From 013a1248a3338144799e4dc32ffc4bec9aa5b9f8 Mon Sep 17 00:00:00 2001 From: Yngrid Coello Date: Tue, 28 Jan 2025 19:34:05 +0100 Subject: [PATCH 01/26] [Logs] Manual migration for routes with access tags (#208484) Relates to https://github.com/elastic/kibana-team/issues/1235. --- ## Team: `@elastic/obs-ux-logs-team` | URL | PR | | --- | --- | | `/api/log_entries/highlights` | current PR | | `/api/log_entries/summary` | current PR | | `/api/log_entries/summary_highlights` | current PR | | `/api/infra/log_views/{logViewId}` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_views/{logViewId}` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/results/log_entry_categories` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/results/log_entry_category_datasets` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/results/latest_log_entry_category_datasets_stats` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/results/log_entry_category_examples` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/results/log_entry_anomalies` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/results/log_entry_anomalies_datasets` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/id_formats` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/validation/log_entry_datasets` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/validation/log_entry_rate_indices` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_analysis/results/log_entry_examples` | https://github.com/elastic/kibana/pull/204214 | | `/api/infra/log_alerts/chart_preview_data` | https://github.com/elastic/kibana/pull/204214 | --- .../adapters/framework/kibana_framework_adapter.ts | 11 +++++------ .../adapters/framework/kibana_framework_adapter.ts | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/x-pack/platform/plugins/shared/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/platform/plugins/shared/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts index 413ab3b333e82..ca635642f3462 100644 --- a/x-pack/platform/plugins/shared/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/platform/plugins/shared/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -42,15 +42,14 @@ export class KibanaFramework { public registerVersionedRoute( config: LogsSharedVersionedRouteConfig ) { - const defaultOptions = { - tags: ['access:infra'], - }; const routeConfig = { access: config.access, path: config.path, - // Currently we have no use of custom options beyond tags, this can be extended - // beyond defaultOptions if it's needed. - options: defaultOptions, + security: { + authz: { + requiredPrivileges: ['infra'], + }, + }, }; switch (config.method) { case 'get': diff --git a/x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts index 4c574db8ac399..dc9d7d10451d5 100644 --- a/x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -76,15 +76,14 @@ export class KibanaFramework { public registerVersionedRoute( config: InfraVersionedRouteConfig ) { - const defaultOptions = { - tags: ['access:infra'], - }; const routeConfig = { access: config.access, path: config.path, - // Currently we have no use of custom options beyond tags, this can be extended - // beyond defaultOptions if it's needed. - options: defaultOptions, + security: { + authz: { + requiredPrivileges: ['infra'], + }, + }, }; switch (config.method) { case 'get': From 67cf170a24c056b743b5fae229ff05f86913cb3d Mon Sep 17 00:00:00 2001 From: Viduni Wickramarachchi Date: Tue, 28 Jan 2025 13:50:18 -0500 Subject: [PATCH 02/26] [Obs AI Assistant] Chat history details in conversation list (#207426) Closes https://github.com/elastic/kibana/issues/176295 ## Summary Categorizes the chat history based on `lastUpdated` date of the conversation. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../src/buttons/new_chat_button.tsx | 2 +- .../src/chat/conversation_list.test.tsx | 204 ++++++++++++++++ .../src/chat/conversation_list.tsx | 176 +++++++------- .../welcome_message_knowledge_base.test.tsx | 1 + .../kbn-ai-assistant/src/hooks/index.ts | 2 + .../hooks/use_conversations_by_date.test.ts | 223 ++++++++++++++++++ .../src/hooks/use_conversations_by_date.ts | 75 ++++++ .../shared/kbn-ai-assistant/src/i18n.ts | 27 +++ .../kbn-ai-assistant/src/utils/date.test.ts | 77 ++++++ .../shared/kbn-ai-assistant/src/utils/date.ts | 22 ++ .../shared/kbn-ai-assistant/tsconfig.json | 1 + .../translations/translations/fr-FR.json | 9 +- .../translations/translations/ja-JP.json | 9 +- .../translations/translations/zh-CN.json | 9 +- 14 files changed, 736 insertions(+), 101 deletions(-) create mode 100644 x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.test.tsx create mode 100644 x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.test.ts create mode 100644 x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.ts create mode 100644 x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.test.ts create mode 100644 x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.ts diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/buttons/new_chat_button.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/buttons/new_chat_button.tsx index 60e37d85b92d9..9435cca062816 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/buttons/new_chat_button.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/buttons/new_chat_button.tsx @@ -24,7 +24,7 @@ export function NewChatButton( ) : ( ({ + useConversationsByDate: jest.fn(), +})); + +jest.mock('../hooks/use_confirm_modal', () => ({ + useConfirmModal: jest.fn().mockReturnValue({ + element:
, + confirm: jest.fn(() => Promise.resolve(true)), + }), +})); + +const mockConversations: UseConversationListResult['conversations'] = { + value: { + conversations: [ + { + conversation: { + id: '1', + title: "Today's Conversation", + last_updated: '2025-01-21T10:00:00Z', + }, + '@timestamp': '2025-01-21T10:00:00Z', + labels: {}, + numeric_labels: {}, + messages: [], + namespace: 'namespace-1', + public: true, + }, + { + conversation: { + id: '2', + title: "Yesterday's Conversation", + last_updated: '2025-01-20T10:00:00Z', + }, + '@timestamp': '2025-01-20T10:00:00Z', + labels: {}, + numeric_labels: {}, + messages: [], + namespace: 'namespace-2', + public: true, + }, + ], + }, + error: undefined, + loading: false, + refresh: jest.fn(), +}; + +const mockCategorizedConversations = { + TODAY: [ + { + id: '1', + label: "Today's Conversation", + lastUpdated: '2025-01-21T10:00:00Z', + href: '/conversation/1', + }, + ], + YESTERDAY: [ + { + id: '2', + label: "Yesterday's Conversation", + lastUpdated: '2025-01-20T10:00:00Z', + href: '/conversation/2', + }, + ], + THIS_WEEK: [], + LAST_WEEK: [], + THIS_MONTH: [], + LAST_MONTH: [], + THIS_YEAR: [], + OLDER: [], +}; + +const defaultProps = { + conversations: mockConversations, + isLoading: false, + selectedConversationId: undefined, + onConversationSelect: jest.fn(), + onConversationDeleteClick: jest.fn(), + newConversationHref: '/conversation/new', + getConversationHref: (id: string) => `/conversation/${id}`, +}; + +describe('ConversationList', () => { + beforeEach(() => { + jest.clearAllMocks(); + (useConversationsByDate as jest.Mock).mockReturnValue(mockCategorizedConversations); + }); + + it('renders the component without errors', () => { + render(); + + const todayCategoryLabel = screen.getByText(/today/i, { + selector: 'div.euiText', + }); + expect(todayCategoryLabel).toBeInTheDocument(); + + const yesterdayCategoryLabel = screen.getByText(/yesterday/i, { + selector: 'div.euiText', + }); + expect(yesterdayCategoryLabel).toBeInTheDocument(); + + expect(screen.queryByRole('progressbar')).not.toBeInTheDocument(); + expect( + screen.queryByText( + i18n.translate('xpack.aiAssistant.conversationList.errorMessage', { + defaultMessage: 'Failed to load', + }) + ) + ).not.toBeInTheDocument(); + + expect( + screen.queryByText( + i18n.translate('xpack.aiAssistant.conversationList.noConversations', { + defaultMessage: 'No conversations', + }) + ) + ).not.toBeInTheDocument(); + + expect(screen.getByTestId('observabilityAiAssistantNewChatButton')).toBeInTheDocument(); + }); + + it('displays loading state', () => { + render(); + expect(screen.getByRole('progressbar')).toBeInTheDocument(); + }); + + it('displays error state', () => { + const errorProps = { + ...defaultProps, + conversations: { ...mockConversations, error: new Error('An error occurred') }, + }; + render(); + expect( + screen.getByText( + i18n.translate('xpack.aiAssistant.conversationList.errorMessage', { + defaultMessage: 'Failed to load', + }) + ) + ).toBeInTheDocument(); + }); + + it('renders categorized conversations', () => { + render(); + Object.entries(mockCategorizedConversations).forEach(([category, conversationList]) => { + if (conversationList.length > 0) { + expect(screen.getByText(DATE_CATEGORY_LABELS[category])).toBeInTheDocument(); + conversationList.forEach((conversation) => { + expect(screen.getByText(conversation.label)).toBeInTheDocument(); + }); + } + }); + }); + + it('calls onConversationSelect when a conversation is clicked', () => { + render(); + const todayConversation = screen.getByText("Today's Conversation"); + fireEvent.click(todayConversation); + expect(defaultProps.onConversationSelect).toHaveBeenCalledWith('1'); + }); + + it('calls onConversationDeleteClick when delete icon is clicked', async () => { + render(); + const deleteButtons = screen.getAllByLabelText('Delete'); + await fireEvent.click(deleteButtons[0]); + expect(defaultProps.onConversationDeleteClick).toHaveBeenCalledWith('1'); + }); + + it('renders a new chat button and triggers onConversationSelect when clicked', () => { + render(); + const newChatButton = screen.getByTestId('observabilityAiAssistantNewChatButton'); + fireEvent.click(newChatButton); + expect(defaultProps.onConversationSelect).toHaveBeenCalledWith(undefined); + }); + + it('renders "no conversations" message when there are no conversations', () => { + const emptyProps = { + ...defaultProps, + conversations: { ...mockConversations, value: { conversations: [] } }, + }; + render(); + expect( + screen.getByText( + i18n.translate('xpack.aiAssistant.conversationList.noConversations', { + defaultMessage: 'No conversations', + }) + ) + ).toBeInTheDocument(); + }); +}); diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx index e4a7022edc763..0b634f8ee9f7f 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/conversation_list.tsx @@ -21,15 +21,11 @@ import { import { css } from '@emotion/css'; import { i18n } from '@kbn/i18n'; import React, { MouseEvent } from 'react'; -import { useConfirmModal } from '../hooks/use_confirm_modal'; import type { UseConversationListResult } from '../hooks/use_conversation_list'; -import { EMPTY_CONVERSATION_TITLE } from '../i18n'; +import { useConfirmModal, useConversationsByDate } from '../hooks'; +import { DATE_CATEGORY_LABELS } from '../i18n'; import { NewChatButton } from '../buttons/new_chat_button'; -const titleClassName = css` - text-transform: uppercase; -`; - const panelClassName = css` max-height: 100%; padding-top: 56px; @@ -70,6 +66,11 @@ export function ConversationList({ padding: ${euiTheme.euiTheme.size.s}; `; + const titleClassName = css` + text-transform: uppercase; + font-weight: ${euiTheme.euiTheme.font.weight.bold}; + `; + const { element: confirmDeleteElement, confirm: confirmDeleteCallback } = useConfirmModal({ title: i18n.translate('xpack.aiAssistant.flyout.confirmDeleteConversationTitle', { defaultMessage: 'Delete this conversation?', @@ -82,24 +83,21 @@ export function ConversationList({ }), }); - const displayedConversations = [ - ...(!selectedConversationId - ? [ - { - id: '', - label: EMPTY_CONVERSATION_TITLE, - lastUpdated: '', - href: newConversationHref, - }, - ] - : []), - ...(conversations.value?.conversations ?? []).map(({ conversation }) => ({ - id: conversation.id, - label: conversation.title, - lastUpdated: conversation.last_updated, - href: getConversationHref ? getConversationHref(conversation.id) : undefined, - })), - ]; + // Categorize conversations by date + const conversationsCategorizedByDate = useConversationsByDate( + conversations.value?.conversations, + getConversationHref + ); + + const onClickConversation = ( + e: MouseEvent | MouseEvent, + conversationId?: string + ) => { + if (onConversationSelect) { + e.preventDefault(); + onConversationSelect(conversationId); + } + }; return ( <> @@ -107,27 +105,17 @@ export function ConversationList({ - - - - - - - - {i18n.translate('xpack.aiAssistant.conversationList.title', { - defaultMessage: 'Previously', - })} - - - - {isLoading ? ( + {isLoading ? ( + + + - ) : null} - - - + + + + ) : null} {conversations.error ? ( @@ -148,55 +136,56 @@ export function ConversationList({ ) : null} - {displayedConversations?.length ? ( - - - {displayedConversations?.map((conversation) => ( - { - if (onConversationSelect) { - event.preventDefault(); - onConversationSelect(conversation.id); - } - }} - extraAction={ - conversation.id - ? { - iconType: 'trash', - 'aria-label': i18n.translate( - 'xpack.aiAssistant.conversationList.deleteConversationIconLabel', - { - defaultMessage: 'Delete', - } - ), - onClick: () => { - confirmDeleteCallback().then((confirmed) => { - if (!confirmed) { - return; - } - - onConversationDeleteClick(conversation.id); - }); - }, + {/* Render conversations categorized by date */} + {Object.entries(conversationsCategorizedByDate).map(([category, conversationList]) => + conversationList.length ? ( + + + + {i18n.translate('xpack.aiAssistant.conversationList.dateGroup', { + defaultMessage: DATE_CATEGORY_LABELS[category], + })} + + + + {conversationList.map((conversation) => ( + onClickConversation(event, conversation.id)} + extraAction={{ + iconType: 'trash', + 'aria-label': i18n.translate( + 'xpack.aiAssistant.conversationList.deleteConversationIconLabel', + { + defaultMessage: 'Delete', } - : undefined - } - /> - ))} - - - ) : null} + ), + onClick: () => { + confirmDeleteCallback().then((confirmed) => { + if (!confirmed) { + return; + } + onConversationDeleteClick(conversation.id); + }); + }, + }} + /> + ))} + + + + ) : null + )} - {!isLoading && !conversations.error && !displayedConversations?.length ? ( + {!isLoading && !conversations.error && !conversations.value?.conversations?.length ? ( {i18n.translate('xpack.aiAssistant.conversationList.noConversations', { @@ -214,14 +203,7 @@ export function ConversationList({ | MouseEvent - ) => { - if (onConversationSelect) { - event.preventDefault(); - onConversationSelect(undefined); - } - }} + onClick={(event) => onClickConversation(event)} /> diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/welcome_message_knowledge_base.test.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/welcome_message_knowledge_base.test.tsx index f5fe599946fde..db29938ee6262 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/welcome_message_knowledge_base.test.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/welcome_message_knowledge_base.test.tsx @@ -15,6 +15,7 @@ describe('WelcomeMessageKnowledgeBase', () => { afterEach(() => { jest.clearAllMocks(); }); + function createMockKnowledgeBase( partial: Partial = {} ): UseKnowledgeBaseResult { diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/index.ts b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/index.ts index a879bbecdfd40..8826917597d0b 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/index.ts +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/index.ts @@ -10,3 +10,5 @@ export * from './use_ai_assistant_chat_service'; export * from './use_knowledge_base'; export * from './use_scopes'; export * from './use_genai_connectors'; +export * from './use_confirm_modal'; +export * from './use_conversations_by_date'; diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.test.ts b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.test.ts new file mode 100644 index 0000000000000..bbb8456c604a7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.test.ts @@ -0,0 +1,223 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { renderHook } from '@testing-library/react'; +import { useConversationsByDate } from './use_conversations_by_date'; +import { getAbsoluteTime, isValidDateMath } from '../utils/date'; +import { Conversation } from '@kbn/observability-ai-assistant-plugin/common'; + +jest.mock('../utils/date', () => ({ + getAbsoluteTime: jest.fn(), + isValidDateMath: jest.fn(), +})); + +const getDisplayedConversation = (conversation: Conversation) => { + return { + id: conversation.conversation.id, + label: conversation.conversation.title, + lastUpdated: conversation.conversation.last_updated, + href: `/conversation/${conversation.conversation.id}`, + }; +}; + +describe('useConversationsByDate', () => { + const startOfToday = new Date('2025-01-21T00:00:00Z').valueOf(); + const startOfYesterday = new Date('2025-01-20T00:00:00Z').valueOf(); + const startOfThisWeek = new Date('2025-01-19T00:00:00Z').valueOf(); + const startOfLastWeek = new Date('2025-01-12T00:00:00Z').valueOf(); + const startOfThisMonth = new Date('2025-01-01T00:00:00Z').valueOf(); + const startOfLastMonth = new Date('2024-12-01T00:00:00Z').valueOf(); + const startOfThisYear = new Date('2025-01-01T00:00:00Z').valueOf(); + + beforeEach(() => { + jest.clearAllMocks(); + jest.useFakeTimers(); + + (getAbsoluteTime as jest.Mock).mockImplementation((range: string) => { + switch (range) { + case 'now/d': + return startOfToday; + case 'now-1d/d': + return startOfYesterday; + case 'now/w': + return startOfThisWeek; + case 'now-1w/w': + return startOfLastWeek; + case 'now/M': + return startOfThisMonth; + case 'now-1M/M': + return startOfLastMonth; + case 'now/y': + return startOfThisYear; + default: + return undefined; + } + }); + + (isValidDateMath as jest.Mock).mockImplementation((value: string) => { + const validTimestamps = [ + new Date(startOfToday + 5 * 60 * 60 * 1000).toISOString(), + new Date(startOfYesterday + 5 * 60 * 60 * 1000).toISOString(), + new Date(startOfLastWeek + 5 * 60 * 60 * 1000).toISOString(), + new Date(startOfLastMonth + 5 * 60 * 60 * 1000).toISOString(), + '2024-05-01T10:00:00Z', + ]; + return validTimestamps.includes(value); + }); + }); + + afterAll(() => { + jest.useRealTimers(); + }); + + const mockConversations = [ + { + conversation: { + id: '1', + title: `Today's Conversation`, + last_updated: new Date(startOfToday + 5 * 60 * 60 * 1000).toISOString(), + }, + '@timestamp': new Date(startOfToday + 5 * 60 * 60 * 1000).toISOString(), + labels: {}, + numeric_labels: {}, + messages: [], + namespace: 'namespace-1', + public: true, + }, + { + conversation: { + id: '2', + title: `Yesterday's Conversation`, + last_updated: new Date(startOfYesterday + 5 * 60 * 60 * 1000).toISOString(), + }, + '@timestamp': new Date(startOfYesterday + 5 * 60 * 60 * 1000).toISOString(), + labels: {}, + numeric_labels: {}, + messages: [], + namespace: 'namespace-2', + public: true, + }, + { + conversation: { + id: '3', + title: `Last Week's Conversation`, + last_updated: new Date(startOfLastWeek + 5 * 60 * 60 * 1000).toISOString(), + }, + '@timestamp': new Date(startOfLastWeek + 5 * 60 * 60 * 1000).toISOString(), + labels: {}, + numeric_labels: {}, + messages: [], + namespace: 'namespace-3', + public: true, + }, + { + conversation: { + id: '4', + title: 'Older Conversation', + last_updated: '2024-05-01T10:00:00Z', + }, + '@timestamp': '2024-05-01T10:00:00Z', + labels: {}, + numeric_labels: {}, + messages: [], + namespace: 'namespace-4', + public: true, + }, + ]; + + it('categorizes conversations by date', () => { + const { result } = renderHook(() => + useConversationsByDate(mockConversations, (id) => `/conversation/${id}`) + ); + + expect(result.current).toEqual({ + TODAY: [getDisplayedConversation(mockConversations[0])], + YESTERDAY: [getDisplayedConversation(mockConversations[1])], + THIS_WEEK: [], + LAST_WEEK: [getDisplayedConversation(mockConversations[2])], + THIS_MONTH: [], + LAST_MONTH: [], + THIS_YEAR: [], + OLDER: [getDisplayedConversation(mockConversations[3])], + }); + }); + + it('handles invalid timestamps gracefully', () => { + const invalidConversations = [ + { + ...mockConversations[0], + conversation: { id: '5', title: 'Invalid Timestamp', last_updated: 'invalid-date' }, + }, + ]; + + const { result } = renderHook(() => useConversationsByDate(invalidConversations)); + + expect(result.current).toEqual({ + TODAY: [], + YESTERDAY: [], + THIS_WEEK: [], + LAST_WEEK: [], + THIS_MONTH: [], + LAST_MONTH: [], + THIS_YEAR: [], + OLDER: [], + }); + }); + + it('handles undefined timestamps in conversations', () => { + const undefinedTimestampConversations = [ + { + ...mockConversations[0], + conversation: { id: '6', title: 'No Timestamp', last_updated: undefined }, + }, + ]; + + // @ts-expect-error date is forced to be undefined for testing purposes + const { result } = renderHook(() => useConversationsByDate(undefinedTimestampConversations)); + + expect(result.current).toEqual({ + TODAY: [], + YESTERDAY: [], + THIS_WEEK: [], + LAST_WEEK: [], + THIS_MONTH: [], + LAST_MONTH: [], + THIS_YEAR: [], + OLDER: [], + }); + }); + + it('handles undefined conversations input gracefully', () => { + const { result } = renderHook(() => useConversationsByDate(undefined)); + + expect(result.current).toEqual({ + TODAY: [], + YESTERDAY: [], + THIS_WEEK: [], + LAST_WEEK: [], + THIS_MONTH: [], + LAST_MONTH: [], + THIS_YEAR: [], + OLDER: [], + }); + }); + + it('returns empty categories when no conversations are provided', () => { + const { result } = renderHook(() => useConversationsByDate([])); + + expect(result.current).toEqual({ + TODAY: [], + YESTERDAY: [], + THIS_WEEK: [], + LAST_WEEK: [], + THIS_MONTH: [], + LAST_MONTH: [], + THIS_YEAR: [], + OLDER: [], + }); + }); +}); diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.ts b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.ts new file mode 100644 index 0000000000000..cc7e7927f381d --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/hooks/use_conversations_by_date.ts @@ -0,0 +1,75 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useMemo } from 'react'; +import { type Conversation } from '@kbn/observability-ai-assistant-plugin/public'; +import { getAbsoluteTime, isValidDateMath } from '../utils/date'; + +export function useConversationsByDate( + conversations: Conversation[] = [], + getConversationHref?: (id: string) => string +) { + return useMemo(() => { + const now = new Date(); + + const startOfToday = getAbsoluteTime('now/d', { forceNow: now }) ?? 0; + const startOfYesterday = getAbsoluteTime('now-1d/d', { forceNow: now }) ?? 0; + const startOfThisWeek = getAbsoluteTime('now/w', { forceNow: now }) ?? 0; + const startOfLastWeek = getAbsoluteTime('now-1w/w', { forceNow: now }) ?? 0; + const startOfThisMonth = getAbsoluteTime('now/M', { forceNow: now }) ?? 0; + const startOfLastMonth = getAbsoluteTime('now-1M/M', { forceNow: now }) ?? 0; + const startOfThisYear = getAbsoluteTime('now/y', { forceNow: now }) ?? 0; + + const categorizedConversations: Record< + string, + Array<{ id: string; label: string; lastUpdated: string; href?: string }> + > = { + TODAY: [], + YESTERDAY: [], + THIS_WEEK: [], + LAST_WEEK: [], + THIS_MONTH: [], + LAST_MONTH: [], + THIS_YEAR: [], + OLDER: [], + }; + + conversations.forEach((conversation) => { + if (!isValidDateMath(conversation.conversation.last_updated)) { + return; + } + + const lastUpdated = new Date(conversation.conversation.last_updated).valueOf(); + const displayedConversation = { + id: conversation.conversation.id, + label: conversation.conversation.title, + lastUpdated: conversation.conversation.last_updated, + href: getConversationHref ? getConversationHref(conversation.conversation.id) : undefined, + }; + + if (lastUpdated >= startOfToday) { + categorizedConversations.TODAY.push(displayedConversation); + } else if (lastUpdated >= startOfYesterday) { + categorizedConversations.YESTERDAY.push(displayedConversation); + } else if (lastUpdated >= startOfThisWeek) { + categorizedConversations.THIS_WEEK.push(displayedConversation); + } else if (lastUpdated >= startOfLastWeek) { + categorizedConversations.LAST_WEEK.push(displayedConversation); + } else if (lastUpdated >= startOfThisMonth) { + categorizedConversations.THIS_MONTH.push(displayedConversation); + } else if (lastUpdated >= startOfLastMonth) { + categorizedConversations.LAST_MONTH.push(displayedConversation); + } else if (lastUpdated >= startOfThisYear) { + categorizedConversations.THIS_YEAR.push(displayedConversation); + } else { + categorizedConversations.OLDER.push(displayedConversation); + } + }); + + return categorizedConversations; + }, [conversations, getConversationHref]); +} diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/i18n.ts b/x-pack/platform/packages/shared/kbn-ai-assistant/src/i18n.ts index 5c5be1633a07a..cdfdb01ab2da3 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/i18n.ts +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/i18n.ts @@ -18,3 +18,30 @@ export const EMPTY_CONVERSATION_TITLE = i18n.translate('xpack.aiAssistant.emptyC export const UPGRADE_LICENSE_TITLE = i18n.translate('xpack.aiAssistant.incorrectLicense.title', { defaultMessage: 'Upgrade your license', }); + +export const DATE_CATEGORY_LABELS: Record = { + TODAY: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.today', { + defaultMessage: 'Today', + }), + YESTERDAY: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.yesterday', { + defaultMessage: 'Yesterday', + }), + THIS_WEEK: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.thisWeek', { + defaultMessage: 'This Week', + }), + LAST_WEEK: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.lastWeek', { + defaultMessage: 'Last Week', + }), + THIS_MONTH: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.thisMonth', { + defaultMessage: 'This Month', + }), + LAST_MONTH: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.lastMonth', { + defaultMessage: 'Last Month', + }), + THIS_YEAR: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.thisYear', { + defaultMessage: 'This Year', + }), + OLDER: i18n.translate('xpack.aiAssistant.conversationList.dateGroupTitle.older', { + defaultMessage: 'Older', + }), +}; diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.test.ts b/x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.test.ts new file mode 100644 index 0000000000000..ce10579fcef48 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.test.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import datemath from '@kbn/datemath'; +import moment from 'moment'; +import { getAbsoluteTime, isValidDateMath } from './date'; + +describe('getAbsoluteTime', () => { + let parseSpy: jest.SpyInstance; + + beforeEach(() => { + jest.clearAllMocks(); + + parseSpy = jest + .spyOn(datemath, 'parse') + .mockImplementation((range: string, opts: { forceNow?: Date; roundUp?: boolean } = {}) => { + switch (range) { + case 'now/d': + return moment(opts.roundUp ? '2025-01-20T23:59:59Z' : '2025-01-20T00:00:00Z'); + default: + return undefined; + } + }); + }); + + it('returns the absolute timestamp for a valid relative range (e.g., now/d)', () => { + const startOfToday = new Date('2025-01-20T00:00:00Z').valueOf(); + + const result = getAbsoluteTime('now/d'); + expect(result).toEqual(startOfToday); + }); + + it('respects the options passed to datemath.parse (e.g., roundUp)', () => { + const endOfToday = new Date('2025-01-20T23:59:59Z').valueOf(); + + const result = getAbsoluteTime('now/d', { roundUp: true }); + expect(result).toEqual(endOfToday); + }); + + it('returns undefined for an invalid range', () => { + const result = getAbsoluteTime('invalid-range'); + expect(result).toBeUndefined(); + }); + + it('handles undefined input gracefully', () => { + const result = getAbsoluteTime(''); + expect(result).toBeUndefined(); + }); + + afterEach(() => { + parseSpy.mockRestore(); + }); +}); + +describe('isValidDateMath', () => { + it('Returns `false` for empty strings', () => { + expect(isValidDateMath('')).toBe(false); + }); + + it('Returns `false` for invalid strings', () => { + expect(isValidDateMath('wadus')).toBe(false); + expect(isValidDateMath('nowww-')).toBe(false); + expect(isValidDateMath('now-')).toBe(false); + expect(isValidDateMath('now-1')).toBe(false); + expect(isValidDateMath('now-1d/')).toBe(false); + }); + + it('Returns `true` for valid strings', () => { + expect(isValidDateMath('now')).toBe(true); + expect(isValidDateMath('now/d')).toBe(true); + expect(isValidDateMath('now-1d')).toBe(true); + expect(isValidDateMath('now-1d/d')).toBe(true); + }); +}); diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.ts b/x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.ts new file mode 100644 index 0000000000000..f8b280c1aefb7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/utils/date.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 datemath from '@kbn/datemath'; + +export const getAbsoluteTime = (range: string, opts: Parameters[1] = {}) => { + const parsed = datemath.parse(range, opts); + + if (parsed && parsed.isValid()) { + return parsed.valueOf(); + } + + return undefined; +}; + +export const isValidDateMath = (value: string): boolean => { + const parsedValue = datemath.parse(value); + return !!(parsedValue && parsedValue.isValid()); +}; diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/tsconfig.json b/x-pack/platform/packages/shared/kbn-ai-assistant/tsconfig.json index 1822c6370f7bf..5a99bebb724a5 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/tsconfig.json +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/tsconfig.json @@ -40,5 +40,6 @@ "@kbn/inference-common", "@kbn/storybook", "@kbn/ai-assistant-icon", + "@kbn/datemath", ] } 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 0dc3d5be9969e..8d44380617b5b 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -9772,7 +9772,14 @@ "xpack.aiAssistant.conversationList.deleteConversationIconLabel": "Supprimer", "xpack.aiAssistant.conversationList.errorMessage": "Échec de chargement", "xpack.aiAssistant.conversationList.noConversations": "Aucune conversation", - "xpack.aiAssistant.conversationList.title": "Précédemment", + "xpack.aiAssistant.conversationList.dateGroupTitle.today": "Aujourd'hui", + "xpack.aiAssistant.conversationList.dateGroupTitle.yesterday": "Hier", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisWeek": "Cette semaine", + "xpack.aiAssistant.conversationList.dateGroupTitle.lastWeek": "La semaine dernière", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisMonth": "Ce mois-ci", + "xpack.aiAssistant.conversationList.dateGroupTitle.lastMonth": "Le mois dernier", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisYear": "Cette année", + "xpack.aiAssistant.conversationList.dateGroupTitle.older": "Plus ancien", "xpack.aiAssistant.conversationStartTitle": "a démarré une conversation", "xpack.aiAssistant.couldNotFindConversationContent": "Impossible de trouver une conversation avec l'ID {conversationId}. Assurez-vous que la conversation existe et que vous y avez accès.", "xpack.aiAssistant.couldNotFindConversationTitle": "Conversation introuvable", 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 d1091d8a558ca..7058c369c5404 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -9648,7 +9648,14 @@ "xpack.aiAssistant.conversationList.deleteConversationIconLabel": "削除", "xpack.aiAssistant.conversationList.errorMessage": "の読み込みに失敗しました", "xpack.aiAssistant.conversationList.noConversations": "会話なし", - "xpack.aiAssistant.conversationList.title": "以前", + "xpack.aiAssistant.conversationList.dateGroupTitle.today": "今日", + "xpack.aiAssistant.conversationList.dateGroupTitle.yesterday": "昨日", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisWeek": "今週", + "xpack.aiAssistant.conversationList.dateGroupTitle.lastWeek": "先週", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisMonth": "今月", + "xpack.aiAssistant.conversationList.dateGroupTitle.lastMonth": "先月", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisYear": "今年", + "xpack.aiAssistant.conversationList.dateGroupTitle.older": "以前", "xpack.aiAssistant.conversationStartTitle": "会話を開始しました", "xpack.aiAssistant.couldNotFindConversationContent": "id {conversationId}の会話が見つかりませんでした。会話が存在し、それにアクセスできることを確認してください。", "xpack.aiAssistant.couldNotFindConversationTitle": "会話が見つかりません", 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 b9cee03f0d919..48421acdfe1d9 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -9492,7 +9492,14 @@ "xpack.aiAssistant.conversationList.deleteConversationIconLabel": "删除", "xpack.aiAssistant.conversationList.errorMessage": "无法加载", "xpack.aiAssistant.conversationList.noConversations": "无对话", - "xpack.aiAssistant.conversationList.title": "以前", + "xpack.aiAssistant.conversationList.dateGroupTitle.today": "今天", + "xpack.aiAssistant.conversationList.dateGroupTitle.yesterday": "昨天", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisWeek": "本周", + "xpack.aiAssistant.conversationList.dateGroupTitle.lastWeek": "上周", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisMonth": "本月", + "xpack.aiAssistant.conversationList.dateGroupTitle.lastMonth": "上月", + "xpack.aiAssistant.conversationList.dateGroupTitle.thisYear": "今年", + "xpack.aiAssistant.conversationList.dateGroupTitle.older": "更早", "xpack.aiAssistant.conversationStartTitle": "已开始对话", "xpack.aiAssistant.couldNotFindConversationContent": "找不到 ID 为 {conversationId} 的对话。请确保该对话存在并且您具有访问权限。", "xpack.aiAssistant.couldNotFindConversationTitle": "未找到对话", From 04676b2e7417717c3f5030c1ea87d1575a2753d5 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Tue, 28 Jan 2025 10:50:36 -0800 Subject: [PATCH 03/26] Fixed Cypress tests to exclude internal inference connectors from delete connectors tests (#208546) --- .../shared/fleet/cypress/tasks/api_calls/connectors.ts | 6 +++++- .../cypress/tasks/api_calls/common.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/x-pack/platform/plugins/shared/fleet/cypress/tasks/api_calls/connectors.ts b/x-pack/platform/plugins/shared/fleet/cypress/tasks/api_calls/connectors.ts index 230fdcd124562..753b3810e84b9 100644 --- a/x-pack/platform/plugins/shared/fleet/cypress/tasks/api_calls/connectors.ts +++ b/x-pack/platform/plugins/shared/fleet/cypress/tasks/api_calls/connectors.ts @@ -25,6 +25,7 @@ export const request = ({ ...options, }); }; +export const INTERNAL_INFERENCE_CONNECTORS = ['Elastic-Inference-Rainbow-Sprinkles']; export const INTERNAL_CLOUD_CONNECTORS = ['Elastic-Cloud-SMTP']; export const getConnectors = () => @@ -48,7 +49,10 @@ export const deleteConnectors = () => { return connector.id; }); ids.forEach((id) => { - if (!INTERNAL_CLOUD_CONNECTORS.includes(id)) { + if ( + !INTERNAL_CLOUD_CONNECTORS.includes(id) && + !INTERNAL_INFERENCE_CONNECTORS.includes(id) + ) { request({ method: 'DELETE', url: `api/actions/connector/${id}`, diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts index 480d97bf35979..76a85c4c28314 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts @@ -26,6 +26,7 @@ export const API_HEADERS = Object.freeze({ }); export const INTERNAL_CLOUD_CONNECTORS = ['Elastic-Cloud-SMTP']; +export const INTERNAL_INFERENCE_CONNECTORS = ['Elastic-Inference-Rainbow-Sprinkles']; export const rootRequest = ({ headers: optionHeaders = {}, @@ -105,7 +106,10 @@ export const deleteConnectors = () => { return connector.id; }); ids.forEach((id) => { - if (!INTERNAL_CLOUD_CONNECTORS.includes(id)) { + if ( + !INTERNAL_CLOUD_CONNECTORS.includes(id) && + !INTERNAL_INFERENCE_CONNECTORS.includes(id) + ) { rootRequest({ method: 'DELETE', url: spaceId From 74ec59f332d9b9b63fbc90427eba14bd18fe9521 Mon Sep 17 00:00:00 2001 From: Thom Heymann <190132+thomheymann@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:51:00 +0000 Subject: [PATCH 04/26] Promote solutions view in Discover top nav (#208320) Resolves #204971 ## Summary Displays badge in Discover top nav to promote solutions view. ## Screenshot Screenshot 2025-01-27 at 09 13 38 --- .../plugins/shared/discover/kibana.jsonc | 4 +- .../top_nav/get_top_nav_badges.test.ts | 24 ++++ .../components/top_nav/get_top_nav_badges.tsx | 11 ++ .../top_nav/solutions_view_badge.test.tsx | 117 ++++++++++++++++++ .../top_nav/solutions_view_badge.tsx | 109 ++++++++++++++++ 5 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.test.tsx create mode 100644 src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.tsx diff --git a/src/platform/plugins/shared/discover/kibana.jsonc b/src/platform/plugins/shared/discover/kibana.jsonc index 55adf229aa676..d64f48f59ba4a 100644 --- a/src/platform/plugins/shared/discover/kibana.jsonc +++ b/src/platform/plugins/shared/discover/kibana.jsonc @@ -48,7 +48,7 @@ "observabilityAIAssistant", "aiops", "fieldsMetadata", - "logsDataAccess", + "logsDataAccess" ], "requiredBundles": [ "kibanaUtils", @@ -60,4 +60,4 @@ "common" ] } -} +} \ No newline at end of file diff --git a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.test.ts b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.test.ts index d6374affe0f61..790e6f94f616b 100644 --- a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.test.ts +++ b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.test.ts @@ -13,6 +13,7 @@ import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock' import { savedSearchMock } from '../../../../__mocks__/saved_search'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { spacesPluginMock } from '@kbn/spaces-plugin/public/mocks'; const stateContainer = getDiscoverStateMock({ isTimeBased: true }); const discoverServiceMock = createDiscoverServicesMock(); @@ -128,4 +129,27 @@ describe('getTopNavBadges()', function () { }); expect(topNavBadges).toMatchInlineSnapshot(`Array []`); }); + + describe('solutions view badge', () => { + const discoverServiceWithSpacesMock = createDiscoverServicesMock(); + discoverServiceWithSpacesMock.capabilities.discover.save = true; + discoverServiceWithSpacesMock.spaces = spacesPluginMock.createStartContract(); + + test('should return the solutions view badge when spaces is enabled', () => { + const topNavBadges = getTopNavBadges({ + hasUnsavedChanges: false, + services: discoverServiceWithSpacesMock, + stateContainer, + topNavCustomization: undefined, + }); + expect(topNavBadges).toMatchInlineSnapshot(` + Array [ + Object { + "badgeText": "Check out context-aware Discover", + "renderCustomBadge": [Function], + }, + ] + `); + }); + }); }); diff --git a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx index 9d6a3c8a9912a..5e192275bb204 100644 --- a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx +++ b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx @@ -7,6 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import React from 'react'; import type { TopNavMenuBadgeProps } from '@kbn/navigation-plugin/public'; import { getTopNavUnsavedChangesBadge } from '@kbn/unsaved-changes-badge'; import { getManagedContentBadge } from '@kbn/managed-content-badge'; @@ -16,6 +17,7 @@ import { DiscoverStateContainer } from '../../state_management/discover_state'; import type { TopNavCustomization } from '../../../../customizations'; import { onSaveSearch } from './on_save_search'; import { DiscoverServices } from '../../../../build_services'; +import { SolutionsViewBadge } from './solutions_view_badge'; /** * Helper function to build the top nav badges @@ -44,6 +46,15 @@ export const getTopNavBadges = ({ const isManaged = stateContainer.savedSearchState.getState().managed; + if (services.spaces) { + entries.push({ + badgeText: i18n.translate('discover.topNav.solutionViewTitle', { + defaultMessage: 'Check out context-aware Discover', + }), + renderCustomBadge: ({ badgeText }) => , + }); + } + if (hasUnsavedChanges && !defaultBadges?.unsavedChangesBadge?.disabled) { entries.push( getTopNavUnsavedChangesBadge({ diff --git a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.test.tsx b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.test.tsx new file mode 100644 index 0000000000000..06a668f0e492a --- /dev/null +++ b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.test.tsx @@ -0,0 +1,117 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { of } from 'rxjs'; +import { SolutionsViewBadge } from './solutions_view_badge'; +import { render } from '@testing-library/react'; +import { useDiscoverServices } from '../../../../hooks/use_discover_services'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; + +jest.mock('../../../../hooks/use_discover_services'); + +const useDiscoverServicesMock = useDiscoverServices as jest.Mock; + +describe('SolutionsViewBadge', () => { + test('renders badge', async () => { + useDiscoverServicesMock.mockReturnValue({ + spaces: { + getActiveSpace$: jest.fn().mockReturnValue( + of({ + id: 'default', + solution: 'classic', + }) + ), + isSolutionViewEnabled: true, + }, + docLinks: { ELASTIC_WEBSITE_URL: 'https://www.elastic.co' }, + addBasePath: (path: string) => path, + capabilities: { spaces: { manage: true } }, + }); + + const { container, findByTitle, findByRole } = render( + + + + ); + expect(container).not.toBeEmptyDOMElement(); + + const button = await findByTitle('Toggle popover'); + await button.click(); + const dialog = await findByRole('dialog'); + expect(dialog).not.toBeEmptyDOMElement(); + }); + + test('does not render badge when active space is already configured to use a solution view other than "classic"', async () => { + useDiscoverServicesMock.mockReturnValue({ + spaces: { + getActiveSpace$: jest.fn().mockReturnValue( + of({ + id: 'default', + solution: 'oblt', + }) + ), + isSolutionViewEnabled: true, + }, + docLinks: { ELASTIC_WEBSITE_URL: 'https://www.elastic.co' }, + addBasePath: (path: string) => path, + capabilities: { spaces: { manage: true } }, + }); + + const { container } = render( + + + + ); + expect(container).toBeEmptyDOMElement(); + }); + + test('does not render badge when spaces is disabled (no active space available)', async () => { + useDiscoverServicesMock.mockReturnValue({ + spaces: { + getActiveSpace$: jest.fn().mockReturnValue(of(undefined)), + isSolutionViewEnabled: true, + }, + docLinks: { ELASTIC_WEBSITE_URL: 'https://www.elastic.co' }, + addBasePath: (path: string) => path, + capabilities: { spaces: { manage: true } }, + }); + + const { container } = render( + + + + ); + expect(container).toBeEmptyDOMElement(); + }); + + test('does not render badge when solution visibility feature is disabled', async () => { + useDiscoverServicesMock.mockReturnValue({ + spaces: { + getActiveSpace$: jest.fn().mockReturnValue( + of({ + id: 'default', + solution: 'classic', + }) + ), + isSolutionViewEnabled: false, + }, + docLinks: { ELASTIC_WEBSITE_URL: 'https://www.elastic.co' }, + addBasePath: (path: string) => path, + capabilities: { spaces: { manage: true } }, + }); + + const { container } = render( + + + + ); + expect(container).toBeEmptyDOMElement(); + }); +}); diff --git a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.tsx b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.tsx new file mode 100644 index 0000000000000..229589dfbcf65 --- /dev/null +++ b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/solutions_view_badge.tsx @@ -0,0 +1,109 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React, { useState, useMemo, type FunctionComponent } from 'react'; +import { EuiBadge, EuiPopover, EuiPopoverFooter, EuiText, EuiLink } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; +import useObservable from 'react-use/lib/useObservable'; +import { of } from 'rxjs'; +import { useDiscoverServices } from '../../../../hooks/use_discover_services'; + +export const SolutionsViewBadge: FunctionComponent<{ badgeText: string }> = ({ badgeText }) => { + const services = useDiscoverServices(); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const activeSpace$ = useMemo( + () => services.spaces?.getActiveSpace$() ?? of(undefined), + [services.spaces] + ); + const activeSpace = useObservable(activeSpace$); + const canManageSpaces = services.capabilities.spaces?.manage === true; + + // Do not render this component if one of the following conditions is met: + // 1. Solution visibility feature is disabled + // 2. Spaces is disabled (No active space available) + // 3. Active space is already configured to use a solution view other than "classic". + if ( + !services.spaces?.isSolutionViewEnabled || + !activeSpace || + (activeSpace.solution && activeSpace.solution !== 'classic') + ) { + return null; + } + + const onClickAriaLabel = i18n.translate( + 'discover.topNav.solutionsViewBadge.clickToLearnMoreAriaLabel', + { + defaultMessage: 'Click to learn more about the “solution view”', + } + ); + + return ( + setIsPopoverOpen((value) => !value)} + onClickAriaLabel={onClickAriaLabel} + iconOnClick={() => setIsPopoverOpen((value) => !value)} + iconOnClickAriaLabel={onClickAriaLabel} + > + {badgeText} + + } + isOpen={isPopoverOpen} + closePopover={() => setIsPopoverOpen(false)} + panelStyle={{ maxWidth: 300 }} + > + {canManageSpaces ? ( + <> + +

+ +

+
+ + + + + + + ) : ( + <> + + + + + + + + )} +
+ ); +}; From 4f1e5def8ac9d8de61567184d377cf8fe225dcf8 Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Tue, 28 Jan 2025 12:51:39 -0600 Subject: [PATCH 05/26] [ingest pipelines] Manually add privilege check for parse_cvs route / supply Authz content (#206535) ## Summary Closes https://github.com/elastic/kibana/issues/204681 --------- Co-authored-by: Ignacio Rivas Co-authored-by: Elastic Machine --- .../shared/ingest_pipelines/server/plugin.ts | 3 +- .../server/routes/api/parse_csv.ts | 17 +++- .../apis/management/ingest_pipelines/index.ts | 1 + .../management/ingest_pipelines/parse_csv.ts | 84 +++++++++++++++++++ .../ingest_pipelines/pipeline_mappings.ts | 27 ++++++ 5 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 x-pack/test/api_integration/apis/management/ingest_pipelines/parse_csv.ts create mode 100644 x-pack/test/api_integration/apis/management/ingest_pipelines/pipeline_mappings.ts diff --git a/x-pack/platform/plugins/shared/ingest_pipelines/server/plugin.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/plugin.ts index 85ca1691bf392..7aa7634bce31a 100644 --- a/x-pack/platform/plugins/shared/ingest_pipelines/server/plugin.ts +++ b/x-pack/platform/plugins/shared/ingest_pipelines/server/plugin.ts @@ -11,6 +11,7 @@ import { IngestPipelinesConfigType } from './config'; import { ApiRoutes } from './routes'; import { handleEsError } from './shared_imports'; import { Dependencies } from './types'; +import { APP_CLUSTER_REQUIRED_PRIVILEGES } from '../common/constants'; export class IngestPipelinesPlugin implements Plugin { private readonly apiRoutes: ApiRoutes; @@ -32,7 +33,7 @@ export class IngestPipelinesPlugin implements Plugin { privileges: [ { ui: [], - requiredClusterPrivileges: ['manage_pipeline', 'cluster:monitor/nodes/info'], + requiredClusterPrivileges: APP_CLUSTER_REQUIRED_PRIVILEGES, }, ], }); diff --git a/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/parse_csv.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/parse_csv.ts index 43bd94a52c056..d3c1179419bc6 100644 --- a/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/parse_csv.ts +++ b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/parse_csv.ts @@ -7,7 +7,7 @@ import { schema, TypeOf, Type } from '@kbn/config-schema'; -import { API_BASE_PATH } from '../../../common/constants'; +import { API_BASE_PATH, APP_CLUSTER_REQUIRED_PRIVILEGES } from '../../../common/constants'; import { FieldCopyAction } from '../../../common/types'; import { csvToIngestPipeline } from '../../lib'; import { RouteDependencies } from '../../types'; @@ -23,12 +23,27 @@ export const registerParseCsvRoute = ({ router }: RouteDependencies): void => { router.post( { path: `${API_BASE_PATH}/parse_csv`, + security: { + authz: { + enabled: false, + reason: 'Manually implements ES priv check to match mgmt app', + }, + }, validate: { body: bodySchema, }, }, async (contxt, req, res) => { const { file, copyAction } = req.body; + const privResult = await ( + await contxt.core + ).elasticsearch.client.asCurrentUser.security.hasPrivileges({ + // same as privs for ingest pipelines management + cluster: APP_CLUSTER_REQUIRED_PRIVILEGES, + }); + if (!privResult.has_all_requested) { + return res.unauthorized(); + } try { const result = csvToIngestPipeline(file, copyAction); return res.ok({ body: result }); diff --git a/x-pack/test/api_integration/apis/management/ingest_pipelines/index.ts b/x-pack/test/api_integration/apis/management/ingest_pipelines/index.ts index 0afcb720dc3cd..8c81f5d194086 100644 --- a/x-pack/test/api_integration/apis/management/ingest_pipelines/index.ts +++ b/x-pack/test/api_integration/apis/management/ingest_pipelines/index.ts @@ -10,5 +10,6 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('Ingest pipelines', () => { loadTestFile(require.resolve('./databases')); + loadTestFile(require.resolve('./parse_csv')); }); } diff --git a/x-pack/test/api_integration/apis/management/ingest_pipelines/parse_csv.ts b/x-pack/test/api_integration/apis/management/ingest_pipelines/parse_csv.ts new file mode 100644 index 0000000000000..60b225d92c6f5 --- /dev/null +++ b/x-pack/test/api_integration/apis/management/ingest_pipelines/parse_csv.ts @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { pipelineMappings } from './pipeline_mappings'; + +export default function ({ getService }: FtrProviderContext) { + const supertestWithoutAuth = getService('supertestWithoutAuth'); + const security = getService('security'); + const url = `/api/ingest_pipelines/parse_csv`; + + const userName = 'ingest_user'; + const roleName = 'ingest_role'; + + const userName2 = 'ingest_user_no_access'; + const roleName2 = 'ingest_role_no_access'; + + const password = `${userName}-password`; + + describe('parse csv', function () { + before(async () => { + await security.role.create(roleName, { + kibana: [], + elasticsearch: { + cluster: ['manage_pipeline', 'cluster:monitor/nodes/info'], + }, + }); + + await security.user.create(userName, { + password, + roles: [roleName], + }); + + await security.role.create(roleName2, { + kibana: [], + elasticsearch: { + cluster: ['monitor'], + }, + }); + + await security.user.create(userName2, { + password, + roles: [roleName2], + }); + }); + + after(async () => { + await security.role.delete(roleName); + await security.user.delete(userName); + await security.role.delete(roleName2); + await security.user.delete(userName2); + }); + + describe('privs', () => { + it('has access', async () => { + await supertestWithoutAuth + .post(url) + .set('kbn-xsrf', 'xxx') + .auth(userName, password) + .send({ + file: pipelineMappings, + copyAction: 'copy', + }) + .expect(200); + }); + + it('no access', async () => { + await supertestWithoutAuth + .post(url) + .set('kbn-xsrf', 'xxx') + .auth(userName2, password) + .send({ + file: pipelineMappings, + copyAction: 'copy', + }) + .expect(401); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/management/ingest_pipelines/pipeline_mappings.ts b/x-pack/test/api_integration/apis/management/ingest_pipelines/pipeline_mappings.ts new file mode 100644 index 0000000000000..ef1abac760077 --- /dev/null +++ b/x-pack/test/api_integration/apis/management/ingest_pipelines/pipeline_mappings.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const pipelineMappings = `source_field,copy_action,format_action,timestamp_format,destination_field,Notes +srcip,,,,source.address,Copying srcip to source.address +srcip,,,,source.ip,Copying srcip a second time to source.ip as well +new_event.srcip,,,,source.ip,This new event type could also populate source.ip +some_timestamp_field,,parse_timestamp,,@timestamp,Convert this timestamp to UNIX_MS format +some_other_timestamp,,,,@timestamp,Convert this timestamp to default UNIX_MS +some_new_timestamp,,parse_timestamp,UNIX,destination_timestamp,Convert this timestamp to UNIX format +srcport,rename,to_integer,,source.port, +destip,,,,destination.address, +destport,,to_integer,,destination.port, +ts,copy,,,timestamp, +action,rename,lowercase,,event.action, +duration,rename,to_float,,event.duration, +user_agent,rename,,,user_agent.original, +log_level,rename,uppercase,,log.level, +eventid,rename,to_string,,event.id,IDs should be strings! +successful,,to_boolean,,,Format source field to boolean type +hostip,rename,to_array,,host.ip, +process.args,,to_array,,,Format source field to an array +`; From afe24108a25ff6b9199cda5469bb3c2aafd1a986 Mon Sep 17 00:00:00 2001 From: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:54:14 +0000 Subject: [PATCH 06/26] [Security Solution][Detection Engine] fixes FTR tests for synthetic source indices (#208524) ## Summary fixes FTR tests that blocks ES image promotion: https://buildkite.com/elastic/kibana-elasticsearch-snapshot-verify/builds?branch=main I have changed logic to index creation, as suggested in docs https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping-source-field.html#synthetic-source instead using API to change mode --------- Co-authored-by: Tiago Costa --- .../mappings.json | 127 +++++++++++++++++ .../mappings.json | 128 ++++++++++++++++++ .../synthetic_source.ts | 13 +- .../detections_response/utils/index.ts | 1 - .../utils/indices/index.ts | 8 -- .../utils/indices/set_synthetic_source.ts | 17 --- 6 files changed, 258 insertions(+), 36 deletions(-) create mode 100644 x-pack/test/functional/es_archives/security_solution/ecs_compliant_synthetic_source/mappings.json create mode 100644 x-pack/test/functional/es_archives/security_solution/ecs_non_compliant_synthetic_source/mappings.json delete mode 100644 x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/index.ts delete mode 100644 x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/set_synthetic_source.ts diff --git a/x-pack/test/functional/es_archives/security_solution/ecs_compliant_synthetic_source/mappings.json b/x-pack/test/functional/es_archives/security_solution/ecs_compliant_synthetic_source/mappings.json new file mode 100644 index 0000000000000..4e3c7d1de0388 --- /dev/null +++ b/x-pack/test/functional/es_archives/security_solution/ecs_compliant_synthetic_source/mappings.json @@ -0,0 +1,127 @@ +{ + "type": "index", + "value": { + "index": "ecs_compliant_synthetic_source", + "mappings": { + "properties": { + "id": { + "type": "keyword" + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "name": { + "type": "keyword" + }, + "version": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + }, + "observer": { + "properties": { + "os": { + "properties": { + "full": { + "type": "keyword", + "ignore_above": 1024, + "fields": { + "text": { + "type": "match_only_text" + } + } + } + } + } + } + }, + "process": { + "properties": { + "entry_leader": { + "properties": { + "name": { + "type": "keyword", + "ignore_above": 1024, + "fields": { + "text": { + "type": "match_only_text" + }, + "caseless": { + "type": "keyword", + "ignore_above": 1024, + "normalizer": "lowercase" + } + } + } + } + } + } + }, + "host": { + "properties": { + "name": { + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "uptime": { + "type": "long" + } + } + }, + "container": { + "properties": { + "image": { + "type": "keyword" + } + } + }, + "client": { + "properties": { + "ip": { + "type": "keyword" + } + } + }, + "event": { + "properties": { + "ingested": { + "type": "date" + }, + "created": { + "type": "keyword" + } + } + }, + "dll": { + "properties": { + "code_signature": { + "properties": { + "valid": { + "type": "keyword" + } + } + } + } + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1", + "mapping": { + "source": { + "mode": "synthetic" + } + } + } + } + } +} diff --git a/x-pack/test/functional/es_archives/security_solution/ecs_non_compliant_synthetic_source/mappings.json b/x-pack/test/functional/es_archives/security_solution/ecs_non_compliant_synthetic_source/mappings.json new file mode 100644 index 0000000000000..92f59a13f5a4e --- /dev/null +++ b/x-pack/test/functional/es_archives/security_solution/ecs_non_compliant_synthetic_source/mappings.json @@ -0,0 +1,128 @@ +{ + "type": "index", + "value": { + "index": "ecs_non_compliant_synthetic_source", + "mappings": { + "properties": { + "id": { + "type": "keyword" + }, + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "name": { + "properties": { + "first": { + "type": "keyword" + } + } + }, + "type": { + "type": "long" + } + } + }, + "container": { + "properties": { + "image": { + "type": "keyword" + } + } + }, + "client": { + "properties": { + "ip": { + "type": "keyword" + } + } + }, + "event": { + "properties": { + "created": { + "type": "keyword" + }, + "action": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "original": { + "type": "text" + }, + "module": { + "type": "text" + } + } + }, + "dll": { + "properties": { + "code_signature": { + "properties": { + "valid": { + "type": "keyword" + } + } + } + } + }, + "process.command_line": { + "type": "keyword", + "ignore_above": 10, + "fields": { + "text": { + "type": "text" + } + } + }, + "nonEcs.command_line": { + "type": "keyword", + "ignore_above": 10, + "fields": { + "text": { + "type": "text" + } + } + }, + "random": { + "properties": { + "entry_leader": { + "properties": { + "name": { + "type": "keyword", + "ignore_above": 1024, + "fields": { + "text": { + "type": "match_only_text" + }, + "caseless": { + "type": "keyword", + "ignore_above": 1024, + "normalizer": "lowercase" + } + } + } + } + } + } + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1", + "mapping": { + "source": { + "mode": "synthetic" + } + } + } + } + } + } \ No newline at end of file diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/general_logic/trial_license_complete_tier/synthetic_source.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/general_logic/trial_license_complete_tier/synthetic_source.ts index e70fa226213d5..b8fd0c554351d 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/general_logic/trial_license_complete_tier/synthetic_source.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/general_logic/trial_license_complete_tier/synthetic_source.ts @@ -9,12 +9,7 @@ import expect from 'expect'; import { v4 as uuidv4 } from 'uuid'; import { QueryRuleCreateProps } from '@kbn/security-solution-plugin/common/api/detection_engine'; -import { - getPreviewAlerts, - previewRule, - dataGeneratorFactory, - setSyntheticSource, -} from '../../../../utils'; +import { getPreviewAlerts, previewRule, dataGeneratorFactory } from '../../../../utils'; import { deleteAllRules, deleteAllAlerts, @@ -39,12 +34,11 @@ export default ({ getService }: FtrProviderContext) => { describe('@ess @serverless synthetic source', () => { describe('synthetic source limitations', () => { - const index = 'ecs_compliant'; + const index = 'ecs_compliant_synthetic_source'; const { indexListOfDocuments } = dataGeneratorFactory({ es, index, log }); before(async () => { await esArchiver.load(`x-pack/test/functional/es_archives/security_solution/${index}`); - await setSyntheticSource({ es, index }); }); after(async () => { @@ -182,13 +176,12 @@ export default ({ getService }: FtrProviderContext) => { // this set of tests represent corrected failed test suits in https://github.com/elastic/kibana/pull/191527#issuecomment-2360684346 // and ensures non-ecs fields are stripped when source mode is synthetic describe('non ecs fields', () => { - const index = 'ecs_non_compliant'; + const index = 'ecs_non_compliant_synthetic_source'; const { indexListOfDocuments } = dataGeneratorFactory({ es, index, log }); const timestamp = '2020-10-28T06:00:00.000Z'; before(async () => { await esArchiver.load(`x-pack/test/functional/es_archives/security_solution/${index}`); - await setSyntheticSource({ es, index }); }); after(async () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/index.ts index 2c12400b7f169..68d9cf1b85660 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/index.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/index.ts @@ -12,7 +12,6 @@ export * from './data_generator'; export * from './telemetry'; export * from './event_log'; export * from './machine_learning'; -export * from './indices'; export * from './binary_to_string'; export * from './get_index_name_from_load'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/index.ts deleted file mode 100644 index 79cad822b8f36..0000000000000 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './set_synthetic_source'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/set_synthetic_source.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/set_synthetic_source.ts deleted file mode 100644 index b37bcd7664319..0000000000000 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/indices/set_synthetic_source.ts +++ /dev/null @@ -1,17 +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 { Client } from '@elastic/elasticsearch'; - -interface UpdateMappingsProps { - es: Client; - index: string | string[]; -} - -export const setSyntheticSource = async ({ es, index }: UpdateMappingsProps) => { - await es.indices.putMapping({ _source: { mode: 'synthetic' }, index }); -}; From 5b6261782e6c93ccd11c3b145cc01bf671780229 Mon Sep 17 00:00:00 2001 From: Pierre Gayvallet Date: Tue, 28 Jan 2025 19:58:57 +0100 Subject: [PATCH 07/26] Remove TS reference from `stack_connectors` to `dashboard` (#208165) ## Summary In #159075 was introduced a reference from the `stack_connectors` plugin to the `dashboard` plugin. This dependency was made so that the logic creating the GenAI dashboard has proper typing for the dashboard SO attributes type. However, that is a bad isolation of concerns, introducing a high risk of cyclic dependencies: the `dashboard` plugin, or any of its dependencies, can't depend on `stack_connectors`, or any plugin depending on stack_connectors. This is especially problematic because of another bad design decision of having `dashboard` depending on `observability_ai_assistant`, as it increases the risk of circular dependencies. This PR addresses it by removing the few usages we have of the dashboard plugin's type in stack_connectors. Of course the ideal fix would be to extract the type from the dashboard plugin instead, but those types we're using here are inferred from config schema concrete objects, making it complicated, so I went the pragmatic road even if it means loosing a bit of type safety. --- .../connector_types/lib/gen_ai/create_gen_ai_dashboard.ts | 5 ++--- .../server/connector_types/lib/gen_ai/gen_ai_dashboard.ts | 3 +-- .../platform/plugins/shared/stack_connectors/tsconfig.json | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/create_gen_ai_dashboard.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/create_gen_ai_dashboard.ts index d54ccec0656e7..71e194d57c9d5 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/create_gen_ai_dashboard.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/create_gen_ai_dashboard.ts @@ -6,7 +6,6 @@ */ import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import type { DashboardSavedObjectAttributes } from '@kbn/dashboard-plugin/server'; import { Logger } from '@kbn/logging'; import { getDashboard } from './gen_ai_dashboard'; @@ -30,7 +29,7 @@ export const initDashboard = async ({ error?: OutputError; }> => { try { - await savedObjectsClient.get('dashboard', dashboardId); + await savedObjectsClient.get('dashboard', dashboardId); return { success: true, }; @@ -50,7 +49,7 @@ export const initDashboard = async ({ } try { - await savedObjectsClient.create( + await savedObjectsClient.create( 'dashboard', getDashboard(genAIProvider, dashboardId).attributes, { diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/gen_ai_dashboard.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/gen_ai_dashboard.ts index efe5fc0c0ca6c..d0f3893c83034 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/gen_ai_dashboard.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/lib/gen_ai/gen_ai_dashboard.ts @@ -5,7 +5,6 @@ * 2.0. */ -import type { DashboardSavedObjectAttributes } from '@kbn/dashboard-plugin/server'; import { v4 as uuidv4 } from 'uuid'; import { SavedObject } from '@kbn/core-saved-objects-common/src/server_types'; import { OPENAI_TITLE, OPENAI_CONNECTOR_ID } from '../../../../common/openai/constants'; @@ -21,7 +20,7 @@ export const getDashboardTitle = (title: string) => `${title} Token Usage`; export const getDashboard = ( genAIProvider: 'OpenAI' | 'Bedrock' | 'Gemini' | 'Inference', dashboardId: string -): SavedObject => { +): SavedObject => { let attributes = { provider: OPENAI_TITLE, dashboardTitle: getDashboardTitle(OPENAI_TITLE), diff --git a/x-pack/platform/plugins/shared/stack_connectors/tsconfig.json b/x-pack/platform/plugins/shared/stack_connectors/tsconfig.json index 18d8722b51abd..adb1d4e2e756e 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/tsconfig.json +++ b/x-pack/platform/plugins/shared/stack_connectors/tsconfig.json @@ -28,7 +28,6 @@ "@kbn/test-jest-helpers", "@kbn/securitysolution-io-ts-utils", "@kbn/safer-lodash-set", - "@kbn/dashboard-plugin", "@kbn/core-http-browser", "@kbn/core-saved-objects-api-server", "@kbn/core-saved-objects-common", From f10d8f7c56a63dc7e71ffcae8e31a5a1736da6ac Mon Sep 17 00:00:00 2001 From: Viduni Wickramarachchi Date: Tue, 28 Jan 2025 14:00:18 -0500 Subject: [PATCH 08/26] [Obs AI Assistant] Avoid sending user prompts and LLM responses to Telemetry (#208118) Closes https://github.com/elastic/obs-ai-assistant-team/issues/186 ### Problem Prompts entered by users and responses from LLMs must not be sent to telemetry ### Solution Remove `messages` from the payloads sent to Telemetry ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .../kbn-ai-assistant/src/chat/chat_body.tsx | 17 +++++-- .../src/chat/chat_consolidated_items.tsx | 4 +- .../src/chat/chat_timeline.tsx | 6 +-- .../src/prompt_editor/prompt_editor.tsx | 2 +- .../public/analytics/index.ts | 6 +-- .../public/analytics/schemas/chat_feedback.ts | 40 ++++------------- .../analytics/schemas/insight_feedback.ts | 6 --- .../analytics/schemas/user_sent_prompt.ts | 19 ++++++-- .../public/components/insight/insight.tsx | 1 - .../tests/conversations/index.spec.ts | 44 ++++--------------- 10 files changed, 51 insertions(+), 94 deletions(-) diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_body.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_body.tsx index 00879b38932aa..1b65c58e940d0 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_body.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_body.tsx @@ -183,13 +183,24 @@ export function ChatBody({ const [promptEditorHeight, setPromptEditorHeight] = useState(0); - const handleFeedback = (message: Message, feedback: Feedback) => { + const handleFeedback = (feedback: Feedback) => { if (conversation.value?.conversation && 'user' in conversation.value) { + const { + messages: _removedMessages, // Exclude messages + conversation: { title: _removedTitle, ...conversationRest }, // Exclude title + ...rest + } = conversation.value; + + const conversationWithoutMessagesAndTitle = { + ...rest, + conversation: conversationRest, + }; + chatService.sendAnalyticsEvent({ type: ObservabilityAIAssistantTelemetryEventType.ChatFeedback, payload: { - messageWithFeedback: { message, feedback }, - conversation: conversation.value, + feedback, + conversation: conversationWithoutMessagesAndTitle, }, }); } diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_consolidated_items.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_consolidated_items.tsx index 5771b1fd297d7..b6fe53cb53c77 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_consolidated_items.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_consolidated_items.tsx @@ -128,9 +128,7 @@ export function ChatConsolidatedItems({ }); }} onEditSubmit={(message) => onEditSubmit(item.message, message)} - onFeedbackClick={(feedback) => { - onFeedback(item.message, feedback); - }} + onFeedbackClick={(feedback) => onFeedback(feedback)} onRegenerateClick={() => { onRegenerate(item.message); }} diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_timeline.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_timeline.tsx index 9b349f49f3904..2dfee080f5dc3 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_timeline.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_timeline.tsx @@ -53,7 +53,7 @@ export interface ChatTimelineProps { chatState: ChatState; currentUser?: Pick; onEdit: (message: Message, messageAfterEdit: Message) => void; - onFeedback: (message: Message, feedback: Feedback) => void; + onFeedback: (feedback: Feedback) => void; onRegenerate: (message: Message) => void; onSendTelemetry: (eventWithPayload: TelemetryEventTypeWithPayload) => void; onStopGenerating: () => void; @@ -137,9 +137,7 @@ export function ChatTimeline({ onActionClick={(payload) => { onActionClick({ message: item.message, payload }); }} - onFeedbackClick={(feedback) => { - onFeedback(item.message, feedback); - }} + onFeedbackClick={(feedback) => onFeedback(feedback)} onRegenerateClick={() => { onRegenerate(item.message); }} diff --git a/x-pack/platform/packages/shared/kbn-ai-assistant/src/prompt_editor/prompt_editor.tsx b/x-pack/platform/packages/shared/kbn-ai-assistant/src/prompt_editor/prompt_editor.tsx index c848935c17a3a..af5ffcc03aae9 100644 --- a/x-pack/platform/packages/shared/kbn-ai-assistant/src/prompt_editor/prompt_editor.tsx +++ b/x-pack/platform/packages/shared/kbn-ai-assistant/src/prompt_editor/prompt_editor.tsx @@ -125,7 +125,7 @@ export function PromptEditor({ setMode('prompt'); onSendTelemetry({ type: ObservabilityAIAssistantTelemetryEventType.UserSentPromptInChat, - payload: { ...message, scopes }, + payload: { scopes }, }); } catch (_) { setInnerMessage(oldMessage); diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/index.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/index.ts index 422ef625cdc64..a1709395428eb 100644 --- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/index.ts +++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/index.ts @@ -6,12 +6,10 @@ */ import type { AnalyticsServiceSetup, AnalyticsServiceStart } from '@kbn/core-analytics-browser'; -import { AssistantScope } from '@kbn/ai-assistant-common'; -import type { Message } from '../../common'; import { chatFeedbackEventSchema, ChatFeedback } from './schemas/chat_feedback'; import { insightFeedbackEventSchema, InsightFeedback } from './schemas/insight_feedback'; import { insightResponseEventSchema, InsightResponse } from './schemas/insight_response'; -import { userSentPromptEventSchema } from './schemas/user_sent_prompt'; +import { userSentPromptEventSchema, UserSentPrompt } from './schemas/user_sent_prompt'; import { ObservabilityAIAssistantTelemetryEventType } from './telemetry_event_type'; const schemas = [ @@ -26,7 +24,7 @@ export type TelemetryEventTypeWithPayload = | { type: ObservabilityAIAssistantTelemetryEventType.InsightFeedback; payload: InsightFeedback } | { type: ObservabilityAIAssistantTelemetryEventType.UserSentPromptInChat; - payload: Message & { scopes: AssistantScope[] }; + payload: UserSentPrompt; } | { type: ObservabilityAIAssistantTelemetryEventType.InsightResponse; diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts index 01df60e95a952..7fab15137d933 100644 --- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts +++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts @@ -6,33 +6,24 @@ */ import type { EventTypeOpts } from '@kbn/core/public'; -import type { Message, Conversation } from '../../../common'; +import type { Conversation } from '../../../common'; import type { Feedback } from '../../components/buttons/feedback_buttons'; import { ObservabilityAIAssistantTelemetryEventType } from '../telemetry_event_type'; -import { messageSchema } from './common'; export interface ChatFeedback { - messageWithFeedback: { - message: Message; - feedback: Feedback; + feedback: Feedback; + conversation: Omit, 'conversation'> & { + conversation: Omit; }; - conversation: Conversation; } export const chatFeedbackEventSchema: EventTypeOpts = { eventType: ObservabilityAIAssistantTelemetryEventType.ChatFeedback, schema: { - messageWithFeedback: { - properties: { - message: { - properties: messageSchema, - }, - feedback: { - type: 'text', - _meta: { - description: 'Whether the user has deemed this response useful or not', - }, - }, + feedback: { + type: 'text', + _meta: { + description: 'Whether the user has deemed this response useful or not', }, }, conversation: { @@ -68,12 +59,6 @@ export const chatFeedbackEventSchema: EventTypeOpts = { description: 'The id of the conversation.', }, }, - title: { - type: 'text', - _meta: { - description: 'The title of the conversation.', - }, - }, last_updated: { type: 'text', _meta: { @@ -104,15 +89,6 @@ export const chatFeedbackEventSchema: EventTypeOpts = { }, }, }, - messages: { - type: 'array', - items: { - properties: messageSchema, - }, - _meta: { - description: 'The messages in the conversation.', - }, - }, labels: { type: 'pass_through', _meta: { diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts index 67bd03f1fcd4f..9c784e8afae38 100644 --- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts +++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts @@ -6,14 +6,11 @@ */ import type { EventTypeOpts } from '@kbn/core/public'; -import type { Message } from '../../../common'; import type { Feedback } from '../../components/buttons/feedback_buttons'; import { ObservabilityAIAssistantTelemetryEventType } from '../telemetry_event_type'; -import { messageSchema } from './common'; export interface InsightFeedback { feedback: Feedback; - message: Message; } export const insightFeedbackEventSchema: EventTypeOpts = { @@ -25,8 +22,5 @@ export const insightFeedbackEventSchema: EventTypeOpts = { description: 'Whether the user has deemed this response useful or not', }, }, - message: { - properties: messageSchema, - }, }, }; diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts index 9c6f6d45110b1..2879184baad79 100644 --- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts +++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts @@ -6,11 +6,22 @@ */ import type { EventTypeOpts } from '@kbn/core/public'; -import type { Message } from '../../../common'; +import { AssistantScope } from '@kbn/ai-assistant-common'; import { ObservabilityAIAssistantTelemetryEventType } from '../telemetry_event_type'; -import { messageSchema } from './common'; -export const userSentPromptEventSchema: EventTypeOpts = { +export interface UserSentPrompt { + scopes: AssistantScope[]; +} + +export const userSentPromptEventSchema: EventTypeOpts = { eventType: ObservabilityAIAssistantTelemetryEventType.UserSentPromptInChat, - schema: messageSchema, + schema: { + scopes: { + type: 'array', + items: { + type: 'text', + _meta: { description: 'Scope of the AI Assistant' }, + }, + }, + }, }; diff --git a/x-pack/platform/plugins/shared/observability_ai_assistant/public/components/insight/insight.tsx b/x-pack/platform/plugins/shared/observability_ai_assistant/public/components/insight/insight.tsx index dc09d750b54ad..d822aa571f6b4 100644 --- a/x-pack/platform/plugins/shared/observability_ai_assistant/public/components/insight/insight.tsx +++ b/x-pack/platform/plugins/shared/observability_ai_assistant/public/components/insight/insight.tsx @@ -120,7 +120,6 @@ function ChatContent({ type: ObservabilityAIAssistantTelemetryEventType.InsightFeedback, payload: { feedback, - message: lastAssistantResponse, }, }); } diff --git a/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts b/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts index 5ebd5f0d2324b..c87e0d76dff3a 100644 --- a/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts +++ b/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts @@ -417,30 +417,16 @@ export default function ApiTest({ getService, getPageObjects }: FtrProviderConte expect(events.length).to.eql(1); - const { messageWithFeedback, conversation } = events[0] + const { feedback, conversation } = events[0] .properties as unknown as ChatFeedback; - expect(messageWithFeedback.feedback).to.eql('positive'); - expect(messageWithFeedback.message.message).to.eql({ - content: 'My response', - function_call: { - arguments: '', - name: '', - trigger: 'assistant', - }, - role: 'assistant', - }); - - expect(conversation.conversation.title).to.eql('My title'); + expect(feedback).to.eql('positive'); expect(conversation.namespace).to.eql('default'); expect(conversation.public).to.eql(false); expect(conversation.user?.name).to.eql('editor'); - const { messages } = conversation; - - expect(messages.length).to.eql(9); - - expect(messages[0].message.role).to.eql('system'); + expect(conversation.conversation).to.not.have.property('title'); + expect(conversation).to.not.have.property('messages'); }); }); }); @@ -492,30 +478,16 @@ export default function ApiTest({ getService, getPageObjects }: FtrProviderConte expect(events.length).to.eql(2); - const { messageWithFeedback, conversation } = events[1] + const { feedback, conversation } = events[1] .properties as unknown as ChatFeedback; - expect(messageWithFeedback.feedback).to.eql('positive'); - expect(messageWithFeedback.message.message).to.eql({ - content: - 'Service Level Indicators (SLIs) are quantifiable defined metrics that measure the performance and availability of a service or distributed system.', - function_call: { - arguments: '', - name: '', - trigger: 'assistant', - }, - role: 'assistant', - }); - - expect(conversation.conversation.title).to.eql('My old conversation'); + expect(feedback).to.eql('positive'); expect(conversation.namespace).to.eql('default'); expect(conversation.public).to.eql(false); expect(conversation.user?.name).to.eql('editor'); - const { messages } = conversation; - - // Verify that data changed after user interaction before being sent to telemetry - expect(messages.length).to.eql(9); + expect(conversation.conversation).to.not.have.property('title'); + expect(conversation).to.not.have.property('messages'); }); }); }); From 9a5df11b33fa7848e29ef777e5b1abd31fadd257 Mon Sep 17 00:00:00 2001 From: Ievgen Sorokopud Date: Tue, 28 Jan 2025 20:07:36 +0100 Subject: [PATCH 09/26] [Rules migration] Inlined ES|QL editor (#208497) ## Summary With these changes we make ES|QL editor inlined which increases the default height of it. This is possible after we allowed the ES|QL editor to hide "run query" button when inlined prop is used https://github.com/elastic/kibana/pull/208446 Screenshot 2025-01-27 at 21 31 24 > [!NOTE] > This feature needs `siemMigrationsEnabled` experimental flag enabled to work. --- .../translation/query_details/esql_editor/esql_editor_field.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/query_details/esql_editor/esql_editor_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/query_details/esql_editor/esql_editor_field.tsx index 5b92890c2dafd..90ec1c99de4ad 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/query_details/esql_editor/esql_editor_field.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/query_details/esql_editor/esql_editor_field.tsx @@ -59,6 +59,8 @@ export const EsqlEditorField: React.FC = React.memo( hideTimeFilterInfo={true} hideQueryHistory={true} hasOutline={true} + editorIsInline={true} + hideRunQueryButton={true} /> ); From 21df1e8b0bf2fa1ac0ffb0d7672efe00176a2add Mon Sep 17 00:00:00 2001 From: "elastic-renovate-prod[bot]" <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 20:17:38 +0100 Subject: [PATCH 10/26] Update react-is to v18.2 (main) (#204237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/react-is](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-is) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-is)) | devDependencies | major | [`^17.0.3` -> `~18.2.0`](https://renovatebot.com/diffs/npm/@types%2freact-is/17.0.3/18.2.0) | | [react-is](https://react.dev/) ([source](https://togithub.com/facebook/react/tree/HEAD/packages/react-is)) | devDependencies | major | [`^17.0.2` -> `~18.2.0`](https://renovatebot.com/diffs/npm/react-is/17.0.2/18.2.4) | --- ### Release Notes
facebook/react (react-is) ### [`v18.2.0`](https://togithub.com/facebook/react/blob/HEAD/CHANGELOG.md#1820-June-14-2022) [Compare Source](https://togithub.com/facebook/react/compare/v18.1.0...v18.2.0) ##### React DOM - Provide a component stack as a second argument to `onRecoverableError`. ([@​gnoff](https://togithub.com/gnoff) in [#​24591](https://togithub.com/facebook/react/pull/24591)) - Fix hydrating into `document` causing a blank page on mismatch. ([@​gnoff](https://togithub.com/gnoff) in [#​24523](https://togithub.com/facebook/react/pull/24523)) - Fix false positive hydration errors with Suspense. ([@​gnoff](https://togithub.com/gnoff) in [#​24480](https://togithub.com/facebook/react/pull/24480) and [@​acdlite](https://togithub.com/acdlite) in [#​24532](https://togithub.com/facebook/react/pull/24532)) - Fix ignored `setState` in Safari when adding an iframe. ([@​gaearon](https://togithub.com/gaearon) in [#​24459](https://togithub.com/facebook/react/pull/24459)) ##### React DOM Server - Pass information about server errors to the client. ([@​salazarm](https://togithub.com/salazarm) and [@​gnoff](https://togithub.com/gnoff) in [#​24551](https://togithub.com/facebook/react/pull/24551) and [#​24591](https://togithub.com/facebook/react/pull/24591)) - Allow to provide a reason when aborting the HTML stream. ([@​gnoff](https://togithub.com/gnoff) in [#​24680](https://togithub.com/facebook/react/pull/24680)) - Eliminate extraneous text separators in the HTML where possible. ([@​gnoff](https://togithub.com/gnoff) in [#​24630](https://togithub.com/facebook/react/pull/24630)) - Disallow complex children inside `` elements to match the browser constraints. ([@​gnoff](https://togithub.com/gnoff) in [#​24679](https://togithub.com/facebook/react/pull/24679)) - Fix buffering in some worker environments by explicitly setting `highWaterMark` to `0`. ([@​jplhomer](https://togithub.com/jplhomer) in [#​24641](https://togithub.com/facebook/react/pull/24641)) ##### Server Components (Experimental) - Add support for `useId()` inside Server Components. ([@​gnoff](https://togithub.com/gnoff) in [#​24172](https://togithub.com/facebook/react/pull/24172)) ### [`v18.1.0`](https://togithub.com/facebook/react/blob/HEAD/CHANGELOG.md#1810-April-26-2022) [Compare Source](https://togithub.com/facebook/react/compare/v18.0.0...v18.1.0) ##### React DOM - Fix the false positive warning about `react-dom/client` when using UMD bundle. ([@​alireza-molaee](https://togithub.com/alireza-molaee) in [#​24274](https://togithub.com/facebook/react/pull/24274)) - Fix `suppressHydrationWarning` to work in production too. ([@​gaearon](https://togithub.com/gaearon) in [#​24271](https://togithub.com/facebook/react/pull/24271)) - Fix `componentWillUnmount` firing twice inside of Suspense. ([@​acdlite](https://togithub.com/acdlite) in [#​24308](https://togithub.com/facebook/react/pull/24308)) - Fix some transition updates being ignored. ([@​acdlite](https://togithub.com/acdlite) in [#​24353](https://togithub.com/facebook/react/pull/24353)) - Fix `useDeferredValue` causing an infinite loop when passed an unmemoized value. ([@​acdlite](https://togithub.com/acdlite) in [#​24247](https://togithub.com/facebook/react/pull/24247)) - Fix throttling of revealing Suspense fallbacks. ([@​sunderls](https://togithub.com/sunderls) in [#​24253](https://togithub.com/facebook/react/pull/24253)) - Fix an inconsistency in whether the props object is the same between renders. ([@​Andarist](https://togithub.com/Andarist) and [@​acdlite](https://togithub.com/acdlite) in [#​24421](https://togithub.com/facebook/react/pull/24421)) - Fix a missing warning about a `setState` loop in `useEffect`. ([@​gaearon](https://togithub.com/gaearon) in [#​24298](https://togithub.com/facebook/react/pull/24298)) - Fix a spurious hydration error. ([@​gnoff](https://togithub.com/gnoff) in [#​24404](https://togithub.com/facebook/react/pull/24404)) - Warn when calling `setState` in `useInsertionEffect`. ([@​gaearon](https://togithub.com/gaearon) in [#​24295](https://togithub.com/facebook/react/pull/24295)) - Ensure the reason for hydration errors is always displayed. ([@​gaearon](https://togithub.com/gaearon) in [#​24276](https://togithub.com/facebook/react/pull/24276)) ##### React DOM Server - Fix escaping for the `bootstrapScriptContent` contents. ([@​gnoff](https://togithub.com/gnoff) in [#​24385](https://togithub.com/facebook/react/pull/24385)) - Significantly improve performance of `renderToPipeableStream`. ([@​gnoff](https://togithub.com/gnoff) in [#​24291](https://togithub.com/facebook/react/pull/24291)) ##### ESLint Plugin: React Hooks - Fix false positive errors with a large number of branches. ([@​scyron6](https://togithub.com/scyron6) in [#​24287](https://togithub.com/facebook/react/pull/24287)) - Don't consider a known dependency stable when the variable is reassigned. ([@​afzalsayed96](https://togithub.com/afzalsayed96) in [#​24343](https://togithub.com/facebook/react/pull/24343)) ##### Use Subscription - Replace the implementation with the `use-sync-external-store` shim. ([@​gaearon](https://togithub.com/gaearon) in [#​24289](https://togithub.com/facebook/react/pull/24289)) ### [`v18.0.0`](https://togithub.com/facebook/react/blob/HEAD/CHANGELOG.md#1800-March-29-2022) [Compare Source](https://togithub.com/facebook/react/compare/v17.0.2...v18.0.0) Below is a list of all new features, APIs, deprecations, and breaking changes. Read [React 18 release post](https://reactjs.org/blog/2022/03/29/react-v18.html) and [React 18 upgrade guide](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html) for more information. ##### New Features ##### React - `useId` is a new hook for generating unique IDs on both the client and s </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOlZpc3VhbGl6YXRpb25zIiwiYmFja3BvcnQ6YWxsLW9wZW4iLCJyZWxlYXNlX25vdGU6c2tpcCJdfQ==--> --------- Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Co-authored-by: nickofthyme <nicholas.partridge@elastic.co> --- package.json | 4 ++-- yarn.lock | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 41161b56b406a..1a7443115a1a2 100644 --- a/package.json +++ b/package.json @@ -1645,7 +1645,7 @@ "@types/rbush": "^3.0.0", "@types/react": "~18.2.0", "@types/react-dom": "~18.2.0", - "@types/react-is": "^17.0.3", + "@types/react-is": "~18.2.0", "@types/react-recompose": "^0.33.4", "@types/react-router": "^5.1.20", "@types/react-router-config": "^5.0.7", @@ -1821,7 +1821,7 @@ "prettier": "^2.8.8", "proxy": "^2.1.1", "raw-loader": "^3.1.0", - "react-is": "^17.0.2", + "react-is": "~18.2.0", "react-test-renderer": "^17.0.2", "recast": "^0.23.9", "regenerate": "^1.4.0", diff --git a/yarn.lock b/yarn.lock index ce0afa9c77a4b..52c2d5a51e206 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12247,10 +12247,10 @@ dependencies: "@types/react" "*" -"@types/react-is@^17.0.3": - version "17.0.3" - resolved "https://registry.yarnpkg.com/@types/react-is/-/react-is-17.0.3.tgz#2d855ba575f2fc8d17ef9861f084acc4b90a137a" - integrity sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw== +"@types/react-is@~18.2.0": + version "18.2.4" + resolved "https://registry.yarnpkg.com/@types/react-is/-/react-is-18.2.4.tgz#95a92829de452662348ce08349ca65623c50daf7" + integrity sha512-wBc7HgmbCcrvw0fZjxbgz/xrrlZKzEqmABBMeSvpTvdm25u6KI6xdIi9pRE2G0C1Lw5ETFdcn4UbYZ4/rpqUYw== dependencies: "@types/react" "*" @@ -27668,6 +27668,11 @@ react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react- resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== +react-is@~18.2.0: + version "18.2.0" + resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" From 583b3b62b6e7b18f67c84eba7af2907177fb5e72 Mon Sep 17 00:00:00 2001 From: Rodney Norris <rodney.norris@elastic.co> Date: Tue, 28 Jan 2025 13:19:25 -0600 Subject: [PATCH 11/26] [Search] connector sync, check agentless instead of ent-search (#208587) ## Summary Remove check for ent-search and usage of `config.host` from UIs, check if agentless is available instead. --- .../shared/header_actions/syncs_context_menu.tsx | 7 ++----- .../applications/enterprise_search_content/index.test.tsx | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx b/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx index b0c887a4c2228..2bbfac9cdd462 100644 --- a/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx +++ b/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx @@ -25,7 +25,6 @@ import { i18n } from '@kbn/i18n'; import { ConnectorStatus, IngestionStatus } from '@kbn/search-connectors'; import { Status } from '../../../../../../common/types/api'; -import { HttpLogic } from '../../../../shared/http'; import { KibanaLogic } from '../../../../shared/kibana'; import { CancelSyncsApiLogic } from '../../../api/connector/cancel_syncs_api_logic'; import { ConnectorViewLogic } from '../../connector_detail/connector_view_logic'; @@ -39,14 +38,13 @@ export interface SyncsContextMenuProps { } export const SyncsContextMenu: React.FC<SyncsContextMenuProps> = ({ disabled = false }) => { - const { config, productFeatures } = useValues(KibanaLogic); + const { productFeatures, isAgentlessEnabled } = useValues(KibanaLogic); const { ingestionStatus, isCanceling, isSyncing, isWaitingForSync } = useValues(IndexViewLogic); const { connector, hasDocumentLevelSecurityFeature, hasIncrementalSyncFeature } = useValues(ConnectorViewLogic); const { status } = useValues(CancelSyncsApiLogic); const { startSync, startIncrementalSync, startAccessControlSync, cancelSyncs } = useActions(SyncsLogic); - const { errorConnectingMessage } = useValues(HttpLogic); const [isPopoverOpen, setPopover] = useState(false); const togglePopover = () => setPopover(!isPopoverOpen); @@ -80,9 +78,8 @@ export const SyncsContextMenu: React.FC<SyncsContextMenuProps> = ({ disabled = f const shouldShowIncrementalSync = productFeatures.hasIncrementalSyncEnabled && hasIncrementalSyncFeature; - const isEnterpriseSearchNotAvailable = Boolean(config.host && errorConnectingMessage); const isSyncsDisabled = - (connector?.is_native && isEnterpriseSearchNotAvailable) || + (connector?.is_native && !isAgentlessEnabled) || ingestionStatus === IngestionStatus.INCOMPLETE || !connector?.index_name; diff --git a/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx b/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx index e80009f3f2a15..cf504980dbe2a 100644 --- a/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx +++ b/x-pack/solutions/search/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx @@ -18,7 +18,7 @@ import { SearchIndicesRouter } from './components/search_indices'; import { EnterpriseSearchContent, EnterpriseSearchContentConfigured } from '.'; describe('EnterpriseSearchContent', () => { - it('renders EnterpriseSearchContentConfigured when config.host is set & available', () => { + it('renders EnterpriseSearchContentConfigured', () => { setMockValues({ config: { host: 'some.url' }, errorConnectingMessage: '', From b128cee4ee7ccc367e8acf159dbf58a75f081867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Kopyci=C5=84ski?= <contact@patrykkopycinski.com> Date: Tue, 28 Jan 2025 20:19:55 +0100 Subject: [PATCH 12/26] [Security Assistant] Add Knowledge Base entries API (#206407) ## Summary Expose Knowledge Base entries API --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- oas_docs/output/kibana.serverless.yaml | 1374 ++++++++++++---- oas_docs/output/kibana.yaml | 1380 +++++++++++++---- .../kbn-elastic-assistant-common/constants.ts | 10 +- ...sistant_api_2023_10_31.bundled.schema.yaml | 784 ++++++++++ ...sistant_api_2023_10_31.bundled.schema.yaml | 784 ++++++++++ .../knowledge_base/crud_kb_route.gen.ts | 2 +- .../knowledge_base/crud_kb_route.schema.yaml | 4 +- ...k_crud_knowledge_base_entries_route.gen.ts | 2 +- ...ulk_crud_knowledge_base_entries_route.http | 2 +- ...d_knowledge_base_entries_route.schema.yaml | 6 +- .../entries/common_attributes.gen.ts | 8 + .../entries/common_attributes.schema.yaml | 12 + .../crud_knowledge_base_entries_route.gen.ts | 5 +- .../crud_knowledge_base_entries_route.http | 16 +- ...d_knowledge_base_entries_route.schema.yaml | 18 +- .../find_knowledge_base_entries_route.gen.ts | 2 +- .../find_knowledge_base_entries_route.http | 2 +- ...d_knowledge_base_entries_route.schema.yaml | 6 +- ...t_knowledge_base_indices_route.schema.yaml | 1 + .../assistant/api/knowledge_base/api.test.tsx | 9 +- .../impl/assistant/api/knowledge_base/api.tsx | 4 +- .../use_create_knowledge_base_entry.tsx | 4 +- ...use_delete_knowledge_base_entries.test.tsx | 3 +- .../use_delete_knowledge_base_entries.tsx | 4 +- .../entries/use_knowledge_base_entries.ts | 4 +- ...use_update_knowledge_base_entries.test.tsx | 3 +- .../use_update_knowledge_base_entries.tsx | 4 +- .../use_knowledge_base_status.test.tsx | 9 +- .../use_setup_knowledge_base.test.tsx | 9 +- .../kbn-elastic-assistant/tsconfig.json | 1 + .../server/__mocks__/data_clients.mock.ts | 2 + .../server/__mocks__/request.ts | 25 + .../knowledge_base/index.ts | 136 +- .../get/get_attack_discovery.ts | 4 +- .../post/cancel/cancel_attack_discovery.ts | 4 +- .../post/post_attack_discovery.ts | 4 +- .../defend_insights/get_defend_insight.ts | 4 +- .../defend_insights/get_defend_insights.ts | 4 +- .../defend_insights/post_defend_insights.ts | 4 +- .../entries/bulk_actions_route.ts | 47 +- .../knowledge_base/entries/create_route.ts | 4 +- .../entries/delete_route.test.ts | 92 ++ .../knowledge_base/entries/delete_route.ts | 93 ++ .../knowledge_base/entries/find_route.ts | 4 +- .../entries/update_route.test.ts | 121 ++ .../knowledge_base/entries/update_route.ts | 89 ++ .../routes/knowledge_base/entries/utils.ts | 37 + .../get_knowledge_base_indices.ts | 4 +- .../get_knowledge_base_status.ts | 6 +- .../knowledge_base/post_knowledge_base.ts | 6 +- .../pages/use_attack_discovery/index.tsx | 7 +- .../use_poll_api/use_poll_api.tsx | 6 +- .../view/hooks/insights/use_fetch_insights.ts | 4 +- .../hooks/insights/use_fetch_ongoing_tasks.ts | 4 +- .../view/hooks/insights/use_trigger_scan.ts | 4 +- .../entries/utils/bulk_actions_entry.ts | 5 +- .../entries/utils/create_entry.ts | 5 +- .../entries/utils/find_entry.ts | 5 +- .../knowledge_base/entries/utils/helpers.ts | 3 +- 59 files changed, 4428 insertions(+), 777 deletions(-) create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.test.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.test.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 6fd080c8c5f27..e113e20d474f3 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -37315,10 +37315,132 @@ paths: tags: - Security AI Assistant API x-beta: true - /api/security_ai_assistant/prompts/_bulk_action: + /api/security_ai_assistant/knowledge_base/{resource}: + get: + description: Read a single KB + operationId: ReadKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + elser_exists: + type: boolean + index_exists: + type: boolean + is_setup_available: + type: boolean + is_setup_in_progress: + type: boolean + pipeline_exists: + type: boolean + security_labs_exists: + type: boolean + user_data_exists: + type: boolean + description: Indicates a successful call. + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Read a KnowledgeBase + tags: + - Security AI Assistant API + x-beta: true post: - description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. - operationId: PerformPromptsBulkAction + description: Create a KnowledgeBase + operationId: CreateKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + - description: Optional ELSER modelId to use when setting up the Knowledge Base + in: query + name: modelId + required: false + schema: + type: string + - description: Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base + in: query + name: ignoreSecurityLabs + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseResponse' + description: Indicates a successful call. + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Create a KnowledgeBase + tags: + - Security AI Assistant API + x-beta: true + /api/security_ai_assistant/knowledge_base/entries: + post: + description: Create a Knowledge Base Entry + operationId: CreateKnowledgeBaseEntry + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + description: Successful request returning Knowledge Base Entries + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Create a Knowledge Base Entry + tags: + - Security AI Assistant API + x-beta: true + /api/security_ai_assistant/knowledge_base/entries/_bulk_action: + post: + description: The bulk action is applied to all Knowledge Base Entries that match the filter or to the list of Knowledge Base Entries by their IDs + operationId: PerformKnowledgeBaseEntryBulkAction requestBody: content: application/json; Elastic-Api-Version=2023-10-31: @@ -37327,52 +37449,45 @@ paths: properties: create: items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptCreateProps' + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps' type: array delete: type: object properties: ids: - description: Array of prompts IDs + description: Array of Knowledge base Entry IDs items: type: string minItems: 1 type: array query: - description: Query to filter promps + description: Query to filter Knowledge Base Entries type: string update: items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptUpdateProps' + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryUpdateProps' type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResponse' - description: Indicates a successful call. + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResponse' + description: Successful bulk operation request '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' description: Generic Error - summary: Apply a bulk action to prompts + summary: Applies a bulk action to multiple Knowledge Base Entries tags: - Security AI Assistant API x-beta: true - /api/security_ai_assistant/prompts/_find: + /api/security_ai_assistant/knowledge_base/entries/_find: get: - description: Get a list of all prompts. - operationId: FindPrompts + description: Finds Knowledge Base Entries that match the given query. + operationId: FindKnowledgeBaseEntries parameters: - in: query name: fields @@ -37392,7 +37507,7 @@ paths: name: sort_field required: false schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_FindPromptsSortField' + $ref: '#/components/schemas/Security_AI_Assistant_API_FindKnowledgeBaseEntriesSortField' - description: Sort order in: query name: sort_order @@ -37407,7 +37522,7 @@ paths: default: 1 minimum: 1 type: integer - - description: Prompts per page + - description: Knowledge Base Entries per page in: query name: per_page required: false @@ -37424,7 +37539,7 @@ paths: properties: data: items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' type: array page: type: integer @@ -37451,126 +37566,354 @@ paths: statusCode: type: number description: Generic Error - summary: Get prompts + summary: Finds Knowledge Base Entries that match the given query. tags: - Security AI Assistant API x-beta: true - /api/security/role: - get: - operationId: get-security-role - parameters: - - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. - in: query - name: replaceDeprecatedPrivileges - required: false - schema: - type: boolean - responses: - '200': - description: Indicates a successful call. - summary: Get all roles - tags: - - roles - x-beta: true - /api/security/role/{name}: + /api/security_ai_assistant/knowledge_base/entries/{id}: delete: - operationId: delete-security-role-name + description: Deletes a single Knowledge Base Entry using the `id` field + operationId: DeleteKnowledgeBaseEntry parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: name + - description: The Knowledge Base Entry's `id` value + in: path + name: id required: true schema: - minLength: 1 - type: string + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' responses: - '204': - description: Indicates a successful call. - summary: Delete a role + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_DeleteResponseFields' + description: Successful request returning the deleted Knowledge Base Entry's ID + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Deletes a single Knowledge Base Entry using the `id` field tags: - - roles + - Security AI Assistant API x-beta: true get: - operationId: get-security-role-name + description: Read a Knowledge Base Entry + operationId: ReadKnowledgeBaseEntry parameters: - - description: The role name. + - description: The Knowledge Base Entry's `id` value. in: path - name: name + name: id required: true schema: - minLength: 1 - type: string - - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. - in: query - name: replaceDeprecatedPrivileges - required: false - schema: - type: boolean + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' responses: '200': - description: Indicates a successful call. - summary: Get a role + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + description: Successful request returning a Knowledge Base Entry + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Read a Knowledge Base Entry tags: - - roles + - Security AI Assistant API x-beta: true put: - description: Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm. - operationId: put-security-role-name + description: Update a Knowledge Base Entry + operationId: UpdateKnowledgeBaseEntry parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The role name. + - description: The Knowledge Base Entry's `id` value in: path - name: name + name: id required: true schema: - maxLength: 1024 - minLength: 1 - type: string - - description: When true, a role is not overwritten if it already exists. - in: query - name: createOnly - required: false - schema: - default: false - type: boolean + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryUpdateProps' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + description: Successful request returning the updated Knowledge Base Entry + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Update a Knowledge Base Entry + tags: + - Security AI Assistant API + x-beta: true + /api/security_ai_assistant/prompts/_bulk_action: + post: + description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. + operationId: PerformPromptsBulkAction requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - additionalProperties: false type: object properties: - description: - description: A description for the role. - maxLength: 2048 - type: string - elasticsearch: - additionalProperties: false + create: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptCreateProps' + type: array + delete: type: object properties: - cluster: + ids: + description: Array of prompts IDs items: - description: Cluster privileges that define the cluster level actions that users can perform. type: string + minItems: 1 type: array - indices: - items: - additionalProperties: false - type: object - properties: - allow_restricted_indices: + query: + description: Query to filter promps + type: string + update: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptUpdateProps' + type: array + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResponse' + description: Indicates a successful call. + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Apply a bulk action to prompts + tags: + - Security AI Assistant API + x-beta: true + /api/security_ai_assistant/prompts/_find: + get: + description: Get a list of all prompts. + operationId: FindPrompts + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_FindPromptsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Prompts per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Get prompts + tags: + - Security AI Assistant API + x-beta: true + /api/security/role: + get: + operationId: get-security-role + parameters: + - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. + in: query + name: replaceDeprecatedPrivileges + required: false + schema: + type: boolean + responses: + '200': + description: Indicates a successful call. + summary: Get all roles + tags: + - roles + x-beta: true + /api/security/role/{name}: + delete: + operationId: delete-security-role-name + parameters: + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - in: path + name: name + required: true + schema: + minLength: 1 + type: string + responses: + '204': + description: Indicates a successful call. + summary: Delete a role + tags: + - roles + x-beta: true + get: + operationId: get-security-role-name + parameters: + - description: The role name. + in: path + name: name + required: true + schema: + minLength: 1 + type: string + - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. + in: query + name: replaceDeprecatedPrivileges + required: false + schema: + type: boolean + responses: + '200': + description: Indicates a successful call. + summary: Get a role + tags: + - roles + x-beta: true + put: + description: Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm. + operationId: put-security-role-name + parameters: + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The role name. + in: path + name: name + required: true + schema: + maxLength: 1024 + minLength: 1 + type: string + - description: When true, a role is not overwritten if it already exists. + in: query + name: createOnly + required: false + schema: + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + description: + description: A description for the role. + maxLength: 2048 + type: string + elasticsearch: + additionalProperties: false + type: object + properties: + cluster: + items: + description: Cluster privileges that define the cluster level actions that users can perform. + type: string + type: array + indices: + items: + additionalProperties: false + type: object + properties: + allow_restricted_indices: description: Restricted indices are a special category of indices that are used internally to store configuration data and should not be directly accessed. Only internal system roles should normally grant privileges over the restricted indices. Toggling this flag is very strongly discouraged because it could effectively grant unrestricted operations on critical data, making the entire system unstable or leaking sensitive information. If for administrative purposes you need to create a role with privileges covering restricted indices, however, you can set this property to true. In that case, the names field covers the restricted indices too. type: boolean field_security: @@ -43322,220 +43665,578 @@ components: - skipped - succeeded - total - Security_AI_Assistant_API_ChatCompleteProps: - type: object - properties: - connectorId: - type: string - conversationId: - type: string - isStream: - type: boolean - langSmithApiKey: - type: string - langSmithProject: - type: string - messages: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessage' - type: array - model: - type: string - persist: - type: boolean - promptId: - type: string - responseLanguage: - type: string - required: - - messages - - persist - - connectorId - Security_AI_Assistant_API_ChatMessage: - description: AI assistant message. - type: object - properties: - content: - description: Message content. - type: string - data: - $ref: '#/components/schemas/Security_AI_Assistant_API_MessageData' - description: ECS object to attach to the context of the message. - fields_to_anonymize: - items: - type: string - type: array - role: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessageRole' - description: Message role. - required: - - role - Security_AI_Assistant_API_ChatMessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - Security_AI_Assistant_API_ConversationCategory: - description: The conversation category. - enum: - - assistant - - insights - type: string - Security_AI_Assistant_API_ConversationConfidence: - description: The conversation confidence. - enum: - - low - - medium - - high - type: string - Security_AI_Assistant_API_ConversationCreateProps: + Security_AI_Assistant_API_ChatCompleteProps: + type: object + properties: + connectorId: + type: string + conversationId: + type: string + isStream: + type: boolean + langSmithApiKey: + type: string + langSmithProject: + type: string + messages: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessage' + type: array + model: + type: string + persist: + type: boolean + promptId: + type: string + responseLanguage: + type: string + required: + - messages + - persist + - connectorId + Security_AI_Assistant_API_ChatMessage: + description: AI assistant message. + type: object + properties: + content: + description: Message content. + type: string + data: + $ref: '#/components/schemas/Security_AI_Assistant_API_MessageData' + description: ECS object to attach to the context of the message. + fields_to_anonymize: + items: + type: string + type: array + role: + $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessageRole' + description: Message role. + required: + - role + Security_AI_Assistant_API_ChatMessageRole: + description: Message role. + enum: + - system + - user + - assistant + type: string + Security_AI_Assistant_API_ConversationCategory: + description: The conversation category. + enum: + - assistant + - insights + type: string + Security_AI_Assistant_API_ConversationConfidence: + description: The conversation confidence. + enum: + - low + - medium + - high + type: string + Security_AI_Assistant_API_ConversationCreateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + description: The conversation id. + type: string + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_Message' + type: array + replacements: + $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' + title: + description: The conversation title. + type: string + required: + - title + Security_AI_Assistant_API_ConversationResponse: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' + description: The conversation category. + createdAt: + description: The last time conversation was updated. + type: string + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_Message' + type: array + namespace: + description: Kibana space + type: string + replacements: + $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' + summary: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' + timestamp: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + title: + description: The conversation title. + type: string + updatedAt: + description: The last time conversation was updated. + type: string + users: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - id + - title + - createdAt + - users + - namespace + - category + Security_AI_Assistant_API_ConversationSummary: + type: object + properties: + confidence: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationConfidence' + description: How confident you are about this being a correct and useful learning. + content: + description: Summary text of the conversation over time. + type: string + public: + description: Define if summary is marked as publicly available. + type: boolean + timestamp: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + description: The timestamp summary was updated. + Security_AI_Assistant_API_ConversationUpdateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_Message' + type: array + replacements: + $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' + summary: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' + title: + description: The conversation title. + type: string + required: + - id + Security_AI_Assistant_API_DeleteResponseFields: + type: object + properties: + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + required: + - id + Security_AI_Assistant_API_DocumentEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/Security_AI_Assistant_API_ResponseFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryResponseFields' + Security_AI_Assistant_API_DocumentEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryOptionalFields' + Security_AI_Assistant_API_DocumentEntryOptionalFields: + type: object + properties: + required: + description: Whether this resource should always be included, defaults to false + type: boolean + vector: + $ref: '#/components/schemas/Security_AI_Assistant_API_Vector' + Security_AI_Assistant_API_DocumentEntryRequiredFields: + type: object + properties: + kbResource: + description: Knowledge Base resource name for grouping entries, e.g. 'esql', 'lens-docs', etc + type: string + source: + description: Source document name or filepath + type: string + text: + description: Knowledge Base Entry content + type: string + type: + description: Entry type + enum: + - document + type: string + required: + - type + - kbResource + - source + - text + Security_AI_Assistant_API_DocumentEntryResponseFields: + allOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryOptionalFields' + Security_AI_Assistant_API_DocumentEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - id + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryCreateFields' + Security_AI_Assistant_API_FindAnonymizationFieldsSortField: + enum: + - created_at + - anonymized + - allowed + - field + - updated_at + type: string + Security_AI_Assistant_API_FindConversationsSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string + Security_AI_Assistant_API_FindKnowledgeBaseEntriesSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string + Security_AI_Assistant_API_FindPromptsSortField: + enum: + - created_at + - is_default + - name + - updated_at + type: string + Security_AI_Assistant_API_IndexEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/Security_AI_Assistant_API_ResponseFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryResponseFields' + Security_AI_Assistant_API_IndexEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryOptionalFields' + Security_AI_Assistant_API_IndexEntryOptionalFields: + type: object + properties: + inputSchema: + $ref: '#/components/schemas/Security_AI_Assistant_API_InputSchema' + outputFields: + description: Fields to extract from the query result, defaults to all fields if not provided or empty + items: + type: string + type: array + Security_AI_Assistant_API_IndexEntryRequiredFields: + type: object + properties: + description: + description: Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description + type: string + field: + description: Field to query for Knowledge Base content + type: string + index: + description: Index or Data Stream to query for Knowledge Base content + type: string + queryDescription: + description: Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema + type: string + type: + description: Entry type + enum: + - index + type: string + required: + - type + - index + - field + - description + - queryDescription + Security_AI_Assistant_API_IndexEntryResponseFields: + allOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryOptionalFields' + Security_AI_Assistant_API_IndexEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - id + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryCreateFields' + Security_AI_Assistant_API_InputSchema: + description: Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval + items: + type: object + properties: + description: + description: Description of the field + type: string + fieldName: + description: Name of the field + type: string + fieldType: + description: Type of the field + type: string + required: + - fieldName + - fieldType + - description + type: array + Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipReason: + enum: + - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED + type: string + Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipReason' + required: + - id + - skip_reason + Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_NormalizedKnowledgeBaseEntryError' + type: array + results: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResults' + summary: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionSummary' + required: + - results + - summary + knowledgeBaseEntriesCount: + type: integer + message: + type: string + statusCode: + type: integer + success: + type: boolean + required: + - attributes + Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + type: array + required: + - updated + - created + - deleted + - skipped + Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total + Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps: + anyOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryCreateFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryCreateFields' + discriminator: + propertyName: type + Security_AI_Assistant_API_KnowledgeBaseEntryDetailsInError: type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - description: The conversation id. type: string - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - title: - description: The conversation title. + name: type: string required: - - title - Security_AI_Assistant_API_ConversationResponse: + - id + Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema: + additionalProperties: false type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - createdAt: - description: The last time conversation was updated. - type: string - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - namespace: - description: Kibana space - type: string - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - title: - description: The conversation title. + error: type: string - updatedAt: - description: The last time conversation was updated. + message: type: string - users: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_User' - type: array + statusCode: + type: number required: - - id - - title - - createdAt - - users - - namespace - - category - Security_AI_Assistant_API_ConversationSummary: - type: object - properties: - confidence: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationConfidence' - description: How confident you are about this being a correct and useful learning. - content: - description: Summary text of the conversation over time. - type: string - public: - description: Define if summary is marked as publicly available. - type: boolean - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - description: The timestamp summary was updated. - Security_AI_Assistant_API_ConversationUpdateProps: + - statusCode + - error + - message + Security_AI_Assistant_API_KnowledgeBaseEntryResponse: + anyOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntry' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntry' + discriminator: + propertyName: type + Security_AI_Assistant_API_KnowledgeBaseEntryUpdateProps: + anyOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryUpdateFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryUpdateFields' + discriminator: + propertyName: type + Security_AI_Assistant_API_KnowledgeBaseResponse: + description: AI assistant KnowledgeBase. type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + success: + description: Identify the success of the method execution. type: boolean - id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - title: - description: The conversation title. - type: string - required: - - id - Security_AI_Assistant_API_FindAnonymizationFieldsSortField: - enum: - - created_at - - anonymized - - allowed - - field - - updated_at - type: string - Security_AI_Assistant_API_FindConversationsSortField: - enum: - - created_at - - is_default - - title - - updated_at - type: string - Security_AI_Assistant_API_FindPromptsSortField: - enum: - - created_at - - is_default - - name - - updated_at - type: string Security_AI_Assistant_API_Message: description: AI assistant conversation message. type: object @@ -43594,6 +44295,23 @@ components: - message - status_code - anonymization_fields + Security_AI_Assistant_API_NormalizedKnowledgeBaseEntryError: + type: object + properties: + err_code: + type: string + knowledgeBaseEntries: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryDetailsInError' + type: array + message: + type: string + statusCode: + type: integer + required: + - message + - statusCode + - knowledgeBaseEntries Security_AI_Assistant_API_NormalizedPromptError: type: object properties: @@ -43799,6 +44517,29 @@ components: type: string description: Replacements object used to anonymize/deanomymize messsages type: object + Security_AI_Assistant_API_ResponseFields: + type: object + properties: + createdAt: + description: Time the Knowledge Base Entry was created + type: string + createdBy: + description: User who created the Knowledge Base Entry + type: string + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + updatedAt: + description: Time the Knowledge Base Entry was last updated + type: string + updatedBy: + description: User who last updated the Knowledge Base Entry + type: string + required: + - id + - createdAt + - createdBy + - updatedAt + - updatedBy Security_AI_Assistant_API_SortOrder: enum: - asc @@ -43824,6 +44565,21 @@ components: name: description: User name type: string + Security_AI_Assistant_API_Vector: + description: Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings + type: object + properties: + modelId: + description: ID of the model used to create the embeddings + type: string + tokens: + additionalProperties: + type: number + description: Tokens with their corresponding values + type: object + required: + - modelId + - tokens Security_Detections_API_AlertAssignees: type: object properties: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 8c04df0345d9b..6912ecaa79fcd 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -39793,10 +39793,129 @@ paths: summary: Update a conversation tags: - Security AI Assistant API - /api/security_ai_assistant/prompts/_bulk_action: + /api/security_ai_assistant/knowledge_base/{resource}: + get: + description: Read a single KB + operationId: ReadKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + elser_exists: + type: boolean + index_exists: + type: boolean + is_setup_available: + type: boolean + is_setup_in_progress: + type: boolean + pipeline_exists: + type: boolean + security_labs_exists: + type: boolean + user_data_exists: + type: boolean + description: Indicates a successful call. + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Read a KnowledgeBase + tags: + - Security AI Assistant API post: - description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. - operationId: PerformPromptsBulkAction + description: Create a KnowledgeBase + operationId: CreateKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + - description: Optional ELSER modelId to use when setting up the Knowledge Base + in: query + name: modelId + required: false + schema: + type: string + - description: Indicates whether we should or should not install Security Labs docs when setting up the Knowledge Base + in: query + name: ignoreSecurityLabs + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseResponse' + description: Indicates a successful call. + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Create a KnowledgeBase + tags: + - Security AI Assistant API + /api/security_ai_assistant/knowledge_base/entries: + post: + description: Create a Knowledge Base Entry + operationId: CreateKnowledgeBaseEntry + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + description: Successful request returning Knowledge Base Entries + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Create a Knowledge Base Entry + tags: + - Security AI Assistant API + /api/security_ai_assistant/knowledge_base/entries/_bulk_action: + post: + description: The bulk action is applied to all Knowledge Base Entries that match the filter or to the list of Knowledge Base Entries by their IDs + operationId: PerformKnowledgeBaseEntryBulkAction requestBody: content: application/json; Elastic-Api-Version=2023-10-31: @@ -39805,51 +39924,44 @@ paths: properties: create: items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptCreateProps' + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps' type: array delete: type: object properties: ids: - description: Array of prompts IDs + description: Array of Knowledge base Entry IDs items: type: string minItems: 1 type: array query: - description: Query to filter promps + description: Query to filter Knowledge Base Entries type: string update: items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptUpdateProps' + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryUpdateProps' type: array responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResponse' - description: Indicates a successful call. + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResponse' + description: Successful bulk operation request '400': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' description: Generic Error - summary: Apply a bulk action to prompts + summary: Applies a bulk action to multiple Knowledge Base Entries tags: - Security AI Assistant API - /api/security_ai_assistant/prompts/_find: + /api/security_ai_assistant/knowledge_base/entries/_find: get: - description: Get a list of all prompts. - operationId: FindPrompts + description: Finds Knowledge Base Entries that match the given query. + operationId: FindKnowledgeBaseEntries parameters: - in: query name: fields @@ -39869,7 +39981,7 @@ paths: name: sort_field required: false schema: - $ref: '#/components/schemas/Security_AI_Assistant_API_FindPromptsSortField' + $ref: '#/components/schemas/Security_AI_Assistant_API_FindKnowledgeBaseEntriesSortField' - description: Sort order in: query name: sort_order @@ -39884,7 +39996,7 @@ paths: default: 1 minimum: 1 type: integer - - description: Prompts per page + - description: Knowledge Base Entries per page in: query name: per_page required: false @@ -39901,7 +40013,7 @@ paths: properties: data: items: - $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' type: array page: type: integer @@ -39928,133 +40040,356 @@ paths: statusCode: type: number description: Generic Error - summary: Get prompts + summary: Finds Knowledge Base Entries that match the given query. tags: - Security AI Assistant API - /api/security/role: - get: - operationId: get-security-role + /api/security_ai_assistant/knowledge_base/entries/{id}: + delete: + description: Deletes a single Knowledge Base Entry using the `id` field + operationId: DeleteKnowledgeBaseEntry parameters: - - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. - in: query - name: replaceDeprecatedPrivileges - required: false + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true schema: - type: boolean + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' responses: '200': - description: Indicates a successful call. content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getRolesResponse1: - $ref: '#/components/examples/get_roles_response1' - summary: Get all roles - tags: - - roles - /api/security/role/{name}: - delete: - operationId: delete-security-role-name - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: name - required: true - schema: - minLength: 1 - type: string - responses: - '204': - description: Indicates a successful call. - summary: Delete a role + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_DeleteResponseFields' + description: Successful request returning the deleted Knowledge Base Entry's ID + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Deletes a single Knowledge Base Entry using the `id` field tags: - - roles + - Security AI Assistant API get: - operationId: get-security-role-name + description: Read a Knowledge Base Entry + operationId: ReadKnowledgeBaseEntry parameters: - - description: The role name. + - description: The Knowledge Base Entry's `id` value. in: path - name: name + name: id required: true schema: - minLength: 1 - type: string - - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. - in: query - name: replaceDeprecatedPrivileges - required: false - schema: - type: boolean + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' responses: '200': - description: Indicates a successful call. content: application/json; Elastic-Api-Version=2023-10-31: - examples: - getRoleResponse1: - $ref: '#/components/examples/get_role_response1' - summary: Get a role + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + description: Successful request returning a Knowledge Base Entry + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Read a Knowledge Base Entry tags: - - roles + - Security AI Assistant API put: - description: Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm. - operationId: put-security-role-name + description: Update a Knowledge Base Entry + operationId: UpdateKnowledgeBaseEntry parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The role name. + - description: The Knowledge Base Entry's `id` value in: path - name: name + name: id required: true schema: - maxLength: 1024 - minLength: 1 - type: string - - description: When true, a role is not overwritten if it already exists. - in: query - name: createOnly - required: false - schema: - default: false - type: boolean + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryUpdateProps' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + description: Successful request returning the updated Knowledge Base Entry + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Update a Knowledge Base Entry + tags: + - Security AI Assistant API + /api/security_ai_assistant/prompts/_bulk_action: + post: + description: Apply a bulk action to multiple prompts. The bulk action is applied to all prompts that match the filter or to the list of prompts by their IDs. + operationId: PerformPromptsBulkAction requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - additionalProperties: false type: object properties: - description: - description: A description for the role. - maxLength: 2048 - type: string - elasticsearch: - additionalProperties: false + create: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptCreateProps' + type: array + delete: type: object properties: - cluster: + ids: + description: Array of prompts IDs items: - description: Cluster privileges that define the cluster level actions that users can perform. type: string + minItems: 1 type: array - indices: - items: - additionalProperties: false - type: object - properties: - allow_restricted_indices: - description: Restricted indices are a special category of indices that are used internally to store configuration data and should not be directly accessed. Only internal system roles should normally grant privileges over the restricted indices. Toggling this flag is very strongly discouraged because it could effectively grant unrestricted operations on critical data, making the entire system unstable or leaking sensitive information. If for administrative purposes you need to create a role with privileges covering restricted indices, however, you can set this property to true. In that case, the names field covers the restricted indices too. + query: + description: Query to filter promps + type: string + update: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptUpdateProps' + type: array + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptsBulkCrudActionResponse' + description: Indicates a successful call. + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Apply a bulk action to prompts + tags: + - Security AI Assistant API + /api/security_ai_assistant/prompts/_find: + get: + description: Get a list of all prompts. + operationId: FindPrompts + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_FindPromptsSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/Security_AI_Assistant_API_SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Prompts per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_PromptResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Get prompts + tags: + - Security AI Assistant API + /api/security/role: + get: + operationId: get-security-role + parameters: + - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. + in: query + name: replaceDeprecatedPrivileges + required: false + schema: + type: boolean + responses: + '200': + description: Indicates a successful call. + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + getRolesResponse1: + $ref: '#/components/examples/get_roles_response1' + summary: Get all roles + tags: + - roles + /api/security/role/{name}: + delete: + operationId: delete-security-role-name + parameters: + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - in: path + name: name + required: true + schema: + minLength: 1 + type: string + responses: + '204': + description: Indicates a successful call. + summary: Delete a role + tags: + - roles + get: + operationId: get-security-role-name + parameters: + - description: The role name. + in: path + name: name + required: true + schema: + minLength: 1 + type: string + - description: If `true` and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges. + in: query + name: replaceDeprecatedPrivileges + required: false + schema: + type: boolean + responses: + '200': + description: Indicates a successful call. + content: + application/json; Elastic-Api-Version=2023-10-31: + examples: + getRoleResponse1: + $ref: '#/components/examples/get_role_response1' + summary: Get a role + tags: + - roles + put: + description: Create a new Kibana role or update the attributes of an existing role. Kibana roles are stored in the Elasticsearch native realm. + operationId: put-security-role-name + parameters: + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - description: The role name. + in: path + name: name + required: true + schema: + maxLength: 1024 + minLength: 1 + type: string + - description: When true, a role is not overwritten if it already exists. + in: query + name: createOnly + required: false + schema: + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + description: + description: A description for the role. + maxLength: 2048 + type: string + elasticsearch: + additionalProperties: false + type: object + properties: + cluster: + items: + description: Cluster privileges that define the cluster level actions that users can perform. + type: string + type: array + indices: + items: + additionalProperties: false + type: object + properties: + allow_restricted_indices: + description: Restricted indices are a special category of indices that are used internally to store configuration data and should not be directly accessed. Only internal system roles should normally grant privileges over the restricted indices. Toggling this flag is very strongly discouraged because it could effectively grant unrestricted operations on critical data, making the entire system unstable or leaking sensitive information. If for administrative purposes you need to create a role with privileges covering restricted indices, however, you can set this property to true. In that case, the names field covers the restricted indices too. type: boolean field_security: additionalProperties: @@ -49834,220 +50169,578 @@ components: - skipped - succeeded - total - Security_AI_Assistant_API_ChatCompleteProps: - type: object - properties: - connectorId: - type: string - conversationId: - type: string - isStream: - type: boolean - langSmithApiKey: - type: string - langSmithProject: - type: string - messages: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessage' - type: array - model: - type: string - persist: - type: boolean - promptId: - type: string - responseLanguage: - type: string - required: - - messages - - persist - - connectorId - Security_AI_Assistant_API_ChatMessage: - description: AI assistant message. - type: object - properties: - content: - description: Message content. - type: string - data: - $ref: '#/components/schemas/Security_AI_Assistant_API_MessageData' - description: ECS object to attach to the context of the message. - fields_to_anonymize: - items: - type: string - type: array - role: - $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessageRole' - description: Message role. - required: - - role - Security_AI_Assistant_API_ChatMessageRole: - description: Message role. - enum: - - system - - user - - assistant - type: string - Security_AI_Assistant_API_ConversationCategory: - description: The conversation category. - enum: - - assistant - - insights - type: string - Security_AI_Assistant_API_ConversationConfidence: - description: The conversation confidence. - enum: - - low - - medium - - high - type: string - Security_AI_Assistant_API_ConversationCreateProps: + Security_AI_Assistant_API_ChatCompleteProps: + type: object + properties: + connectorId: + type: string + conversationId: + type: string + isStream: + type: boolean + langSmithApiKey: + type: string + langSmithProject: + type: string + messages: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessage' + type: array + model: + type: string + persist: + type: boolean + promptId: + type: string + responseLanguage: + type: string + required: + - messages + - persist + - connectorId + Security_AI_Assistant_API_ChatMessage: + description: AI assistant message. + type: object + properties: + content: + description: Message content. + type: string + data: + $ref: '#/components/schemas/Security_AI_Assistant_API_MessageData' + description: ECS object to attach to the context of the message. + fields_to_anonymize: + items: + type: string + type: array + role: + $ref: '#/components/schemas/Security_AI_Assistant_API_ChatMessageRole' + description: Message role. + required: + - role + Security_AI_Assistant_API_ChatMessageRole: + description: Message role. + enum: + - system + - user + - assistant + type: string + Security_AI_Assistant_API_ConversationCategory: + description: The conversation category. + enum: + - assistant + - insights + type: string + Security_AI_Assistant_API_ConversationConfidence: + description: The conversation confidence. + enum: + - low + - medium + - high + type: string + Security_AI_Assistant_API_ConversationCreateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + description: The conversation id. + type: string + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_Message' + type: array + replacements: + $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' + title: + description: The conversation title. + type: string + required: + - title + Security_AI_Assistant_API_ConversationResponse: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' + description: The conversation category. + createdAt: + description: The last time conversation was updated. + type: string + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + isDefault: + description: Is default conversation. + type: boolean + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_Message' + type: array + namespace: + description: Kibana space + type: string + replacements: + $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' + summary: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' + timestamp: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + title: + description: The conversation title. + type: string + updatedAt: + description: The last time conversation was updated. + type: string + users: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - id + - title + - createdAt + - users + - namespace + - category + Security_AI_Assistant_API_ConversationSummary: + type: object + properties: + confidence: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationConfidence' + description: How confident you are about this being a correct and useful learning. + content: + description: Summary text of the conversation over time. + type: string + public: + description: Define if summary is marked as publicly available. + type: boolean + timestamp: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + description: The timestamp summary was updated. + Security_AI_Assistant_API_ConversationUpdateProps: + type: object + properties: + apiConfig: + $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' + description: LLM API configuration. + category: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' + description: The conversation category. + excludeFromLastConversationStorage: + description: excludeFromLastConversationStorage. + type: boolean + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + messages: + description: The conversation messages. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_Message' + type: array + replacements: + $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' + summary: + $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' + title: + description: The conversation title. + type: string + required: + - id + Security_AI_Assistant_API_DeleteResponseFields: + type: object + properties: + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + required: + - id + Security_AI_Assistant_API_DocumentEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/Security_AI_Assistant_API_ResponseFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryResponseFields' + Security_AI_Assistant_API_DocumentEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryOptionalFields' + Security_AI_Assistant_API_DocumentEntryOptionalFields: + type: object + properties: + required: + description: Whether this resource should always be included, defaults to false + type: boolean + vector: + $ref: '#/components/schemas/Security_AI_Assistant_API_Vector' + Security_AI_Assistant_API_DocumentEntryRequiredFields: + type: object + properties: + kbResource: + description: Knowledge Base resource name for grouping entries, e.g. 'esql', 'lens-docs', etc + type: string + source: + description: Source document name or filepath + type: string + text: + description: Knowledge Base Entry content + type: string + type: + description: Entry type + enum: + - document + type: string + required: + - type + - kbResource + - source + - text + Security_AI_Assistant_API_DocumentEntryResponseFields: + allOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryOptionalFields' + Security_AI_Assistant_API_DocumentEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - id + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryCreateFields' + Security_AI_Assistant_API_FindAnonymizationFieldsSortField: + enum: + - created_at + - anonymized + - allowed + - field + - updated_at + type: string + Security_AI_Assistant_API_FindConversationsSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string + Security_AI_Assistant_API_FindKnowledgeBaseEntriesSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string + Security_AI_Assistant_API_FindPromptsSortField: + enum: + - created_at + - is_default + - name + - updated_at + type: string + Security_AI_Assistant_API_IndexEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/Security_AI_Assistant_API_ResponseFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryResponseFields' + Security_AI_Assistant_API_IndexEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - name + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryOptionalFields' + Security_AI_Assistant_API_IndexEntryOptionalFields: + type: object + properties: + inputSchema: + $ref: '#/components/schemas/Security_AI_Assistant_API_InputSchema' + outputFields: + description: Fields to extract from the query result, defaults to all fields if not provided or empty + items: + type: string + type: array + Security_AI_Assistant_API_IndexEntryRequiredFields: + type: object + properties: + description: + description: Description for when this index or data stream should be queried for Knowledge Base content. Passed to the LLM as a tool description + type: string + field: + description: Field to query for Knowledge Base content + type: string + index: + description: Index or Data Stream to query for Knowledge Base content + type: string + queryDescription: + description: Description of query field used to fetch Knowledge Base content. Passed to the LLM as part of the tool input schema + type: string + type: + description: Entry type + enum: + - index + type: string + required: + - type + - index + - field + - description + - queryDescription + Security_AI_Assistant_API_IndexEntryResponseFields: + allOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryRequiredFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryOptionalFields' + Security_AI_Assistant_API_IndexEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: Users who have access to the Knowledge Base Entry, defaults to current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_User' + type: array + required: + - id + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryCreateFields' + Security_AI_Assistant_API_InputSchema: + description: Array of objects defining the input schema, allowing the LLM to extract structured data to be used in retrieval + items: + type: object + properties: + description: + description: Description of the field + type: string + fieldName: + description: Name of the field + type: string + fieldType: + description: Type of the field + type: string + required: + - fieldName + - fieldType + - description + type: array + Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipReason: + enum: + - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED + type: string + Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipReason' + required: + - id + - skip_reason + Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_NormalizedKnowledgeBaseEntryError' + type: array + results: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResults' + summary: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionSummary' + required: + - results + - summary + knowledgeBaseEntriesCount: + type: integer + message: + type: string + statusCode: + type: integer + success: + type: boolean + required: + - attributes + Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryResponse' + type: array + required: + - updated + - created + - deleted + - skipped + Security_AI_Assistant_API_KnowledgeBaseEntryBulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total + Security_AI_Assistant_API_KnowledgeBaseEntryCreateProps: + anyOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryCreateFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryCreateFields' + discriminator: + propertyName: type + Security_AI_Assistant_API_KnowledgeBaseEntryDetailsInError: type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean id: - description: The conversation id. type: string - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - title: - description: The conversation title. + name: type: string required: - - title - Security_AI_Assistant_API_ConversationResponse: + - id + Security_AI_Assistant_API_KnowledgeBaseEntryErrorSchema: + additionalProperties: false type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - createdAt: - description: The last time conversation was updated. - type: string - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. - type: boolean - id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - isDefault: - description: Is default conversation. - type: boolean - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - namespace: - description: Kibana space - type: string - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - title: - description: The conversation title. + error: type: string - updatedAt: - description: The last time conversation was updated. + message: type: string - users: - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_User' - type: array + statusCode: + type: number required: - - id - - title - - createdAt - - users - - namespace - - category - Security_AI_Assistant_API_ConversationSummary: - type: object - properties: - confidence: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationConfidence' - description: How confident you are about this being a correct and useful learning. - content: - description: Summary text of the conversation over time. - type: string - public: - description: Define if summary is marked as publicly available. - type: boolean - timestamp: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - description: The timestamp summary was updated. - Security_AI_Assistant_API_ConversationUpdateProps: + - statusCode + - error + - message + Security_AI_Assistant_API_KnowledgeBaseEntryResponse: + anyOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntry' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntry' + discriminator: + propertyName: type + Security_AI_Assistant_API_KnowledgeBaseEntryUpdateProps: + anyOf: + - $ref: '#/components/schemas/Security_AI_Assistant_API_DocumentEntryUpdateFields' + - $ref: '#/components/schemas/Security_AI_Assistant_API_IndexEntryUpdateFields' + discriminator: + propertyName: type + Security_AI_Assistant_API_KnowledgeBaseResponse: + description: AI assistant KnowledgeBase. type: object properties: - apiConfig: - $ref: '#/components/schemas/Security_AI_Assistant_API_ApiConfig' - description: LLM API configuration. - category: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationCategory' - description: The conversation category. - excludeFromLastConversationStorage: - description: excludeFromLastConversationStorage. + success: + description: Identify the success of the method execution. type: boolean - id: - $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' - messages: - description: The conversation messages. - items: - $ref: '#/components/schemas/Security_AI_Assistant_API_Message' - type: array - replacements: - $ref: '#/components/schemas/Security_AI_Assistant_API_Replacements' - summary: - $ref: '#/components/schemas/Security_AI_Assistant_API_ConversationSummary' - title: - description: The conversation title. - type: string - required: - - id - Security_AI_Assistant_API_FindAnonymizationFieldsSortField: - enum: - - created_at - - anonymized - - allowed - - field - - updated_at - type: string - Security_AI_Assistant_API_FindConversationsSortField: - enum: - - created_at - - is_default - - title - - updated_at - type: string - Security_AI_Assistant_API_FindPromptsSortField: - enum: - - created_at - - is_default - - name - - updated_at - type: string Security_AI_Assistant_API_Message: description: AI assistant conversation message. type: object @@ -50106,6 +50799,23 @@ components: - message - status_code - anonymization_fields + Security_AI_Assistant_API_NormalizedKnowledgeBaseEntryError: + type: object + properties: + err_code: + type: string + knowledgeBaseEntries: + items: + $ref: '#/components/schemas/Security_AI_Assistant_API_KnowledgeBaseEntryDetailsInError' + type: array + message: + type: string + statusCode: + type: integer + required: + - message + - statusCode + - knowledgeBaseEntries Security_AI_Assistant_API_NormalizedPromptError: type: object properties: @@ -50311,6 +51021,29 @@ components: type: string description: Replacements object used to anonymize/deanomymize messsages type: object + Security_AI_Assistant_API_ResponseFields: + type: object + properties: + createdAt: + description: Time the Knowledge Base Entry was created + type: string + createdBy: + description: User who created the Knowledge Base Entry + type: string + id: + $ref: '#/components/schemas/Security_AI_Assistant_API_NonEmptyString' + updatedAt: + description: Time the Knowledge Base Entry was last updated + type: string + updatedBy: + description: User who last updated the Knowledge Base Entry + type: string + required: + - id + - createdAt + - createdBy + - updatedAt + - updatedBy Security_AI_Assistant_API_SortOrder: enum: - asc @@ -50336,6 +51069,21 @@ components: name: description: User name type: string + Security_AI_Assistant_API_Vector: + description: Object containing Knowledge Base Entry text embeddings and modelId used to create the embeddings + type: object + properties: + modelId: + description: ID of the model used to create the embeddings + type: string + tokens: + additionalProperties: + type: number + description: Tokens with their corresponding values + type: object + required: + - modelId + - tokens Security_Detections_API_AlertAssignees: type: object properties: diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/constants.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/constants.ts index 7a884936d04e2..5042b66facd70 100755 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/constants.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/constants.ts @@ -5,8 +5,6 @@ * 2.0. */ -export const ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION = '1'; - export const ELASTIC_AI_ASSISTANT_URL = '/api/security_ai_assistant'; export const ELASTIC_AI_ASSISTANT_INTERNAL_URL = '/internal/elastic_assistant'; @@ -43,16 +41,18 @@ export const ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND = // TODO: Update existing 'status' endpoint to take resource as query param as to not conflict with 'entries' export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL = - `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/knowledge_base/{resource?}` as const; + `${ELASTIC_AI_ASSISTANT_URL}/knowledge_base/{resource?}` as const; export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL = - `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/knowledge_base/entries` as const; + `${ELASTIC_AI_ASSISTANT_URL}/knowledge_base/entries` as const; +export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID = + `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/{id}` as const; export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND = `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_find` as const; export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION = `${ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL}/_bulk_action` as const; + export const ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_INDICES_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/knowledge_base/_indices` as const; - export const ELASTIC_AI_ASSISTANT_EVALUATE_URL = `${ELASTIC_AI_ASSISTANT_INTERNAL_URL}/evaluate` as const; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml index 726f5faba2edb..1da2cb5ce57ee 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -418,6 +418,353 @@ paths: tags: - Security AI Assistant API - Conversation API + /api/security_ai_assistant/knowledge_base/{resource}: + get: + description: Read a single KB + operationId: ReadKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + responses: + '200': + content: + application/json: + schema: + type: object + properties: + elser_exists: + type: boolean + index_exists: + type: boolean + is_setup_available: + type: boolean + is_setup_in_progress: + type: boolean + pipeline_exists: + type: boolean + security_labs_exists: + type: boolean + user_data_exists: + type: boolean + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Read a KnowledgeBase + tags: + - Security AI Assistant API + - KnowledgeBase API + post: + description: Create a KnowledgeBase + operationId: CreateKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + - description: Optional ELSER modelId to use when setting up the Knowledge Base + in: query + name: modelId + required: false + schema: + type: string + - description: >- + Indicates whether we should or should not install Security Labs docs + when setting up the Knowledge Base + in: query + name: ignoreSecurityLabs + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Create a KnowledgeBase + tags: + - Security AI Assistant API + - KnowledgeBase API + /api/security_ai_assistant/knowledge_base/entries: + post: + description: Create a Knowledge Base Entry + operationId: CreateKnowledgeBaseEntry + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning Knowledge Base Entries + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Create a Knowledge Base Entry + tags: + - Security AI Assistant API + - Knowledge Base Entries API + /api/security_ai_assistant/knowledge_base/entries/_bulk_action: + post: + description: >- + The bulk action is applied to all Knowledge Base Entries that match the + filter or to the list of Knowledge Base Entries by their IDs + operationId: PerformKnowledgeBaseEntryBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of Knowledge base Entry IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter Knowledge Base Entries + type: string + update: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResponse' + description: Successful bulk operation request + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Applies a bulk action to multiple Knowledge Base Entries + tags: + - Security AI Assistant API + - Knowledge Base Entries Bulk API + /api/security_ai_assistant/knowledge_base/entries/_find: + get: + description: Finds Knowledge Base Entries that match the given query. + operationId: FindKnowledgeBaseEntries + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindKnowledgeBaseEntriesSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Knowledge Base Entries per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds Knowledge Base Entries that match the given query. + tags: + - Security AI Assistant API + - Knowledge Base Entries API + /api/security_ai_assistant/knowledge_base/entries/{id}: + delete: + description: Deletes a single Knowledge Base Entry using the `id` field + operationId: DeleteKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponseFields' + description: Successful request returning the deleted Knowledge Base Entry's ID + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Deletes a single Knowledge Base Entry using the `id` field + tags: + - Security AI Assistant API + - Knowledge Base Entries API + get: + description: Read a Knowledge Base Entry + operationId: ReadKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning a Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Read a Knowledge Base Entry + tags: + - Security AI Assistant API + - Knowledge Base Entries API + put: + description: Update a Knowledge Base Entry + operationId: UpdateKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning the updated Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Update a Knowledge Base Entry + tags: + - Security AI Assistant API + - Knowledge Base Entries API /api/security_ai_assistant/prompts/_bulk_action: post: description: >- @@ -919,6 +1266,115 @@ components: type: string required: - id + DeleteResponseFields: + type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + required: + - id + DocumentEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/ResponseFields' + - $ref: '#/components/schemas/DocumentEntryResponseFields' + DocumentEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - $ref: '#/components/schemas/DocumentEntryRequiredFields' + - $ref: '#/components/schemas/DocumentEntryOptionalFields' + DocumentEntryOptionalFields: + type: object + properties: + required: + description: Whether this resource should always be included, defaults to false + type: boolean + vector: + $ref: '#/components/schemas/Vector' + DocumentEntryRequiredFields: + type: object + properties: + kbResource: + description: >- + Knowledge Base resource name for grouping entries, e.g. 'esql', + 'lens-docs', etc + type: string + source: + description: Source document name or filepath + type: string + text: + description: Knowledge Base Entry content + type: string + type: + description: Entry type + enum: + - document + type: string + required: + - type + - kbResource + - source + - text + DocumentEntryResponseFields: + allOf: + - $ref: '#/components/schemas/DocumentEntryRequiredFields' + - $ref: '#/components/schemas/DocumentEntryOptionalFields' + DocumentEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - $ref: '#/components/schemas/DocumentEntryCreateFields' FindAnonymizationFieldsSortField: enum: - created_at @@ -934,6 +1390,13 @@ components: - title - updated_at type: string + FindKnowledgeBaseEntriesSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string FindPromptsSortField: enum: - created_at @@ -941,6 +1404,270 @@ components: - name - updated_at type: string + IndexEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/ResponseFields' + - $ref: '#/components/schemas/IndexEntryResponseFields' + IndexEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - $ref: '#/components/schemas/IndexEntryRequiredFields' + - $ref: '#/components/schemas/IndexEntryOptionalFields' + IndexEntryOptionalFields: + type: object + properties: + inputSchema: + $ref: '#/components/schemas/InputSchema' + outputFields: + description: >- + Fields to extract from the query result, defaults to all fields if + not provided or empty + items: + type: string + type: array + IndexEntryRequiredFields: + type: object + properties: + description: + description: >- + Description for when this index or data stream should be queried for + Knowledge Base content. Passed to the LLM as a tool description + type: string + field: + description: Field to query for Knowledge Base content + type: string + index: + description: Index or Data Stream to query for Knowledge Base content + type: string + queryDescription: + description: >- + Description of query field used to fetch Knowledge Base content. + Passed to the LLM as part of the tool input schema + type: string + type: + description: Entry type + enum: + - index + type: string + required: + - type + - index + - field + - description + - queryDescription + IndexEntryResponseFields: + allOf: + - $ref: '#/components/schemas/IndexEntryRequiredFields' + - $ref: '#/components/schemas/IndexEntryOptionalFields' + IndexEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - $ref: '#/components/schemas/IndexEntryCreateFields' + InputSchema: + description: >- + Array of objects defining the input schema, allowing the LLM to extract + structured data to be used in retrieval + items: + type: object + properties: + description: + description: Description of the field + type: string + fieldName: + description: Name of the field + type: string + fieldType: + description: Type of the field + type: string + required: + - fieldName + - fieldType + - description + type: array + KnowledgeBaseEntryBulkActionSkipReason: + enum: + - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED + type: string + KnowledgeBaseEntryBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' + required: + - id + - skip_reason + KnowledgeBaseEntryBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' + type: array + results: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResults' + summary: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionSummary' + required: + - results + - summary + knowledgeBaseEntriesCount: + type: integer + message: + type: string + statusCode: + type: integer + success: + type: boolean + required: + - attributes + KnowledgeBaseEntryBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + required: + - updated + - created + - deleted + - skipped + KnowledgeBaseEntryBulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total + KnowledgeBaseEntryCreateProps: + anyOf: + - $ref: '#/components/schemas/DocumentEntryCreateFields' + - $ref: '#/components/schemas/IndexEntryCreateFields' + discriminator: + propertyName: type + KnowledgeBaseEntryDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + KnowledgeBaseEntryErrorSchema: + additionalProperties: false + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - statusCode + - error + - message + KnowledgeBaseEntryResponse: + anyOf: + - $ref: '#/components/schemas/DocumentEntry' + - $ref: '#/components/schemas/IndexEntry' + discriminator: + propertyName: type + KnowledgeBaseEntryUpdateProps: + anyOf: + - $ref: '#/components/schemas/DocumentEntryUpdateFields' + - $ref: '#/components/schemas/IndexEntryUpdateFields' + discriminator: + propertyName: type + KnowledgeBaseResponse: + description: AI assistant KnowledgeBase. + type: object + properties: + success: + description: Identify the success of the method execution. + type: boolean Message: description: AI assistant conversation message. type: object @@ -999,6 +1726,23 @@ components: - message - status_code - anonymization_fields + NormalizedKnowledgeBaseEntryError: + type: object + properties: + err_code: + type: string + knowledgeBaseEntries: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' + type: array + message: + type: string + statusCode: + type: integer + required: + - message + - statusCode + - knowledgeBaseEntries NormalizedPromptError: type: object properties: @@ -1204,6 +1948,29 @@ components: type: string description: Replacements object used to anonymize/deanomymize messsages type: object + ResponseFields: + type: object + properties: + createdAt: + description: Time the Knowledge Base Entry was created + type: string + createdBy: + description: User who created the Knowledge Base Entry + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + description: Time the Knowledge Base Entry was last updated + type: string + updatedBy: + description: User who last updated the Knowledge Base Entry + type: string + required: + - id + - createdAt + - createdBy + - updatedAt + - updatedBy SortOrder: enum: - asc @@ -1229,6 +1996,23 @@ components: name: description: User name type: string + Vector: + description: >- + Object containing Knowledge Base Entry text embeddings and modelId used + to create the embeddings + type: object + properties: + modelId: + description: ID of the model used to create the embeddings + type: string + tokens: + additionalProperties: + type: number + description: Tokens with their corresponding values + type: object + required: + - modelId + - tokens securitySchemes: BasicAuth: scheme: basic diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml index 81112f1470547..be0c22efb99ab 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -418,6 +418,353 @@ paths: tags: - Security AI Assistant API - Conversation API + /api/security_ai_assistant/knowledge_base/{resource}: + get: + description: Read a single KB + operationId: ReadKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + responses: + '200': + content: + application/json: + schema: + type: object + properties: + elser_exists: + type: boolean + index_exists: + type: boolean + is_setup_available: + type: boolean + is_setup_in_progress: + type: boolean + pipeline_exists: + type: boolean + security_labs_exists: + type: boolean + user_data_exists: + type: boolean + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Read a KnowledgeBase + tags: + - Security AI Assistant API + - KnowledgeBase API + post: + description: Create a KnowledgeBase + operationId: CreateKnowledgeBase + parameters: + - description: The KnowledgeBase `resource` value. + in: path + name: resource + schema: + type: string + - description: Optional ELSER modelId to use when setting up the Knowledge Base + in: query + name: modelId + required: false + schema: + type: string + - description: >- + Indicates whether we should or should not install Security Labs docs + when setting up the Knowledge Base + in: query + name: ignoreSecurityLabs + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseResponse' + description: Indicates a successful call. + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Create a KnowledgeBase + tags: + - Security AI Assistant API + - KnowledgeBase API + /api/security_ai_assistant/knowledge_base/entries: + post: + description: Create a Knowledge Base Entry + operationId: CreateKnowledgeBaseEntry + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning Knowledge Base Entries + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Create a Knowledge Base Entry + tags: + - Security AI Assistant API + - Knowledge Base Entries API + /api/security_ai_assistant/knowledge_base/entries/_bulk_action: + post: + description: >- + The bulk action is applied to all Knowledge Base Entries that match the + filter or to the list of Knowledge Base Entries by their IDs + operationId: PerformKnowledgeBaseEntryBulkAction + requestBody: + content: + application/json: + schema: + type: object + properties: + create: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryCreateProps' + type: array + delete: + type: object + properties: + ids: + description: Array of Knowledge base Entry IDs + items: + type: string + minItems: 1 + type: array + query: + description: Query to filter Knowledge Base Entries + type: string + update: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResponse' + description: Successful bulk operation request + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Applies a bulk action to multiple Knowledge Base Entries + tags: + - Security AI Assistant API + - Knowledge Base Entries Bulk API + /api/security_ai_assistant/knowledge_base/entries/_find: + get: + description: Finds Knowledge Base Entries that match the given query. + operationId: FindKnowledgeBaseEntries + parameters: + - in: query + name: fields + required: false + schema: + items: + type: string + type: array + - description: Search query + in: query + name: filter + required: false + schema: + type: string + - description: Field to sort by + in: query + name: sort_field + required: false + schema: + $ref: '#/components/schemas/FindKnowledgeBaseEntriesSortField' + - description: Sort order + in: query + name: sort_order + required: false + schema: + $ref: '#/components/schemas/SortOrder' + - description: Page number + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: Knowledge Base Entries per page + in: query + name: per_page + required: false + schema: + default: 20 + minimum: 0 + type: integer + responses: + '200': + content: + application/json: + schema: + type: object + properties: + data: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + page: + type: integer + perPage: + type: integer + total: + type: integer + required: + - page + - perPage + - total + - data + description: Successful response + '400': + content: + application/json: + schema: + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + description: Generic Error + summary: Finds Knowledge Base Entries that match the given query. + tags: + - Security AI Assistant API + - Knowledge Base Entries API + /api/security_ai_assistant/knowledge_base/entries/{id}: + delete: + description: Deletes a single Knowledge Base Entry using the `id` field + operationId: DeleteKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponseFields' + description: Successful request returning the deleted Knowledge Base Entry's ID + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Deletes a single Knowledge Base Entry using the `id` field + tags: + - Security AI Assistant API + - Knowledge Base Entries API + get: + description: Read a Knowledge Base Entry + operationId: ReadKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value. + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning a Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Read a Knowledge Base Entry + tags: + - Security AI Assistant API + - Knowledge Base Entries API + put: + description: Update a Knowledge Base Entry + operationId: UpdateKnowledgeBaseEntry + parameters: + - description: The Knowledge Base Entry's `id` value + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NonEmptyString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryUpdateProps' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + description: Successful request returning the updated Knowledge Base Entry + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/KnowledgeBaseEntryErrorSchema' + description: Generic Error + summary: Update a Knowledge Base Entry + tags: + - Security AI Assistant API + - Knowledge Base Entries API /api/security_ai_assistant/prompts/_bulk_action: post: description: >- @@ -919,6 +1266,115 @@ components: type: string required: - id + DeleteResponseFields: + type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + required: + - id + DocumentEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/ResponseFields' + - $ref: '#/components/schemas/DocumentEntryResponseFields' + DocumentEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - $ref: '#/components/schemas/DocumentEntryRequiredFields' + - $ref: '#/components/schemas/DocumentEntryOptionalFields' + DocumentEntryOptionalFields: + type: object + properties: + required: + description: Whether this resource should always be included, defaults to false + type: boolean + vector: + $ref: '#/components/schemas/Vector' + DocumentEntryRequiredFields: + type: object + properties: + kbResource: + description: >- + Knowledge Base resource name for grouping entries, e.g. 'esql', + 'lens-docs', etc + type: string + source: + description: Source document name or filepath + type: string + text: + description: Knowledge Base Entry content + type: string + type: + description: Entry type + enum: + - document + type: string + required: + - type + - kbResource + - source + - text + DocumentEntryResponseFields: + allOf: + - $ref: '#/components/schemas/DocumentEntryRequiredFields' + - $ref: '#/components/schemas/DocumentEntryOptionalFields' + DocumentEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - $ref: '#/components/schemas/DocumentEntryCreateFields' FindAnonymizationFieldsSortField: enum: - created_at @@ -934,6 +1390,13 @@ components: - title - updated_at type: string + FindKnowledgeBaseEntriesSortField: + enum: + - created_at + - is_default + - title + - updated_at + type: string FindPromptsSortField: enum: - created_at @@ -941,6 +1404,270 @@ components: - name - updated_at type: string + IndexEntry: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - namespace + - users + - $ref: '#/components/schemas/ResponseFields' + - $ref: '#/components/schemas/IndexEntryResponseFields' + IndexEntryCreateFields: + allOf: + - type: object + properties: + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - name + - $ref: '#/components/schemas/IndexEntryRequiredFields' + - $ref: '#/components/schemas/IndexEntryOptionalFields' + IndexEntryOptionalFields: + type: object + properties: + inputSchema: + $ref: '#/components/schemas/InputSchema' + outputFields: + description: >- + Fields to extract from the query result, defaults to all fields if + not provided or empty + items: + type: string + type: array + IndexEntryRequiredFields: + type: object + properties: + description: + description: >- + Description for when this index or data stream should be queried for + Knowledge Base content. Passed to the LLM as a tool description + type: string + field: + description: Field to query for Knowledge Base content + type: string + index: + description: Index or Data Stream to query for Knowledge Base content + type: string + queryDescription: + description: >- + Description of query field used to fetch Knowledge Base content. + Passed to the LLM as part of the tool input schema + type: string + type: + description: Entry type + enum: + - index + type: string + required: + - type + - index + - field + - description + - queryDescription + IndexEntryResponseFields: + allOf: + - $ref: '#/components/schemas/IndexEntryRequiredFields' + - $ref: '#/components/schemas/IndexEntryOptionalFields' + IndexEntryUpdateFields: + allOf: + - type: object + properties: + id: + $ref: '#/components/schemas/NonEmptyString' + name: + description: Name of the Knowledge Base Entry + type: string + namespace: + description: Kibana Space, defaults to 'default' space + type: string + users: + description: >- + Users who have access to the Knowledge Base Entry, defaults to + current user. Empty array provides access to all users. + items: + $ref: '#/components/schemas/User' + type: array + required: + - id + - $ref: '#/components/schemas/IndexEntryCreateFields' + InputSchema: + description: >- + Array of objects defining the input schema, allowing the LLM to extract + structured data to be used in retrieval + items: + type: object + properties: + description: + description: Description of the field + type: string + fieldName: + description: Name of the field + type: string + fieldType: + description: Type of the field + type: string + required: + - fieldName + - fieldType + - description + type: array + KnowledgeBaseEntryBulkActionSkipReason: + enum: + - KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED + type: string + KnowledgeBaseEntryBulkActionSkipResult: + type: object + properties: + id: + type: string + name: + type: string + skip_reason: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipReason' + required: + - id + - skip_reason + KnowledgeBaseEntryBulkCrudActionResponse: + type: object + properties: + attributes: + type: object + properties: + errors: + items: + $ref: '#/components/schemas/NormalizedKnowledgeBaseEntryError' + type: array + results: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionResults' + summary: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkCrudActionSummary' + required: + - results + - summary + knowledgeBaseEntriesCount: + type: integer + message: + type: string + statusCode: + type: integer + success: + type: boolean + required: + - attributes + KnowledgeBaseEntryBulkCrudActionResults: + type: object + properties: + created: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + deleted: + items: + type: string + type: array + skipped: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryBulkActionSkipResult' + type: array + updated: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryResponse' + type: array + required: + - updated + - created + - deleted + - skipped + KnowledgeBaseEntryBulkCrudActionSummary: + type: object + properties: + failed: + type: integer + skipped: + type: integer + succeeded: + type: integer + total: + type: integer + required: + - failed + - skipped + - succeeded + - total + KnowledgeBaseEntryCreateProps: + anyOf: + - $ref: '#/components/schemas/DocumentEntryCreateFields' + - $ref: '#/components/schemas/IndexEntryCreateFields' + discriminator: + propertyName: type + KnowledgeBaseEntryDetailsInError: + type: object + properties: + id: + type: string + name: + type: string + required: + - id + KnowledgeBaseEntryErrorSchema: + additionalProperties: false + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - statusCode + - error + - message + KnowledgeBaseEntryResponse: + anyOf: + - $ref: '#/components/schemas/DocumentEntry' + - $ref: '#/components/schemas/IndexEntry' + discriminator: + propertyName: type + KnowledgeBaseEntryUpdateProps: + anyOf: + - $ref: '#/components/schemas/DocumentEntryUpdateFields' + - $ref: '#/components/schemas/IndexEntryUpdateFields' + discriminator: + propertyName: type + KnowledgeBaseResponse: + description: AI assistant KnowledgeBase. + type: object + properties: + success: + description: Identify the success of the method execution. + type: boolean Message: description: AI assistant conversation message. type: object @@ -999,6 +1726,23 @@ components: - message - status_code - anonymization_fields + NormalizedKnowledgeBaseEntryError: + type: object + properties: + err_code: + type: string + knowledgeBaseEntries: + items: + $ref: '#/components/schemas/KnowledgeBaseEntryDetailsInError' + type: array + message: + type: string + statusCode: + type: integer + required: + - message + - statusCode + - knowledgeBaseEntries NormalizedPromptError: type: object properties: @@ -1204,6 +1948,29 @@ components: type: string description: Replacements object used to anonymize/deanomymize messsages type: object + ResponseFields: + type: object + properties: + createdAt: + description: Time the Knowledge Base Entry was created + type: string + createdBy: + description: User who created the Knowledge Base Entry + type: string + id: + $ref: '#/components/schemas/NonEmptyString' + updatedAt: + description: Time the Knowledge Base Entry was last updated + type: string + updatedBy: + description: User who last updated the Knowledge Base Entry + type: string + required: + - id + - createdAt + - createdBy + - updatedAt + - updatedBy SortOrder: enum: - asc @@ -1229,6 +1996,23 @@ components: name: description: User name type: string + Vector: + description: >- + Object containing Knowledge Base Entry text embeddings and modelId used + to create the embeddings + type: object + properties: + modelId: + description: ID of the model used to create the embeddings + type: string + tokens: + additionalProperties: + type: number + description: Tokens with their corresponding values + type: object + required: + - modelId + - tokens securitySchemes: BasicAuth: scheme: basic diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts index a4f38cafd460b..ce1865496cd35 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: KnowledgeBase API endpoints - * version: 1 + * version: 2023-10-31 */ import { z } from '@kbn/zod'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml index 67193212abb49..90617149886f6 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/crud_kb_route.schema.yaml @@ -1,9 +1,9 @@ openapi: 3.0.0 info: title: KnowledgeBase API endpoints - version: '1' + version: '2023-10-31' paths: - /internal/elastic_assistant/knowledge_base/{resource}: + /api/security_ai_assistant/knowledge_base/{resource}: post: x-codegen-enabled: true x-labels: [ess, serverless] diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts index 44759badb7374..631b8c27a6387 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Bulk Knowledge Base Actions API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from '@kbn/zod'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.http b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.http index 873a7299820f0..b3ab8827086a1 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.http +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.http @@ -1,5 +1,5 @@ ### Empty Bulk Action -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries/_bulk_action +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries/_bulk_action kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml index db68416b14561..0688fc5d3faca 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.schema.yaml @@ -1,13 +1,11 @@ openapi: 3.0.0 info: title: Bulk Knowledge Base Actions API endpoint - version: '1' + version: '2023-10-31' paths: - /internal/elastic_assistant/knowledge_base/entries/_bulk_action: + /api/security_ai_assistant/knowledge_base/entries/_bulk_action: post: x-codegen-enabled: true - # Targeted to update to public by 8.18 - x-internal: true x-labels: [ess, serverless] operationId: PerformKnowledgeBaseEntryBulkAction summary: Applies a bulk action to multiple Knowledge Base Entries diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts index c32517fec0860..8a9e4b89e971f 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts @@ -136,6 +136,11 @@ export const ResponseFields = z.object({ updatedBy: z.string(), }); +export type DeleteResponseFields = z.infer<typeof DeleteResponseFields>; +export const DeleteResponseFields = z.object({ + id: NonEmptyString, +}); + export type SharedResponseProps = z.infer<typeof SharedResponseProps>; export const SharedResponseProps = BaseResponseProps.merge(ResponseFields); @@ -250,3 +255,6 @@ export const KnowledgeBaseEntryUpdateProps = z.discriminatedUnion('type', [ export type KnowledgeBaseEntryResponse = z.infer<typeof KnowledgeBaseEntryResponse>; export const KnowledgeBaseEntryResponse = z.discriminatedUnion('type', [DocumentEntry, IndexEntry]); + +export type KnowledgeBaseEntryDeleteResponse = z.infer<typeof KnowledgeBaseEntryDeleteResponse>; +export const KnowledgeBaseEntryDeleteResponse = DeleteResponseFields; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml index af7f4dd8e4221..91b082e4aac44 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.schema.yaml @@ -150,6 +150,14 @@ components: - updatedAt - updatedBy + DeleteResponseFields: + type: object + properties: + id: + $ref: "../../common_attributes.schema.yaml#/components/schemas/NonEmptyString" + required: + - id + SharedResponseProps: x-inline: true allOf: @@ -306,3 +314,7 @@ components: anyOf: - $ref: "#/components/schemas/DocumentEntry" - $ref: "#/components/schemas/IndexEntry" + + KnowledgeBaseEntryDeleteResponse: + allOf: + - $ref: "#/components/schemas/DeleteResponseFields" diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts index 1650f4ddc3cc6..d47f90b2446df 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Manage Knowledge Base Entries API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from '@kbn/zod'; @@ -20,6 +20,7 @@ import { KnowledgeBaseEntryCreateProps, KnowledgeBaseEntryResponse, KnowledgeBaseEntryUpdateProps, + DeleteResponseFields, } from './common_attributes.gen'; import { NonEmptyString } from '../../common_attributes.gen'; @@ -48,7 +49,7 @@ export type DeleteKnowledgeBaseEntryRequestParamsInput = z.input< >; export type DeleteKnowledgeBaseEntryResponse = z.infer<typeof DeleteKnowledgeBaseEntryResponse>; -export const DeleteKnowledgeBaseEntryResponse = KnowledgeBaseEntryResponse; +export const DeleteKnowledgeBaseEntryResponse = DeleteResponseFields; export type ReadKnowledgeBaseEntryRequestParams = z.infer< typeof ReadKnowledgeBaseEntryRequestParams diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.http b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.http index 6bd8dc7ba288b..123e00f2dbc8f 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.http +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.http @@ -1,5 +1,5 @@ ### Create Document Entry [Admin] [Private] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} @@ -16,7 +16,7 @@ X-Kbn-Context: {{appContext.security}} } ### Create Document Entry [Admin] [Global] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} @@ -34,7 +34,7 @@ X-Kbn-Context: {{appContext.security}} } ### Create Document Entry [Assistant All] [Private] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} @@ -51,7 +51,7 @@ X-Kbn-Context: {{appContext.security}} } ### Create Document Entry [Assistant All] [Global] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} @@ -69,7 +69,7 @@ X-Kbn-Context: {{appContext.security}} } ### Create Index Entry [Admin] [Private] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} @@ -89,7 +89,7 @@ X-Kbn-Context: {{appContext.security}} } ### Create Index Entry [Admin] [Global] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} @@ -110,7 +110,7 @@ X-Kbn-Context: {{appContext.security}} } ### Create Index Entry [Assistant All] [Private] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} @@ -129,7 +129,7 @@ X-Kbn-Context: {{appContext.security}} } ### Create Index Entry [Assistant All] [Global] -POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries +POST http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries kbn-xsrf: "true" Content-Type: application/json Elastic-Api-Version: {{elasticApiVersion}} diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml index 10105ef7dce90..4c80999d2c926 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.schema.yaml @@ -1,13 +1,11 @@ openapi: 3.0.0 info: title: Manage Knowledge Base Entries API endpoint - version: '1' + version: '2023-10-31' paths: - /internal/elastic_assistant/knowledge_base/entries: + /api/security_ai_assistant/knowledge_base/entries: post: x-codegen-enabled: true - # Targeted to update to public by 8.18 - x-internal: true x-labels: [ess, serverless] operationId: CreateKnowledgeBaseEntry description: Create a Knowledge Base Entry @@ -34,11 +32,9 @@ paths: schema: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryErrorSchema' - /internal/elastic_assistant/knowledge_base/entries/{id}: + /api/security_ai_assistant/knowledge_base/entries/{id}: get: x-codegen-enabled: true - # Targeted to update to public by 8.18 - x-internal: true x-labels: [ess, serverless] operationId: ReadKnowledgeBaseEntry description: Read a Knowledge Base Entry @@ -67,8 +63,6 @@ paths: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryErrorSchema' put: x-codegen-enabled: true - # Targeted to update to public by 8.18 - x-internal: true x-labels: [ess, serverless] operationId: UpdateKnowledgeBaseEntry description: Update a Knowledge Base Entry @@ -103,8 +97,6 @@ paths: $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryErrorSchema' delete: x-codegen-enabled: true - # Targeted to update to public by 8.18 - x-internal: true x-labels: [ess, serverless] operationId: DeleteKnowledgeBaseEntry description: Deletes a single Knowledge Base Entry using the `id` field @@ -120,11 +112,11 @@ paths: $ref: '../../common_attributes.schema.yaml#/components/schemas/NonEmptyString' responses: 200: - description: Successful request returning the deleted Knowledge Base Entry + description: Successful request returning the deleted Knowledge Base Entry's ID content: application/json: schema: - $ref: './common_attributes.schema.yaml#/components/schemas/KnowledgeBaseEntryResponse' + $ref: './common_attributes.schema.yaml#/components/schemas/DeleteResponseFields' 400: description: Generic Error content: diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts index 81930d69bb265..b27e003b3681d 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts @@ -11,7 +11,7 @@ * * info: * title: Find Knowledge Base Entries API endpoint - * version: 1 + * version: 2023-10-31 */ import { z } from '@kbn/zod'; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.http b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.http index 81733c62838a4..b68f37374c236 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.http +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.http @@ -1,5 +1,5 @@ ### Find all knowledge base entries -GET http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries/_find +GET http://{{host}}:{{port}}{{basePath}}/api/security_ai_assistant/knowledge_base/entries/_find Elastic-Api-Version: {{elasticApiVersion}} Authorization: Basic {{auth.admin.username}} {{auth.admin.password}} X-Kbn-Context: {{appContext.security}} diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml index 9b9696e8760fc..1b333d18a0d4a 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.schema.yaml @@ -1,13 +1,11 @@ openapi: 3.0.0 info: title: Find Knowledge Base Entries API endpoint - version: '1' + version: '2023-10-31' paths: - /internal/elastic_assistant/knowledge_base/entries/_find: + /api/security_ai_assistant/knowledge_base/entries/_find: get: x-codegen-enabled: true - # Targeted to update to public by 8.18 - x-internal: true x-labels: [ess, serverless] operationId: FindKnowledgeBaseEntries description: Finds Knowledge Base Entries that match the given query. diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/get_knowledge_base_indices_route.schema.yaml b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/get_knowledge_base_indices_route.schema.yaml index 2dbbc7b5cb527..ca4da6082a37a 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/get_knowledge_base_indices_route.schema.yaml +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/knowledge_base/get_knowledge_base_indices_route.schema.yaml @@ -6,6 +6,7 @@ paths: /internal/elastic_assistant/knowledge_base/_indices: get: x-codegen-enabled: true + x-internal: true x-labels: [ess, serverless] operationId: GetKnowledgeBaseIndices description: Gets Knowledge Base indices that have fields of a `sematic_text` type. diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.test.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.test.tsx index 2a1ffc5072570..62413538666a0 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.test.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.test.tsx @@ -8,6 +8,7 @@ import { HttpSetup } from '@kbn/core-http-browser'; import { getKnowledgeBaseIndices, getKnowledgeBaseStatus, postKnowledgeBase } from './api'; +import { API_VERSIONS } from '@kbn/spaces-plugin/common'; jest.mock('@kbn/core-http-browser'); @@ -30,11 +31,11 @@ describe('API tests', () => { await getKnowledgeBaseStatus(knowledgeBaseArgs); expect(mockHttp.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/knowledge_base/a-resource', + '/api/security_ai_assistant/knowledge_base/a-resource', { method: 'GET', signal: undefined, - version: '1', + version: API_VERSIONS.public.v1, } ); }); @@ -55,11 +56,11 @@ describe('API tests', () => { await postKnowledgeBase(knowledgeBaseArgs); expect(mockHttp.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/knowledge_base/a-resource', + '/api/security_ai_assistant/knowledge_base/a-resource', { method: 'POST', signal: undefined, - version: '1', + version: API_VERSIONS.public.v1, } ); }); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.tsx index 00fe022ad9517..06a6a4535dc8f 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/api.tsx @@ -40,7 +40,7 @@ export const getKnowledgeBaseStatus = async ({ const response = await http.fetch(path, { method: 'GET', signal, - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, }); return response as ReadKnowledgeBaseResponse; @@ -71,7 +71,7 @@ export const postKnowledgeBase = async ({ const response = await http.fetch(path, { method: 'POST', signal, - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, }); return response as CreateKnowledgeBaseResponse; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_create_knowledge_base_entry.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_create_knowledge_base_entry.tsx index f4edcb0d8d442..769c8e5e25aa9 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_create_knowledge_base_entry.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_create_knowledge_base_entry.tsx @@ -20,7 +20,7 @@ import { useInvalidateKnowledgeBaseEntries } from './use_knowledge_base_entries' const CREATE_KNOWLEDGE_BASE_ENTRY_MUTATION_KEY = [ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, - API_VERSIONS.internal.v1, + API_VERSIONS.public.v1, ]; export interface UseCreateKnowledgeBaseEntryParams { @@ -54,7 +54,7 @@ export const useCreateKnowledgeBaseEntry = ({ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, { body: JSON.stringify(entry), - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, } ); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.test.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.test.tsx index 439460862e6d4..7af5e38fdb6a5 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.test.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.test.tsx @@ -11,6 +11,7 @@ import { UseDeleteKnowledgeEntriesParams, } from './use_delete_knowledge_base_entries'; import { useInvalidateKnowledgeBaseEntries } from './use_knowledge_base_entries'; +import { API_VERSIONS } from '@kbn/elastic-assistant-common'; jest.mock('./use_knowledge_base_entries', () => ({ useInvalidateKnowledgeBaseEntries: jest.fn(), @@ -66,7 +67,7 @@ describe('useDeleteKnowledgeBaseEntries', () => { expect.any(String), expect.objectContaining({ body: JSON.stringify({ delete: { query: '', ids: ['1'] } }), - version: '1', + version: API_VERSIONS.public.v1, }) ); expect(invalidateKnowledgeBaseEntries).toHaveBeenCalled(); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.tsx index 0cfce8f576b24..2e0961a078208 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries.tsx @@ -21,7 +21,7 @@ import { useInvalidateKnowledgeBaseEntries } from './use_knowledge_base_entries' const DELETE_KNOWLEDGE_BASE_ENTRIES_MUTATION_KEY = [ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, - API_VERSIONS.internal.v1, + API_VERSIONS.public.v1, ]; export interface UseDeleteKnowledgeEntriesParams { @@ -61,7 +61,7 @@ export const useDeleteKnowledgeBaseEntries = ({ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, { body: JSON.stringify(body), - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, } ); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_knowledge_base_entries.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_knowledge_base_entries.ts index 0775ed2d27a36..a654fc9fbe0cf 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_knowledge_base_entries.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_knowledge_base_entries.ts @@ -36,7 +36,7 @@ export const KNOWLEDGE_BASE_ENTRY_QUERY_KEY = [ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, defaultQuery.page, defaultQuery.per_page, - API_VERSIONS.internal.v1, + API_VERSIONS.public.v1, ]; /** @@ -66,7 +66,7 @@ export const useKnowledgeBaseEntries = ({ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, { method: 'GET', - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, query, signal, } diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.test.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.test.tsx index 141ea5b47a8b1..20acd57b8745d 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.test.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.test.tsx @@ -11,6 +11,7 @@ import { UseUpdateKnowledgeBaseEntriesParams, } from './use_update_knowledge_base_entries'; import { useInvalidateKnowledgeBaseEntries } from './use_knowledge_base_entries'; +import { API_VERSIONS } from '@kbn/elastic-assistant-common'; jest.mock('./use_knowledge_base_entries', () => ({ useInvalidateKnowledgeBaseEntries: jest.fn(), @@ -67,7 +68,7 @@ describe('useUpdateKnowledgeBaseEntries', () => { expect.any(String), expect.objectContaining({ body: JSON.stringify({ update: defaultArgs }), - version: '1', + version: API_VERSIONS.public.v1, }) ); expect(invalidateKnowledgeBaseEntries).toHaveBeenCalled(); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.tsx index e717c6786cd25..95278f7382be8 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/entries/use_update_knowledge_base_entries.tsx @@ -20,7 +20,7 @@ import { useInvalidateKnowledgeBaseEntries } from './use_knowledge_base_entries' const BULK_UPDATE_KNOWLEDGE_BASE_ENTRY_MUTATION_KEY = [ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, - API_VERSIONS.internal.v1, + API_VERSIONS.public.v1, 'UPDATE', ]; @@ -58,7 +58,7 @@ export const useUpdateKnowledgeBaseEntries = ({ ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, { body: JSON.stringify(body), - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, signal, } ); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx index 69fccba092ee9..a7d73c8b10a62 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx @@ -8,6 +8,7 @@ import { waitFor, renderHook } from '@testing-library/react'; import { useKnowledgeBaseStatus, UseKnowledgeBaseStatusParams } from './use_knowledge_base_status'; import { getKnowledgeBaseStatus as _getKnowledgeBaseStatus } from './api'; +import { API_VERSIONS } from '@kbn/elastic-assistant-common'; const getKnowledgeBaseStatusMock = _getKnowledgeBaseStatus as jest.Mock; @@ -52,11 +53,11 @@ describe('useKnowledgeBaseStatus', () => { renderHook(() => useKnowledgeBaseStatus(defaultProps)); await waitFor(() => { expect(defaultProps.http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/knowledge_base/', + '/api/security_ai_assistant/knowledge_base/', { method: 'GET', signal: undefined, - version: '1', + version: API_VERSIONS.public.v1, } ); expect(toasts.addError).not.toHaveBeenCalled(); @@ -66,11 +67,11 @@ describe('useKnowledgeBaseStatus', () => { renderHook(() => useKnowledgeBaseStatus({ ...defaultProps, resource: 'something' })); await waitFor(() => expect(defaultProps.http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/knowledge_base/something', + '/api/security_ai_assistant/knowledge_base/something', { method: 'GET', signal: undefined, - version: '1', + version: API_VERSIONS.public.v1, } ) ); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx index 802ddf74bdf72..f5ce14d9ab1b5 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx @@ -9,6 +9,7 @@ import { waitFor, renderHook } from '@testing-library/react'; import { useSetupKnowledgeBase, UseSetupKnowledgeBaseParams } from './use_setup_knowledge_base'; import { postKnowledgeBase as _postKnowledgeBase } from './api'; import { useMutation as _useMutation } from '@tanstack/react-query'; +import { API_VERSIONS } from '@kbn/elastic-assistant-common'; const postKnowledgeBaseMock = _postKnowledgeBase as jest.Mock; const useMutationMock = _useMutation as jest.Mock; @@ -53,10 +54,10 @@ describe('useSetupKnowledgeBase', () => { renderHook(() => useSetupKnowledgeBase(defaultProps)); await waitFor(() => { expect(defaultProps.http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/knowledge_base/', + '/api/security_ai_assistant/knowledge_base/', { method: 'POST', - version: '1', + version: API_VERSIONS.public.v1, } ); expect(toasts.addError).not.toHaveBeenCalled(); @@ -75,10 +76,10 @@ describe('useSetupKnowledgeBase', () => { renderHook(() => useSetupKnowledgeBase(defaultProps)); await waitFor(() => expect(defaultProps.http.fetch).toHaveBeenCalledWith( - '/internal/elastic_assistant/knowledge_base/something', + '/api/security_ai_assistant/knowledge_base/something', { method: 'POST', - version: '1', + version: API_VERSIONS.public.v1, } ) ); diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/tsconfig.json b/x-pack/platform/packages/shared/kbn-elastic-assistant/tsconfig.json index 0349d31758d0f..9e26a19706136 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/tsconfig.json +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/tsconfig.json @@ -39,5 +39,6 @@ "@kbn/core-chrome-browser", "@kbn/ai-assistant-icon", "@kbn/product-doc-base-plugin", + "@kbn/spaces-plugin", ] } diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/data_clients.mock.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/data_clients.mock.ts index 7c4abffff6520..42839280db520 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/data_clients.mock.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/data_clients.mock.ts @@ -60,6 +60,8 @@ const createKnowledgeBaseDataClientMock = () => { addKnowledgeBaseDocuments: jest.fn(), createInferenceEndpoint: jest.fn(), createKnowledgeBaseEntry: jest.fn(), + updateKnowledgeBaseEntry: jest.fn(), + deleteKnowledgeBaseEntry: jest.fn(), findDocuments: jest.fn(), getAssistantTools: jest.fn(), getKnowledgeBaseDocumentEntries: jest.fn(), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request.ts index 26db891242884..326b37ab219a3 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request.ts @@ -14,6 +14,9 @@ import { import type { DefendInsightsGetRequestQuery, DefendInsightsPostRequestBody, + DeleteKnowledgeBaseEntryRequestParams, + KnowledgeBaseEntryUpdateProps, + UpdateKnowledgeBaseEntryRequestParams, } from '@kbn/elastic-assistant-common'; import { AttackDiscoveryPostRequestBody, @@ -31,6 +34,7 @@ import { ELASTIC_AI_ASSISTANT_EVALUATE_URL, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_INDICES_URL, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, @@ -94,6 +98,27 @@ export const getBulkActionKnowledgeBaseEntryRequest = ( body, }); +export const getUpdateKnowledgeBaseEntryRequest = ({ + params, + body, +}: { + params: UpdateKnowledgeBaseEntryRequestParams; + body: KnowledgeBaseEntryUpdateProps; +}) => + requestMock.create({ + method: 'put', + path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID, + params, + body, + }); + +export const getDeleteKnowledgeBaseEntryRequest = (params: DeleteKnowledgeBaseEntryRequestParams) => + requestMock.create({ + method: 'delete', + path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID, + params, + }); + export const getGetCapabilitiesRequest = () => requestMock.create({ method: 'get', diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts index 854c83ac4f5a9..ab14236df5392 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts @@ -22,6 +22,7 @@ import { KnowledgeBaseEntryCreateProps, KnowledgeBaseEntryResponse, Metadata, + KnowledgeBaseEntryUpdateProps, } from '@kbn/elastic-assistant-common'; import pRetry from 'p-retry'; import { StructuredTool } from '@langchain/core/tools'; @@ -30,21 +31,36 @@ import { IndexPatternsFetcher } from '@kbn/data-views-plugin/server'; import { map } from 'lodash'; import { AIAssistantDataClient, AIAssistantDataClientParams } from '..'; import { GetElser } from '../../types'; -import { createKnowledgeBaseEntry, transformToCreateSchema } from './create_knowledge_base_entry'; -import { EsDocumentEntry, EsIndexEntry, EsKnowledgeBaseEntrySchema } from './types'; -import { transformESSearchToKnowledgeBaseEntry } from './transforms'; +import { + createKnowledgeBaseEntry, + getUpdateScript, + transformToCreateSchema, + transformToUpdateSchema, +} from './create_knowledge_base_entry'; +import { + EsDocumentEntry, + EsIndexEntry, + EsKnowledgeBaseEntrySchema, + UpdateKnowledgeBaseEntrySchema, +} from './types'; +import { transformESSearchToKnowledgeBaseEntry, transformESToKnowledgeBase } from './transforms'; import { SECURITY_LABS_RESOURCE, USER_RESOURCE } from '../../routes/knowledge_base/constants'; import { getKBVectorSearchQuery, getStructuredToolForIndexEntry, isModelAlreadyExistsError, } from './helpers'; -import { getKBUserFilter } from '../../routes/knowledge_base/entries/utils'; +import { + getKBUserFilter, + validateDocumentsModification, +} from '../../routes/knowledge_base/entries/utils'; import { loadSecurityLabs, getSecurityLabsDocsCount, } from '../../lib/langchain/content_loaders/security_labs_loader'; import { ASSISTANT_ELSER_INFERENCE_ID } from './field_maps_configuration'; +import { BulkOperationError } from '../../lib/data_stream/documents_data_writer'; +import { AUDIT_OUTCOME, KnowledgeBaseAuditAction, knowledgeBaseAuditEvent } from './audit_events'; /** * Params for when creating KbDataClient in Request Context Factory. Useful if needing to modify @@ -633,6 +649,118 @@ export class AIAssistantKnowledgeBaseDataClient extends AIAssistantDataClient { }); }; + /** + * Updates a Knowledge Base Entry. + * + * @param auditLogger + * @param knowledgeBaseEntryId + */ + public updateKnowledgeBaseEntry = async ({ + auditLogger, + knowledgeBaseEntry, + }: { + auditLogger?: AuditLogger; + knowledgeBaseEntry: KnowledgeBaseEntryUpdateProps; + }): Promise<{ + errors: BulkOperationError[]; + updatedEntry: KnowledgeBaseEntryResponse; + }> => { + const authenticatedUser = this.options.currentUser; + + if (authenticatedUser == null) { + throw new Error( + 'Authenticated user not found! Ensure kbDataClient was initialized from a request.' + ); + } + + await validateDocumentsModification(this, authenticatedUser, [knowledgeBaseEntry.id], 'update'); + + this.options.logger.debug( + () => `Updating Knowledge Base Entry:\n ${JSON.stringify(knowledgeBaseEntry, null, 2)}` + ); + this.options.logger.debug(`kbIndex: ${this.indexTemplateAndPattern.alias}`); + + const writer = await this.getWriter(); + const changedAt = new Date().toISOString(); + const { errors, docs_updated: docsUpdated } = await writer.bulk({ + documentsToUpdate: [ + transformToUpdateSchema({ + user: authenticatedUser, + updatedAt: changedAt, + entry: knowledgeBaseEntry, + global: knowledgeBaseEntry.users != null && knowledgeBaseEntry.users.length === 0, + }), + ], + getUpdateScript: (entry: UpdateKnowledgeBaseEntrySchema) => getUpdateScript({ entry }), + authenticatedUser, + }); + + // @ts-ignore-next-line TS2322 + const updatedEntry = transformESToKnowledgeBase(docsUpdated)?.[0]; + + if (updatedEntry) { + auditLogger?.log( + knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.UPDATE, + id: updatedEntry.id, + name: updatedEntry.name, + outcome: AUDIT_OUTCOME.SUCCESS, + }) + ); + } + + return { errors, updatedEntry }; + }; + + /** + * Deletes a new Knowledge Base Entry. + * + * @param auditLogger + * @param knowledgeBaseEntryId + */ + public deleteKnowledgeBaseEntry = async ({ + auditLogger, + knowledgeBaseEntryId, + }: { + auditLogger?: AuditLogger; + knowledgeBaseEntryId: string; + }): Promise<{ errors: BulkOperationError[]; docsDeleted: string[] } | null> => { + const authenticatedUser = this.options.currentUser; + + if (authenticatedUser == null) { + throw new Error( + 'Authenticated user not found! Ensure kbDataClient was initialized from a request.' + ); + } + + await validateDocumentsModification(this, authenticatedUser, [knowledgeBaseEntryId], 'delete'); + + this.options.logger.debug( + () => `Deleting Knowledge Base Entry:\n ID: ${JSON.stringify(knowledgeBaseEntryId, null, 2)}` + ); + this.options.logger.debug(`kbIndex: ${this.indexTemplateAndPattern.alias}`); + + const writer = await this.getWriter(); + const { errors, docs_deleted: docsDeleted } = await writer.bulk({ + documentsToDelete: [knowledgeBaseEntryId], + authenticatedUser, + }); + + if (docsDeleted.length) { + docsDeleted.forEach((docsDeletedId) => { + auditLogger?.log( + knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.DELETE, + id: docsDeletedId, + outcome: AUDIT_OUTCOME.SUCCESS, + }) + ); + }); + } + + return { errors, docsDeleted }; + }; + /** * Returns AssistantTools for any 'relevant' KB IndexEntries that exist in the knowledge base. * diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts index 9049c152183b0..cf6d07e4953cd 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts @@ -9,7 +9,7 @@ import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/ import { type IKibanaResponse, IRouter, Logger } from '@kbn/core/server'; import { AttackDiscoveryGetResponse, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, AttackDiscoveryGetRequestParams, } from '@kbn/elastic-assistant-common'; import { transformError } from '@kbn/securitysolution-es-utils'; @@ -32,7 +32,7 @@ export const getAttackDiscoveryRoute = (router: IRouter<ElasticAssistantRequestH }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, validate: { request: { params: buildRouteValidationWithZod(AttackDiscoveryGetRequestParams), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts index 7b17f0db6e7ab..1c5fc36dc56cf 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts @@ -9,7 +9,7 @@ import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/ import { type IKibanaResponse, IRouter, Logger } from '@kbn/core/server'; import { AttackDiscoveryCancelResponse, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, AttackDiscoveryCancelRequestParams, } from '@kbn/elastic-assistant-common'; import { transformError } from '@kbn/securitysolution-es-utils'; @@ -34,7 +34,7 @@ export const cancelAttackDiscoveryRoute = ( }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, validate: { request: { params: buildRouteValidationWithZod(AttackDiscoveryCancelRequestParams), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts index 717d4d5dbf72f..54fabb7891548 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts @@ -9,7 +9,7 @@ import { type IKibanaResponse, IRouter, Logger } from '@kbn/core/server'; import { AttackDiscoveryPostRequestBody, AttackDiscoveryPostResponse, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, Replacements, } from '@kbn/elastic-assistant-common'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; @@ -48,7 +48,7 @@ export const postAttackDiscoveryRoute = ( }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, validate: { request: { body: buildRouteValidationWithZod(AttackDiscoveryPostRequestBody), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts index 2b7a7cdb30d26..50c547d1d31a2 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts @@ -13,7 +13,7 @@ import { DEFEND_INSIGHTS_BY_ID, DefendInsightGetResponse, DefendInsightGetRequestParams, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, } from '@kbn/elastic-assistant-common'; import { transformError } from '@kbn/securitysolution-es-utils'; @@ -34,7 +34,7 @@ export const getDefendInsightRoute = (router: IRouter<ElasticAssistantRequestHan }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, validate: { request: { params: buildRouteValidationWithZod(DefendInsightGetRequestParams), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts index 28a64262c3c24..d967ee6537c9a 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts @@ -13,7 +13,7 @@ import { DEFEND_INSIGHTS, DefendInsightsGetResponse, DefendInsightsGetRequestQuery, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, } from '@kbn/elastic-assistant-common'; import { transformError } from '@kbn/securitysolution-es-utils'; @@ -34,7 +34,7 @@ export const getDefendInsightsRoute = (router: IRouter<ElasticAssistantRequestHa }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, validate: { request: { query: buildRouteValidationWithZod(DefendInsightsGetRequestQuery), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts index b309ec44f9fd7..21d6e775e7739 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts @@ -14,7 +14,7 @@ import { DEFEND_INSIGHTS, DefendInsightsPostRequestBody, DefendInsightsPostResponse, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, Replacements, } from '@kbn/elastic-assistant-common'; import { transformError } from '@kbn/securitysolution-es-utils'; @@ -54,7 +54,7 @@ export const postDefendInsightsRoute = (router: IRouter<ElasticAssistantRequestH }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, validate: { request: { body: buildRouteValidationWithZod(DefendInsightsPostRequestBody), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts index 82c8b4e0148fd..1a9b6af6cb674 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts @@ -48,7 +48,7 @@ import { transformToCreateSchema, transformToUpdateSchema, } from '../../../ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry'; -import { getKBUserFilter } from './utils'; +import { validateDocumentsModification } from './utils'; export interface BulkOperationError { message: string; @@ -167,7 +167,7 @@ const buildBulkResponse = ( export const bulkActionKnowledgeBaseEntriesRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .post({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, security: { authz: { @@ -182,7 +182,7 @@ export const bulkActionKnowledgeBaseEntriesRoute = (router: ElasticAssistantPlug }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { body: buildRouteValidationWithZod(PerformKnowledgeBaseEntryBulkActionRequestBody), @@ -235,7 +235,6 @@ export const bulkActionKnowledgeBaseEntriesRoute = (router: ElasticAssistantPlug const kbDataClient = await ctx.elasticAssistant.getAIAssistantKnowledgeBaseDataClient(); const spaceId = ctx.elasticAssistant.getSpaceId(); const authenticatedUser = checkResponse.currentUser; - const userFilter = getKBUserFilter(authenticatedUser); const manageGlobalKnowledgeBaseAIAssistant = kbDataClient?.options.manageGlobalKnowledgeBaseAIAssistant; @@ -266,39 +265,15 @@ export const bulkActionKnowledgeBaseEntriesRoute = (router: ElasticAssistantPlug } } - const validateDocumentsModification = async ( - documentIds: string[], - operation: 'delete' | 'update' - ) => { - if (!documentIds.length) { - return; - } - const documentsFilter = documentIds.map((id) => `_id:${id}`).join(' OR '); - const entries = await kbDataClient?.findDocuments<EsKnowledgeBaseEntrySchema>({ - page: 1, - perPage: 100, - filter: `${documentsFilter} AND ${userFilter}`, - }); - const availableEntries = entries - ? transformESSearchToKnowledgeBaseEntry(entries.data) - : []; - availableEntries.forEach((entry) => { - // RBAC validation - const isGlobal = entry.users != null && entry.users.length === 0; - if (isGlobal && !manageGlobalKnowledgeBaseAIAssistant) { - throw new Error( - `User lacks privileges to ${operation} global knowledge base entries` - ); - } - }); - const availableIds = availableEntries.map((doc) => doc.id); - const nonAvailableIds = documentIds.filter((id) => !availableIds.includes(id)); - if (nonAvailableIds.length > 0) { - throw new Error(`Could not find documents to ${operation}: ${nonAvailableIds}.`); - } - }; - await validateDocumentsModification(body.delete?.ids ?? [], 'delete'); await validateDocumentsModification( + kbDataClient, + authenticatedUser, + body.delete?.ids ?? [], + 'delete' + ); + await validateDocumentsModification( + kbDataClient, + authenticatedUser, body.update?.map((entry) => entry.id) ?? [], 'update' ); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts index cd1216713e18a..5d3171f49533f 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts @@ -23,7 +23,7 @@ import { performChecks } from '../../helpers'; export const createKnowledgeBaseEntryRoute = (router: ElasticAssistantPluginRouter): void => { router.versioned .post({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, security: { @@ -34,7 +34,7 @@ export const createKnowledgeBaseEntryRoute = (router: ElasticAssistantPluginRout }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { body: buildRouteValidationWithZod(KnowledgeBaseEntryCreateProps), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.test.ts new file mode 100644 index 0000000000000..730807550545d --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.test.ts @@ -0,0 +1,92 @@ +/* + * Copyright 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 { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import { requestContextMock } from '../../../__mocks__/request_context'; +import { serverMock } from '../../../__mocks__/server'; +import { deleteKnowledgeBaseEntryRoute } from './delete_route'; +import { getBasicEmptySearchResponse, getEmptyFindResult } from '../../../__mocks__/response'; +import { getDeleteKnowledgeBaseEntryRequest, requestMock } from '../../../__mocks__/request'; +import { authenticatedUser } from '../../../__mocks__/user'; +import { ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID } from '@kbn/elastic-assistant-common'; + +describe('Delete knowledge base entry route', () => { + let server: ReturnType<typeof serverMock.create>; + let { clients, context } = requestContextMock.createTools(); + const mockUser1 = authenticatedUser; + + beforeEach(() => { + server = serverMock.create(); + ({ clients, context } = requestContextMock.createTools()); + + clients.elasticAssistant.getAIAssistantKnowledgeBaseDataClient.findDocuments.mockResolvedValue( + Promise.resolve(getEmptyFindResult()) + ); // no current conversations + clients.elasticAssistant.getAIAssistantKnowledgeBaseDataClient.deleteKnowledgeBaseEntry.mockResolvedValue( + { errors: [], docsDeleted: ['04128c15-0d1b-4716-a4c5-46997ac7f3bd'] } + ); // creation succeeds + + context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( + elasticsearchClientMock.createSuccessTransportRequestPromise(getBasicEmptySearchResponse()) + ); + context.elasticAssistant.getCurrentUser.mockReturnValue(mockUser1); + deleteKnowledgeBaseEntryRoute(server.router); + }); + + describe('status codes', () => { + test('returns 200 with a conversation deleted via AIAssistantKnowledgeBaseDataClient', async () => { + const response = await server.inject( + getDeleteKnowledgeBaseEntryRequest({ id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd' }), + requestContextMock.convertContext(context) + ); + expect(response.status).toEqual(200); + }); + + test('returns 401 Unauthorized when request context getCurrentUser is not defined', async () => { + context.elasticAssistant.getCurrentUser.mockReturnValueOnce(null); + const response = await server.inject( + getDeleteKnowledgeBaseEntryRequest({ id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd' }), + requestContextMock.convertContext(context) + ); + expect(response.status).toEqual(401); + }); + }); + + describe('unhappy paths', () => { + test('catches error if deletion throws', async () => { + clients.elasticAssistant.getAIAssistantKnowledgeBaseDataClient.deleteKnowledgeBaseEntry.mockImplementation( + async () => { + throw new Error('Test error'); + } + ); + const response = await server.inject( + getDeleteKnowledgeBaseEntryRequest({ id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd' }), + requestContextMock.convertContext(context) + ); + expect(response.status).toEqual(500); + expect(response.body).toEqual({ + message: 'Test error', + status_code: 500, + }); + }); + }); + + describe('request validation', () => { + test('disallows wrong name type', async () => { + const request = requestMock.create({ + method: 'delete', + path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, + params: { + id: '', + }, + }); + const result = server.validate(request); + + expect(result.badRequest).toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts new file mode 100644 index 0000000000000..74ae67fdb17e5 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/delete_route.ts @@ -0,0 +1,93 @@ +/* + * Copyright 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 { IKibanaResponse } from '@kbn/core/server'; +import { transformError } from '@kbn/securitysolution-es-utils'; +import { + API_VERSIONS, + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID, +} from '@kbn/elastic-assistant-common'; +import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; +import { + DeleteKnowledgeBaseEntryRequestParams, + DeleteKnowledgeBaseEntryResponse, +} from '@kbn/elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen'; +import { ElasticAssistantPluginRouter } from '../../../types'; +import { buildResponse } from '../../utils'; +import { performChecks } from '../../helpers'; + +export const deleteKnowledgeBaseEntryRoute = (router: ElasticAssistantPluginRouter): void => { + router.versioned + .delete({ + access: 'public', + path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID, + + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, + }) + .addVersion( + { + version: API_VERSIONS.public.v1, + validate: { + request: { + params: buildRouteValidationWithZod(DeleteKnowledgeBaseEntryRequestParams), + }, + }, + }, + async ( + context, + request, + response + ): Promise<IKibanaResponse<DeleteKnowledgeBaseEntryResponse>> => { + const assistantResponse = buildResponse(response); + try { + const ctx = await context.resolve(['core', 'elasticAssistant', 'licensing']); + const logger = ctx.elasticAssistant.logger; + + // Perform license, authenticated user and FF checks + const checkResponse = performChecks({ + context: ctx, + request, + response, + }); + if (!checkResponse.isSuccess) { + return checkResponse.response; + } + + logger.debug(() => `Deleting KB Entry:\n${JSON.stringify(request.body)}`); + + const kbDataClient = await ctx.elasticAssistant.getAIAssistantKnowledgeBaseDataClient(); + const deleteResponse = await kbDataClient?.deleteKnowledgeBaseEntry({ + knowledgeBaseEntryId: request.params.id, + auditLogger: ctx.elasticAssistant.auditLogger, + }); + + if (deleteResponse?.docsDeleted) { + return response.ok({ + body: { + id: deleteResponse?.docsDeleted[0], + }, + }); + } + + return assistantResponse.error({ + body: deleteResponse?.errors?.[0].message ?? `Knowledge Base Entry was not deleted`, + statusCode: 400, + }); + } catch (err) { + const error = transformError(err as Error); + return assistantResponse.error({ + body: error.message, + statusCode: error.statusCode, + }); + } + } + ); +}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts index 6ed6001a59dbc..6823c8d346b87 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts @@ -31,7 +31,7 @@ import { SECURITY_LABS_RESOURCE } from '../constants'; export const findKnowledgeBaseEntriesRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .get({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, security: { authz: { @@ -41,7 +41,7 @@ export const findKnowledgeBaseEntriesRoute = (router: ElasticAssistantPluginRout }) .addVersion( { - version: API_VERSIONS.internal.v1, + version: API_VERSIONS.public.v1, validate: { request: { query: buildRouteValidationWithZod(FindKnowledgeBaseEntriesRequestQuery), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.test.ts new file mode 100644 index 0000000000000..7f46434630172 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.test.ts @@ -0,0 +1,121 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import { requestContextMock } from '../../../__mocks__/request_context'; +import { serverMock } from '../../../__mocks__/server'; +import { updateKnowledgeBaseEntryRoute } from './update_route'; +import { + getBasicEmptySearchResponse, + getEmptyFindResult, + getFindKnowledgeBaseEntriesResultWithSingleHit, +} from '../../../__mocks__/response'; +import { getUpdateKnowledgeBaseEntryRequest, requestMock } from '../../../__mocks__/request'; +import { + getKnowledgeBaseEntryMock, + getQueryKnowledgeBaseEntryParams, + getUpdateKnowledgeBaseEntrySchemaMock, +} from '../../../__mocks__/knowledge_base_entry_schema.mock'; +import { authenticatedUser } from '../../../__mocks__/user'; +import { ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL } from '@kbn/elastic-assistant-common'; + +describe('Update knowledge base entry route', () => { + let server: ReturnType<typeof serverMock.create>; + let { clients, context } = requestContextMock.createTools(); + const mockUser1 = authenticatedUser; + + beforeEach(() => { + server = serverMock.create(); + ({ clients, context } = requestContextMock.createTools()); + + clients.elasticAssistant.getAIAssistantKnowledgeBaseDataClient.findDocuments.mockResolvedValue( + Promise.resolve(getEmptyFindResult()) + ); // no current conversations + clients.elasticAssistant.getAIAssistantKnowledgeBaseDataClient.updateKnowledgeBaseEntry.mockResolvedValue( + { + errors: [], + updatedEntry: getKnowledgeBaseEntryMock(getQueryKnowledgeBaseEntryParams(true)), + } + ); // creation succeeds + + context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( + elasticsearchClientMock.createSuccessTransportRequestPromise(getBasicEmptySearchResponse()) + ); + context.elasticAssistant.getCurrentUser.mockReturnValue(mockUser1); + updateKnowledgeBaseEntryRoute(server.router); + }); + + describe('status codes', () => { + test('returns 200 with a conversation updated via AIAssistantKnowledgeBaseDataClient', async () => { + clients.elasticAssistant.getAIAssistantKnowledgeBaseDataClient.findDocuments.mockResolvedValue( + Promise.resolve(getFindKnowledgeBaseEntriesResultWithSingleHit()) + ); + + const response = await server.inject( + getUpdateKnowledgeBaseEntryRequest({ + params: { id: '1' }, + body: getKnowledgeBaseEntryMock(getQueryKnowledgeBaseEntryParams(true)), + }), + requestContextMock.convertContext(context) + ); + expect(response.status).toEqual(200); + }); + + test('returns 401 Unauthorized when request context getCurrentUser is not defined', async () => { + context.elasticAssistant.getCurrentUser.mockReturnValueOnce(null); + const response = await server.inject( + getUpdateKnowledgeBaseEntryRequest({ + params: { id: '1' }, + body: getKnowledgeBaseEntryMock(getQueryKnowledgeBaseEntryParams(true)), + }), + requestContextMock.convertContext(context) + ); + expect(response.status).toEqual(401); + }); + }); + + describe('unhappy paths', () => { + test('catches error if update throws', async () => { + clients.elasticAssistant.getAIAssistantKnowledgeBaseDataClient.updateKnowledgeBaseEntry.mockImplementation( + async () => { + throw new Error('Test error'); + } + ); + const response = await server.inject( + getUpdateKnowledgeBaseEntryRequest({ + params: { id: '1' }, + body: getKnowledgeBaseEntryMock(getQueryKnowledgeBaseEntryParams(true)), + }), + requestContextMock.convertContext(context) + ); + expect(response.status).toEqual(500); + expect(response.body).toEqual({ + message: 'Test error', + status_code: 500, + }); + }); + }); + + describe('request validation', () => { + test('disallows POST request', async () => { + const request = requestMock.create({ + method: 'put', + path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL, + params: { + id: '1', + }, + body: { + ...getUpdateKnowledgeBaseEntrySchemaMock(), + name: true, + }, + }); + const result = server.validate(request); + + expect(result.badRequest).toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts new file mode 100644 index 0000000000000..4ef4cbeaaea50 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/update_route.ts @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IKibanaResponse } from '@kbn/core/server'; +import { transformError } from '@kbn/securitysolution-es-utils'; +import { + API_VERSIONS, + ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID, + UpdateKnowledgeBaseEntryRequestParams, +} from '@kbn/elastic-assistant-common'; +import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; +import { + KnowledgeBaseEntryResponse, + KnowledgeBaseEntryUpdateProps, +} from '@kbn/elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen'; +import { ElasticAssistantPluginRouter } from '../../../types'; +import { buildResponse } from '../../utils'; +import { performChecks } from '../../helpers'; + +export const updateKnowledgeBaseEntryRoute = (router: ElasticAssistantPluginRouter): void => { + router.versioned + .put({ + access: 'public', + path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BY_ID, + + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, + }) + .addVersion( + { + version: API_VERSIONS.public.v1, + validate: { + request: { + params: buildRouteValidationWithZod(UpdateKnowledgeBaseEntryRequestParams), + body: buildRouteValidationWithZod(KnowledgeBaseEntryUpdateProps), + }, + }, + }, + async (context, request, response): Promise<IKibanaResponse<KnowledgeBaseEntryResponse>> => { + const assistantResponse = buildResponse(response); + try { + const ctx = await context.resolve(['core', 'elasticAssistant', 'licensing']); + const logger = ctx.elasticAssistant.logger; + + // Perform license, authenticated user and FF checks + const checkResponse = performChecks({ + context: ctx, + request, + response, + }); + if (!checkResponse.isSuccess) { + return checkResponse.response; + } + + logger.debug(() => `Updating KB Entry:\n${JSON.stringify(request.body)}`); + + const kbDataClient = await ctx.elasticAssistant.getAIAssistantKnowledgeBaseDataClient(); + const updateResponse = await kbDataClient?.updateKnowledgeBaseEntry({ + knowledgeBaseEntry: { ...request.body, id: request.params.id }, + auditLogger: ctx.elasticAssistant.auditLogger, + }); + + if (updateResponse?.updatedEntry) { + return response.ok({ + body: updateResponse?.updatedEntry, + }); + } + + return assistantResponse.error({ + body: updateResponse?.errors?.[0].message ?? `Knowledge Base Entry was not created`, + statusCode: 400, + }); + } catch (err) { + const error = transformError(err as Error); + return assistantResponse.error({ + body: error.message, + statusCode: error.statusCode, + }); + } + } + ); +}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/utils.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/utils.ts index 0f5a0ab97fb29..38da2c733edc0 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/utils.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/utils.ts @@ -6,6 +6,9 @@ */ import { AuthenticatedUser } from '@kbn/core-security-common'; +import { AIAssistantKnowledgeBaseDataClient } from '../../../ai_assistant_data_clients/knowledge_base'; +import { transformESSearchToKnowledgeBaseEntry } from '../../../ai_assistant_data_clients/knowledge_base/transforms'; +import { EsKnowledgeBaseEntrySchema } from '../../../ai_assistant_data_clients/knowledge_base/types'; export const getKBUserFilter = (user: AuthenticatedUser | null) => { // Only return the current users entries and all other global entries (where user[] is empty) @@ -24,3 +27,37 @@ export const getKBUserFilter = (user: AuthenticatedUser | null) => { return `(${globalFilter}${userFilter})`; }; + +export const validateDocumentsModification = async ( + kbDataClient: AIAssistantKnowledgeBaseDataClient | null, + authenticatedUser: AuthenticatedUser | null, + documentIds: string[], + operation: 'delete' | 'update' +) => { + if (!documentIds.length) { + return; + } + const manageGlobalKnowledgeBaseAIAssistant = + kbDataClient?.options?.manageGlobalKnowledgeBaseAIAssistant; + + const userFilter = getKBUserFilter(authenticatedUser); + const documentsFilter = documentIds.map((id) => `_id:${id}`).join(' OR '); + const entries = await kbDataClient?.findDocuments<EsKnowledgeBaseEntrySchema>({ + page: 1, + perPage: 100, + filter: `${documentsFilter} AND ${userFilter}`, + }); + const availableEntries = entries ? transformESSearchToKnowledgeBaseEntry(entries.data) : []; + availableEntries.forEach((entry) => { + // RBAC validation + const isGlobal = entry.users != null && entry.users.length === 0; + if (isGlobal && !manageGlobalKnowledgeBaseAIAssistant) { + throw new Error(`User lacks privileges to ${operation} global knowledge base entries`); + } + }); + const availableIds = availableEntries.map((doc) => doc.id); + const nonAvailableIds = documentIds.filter((id) => !availableIds.includes(id)); + if (nonAvailableIds.length > 0) { + throw new Error(`Could not find documents to ${operation}: ${nonAvailableIds}.`); + } +}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts index b7da45f38b2aa..6eead8a0e317f 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts @@ -8,7 +8,7 @@ import { transformError } from '@kbn/securitysolution-es-utils'; import { - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_INDICES_URL, GetKnowledgeBaseIndicesResponse, } from '@kbn/elastic-assistant-common'; @@ -36,7 +36,7 @@ export const getKnowledgeBaseIndicesRoute = (router: ElasticAssistantPluginRoute }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, validate: false, }, async (context, _, response): Promise<IKibanaResponse<GetKnowledgeBaseIndicesResponse>> => { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts index c782fc6dc7a15..88d2e118f8648 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts @@ -8,7 +8,7 @@ import { transformError } from '@kbn/securitysolution-es-utils'; import { - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, ReadKnowledgeBaseRequestParams, ReadKnowledgeBaseResponse, @@ -26,7 +26,7 @@ import { ElasticAssistantPluginRouter } from '../../types'; export const getKnowledgeBaseStatusRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .get({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, security: { authz: { @@ -36,7 +36,7 @@ export const getKnowledgeBaseStatusRoute = (router: ElasticAssistantPluginRouter }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.public.v1, validate: { request: { params: buildRouteValidationWithZod(ReadKnowledgeBaseRequestParams), diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts index b57e9832c126c..b29d00fae5d2d 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts @@ -6,7 +6,7 @@ */ import { - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, CreateKnowledgeBaseRequestParams, CreateKnowledgeBaseResponse, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, @@ -28,7 +28,7 @@ const ROUTE_HANDLER_TIMEOUT = 10 * 60 * 1000; // 10 * 60 seconds = 10 minutes export const postKnowledgeBaseRoute = (router: ElasticAssistantPluginRouter) => { router.versioned .post({ - access: 'internal', + access: 'public', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, security: { authz: { @@ -43,7 +43,7 @@ export const postKnowledgeBaseRoute = (router: ElasticAssistantPluginRouter) => }) .addVersion( { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.public.v1, validate: { request: { params: buildRouteValidationWithZod(CreateKnowledgeBaseRequestParams), diff --git a/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx index 3a3bc955cf66c..9cc7b7c475c09 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx @@ -12,10 +12,7 @@ import type { GenerationInterval, AttackDiscoveryStats, } from '@kbn/elastic-assistant-common'; -import { - AttackDiscoveryPostResponse, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, -} from '@kbn/elastic-assistant-common'; +import { AttackDiscoveryPostResponse, API_VERSIONS } from '@kbn/elastic-assistant-common'; import { isEmpty } from 'lodash/fp'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useFetchAnonymizationFields } from '@kbn/elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields'; @@ -193,7 +190,7 @@ export const useAttackDiscovery = ({ // call the internal API to generate attack discoveries: const rawResponse = await http.post('/internal/elastic_assistant/attack_discovery', { body: JSON.stringify(bodyWithOverrides), - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, }); setIsLoadingPost(false); const parsedResponse = AttackDiscoveryPostResponse.safeParse(rawResponse); diff --git a/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx index 0b707349eb708..5910fb64705f1 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx @@ -15,7 +15,7 @@ import type { import { AttackDiscoveryCancelResponse, AttackDiscoveryGetResponse, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + API_VERSIONS, } from '@kbn/elastic-assistant-common'; import type { HttpSetup } from '@kbn/core-http-browser'; import moment from 'moment'; @@ -126,7 +126,7 @@ export const usePollApi = ({ `/internal/elastic_assistant/attack_discovery/cancel/${connectorId}`, { method: 'POST', - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, } ); const parsedResponse = AttackDiscoveryCancelResponse.safeParse(rawResponse); @@ -159,7 +159,7 @@ export const usePollApi = ({ `/internal/elastic_assistant/attack_discovery/${connectorId}`, { method: 'GET', - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, } ); diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts index d4eee941200f4..fb030af078c8f 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts @@ -6,7 +6,7 @@ */ import { useQuery } from '@tanstack/react-query'; -import { ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION } from '@kbn/elastic-assistant-common'; +import { API_VERSIONS } from '@kbn/elastic-assistant-common'; import { WORKFLOW_INSIGHTS } from '../../translations'; import type { SecurityWorkflowInsight } from '../../../../../../../common/endpoint/types/workflow_insights'; import { ActionType } from '../../../../../../../common/endpoint/types/workflow_insights'; @@ -27,7 +27,7 @@ export const useFetchInsights = ({ endpointId, onSuccess }: UseFetchInsightsConf async () => { try { const result = await http.get<SecurityWorkflowInsight[]>(WORKFLOW_INSIGHTS_ROUTE, { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, query: { actionTypes: JSON.stringify([ActionType.Refreshed]), targetIds: JSON.stringify([endpointId]), diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts index 6969ca0531f6c..b96e6d092a6c6 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts @@ -6,10 +6,10 @@ */ import { useQuery } from '@tanstack/react-query'; import { + API_VERSIONS, DEFEND_INSIGHTS, type DefendInsightsResponse, DefendInsightStatusEnum, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, } from '@kbn/elastic-assistant-common'; import { useEffect, useRef } from 'react'; import { WORKFLOW_INSIGHTS } from '../../translations'; @@ -45,7 +45,7 @@ export const useFetchOngoingScans = ({ async () => { try { const response = await http.get<{ data: DefendInsightsResponse[] }>(DEFEND_INSIGHTS, { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, query: { status: DefendInsightStatusEnum.running, endpoint_ids: [endpointId], diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts index efa5a937d442c..87ae37dd46063 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts @@ -8,9 +8,9 @@ import { useMutation } from '@tanstack/react-query'; import type { DefendInsightsResponse } from '@kbn/elastic-assistant-common'; import { + API_VERSIONS, DEFEND_INSIGHTS, DefendInsightTypeEnum, - ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, } from '@kbn/elastic-assistant-common'; import { useFetchAnonymizationFields } from '@kbn/elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields'; import { useKibana, useToasts } from '../../../../../../common/lib/kibana'; @@ -36,7 +36,7 @@ export const useTriggerScan = ({ onMutate, onSuccess }: UseTriggerScanConfig) => return useMutation<DefendInsightsResponse, { body?: { error: string } }, UseTriggerScanPayload>( ({ endpointId, connectorId, actionTypeId }: UseTriggerScanPayload) => http.post<DefendInsightsResponse>(DEFEND_INSIGHTS, { - version: ELASTIC_AI_ASSISTANT_INTERNAL_API_VERSION, + version: API_VERSIONS.internal.v1, body: JSON.stringify({ endpointIds: [endpointId], insightType: DefendInsightTypeEnum.incompatible_antivirus, diff --git a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/bulk_actions_entry.ts b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/bulk_actions_entry.ts index a709070d56fef..9b532b874e8ef 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/bulk_actions_entry.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/bulk_actions_entry.ts @@ -10,6 +10,7 @@ import type { ToolingLog } from '@kbn/tooling-log'; import type SuperTest from 'supertest'; import { ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, + API_VERSIONS, KnowledgeBaseEntryCreateProps, KnowledgeBaseEntryUpdateProps, PerformKnowledgeBaseEntryBulkActionResponse, @@ -50,7 +51,7 @@ export const bulkActionKnowledgeBaseEntries = async ({ const response = await supertest .post(route) .set('kbn-xsrf', 'true') - .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .send(payload) .expect(expectedHttpCode); @@ -93,7 +94,7 @@ export const bulkActionKnowledgeBaseEntriesForUser = async ({ .post(route) .auth(user.username, user.password) .set('kbn-xsrf', 'true') - .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .send(payload) .expect(expectedHttpCode); diff --git a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/create_entry.ts b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/create_entry.ts index 3b4507d0c4ba0..5358a53013165 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/create_entry.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/create_entry.ts @@ -9,6 +9,7 @@ import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import type { ToolingLog } from '@kbn/tooling-log'; import type SuperTest from 'supertest'; import { + API_VERSIONS, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, KnowledgeBaseEntryCreateProps, KnowledgeBaseEntryResponse, @@ -42,7 +43,7 @@ export const createEntry = async ({ const response = await supertest .post(route) .set('kbn-xsrf', 'true') - .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .send(entry) .expect(expectedHttpCode); @@ -78,7 +79,7 @@ export const createEntryForUser = async ({ .post(route) .auth(user.username, user.password) .set('kbn-xsrf', 'true') - .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .send(entry) .expect(expectedHttpCode); diff --git a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/find_entry.ts b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/find_entry.ts index 23dbfafe8d56b..4b9b7cd37d4b7 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/find_entry.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/find_entry.ts @@ -12,6 +12,7 @@ import { FindKnowledgeBaseEntriesResponse, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, FindKnowledgeBaseEntriesRequestQuery, + API_VERSIONS, } from '@kbn/elastic-assistant-common'; import type { User } from './auth/types'; @@ -39,7 +40,7 @@ export const findEntries = async ({ const response = await supertest .get(route) .set('kbn-xsrf', 'true') - .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .send(); if (response.status !== 200) { throw new Error( @@ -78,7 +79,7 @@ export const findEntriesForUser = async ({ .get(route) .auth(user.username, user.password) .set('kbn-xsrf', 'true') - .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .send(); if (response.status !== 200) { throw new Error( diff --git a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/helpers.ts b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/helpers.ts index 36b2963f5b538..a118fd8c565c2 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/helpers.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/utils/helpers.ts @@ -7,6 +7,7 @@ import { Client } from '@elastic/elasticsearch'; import { + API_VERSIONS, CreateKnowledgeBaseResponse, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_INDICES_URL, ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, @@ -73,7 +74,7 @@ export const setupKnowledgeBase = async ( const response = await supertest .post(route) .set('kbn-xsrf', 'true') - .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1) .send(); if (response.status !== 200) { throw new Error( From 16f6970d3f0a711cbad62e211f4af2d46721a8c8 Mon Sep 17 00:00:00 2001 From: "elastic-renovate-prod[bot]" <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 21:11:12 +0100 Subject: [PATCH 13/26] Update dependency @types/set-value to v4 (main) (#206189) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/set-value](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/set-value) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/set-value)) | devDependencies | major | [`^2.0.0` -> `^4.0.3`](https://renovatebot.com/diffs/npm/@types%2fset-value/2.0.0/4.0.3) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOlZpc3VhbGl6YXRpb25zIiwiYmFja3BvcnQ6YWxsLW9wZW4iLCJyZWxlYXNlX25vdGU6c2tpcCJdfQ==--> Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1a7443115a1a2..72e767f48dd54 100644 --- a/package.json +++ b/package.json @@ -1659,7 +1659,7 @@ "@types/seedrandom": ">=2.0.0 <4.0.0", "@types/selenium-webdriver": "^4.1.28", "@types/semver": "^7.5.8", - "@types/set-value": "^2.0.0", + "@types/set-value": "^4.0.3", "@types/sinon": "^7.0.13", "@types/source-map-support": "^0.5.3", "@types/stats-lite": "^2.2.0", diff --git a/yarn.lock b/yarn.lock index 52c2d5a51e206..28e059daf481f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12425,10 +12425,10 @@ "@types/mime" "^1" "@types/node" "*" -"@types/set-value@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-2.0.0.tgz#63d386b103926dcf49b50e16e0f6dd49983046be" - integrity sha512-k8dCJEC80F/mbsIOZ5Hj3YSzTVVVBwMdtP/M9Rtc2TM4F5etVd+2UG8QUiAUfbXm4fABedL2tBZnrBheY7UwpA== +"@types/set-value@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-4.0.3.tgz#ac7f5f9715c95c7351e02832df672a112428e587" + integrity sha512-tSuUcLl6kMzI+l0gG7FZ04xbIcynxNIYgWFj91LPAvRcn7W3L1EveXNdVjqFDgAZPjY1qCOsm8Sb1C70SxAPHw== "@types/sinon@^7.0.13": version "7.0.13" From 06d16614a98db092ee60c4e9c525a287c35cab31 Mon Sep 17 00:00:00 2001 From: Hanna Tamoudi <hanna.tamoudi@elastic.co> Date: Tue, 28 Jan 2025 21:55:42 +0100 Subject: [PATCH 14/26] [Automatic Import] rename plugin to automatic import (#207325) ## Summary Rename `integration-assistant` plugin to `automatic-import`. --- .eslintrc.js | 12 +- .github/CODEOWNERS | 2 +- ...ocs.json => automatic_import.devdocs.json} | 856 +++++++++--------- api_docs/automatic_import.mdx | 55 ++ api_docs/integration_assistant.mdx | 55 -- api_docs/plugin_directory.mdx | 2 +- docs/developer/plugin-list.asciidoc | 8 +- package.json | 2 +- packages/kbn-optimizer/limits.yml | 2 +- .../test_suites/core_plugins/rendering.ts | 2 +- tsconfig.base.json | 4 +- x-pack/.i18nrc.json | 2 +- .../translations/translations/fr-FR.json | 114 --- .../translations/translations/ja-JP.json | 114 --- .../translations/translations/zh-CN.json | 114 --- .../README.md | 4 +- .../__jest__/fixtures/api_analysis.ts | 0 .../__jest__/fixtures/build_integration.ts | 0 .../__jest__/fixtures/categorization.ts | 0 .../__jest__/fixtures/cel.ts | 0 .../__jest__/fixtures/ecs_mapping.ts | 0 .../__jest__/fixtures/index.ts | 0 .../__jest__/fixtures/kv.ts | 0 .../__jest__/fixtures/log_type_detection.ts | 0 .../__jest__/fixtures/related.ts | 0 .../__jest__/fixtures/unstructured.ts | 0 .../api/analyze_api/analyze_api_route.gen.ts | 0 .../analyze_api/analyze_api_route.schema.yaml | 0 .../api/analyze_api/analyze_api_route.test.ts | 0 .../analyze_logs/analyze_logs_route.gen.ts | 0 .../analyze_logs_route.schema.yaml | 0 .../analyze_logs/analyze_logs_route.test.ts | 0 .../build_integration.gen.ts | 2 +- .../build_integration.schema.yaml | 2 +- .../categorization_route.gen.ts | 2 +- .../categorization_route.schema.yaml | 2 +- .../categorization_route.test.ts | 0 .../common/api/cel/cel_input_route.gen.ts | 0 .../api/cel/cel_input_route.schema.yaml | 0 .../common/api/cel/cel_input_route.test.ts | 0 .../api/check_pipeline/check_pipeline.gen.ts | 2 +- .../check_pipeline/check_pipeline.schema.yaml | 2 +- .../common/api/ecs/ecs_route.gen.ts | 2 +- .../common/api/ecs/ecs_route.schema.yaml | 2 +- .../common/api/ecs/ecs_route.test.ts | 0 .../common/api/generation_error.test.ts | 0 .../common/api/generation_error.ts | 0 .../common/api/model/api_test.mock.ts | 0 .../api/model/cel_input_attributes.gen.ts | 0 .../model/cel_input_attributes.schema.yaml | 0 .../common/api/model/common_attributes.gen.ts | 0 .../api/model/common_attributes.schema.yaml | 0 .../api/model/processor_attributes.gen.ts | 0 .../model/processor_attributes.schema.yaml | 0 .../common/api/model/response_schemas.gen.ts | 0 .../api/model/response_schemas.schema.yaml | 0 .../common/api/related/related_route.gen.ts | 2 +- .../api/related/related_route.schema.yaml | 2 +- .../common/api/related/related_route.test.ts | 0 .../common/constants.ts | 24 +- .../common/ecs.ts | 0 .../common/experimental_features.ts | 4 +- .../common/index.ts | 4 +- .../common/utils.test.ts | 0 .../common/utils.ts | 0 .../docs/imgs/analyze_api_graph.png | Bin .../docs/imgs/categorization_graph.png | Bin .../docs/imgs/cel_graph.png | Bin .../docs/imgs/ecs_graph.png | Bin .../docs/imgs/ecs_subgraph.png | Bin .../docs/imgs/kv_graph.png | Bin .../docs/imgs/log_detection_graph.png | Bin .../docs/imgs/related_graph.png | Bin .../docs/imgs/unstructured_graph.png | Bin .../jest.config.js | 12 +- .../kibana.jsonc | 8 +- .../package.json | 2 +- .../authorization/authorization_wrapper.tsx | 0 .../common/components/authorization/index.ts | 0 .../missing_privileges_description.tsx | 0 .../missing_privileges_tooltip.tsx | 0 .../components/authorization/translations.ts | 21 +- .../availability_wrapper.tsx | 0 .../components/availability_wrapper/index.ts | 0 .../license_paywall_card.tsx | 0 .../availability_wrapper/translations.ts | 10 +- .../common/components/buttons_footer.tsx | 6 +- .../components/integration_image_header.tsx | 0 .../common/components/section_title.tsx | 0 .../common/components/section_wrapper.tsx | 0 .../components/success_section/index.ts | 0 .../success_section/success_section.tsx | 0 .../success_section/translations.ts | 16 +- .../public/common/constants.ts | 0 .../hooks/__mocks__/use_authorization.ts | 2 +- .../hooks/__mocks__/use_availability.ts | 0 .../public/common/hooks/use_authorization.ts | 4 +- .../public/common/hooks/use_availability.ts | 0 .../public/common/hooks/use_kibana.ts | 0 .../public/common/hooks/use_navigate.ts | 0 .../common/images/integrations_light.svg | 0 .../public/common/index.ts | 0 .../public/common/lib/api.ts | 0 .../public/common/lib/api_parsers.test.ts | 0 .../public/common/lib/api_parsers.ts | 0 .../public/common/lib/lang_smith.ts | 0 .../create_automatic_import.test.tsx} | 129 ++- .../create_automatic_import.tsx} | 4 +- .../cel_configuration/create_cel_config.tsx | 0 .../flyout/cel_configuration/footer.tsx | 0 .../cel_configuration/generation_error.tsx | 0 .../flyout/cel_configuration/index.ts | 0 .../confirm_settings_step/auth_selection.tsx | 0 .../confirm_settings_step.tsx | 0 .../endpoint_selection.tsx | 0 .../steps/confirm_settings_step/index.ts | 0 .../confirm_settings_step/translations.ts | 30 +- .../upload_spec_step/api_definition_input.tsx | 0 .../steps/upload_spec_step/index.ts | 0 .../steps/upload_spec_step/translations.ts | 53 +- .../upload_spec_step/upload_spec_step.tsx | 0 .../steps/upload_spec_step/util.ts | 0 .../flyout/cel_configuration/translations.ts | 16 +- .../footer/footer.test.tsx | 0 .../footer/footer.tsx | 0 .../create_automatic_import}/footer/index.ts | 0 .../footer/translations.ts | 8 +- .../header/header.tsx | 0 .../create_automatic_import}/header/index.ts | 0 .../create_automatic_import}/header/steps.tsx | 8 +- .../header/translations.ts | 11 +- .../create_automatic_import}/index.ts | 2 +- .../create_automatic_import}/mocks/state.ts | 0 .../create_automatic_import}/state.ts | 0 .../connector_step/connector_selector.tsx | 0 .../steps/connector_step/connector_setup.tsx | 0 .../connector_step/connector_step.test.tsx | 0 .../steps/connector_step/connector_step.tsx | 0 .../steps/connector_step/index.ts | 0 .../steps/connector_step/is_step_ready.ts | 0 .../steps/connector_step/translations.ts | 15 +- .../data_stream_step/data_stream_name.tsx | 0 .../data_stream_step.test.tsx | 0 .../data_stream_step/data_stream_step.tsx | 0 .../data_stream_step/error_with_link.test.tsx | 0 .../data_stream_step/error_with_link.tsx | 2 +- .../generation_modal.test.tsx | 8 +- .../data_stream_step/generation_modal.tsx | 0 .../steps/data_stream_step/index.ts | 0 .../steps/data_stream_step/is_step_ready.ts | 0 .../sample_logs_input.test.tsx | 0 .../data_stream_step/sample_logs_input.tsx | 0 .../steps/data_stream_step/translations.ts | 120 ++- .../steps/data_stream_step/use_generation.tsx | 0 .../use_load_package_names.ts | 0 .../steps/deploy_step/deploy_step.test.tsx | 81 +- .../steps/deploy_step/deploy_step.tsx | 0 .../steps/deploy_step/index.ts | 0 .../steps/deploy_step/translations.ts | 8 +- .../deploy_step/use_deploy_integration.ts | 0 .../steps/integration_step/index.ts | 0 .../integration_step.test.tsx | 0 .../integration_step/integration_step.tsx | 0 .../steps/integration_step/is_step_ready.ts | 0 .../integration_step/package_card_preview.tsx | 0 .../steps/integration_step/translations.ts | 25 +- .../steps/review_step/fields_table.tsx | 0 .../steps/review_step/index.ts | 0 .../steps/review_step/is_step_ready.ts | 0 .../steps/review_step/review_step.test.tsx | 0 .../steps/review_step/review_step.tsx | 0 .../steps/review_step/translations.ts | 10 +- .../steps/review_step/use_check_pipeline.ts | 0 .../steps/step_content_wrapper.tsx | 0 .../create_automatic_import}/types.ts | 0 .../create_integration.test.tsx | 10 +- .../create_integration/create_integration.tsx | 8 +- .../automatic_import_card.tsx} | 12 +- .../create_integration_landing.tsx | 8 +- .../create_integration_landing/index.ts | 0 .../translations.ts | 26 +- .../create_integration_upload.tsx | 0 .../docs_link_subtitle.tsx | 4 +- .../create_integration_upload/index.ts | 0 .../create_integration_upload/translations.ts | 34 + .../components/create_integration/index.tsx | 0 .../create_integration/telemetry.tsx | 12 +- .../components/create_integration/types.ts | 0 .../create_integration_card_button.test.tsx | 0 .../create_integration_card_button.tsx | 6 +- .../create_integration_card_button/index.tsx | 0 .../create_integration_card_button/types.ts | 0 .../public/index.ts | 6 +- .../public/mocks/test_provider.tsx | 0 .../public/plugin.ts | 27 +- .../services/experimental_features_service.ts | 0 .../public/services/index.ts | 0 .../public/services/mocks/services.ts | 0 .../public/services/telemetry/events.ts | 10 +- .../services/telemetry/mocks/service.ts | 0 .../public/services/telemetry/service.ts | 0 .../public/services/telemetry/types.ts | 40 +- .../public/services/types.ts | 4 +- .../public/types.ts | 8 +- .../public/util/oas.test.ts | 0 .../public/util/oas.ts | 0 .../scripts/draw_graphs.js | 0 .../scripts/draw_graphs_script.ts | 0 .../server/__mocks__/mock_server.ts | 0 .../server/__mocks__/request.ts | 0 .../server/__mocks__/request_context.ts | 2 +- .../server/__mocks__/response.ts | 0 .../server/__mocks__/test_adapters.ts | 0 .../server/config.ts | 20 +- .../server/constants.ts | 0 .../server/graphs/api_analysis/constants.ts | 0 .../server/graphs/api_analysis/graph.test.ts | 0 .../server/graphs/api_analysis/graph.ts | 0 .../server/graphs/api_analysis/index.ts | 0 .../server/graphs/api_analysis/paths.test.ts | 0 .../server/graphs/api_analysis/paths.ts | 0 .../server/graphs/api_analysis/prompts.ts | 0 .../server/graphs/api_analysis/types.ts | 0 .../categorization/categorization.test.ts | 0 .../graphs/categorization/categorization.ts | 0 .../server/graphs/categorization/constants.ts | 0 .../graphs/categorization/errors.test.ts | 0 .../server/graphs/categorization/errors.ts | 0 .../graphs/categorization/graph.test.ts | 0 .../server/graphs/categorization/graph.ts | 0 .../server/graphs/categorization/index.ts | 0 .../graphs/categorization/invalid.test.ts | 0 .../server/graphs/categorization/invalid.ts | 0 .../server/graphs/categorization/prompts.ts | 0 .../graphs/categorization/review.test.ts | 0 .../server/graphs/categorization/review.ts | 0 .../server/graphs/categorization/stable.ts | 0 .../server/graphs/categorization/types.ts | 0 .../server/graphs/categorization/util.test.ts | 0 .../server/graphs/categorization/util.ts | 0 .../graphs/categorization/validate.test.ts | 0 .../server/graphs/categorization/validate.ts | 0 .../server/graphs/cel/analyze_headers.test.ts | 0 .../server/graphs/cel/analyze_headers.ts | 0 .../server/graphs/cel/auth_basic.test.ts | 0 .../server/graphs/cel/auth_basic.ts | 0 .../server/graphs/cel/auth_digest.test.ts | 0 .../server/graphs/cel/auth_digest.ts | 0 .../server/graphs/cel/auth_header.ts | 0 .../server/graphs/cel/auth_oauth2.test.ts | 0 .../server/graphs/cel/auth_oauth2.ts | 0 .../server/graphs/cel/build_program.test.ts | 0 .../server/graphs/cel/build_program.ts | 0 .../server/graphs/cel/constants.ts | 0 .../server/graphs/cel/graph.test.ts | 0 .../server/graphs/cel/graph.ts | 0 .../server/graphs/cel/index.ts | 0 .../server/graphs/cel/prompts.ts | 0 .../graphs/cel/retrieve_state_details.test.ts | 0 .../graphs/cel/retrieve_state_details.ts | 0 .../graphs/cel/retrieve_state_vars.test.ts | 0 .../server/graphs/cel/retrieve_state_vars.ts | 0 .../server/graphs/cel/summarize_query.test.ts | 0 .../server/graphs/cel/summarize_query.ts | 0 .../server/graphs/cel/types.ts | 0 .../server/graphs/cel/util.test.ts | 0 .../server/graphs/cel/util.ts | 0 .../server/graphs/csv/columns.test.ts | 0 .../server/graphs/csv/columns.ts | 0 .../server/graphs/csv/csv.ts | 0 .../server/graphs/ecs/chunk.test.ts | 0 .../server/graphs/ecs/chunk.ts | 0 .../server/graphs/ecs/constants.ts | 0 .../server/graphs/ecs/duplicates.test.ts | 0 .../server/graphs/ecs/duplicates.ts | 0 .../server/graphs/ecs/graph.test.ts | 0 .../server/graphs/ecs/graph.ts | 0 .../server/graphs/ecs/index.ts | 0 .../server/graphs/ecs/invalid.test.ts | 0 .../server/graphs/ecs/invalid.ts | 0 .../server/graphs/ecs/mapping.test.ts | 0 .../server/graphs/ecs/mapping.ts | 0 .../server/graphs/ecs/missing.test.ts | 0 .../server/graphs/ecs/missing.ts | 0 .../server/graphs/ecs/model.ts | 0 .../server/graphs/ecs/pipeline.test.ts | 0 .../server/graphs/ecs/pipeline.ts | 0 .../server/graphs/ecs/prompts.ts | 0 .../server/graphs/ecs/state.ts | 0 .../server/graphs/ecs/types.ts | 0 .../server/graphs/ecs/validate.test.ts | 0 .../server/graphs/ecs/validate.ts | 0 .../server/graphs/kv/constants.ts | 0 .../server/graphs/kv/error.ts | 0 .../server/graphs/kv/graph.test.ts | 0 .../server/graphs/kv/graph.ts | 0 .../server/graphs/kv/header.test.ts | 0 .../server/graphs/kv/header.ts | 0 .../server/graphs/kv/index.ts | 0 .../server/graphs/kv/kv.test.ts | 0 .../server/graphs/kv/kv.ts | 0 .../server/graphs/kv/prompts.ts | 0 .../server/graphs/kv/types.ts | 0 .../server/graphs/kv/validate.ts | 0 .../graphs/log_type_detection/constants.ts | 0 .../log_type_detection/detection.test.ts | 0 .../graphs/log_type_detection/detection.ts | 0 .../graphs/log_type_detection/graph.test.ts | 0 .../server/graphs/log_type_detection/graph.ts | 0 .../graphs/log_type_detection/prompts.ts | 0 .../server/graphs/log_type_detection/types.ts | 0 .../server/graphs/related/constants.ts | 0 .../server/graphs/related/errors.test.ts | 0 .../server/graphs/related/errors.ts | 0 .../server/graphs/related/graph.test.ts | 0 .../server/graphs/related/graph.ts | 0 .../server/graphs/related/index.ts | 0 .../server/graphs/related/prompts.ts | 0 .../server/graphs/related/related.test.ts | 0 .../server/graphs/related/related.ts | 0 .../server/graphs/related/review.test.ts | 0 .../server/graphs/related/review.ts | 0 .../server/graphs/related/types.ts | 0 .../server/graphs/related/util.test.ts | 0 .../server/graphs/related/util.ts | 0 .../server/graphs/unstructured/constants.ts | 0 .../server/graphs/unstructured/error.ts | 0 .../server/graphs/unstructured/errors.test.ts | 0 .../server/graphs/unstructured/graph.test.ts | 0 .../server/graphs/unstructured/graph.ts | 0 .../server/graphs/unstructured/index.ts | 0 .../server/graphs/unstructured/prompts.ts | 0 .../server/graphs/unstructured/types.ts | 0 .../graphs/unstructured/unstructured.test.ts | 0 .../graphs/unstructured/unstructured.ts | 0 .../graphs/unstructured/validate.test.ts | 0 .../server/graphs/unstructured/validate.ts | 0 .../server/index.ts | 6 +- .../server/integration_builder/agent.test.ts | 0 .../server/integration_builder/agent.ts | 0 .../build_integration.test.ts | 2 +- .../integration_builder/build_integration.ts | 2 +- .../server/integration_builder/constants.ts | 0 .../integration_builder/data_stream.test.ts | 0 .../server/integration_builder/data_stream.ts | 0 .../server/integration_builder/dev_folders.ts | 0 .../server/integration_builder/fields.test.ts | 0 .../server/integration_builder/fields.ts | 0 .../server/integration_builder/index.ts | 0 .../integration_builder/pipeline.test.ts | 0 .../server/integration_builder/pipeline.ts | 0 .../integration_builder/readme_files.test.ts | 0 .../integration_builder/readme_files.ts | 0 .../server/lib/errors/cef_error.ts | 0 .../server/lib/errors/index.ts | 0 .../lib/errors/recursion_limit_error.ts | 0 .../server/lib/errors/types.ts | 0 .../lib/errors/unparseable_csv_error.ts | 0 .../server/lib/errors/unsupported_error.ts | 0 .../server/plugin.ts | 56 +- .../server/processor_types.ts | 0 .../server/routes/analyze_api_route.test.ts | 4 +- .../server/routes/analyze_api_route.ts | 8 +- .../server/routes/analyze_logs_routes.ts | 8 +- .../routes/build_integration_routes.test.ts | 4 +- .../server/routes/build_integration_routes.ts | 4 +- .../routes/categorization_routes.test.ts | 4 +- .../server/routes/categorization_routes.ts | 8 +- .../server/routes/cel_route.test.ts | 4 +- .../server/routes/cel_routes.ts | 6 +- .../server/routes/ecs_routes.test.ts | 4 +- .../server/routes/ecs_routes.ts | 6 +- .../server/routes/index.ts | 0 .../server/routes/pipeline_routes.test.ts | 4 +- .../server/routes/pipeline_routes.ts | 4 +- .../server/routes/register_routes.ts | 4 +- .../server/routes/related_routes.test.ts | 4 +- .../server/routes/related_routes.ts | 6 +- .../server/routes/routes_util.test.ts | 0 .../server/routes/routes_util.ts | 0 .../server/routes/with_availability.ts | 8 +- .../templates/agent/aws_cloudwatch.yml.hbs | 0 .../server/templates/agent/aws_s3.yml.hbs | 0 .../agent/azure_blob_storage.yml.hbs | 0 .../templates/agent/azure_eventhub.yml.hbs | 0 .../server/templates/agent/cel.yml.hbs | 0 .../templates/agent/cel_generated.yml.hbs.njk | 0 .../templates/agent/cloudfoundry.yml.hbs | 0 .../server/templates/agent/common.yml.hbs | 0 .../server/templates/agent/filestream.yml.hbs | 0 .../server/templates/agent/gcp_pubsub.yml.hbs | 0 .../server/templates/agent/gcs.yml.hbs | 0 .../templates/agent/http_endpoint.yml.hbs | 0 .../server/templates/agent/journald.yml.hbs | 0 .../server/templates/agent/kafka.yml.hbs | 0 .../server/templates/agent/logfile.yml.hbs | 0 .../server/templates/agent/tcp.yml.hbs | 0 .../server/templates/agent/udp.yml.hbs | 0 .../server/templates/base_fields.yml.njk | 0 .../server/templates/build.yml.njk | 0 .../server/templates/build_readme.md.njk | 0 .../server/templates/changelog.yml.njk | 0 .../templates/data_stream/fields/agent.yml | 0 .../templates/data_stream/fields/beats.yml | 0 .../server/templates/description_readme.njk | 0 .../manifest/aws_cloudwatch_manifest.yml.njk | 0 .../manifest/aws_s3_manifest.yml.njk | 0 .../azure_blob_storage_manifest.yml.njk | 0 .../manifest/azure_eventhub_manifest.yml.njk | 0 .../templates/manifest/cel_manifest.yml.njk | 0 .../manifest/cloudfoundry_manifest.yml.njk | 0 .../manifest/common_manifest.yml.njk | 0 .../templates/manifest/data_stream.yml.njk | 0 .../manifest/filestream_manifest.yml.njk | 0 .../manifest/gcp_pubsub_manifest.yml.njk | 0 .../templates/manifest/gcs_manifest.yml.njk | 0 .../manifest/http_endpoint_manifest.yml.njk | 0 .../manifest/journald_manifest.yml.njk | 0 .../templates/manifest/kafka_manifest.yml.njk | 0 .../manifest/logfile_manifest.yml.njk | 0 .../templates/manifest/ssl_manifest.yml.njk | 0 .../templates/manifest/tcp_manifest.yml.njk | 0 .../templates/manifest/udp_manifest.yml.njk | 0 .../server/templates/package_readme.md.njk | 0 .../server/templates/pipeline.yml.njk | 0 .../pipeline_tests/test_common_config.yml | 0 .../templates/processors/append.yml.njk | 0 .../server/templates/processors/grok.yml.njk | 0 .../server/templates/processors/kv.yml.njk | 0 .../readme/setup/aws-cloudwatch.md.njk | 0 .../templates/readme/setup/aws-s3.md.njk | 0 .../readme/setup/azure-blob-storage.md.njk | 0 .../readme/setup/azure-eventhub.md.njk | 0 .../server/templates/readme/setup/cel.md.njk | 0 .../templates/readme/setup/filestream.md.njk | 0 .../templates/readme/setup/gcp-pubsub.md.njk | 0 .../server/templates/readme/setup/gcs.md.njk | 0 .../readme/setup/http_endpoint.md.njk | 0 .../templates/readme/setup/journald.md.njk | 0 .../templates/readme/setup/kafka.md.njk | 0 .../templates/readme/setup/ssl-tls.md.njk | 0 .../server/templates/readme/setup/tcp.md.njk | 0 .../server/templates/readme/setup/udp.md.njk | 0 .../readme/troubleshooting/gcp.md.njk | 0 .../troubleshooting/http_endpoint.md.njk | 0 .../system_tests/docker_compose.yml.njk | 0 .../system_tests/service_filestream.njk | 0 .../templates/system_tests/service_gcs.njk | 0 .../system_tests/service_logfile.njk | 0 .../templates/system_tests/service_tcp.njk | 0 .../templates/system_tests/service_udp.njk | 0 .../test_filestream_config.yml.njk | 0 .../system_tests/test_gcs_config.yml.njk | 0 .../system_tests/test_logfile_config.yml.njk | 0 .../system_tests/test_tcp_config.yml.njk | 0 .../system_tests/test_udp_config.yml.njk | 0 .../server/types.ts | 8 +- .../server/util/fields.test.ts | 0 .../server/util/fields.ts | 0 .../server/util/files.ts | 0 .../server/util/graph.ts | 0 .../server/util/index.ts | 0 .../server/util/llm.ts | 0 .../server/util/painless.test.ts | 0 .../server/util/painless.ts | 0 .../server/util/pipeline.ts | 0 .../server/util/processors.ts | 0 .../server/util/route_validation.ts | 0 .../server/util/samples.test.ts | 0 .../server/util/samples.ts | 0 .../server/util/util.ts | 0 .../tsconfig.json | 0 .../e2e/integrations_automatic_import.cy.ts | 2 +- ...ileges_integrations_automatic_import.cy.ts | 8 +- .../screens/integrations_automatic_import.ts | 2 +- .../plugins/shared/fleet/kibana.jsonc | 2 +- .../integrations/layouts/default.tsx | 4 +- .../integrations/sections/epm/index.tsx | 4 +- .../sections/epm/screens/create/index.tsx | 6 +- .../plugins/shared/fleet/public/plugin.ts | 6 +- .../plugins/shared/fleet/tsconfig.json | 2 +- .../create_integration_upload/translations.ts | 43 - .../features/src/product_features_keys.ts | 4 +- .../src/security/product_feature_config.ts | 2 +- .../packages/upselling/service/types.ts | 2 +- .../plugins/security_solution/kibana.jsonc | 2 +- .../plugins/security_solution/public/types.ts | 4 +- .../plugins/security_solution/tsconfig.json | 2 +- .../common/pli/pli_config.ts | 2 +- .../security_solution_serverless/kibana.jsonc | 2 +- .../public/types.ts | 4 +- .../public/upselling/register_upsellings.tsx | 4 +- .../automatic_import.tsx} | 12 +- .../index.ts | 6 +- .../public/upselling/upsellings.tsx | 10 +- .../server/product_features/index.ts | 6 +- .../server/types.ts | 4 +- .../tsconfig.json | 2 +- .../common/config.ts | 2 +- .../common/lib/api/analyze_logs.ts | 2 +- .../common/lib/api/categorization.ts | 2 +- .../common/lib/api/ecs.ts | 2 +- .../common/lib/api/related.ts | 2 +- x-pack/test/tsconfig.json | 2 +- yarn.lock | 8 +- 505 files changed, 1095 insertions(+), 1484 deletions(-) rename api_docs/{integration_assistant.devdocs.json => automatic_import.devdocs.json} (76%) create mode 100644 api_docs/automatic_import.mdx delete mode 100644 api_docs/integration_assistant.mdx rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/README.md (96%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/api_analysis.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/build_integration.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/categorization.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/cel.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/ecs_mapping.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/kv.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/log_type_detection.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/related.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/__jest__/fixtures/unstructured.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/analyze_api/analyze_api_route.gen.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/analyze_api/analyze_api_route.schema.yaml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/analyze_api/analyze_api_route.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/analyze_logs/analyze_logs_route.gen.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/analyze_logs/analyze_logs_route.schema.yaml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/analyze_logs/analyze_logs_route.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/build_integration/build_integration.gen.ts (92%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/build_integration/build_integration.schema.yaml (93%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/categorization/categorization_route.gen.ts (95%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/categorization/categorization_route.schema.yaml (96%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/categorization/categorization_route.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/cel/cel_input_route.gen.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/cel/cel_input_route.schema.yaml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/cel/cel_input_route.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/check_pipeline/check_pipeline.gen.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/check_pipeline/check_pipeline.schema.yaml (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/ecs/ecs_route.gen.ts (95%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/ecs/ecs_route.schema.yaml (97%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/ecs/ecs_route.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/generation_error.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/generation_error.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/api_test.mock.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/cel_input_attributes.gen.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/cel_input_attributes.schema.yaml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/common_attributes.gen.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/common_attributes.schema.yaml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/processor_attributes.gen.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/processor_attributes.schema.yaml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/response_schemas.gen.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/model/response_schemas.schema.yaml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/related/related_route.gen.ts (95%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/related/related_route.schema.yaml (97%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/api/related/related_route.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/constants.ts (62%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/ecs.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/experimental_features.ts (89%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/index.ts (96%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/utils.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/common/utils.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/analyze_api_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/categorization_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/cel_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/ecs_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/ecs_subgraph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/kv_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/log_detection_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/related_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/docs/imgs/unstructured_graph.png (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/jest.config.js (51%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/kibana.jsonc (68%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/package.json (78%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/authorization/authorization_wrapper.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/authorization/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/authorization/missing_privileges_description.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/authorization/missing_privileges_tooltip.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/authorization/translations.ts (62%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/availability_wrapper/availability_wrapper.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/availability_wrapper/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/availability_wrapper/license_paywall_card.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/availability_wrapper/translations.ts (75%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/buttons_footer.tsx (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/integration_image_header.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/section_title.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/section_wrapper.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/success_section/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/success_section/success_section.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/components/success_section/translations.ts (66%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/hooks/__mocks__/use_authorization.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/hooks/__mocks__/use_availability.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/hooks/use_authorization.ts (90%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/hooks/use_availability.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/hooks/use_kibana.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/hooks/use_navigate.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/images/integrations_light.svg (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/lib/api.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/lib/api_parsers.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/lib/api_parsers.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/common/lib/lang_smith.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx => automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.test.tsx} (82%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx => automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.tsx} (97%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/create_cel_config.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/footer.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/generation_error.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/confirm_settings_step/auth_selection.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/confirm_settings_step/confirm_settings_step.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/confirm_settings_step/endpoint_selection.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/confirm_settings_step/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/confirm_settings_step/translations.ts (62%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/upload_spec_step/api_definition_input.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/upload_spec_step/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/upload_spec_step/translations.ts (57%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/upload_spec_step/upload_spec_step.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/steps/upload_spec_step/util.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/flyout/cel_configuration/translations.ts (66%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/footer/footer.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/footer/footer.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/footer/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/footer/translations.ts (54%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/header/header.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/header/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/header/steps.tsx (87%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/header/translations.ts (56%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/index.ts (76%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/mocks/state.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/state.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/connector_step/connector_selector.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/connector_step/connector_setup.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/connector_step/connector_step.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/connector_step/connector_step.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/connector_step/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/connector_step/is_step_ready.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/connector_step/translations.ts (62%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/data_stream_name.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/data_stream_step.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/data_stream_step.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/error_with_link.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/error_with_link.tsx (95%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/generation_modal.test.tsx (97%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/generation_modal.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/is_step_ready.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/sample_logs_input.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/sample_logs_input.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/translations.ts (62%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/use_generation.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/data_stream_step/use_load_package_names.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/deploy_step/deploy_step.test.tsx (82%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/deploy_step/deploy_step.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/deploy_step/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/deploy_step/translations.ts (70%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/deploy_step/use_deploy_integration.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/integration_step/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/integration_step/integration_step.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/integration_step/integration_step.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/integration_step/is_step_ready.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/integration_step/package_card_preview.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/integration_step/translations.ts (51%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/review_step/fields_table.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/review_step/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/review_step/is_step_ready.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/review_step/review_step.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/review_step/review_step.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/review_step/translations.ts (64%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/review_step/use_check_pipeline.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/steps/step_content_wrapper.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_assistant => automatic_import/public/components/create_integration/create_automatic_import}/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration.test.tsx (95%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration.tsx (88%) rename x-pack/platform/plugins/shared/{integration_assistant/public/components/create_integration/create_integration_landing/integration_assistant_card.tsx => automatic_import/public/components/create_integration/create_integration_landing/automatic_import_card.tsx} (87%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration_landing/create_integration_landing.tsx (90%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration_landing/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration_landing/translations.ts (62%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration_upload/create_integration_upload.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration_upload/docs_link_subtitle.tsx (86%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/create_integration_upload/index.ts (100%) create mode 100644 x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/translations.ts rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/index.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/telemetry.tsx (93%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration_card_button/create_integration_card_button.test.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration_card_button/create_integration_card_button.tsx (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration_card_button/index.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/components/create_integration_card_button/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/index.ts (64%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/mocks/test_provider.tsx (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/plugin.ts (75%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/experimental_features_service.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/mocks/services.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/telemetry/events.ts (95%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/telemetry/mocks/service.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/telemetry/service.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/telemetry/types.ts (56%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/services/types.ts (82%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/types.ts (87%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/util/oas.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/public/util/oas.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/scripts/draw_graphs.js (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/scripts/draw_graphs_script.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/__mocks__/mock_server.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/__mocks__/request.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/__mocks__/request_context.ts (98%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/__mocks__/response.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/__mocks__/test_adapters.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/config.ts (61%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/paths.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/paths.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/api_analysis/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/categorization.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/categorization.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/errors.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/errors.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/invalid.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/invalid.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/review.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/review.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/stable.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/util.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/util.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/validate.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/categorization/validate.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/analyze_headers.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/analyze_headers.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/auth_basic.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/auth_basic.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/auth_digest.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/auth_digest.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/auth_header.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/auth_oauth2.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/auth_oauth2.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/build_program.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/build_program.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/retrieve_state_details.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/retrieve_state_details.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/retrieve_state_vars.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/retrieve_state_vars.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/summarize_query.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/summarize_query.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/util.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/cel/util.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/csv/columns.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/csv/columns.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/csv/csv.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/chunk.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/chunk.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/duplicates.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/duplicates.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/invalid.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/invalid.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/mapping.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/mapping.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/missing.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/missing.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/model.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/pipeline.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/pipeline.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/state.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/validate.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/ecs/validate.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/error.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/header.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/header.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/kv.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/kv.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/kv/validate.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/log_type_detection/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/log_type_detection/detection.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/log_type_detection/detection.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/log_type_detection/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/log_type_detection/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/log_type_detection/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/log_type_detection/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/errors.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/errors.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/related.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/related.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/review.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/review.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/util.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/related/util.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/error.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/errors.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/graph.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/prompts.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/unstructured.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/unstructured.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/validate.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/graphs/unstructured/validate.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/index.ts (66%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/agent.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/agent.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/build_integration.test.ts (99%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/build_integration.ts (98%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/constants.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/data_stream.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/data_stream.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/dev_folders.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/fields.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/fields.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/pipeline.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/pipeline.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/readme_files.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/integration_builder/readme_files.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/lib/errors/cef_error.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/lib/errors/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/lib/errors/recursion_limit_error.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/lib/errors/types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/lib/errors/unparseable_csv_error.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/lib/errors/unsupported_error.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/plugin.ts (51%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/processor_types.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/analyze_api_route.test.ts (93%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/analyze_api_route.ts (93%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/analyze_logs_routes.ts (95%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/build_integration_routes.test.ts (93%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/build_integration_routes.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/categorization_routes.test.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/categorization_routes.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/cel_route.test.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/cel_routes.ts (93%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/ecs_routes.test.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/ecs_routes.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/pipeline_routes.test.ts (92%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/pipeline_routes.ts (93%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/register_routes.ts (86%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/related_routes.test.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/related_routes.ts (94%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/routes_util.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/routes_util.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/routes/with_availability.ts (75%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/aws_cloudwatch.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/aws_s3.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/azure_blob_storage.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/azure_eventhub.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/cel.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/cel_generated.yml.hbs.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/cloudfoundry.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/common.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/filestream.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/gcp_pubsub.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/gcs.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/http_endpoint.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/journald.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/kafka.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/logfile.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/tcp.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/agent/udp.yml.hbs (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/base_fields.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/build.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/build_readme.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/changelog.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/data_stream/fields/agent.yml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/data_stream/fields/beats.yml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/description_readme.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/aws_cloudwatch_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/aws_s3_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/azure_blob_storage_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/azure_eventhub_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/cel_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/cloudfoundry_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/common_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/data_stream.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/filestream_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/gcp_pubsub_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/gcs_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/http_endpoint_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/journald_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/kafka_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/logfile_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/ssl_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/tcp_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/manifest/udp_manifest.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/package_readme.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/pipeline.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/pipeline_tests/test_common_config.yml (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/processors/append.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/processors/grok.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/processors/kv.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/aws-cloudwatch.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/aws-s3.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/azure-blob-storage.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/azure-eventhub.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/cel.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/filestream.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/gcp-pubsub.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/gcs.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/http_endpoint.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/journald.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/kafka.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/ssl-tls.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/tcp.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/setup/udp.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/troubleshooting/gcp.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/readme/troubleshooting/http_endpoint.md.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/docker_compose.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/service_filestream.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/service_gcs.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/service_logfile.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/service_tcp.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/service_udp.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/test_filestream_config.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/test_gcs_config.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/test_logfile_config.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/test_tcp_config.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/templates/system_tests/test_udp_config.yml.njk (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/types.ts (95%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/fields.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/fields.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/files.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/graph.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/index.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/llm.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/painless.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/painless.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/pipeline.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/processors.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/route_validation.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/samples.test.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/samples.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/server/util/util.ts (100%) rename x-pack/platform/plugins/shared/{integration_assistant => automatic_import}/tsconfig.json (100%) delete mode 100644 x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/translations.ts rename x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/{integration_assistant/integration_assistant.tsx => automatic_import/automatic_import.tsx} (80%) rename x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/{integration_assistant => automatic_import}/index.ts (64%) diff --git a/.eslintrc.js b/.eslintrc.js index a6268f698e40b..d209e9631baed 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1074,8 +1074,8 @@ module.exports = { { // front end and common typescript and javascript files only files: [ - 'x-pack/platform/plugins/shared/integration_assistant/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/platform/plugins/shared/integration_assistant/common/**/*.{js,mjs,ts,tsx}', + 'x-pack/platform/plugins/shared/automatic_import/public/**/*.{js,mjs,ts,tsx}', + 'x-pack/platform/plugins/shared/automatic_import/common/**/*.{js,mjs,ts,tsx}', ], rules: { 'import/no-nodejs-modules': 'error', @@ -1159,7 +1159,7 @@ module.exports = { files: [ 'x-pack/solutions/security/plugins/ecs_data_quality_dashboard/**/*.{ts,tsx}', 'x-pack/solutions/security/plugins/elastic_assistant/**/*.{ts,tsx}', - 'x-pack/platform/plugins/shared/integration_assistant/**/*.{ts,tsx}', + 'x-pack/platform/plugins/shared/automatic_import/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{ts,tsx}', @@ -1174,7 +1174,7 @@ module.exports = { excludedFiles: [ 'x-pack/solutions/security/plugins/ecs_data_quality_dashboard/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/solutions/security/plugins/elastic_assistant/**/*.{test,mock,test_helper}.{ts,tsx}', - 'x-pack/platform/plugins/shared/integration_assistant/**/*.{test,mock,test_helper}.{ts,tsx}', + 'x-pack/platform/plugins/shared/automatic_import/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{test,mock,test_helper}.{ts,tsx}', @@ -1195,7 +1195,7 @@ module.exports = { files: [ 'x-pack/solutions/security/plugins/ecs_data_quality_dashboard/**/*.{ts,tsx}', 'x-pack/solutions/security/plugins/elastic_assistant/**/*.{ts,tsx}', - 'x-pack/platform/plugins/shared/integration_assistant/**/*.{ts,tsx}', + 'x-pack/platform/plugins/shared/automatic_import/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{ts,tsx}', @@ -1229,7 +1229,7 @@ module.exports = { files: [ 'x-pack/solutions/security/plugins/ecs_data_quality_dashboard/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/plugins/elastic_assistant/**/*.{js,mjs,ts,tsx}', - 'x-pack/platform/plugins/shared/integration_assistant/**/*.{js,mjs,ts,tsx}', + 'x-pack/platform/plugins/shared/automatic_import/**/*.{js,mjs,ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant/**/*.{js,mjs,ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{js,mjs,ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{js,mjs,ts,tsx}', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 39eabe4160e72..6bfd3ffa792f8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -871,6 +871,7 @@ x-pack/platform/plugins/shared/ai_infra/llm_tasks @elastic/appex-ai-infra x-pack/platform/plugins/shared/ai_infra/product_doc_base @elastic/appex-ai-infra x-pack/platform/plugins/shared/aiops @elastic/ml-ui x-pack/platform/plugins/shared/alerting @elastic/response-ops +x-pack/platform/plugins/shared/automatic_import @elastic/security-scalability x-pack/platform/plugins/shared/cases @elastic/response-ops x-pack/platform/plugins/shared/cloud @elastic/kibana-core x-pack/platform/plugins/shared/dashboard_enhanced @elastic/kibana-presentation @@ -888,7 +889,6 @@ x-pack/platform/plugins/shared/index_management @elastic/kibana-management x-pack/platform/plugins/shared/inference @elastic/appex-ai-infra x-pack/platform/plugins/shared/inference_endpoint @elastic/ml-ui x-pack/platform/plugins/shared/ingest_pipelines @elastic/kibana-management -x-pack/platform/plugins/shared/integration_assistant @elastic/security-scalability x-pack/platform/plugins/shared/lens @elastic/kibana-visualizations x-pack/platform/plugins/shared/license_management @elastic/kibana-management x-pack/platform/plugins/shared/licensing @elastic/kibana-core diff --git a/api_docs/integration_assistant.devdocs.json b/api_docs/automatic_import.devdocs.json similarity index 76% rename from api_docs/integration_assistant.devdocs.json rename to api_docs/automatic_import.devdocs.json index 8174065f63151..5d0a66394cdb7 100644 --- a/api_docs/integration_assistant.devdocs.json +++ b/api_docs/automatic_import.devdocs.json @@ -1,5 +1,5 @@ { - "id": "integrationAssistant", + "id": "automaticImport", "client": { "classes": [], "functions": [], @@ -8,13 +8,13 @@ "misc": [], "objects": [], "setup": { - "parentPluginId": "integrationAssistant", - "id": "def-public.IntegrationAssistantPluginSetup", + "parentPluginId": "automaticImport", + "id": "def-public.AutomaticImportPluginSetup", "type": "Interface", "tags": [], - "label": "IntegrationAssistantPluginSetup", + "label": "AutomaticImportPluginSetup", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -22,19 +22,19 @@ "initialIsOpen": true }, "start": { - "parentPluginId": "integrationAssistant", - "id": "def-public.IntegrationAssistantPluginStart", + "parentPluginId": "automaticImport", + "id": "def-public.AutomaticImportPluginStart", "type": "Interface", "tags": [], - "label": "IntegrationAssistantPluginStart", + "label": "AutomaticImportPluginStart", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { - "parentPluginId": "integrationAssistant", - "id": "def-public.IntegrationAssistantPluginStart.components", + "parentPluginId": "automaticImport", + "id": "def-public.AutomaticImportPluginStart.components", "type": "Object", "tags": [], "label": "components", @@ -46,13 +46,13 @@ "CreateIntegrationCardButtonComponent", "; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/public/types.ts", "deprecated": false, "trackAdoption": false }, { - "parentPluginId": "integrationAssistant", - "id": "def-public.IntegrationAssistantPluginStart.renderUpselling", + "parentPluginId": "automaticImport", + "id": "def-public.AutomaticImportPluginStart.renderUpselling", "type": "Function", "tags": [], "label": "renderUpselling", @@ -62,13 +62,13 @@ "signature": [ "(upselling: React.ReactNode) => void" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { - "parentPluginId": "integrationAssistant", - "id": "def-public.IntegrationAssistantPluginStart.renderUpselling.$1", + "parentPluginId": "automaticImport", + "id": "def-public.AutomaticImportPluginStart.renderUpselling.$1", "type": "CompoundType", "tags": [], "label": "upselling", @@ -76,7 +76,7 @@ "signature": [ "React.ReactNode" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -97,19 +97,19 @@ "misc": [], "objects": [], "setup": { - "parentPluginId": "integrationAssistant", - "id": "def-server.IntegrationAssistantPluginSetup", + "parentPluginId": "automaticImport", + "id": "def-server.AutomaticImportPluginSetup", "type": "Interface", "tags": [], - "label": "IntegrationAssistantPluginSetup", + "label": "AutomaticImportPluginSetup", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { - "parentPluginId": "integrationAssistant", - "id": "def-server.IntegrationAssistantPluginSetup.setIsAvailable", + "parentPluginId": "automaticImport", + "id": "def-server.AutomaticImportPluginSetup.setIsAvailable", "type": "Function", "tags": [], "label": "setIsAvailable", @@ -117,13 +117,13 @@ "signature": [ "(isAvailable: boolean) => void" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { - "parentPluginId": "integrationAssistant", - "id": "def-server.IntegrationAssistantPluginSetup.setIsAvailable.$1", + "parentPluginId": "automaticImport", + "id": "def-server.AutomaticImportPluginSetup.setIsAvailable.$1", "type": "boolean", "tags": [], "label": "isAvailable", @@ -131,7 +131,7 @@ "signature": [ "boolean" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/server/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -144,13 +144,13 @@ "initialIsOpen": true }, "start": { - "parentPluginId": "integrationAssistant", - "id": "def-server.IntegrationAssistantPluginStart", + "parentPluginId": "automaticImport", + "id": "def-server.AutomaticImportPluginStart", "type": "Interface", "tags": [], - "label": "IntegrationAssistantPluginStart", + "label": "AutomaticImportPluginStart", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -162,7 +162,7 @@ "classes": [], "functions": [ { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.partialShuffleArray", "type": "Function", "tags": [], @@ -173,12 +173,12 @@ "signature": [ "(arr: T[], start: number, end: number, seed: string) => void" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/utils.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/utils.ts", "deprecated": false, "trackAdoption": false, "children": [ { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.partialShuffleArray.$1", "type": "Array", "tags": [], @@ -189,13 +189,13 @@ "signature": [ "T[]" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/utils.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.partialShuffleArray.$2", "type": "number", "tags": [], @@ -206,13 +206,13 @@ "signature": [ "number" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/utils.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.partialShuffleArray.$3", "type": "number", "tags": [], @@ -223,13 +223,13 @@ "signature": [ "number" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/utils.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.partialShuffleArray.$4", "type": "string", "tags": [], @@ -238,7 +238,7 @@ "signature": [ "string" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/utils.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -250,7 +250,7 @@ ], "interfaces": [ { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.ESProcessorItem", "type": "Interface", "tags": [], @@ -258,12 +258,12 @@ "description": [ "\nProcessor item for the Elasticsearch processor." ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/processor_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/processor_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "children": [ { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.ESProcessorItem.Unnamed", "type": "IndexSignature", "tags": [], @@ -273,7 +273,7 @@ "[key: string]: ", "ESProcessorOptions" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/processor_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/processor_attributes.gen.ts", "deprecated": false, "trackAdoption": false } @@ -284,31 +284,31 @@ "enums": [], "misc": [ { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.ANALYZE_API_PATH", "type": "string", "tags": [], "label": "ANALYZE_API_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.ANALYZE_LOGS_PATH", "type": "string", "tags": [], "label": "ANALYZE_LOGS_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeApiRequestBody", "type": "Type", "tags": [], @@ -317,13 +317,13 @@ "signature": [ "{ connectorId: string; dataStreamTitle: string; pathOptions: {} & { [k: string]: unknown; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeApiResponse", "type": "Type", "tags": [], @@ -332,13 +332,13 @@ "signature": [ "{ results: { suggestedPaths: string[]; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeLogsRequestBody", "type": "Type", "tags": [], @@ -347,110 +347,140 @@ "signature": [ "{ connectorId: string; packageName: string; dataStreamName: string; packageTitle: string; dataStreamTitle: string; logSamples: string[]; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeLogsResponse", "type": "Type", "tags": [], "label": "AnalyzeLogsResponse", "description": [], "signature": [ - "{ results: { samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; additionalProcessors?: ", + "{ results: { samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; additionalProcessors?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", + "id": "def-common.AUTOMATIC_IMPORT_APP_ROUTE", + "type": "string", + "tags": [], + "label": "AUTOMATIC_IMPORT_APP_ROUTE", + "description": [], + "signature": [ + "\"/app/automatic_import\"" + ], + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "automaticImport", + "id": "def-common.AUTOMATIC_IMPORT_BASE_PATH", + "type": "string", + "tags": [], + "label": "AUTOMATIC_IMPORT_BASE_PATH", + "description": [], + "signature": [ + "\"/internal/automatic_import\"" + ], + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "automaticImport", "id": "def-common.BuildIntegrationRequestBody", "type": "Type", "tags": [], "label": "BuildIntegrationRequestBody", "description": [], "signature": [ - "{ integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "{ integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }; }" + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CATEGORIZATION_GRAPH_PATH", "type": "string", "tags": [], "label": "CATEGORIZATION_GRAPH_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CategorizationRequestBody", "type": "Type", "tags": [], "label": "CategorizationRequestBody", "description": [], "signature": [ - "{ connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", + "{ connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CategorizationResponse", "type": "Type", "tags": [], @@ -459,41 +489,41 @@ "signature": [ "{ results: { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CEL_INPUT_GRAPH_PATH", "type": "string", "tags": [], "label": "CEL_INPUT_GRAPH_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelAuthType", "type": "Type", "tags": [], @@ -504,13 +534,13 @@ "signature": [ "\"basic\" | \"digest\" | \"oauth2\" | \"header\"" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelInput", "type": "Type", "tags": [], @@ -521,13 +551,13 @@ "signature": [ "{ url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelInputRequestBody", "type": "Type", "tags": [], @@ -536,13 +566,13 @@ "signature": [ "{ connectorId: string; dataStreamTitle: string; celDetails: { path: string; auth: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; openApiDetails?: { schemas: string; operation: string; auth?: string | undefined; } | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelInputResponse", "type": "Type", "tags": [], @@ -551,25 +581,25 @@ "signature": [ "{ results: { configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CHECK_PIPELINE_PATH", "type": "string", "tags": [], "label": "CHECK_PIPELINE_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CheckPipelineRequestBody", "type": "Type", "tags": [], @@ -578,29 +608,29 @@ "signature": [ "{ rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CheckPipelineResponse", "type": "Type", "tags": [], @@ -609,13 +639,13 @@ "signature": [ "{ results: { docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.DataStream", "type": "Type", "tags": [], @@ -624,31 +654,31 @@ "\nThe dataStream object." ], "signature": [ - "{ name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "{ name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }" + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.Docs", "type": "Type", "tags": [], @@ -659,48 +689,48 @@ "signature": [ "Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.ECS_GRAPH_PATH", "type": "string", "tags": [], "label": "ECS_GRAPH_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.EcsMappingRequestBody", "type": "Type", "tags": [], "label": "EcsMappingRequestBody", "description": [], "signature": [ - "{ connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; mapping?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; additionalProcessors?: ", + "{ connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; mapping?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; additionalProcessors?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.EcsMappingResponse", "type": "Type", "tags": [], @@ -709,29 +739,29 @@ "signature": [ "{ results: { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }; mapping: {} & { [k: string]: unknown; }; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.InputType", "type": "Type", "tags": [], @@ -740,15 +770,15 @@ "\nThe input type for the dataStream to pull logs from." ], "signature": [ - "\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\"" + "\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\"" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.Integration", "type": "Type", "tags": [], @@ -757,73 +787,43 @@ "\nThe integration object." ], "signature": [ - "{ name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "{ name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }" - ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "integrationAssistant", - "id": "def-common.INTEGRATION_ASSISTANT_APP_ROUTE", - "type": "string", - "tags": [], - "label": "INTEGRATION_ASSISTANT_APP_ROUTE", - "description": [], - "signature": [ - "\"/app/integration_assistant\"" - ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "integrationAssistant", - "id": "def-common.INTEGRATION_ASSISTANT_BASE_PATH", - "type": "string", - "tags": [], - "label": "INTEGRATION_ASSISTANT_BASE_PATH", - "description": [], - "signature": [ - "\"/internal/automatic_import\"" + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.INTEGRATION_BUILDER_PATH", "type": "string", "tags": [], "label": "INTEGRATION_BUILDER_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.LangSmithOptions", "type": "Type", "tags": [], @@ -834,13 +834,13 @@ "signature": [ "{ apiKey: string; projectName: string; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.Pipeline", "type": "Type", "tags": [], @@ -851,87 +851,87 @@ "signature": [ "{ processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.PLUGIN_ID", "type": "string", "tags": [], "label": "PLUGIN_ID", "description": [], "signature": [ - "\"integrationAssistant\"" + "\"automaticImport\"" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.RELATED_GRAPH_PATH", "type": "string", "tags": [], "label": "RELATED_GRAPH_PATH", "description": [], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/constants.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.RelatedRequestBody", "type": "Type", "tags": [], "label": "RelatedRequestBody", "description": [], "signature": [ - "{ connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", + "{ connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.RelatedResponse", "type": "Type", "tags": [], @@ -940,29 +940,29 @@ "signature": [ "{ results: { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; }; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.SamplesFormat", "type": "Type", "tags": [], @@ -971,15 +971,15 @@ "\nFormat of the provided log samples." ], "signature": [ - "{ name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }" + "{ name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.SamplesFormatName", "type": "Type", "tags": [], @@ -990,7 +990,7 @@ "signature": [ "\"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"unsupported\" | \"cef\" | \"leef\" | \"fix\"" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -998,7 +998,7 @@ ], "objects": [ { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeApiRequestBody", "type": "Object", "tags": [], @@ -1007,13 +1007,13 @@ "signature": [ "Zod.ZodObject<{ dataStreamTitle: Zod.ZodString; pathOptions: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; dataStreamTitle: string; pathOptions: {} & { [k: string]: unknown; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; dataStreamTitle: string; pathOptions: {} & { [k: string]: unknown; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeApiResponse", "type": "Object", "tags": [], @@ -1022,13 +1022,13 @@ "signature": [ "Zod.ZodObject<{ results: Zod.ZodObject<{ suggestedPaths: Zod.ZodArray<Zod.ZodString, \"many\">; }, \"strip\", Zod.ZodTypeAny, { suggestedPaths: string[]; }, { suggestedPaths: string[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { suggestedPaths: string[]; }; }, { results: { suggestedPaths: string[]; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeLogsRequestBody", "type": "Object", "tags": [], @@ -1037,13 +1037,13 @@ "signature": [ "Zod.ZodObject<{ packageName: Zod.ZodString; dataStreamName: Zod.ZodString; packageTitle: Zod.ZodString; dataStreamTitle: Zod.ZodString; logSamples: Zod.ZodArray<Zod.ZodString, \"many\">; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; dataStreamName: string; packageTitle: string; dataStreamTitle: string; logSamples: string[]; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; dataStreamName: string; packageTitle: string; dataStreamTitle: string; logSamples: string[]; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.AnalyzeLogsResponse", "type": "Object", "tags": [], @@ -1052,33 +1052,33 @@ "signature": [ "Zod.ZodObject<{ additionalProcessors: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, ", Zod.ZodTypeDef, ", "ESProcessorItemInput", - ">, \"many\">>; results: Zod.ZodObject<{ samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; parsedSamples: Zod.ZodArray<Zod.ZodString, \"many\">; }, \"strip\", Zod.ZodTypeAny, { samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }, { samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; additionalProcessors?: ", + ">, \"many\">>; results: Zod.ZodObject<{ samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; parsedSamples: Zod.ZodArray<Zod.ZodString, \"many\">; }, \"strip\", Zod.ZodTypeAny, { samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }, { samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; additionalProcessors?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }, { results: { samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; additionalProcessors?: ", + "[] | undefined; }, { results: { samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; parsedSamples: string[]; }; additionalProcessors?: ", "ESProcessorItemInput", "[] | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.BuildIntegrationRequestBody", "type": "Object", "tags": [], @@ -1087,9 +1087,9 @@ "signature": [ "Zod.ZodObject<{ integration: Zod.ZodObject<{ name: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; dataStreams: Zod.ZodArray<Zod.ZodObject<{ name: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; inputTypes: Zod.ZodArray<Zod.ZodEnum<[\"aws-cloudwatch\", \"aws-s3\", \"azure-blob-storage\", \"azure-eventhub\", \"cel\", \"cloudfoundry\", \"filestream\", \"gcp-pubsub\", \"gcs\", \"http_endpoint\", \"journald\", \"kafka\", \"tcp\", \"udp\"]>, \"many\">; rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; pipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1097,9 +1097,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1107,17 +1107,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1125,75 +1125,75 @@ "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }>; docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; celInput: Zod.ZodOptional<Zod.ZodObject<{ authType: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; needsAuthConfigBlock: Zod.ZodBoolean; program: Zod.ZodString; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; url: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }>; docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; celInput: Zod.ZodOptional<Zod.ZodObject<{ authType: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; needsAuthConfigBlock: Zod.ZodBoolean; program: Zod.ZodString; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; url: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }, { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }>, \"many\">; logo: Zod.ZodOptional<Zod.ZodString>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }>, \"many\">; logo: Zod.ZodOptional<Zod.ZodString>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }; }, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }; }, { integration: { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }; }>" + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CategorizationRequestBody", "type": "Object", "tags": [], @@ -1202,9 +1202,9 @@ "signature": [ "Zod.ZodObject<{ packageName: Zod.ZodString; dataStreamName: Zod.ZodString; rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; currentPipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1212,9 +1212,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1222,17 +1222,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1240,35 +1240,35 @@ "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }>; connectorId: Zod.ZodString; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }>; connectorId: Zod.ZodString; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CategorizationResponse", "type": "Object", "tags": [], @@ -1277,9 +1277,9 @@ "signature": [ "Zod.ZodObject<{ results: Zod.ZodObject<{ docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; pipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1287,9 +1287,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1297,17 +1297,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1317,17 +1317,17 @@ "ESProcessorItemInput", "[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1337,17 +1337,17 @@ "ESProcessorItemInput", "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1357,13 +1357,13 @@ "ESProcessorItemInput", "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelAuthType", "type": "Object", "tags": [], @@ -1372,13 +1372,13 @@ "signature": [ "Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelInput", "type": "Object", "tags": [], @@ -1387,13 +1387,13 @@ "signature": [ "Zod.ZodObject<{ authType: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; needsAuthConfigBlock: Zod.ZodBoolean; program: Zod.ZodString; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; url: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelInputRequestBody", "type": "Object", "tags": [], @@ -1402,13 +1402,13 @@ "signature": [ "Zod.ZodObject<{ dataStreamTitle: Zod.ZodString; celDetails: Zod.ZodObject<{ path: Zod.ZodString; auth: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; openApiDetails: Zod.ZodOptional<Zod.ZodObject<{ operation: Zod.ZodString; schemas: Zod.ZodString; auth: Zod.ZodOptional<Zod.ZodString>; }, \"strip\", Zod.ZodTypeAny, { schemas: string; operation: string; auth?: string | undefined; }, { schemas: string; operation: string; auth?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { path: string; auth: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; openApiDetails?: { schemas: string; operation: string; auth?: string | undefined; } | undefined; }, { path: string; auth: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; openApiDetails?: { schemas: string; operation: string; auth?: string | undefined; } | undefined; }>; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; dataStreamTitle: string; celDetails: { path: string; auth: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; openApiDetails?: { schemas: string; operation: string; auth?: string | undefined; } | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; dataStreamTitle: string; celDetails: { path: string; auth: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; openApiDetails?: { schemas: string; operation: string; auth?: string | undefined; } | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CelInputResponse", "type": "Object", "tags": [], @@ -1417,13 +1417,13 @@ "signature": [ "Zod.ZodObject<{ results: Zod.ZodObject<{ configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; program: Zod.ZodString; needsAuthConfigBlock: Zod.ZodBoolean; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; }, \"strip\", Zod.ZodTypeAny, { configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }; }, { results: { configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CheckPipelineRequestBody", "type": "Object", "tags": [], @@ -1432,9 +1432,9 @@ "signature": [ "Zod.ZodObject<{ rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; pipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1442,9 +1442,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1452,17 +1452,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1472,17 +1472,17 @@ "ESProcessorItemInput", "[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1492,13 +1492,13 @@ "ESProcessorItemInput", "[] | undefined; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.CheckPipelineResponse", "type": "Object", "tags": [], @@ -1507,13 +1507,13 @@ "signature": [ "Zod.ZodObject<{ results: Zod.ZodObject<{ docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; }, { docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; }; }, { results: { docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.DataStream", "type": "Object", "tags": [], @@ -1522,9 +1522,9 @@ "signature": [ "Zod.ZodObject<{ name: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; inputTypes: Zod.ZodArray<Zod.ZodEnum<[\"aws-cloudwatch\", \"aws-s3\", \"azure-blob-storage\", \"azure-eventhub\", \"cel\", \"cloudfoundry\", \"filestream\", \"gcp-pubsub\", \"gcs\", \"http_endpoint\", \"journald\", \"kafka\", \"tcp\", \"udp\"]>, \"many\">; rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; pipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1532,9 +1532,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1542,17 +1542,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1560,35 +1560,35 @@ "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }>; docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; celInput: Zod.ZodOptional<Zod.ZodObject<{ authType: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; needsAuthConfigBlock: Zod.ZodBoolean; program: Zod.ZodString; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; url: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }>; docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; celInput: Zod.ZodOptional<Zod.ZodObject<{ authType: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; needsAuthConfigBlock: Zod.ZodBoolean; program: Zod.ZodString; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; url: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }, { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }>" + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.Docs", "type": "Object", "tags": [], @@ -1597,48 +1597,48 @@ "signature": [ "Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.EcsMappingRequestBody", "type": "Object", "tags": [], "label": "EcsMappingRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ packageName: Zod.ZodString; dataStreamName: Zod.ZodString; rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; mapping: Zod.ZodOptional<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; additionalProcessors: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", + "Zod.ZodObject<{ packageName: Zod.ZodString; dataStreamName: Zod.ZodString; rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; mapping: Zod.ZodOptional<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; additionalProcessors: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, ", Zod.ZodTypeDef, ", "ESProcessorItemInput", - ">, \"many\">>; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; mapping?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; additionalProcessors?: ", + ">, \"many\">>; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; mapping?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; additionalProcessors?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; mapping?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; additionalProcessors?: ", + "[] | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; mapping?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; additionalProcessors?: ", "ESProcessorItemInput", "[] | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.EcsMappingResponse", "type": "Object", "tags": [], @@ -1647,9 +1647,9 @@ "signature": [ "Zod.ZodObject<{ results: Zod.ZodObject<{ mapping: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; pipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1657,9 +1657,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1667,17 +1667,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1687,17 +1687,17 @@ "ESProcessorItemInput", "[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1707,17 +1707,17 @@ "ESProcessorItemInput", "[] | undefined; }; mapping: {} & { [k: string]: unknown; }; }>; }, \"strip\", Zod.ZodTypeAny, { results: { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1727,13 +1727,13 @@ "ESProcessorItemInput", "[] | undefined; }; mapping: {} & { [k: string]: unknown; }; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.ESProcessorItem", "type": "Object", "tags": [], @@ -1742,9 +1742,9 @@ "signature": [ "Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1752,13 +1752,13 @@ "ESProcessorItemInput", ">" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/processor_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/processor_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.InputType", "type": "Object", "tags": [], @@ -1767,13 +1767,13 @@ "signature": [ "Zod.ZodEnum<[\"aws-cloudwatch\", \"aws-s3\", \"azure-blob-storage\", \"azure-eventhub\", \"cel\", \"cloudfoundry\", \"filestream\", \"gcp-pubsub\", \"gcs\", \"http_endpoint\", \"journald\", \"kafka\", \"tcp\", \"udp\"]>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.Integration", "type": "Object", "tags": [], @@ -1782,9 +1782,9 @@ "signature": [ "Zod.ZodObject<{ name: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; dataStreams: Zod.ZodArray<Zod.ZodObject<{ name: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; inputTypes: Zod.ZodArray<Zod.ZodEnum<[\"aws-cloudwatch\", \"aws-s3\", \"azure-blob-storage\", \"azure-eventhub\", \"cel\", \"cloudfoundry\", \"filestream\", \"gcp-pubsub\", \"gcs\", \"http_endpoint\", \"journald\", \"kafka\", \"tcp\", \"udp\"]>, \"many\">; rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; pipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1792,9 +1792,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1802,17 +1802,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1820,55 +1820,55 @@ "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }>; docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; celInput: Zod.ZodOptional<Zod.ZodObject<{ authType: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; needsAuthConfigBlock: Zod.ZodBoolean; program: Zod.ZodString; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; url: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }>; docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; celInput: Zod.ZodOptional<Zod.ZodObject<{ authType: Zod.ZodEnum<[\"basic\", \"digest\", \"oauth2\", \"header\"]>; configFields: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; needsAuthConfigBlock: Zod.ZodBoolean; program: Zod.ZodString; stateSettings: Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>; redactVars: Zod.ZodArray<Zod.ZodString, \"many\">; url: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }, { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; }>>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }, { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }, { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }>, \"many\">; logo: Zod.ZodOptional<Zod.ZodString>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }>, \"many\">; logo: Zod.ZodOptional<Zod.ZodString>; }, \"strip\", Zod.ZodTypeAny, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"kafka\" | \"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", + "[] | undefined; }; docs: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }, { name: string; title: string; description: string; dataStreams: { name: string; title: string; description: string; inputTypes: (\"aws-cloudwatch\" | \"aws-s3\" | \"azure-blob-storage\" | \"azure-eventhub\" | \"cel\" | \"cloudfoundry\" | \"filestream\" | \"gcp-pubsub\" | \"gcs\" | \"http_endpoint\" | \"journald\" | \"kafka\" | \"tcp\" | \"udp\")[]; rawSamples: string[]; pipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }>" + "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; celInput?: { url: string; authType: \"basic\" | \"header\" | \"digest\" | \"oauth2\"; configFields: {} & { [k: string]: unknown; }; needsAuthConfigBlock: boolean; program: string; stateSettings: {} & { [k: string]: unknown; }; redactVars: string[]; } | undefined; }[]; logo?: string | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.LangSmithOptions", "type": "Object", "tags": [], @@ -1877,13 +1877,13 @@ "signature": [ "Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.Pipeline", "type": "Object", "tags": [], @@ -1892,9 +1892,9 @@ "signature": [ "Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1902,9 +1902,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1912,17 +1912,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1932,13 +1932,13 @@ "ESProcessorItemInput", "[] | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.RelatedRequestBody", "type": "Object", "tags": [], @@ -1947,9 +1947,9 @@ "signature": [ "Zod.ZodObject<{ packageName: Zod.ZodString; dataStreamName: Zod.ZodString; rawSamples: Zod.ZodArray<Zod.ZodString, \"many\">; currentPipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1957,9 +1957,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1967,17 +1967,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -1985,35 +1985,35 @@ "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", - "[] | undefined; }>; connectorId: Zod.ZodString; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }>; connectorId: Zod.ZodString; samplesFormat: Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>; langSmithOptions: Zod.ZodOptional<Zod.ZodObject<{ projectName: Zod.ZodString; apiKey: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { apiKey: string; projectName: string; }, { apiKey: string; projectName: string; }>>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; samplesFormat: { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }; dataStreamName: string; currentPipeline: { processors: ", "ESProcessorItemInput", "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", "ESProcessorItemInput", "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.RelatedResponse", "type": "Object", "tags": [], @@ -2022,9 +2022,9 @@ "signature": [ "Zod.ZodObject<{ results: Zod.ZodObject<{ docs: Zod.ZodArray<Zod.ZodObject<{}, \"strip\", Zod.ZodUnknown, Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\">, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>, \"many\">; pipeline: Zod.ZodObject<{ name: Zod.ZodOptional<Zod.ZodString>; description: Zod.ZodOptional<Zod.ZodString>; version: Zod.ZodOptional<Zod.ZodNumber>; processors: Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -2032,9 +2032,9 @@ "ESProcessorItemInput", ">, \"many\">; on_failure: Zod.ZodOptional<Zod.ZodArray<Zod.ZodType<", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -2042,17 +2042,17 @@ "ESProcessorItemInput", ">, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -2062,17 +2062,17 @@ "ESProcessorItemInput", "[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -2082,17 +2082,17 @@ "ESProcessorItemInput", "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; }>; }, \"strip\", Zod.ZodTypeAny, { results: { pipeline: { processors: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, "[]; version?: number | undefined; name?: string | undefined; description?: string | undefined; on_failure?: ", { - "pluginId": "integrationAssistant", + "pluginId": "automaticImport", "scope": "common", - "docId": "kibIntegrationAssistantPluginApi", + "docId": "kibAutomaticImportPluginApi", "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, @@ -2102,28 +2102,28 @@ "ESProcessorItemInput", "[] | undefined; }; docs: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">[]; }; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.SamplesFormat", "type": "Object", "tags": [], "label": "SamplesFormat", "description": [], "signature": [ - "Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"json\" | \"ndjson\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>" + "Zod.ZodObject<{ name: Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>; multiline: Zod.ZodOptional<Zod.ZodBoolean>; header: Zod.ZodOptional<Zod.ZodBoolean>; columns: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; json_path: Zod.ZodOptional<Zod.ZodArray<Zod.ZodString, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }, { name: \"unsupported\" | \"ndjson\" | \"json\" | \"csv\" | \"structured\" | \"unstructured\" | \"cef\" | \"leef\" | \"fix\"; columns?: string[] | undefined; header?: boolean | undefined; multiline?: boolean | undefined; json_path?: string[] | undefined; }>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { - "parentPluginId": "integrationAssistant", + "parentPluginId": "automaticImport", "id": "def-common.SamplesFormatName", "type": "Object", "tags": [], @@ -2132,7 +2132,7 @@ "signature": [ "Zod.ZodEnum<[\"ndjson\", \"json\", \"csv\", \"structured\", \"unstructured\", \"unsupported\", \"cef\", \"leef\", \"fix\"]>" ], - "path": "x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts", + "path": "x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/automatic_import.mdx b/api_docs/automatic_import.mdx new file mode 100644 index 0000000000000..81c6fe4ab0ea4 --- /dev/null +++ b/api_docs/automatic_import.mdx @@ -0,0 +1,55 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibAutomaticImportPluginApi +slug: /kibana-dev-docs/api/automaticImport +title: "automaticImport" +image: https://source.unsplash.com/400x175/?github +description: API docs for the automaticImport plugin +date: 2025-01-23 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'automaticImport'] +--- +import automaticImportObj from './automatic_import.devdocs.json'; + +Plugin implementing the Automatic Import API and UI + +Contact [@elastic/security-scalability](https://github.com/orgs/elastic/teams/security-scalability) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 78 | 0 | 62 | 4 | + +## Client + +### Setup +<DocDefinitionList data={[automaticImportObj.client.setup]}/> + +### Start +<DocDefinitionList data={[automaticImportObj.client.start]}/> + +## Server + +### Setup +<DocDefinitionList data={[automaticImportObj.server.setup]}/> + +### Start +<DocDefinitionList data={[automaticImportObj.server.start]}/> + +## Common + +### Objects +<DocDefinitionList data={automaticImportObj.common.objects}/> + +### Functions +<DocDefinitionList data={automaticImportObj.common.functions}/> + +### Interfaces +<DocDefinitionList data={automaticImportObj.common.interfaces}/> + +### Consts, variables and types +<DocDefinitionList data={automaticImportObj.common.misc}/> + diff --git a/api_docs/integration_assistant.mdx b/api_docs/integration_assistant.mdx deleted file mode 100644 index 657278364ccc9..0000000000000 --- a/api_docs/integration_assistant.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -#### -#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. -#### Reach out in #docs-engineering for more info. -#### -id: kibIntegrationAssistantPluginApi -slug: /kibana-dev-docs/api/integrationAssistant -title: "integrationAssistant" -image: https://source.unsplash.com/400x175/?github -description: API docs for the integrationAssistant plugin -date: 2025-01-28 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'integrationAssistant'] ---- -import integrationAssistantObj from './integration_assistant.devdocs.json'; - -Plugin implementing the Integration Assistant API and UI - -Contact [@elastic/security-scalability](https://github.com/orgs/elastic/teams/security-scalability) for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 78 | 0 | 62 | 4 | - -## Client - -### Setup -<DocDefinitionList data={[integrationAssistantObj.client.setup]}/> - -### Start -<DocDefinitionList data={[integrationAssistantObj.client.start]}/> - -## Server - -### Setup -<DocDefinitionList data={[integrationAssistantObj.server.setup]}/> - -### Start -<DocDefinitionList data={[integrationAssistantObj.server.start]}/> - -## Common - -### Objects -<DocDefinitionList data={integrationAssistantObj.common.objects}/> - -### Functions -<DocDefinitionList data={integrationAssistantObj.common.functions}/> - -### Interfaces -<DocDefinitionList data={integrationAssistantObj.common.interfaces}/> - -### Consts, variables and types -<DocDefinitionList data={integrationAssistantObj.common.misc}/> - diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index 601b6c936f8a9..5aa6de14636f4 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -34,6 +34,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | <DocLink id="kibAlertingPluginApi" text="alerting"/> | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 875 | 1 | 842 | 50 | | <DocLink id="kibApmPluginApi" text="apm"/> | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | The user interface for Elastic APM | 29 | 0 | 29 | 119 | | <DocLink id="kibApmDataAccessPluginApi" text="apmDataAccess"/> | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 93 | 0 | 93 | 3 | +| <DocLink id="kibAutomaticImportPluginApi" text="automaticImport"/> | [@elastic/security-scalability](https://github.com/orgs/elastic/teams/security-scalability) | Plugin implementing the Automatic Import API and UI | 78 | 0 | 62 | 4 | | <DocLink id="kibBannersPluginApi" text="banners"/> | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 9 | 0 | 9 | 0 | | <DocLink id="kibCanvasPluginApi" text="canvas"/> | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | | <DocLink id="kibCasesPluginApi" text="cases"/> | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 125 | 0 | 105 | 28 | @@ -121,7 +122,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | <DocLink id="kibIngestPipelinesPluginApi" text="ingestPipelines"/> | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 4 | 0 | 4 | 0 | | inputControlVis | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Input Control visualization to Kibana | 0 | 0 | 0 | 0 | | <DocLink id="kibInspectorPluginApi" text="inspector"/> | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 128 | 2 | 101 | 4 | -| <DocLink id="kibIntegrationAssistantPluginApi" text="integrationAssistant"/> | [@elastic/security-scalability](https://github.com/orgs/elastic/teams/security-scalability) | Plugin implementing the Integration Assistant API and UI | 78 | 0 | 62 | 4 | | <DocLink id="kibInteractiveSetupPluginApi" text="interactiveSetup"/> | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 28 | 0 | 18 | 0 | | <DocLink id="kibInventoryPluginApi" text="inventory"/> | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 5 | 0 | 5 | 3 | | <DocLink id="kibInvestigatePluginApi" text="investigate"/> | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 43 | 0 | 43 | 4 | diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 542ab1ef12869..e0771e980e534 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -467,6 +467,10 @@ The plugin exposes the static DefaultEditorController class to consume. |WARNING: Missing README. +|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/automatic_import/README.md[automaticImport] +|Team owner: Security Integrations Scalability + + |{kib-repo}blob/{branch}/x-pack/platform/plugins/private/banners/README.md[banners] |Allow to add a header banner that will be displayed on every page of the Kibana application @@ -654,10 +658,6 @@ the infrastructure monitoring use-case within Kibana. |The ingest_pipelines plugin provides Kibana support for Elasticsearch's ingest pipelines. -|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/integration_assistant/README.md[integrationAssistant] -|Team owner: Security Integrations Scalability - - |{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/inventory/README.md[inventory] |Home of the Inventory plugin, which renders the... inventory. diff --git a/package.json b/package.json index 72e767f48dd54..e9335b7c9a73a 100644 --- a/package.json +++ b/package.json @@ -193,6 +193,7 @@ "@kbn/app-link-test-plugin": "link:test/plugin_functional/plugins/app_link_test", "@kbn/application-usage-test-plugin": "link:x-pack/test/usage_collection/plugins/application_usage_test", "@kbn/audit-log-plugin": "link:x-pack/test/security_api_integration/plugins/audit_log", + "@kbn/automatic-import-plugin": "link:x-pack/platform/plugins/shared/automatic_import", "@kbn/avc-banner": "link:src/platform/packages/shared/kbn-avc-banner", "@kbn/banners-plugin": "link:x-pack/platform/plugins/private/banners", "@kbn/calculate-auto": "link:src/platform/packages/shared/kbn-calculate-auto", @@ -584,7 +585,6 @@ "@kbn/ingest-pipelines-plugin": "link:x-pack/platform/plugins/shared/ingest_pipelines", "@kbn/input-control-vis-plugin": "link:src/platform/plugins/private/input_control_vis", "@kbn/inspector-plugin": "link:src/platform/plugins/shared/inspector", - "@kbn/integration-assistant-plugin": "link:x-pack/platform/plugins/shared/integration_assistant", "@kbn/interactive-setup-plugin": "link:src/platform/plugins/private/interactive_setup", "@kbn/interactive-setup-test-endpoints-plugin": "link:test/interactive_setup_api_integration/plugins/test_endpoints", "@kbn/interpreter": "link:src/platform/packages/shared/kbn-interpreter", diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 7ae1d20dcff03..0fe04b0c1dcca 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -5,6 +5,7 @@ pageLoadAssetSize: aiops: 32733 alerting: 106936 apm: 64385 + automaticImport: 25433 banners: 17946 canvas: 29355 cases: 180037 @@ -84,7 +85,6 @@ pageLoadAssetSize: ingestPipelines: 58003 inputControlVis: 172675 inspector: 148711 - integrationAssistant: 19524 interactiveSetup: 80000 inventory: 27430 investigate: 17970 diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index ff04259af7257..9f8e35a4a1bda 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -276,7 +276,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.infra.sources.default.fields.message (array?)', 'xpack.index_management.enableTogglingDataRetention (boolean?|never)', 'xpack.index_management.enableProjectLevelRetentionChecks (boolean?|never)', - 'xpack.integration_assistant.enableExperimental (array?)', + 'xpack.automatic_import.enableExperimental (array?)', /** * Feature flags bellow are conditional based on traditional/serverless offering */ diff --git a/tsconfig.base.json b/tsconfig.base.json index 87ac54b11446b..59e181066e996 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -100,6 +100,8 @@ "@kbn/application-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/application_usage_test/*"], "@kbn/audit-log-plugin": ["x-pack/test/security_api_integration/plugins/audit_log"], "@kbn/audit-log-plugin/*": ["x-pack/test/security_api_integration/plugins/audit_log/*"], + "@kbn/automatic-import-plugin": ["x-pack/platform/plugins/shared/automatic_import"], + "@kbn/automatic-import-plugin/*": ["x-pack/platform/plugins/shared/automatic_import/*"], "@kbn/avc-banner": ["src/platform/packages/shared/kbn-avc-banner"], "@kbn/avc-banner/*": ["src/platform/packages/shared/kbn-avc-banner/*"], "@kbn/axe-config": ["packages/kbn-axe-config"], @@ -1084,8 +1086,6 @@ "@kbn/input-control-vis-plugin/*": ["src/platform/plugins/private/input_control_vis/*"], "@kbn/inspector-plugin": ["src/platform/plugins/shared/inspector"], "@kbn/inspector-plugin/*": ["src/platform/plugins/shared/inspector/*"], - "@kbn/integration-assistant-plugin": ["x-pack/platform/plugins/shared/integration_assistant"], - "@kbn/integration-assistant-plugin/*": ["x-pack/platform/plugins/shared/integration_assistant/*"], "@kbn/interactive-setup-plugin": ["src/platform/plugins/private/interactive_setup"], "@kbn/interactive-setup-plugin/*": ["src/platform/plugins/private/interactive_setup/*"], "@kbn/interactive-setup-test-endpoints-plugin": ["test/interactive_setup_api_integration/plugins/test_endpoints"], diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 73ccecf769a32..857606150970b 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -66,7 +66,7 @@ "xpack.logsShared": "platform/plugins/shared/logs_shared", "xpack.fleet": "platform/plugins/shared/fleet", "xpack.ingestPipelines": "platform/plugins/shared/ingest_pipelines", - "xpack.integrationAssistant": "platform/plugins/shared/integration_assistant", + "xpack.automaticImport": "platform/plugins/shared/automatic_import", "xpack.inference": "platform/plugins/shared/inference", "xpack.inventory": "solutions/observability/plugins/inventory", "xpack.investigate": "solutions/observability/plugins/investigate", 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 8d44380617b5b..9527ba681f0a2 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -23764,117 +23764,6 @@ "xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchLabel": "Afficher la sortie détaillée", "xpack.ingestPipelines.testPipelineFlyout.successNotificationText": "Pipeline exécuté", "xpack.ingestPipelines.testPipelineFlyout.title": "Pipeline de test", - "xpack.integrationAssistant.bottomBar.addToElastic": "Ajouter à Elastic", - "xpack.integrationAssistant.bottomBar.analyzeLogs": "Analyser les logs", - "xpack.integrationAssistant.bottomBar.close": "Fermer", - "xpack.integrationAssistant.bottomBar.loading": "Chargement", - "xpack.integrationAssistant.createIntegrationButton": "Créer une nouvelle intégration", - "xpack.integrationAssistant.createIntegrationDescription": "Créez-en une personnalisée pour répondre à vos besoins", - "xpack.integrationAssistant.createIntegrationLanding.assistant.button": "Créer une intégration", - "xpack.integrationAssistant.createIntegrationLanding.assistant.description": "Utilisez notre processus piloté par l'IA pour créer votre intégration personnalisée", - "xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewBadge": "Version d'évaluation technique", - "xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewTooltip": "Cette fonctionnalité est en version d’évaluation technique, elle est susceptible d’être modifiée. Veuillez l’utiliser avec prudence dans les environnements de production.", - "xpack.integrationAssistant.createIntegrationLanding.assistant.title": "Créer une intégration personnalisée", - "xpack.integrationAssistant.createIntegrationLanding.description": "Démarrez un processus piloté par l'IA pour créer pas à pas votre intégration, ou téléchargez un package .zip d'une intégration créée précédemment", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.button": "Charger un fichier au format .zip", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.description": "Utilisez cette option si vous disposez d'un package d'intégration existant dans un fichier .zip", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.title": "Chargement de package", - "xpack.integrationAssistant.createIntegrationLanding.title": "Créer une nouvelle intégration", - "xpack.integrationAssistant.createIntegrationLanding.uploadPackageDescription": "Si vous disposez déjà d'un paquet d'intégration existant, {link}", - "xpack.integrationAssistant.createIntegrationLanding.uploadPackageLink": "chargez-la au format .zip", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.button": "Ajouter à un agent", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.description": "Ajoutez votre nouvelle intégration à un agent pour commencer à collecter des données", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.title": "Ajouter à un agent", - "xpack.integrationAssistant.createIntegrationSuccess.description": "Votre intégration est créée avec succès.", - "xpack.integrationAssistant.createIntegrationSuccess.title": "Réussite", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.button": "Afficher l’intégration", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.description": "Affichez des informations détaillées sur votre nouvelle intégration personnalisée", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.title": "Afficher l'intégration", - "xpack.integrationAssistant.createIntegrationTitle": "Vous ne trouvez pas une intégration ?", - "xpack.integrationAssistant.createIntegrationUpload.close": "Fermer", - "xpack.integrationAssistant.createIntegrationUpload.documentation": "Charger une intégration", - "xpack.integrationAssistant.createIntegrationUpload.error": "Erreur lors de l'installation du package", - "xpack.integrationAssistant.createIntegrationUpload.inputText": "Glissez et déposez un fichier au format .zip ou parcourez les fichiers", - "xpack.integrationAssistant.createIntegrationUpload.install": "Ajouter à Elastic", - "xpack.integrationAssistant.createIntegrationUpload.title": "Charger un package d'intégration", - "xpack.integrationAssistant.createIntegrationUpload.uploadHelpText": "Pour en savoir plus, consultez {link}", - "xpack.integrationAssistant.errors.recursionLimitAnalyzeLogsErrorMessage": "Veuillez vérifier que le format des échantillons de logs est correct, puis réessayez. Essayez avec moins d'échantillons si l'erreur persiste.", - "xpack.integrationAssistant.errors.recursionLimitReached": "Nombre maximal de tentatives dépassé. Veuillez réessayer.", - "xpack.integrationAssistant.errors.unsupportedLogSamples": "Format de log non pris en charge dans les échantillons.", - "xpack.integrationAssistant.errors.uparseableCSV.withoutReason": "Impossible d'analyser les échantillons en tant que données CSV. Veuillez vérifier les échantillons fournis.", - "xpack.integrationAssistant.errors.uparseableCSV.withReason": "Impossible d'analyser les échantillons en tant que données CSV (motif : {reason}). Veuillez vérifier les échantillons fournis.", - "xpack.integrationAssistant.footer.back": "Retour", - "xpack.integrationAssistant.footer.cancel": "Annuler", - "xpack.integrationAssistant.footer.next": "Suivant", - "xpack.integrationAssistant.license.enterprise.label": "Enterprise", - "xpack.integrationAssistant.license.enterprise.title": "Licence Enterprise requise", - "xpack.integrationAssistant.license.enterprise.upgradeButton": "Mettre à niveau la licence", - "xpack.integrationAssistant.license.enterprise.upgradeDescription": "Pour activer cette fonctionnalité, vous devez mettre à niveau votre licence vers Enterprise ou démarrer un essai gratuit de 30 jours", - "xpack.integrationAssistant.license.enterprise.upgradeTitle": "Mettre à niveau vers Elastic Enterprise", - "xpack.integrationAssistant.missingPrivileges.contactAdministrator": "Contactez votre administrateur si vous avez besoin d'aide.", - "xpack.integrationAssistant.missingPrivileges.privilegesNeededTitle": "Les privilèges Kibana minimum requis pour utiliser cette fonctionnalité sont les suivants :", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsAll": "Gestion > Connecteurs : Tous", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsRead": "Gestion > Connecteurs : Lire", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.fleet": "Gestion > Fleet : Tous", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.integrations": "Gestion > Intégrations : Tous", - "xpack.integrationAssistant.missingPrivileges.title": "Privilèges manquants", - "xpack.integrationAssistant.pages.header.avatarTitle": "Alimenté par l’IA générative", - "xpack.integrationAssistant.pages.header.title": "Nouvelle intégration", - "xpack.integrationAssistant.step.connector": "Connecteur", - "xpack.integrationAssistant.step.dataStream": "Flux de données", - "xpack.integrationAssistant.step.dataStream.analyzing": "Analyse", - "xpack.integrationAssistant.step.dataStream.dataCollectionMethod.label": "Méthode de collecte de données", - "xpack.integrationAssistant.step.dataStream.dataStreamDescription": "Les logs sont analysés pour mapper automatiquement les champs ECS et aider à la création du pipeline d'ingestion", - "xpack.integrationAssistant.step.dataStream.dataStreamDescription.label": "Description du flux de données", - "xpack.integrationAssistant.step.dataStream.dataStreamName.label": "Nom du flux de données", - "xpack.integrationAssistant.step.dataStream.dataStreamTitle": "Définir le flux de données et charger les journaux", - "xpack.integrationAssistant.step.dataStream.dataStreamTitle.label": "Titre du flux de données", - "xpack.integrationAssistant.step.dataStream.generationError": "Une erreur s'est produite pendant : {progressStep}", - "xpack.integrationAssistant.step.dataStream.integrationName.label": "Nom du package d'intégration", - "xpack.integrationAssistant.step.dataStream.integrationNameDescription": "Le nom du package est utilisé pour faire référence à l'intégration dans le pipeline d'ingestion d'Elastic", - "xpack.integrationAssistant.step.dataStream.integrationNameTitle": "Définir le nom du package", - "xpack.integrationAssistant.step.dataStream.logsSample.description": "Glissez et déposez un fichier ou parcourez les fichiers.", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotParse": "Impossible d'analyser le fichier d'exemple de log en tant que fichier JSON ou NDJSON", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotRead": "Impossible de lire le fichier de logs exemple", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotReadWithReason": "Une erreur s'est produite lors de la lecture de l'échantillon de logs : {reason}", - "xpack.integrationAssistant.step.dataStream.logsSample.errorEmpty": "Le fichier de logs exemple est vide", - "xpack.integrationAssistant.step.dataStream.logsSample.errorNotArray": "Le fichier de logs exemple n'est pas un tableau", - "xpack.integrationAssistant.step.dataStream.logsSample.errorNotObject": "Le fichier de logs exemple contient des entrées n’étant pas des objets", - "xpack.integrationAssistant.step.dataStream.logsSample.errorTooLargeToParse": "Cet exemple de fichier de log est trop volumineux pour être analysé", - "xpack.integrationAssistant.step.dataStream.logsSample.label": "Logs", - "xpack.integrationAssistant.step.dataStream.logsSample.warning": "Veuillez noter que ces données seront analysées par un outil d'IA tiers. Assurez-vous de respecter les directives de confidentialité et de sécurité lors de la sélection des données.", - "xpack.integrationAssistant.step.dataStream.nameAlreadyExistsError": "Ce nom d'intégration est déjà utilisé. Veuillez choisir un autre nom.", - "xpack.integrationAssistant.step.dataStream.noSpacesHelpText": "Les noms peuvent contenir uniquement des lettres minuscules, des chiffres et des traits de soulignement (_)", - "xpack.integrationAssistant.step.dataStream.packageNamesFetchError": "Erreur lors de la récupération des noms de packages", - "xpack.integrationAssistant.step.dataStream.progress.analyzeLogs": "Analyse des exemples de logs", - "xpack.integrationAssistant.step.dataStream.progress.categorization": "Ajout d'une catégorisation", - "xpack.integrationAssistant.step.dataStream.progress.ecsMapping": "Mappage des champs ECS", - "xpack.integrationAssistant.step.dataStream.progress.relatedGraph": "Générer des champs associés", - "xpack.integrationAssistant.step.dataStream.retryButtonLabel": "Réessayer", - "xpack.integrationAssistant.step.deploy.downloadZip.description": "Téléchargez votre package d'intégration pour le réutiliser dans d'autres déploiements.", - "xpack.integrationAssistant.step.deploy.downloadZip.link": "Télécharger le package", - "xpack.integrationAssistant.step.deploy.downloadZip.title": "Télécharger le package au format .zip", - "xpack.integrationAssistant.step.deploy.loadingTitle": "Déploiement", - "xpack.integrationAssistant.step.integration": "Intégration", - "xpack.integrationAssistant.step.integration.description": "Nommez votre intégration, donnez-lui une description et (facultatif) ajoutez un logo", - "xpack.integrationAssistant.step.integration.integrationDescription": "Description", - "xpack.integrationAssistant.step.integration.integrationTitle": "Titre", - "xpack.integrationAssistant.step.integration.logo.description": "Glissez et déposez un fichier au format .svg ou parcourez les fichiers", - "xpack.integrationAssistant.step.integration.logo.error": "Erreur survenue lors du traitement du fichier de logo", - "xpack.integrationAssistant.step.integration.logo.label": "Logo (facultatif)", - "xpack.integrationAssistant.step.integration.preview": "Aperçu", - "xpack.integrationAssistant.step.integration.previewTooltip": "Ceci est un aperçu de la carte d'intégration pour le catalogue d'intégrations", - "xpack.integrationAssistant.step.integration.title": "Détails de l'intégration", - "xpack.integrationAssistant.step.review": "Révision", - "xpack.integrationAssistant.step.review.description": "Examinez tous les champs et leurs valeurs dans votre intégration. Apportez les modifications nécessaires pour garantir leur exactitude.", - "xpack.integrationAssistant.step.review.editPipeline": "Modifier le pipeline", - "xpack.integrationAssistant.step.review.ingestPipelineTitle": "Pipeline d'ingestion", - "xpack.integrationAssistant.step.review.save": "Enregistrer", - "xpack.integrationAssistant.step.review.title": "Examiner les résultats", - "xpack.integrationAssistant.steps.connector.createConnectorLabel": "Créer un nouveau connecteur", - "xpack.integrationAssistant.steps.connector.description": "Sélectionnez un connecteur d’IA pour vous aider à créer votre intégration personnalisée", - "xpack.integrationAssistant.steps.connector.supportedModelsInfo": "Pour une expérience optimale, nous recommandons actuellement d'utiliser un fournisseur prenant en charge les nouveaux modèles Claude. Nous travaillons actuellement à l'ajout d'une meilleure prise en charge de GPT-4 et de modèles similaires", - "xpack.integrationAssistant.steps.connector.title": "Choisissez votre connecteur d’IA", "xpack.inventory.add.apm.agent.button.": "Ajouter des données", "xpack.inventory.addDataContextMenu.link": "Ajouter des données", "xpack.inventory.apiCall.error.title": "Erreur lors de la récupération des ressources", @@ -40388,9 +40277,6 @@ "xpack.securitySolutionServerless.threatIntelligence.paywall.body": "Passez votre licence au niveau {productTypeRequired} pour utiliser Threat Intelligence.", "xpack.securitySolutionServerless.threatIntelligence.paywall.title": "Toujours plus avec Security !", "xpack.securitySolutionServerless.upselling.entityAnalytics.upgradeProductMessage": "La capacité d'évaluation du risque des entités est disponible dans notre niveau de licence {requiredProduct}", - "xpack.securitySolutionServerless.upselling.integrationAssistant.contactAdministrator": "Contactez votre administrateur si vous avez besoin d'aide.", - "xpack.securitySolutionServerless.upselling.integrationAssistant.tierRequired": "Palier {requiredProductType} requis", - "xpack.securitySolutionServerless.upselling.integrationAssistant.upgradeProductMessage": "Pour activer la fonctionnalité d'Assistant d'intégration, vous devez mettre à niveau le palier du produit vers {requiredProductType}", "xpack.securitySolutionServerless.upselling.pages.attackDiscovery.availabilityMessage": "Votre niveau de produit ne prend pas en charge Attack Discovery.", "xpack.securitySolutionServerless.upselling.pages.attackDiscovery.upgradeMessage": "Veuillez mettre votre produit à niveau pour utiliser cette fonctionnalité.", "xpack.serverless.header.giveFeedbackBtn.label": "Donner un retour", 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 7058c369c5404..f951b53f9b2bd 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -23625,117 +23625,6 @@ "xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchLabel": "冗長出力を表示", "xpack.ingestPipelines.testPipelineFlyout.successNotificationText": "パイプラインが実行されました", "xpack.ingestPipelines.testPipelineFlyout.title": "パイプラインをテスト", - "xpack.integrationAssistant.bottomBar.addToElastic": "Elasticに追加", - "xpack.integrationAssistant.bottomBar.analyzeLogs": "ログを分析", - "xpack.integrationAssistant.bottomBar.close": "閉じる", - "xpack.integrationAssistant.bottomBar.loading": "読み込み中", - "xpack.integrationAssistant.createIntegrationButton": "新しい統合を作成", - "xpack.integrationAssistant.createIntegrationDescription": "要件に合わせてカスタム統合を作成", - "xpack.integrationAssistant.createIntegrationLanding.assistant.button": "統合を作成", - "xpack.integrationAssistant.createIntegrationLanding.assistant.description": "AIを活用したプロセスを使用して、カスタム統合を構築", - "xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewBadge": "テクニカルプレビュー", - "xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewTooltip": "この機能はテクニカルプレビュー中で、変更される可能性があります。本番環境では注意して使用してください。", - "xpack.integrationAssistant.createIntegrationLanding.assistant.title": "カスタム統合を作成", - "xpack.integrationAssistant.createIntegrationLanding.description": "AIを活用したプロセスを開始し、統合を段階的に構築するか、以前に作成した統合の.zipパッケージをアップロード", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.button": ".zipをアップロード", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.description": "既存の統合パッケージが.zipファイルの場合、このオプションを選択します", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.title": "パッケージアップロード", - "xpack.integrationAssistant.createIntegrationLanding.title": "新しい統合を作成", - "xpack.integrationAssistant.createIntegrationLanding.uploadPackageDescription": "既存の統合パッケージがある場合は、{link}", - "xpack.integrationAssistant.createIntegrationLanding.uploadPackageLink": ".zipとしてアップロード", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.button": "エージェントに追加", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.description": "新しい統合をエージェントに追加して、データの収集を開始", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.title": "エージェントに追加", - "xpack.integrationAssistant.createIntegrationSuccess.description": "統合が正常に作成されました。", - "xpack.integrationAssistant.createIntegrationSuccess.title": "成功", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.button": "統合を表示", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.description": "新しい統合に関する詳細な情報を表示", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.title": "統合を表示", - "xpack.integrationAssistant.createIntegrationTitle": "統合が見つかりませんか?", - "xpack.integrationAssistant.createIntegrationUpload.close": "閉じる", - "xpack.integrationAssistant.createIntegrationUpload.documentation": "統合をアップロード", - "xpack.integrationAssistant.createIntegrationUpload.error": "パッケージのインストールエラー", - "xpack.integrationAssistant.createIntegrationUpload.inputText": ".zipファイルをドラッグアンドドロップするか、ファイルを参照します", - "xpack.integrationAssistant.createIntegrationUpload.install": "Elasticに追加", - "xpack.integrationAssistant.createIntegrationUpload.title": "統合パッケージをアップロード", - "xpack.integrationAssistant.createIntegrationUpload.uploadHelpText": "詳細については、{link}を参照してください。", - "xpack.integrationAssistant.errors.recursionLimitAnalyzeLogsErrorMessage": "ログサンプルの形式が正しいことを確認し、再試行してください。エラーが解決しない場合は、サンプル数を減らして、再試行してください。", - "xpack.integrationAssistant.errors.recursionLimitReached": "最大試行回数を超えました。再試行してください。", - "xpack.integrationAssistant.errors.unsupportedLogSamples": "サンプルのサポートされていないログ形式。", - "xpack.integrationAssistant.errors.uparseableCSV.withoutReason": "サンプルをCSVデータとして解析できません。提供されたサンプルを確認してください。", - "xpack.integrationAssistant.errors.uparseableCSV.withReason": "サンプルをCSVデータとして解析できません(理由:{reason})。提供されたサンプルを確認してください。", - "xpack.integrationAssistant.footer.back": "戻る", - "xpack.integrationAssistant.footer.cancel": "キャンセル", - "xpack.integrationAssistant.footer.next": "次へ", - "xpack.integrationAssistant.license.enterprise.label": "Enterprise", - "xpack.integrationAssistant.license.enterprise.title": "エンタープライズライセンスが必要です", - "xpack.integrationAssistant.license.enterprise.upgradeButton": "ライセンスをアップグレード", - "xpack.integrationAssistant.license.enterprise.upgradeDescription": "この機能をオンにすると、エンタープライズライセンスにアップグレードするか、30日間無料の試用版を開始する必要があります", - "xpack.integrationAssistant.license.enterprise.upgradeTitle": "Elastic Enterpriseにアップグレード", - "xpack.integrationAssistant.missingPrivileges.contactAdministrator": "サポートについては、管理者にお問い合わせください。", - "xpack.integrationAssistant.missingPrivileges.privilegesNeededTitle": "この機能を使用するために必要な最小限のKibana権限:", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsAll": "管理 > コネクター:すべて", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsRead": "管理 > コネクター:読み取り", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.fleet": "管理 > Fleet:すべて", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.integrations": "管理 > 統合:すべて", - "xpack.integrationAssistant.missingPrivileges.title": "不足している権限", - "xpack.integrationAssistant.pages.header.avatarTitle": "生成AIを活用", - "xpack.integrationAssistant.pages.header.title": "新しい統合", - "xpack.integrationAssistant.step.connector": "コネクター", - "xpack.integrationAssistant.step.dataStream": "データストリーム", - "xpack.integrationAssistant.step.dataStream.analyzing": "分析中", - "xpack.integrationAssistant.step.dataStream.dataCollectionMethod.label": "データ収集方法", - "xpack.integrationAssistant.step.dataStream.dataStreamDescription": "ログは分析され、自動的にECSフィールドにマッピングされ、インジェストパイプラインを作成できます", - "xpack.integrationAssistant.step.dataStream.dataStreamDescription.label": "データストリーム説明", - "xpack.integrationAssistant.step.dataStream.dataStreamName.label": "データストリーム名", - "xpack.integrationAssistant.step.dataStream.dataStreamTitle": "データストリームを定義して、ログをアップロード", - "xpack.integrationAssistant.step.dataStream.dataStreamTitle.label": "データストリームタイトル", - "xpack.integrationAssistant.step.dataStream.generationError": "{progressStep}中にエラーが発生しました", - "xpack.integrationAssistant.step.dataStream.integrationName.label": "統合パッケージ名", - "xpack.integrationAssistant.step.dataStream.integrationNameDescription": "このパッケージ名は、Elasticのインジェストパイプラインの統合を参照するために使用されます", - "xpack.integrationAssistant.step.dataStream.integrationNameTitle": "パッケージ名を定義", - "xpack.integrationAssistant.step.dataStream.logsSample.description": "ファイルをドラッグアンドドロップするか、ファイルを参照します", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotParse": "ログサンプルファイルをJSONまたはNDJSONファイルとして解析できません", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotRead": "ログサンプルファイルを読み取れませんでした", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotReadWithReason": "ログサンプルの読み取り中にエラーが発生しました:{reason}", - "xpack.integrationAssistant.step.dataStream.logsSample.errorEmpty": "ログサンプルファイルが空です", - "xpack.integrationAssistant.step.dataStream.logsSample.errorNotArray": "ログサンプルファイルは配列ではありません", - "xpack.integrationAssistant.step.dataStream.logsSample.errorNotObject": "ログサンプルファイルには、オブジェクト以外のエントリが含まれています", - "xpack.integrationAssistant.step.dataStream.logsSample.errorTooLargeToParse": "このログサンプルファイルは大きすぎて解析できません", - "xpack.integrationAssistant.step.dataStream.logsSample.label": "ログ", - "xpack.integrationAssistant.step.dataStream.logsSample.warning": "このデータは、サードパーティAIツールによって分析されます。データを選択するときには、プライバシーおよびセキュリティガイドラインに準拠していることを確認してください。", - "xpack.integrationAssistant.step.dataStream.nameAlreadyExistsError": "この統合名はすでに使用中です。別の名前を選択してください。", - "xpack.integrationAssistant.step.dataStream.noSpacesHelpText": "名前には、小文字、数字、アンダースコア(_)のみを使用できます。", - "xpack.integrationAssistant.step.dataStream.packageNamesFetchError": "パッケージ名の取得エラー", - "xpack.integrationAssistant.step.dataStream.progress.analyzeLogs": "サンプルログを分析中", - "xpack.integrationAssistant.step.dataStream.progress.categorization": "カテゴリを追加", - "xpack.integrationAssistant.step.dataStream.progress.ecsMapping": "ECSフィールドをマッピング中", - "xpack.integrationAssistant.step.dataStream.progress.relatedGraph": "関連するフィールドを生成中", - "xpack.integrationAssistant.step.dataStream.retryButtonLabel": "再試行", - "xpack.integrationAssistant.step.deploy.downloadZip.description": "他のデプロイで再利用する統合パッケージをダウンロードします。", - "xpack.integrationAssistant.step.deploy.downloadZip.link": "パッケージをダウンロード", - "xpack.integrationAssistant.step.deploy.downloadZip.title": ".zipパッケージをダウンロード", - "xpack.integrationAssistant.step.deploy.loadingTitle": "デプロイ中", - "xpack.integrationAssistant.step.integration": "統合", - "xpack.integrationAssistant.step.integration.description": "統合の名前を指定し、説明を入力して、(任意で)ロゴを追加", - "xpack.integrationAssistant.step.integration.integrationDescription": "説明", - "xpack.integrationAssistant.step.integration.integrationTitle": "タイトル", - "xpack.integrationAssistant.step.integration.logo.description": ".svgファイルをドラッグアンドドロップするか、ファイルを参照します", - "xpack.integrationAssistant.step.integration.logo.error": "ロゴファイルの処理エラー", - "xpack.integrationAssistant.step.integration.logo.label": "ロゴ(任意)", - "xpack.integrationAssistant.step.integration.preview": "プレビュー", - "xpack.integrationAssistant.step.integration.previewTooltip": "これは、統合カタログの統合カードのプレビューです", - "xpack.integrationAssistant.step.integration.title": "統合の詳細", - "xpack.integrationAssistant.step.review": "見直し", - "xpack.integrationAssistant.step.review.description": "統合のすべてのフィールドと値を確認します。精度を保証するために、必要な調整があれば行います。", - "xpack.integrationAssistant.step.review.editPipeline": "パイプラインの編集", - "xpack.integrationAssistant.step.review.ingestPipelineTitle": "パイプラインを投入", - "xpack.integrationAssistant.step.review.save": "保存", - "xpack.integrationAssistant.step.review.title": "結果を確認", - "xpack.integrationAssistant.steps.connector.createConnectorLabel": "新しいコネクターを作成", - "xpack.integrationAssistant.steps.connector.description": "カスタム統合の作成を支援するAIコネクターを選択", - "xpack.integrationAssistant.steps.connector.supportedModelsInfo": "現在、最高のエクスペリエンスが得られるように、新しいClaudeモデルをサポートするプロバイダーを利用することをお勧めします。現在、GPT-4や類似モデルへの改善されたサポートの追加に取り組んでいます。", - "xpack.integrationAssistant.steps.connector.title": "AIコネクターを選択", "xpack.inventory.add.apm.agent.button.": "データの追加", "xpack.inventory.addDataContextMenu.link": "データの追加", "xpack.inventory.apiCall.error.title": "リソースの取得中にエラーが発生しました", @@ -40247,9 +40136,6 @@ "xpack.securitySolutionServerless.threatIntelligence.paywall.body": "脅威インテリジェンスを使用するには、ライセンスを{productTypeRequired}にアップグレードしてください。", "xpack.securitySolutionServerless.threatIntelligence.paywall.title": "Securityではさまざまなことが可能です!", "xpack.securitySolutionServerless.upselling.entityAnalytics.upgradeProductMessage": "エンティティリスクスコアリング機能は、{requiredProduct}ライセンスティアで利用可能です", - "xpack.securitySolutionServerless.upselling.integrationAssistant.contactAdministrator": "サポートについては、管理者にお問い合わせください。", - "xpack.securitySolutionServerless.upselling.integrationAssistant.tierRequired": "{requiredProductType}ティアが必要です", - "xpack.securitySolutionServerless.upselling.integrationAssistant.upgradeProductMessage": "統合アシスタント機能をオンにするには、製品ティアを{requiredProductType}にアップグレードする必要があります", "xpack.securitySolutionServerless.upselling.pages.attackDiscovery.availabilityMessage": "ご使用の製品ティアはAttack Discoveryをサポートしていません。", "xpack.securitySolutionServerless.upselling.pages.attackDiscovery.upgradeMessage": "この機能を使用するには、製品ティアをアップグレードしてください。", "xpack.serverless.header.giveFeedbackBtn.label": "フィードバックを作成する", 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 48421acdfe1d9..10ccac6ffb6da 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -23218,117 +23218,6 @@ "xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchLabel": "查看详细输出", "xpack.ingestPipelines.testPipelineFlyout.successNotificationText": "管道已执行", "xpack.ingestPipelines.testPipelineFlyout.title": "测试管道", - "xpack.integrationAssistant.bottomBar.addToElastic": "添加到 Elastic", - "xpack.integrationAssistant.bottomBar.analyzeLogs": "分析日志", - "xpack.integrationAssistant.bottomBar.close": "关闭", - "xpack.integrationAssistant.bottomBar.loading": "正在加载", - "xpack.integrationAssistant.createIntegrationButton": "创建新集成", - "xpack.integrationAssistant.createIntegrationDescription": "创建定制集成以满足您的要求", - "xpack.integrationAssistant.createIntegrationLanding.assistant.button": "创建集成", - "xpack.integrationAssistant.createIntegrationLanding.assistant.description": "使用我们的 AI 驱动式进程构建定制集成", - "xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewBadge": "技术预览", - "xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewTooltip": "此功能处于技术预览状态,可能会进行更改。在生产环境中请谨慎使用。", - "xpack.integrationAssistant.createIntegrationLanding.assistant.title": "创建定制集成", - "xpack.integrationAssistant.createIntegrationLanding.description": "启动 AI 驱动式进程以分步构建集成,或上传以前创建的集成的 .zip 软件包", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.button": "上传 .zip", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.description": "如果具有 .zip 文件格式的现有集成软件包,请使用此选项", - "xpack.integrationAssistant.createIntegrationLanding.packageUpload.title": "软件包上传", - "xpack.integrationAssistant.createIntegrationLanding.title": "创建新集成", - "xpack.integrationAssistant.createIntegrationLanding.uploadPackageDescription": "如果具有现有集成软件包,{link}", - "xpack.integrationAssistant.createIntegrationLanding.uploadPackageLink": "作为 .zip 上传", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.button": "添加到代理", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.description": "将新集成添加到代理以开始收集数据", - "xpack.integrationAssistant.createIntegrationSuccess.addToAgent.title": "添加到代理", - "xpack.integrationAssistant.createIntegrationSuccess.description": "已成功创建集成。", - "xpack.integrationAssistant.createIntegrationSuccess.title": "成功", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.button": "查看集成", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.description": "查看有关新定制集成的详细信息", - "xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.title": "查看集成", - "xpack.integrationAssistant.createIntegrationTitle": "找不到集成?", - "xpack.integrationAssistant.createIntegrationUpload.close": "关闭", - "xpack.integrationAssistant.createIntegrationUpload.documentation": "上传集成", - "xpack.integrationAssistant.createIntegrationUpload.error": "安装软件包时出错", - "xpack.integrationAssistant.createIntegrationUpload.inputText": "拖放 .zip 文件或浏览文件", - "xpack.integrationAssistant.createIntegrationUpload.install": "添加到 Elastic", - "xpack.integrationAssistant.createIntegrationUpload.title": "上传集成软件包", - "xpack.integrationAssistant.createIntegrationUpload.uploadHelpText": "有关更多信息,请参阅 {link}", - "xpack.integrationAssistant.errors.recursionLimitAnalyzeLogsErrorMessage": "请验证日志样例的格式是否正确,然后重试。如果错误持续存在,请尝试使用较少的样例。", - "xpack.integrationAssistant.errors.recursionLimitReached": "超出了最大尝试次数。请重试。", - "xpack.integrationAssistant.errors.unsupportedLogSamples": "样例中的日志格式不受支持。", - "xpack.integrationAssistant.errors.uparseableCSV.withoutReason": "无法将样例解析为 CSV 数据。请检查提供的样例。", - "xpack.integrationAssistant.errors.uparseableCSV.withReason": "无法将样例解析为 CSV 数据(原因:{reason})。请检查提供的样例。", - "xpack.integrationAssistant.footer.back": "返回", - "xpack.integrationAssistant.footer.cancel": "取消", - "xpack.integrationAssistant.footer.next": "下一步", - "xpack.integrationAssistant.license.enterprise.label": "企业", - "xpack.integrationAssistant.license.enterprise.title": "需要企业许可证", - "xpack.integrationAssistant.license.enterprise.upgradeButton": "升级许可证", - "xpack.integrationAssistant.license.enterprise.upgradeDescription": "要打开此功能,必须将许可证升级到企业许可证,或开始 30 天免费试用", - "xpack.integrationAssistant.license.enterprise.upgradeTitle": "升级到 Elastic 企业版", - "xpack.integrationAssistant.missingPrivileges.contactAdministrator": "请联系管理员寻求帮助。", - "xpack.integrationAssistant.missingPrivileges.privilegesNeededTitle": "使用此功能所需的最低 Kibana 权限为:", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsAll": "管理 > 连接器:全部", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsRead": "管理 > 连接器:读取", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.fleet": "管理 > Fleet:全部", - "xpack.integrationAssistant.missingPrivileges.requiredPrivileges.integrations": "管理 > 集成:全部", - "xpack.integrationAssistant.missingPrivileges.title": "缺少权限", - "xpack.integrationAssistant.pages.header.avatarTitle": "由生成式 AI 提供支持", - "xpack.integrationAssistant.pages.header.title": "新集成", - "xpack.integrationAssistant.step.connector": "连接器", - "xpack.integrationAssistant.step.dataStream": "数据流", - "xpack.integrationAssistant.step.dataStream.analyzing": "正在分析", - "xpack.integrationAssistant.step.dataStream.dataCollectionMethod.label": "数据收集方法", - "xpack.integrationAssistant.step.dataStream.dataStreamDescription": "将分析日志以自动映射 ECS 字段,并帮助创建采集管道", - "xpack.integrationAssistant.step.dataStream.dataStreamDescription.label": "数据流描述", - "xpack.integrationAssistant.step.dataStream.dataStreamName.label": "数据流名称", - "xpack.integrationAssistant.step.dataStream.dataStreamTitle": "定义数据流并上传日志", - "xpack.integrationAssistant.step.dataStream.dataStreamTitle.label": "数据流标题", - "xpack.integrationAssistant.step.dataStream.generationError": "以下期间出现错误:{progressStep}", - "xpack.integrationAssistant.step.dataStream.integrationName.label": "集成软件包名称", - "xpack.integrationAssistant.step.dataStream.integrationNameDescription": "软件包名称用于在 Elastic 采集管道中引用集成", - "xpack.integrationAssistant.step.dataStream.integrationNameTitle": "定义软件包名称", - "xpack.integrationAssistant.step.dataStream.logsSample.description": "拖放文件或浏览文件。", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotParse": "无法将日志样例文件解析为 JSON 或 NDJSON 文件", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotRead": "无法读取日志样例文件", - "xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotReadWithReason": "读取日志样例时发生错误:{reason}", - "xpack.integrationAssistant.step.dataStream.logsSample.errorEmpty": "日志样例文件为空", - "xpack.integrationAssistant.step.dataStream.logsSample.errorNotArray": "日志样例文件不是数组", - "xpack.integrationAssistant.step.dataStream.logsSample.errorNotObject": "日志样例文件包含非对象条目", - "xpack.integrationAssistant.step.dataStream.logsSample.errorTooLargeToParse": "此日志样例文件太大,无法解析", - "xpack.integrationAssistant.step.dataStream.logsSample.label": "日志", - "xpack.integrationAssistant.step.dataStream.logsSample.warning": "请注意,此数据将由第三方 AI 工具进行分析。选择数据时,请确保遵循隐私和安全指引。", - "xpack.integrationAssistant.step.dataStream.nameAlreadyExistsError": "此集成名称已在使用中。请选择其他名称。", - "xpack.integrationAssistant.step.dataStream.noSpacesHelpText": "名称只能包含小写字母、数字和下划线 (_)", - "xpack.integrationAssistant.step.dataStream.packageNamesFetchError": "提取软件包名称时出错", - "xpack.integrationAssistant.step.dataStream.progress.analyzeLogs": "正在分析样例日志", - "xpack.integrationAssistant.step.dataStream.progress.categorization": "正在添加归类", - "xpack.integrationAssistant.step.dataStream.progress.ecsMapping": "正在映射 ECS 字段", - "xpack.integrationAssistant.step.dataStream.progress.relatedGraph": "正在生成相关字段", - "xpack.integrationAssistant.step.dataStream.retryButtonLabel": "重试", - "xpack.integrationAssistant.step.deploy.downloadZip.description": "下载集成软件包以在其他部署中重复使用。", - "xpack.integrationAssistant.step.deploy.downloadZip.link": "下载软件包", - "xpack.integrationAssistant.step.deploy.downloadZip.title": "下载 .zip 软件包", - "xpack.integrationAssistant.step.deploy.loadingTitle": "正在部署", - "xpack.integrationAssistant.step.integration": "集成", - "xpack.integrationAssistant.step.integration.description": "为您的集成命名,为其提供描述并(可选)添加徽标", - "xpack.integrationAssistant.step.integration.integrationDescription": "描述", - "xpack.integrationAssistant.step.integration.integrationTitle": "标题", - "xpack.integrationAssistant.step.integration.logo.description": "拖放 .svg 文件或浏览文件", - "xpack.integrationAssistant.step.integration.logo.error": "处理徽标文件时出错", - "xpack.integrationAssistant.step.integration.logo.label": "徽标(可选)", - "xpack.integrationAssistant.step.integration.preview": "预览", - "xpack.integrationAssistant.step.integration.previewTooltip": "这是用于集成目录的集成卡的预览", - "xpack.integrationAssistant.step.integration.title": "集成详情", - "xpack.integrationAssistant.step.review": "复查", - "xpack.integrationAssistant.step.review.description": "查看集成中的所有字段及其值。做出任何必要的调整以确保准确性。", - "xpack.integrationAssistant.step.review.editPipeline": "编辑管道", - "xpack.integrationAssistant.step.review.ingestPipelineTitle": "采集管道", - "xpack.integrationAssistant.step.review.save": "保存", - "xpack.integrationAssistant.step.review.title": "复查结果", - "xpack.integrationAssistant.steps.connector.createConnectorLabel": "创建新连接器", - "xpack.integrationAssistant.steps.connector.description": "选择 AI 连接器以帮助您创建定制集成", - "xpack.integrationAssistant.steps.connector.supportedModelsInfo": "当前,我们建议使用支持更新 Claude 模型的提供商,以获得最佳体验。目前,我们正努力为 GPT-4 和类似模型添加更全面的支持", - "xpack.integrationAssistant.steps.connector.title": "选择 AI 连接器", "xpack.inventory.add.apm.agent.button.": "添加数据", "xpack.inventory.addDataContextMenu.link": "添加数据", "xpack.inventory.apiCall.error.title": "提取资源时出错", @@ -39662,9 +39551,6 @@ "xpack.securitySolutionServerless.securityAiAssistantManagement.app.title": "适用于 Security 的 AI 助手设置", "xpack.securitySolutionServerless.threatIntelligence.paywall.body": "将您的许可证升级到{productTypeRequired}以使用威胁情报。", "xpack.securitySolutionServerless.threatIntelligence.paywall.title": "Security 让您事半功倍!", - "xpack.securitySolutionServerless.upselling.integrationAssistant.contactAdministrator": "请联系管理员寻求帮助。", - "xpack.securitySolutionServerless.upselling.integrationAssistant.tierRequired": "{requiredProductType} 套餐必填", - "xpack.securitySolutionServerless.upselling.integrationAssistant.upgradeProductMessage": "要打开集成助手功能,必须将产品套餐升级到 {requiredProductType}", "xpack.securitySolutionServerless.upselling.pages.attackDiscovery.availabilityMessage": "您的产品套餐不支持 Attack Discovery。", "xpack.securitySolutionServerless.upselling.pages.attackDiscovery.upgradeMessage": "请升级产品套餐以使用此功能。", "xpack.serverless.header.giveFeedbackBtn.label": "反馈", diff --git a/x-pack/platform/plugins/shared/integration_assistant/README.md b/x-pack/platform/plugins/shared/automatic_import/README.md similarity index 96% rename from x-pack/platform/plugins/shared/integration_assistant/README.md rename to x-pack/platform/plugins/shared/automatic_import/README.md index 3300776c763ac..9824be5b70dd6 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/README.md +++ b/x-pack/platform/plugins/shared/automatic_import/README.md @@ -1,4 +1,4 @@ -# Integration Assistant +# Automatic Import ## Overview @@ -86,5 +86,5 @@ All mocks/fixtures are placed in the top `./__jest__` directory of the plugin. I Tests can be run with: ```bash -node scripts/jest x-pack/platform/plugins/shared/integration_assistant/ --coverage +node scripts/jest x-pack/platform/plugins/shared/automatic_import/ --coverage ``` diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/api_analysis.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/api_analysis.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/api_analysis.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/api_analysis.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/build_integration.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/build_integration.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/build_integration.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/build_integration.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/categorization.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/categorization.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/categorization.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/categorization.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/cel.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/cel.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/cel.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/cel.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/ecs_mapping.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/ecs_mapping.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/ecs_mapping.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/ecs_mapping.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/index.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/index.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/kv.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/kv.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/kv.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/kv.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/log_type_detection.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/log_type_detection.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/log_type_detection.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/log_type_detection.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/related.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/related.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/related.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/related.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/unstructured.ts b/x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/unstructured.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/__jest__/fixtures/unstructured.ts rename to x-pack/platform/plugins/shared/automatic_import/__jest__/fixtures/unstructured.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.gen.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.gen.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.schema.yaml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.schema.yaml diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_api/analyze_api_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/analyze_api/analyze_api_route.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.gen.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.gen.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.schema.yaml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.schema.yaml diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/analyze_logs/analyze_logs_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/analyze_logs/analyze_logs_route.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.gen.ts similarity index 92% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.gen.ts index 46db1066ffdff..17a791cb6916f 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.gen.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.gen.ts @@ -10,7 +10,7 @@ * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. * * info: - * title: Integration Assistatnt Build Integrarion API endpoint + * title: Automatic Import Build Integration API endpoint * version: 1 */ diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.schema.yaml similarity index 93% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.schema.yaml index cc210c53f1e70..796b37a512dc1 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/build_integration/build_integration.schema.yaml +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/build_integration/build_integration.schema.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - title: Integration Assistatnt Build Integrarion API endpoint + title: Automatic Import Build Integration API endpoint version: "1" paths: /internal/automatic_import/build: diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.gen.ts similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.gen.ts index 0b2492e41ac12..f709575a1f5fb 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.gen.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.gen.ts @@ -10,7 +10,7 @@ * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. * * info: - * title: Integration Assistatnt Categorization API endpoint + * title: Automatic Import Categorization API endpoint * version: 1 */ diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.schema.yaml similarity index 96% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.schema.yaml index 694eb80e852c4..2ff2cd8a4cff0 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.schema.yaml +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.schema.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - title: Integration Assistatnt Categorization API endpoint + title: Automatic Import Categorization API endpoint version: "1" paths: /internal/automatic_import/categorization: diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/categorization/categorization_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/categorization/categorization_route.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.gen.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.gen.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.schema.yaml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.schema.yaml diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/cel/cel_input_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/cel/cel_input_route.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.gen.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.gen.ts index 18888108396f4..3d7d2faefc997 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.gen.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.gen.ts @@ -10,7 +10,7 @@ * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. * * info: - * title: Integration Assistatnt Check Pipeline API endpoint + * title: Automatic Import Check Pipeline API endpoint * version: 1 */ diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.schema.yaml similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.schema.yaml index e592565c52b63..446b224f7c040 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/check_pipeline/check_pipeline.schema.yaml +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/check_pipeline/check_pipeline.schema.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - title: Integration Assistatnt Check Pipeline API endpoint + title: Automatic Import Check Pipeline API endpoint version: "1" paths: /internal/automatic_import/pipeline: diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.gen.ts similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.gen.ts index 867f792405cbd..e44ccc94b37c5 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.gen.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.gen.ts @@ -10,7 +10,7 @@ * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. * * info: - * title: Integration Assistatnt ECS Mapping API endpoint + * title: Automatic Import ECS Mapping API endpoint * version: 1 */ diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.schema.yaml similarity index 97% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.schema.yaml index 2534823b1d171..c88a2dc17c6d1 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.schema.yaml +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.schema.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - title: Integration Assistatnt ECS Mapping API endpoint + title: Automatic Import ECS Mapping API endpoint version: "1" paths: /internal/automatic_import/ecs: diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/ecs/ecs_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/ecs/ecs_route.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/generation_error.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/generation_error.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/generation_error.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/generation_error.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/generation_error.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/generation_error.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/generation_error.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/generation_error.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/api_test.mock.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/model/api_test.mock.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/api_test.mock.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/api_test.mock.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.gen.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.gen.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.schema.yaml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/cel_input_attributes.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/cel_input_attributes.schema.yaml diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.gen.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.schema.yaml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/common_attributes.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/common_attributes.schema.yaml diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/processor_attributes.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/model/processor_attributes.gen.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/processor_attributes.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/processor_attributes.gen.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/processor_attributes.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/model/processor_attributes.schema.yaml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/processor_attributes.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/processor_attributes.schema.yaml diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/response_schemas.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/model/response_schemas.gen.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/response_schemas.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/response_schemas.gen.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/model/response_schemas.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/model/response_schemas.schema.yaml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/model/response_schemas.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/model/response_schemas.schema.yaml diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.gen.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.gen.ts similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.gen.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.gen.ts index eceb01679a442..52db0cda6eefb 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.gen.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.gen.ts @@ -10,7 +10,7 @@ * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. * * info: - * title: Integration Assistatnt Related API endpoint + * title: Automatic Import Related API endpoint * version: 1 */ diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.schema.yaml b/x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.schema.yaml similarity index 97% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.schema.yaml rename to x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.schema.yaml index 2d53b07d4f846..7ce6a4b901e27 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.schema.yaml +++ b/x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.schema.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - title: Integration Assistatnt Related API endpoint + title: Automatic Import Related API endpoint version: "1" paths: /internal/automatic_import/related: diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/api/related/related_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/api/related/related_route.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/constants.ts b/x-pack/platform/plugins/shared/automatic_import/common/constants.ts similarity index 62% rename from x-pack/platform/plugins/shared/integration_assistant/common/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/common/constants.ts index 52f7992643fbc..ee668a859cc05 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/constants.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/constants.ts @@ -8,22 +8,22 @@ import type { LicenseType } from '@kbn/licensing-plugin/common/types'; // Plugin information -export const PLUGIN_ID = 'integrationAssistant'; +export const PLUGIN_ID = 'automaticImport'; // Public App Routes -export const INTEGRATION_ASSISTANT_APP_ROUTE = '/app/integration_assistant'; +export const AUTOMATIC_IMPORT_APP_ROUTE = '/app/automatic_import'; // Server API Routes -export const INTEGRATION_ASSISTANT_BASE_PATH = '/internal/automatic_import'; - -export const ECS_GRAPH_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/ecs`; -export const CATEGORIZATION_GRAPH_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/categorization`; -export const ANALYZE_LOGS_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/analyzelogs`; -export const RELATED_GRAPH_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/related`; -export const ANALYZE_API_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/analyzeapi`; -export const CEL_INPUT_GRAPH_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/cel`; -export const CHECK_PIPELINE_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/pipeline`; -export const INTEGRATION_BUILDER_PATH = `${INTEGRATION_ASSISTANT_BASE_PATH}/build`; +export const AUTOMATIC_IMPORT_BASE_PATH = '/internal/automatic_import'; + +export const ECS_GRAPH_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/ecs`; +export const CATEGORIZATION_GRAPH_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/categorization`; +export const ANALYZE_LOGS_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/analyzelogs`; +export const RELATED_GRAPH_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/related`; +export const ANALYZE_API_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/analyzeapi`; +export const CEL_INPUT_GRAPH_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/cel`; +export const CHECK_PIPELINE_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/pipeline`; +export const INTEGRATION_BUILDER_PATH = `${AUTOMATIC_IMPORT_BASE_PATH}/build`; export const FLEET_PACKAGES_PATH = `/api/fleet/epm/packages`; // License diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/ecs.ts b/x-pack/platform/plugins/shared/automatic_import/common/ecs.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/ecs.ts rename to x-pack/platform/plugins/shared/automatic_import/common/ecs.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/experimental_features.ts b/x-pack/platform/plugins/shared/automatic_import/common/experimental_features.ts similarity index 89% rename from x-pack/platform/plugins/shared/integration_assistant/common/experimental_features.ts rename to x-pack/platform/plugins/shared/automatic_import/common/experimental_features.ts index d4c5a48b0e9ec..ecb875390b479 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/experimental_features.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/experimental_features.ts @@ -16,7 +16,7 @@ const _allowedExperimentalValues = { }; /** - * A list of allowed values that can be used in `xpack.integration_assistant.enableExperimental`. + * A list of allowed values that can be used in `xpack.automatic_import.enableExperimental`. * This object is then used to validate and parse the value entered. */ export const allowedExperimentalValues = Object.freeze< @@ -30,7 +30,7 @@ type Mutable<T> = { -readonly [P in keyof T]: T[P] }; const allowedKeys = Object.keys(allowedExperimentalValues) as Readonly<ExperimentalConfigKeys>; /** - * Parses the string value used in `xpack.integration_assistant.enableExperimental` kibana configuration, + * Parses the string value used in `xpack.automatic_import.enableExperimental` kibana configuration, * which should be a string of values delimited by a comma (`,`) * * @param configValue diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/index.ts b/x-pack/platform/plugins/shared/automatic_import/common/index.ts similarity index 96% rename from x-pack/platform/plugins/shared/integration_assistant/common/index.ts rename to x-pack/platform/plugins/shared/automatic_import/common/index.ts index 60ee134cf9acf..3ab16998cf861 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/common/index.ts +++ b/x-pack/platform/plugins/shared/automatic_import/common/index.ts @@ -40,8 +40,8 @@ export { CATEGORIZATION_GRAPH_PATH, CEL_INPUT_GRAPH_PATH, ECS_GRAPH_PATH, - INTEGRATION_ASSISTANT_APP_ROUTE, - INTEGRATION_ASSISTANT_BASE_PATH, + AUTOMATIC_IMPORT_APP_ROUTE, + AUTOMATIC_IMPORT_BASE_PATH, INTEGRATION_BUILDER_PATH, PLUGIN_ID, RELATED_GRAPH_PATH, diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/utils.test.ts b/x-pack/platform/plugins/shared/automatic_import/common/utils.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/utils.test.ts rename to x-pack/platform/plugins/shared/automatic_import/common/utils.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/common/utils.ts b/x-pack/platform/plugins/shared/automatic_import/common/utils.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/common/utils.ts rename to x-pack/platform/plugins/shared/automatic_import/common/utils.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/analyze_api_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/analyze_api_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/analyze_api_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/analyze_api_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/categorization_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/categorization_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/categorization_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/categorization_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/cel_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/cel_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/cel_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/cel_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/ecs_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/ecs_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/ecs_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/ecs_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/ecs_subgraph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/ecs_subgraph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/ecs_subgraph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/ecs_subgraph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/kv_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/kv_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/kv_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/kv_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/log_detection_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/log_detection_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/log_detection_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/log_detection_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/related_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/related_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/related_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/related_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/docs/imgs/unstructured_graph.png b/x-pack/platform/plugins/shared/automatic_import/docs/imgs/unstructured_graph.png similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/docs/imgs/unstructured_graph.png rename to x-pack/platform/plugins/shared/automatic_import/docs/imgs/unstructured_graph.png diff --git a/x-pack/platform/plugins/shared/integration_assistant/jest.config.js b/x-pack/platform/plugins/shared/automatic_import/jest.config.js similarity index 51% rename from x-pack/platform/plugins/shared/integration_assistant/jest.config.js rename to x-pack/platform/plugins/shared/automatic_import/jest.config.js index 9d35ce22d3231..1a7e7c7026a3d 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/jest.config.js +++ b/x-pack/platform/plugins/shared/automatic_import/jest.config.js @@ -8,15 +8,15 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/platform/plugins/shared/integration_assistant'], + roots: ['<rootDir>/x-pack/platform/plugins/shared/automatic_import'], coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/integration_assistant', + '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/automatic_import', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '<rootDir>/x-pack/platform/plugins/shared/integration_assistant/{common,server,public}/**/*.{ts,tsx}', - '!<rootDir>/x-pack/platform/plugins/shared/integration_assistant/{__jest__}/**/*', - '!<rootDir>/x-pack/platform/plugins/shared/integration_assistant/**/*.test.{ts,tsx}', - '!<rootDir>/x-pack/platform/plugins/shared/integration_assistant/**/*.config.ts', + '<rootDir>/x-pack/platform/plugins/shared/automatic_import/{common,server,public}/**/*.{ts,tsx}', + '!<rootDir>/x-pack/platform/plugins/shared/automatic_import/{__jest__}/**/*', + '!<rootDir>/x-pack/platform/plugins/shared/automatic_import/**/*.test.{ts,tsx}', + '!<rootDir>/x-pack/platform/plugins/shared/automatic_import/**/*.config.ts', ], setupFiles: ['jest-canvas-mock'], }; diff --git a/x-pack/platform/plugins/shared/integration_assistant/kibana.jsonc b/x-pack/platform/plugins/shared/automatic_import/kibana.jsonc similarity index 68% rename from x-pack/platform/plugins/shared/integration_assistant/kibana.jsonc rename to x-pack/platform/plugins/shared/automatic_import/kibana.jsonc index 66ee0775fb481..8f34ee79cc453 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/kibana.jsonc +++ b/x-pack/platform/plugins/shared/automatic_import/kibana.jsonc @@ -1,17 +1,17 @@ { "type": "plugin", - "id": "@kbn/integration-assistant-plugin", + "id": "@kbn/automatic-import-plugin", "owner": "@elastic/security-scalability", "group": "platform", "visibility": "shared", - "description": "Plugin implementing the Integration Assistant API and UI", + "description": "Plugin implementing the Automatic Import API and UI", "plugin": { - "id": "integrationAssistant", + "id": "automaticImport", "server": true, "browser": true, "configPath": [ "xpack", - "integration_assistant" + "automatic_import" ], "requiredPlugins": [ "kibanaReact", diff --git a/x-pack/platform/plugins/shared/integration_assistant/package.json b/x-pack/platform/plugins/shared/automatic_import/package.json similarity index 78% rename from x-pack/platform/plugins/shared/integration_assistant/package.json rename to x-pack/platform/plugins/shared/automatic_import/package.json index f8eef738a69ae..d2d5a452fbef1 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/package.json +++ b/x-pack/platform/plugins/shared/automatic_import/package.json @@ -1,6 +1,6 @@ { "author": "Elastic", - "name": "@kbn/integration-assistant-plugin", + "name": "@kbn/automatic-import-plugin", "version": "1.0.0", "private": true, "license": "Elastic License 2.0", diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/authorization_wrapper.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/authorization_wrapper.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/authorization_wrapper.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/authorization_wrapper.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/missing_privileges_description.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/missing_privileges_description.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/missing_privileges_description.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/missing_privileges_description.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/missing_privileges_tooltip.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/missing_privileges_tooltip.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/missing_privileges_tooltip.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/missing_privileges_tooltip.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/translations.ts similarity index 62% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/translations.ts index 9da73799dc69c..a84df39d7933c 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/authorization/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/common/components/authorization/translations.ts @@ -8,40 +8,37 @@ import { i18n } from '@kbn/i18n'; export const PRIVILEGES_MISSING_TITLE = i18n.translate( - 'xpack.integrationAssistant.missingPrivileges.title', + 'xpack.automaticImport.missingPrivileges.title', { defaultMessage: 'Missing privileges', } ); export const PRIVILEGES_REQUIRED_TITLE = i18n.translate( - 'xpack.integrationAssistant.missingPrivileges.privilegesNeededTitle', + 'xpack.automaticImport.missingPrivileges.privilegesNeededTitle', { defaultMessage: 'The minimum Kibana privileges required to use this feature are:', } ); export const REQUIRED_PRIVILEGES = { - FLEET_ALL: i18n.translate( - 'xpack.integrationAssistant.missingPrivileges.requiredPrivileges.fleet', - { - defaultMessage: 'Management > Fleet: All', - } - ), + FLEET_ALL: i18n.translate('xpack.automaticImport.missingPrivileges.requiredPrivileges.fleet', { + defaultMessage: 'Management > Fleet: All', + }), INTEGRATIONS_ALL: i18n.translate( - 'xpack.integrationAssistant.missingPrivileges.requiredPrivileges.integrations', + 'xpack.automaticImport.missingPrivileges.requiredPrivileges.integrations', { defaultMessage: 'Management > Integrations: All', } ), CONNECTORS_READ: i18n.translate( - 'xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsRead', + 'xpack.automaticImport.missingPrivileges.requiredPrivileges.connectorsRead', { defaultMessage: 'Management > Connectors: Read', } ), CONNECTORS_ALL: i18n.translate( - 'xpack.integrationAssistant.missingPrivileges.requiredPrivileges.connectorsAll', + 'xpack.automaticImport.missingPrivileges.requiredPrivileges.connectorsAll', { defaultMessage: 'Management > Connectors: All', } @@ -49,7 +46,7 @@ export const REQUIRED_PRIVILEGES = { }; export const CONTACT_ADMINISTRATOR = i18n.translate( - 'xpack.integrationAssistant.missingPrivileges.contactAdministrator', + 'xpack.automaticImport.missingPrivileges.contactAdministrator', { defaultMessage: 'Contact your administrator for assistance.', } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/availability_wrapper.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/availability_wrapper.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/availability_wrapper.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/availability_wrapper.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/license_paywall_card.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/license_paywall_card.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/license_paywall_card.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/license_paywall_card.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/translations.ts similarity index 75% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/translations.ts index e7774f9ecb460..502fa39e9143b 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/availability_wrapper/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/common/components/availability_wrapper/translations.ts @@ -8,33 +8,33 @@ import { i18n } from '@kbn/i18n'; export const ENTERPRISE_LICENSE_LABEL = i18n.translate( - 'xpack.integrationAssistant.license.enterprise.label', + 'xpack.automaticImport.license.enterprise.label', { defaultMessage: 'Enterprise', } ); export const ENTERPRISE_LICENSE_TITLE = i18n.translate( - 'xpack.integrationAssistant.license.enterprise.title', + 'xpack.automaticImport.license.enterprise.title', { defaultMessage: 'Enterprise License Required', } ); export const ENTERPRISE_LICENSE_UPGRADE_TITLE = i18n.translate( - 'xpack.integrationAssistant.license.enterprise.upgradeTitle', + 'xpack.automaticImport.license.enterprise.upgradeTitle', { defaultMessage: 'Upgrade to Elastic Enterprise', } ); export const ENTERPRISE_LICENSE_UPGRADE_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.license.enterprise.upgradeDescription', + 'xpack.automaticImport.license.enterprise.upgradeDescription', { defaultMessage: 'To turn on this feature, you must upgrade your license to Enterprise or start a free 30-day trial', } ); export const ENTERPRISE_LICENSE_UPGRADE_BUTTON = i18n.translate( - 'xpack.integrationAssistant.license.enterprise.upgradeButton', + 'xpack.automaticImport.license.enterprise.upgradeButton', { defaultMessage: 'Upgrade license', } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/buttons_footer.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/buttons_footer.tsx similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/buttons_footer.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/buttons_footer.tsx index d27d1381b6e25..c1fcc8c90d621 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/buttons_footer.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/common/components/buttons_footer.tsx @@ -66,7 +66,7 @@ export const ButtonsFooter = React.memo<ButtonsFooterProps>( > {cancelButtonText || ( <FormattedMessage - id="xpack.integrationAssistant.footer.cancel" + id="xpack.automaticImport.footer.cancel" defaultMessage="Cancel" /> )} @@ -89,7 +89,7 @@ export const ButtonsFooter = React.memo<ButtonsFooterProps>( > {backButtonText || ( <FormattedMessage - id="xpack.integrationAssistant.footer.back" + id="xpack.automaticImport.footer.back" defaultMessage="Back" /> )} @@ -107,7 +107,7 @@ export const ButtonsFooter = React.memo<ButtonsFooterProps>( > {nextButtonText || ( <FormattedMessage - id="xpack.integrationAssistant.footer.next" + id="xpack.automaticImport.footer.next" defaultMessage="Next" /> )} diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/integration_image_header.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/integration_image_header.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/integration_image_header.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/integration_image_header.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/section_title.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/section_title.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/section_title.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/section_title.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/section_wrapper.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/section_wrapper.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/section_wrapper.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/section_wrapper.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/success_section/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/components/success_section/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/success_section/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/success_section/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/success_section/success_section.tsx b/x-pack/platform/plugins/shared/automatic_import/public/common/components/success_section/success_section.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/success_section/success_section.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/success_section/success_section.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/success_section/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/components/success_section/translations.ts similarity index 66% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/components/success_section/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/components/success_section/translations.ts index 4e684dae2a846..3df32d43155a1 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/common/components/success_section/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/common/components/success_section/translations.ts @@ -8,56 +8,56 @@ import { i18n } from '@kbn/i18n'; export const SUCCESS_TITLE = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.title', + 'xpack.automaticImport.createIntegrationSuccess.title', { defaultMessage: 'Success', } ); export const SUCCESS_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.description', + 'xpack.automaticImport.createIntegrationSuccess.description', { defaultMessage: 'Your integration is successfully created.', } ); export const ADD_TO_AGENT_TITLE = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.addToAgent.title', + 'xpack.automaticImport.createIntegrationSuccess.addToAgent.title', { defaultMessage: 'Add to an agent', } ); export const ADD_TO_AGENT_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.addToAgent.description', + 'xpack.automaticImport.createIntegrationSuccess.addToAgent.description', { defaultMessage: 'Add your new integration to an agent to start collecting data', } ); export const ADD_TO_AGENT_BUTTON = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.addToAgent.button', + 'xpack.automaticImport.createIntegrationSuccess.addToAgent.button', { defaultMessage: 'Add to an agent', } ); export const VIEW_INTEGRATION_TITLE = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.title', + 'xpack.automaticImport.createIntegrationSuccess.viewIntegration.title', { defaultMessage: 'View integration', } ); export const VIEW_INTEGRATION_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.description', + 'xpack.automaticImport.createIntegrationSuccess.viewIntegration.description', { defaultMessage: 'See detailed information about your new custom integration', } ); export const VIEW_INTEGRATION_BUTTON = i18n.translate( - 'xpack.integrationAssistant.createIntegrationSuccess.viewIntegration.button', + 'xpack.automaticImport.createIntegrationSuccess.viewIntegration.button', { defaultMessage: 'View Integration', } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/constants.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/__mocks__/use_authorization.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/__mocks__/use_authorization.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/__mocks__/use_authorization.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/hooks/__mocks__/use_authorization.ts index cf3871e073ece..d69e61d7c3b29 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/__mocks__/use_authorization.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/__mocks__/use_authorization.ts @@ -17,7 +17,7 @@ export const useAuthorization = jest.fn( export const useRoutesAuthorization = jest.fn( (): RoutesAuthorization => ({ - canUseIntegrationAssistant: true, + canUseAutomaticImport: true, canUseIntegrationUpload: true, }) ); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/__mocks__/use_availability.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/__mocks__/use_availability.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/__mocks__/use_availability.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/hooks/__mocks__/use_availability.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_authorization.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_authorization.ts similarity index 90% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_authorization.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_authorization.ts index c4ce31bf96cca..61aabc8d3e0e7 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_authorization.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_authorization.ts @@ -23,13 +23,13 @@ export const useAuthorization = (): Authorization => { }; export interface RoutesAuthorization { - canUseIntegrationAssistant: boolean; + canUseAutomaticImport: boolean; canUseIntegrationUpload: boolean; } export const useRoutesAuthorization = (): RoutesAuthorization => { const { canCreateIntegrations, canExecuteConnectors } = useAuthorization(); return { - canUseIntegrationAssistant: canCreateIntegrations && canExecuteConnectors, + canUseAutomaticImport: canCreateIntegrations && canExecuteConnectors, canUseIntegrationUpload: canCreateIntegrations, }; }; diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_availability.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_availability.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_availability.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_availability.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_kibana.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_kibana.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_kibana.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_kibana.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_navigate.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_navigate.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/hooks/use_navigate.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/hooks/use_navigate.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/images/integrations_light.svg b/x-pack/platform/plugins/shared/automatic_import/public/common/images/integrations_light.svg similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/images/integrations_light.svg rename to x-pack/platform/plugins/shared/automatic_import/public/common/images/integrations_light.svg diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/lib/api.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/lib/api.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/lib/api.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/lib/api.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/lib/api_parsers.test.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/lib/api_parsers.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/lib/api_parsers.test.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/lib/api_parsers.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/lib/api_parsers.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/lib/api_parsers.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/lib/api_parsers.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/lib/api_parsers.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/common/lib/lang_smith.ts b/x-pack/platform/plugins/shared/automatic_import/public/common/lib/lang_smith.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/common/lib/lang_smith.ts rename to x-pack/platform/plugins/shared/automatic_import/public/common/lib/lang_smith.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.test.tsx similarity index 82% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.test.tsx index 5e40b2dcbc86a..58a0960575e56 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.test.tsx @@ -8,10 +8,10 @@ import React from 'react'; import { render, act } from '@testing-library/react'; import { TestProvider } from '../../../mocks/test_provider'; -import { CreateIntegrationAssistant } from './create_integration_assistant'; import type { State } from './state'; import { mockReportEvent } from '../../../services/telemetry/mocks/service'; import { TelemetryEventType } from '../../../services/telemetry/types'; +import { CreateAutomaticImport } from './create_automatic_import'; export const defaultInitialState: State = { step: 1, @@ -70,8 +70,7 @@ jest.mock('../../../common/hooks/use_navigate', () => ({ useNavigate: () => mockNavigate, })); -const renderIntegrationAssistant = () => - render(<CreateIntegrationAssistant />, { wrapper: TestProvider }); +const renderAutomaticImport = () => render(<CreateAutomaticImport />, { wrapper: TestProvider }); describe('CreateIntegration', () => { beforeEach(() => { @@ -84,24 +83,24 @@ describe('CreateIntegration', () => { }); it('shoud report telemetry for assistant open', () => { - renderIntegrationAssistant(); - expect(mockReportEvent).toHaveBeenCalledWith(TelemetryEventType.IntegrationAssistantOpen, { + renderAutomaticImport(); + expect(mockReportEvent).toHaveBeenCalledWith(TelemetryEventType.AutomaticImportOpen, { sessionId: expect.any(String), }); }); it('should render connector step', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('connectorStepMock')).toBeInTheDocument(); }); it('should call isConnectorStepReadyToComplete', () => { - renderIntegrationAssistant(); + renderAutomaticImport(); expect(mockIsConnectorStepReadyToComplete).toHaveBeenCalled(); }); it('should show "Next" on the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Next'); }); @@ -111,17 +110,17 @@ describe('CreateIntegration', () => { }); it('should disable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); }); it('should still enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should still enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); }); @@ -132,23 +131,23 @@ describe('CreateIntegration', () => { }); it('should enable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); }); it('should enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); describe('when next button is clicked', () => { beforeEach(() => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); mockReportEvent.mockClear(); act(() => { result.getByTestId('buttonsFooter-nextButton').click(); @@ -157,7 +156,7 @@ describe('CreateIntegration', () => { it('should report telemetry for connector step completion', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, + TelemetryEventType.AutomaticImportStepComplete, { sessionId: expect.any(String), step: 1, @@ -171,9 +170,9 @@ describe('CreateIntegration', () => { }); describe('when back button is clicked', () => { - let result: ReturnType<typeof renderIntegrationAssistant>; + let result: ReturnType<typeof renderAutomaticImport>; beforeEach(() => { - result = renderIntegrationAssistant(); + result = renderAutomaticImport(); mockReportEvent.mockClear(); act(() => { result.getByTestId('buttonsFooter-backButton').click(); @@ -197,17 +196,17 @@ describe('CreateIntegration', () => { }); it('should render integration', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('integrationStepMock')).toBeInTheDocument(); }); it('should call isIntegrationStepReadyToComplete', () => { - renderIntegrationAssistant(); + renderAutomaticImport(); expect(mockIsIntegrationStepReadyToComplete).toHaveBeenCalled(); }); it('should show "Next" on the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Next'); }); @@ -217,17 +216,17 @@ describe('CreateIntegration', () => { }); it('should disable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); }); it('should still enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should still enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); }); @@ -238,23 +237,23 @@ describe('CreateIntegration', () => { }); it('should enable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); }); it('should enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); describe('when next button is clicked', () => { beforeEach(() => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); mockReportEvent.mockClear(); act(() => { result.getByTestId('buttonsFooter-nextButton').click(); @@ -263,7 +262,7 @@ describe('CreateIntegration', () => { it('should report telemetry for integration step completion', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, + TelemetryEventType.AutomaticImportStepComplete, { sessionId: expect.any(String), step: 2, @@ -277,9 +276,9 @@ describe('CreateIntegration', () => { }); describe('when back button is clicked', () => { - let result: ReturnType<typeof renderIntegrationAssistant>; + let result: ReturnType<typeof renderAutomaticImport>; beforeEach(() => { - result = renderIntegrationAssistant(); + result = renderAutomaticImport(); mockReportEvent.mockClear(); act(() => { result.getByTestId('buttonsFooter-backButton').click(); @@ -308,17 +307,17 @@ describe('CreateIntegration', () => { }); it('should render data stream', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('dataStreamStepMock')).toBeInTheDocument(); }); it('should call isDataStreamStepReadyToComplete', () => { - renderIntegrationAssistant(); + renderAutomaticImport(); expect(mockIsDataStreamStepReadyToComplete).toHaveBeenCalled(); }); it('should show "Analyze logs" on the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Analyze logs'); }); @@ -328,17 +327,17 @@ describe('CreateIntegration', () => { }); it('should disable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); }); it('should still enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should still enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); }); @@ -349,23 +348,23 @@ describe('CreateIntegration', () => { }); it('should enable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); }); it('should enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); describe('when next button is clicked', () => { beforeEach(() => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); mockReportEvent.mockClear(); act(() => { result.getByTestId('buttonsFooter-nextButton').click(); @@ -374,7 +373,7 @@ describe('CreateIntegration', () => { it('should report telemetry for data stream step completion', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, + TelemetryEventType.AutomaticImportStepComplete, { sessionId: expect.any(String), step: 3, @@ -386,12 +385,12 @@ describe('CreateIntegration', () => { }); it('should show loader on the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('generatingLoader')).toBeInTheDocument(); }); it('should disable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); // Not sure why there are two buttons when testing. const nextButton = result .getAllByTestId('buttonsFooter-nextButton') @@ -402,9 +401,9 @@ describe('CreateIntegration', () => { }); describe('when back button is clicked', () => { - let result: ReturnType<typeof renderIntegrationAssistant>; + let result: ReturnType<typeof renderAutomaticImport>; beforeEach(() => { - result = renderIntegrationAssistant(); + result = renderAutomaticImport(); mockReportEvent.mockClear(); act(() => { result.getByTestId('buttonsFooter-backButton').click(); @@ -435,7 +434,7 @@ describe('CreateIntegration', () => { }); it('should render cel creation flyout', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('celCreateFlyoutMock')).toBeInTheDocument(); }); }); @@ -446,17 +445,17 @@ describe('CreateIntegration', () => { }); it('should render review', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('reviewStepMock')).toBeInTheDocument(); }); it('should call isReviewStepReadyToComplete', () => { - renderIntegrationAssistant(); + renderAutomaticImport(); expect(mockIsReviewStepReadyToComplete).toHaveBeenCalled(); }); it('should show the "Add to Elastic" on the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Add to Elastic'); }); @@ -466,17 +465,17 @@ describe('CreateIntegration', () => { }); it('should disable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); }); it('should still enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should still enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); }); @@ -487,23 +486,23 @@ describe('CreateIntegration', () => { }); it('should enable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); }); it('should enable the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); }); it('should enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); describe('when next button is clicked', () => { beforeEach(() => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); mockReportEvent.mockClear(); act(() => { result.getByTestId('buttonsFooter-nextButton').click(); @@ -512,7 +511,7 @@ describe('CreateIntegration', () => { it('should report telemetry for review step completion', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, + TelemetryEventType.AutomaticImportStepComplete, { sessionId: expect.any(String), step: 4, @@ -524,12 +523,12 @@ describe('CreateIntegration', () => { }); it('should show deploy step', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); }); it('should enable the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); }); }); @@ -542,27 +541,27 @@ describe('CreateIntegration', () => { }); it('should render deploy', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); }); it('should hide the back button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); }); it('should hide the next button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); }); it('should enable the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); }); it('should show "Close" on the cancel button', () => { - const result = renderIntegrationAssistant(); + const result = renderAutomaticImport(); expect(result.getByTestId('buttonsFooter-cancelButton')).toHaveTextContent('Close'); }); }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.tsx similarity index 97% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.tsx index 1f353f187bb2a..59e169d67a55e 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/create_automatic_import.tsx @@ -27,7 +27,7 @@ const stepNames: Record<number | string, string> = { 5: 'Deploy Step', }; -export const CreateIntegrationAssistant = React.memo(() => { +export const CreateAutomaticImport = React.memo(() => { const [state, dispatch] = useReducer(reducer, initialState); const navigate = useNavigate(); @@ -154,4 +154,4 @@ export const CreateIntegrationAssistant = React.memo(() => { </ActionsProvider> ); }); -CreateIntegrationAssistant.displayName = 'CreateIntegrationAssistant'; +CreateAutomaticImport.displayName = 'CreateAutomaticImport'; diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/create_cel_config.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/create_cel_config.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/create_cel_config.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/create_cel_config.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/footer.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/footer.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/footer.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/footer.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/generation_error.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/generation_error.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/generation_error.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/generation_error.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/auth_selection.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/auth_selection.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/auth_selection.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/auth_selection.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/confirm_settings_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/confirm_settings_step.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/confirm_settings_step.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/confirm_settings_step.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/endpoint_selection.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/endpoint_selection.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/endpoint_selection.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/endpoint_selection.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/translations.ts similarity index 62% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/translations.ts index 606fa6c8a0662..7ad7d243be81b 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/confirm_settings_step/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/confirm_settings_step/translations.ts @@ -8,92 +8,92 @@ import { i18n } from '@kbn/i18n'; export const RECOMMENDED = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.recommended', + 'xpack.automaticImport.celFlyout.step.confirmSettings.recommended', { defaultMessage: 'Recommended', } ); export const ENTER_MANUALLY = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.enterManually', + 'xpack.automaticImport.celFlyout.step.confirmSettings.enterManually', { defaultMessage: 'Enter manually', } ); export const CONFIRM_ENDPOINT = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.confirmEndpoint', + 'xpack.automaticImport.celFlyout.step.confirmSettings.confirmEndpoint', { defaultMessage: 'Choose API endpoint', } ); export const CONFIRM_ENDPOINT_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.confirmEndpointDescription', + 'xpack.automaticImport.celFlyout.step.confirmSettings.confirmEndpointDescription', { defaultMessage: 'Recommended API endpoints (chosen from your spec file):', } ); export const CONFIRM_AUTH = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.confirmAuth', + 'xpack.automaticImport.celFlyout.step.confirmSettings.confirmAuth', { defaultMessage: 'Select Authentication method', } ); export const CONFIRM_AUTH_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.confirmAuthDescription', + 'xpack.automaticImport.celFlyout.step.confirmSettings.confirmAuthDescription', { defaultMessage: 'Select the authentication method for the API endpoint. Generation should take less than a minute.', } ); export const AUTH_SELECTION_TITLE = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.authSelectionTitle', + 'xpack.automaticImport.celFlyout.step.confirmSettings.authSelectionTitle', { defaultMessage: 'Preferred method', } ); export const AUTH_DOES_NOT_ALIGN = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.authDoesNotAlign', + 'xpack.automaticImport.celFlyout.step.confirmSettings.authDoesNotAlign', { defaultMessage: 'This method does not align with your spec file', } ); export const GENERATION_ERROR = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.generationError', + 'xpack.automaticImport.celFlyout.step.confirmSettings.generationError', { defaultMessage: 'An error occurred during: CEL input generation', } ); export const GENERATE = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.generateButtonLabel', + 'xpack.automaticImport.celFlyout.step.confirmSettings.generateButtonLabel', { defaultMessage: 'Generate', } ); export const GENERATING = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.generatingButtonLabel', + 'xpack.automaticImport.celFlyout.step.confirmSettings.generatingButtonLabel', { defaultMessage: 'Generating', } ); export const SUCCESS = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.success', + 'xpack.automaticImport.celFlyout.step.confirmSettings.success', { defaultMessage: 'Success! Configuration ready.', } ); export const CANCEL = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.cancel', + 'xpack.automaticImport.celFlyout.step.confirmSettings.cancel', { defaultMessage: 'Cancel', } ); export const PATH_REQUIRED = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.pathRequired', + 'xpack.automaticImport.celFlyout.step.confirmSettings.pathRequired', { defaultMessage: 'API endpoint is required', } ); export const AUTH_REQUIRED = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.confirmSettings.authRequired', + 'xpack.automaticImport.celFlyout.step.confirmSettings.authRequired', { defaultMessage: 'Authentication method is required', } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/api_definition_input.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/api_definition_input.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/api_definition_input.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/api_definition_input.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/translations.ts similarity index 57% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/translations.ts index 799d34a5392ca..cc4a14d686b81 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/translations.ts @@ -8,102 +8,93 @@ import { i18n } from '@kbn/i18n'; export const OPEN_API_UPLOAD_INSTRUCTIONS = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.uploadInstructions', + 'xpack.automaticImport.celFlyout.step.uploadSpec.uploadInstructions', { defaultMessage: "The LLM will analyze the file to identify the structure of your API data. The OpenAPI spec file is typically found in the vendor's API reference documentation.", } ); export const API_DEFINITION_TITLE = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.apiDefinition.title', + 'xpack.automaticImport.celFlyout.step.uploadSpec.apiDefinition.title', { defaultMessage: 'Upload an OpenAPI spec file', } ); export const API_DEFINITION_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.apiDefinition.description', + 'xpack.automaticImport.celFlyout.step.uploadSpec.apiDefinition.description', { defaultMessage: 'Drag and drop a file or browse files.', } ); export const API_DEFINITION_DESCRIPTION_2 = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.apiDefinition.description2', + 'xpack.automaticImport.celFlyout.step.uploadSpec.apiDefinition.description2', { defaultMessage: 'OpenAPI specification', } ); export const API_DEFINITION_ERROR = { CAN_NOT_READ: i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.openapiSpec.errorCanNotRead', + 'xpack.automaticImport.celFlyout.step.uploadSpec.openapiSpec.errorCanNotRead', { defaultMessage: 'Failed to read the uploaded file', } ), INVALID_OAS: i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.openapiSpec.errorInvalidFormat', + 'xpack.automaticImport.celFlyout.step.uploadSpec.openapiSpec.errorInvalidFormat', { defaultMessage: 'Uploaded file is not a valid OpenApi spec file', } ), CAN_NOT_READ_WITH_REASON: (reason: string) => i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.openapiSpec.errorCanNotReadWithReason', + 'xpack.automaticImport.celFlyout.step.uploadSpec.openapiSpec.errorCanNotReadWithReason', { values: { reason }, defaultMessage: 'An error occurred when reading spec file: {reason}', } ), TOO_LARGE_TO_PARSE: i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.openapiSpec.errorTooLargeToParse', + 'xpack.automaticImport.celFlyout.step.uploadSpec.openapiSpec.errorTooLargeToParse', { defaultMessage: 'This spec file is too large to parse', } ), NO_PATHS_IDENTIFIED: i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.openapiSpec.noPathsIdentified', + 'xpack.automaticImport.celFlyout.step.uploadSpec.openapiSpec.noPathsIdentified', { defaultMessage: 'No valid paths found in OpenAPI spec file', } ), }; export const GENERATION_ERROR = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.generationError', + 'xpack.automaticImport.celFlyout.step.uploadSpec.generationError', { defaultMessage: 'An error occurred during API analysis', } ); -export const ANALYZE = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.analyze', - { - defaultMessage: 'Analyze', - } -); +export const ANALYZE = i18n.translate('xpack.automaticImport.celFlyout.step.uploadSpec.analyze', { + defaultMessage: 'Analyze', +}); export const ANALYZING = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.analyzing', + 'xpack.automaticImport.celFlyout.step.uploadSpec.analyzing', { defaultMessage: 'Analyzing', } ); -export const CANCEL = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.cancel', - { - defaultMessage: 'Cancel', - } -); -export const SUCCESS = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.success', - { - defaultMessage: 'Success', - } -); +export const CANCEL = i18n.translate('xpack.automaticImport.celFlyout.step.uploadSpec.cancel', { + defaultMessage: 'Cancel', +}); +export const SUCCESS = i18n.translate('xpack.automaticImport.celFlyout.step.uploadSpec.success', { + defaultMessage: 'Success', +}); export const DATASTREAM_TITLE_REQUIRED = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.dataStreamRequired', + 'xpack.automaticImport.celFlyout.step.uploadSpec.dataStreamRequired', { defaultMessage: 'A data stream title is required', } ); export const SPEC_FILE_REQUIRED = i18n.translate( - 'xpack.integrationAssistant.celFlyout.step.uploadSpec.specFileRequired', + 'xpack.automaticImport.celFlyout.step.uploadSpec.specFileRequired', { defaultMessage: 'An OpenAPI spec file is required', } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/upload_spec_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/upload_spec_step.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/upload_spec_step.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/upload_spec_step.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/util.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/util.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/steps/upload_spec_step/util.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/steps/upload_spec_step/util.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/translations.ts similarity index 66% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/translations.ts index e2809cfbb5bf9..cf6280fb42dbe 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/flyout/cel_configuration/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/flyout/cel_configuration/translations.ts @@ -11,19 +11,19 @@ import { i18n } from '@kbn/i18n'; * flyout container */ export const OPEN_API_SPEC_TITLE = i18n.translate( - 'xpack.integrationAssistant.celFlyout.createCel.openApiSpecTitle', + 'xpack.automaticImport.celFlyout.createCel.openApiSpecTitle', { defaultMessage: 'OpenAPI spec', } ); export const UPLOAD_SPEC_TITLE = i18n.translate( - 'xpack.integrationAssistant.celFlyout.createCel.uploadSpecTitle', + 'xpack.automaticImport.celFlyout.createCel.uploadSpecTitle', { defaultMessage: 'Upload OpenAPI Specification', } ); export const CONFIRM_SETTINGS_TITLE = i18n.translate( - 'xpack.integrationAssistant.celFlyout.createCel.confirmSettingsTitle', + 'xpack.automaticImport.celFlyout.createCel.confirmSettingsTitle', { defaultMessage: 'Choose API endpoint and Authentication method', } @@ -33,22 +33,22 @@ export const CONFIRM_SETTINGS_TITLE = i18n.translate( * footer */ export const SAVE_CONFIG = i18n.translate( - 'xpack.integrationAssistant.celFlyout.footer.saveAndContinue', + 'xpack.automaticImport.celFlyout.footer.saveAndContinue', { defaultMessage: 'Save Configuration', } ); -export const CANCEL = i18n.translate('xpack.integrationAssistant.celFlyout.footer.cancel', { +export const CANCEL = i18n.translate('xpack.automaticImport.celFlyout.footer.cancel', { defaultMessage: 'Cancel', }); export const ANALYZE_BUTTON_HINT = i18n.translate( - 'xpack.integrationAssistant.celFlyout.footer.analyzeHint', + 'xpack.automaticImport.celFlyout.footer.analyzeHint', { defaultMessage: 'Analyze your OpenAPI spec file before saving', } ); export const GENERATE_BUTTON_HINT = i18n.translate( - 'xpack.integrationAssistant.celFlyout.footer.generateHint', + 'xpack.automaticImport.celFlyout.footer.generateHint', { defaultMessage: 'Generate your CEL input configuration before saving', } @@ -57,6 +57,6 @@ export const GENERATE_BUTTON_HINT = i18n.translate( /** * generation error */ -export const RETRY = i18n.translate('xpack.integrationAssistant.celFlyout.retry', { +export const RETRY = i18n.translate('xpack.automaticImport.celFlyout.retry', { defaultMessage: 'Retry', }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/footer.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/footer.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/footer.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/footer.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/translations.ts similarity index 54% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/translations.ts index aedfd63ba2213..41ab79d728ee6 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/footer/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/footer/translations.ts @@ -7,18 +7,18 @@ import { i18n } from '@kbn/i18n'; -export const ANALYZE_LOGS = i18n.translate('xpack.integrationAssistant.bottomBar.analyzeLogs', { +export const ANALYZE_LOGS = i18n.translate('xpack.automaticImport.bottomBar.analyzeLogs', { defaultMessage: 'Analyze logs', }); -export const LOADING = i18n.translate('xpack.integrationAssistant.bottomBar.loading', { +export const LOADING = i18n.translate('xpack.automaticImport.bottomBar.loading', { defaultMessage: 'Loading', }); -export const ADD_TO_ELASTIC = i18n.translate('xpack.integrationAssistant.bottomBar.addToElastic', { +export const ADD_TO_ELASTIC = i18n.translate('xpack.automaticImport.bottomBar.addToElastic', { defaultMessage: 'Add to Elastic', }); -export const CLOSE = i18n.translate('xpack.integrationAssistant.bottomBar.close', { +export const CLOSE = i18n.translate('xpack.automaticImport.bottomBar.close', { defaultMessage: 'Close', }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/header.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/header.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/header.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/header.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/steps.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/steps.tsx similarity index 87% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/steps.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/steps.tsx index 76214e6c9f884..29c3f1f60555e 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/steps.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/steps.tsx @@ -22,19 +22,19 @@ interface StepsProps { isGenerating: boolean; } -const STEP_CONNECTOR = i18n.translate('xpack.integrationAssistant.step.connector', { +const STEP_CONNECTOR = i18n.translate('xpack.automaticImport.step.connector', { defaultMessage: 'Connector', }); -const STEP_INTEGRATION = i18n.translate('xpack.integrationAssistant.step.integration', { +const STEP_INTEGRATION = i18n.translate('xpack.automaticImport.step.integration', { defaultMessage: 'Integration', }); -const STEP_DATA_STREAM = i18n.translate('xpack.integrationAssistant.step.dataStream', { +const STEP_DATA_STREAM = i18n.translate('xpack.automaticImport.step.dataStream', { defaultMessage: 'Data stream', }); -const STEP_REVIEW = i18n.translate('xpack.integrationAssistant.step.review', { +const STEP_REVIEW = i18n.translate('xpack.automaticImport.step.review', { defaultMessage: 'Review', }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/translations.ts similarity index 56% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/translations.ts index 85d342ce6aa33..d3a3043471cb0 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/header/translations.ts @@ -7,13 +7,10 @@ import { i18n } from '@kbn/i18n'; -export const TITLE = i18n.translate('xpack.integrationAssistant.pages.header.title', { +export const TITLE = i18n.translate('xpack.automaticImport.pages.header.title', { defaultMessage: 'New integration', }); -export const ASSISTANT_AVATAR = i18n.translate( - 'xpack.integrationAssistant.pages.header.avatarTitle', - { - defaultMessage: 'Powered by generative AI', - } -); +export const ASSISTANT_AVATAR = i18n.translate('xpack.automaticImport.pages.header.avatarTitle', { + defaultMessage: 'Powered by generative AI', +}); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/index.ts similarity index 76% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/index.ts index d0255856adbe8..825b6af7c1c42 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/index.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { CreateIntegrationAssistant } from './create_integration_assistant'; +export { CreateAutomaticImport } from './create_automatic_import'; diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/mocks/state.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/mocks/state.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/mocks/state.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/mocks/state.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/state.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/state.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/state.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/state.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_selector.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_selector.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_selector.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_selector.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_setup.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_setup.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_setup.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_setup.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_step.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_step.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_step.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/connector_step.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/is_step_ready.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/is_step_ready.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/is_step_ready.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/is_step_ready.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/translations.ts similarity index 62% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/translations.ts index 30f78279d1586..9507e826d3e9d 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/connector_step/translations.ts @@ -7,26 +7,23 @@ import { i18n } from '@kbn/i18n'; -export const TITLE = i18n.translate('xpack.integrationAssistant.steps.connector.title', { +export const TITLE = i18n.translate('xpack.automaticImport.steps.connector.title', { defaultMessage: 'Choose your AI connector', }); -export const DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.steps.connector.description', - { - defaultMessage: 'Select an AI connector to help you create your custom integration', - } -); +export const DESCRIPTION = i18n.translate('xpack.automaticImport.steps.connector.description', { + defaultMessage: 'Select an AI connector to help you create your custom integration', +}); export const CREATE_CONNECTOR = i18n.translate( - 'xpack.integrationAssistant.steps.connector.createConnectorLabel', + 'xpack.automaticImport.steps.connector.createConnectorLabel', { defaultMessage: 'Create new connector', } ); export const SUPPORTED_MODELS_INFO = i18n.translate( - 'xpack.integrationAssistant.steps.connector.supportedModelsInfo', + 'xpack.automaticImport.steps.connector.supportedModelsInfo', { defaultMessage: "We currently recommend using a provider that supports the newer Claude models for the best experience. We're currently working on adding better support for GPT-4 and similar models", diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_name.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_name.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_name.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_name.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/data_stream_step.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/error_with_link.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/error_with_link.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/error_with_link.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/error_with_link.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/error_with_link.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/error_with_link.tsx similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/error_with_link.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/error_with_link.tsx index 8791e9f03a0f8..bb42f804133d0 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/error_with_link.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/error_with_link.tsx @@ -43,7 +43,7 @@ export const ErrorMessage = React.memo<ErrorMessageProps>(({ error }) => { <> {isErrorMessageWithLink(error) ? ( <FormattedMessage - id="xpack.integrationAssistant.createIntegration.generateErrorWithLink" + id="xpack.automaticImport.createIntegration.generateErrorWithLink" defaultMessage="{errorMessage} {link}" values={{ errorMessage: error.errorMessage, diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/generation_modal.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/generation_modal.test.tsx similarity index 97% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/generation_modal.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/generation_modal.test.tsx index 25ed031129777..987877efa4755 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/generation_modal.test.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/generation_modal.test.tsx @@ -146,7 +146,7 @@ describe('GenerationModal', () => { it('should report telemetry for generation complete', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantGenerationComplete, + TelemetryEventType.AutomaticImportGenerationComplete, { sessionId: expect.any(String), sampleRows: integrationSettingsNonJSON.logSamples?.length ?? 0, @@ -220,7 +220,7 @@ describe('GenerationModal', () => { it('should report telemetry for generation complete', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantGenerationComplete, + TelemetryEventType.AutomaticImportGenerationComplete, { sessionId: expect.any(String), sampleRows: integrationSettings.logSamples?.length ?? 0, @@ -266,7 +266,7 @@ describe('GenerationModal', () => { }); it('should report telemetry for generation error', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantGenerationComplete, + TelemetryEventType.AutomaticImportGenerationComplete, { sessionId: expect.any(String), sampleRows: integrationSettings.logSamples?.length ?? 0, @@ -337,7 +337,7 @@ describe('GenerationModal', () => { }); it('should report telemetry for generation error', () => { expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantGenerationComplete, + TelemetryEventType.AutomaticImportGenerationComplete, { sessionId: expect.any(String), sampleRows: integrationSettings.logSamples?.length ?? 0, diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/generation_modal.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/generation_modal.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/generation_modal.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/generation_modal.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/is_step_ready.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/is_step_ready.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/is_step_ready.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/is_step_ready.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/sample_logs_input.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/sample_logs_input.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/sample_logs_input.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/sample_logs_input.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/sample_logs_input.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/sample_logs_input.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/sample_logs_input.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/sample_logs_input.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/translations.ts similarity index 62% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/translations.ts index f0ff3c7c2b047..4e6f3ab72313c 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/translations.ts @@ -10,26 +10,26 @@ import type { GenerationErrorAttributes } from '../../../../../../common/api/gen import { GenerationErrorCode } from '../../../../../../common/constants'; export const INTEGRATION_NAME_TITLE = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.integrationNameTitle', + 'xpack.automaticImport.step.dataStream.integrationNameTitle', { defaultMessage: 'Define package name', } ); export const INTEGRATION_NAME_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.integrationNameDescription', + 'xpack.automaticImport.step.dataStream.integrationNameDescription', { defaultMessage: "The package name is used to refer to the integration in Elastic's ingest pipeline", } ); export const DATA_STREAM_TITLE = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.dataStreamTitle', + 'xpack.automaticImport.step.dataStream.dataStreamTitle', { defaultMessage: 'Define data stream and upload logs', } ); export const DATA_STREAM_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.dataStreamDescription', + 'xpack.automaticImport.step.dataStream.dataStreamDescription', { defaultMessage: 'Logs are analyzed to automatically map ECS fields and help create the ingestion pipeline', @@ -37,104 +37,104 @@ export const DATA_STREAM_DESCRIPTION = i18n.translate( ); export const INTEGRATION_NAME_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.integrationName.label', + 'xpack.automaticImport.step.dataStream.integrationName.label', { defaultMessage: 'Integration package name', } ); export const NO_SPACES_HELP = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.noSpacesHelpText', + 'xpack.automaticImport.step.dataStream.noSpacesHelpText', { defaultMessage: 'Name must be at least 2 characters long and can only contain lowercase letters, numbers, and underscores (_)', } ); export const PACKAGE_NAMES_FETCH_ERROR = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.packageNamesFetchError', + 'xpack.automaticImport.step.dataStream.packageNamesFetchError', { defaultMessage: 'Error fetching package names', } ); export const NAME_ALREADY_EXISTS_ERROR = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.nameAlreadyExistsError', + 'xpack.automaticImport.step.dataStream.nameAlreadyExistsError', { defaultMessage: 'This integration name is already in use. Please choose a different name.', } ); export const DATA_STREAM_TITLE_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.dataStreamTitle.label', + 'xpack.automaticImport.step.dataStream.dataStreamTitle.label', { defaultMessage: 'Data stream title', } ); export const DATA_STREAM_DESCRIPTION_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.dataStreamDescription.label', + 'xpack.automaticImport.step.dataStream.dataStreamDescription.label', { defaultMessage: 'Data stream description', } ); export const DATA_STREAM_NAME_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.dataStreamName.label', + 'xpack.automaticImport.step.dataStream.dataStreamName.label', { defaultMessage: 'Data stream name', } ); export const DATA_COLLECTION_METHOD_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.dataCollectionMethod.label', + 'xpack.automaticImport.step.dataStream.dataCollectionMethod.label', { defaultMessage: 'Data collection method', } ); export const ADD_OPEN_API_SPEC_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.addOpenApiSpecLabel', + 'xpack.automaticImport.step.dataStream.addOpenApiSpecLabel', { defaultMessage: 'OpenAPI Spec', } ); export const ADD_OPEN_API_SPEC_OPTIONAL_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.addOpenApiSpecOptionalLabel', + 'xpack.automaticImport.step.dataStream.addOpenApiSpecOptionalLabel', { defaultMessage: 'Optional', } ); export const ADD_OPEN_API_SPEC_BUTTON = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.addOpenApiSpecButton', + 'xpack.automaticImport.step.dataStream.addOpenApiSpecButton', { defaultMessage: 'Add OpenAPI spec file', } ); export const OPEN_API_SPEC_BUTTON_CONFIGURED = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.openApiSpecButtonConfigured', + 'xpack.automaticImport.step.dataStream.openApiSpecButtonConfigured', { defaultMessage: 'OpenAPI spec file configured', } ); export const EDIT_OPEN_API_SPEC_BUTTON = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.editOpenApiSpecButton', + 'xpack.automaticImport.step.dataStream.editOpenApiSpecButton', { defaultMessage: 'Edit', } ); export const ADD_OPEN_API_SPEC_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.addOpenApiSpecDescription', + 'xpack.automaticImport.step.dataStream.addOpenApiSpecDescription', { defaultMessage: 'To successfully ingest CEL data from an API, provide the associated OpenAPI Specification (OAS) file.', } ); export const TECH_PREVIEW = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.techPreviewBadge', + 'xpack.automaticImport.step.dataStream.techPreviewBadge', { defaultMessage: 'Technical preview', } ); export const TECH_PREVIEW_TOOLTIP = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.techPreviewTooltip', + 'xpack.automaticImport.step.dataStream.techPreviewTooltip', { defaultMessage: 'This functionality is in technical preview and is subject to change. Please use with caution in production environments.', @@ -142,14 +142,14 @@ export const TECH_PREVIEW_TOOLTIP = i18n.translate( ); export const LOGS_SAMPLE_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.label', + 'xpack.automaticImport.step.dataStream.logsSample.label', { defaultMessage: 'Logs', } ); export const LOGS_SAMPLE_WARNING = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.warning', + 'xpack.automaticImport.step.dataStream.logsSample.warning', { defaultMessage: 'Please note that this data will be analyzed by a third-party AI tool. Ensure that you comply with privacy and security guidelines when selecting data.', @@ -157,128 +157,116 @@ export const LOGS_SAMPLE_WARNING = i18n.translate( ); export const LOGS_SAMPLE_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.description', + 'xpack.automaticImport.step.dataStream.logsSample.description', { defaultMessage: 'Drag and drop a file or Browse files.', } ); export const LOGS_SAMPLE_ERROR = { - CAN_NOT_READ: i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotRead', - { - defaultMessage: 'Failed to read the logs sample file', - } - ), + CAN_NOT_READ: i18n.translate('xpack.automaticImport.step.dataStream.logsSample.errorCanNotRead', { + defaultMessage: 'Failed to read the logs sample file', + }), CAN_NOT_READ_WITH_REASON: (reason: string) => - i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotReadWithReason', - { - values: { reason }, - defaultMessage: 'An error occurred when reading logs sample: {reason}', - } - ), + i18n.translate('xpack.automaticImport.step.dataStream.logsSample.errorCanNotReadWithReason', { + values: { reason }, + defaultMessage: 'An error occurred when reading logs sample: {reason}', + }), CAN_NOT_PARSE: i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.errorCanNotParse', + 'xpack.automaticImport.step.dataStream.logsSample.errorCanNotParse', { defaultMessage: 'Cannot parse the logs sample file as either a JSON or NDJSON file', } ), TOO_LARGE_TO_PARSE: i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.errorTooLargeToParse', + 'xpack.automaticImport.step.dataStream.logsSample.errorTooLargeToParse', { defaultMessage: 'This logs sample file is too large to parse', } ), - NOT_ARRAY: i18n.translate('xpack.integrationAssistant.step.dataStream.logsSample.errorNotArray', { + NOT_ARRAY: i18n.translate('xpack.automaticImport.step.dataStream.logsSample.errorNotArray', { defaultMessage: 'The logs sample file is not an array', }), - EMPTY: i18n.translate('xpack.integrationAssistant.step.dataStream.logsSample.errorEmpty', { + EMPTY: i18n.translate('xpack.automaticImport.step.dataStream.logsSample.errorEmpty', { defaultMessage: 'The logs sample file is empty', }), - NOT_OBJECT: i18n.translate( - 'xpack.integrationAssistant.step.dataStream.logsSample.errorNotObject', - { - defaultMessage: 'The logs sample file contains non-object entries', - } - ), + NOT_OBJECT: i18n.translate('xpack.automaticImport.step.dataStream.logsSample.errorNotObject', { + defaultMessage: 'The logs sample file contains non-object entries', + }), }; -export const ANALYZING = i18n.translate('xpack.integrationAssistant.step.dataStream.analyzing', { +export const ANALYZING = i18n.translate('xpack.automaticImport.step.dataStream.analyzing', { defaultMessage: 'Analyzing', }); export const PROGRESS_ANALYZE_LOGS = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.progress.analyzeLogs', + 'xpack.automaticImport.step.dataStream.progress.analyzeLogs', { defaultMessage: 'Analyzing Sample logs', } ); export const PROGRESS_ECS_MAPPING = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.progress.ecsMapping', + 'xpack.automaticImport.step.dataStream.progress.ecsMapping', { defaultMessage: 'Mapping ECS fields', } ); export const PROGRESS_CATEGORIZATION = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.progress.categorization', + 'xpack.automaticImport.step.dataStream.progress.categorization', { defaultMessage: 'Adding categorization', } ); export const PROGRESS_RELATED_GRAPH = i18n.translate( - 'xpack.integrationAssistant.step.dataStream.progress.relatedGraph', + 'xpack.automaticImport.step.dataStream.progress.relatedGraph', { defaultMessage: 'Generating related fields', } ); export const GENERATION_ERROR_TITLE = (progressStep: string) => - i18n.translate('xpack.integrationAssistant.step.dataStream.generationError', { + i18n.translate('xpack.automaticImport.step.dataStream.generationError', { values: { progressStep }, defaultMessage: 'An error occurred during: {progressStep}', }); -export const RETRY = i18n.translate('xpack.integrationAssistant.step.dataStream.retryButtonLabel', { +export const RETRY = i18n.translate('xpack.automaticImport.step.dataStream.retryButtonLabel', { defaultMessage: 'Retry', }); -export const DECODE_CEF_LINK = i18n.translate( - 'xpack.integrationAssistant.errors.cefFormat.decodeLink', - { - defaultMessage: 'CEF format not supported yet. Instead please use CEF Integration:', - } -); +export const DECODE_CEF_LINK = i18n.translate('xpack.automaticImport.errors.cefFormat.decodeLink', { + defaultMessage: 'CEF format not supported yet. Instead please use CEF Integration:', +}); export const GENERATION_ERROR_TRANSLATION: Record< GenerationErrorCode, string | ((attributes: GenerationErrorAttributes) => string) > = { [GenerationErrorCode.RECURSION_LIMIT_ANALYZE_LOGS]: i18n.translate( - 'xpack.integrationAssistant.errors.recursionLimitAnalyzeLogsErrorMessage', + 'xpack.automaticImport.errors.recursionLimitAnalyzeLogsErrorMessage', { defaultMessage: 'Please verify the format of log samples is correct and try again. Try with a fewer samples if error persists.', } ), [GenerationErrorCode.RECURSION_LIMIT]: i18n.translate( - 'xpack.integrationAssistant.errors.recursionLimitReached', + 'xpack.automaticImport.errors.recursionLimitReached', { defaultMessage: 'Max attempts exceeded. Please try again.', } ), [GenerationErrorCode.UNSUPPORTED_LOG_SAMPLES_FORMAT]: (attributes) => { if (attributes.logFormat !== undefined && attributes.logFormat?.length !== 0) { - return i18n.translate('xpack.integrationAssistant.errors.uparseableCSV.withReason', { + return i18n.translate('xpack.automaticImport.errors.uparseableCSV.withReason', { values: { format: attributes.logFormat, }, defaultMessage: `Unsupported log format in the samples (format: {format}).`, }); } else { - return i18n.translate('xpack.integrationAssistant.errors.unsupportedLogSamples', { + return i18n.translate('xpack.automaticImport.errors.unsupportedLogSamples', { defaultMessage: `Unsupported log format in the samples.`, }); } }, - [GenerationErrorCode.CEF_ERROR]: i18n.translate('xpack.integrationAssistant.errors.cefError', { + [GenerationErrorCode.CEF_ERROR]: i18n.translate('xpack.automaticImport.errors.cefError', { // This is a default error message if the linking does not work. defaultMessage: 'CEF format detected. Please decode the CEF logs into JSON format using filebeat decode_cef processor.', @@ -288,14 +276,14 @@ export const GENERATION_ERROR_TRANSLATION: Record< attributes.underlyingMessages !== undefined && attributes.underlyingMessages?.length !== 0 ) { - return i18n.translate('xpack.integrationAssistant.errors.uparseableCSV.withReason', { + return i18n.translate('xpack.automaticImport.errors.uparseableCSV.withReason', { values: { reason: attributes.underlyingMessages[0], }, defaultMessage: `Cannot parse the samples as the CSV data (reason: {reason}). Please check the provided samples.`, }); } else { - return i18n.translate('xpack.integrationAssistant.errors.uparseableCSV.withoutReason', { + return i18n.translate('xpack.automaticImport.errors.uparseableCSV.withoutReason', { defaultMessage: `Cannot parse the samples as the CSV data. Please check the provided samples.`, }); } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/use_generation.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/use_generation.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/use_generation.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/use_generation.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/use_load_package_names.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/use_load_package_names.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/use_load_package_names.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/data_stream_step/use_load_package_names.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/deploy_step.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/deploy_step.test.tsx similarity index 82% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/deploy_step.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/deploy_step.test.tsx index 758e9ca06a06f..a8d975822e1b5 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/deploy_step.test.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/deploy_step.test.tsx @@ -99,21 +99,18 @@ describe('DeployStep', () => { }); it('should report telemetry for integration complete', () => { - expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantComplete, - { - sessionId: expect.any(String), - integrationName, - integrationDescription: integrationSettings.description, - dataStreamName: integrationSettings.dataStreamName, - inputTypes: integrationSettings.inputTypes, - model: expect.any(String), - actionTypeId: connector.actionTypeId, - provider: connector.apiProvider ?? 'unknown', - durationMs: expect.any(Number), - errorMessage: undefined, - } - ); + expect(mockReportEvent).toHaveBeenCalledWith(TelemetryEventType.AutomaticImportComplete, { + sessionId: expect.any(String), + integrationName, + integrationDescription: integrationSettings.description, + dataStreamName: integrationSettings.dataStreamName, + inputTypes: integrationSettings.inputTypes, + model: expect.any(String), + actionTypeId: connector.actionTypeId, + provider: connector.apiProvider ?? 'unknown', + durationMs: expect.any(Number), + errorMessage: undefined, + }); }); it('should render the save button', () => { @@ -166,21 +163,18 @@ describe('DeployStep', () => { }); it('should report telemetry for integration complete with error', () => { - expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantComplete, - { - sessionId: expect.any(String), - integrationName: integrationSettings.name, - integrationDescription: integrationSettings.description, - dataStreamName: integrationSettings.dataStreamName, - inputTypes: integrationSettings.inputTypes, - model: expect.any(String), - actionTypeId: connector.actionTypeId, - provider: connector.apiProvider ?? 'unknown', - durationMs: expect.any(Number), - errorMessage, - } - ); + expect(mockReportEvent).toHaveBeenCalledWith(TelemetryEventType.AutomaticImportComplete, { + sessionId: expect.any(String), + integrationName: integrationSettings.name, + integrationDescription: integrationSettings.description, + dataStreamName: integrationSettings.dataStreamName, + inputTypes: integrationSettings.inputTypes, + model: expect.any(String), + actionTypeId: connector.actionTypeId, + provider: connector.apiProvider ?? 'unknown', + durationMs: expect.any(Number), + errorMessage, + }); }); }); @@ -218,21 +212,18 @@ describe('DeployStep', () => { }); it('should report telemetry for integration complete with error', () => { - expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantComplete, - { - sessionId: expect.any(String), - integrationName: integrationSettings.name, - integrationDescription: integrationSettings.description, - dataStreamName: integrationSettings.dataStreamName, - inputTypes: integrationSettings.inputTypes, - model: expect.any(String), - actionTypeId: connector.actionTypeId, - provider: connector.apiProvider ?? 'unknown', - durationMs: expect.any(Number), - errorMessage, - } - ); + expect(mockReportEvent).toHaveBeenCalledWith(TelemetryEventType.AutomaticImportComplete, { + sessionId: expect.any(String), + integrationName: integrationSettings.name, + integrationDescription: integrationSettings.description, + dataStreamName: integrationSettings.dataStreamName, + inputTypes: integrationSettings.inputTypes, + model: expect.any(String), + actionTypeId: connector.actionTypeId, + provider: connector.apiProvider ?? 'unknown', + durationMs: expect.any(Number), + errorMessage, + }); }); }); }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/deploy_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/deploy_step.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/deploy_step.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/deploy_step.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/translations.ts similarity index 70% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/translations.ts index 4e63444f2e346..e24d71aff00c2 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/translations.ts @@ -7,25 +7,25 @@ import { i18n } from '@kbn/i18n'; -export const DEPLOYING = i18n.translate('xpack.integrationAssistant.step.deploy.loadingTitle', { +export const DEPLOYING = i18n.translate('xpack.automaticImport.step.deploy.loadingTitle', { defaultMessage: 'Deploying', }); export const DOWNLOAD_ZIP_TITLE = i18n.translate( - 'xpack.integrationAssistant.step.deploy.downloadZip.title', + 'xpack.automaticImport.step.deploy.downloadZip.title', { defaultMessage: 'Download .zip package', } ); export const DOWNLOAD_ZIP_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.step.deploy.downloadZip.description', + 'xpack.automaticImport.step.deploy.downloadZip.description', { defaultMessage: 'Download your integration package to reuse in other deployments. ', } ); export const DOWNLOAD_ZIP_LINK = i18n.translate( - 'xpack.integrationAssistant.step.deploy.downloadZip.link', + 'xpack.automaticImport.step.deploy.downloadZip.link', { defaultMessage: 'Download package', } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/use_deploy_integration.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/use_deploy_integration.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/deploy_step/use_deploy_integration.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/deploy_step/use_deploy_integration.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/integration_step.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/integration_step.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/integration_step.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/integration_step.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/is_step_ready.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/is_step_ready.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/is_step_ready.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/is_step_ready.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/package_card_preview.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/package_card_preview.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/package_card_preview.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/package_card_preview.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/translations.ts similarity index 51% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/translations.ts index 4de004950eb6f..4067b45110f10 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/integration_step/translations.ts @@ -7,50 +7,47 @@ import { i18n } from '@kbn/i18n'; -export const TITLE = i18n.translate('xpack.integrationAssistant.step.integration.title', { +export const TITLE = i18n.translate('xpack.automaticImport.step.integration.title', { defaultMessage: 'Integration details', }); -export const DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.step.integration.description', - { - defaultMessage: 'Name your integration, give it a description, and (optional) add a logo', - } -); +export const DESCRIPTION = i18n.translate('xpack.automaticImport.step.integration.description', { + defaultMessage: 'Name your integration, give it a description, and (optional) add a logo', +}); export const TITLE_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.integration.integrationTitle', + 'xpack.automaticImport.step.integration.integrationTitle', { defaultMessage: 'Title', } ); export const DESCRIPTION_LABEL = i18n.translate( - 'xpack.integrationAssistant.step.integration.integrationDescription', + 'xpack.automaticImport.step.integration.integrationDescription', { defaultMessage: 'Description', } ); -export const LOGO_LABEL = i18n.translate('xpack.integrationAssistant.step.integration.logo.label', { +export const LOGO_LABEL = i18n.translate('xpack.automaticImport.step.integration.logo.label', { defaultMessage: 'Logo (optional)', }); export const LOGO_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.step.integration.logo.description', + 'xpack.automaticImport.step.integration.logo.description', { defaultMessage: 'Drag and drop a .svg file or Browse files', } ); -export const PREVIEW = i18n.translate('xpack.integrationAssistant.step.integration.preview', { +export const PREVIEW = i18n.translate('xpack.automaticImport.step.integration.preview', { defaultMessage: 'Preview', }); export const PREVIEW_TOOLTIP = i18n.translate( - 'xpack.integrationAssistant.step.integration.previewTooltip', + 'xpack.automaticImport.step.integration.previewTooltip', { defaultMessage: 'This is a preview of the integration card for the integrations catalog', } ); -export const LOGO_ERROR = i18n.translate('xpack.integrationAssistant.step.integration.logo.error', { +export const LOGO_ERROR = i18n.translate('xpack.automaticImport.step.integration.logo.error', { defaultMessage: 'Error processing logo file', }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/fields_table.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/fields_table.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/fields_table.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/fields_table.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/is_step_ready.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/is_step_ready.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/is_step_ready.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/is_step_ready.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/review_step.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/review_step.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/review_step.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/review_step.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/review_step.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/review_step.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/review_step.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/review_step.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/translations.ts similarity index 64% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/translations.ts index dc8af8dc8bd3a..6822b1a3c5a2b 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/translations.ts @@ -7,27 +7,27 @@ import { i18n } from '@kbn/i18n'; -export const TITLE = i18n.translate('xpack.integrationAssistant.step.review.title', { +export const TITLE = i18n.translate('xpack.automaticImport.step.review.title', { defaultMessage: 'Review results', }); -export const DESCRIPTION = i18n.translate('xpack.integrationAssistant.step.review.description', { +export const DESCRIPTION = i18n.translate('xpack.automaticImport.step.review.description', { defaultMessage: 'Review all the fields and their values in your integration. Make any necessary adjustments to ensure accuracy.', }); export const EDIT_PIPELINE_BUTTON = i18n.translate( - 'xpack.integrationAssistant.step.review.editPipeline', + 'xpack.automaticImport.step.review.editPipeline', { defaultMessage: 'Edit pipeline', } ); export const INGEST_PIPELINE_TITLE = i18n.translate( - 'xpack.integrationAssistant.step.review.ingestPipelineTitle', + 'xpack.automaticImport.step.review.ingestPipelineTitle', { defaultMessage: 'Ingest pipeline', } ); -export const SAVE_BUTTON = i18n.translate('xpack.integrationAssistant.step.review.save', { +export const SAVE_BUTTON = i18n.translate('xpack.automaticImport.step.review.save', { defaultMessage: 'Save', }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/use_check_pipeline.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/use_check_pipeline.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/use_check_pipeline.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/review_step/use_check_pipeline.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/step_content_wrapper.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/step_content_wrapper.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/steps/step_content_wrapper.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/steps/step_content_wrapper.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/types.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/types.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_automatic_import/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration.test.tsx similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration.test.tsx index dca18a90f3a65..0daf36a1afeb9 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration.test.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration.test.tsx @@ -26,8 +26,8 @@ jest.mock('./create_integration_landing', () => ({ jest.mock('./create_integration_upload', () => ({ CreateIntegrationUpload: jest.fn(() => <div data-test-subj="uploadMock" />), })); -jest.mock('./create_integration_assistant', () => ({ - CreateIntegrationAssistant: jest.fn(() => <div data-test-subj="assistantMock" />), +jest.mock('./create_automatic_import', () => ({ + CreateAutomaticImport: jest.fn(() => <div data-test-subj="assistantMock" />), })); const getWrapper = (pathname: string): React.FC<PropsWithChildren<{}>> => @@ -56,7 +56,7 @@ describe('CreateIntegration', () => { describe('and user is not authorized', () => { beforeEach(() => { mockUseRoutesAuthorization.mockReturnValueOnce({ - canUseIntegrationAssistant: false, + canUseAutomaticImport: false, canUseIntegrationUpload: false, }); }); @@ -94,7 +94,7 @@ describe('CreateIntegration', () => { describe('and user is not authorized', () => { beforeEach(() => { mockUseRoutesAuthorization.mockReturnValueOnce({ - canUseIntegrationAssistant: false, + canUseAutomaticImport: false, canUseIntegrationUpload: true, }); }); @@ -134,7 +134,7 @@ describe('CreateIntegration', () => { describe('and user is not authorized', () => { beforeEach(() => { mockUseRoutesAuthorization.mockReturnValueOnce({ - canUseIntegrationAssistant: true, + canUseAutomaticImport: true, canUseIntegrationUpload: false, }); }); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration.tsx similarity index 88% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration.tsx index 6afacc8e417f3..138db39e54fee 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration.tsx @@ -12,10 +12,10 @@ import type { Services } from '../../services'; import { TelemetryContextProvider } from './telemetry'; import { CreateIntegrationLanding } from './create_integration_landing'; import { CreateIntegrationUpload } from './create_integration_upload'; -import { CreateIntegrationAssistant } from './create_integration_assistant'; import { Page, PagePath } from '../../common/constants'; import { useRoutesAuthorization } from '../../common/hooks/use_authorization'; import { useIsAvailable } from '../../common/hooks/use_availability'; +import { CreateAutomaticImport } from './create_automatic_import'; interface CreateIntegrationProps { services: Services; @@ -30,12 +30,12 @@ export const CreateIntegration = React.memo<CreateIntegrationProps>(({ services CreateIntegration.displayName = 'CreateIntegration'; const CreateIntegrationRouter = React.memo(() => { - const { canUseIntegrationAssistant, canUseIntegrationUpload } = useRoutesAuthorization(); + const { canUseAutomaticImport, canUseIntegrationUpload } = useRoutesAuthorization(); const isAvailable = useIsAvailable(); return ( <Routes> - {isAvailable && canUseIntegrationAssistant && ( - <Route path={PagePath[Page.assistant]} exact component={CreateIntegrationAssistant} /> + {isAvailable && canUseAutomaticImport && ( + <Route path={PagePath[Page.assistant]} exact component={CreateAutomaticImport} /> )} {isAvailable && canUseIntegrationUpload && ( <Route path={PagePath[Page.upload]} exact component={CreateIntegrationUpload} /> diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/integration_assistant_card.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/automatic_import_card.tsx similarity index 87% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/integration_assistant_card.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/automatic_import_card.tsx index dbae30ad664de..e3278dab259d3 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/integration_assistant_card.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/automatic_import_card.tsx @@ -21,7 +21,7 @@ import { MissingPrivilegesTooltip } from '../../../common/components/authorizati import { useNavigate, Page } from '../../../common/hooks/use_navigate'; import * as i18n from './translations'; -export const IntegrationAssistantCard = React.memo(() => { +export const AutomaticImportCard = React.memo(() => { const { canExecuteConnectors } = useAuthorization(); const navigate = useNavigate(); return ( @@ -41,7 +41,7 @@ export const IntegrationAssistantCard = React.memo(() => { <EuiFlexGroup direction="row" gutterSize="s"> <EuiFlexItem> <EuiTitle size="xs"> - <h3>{i18n.ASSISTANT_TITLE}</h3> + <h3>{i18n.AUTOMATIC_IMPORT_TITLE}</h3> </EuiTitle> </EuiFlexItem> <EuiFlexItem grow={false}> @@ -58,7 +58,7 @@ export const IntegrationAssistantCard = React.memo(() => { </EuiFlexItem> <EuiFlexItem> <EuiText size="s" color="subdued" textAlign="left"> - {i18n.ASSISTANT_DESCRIPTION} + {i18n.AUTOMATIC_IMPORT_DESCRIPTION} </EuiText> </EuiFlexItem> </EuiFlexGroup> @@ -66,11 +66,11 @@ export const IntegrationAssistantCard = React.memo(() => { <EuiFlexItem grow={false}> {canExecuteConnectors ? ( <EuiButton onClick={() => navigate(Page.assistant)} data-test-subj="assistantButton"> - {i18n.ASSISTANT_BUTTON} + {i18n.AUTOMATIC_IMPORT_BUTTON} </EuiButton> ) : ( <MissingPrivilegesTooltip canExecuteConnectors> - <EuiButton disabled>{i18n.ASSISTANT_BUTTON}</EuiButton> + <EuiButton disabled>{i18n.AUTOMATIC_IMPORT_BUTTON}</EuiButton> </MissingPrivilegesTooltip> )} </EuiFlexItem> @@ -78,4 +78,4 @@ export const IntegrationAssistantCard = React.memo(() => { </EuiPanel> ); }); -IntegrationAssistantCard.displayName = 'IntegrationAssistantCard'; +AutomaticImportCard.displayName = 'AutomaticImportCard'; diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/create_integration_landing.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/create_integration_landing.tsx similarity index 90% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/create_integration_landing.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/create_integration_landing.tsx index 71706625f636f..dade0f8d7dee0 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/create_integration_landing.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/create_integration_landing.tsx @@ -15,7 +15,7 @@ import { IntegrationImageHeader } from '../../../common/components/integration_i import { ButtonsFooter } from '../../../common/components/buttons_footer'; import { SectionWrapper } from '../../../common/components/section_wrapper'; import { useNavigate, Page } from '../../../common/hooks/use_navigate'; -import { IntegrationAssistantCard } from './integration_assistant_card'; +import { AutomaticImportCard } from './automatic_import_card'; import * as i18n from './translations'; export const CreateIntegrationLanding = React.memo(() => { @@ -35,7 +35,7 @@ export const CreateIntegrationLanding = React.memo(() => { > <EuiFlexItem> <EuiSpacer size="l" /> - <IntegrationAssistantCard /> + <AutomaticImportCard /> </EuiFlexItem> <EuiFlexItem> <EuiFlexGroup @@ -50,7 +50,7 @@ export const CreateIntegrationLanding = React.memo(() => { <EuiFlexItem> <EuiText size="s" color="subdued"> <FormattedMessage - id="xpack.integrationAssistant.createIntegrationLanding.uploadPackageDescription" + id="xpack.automaticImport.createIntegrationLanding.uploadPackageDescription" defaultMessage="If you have an existing integration package, {link}" values={{ link: ( @@ -59,7 +59,7 @@ export const CreateIntegrationLanding = React.memo(() => { data-test-subj="uploadPackageLink" > <FormattedMessage - id="xpack.integrationAssistant.createIntegrationLanding.uploadPackageLink" + id="xpack.automaticImport.createIntegrationLanding.uploadPackageLink" defaultMessage="upload it as a .zip" /> </EuiLink> diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/translations.ts similarity index 62% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/translations.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/translations.ts index cdda572d4dff4..468c6d6701e9e 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_landing/translations.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_landing/translations.ts @@ -8,14 +8,14 @@ import { i18n } from '@kbn/i18n'; export const LANDING_TITLE = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.title', + 'xpack.automaticImport.createIntegrationLanding.title', { defaultMessage: 'Create new integration', } ); export const LANDING_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.description', + 'xpack.automaticImport.createIntegrationLanding.description', { defaultMessage: 'Start an AI-driven process to build your integration step-by-step, or upload a .zip package of a previously created integration', @@ -23,56 +23,56 @@ export const LANDING_DESCRIPTION = i18n.translate( ); export const PACKAGE_UPLOAD_TITLE = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.packageUpload.title', + 'xpack.automaticImport.createIntegrationLanding.packageUpload.title', { defaultMessage: 'Package upload', } ); export const PACKAGE_UPLOAD_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.packageUpload.description', + 'xpack.automaticImport.createIntegrationLanding.packageUpload.description', { defaultMessage: 'Use this option if you have an existing integration package in a .zip file', } ); export const PACKAGE_UPLOAD_BUTTON = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.packageUpload.button', + 'xpack.automaticImport.createIntegrationLanding.packageUpload.button', { defaultMessage: 'Upload .zip', } ); -export const ASSISTANT_TITLE = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.assistant.title', +export const AUTOMATIC_IMPORT_TITLE = i18n.translate( + 'xpack.automaticImport.createIntegrationLanding.assistant.title', { defaultMessage: 'Create custom integration', } ); -export const ASSISTANT_DESCRIPTION = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.assistant.description', +export const AUTOMATIC_IMPORT_DESCRIPTION = i18n.translate( + 'xpack.automaticImport.createIntegrationLanding.assistant.description', { defaultMessage: 'Use our AI-driven process to build your custom integration', } ); -export const ASSISTANT_BUTTON = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.assistant.button', +export const AUTOMATIC_IMPORT_BUTTON = i18n.translate( + 'xpack.automaticImport.createIntegrationLanding.assistant.button', { defaultMessage: 'Create Integration', } ); export const TECH_PREVIEW = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewBadge', + 'xpack.automaticImport.createIntegrationLanding.assistant.techPreviewBadge', { defaultMessage: 'Technical preview', } ); export const TECH_PREVIEW_TOOLTIP = i18n.translate( - 'xpack.integrationAssistant.createIntegrationLanding.assistant.techPreviewTooltip', + 'xpack.automaticImport.createIntegrationLanding.assistant.techPreviewTooltip', { defaultMessage: 'This functionality is in technical preview and is subject to change. Please use with caution in production environments.', diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/create_integration_upload.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/create_integration_upload.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/create_integration_upload.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/create_integration_upload.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/docs_link_subtitle.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/docs_link_subtitle.tsx similarity index 86% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/docs_link_subtitle.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/docs_link_subtitle.tsx index 144ab01a0d0ca..c5aa15ee5634b 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/docs_link_subtitle.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/docs_link_subtitle.tsx @@ -15,13 +15,13 @@ export const DocsLinkSubtitle = React.memo(() => { return ( <EuiText size="s" color="subdued"> <FormattedMessage - id="xpack.integrationAssistant.createIntegrationUpload.uploadHelpText" + id="xpack.automaticImport.createIntegrationUpload.uploadHelpText" defaultMessage="For more information, refer to {link}" values={{ link: ( <EuiLink href={docLinks?.links.integrationDeveloper.upload} target="_blank"> <FormattedMessage - id="xpack.integrationAssistant.createIntegrationUpload.documentation" + id="xpack.automaticImport.createIntegrationUpload.documentation" defaultMessage="Upload an Integration" /> </EuiLink> diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/index.ts diff --git a/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/translations.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/translations.ts new file mode 100644 index 0000000000000..0b1d8a91ad2f6 --- /dev/null +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/create_integration_upload/translations.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const UPLOAD_TITLE = i18n.translate('xpack.automaticImport.createIntegrationUpload.title', { + defaultMessage: 'Upload integration package', +}); + +export const UPLOAD_INPUT_TEXT = i18n.translate( + 'xpack.automaticImport.createIntegrationUpload.inputText', + { + defaultMessage: 'Drag and drop a .zip file or Browse files', + } +); + +export const INSTALL_BUTTON = i18n.translate( + 'xpack.automaticImport.createIntegrationUpload.install', + { + defaultMessage: 'Add to Elastic', + } +); + +export const CLOSE_BUTTON = i18n.translate('xpack.automaticImport.createIntegrationUpload.close', { + defaultMessage: 'Close', +}); + +export const UPLOAD_ERROR = i18n.translate('xpack.automaticImport.createIntegrationUpload.error', { + defaultMessage: 'Error installing package', +}); diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/index.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/index.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/index.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/index.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/telemetry.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/telemetry.tsx similarity index 93% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/telemetry.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/telemetry.tsx index 04d8a07cd1288..b29d3e690a89e 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/telemetry.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/telemetry.tsx @@ -13,7 +13,7 @@ import type { AIConnector, ConfiguredAIConnectorType, IntegrationSettings, -} from './create_integration_assistant/types'; +} from './create_automatic_import/types'; type ReportUploadZipIntegrationComplete = (params: { integrationName?: string; @@ -78,14 +78,14 @@ export const TelemetryContextProvider = React.memo<PropsWithChildren<{}>>(({ chi const sessionId = uuidV4(); sessionData.current = { sessionId, startedAt: Date.now() }; stepsData.current = { startedAt: Date.now() }; - telemetry.reportEvent(TelemetryEventType.IntegrationAssistantOpen, { + telemetry.reportEvent(TelemetryEventType.AutomaticImportOpen, { sessionId, }); }, [telemetry]); const reportAssistantStepComplete = useCallback<ReportAssistantStepComplete>( ({ step, stepName }) => { - telemetry.reportEvent(TelemetryEventType.IntegrationAssistantStepComplete, { + telemetry.reportEvent(TelemetryEventType.AutomaticImportStepComplete, { sessionId: sessionData.current.sessionId, step, stepName, @@ -99,7 +99,7 @@ export const TelemetryContextProvider = React.memo<PropsWithChildren<{}>>(({ chi const reportGenerationComplete = useCallback<ReportGenerationComplete>( ({ connector, integrationSettings, durationMs, error }) => { - telemetry.reportEvent(TelemetryEventType.IntegrationAssistantGenerationComplete, { + telemetry.reportEvent(TelemetryEventType.AutomaticImportGenerationComplete, { sessionId: sessionData.current.sessionId, sampleRows: integrationSettings?.logSamples?.length ?? 0, actionTypeId: connector.actionTypeId, @@ -114,7 +114,7 @@ export const TelemetryContextProvider = React.memo<PropsWithChildren<{}>>(({ chi const reportCelGenerationComplete = useCallback<ReportGenerationComplete>( ({ connector, integrationSettings, durationMs, error }) => { - telemetry.reportEvent(TelemetryEventType.IntegrationAssistantCelGenerationComplete, { + telemetry.reportEvent(TelemetryEventType.AutomaticImportCelGenerationComplete, { sessionId: sessionData.current.sessionId, actionTypeId: connector.actionTypeId, model: getConnectorModel(connector), @@ -128,7 +128,7 @@ export const TelemetryContextProvider = React.memo<PropsWithChildren<{}>>(({ chi const reportAssistantComplete = useCallback<ReportAssistantComplete>( ({ integrationName, integrationSettings, connector, error }) => { - telemetry.reportEvent(TelemetryEventType.IntegrationAssistantComplete, { + telemetry.reportEvent(TelemetryEventType.AutomaticImportComplete, { sessionId: sessionData.current.sessionId, integrationName, integrationDescription: integrationSettings?.description ?? 'unknown', diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/types.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/types.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/create_integration_card_button.test.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/create_integration_card_button.test.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/create_integration_card_button.test.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/create_integration_card_button.test.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/create_integration_card_button.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/create_integration_card_button.tsx similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/create_integration_card_button.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/create_integration_card_button.tsx index 995e386d0b156..4ee84fb109d28 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/create_integration_card_button.tsx +++ b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/create_integration_card_button.tsx @@ -77,7 +77,7 @@ export const CreateIntegrationCardButton = React.memo<CreateIntegrationCardButto <EuiTitle size="xs"> <h2> <FormattedMessage - id="xpack.integrationAssistant.createIntegrationTitle" + id="xpack.automaticImport.createIntegrationTitle" defaultMessage="Can't find an Integration?" /> </h2> @@ -85,7 +85,7 @@ export const CreateIntegrationCardButton = React.memo<CreateIntegrationCardButto {!compressed && ( <EuiText size="s"> <FormattedMessage - id="xpack.integrationAssistant.createIntegrationDescription" + id="xpack.automaticImport.createIntegrationDescription" defaultMessage="Create a custom one to fit your requirements" /> </EuiText> @@ -110,7 +110,7 @@ export const CreateIntegrationCardButton = React.memo<CreateIntegrationCardButto </EuiFlexItem> <EuiFlexItem> <FormattedMessage - id="xpack.integrationAssistant.createIntegrationButton" + id="xpack.automaticImport.createIntegrationButton" defaultMessage="Create new integration" /> </EuiFlexItem> diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/index.tsx b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/index.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/index.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/index.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/types.ts b/x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration_card_button/types.ts rename to x-pack/platform/plugins/shared/automatic_import/public/components/create_integration_card_button/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/index.ts similarity index 64% rename from x-pack/platform/plugins/shared/integration_assistant/public/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/index.ts index 565688afda5e0..45f87184dff41 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/index.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/index.ts @@ -6,9 +6,9 @@ */ import type { PluginInitializerContext } from '@kbn/core/public'; -import { IntegrationAssistantPlugin } from './plugin'; -export type { IntegrationAssistantPluginSetup, IntegrationAssistantPluginStart } from './types'; +import { AutomaticImportPlugin } from './plugin'; +export type { AutomaticImportPluginSetup, AutomaticImportPluginStart } from './types'; export function plugin(initializerContext: PluginInitializerContext) { - return new IntegrationAssistantPlugin(initializerContext); + return new AutomaticImportPlugin(initializerContext); } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/mocks/test_provider.tsx b/x-pack/platform/plugins/shared/automatic_import/public/mocks/test_provider.tsx similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/mocks/test_provider.tsx rename to x-pack/platform/plugins/shared/automatic_import/public/mocks/test_provider.tsx diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/plugin.ts b/x-pack/platform/plugins/shared/automatic_import/public/plugin.ts similarity index 75% rename from x-pack/platform/plugins/shared/integration_assistant/public/plugin.ts rename to x-pack/platform/plugins/shared/automatic_import/public/plugin.ts index 96c08f799f761..cf67be77707d3 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/plugin.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/plugin.ts @@ -7,11 +7,7 @@ import type { CoreStart, Plugin, CoreSetup, PluginInitializerContext } from '@kbn/core/public'; import { BehaviorSubject } from 'rxjs'; -import type { - IntegrationAssistantPluginSetup, - IntegrationAssistantPluginStart, - IntegrationAssistantPluginStartDependencies, -} from './types'; + import { getCreateIntegrationLazy } from './components/create_integration'; import { getCreateIntegrationCardButtonLazy } from './components/create_integration_card_button'; import { @@ -22,23 +18,28 @@ import { } from './services'; import { parseExperimentalConfigValue } from '../common/experimental_features'; import type { ExperimentalFeatures } from '../common/experimental_features'; -import { type IntegrationAssistantConfigType } from '../server/config'; +import type { + AutomaticImportPluginSetup, + AutomaticImportPluginStart, + AutomaticImportPluginStartDependencies, +} from './types'; +import type { AutomaticImportConfigType } from '../server/config'; -export class IntegrationAssistantPlugin - implements Plugin<IntegrationAssistantPluginSetup, IntegrationAssistantPluginStart> +export class AutomaticImportPlugin + implements Plugin<AutomaticImportPluginSetup, AutomaticImportPluginStart> { private telemetry = new Telemetry(); private renderUpselling$ = new BehaviorSubject<RenderUpselling | undefined>(undefined); - private config: IntegrationAssistantConfigType; + private config: AutomaticImportConfigType; private experimentalFeatures: ExperimentalFeatures; constructor(private readonly initializerContext: PluginInitializerContext) { - this.config = this.initializerContext.config.get<IntegrationAssistantConfigType>(); + this.config = this.initializerContext.config.get<AutomaticImportConfigType>(); this.experimentalFeatures = parseExperimentalConfigValue(this.config.enableExperimental || []); ExperimentalFeaturesService.init(this.experimentalFeatures); } - public setup(core: CoreSetup): IntegrationAssistantPluginSetup { + public setup(core: CoreSetup): AutomaticImportPluginSetup { this.telemetry.setup(core.analytics); this.config = this.config; return {}; @@ -46,8 +47,8 @@ export class IntegrationAssistantPlugin public start( core: CoreStart, - dependencies: IntegrationAssistantPluginStartDependencies - ): IntegrationAssistantPluginStart { + dependencies: AutomaticImportPluginStartDependencies + ): AutomaticImportPluginStart { const services: Services = { ...core, ...dependencies, diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/experimental_features_service.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/experimental_features_service.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/experimental_features_service.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/experimental_features_service.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/index.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/index.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/mocks/services.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/mocks/services.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/mocks/services.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/mocks/services.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/events.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/events.ts similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/events.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/events.ts index 0da7cdb9b288c..45dce2cbcad0b 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/events.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/events.ts @@ -33,7 +33,7 @@ export const telemetryEventsSchemas: TelemetryEventsSchemas = { }, }, - [TelemetryEventType.IntegrationAssistantOpen]: { + [TelemetryEventType.AutomaticImportOpen]: { sessionId: { type: 'keyword', _meta: { @@ -43,7 +43,7 @@ export const telemetryEventsSchemas: TelemetryEventsSchemas = { }, }, - [TelemetryEventType.IntegrationAssistantStepComplete]: { + [TelemetryEventType.AutomaticImportStepComplete]: { sessionId: { type: 'keyword', _meta: { @@ -81,7 +81,7 @@ export const telemetryEventsSchemas: TelemetryEventsSchemas = { }, }, - [TelemetryEventType.IntegrationAssistantGenerationComplete]: { + [TelemetryEventType.AutomaticImportGenerationComplete]: { sessionId: { type: 'keyword', _meta: { @@ -133,7 +133,7 @@ export const telemetryEventsSchemas: TelemetryEventsSchemas = { }, }, - [TelemetryEventType.IntegrationAssistantCelGenerationComplete]: { + [TelemetryEventType.AutomaticImportCelGenerationComplete]: { sessionId: { type: 'keyword', _meta: { @@ -178,7 +178,7 @@ export const telemetryEventsSchemas: TelemetryEventsSchemas = { }, }, - [TelemetryEventType.IntegrationAssistantComplete]: { + [TelemetryEventType.AutomaticImportComplete]: { sessionId: { type: 'keyword', _meta: { diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/mocks/service.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/mocks/service.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/mocks/service.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/mocks/service.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/service.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/service.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/service.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/service.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/types.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/types.ts similarity index 56% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/types.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/types.ts index 6b5f8e8b558fe..8b37d38b9c302 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/types.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/services/telemetry/types.ts @@ -8,11 +8,11 @@ // Event type definitions export enum TelemetryEventType { UploadIntegrationZipComplete = 'upload_integration_zip_complete', - IntegrationAssistantOpen = 'integration_assistant_open', - IntegrationAssistantStepComplete = 'integration_assistant_step_complete', - IntegrationAssistantGenerationComplete = 'integration_assistant_generation_complete', - IntegrationAssistantCelGenerationComplete = 'integration_assistant_cel_generation_complete', - IntegrationAssistantComplete = 'integration_assistant_complete', + AutomaticImportOpen = 'automatic_import_open', + AutomaticImportStepComplete = 'automatic_import_step_complete', + AutomaticImportGenerationComplete = 'automatic_import_generation_complete', + AutomaticImportCelGenerationComplete = 'automatic_import_cel_generation_complete', + AutomaticImportComplete = 'automatic_import_complete', } // Event data definitions @@ -22,11 +22,11 @@ interface UploadIntegrationZipCompleteData { errorMessage?: string; } -interface IntegrationAssistantOpenData { +interface AutomaticImportOpenData { sessionId: string; } -interface IntegrationAssistantStepCompleteData { +interface AutomaticImportStepCompleteData { sessionId: string; step: number; stepName: string; @@ -34,7 +34,7 @@ interface IntegrationAssistantStepCompleteData { sessionElapsedTime: number; // Total time spent in the current generation session } -interface IntegrationAssistantGenerationCompleteData { +interface AutomaticImportGenerationCompleteData { sessionId: string; sampleRows: number; durationMs: number; @@ -44,7 +44,7 @@ interface IntegrationAssistantGenerationCompleteData { errorMessage?: string; } -interface IntegrationAssistantCelGenerationCompleteData { +interface AutomaticImportCelGenerationCompleteData { sessionId: string; durationMs: number; actionTypeId: string; @@ -53,7 +53,7 @@ interface IntegrationAssistantCelGenerationCompleteData { errorMessage?: string; } -interface IntegrationAssistantCompleteData { +interface AutomaticImportCompleteData { sessionId: string; durationMs: number; integrationName: string; @@ -73,14 +73,14 @@ interface IntegrationAssistantCompleteData { export type TelemetryEventTypeData<T extends TelemetryEventType> = T extends TelemetryEventType.UploadIntegrationZipComplete ? UploadIntegrationZipCompleteData - : T extends TelemetryEventType.IntegrationAssistantOpen - ? IntegrationAssistantOpenData - : T extends TelemetryEventType.IntegrationAssistantStepComplete - ? IntegrationAssistantStepCompleteData - : T extends TelemetryEventType.IntegrationAssistantGenerationComplete - ? IntegrationAssistantGenerationCompleteData - : T extends TelemetryEventType.IntegrationAssistantCelGenerationComplete - ? IntegrationAssistantCelGenerationCompleteData - : T extends TelemetryEventType.IntegrationAssistantComplete - ? IntegrationAssistantCompleteData + : T extends TelemetryEventType.AutomaticImportOpen + ? AutomaticImportOpenData + : T extends TelemetryEventType.AutomaticImportStepComplete + ? AutomaticImportStepCompleteData + : T extends TelemetryEventType.AutomaticImportGenerationComplete + ? AutomaticImportGenerationCompleteData + : T extends TelemetryEventType.AutomaticImportCelGenerationComplete + ? AutomaticImportCelGenerationCompleteData + : T extends TelemetryEventType.AutomaticImportComplete + ? AutomaticImportCompleteData : never; diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/services/types.ts b/x-pack/platform/plugins/shared/automatic_import/public/services/types.ts similarity index 82% rename from x-pack/platform/plugins/shared/integration_assistant/public/services/types.ts rename to x-pack/platform/plugins/shared/automatic_import/public/services/types.ts index 43e398151661f..4a7821b1c46f1 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/services/types.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/services/types.ts @@ -6,13 +6,13 @@ */ import type { CoreStart } from '@kbn/core/public'; import type { Observable } from 'rxjs'; -import type { IntegrationAssistantPluginStartDependencies } from '../types'; +import type { AutomaticImportPluginStartDependencies } from '../types'; import type { TelemetryService } from './telemetry/service'; export type RenderUpselling = React.ReactNode; export type Services = CoreStart & - IntegrationAssistantPluginStartDependencies & { + AutomaticImportPluginStartDependencies & { telemetry: TelemetryService; renderUpselling$: Observable<RenderUpselling | undefined>; }; diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/types.ts b/x-pack/platform/plugins/shared/automatic_import/public/types.ts similarity index 87% rename from x-pack/platform/plugins/shared/integration_assistant/public/types.ts rename to x-pack/platform/plugins/shared/automatic_import/public/types.ts index e3b2954cccd6d..4b0ca7363c3e8 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/public/types.ts +++ b/x-pack/platform/plugins/shared/automatic_import/public/types.ts @@ -14,9 +14,9 @@ import type { CreateIntegrationCardButtonComponent } from './components/create_i import type { RenderUpselling } from './services'; // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface IntegrationAssistantPluginSetup {} +export interface AutomaticImportPluginSetup {} -export interface IntegrationAssistantPluginStart { +export interface AutomaticImportPluginStart { components: { /** * Component that allows the user to create an integration. @@ -35,12 +35,12 @@ export interface IntegrationAssistantPluginStart { renderUpselling: (upselling: RenderUpselling | undefined) => void; } -export interface IntegrationAssistantPluginSetupDependencies { +export interface AutomaticImportPluginSetupDependencies { triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; licensing: LicensingPluginSetup; } -export interface IntegrationAssistantPluginStartDependencies { +export interface AutomaticImportPluginStartDependencies { triggersActionsUi: TriggersAndActionsUIPublicPluginStart; licensing: LicensingPluginStart; } diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/util/oas.test.ts b/x-pack/platform/plugins/shared/automatic_import/public/util/oas.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/util/oas.test.ts rename to x-pack/platform/plugins/shared/automatic_import/public/util/oas.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/util/oas.ts b/x-pack/platform/plugins/shared/automatic_import/public/util/oas.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/public/util/oas.ts rename to x-pack/platform/plugins/shared/automatic_import/public/util/oas.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/scripts/draw_graphs.js b/x-pack/platform/plugins/shared/automatic_import/scripts/draw_graphs.js similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/scripts/draw_graphs.js rename to x-pack/platform/plugins/shared/automatic_import/scripts/draw_graphs.js diff --git a/x-pack/platform/plugins/shared/integration_assistant/scripts/draw_graphs_script.ts b/x-pack/platform/plugins/shared/automatic_import/scripts/draw_graphs_script.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/scripts/draw_graphs_script.ts rename to x-pack/platform/plugins/shared/automatic_import/scripts/draw_graphs_script.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/mock_server.ts b/x-pack/platform/plugins/shared/automatic_import/server/__mocks__/mock_server.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/mock_server.ts rename to x-pack/platform/plugins/shared/automatic_import/server/__mocks__/mock_server.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/request.ts b/x-pack/platform/plugins/shared/automatic_import/server/__mocks__/request.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/request.ts rename to x-pack/platform/plugins/shared/automatic_import/server/__mocks__/request.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/request_context.ts b/x-pack/platform/plugins/shared/automatic_import/server/__mocks__/request_context.ts similarity index 98% rename from x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/request_context.ts rename to x-pack/platform/plugins/shared/automatic_import/server/__mocks__/request_context.ts index 95292e491cc73..47be211fc040b 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/request_context.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/__mocks__/request_context.ts @@ -61,7 +61,7 @@ const actions = { const coreSetupMock = coreMock.createSetup(); const createRequestContextMock = (clients: MockClients = createMockClients()) => { return { - integrationAssistant: { + automaticImport: { getStartServices: (coreSetupMock.getStartServices as jest.Mock).mockImplementation( async () => { return [ diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/response.ts b/x-pack/platform/plugins/shared/automatic_import/server/__mocks__/response.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/response.ts rename to x-pack/platform/plugins/shared/automatic_import/server/__mocks__/response.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/test_adapters.ts b/x-pack/platform/plugins/shared/automatic_import/server/__mocks__/test_adapters.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/test_adapters.ts rename to x-pack/platform/plugins/shared/automatic_import/server/__mocks__/test_adapters.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/config.ts b/x-pack/platform/plugins/shared/automatic_import/server/config.ts similarity index 61% rename from x-pack/platform/plugins/shared/integration_assistant/server/config.ts rename to x-pack/platform/plugins/shared/automatic_import/server/config.ts index bd30cc844ebe7..67e834dd1b9e2 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/config.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/config.ts @@ -14,11 +14,11 @@ export const configSchema = schema.object({ * For internal use. A list of string values (comma delimited) that will enable experimental * type of functionality that is not yet released. Valid values for this settings need to * be defined in: - * `x-pack/platform/plugins/shared/integration_assistant/common/experimental_features.ts` + * `x-pack/platform/plugins/shared/automatic_import/common/experimental_features.ts` * under the `allowedExperimentalValues` object * * @example - * xpack.integration_assistant.enableExperimental: + * xpack.automatic_import.enableExperimental: * - someCrazyFeature * - someEvenCrazierFeature */ @@ -26,11 +26,23 @@ export const configSchema = schema.object({ defaultValue: () => [], }), }); -export type IntegrationAssistantConfigType = TypeOf<typeof configSchema>; +export type AutomaticImportConfigType = TypeOf<typeof configSchema>; -export const config: PluginConfigDescriptor<IntegrationAssistantConfigType> = { +export const config: PluginConfigDescriptor<AutomaticImportConfigType> = { exposeToBrowser: { enableExperimental: true, }, schema: configSchema, + deprecations: ({ renameFromRoot }) => [ + renameFromRoot('xpack.integration_assistant.enabled', 'xpack.automatic_import.enabled', { + level: 'critical', + }), + renameFromRoot( + 'xpack.integration_assistant.enableExperimental', + 'xpack.automatic_import.enableExperimental', + { + level: 'critical', + } + ), + ], }; diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/paths.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/paths.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/paths.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/paths.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/paths.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/paths.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/paths.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/paths.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/api_analysis/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/api_analysis/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/categorization.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/categorization.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/categorization.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/categorization.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/categorization.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/categorization.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/categorization.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/categorization.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/errors.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/errors.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/errors.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/errors.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/errors.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/errors.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/errors.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/errors.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/invalid.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/invalid.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/invalid.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/invalid.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/invalid.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/invalid.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/invalid.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/invalid.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/review.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/review.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/review.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/review.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/review.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/review.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/review.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/review.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/stable.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/stable.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/stable.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/stable.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/util.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/util.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/util.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/util.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/util.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/util.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/util.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/util.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/validate.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/validate.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/validate.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/validate.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/validate.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/validate.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/categorization/validate.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/categorization/validate.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/analyze_headers.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/analyze_headers.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/analyze_headers.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/analyze_headers.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/analyze_headers.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/analyze_headers.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/analyze_headers.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/analyze_headers.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_basic.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_basic.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_basic.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_basic.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_basic.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_basic.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_basic.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_basic.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_digest.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_digest.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_digest.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_digest.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_digest.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_digest.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_digest.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_digest.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_header.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_header.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_header.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_header.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_oauth2.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_oauth2.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_oauth2.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_oauth2.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_oauth2.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_oauth2.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/auth_oauth2.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/auth_oauth2.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/build_program.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/build_program.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/build_program.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/build_program.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/build_program.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/build_program.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/build_program.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/build_program.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_details.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_details.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_details.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_details.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_details.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_details.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_details.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_details.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_vars.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_vars.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_vars.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_vars.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_vars.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_vars.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/retrieve_state_vars.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/retrieve_state_vars.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/summarize_query.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/summarize_query.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/summarize_query.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/summarize_query.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/summarize_query.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/summarize_query.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/summarize_query.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/summarize_query.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/util.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/util.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/util.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/util.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/util.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/util.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/cel/util.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/cel/util.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/csv/columns.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/csv/columns.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/csv/columns.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/csv/columns.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/csv/columns.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/csv/columns.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/csv/columns.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/csv/columns.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/csv/csv.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/csv/csv.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/csv/csv.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/csv/csv.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/chunk.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/chunk.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/chunk.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/chunk.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/chunk.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/chunk.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/chunk.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/chunk.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/duplicates.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/duplicates.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/duplicates.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/duplicates.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/duplicates.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/duplicates.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/duplicates.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/duplicates.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/invalid.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/invalid.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/invalid.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/invalid.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/invalid.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/invalid.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/invalid.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/invalid.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/mapping.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/mapping.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/mapping.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/mapping.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/mapping.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/mapping.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/mapping.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/mapping.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/missing.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/missing.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/missing.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/missing.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/missing.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/missing.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/missing.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/missing.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/model.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/model.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/model.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/model.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/pipeline.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/pipeline.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/pipeline.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/pipeline.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/pipeline.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/pipeline.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/pipeline.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/pipeline.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/state.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/state.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/state.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/state.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/validate.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/validate.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/validate.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/validate.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/validate.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/validate.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/ecs/validate.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/ecs/validate.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/error.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/error.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/error.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/error.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/header.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/header.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/header.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/header.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/header.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/header.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/header.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/header.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/kv.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/kv.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/kv.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/kv.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/kv.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/kv.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/kv.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/kv.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/validate.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/validate.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/kv/validate.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/kv/validate.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/detection.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/detection.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/detection.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/detection.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/detection.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/detection.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/detection.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/detection.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/log_type_detection/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/log_type_detection/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/errors.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/errors.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/errors.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/errors.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/errors.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/errors.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/errors.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/errors.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/related.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/related.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/related.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/related.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/related.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/related.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/related.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/related.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/review.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/review.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/review.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/review.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/review.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/review.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/review.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/review.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/util.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/util.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/util.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/util.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/util.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/related/util.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/related/util.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/related/util.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/error.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/error.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/error.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/error.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/errors.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/errors.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/errors.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/errors.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/graph.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/graph.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/graph.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/graph.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/prompts.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/prompts.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/prompts.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/prompts.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/unstructured.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/unstructured.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/unstructured.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/unstructured.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/unstructured.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/unstructured.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/unstructured.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/unstructured.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/validate.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/validate.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/validate.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/validate.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/validate.ts b/x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/validate.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/graphs/unstructured/validate.ts rename to x-pack/platform/plugins/shared/automatic_import/server/graphs/unstructured/validate.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/index.ts similarity index 66% rename from x-pack/platform/plugins/shared/integration_assistant/server/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/index.ts index d259ae80c53de..7df9a612f850e 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/index.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/index.ts @@ -10,8 +10,8 @@ import type { PluginInitializerContext } from '@kbn/core/server'; export { config } from './config'; export async function plugin(initializerContext: PluginInitializerContext) { - const { IntegrationAssistantPlugin } = await import('./plugin'); - return new IntegrationAssistantPlugin(initializerContext); + const { AutomaticImportPlugin } = await import('./plugin'); + return new AutomaticImportPlugin(initializerContext); } -export type { IntegrationAssistantPluginSetup, IntegrationAssistantPluginStart } from './types'; +export type { AutomaticImportPluginSetup, AutomaticImportPluginStart } from './types'; diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/agent.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/agent.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/agent.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/agent.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/agent.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/agent.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/agent.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/agent.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.test.ts similarity index 99% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.test.ts index 936f057fd6bec..cb40f9731242c 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.test.ts @@ -49,7 +49,7 @@ jest.mock('adm-zip', () => { }); describe('buildPackage', () => { - const packagePath = `${mockedDataPath}/integration-assistant-${mockedId}`; + const packagePath = `${mockedDataPath}/automatic-import-${mockedId}`; const integrationPath = `${packagePath}/integration-1.0.0`; const firstDatastreamName = 'datastream_one'; diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.ts similarity index 98% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.ts index d8d29875bcc8a..30ef7d997a6bc 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/build_integration.ts @@ -42,7 +42,7 @@ export async function buildPackage(integration: Integration): Promise<Buffer> { ); } - const workingDir = joinPath(getDataPath(), `integration-assistant-${generateUniqueId()}`); + const workingDir = joinPath(getDataPath(), `automatic-import-${generateUniqueId()}`); const packageDirectoryName = `${integration.name}-${initialVersion}`; const packageDir = createDirectories(workingDir, integration, packageDirectoryName); diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/constants.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/constants.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/constants.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/constants.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/data_stream.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/data_stream.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/data_stream.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/data_stream.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/data_stream.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/dev_folders.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/dev_folders.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/dev_folders.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/dev_folders.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/fields.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/fields.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/fields.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/fields.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/fields.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/fields.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/fields.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/fields.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/pipeline.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/pipeline.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/pipeline.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/pipeline.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/pipeline.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/pipeline.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/pipeline.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/pipeline.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/readme_files.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/readme_files.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/readme_files.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/readme_files.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/readme_files.ts b/x-pack/platform/plugins/shared/automatic_import/server/integration_builder/readme_files.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/readme_files.ts rename to x-pack/platform/plugins/shared/automatic_import/server/integration_builder/readme_files.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/cef_error.ts b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/cef_error.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/cef_error.ts rename to x-pack/platform/plugins/shared/automatic_import/server/lib/errors/cef_error.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/lib/errors/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/recursion_limit_error.ts b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/recursion_limit_error.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/recursion_limit_error.ts rename to x-pack/platform/plugins/shared/automatic_import/server/lib/errors/recursion_limit_error.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/lib/errors/types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/unparseable_csv_error.ts b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/unparseable_csv_error.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/unparseable_csv_error.ts rename to x-pack/platform/plugins/shared/automatic_import/server/lib/errors/unparseable_csv_error.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/unsupported_error.ts b/x-pack/platform/plugins/shared/automatic_import/server/lib/errors/unsupported_error.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/lib/errors/unsupported_error.ts rename to x-pack/platform/plugins/shared/automatic_import/server/lib/errors/unsupported_error.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/plugin.ts b/x-pack/platform/plugins/shared/automatic_import/server/plugin.ts similarity index 51% rename from x-pack/platform/plugins/shared/integration_assistant/server/plugin.ts rename to x-pack/platform/plugins/shared/automatic_import/server/plugin.ts index 9c47d5676b6d3..325c4833115d0 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/plugin.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/plugin.ts @@ -16,30 +16,30 @@ import type { import { MINIMUM_LICENSE_TYPE } from '../common/constants'; import { registerRoutes } from './routes'; import type { - IntegrationAssistantPluginSetup, - IntegrationAssistantPluginStart, - IntegrationAssistantPluginStartDependencies, - IntegrationAssistantPluginSetupDependencies, + AutomaticImportPluginSetup, + AutomaticImportPluginStart, + AutomaticImportPluginStartDependencies, + AutomaticImportPluginSetupDependencies, } from './types'; -export type IntegrationAssistantRouteHandlerContext = CustomRequestHandlerContext<{ - integrationAssistant: { +export type AutomaticImportRouteHandlerContext = CustomRequestHandlerContext<{ + automaticImport: { getStartServices: CoreSetup< - IntegrationAssistantPluginStartDependencies, - IntegrationAssistantPluginStart + AutomaticImportPluginStartDependencies, + AutomaticImportPluginStart >['getStartServices']; isAvailable: () => boolean; logger: Logger; }; }>; -export class IntegrationAssistantPlugin +export class AutomaticImportPlugin implements Plugin< - IntegrationAssistantPluginSetup, - IntegrationAssistantPluginStart, - IntegrationAssistantPluginSetupDependencies, - IntegrationAssistantPluginStartDependencies + AutomaticImportPluginSetup, + AutomaticImportPluginStart, + AutomaticImportPluginSetupDependencies, + AutomaticImportPluginStartDependencies > { private readonly logger: Logger; @@ -53,19 +53,19 @@ export class IntegrationAssistantPlugin } public setup( - core: CoreSetup<IntegrationAssistantPluginStartDependencies, IntegrationAssistantPluginStart> - ): IntegrationAssistantPluginSetup { - core.http.registerRouteHandlerContext< - IntegrationAssistantRouteHandlerContext, - 'integrationAssistant' - >('integrationAssistant', () => ({ - getStartServices: core.getStartServices, - isAvailable: () => this.isAvailable && this.hasLicense, - logger: this.logger, - })); - const router = core.http.createRouter<IntegrationAssistantRouteHandlerContext>(); + core: CoreSetup<AutomaticImportPluginStartDependencies, AutomaticImportPluginStart> + ): AutomaticImportPluginSetup { + core.http.registerRouteHandlerContext<AutomaticImportRouteHandlerContext, 'automaticImport'>( + 'automaticImport', + () => ({ + getStartServices: core.getStartServices, + isAvailable: () => this.isAvailable && this.hasLicense, + logger: this.logger, + }) + ); + const router = core.http.createRouter<AutomaticImportRouteHandlerContext>(); - this.logger.debug('integrationAssistant api: Setup'); + this.logger.debug('automaticImport api: Setup'); registerRoutes(router); @@ -80,9 +80,9 @@ export class IntegrationAssistantPlugin public start( _: CoreStart, - dependencies: IntegrationAssistantPluginStartDependencies - ): IntegrationAssistantPluginStart { - this.logger.debug('integrationAssistant api: Started'); + dependencies: AutomaticImportPluginStartDependencies + ): AutomaticImportPluginStart { + this.logger.debug('automaticImport api: Started'); const { licensing } = dependencies; licensing.license$.subscribe((license) => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/processor_types.ts b/x-pack/platform/plugins/shared/automatic_import/server/processor_types.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/processor_types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/processor_types.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_api_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_api_route.test.ts similarity index 93% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_api_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_api_route.test.ts index 41fd070fcfa8d..9ae894814b965 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_api_route.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_api_route.test.ts @@ -56,9 +56,9 @@ describe('registerApiAnalysisRoute', () => { expect(response.status).toEqual(400); }); - describe('when the integration assistant is not available', () => { + describe('when the automatic import is not available', () => { beforeEach(() => { - context.integrationAssistant.isAvailable.mockReturnValue(false); + context.automaticImport.isAvailable.mockReturnValue(false); }); it('returns a 404', async () => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_api_route.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_api_route.ts similarity index 93% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_api_route.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_api_route.ts index cafa5a7d0a396..f73d79ed28cad 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_api_route.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_api_route.ts @@ -17,15 +17,13 @@ import { ROUTE_HANDLER_TIMEOUT, } from '../constants'; import { getApiAnalysisGraph } from '../graphs/api_analysis'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { getLLMClass, getLLMType } from '../util/llm'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; import { isErrorThatHandlesItsOwnResponse } from '../lib/errors'; -export function registerApiAnalysisRoutes( - router: IRouter<IntegrationAssistantRouteHandlerContext> -) { +export function registerApiAnalysisRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { router.versioned .post({ path: ANALYZE_API_PATH, @@ -56,7 +54,7 @@ export function registerApiAnalysisRoutes( }, withAvailability(async (context, req, res): Promise<IKibanaResponse<AnalyzeApiResponse>> => { const { dataStreamTitle, pathOptions, langSmithOptions } = req.body; - const { getStartServices, logger } = await context.integrationAssistant; + const { getStartServices, logger } = await context.automaticImport; const [, { actions: actionsPlugin }] = await getStartServices(); try { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_logs_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_logs_routes.ts similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_logs_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_logs_routes.ts index de6f3fc054dc6..565b6e42204a1 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_logs_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/analyze_logs_routes.ts @@ -17,7 +17,7 @@ import { ROUTE_HANDLER_TIMEOUT, } from '../constants'; import { getLogFormatDetectionGraph } from '../graphs/log_type_detection/graph'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { getLLMClass, getLLMType } from '../util/llm'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; @@ -26,9 +26,7 @@ import { handleCustomErrors } from './routes_util'; import { GenerationErrorCode } from '../../common/constants'; import { CefError } from '../lib/errors/cef_error'; -export function registerAnalyzeLogsRoutes( - router: IRouter<IntegrationAssistantRouteHandlerContext> -) { +export function registerAnalyzeLogsRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { router.versioned .post({ path: ANALYZE_LOGS_PATH, @@ -68,7 +66,7 @@ export function registerAnalyzeLogsRoutes( } = req.body; const services = await context.resolve(['core']); const { client } = services.core.elasticsearch; - const { getStartServices, logger } = await context.integrationAssistant; + const { getStartServices, logger } = await context.automaticImport; const [, { actions: actionsPlugin }] = await getStartServices(); try { const actionsClient = await actionsPlugin.getActionsClientWithRequest(req); diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/build_integration_routes.test.ts similarity index 93% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/build_integration_routes.test.ts index b57dd670df03f..9f5ec4fc3e15c 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/build_integration_routes.test.ts @@ -60,9 +60,9 @@ describe('registerIntegrationBuilderRoutes', () => { expect(response.status).toEqual(200); }); - describe('when the integration assistant is not available', () => { + describe('when the automatic import is not available', () => { beforeEach(() => { - context.integrationAssistant.isAvailable.mockReturnValue(false); + context.automaticImport.isAvailable.mockReturnValue(false); }); it('returns a 404', async () => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/build_integration_routes.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/build_integration_routes.ts index 94bcbfaedaebf..8be9a018ae67e 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/build_integration_routes.ts @@ -8,7 +8,7 @@ import type { IRouter } from '@kbn/core/server'; import { BuildIntegrationRequestBody, INTEGRATION_BUILDER_PATH } from '../../common'; import { buildPackage } from '../integration_builder'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; import { isErrorThatHandlesItsOwnResponse } from '../lib/errors'; @@ -20,7 +20,7 @@ import { INTEGRATIONS_ALL_ROLE, } from '../constants'; export function registerIntegrationBuilderRoutes( - router: IRouter<IntegrationAssistantRouteHandlerContext> + router: IRouter<AutomaticImportRouteHandlerContext> ) { router.versioned .post({ diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/categorization_routes.test.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/categorization_routes.test.ts index 0e6f4ffa0491a..1d54267fff6d5 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/categorization_routes.test.ts @@ -68,9 +68,9 @@ describe('registerCategorizationRoute', () => { expect(response.status).toEqual(400); }); - describe('when the integration assistant is not available', () => { + describe('when the automatic import is not available', () => { beforeEach(() => { - context.integrationAssistant.isAvailable.mockReturnValue(false); + context.automaticImport.isAvailable.mockReturnValue(false); }); it('returns a 404', async () => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/categorization_routes.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/categorization_routes.ts index 72aaf1d963efb..87e711aa4d2d1 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/categorization_routes.ts @@ -21,7 +21,7 @@ import { ROUTE_HANDLER_TIMEOUT, } from '../constants'; import { getCategorizationGraph } from '../graphs/categorization'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { getLLMClass, getLLMType } from '../util/llm'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; @@ -29,9 +29,7 @@ import { isErrorThatHandlesItsOwnResponse } from '../lib/errors'; import { handleCustomErrors } from './routes_util'; import { CATEGORIZATION_RECURSION_LIMIT, GenerationErrorCode } from '../../common/constants'; -export function registerCategorizationRoutes( - router: IRouter<IntegrationAssistantRouteHandlerContext> -) { +export function registerCategorizationRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { router.versioned .post({ path: CATEGORIZATION_GRAPH_PATH, @@ -72,7 +70,7 @@ export function registerCategorizationRoutes( } = req.body; const services = await context.resolve(['core']); const { client } = services.core.elasticsearch; - const { getStartServices, logger } = await context.integrationAssistant; + const { getStartServices, logger } = await context.automaticImport; const [, { actions: actionsPlugin }] = await getStartServices(); try { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_route.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/cel_route.test.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_route.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/cel_route.test.ts index fe49a1982b99a..bc131d5ce6930 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_route.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/cel_route.test.ts @@ -80,9 +80,9 @@ describe('registerCelInputRoute', () => { expect(response.status).toEqual(400); }); - describe('when the integration assistant is not available', () => { + describe('when the automatic import is not available', () => { beforeEach(() => { - context.integrationAssistant.isAvailable.mockReturnValue(false); + context.automaticImport.isAvailable.mockReturnValue(false); }); it('returns a 404', async () => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/cel_routes.ts similarity index 93% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/cel_routes.ts index 13a7f963244f3..3212b1f15544a 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/cel_routes.ts @@ -17,13 +17,13 @@ import { ROUTE_HANDLER_TIMEOUT, } from '../constants'; import { getCelGraph } from '../graphs/cel'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { getLLMClass, getLLMType } from '../util/llm'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; import { isErrorThatHandlesItsOwnResponse } from '../lib/errors'; -export function registerCelInputRoutes(router: IRouter<IntegrationAssistantRouteHandlerContext>) { +export function registerCelInputRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { router.versioned .post({ path: CEL_INPUT_GRAPH_PATH, @@ -54,7 +54,7 @@ export function registerCelInputRoutes(router: IRouter<IntegrationAssistantRoute }, withAvailability(async (context, req, res): Promise<IKibanaResponse<CelInputResponse>> => { const { dataStreamTitle, celDetails, langSmithOptions } = req.body; - const { getStartServices, logger } = await context.integrationAssistant; + const { getStartServices, logger } = await context.automaticImport; const [, { actions: actionsPlugin }] = await getStartServices(); try { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/ecs_routes.test.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/ecs_routes.test.ts index 42cb68de5eb26..49c3ace2c05b2 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/ecs_routes.test.ts @@ -73,9 +73,9 @@ describe('registerEcsRoute', () => { expect(response.status).toEqual(400); }); - describe('when the integration assistant is not available', () => { + describe('when the automatic import is not available', () => { beforeEach(() => { - context.integrationAssistant.isAvailable.mockReturnValue(false); + context.automaticImport.isAvailable.mockReturnValue(false); }); it('returns a 404', async () => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/ecs_routes.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/ecs_routes.ts index ff115eb8027c6..3a86e49ced4be 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/ecs_routes.ts @@ -17,7 +17,7 @@ import { ROUTE_HANDLER_TIMEOUT, } from '../constants'; import { getEcsGraph } from '../graphs/ecs'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { getLLMClass, getLLMType } from '../util/llm'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; @@ -25,7 +25,7 @@ import { isErrorThatHandlesItsOwnResponse } from '../lib/errors'; import { handleCustomErrors } from './routes_util'; import { GenerationErrorCode } from '../../common/constants'; -export function registerEcsRoutes(router: IRouter<IntegrationAssistantRouteHandlerContext>) { +export function registerEcsRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { router.versioned .post({ path: ECS_GRAPH_PATH, @@ -64,7 +64,7 @@ export function registerEcsRoutes(router: IRouter<IntegrationAssistantRouteHandl mapping, langSmithOptions, } = req.body; - const { getStartServices, logger } = await context.integrationAssistant; + const { getStartServices, logger } = await context.automaticImport; const [, { actions: actionsPlugin }] = await getStartServices(); try { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/pipeline_routes.test.ts similarity index 92% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/pipeline_routes.test.ts index 7cde38383f977..fc15a3321fb9a 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/pipeline_routes.test.ts @@ -55,9 +55,9 @@ describe('registerPipelineRoutes', () => { expect(response.status).toEqual(200); }); - describe('when the integration assistant is not available', () => { + describe('when the automatic import is not available', () => { beforeEach(() => { - context.integrationAssistant.isAvailable.mockReturnValue(false); + context.automaticImport.isAvailable.mockReturnValue(false); }); it('returns a 404', async () => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/pipeline_routes.ts similarity index 93% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/pipeline_routes.ts index 357d104c7e852..5edf7e0e3d294 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/pipeline_routes.ts @@ -13,7 +13,7 @@ import { INTEGRATIONS_ALL_ROLE, ROUTE_HANDLER_TIMEOUT, } from '../constants'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { testPipeline } from '../util/pipeline'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; @@ -21,7 +21,7 @@ import { isErrorThatHandlesItsOwnResponse } from '../lib/errors'; import { handleCustomErrors } from './routes_util'; import { GenerationErrorCode } from '../../common/constants'; -export function registerPipelineRoutes(router: IRouter<IntegrationAssistantRouteHandlerContext>) { +export function registerPipelineRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { router.versioned .post({ path: CHECK_PIPELINE_PATH, diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/register_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/register_routes.ts similarity index 86% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/register_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/register_routes.ts index 866fe186c6fcd..998a4fd3c173a 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/register_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/register_routes.ts @@ -11,12 +11,12 @@ import { registerIntegrationBuilderRoutes } from './build_integration_routes'; import { registerCategorizationRoutes } from './categorization_routes'; import { registerRelatedRoutes } from './related_routes'; import { registerPipelineRoutes } from './pipeline_routes'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { registerAnalyzeLogsRoutes } from './analyze_logs_routes'; import { registerCelInputRoutes } from './cel_routes'; import { registerApiAnalysisRoutes } from './analyze_api_route'; -export function registerRoutes(router: IRouter<IntegrationAssistantRouteHandlerContext>) { +export function registerRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { registerAnalyzeLogsRoutes(router); registerEcsRoutes(router); registerIntegrationBuilderRoutes(router); diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/related_routes.test.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/related_routes.test.ts index 038d5e14478f5..bf8dd4c5dc5c7 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.test.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/related_routes.test.ts @@ -68,9 +68,9 @@ describe('registerRelatedRoutes', () => { expect(response.status).toEqual(400); }); - describe('when the integration assistant is not available', () => { + describe('when the automatic import is not available', () => { beforeEach(() => { - context.integrationAssistant.isAvailable.mockReturnValue(false); + context.automaticImport.isAvailable.mockReturnValue(false); }); it('returns a 404', async () => { diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/related_routes.ts similarity index 94% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/related_routes.ts index 814fda4684786..196133b8c4457 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/related_routes.ts @@ -17,7 +17,7 @@ import { ROUTE_HANDLER_TIMEOUT, } from '../constants'; import { getRelatedGraph } from '../graphs/related'; -import type { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import type { AutomaticImportRouteHandlerContext } from '../plugin'; import { getLLMClass, getLLMType } from '../util/llm'; import { buildRouteValidationWithZod } from '../util/route_validation'; import { withAvailability } from './with_availability'; @@ -25,7 +25,7 @@ import { isErrorThatHandlesItsOwnResponse } from '../lib/errors'; import { handleCustomErrors } from './routes_util'; import { GenerationErrorCode } from '../../common/constants'; -export function registerRelatedRoutes(router: IRouter<IntegrationAssistantRouteHandlerContext>) { +export function registerRelatedRoutes(router: IRouter<AutomaticImportRouteHandlerContext>) { router.versioned .post({ path: RELATED_GRAPH_PATH, @@ -65,7 +65,7 @@ export function registerRelatedRoutes(router: IRouter<IntegrationAssistantRouteH } = req.body; const services = await context.resolve(['core']); const { client } = services.core.elasticsearch; - const { getStartServices, logger } = await context.integrationAssistant; + const { getStartServices, logger } = await context.automaticImport; const [, { actions: actionsPlugin }] = await getStartServices(); try { const actionsClient = await actionsPlugin.getActionsClientWithRequest(req); diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/routes_util.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/routes_util.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/routes_util.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/routes_util.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/routes_util.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/routes_util.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/routes_util.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/routes_util.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/routes/with_availability.ts b/x-pack/platform/plugins/shared/automatic_import/server/routes/with_availability.ts similarity index 75% rename from x-pack/platform/plugins/shared/integration_assistant/server/routes/with_availability.ts rename to x-pack/platform/plugins/shared/automatic_import/server/routes/with_availability.ts index c9f04421bb340..f5bc183aae0d0 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/routes/with_availability.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/routes/with_availability.ts @@ -6,7 +6,7 @@ */ import { RequestHandler, RouteMethod } from '@kbn/core/server'; -import { IntegrationAssistantRouteHandlerContext } from '../plugin'; +import { AutomaticImportRouteHandlerContext } from '../plugin'; /** * Wraps a request handler with a check for whether the API route is available. @@ -19,10 +19,10 @@ export const withAvailability = < B = unknown, Method extends RouteMethod = never >( - handler: RequestHandler<P, Q, B, IntegrationAssistantRouteHandlerContext, Method> -): RequestHandler<P, Q, B, IntegrationAssistantRouteHandlerContext, Method> => { + handler: RequestHandler<P, Q, B, AutomaticImportRouteHandlerContext, Method> +): RequestHandler<P, Q, B, AutomaticImportRouteHandlerContext, Method> => { return async (context, req, res) => { - const { isAvailable } = await context.integrationAssistant; + const { isAvailable } = await context.automaticImport; if (!isAvailable()) { return res.notFound({ body: { message: 'This API route is not available using your current license/tier.' }, diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/aws_cloudwatch.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/aws_cloudwatch.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/aws_cloudwatch.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/aws_cloudwatch.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/aws_s3.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/aws_s3.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/aws_s3.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/aws_s3.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/azure_blob_storage.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/azure_blob_storage.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/azure_blob_storage.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/azure_blob_storage.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/azure_eventhub.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/azure_eventhub.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/azure_eventhub.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/azure_eventhub.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/cel.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/cel.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/cel.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/cel.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/cel_generated.yml.hbs.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/cel_generated.yml.hbs.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/cel_generated.yml.hbs.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/cel_generated.yml.hbs.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/cloudfoundry.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/cloudfoundry.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/cloudfoundry.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/cloudfoundry.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/common.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/common.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/common.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/common.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/filestream.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/filestream.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/filestream.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/filestream.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/gcp_pubsub.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/gcp_pubsub.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/gcp_pubsub.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/gcp_pubsub.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/gcs.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/gcs.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/gcs.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/gcs.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/http_endpoint.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/http_endpoint.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/http_endpoint.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/http_endpoint.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/journald.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/journald.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/journald.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/journald.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/kafka.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/kafka.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/kafka.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/kafka.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/logfile.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/logfile.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/logfile.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/logfile.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/tcp.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/tcp.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/tcp.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/tcp.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/udp.yml.hbs b/x-pack/platform/plugins/shared/automatic_import/server/templates/agent/udp.yml.hbs similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/agent/udp.yml.hbs rename to x-pack/platform/plugins/shared/automatic_import/server/templates/agent/udp.yml.hbs diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/base_fields.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/base_fields.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/base_fields.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/base_fields.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/build.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/build.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/build.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/build.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/build_readme.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/build_readme.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/build_readme.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/build_readme.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/changelog.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/changelog.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/changelog.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/changelog.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/data_stream/fields/agent.yml b/x-pack/platform/plugins/shared/automatic_import/server/templates/data_stream/fields/agent.yml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/data_stream/fields/agent.yml rename to x-pack/platform/plugins/shared/automatic_import/server/templates/data_stream/fields/agent.yml diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/data_stream/fields/beats.yml b/x-pack/platform/plugins/shared/automatic_import/server/templates/data_stream/fields/beats.yml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/data_stream/fields/beats.yml rename to x-pack/platform/plugins/shared/automatic_import/server/templates/data_stream/fields/beats.yml diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/description_readme.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/description_readme.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/description_readme.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/description_readme.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/aws_cloudwatch_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/aws_cloudwatch_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/aws_cloudwatch_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/aws_cloudwatch_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/aws_s3_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/aws_s3_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/aws_s3_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/aws_s3_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/azure_blob_storage_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/azure_blob_storage_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/azure_blob_storage_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/azure_blob_storage_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/azure_eventhub_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/azure_eventhub_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/azure_eventhub_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/azure_eventhub_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/cel_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/cel_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/cel_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/cel_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/cloudfoundry_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/cloudfoundry_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/cloudfoundry_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/cloudfoundry_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/common_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/common_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/common_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/common_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/data_stream.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/data_stream.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/data_stream.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/data_stream.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/filestream_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/filestream_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/filestream_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/filestream_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/gcp_pubsub_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/gcp_pubsub_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/gcp_pubsub_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/gcp_pubsub_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/gcs_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/gcs_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/gcs_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/gcs_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/http_endpoint_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/http_endpoint_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/http_endpoint_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/http_endpoint_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/journald_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/journald_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/journald_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/journald_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/kafka_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/kafka_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/kafka_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/kafka_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/logfile_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/logfile_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/logfile_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/logfile_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/ssl_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/ssl_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/ssl_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/ssl_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/tcp_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/tcp_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/tcp_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/tcp_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/udp_manifest.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/udp_manifest.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/manifest/udp_manifest.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/manifest/udp_manifest.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/package_readme.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/package_readme.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/package_readme.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/package_readme.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/pipeline.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/pipeline.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/pipeline.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/pipeline.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/pipeline_tests/test_common_config.yml b/x-pack/platform/plugins/shared/automatic_import/server/templates/pipeline_tests/test_common_config.yml similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/pipeline_tests/test_common_config.yml rename to x-pack/platform/plugins/shared/automatic_import/server/templates/pipeline_tests/test_common_config.yml diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/processors/append.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/processors/append.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/processors/append.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/processors/append.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/processors/grok.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/processors/grok.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/processors/grok.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/processors/grok.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/processors/kv.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/processors/kv.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/processors/kv.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/processors/kv.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/aws-cloudwatch.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/aws-cloudwatch.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/aws-cloudwatch.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/aws-cloudwatch.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/aws-s3.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/aws-s3.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/aws-s3.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/aws-s3.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/azure-blob-storage.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/azure-blob-storage.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/azure-blob-storage.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/azure-blob-storage.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/azure-eventhub.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/azure-eventhub.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/azure-eventhub.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/azure-eventhub.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/cel.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/cel.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/cel.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/cel.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/filestream.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/filestream.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/filestream.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/filestream.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/gcp-pubsub.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/gcp-pubsub.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/gcp-pubsub.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/gcp-pubsub.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/gcs.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/gcs.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/gcs.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/gcs.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/http_endpoint.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/http_endpoint.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/http_endpoint.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/http_endpoint.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/journald.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/journald.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/journald.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/journald.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/kafka.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/kafka.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/kafka.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/kafka.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/ssl-tls.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/ssl-tls.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/ssl-tls.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/ssl-tls.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/tcp.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/tcp.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/tcp.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/tcp.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/udp.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/udp.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/setup/udp.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/setup/udp.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/troubleshooting/gcp.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/troubleshooting/gcp.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/troubleshooting/gcp.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/troubleshooting/gcp.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/troubleshooting/http_endpoint.md.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/readme/troubleshooting/http_endpoint.md.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/readme/troubleshooting/http_endpoint.md.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/readme/troubleshooting/http_endpoint.md.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/docker_compose.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/docker_compose.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/docker_compose.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/docker_compose.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_filestream.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_filestream.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_filestream.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_filestream.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_gcs.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_gcs.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_gcs.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_gcs.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_logfile.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_logfile.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_logfile.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_logfile.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_tcp.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_tcp.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_tcp.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_tcp.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_udp.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_udp.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/service_udp.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/service_udp.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_filestream_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_filestream_config.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_filestream_config.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_filestream_config.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_gcs_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_gcs_config.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_gcs_config.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_gcs_config.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_logfile_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_logfile_config.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_logfile_config.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_logfile_config.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_tcp_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_tcp_config.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_tcp_config.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_tcp_config.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_udp_config.yml.njk b/x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_udp_config.yml.njk similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/templates/system_tests/test_udp_config.yml.njk rename to x-pack/platform/plugins/shared/automatic_import/server/templates/system_tests/test_udp_config.yml.njk diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/types.ts b/x-pack/platform/plugins/shared/automatic_import/server/types.ts similarity index 95% rename from x-pack/platform/plugins/shared/integration_assistant/server/types.ts rename to x-pack/platform/plugins/shared/automatic_import/server/types.ts index 20b1fb00768f9..d54e9f122b214 100644 --- a/x-pack/platform/plugins/shared/integration_assistant/server/types.ts +++ b/x-pack/platform/plugins/shared/automatic_import/server/types.ts @@ -18,17 +18,17 @@ import type { } from '@kbn/actions-plugin/server/plugin'; import { ESProcessorItem, SamplesFormat, CelAuthType } from '../common'; -export interface IntegrationAssistantPluginSetup { +export interface AutomaticImportPluginSetup { setIsAvailable: (isAvailable: boolean) => void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface IntegrationAssistantPluginStart {} +export interface AutomaticImportPluginStart {} -export interface IntegrationAssistantPluginSetupDependencies { +export interface AutomaticImportPluginSetupDependencies { licensing: LicensingPluginSetup; actions: ActionsPluginSetup; } -export interface IntegrationAssistantPluginStartDependencies { +export interface AutomaticImportPluginStartDependencies { licensing: LicensingPluginStart; actions: ActionsPluginStart; } diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/fields.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/fields.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/fields.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/fields.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/fields.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/fields.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/fields.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/fields.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/files.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/files.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/files.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/files.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/graph.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/graph.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/graph.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/graph.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/index.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/index.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/index.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/index.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/llm.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/llm.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/llm.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/llm.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/painless.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/painless.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/painless.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/painless.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/painless.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/painless.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/painless.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/painless.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/pipeline.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/pipeline.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/pipeline.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/pipeline.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/processors.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/processors.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/processors.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/processors.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/route_validation.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/route_validation.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/route_validation.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/route_validation.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/samples.test.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/samples.test.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/samples.test.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/samples.test.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/samples.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/samples.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/samples.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/samples.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/server/util/util.ts b/x-pack/platform/plugins/shared/automatic_import/server/util/util.ts similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/server/util/util.ts rename to x-pack/platform/plugins/shared/automatic_import/server/util/util.ts diff --git a/x-pack/platform/plugins/shared/integration_assistant/tsconfig.json b/x-pack/platform/plugins/shared/automatic_import/tsconfig.json similarity index 100% rename from x-pack/platform/plugins/shared/integration_assistant/tsconfig.json rename to x-pack/platform/plugins/shared/automatic_import/tsconfig.json diff --git a/x-pack/platform/plugins/shared/fleet/cypress/e2e/integrations_automatic_import.cy.ts b/x-pack/platform/plugins/shared/fleet/cypress/e2e/integrations_automatic_import.cy.ts index 74050d9244e0b..9175f0a04cab7 100644 --- a/x-pack/platform/plugins/shared/fleet/cypress/e2e/integrations_automatic_import.cy.ts +++ b/x-pack/platform/plugins/shared/fleet/cypress/e2e/integrations_automatic_import.cy.ts @@ -79,7 +79,7 @@ describe('Add Integration - Automatic Import', () => { cy.getBySel(UPLOAD_PACKAGE_LINK).should('exist'); cy.getBySel(TECH_PREVIEW_BADGE).should('exist'); - // Create Integration Assistant Page + // Create Automatic Import Page cy.getBySel(ASSISTANT_BUTTON).click(); cy.getBySel(BUTTON_FOOTER_NEXT).click(); diff --git a/x-pack/platform/plugins/shared/fleet/cypress/e2e/privileges_integrations_automatic_import.cy.ts b/x-pack/platform/plugins/shared/fleet/cypress/e2e/privileges_integrations_automatic_import.cy.ts index 2be316d1efb30..29e307a2082a1 100644 --- a/x-pack/platform/plugins/shared/fleet/cypress/e2e/privileges_integrations_automatic_import.cy.ts +++ b/x-pack/platform/plugins/shared/fleet/cypress/e2e/privileges_integrations_automatic_import.cy.ts @@ -23,7 +23,7 @@ import { CONNECTOR_BEDROCK, CONNECTOR_GEMINI, CONNECTOR_OPENAI, - CREATE_INTEGRATION_ASSISTANT, + CREATE_AUTOMATIC_IMPORT, CREATE_INTEGRATION_LANDING_PAGE, CREATE_INTEGRATION_UPLOAD, MISSING_PRIVILEGES, @@ -62,7 +62,7 @@ describe('When the user does not have enough previleges for Integrations', () => }); it('Create Assistant is not accessible if user has read role in integrations', () => { - loginWithUserAndWaitForPage(CREATE_INTEGRATION_ASSISTANT, AutomaticImportIntegrUser); + loginWithUserAndWaitForPage(CREATE_AUTOMATIC_IMPORT, AutomaticImportIntegrUser); cy.getBySel(MISSING_PRIVILEGES).should('exist'); }); @@ -114,7 +114,7 @@ describe('When the user has All permissions for Integrations and read permission }); it('Create Assistant is accessible but execute connector is not accessible', () => { - loginWithUserAndWaitForPage(CREATE_INTEGRATION_ASSISTANT, AutomaticImportConnectorReadUser); + loginWithUserAndWaitForPage(CREATE_AUTOMATIC_IMPORT, AutomaticImportConnectorReadUser); cy.getBySel(CONNECTOR_BEDROCK).should('not.exist'); cy.getBySel(CONNECTOR_OPENAI).should('not.exist'); cy.getBySel(CONNECTOR_GEMINI).should('not.exist'); @@ -135,7 +135,7 @@ describe('When the user has All permissions for Integrations and All permissions }); it('Create Assistant is not accessible but upload is accessible', () => { - loginWithUserAndWaitForPage(CREATE_INTEGRATION_ASSISTANT, AutomaticImportConnectorAllUser); + loginWithUserAndWaitForPage(CREATE_AUTOMATIC_IMPORT, AutomaticImportConnectorAllUser); cy.getBySel(CONNECTOR_BEDROCK).should('exist'); cy.getBySel(CONNECTOR_OPENAI).should('exist'); cy.getBySel(CONNECTOR_GEMINI).should('exist'); diff --git a/x-pack/platform/plugins/shared/fleet/cypress/screens/integrations_automatic_import.ts b/x-pack/platform/plugins/shared/fleet/cypress/screens/integrations_automatic_import.ts index bd6f60cd3c948..ab51e920708d7 100644 --- a/x-pack/platform/plugins/shared/fleet/cypress/screens/integrations_automatic_import.ts +++ b/x-pack/platform/plugins/shared/fleet/cypress/screens/integrations_automatic_import.ts @@ -32,5 +32,5 @@ export const INTEGRATION_SUCCESS_SECTION = 'integrationSuccessSection'; export const SAVE_ZIP_BUTTON = 'saveZipButton'; export const CREATE_INTEGRATION_LANDING_PAGE = '/app/integrations/create'; -export const CREATE_INTEGRATION_ASSISTANT = '/app/integrations/create/assistant'; +export const CREATE_AUTOMATIC_IMPORT = '/app/integrations/create/assistant'; export const CREATE_INTEGRATION_UPLOAD = '/app/integrations/create/upload'; diff --git a/x-pack/platform/plugins/shared/fleet/kibana.jsonc b/x-pack/platform/plugins/shared/fleet/kibana.jsonc index 823328da8ada6..b51aa523e5974 100644 --- a/x-pack/platform/plugins/shared/fleet/kibana.jsonc +++ b/x-pack/platform/plugins/shared/fleet/kibana.jsonc @@ -42,7 +42,7 @@ "discover", "ingestPipelines", "guidedOnboarding", - "integrationAssistant" + "automaticImport" ], "requiredBundles": [ "kibanaReact", diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/layouts/default.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/layouts/default.tsx index 440637512490f..99bfb1aa7e237 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/layouts/default.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/layouts/default.tsx @@ -21,7 +21,7 @@ interface Props { export const DefaultLayout: React.FC<Props> = memo( ({ section, children, notificationsBySection }) => { - const { integrationAssistant } = useStartServices(); + const { automaticImport } = useStartServices(); const { getHref } = useLink(); const tabs = [ { @@ -46,7 +46,7 @@ export const DefaultLayout: React.FC<Props> = memo( }, ]; - const { CreateIntegrationCardButton } = integrationAssistant?.components ?? {}; + const { CreateIntegrationCardButton } = automaticImport?.components ?? {}; return ( <WithHeaderLayout diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/index.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/index.tsx index 741eca1497fdc..303951eaf9461 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/index.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/index.tsx @@ -20,7 +20,7 @@ import { CreateIntegration } from './screens/create'; import { CustomLanguagesOverview } from './screens/detail/custom_languages_overview'; export const EPMApp: React.FunctionComponent = () => { - const { integrationAssistant } = useStartServices(); + const { automaticImport } = useStartServices(); useBreadcrumbs('integrations'); return ( @@ -40,7 +40,7 @@ export const EPMApp: React.FunctionComponent = () => { </React.Suspense> </IntegrationsStateContextProvider> </Route> - {integrationAssistant && ( + {automaticImport && ( <Route path={INTEGRATIONS_ROUTING_PATHS.integrations_create}> <CreateIntegration /> </Route> diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/create/index.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/create/index.tsx index ec97d01a57193..7486870d16e54 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/create/index.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/screens/create/index.tsx @@ -10,10 +10,10 @@ import React from 'react'; import { useStartServices, useBreadcrumbs } from '../../../../hooks'; export const CreateIntegration = React.memo(() => { - const { integrationAssistant } = useStartServices(); + const { automaticImport } = useStartServices(); useBreadcrumbs('integration_create'); - const CreateIntegrationAssistant = integrationAssistant?.components.CreateIntegration; + const CreateAutomaticImport = automaticImport?.components.CreateIntegration; - return CreateIntegrationAssistant ? <CreateIntegrationAssistant /> : null; + return CreateAutomaticImport ? <CreateAutomaticImport /> : null; }); diff --git a/x-pack/platform/plugins/shared/fleet/public/plugin.ts b/x-pack/platform/plugins/shared/fleet/public/plugin.ts index 2e3ed2a19a4c1..993678b6ca649 100644 --- a/x-pack/platform/plugins/shared/fleet/public/plugin.ts +++ b/x-pack/platform/plugins/shared/fleet/public/plugin.ts @@ -18,7 +18,6 @@ import { DEFAULT_APP_CATEGORIES } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; -import type { IntegrationAssistantPluginStart } from '@kbn/integration-assistant-plugin/public'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import type { @@ -88,6 +87,7 @@ import type { import { LazyCustomLogsAssetsExtension } from './lazy_custom_logs_assets_extension'; import { setCustomIntegrations, setCustomIntegrationsStart } from './services/custom_integrations'; import { getFleetDeepLinks } from './deep_links'; +import type { AutomaticImportPluginStart } from '@kbn/automatic-import-plugin/public'; export type { FleetConfigType } from '../common/types'; @@ -132,7 +132,7 @@ export interface FleetStartDeps { navigation: NavigationPublicPluginStart; customIntegrations: CustomIntegrationsStart; share: SharePluginStart; - integrationAssistant?: IntegrationAssistantPluginStart; + automaticImport?: AutomaticImportPluginStart; cloud?: CloudStart; usageCollection?: UsageCollectionStart; guidedOnboarding?: GuidedOnboardingPluginStart; @@ -142,7 +142,7 @@ export interface FleetStartServices extends CoreStart, Exclude<FleetStartDeps, ' storage: Storage; share: SharePluginStart; dashboard: DashboardStart; - integrationAssistant?: IntegrationAssistantPluginStart; + automaticImport?: AutomaticImportPluginStart; cloud?: CloudSetup & CloudStart; discover?: DiscoverStart; spaces?: SpacesPluginStart; diff --git a/x-pack/platform/plugins/shared/fleet/tsconfig.json b/x-pack/platform/plugins/shared/fleet/tsconfig.json index 1bb5ad420ccda..6c9f47fc47216 100644 --- a/x-pack/platform/plugins/shared/fleet/tsconfig.json +++ b/x-pack/platform/plugins/shared/fleet/tsconfig.json @@ -110,7 +110,7 @@ "@kbn/fields-metadata-plugin", "@kbn/test-jest-helpers", "@kbn/core-saved-objects-utils-server", - "@kbn/integration-assistant-plugin", + "@kbn/automatic-import-plugin", "@kbn/core-security-server-mocks", "@kbn/server-http-tools", "@kbn/avc-banner", diff --git a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/translations.ts b/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/translations.ts deleted file mode 100644 index 8f6128834cbe7..0000000000000 --- a/x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_upload/translations.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const UPLOAD_TITLE = i18n.translate( - 'xpack.integrationAssistant.createIntegrationUpload.title', - { - defaultMessage: 'Upload integration package', - } -); - -export const UPLOAD_INPUT_TEXT = i18n.translate( - 'xpack.integrationAssistant.createIntegrationUpload.inputText', - { - defaultMessage: 'Drag and drop a .zip file or Browse files', - } -); - -export const INSTALL_BUTTON = i18n.translate( - 'xpack.integrationAssistant.createIntegrationUpload.install', - { - defaultMessage: 'Add to Elastic', - } -); - -export const CLOSE_BUTTON = i18n.translate( - 'xpack.integrationAssistant.createIntegrationUpload.close', - { - defaultMessage: 'Close', - } -); - -export const UPLOAD_ERROR = i18n.translate( - 'xpack.integrationAssistant.createIntegrationUpload.error', - { - defaultMessage: 'Error installing package', - } -); diff --git a/x-pack/solutions/security/packages/features/src/product_features_keys.ts b/x-pack/solutions/security/packages/features/src/product_features_keys.ts index b8260762773a8..2edb3d2840494 100644 --- a/x-pack/solutions/security/packages/features/src/product_features_keys.ts +++ b/x-pack/solutions/security/packages/features/src/product_features_keys.ts @@ -85,9 +85,9 @@ export enum ProductFeatureSecurityKey { cloudSecurityPosture = 'cloud_security_posture', /** - * enables the integration assistant + * enables the automatic import */ - integrationAssistant = 'integration_assistant', + automaticImport = 'automatic_import', /** Enables Endpoint Workflow Insights */ securityWorkflowInsights = 'security_workflow_insights', diff --git a/x-pack/solutions/security/packages/features/src/security/product_feature_config.ts b/x-pack/solutions/security/packages/features/src/security/product_feature_config.ts index be72dcdbf9df8..516a087bb553e 100644 --- a/x-pack/solutions/security/packages/features/src/security/product_feature_config.ts +++ b/x-pack/solutions/security/packages/features/src/security/product_feature_config.ts @@ -134,5 +134,5 @@ export const securityDefaultProductFeaturesConfig: DefaultSecurityProductFeature [ProductFeatureSecurityKey.cloudSecurityPosture]: {}, // Security PLIs - [ProductFeatureSecurityKey.integrationAssistant]: {}, + [ProductFeatureSecurityKey.automaticImport]: {}, }; diff --git a/x-pack/solutions/security/packages/upselling/service/types.ts b/x-pack/solutions/security/packages/upselling/service/types.ts index b053c9aedf857..8ca3180f426e1 100644 --- a/x-pack/solutions/security/packages/upselling/service/types.ts +++ b/x-pack/solutions/security/packages/upselling/service/types.ts @@ -20,7 +20,7 @@ export type UpsellingSectionId = | 'endpoint_custom_notification' | 'cloud_security_posture_integration_installation' | 'ruleDetailsEndpointExceptions' - | 'integration_assistant'; + | 'automatic_import'; export type UpsellingMessageId = | 'investigation_guide' diff --git a/x-pack/solutions/security/plugins/security_solution/kibana.jsonc b/x-pack/solutions/security/plugins/security_solution/kibana.jsonc index 2142601e1bd04..632fa72c39782 100644 --- a/x-pack/solutions/security/plugins/security_solution/kibana.jsonc +++ b/x-pack/solutions/security/plugins/security_solution/kibana.jsonc @@ -76,7 +76,7 @@ "osquery", "savedObjectsTaggingOss", "guidedOnboarding", - "integrationAssistant", + "automaticImport", "serverless" ], "requiredBundles": [ diff --git a/x-pack/solutions/security/plugins/security_solution/public/types.ts b/x-pack/solutions/security/plugins/security_solution/public/types.ts index 31b7aae183c2b..57dd3b34edcbf 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/types.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/types.ts @@ -59,9 +59,9 @@ import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; import type { SavedSearchPublicPluginStart } from '@kbn/saved-search-plugin/public'; import type { PluginStartContract } from '@kbn/alerting-plugin/public/plugin'; import type { MapsStartApi } from '@kbn/maps-plugin/public'; -import type { IntegrationAssistantPluginStart } from '@kbn/integration-assistant-plugin/public'; import type { ServerlessPluginStart } from '@kbn/serverless/public'; import type { DiscoverSharedPublicStart } from '@kbn/discover-shared-plugin/public'; +import type { AutomaticImportPluginStart } from '@kbn/automatic-import-plugin/public'; import type { ResolverPluginSetup } from './resolver/types'; import type { Inspect } from '../common/search_strategy'; import type { Detections } from './detections'; @@ -157,7 +157,7 @@ export interface StartPlugins { savedSearch: SavedSearchPublicPluginStart; alerting: PluginStartContract; core: CoreStart; - integrationAssistant?: IntegrationAssistantPluginStart; + automaticImport?: AutomaticImportPluginStart; serverless?: ServerlessPluginStart; productDocBase: ProductDocBasePluginStart; } diff --git a/x-pack/solutions/security/plugins/security_solution/tsconfig.json b/x-pack/solutions/security/plugins/security_solution/tsconfig.json index d759bc5d9112f..81f810b485fb6 100644 --- a/x-pack/solutions/security/plugins/security_solution/tsconfig.json +++ b/x-pack/solutions/security/plugins/security_solution/tsconfig.json @@ -203,7 +203,7 @@ "@kbn/core-analytics-browser", "@kbn/core-i18n-browser", "@kbn/core-theme-browser", - "@kbn/integration-assistant-plugin", + "@kbn/automatic-import-plugin", "@kbn/avc-banner", "@kbn/config", "@kbn/openapi-common", diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_config.ts index 4bb78efb4b701..ee2fc44d71f0c 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_config.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_config.ts @@ -28,7 +28,7 @@ export const PLI_PRODUCT_FEATURES: PliProductFeatures = { ProductFeatureKey.threatIntelligence, ProductFeatureKey.casesConnectors, ProductFeatureKey.externalRuleActions, - ProductFeatureKey.integrationAssistant, + ProductFeatureKey.automaticImport, ], }, endpoint: { diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/kibana.jsonc b/x-pack/solutions/security/plugins/security_solution_serverless/kibana.jsonc index fa52190aa2784..ac692962a73c8 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/kibana.jsonc +++ b/x-pack/solutions/security/plugins/security_solution_serverless/kibana.jsonc @@ -29,7 +29,7 @@ ], "optionalPlugins": [ "securitySolutionEss", - "integrationAssistant" + "automaticImport" ] } } \ No newline at end of file diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts index 0e47917f8122c..590625abf3ab7 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts @@ -14,7 +14,7 @@ import type { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverle import type { ManagementSetup, ManagementStart } from '@kbn/management-plugin/public'; import type { CloudStart } from '@kbn/cloud-plugin/public'; import type { DiscoverSetup } from '@kbn/discover-plugin/public'; -import type { IntegrationAssistantPluginStart } from '@kbn/integration-assistant-plugin/public'; +import type { AutomaticImportPluginStart } from '@kbn/automatic-import-plugin/public'; import type { ServerlessSecurityConfigSchema } from '../common/config'; // eslint-disable-next-line @typescript-eslint/no-empty-interface @@ -37,7 +37,7 @@ export interface SecuritySolutionServerlessPluginStartDeps { serverless: ServerlessPluginStart; management: ManagementStart; cloud: CloudStart; - integrationAssistant?: IntegrationAssistantPluginStart; + automaticImport?: AutomaticImportPluginStart; } export type ServerlessSecurityPublicConfig = Pick< diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx index d238148dcc0b0..d7eb6f4dcda30 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx @@ -73,10 +73,10 @@ const registerSecuritySolutionUpsellings = ( * Configures the upsellings for other plugins. */ const configurePluginsUpsellings = (upsellingService: UpsellingService, services: Services) => { - const { integrationAssistant } = services; + const { automaticImport } = services; upsellingService.sections$.subscribe((sections) => { // @ts-expect-error Type 'FunctionComponent<{}>' is not assignable to type 'ReactNode'. - integrationAssistant?.renderUpselling(sections.get('integration_assistant')); + automaticImport?.renderUpselling(sections.get('automatic_import')); }); }; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/integration_assistant.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/automatic_import/automatic_import.tsx similarity index 80% rename from x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/integration_assistant.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/automatic_import/automatic_import.tsx index 7d1d797c1ecad..7cbe328ae3c9c 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/integration_assistant.tsx +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/automatic_import/automatic_import.tsx @@ -20,24 +20,24 @@ import { useProductTypeByPLI } from '../../hooks/use_product_type_by_pli'; export const UPGRADE_PRODUCT_MESSAGE = (requiredProductType: string) => i18n.translate( - 'xpack.securitySolutionServerless.upselling.integrationAssistant.upgradeProductMessage', + 'xpack.securitySolutionServerless.upselling.automaticImport.upgradeProductMessage', { defaultMessage: - 'To turn on the Integration Assistant feature, you must upgrade the product tier to {requiredProductType}', + 'To turn on the Automatic Import feature, you must upgrade the product tier to {requiredProductType}', values: { requiredProductType, }, } ); export const TIER_REQUIRED = (requiredProductType: string) => - i18n.translate('xpack.securitySolutionServerless.upselling.integrationAssistant.tierRequired', { + i18n.translate('xpack.securitySolutionServerless.upselling.automaticImport.tierRequired', { defaultMessage: '{requiredProductType} tier required', values: { requiredProductType, }, }); export const CONTACT_ADMINISTRATOR = i18n.translate( - 'xpack.securitySolutionServerless.upselling.integrationAssistant.contactAdministrator', + 'xpack.securitySolutionServerless.upselling.automaticImport.contactAdministrator', { defaultMessage: 'Contact your administrator for assistance.', } @@ -46,7 +46,7 @@ export const CONTACT_ADMINISTRATOR = i18n.translate( export interface IntegrationsAssistantProps { requiredPLI: ProductFeatureKeyType; } -export const IntegrationsAssistant = React.memo<IntegrationsAssistantProps>(({ requiredPLI }) => { +export const AutomaticImport = React.memo<IntegrationsAssistantProps>(({ requiredPLI }) => { const requiredProductType = useProductTypeByPLI(requiredPLI); return ( <> @@ -84,4 +84,4 @@ export const IntegrationsAssistant = React.memo<IntegrationsAssistantProps>(({ r </> ); }); -IntegrationsAssistant.displayName = 'IntegrationsAssistant'; +AutomaticImport.displayName = 'IntegrationsAssistant'; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/automatic_import/index.ts similarity index 64% rename from x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/automatic_import/index.ts index 320ed8be7ffc1..e7747cddc2439 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/index.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/automatic_import/index.ts @@ -7,8 +7,8 @@ import { lazy } from 'react'; -export const IntegrationsAssistantLazy = lazy(() => - import('./integration_assistant').then(({ IntegrationsAssistant }) => ({ - default: IntegrationsAssistant, +export const AutomaticImportLazy = lazy(() => + import('./automatic_import').then(({ AutomaticImport }) => ({ + default: AutomaticImport, })) ); diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.tsx index f61f429ff9e88..44ba64631e9d7 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.tsx +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.tsx @@ -34,7 +34,7 @@ import { ThreatIntelligencePaywallLazy, } from './lazy_upselling'; import * as i18n from './translations'; -import { IntegrationsAssistantLazy } from './sections/integration_assistant'; +import { AutomaticImportLazy } from './sections/automatic_import'; interface UpsellingsConfig { pli: ProductFeatureKeyType; @@ -140,11 +140,9 @@ export const upsellingSections: UpsellingSections = [ ), }, { - id: 'integration_assistant', - pli: ProductFeatureKey.integrationAssistant, - component: () => ( - <IntegrationsAssistantLazy requiredPLI={ProductFeatureKey.integrationAssistant} /> - ), + id: 'automatic_import', + pli: ProductFeatureKey.automaticImport, + component: () => <AutomaticImportLazy requiredPLI={ProductFeatureKey.automaticImport} />, }, ]; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/index.ts index 176003cfda14a..87320cca5ae9a 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/index.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/index.ts @@ -52,9 +52,9 @@ export const registerProductFeatures = ( productFeatureKeys: enabledProductFeatureKeys, }); - // set availability for the integration assistant plugin based on the product features - pluginsSetup.integrationAssistant?.setIsAvailable( - enabledProductFeatureKeys.includes(ProductFeatureKey.integrationAssistant) + // set availability for the automatic import plugin based on the product features + pluginsSetup.automaticImport?.setIsAvailable( + enabledProductFeatureKeys.includes(ProductFeatureKey.automaticImport) ); }; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts index a838c410793c3..8f76152f69db7 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts @@ -21,7 +21,7 @@ import type { FleetStartContract } from '@kbn/fleet-plugin/server'; import type { PluginSetupContract as ActionsPluginSetupContract } from '@kbn/actions-plugin/server'; import type { ServerlessPluginSetup } from '@kbn/serverless/server'; -import type { IntegrationAssistantPluginSetup } from '@kbn/integration-assistant-plugin/server'; +import type { AutomaticImportPluginSetup } from '@kbn/automatic-import-plugin/server'; import type { ProductTier } from '../common/product'; import type { ServerlessSecurityConfig } from './config'; @@ -41,7 +41,7 @@ export interface SecuritySolutionServerlessPluginSetupDeps { taskManager: TaskManagerSetupContract; cloud: CloudSetup; actions: ActionsPluginSetupContract; - integrationAssistant?: IntegrationAssistantPluginSetup; + automaticImport?: AutomaticImportPluginSetup; } export interface SecuritySolutionServerlessPluginStartDeps { 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 6b082dea68d86..68c52590670dd 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json +++ b/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json @@ -44,7 +44,7 @@ "@kbn/management-cards-navigation", "@kbn/discover-plugin", "@kbn/logging", - "@kbn/integration-assistant-plugin", + "@kbn/automatic-import-plugin", "@kbn/cloud-security-posture-common", "@kbn/dev-utils" ] diff --git a/x-pack/test/automatic_import_api_integration/common/config.ts b/x-pack/test/automatic_import_api_integration/common/config.ts index aa83401a5e8b6..04a14313d8bf0 100644 --- a/x-pack/test/automatic_import_api_integration/common/config.ts +++ b/x-pack/test/automatic_import_api_integration/common/config.ts @@ -81,7 +81,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, ] : []), - '--xpack.integration_assistant.enabled=true', + '--xpack.automatic_import.enabled=true', ], }, }; diff --git a/x-pack/test/automatic_import_api_integration/common/lib/api/analyze_logs.ts b/x-pack/test/automatic_import_api_integration/common/lib/api/analyze_logs.ts index 4ad3034a0f55b..88d16ed45c707 100644 --- a/x-pack/test/automatic_import_api_integration/common/lib/api/analyze_logs.ts +++ b/x-pack/test/automatic_import_api_integration/common/lib/api/analyze_logs.ts @@ -9,7 +9,7 @@ import { AnalyzeLogsRequestBody, ANALYZE_LOGS_PATH, AnalyzeLogsResponse, -} from '@kbn/integration-assistant-plugin/common'; +} from '@kbn/automatic-import-plugin/common'; import { superUser } from '../authentication/users'; import { User } from '../authentication/types'; diff --git a/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts b/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts index 38bc7ddafe320..b9dea57c9e94f 100644 --- a/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts +++ b/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts @@ -9,7 +9,7 @@ import { CategorizationRequestBody, CATEGORIZATION_GRAPH_PATH, CategorizationResponse, -} from '@kbn/integration-assistant-plugin/common'; +} from '@kbn/automatic-import-plugin/common'; import { superUser } from '../authentication/users'; import { User } from '../authentication/types'; import { BadRequestError } from '../error/error'; diff --git a/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts b/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts index 82888d0861659..4456ad459cbb4 100644 --- a/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts +++ b/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts @@ -9,7 +9,7 @@ import { EcsMappingRequestBody, ECS_GRAPH_PATH, EcsMappingResponse, -} from '@kbn/integration-assistant-plugin/common'; +} from '@kbn/automatic-import-plugin/common'; import { superUser } from '../authentication/users'; import { User } from '../authentication/types'; import { BadRequestError } from '../error/error'; diff --git a/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts b/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts index 0620d98fcb269..a58c64896cb9b 100644 --- a/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts +++ b/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts @@ -9,7 +9,7 @@ import { RelatedRequestBody, RELATED_GRAPH_PATH, RelatedResponse, -} from '@kbn/integration-assistant-plugin/common'; +} from '@kbn/automatic-import-plugin/common'; import { superUser } from '../authentication/users'; import { User } from '../authentication/types'; import { BadRequestError } from '../error/error'; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 60448e2a6141d..77ffa8f2d7b3e 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -186,7 +186,7 @@ "@kbn/palettes", "@kbn/sse-utils-server", "@kbn/gen-ai-functional-testing", - "@kbn/integration-assistant-plugin", + "@kbn/automatic-import-plugin", "@kbn/core-elasticsearch-server", "@kbn/streams-schema", "@kbn/server-route-repository-utils", diff --git a/yarn.lock b/yarn.lock index 28e059daf481f..e0923f065c9ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4060,6 +4060,10 @@ version "0.0.0" uid "" +"@kbn/automatic-import-plugin@link:x-pack/platform/plugins/shared/automatic_import": + version "0.0.0" + uid "" + "@kbn/avc-banner@link:src/platform/packages/shared/kbn-avc-banner": version "0.0.0" uid "" @@ -6028,10 +6032,6 @@ version "0.0.0" uid "" -"@kbn/integration-assistant-plugin@link:x-pack/platform/plugins/shared/integration_assistant": - version "0.0.0" - uid "" - "@kbn/interactive-setup-plugin@link:src/platform/plugins/private/interactive_setup": version "0.0.0" uid "" From 37eca30f85553e1a7012b38112195e886112af32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= <alejandro.haro@elastic.co> Date: Tue, 28 Jan 2025 21:59:45 +0100 Subject: [PATCH 15/26] [UA] Remove unnecessary index block settings (#208222) --- .../server/lib/reindexing/reindex_service.test.ts | 3 --- .../server/lib/reindexing/reindex_service.ts | 6 ------ 2 files changed, 9 deletions(-) diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts index cef50f37b2994..5fdd333347f57 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts @@ -465,9 +465,6 @@ describe('reindexService', () => { path: `_create_from/myIndex/myIndex-reindex-0`, body: { settings_override: { - 'index.blocks.read_only': null, - 'index.blocks.read_only_allow_delete': null, - 'index.blocks.write': null, 'index.number_of_replicas': 0, 'index.refresh_interval': -1, }, diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts index a6f85e45e3676..a17dbdadf0214 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/reindex_service.ts @@ -200,13 +200,7 @@ export const reindexServiceFactory = ( method: 'POST', path: `_create_from/${indexName}/${newIndexName}`, body: { - // Settings overrides copied from ES datastream reindex logic - // https://github.com/elastic/elasticsearch/blob/9c0709f386fee4154e930cb61a02868adebe8572/x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/ReindexDataStreamIndexTransportAction.java#L195-L210 settings_override: { - // Remove read-only settings if they exist - 'index.blocks.read_only': null, - 'index.blocks.read_only_allow_delete': null, - 'index.blocks.write': null, // Reindexing optimizations 'index.number_of_replicas': 0, 'index.refresh_interval': -1, From 7c6136be1eb82d21db0945f650f986e6349e9de6 Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Tue, 28 Jan 2025 16:00:25 -0500 Subject: [PATCH 16/26] [Security Solution][Endpoint] Fix error display on host isolation flyout (#208542) ## Summary - Fixes the display of errors when on the Host Isolation flyout panel _(`isolate`/`release` menu options from an Alert's `Take Action` menu)_ so that the expected error is shown on the Toast message and the full error is displayed when a user clicks the `See full error` button --- .../endpoint/host_isolation/from_alerts/use_host_isolation.tsx | 2 +- .../host_isolation/from_alerts/use_host_unisolation.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx index 6964ee1a34308..927e4b6049451 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx @@ -46,7 +46,7 @@ export const useHostIsolation = ({ return isolationStatus.action ? true : false; } catch (error) { setLoading(false); - addError(error.message, { title: HOST_ISOLATION_FAILURE }); + addError(error, { title: HOST_ISOLATION_FAILURE }); return false; } }, [endpointId, comment, caseIds, agentType, addError]); diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx index 1cd0d7fe3b886..ec70dcc389b81 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx @@ -45,7 +45,7 @@ export const useHostUnisolation = ({ return isolationStatus.action ? true : false; } catch (error) { setLoading(false); - addError(error.message, { title: HOST_ISOLATION_FAILURE }); + addError(error, { title: HOST_ISOLATION_FAILURE }); return false; } }, [endpointId, comment, caseIds, agentType, addError]); From 19f8506d7fea351b27af457ff484914f042c070f Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Tue, 28 Jan 2025 16:05:35 -0500 Subject: [PATCH 17/26] [Security Solution][Endpoint] Fix error message for all SentinelOne response actions so that its consistent when no stack connector is setup (#208405) ## Summary - Fixes the API error messages for SentinelOne so that they are consistent when there is no stack connector setup for it - All commands now return a `400: Bad Request, statusCode: 400, error: Bad Request, message: No stack connector instance configured for [.sentinelone]` for this condition - Improve the error message title on the UI (console) to clarify that the Action Request failed to be created - Background: Before this change, all failures showed a title of `Action failed` regardless if the action request API call failed **-OR-** the response of the action was a failure - The UI will now show a message title of `Failed to create action request.` when the API call to create the action fails - Response actions that were successful created, but the result of them is an error will continue to show `Action failed.` --- .../hooks/use_console_action_submitter.tsx | 14 +++++++++++- .../sentinel_one_actions_client.ts | 22 +++++-------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx index 08c2907dde0e3..beeb5f08aa92c 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx @@ -10,6 +10,7 @@ import type { UseMutationResult } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { FormattedMessage } from '@kbn/i18n-react'; import { useIsMounted } from '@kbn/securitysolution-hook-utils'; +import { i18n } from '@kbn/i18n'; import type { BaseActionRequestBody } from '../../../../../common/api/endpoint/actions/common/base'; import { useTestIdGenerator } from '../../../hooks/use_test_id_generator'; import { ActionSuccess } from '../components/action_success'; @@ -274,7 +275,18 @@ export const useConsoleActionSubmitter = < if (apiError) { return ( - <ResultComponent showAs="failure" data-test-subj={getTestId('apiFailure')}> + <ResultComponent + showAs="failure" + data-test-subj={getTestId('apiFailure')} + title={ + actionRequestError + ? i18n.translate( + 'xpack.securitySolution.useConsoleActionSubmitter.actionRequestFailure', + { defaultMessage: 'Failed to create action request.' } + ) + : undefined + } + > <FormattedMessage id="xpack.securitySolution.endpointResponseActions.actionSubmitter.apiErrorDetails" defaultMessage="The following error was encountered:" diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts index b35fa0fa455e9..b2bd5e99c35d9 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts @@ -255,22 +255,12 @@ export class SentinelOneActionsClient extends ResponseActionsClientImpl { return cachedEntry; } - let s1ApiResponse: SentinelOneGetAgentsResponse | undefined; - - try { - const response = await this.sendAction< - SentinelOneGetAgentsResponse, - SentinelOneGetAgentsParams - >(SUB_ACTION.GET_AGENTS, { ids: agentId }); - - s1ApiResponse = response.data; - } catch (err) { - throw new ResponseActionsClientError( - `Error while attempting to retrieve SentinelOne host with agent id [${agentId}]: ${err.message}`, - 500, - err - ); - } + const s1ApiResponse = ( + await this.sendAction<SentinelOneGetAgentsResponse, SentinelOneGetAgentsParams>( + SUB_ACTION.GET_AGENTS, + { ids: agentId } + ) + ).data; if (!s1ApiResponse || !s1ApiResponse.data[0]) { throw new ResponseActionsClientError(`SentinelOne agent id [${agentId}] not found`, 404); From 83e2a16bf8889a97dd3a1460c5fbcba34726197a Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Tue, 28 Jan 2025 16:06:28 -0500 Subject: [PATCH 18/26] [Stack Connectors][Microsoft Defender] Improve management of OAuth token to Microsoft's API (#208120) ## Summary - Add re-try logic to requests to Microsoft's API so that if a `401` (Unauthorized) is encountered, the existing cached access token is regenerated and the request is tried again. - This change should handle (edge) cases where the connector's access settings could be updated and connector would continue to use the cached token --- .../microsoft_defender_endpoint.ts | 53 +++- .../o_auth_token_manager.test.ts | 135 ++++++---- .../o_auth_token_manager.ts | 244 ++++++++++++------ 3 files changed, 290 insertions(+), 142 deletions(-) diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/microsoft_defender_endpoint.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/microsoft_defender_endpoint.ts index d06112631cf45..5262e032d0ccc 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/microsoft_defender_endpoint.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/microsoft_defender_endpoint.ts @@ -6,7 +6,7 @@ */ import { ServiceParams, SubActionConnector } from '@kbn/actions-plugin/server'; -import type { AxiosError } from 'axios'; +import type { AxiosError, AxiosResponse } from 'axios'; import { SubActionRequestParams } from '@kbn/actions-plugin/server/sub_action_framework/types'; import { ConnectorUsageCollector } from '@kbn/actions-plugin/server/types'; import { OAuthTokenManager } from './o_auth_token_manager'; @@ -52,7 +52,6 @@ export class MicrosoftDefenderEndpointConnector extends SubActionConnector< params: ServiceParams<MicrosoftDefenderEndpointConfig, MicrosoftDefenderEndpointSecrets> ) { super(params); - this.oAuthToken = new OAuthTokenManager({ ...params, apiRequest: async (...args) => this.request(...args), @@ -110,19 +109,45 @@ export class MicrosoftDefenderEndpointConnector extends SubActionConnector< ): Promise<R> { this.logger.debug(() => `Request:\n${JSON.stringify(req, null, 2)}`); - const bearerAccessToken = await this.oAuthToken.get(connectorUsageCollector); - const response = await this.request<R>( - { - ...req, - // We don't validate responses from Microsoft API's because we do not want failures for cases - // where the external system might add/remove/change values in the response that we have no - // control over. - responseSchema: - MicrosoftDefenderEndpointDoNotValidateResponseSchema as unknown as SubActionRequestParams<R>['responseSchema'], - headers: { Authorization: `Bearer ${bearerAccessToken}` }, + const requestOptions: SubActionRequestParams<R> = { + ...req, + // We don't validate responses from Microsoft API's because we do not want failures for cases + // where the external system might add/remove/change values in the response that we have no + // control over. + responseSchema: + MicrosoftDefenderEndpointDoNotValidateResponseSchema as unknown as SubActionRequestParams<R>['responseSchema'], + headers: { + Authorization: `Bearer ${await this.oAuthToken.get(connectorUsageCollector)}`, }, - connectorUsageCollector - ); + }; + let response: AxiosResponse<R>; + let was401RetryDone = false; + + try { + response = await this.request<R>(requestOptions, connectorUsageCollector); + } catch (err) { + if (was401RetryDone) { + throw err; + } + + this.logger.debug("API call failed! Determining if it's one we can retry"); + + // If error was a 401, then for some reason the token used was not valid (ex. perhaps the connector's credentials + // were updated). IN this case, we will try again by ensuring a new token is re-generated + if (err.message.includes('Status code: 401')) { + this.logger.warn( + `Received HTTP 401 (Unauthorized). Re-generating new access token and trying again` + ); + was401RetryDone = true; + await this.oAuthToken.generateNew(connectorUsageCollector); + requestOptions.headers!.Authorization = `Bearer ${await this.oAuthToken.get( + connectorUsageCollector + )}`; + response = await this.request<R>(requestOptions, connectorUsageCollector); + } else { + throw err; + } + } return response.data; } diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.test.ts index f523cc4188c69..066e2bab1f7b0 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.test.ts @@ -27,66 +27,99 @@ describe('Microsoft Defender for Endpoint oAuth token manager', () => { }); }); - it('should call MS api to generate new token', async () => { - await msOAuthManagerMock.get(testMock.usageCollector); + describe('#get()', () => { + it('should call MS api to generate new token', async () => { + await msOAuthManagerMock.get(testMock.usageCollector); - expect(testMock.instanceMock.request).toHaveBeenCalledWith( - expect.objectContaining({ - url: `${testMock.options.config.oAuthServerUrl}/${testMock.options.config.tenantId}/oauth2/v2.0/token`, - method: 'POST', - data: { - grant_type: 'client_credentials', - client_id: testMock.options.config.clientId, - scope: testMock.options.config.oAuthScope, - client_secret: testMock.options.secrets.clientSecret, - }, - }), - testMock.usageCollector - ); - }); + expect(testMock.instanceMock.request).toHaveBeenCalledWith( + expect.objectContaining({ + url: `${testMock.options.config.oAuthServerUrl}/${testMock.options.config.tenantId}/oauth2/v2.0/token`, + method: 'POST', + data: { + grant_type: 'client_credentials', + client_id: testMock.options.config.clientId, + scope: testMock.options.config.oAuthScope, + client_secret: testMock.options.secrets.clientSecret, + }, + }), + testMock.usageCollector + ); + }); + + it('should use cached token when one exists', async () => { + const { + connectorId, + token, + expiresAt: expiresAtMillis, + tokenType, + } = microsoftDefenderEndpointConnectorMocks.createConnectorToken(); + await connectorTokenManagerClientMock.create({ + connectorId, + token, + expiresAtMillis, + tokenType, + }); + await msOAuthManagerMock.get(testMock.usageCollector); - it('should use cached token when one exists', async () => { - const { - connectorId, - token, - expiresAt: expiresAtMillis, - tokenType, - } = microsoftDefenderEndpointConnectorMocks.createConnectorToken(); - await connectorTokenManagerClientMock.create({ - connectorId, - token, - expiresAtMillis, - tokenType, + expect(testMock.instanceMock.request).not.toHaveBeenCalled(); + expect(connectorTokenManagerClientMock.get).toHaveBeenCalledWith({ + connectorId: '1', + tokenType: 'access_token', + }); }); - await msOAuthManagerMock.get(testMock.usageCollector); - expect(testMock.instanceMock.request).not.toHaveBeenCalled(); - expect(connectorTokenManagerClientMock.get).toHaveBeenCalledWith({ - connectorId: '1', - tokenType: 'access_token', + it('should call MS API to generate new token when the cached token is expired', async () => { + const { connectorId, token, tokenType } = + microsoftDefenderEndpointConnectorMocks.createConnectorToken(); + await connectorTokenManagerClientMock.create({ + connectorId, + token, + expiresAtMillis: '2024-01-16T13:02:43.494Z', + tokenType, + }); + await msOAuthManagerMock.get(testMock.usageCollector); + + expect(connectorTokenManagerClientMock.get).toHaveBeenCalledWith({ + connectorId: '1', + tokenType: 'access_token', + }); + expect(testMock.instanceMock.request).toHaveBeenCalledWith( + expect.objectContaining({ + url: `${testMock.options.config.oAuthServerUrl}/${testMock.options.config.tenantId}/oauth2/v2.0/token`, + }), + testMock.usageCollector + ); }); }); - it('should call MS API to generate new token when the cached token is expired', async () => { - const { connectorId, token, tokenType } = - microsoftDefenderEndpointConnectorMocks.createConnectorToken(); - await connectorTokenManagerClientMock.create({ - connectorId, - token, - expiresAtMillis: '2024-01-16T13:02:43.494Z', - tokenType, + describe('#generateNew()', () => { + it('should call microsoft api to get new token', async () => { + await msOAuthManagerMock.generateNew(testMock.usageCollector); + + expect(testMock.instanceMock.request).toHaveBeenCalledWith( + expect.objectContaining({ + url: `${testMock.options.config.oAuthServerUrl}/${testMock.options.config.tenantId}/oauth2/v2.0/token`, + }), + testMock.usageCollector + ); }); - await msOAuthManagerMock.get(testMock.usageCollector); - expect(connectorTokenManagerClientMock.get).toHaveBeenCalledWith({ - connectorId: '1', - tokenType: 'access_token', + it('should use stored token if it is different since the last time it was read', async () => { + await msOAuthManagerMock.get(testMock.usageCollector); + const { connectorId, tokenType } = + microsoftDefenderEndpointConnectorMocks.createConnectorToken(); + await connectorTokenManagerClientMock.create({ + connectorId, + token: 'different-token-here', + expiresAtMillis: '2050-01-16T13:02:43.494Z', + tokenType, + }); + connectorTokenManagerClientMock.get.mockClear(); + testMock.instanceMock.request.mockClear(); + await msOAuthManagerMock.generateNew(testMock.usageCollector); + + expect(connectorTokenManagerClientMock.get).toHaveBeenCalledTimes(1); + expect(testMock.instanceMock.request).not.toHaveBeenCalled(); }); - expect(testMock.instanceMock.request).toHaveBeenCalledWith( - expect.objectContaining({ - url: `${testMock.options.config.oAuthServerUrl}/${testMock.options.config.tenantId}/oauth2/v2.0/token`, - }), - testMock.usageCollector - ); }); }); diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.ts index eb626ed1693e5..479e9c2aa5d67 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/microsoft_defender_endpoint/o_auth_token_manager.ts @@ -8,6 +8,7 @@ import { ServiceParams, SubActionConnector } from '@kbn/actions-plugin/server'; import { ConnectorUsageCollector } from '@kbn/actions-plugin/server/usage'; import { ConnectorToken } from '@kbn/actions-plugin/server/types'; +import type { Logger } from '@kbn/logging'; import { MicrosoftDefenderEndpointDoNotValidateResponseSchema } from '../../../common/microsoft_defender_endpoint/schema'; import { MicrosoftDefenderEndpointConfig, @@ -22,6 +23,8 @@ export class OAuthTokenManager { // `ConnectorTokenClient.updateOrCreate()` method, which hardcodes the `tokenType` private readonly tokenType = 'access_token'; private generatingNewTokenPromise: Promise<void> | null = null; + private reGenerateNewTokenPromise: Promise<void> | null = null; + protected logger: Logger; constructor( private readonly params: ServiceParams< @@ -34,6 +37,7 @@ export class OAuthTokenManager { >['request']; } ) { + this.logger = params.logger.get('microsoftDefenderOAuthTokenManager'); const url = new URL(params.config.oAuthServerUrl); url.pathname = `/${params.config.tenantId}/oauth2/v2.0/token`; this.oAuthTokenUrl = url.toString(); @@ -46,114 +50,139 @@ export class OAuthTokenManager { const isExpired = token.expiresAt < now.toISOString(); if (isExpired) { - this.params.logger.debug(`Cached access token expired at [${token.expiresAt}]`); + this.logger.debug(`Cached access token expired at [${token.expiresAt}]`); } return isExpired; } + private async fetchAndStoreNewToken( + connectorUsageCollector: ConnectorUsageCollector + ): Promise<MicrosoftDefenderEndpointApiTokenResponse> { + const { + connector: { id: connectorId }, + } = this.params; + const logger = this.logger; + const connectorTokenClient = this.params.services.connectorTokenClient; + + logger.debug(`Requesting a new Microsoft access token for connector id [${connectorId}]]`); + + // FYI: API Docs: https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-client-creds-grant-flow#get-a-token + const { oAuthScope, clientId } = this.params.config; + const tokenRequestDate = Date.now(); + const newToken = await this.params.apiRequest<MicrosoftDefenderEndpointApiTokenResponse>( + { + url: this.oAuthTokenUrl, + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + data: { + grant_type: 'client_credentials', + client_id: clientId, + scope: oAuthScope, + client_secret: this.params.secrets.clientSecret, + }, + responseSchema: MicrosoftDefenderEndpointDoNotValidateResponseSchema, + }, + connectorUsageCollector + ); + + logger.debug( + () => + `Successfully created an access token for Microsoft Defend for Endpoint:\n${JSON.stringify({ + ...newToken.data, + access_token: '[REDACTED]', + })}` + ); + + await connectorTokenClient.updateOrReplace({ + connectorId, + tokenRequestDate, + deleteExisting: true, + token: this.connectorToken, + newToken: newToken.data.access_token, + expiresInSec: newToken.data.expires_in, + }); + + return newToken.data; + } + private async retrieveOrGenerateNewTokenIfNeeded( connectorUsageCollector: ConnectorUsageCollector ): Promise<void> { if (this.generatingNewTokenPromise) { + this.logger.debug(`Returning pending retrieval of access token`); return await this.generatingNewTokenPromise; } - this.generatingNewTokenPromise = (async () => { - const { - connector: { id: connectorId }, - logger, - } = this.params; - const connectorTokenClient = this.params.services.connectorTokenClient; + this.generatingNewTokenPromise = new Promise(async (resolve, reject) => { + try { + const { + connector: { id: connectorId }, + } = this.params; + const logger = this.logger; + const connectorTokenClient = this.params.services.connectorTokenClient; + + if (!this.connectorToken) { + logger.debug(`Retrieving cached connector access token (if any)`); + + const cachedToken = await connectorTokenClient.get({ + connectorId, + tokenType: this.tokenType, + }); + + if (cachedToken.connectorToken) { + this.connectorToken = cachedToken.connectorToken; + + const logToken = { + ...this.connectorToken, + token: '[redacted]', + }; + + logger.debug(() => `Found cached access token:\n${JSON.stringify(logToken, null, 2)}`); + } else { + logger.debug(`No cached access token found`); + } + } + + if (this.connectorToken && !this.isTokenExpired(this.connectorToken)) { + logger.debug('Cached token is not expired - no need to request a new one'); + resolve(); + return; + } - if (!this.connectorToken) { - logger.debug(`Retrieving cached connector access token (if any)`); + await this.fetchAndStoreNewToken(connectorUsageCollector); - const cachedToken = await connectorTokenClient.get({ + const updatedCachedToken = await connectorTokenClient.get({ connectorId, tokenType: this.tokenType, }); - if (cachedToken.connectorToken) { - this.connectorToken = cachedToken.connectorToken; - - const logToken = { - ...this.connectorToken, - token: '[redacted]', - }; - - logger.debug(() => `using cached access token:\n${JSON.stringify(logToken, null, 2)}`); - } else { - logger.debug(`No cached access token found`); + if (!updatedCachedToken.connectorToken) { + throw new Error(`Failed to retrieve cached [${this.tokenType}] after it was updated.`); } - } - if (this.connectorToken && !this.isTokenExpired(this.connectorToken)) { - logger.debug('Cached token is not expired - no need to request a new one'); - return; - } + this.connectorToken = updatedCachedToken.connectorToken; - logger.debug(`Requesting a new Microsoft access token for connector id [${connectorId}]]`); - - // FYI: API Docs: https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-client-creds-grant-flow#get-a-token - const { oAuthScope, clientId } = this.params.config; - const tokenRequestDate = Date.now(); - const newToken = await this.params.apiRequest<MicrosoftDefenderEndpointApiTokenResponse>( - { - url: this.oAuthTokenUrl, - method: 'POST', - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - data: { - grant_type: 'client_credentials', - client_id: clientId, - scope: oAuthScope, - client_secret: this.params.secrets.clientSecret, - }, - responseSchema: MicrosoftDefenderEndpointDoNotValidateResponseSchema, - }, - connectorUsageCollector - ); - - logger.debug( - () => - `Successfully created an access token for Microsoft Defend for Endpoint:\n${JSON.stringify( - { - ...newToken.data, - access_token: '[REDACTED]', - } - )}` - ); - - await connectorTokenClient.updateOrReplace({ - connectorId, - tokenRequestDate, - deleteExisting: true, - token: this.connectorToken, - newToken: newToken.data.access_token, - expiresInSec: newToken.data.expires_in, - }); - - const updatedCachedToken = await connectorTokenClient.get({ - connectorId, - tokenType: this.tokenType, - }); - - if (!updatedCachedToken.connectorToken) { - throw new Error(`Failed to retrieve cached [${this.tokenType}] after it was updated.`); + resolve(undefined); + } catch (error) { + reject(error); } + }); - this.connectorToken = updatedCachedToken.connectorToken; - })().finally(() => { + return await this.generatingNewTokenPromise.then(() => { this.generatingNewTokenPromise = null; }); - - return this.generatingNewTokenPromise; } /** * Returns the Bearer token that should be used in API calls */ public async get(connectorUsageCollector: ConnectorUsageCollector): Promise<string> { + if (this.reGenerateNewTokenPromise) { + this.logger.debug(`Waiting for pending token re-generation to complete before retrieving it`); + await this.reGenerateNewTokenPromise; + } + await this.retrieveOrGenerateNewTokenIfNeeded(connectorUsageCollector); if (!this.connectorToken) { @@ -162,4 +191,65 @@ export class OAuthTokenManager { return this.connectorToken.token; } + + /** + * Forces a new token to be generated by calling the Microsoft API, regardless if the existing + * one is expired or not. This method can be called multiple times, but it will only perform + * a token re-generation once per class instance (there should be no need to do it more than once) + */ + public async generateNew(connectorUsageCollector: ConnectorUsageCollector): Promise<void> { + if (this.reGenerateNewTokenPromise) { + this.logger.debug(`A request to generate a new token has already been requested!`); + return await this.reGenerateNewTokenPromise; + } + + this.reGenerateNewTokenPromise = new Promise(async (resolve, reject) => { + try { + const connectorTokenClient = this.params.services.connectorTokenClient; + + if (this.generatingNewTokenPromise) { + this.logger.debug( + `Waiting for current new token retrieval/generate to complete before performing proceeding with generating new one` + ); + await this.generatingNewTokenPromise; + } + + // First check if the token was already updated by another instance of the connector and if so, then do nothing + if (this.connectorToken) { + const currentToken = this.connectorToken.token; + const latestStoredToken = await connectorTokenClient.get({ + connectorId: this.params.connector.id, + tokenType: this.tokenType, + }); + + if ( + latestStoredToken.connectorToken && + latestStoredToken.connectorToken.token !== currentToken + ) { + this.logger.debug( + `Token has been updated since it was last read. Using it instead of generating a new one.\n${JSON.stringify( + { + ...latestStoredToken.connectorToken, + token: '[redacted]', + }, + null, + 2 + )}` + ); + this.connectorToken = latestStoredToken.connectorToken; + return resolve(undefined); + } + } + + await this.fetchAndStoreNewToken(connectorUsageCollector); + this.connectorToken = null; + + resolve(undefined); + } catch (error) { + reject(error); + } + }); + + await this.reGenerateNewTokenPromise; + } } From 188823e97273762e330b0dea5cc24aa75c529356 Mon Sep 17 00:00:00 2001 From: Shahzad <shahzad31comp@gmail.com> Date: Tue, 28 Jan 2025 22:08:43 +0100 Subject: [PATCH 19/26] Remove unused eslint rule !! (#208508) ## Summary We created a new plugin for uptime code so this eslint rule is not valid anymore and is not being used !! --- .eslintrc.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d209e9631baed..98a33bce61b12 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1019,21 +1019,6 @@ module.exports = { ], }, }, - { - // disable imports from legacy uptime plugin - files: [ - 'x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/**/*.{js,mjs,ts,tsx}', - ], - rules: { - 'no-restricted-imports': [ - 'error', - { - patterns: ['**/legacy_uptime/*'], - paths: RESTRICTED_IMPORTS, - }, - ], - }, - }, { files: [ 'x-pack/solutions/observability/plugins/apm/**/*.{js,mjs,ts,tsx}', From 8ba217909651c2539c0e0d46ef411b4e0992be8b Mon Sep 17 00:00:00 2001 From: Hannah Mudge <Heenawter@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:17:33 -0700 Subject: [PATCH 20/26] [`kbn-grid-layout`] Remove use of `fr` unit (#208437) Closes https://github.com/elastic/kibana/issues/208305 ## Summary This PR is a better solution for the issue described in https://github.com/elastic/kibana/pull/208247. In that PR, we found that the drag preview was causing panels to resize unnecessarily at seemingly random occurrences, which was causing huge lag spikes and errors to be thrown. While making the drag preview absolute positioned did resolve that problem, it caused other issues (such as [this one](https://github.com/elastic/kibana/issues/208305)) because the drag preview no longer took up height in the parent. Therefore, we decided to revisit this and, upon further investigation, we found that the resize observers were **specifically** firing whenever the viewport has a width that cannot be evenly divided into 48 columns, which causes inconsistent rounding of pixels for each column on render. The reason the drag preview in particular made this issue more apparent is because, when rendering it as a `block`, it is causing the DOM to repaint as it changes target column + row - which then caused the CSS grid columns to "flicker" between widths that differed by less than half a pixel. In the following GIF, you can see this flicker in the panel widths as I drag another panel around: ![Jan-27-2025 12-28-57](https://github.com/user-attachments/assets/e19aacab-c43a-4541-aa57-b260da0cf4c9) This then repeatedly triggered `resizeObservers` for panels that had them. Instead of relying on the `fr` unit, which is giving us inconsistent column widths as shown above (most likely due to a rounding bug with the `fr` unit in Chrome, since it works fine in Firefox), I have instead migrated to a more static way of calculating `grid-template-columns` by simply subtracting the pixels that the gutters take up from `100%` in order to determine the width of a column. This still resolves the resize observer problem, but it does so while still allowing the drag preview to be rendered as a block. ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../private/kbn-grid-layout/grid/drag_preview.tsx | 9 ++++----- .../private/kbn-grid-layout/grid/grid_row/grid_row.tsx | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/platform/packages/private/kbn-grid-layout/grid/drag_preview.tsx b/src/platform/packages/private/kbn-grid-layout/grid/drag_preview.tsx index 13ddcab610cf5..4594df315d265 100644 --- a/src/platform/packages/private/kbn-grid-layout/grid/drag_preview.tsx +++ b/src/platform/packages/private/kbn-grid-layout/grid/drag_preview.tsx @@ -39,10 +39,10 @@ export const DragPreview = ({ } else { const panel = proposedGridLayout[rowIndex].panels[activePanel.id]; dragPreviewRef.current.style.display = 'block'; - dragPreviewRef.current.style.height = `calc(1px * (${panel.height} * (var(--kbnGridRowHeight) + var(--kbnGridGutterSize)) - var(--kbnGridGutterSize)))`; - dragPreviewRef.current.style.width = `calc(1px * (${panel.width} * (var(--kbnGridColumnWidth) + var(--kbnGridGutterSize)) - var(--kbnGridGutterSize)))`; - dragPreviewRef.current.style.top = `calc(1px * (${panel.row} * (var(--kbnGridRowHeight) + var(--kbnGridGutterSize))))`; - dragPreviewRef.current.style.left = `calc(1px * (${panel.column} * (var(--kbnGridColumnWidth) + var(--kbnGridGutterSize))))`; + dragPreviewRef.current.style.gridColumnStart = `${panel.column + 1}`; + dragPreviewRef.current.style.gridColumnEnd = `${panel.column + 1 + panel.width}`; + dragPreviewRef.current.style.gridRowStart = `${panel.row + 1}`; + dragPreviewRef.current.style.gridRowEnd = `${panel.row + 1 + panel.height}`; } }); @@ -61,7 +61,6 @@ export const DragPreview = ({ css={css` display: none; pointer-events: none; - position: absolute; `} /> ); diff --git a/src/platform/packages/private/kbn-grid-layout/grid/grid_row/grid_row.tsx b/src/platform/packages/private/kbn-grid-layout/grid/grid_row/grid_row.tsx index 1afe78cc33306..6e0d0ff87c9a5 100644 --- a/src/platform/packages/private/kbn-grid-layout/grid/grid_row/grid_row.tsx +++ b/src/platform/packages/private/kbn-grid-layout/grid/grid_row/grid_row.tsx @@ -46,7 +46,10 @@ export const GridRow = ({ const { columnCount } = gridLayoutStateManager.runtimeSettings$.getValue(); return css` grid-auto-rows: calc(var(--kbnGridRowHeight) * 1px); - grid-template-columns: repeat(${columnCount}, minmax(0, 1fr)); + grid-template-columns: repeat( + ${columnCount}, + calc((100% - (var(--kbnGridGutterSize) * ${columnCount - 1}px)) / ${columnCount}) + ); gap: calc(var(--kbnGridGutterSize) * 1px); `; }, [gridLayoutStateManager]); From dcf64f2eb6a557a4d4eced9791d482820c781449 Mon Sep 17 00:00:00 2001 From: Nathan Reese <reese.nathan@elastic.co> Date: Tue, 28 Jan 2025 14:58:23 -0700 Subject: [PATCH 21/26] [dashboard] refactor EditorMenu to AddPanelButton (#208226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR refactors `EditorMenu` component into `AddPanelButton` to provide better naming scheme and simplify logic. * replace `COMMON_VISUALIZATION_GROUPING` with `ADD_PANEL_VISUALIZATION_GROUP`. Moved from visualizations plugin to embeddable plugin. * rename `EditorMenu` => `AddPanelButton` * rename `DashboardPanelSelectionListFlyout` => `AddPanelFlyout` * remove unused style `dshSolutionToolbar__editorContextMenu` from editor_menu.scss * Simplify loading of `AddPanelFlyout` contents. Replaced `useGetDashboardPanels` hook with `getMenuItemGroups` function. * avoid loading `AddPanelFlyout` contents until `AddPanelButton` is clicked. `DashboardEditingToolbar` component used to setup `useGetDashboardPanels` hook. Now `AddPanelFlyout` loads contents by directly calling `getMenuItemGroups`. * Added loading state to `AddPanelFlyout` <img width="600" alt="Screenshot 2025-01-24 at 9 21 05 AM" src="https://github.com/user-attachments/assets/b2dfde5f-e347-4745-9ee0-b3268e2138c2" /> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com> --- .../public/embeddable/embeddable_module.ts} | 4 +- .../add_panel_action_menu_items.test.ts | 116 ------- .../add_panel_action_menu_items.ts | 118 ------- .../dashboard_panel_selection_flyout.test.tsx | 109 ------- .../dashboard_panel_selection_flyout.tsx | 293 ------------------ .../use_get_dashboard_panels.test.ts | 218 ------------- .../add_new_panel/use_get_dashboard_panels.ts | 210 ------------- .../components/add_panel_button.tsx | 66 ++++ .../components/add_panel_flyout.test.tsx | 98 ++++++ .../components/add_panel_flyout.tsx | 177 +++++++++++ .../add_panel_button/components/group.tsx | 72 +++++ .../add_panel_button/components/groups.tsx | 37 +++ .../get_menu_item_groups.test.ts | 79 +++++ .../add_panel_button/get_menu_item_groups.ts | 134 ++++++++ .../navigate_to_vis_editor.ts | 56 ++++ .../top_nav/add_panel_button/types.ts | 30 ++ .../top_nav/dashboard_editing_toolbar.tsx | 68 +--- .../dashboard_app/top_nav/editor_menu.scss | 6 - .../top_nav/editor_menu.test.tsx | 31 -- .../dashboard_app/top_nav/editor_menu.tsx | 92 ------ .../plugins/shared/dashboard/tsconfig.json | 3 +- .../plugins/shared/embeddable/public/index.ts | 1 + .../public/ui_actions/add_panel_groups.ts | 12 + .../shared/visualizations/public/index.ts | 1 - .../public/legacy/embeddable/constants.ts | 26 -- .../public/legacy/embeddable/index.ts | 2 +- .../embeddable/visualize_embeddable.tsx | 2 +- .../translations/translations/fr-FR.json | 1 - .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - .../open_lens_config/create_action.tsx | 4 +- 31 files changed, 780 insertions(+), 1288 deletions(-) rename src/platform/plugins/{shared/dashboard/public/dashboard_app/top_nav/add_new_panel/index.ts => private/links/public/embeddable/embeddable_module.ts} (75%) delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.test.ts delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.ts delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.test.tsx delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.tsx delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.test.ts delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.ts create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_button.tsx create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.test.tsx create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.tsx create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/group.tsx create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/groups.tsx create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.test.ts create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.ts create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/navigate_to_vis_editor.ts create mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/types.ts delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.scss delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx delete mode 100644 src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.tsx delete mode 100644 src/platform/plugins/shared/visualizations/public/legacy/embeddable/constants.ts diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/index.ts b/src/platform/plugins/private/links/public/embeddable/embeddable_module.ts similarity index 75% rename from src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/index.ts rename to src/platform/plugins/private/links/public/embeddable/embeddable_module.ts index a72a3112aeba1..04dc3245ef73d 100644 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/index.ts +++ b/src/platform/plugins/private/links/public/embeddable/embeddable_module.ts @@ -7,5 +7,5 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { useGetDashboardPanels } from './use_get_dashboard_panels'; -export { DashboardPanelSelectionListFlyout } from './dashboard_panel_selection_flyout'; +export { getLinksEmbeddableFactory } from './links_embeddable'; +export { deserializeLinksSavedObject } from '../lib/deserialize_from_library'; diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.test.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.test.ts deleted file mode 100644 index daf6a4fc036fd..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.test.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { getMockPresentationContainer } from '@kbn/presentation-containers/mocks'; -import { getAddPanelActionMenuItemsGroup } from './add_panel_action_menu_items'; - -describe('getAddPanelActionMenuItems', () => { - it('returns the items correctly', async () => { - const registeredActions = [ - { - id: 'ACTION_CREATE_ESQL_CHART', - type: 'ACTION_CREATE_ESQL_CHART', - getDisplayName: () => 'Action name', - getIconType: () => 'pencil', - getDisplayNameTooltip: () => 'Action tooltip', - isCompatible: () => Promise.resolve(true), - execute: jest.fn(), - }, - { - id: 'TEST_ACTION_01', - type: 'TEST_ACTION_01', - getDisplayName: () => 'Action name 01', - getIconType: () => 'pencil', - getDisplayNameTooltip: () => 'Action tooltip', - isCompatible: () => Promise.resolve(true), - execute: jest.fn(), - grouping: [ - { - id: 'groupedAddPanelAction', - getDisplayName: () => 'Custom group', - getIconType: () => 'logoElasticsearch', - }, - ], - }, - { - id: 'TEST_ACTION_02', - type: 'TEST_ACTION_02', - getDisplayName: () => 'Action name', - getDisplayNameTooltip: () => 'Action tooltip', - getIconType: () => undefined, - isCompatible: () => Promise.resolve(true), - execute: jest.fn(), - grouping: [ - { - id: 'groupedAddPanelAction', - getDisplayName: () => 'Custom group', - getIconType: () => 'logoElasticsearch', - }, - ], - }, - ]; - const grouped = getAddPanelActionMenuItemsGroup( - getMockPresentationContainer(), - registeredActions, - jest.fn() - ); - - expect(grouped).toStrictEqual({ - groupedAddPanelAction: { - id: 'groupedAddPanelAction', - title: 'Custom group', - order: 0, - 'data-test-subj': 'dashboardEditorMenu-groupedAddPanelActionGroup', - items: [ - { - 'data-test-subj': 'create-action-Action name 01', - icon: 'pencil', - id: 'TEST_ACTION_01', - name: 'Action name 01', - onClick: expect.any(Function), - description: 'Action tooltip', - order: 0, - }, - { - 'data-test-subj': 'create-action-Action name', - icon: 'empty', - id: 'TEST_ACTION_02', - name: 'Action name', - onClick: expect.any(Function), - description: 'Action tooltip', - order: 0, - }, - ], - }, - other: { - id: 'other', - title: 'Other', - order: -1, - 'data-test-subj': 'dashboardEditorMenu-otherGroup', - items: [ - { - id: 'ACTION_CREATE_ESQL_CHART', - name: 'Action name', - icon: 'pencil', - description: 'Action tooltip', - onClick: expect.any(Function), - 'data-test-subj': 'create-action-Action name', - order: 0, - }, - ], - }, - }); - }); - - it('returns empty array if no actions have been registered', async () => { - const grouped = getAddPanelActionMenuItemsGroup(getMockPresentationContainer(), [], jest.fn()); - - expect(grouped).toStrictEqual({}); - }); -}); diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.ts deleted file mode 100644 index fe1d1e73e5a96..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/add_panel_action_menu_items.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - type ActionExecutionContext, - type Action, - addPanelMenuTrigger, -} from '@kbn/ui-actions-plugin/public'; -import { PresentationContainer } from '@kbn/presentation-containers'; -import { ADD_PANEL_OTHER_GROUP } from '@kbn/embeddable-plugin/public'; -import type { IconType, CommonProps } from '@elastic/eui'; -import React, { type MouseEventHandler } from 'react'; - -export interface PanelSelectionMenuItem extends Pick<CommonProps, 'data-test-subj'> { - id: string; - name: string; - icon: IconType; - onClick: MouseEventHandler; - description?: string; - isDisabled?: boolean; - isDeprecated?: boolean; - order: number; -} - -export type GroupedAddPanelActions = Pick< - PanelSelectionMenuItem, - 'id' | 'isDisabled' | 'data-test-subj' | 'order' -> & { - title: string; - items: PanelSelectionMenuItem[]; -}; - -const onAddPanelActionClick = - (action: Action, context: ActionExecutionContext<object>, closePopover: () => void) => - (event: React.MouseEvent) => { - closePopover(); - if (event.currentTarget instanceof HTMLAnchorElement) { - if ( - !event.defaultPrevented && // onClick prevented default - event.button === 0 && - (!event.currentTarget.target || event.currentTarget.target === '_self') && - !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) - ) { - event.preventDefault(); - action.execute(context); - } - } else action.execute(context); - }; - -export const getAddPanelActionMenuItemsGroup = ( - api: PresentationContainer, - actions: Array<Action<object>> | undefined, - onPanelSelected: () => void -) => { - const grouped: Record<string, GroupedAddPanelActions> = {}; - - const context = { - embeddable: api, - trigger: addPanelMenuTrigger, - }; - - const getMenuItem = (item: Action<object>): PanelSelectionMenuItem => { - const actionName = item.getDisplayName(context); - - return { - id: item.id, - name: actionName, - icon: - (typeof item.getIconType === 'function' ? item.getIconType(context) : undefined) ?? 'empty', - onClick: onAddPanelActionClick(item, context, onPanelSelected), - 'data-test-subj': `create-action-${actionName}`, - description: item?.getDisplayNameTooltip?.(context), - order: item.order ?? 0, - }; - }; - - actions?.forEach((item) => { - if (Array.isArray(item.grouping)) { - item.grouping.forEach((group) => { - const groupId = group.id; - if (!grouped[groupId]) { - grouped[groupId] = { - id: groupId, - title: group.getDisplayName ? group.getDisplayName(context) : '', - 'data-test-subj': `dashboardEditorMenu-${groupId}Group`, - order: group.order ?? 0, - items: [], - }; - } - - grouped[group.id]!.items!.push(getMenuItem(item)); - }); - } else { - // use other group as the default for definitions that don't have a group - const fallbackGroup = ADD_PANEL_OTHER_GROUP; - - if (!grouped[fallbackGroup.id]) { - grouped[fallbackGroup.id] = { - id: fallbackGroup.id, - title: fallbackGroup.getDisplayName?.() || '', - 'data-test-subj': `dashboardEditorMenu-${fallbackGroup.id}Group`, - order: fallbackGroup.order || 0, - items: [], - }; - } - - grouped[fallbackGroup.id].items.push(getMenuItem(item)); - } - }); - - return grouped; -}; diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.test.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.test.tsx deleted file mode 100644 index 20c7cb3a61bf8..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.test.tsx +++ /dev/null @@ -1,109 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { type ComponentProps } from 'react'; -import { render, screen, fireEvent } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { DashboardPanelSelectionListFlyout } from './dashboard_panel_selection_flyout'; -import type { GroupedAddPanelActions } from './add_panel_action_menu_items'; - -const defaultProps: Omit< - ComponentProps<typeof DashboardPanelSelectionListFlyout>, - 'fetchDashboardPanels' -> = { - close: jest.fn(), - paddingSize: 's', -}; - -const renderComponent = ({ - fetchDashboardPanels, -}: Pick<ComponentProps<typeof DashboardPanelSelectionListFlyout>, 'fetchDashboardPanels'>) => - render( - <IntlProvider locale="en"> - <DashboardPanelSelectionListFlyout - {...defaultProps} - fetchDashboardPanels={fetchDashboardPanels} - /> - </IntlProvider> - ); - -const panelConfiguration: GroupedAddPanelActions[] = [ - { - id: 'panel1', - title: 'App 1', - items: [ - { - icon: 'icon1', - id: 'mockFactory', - name: 'Factory 1', - description: 'Factory 1 description', - 'data-test-subj': 'createNew-mockFactory', - onClick: jest.fn(), - order: 0, - }, - ], - order: 10, - 'data-test-subj': 'dashboardEditorMenu-group1Group', - }, -]; - -describe('DashboardPanelSelectionListFlyout', () => { - it('renders a loading indicator when fetchDashboardPanel has not yielded any value', async () => { - const promiseDelay = 5000; - - renderComponent({ - fetchDashboardPanels: jest.fn( - () => - new Promise((resolve) => { - setTimeout(() => resolve(panelConfiguration), promiseDelay); - }) - ), - }); - - expect( - await screen.findByTestId('dashboardPanelSelectionLoadingIndicator') - ).toBeInTheDocument(); - }); - - it('renders an error indicator when fetchDashboardPanel errors', async () => { - renderComponent({ - fetchDashboardPanels: jest.fn().mockRejectedValue(new Error('simulated error')), - }); - - expect(await screen.findByTestId('dashboardPanelSelectionErrorIndicator')).toBeInTheDocument(); - }); - - it('renders the list of available panels when fetchDashboardPanel resolves a value', async () => { - renderComponent({ fetchDashboardPanels: jest.fn().mockResolvedValue(panelConfiguration) }); - - expect(await screen.findByTestId(panelConfiguration[0]['data-test-subj']!)).toBeInTheDocument(); - }); - - it('renders a not found message when a user searches for an item that is not in the selection list', async () => { - renderComponent({ fetchDashboardPanels: jest.fn().mockResolvedValue(panelConfiguration) }); - - expect(await screen.findByTestId(panelConfiguration[0]['data-test-subj']!)).toBeInTheDocument(); - - await userEvent.type( - screen.getByTestId('dashboardPanelSelectionFlyout__searchInput'), - 'non existent panel' - ); - - expect(await screen.findByTestId('dashboardPanelSelectionNoPanelMessage')).toBeInTheDocument(); - }); - - it('invokes the close method when the flyout close btn is clicked', async () => { - renderComponent({ fetchDashboardPanels: jest.fn().mockResolvedValue(panelConfiguration) }); - - fireEvent.click(await screen.findByTestId('dashboardPanelSelectionCloseBtn')); - - expect(defaultProps.close).toHaveBeenCalled(); - }); -}); diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.tsx deleted file mode 100644 index e6adece8ab36d..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/dashboard_panel_selection_flyout.tsx +++ /dev/null @@ -1,293 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useEffect, useState } from 'react'; -import { i18n as i18nFn } from '@kbn/i18n'; -import { type EuiFlyoutProps, EuiLoadingChart } from '@elastic/eui'; -import orderBy from 'lodash/orderBy'; -import { - EuiEmptyPrompt, - EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiFlyoutBody, - EuiFlyoutFooter, - EuiFlyoutHeader, - EuiForm, - EuiBadge, - EuiFormRow, - EuiTitle, - EuiFieldSearch, - useEuiTheme, - EuiListGroup, - EuiListGroupItem, - EuiToolTip, - EuiText, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { - type PanelSelectionMenuItem, - type GroupedAddPanelActions, -} from './add_panel_action_menu_items'; - -export interface DashboardPanelSelectionListFlyoutProps { - /** Handler to close flyout */ - close: () => void; - /** Padding for flyout */ - paddingSize: Exclude<EuiFlyoutProps['paddingSize'], 'none' | undefined>; - /** Fetches the panels available for a dashboard */ - fetchDashboardPanels: () => Promise<GroupedAddPanelActions[]>; -} - -export const DashboardPanelSelectionListFlyout: React.FC< - DashboardPanelSelectionListFlyoutProps -> = ({ close, paddingSize, fetchDashboardPanels }) => { - const { euiTheme } = useEuiTheme(); - const [{ data: panels, loading, error }, setPanelState] = useState<{ - loading: boolean; - data: GroupedAddPanelActions[] | null; - error: unknown | null; - }>({ loading: true, data: null, error: null }); - - const [searchTerm, setSearchTerm] = useState<string>(''); - const [panelsSearchResult, setPanelsSearchResult] = useState<GroupedAddPanelActions[] | null>( - panels - ); - - useEffect(() => { - const requestDashboardPanels = () => { - fetchDashboardPanels() - .then((_panels) => - setPanelState((prevState) => ({ - ...prevState, - loading: false, - data: _panels, - })) - ) - .catch((err) => - setPanelState((prevState) => ({ - ...prevState, - loading: false, - error: err, - })) - ); - }; - - requestDashboardPanels(); - }, [fetchDashboardPanels]); - - useEffect(() => { - const _panels = (panels ?? []).slice(0); - - if (!searchTerm) { - return setPanelsSearchResult(_panels); - } - - const q = searchTerm.toLowerCase(); - - setPanelsSearchResult( - orderBy( - _panels.map((panel) => { - const groupSearchMatch = panel.title.toLowerCase().includes(q); - - const [groupSearchMatchAgg, items] = panel.items.reduce( - (acc, cur) => { - const searchMatch = cur.name.toLowerCase().includes(q); - - acc[0] = acc[0] || searchMatch; - acc[1].push({ - ...cur, - isDisabled: !(groupSearchMatch || searchMatch), - }); - - return acc; - }, - [groupSearchMatch, [] as PanelSelectionMenuItem[]] - ); - - return { - ...panel, - isDisabled: !groupSearchMatchAgg, - items, - }; - }), - ['isDisabled'] - ) - ); - }, [panels, searchTerm]); - - return ( - <> - <EuiFlyoutHeader hasBorder> - <EuiTitle size="s"> - <h1 id="addPanelsFlyout"> - <FormattedMessage - id="dashboard.solutionToolbar.addPanelFlyout.headingText" - defaultMessage="Add panel" - /> - </h1> - </EuiTitle> - </EuiFlyoutHeader> - <EuiFlyoutBody> - <EuiFlexGroup direction="column" responsive={false} gutterSize="m"> - <EuiFlexItem - grow={false} - css={{ - position: 'sticky', - top: euiTheme.size[paddingSize], - zIndex: 1, - boxShadow: `0 -${euiTheme.size[paddingSize]} 0 4px ${euiTheme.colors.emptyShade}`, - }} - > - <EuiForm component="form" fullWidth> - <EuiFormRow css={{ backgroundColor: euiTheme.colors.emptyShade }}> - <EuiFieldSearch - compressed - autoFocus - value={searchTerm} - onChange={(e) => { - setSearchTerm(e.target.value); - }} - aria-label={i18nFn.translate( - 'dashboard.editorMenu.addPanelFlyout.searchLabelText', - { defaultMessage: 'search field for panels' } - )} - className="nsPanelSelectionFlyout__searchInput" - data-test-subj="dashboardPanelSelectionFlyout__searchInput" - /> - </EuiFormRow> - </EuiForm> - </EuiFlexItem> - <EuiFlexItem - css={{ - minHeight: '20vh', - ...(loading || error - ? { - justifyContent: 'center', - alignItems: 'center', - } - : {}), - }} - > - {loading ? ( - <EuiEmptyPrompt - data-test-subj="dashboardPanelSelectionLoadingIndicator" - icon={<EuiLoadingChart size="l" mono />} - /> - ) : ( - <EuiFlexGroup - direction="column" - gutterSize="m" - data-test-subj="dashboardPanelSelectionList" - > - {panelsSearchResult?.some(({ isDisabled }) => !isDisabled) ? ( - panelsSearchResult.map( - ({ id, title, items, isDisabled, ['data-test-subj']: dataTestSubj, order }) => - !isDisabled ? ( - <EuiFlexItem - key={id} - data-test-subj={dataTestSubj} - data-group-sort-order={order} - > - <EuiTitle id={`${id}-group`} size="xxs"> - {typeof title === 'string' ? <h3>{title}</h3> : title} - </EuiTitle> - <EuiListGroup - aria-labelledby={`${id}-group`} - size="s" - gutterSize="none" - maxWidth={false} - flush - > - {items?.map((item, idx) => { - return ( - <EuiListGroupItem - key={`${id}.${idx}`} - label={ - <EuiToolTip position="right" content={item.description}> - {!item.isDeprecated ? ( - <EuiText size="s">{item.name}</EuiText> - ) : ( - <EuiFlexGroup wrap responsive={false} gutterSize="s"> - <EuiFlexItem grow={false}> - <EuiText size="s">{item.name}</EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiBadge color="warning"> - <FormattedMessage - id="dashboard.editorMenu.deprecatedTag" - defaultMessage="Deprecated" - /> - </EuiBadge> - </EuiFlexItem> - </EuiFlexGroup> - )} - </EuiToolTip> - } - onClick={item?.onClick} - iconType={item.icon} - data-test-subj={item['data-test-subj']} - isDisabled={item.isDisabled} - /> - ); - })} - </EuiListGroup> - </EuiFlexItem> - ) : null - ) - ) : ( - <> - {Boolean(error) ? ( - <EuiEmptyPrompt - iconType="warning" - iconColor="danger" - body={ - <EuiText size="s" textAlign="center"> - <FormattedMessage - id="dashboard.solutionToolbar.addPanelFlyout.loadingErrorDescription" - defaultMessage="An error occurred loading the available dashboard panels for selection" - /> - </EuiText> - } - data-test-subj="dashboardPanelSelectionErrorIndicator" - /> - ) : ( - <EuiText - size="s" - textAlign="center" - data-test-subj="dashboardPanelSelectionNoPanelMessage" - > - <FormattedMessage - id="dashboard.solutionToolbar.addPanelFlyout.noResultsDescription" - defaultMessage="No panel types found" - /> - </EuiText> - )} - </> - )} - </EuiFlexGroup> - )} - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlyoutBody> - <EuiFlyoutFooter> - <EuiFlexGroup justifyContent="spaceBetween"> - <EuiFlexItem grow={false}> - <EuiButtonEmpty onClick={close} data-test-subj="dashboardPanelSelectionCloseBtn"> - <FormattedMessage - id="dashboard.solutionToolbar.addPanelFlyout.cancelButtonText" - defaultMessage="Cancel" - /> - </EuiButtonEmpty> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlyoutFooter> - </> - ); -}; diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.test.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.test.ts deleted file mode 100644 index 7965403a6b01a..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.test.ts +++ /dev/null @@ -1,218 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ADD_PANEL_ANNOTATION_GROUP, ADD_PANEL_LEGACY_GROUP } from '@kbn/embeddable-plugin/public'; -import type { PresentationContainer } from '@kbn/presentation-containers'; -import type { Action, UiActionsService } from '@kbn/ui-actions-plugin/public'; -import { ADD_PANEL_TRIGGER } from '@kbn/ui-actions-plugin/public'; -import { - VisGroups, - VisTypeAlias, - VisualizationsStart, - type BaseVisType, -} from '@kbn/visualizations-plugin/public'; -import { renderHook } from '@testing-library/react'; - -import { uiActionsService, visualizationsService } from '../../../services/kibana_services'; -import { useGetDashboardPanels } from './use_get_dashboard_panels'; - -const mockApi = { addNewPanel: jest.fn() } as unknown as jest.Mocked<PresentationContainer>; - -describe('Get dashboard panels hook', () => { - const defaultHookProps: Parameters<typeof useGetDashboardPanels>[0] = { - api: mockApi, - createNewVisType: jest.fn(), - }; - - let compatibleTriggerActionsRequestSpy: jest.SpyInstance< - ReturnType<NonNullable<UiActionsService['getTriggerCompatibleActions']>> - >; - - let dashboardVisualizationGroupGetterSpy: jest.SpyInstance< - ReturnType<VisualizationsStart['getByGroup']> - >; - - let dashboardVisualizationAliasesGetterSpy: jest.SpyInstance< - ReturnType<VisualizationsStart['getAliases']> - >; - - beforeAll(() => { - compatibleTriggerActionsRequestSpy = jest.spyOn( - uiActionsService, - 'getTriggerCompatibleActions' - ); - dashboardVisualizationGroupGetterSpy = jest.spyOn(visualizationsService, 'getByGroup'); - dashboardVisualizationAliasesGetterSpy = jest.spyOn(visualizationsService, 'getAliases'); - }); - - beforeEach(() => { - compatibleTriggerActionsRequestSpy.mockResolvedValue([]); - dashboardVisualizationGroupGetterSpy.mockReturnValue([]); - dashboardVisualizationAliasesGetterSpy.mockReturnValue([]); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - describe('useGetDashboardPanels', () => { - it('hook return value is callable', () => { - const { result } = renderHook(() => useGetDashboardPanels(defaultHookProps)); - expect(result.current).toBeInstanceOf(Function); - }); - - it('returns a callable method that yields a cached result if invoked after a prior resolution', async () => { - const { result } = renderHook(() => useGetDashboardPanels(defaultHookProps)); - expect(result.current).toBeInstanceOf(Function); - - const firstInvocationResult = await result.current(jest.fn()); - - expect(compatibleTriggerActionsRequestSpy).toHaveBeenCalledWith(ADD_PANEL_TRIGGER, { - embeddable: expect.objectContaining(mockApi), - }); - - const secondInvocationResult = await result.current(jest.fn()); - - expect(firstInvocationResult).toStrictEqual(secondInvocationResult); - - expect(compatibleTriggerActionsRequestSpy).toHaveBeenCalledTimes(1); - }); - }); - - describe('augmenting ui action group items with dashboard visualization types', () => { - it.each([ - ['visualizations', VisGroups.PROMOTED], - [ADD_PANEL_LEGACY_GROUP.id, VisGroups.LEGACY], - [ADD_PANEL_ANNOTATION_GROUP.id, VisGroups.TOOLS], - ])( - 'includes in the ui action %s group, %s dashboard visualization group types', - async (uiActionGroupId, dashboardVisualizationGroupId) => { - const mockVisualizationsUiAction: Action<object> = { - id: `some-${uiActionGroupId}-action`, - type: '', - order: 10, - grouping: [ - { - id: uiActionGroupId, - order: 1000, - getDisplayName: jest.fn(), - getIconType: jest.fn(), - }, - ], - getDisplayName: jest.fn(() => `Some ${uiActionGroupId} visualization Action`), - getIconType: jest.fn(), - execute: jest.fn(), - isCompatible: jest.fn(() => Promise.resolve(true)), - }; - - const mockDashboardVisualizationType = { - name: dashboardVisualizationGroupId, - title: dashboardVisualizationGroupId, - order: 0, - description: `This is a dummy representation of a ${dashboardVisualizationGroupId} visualization.`, - icon: 'empty', - stage: 'production', - isDeprecated: false, - group: dashboardVisualizationGroupId, - titleInWizard: `Custom ${dashboardVisualizationGroupId} visualization`, - } as BaseVisType; - - compatibleTriggerActionsRequestSpy.mockResolvedValue([mockVisualizationsUiAction]); - - dashboardVisualizationGroupGetterSpy.mockImplementation((group) => { - if (group !== dashboardVisualizationGroupId) return []; - - return [mockDashboardVisualizationType]; - }); - - const { result } = renderHook(() => useGetDashboardPanels(defaultHookProps)); - expect(result.current).toBeInstanceOf(Function); - - expect(await result.current(jest.fn())).toStrictEqual( - expect.arrayContaining([ - expect.objectContaining({ - id: uiActionGroupId, - 'data-test-subj': `dashboardEditorMenu-${uiActionGroupId}Group`, - items: expect.arrayContaining([ - expect.objectContaining({ - // @ts-expect-error ignore passing the required context in this test - 'data-test-subj': `create-action-${mockVisualizationsUiAction.getDisplayName()}`, - }), - expect.objectContaining({ - 'data-test-subj': `visType-${mockDashboardVisualizationType.name}`, - }), - ]), - }), - ]) - ); - } - ); - - it('includes in the ui action visualization group dashboard visualization alias types', async () => { - const mockVisualizationsUiAction: Action<object> = { - id: 'some-vis-action', - type: '', - order: 10, - grouping: [ - { - id: 'visualizations', - order: 1000, - getDisplayName: jest.fn(), - getIconType: jest.fn(), - }, - ], - getDisplayName: jest.fn(() => 'Some visualization Action'), - getIconType: jest.fn(), - execute: jest.fn(), - isCompatible: jest.fn(() => Promise.resolve(true)), - }; - - const mockedAliasVisualizationType: VisTypeAlias = { - name: 'alias visualization', - title: 'Alias Visualization', - order: 0, - description: 'This is a dummy representation of aan aliased visualization.', - icon: 'empty', - stage: 'production', - isDeprecated: false, - }; - - compatibleTriggerActionsRequestSpy.mockResolvedValue([mockVisualizationsUiAction]); - - dashboardVisualizationAliasesGetterSpy.mockReturnValue([mockedAliasVisualizationType]); - - const { result } = renderHook(() => useGetDashboardPanels(defaultHookProps)); - expect(result.current).toBeInstanceOf(Function); - - expect(await result.current(jest.fn())).toStrictEqual( - expect.arrayContaining([ - expect.objectContaining({ - id: mockVisualizationsUiAction.grouping![0].id, - 'data-test-subj': `dashboardEditorMenu-${ - mockVisualizationsUiAction.grouping![0].id - }Group`, - items: expect.arrayContaining([ - expect.objectContaining({ - // @ts-expect-error ignore passing the required context in this test - 'data-test-subj': `create-action-${mockVisualizationsUiAction.getDisplayName()}`, - }), - expect.objectContaining({ - 'data-test-subj': `visType-${mockedAliasVisualizationType.name}`, - }), - ]), - }), - ]) - ); - }); - }); -}); diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.ts deleted file mode 100644 index 8d26c2a3b5708..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_new_panel/use_get_dashboard_panels.ts +++ /dev/null @@ -1,210 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useCallback, useMemo, useRef } from 'react'; -import { AsyncSubject, defer, from, lastValueFrom, map, type Subscription } from 'rxjs'; - -import { ADD_PANEL_ANNOTATION_GROUP, ADD_PANEL_LEGACY_GROUP } from '@kbn/embeddable-plugin/public'; -import { PresentationContainer } from '@kbn/presentation-containers'; -import { ADD_PANEL_TRIGGER } from '@kbn/ui-actions-plugin/public'; -import { VisGroups, type BaseVisType, type VisTypeAlias } from '@kbn/visualizations-plugin/public'; - -import { uiActionsService, visualizationsService } from '../../../services/kibana_services'; -import { - getAddPanelActionMenuItemsGroup, - type GroupedAddPanelActions, - type PanelSelectionMenuItem, -} from './add_panel_action_menu_items'; - -interface UseGetDashboardPanelsArgs { - api: PresentationContainer; - createNewVisType: (visType: BaseVisType | VisTypeAlias) => () => void; -} - -const sortGroupPanelsByOrder = <T extends { order: number }>(panelGroups: T[]): T[] => { - return panelGroups.sort( - // larger number sorted to the top - (panelGroupA, panelGroupB) => panelGroupB.order - panelGroupA.order - ); -}; - -export const useGetDashboardPanels = ({ api, createNewVisType }: UseGetDashboardPanelsArgs) => { - const panelsComputeResultCache = useRef(new AsyncSubject<GroupedAddPanelActions[]>()); - const panelsComputeSubscription = useRef<Subscription | null>(null); - - const getSortedVisTypesByGroup = (group: VisGroups) => - visualizationsService - .getByGroup(group) - .sort((a: BaseVisType | VisTypeAlias, b: BaseVisType | VisTypeAlias) => { - const labelA = 'titleInWizard' in a ? a.titleInWizard || a.title : a.title; - const labelB = 'titleInWizard' in b ? b.titleInWizard || a.title : a.title; - if (labelA < labelB) { - return -1; - } - if (labelA > labelB) { - return 1; - } - return 0; - }) - .filter(({ disableCreate }: BaseVisType) => !disableCreate); - - const promotedVisTypes = getSortedVisTypesByGroup(VisGroups.PROMOTED); - const toolVisTypes = getSortedVisTypesByGroup(VisGroups.TOOLS); - const legacyVisTypes = getSortedVisTypesByGroup(VisGroups.LEGACY); - - const visTypeAliases = visualizationsService - .getAliases() - .sort(({ promotion: a = false }: VisTypeAlias, { promotion: b = false }: VisTypeAlias) => - a === b ? 0 : a ? -1 : 1 - ) - .filter(({ disableCreate }: VisTypeAlias) => !disableCreate); - - const augmentedCreateNewVisType = useCallback( - (visType: Parameters<typeof createNewVisType>[0], cb: () => void) => { - const visClickHandler = createNewVisType(visType); - return () => { - visClickHandler(); - cb(); - }; - }, - [createNewVisType] - ); - - const getVisTypeMenuItem = useCallback( - (onClickCb: () => void, visType: BaseVisType): PanelSelectionMenuItem => { - const { - name, - title, - titleInWizard, - description, - icon = 'empty', - isDeprecated, - order, - } = visType; - return { - id: name, - name: titleInWizard || title, - isDeprecated, - icon, - onClick: augmentedCreateNewVisType(visType, onClickCb), - 'data-test-subj': `visType-${name}`, - description, - order, - }; - }, - [augmentedCreateNewVisType] - ); - - const getVisTypeAliasMenuItem = useCallback( - (onClickCb: () => void, visTypeAlias: VisTypeAlias): PanelSelectionMenuItem => { - const { name, title, description, icon = 'empty', order } = visTypeAlias; - - return { - id: name, - name: title, - icon, - onClick: augmentedCreateNewVisType(visTypeAlias, onClickCb), - 'data-test-subj': `visType-${name}`, - description, - order: order ?? 0, - }; - }, - [augmentedCreateNewVisType] - ); - - const addPanelAction$ = useMemo( - () => - defer(() => { - return from( - uiActionsService.getTriggerCompatibleActions?.(ADD_PANEL_TRIGGER, { - embeddable: api, - }) ?? [] - ); - }), - [api] - ); - - const computeAvailablePanels = useCallback( - (onPanelSelected: () => void) => { - if (!panelsComputeSubscription.current) { - panelsComputeSubscription.current = addPanelAction$ - .pipe( - map((addPanelActions) => - getAddPanelActionMenuItemsGroup(api, addPanelActions, onPanelSelected) - ), - map((groupedAddPanelAction) => { - return sortGroupPanelsByOrder<GroupedAddPanelActions>( - Object.values(groupedAddPanelAction) - ).map((panelGroup) => { - switch (panelGroup.id) { - case 'visualizations': { - return { - ...panelGroup, - items: sortGroupPanelsByOrder<PanelSelectionMenuItem>( - (panelGroup.items ?? []).concat( - // TODO: actually add grouping to vis type alias so we wouldn't randomly display an unintended item - visTypeAliases.map(getVisTypeAliasMenuItem.bind(null, onPanelSelected)), - promotedVisTypes.map(getVisTypeMenuItem.bind(null, onPanelSelected)) - ) - ), - }; - } - case ADD_PANEL_LEGACY_GROUP.id: { - return { - ...panelGroup, - items: sortGroupPanelsByOrder<PanelSelectionMenuItem>( - (panelGroup.items ?? []).concat( - legacyVisTypes.map(getVisTypeMenuItem.bind(null, onPanelSelected)) - ) - ), - }; - } - case ADD_PANEL_ANNOTATION_GROUP.id: { - return { - ...panelGroup, - items: sortGroupPanelsByOrder<PanelSelectionMenuItem>( - (panelGroup.items ?? []).concat( - toolVisTypes.map(getVisTypeMenuItem.bind(null, onPanelSelected)) - ) - ), - }; - } - default: { - return { - ...panelGroup, - items: sortGroupPanelsByOrder(panelGroup.items), - }; - } - } - }); - }) - ) - .subscribe(panelsComputeResultCache.current); - } - }, - [ - api, - addPanelAction$, - getVisTypeMenuItem, - getVisTypeAliasMenuItem, - toolVisTypes, - legacyVisTypes, - promotedVisTypes, - visTypeAliases, - ] - ); - - return useCallback( - (...args: Parameters<typeof computeAvailablePanels>) => { - computeAvailablePanels(...args); - return lastValueFrom(panelsComputeResultCache.current.asObservable()); - }, - [computeAvailablePanels] - ); -}; diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_button.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_button.tsx new file mode 100644 index 0000000000000..d5e384864539c --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_button.tsx @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React, { useEffect, useCallback } from 'react'; + +import { i18n } from '@kbn/i18n'; +import { toMountPoint } from '@kbn/react-kibana-mount'; +import { ToolbarButton } from '@kbn/shared-ux-button-toolbar'; + +import { AddPanelFlyout } from './add_panel_flyout'; +import { useDashboardApi } from '../../../../dashboard_api/use_dashboard_api'; +import { coreServices } from '../../../../services/kibana_services'; + +export const AddPanelButton = ({ isDisabled }: { isDisabled?: boolean }) => { + const dashboardApi = useDashboardApi(); + + useEffect(() => { + // ensure opened overlays are closed if a navigation event happens + return () => { + dashboardApi.clearOverlays(); + }; + }, [dashboardApi]); + + const openFlyout = useCallback(() => { + const overlayRef = coreServices.overlays.openFlyout( + toMountPoint( + React.createElement(function () { + return <AddPanelFlyout dashboardApi={dashboardApi} />; + }), + coreServices + ), + { + size: 'm', + maxWidth: 500, + paddingSize: 'm', + 'aria-labelledby': 'addPanelsFlyout', + 'data-test-subj': 'dashboardPanelSelectionFlyout', + onClose() { + dashboardApi.clearOverlays(); + overlayRef.close(); + }, + } + ); + + dashboardApi.openOverlay(overlayRef); + }, [dashboardApi]); + + return ( + <ToolbarButton + data-test-subj="dashboardEditorMenuButton" + isDisabled={isDisabled} + iconType="plusInCircle" + label={i18n.translate('dashboard.solutionToolbar.editorMenuButtonLabel', { + defaultMessage: 'Add panel', + })} + onClick={openFlyout} + size="s" + /> + ); +}; diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.test.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.test.tsx new file mode 100644 index 0000000000000..0691fd602bf7e --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.test.tsx @@ -0,0 +1,98 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { render, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; +import { AddPanelFlyout } from './add_panel_flyout'; +import { DashboardApi } from '../../../../dashboard_api/types'; + +jest.mock('../get_menu_item_groups', () => ({})); + +const mockDashboardApi = {} as unknown as DashboardApi; + +describe('AddPanelFlyout', () => { + describe('getMenuItemGroups throws', () => { + beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../get_menu_item_groups').getMenuItemGroups = async () => { + throw new Error('simulated getMenuItemGroups error'); + }; + }); + + test('displays getMenuItemGroups error', async () => { + render( + <IntlProvider locale="en"> + <AddPanelFlyout dashboardApi={mockDashboardApi} /> + </IntlProvider> + ); + + await waitFor(() => { + screen.getByTestId('dashboardPanelSelectionErrorIndicator'); + }); + }); + }); + + describe('getMenuItemGroups returns results', () => { + const onClickMock = jest.fn(); + beforeEach(() => { + onClickMock.mockClear(); + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../get_menu_item_groups').getMenuItemGroups = async () => [ + { + id: 'panel1', + title: 'App 1', + items: [ + { + icon: 'icon1', + id: 'mockFactory', + name: 'Factory 1', + description: 'Factory 1 description', + 'data-test-subj': 'myItem', + onClick: onClickMock, + order: 0, + }, + ], + order: 10, + 'data-test-subj': 'dashboardEditorMenu-group1Group', + }, + ]; + }); + + test('calls item onClick handler when item is clicked', async () => { + render( + <IntlProvider locale="en"> + <AddPanelFlyout dashboardApi={mockDashboardApi} /> + </IntlProvider> + ); + + await waitFor(async () => { + await userEvent.click(screen.getByTestId('myItem')); + expect(onClickMock).toBeCalled(); + }); + }); + + test('displays not found message when a user searches for an item that is not in the selection list', async () => { + render( + <IntlProvider locale="en"> + <AddPanelFlyout dashboardApi={mockDashboardApi} /> + </IntlProvider> + ); + + await waitFor(async () => { + await userEvent.type( + screen.getByTestId('dashboardPanelSelectionFlyout__searchInput'), + 'non existent panel' + ); + screen.getByTestId('dashboardPanelSelectionNoPanelMessage'); + }); + }); + }); +}); diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.tsx new file mode 100644 index 0000000000000..4607cd35d9e0e --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/add_panel_flyout.tsx @@ -0,0 +1,177 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React, { useEffect, useState } from 'react'; +import useAsync from 'react-use/lib/useAsync'; +import { i18n as i18nFn } from '@kbn/i18n'; +import { + EuiEmptyPrompt, + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiFlyoutBody, + EuiFlyoutFooter, + EuiFlyoutHeader, + EuiForm, + EuiFormRow, + EuiTitle, + EuiFieldSearch, + useEuiTheme, + EuiSkeletonText, + EuiText, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { DashboardApi } from '../../../../dashboard_api/types'; +import { MenuItem, MenuItemGroup } from '../types'; +import { getMenuItemGroups } from '../get_menu_item_groups'; +import { Groups } from './groups'; + +export function AddPanelFlyout({ dashboardApi }: { dashboardApi: DashboardApi }) { + const { euiTheme } = useEuiTheme(); + + const { + value: groups, + loading, + error, + } = useAsync(async () => { + return await getMenuItemGroups(dashboardApi); + }, [dashboardApi]); + + const [searchTerm, setSearchTerm] = useState<string>(''); + const [filteredGroups, setFilteredGroups] = useState<MenuItemGroup[]>([]); + useEffect(() => { + if (!searchTerm) { + return setFilteredGroups(groups ?? []); + } + + const q = searchTerm.toLowerCase(); + + const currentGroups = groups ?? ([] as MenuItemGroup[]); + setFilteredGroups( + currentGroups + .map((group) => { + const groupMatch = group.title.toLowerCase().includes(q); + + const [itemsMatch, items] = group.items.reduce( + (acc, item) => { + const itemMatch = item.name.toLowerCase().includes(q); + + acc[0] = acc[0] || itemMatch; + acc[1].push({ + ...item, + isDisabled: !(groupMatch || itemMatch), + }); + + return acc; + }, + [false, [] as MenuItem[]] + ); + + return { + ...group, + isDisabled: !(groupMatch || itemsMatch), + items, + }; + }) + .filter((group) => !group.isDisabled) + ); + }, [groups, searchTerm]); + + return ( + <> + <EuiFlyoutHeader hasBorder> + <EuiTitle size="s"> + <h1 id="addPanelsFlyout"> + <FormattedMessage + id="dashboard.solutionToolbar.addPanelFlyout.headingText" + defaultMessage="Add panel" + /> + </h1> + </EuiTitle> + </EuiFlyoutHeader> + <EuiFlyoutBody> + <EuiSkeletonText isLoading={loading}> + <EuiFlexGroup direction="column" responsive={false} gutterSize="m"> + <EuiFlexItem + grow={false} + css={{ + position: 'sticky', + top: euiTheme.size.m, + zIndex: 1, + boxShadow: `0 -${euiTheme.size.m} 0 4px ${euiTheme.colors.emptyShade}`, + }} + > + <EuiForm component="form" fullWidth> + <EuiFormRow css={{ backgroundColor: euiTheme.colors.emptyShade }}> + <EuiFieldSearch + compressed + autoFocus + value={searchTerm} + onChange={(e) => { + setSearchTerm(e.target.value); + }} + aria-label={i18nFn.translate( + 'dashboard.editorMenu.addPanelFlyout.searchLabelText', + { defaultMessage: 'search field for panels' } + )} + data-test-subj="dashboardPanelSelectionFlyout__searchInput" + /> + </EuiFormRow> + </EuiForm> + </EuiFlexItem> + <EuiFlexItem + css={{ + minHeight: '20vh', + ...(error + ? { + justifyContent: 'center', + alignItems: 'center', + } + : {}), + }} + > + {error ? ( + <EuiEmptyPrompt + iconType="warning" + iconColor="danger" + body={ + <EuiText size="s" textAlign="center"> + <FormattedMessage + id="dashboard.solutionToolbar.addPanelFlyout.loadingErrorDescription" + defaultMessage="An error occurred loading the available dashboard panels for selection" + /> + </EuiText> + } + data-test-subj="dashboardPanelSelectionErrorIndicator" + /> + ) : ( + <Groups groups={filteredGroups} /> + )} + </EuiFlexItem> + </EuiFlexGroup> + </EuiSkeletonText> + </EuiFlyoutBody> + <EuiFlyoutFooter> + <EuiFlexGroup justifyContent="spaceBetween"> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + onClick={dashboardApi.clearOverlays} + data-test-subj="dashboardPanelSelectionCloseBtn" + > + <FormattedMessage + id="dashboard.solutionToolbar.addPanelFlyout.cancelButtonText" + defaultMessage="Cancel" + /> + </EuiButtonEmpty> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlyoutFooter> + </> + ); +} diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/group.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/group.tsx new file mode 100644 index 0000000000000..ea31731d9336a --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/group.tsx @@ -0,0 +1,72 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { + EuiBadge, + EuiFlexGroup, + EuiFlexItem, + EuiListGroup, + EuiListGroupItem, + EuiText, + EuiTitle, + EuiToolTip, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { MenuItemGroup } from '../types'; + +export function Group({ group }: { group: MenuItemGroup }) { + return ( + <> + <EuiTitle id={`${group.id}-group`} size="xxs"> + <h3>{group.title}</h3> + </EuiTitle> + <EuiListGroup + aria-labelledby={`${group.id}-group`} + size="s" + gutterSize="none" + maxWidth={false} + flush + > + {group.items.map((item) => { + return ( + <EuiListGroupItem + key={item.id} + label={ + <EuiToolTip position="right" content={item.description}> + {!item.isDeprecated ? ( + <EuiText size="s">{item.name}</EuiText> + ) : ( + <EuiFlexGroup wrap responsive={false} gutterSize="s"> + <EuiFlexItem grow={false}> + <EuiText size="s">{item.name}</EuiText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiBadge color="warning"> + <FormattedMessage + id="dashboard.editorMenu.deprecatedTag" + defaultMessage="Deprecated" + /> + </EuiBadge> + </EuiFlexItem> + </EuiFlexGroup> + )} + </EuiToolTip> + } + onClick={item.onClick} + iconType={item.icon} + data-test-subj={item['data-test-subj']} + isDisabled={item.isDisabled} + /> + ); + })} + </EuiListGroup> + </> + ); +} diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/groups.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/groups.tsx new file mode 100644 index 0000000000000..71ec9cc6c0359 --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/components/groups.tsx @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { Group } from './group'; +import { MenuItemGroup } from '../types'; + +export function Groups({ groups }: { groups: MenuItemGroup[] }) { + return groups.length === 0 ? ( + <EuiText size="s" textAlign="center" data-test-subj="dashboardPanelSelectionNoPanelMessage"> + <FormattedMessage + id="dashboard.solutionToolbar.addPanelFlyout.noResultsDescription" + defaultMessage="No panel types found" + /> + </EuiText> + ) : ( + <EuiFlexGroup direction="column" gutterSize="m" data-test-subj="dashboardPanelSelectionList"> + {groups.map((group) => ( + <EuiFlexItem + key={group.id} + data-test-subj={group['data-test-subj']} + data-group-sort-order={group.order} + > + <Group group={group} /> + </EuiFlexItem> + ))} + </EuiFlexGroup> + ); +} diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.test.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.test.ts new file mode 100644 index 0000000000000..9bccfba23c817 --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.test.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { getMenuItemGroups } from './get_menu_item_groups'; + +jest.mock('../../../services/kibana_services', () => ({ + uiActionsService: { + getTriggerCompatibleActions: async () => [ + { + id: 'mockAddPanelAction', + type: '', + order: 10, + grouping: [ + { + id: 'myGroup', + order: 900, + getDisplayName: () => 'My group', + }, + ], + getDisplayName: () => 'mockAddPanelAction', + getIconType: () => 'empty', + execute: () => {}, + isCompatible: async () => true, + }, + ], + }, + visualizationsService: { + all: () => [ + { + name: 'myPromotedVis', + title: 'myPromotedVis', + order: 0, + description: 'myPromotedVis description', + icon: 'empty', + stage: 'production', + isDeprecated: false, + group: 'promoted', + titleInWizard: 'myPromotedVis title', + }, + ], + getAliases: () => [ + { + name: 'alias visualization', + title: 'Alias Visualization', + order: 0, + description: 'This is a dummy representation of aan aliased visualization.', + icon: 'empty', + stage: 'production', + isDeprecated: false, + }, + ], + }, +})); + +describe('getMenuItemGroups', () => { + test('gets sorted groups from visTypes, visTypeAliases, and add panel actions', async () => { + const api = { + getAppContext: () => ({ + currentAppId: 'dashboards', + }), + openOverlay: () => {}, + clearOverlays: () => {}, + }; + const groups = await getMenuItemGroups(api); + expect(groups.length).toBe(2); + + expect(groups[0].title).toBe('Visualizations'); + expect(groups[0].items.length).toBe(2); // promoted vis type and vis alias + + expect(groups[1].title).toBe('My group'); + expect(groups[1].items.length).toBe(1); // add panel action + }); +}); diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.ts new file mode 100644 index 0000000000000..00e262c6b6f64 --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/get_menu_item_groups.ts @@ -0,0 +1,134 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { VisGroups } from '@kbn/visualizations-plugin/public'; +import { ADD_PANEL_TRIGGER } from '@kbn/ui-actions-plugin/public'; +import { + ADD_PANEL_ANNOTATION_GROUP, + ADD_PANEL_LEGACY_GROUP, + ADD_PANEL_OTHER_GROUP, + ADD_PANEL_VISUALIZATION_GROUP, +} from '@kbn/embeddable-plugin/public'; +import type { TracksOverlays } from '@kbn/presentation-containers'; +import { PresentableGroup } from '@kbn/ui-actions-browser/src/types'; +import { addPanelMenuTrigger } from '@kbn/ui-actions-plugin/public'; +import type { HasAppContext } from '@kbn/presentation-publishing'; +import { uiActionsService, visualizationsService } from '../../../services/kibana_services'; +import { navigateToVisEditor } from './navigate_to_vis_editor'; +import type { MenuItem, MenuItemGroup } from './types'; + +const VIS_GROUP_TO_ADD_PANEL_GROUP: Record<VisGroups, undefined | PresentableGroup> = { + [VisGroups.AGGBASED]: undefined, + [VisGroups.PROMOTED]: ADD_PANEL_VISUALIZATION_GROUP, + [VisGroups.TOOLS]: ADD_PANEL_ANNOTATION_GROUP, + [VisGroups.LEGACY]: ADD_PANEL_LEGACY_GROUP, +}; + +export async function getMenuItemGroups( + api: HasAppContext & TracksOverlays +): Promise<MenuItemGroup[]> { + const groups: Record<string, MenuItemGroup> = {}; + const addPanelContext = { + embeddable: api, + trigger: addPanelMenuTrigger, + }; + function pushItem(group: PresentableGroup, item: MenuItem) { + if (!groups[group.id]) { + groups[group.id] = { + id: group.id, + title: group.getDisplayName?.(addPanelContext) ?? '', + 'data-test-subj': `dashboardEditorMenu-${group.id}Group`, + order: group.order ?? 0, + items: [], + }; + } + groups[group.id].items.push(item); + } + + // add menu items from vis types + visualizationsService.all().forEach((visType) => { + if (visType.disableCreate) return; + + const group = VIS_GROUP_TO_ADD_PANEL_GROUP[visType.group]; + if (!group) return; + pushItem(group, { + id: visType.name, + name: visType.titleInWizard || visType.title, + isDeprecated: visType.isDeprecated, + icon: visType.icon ?? 'empty', + onClick: () => { + api.clearOverlays(); + navigateToVisEditor(api, visType); + }, + 'data-test-subj': `visType-${visType.name}`, + description: visType.description, + order: visType.order, + }); + }); + + // add menu items from vis alias + visualizationsService.getAliases().forEach((visTypeAlias) => { + if (visTypeAlias.disableCreate) return; + pushItem(ADD_PANEL_VISUALIZATION_GROUP, { + id: visTypeAlias.name, + name: visTypeAlias.title, + icon: visTypeAlias.icon ?? 'empty', + onClick: () => { + api.clearOverlays(); + navigateToVisEditor(api, visTypeAlias); + }, + 'data-test-subj': `visType-${visTypeAlias.name}`, + description: visTypeAlias.description, + order: visTypeAlias.order ?? 0, + }); + }); + + // add menu items from "add panel" actions + ( + await uiActionsService.getTriggerCompatibleActions(ADD_PANEL_TRIGGER, { embeddable: api }) + ).forEach((action) => { + const actionGroups = Array.isArray(action.grouping) ? action.grouping : [ADD_PANEL_OTHER_GROUP]; + actionGroups.forEach((group) => { + const actionName = action.getDisplayName(addPanelContext); + pushItem(group, { + id: action.id, + name: actionName, + icon: action.getIconType?.(addPanelContext) ?? 'empty', + onClick: (event: React.MouseEvent) => { + api.clearOverlays(); + if (event.currentTarget instanceof HTMLAnchorElement) { + if ( + !event.defaultPrevented && // onClick prevented default + event.button === 0 && + (!event.currentTarget.target || event.currentTarget.target === '_self') && + !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) + ) { + event.preventDefault(); + } + } + action.execute(addPanelContext); + }, + 'data-test-subj': `create-action-${actionName}`, + description: action?.getDisplayNameTooltip?.(addPanelContext), + order: action.order ?? 0, + }); + }); + }); + + return Object.values(groups) + .map((group) => { + group.items.sort((itemA, itemB) => { + return itemA.order === itemB.order + ? itemA.name.localeCompare(itemB.name) + : itemB.order - itemA.order; + }); + return group; + }) + .sort((groupA, groupB) => groupB.order - groupA.order); +} diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/navigate_to_vis_editor.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/navigate_to_vis_editor.ts new file mode 100644 index 0000000000000..352a567f51777 --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/navigate_to_vis_editor.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { HasAppContext } from '@kbn/presentation-publishing'; +import type { BaseVisType, VisTypeAlias } from '@kbn/visualizations-plugin/public'; +import { METRIC_TYPE } from '@kbn/analytics'; +import { + dataService, + embeddableService, + usageCollectionService, +} from '../../../services/kibana_services'; +import { DASHBOARD_UI_METRIC_ID } from '../../../utils/telemetry_constants'; + +export function navigateToVisEditor(api: HasAppContext, visType?: BaseVisType | VisTypeAlias) { + let path = ''; + let appId = ''; + + if (visType) { + const trackUiMetric = usageCollectionService?.reportUiCounter.bind( + usageCollectionService, + DASHBOARD_UI_METRIC_ID + ); + if (trackUiMetric) { + trackUiMetric(METRIC_TYPE.CLICK, `${visType.name}:create`); + } + + if (!('alias' in visType)) { + // this visualization is not an alias + appId = 'visualize'; + path = `#/create?type=${encodeURIComponent(visType.name)}`; + } else if (visType.alias && 'path' in visType.alias) { + // this visualization **is** an alias, and it has an app to redirect to for creation + appId = visType.alias.app; + path = visType.alias.path; + } + } else { + appId = 'visualize'; + path = '#/create?'; + } + + const stateTransferService = embeddableService.getStateTransfer(); + stateTransferService.navigateToEditor(appId, { + path, + state: { + originatingApp: api.getAppContext()?.currentAppId, + originatingPath: api.getAppContext()?.getCurrentPath?.(), + searchSessionId: dataService.search.session.getSessionId(), + }, + }); +} diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/types.ts b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/types.ts new file mode 100644 index 0000000000000..b43b453d3ba49 --- /dev/null +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/add_panel_button/types.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { MouseEventHandler } from 'react'; +import type { IconType, CommonProps } from '@elastic/eui'; + +export interface MenuItem extends Pick<CommonProps, 'data-test-subj'> { + id: string; + name: string; + icon: IconType; + onClick: MouseEventHandler; + description?: string; + isDisabled?: boolean; + isDeprecated?: boolean; + order: number; +} + +export interface MenuItemGroup extends Pick<CommonProps, 'data-test-subj'> { + id: string; + isDisabled?: boolean; + title: string; + order: number; + items: MenuItem[]; +} diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx index fd5e947a33baa..cf8ec4ee6d3f4 100644 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx @@ -9,80 +9,32 @@ import { useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; -import { METRIC_TYPE } from '@kbn/analytics'; -import React, { useCallback, useMemo } from 'react'; +import React, { useCallback } from 'react'; import { AddFromLibraryButton, Toolbar, ToolbarButton } from '@kbn/shared-ux-button-toolbar'; -import { BaseVisType, VisTypeAlias } from '@kbn/visualizations-plugin/public'; import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; import { useDashboardApi } from '../../dashboard_api/use_dashboard_api'; -import { DASHBOARD_UI_METRIC_ID } from '../../utils/telemetry_constants'; -import { - dataService, - embeddableService, - usageCollectionService, - visualizationsService, -} from '../../services/kibana_services'; +import { visualizationsService } from '../../services/kibana_services'; import { getCreateVisualizationButtonTitle } from '../_dashboard_app_strings'; import { ControlsToolbarButton } from './controls_toolbar_button'; -import { EditorMenu } from './editor_menu'; +import { AddPanelButton } from './add_panel_button/components/add_panel_button'; import { addFromLibrary } from '../../dashboard_container/embeddable/api'; +import { navigateToVisEditor } from './add_panel_button/navigate_to_vis_editor'; export function DashboardEditingToolbar({ isDisabled }: { isDisabled?: boolean }) { const { euiTheme } = useEuiTheme(); const dashboardApi = useDashboardApi(); - const lensAlias = useMemo( - () => visualizationsService.getAliases().find(({ name }) => name === 'lens'), - [] - ); - - const createNewVisType = useCallback( - (visType?: BaseVisType | VisTypeAlias) => () => { - let path = ''; - let appId = ''; - - if (visType) { - const trackUiMetric = usageCollectionService?.reportUiCounter.bind( - usageCollectionService, - DASHBOARD_UI_METRIC_ID - ); - if (trackUiMetric) { - trackUiMetric(METRIC_TYPE.CLICK, `${visType.name}:create`); - } - - if (!('alias' in visType)) { - // this visualization is not an alias - appId = 'visualize'; - path = `#/create?type=${encodeURIComponent(visType.name)}`; - } else if (visType.alias && 'path' in visType.alias) { - // this visualization **is** an alias, and it has an app to redirect to for creation - appId = visType.alias.app; - path = visType.alias.path; - } - } else { - appId = 'visualize'; - path = '#/create?'; - } - - const stateTransferService = embeddableService.getStateTransfer(); - stateTransferService.navigateToEditor(appId, { - path, - state: { - originatingApp: dashboardApi.getAppContext()?.currentAppId, - originatingPath: dashboardApi.getAppContext()?.getCurrentPath?.(), - searchSessionId: dataService.search.session.getSessionId(), - }, - }); - }, - [dashboardApi] - ); + const navigateToDefaultEditor = useCallback(() => { + const lensAlias = visualizationsService.getAliases().find(({ name }) => name === 'lens'); + navigateToVisEditor(dashboardApi, lensAlias); + }, [dashboardApi]); const controlGroupApi = useStateFromPublishingSubject(dashboardApi.controlGroupApi$); const extraButtons = [ - <EditorMenu createNewVisType={createNewVisType} isDisabled={isDisabled} />, + <AddPanelButton isDisabled={isDisabled} />, <AddFromLibraryButton onClick={() => addFromLibrary(dashboardApi)} size="s" @@ -106,7 +58,7 @@ export function DashboardEditingToolbar({ isDisabled }: { isDisabled?: boolean } isDisabled={isDisabled} iconType="lensApp" size="s" - onClick={createNewVisType(lensAlias)} + onClick={navigateToDefaultEditor} label={getCreateVisualizationButtonTitle()} data-test-subj="dashboardAddNewPanelButton" /> diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.scss b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.scss deleted file mode 100644 index 4b1a1d9b27d57..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.scss +++ /dev/null @@ -1,6 +0,0 @@ -.dshSolutionToolbar__editorContextMenu { - max-height: 60vh; - overflow-y: scroll; - @include euiScrollBar; - @include euiOverflowShadow; -} diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx deleted file mode 100644 index f82ad60929f24..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { render } from '@testing-library/react'; -import React from 'react'; -import { buildMockDashboardApi } from '../../mocks'; -import { EditorMenu } from './editor_menu'; - -import { DashboardContext } from '../../dashboard_api/use_dashboard_api'; -import { uiActionsService, visualizationsService } from '../../services/kibana_services'; - -jest.spyOn(uiActionsService, 'getTriggerCompatibleActions').mockResolvedValue([]); -jest.spyOn(visualizationsService, 'getByGroup').mockReturnValue([]); -jest.spyOn(visualizationsService, 'getAliases').mockReturnValue([]); - -describe('editor menu', () => { - it('renders without crashing', async () => { - const { api } = buildMockDashboardApi(); - render(<EditorMenu createNewVisType={jest.fn()} />, { - wrapper: ({ children }) => { - return <DashboardContext.Provider value={api}>{children}</DashboardContext.Provider>; - }, - }); - }); -}); diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.tsx deleted file mode 100644 index 6d052225d6fba..0000000000000 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/editor_menu.tsx +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import './editor_menu.scss'; - -import React, { useEffect, useCallback, type ComponentProps } from 'react'; - -import { i18n } from '@kbn/i18n'; -import { toMountPoint } from '@kbn/react-kibana-mount'; -import { ToolbarButton } from '@kbn/shared-ux-button-toolbar'; - -import { useGetDashboardPanels, DashboardPanelSelectionListFlyout } from './add_new_panel'; -import { useDashboardApi } from '../../dashboard_api/use_dashboard_api'; -import { coreServices } from '../../services/kibana_services'; - -interface EditorMenuProps - extends Pick<Parameters<typeof useGetDashboardPanels>[0], 'createNewVisType'> { - isDisabled?: boolean; -} - -export const EditorMenu = ({ createNewVisType, isDisabled }: EditorMenuProps) => { - const dashboardApi = useDashboardApi(); - - const fetchDashboardPanels = useGetDashboardPanels({ - api: dashboardApi, - createNewVisType, - }); - - useEffect(() => { - // ensure opened dashboard is closed if a navigation event happens; - return () => { - dashboardApi.clearOverlays(); - }; - }, [dashboardApi]); - - const openDashboardPanelSelectionFlyout = useCallback( - function openDashboardPanelSelectionFlyout() { - const flyoutPanelPaddingSize: ComponentProps< - typeof DashboardPanelSelectionListFlyout - >['paddingSize'] = 'm'; - - const mount = toMountPoint( - React.createElement(function () { - return ( - <DashboardPanelSelectionListFlyout - close={dashboardApi.clearOverlays} - {...{ - paddingSize: flyoutPanelPaddingSize, - fetchDashboardPanels: fetchDashboardPanels.bind(null, dashboardApi.clearOverlays), - }} - /> - ); - }), - coreServices - ); - - dashboardApi.openOverlay( - coreServices.overlays.openFlyout(mount, { - size: 'm', - maxWidth: 500, - paddingSize: flyoutPanelPaddingSize, - 'aria-labelledby': 'addPanelsFlyout', - 'data-test-subj': 'dashboardPanelSelectionFlyout', - onClose(overlayRef) { - dashboardApi.clearOverlays(); - overlayRef.close(); - }, - }) - ); - }, - [dashboardApi, fetchDashboardPanels] - ); - - return ( - <ToolbarButton - data-test-subj="dashboardEditorMenuButton" - isDisabled={isDisabled} - iconType="plusInCircle" - label={i18n.translate('dashboard.solutionToolbar.editorMenuButtonLabel', { - defaultMessage: 'Add panel', - })} - onClick={openDashboardPanelSelectionFlyout} - size="s" - /> - ); -}; diff --git a/src/platform/plugins/shared/dashboard/tsconfig.json b/src/platform/plugins/shared/dashboard/tsconfig.json index e1bcc5fae059f..bae41ad9f78ed 100644 --- a/src/platform/plugins/shared/dashboard/tsconfig.json +++ b/src/platform/plugins/shared/dashboard/tsconfig.json @@ -85,7 +85,8 @@ "@kbn/core-rendering-browser", "@kbn/esql-variables-types", "@kbn/grid-layout", - "@kbn/esql-validation-autocomplete" + "@kbn/esql-validation-autocomplete", + "@kbn/ui-actions-browser" ], "exclude": ["target/**/*"] } diff --git a/src/platform/plugins/shared/embeddable/public/index.ts b/src/platform/plugins/shared/embeddable/public/index.ts index 31da8691af17e..c98e73dc76b47 100644 --- a/src/platform/plugins/shared/embeddable/public/index.ts +++ b/src/platform/plugins/shared/embeddable/public/index.ts @@ -57,4 +57,5 @@ export { ADD_PANEL_ANNOTATION_GROUP, ADD_PANEL_OTHER_GROUP, ADD_PANEL_LEGACY_GROUP, + ADD_PANEL_VISUALIZATION_GROUP, } from './ui_actions/add_panel_groups'; diff --git a/src/platform/plugins/shared/embeddable/public/ui_actions/add_panel_groups.ts b/src/platform/plugins/shared/embeddable/public/ui_actions/add_panel_groups.ts index d1111bb5d5a5f..75310d8ff42a4 100644 --- a/src/platform/plugins/shared/embeddable/public/ui_actions/add_panel_groups.ts +++ b/src/platform/plugins/shared/embeddable/public/ui_actions/add_panel_groups.ts @@ -9,6 +9,18 @@ import { i18n } from '@kbn/i18n'; +export const ADD_PANEL_VISUALIZATION_GROUP = { + id: 'visualizations', + getDisplayName: () => + i18n.translate('embeddableApi.common.constants.grouping.visualizations', { + defaultMessage: 'Visualizations', + }), + getIconType: () => { + return 'visGauge'; + }, + order: 1000, +}; + export const ADD_PANEL_ANNOTATION_GROUP = { id: 'annotation-and-navigation', getDisplayName: () => diff --git a/src/platform/plugins/shared/visualizations/public/index.ts b/src/platform/plugins/shared/visualizations/public/index.ts index 58b30592ee29e..a24ed48f73de3 100644 --- a/src/platform/plugins/shared/visualizations/public/index.ts +++ b/src/platform/plugins/shared/visualizations/public/index.ts @@ -20,7 +20,6 @@ export function plugin(initializerContext: PluginInitializerContext) { export { TypesService } from './vis_types/types_service'; export { VIS_EVENT_TO_TRIGGER } from './embeddable/events'; export { apiHasVisualizeConfig } from './embeddable/interfaces/has_visualize_config'; -export { COMMON_VISUALIZATION_GROUPING } from './legacy/embeddable/constants'; export { VisualizationContainer } from './components'; export { getVisSchemas } from './vis_schemas'; export { prepareLogTable } from '../common/utils/prepare_log_table'; diff --git a/src/platform/plugins/shared/visualizations/public/legacy/embeddable/constants.ts b/src/platform/plugins/shared/visualizations/public/legacy/embeddable/constants.ts deleted file mode 100644 index 79d87ec59b1e1..0000000000000 --- a/src/platform/plugins/shared/visualizations/public/legacy/embeddable/constants.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; - -export { VISUALIZE_EMBEDDABLE_TYPE } from '../../../common/constants'; - -export const COMMON_VISUALIZATION_GROUPING = [ - { - id: 'visualizations', - getDisplayName: () => - i18n.translate('visualizations.common.constants.grouping.legacy', { - defaultMessage: 'Visualizations', - }), - getIconType: () => { - return 'visGauge'; - }, - order: 1000, - }, -]; diff --git a/src/platform/plugins/shared/visualizations/public/legacy/embeddable/index.ts b/src/platform/plugins/shared/visualizations/public/legacy/embeddable/index.ts index 6aa08f7b847de..025708758f4df 100644 --- a/src/platform/plugins/shared/visualizations/public/legacy/embeddable/index.ts +++ b/src/platform/plugins/shared/visualizations/public/legacy/embeddable/index.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { VISUALIZE_EMBEDDABLE_TYPE, COMMON_VISUALIZATION_GROUPING } from './constants'; +export { VISUALIZE_EMBEDDABLE_TYPE } from '../../../common/constants'; export { createVisEmbeddableFromObject } from './create_vis_embeddable_from_object'; export type { VisualizeEmbeddable, VisualizeInput } from './visualize_embeddable'; diff --git a/src/platform/plugins/shared/visualizations/public/legacy/embeddable/visualize_embeddable.tsx b/src/platform/plugins/shared/visualizations/public/legacy/embeddable/visualize_embeddable.tsx index 3f77ce9ecb661..dc27834bb109d 100644 --- a/src/platform/plugins/shared/visualizations/public/legacy/embeddable/visualize_embeddable.tsx +++ b/src/platform/plugins/shared/visualizations/public/legacy/embeddable/visualize_embeddable.tsx @@ -38,7 +38,7 @@ import { StartServicesGetter } from '@kbn/kibana-utils-plugin/public'; import { isFallbackDataView } from '../../visualize_app/utils'; import { VisualizationMissedSavedObjectError } from '../../components/visualization_missed_saved_object_error'; import VisualizationError from '../../components/visualization_error'; -import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; +import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../common/constants'; import { SerializedVis, Vis } from '../../vis'; import { getApplication, getExpressions, getUiActions } from '../../services'; import { VIS_EVENT_TO_TRIGGER } from '../../embeddable/events'; 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 9527ba681f0a2..d7bb8e680e339 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -9531,7 +9531,6 @@ "visualizations.badge.readOnly.text": "Lecture seule", "visualizations.badge.readOnly.tooltip": "Impossible d'enregistrer les visualisations dans la bibliothèque", "visualizations.byValue_pageHeading": "Visualisation de type {chartType} intégrée à l'application {originatingApp}", - "visualizations.common.constants.grouping.legacy": "Visualisations", "visualizations.confirmModal.cancelButtonLabel": "Annuler", "visualizations.confirmModal.confirmTextDescription": "Quitter l'éditeur Visualize sans enregistrer les modifications ?", "visualizations.confirmModal.overwriteButtonLabel": "Écraser", 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 f951b53f9b2bd..e49af049a1670 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -9406,7 +9406,6 @@ "visualizations.badge.readOnly.text": "読み取り専用", "visualizations.badge.readOnly.tooltip": "ビジュアライゼーションをライブラリに保存できません", "visualizations.byValue_pageHeading": "{originatingApp}アプリに埋め込まれた{chartType}タイプのビジュアライゼーション", - "visualizations.common.constants.grouping.legacy": "ビジュアライゼーション", "visualizations.confirmModal.cancelButtonLabel": "キャンセル", "visualizations.confirmModal.confirmTextDescription": "変更を保存せずにVisualizeエディターから移動しますか?", "visualizations.confirmModal.overwriteButtonLabel": "上書き", 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 10ccac6ffb6da..dbfbd9a428be0 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -9265,7 +9265,6 @@ "visualizations.badge.readOnly.text": "只读", "visualizations.badge.readOnly.tooltip": "无法将可视化保存到库", "visualizations.byValue_pageHeading": "已嵌入到 {originatingApp} 应用中的 {chartType} 类型可视化", - "visualizations.common.constants.grouping.legacy": "可视化", "visualizations.confirmModal.cancelButtonLabel": "取消", "visualizations.confirmModal.confirmTextDescription": "离开 Visualize 编辑器而不保存更改?", "visualizations.confirmModal.overwriteButtonLabel": "覆盖", diff --git a/x-pack/platform/plugins/shared/lens/public/trigger_actions/open_lens_config/create_action.tsx b/x-pack/platform/plugins/shared/lens/public/trigger_actions/open_lens_config/create_action.tsx index 6fb9310158082..d59e2b629ef92 100644 --- a/x-pack/platform/plugins/shared/lens/public/trigger_actions/open_lens_config/create_action.tsx +++ b/x-pack/platform/plugins/shared/lens/public/trigger_actions/open_lens_config/create_action.tsx @@ -9,7 +9,7 @@ import type { CoreStart } from '@kbn/core/public'; import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; import { EmbeddableApiContext } from '@kbn/presentation-publishing'; import { apiIsPresentationContainer } from '@kbn/presentation-containers'; -import { COMMON_VISUALIZATION_GROUPING } from '@kbn/visualizations-plugin/public'; +import { ADD_PANEL_VISUALIZATION_GROUP } from '@kbn/embeddable-plugin/public'; import type { LensPluginStartDependencies } from '../../plugin'; import type { EditorFrameService } from '../../editor_frame_service'; @@ -22,7 +22,7 @@ export class CreateESQLPanelAction implements Action<EmbeddableApiContext> { public id = ACTION_CREATE_ESQL_CHART; public order = 50; - public grouping = COMMON_VISUALIZATION_GROUPING; + public grouping = [ADD_PANEL_VISUALIZATION_GROUP]; constructor( protected readonly startDependencies: LensPluginStartDependencies, From 9ce2dd8df9f2bd6c0ba1d089b69ddfd7fc1f4a02 Mon Sep 17 00:00:00 2001 From: Larry Gregory <larry.gregory@elastic.co> Date: Tue, 28 Jan 2025 17:00:43 -0500 Subject: [PATCH 22/26] Additional prototype pollution protections (#206073) ## Summary 1. Extends the server-side prototype pollution protections introduced in https://github.com/elastic/kibana/pull/190716 to include `Array.prototype`. 2. Applies the same prototype pollution protections to the client-side. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] Sealing prototypes on the client can lead to failures in third-party dependencies. I'm relying on sufficient functional test coverage to detect issues here. As a result, these protections are disabled by default for now, and can be controlled via setting `server.prototypeHardening: true/false` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> --- .github/CODEOWNERS | 2 +- package.json | 2 +- .../src/http_service.mock.ts | 2 + .../serverless/serverless.base.config.ts | 1 + .../src/config/stateful/base.config.ts | 1 + src/cli/serve/serve.js | 2 + .../__snapshots__/http_config.test.ts.snap | 1 + .../server-internal/src/http_config.test.ts | 10 +++ .../http/server-internal/src/http_config.ts | 3 + .../http/server-internal/src/http_server.ts | 2 + .../http/server-internal/src/http_service.ts | 1 + .../http/server-internal/src/types.ts | 2 + .../render_template.test.ts.snap | 2 + .../src/bootstrap/render_template.ts | 2 + .../server-internal/src/rendering_service.tsx | 1 + .../rendering/server-internal/src/types.ts | 1 + .../server-internal/src/views/template.tsx | 4 + .../resources/base/bin/kibana-docker | 1 + .../kbn-ui-shared-deps-src/BUILD.bazel | 1 + .../kbn-ui-shared-deps-src/src/entry.js | 9 ++ .../shared/kbn-security-hardening/BUILD.bazel | 32 +++++++ .../shared/kbn-security-hardening/README.md | 6 +- .../shared/kbn-security-hardening/index.ts | 1 + .../kbn-security-hardening/prototype.ts | 44 ++++++++++ src/setup_node_env/harden/prototype.js | 3 +- test/common/config.js | 1 + .../plugins/hardening/common/pollute.ts | 85 +++++++++++++++++++ .../plugins/hardening/kibana.jsonc | 2 +- .../plugins/hardening/public/application.tsx | 50 +++++++++++ .../plugins/hardening/public/index.ts | 14 +++ .../plugins/hardening/public/plugin.ts | 34 ++++++++ .../plugins/hardening/server/plugin.ts | 55 +----------- .../plugins/hardening/tsconfig.json | 3 + .../{prototype.json => prototype_client.json} | 2 +- .../baseline/hardening/prototype_server.json | 1 + .../test_suites/hardening/prototype.ts | 21 ++++- .../my_workpads/upload_dropzone.component.tsx | 24 ++++-- .../storybook/storyshots.skipped_test.tsx | 2 +- x-pack/test_serverless/shared/config.base.ts | 1 + yarn.lock | 15 ---- 40 files changed, 360 insertions(+), 86 deletions(-) create mode 100644 src/platform/packages/shared/kbn-security-hardening/BUILD.bazel create mode 100644 src/platform/packages/shared/kbn-security-hardening/prototype.ts create mode 100644 test/plugin_functional/plugins/hardening/common/pollute.ts create mode 100644 test/plugin_functional/plugins/hardening/public/application.tsx create mode 100644 test/plugin_functional/plugins/hardening/public/index.ts create mode 100644 test/plugin_functional/plugins/hardening/public/plugin.ts rename test/plugin_functional/snapshots/baseline/hardening/{prototype.json => prototype_client.json} (52%) create mode 100644 test/plugin_functional/snapshots/baseline/hardening/prototype_server.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6bfd3ffa792f8..480b1fab91c5d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1868,7 +1868,7 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi /x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/space_1.json @elastic/kibana-security # Assigned per only use: https://github.com/elastic/kibana/blob/main/x-pack/test/ftr_apis/security_and_spaces/apis/test_utils.ts#L33 /x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/default_space.json @elastic/kibana-security # Assigned per only use: https://github.com/elastic/kibana/blob/main/x-pack/test/ftr_apis/security_and_spaces/apis/test_utils.ts#L33 /x-pack/test/api_integration/apis/cloud @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/198444 -/test/plugin_functional/snapshots/baseline/hardening/prototype.json @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/190716 +/test/plugin_functional/snapshots/baseline/hardening @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/190716 /test/functional/page_objects/login_page.ts @elastic/kibana-security /x-pack/test_serverless/functional/test_suites/observability/role_management @elastic/kibana-security /x-pack/test/functional/config_security_basic.ts @elastic/kibana-security diff --git a/package.json b/package.json index e9335b7c9a73a..005e82eec5b58 100644 --- a/package.json +++ b/package.json @@ -1220,7 +1220,7 @@ "react-diff-view": "^3.2.1", "react-dom": "^17.0.2", "react-dom-18": "npm:react-dom@~18.2.0", - "react-dropzone": "^4.2.9", + "react-dropzone": "^11.7.1", "react-fast-compare": "^2.0.4", "react-hook-form": "^7.44.2", "react-intl": "6.6.6", diff --git a/packages/core/http/core-http-server-mocks/src/http_service.mock.ts b/packages/core/http/core-http-server-mocks/src/http_service.mock.ts index ef137ff284559..f63e60b4b5233 100644 --- a/packages/core/http/core-http-server-mocks/src/http_service.mock.ts +++ b/packages/core/http/core-http-server-mocks/src/http_service.mock.ts @@ -127,6 +127,7 @@ const createInternalPrebootContractMock = (args: CreateMockArgs = {}) => { basePath, staticAssets: createInternalStaticAssetsMock(basePath, args.cdnUrl), csp: CspConfig.DEFAULT, + prototypeHardening: false, externalUrl: ExternalUrlConfig.DEFAULT, auth: createAuthMock(), getServerInfo: jest.fn(), @@ -182,6 +183,7 @@ const createInternalSetupContractMock = () => { registerStaticDir: jest.fn(), basePath, csp: CspConfig.DEFAULT, + prototypeHardening: false, staticAssets: createInternalStaticAssetsMock(basePath), externalUrl: ExternalUrlConfig.DEFAULT, auth: createAuthMock(), diff --git a/packages/kbn-scout/src/config/serverless/serverless.base.config.ts b/packages/kbn-scout/src/config/serverless/serverless.base.config.ts index c7fb06da954ef..7b79a213c8d34 100644 --- a/packages/kbn-scout/src/config/serverless/serverless.base.config.ts +++ b/packages/kbn-scout/src/config/serverless/serverless.base.config.ts @@ -99,6 +99,7 @@ export const defaultConfig: ScoutServerConfig = { serverArgs: [ `--server.restrictInternalApis=true`, `--server.port=${servers.kibana.port}`, + `--server.prototypeHardening=true`, '--status.allowAnonymous=true', `--migrations.zdt.runOnRoles=${JSON.stringify(['ui'])}`, // We shouldn't embed credentials into the URL since Kibana requests to Elasticsearch should diff --git a/packages/kbn-scout/src/config/stateful/base.config.ts b/packages/kbn-scout/src/config/stateful/base.config.ts index 043b34723a21c..98cbb5a5e9340 100644 --- a/packages/kbn-scout/src/config/stateful/base.config.ts +++ b/packages/kbn-scout/src/config/stateful/base.config.ts @@ -103,6 +103,7 @@ export const defaultConfig: ScoutServerConfig = { sourceArgs: ['--no-base-path', '--env.name=development'], serverArgs: [ `--server.port=${servers.kibana.port}`, + `--server.prototypeHardening=true`, '--status.allowAnonymous=true', // We shouldn't embed credentials into the URL since Kibana requests to Elasticsearch should // either include `kibanaServerTestUser` credentials, or credentials provided by the test diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js index 64c62cb8d4fe1..96b4537b4f3ca 100644 --- a/src/cli/serve/serve.js +++ b/src/cli/serve/serve.js @@ -126,6 +126,8 @@ export function applyConfigOverrides(rawConfig, opts, extraCliOptions, keystoreC ); } + set('server.prototypeHardening', true); + if (!has('elasticsearch.serviceAccountToken') && opts.devCredentials !== false) { if (!has('elasticsearch.username')) { set('elasticsearch.username', 'kibana_system'); diff --git a/src/core/packages/http/server-internal/src/__snapshots__/http_config.test.ts.snap b/src/core/packages/http/server-internal/src/__snapshots__/http_config.test.ts.snap index 85a8a63cbcfb5..57b10c83a5258 100644 --- a/src/core/packages/http/server-internal/src/__snapshots__/http_config.test.ts.snap +++ b/src/core/packages/http/server-internal/src/__snapshots__/http_config.test.ts.snap @@ -84,6 +84,7 @@ Object { "payloadTimeout": 20000, "port": 5601, "protocol": "http1", + "prototypeHardening": false, "rateLimiter": Object { "enabled": false, }, diff --git a/src/core/packages/http/server-internal/src/http_config.test.ts b/src/core/packages/http/server-internal/src/http_config.test.ts index d81e25fa364d1..2fa8e4f89a795 100644 --- a/src/core/packages/http/server-internal/src/http_config.test.ts +++ b/src/core/packages/http/server-internal/src/http_config.test.ts @@ -676,6 +676,16 @@ describe('http2 protocol', () => { }); }); +describe('prototypeHardening', () => { + it('defaults to false', () => { + expect(config.schema.validate({}).prototypeHardening).toBe(false); + }); + + it('can be set to true', () => { + expect(config.schema.validate({ prototypeHardening: true }).prototypeHardening).toBe(true); + }); +}); + describe('HttpConfig', () => { it('converts customResponseHeaders to strings or arrays of strings', () => { const httpSchema = config.schema; diff --git a/src/core/packages/http/server-internal/src/http_config.ts b/src/core/packages/http/server-internal/src/http_config.ts index c6b344fac8cdf..68f9fcf700579 100644 --- a/src/core/packages/http/server-internal/src/http_config.ts +++ b/src/core/packages/http/server-internal/src/http_config.ts @@ -135,6 +135,7 @@ const configSchema = schema.object( defaultValue: 'http1', }) ), + prototypeHardening: schema.boolean({ defaultValue: false }), host: schema.string({ defaultValue: 'localhost', hostname: true, @@ -354,6 +355,7 @@ export class HttpConfig implements IHttpConfig { brotli: { enabled: boolean; quality: number }; }; public csp: ICspConfig; + public prototypeHardening: boolean; public externalUrl: IExternalUrlConfig; public xsrf: { disableProtection: boolean; allowlist: string[] }; public requestId: { allowFromAnyIp: boolean; ipAllowlist: string[] }; @@ -408,6 +410,7 @@ export class HttpConfig implements IHttpConfig { this.compression = rawHttpConfig.compression; this.cdn = CdnConfig.from(rawHttpConfig.cdn); this.csp = new CspConfig({ ...rawCspConfig, disableEmbedding }, this.cdn.getCspConfig()); + this.prototypeHardening = rawHttpConfig.prototypeHardening; this.externalUrl = rawExternalUrlConfig; this.xsrf = rawHttpConfig.xsrf; this.requestId = rawHttpConfig.requestId; diff --git a/src/core/packages/http/server-internal/src/http_server.ts b/src/core/packages/http/server-internal/src/http_server.ts index 1c7b57fde6e2b..7e5235098fc6f 100644 --- a/src/core/packages/http/server-internal/src/http_server.ts +++ b/src/core/packages/http/server-internal/src/http_server.ts @@ -141,6 +141,7 @@ export interface HttpServerSetup { staticAssets: InternalStaticAssets; basePath: HttpServiceSetup['basePath']; csp: HttpServiceSetup['csp']; + prototypeHardening: boolean; createCookieSessionStorageFactory: HttpServiceSetup['createCookieSessionStorageFactory']; registerOnPreRouting: HttpServiceSetup['registerOnPreRouting']; registerOnPreAuth: HttpServiceSetup['registerOnPreAuth']; @@ -307,6 +308,7 @@ export class HttpServer { ), basePath: basePathService, csp: config.csp, + prototypeHardening: config.prototypeHardening, auth: { get: this.authState.get, isAuthenticated: this.authState.isAuthenticated, diff --git a/src/core/packages/http/server-internal/src/http_service.ts b/src/core/packages/http/server-internal/src/http_service.ts index 5392b61d8bc1f..3681346b4ff28 100644 --- a/src/core/packages/http/server-internal/src/http_service.ts +++ b/src/core/packages/http/server-internal/src/http_service.ts @@ -129,6 +129,7 @@ export class HttpService this.internalPreboot = { externalUrl: new ExternalUrlConfig(config.externalUrl), csp: prebootSetup.csp, + prototypeHardening: prebootSetup.prototypeHardening, staticAssets: prebootSetup.staticAssets, basePath: prebootSetup.basePath, registerStaticDir: prebootSetup.registerStaticDir.bind(prebootSetup), diff --git a/src/core/packages/http/server-internal/src/types.ts b/src/core/packages/http/server-internal/src/types.ts index 0b6e6ad903b23..51c268ef1ccb8 100644 --- a/src/core/packages/http/server-internal/src/types.ts +++ b/src/core/packages/http/server-internal/src/types.ts @@ -38,6 +38,7 @@ export interface InternalHttpServicePreboot | 'registerRouteHandlerContext' | 'server' | 'getServerInfo' + | 'prototypeHardening' > { registerRoutes< DefaultRequestHandlerType extends RequestHandlerContextBase = RequestHandlerContextBase @@ -54,6 +55,7 @@ export interface InternalHttpServiceSetup server: HttpServerSetup['server']; staticAssets: InternalStaticAssets; externalUrl: ExternalUrlConfig; + prototypeHardening: boolean; createRouter: <Context extends RequestHandlerContextBase = RequestHandlerContextBase>( path: string, plugin?: PluginOpaqueId diff --git a/src/core/packages/rendering/server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap b/src/core/packages/rendering/server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap index c1754bce247a9..2950ce51b8457 100644 --- a/src/core/packages/rendering/server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap +++ b/src/core/packages/rendering/server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap @@ -32,6 +32,8 @@ function kbnBundlesLoader() { } var kbnCsp = JSON.parse(document.querySelector('kbn-csp').getAttribute('data')); +var kbnHardenPrototypes = JSON.parse(document.querySelector('kbn-prototype-hardening').getAttribute('data')); +window.__kbnHardenPrototypes__ = kbnHardenPrototypes.hardenPrototypes; window.__kbnStrictCsp__ = kbnCsp.strictCsp; window.__kbnThemeTag__ = \\"v8light\\"; window.__kbnPublicPath__ = {\\"foo\\": \\"bar\\"}; diff --git a/src/core/packages/rendering/server-internal/src/bootstrap/render_template.ts b/src/core/packages/rendering/server-internal/src/bootstrap/render_template.ts index da9ce12122664..843d42307f02d 100644 --- a/src/core/packages/rendering/server-internal/src/bootstrap/render_template.ts +++ b/src/core/packages/rendering/server-internal/src/bootstrap/render_template.ts @@ -49,6 +49,8 @@ function kbnBundlesLoader() { } var kbnCsp = JSON.parse(document.querySelector('kbn-csp').getAttribute('data')); +var kbnHardenPrototypes = JSON.parse(document.querySelector('kbn-prototype-hardening').getAttribute('data')); +window.__kbnHardenPrototypes__ = kbnHardenPrototypes.hardenPrototypes; window.__kbnStrictCsp__ = kbnCsp.strictCsp; window.__kbnThemeTag__ = "${themeTag}"; window.__kbnPublicPath__ = ${publicPathMap}; diff --git a/src/core/packages/rendering/server-internal/src/rendering_service.tsx b/src/core/packages/rendering/server-internal/src/rendering_service.tsx index babf533e51dba..7ed024e88c211 100644 --- a/src/core/packages/rendering/server-internal/src/rendering_service.tsx +++ b/src/core/packages/rendering/server-internal/src/rendering_service.tsx @@ -244,6 +244,7 @@ export class RenderingService { const bootstrapScript = isAnonymousPage ? 'bootstrap-anonymous.js' : 'bootstrap.js'; const metadata: RenderingMetadata = { strictCsp: http.csp.strict, + hardenPrototypes: http.prototypeHardening, uiPublicUrl: `${staticAssetsHrefBase}/ui`, bootstrapScriptUrl: `${basePath}/${bootstrapScript}`, locale, diff --git a/src/core/packages/rendering/server-internal/src/types.ts b/src/core/packages/rendering/server-internal/src/types.ts index 1897ffdc08eb3..35bd9d9d21ff5 100644 --- a/src/core/packages/rendering/server-internal/src/types.ts +++ b/src/core/packages/rendering/server-internal/src/types.ts @@ -28,6 +28,7 @@ import type { InternalFeatureFlagsSetup } from '@kbn/core-feature-flags-server-i /** @internal */ export interface RenderingMetadata { + hardenPrototypes: ICspConfig['strict']; strictCsp: ICspConfig['strict']; uiPublicUrl: string; bootstrapScriptUrl: string; diff --git a/src/core/packages/rendering/server-internal/src/views/template.tsx b/src/core/packages/rendering/server-internal/src/views/template.tsx index d3556287a0333..83f9a05f167f8 100644 --- a/src/core/packages/rendering/server-internal/src/views/template.tsx +++ b/src/core/packages/rendering/server-internal/src/views/template.tsx @@ -28,6 +28,7 @@ export const Template: FunctionComponent<Props> = ({ scriptPaths, injectedMetadata, bootstrapScriptUrl, + hardenPrototypes, strictCsp, customBranding, }, @@ -74,6 +75,9 @@ export const Template: FunctionComponent<Props> = ({ {createElement('kbn-csp', { data: JSON.stringify({ strictCsp }), })} + {createElement('kbn-prototype-hardening', { + data: JSON.stringify({ hardenPrototypes }), + })} {createElement('kbn-injected-metadata', { data: JSON.stringify(injectedMetadata) })} <div className="kbnWelcomeView" diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 4bd937d3fc8fd..b8b9d2dafaf21 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -165,6 +165,7 @@ kibana_vars=( server.name server.port server.protocol + server.prototypeHardening server.publicBaseUrl server.requestId.allowFromAnyIp server.requestId.ipAllowlist diff --git a/src/platform/packages/private/kbn-ui-shared-deps-src/BUILD.bazel b/src/platform/packages/private/kbn-ui-shared-deps-src/BUILD.bazel index f14402dfa88c1..7d84db05f99d5 100644 --- a/src/platform/packages/private/kbn-ui-shared-deps-src/BUILD.bazel +++ b/src/platform/packages/private/kbn-ui-shared-deps-src/BUILD.bazel @@ -32,6 +32,7 @@ webpack_cli( "//src/platform/packages/shared/kbn-crypto-browser", "//src/platform/packages/shared/kbn-es-query", "//src/platform/packages/shared/kbn-search-errors", + "//src/platform/packages/shared/kbn-security-hardening", "//src/platform/packages/shared/kbn-std", "//src/platform/packages/shared/kbn-safer-lodash-set", "//packages/kbn-peggy", diff --git a/src/platform/packages/private/kbn-ui-shared-deps-src/src/entry.js b/src/platform/packages/private/kbn-ui-shared-deps-src/src/entry.js index 74025ceb7f476..c76d3bb433589 100644 --- a/src/platform/packages/private/kbn-ui-shared-deps-src/src/entry.js +++ b/src/platform/packages/private/kbn-ui-shared-deps-src/src/entry.js @@ -8,6 +8,15 @@ */ require('./polyfills'); +// Optional prototype hardening. This must occur immediately after polyfills. +if (typeof window.__kbnHardenPrototypes__ !== 'boolean') { + throw new Error( + 'Invariant bootstrap failure: __kbnHardenPrototypes__ must be set to true or false' + ); +} +if (window.__kbnHardenPrototypes__) { + require('@kbn/security-hardening/prototype'); +} export const Jquery = require('jquery'); window.$ = window.jQuery = Jquery; diff --git a/src/platform/packages/shared/kbn-security-hardening/BUILD.bazel b/src/platform/packages/shared/kbn-security-hardening/BUILD.bazel new file mode 100644 index 0000000000000..a5920312aea2e --- /dev/null +++ b/src/platform/packages/shared/kbn-security-hardening/BUILD.bazel @@ -0,0 +1,32 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/test_helpers.ts", + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +BUNDLER_DEPS = [ +] + +js_library( + name = "kbn-security-hardening", + package_name = "@kbn/security-hardening", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + visibility = ["//visibility:public"], +) diff --git a/src/platform/packages/shared/kbn-security-hardening/README.md b/src/platform/packages/shared/kbn-security-hardening/README.md index 5f040d006bbf0..7835bfebe17e3 100644 --- a/src/platform/packages/shared/kbn-security-hardening/README.md +++ b/src/platform/packages/shared/kbn-security-hardening/README.md @@ -4,4 +4,8 @@ A package counterpart of `src/setup_node_env/harden` - containing overrides, uti ## console -When running in production mode (`process.env.NODE_ENV === 'production'`), global console methods `debug`, `error`, `info`, `log`, `trace`, and `warn` are overridden to implement input sanitization. The export `unsafeConsole` provides access to the unmodified global console methods. \ No newline at end of file +When running in production mode (`process.env.NODE_ENV === 'production'`), global console methods `debug`, `error`, `info`, `log`, `trace`, and `warn` are overridden to implement input sanitization. The export `unsafeConsole` provides access to the unmodified global console methods. + +## prototype + +The prototypes of most built-in classes are sealed to mitigate many prototype pollution vulnerabilities. \ No newline at end of file diff --git a/src/platform/packages/shared/kbn-security-hardening/index.ts b/src/platform/packages/shared/kbn-security-hardening/index.ts index b652e3ba472e8..5df510f12f9cf 100644 --- a/src/platform/packages/shared/kbn-security-hardening/index.ts +++ b/src/platform/packages/shared/kbn-security-hardening/index.ts @@ -7,4 +7,5 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import './prototype'; export { unsafeConsole } from './console'; diff --git a/src/platform/packages/shared/kbn-security-hardening/prototype.ts b/src/platform/packages/shared/kbn-security-hardening/prototype.ts new file mode 100644 index 0000000000000..61e9fe974bd1b --- /dev/null +++ b/src/platform/packages/shared/kbn-security-hardening/prototype.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +/** + * Harden the prototypes of built-in objects to prevent prototype pollution attacks. + * This function should be called after the polyfills have been loaded, as some polyfills require the prototypes to be mutable. + * The one known requirement is corejs mutating the Array prototype. + */ +function hardenPrototypesPostPolyfill() { + // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal + // > The Object.seal() static method seals an object. + // > Sealing an object prevents extensions and makes existing properties non-configurable. + // > A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, + // > their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. + // > Values of existing properties can still be changed as long as they are writable. + // Object.freeze would take this one step further, and prevent the values of the properties from being changed as well. + // This is not currently feasible for Kibana, as this functionality is required for some of the libraries that we use, such as react-dom/server. + // While Object.seal() is not a silver bullet, it does provide a good balance between security and compatibility. + // The goal is to prevent a majority of prototype pollution vulnerabilities that can be exploited by an attacker. + + // ** IMPORTANT ** + // This is used both in the browser and in Node.js. + // For Node.js, we _additionally_ seal most prototypes in `src/setup_node_env/harden/prototype.js`. + // This results in sealing most prototypes twice on the server, with the exception of `Array.prototype`, which is only sealed here. + // The extra seal is a no-op, but it is done to ensure that the same code is run in both environments. + + Object.seal(Object.prototype); + Object.seal(Number.prototype); + Object.seal(String.prototype); + Object.seal(Function.prototype); + Object.seal(Array.prototype); +} + +// Use of the `KBN_UNSAFE_DISABLE_PROTOTYPE_HARDENING` environment variable is discouraged, and should only be set to facilitate testing +// specific scenarios. This should never be set in production. +if (!process.env.KBN_UNSAFE_DISABLE_PROTOTYPE_HARDENING) { + hardenPrototypesPostPolyfill(); +} diff --git a/src/setup_node_env/harden/prototype.js b/src/setup_node_env/harden/prototype.js index ebc9b0c31f963..4ea65e3ce6928 100644 --- a/src/setup_node_env/harden/prototype.js +++ b/src/setup_node_env/harden/prototype.js @@ -24,7 +24,8 @@ function hardenPrototypes() { Object.seal(String.prototype); Object.seal(Function.prototype); - // corejs currently manipulates Array.prototype, so we cannot seal it. + // corejs currently manipulates Array.prototype, so we cannot seal it here. + // this is instead sealed within `src/platform/packages/shared/kbn-security-hardening/prototype.ts` } module.exports = hardenPrototypes; diff --git a/test/common/config.js b/test/common/config.js index 2809354a4d730..d47745d6c4c7b 100644 --- a/test/common/config.js +++ b/test/common/config.js @@ -29,6 +29,7 @@ export default function () { sourceArgs: ['--no-base-path', '--env.name=development'], serverArgs: [ `--server.port=${kbnTestConfig.getPort()}`, + `--server.prototypeHardening=true`, '--status.allowAnonymous=true', // We shouldn't embed credentials into the URL since Kibana requests to Elasticsearch should // either include `kibanaServerTestUser` credentials, or credentials provided by the test diff --git a/test/plugin_functional/plugins/hardening/common/pollute.ts b/test/plugin_functional/plugins/hardening/common/pollute.ts new file mode 100644 index 0000000000000..9e0ae6ad25eec --- /dev/null +++ b/test/plugin_functional/plugins/hardening/common/pollute.ts @@ -0,0 +1,85 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export interface PollutionResult { + object: { prototype?: Record<any, any>; error?: string }; + number: { prototype?: Record<any, any>; error?: string }; + string: { prototype?: Record<any, any>; error?: string }; + boolean: { prototype?: Record<any, any>; error?: string }; + fn: { prototype?: Record<any, any>; error?: string }; + array: { prototype?: Record<any, any>; error?: string }; +} + +export function tryPollutingPrototypes(): PollutionResult { + const result: PollutionResult = { + object: {}, + number: {}, + string: {}, + boolean: {}, + fn: {}, + array: {}, + }; + + // Attempt to pollute Object.prototype + try { + (({}) as any).__proto__.polluted = true; + } catch (e) { + result.object.error = e.message; + } finally { + result.object.prototype = { ...Object.keys(Object.getPrototypeOf({})) }; + } + + // Attempt to pollute String.prototype + try { + ('asdf' as any).__proto__.polluted = true; + } catch (e) { + result.string.error = e.message; + } finally { + result.string.prototype = { ...Object.keys(Object.getPrototypeOf('asf')) }; + } + + // Attempt to pollute Number.prototype + try { + (12 as any).__proto__.polluted = true; + } catch (e) { + result.number.error = e.message; + } finally { + result.number.prototype = { ...Object.keys(Object.getPrototypeOf(12)) }; + } + + // Attempt to pollute Boolean.prototype + try { + (true as any).__proto__.polluted = true; + } catch (e) { + result.boolean.error = e.message; + } finally { + result.boolean.prototype = { ...Object.keys(Object.getPrototypeOf(true)) }; + } + + // Attempt to pollute Function.prototype + const fn = function fn() {}; + try { + (fn as any).__proto__.polluted = true; + } catch (e) { + result.fn.error = e.message; + } finally { + result.fn.prototype = { ...Object.keys(Object.getPrototypeOf(fn)) }; + } + + // Attempt to pollute Array.prototype + try { + ([] as any).__proto__.polluted = true; + } catch (e) { + result.array.error = e.message; + } finally { + result.array.prototype = { ...Object.keys(Object.getPrototypeOf([])) }; + } + + return result; +} diff --git a/test/plugin_functional/plugins/hardening/kibana.jsonc b/test/plugin_functional/plugins/hardening/kibana.jsonc index c5680af0dd35e..ea69485d8dc46 100644 --- a/test/plugin_functional/plugins/hardening/kibana.jsonc +++ b/test/plugin_functional/plugins/hardening/kibana.jsonc @@ -5,7 +5,7 @@ "plugin": { "id": "hardeningPlugin", "server": true, - "browser": false, + "browser": true, "configPath": [ "hardening_plugin" ] diff --git a/test/plugin_functional/plugins/hardening/public/application.tsx b/test/plugin_functional/plugins/hardening/public/application.tsx new file mode 100644 index 0000000000000..3fa6d664806ae --- /dev/null +++ b/test/plugin_functional/plugins/hardening/public/application.tsx @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { EuiPageTemplate, EuiTitle, EuiText } from '@elastic/eui'; +import ReactDOM from 'react-dom'; +import { AppMountParameters, CoreStart } from '@kbn/core/public'; +import { tryPollutingPrototypes } from '../common/pollute'; + +export const renderApp = (_core: CoreStart, { element }: AppMountParameters) => { + const result = JSON.stringify(tryPollutingPrototypes(), null, 2); + + ReactDOM.render( + <EuiPageTemplate restrictWidth="1000px"> + <EuiPageTemplate.Header> + <EuiTitle size="l"> + <h1>Hardening tests</h1> + </EuiTitle> + </EuiPageTemplate.Header> + <EuiPageTemplate.Section> + <EuiTitle> + <h2>Goal of this page</h2> + </EuiTitle> + <EuiText> + <p> + The goal of this page is to attempt to pollute prototypes client-side, and report on the + success/failure of these attempts. + </p> + </EuiText> + </EuiPageTemplate.Section> + <EuiPageTemplate.Section> + <EuiTitle> + <h2>Result</h2> + </EuiTitle> + <EuiText> + <pre data-test-subj="pollution-result">{result}</pre> + </EuiText> + </EuiPageTemplate.Section> + </EuiPageTemplate>, + element + ); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/test/plugin_functional/plugins/hardening/public/index.ts b/test/plugin_functional/plugins/hardening/public/index.ts new file mode 100644 index 0000000000000..1b921cb715f5b --- /dev/null +++ b/test/plugin_functional/plugins/hardening/public/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { HardeningPlugin } from './plugin'; + +export function plugin() { + return new HardeningPlugin(); +} diff --git a/test/plugin_functional/plugins/hardening/public/plugin.ts b/test/plugin_functional/plugins/hardening/public/plugin.ts new file mode 100644 index 0000000000000..edfd81d1cbf1b --- /dev/null +++ b/test/plugin_functional/plugins/hardening/public/plugin.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { AppMountParameters, CoreSetup, Plugin } from '@kbn/core/public'; + +export class HardeningPlugin implements Plugin<HardeningPluginSetup, HardeningPluginStart> { + public setup(core: CoreSetup) { + core.application.register({ + id: 'hardeningPlugin', + title: 'Hardening Plugin', + async mount(params: AppMountParameters) { + const { renderApp } = await import('./application'); + const [coreStart] = await core.getStartServices(); + coreStart.chrome.docTitle.change('Hardening test'); + return renderApp(coreStart, params); + }, + }); + + // Return methods that should be available to other plugins + return {}; + } + + public start() {} + public stop() {} +} + +export type HardeningPluginSetup = ReturnType<HardeningPlugin['setup']>; +export type HardeningPluginStart = ReturnType<HardeningPlugin['start']>; diff --git a/test/plugin_functional/plugins/hardening/server/plugin.ts b/test/plugin_functional/plugins/hardening/server/plugin.ts index 34f00d8bbc402..5ac68e2524d0f 100644 --- a/test/plugin_functional/plugins/hardening/server/plugin.ts +++ b/test/plugin_functional/plugins/hardening/server/plugin.ts @@ -8,6 +8,7 @@ */ import type { Plugin, CoreSetup } from '@kbn/core/server'; +import { tryPollutingPrototypes } from '../common/pollute'; export class HardeningPlugin implements Plugin { public setup(core: CoreSetup, deps: {}) { @@ -17,59 +18,7 @@ export class HardeningPlugin implements Plugin { validate: false, }, async (context, request, response) => { - const result: Record<string, { prototype?: Record<any, any>; error?: string }> = { - object: {}, - number: {}, - string: {}, - fn: {}, - array: {}, - }; - // Attempt to pollute Object.prototype - try { - (({}) as any).__proto__.polluted = true; - } catch (e) { - result.object.error = e.message; - } finally { - result.object.prototype = { ...Object.keys(Object.getPrototypeOf({})) }; - } - - // Attempt to pollute String.prototype - try { - ('asdf' as any).__proto__.polluted = true; - } catch (e) { - result.string.error = e.message; - } finally { - result.string.prototype = { ...Object.keys(Object.getPrototypeOf('asf')) }; - } - - // Attempt to pollute Number.prototype - try { - (12 as any).__proto__.polluted = true; - } catch (e) { - result.number.error = e.message; - } finally { - result.number.prototype = { ...Object.keys(Object.getPrototypeOf(12)) }; - } - - // Attempt to pollute Function.prototype - const fn = function fn() {}; - try { - (fn as any).__proto__.polluted = true; - } catch (e) { - result.fn.error = e.message; - } finally { - result.fn.prototype = { ...Object.keys(Object.getPrototypeOf(fn)) }; - } - - // Attempt to pollute Array.prototype - try { - ([] as any).__proto__.polluted = true; - } catch (e) { - result.array.error = e.message; - } finally { - result.array.prototype = { ...Object.keys(Object.getPrototypeOf([])) }; - } - + const result = tryPollutingPrototypes(); return response.ok({ body: result }); } ); diff --git a/test/plugin_functional/plugins/hardening/tsconfig.json b/test/plugin_functional/plugins/hardening/tsconfig.json index bf146797a42ee..a77d8eabace45 100644 --- a/test/plugin_functional/plugins/hardening/tsconfig.json +++ b/test/plugin_functional/plugins/hardening/tsconfig.json @@ -5,6 +5,9 @@ }, "include": [ "index.ts", + "common/**/*.ts", + "public/**/*.ts", + "public/**/*.tsx", "server/**/*.ts", "../../../../typings/**/*", ], diff --git a/test/plugin_functional/snapshots/baseline/hardening/prototype.json b/test/plugin_functional/snapshots/baseline/hardening/prototype_client.json similarity index 52% rename from test/plugin_functional/snapshots/baseline/hardening/prototype.json rename to test/plugin_functional/snapshots/baseline/hardening/prototype_client.json index 4e3a9d8219492..f543cc8b147f4 100644 --- a/test/plugin_functional/snapshots/baseline/hardening/prototype.json +++ b/test/plugin_functional/snapshots/baseline/hardening/prototype_client.json @@ -1 +1 @@ -{"object":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"number":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"string":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"fn":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"array":{"prototype":{"0":"polluted"}}} \ No newline at end of file +{"object":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"number":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"string":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"boolean":{"prototype":{"0":"polluted"}},"fn":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"array":{"error":"Cannot add property polluted, object is not extensible","prototype":{}}} \ No newline at end of file diff --git a/test/plugin_functional/snapshots/baseline/hardening/prototype_server.json b/test/plugin_functional/snapshots/baseline/hardening/prototype_server.json new file mode 100644 index 0000000000000..f543cc8b147f4 --- /dev/null +++ b/test/plugin_functional/snapshots/baseline/hardening/prototype_server.json @@ -0,0 +1 @@ +{"object":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"number":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"string":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"boolean":{"prototype":{"0":"polluted"}},"fn":{"error":"Cannot add property polluted, object is not extensible","prototype":{}},"array":{"error":"Cannot add property polluted, object is not extensible","prototype":{}}} \ No newline at end of file diff --git a/test/plugin_functional/test_suites/hardening/prototype.ts b/test/plugin_functional/test_suites/hardening/prototype.ts index 7343d52812c8f..fc5d602bda60e 100644 --- a/test/plugin_functional/test_suites/hardening/prototype.ts +++ b/test/plugin_functional/test_suites/hardening/prototype.ts @@ -7,20 +7,35 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import expect from '@kbn/expect'; import type { PluginFunctionalProviderContext } from '../../services'; -export default function ({ getService }: PluginFunctionalProviderContext) { +export default function ({ getService, getPageObjects }: PluginFunctionalProviderContext) { + const PageObjects = getPageObjects(['common', 'header']); + const browser = getService('browser'); const supertest = getService('supertest'); const snapshots = getService('snapshots'); + const testSubjects = getService('testSubjects'); describe('prototype', function () { - it('does not allow polluting most prototypes', async () => { + it('does not allow polluting most prototypes on the server', async () => { const response = await supertest .get('/api/hardening/_pollute_prototypes') .set('kbn-xsrf', 'true') .expect(200); - await snapshots.compareAgainstBaseline('hardening/prototype', response.body); + await snapshots.compareAgainstBaseline('hardening/prototype_server', response.body); + }); + + it('does not allow polluting most prototypes on the client', async () => { + const pageTitle = 'Hardening test - Elastic'; + + await PageObjects.common.navigateToApp('hardeningPlugin'); + await PageObjects.header.waitUntilLoadingHasFinished(); + expect(await browser.getTitle()).eql(pageTitle); + + const resultText = await testSubjects.getVisibleText('pollution-result'); + await snapshots.compareAgainstBaseline('hardening/prototype_client', JSON.parse(resultText)); }); }); } diff --git a/x-pack/platform/plugins/private/canvas/public/components/home/my_workpads/upload_dropzone.component.tsx b/x-pack/platform/plugins/private/canvas/public/components/home/my_workpads/upload_dropzone.component.tsx index 1f48965559353..699f69b4d8be9 100644 --- a/x-pack/platform/plugins/private/canvas/public/components/home/my_workpads/upload_dropzone.component.tsx +++ b/x-pack/platform/plugins/private/canvas/public/components/home/my_workpads/upload_dropzone.component.tsx @@ -6,7 +6,6 @@ */ import React, { FC, PropsWithChildren } from 'react'; -// @ts-expect-error untyped library import Dropzone from 'react-dropzone'; import './upload_dropzone.scss'; @@ -21,14 +20,23 @@ export const UploadDropzone: FC<PropsWithChildren<Props>> = ({ disabled, children, }) => { + const dropFn = (acceptedFiles: File[]) => { + const fileList = acceptedFiles as unknown as FileList; + onDrop(fileList); + }; return ( - <Dropzone - {...{ onDrop, disabled }} - disableClick - className="canvasWorkpad__dropzone" - activeClassName="canvasWorkpad__dropzone--active" - > - {children} + <Dropzone {...{ onDrop: dropFn, disabled }} noClick> + {({ getRootProps, isDragActive }) => ( + <div + {...getRootProps({ + className: `canvasWorkpad__dropzone${ + isDragActive ? ' canvasWorkpad__dropzone--active' : '' + }`, + })} + > + {children} + </div> + )} </Dropzone> ); }; diff --git a/x-pack/platform/plugins/private/canvas/storybook/storyshots.skipped_test.tsx b/x-pack/platform/plugins/private/canvas/storybook/storyshots.skipped_test.tsx index c5b33cd240e6c..fbfc5e835df97 100644 --- a/x-pack/platform/plugins/private/canvas/storybook/storyshots.skipped_test.tsx +++ b/x-pack/platform/plugins/private/canvas/storybook/storyshots.skipped_test.tsx @@ -71,9 +71,9 @@ jest.mock('@kbn/presentation-util-plugin/public/components/expression_input'); // @ts-expect-error ExpressionInput.mockImplementation(() => 'ExpressionInput'); -// @ts-expect-error untyped library import Dropzone from 'react-dropzone'; jest.mock('react-dropzone'); +// @ts-expect-error untyped library Dropzone.mockImplementation(() => 'Dropzone'); // This element uses a `ref` and cannot be rendered by Jest snapshots. diff --git a/x-pack/test_serverless/shared/config.base.ts b/x-pack/test_serverless/shared/config.base.ts index 191e1a967f7b7..8f917dfc87255 100644 --- a/x-pack/test_serverless/shared/config.base.ts +++ b/x-pack/test_serverless/shared/config.base.ts @@ -111,6 +111,7 @@ export default async () => { serverArgs: [ `--server.restrictInternalApis=true`, `--server.port=${servers.kibana.port}`, + `--server.prototypeHardening=true`, '--status.allowAnonymous=true', `--migrations.zdt.runOnRoles=${JSON.stringify(['ui'])}`, // We shouldn't embed credentials into the URL since Kibana requests to Elasticsearch should diff --git a/yarn.lock b/yarn.lock index e0923f065c9ca..d6048638d7ce7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13997,13 +13997,6 @@ atomic-sleep@^1.0.0: resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== -attr-accept@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-1.1.3.tgz#48230c79f93790ef2775fcec4f0db0f5db41ca52" - integrity sha512-iT40nudw8zmCweivz6j58g+RT33I4KbaIvRUhjNmDwO2WmsQUxFEZZYZ5w3vXe5x5MX9D7mfvA/XaLOZYFR9EQ== - dependencies: - core-js "^2.5.0" - attr-accept@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" @@ -27543,14 +27536,6 @@ react-dropzone@^11.7.1: file-selector "^0.4.0" prop-types "^15.8.1" -react-dropzone@^4.2.9: - version "4.3.0" - resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-4.3.0.tgz#facdd7db16509772633c9f5200621ac01aa6706f" - integrity sha512-ULfrLaTSsd8BDa9KVAGCueuq1AN3L14dtMsGGqtP0UwYyjG4Vhf158f/ITSHuSPYkZXbvfcIiOlZsH+e3QWm+Q== - dependencies: - attr-accept "^1.1.3" - prop-types "^15.5.7" - react-element-to-jsx-string@^14.3.4: version "14.3.4" resolved "https://registry.yarnpkg.com/react-element-to-jsx-string/-/react-element-to-jsx-string-14.3.4.tgz#709125bc72f06800b68f9f4db485f2c7d31218a8" From b266cafe5910cbcca7f8cffb392590f5c2981fa8 Mon Sep 17 00:00:00 2001 From: Lisa Cawley <lcawley@elastic.co> Date: Tue, 28 Jan 2025 14:04:42 -0800 Subject: [PATCH 23/26] Add migration guide to doc link service (#208455) --- src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts | 2 ++ src/platform/packages/shared/kbn-doc-links/src/types.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts b/src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts index ad76bb9369cd9..7b39986c796c6 100644 --- a/src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts +++ b/src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts @@ -293,6 +293,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D xpackSecurity: `${KIBANA_DOCS}xpack-security.html`, restApis: `${KIBANA_DOCS}api.html`, dashboardImportExport: `${KIBANA_DOCS}dashboard-api.html`, + upgradeNotes: `${KIBANA_DOCS}breaking-changes-summary.html`, }, upgradeAssistant: { overview: `${KIBANA_DOCS}upgrade-assistant.html`, @@ -396,6 +397,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D typesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`, setupUpgrade: `${ELASTICSEARCH_DOCS}setup-upgrade.html`, apiCompatibilityHeader: `${ELASTICSEARCH_DOCS}api-conventions.html#api-compatibility`, + migrationGuide: `${ELASTICSEARCH_DOCS}breaking-changes.html`, }, siem: { guide: `${SECURITY_SOLUTION_DOCS}index.html`, diff --git a/src/platform/packages/shared/kbn-doc-links/src/types.ts b/src/platform/packages/shared/kbn-doc-links/src/types.ts index a065b7a9f6db9..ece18b02d602c 100644 --- a/src/platform/packages/shared/kbn-doc-links/src/types.ts +++ b/src/platform/packages/shared/kbn-doc-links/src/types.ts @@ -254,6 +254,7 @@ export interface DocLinks { readonly secureSavedObject: string; readonly xpackSecurity: string; readonly dashboardImportExport: string; + readonly upgradeNotes: string; }; readonly upgradeAssistant: { readonly overview: string; From 71566f38dcb4d27b35986e7dfb0171b86c005843 Mon Sep 17 00:00:00 2001 From: seanrathier <sean.rathier@gmail.com> Date: Tue, 28 Jan 2025 17:09:13 -0500 Subject: [PATCH 24/26] [Cloud Security] Fixing FTR test for agentless default remove Beta badge from CSPM Agentless (#208314) --- .../translations/translations/fr-FR.json | 2 - .../translations/translations/ja-JP.json | 2 - .../translations/translations/zh-CN.json | 2 - .../setup_technology_selector.tsx | 60 ++++--------------- .../agentless/create_agent.ts | 4 +- .../agentless/security_posture.ts | 7 +-- 6 files changed, 18 insertions(+), 59 deletions(-) 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 d7bb8e680e339..071c64395c219 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -14776,8 +14776,6 @@ "xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDescription": "Configurer l'intégration sans agent", "xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDisplay": "Sans agent", "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay": "Sans agent", - "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.label": "Bêta", - "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.tooltip": "Cette fonctionnalité est en version d'évaluation technique et pourra être modifiée dans une future version. Nous vous remercions de bien vouloir nous aider en nous signalant tout bug.", "xpack.csp.fleetIntegration.setupTechnology.setupTechnologyLabel": "Technologie de configuration", "xpack.csp.fleetIntegration.setupTechnology.setupTechnologyPlaceholder": "Sélectionner la technologie de configuration", "xpack.csp.flyout.moreActionsButton": "Plus d'actions", 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 e49af049a1670..74d8a7b462a53 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -14642,8 +14642,6 @@ "xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDescription": "エージェントなしで統合を設定", "xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDisplay": "エージェントレス", "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay": "エージェントレス", - "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.label": "ベータ", - "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.tooltip": "この機能はテクニカルプレビュー中であり、将来のリリースでは変更される場合があります。不具合が発生したら報告してください。", "xpack.csp.fleetIntegration.setupTechnology.setupTechnologyLabel": "セットアップ技術", "xpack.csp.fleetIntegration.setupTechnology.setupTechnologyPlaceholder": "セットアップ技術を選択", "xpack.csp.flyout.moreActionsButton": "さらにアクションを表示", 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 dbfbd9a428be0..c0690f9afccf8 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -14375,8 +14375,6 @@ "xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDescription": "不使用代理设置集成", "xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDisplay": "无代理", "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay": "无代理", - "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.label": "公测版", - "xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.tooltip": "此功能处于技术预览状态,在未来版本中可能会发生更改。请通过报告错误来帮助我们。", "xpack.csp.fleetIntegration.setupTechnology.setupTechnologyLabel": "设置技术", "xpack.csp.fleetIntegration.setupTechnology.setupTechnologyPlaceholder": "选择设置技术", "xpack.csp.flyout.moreActionsButton": "更多操作", diff --git a/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx index 8353ec8f9847f..bb851fc1f7620 100644 --- a/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx +++ b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx @@ -9,9 +9,7 @@ import React from 'react'; import { SetupTechnology } from '@kbn/fleet-plugin/public'; import { FormattedMessage } from '@kbn/i18n-react'; -import { i18n } from '@kbn/i18n'; import { - EuiBetaBadge, EuiAccordion, EuiFormRow, EuiLink, @@ -19,9 +17,6 @@ import { EuiSuperSelect, EuiText, useGeneratedHtmlId, - EuiFlexItem, - EuiFlexGroup, - useEuiTheme, } from '@elastic/eui'; import { SETUP_TECHNOLOGY_SELECTOR_ACCORDION_TEST_SUBJ, @@ -37,47 +32,6 @@ export const SetupTechnologySelector = ({ setupTechnology: SetupTechnology; onSetupTechnologyChange: (value: SetupTechnology) => void; }) => { - const { euiTheme } = useEuiTheme(); - const agentlessOptionBadge = (isDropDownDisplay: boolean) => { - const title = isDropDownDisplay ? ( - <strong> - <FormattedMessage - id="xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDisplay" - defaultMessage="Agentless" - /> - </strong> - ) : ( - <FormattedMessage - id="xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay" - defaultMessage="Agentless" - /> - ); - return ( - <EuiFlexGroup alignItems="center" responsive={false}> - <EuiFlexItem grow={false}>{title}</EuiFlexItem> - <EuiFlexItem css={{ paddingTop: !isDropDownDisplay ? euiTheme.size.xs : undefined }}> - <EuiBetaBadge - label={i18n.translate( - 'xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.label', - { - defaultMessage: 'Beta', - } - )} - size="m" - color="hollow" - tooltipContent={i18n.translate( - 'xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay.techPreviewBadge.tooltip', - { - defaultMessage: - 'This functionality is in technical preview and may be changed in a future release. Please help us by reporting any bugs.', - } - )} - /> - </EuiFlexItem> - </EuiFlexGroup> - ); - }; - const options = [ { value: SetupTechnology.AGENT_BASED, @@ -109,11 +63,21 @@ export const SetupTechnologySelector = ({ }, { value: SetupTechnology.AGENTLESS, - inputDisplay: agentlessOptionBadge(false), + inputDisplay: ( + <FormattedMessage + id="xpack.csp.fleetIntegration.setupTechnology.agentlessInputDisplay" + defaultMessage="Agentless" + /> + ), 'data-test-subj': 'setup-technology-agentless-option', dropdownDisplay: ( <> - {agentlessOptionBadge(true)} + <strong> + <FormattedMessage + id="xpack.csp.fleetIntegration.setupTechnology.agentlessDrowpownDisplay" + defaultMessage="Agentless" + /> + </strong> <EuiText size="s" color="subdued"> <p> <FormattedMessage diff --git a/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts b/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts index d169d985ba1e9..bd146d9a48a8c 100644 --- a/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts +++ b/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts @@ -29,7 +29,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const AWS_SINGLE_ACCOUNT_TEST_ID = 'awsSingleTestId'; // Failing: See https://github.com/elastic/kibana/issues/208495 - describe.skip('Agentless cloud', function () { + describe('Agentless cloud', function () { let cisIntegration: typeof pageObjects.cisAddIntegration; let cisIntegrationAws: typeof pageObjects.cisAddIntegration.cisAws; let mockApiServer: http.Server; @@ -155,6 +155,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_SINGLE_ACCOUNT_TEST_ID); await cisIntegration.inputIntegrationName(integrationPolicyName); + await cisIntegration.selectSetupTechnology('agent-based'); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickSaveButton(); await pageObjects.header.waitUntilLoadingHasFinished(); diff --git a/x-pack/test/cloud_security_posture_functional/agentless/security_posture.ts b/x-pack/test/cloud_security_posture_functional/agentless/security_posture.ts index 93e5dd9fb72d2..a358b0730b9f5 100644 --- a/x-pack/test/cloud_security_posture_functional/agentless/security_posture.ts +++ b/x-pack/test/cloud_security_posture_functional/agentless/security_posture.ts @@ -6,8 +6,8 @@ */ import expect from '@kbn/expect'; -import type { FtrProviderContext } from '../ftr_provider_context'; import { AGENTLESS_SECURITY_POSTURE_PACKAGE_VERSION } from '../constants'; +import type { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getPageObjects, getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); @@ -27,7 +27,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const SETUP_TECHNOLOGY_SELECTOR = 'setup-technology-selector-accordion'; // Failing: See https://github.com/elastic/kibana/issues/208533 - describe.skip('Agentless Security Posture Integration Options', function () { + describe('Agentless Security Posture Integration Options', function () { let cisIntegration: typeof pageObjects.cisAddIntegration; before(async () => { @@ -70,7 +70,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); it(`should show cspm with agentless option`, async () => { - // const integrationPolicyName = `cloud_security_posture-${new Date().toISOString()}`; await cisIntegration.navigateToAddIntegrationWithVersionPage( AGENTLESS_SECURITY_POSTURE_PACKAGE_VERSION ); @@ -82,7 +81,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const hasAgentBased = await testSubjects.exists(POLICY_NAME_FIELD); expect(hasSetupTechnologySelector).to.be(true); - expect(hasAgentBased).to.be(true); + expect(hasAgentBased).to.be(false); }); }); } From b998946003273245f9ea851ad60347c9f83c593a Mon Sep 17 00:00:00 2001 From: Lukas Olson <lukas@elastic.co> Date: Tue, 28 Jan 2025 15:13:53 -0700 Subject: [PATCH 25/26] Add warnings to upgrade assistant for search sessions (#206998) ## Summary Part of https://github.com/elastic/kibana/issues/203925. Resolves https://github.com/elastic/kibana/issues/205813. Adds warning messages to the upgrade assistant if a cluster has unexpired search sessions, since the feature is being disabled by default and will have to be explicitly re-enabled to manage the sessions. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com> --- docs/upgrade-notes.asciidoc | 22 +++++ .../data/server/config_deprecations.test.ts | 6 +- .../shared/data/server/config_deprecations.ts | 16 ++-- .../shared/data/server/deprecations/index.ts | 10 ++ .../server/deprecations/search_sessions.ts | 93 +++++++++++++++++++ .../plugins/shared/data/server/plugin.ts | 2 + .../plugins/shared/data/tsconfig.json | 1 + 7 files changed, 139 insertions(+), 11 deletions(-) create mode 100644 src/platform/plugins/shared/data/server/deprecations/index.ts create mode 100644 src/platform/plugins/shared/data/server/deprecations/search_sessions.ts diff --git a/docs/upgrade-notes.asciidoc b/docs/upgrade-notes.asciidoc index d35a35ff686a4..2835541a821a0 100644 --- a/docs/upgrade-notes.asciidoc +++ b/docs/upgrade-notes.asciidoc @@ -320,4 +320,26 @@ Systems that use HTTP/1 or don't have TLS configured will get a deprecation warn Verify that TLS is properly configured by enabling it and providing valid certificates in the settings. Test your system to ensure that connections are established securely over HTTP/2. If your Kibana server is hosted behind a load balancer or reverse proxy we recommend testing your deployment configuration before upgrading to 9.0. +==== + + +[discrete] +[[known-issue-206998]] +.Search sessions disabled by default (9.0.0) +[%collapsible] +==== +*Details* + +Starting from version 9.0.0, search sessions are disabled by default. To view, manage, and restore search sessions, the feature needs to be explicitly re-enabled. + +*Impact* + +Search sessions will be disabled unless they are explicitly enabled in config.yml. + +*Action* + +If you would like to continue using, managing, and restoring search sessions in 9.0, you'll need to re-enable the feature in your kibana.yml configuration file. If not, no action is necessary. + +To re-enable search sessions, add the following in your config.yml: + +``` +data.search.sessions.enabled: true +``` ==== \ No newline at end of file diff --git a/src/platform/plugins/shared/data/server/config_deprecations.test.ts b/src/platform/plugins/shared/data/server/config_deprecations.test.ts index 1a103ca695549..c208c4093b2b3 100644 --- a/src/platform/plugins/shared/data/server/config_deprecations.test.ts +++ b/src/platform/plugins/shared/data/server/config_deprecations.test.ts @@ -62,7 +62,7 @@ describe('Config Deprecations', () => { expect(messages).toMatchInlineSnapshot(` Array [ "Setting \\"xpack.data_enhanced.search.sessions\\" has been replaced by \\"data.search.sessions\\"", - "Configuring \\"data.search.sessions.enabled\\" is deprecated and will be removed in 9.0.0.", + "Configuring \\"data.search.sessions.enabled\\" is deprecated and will be removed in 9.1.0.", ] `); }); @@ -103,7 +103,7 @@ describe('Config Deprecations', () => { "You no longer need to configure \\"data.search.sessions.expireInterval\\".", "You no longer need to configure \\"data.search.sessions.monitoringTaskTimeout\\".", "You no longer need to configure \\"data.search.sessions.notTouchedInProgressTimeout\\".", - "Configuring \\"data.search.sessions.enabled\\" is deprecated and will be removed in 9.0.0.", + "Configuring \\"data.search.sessions.enabled\\" is deprecated and will be removed in 9.1.0.", ] `); }); @@ -147,7 +147,7 @@ describe('Config Deprecations', () => { "You no longer need to configure \\"data.search.sessions.expireInterval\\".", "You no longer need to configure \\"data.search.sessions.monitoringTaskTimeout\\".", "You no longer need to configure \\"data.search.sessions.notTouchedInProgressTimeout\\".", - "Configuring \\"data.search.sessions.enabled\\" is deprecated and will be removed in 9.0.0.", + "Configuring \\"data.search.sessions.enabled\\" is deprecated and will be removed in 9.1.0.", ] `); }); diff --git a/src/platform/plugins/shared/data/server/config_deprecations.ts b/src/platform/plugins/shared/data/server/config_deprecations.ts index 3235369082839..95e3fc941dcce 100644 --- a/src/platform/plugins/shared/data/server/config_deprecations.ts +++ b/src/platform/plugins/shared/data/server/config_deprecations.ts @@ -27,12 +27,12 @@ export const configDeprecationProvider: ConfigDeprecationProvider = ({ unusedFromRoot('data.search.sessions.notTouchedInProgressTimeout', { level }), // Search sessions config deprecations - deprecateFromRoot('data.search.sessions.enabled', '9.0.0', { level }), - deprecateFromRoot('data.search.sessions.notTouchedTimeout', '9.0.0', { level }), - deprecateFromRoot('data.search.sessions.maxUpdateRetries', '9.0.0', { level }), - deprecateFromRoot('data.search.sessions.defaultExpiration', '9.0.0', { level }), - deprecateFromRoot('data.search.sessions.management.maxSessions', '9.0.0', { level }), - deprecateFromRoot('data.search.sessions.management.refreshInterval', '9.0.0', { level }), - deprecateFromRoot('data.search.sessions.management.refreshTimeout', '9.0.0', { level }), - deprecateFromRoot('data.search.sessions.management.expiresSoonWarning', '9.0.0', { level }), + deprecateFromRoot('data.search.sessions.enabled', '9.1.0', { level }), + deprecateFromRoot('data.search.sessions.notTouchedTimeout', '9.1.0', { level }), + deprecateFromRoot('data.search.sessions.maxUpdateRetries', '9.1.0', { level }), + deprecateFromRoot('data.search.sessions.defaultExpiration', '9.1.0', { level }), + deprecateFromRoot('data.search.sessions.management.maxSessions', '9.1.0', { level }), + deprecateFromRoot('data.search.sessions.management.refreshInterval', '9.1.0', { level }), + deprecateFromRoot('data.search.sessions.management.refreshTimeout', '9.1.0', { level }), + deprecateFromRoot('data.search.sessions.management.expiresSoonWarning', '9.1.0', { level }), ]; diff --git a/src/platform/plugins/shared/data/server/deprecations/index.ts b/src/platform/plugins/shared/data/server/deprecations/index.ts new file mode 100644 index 0000000000000..4baf9c3e1e867 --- /dev/null +++ b/src/platform/plugins/shared/data/server/deprecations/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export { createSearchSessionsDeprecationsConfig } from './search_sessions'; diff --git a/src/platform/plugins/shared/data/server/deprecations/search_sessions.ts b/src/platform/plugins/shared/data/server/deprecations/search_sessions.ts new file mode 100644 index 0000000000000..2fdd42fd2d898 --- /dev/null +++ b/src/platform/plugins/shared/data/server/deprecations/search_sessions.ts @@ -0,0 +1,93 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { + CoreSetup, + DeprecationsDetails, + GetDeprecationsContext, + RegisterDeprecationsConfig, + SavedObjectsFindResult, +} from '@kbn/core/server'; +import { i18n } from '@kbn/i18n'; +import type { DeprecationDetailsMessage } from '@kbn/core-deprecations-common'; +import { SEARCH_SESSION_TYPE, SearchSessionSavedObjectAttributes } from '../../common'; + +type SearchSessionAttributes = Pick< + SearchSessionSavedObjectAttributes, + 'name' | 'username' | 'expires' +>; + +export const createSearchSessionsDeprecationsConfig: ( + core: CoreSetup +) => RegisterDeprecationsConfig = (core: CoreSetup) => ({ + getDeprecations: async (context: GetDeprecationsContext): Promise<DeprecationsDetails[]> => { + const searchSessionsLink = core.http.basePath.prepend('/app/management/kibana/search_sessions'); + const [coreStart] = await core.getStartServices(); + const savedObjectsClient = coreStart.savedObjects.getScopedClient(context.request, { + includedHiddenTypes: [SEARCH_SESSION_TYPE], + }); + const results = await savedObjectsClient.find<SearchSessionAttributes>({ + type: 'search-session', + perPage: 1000, + fields: ['name', 'username', 'expires'], + sortField: 'created', + sortOrder: 'desc', + namespaces: ['*'], + }); + + const searchSessions: Array<SavedObjectsFindResult<SearchSessionAttributes>> = + results.saved_objects.filter((so) => new Date(so.attributes.expires).getTime() > Date.now()); + + if (!searchSessions.length) { + return []; + } + + return [ + { + title: i18n.translate('data.deprecations.searchSessionsTitle', { + defaultMessage: 'Search sessions will be disabled by default', + }), + message: buildMessage({ searchSessions, searchSessionsLink }), + deprecationType: 'feature', + level: 'warning', + correctiveActions: { + manualSteps: [ + i18n.translate('data.deprecations.searchSessions.manualStepOneMessage', { + defaultMessage: 'Navigate to Stack Management > Kibana > Search Sessions', + }), + i18n.translate('data.deprecations.searchSessions.manualStepTwoMessage', { + defaultMessage: 'Delete search sessions that have not expired', + }), + i18n.translate('data.deprecations.searchSessions.manualStepTwoMessage', { + defaultMessage: + 'Alternatively, to continue using search sessions until 9.1, open the kibana.yml config file and add the following: "data.search.sessions.enabled: true"', + }), + ], + }, + }, + ]; + }, +}); + +const buildMessage = ({ + searchSessions, + searchSessionsLink, +}: { + searchSessions: Array<SavedObjectsFindResult<SearchSessionAttributes>>; + searchSessionsLink: string; +}): DeprecationDetailsMessage => ({ + type: 'markdown', + content: i18n.translate('data.deprecations.scriptedFieldsMessage', { + defaultMessage: `The search sessions feature is deprecated and is disabled by default in 9.0. You currently have {numberOfSearchSessions} active search session(s): [Manage Search Sessions]({searchSessionsLink})`, + values: { + numberOfSearchSessions: searchSessions.length, + searchSessionsLink, + }, + }), +}); diff --git a/src/platform/plugins/shared/data/server/plugin.ts b/src/platform/plugins/shared/data/server/plugin.ts index c18353960db57..885e4a3c1368e 100644 --- a/src/platform/plugins/shared/data/server/plugin.ts +++ b/src/platform/plugins/shared/data/server/plugin.ts @@ -12,6 +12,7 @@ import { ExpressionsServerSetup } from '@kbn/expressions-plugin/server'; import { PluginStart as DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/server'; +import { createSearchSessionsDeprecationsConfig } from './deprecations'; import { ConfigSchema } from './config'; import type { ISearchSetup, ISearchStart } from './search'; import { DatatableUtilitiesService } from './datatable_utilities'; @@ -90,6 +91,7 @@ export class DataServerPlugin this.kqlTelemetryService.setup(core, { usageCollection }); core.uiSettings.register(getUiSettings(core.docLinks, this.config.enableUiSettingsValidations)); + core.deprecations.registerDeprecations(createSearchSessionsDeprecationsConfig(core)); const searchSetup = this.searchService.setup(core, { expressions, diff --git a/src/platform/plugins/shared/data/tsconfig.json b/src/platform/plugins/shared/data/tsconfig.json index 007bc3aecd16a..dcccae71b5057 100644 --- a/src/platform/plugins/shared/data/tsconfig.json +++ b/src/platform/plugins/shared/data/tsconfig.json @@ -54,6 +54,7 @@ "@kbn/safer-lodash-set", "@kbn/esql-utils", "@kbn/shared-ux-table-persist", + "@kbn/core-deprecations-common", ], "exclude": [ "target/**/*", From 7af5a8338bab6da9bc45eccfd21b11129b05048c Mon Sep 17 00:00:00 2001 From: Steph Milovic <stephanie.milovic@elastic.co> Date: Tue, 28 Jan 2025 15:35:39 -0700 Subject: [PATCH 26/26] [Security AI] Add Kibana Support for Security AI Prompts Integration (#207138) --- .../current_fields.json | 9 + .../current_mappings.json | 27 + .../server-internal/src/object_types/index.ts | 2 +- .../check_registered_types.test.ts | 1 + .../registration/type_registrations.test.ts | 1 + .../shared/ai-infra/inference-common/index.ts | 1 + .../ai-infra/inference-common/src/const.ts | 15 + .../ai-infra/inference-common/src/types.ts | 13 + .../context/fixtures/integration.nginx.ts | 1 + .../context/fixtures/integration.okta.ts | 1 + .../package_to_package_policy.test.ts | 1 + .../shared/fleet/common/types/models/epm.ts | 2 + .../integrations/sections/epm/constants.tsx | 6 + .../fleet/server/routes/epm/index.test.ts | 1 + ...kage_policies_to_agent_permissions.test.ts | 6 + .../services/epm/kibana/assets/install.ts | 4 +- .../elastic_assistant/common/constants.ts | 3 + .../scripts/draw_graph_script.ts | 26 + .../server/__mocks__/request_context.ts | 3 +- .../attack_discovery/evaluation/index.test.ts | 19 +- .../lib/attack_discovery/evaluation/index.ts | 7 +- .../edges/generate_or_end/index.test.ts | 1 + .../generate_or_refine_or_end/index.test.ts | 1 + .../edges/refine_or_end/index.test.ts | 1 + .../index.test.ts | 1 + .../default_attack_discovery_graph/index.ts | 9 +- .../index.test.ts | 1 + .../get_alerts_context_prompt/index.test.ts | 6 +- .../index.test.ts | 1 + .../nodes/generate/index.test.ts | 53 +- .../nodes/generate/index.ts | 11 +- .../nodes/generate/schema/index.ts | 84 +-- .../index.test.ts | 19 +- .../index.ts | 13 +- .../index.test.ts | 3 + .../index.ts | 5 +- .../helpers/get_continue_prompt/index.test.ts | 22 - .../helpers/get_continue_prompt/index.ts | 15 - .../index.test.ts | 16 - .../index.ts | 9 - .../helpers/get_output_parser/index.test.ts | 19 +- .../nodes/helpers/get_output_parser/index.ts | 7 +- .../parse_combined_or_throw/index.test.ts | 10 + .../helpers/parse_combined_or_throw/index.ts | 7 +- .../nodes/helpers/prompts/index.test.ts | 118 ++++ .../nodes/helpers/prompts/index.ts | 101 ++++ .../index.test.ts | 1 + .../get_combined_refine_prompt/index.test.ts | 7 +- .../get_combined_refine_prompt/index.ts | 6 +- .../get_default_refine_prompt/index.test.ts | 19 - .../get_default_refine_prompt/index.ts | 11 - .../nodes/refine/index.test.ts | 52 +- .../nodes/refine/index.ts | 13 +- .../nodes/retriever/index.test.ts | 12 +- .../state/index.test.ts | 63 ++- .../state/index.ts | 15 +- .../default_attack_discovery_graph/types.ts | 1 + .../server/lib/langchain/executors/types.ts | 2 + .../graphs/default_assistant_graph/graph.ts | 13 + .../default_assistant_graph/helpers.test.ts | 1 + .../default_assistant_graph/index.test.ts | 15 + .../graphs/default_assistant_graph/index.ts | 28 +- .../nodes/run_agent.ts | 18 +- .../nodes/translations.ts | 78 --- .../graphs/default_assistant_graph/prompts.ts | 36 -- .../graphs/default_assistant_graph/types.ts | 7 + .../server/lib/prompt/get_prompt.test.ts | 520 ++++++++++++++++++ .../server/lib/prompt/get_prompt.ts | 222 ++++++++ .../server/lib/prompt/helpers.ts | 20 + .../server/lib/prompt/index.ts | 9 + .../server/lib/prompt/local_prompt_object.ts | 157 ++++++ .../server/lib/prompt/prompts.ts | 128 +++++ .../lib/prompt/saved_object_mappings.ts | 52 ++ .../server/lib/prompt/types.ts | 17 + .../elastic_assistant/server/plugin.ts | 3 + .../invoke_attack_discovery_graph/index.tsx | 15 +- .../post/post_attack_discovery.ts | 2 + .../server/routes/chat/chat_complete_route.ts | 2 + .../server/routes/evaluate/post_evaluate.ts | 58 +- .../server/routes/helpers.ts | 4 + .../routes/post_actions_connector_execute.ts | 2 + .../server/routes/request_context_factory.ts | 2 +- .../elastic_assistant/server/saved_objects.ts | 18 + .../plugins/elastic_assistant/server/types.ts | 6 +- .../plugins/elastic_assistant/tsconfig.json | 2 + .../view/ingest_manager_integration/mocks.tsx | 1 + 86 files changed, 1921 insertions(+), 399 deletions(-) create mode 100644 x-pack/platform/packages/shared/ai-infra/inference-common/src/const.ts create mode 100644 x-pack/platform/packages/shared/ai-infra/inference-common/src/types.ts delete mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.test.ts delete mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.ts delete mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.test.ts delete mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.test.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.ts delete mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.test.ts delete mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.ts delete mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.test.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/helpers.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/index.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/local_prompt_object.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/prompts.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/saved_object_mappings.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/types.ts create mode 100644 x-pack/solutions/security/plugins/elastic_assistant/server/saved_objects.ts diff --git a/packages/kbn-check-mappings-update-cli/current_fields.json b/packages/kbn-check-mappings-update-cli/current_fields.json index fcb6a89e3284a..38766ac438b02 100644 --- a/packages/kbn-check-mappings-update-cli/current_fields.json +++ b/packages/kbn-check-mappings-update-cli/current_fields.json @@ -914,6 +914,15 @@ "username" ], "search-telemetry": [], + "security-ai-prompt": [ + "description", + "model", + "prompt", + "prompt.default", + "promptGroupId", + "promptId", + "provider" + ], "security-rule": [ "rule_id", "version" diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json index fc76793d4223f..9f41f0839c431 100644 --- a/packages/kbn-check-mappings-update-cli/current_mappings.json +++ b/packages/kbn-check-mappings-update-cli/current_mappings.json @@ -3023,6 +3023,33 @@ "dynamic": false, "properties": {} }, + "security-ai-prompt": { + "dynamic": false, + "properties": { + "description": { + "type": "text" + }, + "model": { + "type": "keyword" + }, + "prompt": { + "properties": { + "default": { + "type": "text" + } + } + }, + "promptGroupId": { + "type": "keyword" + }, + "promptId": { + "type": "keyword" + }, + "provider": { + "type": "keyword" + } + } + }, "security-rule": { "dynamic": false, "properties": { diff --git a/src/core/packages/saved-objects/server-internal/src/object_types/index.ts b/src/core/packages/saved-objects/server-internal/src/object_types/index.ts index 6246c59b8e943..6bf3232a79307 100644 --- a/src/core/packages/saved-objects/server-internal/src/object_types/index.ts +++ b/src/core/packages/saved-objects/server-internal/src/object_types/index.ts @@ -11,4 +11,4 @@ export { registerCoreObjectTypes } from './registration'; // set minimum number of registered saved objects to ensure no object types are removed after 8.8 // declared in internal implementation exclicilty to prevent unintended changes. -export const SAVED_OBJECT_TYPES_COUNT = 127 as const; +export const SAVED_OBJECT_TYPES_COUNT = 128 as const; diff --git a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts index 187ed884f068d..8e1b64633df2f 100644 --- a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts +++ b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts @@ -157,6 +157,7 @@ describe('checking migration metadata changes on all registered SO types', () => "search": "0aa6eefb37edd3145be340a8b67779c2ca578b22", "search-session": "b2fcd840e12a45039ada50b1355faeafa39876d1", "search-telemetry": "b568601618744720b5662946d3103e3fb75fe8ee", + "security-ai-prompt": "cc8ee5aaa9d001e89c131bbd5af6bc80bc271046", "security-rule": "07abb4d7e707d91675ec0495c73816394c7b521f", "security-solution-signals-migration": "9d99715fe5246f19de2273ba77debd2446c36bb1", "siem-detection-engine-rule-actions": "54f08e23887b20da7c805fab7c60bc67c428aff9", diff --git a/src/core/server/integration_tests/saved_objects/registration/type_registrations.test.ts b/src/core/server/integration_tests/saved_objects/registration/type_registrations.test.ts index cee7f307ee67d..97bce6b66c919 100644 --- a/src/core/server/integration_tests/saved_objects/registration/type_registrations.test.ts +++ b/src/core/server/integration_tests/saved_objects/registration/type_registrations.test.ts @@ -123,6 +123,7 @@ const previouslyRegisteredTypes = [ 'search', 'search-session', 'search-telemetry', + 'security-ai-prompt', 'security-rule', 'security-solution-signals-migration', 'risk-engine-configuration', diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts index 585851f8d66da..1c869a9fb8d71 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts @@ -96,6 +96,7 @@ export { isInferenceRequestError, isInferenceRequestAbortedError, } from './src/errors'; +export { elasticModelDictionary } from './src/const'; export { truncateList } from './src/truncate_list'; export { diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/const.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/const.ts new file mode 100644 index 0000000000000..ff95d39469d4e --- /dev/null +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/const.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ElasticModelDictionary } from './types'; + +export const elasticModelDictionary: ElasticModelDictionary = { + 'rainbow-sprinkles': { + provider: 'bedrock', + model: 'us.anthropic.claude-3-5-sonnet-20240620-v1:0', + }, +}; diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/types.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/types.ts new file mode 100644 index 0000000000000..252d6117bbad8 --- /dev/null +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/types.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface ElasticModelDictionary { + [key: string]: { + provider: string; + model: string; + }; +} diff --git a/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.nginx.ts b/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.nginx.ts index 8f47d564c44a2..ea89331156566 100644 --- a/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.nginx.ts +++ b/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.nginx.ts @@ -251,6 +251,7 @@ export const item: GetInfoResponse['item'] = { index_pattern: [], lens: [], map: [], + security_ai_prompt: [], security_rule: [], csp_rule_template: [], tag: [], diff --git a/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.okta.ts b/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.okta.ts index 8778938443661..ddae02803faf0 100644 --- a/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.okta.ts +++ b/x-pack/platform/plugins/shared/fleet/.storybook/context/fixtures/integration.okta.ts @@ -106,6 +106,7 @@ export const item: GetInfoResponse['item'] = { ml_module: [], osquery_pack_asset: [], osquery_saved_query: [], + security_ai_prompt: [], security_rule: [], csp_rule_template: [], tag: [], diff --git a/x-pack/platform/plugins/shared/fleet/common/services/package_to_package_policy.test.ts b/x-pack/platform/plugins/shared/fleet/common/services/package_to_package_policy.test.ts index 8f96c3ffc197d..c800bc4b02151 100644 --- a/x-pack/platform/plugins/shared/fleet/common/services/package_to_package_policy.test.ts +++ b/x-pack/platform/plugins/shared/fleet/common/services/package_to_package_policy.test.ts @@ -33,6 +33,7 @@ describe('Fleet - packageToPackagePolicy', () => { map: [], lens: [], ml_module: [], + security_ai_prompt: [], security_rule: [], tag: [], osquery_pack_asset: [], diff --git a/x-pack/platform/plugins/shared/fleet/common/types/models/epm.ts b/x-pack/platform/plugins/shared/fleet/common/types/models/epm.ts index a2156fdabbe8a..29b9c45e0e71d 100644 --- a/x-pack/platform/plugins/shared/fleet/common/types/models/epm.ts +++ b/x-pack/platform/plugins/shared/fleet/common/types/models/epm.ts @@ -59,6 +59,7 @@ export enum KibanaAssetType { indexPattern = 'index_pattern', map = 'map', mlModule = 'ml_module', + securityAIPrompt = 'security_ai_prompt', securityRule = 'security_rule', cloudSecurityPostureRuleTemplate = 'csp_rule_template', osqueryPackAsset = 'osquery_pack_asset', @@ -77,6 +78,7 @@ export enum KibanaSavedObjectType { indexPattern = 'index-pattern', map = 'map', mlModule = 'ml-module', + securityAIPrompt = 'security-ai-prompt', securityRule = 'security-rule', cloudSecurityPostureRuleTemplate = 'csp-rule-template', osqueryPackAsset = 'osquery-pack-asset', diff --git a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/constants.tsx b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/constants.tsx index c65e5c8d56440..266aae8636710 100644 --- a/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/constants.tsx +++ b/x-pack/platform/plugins/shared/fleet/public/applications/integrations/sections/epm/constants.tsx @@ -47,6 +47,12 @@ export const AssetTitleMap: Record< map: i18n.translate('xpack.fleet.epm.assetTitles.maps', { defaultMessage: 'Maps', }), + 'security-ai-prompt': i18n.translate('xpack.fleet.epm.assetTitles.securityAIPrompt', { + defaultMessage: 'Security AI prompt', + }), + security_ai_prompt: i18n.translate('xpack.fleet.epm.assetTitles.securityAIPrompt', { + defaultMessage: 'Security AI prompt', + }), 'security-rule': i18n.translate('xpack.fleet.epm.assetTitles.securityRules', { defaultMessage: 'Security rules', }), diff --git a/x-pack/platform/plugins/shared/fleet/server/routes/epm/index.test.ts b/x-pack/platform/plugins/shared/fleet/server/routes/epm/index.test.ts index d736cb7c318ba..d89b9ce85c05a 100644 --- a/x-pack/platform/plugins/shared/fleet/server/routes/epm/index.test.ts +++ b/x-pack/platform/plugins/shared/fleet/server/routes/epm/index.test.ts @@ -193,6 +193,7 @@ describe('schema validation', () => { map: [], index_pattern: [], ml_module: [], + security_ai_prompt: [], security_rule: [], tag: [], csp_rule_template: [], diff --git a/x-pack/platform/plugins/shared/fleet/server/services/agent_policies/package_policies_to_agent_permissions.test.ts b/x-pack/platform/plugins/shared/fleet/server/services/agent_policies/package_policies_to_agent_permissions.test.ts index 55d1f0b36ca8e..214117cb15fdb 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/agent_policies/package_policies_to_agent_permissions.test.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/agent_policies/package_policies_to_agent_permissions.test.ts @@ -38,6 +38,7 @@ packageInfoCache.set('test_package-0.0.0', { index_pattern: [], map: [], lens: [], + security_ai_prompt: [], security_rule: [], ml_module: [], tag: [], @@ -122,6 +123,7 @@ packageInfoCache.set('osquery_manager-0.3.0', { index_pattern: [], map: [], lens: [], + security_ai_prompt: [], security_rule: [], ml_module: [], tag: [], @@ -172,6 +174,7 @@ packageInfoCache.set('profiler_symbolizer-8.8.0-preview', { index_pattern: [], map: [], lens: [], + security_ai_prompt: [], security_rule: [], ml_module: [], tag: [], @@ -222,6 +225,7 @@ packageInfoCache.set('profiler_collector-8.9.0-preview', { index_pattern: [], map: [], lens: [], + security_ai_prompt: [], security_rule: [], ml_module: [], tag: [], @@ -264,6 +268,7 @@ packageInfoCache.set('apm-8.9.0-preview', { index_pattern: [], map: [], lens: [], + security_ai_prompt: [], security_rule: [], ml_module: [], tag: [], @@ -306,6 +311,7 @@ packageInfoCache.set('elastic_connectors-1.0.0', { index_pattern: [], map: [], lens: [], + security_ai_prompt: [], security_rule: [], ml_module: [], tag: [], diff --git a/x-pack/platform/plugins/shared/fleet/server/services/epm/kibana/assets/install.ts b/x-pack/platform/plugins/shared/fleet/server/services/epm/kibana/assets/install.ts index d5594f54300b2..5adf1708eb25a 100644 --- a/x-pack/platform/plugins/shared/fleet/server/services/epm/kibana/assets/install.ts +++ b/x-pack/platform/plugins/shared/fleet/server/services/epm/kibana/assets/install.ts @@ -33,9 +33,10 @@ import { deleteKibanaSavedObjectsAssets } from '../../packages/remove'; import { FleetError, KibanaSOReferenceError } from '../../../../errors'; import { withPackageSpan } from '../../packages/utils'; +import { appContextService } from '../../..'; + import { tagKibanaAssets } from './tag_assets'; import { getSpaceAwareSaveobjectsClients } from './saved_objects'; -import { appContextService } from '../../..'; const MAX_ASSETS_TO_INSTALL_IN_PARALLEL = 1000; @@ -70,6 +71,7 @@ export const KibanaSavedObjectTypeMapping: Record<KibanaAssetType, KibanaSavedOb [KibanaAssetType.visualization]: KibanaSavedObjectType.visualization, [KibanaAssetType.lens]: KibanaSavedObjectType.lens, [KibanaAssetType.mlModule]: KibanaSavedObjectType.mlModule, + [KibanaAssetType.securityAIPrompt]: KibanaSavedObjectType.securityAIPrompt, [KibanaAssetType.securityRule]: KibanaSavedObjectType.securityRule, [KibanaAssetType.cloudSecurityPostureRuleTemplate]: KibanaSavedObjectType.cloudSecurityPostureRuleTemplate, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/common/constants.ts b/x-pack/solutions/security/plugins/elastic_assistant/common/constants.ts index 3c3b016870d46..6dffc9147d252 100755 --- a/x-pack/solutions/security/plugins/elastic_assistant/common/constants.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/common/constants.ts @@ -31,3 +31,6 @@ export const CAPABILITIES = `${BASE_PATH}/capabilities`; Licensing requirements */ export const MINIMUM_AI_ASSISTANT_LICENSE = 'enterprise' as const; + +// Saved Objects +export const promptSavedObjectType = 'security-ai-prompt'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/scripts/draw_graph_script.ts b/x-pack/solutions/security/plugins/elastic_assistant/scripts/draw_graph_script.ts index 3b65d307ce385..89c6d7b50c295 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/scripts/draw_graph_script.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/scripts/draw_graph_script.ts @@ -18,6 +18,19 @@ import type { Logger } from '@kbn/logging'; import { ChatPromptTemplate } from '@langchain/core/prompts'; import { FakeLLM } from '@langchain/core/utils/testing'; import { createOpenAIFunctionsAgent } from 'langchain/agents'; +import { actionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock'; +import { savedObjectsClientMock } from '@kbn/core/server/mocks'; +import { + ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_INSIGHTS, + ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_TITLE, + ATTACK_DISCOVERY_CONTINUE, + ATTACK_DISCOVERY_DEFAULT, + ATTACK_DISCOVERY_REFINE, +} from '../server/lib/prompt/prompts'; import { getDefaultAssistantGraph } from '../server/lib/langchain/graphs/default_assistant_graph/graph'; import { getDefaultAttackDiscoveryGraph } from '../server/lib/attack_discovery/graphs/default_attack_discovery_graph'; @@ -49,11 +62,13 @@ async function getAssistantGraph(logger: Logger): Promise<Drawable> { streamRunnable: false, }); const graph = getDefaultAssistantGraph({ + actionsClient: actionsClientMock.create(), agentRunnable, logger, createLlmInstance, tools: [], replacements: {}, + savedObjectsClient: savedObjectsClientMock.create(), }); return graph.getGraph(); } @@ -67,6 +82,17 @@ async function getAttackDiscoveryGraph(logger: Logger): Promise<Drawable> { llm: mockLlm as unknown as ActionsClientLlm, logger, replacements: {}, + prompts: { + default: ATTACK_DISCOVERY_DEFAULT, + refine: ATTACK_DISCOVERY_REFINE, + continue: ATTACK_DISCOVERY_CONTINUE, + detailsMarkdown: ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + entitySummaryMarkdown: ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + mitreAttackTactics: ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + summaryMarkdown: ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + title: ATTACK_DISCOVERY_GENERATION_TITLE, + insights: ATTACK_DISCOVERY_GENERATION_INSIGHTS, + }, size: 20, }); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request_context.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request_context.ts index 3837c158ba199..4c80585d13a70 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request_context.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/__mocks__/request_context.ts @@ -54,8 +54,8 @@ export const createMockClients = () => { getCurrentUser: jest.fn(), inference: jest.fn(), llmTasks: jest.fn(), + savedObjectsClient: core.savedObjects.client, }, - savedObjectsClient: core.savedObjects.client, licensing: { ...licensingMock.createRequestHandlerContext({ license }), @@ -148,6 +148,7 @@ const createElasticAssistantRequestContextMock = ( inference: { getClient: jest.fn() }, llmTasks: { retrieveDocumentationAvailable: jest.fn(), retrieveDocumentation: jest.fn() }, core: clients.core, + savedObjectsClient: clients.elasticAssistant.savedObjectsClient, telemetry: clients.elasticAssistant.telemetry, }; }; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.test.ts index 8154f0b446566..4cf6d7f4c7eb1 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.test.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import type { ActionsClient } from '@kbn/actions-plugin/server'; import type { Connector } from '@kbn/actions-plugin/server/application/connector/types'; import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; @@ -46,7 +45,6 @@ jest.mock('./helpers/get_evaluator_llm', () => { getEvaluatorLlm: jest.fn().mockResolvedValue(mockLlm), }; }); - const actionsClient = { get: jest.fn(), } as unknown as ActionsClient; @@ -61,7 +59,22 @@ const logger = loggerMock.create(); const mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); const runName = 'test-run-name'; -const connectors = [mockExperimentConnector]; +const connectors = [ + { + ...mockExperimentConnector, + prompts: { + default: '', + refine: '', + continue: '', + detailsMarkdown: '', + entitySummaryMarkdown: '', + mitreAttackTactics: '', + summaryMarkdown: '', + title: '', + insights: '', + }, + }, +]; const projectName = 'test-lang-smith-project'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts index 40b0f080fe54a..2de3eb0bdf9d3 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/evaluation/index.ts @@ -16,12 +16,16 @@ import { getLangSmithTracer } from '@kbn/langchain/server/tracers/langsmith'; import { asyncForEach } from '@kbn/std'; import { PublicMethodsOf } from '@kbn/utility-types'; +import { CombinedPrompts } from '../graphs/default_attack_discovery_graph/nodes/helpers/prompts'; import { DEFAULT_EVAL_ANONYMIZATION_FIELDS } from './constants'; import { AttackDiscoveryGraphMetadata } from '../../langchain/graphs'; import { DefaultAttackDiscoveryGraph } from '../graphs/default_attack_discovery_graph'; import { getLlmType } from '../../../routes/utils'; import { runEvaluations } from './run_evaluations'; +interface ConnectorWithPrompts extends Connector { + prompts: CombinedPrompts; +} export const evaluateAttackDiscovery = async ({ actionsClient, attackDiscoveryGraphs, @@ -43,7 +47,7 @@ export const evaluateAttackDiscovery = async ({ attackDiscoveryGraphs: AttackDiscoveryGraphMetadata[]; alertsIndexPattern: string; anonymizationFields?: AnonymizationFieldResponse[]; - connectors: Connector[]; + connectors: ConnectorWithPrompts[]; connectorTimeout: number; datasetName: string; esClient: ElasticsearchClient; @@ -96,6 +100,7 @@ export const evaluateAttackDiscovery = async ({ esClient, llm, logger, + prompts: connector.prompts, size, }); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_end/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_end/index.test.ts index 06dd1529179fa..32104ca5fef64 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_end/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_end/index.test.ts @@ -35,6 +35,7 @@ const graphState: GraphState = { ], combinedGenerations: 'generations', combinedRefinements: 'refinements', + continuePrompt: 'continue', errors: [], generationAttempts: 0, generations: [], diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_refine_or_end/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_refine_or_end/index.test.ts index 585a1bc2dcac3..58f2e1321377f 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_refine_or_end/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/generate_or_refine_or_end/index.test.ts @@ -35,6 +35,7 @@ const graphState: GraphState = { ], combinedGenerations: '', combinedRefinements: '', + continuePrompt: 'continue', errors: [], generationAttempts: 0, generations: [], diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/refine_or_end/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/refine_or_end/index.test.ts index 39934255c069c..9647587bd2e50 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/refine_or_end/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/refine_or_end/index.test.ts @@ -23,6 +23,7 @@ const initialGraphState: GraphState = { anonymizedAlerts: [...mockAnonymizedAlerts], combinedGenerations: 'generations', combinedRefinements: '', + continuePrompt: 'continue', errors: [], generationAttempts: 2, generations: ['gen', 'erations'], diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/retrieve_anonymized_alerts_or_generate/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/retrieve_anonymized_alerts_or_generate/index.test.ts index 06377aa565a12..a03aece049997 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/retrieve_anonymized_alerts_or_generate/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/edges/retrieve_anonymized_alerts_or_generate/index.test.ts @@ -19,6 +19,7 @@ const initialGraphState: GraphState = { anonymizedAlerts: [], combinedGenerations: '', combinedRefinements: '', + continuePrompt: 'continue', errors: [], generationAttempts: 0, generations: [], diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts index 5b8b12656f469..15b65a919dec3 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/index.ts @@ -5,13 +5,14 @@ * 2.0. */ -import type { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { ElasticsearchClient, Logger } from '@kbn/core/server'; import { Replacements } from '@kbn/elastic-assistant-common'; import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; import type { ActionsClientLlm } from '@kbn/langchain/server'; import type { CompiledStateGraph } from '@langchain/langgraph'; import { END, START, StateGraph } from '@langchain/langgraph'; +import { CombinedPrompts } from './nodes/helpers/prompts'; import { NodeType } from './constants'; import { getGenerateOrEndEdge } from './edges/generate_or_end'; import { getGenerateOrRefineOrEndEdge } from './edges/generate_or_refine_or_end'; @@ -32,6 +33,7 @@ export interface GetDefaultAttackDiscoveryGraphParams { llm: ActionsClientLlm; logger?: Logger; onNewReplacements?: (replacements: Replacements) => void; + prompts: CombinedPrompts; replacements?: Replacements; size: number; start?: string; @@ -55,6 +57,7 @@ export const getDefaultAttackDiscoveryGraph = ({ llm, logger, onNewReplacements, + prompts, replacements, size, start, @@ -64,7 +67,7 @@ export const getDefaultAttackDiscoveryGraph = ({ 'generate' | 'refine' | 'retrieve_anonymized_alerts' | '__start__' > => { try { - const graphState = getDefaultGraphState({ end, filter, start }); + const graphState = getDefaultGraphState({ end, filter, prompts, start }); // get nodes: const retrieveAnonymizedAlertsNode = getRetrieveAnonymizedAlertsNode({ @@ -80,11 +83,13 @@ export const getDefaultAttackDiscoveryGraph = ({ const generateNode = getGenerateNode({ llm, logger, + prompts, }); const refineNode = getRefineNode({ llm, logger, + prompts, }); // get edges: diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/discard_previous_generations/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/discard_previous_generations/index.test.ts index 6f3b3b1b909a2..cc611efc90a8b 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/discard_previous_generations/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/discard_previous_generations/index.test.ts @@ -31,6 +31,7 @@ const graphState: GraphState = { ], combinedGenerations: 'combinedGenerations', combinedRefinements: '', + continuePrompt: 'continue', errors: [], generationAttempts: 2, generations: ['combined', 'Generations'], diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_alerts_context_prompt/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_alerts_context_prompt/index.test.ts index 098d2b81f4914..c5b6a26ce613a 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_alerts_context_prompt/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_alerts_context_prompt/index.test.ts @@ -6,13 +6,13 @@ */ import { getAlertsContextPrompt } from '.'; -import { getDefaultAttackDiscoveryPrompt } from '../../../helpers/get_default_attack_discovery_prompt'; +import { ATTACK_DISCOVERY_DEFAULT } from '../../../../../../../prompt/prompts'; describe('getAlertsContextPrompt', () => { it('generates the correct prompt', () => { const anonymizedAlerts = ['Alert 1', 'Alert 2', 'Alert 3']; - const expected = `${getDefaultAttackDiscoveryPrompt()} + const expected = `${ATTACK_DISCOVERY_DEFAULT} Use context from the following alerts to provide insights: @@ -27,7 +27,7 @@ Alert 3 const prompt = getAlertsContextPrompt({ anonymizedAlerts, - attackDiscoveryPrompt: getDefaultAttackDiscoveryPrompt(), + attackDiscoveryPrompt: ATTACK_DISCOVERY_DEFAULT, }); expect(prompt).toEqual(expected); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_anonymized_alerts_from_state/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_anonymized_alerts_from_state/index.test.ts index fb3d541e670df..0d1bc38c123d5 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_anonymized_alerts_from_state/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/helpers/get_anonymized_alerts_from_state/index.test.ts @@ -16,6 +16,7 @@ const graphState: GraphState = { anonymizedAlerts: mockAnonymizedAlerts, // <-- mockAnonymizedAlerts is an array of objects with a pageContent property combinedGenerations: 'combinedGenerations', combinedRefinements: '', + continuePrompt: 'continue', errors: [], generationAttempts: 2, generations: ['combined', 'Generations'], diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.test.ts index 07c3e0007f851..838d5e0eefbdf 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.test.ts @@ -16,13 +16,16 @@ import { } from '../../../../evaluation/__mocks__/mock_anonymized_alerts'; import { getAnonymizedAlertsFromState } from './helpers/get_anonymized_alerts_from_state'; import { getChainWithFormatInstructions } from '../helpers/get_chain_with_format_instructions'; -import { getDefaultAttackDiscoveryPrompt } from '../helpers/get_default_attack_discovery_prompt'; -import { getDefaultRefinePrompt } from '../refine/helpers/get_default_refine_prompt'; import { GraphState } from '../../types'; import { getParsedAttackDiscoveriesMock, getRawAttackDiscoveriesMock, } from '../../../../../../__mocks__/raw_attack_discoveries'; +import { + ATTACK_DISCOVERY_CONTINUE, + ATTACK_DISCOVERY_DEFAULT, + ATTACK_DISCOVERY_REFINE, +} from '../../../../../prompt/prompts'; const attackDiscoveryTimestamp = '2024-10-11T17:55:59.702Z'; @@ -49,10 +52,11 @@ let mockLlm: ActionsClientLlm; const initialGraphState: GraphState = { attackDiscoveries: null, - attackDiscoveryPrompt: getDefaultAttackDiscoveryPrompt(), + attackDiscoveryPrompt: ATTACK_DISCOVERY_DEFAULT, anonymizedAlerts: [...mockAnonymizedAlerts], combinedGenerations: '', combinedRefinements: '', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, errors: [], generationAttempts: 0, generations: [], @@ -61,13 +65,25 @@ const initialGraphState: GraphState = { maxHallucinationFailures: 5, maxRepeatedGenerations: 3, refinements: [], - refinePrompt: getDefaultRefinePrompt(), + refinePrompt: ATTACK_DISCOVERY_REFINE, replacements: { ...mockAnonymizedAlertsReplacements, }, unrefinedResults: null, }; +const prompts = { + default: '', + refine: '', + continue: '', + detailsMarkdown: '', + entitySummaryMarkdown: '', + mitreAttackTactics: '', + summaryMarkdown: '', + title: '', + insights: '', +}; + describe('getGenerateNode', () => { beforeEach(() => { jest.clearAllMocks(); @@ -88,17 +104,20 @@ describe('getGenerateNode', () => { const generateNode = getGenerateNode({ llm: mockLlm, logger: mockLogger, + prompts, }); expect(typeof generateNode).toBe('function'); }); it('invokes the chain with the expected alerts from state and formatting instructions', async () => { - const mockInvoke = getChainWithFormatInstructions(mockLlm).chain.invoke as jest.Mock; + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlm, prompts }).chain + .invoke as jest.Mock; const generateNode = getGenerateNode({ llm: mockLlm, logger: mockLogger, + prompts, }); await generateNode(initialGraphState); @@ -121,7 +140,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} 'You asked for some JSON, here it is:\n```json\n{"key": "value"}\n```\nI hope that works for you.'; const mockLlmWithResponse = new FakeLLM({ response }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(response); @@ -129,6 +148,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const generateNode = getGenerateNode({ llm: mockLlmWithResponse, logger: mockLogger, + prompts, }); const state = await generateNode(initialGraphState); @@ -151,14 +171,15 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const mockLlmWithHallucination = new FakeLLM({ response: hallucinatedResponse, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithHallucination).chain - .invoke as jest.Mock; + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithHallucination, prompts }) + .chain.invoke as jest.Mock; mockInvoke.mockResolvedValue(hallucinatedResponse); const generateNode = getGenerateNode({ llm: mockLlmWithHallucination, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -185,14 +206,17 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const mockLlmWithRepeatedGenerations = new FakeLLM({ response: repeatedResponse, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithRepeatedGenerations).chain - .invoke as jest.Mock; + const mockInvoke = getChainWithFormatInstructions({ + llm: mockLlmWithRepeatedGenerations, + prompts, + }).chain.invoke as jest.Mock; mockInvoke.mockResolvedValue(repeatedResponse); const generateNode = getGenerateNode({ llm: mockLlmWithRepeatedGenerations, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -218,7 +242,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const mockLlmWithResponse = new FakeLLM({ response, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(response); @@ -226,6 +250,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const generateNode = getGenerateNode({ llm: mockLlmWithResponse, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -257,7 +282,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const mockLlmWithResponse = new FakeLLM({ response: secondResponse, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(secondResponse); @@ -265,6 +290,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const generateNode = getGenerateNode({ llm: mockLlmWithResponse, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -296,7 +322,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const mockLlmWithResponse = new FakeLLM({ response: secondResponse, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(secondResponse); @@ -304,6 +330,7 @@ ${getAnonymizedAlertsFromState(initialGraphState).join('\n\n')} const generateNode = getGenerateNode({ llm: mockLlmWithResponse, logger: mockLogger, + prompts, }); const withPreviousGenerations = { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.ts index 0dfe1b0629f58..8ac3f46af6602 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/index.ts @@ -8,6 +8,7 @@ import type { ActionsClientLlm } from '@kbn/langchain/server'; import type { Logger } from '@kbn/core/server'; +import { GenerationPrompts } from '../helpers/prompts'; import { discardPreviousGenerations } from './helpers/discard_previous_generations'; import { extractJson } from '../helpers/extract_json'; import { getAnonymizedAlertsFromState } from './helpers/get_anonymized_alerts_from_state'; @@ -23,9 +24,11 @@ import type { GraphState } from '../../types'; export const getGenerateNode = ({ llm, logger, + prompts, }: { llm: ActionsClientLlm; logger?: Logger; + prompts: GenerationPrompts; }): ((state: GraphState) => Promise<GraphState>) => { const generate = async (state: GraphState): Promise<GraphState> => { logger?.debug(() => `---GENERATE---`); @@ -34,6 +37,7 @@ export const getGenerateNode = ({ const { attackDiscoveryPrompt, + continuePrompt, combinedGenerations, generationAttempts, generations, @@ -50,9 +54,13 @@ export const getGenerateNode = ({ anonymizedAlerts, attackDiscoveryPrompt, combinedMaybePartialResults: combinedGenerations, + continuePrompt, }); - const { chain, formatInstructions, llmType } = getChainWithFormatInstructions(llm); + const { chain, formatInstructions, llmType } = getChainWithFormatInstructions({ + llm, + prompts, + }); logger?.debug( () => `generate node is invoking the chain (${llmType}), attempt ${generationAttempts}` @@ -112,6 +120,7 @@ export const getGenerateNode = ({ llmType, logger, nodeName: 'generate', + prompts, }); // use the unrefined results if we already reached the max number of retries: diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/schema/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/schema/index.ts index 05210799f151c..af6a57b44f4a4 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/schema/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/generate/schema/index.ts @@ -13,72 +13,20 @@ */ import { z } from '@kbn/zod'; +import { GenerationPrompts } from '../../helpers/prompts'; -export const SYNTAX = '{{ field.name fieldValue1 fieldValue2 fieldValueN }}'; -const GOOD_SYNTAX_EXAMPLES = - 'Examples of CORRECT syntax (includes field names and values): {{ host.name hostNameValue }} {{ user.name userNameValue }} {{ source.ip sourceIpValue }}'; - -const BAD_SYNTAX_EXAMPLES = - 'Examples of INCORRECT syntax (bad, because the field names are not included): {{ hostNameValue }} {{ userNameValue }} {{ sourceIpValue }}'; - -const RECONNAISSANCE = 'Reconnaissance'; -const INITIAL_ACCESS = 'Initial Access'; -const EXECUTION = 'Execution'; -const PERSISTENCE = 'Persistence'; -const PRIVILEGE_ESCALATION = 'Privilege Escalation'; -const DISCOVERY = 'Discovery'; -const LATERAL_MOVEMENT = 'Lateral Movement'; -const COMMAND_AND_CONTROL = 'Command and Control'; -const EXFILTRATION = 'Exfiltration'; - -const MITRE_ATTACK_TACTICS = [ - RECONNAISSANCE, - INITIAL_ACCESS, - EXECUTION, - PERSISTENCE, - PRIVILEGE_ESCALATION, - DISCOVERY, - LATERAL_MOVEMENT, - COMMAND_AND_CONTROL, - EXFILTRATION, -] as const; - -export const AttackDiscoveriesGenerationSchema = z.object({ - insights: z - .array( - z.object({ - alertIds: z.string().array().describe(`The alert IDs that the insight is based on.`), - detailsMarkdown: z - .string() - .describe( - `A detailed insight with markdown, where each markdown bullet contains a description of what happened that reads like a story of the attack as it played out and always uses special ${SYNTAX} syntax for field names and values from the source data. ${GOOD_SYNTAX_EXAMPLES} ${BAD_SYNTAX_EXAMPLES}` - ), - entitySummaryMarkdown: z - .string() - .optional() - .describe( - `A short (no more than a sentence) summary of the insight featuring only the host.name and user.name fields (when they are applicable), using the same ${SYNTAX} syntax` - ), - mitreAttackTactics: z - .string() - .array() - .optional() - .describe( - `An array of MITRE ATT&CK tactic for the insight, using one of the following values: ${MITRE_ATTACK_TACTICS.join( - ',' - )}` - ), - summaryMarkdown: z - .string() - .describe(`A markdown summary of insight, using the same ${SYNTAX} syntax`), - title: z - .string() - .describe( - 'A short, no more than 7 words, title for the insight, NOT formatted with special syntax or markdown. This must be as brief as possible.' - ), - }) - ) - .describe( - `Insights with markdown that always uses special ${SYNTAX} syntax for field names and values from the source data. ${GOOD_SYNTAX_EXAMPLES} ${BAD_SYNTAX_EXAMPLES}` - ), -}); +export const getAttackDiscoveriesGenerationSchema = (prompts: GenerationPrompts) => + z.object({ + insights: z + .array( + z.object({ + alertIds: z.string().array().describe(`The alert IDs that the insight is based on.`), + detailsMarkdown: z.string().describe(prompts.detailsMarkdown), + entitySummaryMarkdown: z.string().optional().describe(prompts.entitySummaryMarkdown), + mitreAttackTactics: z.string().array().optional().describe(prompts.mitreAttackTactics), + summaryMarkdown: z.string().describe(prompts.summaryMarkdown), + title: z.string().describe(prompts.title), + }) + ) + .describe(prompts.insights), + }); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.test.ts index fd98af61150b8..36ed8dc85f09e 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.test.ts @@ -9,6 +9,23 @@ import { FakeLLM } from '@langchain/core/utils/testing'; import type { ActionsClientLlm } from '@kbn/langchain/server'; import { getChainWithFormatInstructions } from '.'; +import { + ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_INSIGHTS, + ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_TITLE, +} from '../../../../../../prompt/prompts'; + +const prompts = { + detailsMarkdown: ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + entitySummaryMarkdown: ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + mitreAttackTactics: ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + summaryMarkdown: ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + title: ATTACK_DISCOVERY_GENERATION_TITLE, + insights: ATTACK_DISCOVERY_GENERATION_INSIGHTS, +}; describe('getChainWithFormatInstructions', () => { const mockLlm = new FakeLLM({ @@ -32,7 +49,7 @@ Here is the JSON Schema instance your output must adhere to. Include the enclosi \`\`\` `; - const chainWithFormatInstructions = getChainWithFormatInstructions(mockLlm); + const chainWithFormatInstructions = getChainWithFormatInstructions({ llm: mockLlm, prompts }); expect(chainWithFormatInstructions).toEqual({ chain: expect.any(Object), formatInstructions: expectedFormatInstructions, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.ts index 7eacaad1d7e39..21a2ccb584adf 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_chain_with_format_instructions/index.ts @@ -9,6 +9,7 @@ import type { ActionsClientLlm } from '@kbn/langchain/server'; import { ChatPromptTemplate } from '@langchain/core/prompts'; import { Runnable } from '@langchain/core/runnables'; +import { GenerationPrompts } from '../prompts'; import { getOutputParser } from '../get_output_parser'; interface GetChainWithFormatInstructions { @@ -17,10 +18,14 @@ interface GetChainWithFormatInstructions { llmType: string; } -export const getChainWithFormatInstructions = ( - llm: ActionsClientLlm -): GetChainWithFormatInstructions => { - const outputParser = getOutputParser(); +export const getChainWithFormatInstructions = ({ + llm, + prompts, +}: { + llm: ActionsClientLlm; + prompts: GenerationPrompts; +}): GetChainWithFormatInstructions => { + const outputParser = getOutputParser(prompts); const formatInstructions = outputParser.getFormatInstructions(); const prompt = ChatPromptTemplate.fromTemplate( diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.test.ts index 069dd77bed874..1948618ba8109 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.test.ts @@ -6,12 +6,14 @@ */ import { getCombinedAttackDiscoveryPrompt } from '.'; +import { ATTACK_DISCOVERY_CONTINUE } from '../../../../../../prompt/prompts'; describe('getCombinedAttackDiscoveryPrompt', () => { it('returns the initial query when there are no partial results', () => { const result = getCombinedAttackDiscoveryPrompt({ anonymizedAlerts: ['alert1', 'alert2'], attackDiscoveryPrompt: 'attackDiscoveryPrompt', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, combinedMaybePartialResults: '', }); @@ -31,6 +33,7 @@ alert2 const result = getCombinedAttackDiscoveryPrompt({ anonymizedAlerts: ['alert1', 'alert2'], attackDiscoveryPrompt: 'attackDiscoveryPrompt', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, combinedMaybePartialResults: 'partialResults', }); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.ts index 4c9ac71f8310c..ecc81e57e170a 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_combined_attack_discovery_prompt/index.ts @@ -8,7 +8,6 @@ import { isEmpty } from 'lodash/fp'; import { getAlertsContextPrompt } from '../../generate/helpers/get_alerts_context_prompt'; -import { getContinuePrompt } from '../get_continue_prompt'; /** * Returns the the initial query, or the initial query combined with a @@ -18,11 +17,13 @@ export const getCombinedAttackDiscoveryPrompt = ({ anonymizedAlerts, attackDiscoveryPrompt, combinedMaybePartialResults, + continuePrompt, }: { anonymizedAlerts: string[]; attackDiscoveryPrompt: string; /** combined results that may contain incomplete JSON */ combinedMaybePartialResults: string; + continuePrompt: string; }): string => { const alertsContextPrompt = getAlertsContextPrompt({ anonymizedAlerts, @@ -33,7 +34,7 @@ export const getCombinedAttackDiscoveryPrompt = ({ ? alertsContextPrompt // no partial results yet : `${alertsContextPrompt} -${getContinuePrompt()} +${continuePrompt} """ ${combinedMaybePartialResults} diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.test.ts deleted file mode 100644 index 35dae31a3ae6a..0000000000000 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { getContinuePrompt } from '.'; - -describe('getContinuePrompt', () => { - it('returns the expected prompt string', () => { - const expectedPrompt = `Continue exactly where you left off in the JSON output below, generating only the additional JSON output when it's required to complete your work. The additional JSON output MUST ALWAYS follow these rules: -1) it MUST conform to the schema above, because it will be checked against the JSON schema -2) it MUST escape all JSON special characters (i.e. backslashes, double quotes, newlines, tabs, carriage returns, backspaces, and form feeds), because it will be parsed as JSON -3) it MUST NOT repeat any the previous output, because that would prevent partial results from being combined -4) it MUST NOT restart from the beginning, because that would prevent partial results from being combined -5) it MUST NOT be prefixed or suffixed with additional text outside of the JSON, because that would prevent it from being combined and parsed as JSON: -`; - - expect(getContinuePrompt()).toBe(expectedPrompt); - }); -}); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.ts deleted file mode 100644 index 628ba0531332c..0000000000000 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_continue_prompt/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const getContinuePrompt = - (): string => `Continue exactly where you left off in the JSON output below, generating only the additional JSON output when it's required to complete your work. The additional JSON output MUST ALWAYS follow these rules: -1) it MUST conform to the schema above, because it will be checked against the JSON schema -2) it MUST escape all JSON special characters (i.e. backslashes, double quotes, newlines, tabs, carriage returns, backspaces, and form feeds), because it will be parsed as JSON -3) it MUST NOT repeat any the previous output, because that would prevent partial results from being combined -4) it MUST NOT restart from the beginning, because that would prevent partial results from being combined -5) it MUST NOT be prefixed or suffixed with additional text outside of the JSON, because that would prevent it from being combined and parsed as JSON: -`; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.test.ts deleted file mode 100644 index 6fce86bfceb6f..0000000000000 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { getDefaultAttackDiscoveryPrompt } from '.'; - -describe('getDefaultAttackDiscoveryPrompt', () => { - it('returns the default attack discovery prompt', () => { - expect(getDefaultAttackDiscoveryPrompt()).toEqual( - "You are a cyber security analyst tasked with analyzing security events from Elastic Security to identify and report on potential cyber attacks or progressions. Your report should focus on high-risk incidents that could severely impact the organization, rather than isolated alerts. Present your findings in a way that can be easily understood by anyone, regardless of their technical expertise, as if you were briefing the CISO. Break down your response into sections based on timing, hosts, and users involved. When correlating alerts, use kibana.alert.original_time when it's available, otherwise use @timestamp. Include appropriate context about the affected hosts and users. Describe how the attack progression might have occurred and, if feasible, attribute it to known threat groups. Prioritize high and critical alerts, but include lower-severity alerts if desired. In the description field, provide as much detail as possible, in a bulleted list explaining any attack progressions. Accuracy is of utmost importance. You MUST escape all JSON special characters (i.e. backslashes, double quotes, newlines, tabs, carriage returns, backspaces, and form feeds)." - ); - }); -}); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.ts deleted file mode 100644 index 25bace13d40c8..0000000000000 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_default_attack_discovery_prompt/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const getDefaultAttackDiscoveryPrompt = (): string => - "You are a cyber security analyst tasked with analyzing security events from Elastic Security to identify and report on potential cyber attacks or progressions. Your report should focus on high-risk incidents that could severely impact the organization, rather than isolated alerts. Present your findings in a way that can be easily understood by anyone, regardless of their technical expertise, as if you were briefing the CISO. Break down your response into sections based on timing, hosts, and users involved. When correlating alerts, use kibana.alert.original_time when it's available, otherwise use @timestamp. Include appropriate context about the affected hosts and users. Describe how the attack progression might have occurred and, if feasible, attribute it to known threat groups. Prioritize high and critical alerts, but include lower-severity alerts if desired. In the description field, provide as much detail as possible, in a bulleted list explaining any attack progressions. Accuracy is of utmost importance. You MUST escape all JSON special characters (i.e. backslashes, double quotes, newlines, tabs, carriage returns, backspaces, and form feeds)."; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.test.ts index 569c8cf4e04a5..2fcff45fd3d1c 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.test.ts @@ -5,10 +5,27 @@ * 2.0. */ import { getOutputParser } from '.'; +import { + ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_INSIGHTS, + ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_TITLE, +} from '../../../../../../prompt/prompts'; + +const prompts = { + detailsMarkdown: ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + entitySummaryMarkdown: ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + mitreAttackTactics: ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + summaryMarkdown: ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + title: ATTACK_DISCOVERY_GENERATION_TITLE, + insights: ATTACK_DISCOVERY_GENERATION_INSIGHTS, +}; describe('getOutputParser', () => { it('returns a structured output parser with the expected format instructions', () => { - const outputParser = getOutputParser(); + const outputParser = getOutputParser(prompts); const expected = `You must format your output as a JSON value that adheres to a given \"JSON Schema\" instance. diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.ts index 2ca0d72b63eb4..ac170ead22901 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/get_output_parser/index.ts @@ -7,7 +7,8 @@ import { StructuredOutputParser } from 'langchain/output_parsers'; -import { AttackDiscoveriesGenerationSchema } from '../../generate/schema'; +import { GenerationPrompts } from '../prompts'; +import { getAttackDiscoveriesGenerationSchema } from '../../generate/schema'; -export const getOutputParser = () => - StructuredOutputParser.fromZodSchema(AttackDiscoveriesGenerationSchema); +export const getOutputParser = (prompts: GenerationPrompts) => + StructuredOutputParser.fromZodSchema(getAttackDiscoveriesGenerationSchema(prompts)); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.test.ts index cfbc837a83f66..8aaf6df21b7e7 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.test.ts @@ -10,6 +10,15 @@ import type { Logger } from '@kbn/core/server'; import { parseCombinedOrThrow } from '.'; import { getRawAttackDiscoveriesMock } from '../../../../../../../__mocks__/raw_attack_discoveries'; +const prompts = { + detailsMarkdown: '', + entitySummaryMarkdown: '', + mitreAttackTactics: '', + summaryMarkdown: '', + title: '', + insights: '', +}; + describe('parseCombinedOrThrow', () => { const mockLogger: Logger = { debug: jest.fn(), @@ -28,6 +37,7 @@ describe('parseCombinedOrThrow', () => { nodeName, llmType, logger: mockLogger, + prompts, }; it('returns an Attack discovery for each insight in a valid combined response', () => { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.ts index 3f7a0a9d802b3..e5e1948c80458 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/parse_combined_or_throw/index.ts @@ -8,9 +8,10 @@ import type { Logger } from '@kbn/core/server'; import type { AttackDiscovery } from '@kbn/elastic-assistant-common'; +import { GenerationPrompts } from '../prompts'; import { addTrailingBackticksIfNecessary } from '../add_trailing_backticks_if_necessary'; import { extractJson } from '../extract_json'; -import { AttackDiscoveriesGenerationSchema } from '../../generate/schema'; +import { getAttackDiscoveriesGenerationSchema } from '../../generate/schema'; export const parseCombinedOrThrow = ({ combinedResponse, @@ -18,6 +19,7 @@ export const parseCombinedOrThrow = ({ llmType, logger, nodeName, + prompts, }: { /** combined responses that maybe valid JSON */ combinedResponse: string; @@ -25,6 +27,7 @@ export const parseCombinedOrThrow = ({ nodeName: string; llmType: string; logger?: Logger; + prompts: GenerationPrompts; }): AttackDiscovery[] => { const timestamp = new Date().toISOString(); @@ -42,7 +45,7 @@ export const parseCombinedOrThrow = ({ `${nodeName} node is validating combined response (${llmType}) from attempt ${generationAttempts}` ); - const validatedResponse = AttackDiscoveriesGenerationSchema.parse(unvalidatedParsed); + const validatedResponse = getAttackDiscoveriesGenerationSchema(prompts).parse(unvalidatedParsed); logger?.debug( () => diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.test.ts new file mode 100644 index 0000000000000..88538c1ba942c --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.test.ts @@ -0,0 +1,118 @@ +/* + * Copyright 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 { ActionsClient } from '@kbn/actions-plugin/server'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { PublicMethodsOf } from '@kbn/utility-types'; +import { getAttackDiscoveryPrompts } from '.'; +import { getPromptsByGroupId, promptDictionary } from '../../../../../../prompt'; +import { promptGroupId } from '../../../../../../prompt/local_prompt_object'; + +jest.mock('../../../../../../prompt', () => { + const original = jest.requireActual('../../../../../../prompt'); + return { + ...original, + getPromptsByGroupId: jest.fn(), + }; +}); +const mockGetPromptsByGroupId = getPromptsByGroupId as jest.Mock; + +describe('getAttackDiscoveryPrompts', () => { + const actionsClient = {} as jest.Mocked<PublicMethodsOf<ActionsClient>>; + const savedObjectsClient = {} as jest.Mocked<SavedObjectsClientContract>; + + beforeEach(() => { + jest.clearAllMocks(); + mockGetPromptsByGroupId.mockResolvedValue([ + { promptId: promptDictionary.attackDiscoveryDefault, prompt: 'Default Prompt' }, + { promptId: promptDictionary.attackDiscoveryRefine, prompt: 'Refine Prompt' }, + { promptId: promptDictionary.attackDiscoveryContinue, prompt: 'Continue Prompt' }, + { + promptId: promptDictionary.attackDiscoveryDetailsMarkdown, + prompt: 'Details Markdown Prompt', + }, + { + promptId: promptDictionary.attackDiscoveryEntitySummaryMarkdown, + prompt: 'Entity Summary Markdown Prompt', + }, + { + promptId: promptDictionary.attackDiscoveryMitreAttackTactics, + prompt: 'Mitre Attack Tactics Prompt', + }, + { + promptId: promptDictionary.attackDiscoverySummaryMarkdown, + prompt: 'Summary Markdown Prompt', + }, + { promptId: promptDictionary.attackDiscoveryGenerationTitle, prompt: 'Title Prompt' }, + { promptId: promptDictionary.attackDiscoveryGenerationInsights, prompt: 'Insights Prompt' }, + ]); + }); + + it('should return all prompts', async () => { + const result = await getAttackDiscoveryPrompts({ + actionsClient, + connectorId: 'test-connector-id', + savedObjectsClient, + model: '2', + provider: 'gemini', + }); + + expect(mockGetPromptsByGroupId).toHaveBeenCalledWith( + expect.objectContaining({ + connectorId: 'test-connector-id', + promptGroupId: promptGroupId.attackDiscovery, + model: '2', + provider: 'gemini', + promptIds: [ + promptDictionary.attackDiscoveryDefault, + promptDictionary.attackDiscoveryRefine, + promptDictionary.attackDiscoveryContinue, + promptDictionary.attackDiscoveryDetailsMarkdown, + promptDictionary.attackDiscoveryEntitySummaryMarkdown, + promptDictionary.attackDiscoveryMitreAttackTactics, + promptDictionary.attackDiscoverySummaryMarkdown, + promptDictionary.attackDiscoveryGenerationTitle, + promptDictionary.attackDiscoveryGenerationInsights, + ], + }) + ); + + expect(result).toEqual({ + default: 'Default Prompt', + refine: 'Refine Prompt', + continue: 'Continue Prompt', + detailsMarkdown: 'Details Markdown Prompt', + entitySummaryMarkdown: 'Entity Summary Markdown Prompt', + mitreAttackTactics: 'Mitre Attack Tactics Prompt', + summaryMarkdown: 'Summary Markdown Prompt', + title: 'Title Prompt', + insights: 'Insights Prompt', + }); + }); + + it('should return empty strings for missing prompts', async () => { + mockGetPromptsByGroupId.mockResolvedValue([]); + + const result = await getAttackDiscoveryPrompts({ + actionsClient, + connectorId: 'test-connector-id', + savedObjectsClient, + }); + + expect(result).toEqual({ + default: '', + refine: '', + continue: '', + detailsMarkdown: '', + entitySummaryMarkdown: '', + mitreAttackTactics: '', + summaryMarkdown: '', + title: '', + insights: '', + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.ts new file mode 100644 index 0000000000000..b5f272de3d495 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts/index.ts @@ -0,0 +1,101 @@ +/* + * Copyright 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 { PublicMethodsOf } from '@kbn/utility-types'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import type { Connector } from '@kbn/actions-plugin/server/application/connector/types'; +import { getPromptsByGroupId, promptDictionary } from '../../../../../../prompt'; +import { promptGroupId } from '../../../../../../prompt/local_prompt_object'; + +export interface AttackDiscoveryPrompts { + default: string; + refine: string; + continue: string; +} + +export interface GenerationPrompts { + detailsMarkdown: string; + entitySummaryMarkdown: string; + mitreAttackTactics: string; + summaryMarkdown: string; + title: string; + insights: string; +} + +export interface CombinedPrompts extends AttackDiscoveryPrompts, GenerationPrompts {} + +export const getAttackDiscoveryPrompts = async ({ + actionsClient, + connector, + connectorId, + model, + provider, + savedObjectsClient, +}: { + actionsClient: PublicMethodsOf<ActionsClient>; + connector?: Connector; + connectorId: string; + model?: string; + provider?: string; + savedObjectsClient: SavedObjectsClientContract; +}): Promise<CombinedPrompts> => { + const prompts = await getPromptsByGroupId({ + actionsClient, + connector, + connectorId, + // if in future oss has different prompt, add it as model here + model, + promptGroupId: promptGroupId.attackDiscovery, + promptIds: [ + promptDictionary.attackDiscoveryDefault, + promptDictionary.attackDiscoveryRefine, + promptDictionary.attackDiscoveryContinue, + promptDictionary.attackDiscoveryDetailsMarkdown, + promptDictionary.attackDiscoveryEntitySummaryMarkdown, + promptDictionary.attackDiscoveryMitreAttackTactics, + promptDictionary.attackDiscoverySummaryMarkdown, + promptDictionary.attackDiscoveryGenerationTitle, + promptDictionary.attackDiscoveryGenerationInsights, + ], + provider, + savedObjectsClient, + }); + + return { + default: + prompts.find((prompt) => prompt.promptId === promptDictionary.attackDiscoveryDefault) + ?.prompt || '', + refine: + prompts.find((prompt) => prompt.promptId === promptDictionary.attackDiscoveryRefine) + ?.prompt || '', + continue: + prompts.find((prompt) => prompt.promptId === promptDictionary.attackDiscoveryContinue) + ?.prompt || '', + detailsMarkdown: + prompts.find((prompt) => prompt.promptId === promptDictionary.attackDiscoveryDetailsMarkdown) + ?.prompt || '', + entitySummaryMarkdown: + prompts.find( + (prompt) => prompt.promptId === promptDictionary.attackDiscoveryEntitySummaryMarkdown + )?.prompt || '', + mitreAttackTactics: + prompts.find( + (prompt) => prompt.promptId === promptDictionary.attackDiscoveryMitreAttackTactics + )?.prompt || '', + summaryMarkdown: + prompts.find((prompt) => prompt.promptId === promptDictionary.attackDiscoverySummaryMarkdown) + ?.prompt || '', + title: + prompts.find((prompt) => prompt.promptId === promptDictionary.attackDiscoveryGenerationTitle) + ?.prompt || '', + insights: + prompts.find( + (prompt) => prompt.promptId === promptDictionary.attackDiscoveryGenerationInsights + )?.prompt || '', + }; +}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/discard_previous_refinements/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/discard_previous_refinements/index.test.ts index 1409b3d47473c..70160218334d7 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/discard_previous_refinements/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/discard_previous_refinements/index.test.ts @@ -15,6 +15,7 @@ const initialState: GraphState = { attackDiscoveryPrompt: 'attackDiscoveryPrompt', combinedGenerations: 'generation1generation2', combinedRefinements: 'refinement1', // <-- existing refinements + continuePrompt: 'continue', errors: [], generationAttempts: 3, generations: ['generation1', 'generation2'], diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.test.ts index f955f1b175b5b..b162738857c99 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.test.ts @@ -7,13 +7,14 @@ import { getCombinedRefinePrompt } from '.'; import { mockAttackDiscoveries } from '../../../../../../evaluation/__mocks__/mock_attack_discoveries'; -import { getContinuePrompt } from '../../../helpers/get_continue_prompt'; +import { ATTACK_DISCOVERY_CONTINUE } from '../../../../../../../prompt/prompts'; describe('getCombinedRefinePrompt', () => { it('returns the base query when combinedRefinements is empty', () => { const result = getCombinedRefinePrompt({ attackDiscoveryPrompt: 'Initial query', combinedRefinements: '', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, refinePrompt: 'Refine prompt', unrefinedResults: [...mockAttackDiscoveries], }); @@ -33,6 +34,7 @@ ${JSON.stringify(mockAttackDiscoveries, null, 2)} const result = getCombinedRefinePrompt({ attackDiscoveryPrompt: 'Initial query', combinedRefinements: 'Combined refinements', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, refinePrompt: 'Refine prompt', unrefinedResults: [...mockAttackDiscoveries], }); @@ -47,7 +49,7 @@ ${JSON.stringify(mockAttackDiscoveries, null, 2)} -${getContinuePrompt()} +${ATTACK_DISCOVERY_CONTINUE} """ Combined refinements @@ -60,6 +62,7 @@ Combined refinements const result = getCombinedRefinePrompt({ attackDiscoveryPrompt: 'Initial query', combinedRefinements: '', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, refinePrompt: 'Refine prompt', unrefinedResults: null, }); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.ts index 11ea40a48ae55..656ea2e220372 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_combined_refine_prompt/index.ts @@ -8,19 +8,19 @@ import type { AttackDiscovery } from '@kbn/elastic-assistant-common'; import { isEmpty } from 'lodash/fp'; -import { getContinuePrompt } from '../../../helpers/get_continue_prompt'; - /** * Returns a prompt that combines the initial query, a refine prompt, and partial results */ export const getCombinedRefinePrompt = ({ attackDiscoveryPrompt, combinedRefinements, + continuePrompt, refinePrompt, unrefinedResults, }: { attackDiscoveryPrompt: string; combinedRefinements: string; + continuePrompt: string; refinePrompt: string; unrefinedResults: AttackDiscovery[] | null; }): string => { @@ -38,7 +38,7 @@ ${JSON.stringify(unrefinedResults, null, 2)} ? baseQuery // no partial results yet : `${baseQuery} -${getContinuePrompt()} +${continuePrompt} """ ${combinedRefinements} diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.test.ts deleted file mode 100644 index 95a68524ca31e..0000000000000 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { getDefaultRefinePrompt } from '.'; - -describe('getDefaultRefinePrompt', () => { - it('returns the default refine prompt string', () => { - const result = getDefaultRefinePrompt(); - - expect(result) - .toEqual(`You previously generated the following insights, but sometimes they represent the same attack. - -Combine the insights below, when they represent the same attack; leave any insights that are not combined unchanged:`); - }); -}); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.ts deleted file mode 100644 index 5743316669785..0000000000000 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/helpers/get_default_refine_prompt/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export const getDefaultRefinePrompt = - (): string => `You previously generated the following insights, but sometimes they represent the same attack. - -Combine the insights below, when they represent the same attack; leave any insights that are not combined unchanged:`; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.test.ts index d5b5a333f48f2..0da610229fe39 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.test.ts @@ -16,16 +16,26 @@ import { mockAnonymizedAlertsReplacements, } from '../../../../evaluation/__mocks__/mock_anonymized_alerts'; import { getChainWithFormatInstructions } from '../helpers/get_chain_with_format_instructions'; -import { getDefaultAttackDiscoveryPrompt } from '../helpers/get_default_attack_discovery_prompt'; -import { getDefaultRefinePrompt } from './helpers/get_default_refine_prompt'; import { GraphState } from '../../types'; import { getParsedAttackDiscoveriesMock, getRawAttackDiscoveriesMock, } from '../../../../../../__mocks__/raw_attack_discoveries'; +import { + ATTACK_DISCOVERY_CONTINUE, + ATTACK_DISCOVERY_DEFAULT, + ATTACK_DISCOVERY_REFINE, +} from '../../../../../prompt/prompts'; const attackDiscoveryTimestamp = '2024-10-11T17:55:59.702Z'; - +const prompts = { + detailsMarkdown: '', + entitySummaryMarkdown: '', + mitreAttackTactics: '', + summaryMarkdown: '', + title: '', + insights: '', +}; export const mockUnrefinedAttackDiscoveries: AttackDiscovery[] = [ { title: 'unrefinedTitle1', @@ -67,10 +77,11 @@ let mockLlm: ActionsClientLlm; const initialGraphState: GraphState = { attackDiscoveries: null, - attackDiscoveryPrompt: getDefaultAttackDiscoveryPrompt(), + attackDiscoveryPrompt: ATTACK_DISCOVERY_DEFAULT, anonymizedAlerts: [...mockAnonymizedAlerts], combinedGenerations: 'gen1', combinedRefinements: '', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, errors: [], generationAttempts: 1, generations: ['gen1'], @@ -79,7 +90,7 @@ const initialGraphState: GraphState = { maxHallucinationFailures: 5, maxRepeatedGenerations: 3, refinements: [], - refinePrompt: getDefaultRefinePrompt(), + refinePrompt: ATTACK_DISCOVERY_REFINE, replacements: { ...mockAnonymizedAlertsReplacements, }, @@ -106,17 +117,20 @@ describe('getRefineNode', () => { const refineNode = getRefineNode({ llm: mockLlm, logger: mockLogger, + prompts, }); expect(typeof refineNode).toBe('function'); }); it('invokes the chain with the unrefinedResults from state and format instructions', async () => { - const mockInvoke = getChainWithFormatInstructions(mockLlm).chain.invoke as jest.Mock; + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlm, prompts }).chain + .invoke as jest.Mock; const refineNode = getRefineNode({ llm: mockLlm, logger: mockLogger, + prompts, }); await refineNode(initialGraphState); @@ -125,7 +139,7 @@ describe('getRefineNode', () => { format_instructions: ['mock format instructions'], query: `${initialGraphState.attackDiscoveryPrompt} -${getDefaultRefinePrompt()} +${ATTACK_DISCOVERY_REFINE} \"\"\" ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} @@ -140,7 +154,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} 'You asked for some JSON, here it is:\n```json\n{"key": "value"}\n```\nI hope that works for you.'; const mockLlmWithResponse = new FakeLLM({ response }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(response); @@ -148,6 +162,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const refineNode = getRefineNode({ llm: mockLlm, logger: mockLogger, + prompts, }); const state = await refineNode(initialGraphState); @@ -170,14 +185,15 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const mockLlmWithHallucination = new FakeLLM({ response: hallucinatedResponse, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithHallucination).chain - .invoke as jest.Mock; + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithHallucination, prompts }) + .chain.invoke as jest.Mock; mockInvoke.mockResolvedValue(hallucinatedResponse); const refineNode = getRefineNode({ llm: mockLlmWithHallucination, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -203,14 +219,17 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const mockLlmWithRepeatedGenerations = new FakeLLM({ response: repeatedResponse, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithRepeatedGenerations).chain - .invoke as jest.Mock; + const mockInvoke = getChainWithFormatInstructions({ + llm: mockLlmWithRepeatedGenerations, + prompts, + }).chain.invoke as jest.Mock; mockInvoke.mockResolvedValue(repeatedResponse); const refineNode = getRefineNode({ llm: mockLlmWithRepeatedGenerations, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -236,7 +255,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const mockLlmWithResponse = new FakeLLM({ response, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(response); @@ -244,6 +263,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const refineNode = getRefineNode({ llm: mockLlmWithResponse, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -275,7 +295,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const mockLlmWithResponse = new FakeLLM({ response: secondResponse, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(secondResponse); @@ -283,6 +303,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const refineNode = getRefineNode({ llm: mockLlmWithResponse, logger: mockLogger, + prompts, }); const withPreviousGenerations = { @@ -309,7 +330,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const mockLlmWithResponse = new FakeLLM({ response, }) as unknown as ActionsClientLlm; - const mockInvoke = getChainWithFormatInstructions(mockLlmWithResponse).chain + const mockInvoke = getChainWithFormatInstructions({ llm: mockLlmWithResponse, prompts }).chain .invoke as jest.Mock; mockInvoke.mockResolvedValue(response); @@ -317,6 +338,7 @@ ${JSON.stringify(initialGraphState.unrefinedResults, null, 2)} const refineNode = getRefineNode({ llm: mockLlmWithResponse, logger: mockLogger, + prompts, }); const withPreviousGenerations = { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.ts index d1bed136f6a1c..911e33cc3c035 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/refine/index.ts @@ -6,8 +6,9 @@ */ import type { ActionsClientLlm } from '@kbn/langchain/server'; -import type { Logger } from '@kbn/core/server'; +import { Logger } from '@kbn/core/server'; +import { GenerationPrompts } from '../helpers/prompts'; import { discardPreviousRefinements } from './helpers/discard_previous_refinements'; import { extractJson } from '../helpers/extract_json'; import { getChainWithFormatInstructions } from '../helpers/get_chain_with_format_instructions'; @@ -24,9 +25,11 @@ import type { GraphState } from '../../types'; export const getRefineNode = ({ llm, logger, + prompts, }: { llm: ActionsClientLlm; logger?: Logger; + prompts: GenerationPrompts; }): ((state: GraphState) => Promise<GraphState>) => { const refine = async (state: GraphState): Promise<GraphState> => { logger?.debug(() => '---REFINE---'); @@ -34,6 +37,7 @@ export const getRefineNode = ({ const { attackDiscoveryPrompt, combinedRefinements, + continuePrompt, generationAttempts, hallucinationFailures, maxGenerationAttempts, @@ -51,11 +55,15 @@ export const getRefineNode = ({ const query = getCombinedRefinePrompt({ attackDiscoveryPrompt, combinedRefinements, + continuePrompt, refinePrompt, unrefinedResults, }); - const { chain, formatInstructions, llmType } = getChainWithFormatInstructions(llm); + const { chain, formatInstructions, llmType } = getChainWithFormatInstructions({ + llm, + prompts, + }); logger?.debug( () => `refine node is invoking the chain (${llmType}), attempt ${generationAttempts}` @@ -115,6 +123,7 @@ export const getRefineNode = ({ llmType, logger, nodeName: 'refine', + prompts, }); return { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.test.ts index bfd8bf2ce6953..115a0856c1a35 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/retriever/index.test.ts @@ -11,16 +11,20 @@ import { Replacements } from '@kbn/elastic-assistant-common'; import { getRetrieveAnonymizedAlertsNode } from '.'; import { mockAnonymizedAlerts } from '../../../../evaluation/__mocks__/mock_anonymized_alerts'; -import { getDefaultAttackDiscoveryPrompt } from '../helpers/get_default_attack_discovery_prompt'; -import { getDefaultRefinePrompt } from '../refine/helpers/get_default_refine_prompt'; import type { GraphState } from '../../types'; +import { + ATTACK_DISCOVERY_CONTINUE, + ATTACK_DISCOVERY_DEFAULT, + ATTACK_DISCOVERY_REFINE, +} from '../../../../../prompt/prompts'; const initialGraphState: GraphState = { attackDiscoveries: null, - attackDiscoveryPrompt: getDefaultAttackDiscoveryPrompt(), + attackDiscoveryPrompt: ATTACK_DISCOVERY_DEFAULT, anonymizedAlerts: [], combinedGenerations: '', combinedRefinements: '', + continuePrompt: ATTACK_DISCOVERY_CONTINUE, errors: [], generationAttempts: 0, generations: [], @@ -29,7 +33,7 @@ const initialGraphState: GraphState = { maxHallucinationFailures: 5, maxRepeatedGenerations: 3, refinements: [], - refinePrompt: getDefaultRefinePrompt(), + refinePrompt: ATTACK_DISCOVERY_REFINE, replacements: {}, unrefinedResults: null, }; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.test.ts index d4fb0e0304a0a..afc566fa544d9 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.test.ts @@ -11,110 +11,117 @@ import { DEFAULT_MAX_HALLUCINATION_FAILURES, DEFAULT_MAX_REPEATED_GENERATIONS, } from '../constants'; -import { getDefaultAttackDiscoveryPrompt } from '../nodes/helpers/get_default_attack_discovery_prompt'; -import { getDefaultRefinePrompt } from '../nodes/refine/helpers/get_default_refine_prompt'; - -const defaultAttackDiscoveryPrompt = getDefaultAttackDiscoveryPrompt(); -const defaultRefinePrompt = getDefaultRefinePrompt(); - +import { + ATTACK_DISCOVERY_CONTINUE, + ATTACK_DISCOVERY_DEFAULT, + ATTACK_DISCOVERY_REFINE, +} from '../../../../prompt/prompts'; + +const defaultAttackDiscoveryPrompt = ATTACK_DISCOVERY_DEFAULT; +const defaultRefinePrompt = ATTACK_DISCOVERY_REFINE; +const prompts = { + continue: ATTACK_DISCOVERY_CONTINUE, + default: defaultAttackDiscoveryPrompt, + refine: defaultRefinePrompt, +}; describe('getDefaultGraphState', () => { it('returns the expected default attackDiscoveries', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.attackDiscoveries?.default?.()).toBeNull(); }); it('returns the expected default attackDiscoveryPrompt', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.attackDiscoveryPrompt?.default?.()).toEqual(defaultAttackDiscoveryPrompt); }); it('returns the expected default empty collection of anonymizedAlerts', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.anonymizedAlerts?.default?.()).toHaveLength(0); }); it('returns the expected default combinedGenerations state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.combinedGenerations?.default?.()).toBe(''); }); it('returns the expected default combinedRefinements state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.combinedRefinements?.default?.()).toBe(''); }); it('returns the expected default errors state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.errors?.default?.()).toHaveLength(0); }); it('return the expected default generationAttempts state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.generationAttempts?.default?.()).toBe(0); }); it('returns the expected default generations state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.generations?.default?.()).toHaveLength(0); }); it('returns the expected default hallucinationFailures state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.hallucinationFailures?.default?.()).toBe(0); }); it('returns the expected default refinePrompt state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.refinePrompt?.default?.()).toEqual(defaultRefinePrompt); }); it('returns the expected default maxGenerationAttempts state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.maxGenerationAttempts?.default?.()).toBe(DEFAULT_MAX_GENERATION_ATTEMPTS); }); it('returns the expected default maxHallucinationFailures state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.maxHallucinationFailures?.default?.()).toBe(DEFAULT_MAX_HALLUCINATION_FAILURES); }); it('returns the expected default maxRepeatedGenerations state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.maxRepeatedGenerations?.default?.()).toBe(DEFAULT_MAX_REPEATED_GENERATIONS); }); it('returns the expected default refinements state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.refinements?.default?.()).toHaveLength(0); }); it('returns the expected default replacements state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.replacements?.default?.()).toEqual({}); }); it('returns the expected default unrefinedResults state', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.unrefinedResults?.default?.()).toBeNull(); }); it('returns the expected default end', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.end?.default?.()).toBeUndefined(); }); @@ -122,13 +129,13 @@ describe('getDefaultGraphState', () => { it('returns the expected end when it is provided', () => { const end = '2025-01-02T00:00:00.000Z'; - const state = getDefaultGraphState({ end }); + const state = getDefaultGraphState({ prompts, end }); expect(state.end?.default?.()).toEqual(end); }); it('returns the expected default filter to be undefined', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.filter?.default?.()).toBeUndefined(); }); @@ -155,13 +162,13 @@ describe('getDefaultGraphState', () => { }, }; - const state = getDefaultGraphState({ filter }); + const state = getDefaultGraphState({ prompts, filter }); expect(state.filter?.default?.()).toEqual(filter); }); it('returns the expected default start to be undefined', () => { - const state = getDefaultGraphState(); + const state = getDefaultGraphState({ prompts }); expect(state.start?.default?.()).toBeUndefined(); }); @@ -169,7 +176,7 @@ describe('getDefaultGraphState', () => { it('returns the expected start when it is provided', () => { const start = '2025-01-01T00:00:00.000Z'; - const state = getDefaultGraphState({ start }); + const state = getDefaultGraphState({ prompts, start }); expect(state.start?.default?.()).toEqual(start); }); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.ts index 8a31dbeb4f57f..832af20b8ab82 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/state/index.ts @@ -9,33 +9,34 @@ import { AttackDiscovery, Replacements } from '@kbn/elastic-assistant-common'; import type { Document } from '@langchain/core/documents'; import type { StateGraphArgs } from '@langchain/langgraph'; +import { AttackDiscoveryPrompts } from '../nodes/helpers/prompts'; import { DEFAULT_MAX_GENERATION_ATTEMPTS, DEFAULT_MAX_HALLUCINATION_FAILURES, DEFAULT_MAX_REPEATED_GENERATIONS, } from '../constants'; -import { getDefaultAttackDiscoveryPrompt } from '../nodes/helpers/get_default_attack_discovery_prompt'; -import { getDefaultRefinePrompt } from '../nodes/refine/helpers/get_default_refine_prompt'; import type { GraphState } from '../types'; export interface Options { end?: string; filter?: Record<string, unknown> | null; + prompts: AttackDiscoveryPrompts; start?: string; } export const getDefaultGraphState = ({ end, filter, + prompts, start, -}: Options | undefined = {}): StateGraphArgs<GraphState>['channels'] => ({ +}: Options): StateGraphArgs<GraphState>['channels'] => ({ attackDiscoveries: { value: (x: AttackDiscovery[] | null, y?: AttackDiscovery[] | null) => y ?? x, default: () => null, }, attackDiscoveryPrompt: { value: (x: string, y?: string) => y ?? x, - default: () => getDefaultAttackDiscoveryPrompt(), + default: () => prompts.default, }, anonymizedAlerts: { value: (x: Document[], y?: Document[]) => y ?? x, @@ -49,6 +50,10 @@ export const getDefaultGraphState = ({ value: (x: string, y?: string) => y ?? x, default: () => '', }, + continuePrompt: { + value: (x: string, y?: string) => y ?? x, + default: () => prompts.continue, + }, end: { value: (x?: string | null, y?: string | null) => y ?? x, default: () => end, @@ -75,7 +80,7 @@ export const getDefaultGraphState = ({ }, refinePrompt: { value: (x: string, y?: string) => y ?? x, - default: () => getDefaultRefinePrompt(), + default: () => prompts.refine, }, maxGenerationAttempts: { value: (x: number, y?: number) => y ?? x, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/types.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/types.ts index 8df901f927ade..a4da6c9253a10 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/types.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/attack_discovery/graphs/default_attack_discovery_graph/types.ts @@ -14,6 +14,7 @@ export interface GraphState { anonymizedAlerts: Document[]; combinedGenerations: string; combinedRefinements: string; + continuePrompt: string; end?: string | null; errors: string[]; filter?: Record<string, unknown> | null; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/executors/types.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/executors/types.ts index abef39d8b2e25..deb737d9ad36a 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/executors/types.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/executors/types.ts @@ -18,6 +18,7 @@ import type { InferenceServerStart } from '@kbn/inference-plugin/server'; import { AnalyticsServiceSetup } from '@kbn/core-analytics-server'; import { TelemetryParams } from '@kbn/langchain/server/tracers/telemetry/telemetry_tracer'; import type { LlmTasksPluginStart } from '@kbn/llm-tasks-plugin/server'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import { ResponseBody } from '../types'; import type { AssistantTool } from '../../../types'; import { AIAssistantKnowledgeBaseDataClient } from '../../../ai_assistant_data_clients/knowledge_base'; @@ -57,6 +58,7 @@ export interface AgentExecutorParams<T extends boolean> { onLlmResponse?: OnLlmResponse; request: KibanaRequest<unknown, unknown, ExecuteConnectorRequestBody>; response?: KibanaResponseFactory; + savedObjectsClient: SavedObjectsClientContract; size?: number; systemPrompt?: string; telemetry: AnalyticsServiceSetup; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/graph.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/graph.ts index 10ecebb5e3f9b..e2fa213aabac6 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/graph.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/graph.ts @@ -14,6 +14,9 @@ import type { Logger } from '@kbn/logging'; import { BaseMessage } from '@langchain/core/messages'; import { BaseChatModel } from '@langchain/core/language_models/chat_models'; import { ConversationResponse, Replacements } from '@kbn/elastic-assistant-common'; +import { PublicMethodsOf } from '@kbn/utility-types'; +import { ActionsClient } from '@kbn/actions-plugin/server'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import { AgentState, NodeParamsBase } from './types'; import { AssistantDataClients } from '../../executors/types'; @@ -30,10 +33,12 @@ import { NodeType } from './constants'; export const DEFAULT_ASSISTANT_GRAPH_ID = 'Default Security Assistant Graph'; export interface GetDefaultAssistantGraphParams { + actionsClient: PublicMethodsOf<ActionsClient>; agentRunnable: AgentRunnableSequence; dataClients?: AssistantDataClients; createLlmInstance: () => BaseChatModel; logger: Logger; + savedObjectsClient: SavedObjectsClientContract; signal?: AbortSignal; tools: StructuredTool[]; replacements: Replacements; @@ -42,10 +47,12 @@ export interface GetDefaultAssistantGraphParams { export type DefaultAssistantGraph = ReturnType<typeof getDefaultAssistantGraph>; export const getDefaultAssistantGraph = ({ + actionsClient, agentRunnable, dataClients, createLlmInstance, logger, + savedObjectsClient, // some chat models (bedrock) require a signal to be passed on agent invoke rather than the signal passed to the chat model signal, tools, @@ -97,6 +104,10 @@ export const getDefaultAssistantGraph = ({ value: (x: boolean, y?: boolean) => y ?? x, default: () => false, }, + connectorId: { + value: (x: string, y?: string) => y ?? x, + default: () => '', + }, conversation: { value: (x: ConversationResponse | undefined, y?: ConversationResponse | undefined) => y ?? x, @@ -114,7 +125,9 @@ export const getDefaultAssistantGraph = ({ // Default node parameters const nodeParams: NodeParamsBase = { + actionsClient, logger, + savedObjectsClient, }; // Put together a new graph using default state from above diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.test.ts index 0050dc2e5e596..b3f9dade72250 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.test.ts @@ -56,6 +56,7 @@ describe('streamGraph', () => { input: 'input', responseLanguage: 'English', llmType: 'openai', + connectorId: '123', }, logger: mockLogger, onLlmResponse: mockOnLlmResponse, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.test.ts index 1953dd4d45bf5..fa512b76b3b26 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.test.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.test.ts @@ -18,6 +18,7 @@ import { createStructuredChatAgent, createToolCallingAgent, } from 'langchain/agents'; +import { savedObjectsClientMock } from '@kbn/core-saved-objects-api-server-mocks'; jest.mock('./graph'); jest.mock('./helpers'); jest.mock('langchain/agents'); @@ -41,6 +42,13 @@ describe('callAssistantGraph', () => { }, }; + const savedObjectsClient = savedObjectsClientMock.create(); + savedObjectsClient.find = jest.fn().mockResolvedValue({ + page: 1, + per_page: 20, + total: 0, + saved_objects: [], + }); const defaultParams = { actionsClient: actionsClientMock.create(), alertsIndexPattern: 'test-pattern', @@ -60,6 +68,7 @@ describe('callAssistantGraph', () => { onNewReplacements: jest.fn(), replacements: [], request: mockRequest, + savedObjectsClient, size: 1, systemPrompt: 'test-prompt', telemetry: {}, @@ -167,6 +176,12 @@ describe('callAssistantGraph', () => { }); it('creates OpenAIToolsAgent for inference llmType', async () => { + defaultParams.actionsClient.get = jest.fn().mockResolvedValue({ + config: { + provider: 'elastic', + providerConfig: { model_id: 'rainbow-sprinkles' }, + }, + }); const params = { ...defaultParams, llmType: 'inference' }; await callAssistantGraph(params); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts index 2e94e4bcd4ea0..c68c6f176e47d 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts @@ -14,11 +14,14 @@ import { } from 'langchain/agents'; import { APMTracer } from '@kbn/langchain/server/tracers/apm'; import { TelemetryTracer } from '@kbn/langchain/server/tracers/telemetry'; +import { promptGroupId } from '../../../prompt/local_prompt_object'; +import { getModelOrOss } from '../../../prompt/helpers'; +import { getPrompt, promptDictionary } from '../../../prompt'; import { getLlmClass } from '../../../../routes/utils'; import { EsAnonymizationFieldsSchema } from '../../../../ai_assistant_data_clients/anonymization_fields/types'; import { AssistantToolParams } from '../../../../types'; import { AgentExecutor } from '../../executors/types'; -import { formatPrompt, formatPromptStructured, systemPrompts } from './prompts'; +import { formatPrompt, formatPromptStructured } from './prompts'; import { GraphInputs } from './types'; import { getDefaultAssistantGraph } from './graph'; import { invokeGraph, streamGraph } from './helpers'; @@ -44,6 +47,7 @@ export const callAssistantGraph: AgentExecutor<true | false> = async ({ onNewReplacements, replacements, request, + savedObjectsClient, size, systemPrompt, telemetry, @@ -130,29 +134,36 @@ export const callAssistantGraph: AgentExecutor<true | false> = async ({ } } + const defaultSystemPrompt = await getPrompt({ + actionsClient, + connectorId, + model: getModelOrOss(llmType, isOssModel, request.body.model), + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: llmType, + savedObjectsClient, + }); + const agentRunnable = isOpenAI || llmType === 'inference' ? await createOpenAIToolsAgent({ llm: createLlmInstance(), tools, - prompt: formatPrompt(systemPrompts.openai, systemPrompt), + prompt: formatPrompt(defaultSystemPrompt, systemPrompt), streamRunnable: isStream, }) : llmType && ['bedrock', 'gemini'].includes(llmType) ? await createToolCallingAgent({ llm: createLlmInstance(), tools, - prompt: - llmType === 'bedrock' - ? formatPrompt(systemPrompts.bedrock, systemPrompt) - : formatPrompt(systemPrompts.gemini, systemPrompt), + prompt: formatPrompt(defaultSystemPrompt, systemPrompt), streamRunnable: isStream, }) : // used with OSS models await createStructuredChatAgent({ llm: createLlmInstance(), tools, - prompt: formatPromptStructured(systemPrompts.structuredChat, systemPrompt), + prompt: formatPromptStructured(defaultSystemPrompt, systemPrompt), streamRunnable: isStream, }); @@ -174,6 +185,8 @@ export const callAssistantGraph: AgentExecutor<true | false> = async ({ // we need to pass it like this or streaming does not work for bedrock createLlmInstance, logger, + actionsClient, + savedObjectsClient, tools, replacements, // some chat models (bedrock) require a signal to be passed on agent invoke rather than the signal passed to the chat model @@ -182,6 +195,7 @@ export const callAssistantGraph: AgentExecutor<true | false> = async ({ const inputs: GraphInputs = { responseLanguage, conversationId, + connectorId, llmType, isStream, isOssModel, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts index 952b97287c3ca..830a120669661 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts @@ -7,7 +7,8 @@ import { RunnableConfig } from '@langchain/core/runnables'; import { AgentRunnableSequence } from 'langchain/dist/agents/agent'; -import { formatLatestUserMessage } from '../prompts'; +import { promptGroupId } from '../../../../prompt/local_prompt_object'; +import { getPrompt, promptDictionary } from '../../../../prompt'; import { AgentState, NodeParamsBase } from '../types'; import { NodeType } from '../constants'; import { AIAssistantKnowledgeBaseDataClient } from '../../../../../ai_assistant_data_clients/knowledge_base'; @@ -34,7 +35,9 @@ const NO_KNOWLEDGE_HISTORY = '[No existing knowledge history]'; * @param kbDataClient - Data client for accessing the Knowledge Base on behalf of the current user */ export async function runAgent({ + actionsClient, logger, + savedObjectsClient, state, agentRunnable, config, @@ -43,6 +46,17 @@ export async function runAgent({ logger.debug(() => `${NodeType.AGENT}: Node state:\n${JSON.stringify(state, null, 2)}`); const knowledgeHistory = await kbDataClient?.getRequiredKnowledgeBaseDocumentEntries(); + const userPrompt = + state.llmType === 'gemini' + ? await getPrompt({ + actionsClient, + connectorId: state.connectorId, + promptId: promptDictionary.userPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'gemini', + savedObjectsClient, + }) + : ''; const agentOutcome = await agentRunnable .withConfig({ tags: [AGENT_NODE_TAG], signal: config?.signal }) .invoke( @@ -54,7 +68,7 @@ export async function runAgent({ : NO_KNOWLEDGE_HISTORY }`, // prepend any user prompt (gemini) - input: formatLatestUserMessage(state.input, state.llmType), + input: `${userPrompt}${state.input}`, chat_history: state.messages, // TODO: Message de-dupe with ...state spread }, config diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts deleted file mode 100644 index aee78c16920d8..0000000000000 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/translations.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -// TODO determine whether or not system prompts should be i18n'd -const YOU_ARE_A_HELPFUL_EXPERT_ASSISTANT = - 'You are a security analyst and expert in resolving security incidents. Your role is to assist by answering questions about Elastic Security.'; -const IF_YOU_DONT_KNOW_THE_ANSWER = 'Do not answer questions unrelated to Elastic Security.'; -export const KNOWLEDGE_HISTORY = - 'If available, use the Knowledge History provided to try and answer the question. If not provided, you can try and query for additional knowledge via the KnowledgeBaseRetrievalTool.'; - -export const DEFAULT_SYSTEM_PROMPT = `${YOU_ARE_A_HELPFUL_EXPERT_ASSISTANT} ${IF_YOU_DONT_KNOW_THE_ANSWER} ${KNOWLEDGE_HISTORY}`; -// system prompt from @afirstenberg -const BASE_GEMINI_PROMPT = - 'You are an assistant that is an expert at using tools and Elastic Security, doing your best to use these tools to answer questions or follow instructions. It is very important to use tools to answer the question or follow the instructions rather than coming up with your own answer. Tool calls are good. Sometimes you may need to make several tool calls to accomplish the task or get an answer to the question that was asked. Use as many tool calls as necessary.'; -const KB_CATCH = - 'If the knowledge base tool gives empty results, do your best to answer the question from the perspective of an expert security analyst.'; -export const GEMINI_SYSTEM_PROMPT = `${BASE_GEMINI_PROMPT} ${KB_CATCH}`; -export const BEDROCK_SYSTEM_PROMPT = `Use tools as often as possible, as they have access to the latest data and syntax. Always return value from NaturalLanguageESQLTool as is. Never return <thinking> tags in the response, but make sure to include <result> tags content in the response. Do not reflect on the quality of the returned search results in your response.`; -export const GEMINI_USER_PROMPT = `Now, always using the tools at your disposal, step by step, come up with a response to this request:\n\n`; - -export const STRUCTURED_SYSTEM_PROMPT = `Respond to the human as helpfully and accurately as possible. ${KNOWLEDGE_HISTORY} You have access to the following tools: - -{tools} - -The tool action_input should ALWAYS follow the tool JSON schema args. - -Valid "action" values: "Final Answer" or {tool_names} - -Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input strictly adhering to the tool JSON schema args). - -Provide only ONE action per $JSON_BLOB, as shown: - -\`\`\` - -{{ - - "action": $TOOL_NAME, - - "action_input": $TOOL_INPUT - -}} - -\`\`\` - -Follow this format: - -Question: input question to answer - -Thought: consider previous and subsequent steps - -Action: - -\`\`\` - -$JSON_BLOB - -\`\`\` - -Observation: action result - -... (repeat Thought/Action/Observation N times) - -Thought: I know what to respond - -Action: - -\`\`\` - -{{ - - "action": "Final Answer", - - "action_input": "Final response to human"}} - -Begin! Reminder to ALWAYS respond with a valid json blob of a single action with no additional output. When using tools, ALWAYS input the expected JSON schema args. Your answer will be parsed as JSON, so never use double quotes within the output and instead use backticks. Single quotes may be used, such as apostrophes. Response format is Action:\`\`\`$JSON_BLOB\`\`\`then Observation`; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts index 05cc8b50852f5..bc28f00e5d76e 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/prompts.ts @@ -6,13 +6,6 @@ */ import { ChatPromptTemplate } from '@langchain/core/prompts'; -import { - BEDROCK_SYSTEM_PROMPT, - DEFAULT_SYSTEM_PROMPT, - GEMINI_SYSTEM_PROMPT, - GEMINI_USER_PROMPT, - STRUCTURED_SYSTEM_PROMPT, -} from './nodes/translations'; export const formatPrompt = (prompt: string, additionalPrompt?: string) => ChatPromptTemplate.fromMessages([ @@ -23,20 +16,6 @@ export const formatPrompt = (prompt: string, additionalPrompt?: string) => ['placeholder', '{agent_scratchpad}'], ]); -export const systemPrompts = { - openai: DEFAULT_SYSTEM_PROMPT, - bedrock: `${DEFAULT_SYSTEM_PROMPT} ${BEDROCK_SYSTEM_PROMPT}`, - // The default prompt overwhelms gemini, do not prepend - gemini: GEMINI_SYSTEM_PROMPT, - structuredChat: STRUCTURED_SYSTEM_PROMPT, -}; - -export const openAIFunctionAgentPrompt = formatPrompt(systemPrompts.openai); - -export const bedrockToolCallingAgentPrompt = formatPrompt(systemPrompts.bedrock); - -export const geminiToolCallingAgentPrompt = formatPrompt(systemPrompts.gemini); - export const formatPromptStructured = (prompt: string, additionalPrompt?: string) => ChatPromptTemplate.fromMessages([ ['system', additionalPrompt ? `${prompt}\n\n${additionalPrompt}` : prompt], @@ -47,18 +26,3 @@ export const formatPromptStructured = (prompt: string, additionalPrompt?: string '{input}\n\n{agent_scratchpad}\n\n(reminder to respond in a JSON blob no matter what)', ], ]); - -export const structuredChatAgentPrompt = formatPromptStructured(systemPrompts.structuredChat); - -/** - * If Gemini is the llmType, - * Adds a user prompt for the latest message in a conversation - * @param prompt - * @param llmType - */ -export const formatLatestUserMessage = (prompt: string, llmType?: string): string => { - if (llmType === 'gemini') { - return `${GEMINI_USER_PROMPT}${prompt}`; - } - return prompt; -}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/types.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/types.ts index 344bd042cc036..6a30ef54a1f3b 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/types.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/types.ts @@ -9,6 +9,9 @@ import { BaseMessage } from '@langchain/core/messages'; import { AgentAction, AgentFinish, AgentStep } from '@langchain/core/agents'; import type { Logger } from '@kbn/logging'; import { ConversationResponse } from '@kbn/elastic-assistant-common'; +import { PublicMethodsOf } from '@kbn/utility-types'; +import { ActionsClient } from '@kbn/actions-plugin/server'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; export interface AgentStateBase { agentOutcome?: AgentAction | AgentFinish; @@ -16,6 +19,7 @@ export interface AgentStateBase { } export interface GraphInputs { + connectorId: string; conversationId?: string; llmType?: string; isStream?: boolean; @@ -34,10 +38,13 @@ export interface AgentState extends AgentStateBase { isOssModel: boolean; llmType: string; responseLanguage: string; + connectorId: string; conversation: ConversationResponse | undefined; conversationId: string; } export interface NodeParamsBase { + actionsClient: PublicMethodsOf<ActionsClient>; logger: Logger; + savedObjectsClient: SavedObjectsClientContract; } diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.test.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.test.ts new file mode 100644 index 0000000000000..a420510956cd2 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.test.ts @@ -0,0 +1,520 @@ +/* + * Copyright 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 { getPrompt, getPromptsByGroupId } from './get_prompt'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { ActionsClient } from '@kbn/actions-plugin/server'; +import { BEDROCK_SYSTEM_PROMPT, DEFAULT_SYSTEM_PROMPT, GEMINI_USER_PROMPT } from './prompts'; +import { promptDictionary, promptGroupId } from './local_prompt_object'; + +jest.mock('@kbn/core-saved-objects-api-server'); +jest.mock('@kbn/actions-plugin/server'); +const defaultConnector = { + id: 'mock', + name: 'Mock', + isPreconfigured: false, + isDeprecated: false, + isSystemAction: false, + actionTypeId: '.inference', +}; +describe('get_prompt', () => { + let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>; + let actionsClient: jest.Mocked<ActionsClient>; + + beforeEach(() => { + jest.clearAllMocks(); + savedObjectsClient = { + find: jest.fn().mockResolvedValue({ + page: 1, + per_page: 20, + total: 3, + saved_objects: [ + { + type: 'security-ai-prompt', + id: '977b39b8-5bb9-4530-9a39-7aa7084fb5c0', + attributes: { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + model: 'gpt-4o', + description: 'Default prompt for AI Assistant system prompt.', + prompt: { + default: 'Hello world this is a system prompt', + }, + }, + references: [], + managed: false, + updated_at: '2025-01-22T18:44:35.271Z', + updated_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + created_at: '2025-01-22T18:44:35.271Z', + created_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + version: 'Wzk0MiwxXQ==', + coreMigrationVersion: '8.8.0', + score: 0.13353139, + }, + { + type: 'security-ai-prompt', + id: 'd6dacb9b-1029-4c4c-85e1-e4f97b31c7f4', + attributes: { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + description: 'Default prompt for AI Assistant system prompt.', + prompt: { + default: 'Hello world this is a system prompt no model', + }, + }, + references: [], + managed: false, + updated_at: '2025-01-22T19:11:48.806Z', + updated_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + created_at: '2025-01-22T19:11:48.806Z', + created_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + version: 'Wzk4MCwxXQ==', + coreMigrationVersion: '8.8.0', + score: 0.13353139, + }, + { + type: 'security-ai-prompt', + id: 'd6dacb9b-1029-4c4c-85e1-e4f97b31c7f4', + attributes: { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'bedrock', + description: 'Default prompt for AI Assistant system prompt.', + prompt: { + default: 'Hello world this is a system prompt for bedrock', + }, + }, + references: [], + managed: false, + updated_at: '2025-01-22T19:11:48.806Z', + updated_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + created_at: '2025-01-22T19:11:48.806Z', + created_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + version: 'Wzk4MCwxXQ==', + coreMigrationVersion: '8.8.0', + score: 0.13353139, + }, + { + type: 'security-ai-prompt', + id: 'd6dacb9b-1029-4c4c-85e1-e4f97b31c7f4', + attributes: { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'bedrock', + model: 'us.anthropic.claude-3-5-sonnet-20240620-v1:0', + description: 'Default prompt for AI Assistant system prompt.', + prompt: { + default: 'Hello world this is a system prompt for bedrock claude-3-5-sonnet', + }, + }, + references: [], + managed: false, + updated_at: '2025-01-22T19:11:48.806Z', + updated_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + created_at: '2025-01-22T19:11:48.806Z', + created_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + version: 'Wzk4MCwxXQ==', + coreMigrationVersion: '8.8.0', + score: 0.13353139, + }, + { + type: 'security-ai-prompt', + id: 'da530fad-87ce-49c3-a088-08073e5034d6', + attributes: { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + description: 'Default prompt for AI Assistant system prompt.', + prompt: { + default: 'Hello world this is a system prompt no model, no provider', + }, + }, + references: [], + managed: false, + updated_at: '2025-01-22T19:12:12.911Z', + updated_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + created_at: '2025-01-22T19:12:12.911Z', + created_by: 'u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0', + version: 'Wzk4MiwxXQ==', + coreMigrationVersion: '8.8.0', + score: 0.13353139, + }, + ], + }), + } as unknown as jest.Mocked<SavedObjectsClientContract>; + + actionsClient = { + get: jest.fn().mockResolvedValue({ + config: { + provider: 'openai', + providerConfig: { model_id: 'gpt-4o' }, + }, + }), + } as unknown as jest.Mocked<ActionsClient>; + }); + describe('getPrompt', () => { + it('returns the prompt matching provider and model', async () => { + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + model: 'gpt-4o', + actionsClient, + connectorId: 'connector-123', + }); + expect(actionsClient.get).not.toHaveBeenCalled(); + + expect(result).toBe('Hello world this is a system prompt'); + }); + + it('returns the prompt matching provider when model does not have a match', async () => { + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + model: 'gpt-4o-mini', + actionsClient, + connectorId: 'connector-123', + }); + expect(actionsClient.get).not.toHaveBeenCalled(); + + expect(result).toBe('Hello world this is a system prompt no model'); + }); + + it('returns the prompt matching provider when model is not provided', async () => { + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + actionsClient, + connectorId: 'connector-123', + }); + expect(actionsClient.get).toHaveBeenCalled(); + + expect(result).toBe('Hello world this is a system prompt no model'); + }); + + it('returns the default prompt when there is no match on provider', async () => { + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'badone', + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toBe('Hello world this is a system prompt no model, no provider'); + }); + + it('defaults provider to bedrock if provider is "inference"', async () => { + actionsClient.get.mockResolvedValue(defaultConnector); + + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'inference', + model: 'gpt-4o', + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toBe('Hello world this is a system prompt for bedrock'); + }); + + it('returns the expected prompt from when provider is "elastic" and model matches in elasticModelDictionary', async () => { + actionsClient.get.mockResolvedValue({ + ...defaultConnector, + config: { + provider: 'elastic', + providerConfig: { model_id: 'rainbow-sprinkles' }, + }, + }); + + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'inference', + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toBe('Hello world this is a system prompt for bedrock claude-3-5-sonnet'); + }); + + it('returns the bedrock prompt when provider is "elastic" but model does not match elasticModelDictionary', async () => { + actionsClient.get.mockResolvedValue({ + ...defaultConnector, + config: { + provider: 'elastic', + providerConfig: { model_id: 'unknown-model' }, + }, + }); + + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'inference', + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toBe('Hello world this is a system prompt for bedrock'); + }); + + it('returns the model prompt when no prompts are found and model is provided', async () => { + savedObjectsClient.find.mockResolvedValue({ + page: 1, + per_page: 20, + total: 0, + saved_objects: [], + }); + + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + actionsClient, + provider: 'bedrock', + connectorId: 'connector-123', + }); + + expect(result).toBe(BEDROCK_SYSTEM_PROMPT); + }); + + it('returns the default prompt when no prompts are found', async () => { + savedObjectsClient.find.mockResolvedValue({ + page: 1, + per_page: 20, + total: 0, + saved_objects: [], + }); + + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toBe(DEFAULT_SYSTEM_PROMPT); + }); + + it('throws an error when no prompts are found', async () => { + savedObjectsClient.find.mockResolvedValue({ + page: 1, + per_page: 20, + total: 0, + saved_objects: [], + }); + + await expect( + getPrompt({ + savedObjectsClient, + promptId: 'nonexistent-prompt', + promptGroupId: 'nonexistent-group', + actionsClient, + connectorId: 'connector-123', + }) + ).rejects.toThrow( + 'Prompt not found for promptId: nonexistent-prompt and promptGroupId: nonexistent-group' + ); + }); + + it('handles invalid connector configuration gracefully when provider is "inference"', async () => { + actionsClient.get.mockResolvedValue({ + ...defaultConnector, + config: {}, + }); + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'inference', + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toBe('Hello world this is a system prompt for bedrock'); + }); + + it('retrieves the connector when no model or provider is provided', async () => { + actionsClient.get.mockResolvedValue({ + ...defaultConnector, + actionTypeId: '.bedrock', + config: { + defaultModel: 'us.anthropic.claude-3-5-sonnet-20240620-v1:0', + }, + }); + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + actionsClient, + connectorId: 'connector-123', + }); + expect(actionsClient.get).toHaveBeenCalled(); + + expect(result).toBe('Hello world this is a system prompt for bedrock claude-3-5-sonnet'); + }); + + it('retrieves the connector when no model is provided', async () => { + actionsClient.get.mockResolvedValue({ + ...defaultConnector, + actionTypeId: '.bedrock', + config: { + defaultModel: 'us.anthropic.claude-3-5-sonnet-20240620-v1:0', + }, + }); + const result = await getPrompt({ + savedObjectsClient, + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'bedrock', + actionsClient, + connectorId: 'connector-123', + }); + expect(actionsClient.get).toHaveBeenCalled(); + + expect(result).toBe('Hello world this is a system prompt for bedrock claude-3-5-sonnet'); + }); + }); + + describe('getPromptsByGroupId', () => { + it('returns prompts matching the provided promptIds', async () => { + const result = await getPromptsByGroupId({ + savedObjectsClient, + promptIds: [promptDictionary.systemPrompt], + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + model: 'gpt-4o', + actionsClient, + connectorId: 'connector-123', + }); + expect(savedObjectsClient.find).toHaveBeenCalledWith({ + type: 'security-ai-prompt', + searchFields: ['promptGroupId'], + search: promptGroupId.aiAssistant, + }); + + expect(result).toEqual([ + { + promptId: promptDictionary.systemPrompt, + prompt: 'Hello world this is a system prompt', + }, + ]); + }); + + it('returns prompts matching the provided promptIds for gemini', async () => { + const result = await getPromptsByGroupId({ + savedObjectsClient, + promptIds: [promptDictionary.systemPrompt, promptDictionary.userPrompt], + promptGroupId: promptGroupId.aiAssistant, + provider: 'gemini', + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toEqual([ + { + promptId: promptDictionary.systemPrompt, + prompt: 'Hello world this is a system prompt no model, no provider', + }, + { + promptId: promptDictionary.userPrompt, + prompt: GEMINI_USER_PROMPT, + }, + ]); + }); + + it('returns prompts matching the provided promptIds when connector is given', async () => { + const result = await getPromptsByGroupId({ + savedObjectsClient, + promptIds: [promptDictionary.systemPrompt, promptDictionary.userPrompt], + promptGroupId: promptGroupId.aiAssistant, + connector: { + actionTypeId: '.gemini', + config: { + defaultModel: 'gemini-1.5-pro-002', + }, + id: 'connector-123', + name: 'Gemini', + isPreconfigured: false, + isDeprecated: false, + isSystemAction: false, + }, + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toEqual([ + { + promptId: promptDictionary.systemPrompt, + prompt: 'Hello world this is a system prompt no model, no provider', + }, + { + promptId: promptDictionary.userPrompt, + prompt: GEMINI_USER_PROMPT, + }, + ]); + }); + it('returns prompts matching the provided promptIds when inference connector is given', async () => { + const result = await getPromptsByGroupId({ + savedObjectsClient, + promptIds: [promptDictionary.systemPrompt], + promptGroupId: promptGroupId.aiAssistant, + connector: { + actionTypeId: '.inference', + config: { + provider: 'elastic', + providerConfig: { model_id: 'rainbow-sprinkles' }, + }, + id: 'connector-123', + name: 'Inference', + isPreconfigured: false, + isDeprecated: false, + isSystemAction: false, + }, + actionsClient, + connectorId: 'connector-123', + }); + + expect(result).toEqual([ + { + promptId: promptDictionary.systemPrompt, + prompt: 'Hello world this is a system prompt for bedrock', + }, + ]); + }); + it('throws an error when a prompt is missing', async () => { + savedObjectsClient.find.mockResolvedValue({ + page: 1, + per_page: 20, + total: 0, + saved_objects: [], + }); + + await expect( + getPromptsByGroupId({ + savedObjectsClient, + promptIds: [promptDictionary.systemPrompt, 'fake-id'], + promptGroupId: promptGroupId.aiAssistant, + actionsClient, + connectorId: 'connector-123', + }) + ).rejects.toThrow('Prompt not found for promptId: fake-id and promptGroupId: aiAssistant'); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.ts new file mode 100644 index 0000000000000..ad0ee079eae89 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/get_prompt.ts @@ -0,0 +1,222 @@ +/* + * Copyright 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 { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { PublicMethodsOf } from '@kbn/utility-types'; +import { ActionsClient } from '@kbn/actions-plugin/server'; +import type { Connector } from '@kbn/actions-plugin/server/application/connector/types'; +import { elasticModelDictionary } from '@kbn/inference-common'; +import { Prompt } from './types'; +import { localPrompts } from './local_prompt_object'; +import { getLlmType } from '../../routes/utils'; +import { promptSavedObjectType } from '../../../common/constants'; +interface GetPromptArgs { + actionsClient: PublicMethodsOf<ActionsClient>; + connector?: Connector; + connectorId: string; + model?: string; + promptId: string; + promptGroupId: string; + provider?: string; + savedObjectsClient: SavedObjectsClientContract; +} +interface GetPromptsByGroupIdArgs extends Omit<GetPromptArgs, 'promptId'> { + promptGroupId: string; + promptIds: string[]; +} + +type PromptArray = Array<{ promptId: string; prompt: string }>; +/** + * Get prompts by feature (promptGroupId) + * provide either model + provider or connector to avoid additional calls to get connector + * @param actionsClient - actions client + * @param connector - connector, provide if available. No need to provide model and provider in this case + * @param connectorId - connector id + * @param model - model. No need to provide if connector provided + * @param promptGroupId - feature id, should be common across promptIds + * @param promptIds - prompt ids with shared promptGroupId + * @param provider - provider. No need to provide if connector provided + * @param savedObjectsClient - saved objects client + */ +export const getPromptsByGroupId = async ({ + actionsClient, + connector, + connectorId, + model: providedModel, + promptGroupId, + promptIds, + provider: providedProvider, + savedObjectsClient, +}: GetPromptsByGroupIdArgs): Promise<PromptArray> => { + const { provider, model } = await resolveProviderAndModel({ + providedProvider, + providedModel, + connectorId, + actionsClient, + providedConnector: connector, + }); + + const prompts = await savedObjectsClient.find<Prompt>({ + type: promptSavedObjectType, + searchFields: ['promptGroupId'], + search: promptGroupId, + }); + const promptsOnly = prompts?.saved_objects.map((p) => p.attributes) ?? []; + + return promptIds.map((promptId) => { + const prompt = findPromptEntry({ + prompts: promptsOnly.filter((p) => p.promptId === promptId) ?? [], + promptId, + promptGroupId, + provider, + model, + }); + if (!prompt) { + throw new Error( + `Prompt not found for promptId: ${promptId} and promptGroupId: ${promptGroupId}` + ); + } + + return { + promptId, + prompt, + }; + }); +}; + +/** + * Get prompt by promptId + * provide either model + provider or connector to avoid additional calls to get connector + * @param actionsClient - actions client + * @param connector - connector, provide if available. No need to provide model and provider in this case + * @param connectorId - connector id + * @param model - model. No need to provide if connector provided + * @param promptId - prompt id + * @param promptGroupId - feature id, should be common across promptIds + * @param provider - provider. No need to provide if connector provided + * @param savedObjectsClient - saved objects client + */ +export const getPrompt = async ({ + actionsClient, + connector, + connectorId, + model: providedModel, + promptGroupId, + promptId, + provider: providedProvider, + savedObjectsClient, +}: GetPromptArgs): Promise<string> => { + const { provider, model } = await resolveProviderAndModel({ + providedProvider, + providedModel, + connectorId, + actionsClient, + providedConnector: connector, + }); + + const prompts = await savedObjectsClient.find<Prompt>({ + type: promptSavedObjectType, + filter: `${promptSavedObjectType}.attributes.promptId: "${promptId}" AND ${promptSavedObjectType}.attributes.promptGroupId: "${promptGroupId}"`, + fields: ['provider', 'model', 'prompt'], + }); + + const prompt = findPromptEntry({ + prompts: prompts?.saved_objects.map((p) => p.attributes) ?? [], + promptId, + promptGroupId, + provider, + model, + }); + if (!prompt) { + throw new Error( + `Prompt not found for promptId: ${promptId} and promptGroupId: ${promptGroupId}` + ); + } + + return prompt; +}; + +const resolveProviderAndModel = async ({ + providedProvider, + providedModel, + connectorId, + actionsClient, + providedConnector, +}: { + providedProvider: string | undefined; + providedModel: string | undefined; + connectorId: string; + actionsClient: PublicMethodsOf<ActionsClient>; + providedConnector?: Connector; +}): Promise<{ provider?: string; model?: string }> => { + let model = providedModel; + let provider = providedProvider; + if (!provider || !model || provider === 'inference') { + const connector = providedConnector ?? (await actionsClient.get({ id: connectorId })); + + if (provider === 'inference' && connector.config) { + provider = connector.config.provider || provider; + model = connector.config.providerConfig?.model_id || model; + + if (provider === 'elastic' && model) { + provider = elasticModelDictionary[model]?.provider || 'inference'; + model = elasticModelDictionary[model]?.model; + } + } else if (connector.config) { + provider = provider || getLlmType(connector.actionTypeId); + model = model || connector.config.defaultModel; + } + } + + return { provider: provider === 'inference' ? 'bedrock' : provider, model }; +}; + +const findPrompt = ({ + prompts, + conditions, +}: { + prompts: Array<{ provider?: string; model?: string; prompt: { default: string } }>; + conditions: Array<(prompt: { provider?: string; model?: string }) => boolean>; +}): string | undefined => { + for (const condition of conditions) { + const match = prompts.find(condition); + if (match) return match.prompt.default; + } + return undefined; +}; + +const findPromptEntry = ({ + prompts, + promptId, + promptGroupId, + provider, + model, +}: { + prompts: Prompt[]; + promptId: string; + promptGroupId: string; + provider?: string; + model?: string; +}): string | undefined => { + const conditions = [ + (prompt: { provider?: string; model?: string }) => + prompt.provider === provider && prompt.model === model, + (prompt: { provider?: string; model?: string }) => + prompt.provider === provider && !prompt.model, + (prompt: { provider?: string; model?: string }) => !prompt.provider && !prompt.model, + ]; + + return ( + findPrompt({ prompts, conditions }) ?? + findPrompt({ + prompts: localPrompts.filter( + (p) => p.promptId === promptId && p.promptGroupId === promptGroupId + ), + conditions, + }) + ); +}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/helpers.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/helpers.ts new file mode 100644 index 0000000000000..48f3f5f414657 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/helpers.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * use oss as model when using openai and oss + * else default to given model + * if no model exists, let undefined and resolveProviderAndModel logic will determine the model from connector + * @param llmType + * @param isOssModel + * @param model + */ +export const getModelOrOss = ( + llmType?: string, + isOssModel?: boolean, + model?: string +): string | undefined => (llmType === 'openai' && isOssModel ? 'oss' : model); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/index.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/index.ts new file mode 100644 index 0000000000000..c27ef7803414b --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { getPrompt, getPromptsByGroupId } from './get_prompt'; +export { promptDictionary } from './local_prompt_object'; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/local_prompt_object.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/local_prompt_object.ts new file mode 100644 index 0000000000000..1752497da120a --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/local_prompt_object.ts @@ -0,0 +1,157 @@ +/* + * Copyright 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 { Prompt } from './types'; +import { + ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_INSIGHTS, + ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + ATTACK_DISCOVERY_GENERATION_TITLE, + ATTACK_DISCOVERY_CONTINUE, + ATTACK_DISCOVERY_DEFAULT, + ATTACK_DISCOVERY_REFINE, + BEDROCK_SYSTEM_PROMPT, + DEFAULT_SYSTEM_PROMPT, + GEMINI_SYSTEM_PROMPT, + GEMINI_USER_PROMPT, + STRUCTURED_SYSTEM_PROMPT, +} from './prompts'; + +export const promptGroupId = { + attackDiscovery: 'attackDiscovery', + aiAssistant: 'aiAssistant', +}; + +export const promptDictionary = { + systemPrompt: `systemPrompt`, + userPrompt: `userPrompt`, + attackDiscoveryDefault: `default`, + attackDiscoveryRefine: `refine`, + attackDiscoveryContinue: `continue`, + attackDiscoveryDetailsMarkdown: `detailsMarkdown`, + attackDiscoveryEntitySummaryMarkdown: `entitySummaryMarkdown`, + attackDiscoveryMitreAttackTactics: `mitreAttackTactics`, + attackDiscoverySummaryMarkdown: `summaryMarkdown`, + attackDiscoveryGenerationTitle: `generationTitle`, + attackDiscoveryGenerationInsights: `generationInsights`, +}; + +export const localPrompts: Prompt[] = [ + { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + prompt: { + default: DEFAULT_SYSTEM_PROMPT, + }, + }, + { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + prompt: { + default: DEFAULT_SYSTEM_PROMPT, + }, + }, + { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'bedrock', + prompt: { + default: BEDROCK_SYSTEM_PROMPT, + }, + }, + { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'gemini', + prompt: { + default: GEMINI_SYSTEM_PROMPT, + }, + }, + { + promptId: promptDictionary.systemPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'openai', + model: 'oss', + prompt: { + default: STRUCTURED_SYSTEM_PROMPT, + }, + }, + { + promptId: promptDictionary.userPrompt, + promptGroupId: promptGroupId.aiAssistant, + provider: 'gemini', + prompt: { + default: GEMINI_USER_PROMPT, + }, + }, + { + promptId: promptDictionary.attackDiscoveryDefault, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_DEFAULT, + }, + }, + { + promptId: promptDictionary.attackDiscoveryRefine, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_REFINE, + }, + }, + { + promptId: promptDictionary.attackDiscoveryContinue, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_CONTINUE, + }, + }, + { + promptId: promptDictionary.attackDiscoveryDetailsMarkdown, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN, + }, + }, + { + promptId: promptDictionary.attackDiscoveryEntitySummaryMarkdown, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN, + }, + }, + { + promptId: promptDictionary.attackDiscoveryMitreAttackTactics, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS, + }, + }, + { + promptId: promptDictionary.attackDiscoverySummaryMarkdown, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN, + }, + }, + { + promptId: promptDictionary.attackDiscoveryGenerationTitle, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_GENERATION_TITLE, + }, + }, + { + promptId: promptDictionary.attackDiscoveryGenerationInsights, + promptGroupId: promptGroupId.attackDiscovery, + prompt: { + default: ATTACK_DISCOVERY_GENERATION_INSIGHTS, + }, + }, +]; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/prompts.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/prompts.ts new file mode 100644 index 0000000000000..8bccb54653f03 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/prompts.ts @@ -0,0 +1,128 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const KNOWLEDGE_HISTORY = + 'If available, use the Knowledge History provided to try and answer the question. If not provided, you can try and query for additional knowledge via the KnowledgeBaseRetrievalTool.'; + +export const DEFAULT_SYSTEM_PROMPT = `You are a security analyst and expert in resolving security incidents. Your role is to assist by answering questions about Elastic Security. Do not answer questions unrelated to Elastic Security. ${KNOWLEDGE_HISTORY}`; +// system prompt from @afirstenberg +const BASE_GEMINI_PROMPT = + 'You are an assistant that is an expert at using tools and Elastic Security, doing your best to use these tools to answer questions or follow instructions. It is very important to use tools to answer the question or follow the instructions rather than coming up with your own answer. Tool calls are good. Sometimes you may need to make several tool calls to accomplish the task or get an answer to the question that was asked. Use as many tool calls as necessary.'; +const KB_CATCH = + 'If the knowledge base tool gives empty results, do your best to answer the question from the perspective of an expert security analyst.'; +export const GEMINI_SYSTEM_PROMPT = `${BASE_GEMINI_PROMPT} ${KB_CATCH}`; +export const BEDROCK_SYSTEM_PROMPT = `Use tools as often as possible, as they have access to the latest data and syntax. Always return value from NaturalLanguageESQLTool as is. Never return <thinking> tags in the response, but make sure to include <result> tags content in the response. Do not reflect on the quality of the returned search results in your response.`; +export const GEMINI_USER_PROMPT = `Now, always using the tools at your disposal, step by step, come up with a response to this request:\n\n`; + +export const STRUCTURED_SYSTEM_PROMPT = `Respond to the human as helpfully and accurately as possible. ${KNOWLEDGE_HISTORY} You have access to the following tools: + +{tools} + +The tool action_input should ALWAYS follow the tool JSON schema args. + +Valid "action" values: "Final Answer" or {tool_names} + +Use a json blob to specify a tool by providing an action key (tool name) and an action_input key (tool input strictly adhering to the tool JSON schema args). + +Provide only ONE action per $JSON_BLOB, as shown: + +\`\`\` + +{{ + + "action": $TOOL_NAME, + + "action_input": $TOOL_INPUT + +}} + +\`\`\` + +Follow this format: + +Question: input question to answer + +Thought: consider previous and subsequent steps + +Action: + +\`\`\` + +$JSON_BLOB + +\`\`\` + +Observation: action result + +... (repeat Thought/Action/Observation N times) + +Thought: I know what to respond + +Action: + +\`\`\` + +{{ + + "action": "Final Answer", + + "action_input": "Final response to human"}} + +Begin! Reminder to ALWAYS respond with a valid json blob of a single action with no additional output. When using tools, ALWAYS input the expected JSON schema args. Your answer will be parsed as JSON, so never use double quotes within the output and instead use backticks. Single quotes may be used, such as apostrophes. Response format is Action:\`\`\`$JSON_BLOB\`\`\`then Observation`; + +export const ATTACK_DISCOVERY_DEFAULT = + "You are a cyber security analyst tasked with analyzing security events from Elastic Security to identify and report on potential cyber attacks or progressions. Your report should focus on high-risk incidents that could severely impact the organization, rather than isolated alerts. Present your findings in a way that can be easily understood by anyone, regardless of their technical expertise, as if you were briefing the CISO. Break down your response into sections based on timing, hosts, and users involved. When correlating alerts, use kibana.alert.original_time when it's available, otherwise use @timestamp. Include appropriate context about the affected hosts and users. Describe how the attack progression might have occurred and, if feasible, attribute it to known threat groups. Prioritize high and critical alerts, but include lower-severity alerts if desired. In the description field, provide as much detail as possible, in a bulleted list explaining any attack progressions. Accuracy is of utmost importance. You MUST escape all JSON special characters (i.e. backslashes, double quotes, newlines, tabs, carriage returns, backspaces, and form feeds)."; + +export const ATTACK_DISCOVERY_REFINE = `You previously generated the following insights, but sometimes they represent the same attack. + +Combine the insights below, when they represent the same attack; leave any insights that are not combined unchanged:`; + +export const ATTACK_DISCOVERY_CONTINUE = `Continue exactly where you left off in the JSON output below, generating only the additional JSON output when it's required to complete your work. The additional JSON output MUST ALWAYS follow these rules: +1) it MUST conform to the schema above, because it will be checked against the JSON schema +2) it MUST escape all JSON special characters (i.e. backslashes, double quotes, newlines, tabs, carriage returns, backspaces, and form feeds), because it will be parsed as JSON +3) it MUST NOT repeat any the previous output, because that would prevent partial results from being combined +4) it MUST NOT restart from the beginning, because that would prevent partial results from being combined +5) it MUST NOT be prefixed or suffixed with additional text outside of the JSON, because that would prevent it from being combined and parsed as JSON: +`; + +const SYNTAX = '{{ field.name fieldValue1 fieldValue2 fieldValueN }}'; +const GOOD_SYNTAX_EXAMPLES = + 'Examples of CORRECT syntax (includes field names and values): {{ host.name hostNameValue }} {{ user.name userNameValue }} {{ source.ip sourceIpValue }}'; + +const BAD_SYNTAX_EXAMPLES = + 'Examples of INCORRECT syntax (bad, because the field names are not included): {{ hostNameValue }} {{ userNameValue }} {{ sourceIpValue }}'; + +const RECONNAISSANCE = 'Reconnaissance'; +const INITIAL_ACCESS = 'Initial Access'; +const EXECUTION = 'Execution'; +const PERSISTENCE = 'Persistence'; +const PRIVILEGE_ESCALATION = 'Privilege Escalation'; +const DISCOVERY = 'Discovery'; +const LATERAL_MOVEMENT = 'Lateral Movement'; +const COMMAND_AND_CONTROL = 'Command and Control'; +const EXFILTRATION = 'Exfiltration'; + +const MITRE_ATTACK_TACTICS = [ + RECONNAISSANCE, + INITIAL_ACCESS, + EXECUTION, + PERSISTENCE, + PRIVILEGE_ESCALATION, + DISCOVERY, + LATERAL_MOVEMENT, + COMMAND_AND_CONTROL, + EXFILTRATION, +] as const; +export const ATTACK_DISCOVERY_GENERATION_DETAILS_MARKDOWN = `A detailed insight with markdown, where each markdown bullet contains a description of what happened that reads like a story of the attack as it played out and always uses special ${SYNTAX} syntax for field names and values from the source data. ${GOOD_SYNTAX_EXAMPLES} ${BAD_SYNTAX_EXAMPLES}`; +export const ATTACK_DISCOVERY_GENERATION_ENTITY_SUMMARY_MARKDOWN = `A short (no more than a sentence) summary of the insight featuring only the host.name and user.name fields (when they are applicable), using the same ${SYNTAX} syntax`; +export const ATTACK_DISCOVERY_GENERATION_MITRE_ATTACK_TACTICS = `An array of MITRE ATT&CK tactic for the insight, using one of the following values: ${MITRE_ATTACK_TACTICS.join( + ',' +)}`; +export const ATTACK_DISCOVERY_GENERATION_SUMMARY_MARKDOWN = `A markdown summary of insight, using the same ${SYNTAX} syntax`; +export const ATTACK_DISCOVERY_GENERATION_TITLE = + 'A short, no more than 7 words, title for the insight, NOT formatted with special syntax or markdown. This must be as brief as possible.'; +export const ATTACK_DISCOVERY_GENERATION_INSIGHTS = `Insights with markdown that always uses special ${SYNTAX} syntax for field names and values from the source data. ${GOOD_SYNTAX_EXAMPLES} ${BAD_SYNTAX_EXAMPLES}`; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/saved_object_mappings.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/saved_object_mappings.ts new file mode 100644 index 0000000000000..f91b8f08002b7 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/saved_object_mappings.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { SavedObjectsType } from '@kbn/core/server'; +import { promptSavedObjectType } from '../../../common/constants'; + +export const promptSavedObjectMappings: SavedObjectsType['mappings'] = { + dynamic: false, + properties: { + description: { + type: 'text', + }, + promptId: { + // represent unique prompt + type: 'keyword', + }, + promptGroupId: { + // represents unique groups of prompts + type: 'keyword', + }, + provider: { + type: 'keyword', + }, + model: { + type: 'keyword', + }, + prompt: { + properties: { + // English is default + default: { + type: 'text', + }, + // optionally, add ISO 639 two-letter language code to support more translations + }, + }, + }, +}; + +export const promptType: SavedObjectsType = { + name: promptSavedObjectType, + hidden: false, + management: { + importableAndExportable: true, + visibleInManagement: false, + }, + namespaceType: 'agnostic', + mappings: promptSavedObjectMappings, +}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/types.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/types.ts new file mode 100644 index 0000000000000..ec2a46a0bc31e --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/prompt/types.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface Prompt { + promptId: string; + promptGroupId: string; + prompt: { + default: string; + }; + provider?: string; + model?: string; + description?: string; +} diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/plugin.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/plugin.ts index e93e3786b123c..2e3a149c71300 100755 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/plugin.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/plugin.ts @@ -10,6 +10,7 @@ import { PluginInitializerContext, CoreStart, Plugin, Logger } from '@kbn/core/s import { AssistantFeatures } from '@kbn/elastic-assistant-common'; import { ReplaySubject, type Subject } from 'rxjs'; import { MlPluginSetup } from '@kbn/ml-plugin/server'; +import { initSavedObjects } from './saved_objects'; import { events } from './lib/telemetry/event_based_telemetry'; import { AssistantTool, @@ -55,6 +56,8 @@ export class ElasticAssistantPlugin ) { this.logger.debug('elasticAssistant: Setup'); + initSavedObjects(core.savedObjects); + this.assistantService = new AIAssistantService({ logger: this.logger.get('service'), ml: plugins.ml, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx index 4668d69d1d1f7..b13230f5a8ce5 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/invoke_attack_discovery_graph/index.tsx @@ -7,7 +7,7 @@ import type { ActionsClient } from '@kbn/actions-plugin/server'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import { Logger } from '@kbn/core/server'; +import { Logger, SavedObjectsClientContract } from '@kbn/core/server'; import { ApiConfig, AttackDiscovery, Replacements } from '@kbn/elastic-assistant-common'; import { AnonymizationFieldResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; import { ActionsClientLlm } from '@kbn/langchain/server'; @@ -23,6 +23,7 @@ import { import { GraphState } from '../../../../../lib/attack_discovery/graphs/default_attack_discovery_graph/types'; import { throwIfErrorCountsExceeded } from '../throw_if_error_counts_exceeded'; import { getLlmType } from '../../../../utils'; +import { getAttackDiscoveryPrompts } from '../../../../../lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts'; export const invokeAttackDiscoveryGraph = async ({ actionsClient, @@ -38,6 +39,7 @@ export const invokeAttackDiscoveryGraph = async ({ latestReplacements, logger, onNewReplacements, + savedObjectsClient, size, start, }: { @@ -54,6 +56,7 @@ export const invokeAttackDiscoveryGraph = async ({ latestReplacements: Replacements; logger: Logger; onNewReplacements: (newReplacements: Replacements) => void; + savedObjectsClient: SavedObjectsClientContract; start?: string; size: number; }): Promise<{ @@ -89,6 +92,15 @@ export const invokeAttackDiscoveryGraph = async ({ throw new Error('LLM is required for attack discoveries'); } + const attackDiscoveryPrompts = await getAttackDiscoveryPrompts({ + actionsClient, + connectorId: apiConfig.connectorId, + // if in future oss has different prompt, add it as model here + model, + provider: llmType, + savedObjectsClient, + }); + const graph = getDefaultAttackDiscoveryGraph({ alertsIndexPattern, anonymizationFields, @@ -98,6 +110,7 @@ export const invokeAttackDiscoveryGraph = async ({ llm, logger, onNewReplacements, + prompts: attackDiscoveryPrompts, replacements: latestReplacements, size, start, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts index 54fabb7891548..ae581c9c234b2 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts @@ -66,6 +66,7 @@ export const postAttackDiscoveryRoute = ( const assistantContext = await context.elasticAssistant; const logger: Logger = assistantContext.logger; const telemetry = assistantContext.telemetry; + const savedObjectsClient = assistantContext.savedObjectsClient; try { // get the actions plugin start contract from the request context: @@ -144,6 +145,7 @@ export const postAttackDiscoveryRoute = ( latestReplacements, logger, onNewReplacements, + savedObjectsClient, size, start, }) diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts index 56ccca59da220..bda4da8413120 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts @@ -106,6 +106,7 @@ export const chatCompleteRoute = ( const connector = connectors.length > 0 ? connectors[0] : undefined; actionTypeId = connector?.actionTypeId ?? '.gen-ai'; const isOssModel = isOpenSourceModel(connector); + const savedObjectsClient = ctx.elasticAssistant.savedObjectsClient; // replacements const anonymizationFieldsRes = @@ -221,6 +222,7 @@ export const chatCompleteRoute = ( response, telemetry, responseLanguage: request.body.responseLanguage, + savedObjectsClient, ...(productDocsAvailable ? { llmTasks: ctx.elasticAssistant.llmTasks } : {}), }); } catch (err) { diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts index 80d507504d127..39a778bee4d95 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts @@ -30,6 +30,14 @@ import { createToolCallingAgent, } from 'langchain/agents'; import { omit } from 'lodash/fp'; +import { promptGroupId } from '../../lib/prompt/local_prompt_object'; +import { getModelOrOss } from '../../lib/prompt/helpers'; +import { getAttackDiscoveryPrompts } from '../../lib/attack_discovery/graphs/default_attack_discovery_graph/nodes/helpers/prompts'; +import { + formatPrompt, + formatPromptStructured, +} from '../../lib/langchain/graphs/default_assistant_graph/prompts'; +import { getPrompt, promptDictionary } from '../../lib/prompt'; import { buildResponse } from '../../lib/build_response'; import { AssistantDataClients } from '../../lib/langchain/executors/types'; import { AssistantToolParams, ElasticAssistantRequestHandlerContext, GetElser } from '../../types'; @@ -42,12 +50,6 @@ import { DefaultAssistantGraph, getDefaultAssistantGraph, } from '../../lib/langchain/graphs/default_assistant_graph/graph'; -import { - bedrockToolCallingAgentPrompt, - geminiToolCallingAgentPrompt, - openAIFunctionAgentPrompt, - structuredChatAgentPrompt, -} from '../../lib/langchain/graphs/default_assistant_graph/prompts'; import { getLlmClass, getLlmType, isOpenSourceModel } from '../utils'; import { getGraphsFromNames } from './get_graphs_from_names'; @@ -95,6 +97,7 @@ export const postEvaluateRoute = ( const actions = ctx.elasticAssistant.actions; const logger = assistantContext.logger.get('evaluate'); const abortSignal = getRequestAbortedSignal(request.events.aborted$); + const savedObjectsClient = ctx.elasticAssistant.savedObjectsClient; // Perform license, authenticated user and evaluation FF checks const checkResponse = performChecks({ @@ -176,6 +179,20 @@ export const postEvaluateRoute = ( ids: connectorIds, throwIfSystemAction: false, }); + const connectorsWithPrompts = await Promise.all( + connectors.map(async (connector) => { + const prompts = await getAttackDiscoveryPrompts({ + actionsClient, + connectorId: connector.id, + connector, + savedObjectsClient, + }); + return { + ...connector, + prompts, + }; + }) + ); // Fetch any tools registered to the security assistant const assistantTools = assistantContext.getRegisteredTools(DEFAULT_PLUGIN_NAME); @@ -190,7 +207,7 @@ export const postEvaluateRoute = ( actionsClient, alertsIndexPattern, attackDiscoveryGraphs, - connectors, + connectors: connectorsWithPrompts, connectorTimeout: CONNECTOR_TIMEOUT, datasetName, esClient, @@ -217,6 +234,7 @@ export const postEvaluateRoute = ( graph: DefaultAssistantGraph; llmType: string | undefined; isOssModel: boolean | undefined; + connectorId: string; }> = await Promise.all( connectors.map(async (connector) => { const llmType = getLlmType(connector.actionTypeId); @@ -293,31 +311,40 @@ export const postEvaluateRoute = ( (tool) => tool.getTool(assistantToolParams) ?? [] ); + const defaultSystemPrompt = await getPrompt({ + actionsClient, + connector, + connectorId: connector.id, + model: getModelOrOss(llmType, isOssModel), + promptGroupId: promptGroupId.aiAssistant, + promptId: promptDictionary.systemPrompt, + provider: llmType, + savedObjectsClient, + }); + const agentRunnable = isOpenAI ? await createOpenAIFunctionsAgent({ llm, tools, - prompt: openAIFunctionAgentPrompt, + prompt: formatPrompt(defaultSystemPrompt), streamRunnable: false, }) : llmType && ['bedrock', 'gemini'].includes(llmType) ? createToolCallingAgent({ llm, tools, - prompt: - llmType === 'bedrock' - ? bedrockToolCallingAgentPrompt - : geminiToolCallingAgentPrompt, + prompt: formatPrompt(defaultSystemPrompt), streamRunnable: false, }) : await createStructuredChatAgent({ llm, tools, - prompt: structuredChatAgentPrompt, + prompt: formatPromptStructured(defaultSystemPrompt), streamRunnable: false, }); return { + connectorId: connector.id, name: `${runName} - ${connector.name}`, llmType, isOssModel, @@ -326,6 +353,8 @@ export const postEvaluateRoute = ( dataClients, createLlmInstance, logger, + actionsClient, + savedObjectsClient, tools, replacements: {}, }), @@ -334,7 +363,7 @@ export const postEvaluateRoute = ( ); // Run an evaluation for each graph so they show up separately (resulting in each dataset run grouped by connector) - await asyncForEach(graphs, async ({ name, graph, llmType, isOssModel }) => { + await asyncForEach(graphs, async ({ name, graph, llmType, isOssModel, connectorId }) => { // Wrapper function for invoking the graph (to parse different input/output formats) const predict = async (input: { input: string }) => { logger.debug(`input:\n ${JSON.stringify(input, null, 2)}`); @@ -342,6 +371,7 @@ export const postEvaluateRoute = ( const r = await graph.invoke( { input: input.input, + connectorId, conversationId: undefined, responseLanguage: 'English', llmType, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/helpers.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/helpers.ts index 25d4ce1a2ec45..c66f0482661fa 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/helpers.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/helpers.ts @@ -12,6 +12,7 @@ import { KibanaRequest, KibanaResponseFactory, Logger, + SavedObjectsClientContract, } from '@kbn/core/server'; import { StreamResponseWithHeaders } from '@kbn/ml-response-stream/server'; @@ -235,6 +236,7 @@ export interface LangChainExecuteParams { getElser: GetElser; response: KibanaResponseFactory; responseLanguage?: string; + savedObjectsClient: SavedObjectsClientContract; systemPrompt?: string; } export const langChainExecute = async ({ @@ -258,6 +260,7 @@ export const langChainExecute = async ({ response, responseLanguage, isStream = true, + savedObjectsClient, systemPrompt, }: LangChainExecuteParams) => { // Fetch any tools registered by the request's originating plugin @@ -316,6 +319,7 @@ export const langChainExecute = async ({ request, replacements, responseLanguage, + savedObjectsClient, size: request.body.size, systemPrompt, telemetry, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts index 59dd35bc0f61f..8cd6dd24c24c7 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts @@ -99,6 +99,7 @@ export const postActionsConnectorExecuteRoute = ( // get the actions plugin start contract from the request context: const actions = ctx.elasticAssistant.actions; const inference = ctx.elasticAssistant.inference; + const savedObjectsClient = ctx.elasticAssistant.savedObjectsClient; const productDocsAvailable = (await ctx.elasticAssistant.llmTasks.retrieveDocumentationAvailable()) ?? false; const actionsClient = await actions.getActionsClientWithRequest(request); @@ -153,6 +154,7 @@ export const postActionsConnectorExecuteRoute = ( request, response, telemetry, + savedObjectsClient, systemPrompt, ...(productDocsAvailable ? { llmTasks: ctx.elasticAssistant.llmTasks } : {}), }); diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/request_context_factory.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/request_context_factory.ts index 08ef1bb1828d6..7580fc8c0989d 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/request_context_factory.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/request_context_factory.ts @@ -80,7 +80,7 @@ export class RequestContextFactory implements IRequestContextFactory { }, llmTasks: startPlugins.llmTasks, inference: startPlugins.inference, - + savedObjectsClient: coreStart.savedObjects.getScopedClient(request), telemetry: core.analytics, // Note: modelIdOverride is used here to enable setting up the KB using a different ELSER model, which diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/saved_objects.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/saved_objects.ts new file mode 100644 index 0000000000000..4095d12930968 --- /dev/null +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/saved_objects.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CoreSetup } from '@kbn/core/server'; +import { promptType } from './lib/prompt/saved_object_mappings'; + +export const initSavedObjects = (savedObjects: CoreSetup['savedObjects']) => { + try { + savedObjects.registerType(promptType); + } catch (e) { + // implementation intends to fall back to reasonable defaults when the saved objects are unavailable + // do not block the plugin from starting + } +}; diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts index 1102d4b7b8441..b99479591b877 100755 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/types.ts @@ -9,23 +9,24 @@ import type { PluginSetupContract as ActionsPluginSetup, PluginStartContract as ActionsPluginStart, } from '@kbn/actions-plugin/server'; -import type { +import { AuthenticatedUser, CoreRequestHandlerContext, CoreSetup, AnalyticsServiceSetup, CustomRequestHandlerContext, + ElasticsearchClient, IRouter, KibanaRequest, Logger, AuditLogger, + SavedObjectsClientContract, } from '@kbn/core/server'; import type { LlmTasksPluginStart } from '@kbn/llm-tasks-plugin/server'; import { type MlPluginSetup } from '@kbn/ml-plugin/server'; import { DynamicStructuredTool, Tool } from '@langchain/core/tools'; import { SpacesPluginSetup, SpacesPluginStart } from '@kbn/spaces-plugin/server'; import { TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; -import { ElasticsearchClient } from '@kbn/core/server'; import { AttackDiscoveryPostRequestBody, DefendInsightsPostRequestBody, @@ -140,6 +141,7 @@ export interface ElasticAssistantApiRequestHandlerContext { getAIAssistantAnonymizationFieldsDataClient: () => Promise<AIAssistantDataClient | null>; llmTasks: LlmTasksPluginStart; inference: InferenceServerStart; + savedObjectsClient: SavedObjectsClientContract; telemetry: AnalyticsServiceSetup; } /** diff --git a/x-pack/solutions/security/plugins/elastic_assistant/tsconfig.json b/x-pack/solutions/security/plugins/elastic_assistant/tsconfig.json index 6d12200770b01..ec7c5badce238 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/tsconfig.json +++ b/x-pack/solutions/security/plugins/elastic_assistant/tsconfig.json @@ -53,6 +53,8 @@ "@kbn/core-analytics-server", "@kbn/llm-tasks-plugin", "@kbn/product-doc-base-plugin", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/inference-common" ], "exclude": [ "target/**/*", diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx index 3a480b47c9d08..c33e12cc49717 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx @@ -171,6 +171,7 @@ export const generateFleetPackageInfo = (): PackageInfo => { ml_module: [], security_rule: [], tag: [], + security_ai_prompt: [], osquery_pack_asset: [], osquery_saved_query: [], },