From 43ffa96831323eff62cc1a88928e1a76c4b97719 Mon Sep 17 00:00:00 2001 From: Ashokaditya <1849116+ashokaditya@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:05:07 +0100 Subject: [PATCH 01/87] [Security Solution][Endpoint][Response Actions] Show download link for `get-file` action on response actions history (#144094) * Show download link for get-file success Show download link for successful get-file actions on action history fixes elastic/security-team/issues/5076 * add missing help prefix * add tests fixes elastic/security-team/issues/5076 * update tests review changes (@paul-tavares) * use test ids instead review change (@paul-tavares) * Update use_response_actions_log_table.tsx review change (@dasansol92) * reorder if statements review suggestion (@gergoabraham) --- ...point_response_actions_console_commands.ts | 2 +- .../endpoint_response_actions_list/mocks.tsx | 6 +- .../response_actions_log.test.tsx | 140 +++++++++++++----- .../use_response_actions_log_table.tsx | 41 ++++- .../response_action_file_download_link.tsx | 71 +++++---- 5 files changed, 181 insertions(+), 79 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts index 5269306424a8..1b4768c13d14 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts @@ -379,7 +379,7 @@ export const getEndpointResponseActionsConsoleCommands = ({ capabilities: endpointCapabilities, privileges: endpointPrivileges, }, - exampleUsage: 'get-file path "/full/path/to/file.txt" --comment "Possible malware"', + exampleUsage: 'get-file --path "/full/path/to/file.txt" --comment "Possible malware"', exampleInstruction: ENTER_OR_ADD_COMMENT_ARG_INSTRUCTION, validate: capabilitiesAndPrivilegesValidator, mustHaveArgs: true, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx index 65b40d9a924e..05b3fec8cd96 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx @@ -7,7 +7,10 @@ import uuid from 'uuid'; import type { ActionListApiResponse } from '../../../../common/endpoint/types'; -import type { ResponseActionStatus } from '../../../../common/endpoint/service/response_actions/constants'; +import type { + ResponseActionsApiCommandNames, + ResponseActionStatus, +} from '../../../../common/endpoint/service/response_actions/constants'; import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator'; export const getActionListMock = async ({ @@ -49,6 +52,7 @@ export const getActionListMock = async ({ const actionDetails: ActionListApiResponse['data'] = actionIds.map((actionId) => { return endpointActionGenerator.generateActionDetails({ agents: [id], + command: (commands?.[0] ?? 'isolate') as ResponseActionsApiCommandNames, id: actionId, isCompleted, isExpired, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx index 09d201c171e9..01d19867d421 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx @@ -21,6 +21,7 @@ import { getActionListMock } from './mocks'; import { useGetEndpointsList } from '../../hooks/endpoint/use_get_endpoints_list'; import uuid from 'uuid'; import { RESPONSE_ACTION_API_COMMANDS_NAMES } from '../../../../common/endpoint/service/response_actions/constants'; +import { useUserPrivileges as _useUserPrivileges } from '../../../common/components/user_privileges'; let mockUseGetEndpointActionList: { isFetched?: boolean; @@ -113,9 +114,15 @@ jest.mock('@kbn/kibana-react-plugin/public', () => { jest.mock('../../hooks/endpoint/use_get_endpoints_list'); +jest.mock('../../../common/components/user_privileges'); + const mockUseGetEndpointsList = useGetEndpointsList as jest.Mock; describe('Response actions history', () => { + const useUserPrivilegesMock = _useUserPrivileges as jest.Mock< + ReturnType + >; + const testPrefix = 'response-actions-list'; let render: ( @@ -409,6 +416,53 @@ describe('Response actions history', () => { ); }); + it('should contain download link in expanded row for `get-file` action WITH file operation permission', async () => { + mockUseGetEndpointActionList = { + ...baseMockedActionList, + data: await getActionListMock({ actionCount: 1, commands: ['get-file'] }), + }; + + render(); + const { getByTestId } = renderResult; + + const expandButton = getByTestId(`${testPrefix}-expand-button`); + userEvent.click(expandButton); + const downloadLink = getByTestId(`${testPrefix}-getFileDownloadLink`); + expect(downloadLink).toBeTruthy(); + expect(downloadLink.textContent).toEqual( + 'Click here to download(ZIP file passcode: elastic)' + ); + }); + + it('should not contain download link in expanded row for `get-file` action when NO file operation permission', async () => { + const privileges = useUserPrivilegesMock(); + + useUserPrivilegesMock.mockImplementationOnce(() => { + return { + ...privileges, + endpointPrivileges: { + ...privileges.endpointPrivileges, + canWriteFileOperations: false, + }, + }; + }); + + mockUseGetEndpointActionList = { + ...baseMockedActionList, + data: await getActionListMock({ actionCount: 1, commands: ['get-file'] }), + }; + + render(); + const { getByTestId, queryByTestId } = renderResult; + + const expandButton = getByTestId(`${testPrefix}-expand-button`); + userEvent.click(expandButton); + const output = getByTestId(`${testPrefix}-details-tray-output`); + expect(output).toBeTruthy(); + expect(output.textContent).toEqual('get-file completed successfully'); + expect(queryByTestId(`${testPrefix}-getFileDownloadLink`)).toBeNull(); + }); + it('should refresh data when autoRefresh is toggled on', async () => { render(); const { getByTestId } = renderResult; @@ -552,17 +606,22 @@ describe('Response actions history', () => { it('should show a list of actions when opened', () => { render(); - const { getByTestId } = renderResult; + const { getByTestId, getAllByTestId } = renderResult; userEvent.click(getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`)); const filterList = getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); expect(filterList).toBeTruthy(); - expect(filterList.querySelectorAll('ul>li').length).toEqual( + expect(getAllByTestId(`${filterPrefix}-option`).length).toEqual( RESPONSE_ACTION_API_COMMANDS_NAMES.length ); - expect( - Array.from(filterList.querySelectorAll('ul>li')).map((option) => option.textContent) - ).toEqual(['isolate', 'release', 'kill-process', 'suspend-process', 'processes', 'get-file']); + expect(getAllByTestId(`${filterPrefix}-option`).map((option) => option.textContent)).toEqual([ + 'isolate', + 'release', + 'kill-process', + 'suspend-process', + 'processes', + 'get-file', + ]); }); it('should have `clear all` button `disabled` when no selected values', () => { @@ -580,15 +639,17 @@ describe('Response actions history', () => { it('should show a list of statuses when opened', () => { render(); - const { getByTestId } = renderResult; + const { getByTestId, getAllByTestId } = renderResult; userEvent.click(getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`)); const filterList = getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); expect(filterList).toBeTruthy(); - expect(filterList.querySelectorAll('ul>li').length).toEqual(3); - expect( - Array.from(filterList.querySelectorAll('ul>li')).map((option) => option.textContent) - ).toEqual(['Failed', 'Pending', 'Successful']); + expect(getAllByTestId(`${filterPrefix}-option`).length).toEqual(3); + expect(getAllByTestId(`${filterPrefix}-option`).map((option) => option.textContent)).toEqual([ + 'Failed', + 'Pending', + 'Successful', + ]); }); it('should have `clear all` button `disabled` when no selected values', () => { @@ -623,13 +684,13 @@ describe('Response actions history', () => { it('should show a list of host names when opened', () => { render({ showHostNames: true }); - const { getByTestId } = renderResult; + const { getByTestId, getAllByTestId } = renderResult; const popoverButton = getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`); userEvent.click(popoverButton); const filterList = getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); expect(filterList).toBeTruthy(); - expect(filterList.querySelectorAll('ul>li').length).toEqual(9); + expect(getAllByTestId(`${filterPrefix}-option`).length).toEqual(9); expect( getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`).querySelector( '.euiNotificationBadge' @@ -652,16 +713,15 @@ describe('Response actions history', () => { } }); - const filterList = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); - - const selectedFilterOptions = Array.from(filterList.querySelectorAll('ul>li')).reduce< - number[] - >((acc, curr, i) => { - if (curr.getAttribute('aria-checked') === 'true') { - acc.push(i); - } - return acc; - }, []); + const selectedFilterOptions = getAllByTestId(`${filterPrefix}-option`).reduce( + (acc, curr, i) => { + if (curr.getAttribute('aria-checked') === 'true') { + acc.push(i); + } + return acc; + }, + [] + ); expect(selectedFilterOptions).toEqual([1, 3, 5]); }); @@ -686,16 +746,16 @@ describe('Response actions history', () => { // re-open userEvent.click(popoverButton); - const filterList = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); - const selectedFilterOptions = Array.from(filterList.querySelectorAll('ul>li')).reduce< - number[] - >((acc, curr, i) => { - if (curr.getAttribute('aria-checked') === 'true') { - acc.push(i); - } - return acc; - }, []); + const selectedFilterOptions = getAllByTestId(`${filterPrefix}-option`).reduce( + (acc, curr, i) => { + if (curr.getAttribute('aria-checked') === 'true') { + acc.push(i); + } + return acc; + }, + [] + ); expect(selectedFilterOptions).toEqual([0, 1, 2]); }); @@ -730,15 +790,15 @@ describe('Response actions history', () => { } }); - const filterList = renderResult.getByTestId(`${testPrefix}-${filterPrefix}-popoverList`); - const selectedFilterOptions = Array.from(filterList.querySelectorAll('ul>li')).reduce< - number[] - >((acc, curr, i) => { - if (curr.getAttribute('aria-checked') === 'true') { - acc.push(i); - } - return acc; - }, []); + const selectedFilterOptions = getAllByTestId(`${filterPrefix}-option`).reduce( + (acc, curr, i) => { + if (curr.getAttribute('aria-checked') === 'true') { + acc.push(i); + } + return acc; + }, + [] + ); expect(selectedFilterOptions).toEqual([0, 1, 2, 4, 6, 8]); }); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx index 443eac84c6b1..8d38b22508be 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/use_response_actions_log_table.tsx @@ -5,7 +5,6 @@ * 2.0. */ import React, { useCallback, useMemo, useState } from 'react'; -import type { HorizontalAlignment } from '@elastic/eui'; import { EuiI18nNumber, @@ -20,6 +19,7 @@ import { EuiScreenReaderOnly, EuiText, EuiToolTip, + type HorizontalAlignment, } from '@elastic/eui'; import { css, euiStyled } from '@kbn/kibana-react-plugin/common'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -33,6 +33,7 @@ import { getEmptyValue } from '../../../common/components/empty_value'; import { StatusBadge } from './components/status_badge'; import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; import { MANAGEMENT_PAGE_SIZE_OPTIONS } from '../../common/constants'; +import { ResponseActionFileDownloadLink } from '../response_action_file_download_link'; const emptyValue = getEmptyValue(); @@ -137,6 +138,7 @@ export const useResponseActionsLogTable = ({ : undefined; const command = getUiCommand(_command); + const isGetFileCommand = command === 'get-file'; const dataList = [ { title: OUTPUT_MESSAGES.expandSection.placedAt, @@ -169,6 +171,35 @@ export const useResponseActionsLogTable = ({ }; }); + const getOutputContent = () => { + if (isExpired) { + return OUTPUT_MESSAGES.hasExpired(command); + } + + if (!isCompleted) { + return OUTPUT_MESSAGES.isPending(command); + } + + if (!wasSuccessful) { + return OUTPUT_MESSAGES.hasFailed(command); + } + + if (isGetFileCommand) { + return ( + <> + {OUTPUT_MESSAGES.wasSuccessful(command)} + + + ); + } + + return OUTPUT_MESSAGES.wasSuccessful(command); + }; + const outputList = [ { title: ( @@ -177,13 +208,7 @@ export const useResponseActionsLogTable = ({ description: ( // codeblock for output - {isExpired - ? OUTPUT_MESSAGES.hasExpired(command) - : isCompleted - ? wasSuccessful - ? OUTPUT_MESSAGES.wasSuccessful(command) - : OUTPUT_MESSAGES.hasFailed(command) - : OUTPUT_MESSAGES.isPending(command)} + {getOutputContent()} ), }, diff --git a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx index e873a4ce253f..20701ff55559 100644 --- a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx +++ b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx @@ -5,9 +5,14 @@ * 2.0. */ -import type { CSSProperties } from 'react'; -import React, { memo, useMemo } from 'react'; -import { EuiButtonEmpty, EuiLoadingContent, EuiText } from '@elastic/eui'; +import React, { memo, useMemo, type CSSProperties } from 'react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiButtonEmpty, + EuiLoadingContent, + EuiText, +} from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; @@ -40,6 +45,7 @@ export interface ResponseActionFileDownloadLinkProps { agentId?: string; buttonTitle?: string; 'data-test-subj'?: string; + textSize?: 's' | 'xs'; } /** @@ -49,7 +55,13 @@ export interface ResponseActionFileDownloadLinkProps { * NOTE: Currently displays only the link for the first host in the Action */ export const ResponseActionFileDownloadLink = memo( - ({ action, agentId, buttonTitle = DEFAULT_BUTTON_TITLE, 'data-test-subj': dataTestSubj }) => { + ({ + action, + agentId, + buttonTitle = DEFAULT_BUTTON_TITLE, + 'data-test-subj': dataTestSubj, + textSize = 's', + }) => { const getTestId = useTestIdGenerator(dataTestSubj); const { canWriteFileOperations } = useUserPrivileges().endpointPrivileges; @@ -97,31 +109,32 @@ export const ResponseActionFileDownloadLink = memo - - {buttonTitle} - - - - - + + + + {buttonTitle} + + + + + + + + ); } ); From 7a3243b79fbc309875490e1477a3d97b80854676 Mon Sep 17 00:00:00 2001 From: Dmitrii Shevchenko Date: Mon, 31 Oct 2022 11:44:31 +0100 Subject: [PATCH 02/87] [Security Solution] Added guided onboarding for the rules area (#144016) --- .../api/hooks/use_bulk_action_mutation.ts | 4 + .../api/hooks/use_bulk_export_mutation.ts | 8 +- .../use_create_prebuilt_rules_mutation.ts | 4 + .../api/hooks/use_create_rule_mutation.ts | 4 + .../use_fetch_prebuilt_rules_status_query.ts | 9 +- .../api/hooks/use_fetch_rule_by_id_query.ts | 9 +- .../api/hooks/use_fetch_tags_query.ts | 8 +- .../api/hooks/use_find_rules_query.ts | 11 +- .../api/hooks/use_update_rule_mutation.ts | 4 + .../rules_management_tour.tsx | 118 ++++++++++++++++++ .../guided_onboarding/translations.ts | 36 ++++++ .../use_is_element_mounted.ts | 35 ++++++ .../rules_table_filters.tsx | 2 + .../pages/rule_management/index.tsx | 2 + .../load_prepackaged_rules_button.tsx | 59 +++++---- 15 files changed, 272 insertions(+), 41 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour.tsx create mode 100644 x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/translations.ts create mode 100644 x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/use_is_element_mounted.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts index e52a5cd8e061..647230982c83 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts @@ -13,6 +13,9 @@ import { useInvalidateFetchPrebuiltRulesStatusQuery } from './use_fetch_prebuilt import { useInvalidateFindRulesQuery, useUpdateRulesCache } from './use_find_rules_query'; import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; import { useInvalidateFetchRuleByIdQuery } from './use_fetch_rule_by_id_query'; +import { DETECTION_ENGINE_RULES_BULK_ACTION } from '../../../../../common/constants'; + +export const BULK_ACTION_MUTATION_KEY = ['POST', DETECTION_ENGINE_RULES_BULK_ACTION]; export const useBulkActionMutation = ( options?: UseMutationOptions @@ -27,6 +30,7 @@ export const useBulkActionMutation = ( (action: BulkActionProps) => performBulkAction(action), { ...options, + mutationKey: BULK_ACTION_MUTATION_KEY, onSuccess: (...args) => { const [res, { action }] = args; switch (action) { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts index bcc5fbcdbb18..623db44af609 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts @@ -6,14 +6,20 @@ */ import type { UseMutationOptions } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query'; +import { DETECTION_ENGINE_RULES_BULK_ACTION } from '../../../../../common/constants'; import type { BulkExportProps, BulkExportResponse } from '../api'; import { bulkExportRules } from '../api'; +export const BULK_ACTION_MUTATION_KEY = ['POST', DETECTION_ENGINE_RULES_BULK_ACTION]; + export const useBulkExportMutation = ( options?: UseMutationOptions ) => { return useMutation( (action: BulkExportProps) => bulkExportRules(action), - options + { + ...options, + mutationKey: BULK_ACTION_MUTATION_KEY, + } ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts index 2559be0609d0..86c6efbd50f8 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_prebuilt_rules_mutation.ts @@ -11,6 +11,9 @@ import { createPrepackagedRules } from '../api'; import { useInvalidateFetchPrebuiltRulesStatusQuery } from './use_fetch_prebuilt_rules_status_query'; import { useInvalidateFindRulesQuery } from './use_find_rules_query'; import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; +import { PREBUILT_RULES_URL } from '../../../../../common/detection_engine/prebuilt_rules/api/urls'; + +export const CREATE_PREBUILT_RULES_MUTATION_KEY = ['PUT', PREBUILT_RULES_URL]; export const useCreatePrebuiltRulesMutation = ( options?: UseMutationOptions @@ -21,6 +24,7 @@ export const useCreatePrebuiltRulesMutation = ( return useMutation(() => createPrepackagedRules(), { ...options, + mutationKey: CREATE_PREBUILT_RULES_MUTATION_KEY, onSuccess: (...args) => { // Always invalidate all rules and the prepackaged rules status cache as // the number of rules might change after the installation diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts index 8d62927a6261..56a3d6749271 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts @@ -6,6 +6,7 @@ */ import type { UseMutationOptions } from '@tanstack/react-query'; import { useMutation } from '@tanstack/react-query'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import type { RuleCreateProps, RuleResponse, @@ -16,6 +17,8 @@ import { useInvalidateFetchPrebuiltRulesStatusQuery } from './use_fetch_prebuilt import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; import { useInvalidateFindRulesQuery } from './use_find_rules_query'; +export const CREATE_RULE_MUTATION_KEY = ['POST', DETECTION_ENGINE_RULES_URL]; + export const useCreateRuleMutation = ( options?: UseMutationOptions ) => { @@ -27,6 +30,7 @@ export const useCreateRuleMutation = ( (rule: RuleCreateProps) => createRule({ rule: transformOutput(rule) }), { ...options, + mutationKey: CREATE_RULE_MUTATION_KEY, onSuccess: (...args) => { invalidateFetchPrePackagedRulesStatusQuery(); invalidateFindRulesQuery(); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts index a0344386ffe0..5fd22fae143c 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_prebuilt_rules_status_query.ts @@ -10,14 +10,15 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; import { getPrePackagedRulesStatus } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; import type { PrePackagedRulesStatusResponse } from '../../logic'; +import { PREBUILT_RULES_STATUS_URL } from '../../../../../common/detection_engine/prebuilt_rules/api/urls'; -export const PREBUILT_RULES_STATUS_QUERY_KEY = 'prePackagedRulesStatus'; +export const PREBUILT_RULES_STATUS_QUERY_KEY = ['GET', PREBUILT_RULES_STATUS_URL]; export const useFetchPrebuiltRulesStatusQuery = ( - options: UseQueryOptions + options?: UseQueryOptions ) => { return useQuery( - [PREBUILT_RULES_STATUS_QUERY_KEY], + PREBUILT_RULES_STATUS_QUERY_KEY, async ({ signal }) => { const response = await getPrePackagedRulesStatus({ signal }); return response; @@ -40,7 +41,7 @@ export const useInvalidateFetchPrebuiltRulesStatusQuery = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries([PREBUILT_RULES_STATUS_QUERY_KEY], { + queryClient.invalidateQueries(PREBUILT_RULES_STATUS_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts index 03fe7c6e2df1..66539807787f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts @@ -8,12 +8,13 @@ import type { UseQueryOptions } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { transformInput } from '../../../../detections/containers/detection_engine/rules/transforms'; import type { Rule } from '../../logic'; import { fetchRuleById } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; -const FIND_ONE_RULE_QUERY_KEY = 'findOneRule'; +const FIND_ONE_RULE_QUERY_KEY = ['GET', DETECTION_ENGINE_RULES_URL]; /** * A wrapper around useQuery provides default values to the underlying query, @@ -23,9 +24,9 @@ const FIND_ONE_RULE_QUERY_KEY = 'findOneRule'; * @param options - react-query options * @returns useQuery result */ -export const useFetchRuleByIdQuery = (id: string, options: UseQueryOptions) => { +export const useFetchRuleByIdQuery = (id: string, options?: UseQueryOptions) => { return useQuery( - [FIND_ONE_RULE_QUERY_KEY, id], + [...FIND_ONE_RULE_QUERY_KEY, id], async ({ signal }) => { const response = await fetchRuleById({ signal, id }); @@ -49,7 +50,7 @@ export const useInvalidateFetchRuleByIdQuery = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries([FIND_ONE_RULE_QUERY_KEY], { + queryClient.invalidateQueries(FIND_ONE_RULE_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts index 1be43f992f07..c09ae5d6cb56 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_tags_query.ts @@ -8,12 +8,12 @@ import type { UseQueryOptions } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { DETECTION_ENGINE_TAGS_URL } from '../../../../../common/constants'; import type { FetchTagsResponse } from '../api'; import { fetchTags } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; -// TODO: https://github.com/elastic/kibana/pull/142950 Let's use more detailed cache keys, e.g. ['GET', DETECTION_ENGINE_TAGS_URL] -const TAGS_QUERY_KEY = 'tags'; +const TAGS_QUERY_KEY = ['GET', DETECTION_ENGINE_TAGS_URL]; /** * Hook for using the list of Tags from the Detection Engine API @@ -21,7 +21,7 @@ const TAGS_QUERY_KEY = 'tags'; */ export const useFetchTagsQuery = (options?: UseQueryOptions) => { return useQuery( - [TAGS_QUERY_KEY], + TAGS_QUERY_KEY, async ({ signal }) => { return fetchTags({ signal }); }, @@ -36,7 +36,7 @@ export const useInvalidateFetchTagsQuery = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries([TAGS_QUERY_KEY], { + queryClient.invalidateQueries(TAGS_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts index ad50ab471a7f..35b6430a5117 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts @@ -8,6 +8,7 @@ import type { UseQueryOptions } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { DETECTION_ENGINE_RULES_URL_FIND } from '../../../../../common/constants'; import type { FilterOptions, PaginationOptions, Rule, SortingOptions } from '../../logic'; import { fetchRules } from '../api'; import { DEFAULT_QUERY_OPTIONS } from './constants'; @@ -18,7 +19,7 @@ export interface FindRulesQueryArgs { pagination?: Pick; } -const FIND_RULES_QUERY_KEY = 'findRules'; +const FIND_RULES_QUERY_KEY = ['GET', DETECTION_ENGINE_RULES_URL_FIND]; export interface RulesQueryResponse { rules: Rule[]; @@ -37,7 +38,7 @@ export interface RulesQueryResponse { */ export const useFindRulesQuery = ( queryArgs: FindRulesQueryArgs, - queryOptions: UseQueryOptions< + queryOptions?: UseQueryOptions< RulesQueryResponse, Error, RulesQueryResponse, @@ -45,7 +46,7 @@ export const useFindRulesQuery = ( > ) => { return useQuery( - [FIND_RULES_QUERY_KEY, queryArgs], + [...FIND_RULES_QUERY_KEY, queryArgs], async ({ signal }) => { const response = await fetchRules({ signal, ...queryArgs }); @@ -73,7 +74,7 @@ export const useInvalidateFindRulesQuery = () => { * Invalidate all queries that start with FIND_RULES_QUERY_KEY. This * includes the in-memory query cache and paged query cache. */ - queryClient.invalidateQueries([FIND_RULES_QUERY_KEY], { + queryClient.invalidateQueries(FIND_RULES_QUERY_KEY, { refetchType: 'active', }); }, [queryClient]); @@ -98,7 +99,7 @@ export const useUpdateRulesCache = () => { return useCallback( (newRules: Rule[]) => { queryClient.setQueriesData['data']>( - [FIND_RULES_QUERY_KEY], + FIND_RULES_QUERY_KEY, (currentData) => currentData ? { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts index 6f15fb4fdd8c..d0b60ccb9b89 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts @@ -15,6 +15,9 @@ import { updateRule } from '../api'; import { useInvalidateFindRulesQuery } from './use_find_rules_query'; import { useInvalidateFetchTagsQuery } from './use_fetch_tags_query'; import { useInvalidateFetchRuleByIdQuery } from './use_fetch_rule_by_id_query'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; + +export const UPDATE_RULE_MUTATION_KEY = ['PUT', DETECTION_ENGINE_RULES_URL]; export const useUpdateRuleMutation = ( options?: UseMutationOptions @@ -27,6 +30,7 @@ export const useUpdateRuleMutation = ( (rule: RuleUpdateProps) => updateRule({ rule: transformOutput(rule) }), { ...options, + mutationKey: UPDATE_RULE_MUTATION_KEY, onSuccess: (...args) => { invalidateFindRulesQuery(); invalidateFetchRuleByIdQuery(); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour.tsx new file mode 100644 index 000000000000..1fcb56a009ed --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/rules_management_tour.tsx @@ -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 type { EuiTourActions, EuiTourStepProps } from '@elastic/eui'; +import { EuiTourStep } from '@elastic/eui'; +import { noop } from 'lodash'; +import React, { useEffect, useMemo } from 'react'; +import useObservable from 'react-use/lib/useObservable'; +import { of } from 'rxjs'; +import { useKibana } from '../../../../common/lib/kibana'; +import { useFindRulesQuery } from '../../../rule_management/api/hooks/use_find_rules_query'; +import * as i18n from './translations'; +import { useIsElementMounted } from './use_is_element_mounted'; + +export const INSTALL_PREBUILT_RULES_ANCHOR = 'install-prebuilt-rules-anchor'; +export const SEARCH_FIRST_RULE_ANCHOR = 'search-first-rule-anchor'; + +export interface RulesFeatureTourContextType { + steps: EuiTourStepProps[]; + actions: EuiTourActions; +} + +const GUIDED_ONBOARDING_RULES_FILTER = { + filter: '', + showCustomRules: false, + showElasticRules: true, + tags: ['Guided Onboarding'], +}; + +export enum GuidedOnboardingRulesStatus { + 'inactive' = 'inactive', + 'installRules' = 'installRules', + 'activateRules' = 'activateRules', + 'completed' = 'completed', +} + +export const RulesManagementTour = () => { + const { guidedOnboardingApi } = useKibana().services.guidedOnboarding; + + const isRulesStepActive = useObservable( + guidedOnboardingApi?.isGuideStepActive$('security', 'rules') ?? of(false), + false + ); + + const { data: onboardingRules } = useFindRulesQuery( + { filterOptions: GUIDED_ONBOARDING_RULES_FILTER }, + { enabled: isRulesStepActive } + ); + + const tourStatus = useMemo(() => { + if (!isRulesStepActive || !onboardingRules) { + return GuidedOnboardingRulesStatus.inactive; + } + + if (onboardingRules.total === 0) { + // Onboarding rules are not installed - show the install/update rules step + return GuidedOnboardingRulesStatus.installRules; + } + + if (!onboardingRules.rules.some((rule) => rule.enabled)) { + // None of the onboarding rules is active - show the activate step + return GuidedOnboardingRulesStatus.activateRules; + } + + // Rules are installed and enabled - the tour is completed + return GuidedOnboardingRulesStatus.completed; + }, [isRulesStepActive, onboardingRules]); + + // Synchronize the current "internal" tour step with the global one + useEffect(() => { + if (isRulesStepActive && tourStatus === GuidedOnboardingRulesStatus.completed) { + guidedOnboardingApi?.completeGuideStep('security', 'rules'); + } + }, [guidedOnboardingApi, isRulesStepActive, tourStatus]); + + /** + * Wait until the tour target elements are visible on the page and mount + * EuiTourStep components only after that. Otherwise, the tours would never + * show up on the page. + */ + const isInstallRulesAnchorMounted = useIsElementMounted(INSTALL_PREBUILT_RULES_ANCHOR); + const isSearchFirstRuleAnchorMounted = useIsElementMounted(SEARCH_FIRST_RULE_ANCHOR); + + return ( + <> + {isInstallRulesAnchorMounted && ( + } // Replace "Skip tour" with an empty element + /> + )} + {isSearchFirstRuleAnchorMounted && ( + } // Replace "Skip tour" with an empty element + /> + )} + + ); +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/translations.ts new file mode 100644 index 000000000000..6c8a2880801a --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/translations.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const INSTALL_PREBUILT_RULES_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.installPrebuiltRules.title', + { + defaultMessage: 'Load the Elastic prebuilt rules', + } +); + +export const INSTALL_PREBUILT_RULES_CONTENT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.installPrebuiltRules.content', + { + defaultMessage: 'To get started you need to load the Elastic prebuilt rules.', + } +); + +export const SEARCH_FIRST_RULE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.searchFirstRule.title', + { + defaultMessage: 'Search for Elastic Defend rules', + } +); + +export const SEARCH_FIRST_RULE_CONTENT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.guidedOnboarding.searchFirstRule.content', + { + defaultMessage: 'Find the My First Alert rule and enable it.', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/use_is_element_mounted.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/use_is_element_mounted.ts new file mode 100644 index 000000000000..b3be0184e1a3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/guided_onboarding/use_is_element_mounted.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEffect, useState } from 'react'; + +export const useIsElementMounted = (elementId: string) => { + const [isElementMounted, setIsElementMounted] = useState(false); + + useEffect(() => { + const observer = new MutationObserver(() => { + const isElementFound = !!document.getElementById(elementId); + + if (isElementFound && !isElementMounted) { + setIsElementMounted(true); + } + + if (!isElementFound && isElementMounted) { + setIsElementMounted(false); + } + }); + + observer.observe(document.body, { + childList: true, + subtree: true, + }); + + return () => observer.disconnect(); + }, [isElementMounted, elementId]); + + return isElementMounted; +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx index 784d3dfc6242..143ae37a694d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx @@ -22,6 +22,7 @@ import * as i18n from '../../../../../detections/pages/detection_engine/rules/tr import { useRulesTableContext } from '../rules_table/rules_table_context'; import { TagsFilterPopover } from './tags_filter_popover'; import { useTags } from '../../../../rule_management/logic/use_tags'; +import { SEARCH_FIRST_RULE_ANCHOR } from '../../guided_onboarding/rules_management_tour'; const FilterWrapper = styled(EuiFlexGroup)` margin-bottom: ${({ theme }) => theme.eui.euiSizeXS}; @@ -85,6 +86,7 @@ const RulesTableFiltersComponent = () => { { const [isImportModalVisible, showImportModal, hideImportModal] = useBoolState(); @@ -85,6 +86,7 @@ const RulesPageComponent: React.FC = () => { + - {getLoadRulesOrTimelinesButtonTitle(prePackagedAssetsStatus, prePackagedTimelineStatus)} - +
+ + {getLoadRulesOrTimelinesButtonTitle(prePackagedAssetsStatus, prePackagedTimelineStatus)} + +
); } @@ -81,20 +88,26 @@ export const LoadPrePackagedRulesButton = ({ prePackagedTimelineStatus === 'someTimelineUninstall'; if (showUpdateButton) { + // Without the outer div EuiStepTour crashes with Uncaught DOMException: + // Failed to execute 'removeChild' on 'Node': The node to be removed is not + // a child of this node. return ( - - {getMissingRulesOrTimelinesButtonTitle( - prePackagedRulesStatus?.rules_not_installed ?? 0, - prePackagedRulesStatus?.timelines_not_installed ?? 0 - )} - +
+ + {getMissingRulesOrTimelinesButtonTitle( + prePackagedRulesStatus?.rules_not_installed ?? 0, + prePackagedRulesStatus?.timelines_not_installed ?? 0 + )} + +
); } From 7f8e78f84429839186f3ab6170bd247ce6209d3a Mon Sep 17 00:00:00 2001 From: Pablo Machado Date: Mon, 31 Oct 2022 12:56:07 +0100 Subject: [PATCH 03/87] Update time range when opening timeline from Entity Analytics page (#144024) * Update timerange when opening timeline from Entity Analytics page * Add useCallback to useNavigateToTimeline functions * Refactor 'useNavigateToTimeline' to only export one function --- .../security_solution/risk_score/all/index.ts | 2 + .../e2e/dashboards/entity_analytics.cy.ts | 73 ++++++++++++- .../e2e/dashboards/upgrade_risk_score.cy.ts | 10 +- .../cypress/screens/entity_analytics.ts | 8 +- .../cypress/tasks/risk_scores/index.ts | 10 ++ .../hooks/use_navigate_to_timeline.tsx | 102 +++++++----------- .../host_alerts_table/host_alerts_table.tsx | 19 +++- .../rule_alerts_table/rule_alerts_table.tsx | 9 +- .../user_alerts_table/user_alerts_table.tsx | 18 +++- .../entity_analytics/risk_score/columns.tsx | 9 +- .../entity_analytics/risk_score/index.tsx | 27 +++-- .../properties/use_create_timeline.tsx | 41 ++++--- .../factory/risk_score/all/index.test.ts | 38 ++++++- .../factory/risk_score/all/index.ts | 26 +++-- .../es_archives/risk_users/data.json | 2 +- 15 files changed, 286 insertions(+), 108 deletions(-) diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts index 2c1743e262ea..b35a6aa15499 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts @@ -51,6 +51,7 @@ export interface HostRiskScore { risk: RiskStats; }; alertsCount?: number; + oldestAlertTimestamp?: string; } export interface UserRiskScore { @@ -60,6 +61,7 @@ export interface UserRiskScore { risk: RiskStats; }; alertsCount?: number; + oldestAlertTimestamp?: string; } export interface RuleRisk { diff --git a/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts index 93b3a4594f16..b5c2b07dc72b 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/dashboards/entity_analytics.cy.ts @@ -7,10 +7,10 @@ import { login, visit } from '../../tasks/login'; -import { ENTITY_ANALYTICS_URL } from '../../urls/navigation'; +import { ALERTS_URL, ENTITY_ANALYTICS_URL } from '../../urls/navigation'; import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; -import { cleanKibana } from '../../tasks/common'; +import { cleanKibana, deleteAlertsAndRules } from '../../tasks/common'; import { ANOMALIES_TABLE, ANOMALIES_TABLE_ROWS, @@ -26,8 +26,19 @@ import { USERS_TABLE, USERS_TABLE_ROWS, USER_RISK_SCORE_NO_DATA_DETECTED, + USERS_TABLE_ALERT_CELL, + HOSTS_TABLE_ALERT_CELL, } from '../../screens/entity_analytics'; import { openRiskTableFilterAndSelectTheLowOption } from '../../tasks/host_risk'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; +import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; +import { getNewRule } from '../../objects/rule'; +import { QUERY_TAB_BUTTON } from '../../screens/timeline'; +import { closeTimeline } from '../../tasks/timeline'; +import { clickOnFirstHostsAlerts, clickOnFirstUsersAlerts } from '../../tasks/risk_scores'; + +const TEST_USER_ALERTS = 2; +const SIEM_KIBANA_HOST_ALERTS = 2; describe('Entity Analytics Dashboard', () => { before(() => { @@ -62,11 +73,11 @@ describe('Entity Analytics Dashboard', () => { esArchiverUnload('risk_users_no_data'); }); - it('shows no data detected propmpt for host risk score module', () => { + it('shows no data detected prompt for host risk score module', () => { cy.get(HOST_RISK_SCORE_NO_DATA_DETECTED).should('be.visible'); }); - it('shows no data detected propmpt for user risk score module', () => { + it('shows no data detected prompt for user risk score module', () => { cy.get(USER_RISK_SCORE_NO_DATA_DETECTED).should('be.visible'); }); }); @@ -112,12 +123,39 @@ describe('Entity Analytics Dashboard', () => { cy.get(HOSTS_TABLE_ROWS).should('have.length', 5); }); + it('renders alerts column', () => { + cy.get(HOSTS_TABLE_ALERT_CELL).should('have.length', 5); + }); + it('filters by risk classification', () => { openRiskTableFilterAndSelectTheLowOption(); cy.get(HOSTS_DONUT_CHART).should('include.text', '1Total'); cy.get(HOSTS_TABLE_ROWS).should('have.length', 1); }); + + describe('With alerts data', () => { + before(() => { + createCustomRuleEnabled(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + visit(ENTITY_ANALYTICS_URL); + }); + + after(() => { + deleteAlertsAndRules(); + }); + + it('populates alerts column', () => { + cy.get(HOSTS_TABLE_ALERT_CELL).first().should('include.text', SIEM_KIBANA_HOST_ALERTS); + }); + + it('opens timeline when alerts count is clicked', () => { + clickOnFirstHostsAlerts(); + cy.get(QUERY_TAB_BUTTON).should('contain.text', SIEM_KIBANA_HOST_ALERTS); + closeTimeline(); + }); + }); }); describe('With user risk data', () => { @@ -139,12 +177,39 @@ describe('Entity Analytics Dashboard', () => { cy.get(USERS_TABLE_ROWS).should('have.length', 5); }); + it('renders alerts column', () => { + cy.get(USERS_TABLE_ALERT_CELL).should('have.length', 5); + }); + it('filters by risk classification', () => { openRiskTableFilterAndSelectTheLowOption(); cy.get(USERS_DONUT_CHART).should('include.text', '2Total'); cy.get(USERS_TABLE_ROWS).should('have.length', 2); }); + + describe('With alerts data', () => { + before(() => { + createCustomRuleEnabled(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + visit(ENTITY_ANALYTICS_URL); + }); + + after(() => { + deleteAlertsAndRules(); + }); + + it('populates alerts column', () => { + cy.get(USERS_TABLE_ALERT_CELL).first().should('include.text', TEST_USER_ALERTS); + }); + + it('opens timeline when alerts count is clicked', () => { + clickOnFirstUsersAlerts(); + cy.get(QUERY_TAB_BUTTON).should('contain.text', TEST_USER_ALERTS); + closeTimeline(); + }); + }); }); describe('With anomalies data', () => { diff --git a/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts index 5fcaca256656..bcbc85849c16 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts @@ -11,7 +11,7 @@ import { UPGRADE_HOST_RISK_SCORE_BUTTON, UPGRADE_USER_RISK_SCORE_BUTTON, UPGRADE_CANCELLATION_BUTTON, - UPGRADE_CONFIRMARION_MODAL, + UPGRADE_CONFIRMATION_MODAL, RISK_SCORE_DASHBOARDS_INSTALLATION_SUCCESS_TOAST, } from '../../screens/entity_analytics'; import { deleteRiskScore, installLegacyRiskScoreModule } from '../../tasks/api_calls/risk_scores'; @@ -61,14 +61,14 @@ describe('Upgrade risk scores', () => { it('should show a confirmation modal for upgrading host risk score', () => { clickUpgradeRiskScore(RiskScoreEntity.host); - cy.get(UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.host)).should('exist'); + cy.get(UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.host)).should('exist'); }); it('display a link to host risk score Elastic doc', () => { clickUpgradeRiskScore(RiskScoreEntity.host); cy.get(UPGRADE_CANCELLATION_BUTTON) - .get(`${UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.host)} a`) + .get(`${UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.host)} a`) .then((link) => { expect(link.prop('href')).to.eql( `https://www.elastic.co/guide/en/security/current/${RiskScoreEntity.host}-risk-score.html` @@ -116,14 +116,14 @@ describe('Upgrade risk scores', () => { it('should show a confirmation modal for upgrading user risk score', () => { clickUpgradeRiskScore(RiskScoreEntity.user); - cy.get(UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.user)).should('exist'); + cy.get(UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.user)).should('exist'); }); it('display a link to user risk score Elastic doc', () => { clickUpgradeRiskScore(RiskScoreEntity.user); cy.get(UPGRADE_CANCELLATION_BUTTON) - .get(`${UPGRADE_CONFIRMARION_MODAL(RiskScoreEntity.user)} a`) + .get(`${UPGRADE_CONFIRMATION_MODAL(RiskScoreEntity.user)} a`) .then((link) => { expect(link.prop('href')).to.eql( `https://www.elastic.co/guide/en/security/current/${RiskScoreEntity.user}-risk-score.html` diff --git a/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts b/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts index 4d60556173fd..6095151fee57 100644 --- a/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts +++ b/x-pack/plugins/security_solution/cypress/screens/entity_analytics.ts @@ -47,9 +47,15 @@ export const ANOMALIES_TABLE = export const ANOMALIES_TABLE_ROWS = '[data-test-subj="entity_analytics_anomalies"] .euiTableRow'; -export const UPGRADE_CONFIRMARION_MODAL = (riskScoreEntity: RiskScoreEntity) => +export const UPGRADE_CONFIRMATION_MODAL = (riskScoreEntity: RiskScoreEntity) => `[data-test-subj="${riskScoreEntity}-risk-score-upgrade-confirmation-modal"]`; export const UPGRADE_CONFIRMATION_BUTTON = '[data-test-subj="confirmModalConfirmButton"]'; export const UPGRADE_CANCELLATION_BUTTON = '[data-test-subj="confirmModalCancelButton"]'; + +export const USERS_TABLE_ALERT_CELL = + '[data-test-subj="entity_analytics_users"] [data-test-subj="risk-score-alerts"]'; + +export const HOSTS_TABLE_ALERT_CELL = + '[data-test-subj="entity_analytics_hosts"] [data-test-subj="risk-score-alerts"]'; diff --git a/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts b/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts index ab80122de1dd..4b81e4d72899 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts @@ -8,9 +8,11 @@ import { ENABLE_HOST_RISK_SCORE_BUTTON, ENABLE_USER_RISK_SCORE_BUTTON, + HOSTS_TABLE_ALERT_CELL, UPGRADE_CONFIRMATION_BUTTON, UPGRADE_HOST_RISK_SCORE_BUTTON, UPGRADE_USER_RISK_SCORE_BUTTON, + USERS_TABLE_ALERT_CELL, } from '../../screens/entity_analytics'; import { INGEST_PIPELINES_URL, @@ -73,3 +75,11 @@ export const clickUpgradeRiskScore = (riskScoreEntity: RiskScoreEntity) => { export const clickUpgradeRiskScoreConfirmed = () => { cy.get(UPGRADE_CONFIRMATION_BUTTON).click(); }; + +export const clickOnFirstUsersAlerts = () => { + cy.get(USERS_TABLE_ALERT_CELL).first().click(); +}; + +export const clickOnFirstHostsAlerts = () => { + cy.get(HOSTS_TABLE_ALERT_CELL).first().click(); +}; diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx index d3fcb33ef9ef..705375d48ec3 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useMemo } from 'react'; +import { useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; @@ -17,6 +17,7 @@ import { TimelineId, TimelineType } from '../../../../../common/types/timeline'; import { useCreateTimeline } from '../../../../timelines/components/timeline/properties/use_create_timeline'; import { updateProviders } from '../../../../timelines/store/timeline/actions'; import { sourcererSelectors } from '../../../../common/store'; +import type { TimeRange } from '../../../../common/store/inputs/model'; export interface Filter { field: string; @@ -39,25 +40,28 @@ export const useNavigateToTimeline = () => { timelineType: TimelineType.default, }); - const navigateToTimeline = (dataProviders: DataProvider[]) => { - // Reset the current timeline - clearTimeline(); - // Update the timeline's providers to match the current prevalence field query - dispatch( - updateProviders({ - id: TimelineId.active, - providers: dataProviders, - }) - ); - - dispatch( - sourcererActions.setSelectedDataView({ - id: SourcererScopeName.timeline, - selectedDataViewId: defaultDataView.id, - selectedPatterns: [signalIndexName || ''], - }) - ); - }; + const navigateToTimeline = useCallback( + (dataProviders: DataProvider[], timeRange?: TimeRange) => { + // Reset the current timeline + clearTimeline({ timeRange }); + // Update the timeline's providers to match the current prevalence field query + dispatch( + updateProviders({ + id: TimelineId.active, + providers: dataProviders, + }) + ); + + dispatch( + sourcererActions.setSelectedDataView({ + id: SourcererScopeName.timeline, + selectedDataViewId: defaultDataView.id, + selectedPatterns: [signalIndexName || ''], + }) + ); + }, + [clearTimeline, defaultDataView.id, dispatch, signalIndexName] + ); /** * * Open a timeline with the given filters prepopulated. @@ -65,56 +69,30 @@ export const useNavigateToTimeline = () => { * * [[filter1 & filter2] OR [filter3 & filter4]] * + * @param timeRange Defines the timeline time range field and removes the time range lock */ - const openTimelineWithFilters = (filters: Array<[...Filter[]]>) => { - const dataProviders = []; + const openTimelineWithFilters = useCallback( + (filters: Array<[...Filter[]]>, timeRange?: TimeRange) => { + const dataProviders = []; - for (const orFilterGroup of filters) { - const mainFilter = orFilterGroup[0]; + for (const orFilterGroup of filters) { + const mainFilter = orFilterGroup[0]; - if (mainFilter) { - const dataProvider = getDataProvider(mainFilter.field, '', mainFilter.value); + if (mainFilter) { + const dataProvider = getDataProvider(mainFilter.field, '', mainFilter.value); - for (const filter of orFilterGroup.slice(1)) { - dataProvider.and.push(getDataProvider(filter.field, '', filter.value)); + for (const filter of orFilterGroup.slice(1)) { + dataProvider.and.push(getDataProvider(filter.field, '', filter.value)); + } + dataProviders.push(dataProvider); } - dataProviders.push(dataProvider); } - } - navigateToTimeline(dataProviders); - }; - - // TODO: Replace the usage of functions with openTimelineWithFilters - - const openHostInTimeline = ({ hostName, severity }: { hostName: string; severity?: string }) => { - const dataProvider = getDataProvider('host.name', '', hostName); - - if (severity) { - dataProvider.and.push(getDataProvider('kibana.alert.severity', '', severity)); - } - - navigateToTimeline([dataProvider]); - }; - - const openUserInTimeline = ({ userName, severity }: { userName: string; severity?: string }) => { - const dataProvider = getDataProvider('user.name', '', userName); - - if (severity) { - dataProvider.and.push(getDataProvider('kibana.alert.severity', '', severity)); - } - navigateToTimeline([dataProvider]); - }; - - const openRuleInTimeline = (ruleName: string) => { - const dataProvider = getDataProvider('kibana.alert.rule.name', '', ruleName); - - navigateToTimeline([dataProvider]); - }; + navigateToTimeline(dataProviders, timeRange); + }, + [navigateToTimeline] + ); return { openTimelineWithFilters, - openHostInTimeline, - openRuleInTimeline, - openUserInTimeline, }; }; diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx index b5ec1de73fa3..555a2d7be5b4 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import type { EuiBasicTableColumn } from '@elastic/eui'; import { @@ -43,7 +43,22 @@ type GetTableColumns = ( const DETECTION_RESPONSE_HOST_SEVERITY_QUERY_ID = 'vulnerableHostsBySeverityQuery'; export const HostAlertsTable = React.memo(({ signalIndexName }: HostAlertsTableProps) => { - const { openHostInTimeline } = useNavigateToTimeline(); + const { openTimelineWithFilters } = useNavigateToTimeline(); + + const openHostInTimeline = useCallback( + ({ hostName, severity }: { hostName: string; severity?: string }) => { + const hostNameFilter = { field: 'host.name', value: hostName }; + const severityFilter = severity + ? { field: 'kibana.alert.severity', value: severity } + : undefined; + + openTimelineWithFilters( + severityFilter ? [[hostNameFilter, severityFilter]] : [[hostNameFilter]] + ); + }, + [openTimelineWithFilters] + ); + const { toggleStatus, setToggleStatus } = useQueryToggle( DETECTION_RESPONSE_HOST_SEVERITY_QUERY_ID ); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx index 59a92896ddb8..e9ec906070f7 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx @@ -114,7 +114,14 @@ export const RuleAlertsTable = React.memo(({ signalIndexNa skip: !toggleStatus, }); - const { openRuleInTimeline } = useNavigateToTimeline(); + const { openTimelineWithFilters } = useNavigateToTimeline(); + + const openRuleInTimeline = useCallback( + (ruleName: string) => { + openTimelineWithFilters([[{ field: 'kibana.alert.rule.name', value: ruleName }]]); + }, + [openTimelineWithFilters] + ); const navigateToAlerts = useCallback(() => { navigateTo({ deepLinkId: SecurityPageName.alerts }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx index c50f5976360e..c1a7ad079122 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import type { EuiBasicTableColumn } from '@elastic/eui'; import { @@ -43,7 +43,21 @@ type GetTableColumns = ( const DETECTION_RESPONSE_USER_SEVERITY_QUERY_ID = 'vulnerableUsersBySeverityQuery'; export const UserAlertsTable = React.memo(({ signalIndexName }: UserAlertsTableProps) => { - const { openUserInTimeline } = useNavigateToTimeline(); + const { openTimelineWithFilters } = useNavigateToTimeline(); + + const openUserInTimeline = useCallback( + ({ userName, severity }: { userName: string; severity?: string }) => { + const userNameFilter = { field: 'user.name', value: userName }; + const severityFilter = severity + ? { field: 'kibana.alert.severity', value: severity } + : undefined; + + openTimelineWithFilters( + severityFilter ? [[userNameFilter, severityFilter]] : [[userNameFilter]] + ); + }, + [openTimelineWithFilters] + ); const { toggleStatus, setToggleStatus } = useQueryToggle( DETECTION_RESPONSE_USER_SEVERITY_QUERY_ID ); diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx index a19168b5e864..e9fd68dabd4d 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/columns.tsx @@ -27,7 +27,7 @@ type HostRiskScoreColumns = Array void + openEntityInTimeline: (entityName: string, oldestAlertTimestamp?: string) => void ): HostRiskScoreColumns => [ { field: riskEntity === RiskScoreEntity.host ? 'host.name' : 'user.name', @@ -94,7 +94,12 @@ export const getRiskScoreColumns = ( openEntityInTimeline(get('host.name', risk) ?? get('user.name', risk))} + onClick={() => + openEntityInTimeline( + get('host.name', risk) ?? get('user.name', risk), + risk.oldestAlertTimestamp + ) + } > diff --git a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx index 13899e88f38f..40306e24fb42 100644 --- a/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/entity_analytics/risk_score/index.tsx @@ -41,6 +41,7 @@ import { Panel } from '../../../../common/components/panel'; import * as commonI18n from '../common/translations'; import { usersActions } from '../../../../users/store'; import { useNavigateToTimeline } from '../../detection_response/hooks/use_navigate_to_timeline'; +import type { TimeRange } from '../../../../common/store/inputs/model'; const HOST_RISK_TABLE_QUERY_ID = 'hostRiskDashboardTable'; const HOST_RISK_KPI_QUERY_ID = 'headerHostRiskScoreKpiQuery'; @@ -91,17 +92,27 @@ const EntityAnalyticsRiskScoresComponent = ({ riskEntity }: { riskEntity: RiskSc [dispatch, riskEntity] ); - const { openHostInTimeline, openUserInTimeline } = useNavigateToTimeline(); + const { openTimelineWithFilters } = useNavigateToTimeline(); const openEntityInTimeline = useCallback( - (entityName: string) => { - if (riskEntity === RiskScoreEntity.host) { - openHostInTimeline({ hostName: entityName }); - } else if (riskEntity === RiskScoreEntity.user) { - openUserInTimeline({ userName: entityName }); - } + (entityName: string, oldestAlertTimestamp?: string) => { + const timeRange: TimeRange | undefined = oldestAlertTimestamp + ? { + kind: 'relative', + from: oldestAlertTimestamp ?? '', + fromStr: oldestAlertTimestamp ?? '', + to: new Date().toISOString(), + toStr: 'now', + } + : undefined; + + const filter = { + field: riskEntity === RiskScoreEntity.host ? 'host.name' : 'user.name', + value: entityName, + }; + openTimelineWithFilters([[filter]], timeRange); }, - [riskEntity, openHostInTimeline, openUserInTimeline] + [riskEntity, openTimelineWithFilters] ); const { toggleStatus, setToggleStatus } = useQueryToggle(entity.tableQueryId); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx index 7c83007858ae..f3d5b61e9129 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_create_timeline.tsx @@ -20,11 +20,13 @@ import { inputsActions, inputsSelectors } from '../../../../common/store/inputs' import { sourcererActions, sourcererSelectors } from '../../../../common/store/sourcerer'; import { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { appActions } from '../../../../common/store/app'; +import type { TimeRange } from '../../../../common/store/inputs/model'; interface Props { timelineId?: string; timelineType: TimelineTypeLiteral; closeGearMenu?: () => void; + timeRange?: TimeRange; } export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: Props) => { @@ -35,8 +37,11 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P const { timelineFullScreen, setTimelineFullScreen } = useTimelineFullScreen(); const globalTimeRange = useDeepEqualSelector(inputsSelectors.globalTimeRangeSelector); + const createTimeline = useCallback( - ({ id, show }) => { + ({ id, show, timeRange: timeRangeParam }) => { + const timerange = timeRangeParam ?? globalTimeRange; + if (id === TimelineId.active && timelineFullScreen) { setTimelineFullScreen(false); } @@ -66,17 +71,22 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P ); dispatch(inputsActions.addLinkTo([InputsModelId.global, InputsModelId.timeline])); dispatch(appActions.addNotes({ notes: [] })); - if (globalTimeRange.kind === 'absolute') { + + if (timeRangeParam) { + dispatch(inputsActions.removeLinkTo([InputsModelId.timeline, InputsModelId.global])); + } + + if (timerange.kind === 'absolute') { dispatch( inputsActions.setAbsoluteRangeDatePicker({ - ...globalTimeRange, + ...timerange, id: InputsModelId.timeline, }) ); - } else if (globalTimeRange.kind === 'relative') { + } else if (timerange.kind === 'relative') { dispatch( inputsActions.setRelativeRangeDatePicker({ - ...globalTimeRange, + ...timerange, id: InputsModelId.timeline, }) ); @@ -93,16 +103,23 @@ export const useCreateTimeline = ({ timelineId, timelineType, closeGearMenu }: P ] ); - const handleCreateNewTimeline = useCallback(() => { - createTimeline({ id: timelineId, show: true, timelineType }); - if (typeof closeGearMenu === 'function') { - closeGearMenu(); - } - }, [createTimeline, timelineId, timelineType, closeGearMenu]); + const handleCreateNewTimeline = useCallback( + (options?: CreateNewTimelineOptions) => { + createTimeline({ id: timelineId, show: true, timelineType, timeRange: options?.timeRange }); + if (typeof closeGearMenu === 'function') { + closeGearMenu(); + } + }, + [createTimeline, timelineId, timelineType, closeGearMenu] + ); return handleCreateNewTimeline; }; +interface CreateNewTimelineOptions { + timeRange?: TimeRange; +} + export const useCreateTimelineButton = ({ timelineId, timelineType, closeGearMenu }: Props) => { const handleCreateNewTimeline = useCreateTimeline({ timelineId, @@ -126,7 +143,7 @@ export const useCreateTimelineButton = ({ timelineId, timelineType, closeGearMen }) => { const buttonProps = { iconType, - onClick: handleCreateNewTimeline, + onClick: () => handleCreateNewTimeline(), fill, }; const dataTestSubjPrefix = diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts index 58b2a55bc159..b114b283d624 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts @@ -42,7 +42,7 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _source: { '@timestamp': '1234567899', host: { - name: 'testUsermame', + name: 'testUsername', risk: { rule_risks: [], calculated_level: RiskSeverity.high, @@ -121,8 +121,11 @@ describe('buildRiskScoreQuery search strategy', () => { alertsByEntity: { buckets: [ { - key: 'testUsermame', + key: 'testUsername', doc_count: alertsCunt, + oldestAlertTimestamp: { + value_as_string: '12345566', + }, }, ], }, @@ -133,4 +136,35 @@ describe('buildRiskScoreQuery search strategy', () => { expect(get('data[0].alertsCount', result)).toBe(alertsCunt); }); + + test('should enhance data with alerts oldest timestamp', async () => { + const oldestAlertTimestamp = 'oldestTimestamp_test'; + searchMock.mockReturnValue({ + aggregations: { + oldestAlertTimestamp: { + value_as_string: oldestAlertTimestamp, + }, + }, + }); + + searchMock.mockReturnValue({ + aggregations: { + alertsByEntity: { + buckets: [ + { + key: 'testUsername', + doc_count: 1, + oldestAlertTimestamp: { + value_as_string: oldestAlertTimestamp, + }, + }, + ], + }, + }, + }); + + const result = await riskScore.parse(mockOptions, mockSearchStrategyResponse, mockDeps); + + expect(get('data[0].oldestAlertTimestamp', result)).toBe(oldestAlertTimestamp); + }); }); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts index 5e46ac2b4f44..96bcb5c426d1 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts @@ -9,6 +9,7 @@ import type { IEsSearchResponse, SearchRequest } from '@kbn/data-plugin/common'; import { get, getOr } from 'lodash/fp'; import type { IRuleDataClient } from '@kbn/rule-registry-plugin/server'; +import type { AggregationsMinAggregate } from '@elastic/elasticsearch/lib/api/types'; import type { SecuritySolutionFactory } from '../../types'; import type { RiskScoreRequestOptions, @@ -65,6 +66,10 @@ export const riskScore: SecuritySolutionFactory< }, }; +export type EnhancedDataBucket = { + oldestAlertTimestamp: AggregationsMinAggregate; +} & BucketItem; + async function enhanceData( data: Array, names: string[], @@ -74,21 +79,25 @@ async function enhanceData( ): Promise> { const ruleDataReader = ruleDataClient?.getReader({ namespace: spaceId }); const query = getAlertsQueryForEntity(names, nameField); - const response = await ruleDataReader?.search(query); - const buckets: BucketItem[] = getOr([], 'aggregations.alertsByEntity.buckets', response); + const buckets: EnhancedDataBucket[] = getOr([], 'aggregations.alertsByEntity.buckets', response); - const alertsCountByEntityName: Record = buckets.reduce( - (acc, { key, doc_count: count }) => ({ + const enhancedAlertsDataByEntityName: Record< + string, + { count: number; oldestAlertTimestamp: string } + > = buckets.reduce( + (acc, { key, doc_count: count, oldestAlertTimestamp }) => ({ ...acc, - [key]: count, + [key]: { count, oldestAlertTimestamp: oldestAlertTimestamp.value_as_string }, }), {} ); return data.map((risk) => ({ ...risk, - alertsCount: alertsCountByEntityName[get(nameField, risk)] ?? 0, + alertsCount: enhancedAlertsDataByEntityName[get(nameField, risk)]?.count ?? 0, + oldestAlertTimestamp: + enhancedAlertsDataByEntityName[get(nameField, risk)]?.oldestAlertTimestamp ?? 0, })); } @@ -107,6 +116,11 @@ const getAlertsQueryForEntity = (names: string[], nameField: string): SearchRequ terms: { field: nameField, }, + aggs: { + oldestAlertTimestamp: { + min: { field: '@timestamp' }, + }, + }, }, }, }); diff --git a/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json b/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json index dc182e631df9..b513f934aac6 100644 --- a/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json +++ b/x-pack/test/security_solution_cypress/es_archives/risk_users/data.json @@ -179,7 +179,7 @@ "id": "a4cf452c1e0375c3d4412cb550bd1783358468b3123314829d72c7df6fb74", "index": "ml_user_risk_score_latest_default", "source": { - "@timestamp": "2021-03-10T14:51:05.766Z", + "@timestamp": "2021-03-10T14:52:05.766Z", "user": { "name": "test", "risk": { From fdce0662f85a18643deaa5f3fa361e5c34f947bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20G=C3=B3mez?= Date: Mon, 31 Oct 2022 13:33:32 +0100 Subject: [PATCH 04/87] [Synthetics UI] Add pagination and date filtering to test runs table (#144029) Co-authored-by: Shahzad --- .../common/runtime_types/ping/ping.ts | 1 + .../hooks/use_monitor_pings.tsx | 61 ++++ .../monitor_summary/monitor_summary.tsx | 4 +- ..._ten_test_runs.tsx => test_runs_table.tsx} | 42 ++- .../state/monitor_details/actions.ts | 9 +- .../synthetics/state/monitor_details/api.ts | 21 +- .../synthetics/state/monitor_details/index.ts | 23 +- .../state/monitor_details/selectors.ts | 6 +- .../__mocks__/synthetics_store.mock.ts | 321 +++++++++--------- .../server/common/pings/query_pings.ts | 2 + .../server/routes/pings/get_pings.ts | 16 +- 11 files changed, 320 insertions(+), 186 deletions(-) create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx rename x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/{last_ten_test_runs.tsx => test_runs_table.tsx} (88%) diff --git a/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts b/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts index ebfe80c3a57e..dc8ab97c5f18 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts @@ -289,6 +289,7 @@ export const GetPingsParamsType = t.intersection([ excludedLocations: t.string, index: t.number, size: t.number, + pageIndex: t.number, locations: t.string, monitorId: t.string, sort: t.string, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx new file mode 100644 index 000000000000..f4095892b5ad --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEffect } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; + +import { useSelectedMonitor } from './use_selected_monitor'; +import { useSelectedLocation } from './use_selected_location'; +import { getMonitorRecentPingsAction, selectMonitorPingsMetadata } from '../../../state'; + +interface UseMonitorPingsProps { + pageSize?: number; + pageIndex?: number; + from?: string; + to?: string; +} + +export const useMonitorPings = (props?: UseMonitorPingsProps) => { + const dispatch = useDispatch(); + + const { monitor } = useSelectedMonitor(); + const location = useSelectedLocation(); + + const monitorId = monitor?.id; + const locationLabel = location?.label; + + useEffect(() => { + if (monitorId && locationLabel) { + dispatch( + getMonitorRecentPingsAction.get({ + monitorId, + locationId: locationLabel, + size: props?.pageSize, + pageIndex: props?.pageIndex, + from: props?.from, + to: props?.to, + }) + ); + } + }, [ + dispatch, + monitorId, + locationLabel, + props?.pageSize, + props?.pageIndex, + props?.from, + props?.to, + ]); + + const { total, data: pings, loading } = useSelector(selectMonitorPingsMetadata); + + return { + loading, + total, + pings, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx index 4cdaa6bd4957..1b19d3ca5fdf 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx @@ -26,7 +26,7 @@ import { DurationPanel } from './duration_panel'; import { MonitorDetailsPanel } from './monitor_details_panel'; import { AvailabilitySparklines } from './availability_sparklines'; import { LastTestRun } from './last_test_run'; -import { LastTenTestRuns } from './last_ten_test_runs'; +import { TestRunsTable } from './test_runs_table'; import { MonitorErrorsCount } from './monitor_errors_count'; export const MonitorSummary = () => { @@ -107,7 +107,7 @@ export const MonitorSummary = () => { - + ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_ten_test_runs.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx similarity index 88% rename from x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_ten_test_runs.tsx rename to x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx index eddf40739e55..00ef508ed0d2 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_ten_test_runs.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx @@ -31,27 +31,44 @@ import { import { useSyntheticsSettingsContext } from '../../../contexts/synthetics_settings_context'; import { sortPings } from '../../../utils/monitor_test_result/sort_pings'; -import { selectPingsLoading, selectMonitorRecentPings, selectPingsError } from '../../../state'; +import { selectPingsError } from '../../../state'; import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/status_badge'; import { isStepEnd } from '../../common/monitor_test_result/browser_steps_list'; import { JourneyStepScreenshotContainer } from '../../common/monitor_test_result/journey_step_screenshot_container'; import { useKibanaDateFormat } from '../../../../../hooks/use_kibana_date_format'; import { useSelectedMonitor } from '../hooks/use_selected_monitor'; +import { useMonitorPings } from '../hooks/use_monitor_pings'; import { useJourneySteps } from '../hooks/use_journey_steps'; type SortableField = 'timestamp' | 'monitor.status' | 'monitor.duration.us'; -export const LastTenTestRuns = () => { +interface TestRunsTableProps { + from: string; + to: string; + paginable?: boolean; +} + +export const TestRunsTable = ({ paginable = true, from, to }: TestRunsTableProps) => { const { basePath } = useSyntheticsSettingsContext(); + const [page, setPage] = useState({ index: 0, size: 10 }); const [sortField, setSortField] = useState('timestamp'); const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('desc'); - const pings = useSelector(selectMonitorRecentPings); + const { + pings, + total, + loading: pingsLoading, + } = useMonitorPings({ + from, + to, + pageSize: page.size, + pageIndex: page.index, + }); const sortedPings = useMemo(() => { return sortPings(pings, sortField, sortDirection); }, [pings, sortField, sortDirection]); - const pingsLoading = useSelector(selectPingsLoading); + const pingsError = useSelector(selectPingsError); const { monitor } = useSelectedMonitor(); @@ -64,7 +81,10 @@ export const LastTenTestRuns = () => { }, }; - const handleTableChange = ({ page, sort }: Criteria) => { + const handleTableChange = ({ page: newPage, sort }: Criteria) => { + if (newPage !== undefined) { + setPage(newPage); + } if (sort !== undefined) { setSortField(sort.field as SortableField); setSortDirection(sort.direction); @@ -125,7 +145,7 @@ export const LastTenTestRuns = () => { -

{pings?.length >= 10 ? LAST_10_TEST_RUNS : TEST_RUNS}

+

{paginable || pings?.length < 10 ? TEST_RUNS : LAST_10_TEST_RUNS}

@@ -162,6 +182,16 @@ export const LastTenTestRuns = () => { tableLayout={'auto'} sorting={sorting} onChange={handleTableChange} + pagination={ + paginable + ? { + pageIndex: page.index, + pageSize: page.size, + totalItemCount: total, + pageSizeOptions: [10, 20, 50], // TODO Confirm with Henry, + } + : undefined + } /> ); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts index a80196275a75..31c5bdd2cbc9 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts @@ -26,6 +26,13 @@ export const getMonitorAction = createAsyncAction< >('[MONITOR DETAILS] GET MONITOR'); export const getMonitorRecentPingsAction = createAsyncAction< - { monitorId: string; locationId: string }, + { + monitorId: string; + locationId: string; + size?: number; + pageIndex?: number; + from?: string; + to?: string; + }, PingsResponse >('[MONITOR DETAILS] GET RECENT PINGS'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts index 80713e587cef..5c70db4b8f0a 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts @@ -24,19 +24,32 @@ export interface QueryParams { export const fetchMonitorRecentPings = async ({ monitorId, locationId, + from, + to, + size = 10, + pageIndex = 0, }: { monitorId: string; locationId: string; + from?: string; + to?: string; + size?: number; + pageIndex?: number; }): Promise => { - const from = new Date(0).toISOString(); - const to = new Date().toISOString(); const locations = JSON.stringify([locationId]); const sort = 'desc'; - const size = 10; return await apiService.get( SYNTHETICS_API_URLS.PINGS, - { monitorId, from, to, locations, sort, size }, + { + monitorId, + from: from ?? new Date(0).toISOString(), + to: to ?? new Date().toISOString(), + locations, + sort, + size, + pageIndex, + }, PingsResponseType ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts index 1c9df0c866ad..d068c7a2a421 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts @@ -18,8 +18,11 @@ import { } from './actions'; export interface MonitorDetailsState { - pings: Ping[]; - loading: boolean; + pings: { + total: number; + data: Ping[]; + loading: boolean; + }; syntheticsMonitorLoading: boolean; syntheticsMonitor: EncryptedSyntheticsSavedMonitor | null; error: IHttpSerializedFetchError | null; @@ -27,8 +30,7 @@ export interface MonitorDetailsState { } const initialState: MonitorDetailsState = { - pings: [], - loading: false, + pings: { total: 0, data: [], loading: false }, syntheticsMonitor: null, syntheticsMonitorLoading: false, error: null, @@ -42,16 +44,19 @@ export const monitorDetailsReducer = createReducer(initialState, (builder) => { }) .addCase(getMonitorRecentPingsAction.get, (state, action) => { - state.loading = true; - state.pings = state.pings.filter((ping) => !checkIsStalePing(action.payload.monitorId, ping)); + state.pings.loading = true; + state.pings.data = state.pings.data.filter( + (ping) => !checkIsStalePing(action.payload.monitorId, ping) + ); }) .addCase(getMonitorRecentPingsAction.success, (state, action) => { - state.pings = action.payload.pings; - state.loading = false; + state.pings.total = action.payload.total; + state.pings.data = action.payload.pings; + state.pings.loading = false; }) .addCase(getMonitorRecentPingsAction.fail, (state, action) => { state.error = action.payload; - state.loading = false; + state.pings.loading = false; }) .addCase(getMonitorAction.get, (state) => { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts index 5c6ba75e8cd6..d54bcaba9512 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts @@ -17,10 +17,10 @@ export const selectSelectedLocationId = createSelector( (state) => state.selectedLocationId ); -export const selectLatestPing = createSelector(getState, (state) => state.pings?.[0] ?? null); +export const selectLatestPing = createSelector(getState, (state) => state.pings.data[0] ?? null); -export const selectPingsLoading = createSelector(getState, (state) => state.loading); +export const selectPingsLoading = createSelector(getState, (state) => state.pings.loading); -export const selectMonitorRecentPings = createSelector(getState, (state) => state.pings); +export const selectMonitorPingsMetadata = createSelector(getState, (state) => state.pings); export const selectPingsError = createSelector(getState, (state) => state.error); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts index 6031707c1fd1..5c23f46dfe89 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts @@ -132,171 +132,174 @@ function getBrowserJourneyMockSlice() { function getMonitorDetailsMockSlice() { return { - pings: [ - { - summary: { up: 1, down: 0 }, - agent: { - name: 'cron-b010e1cc9518984e-27644714-4pd4h', - id: 'f8721d90-5aec-4815-a6f1-f4d4a6fb7482', - type: 'heartbeat', - ephemeral_id: 'd6a60494-5e52-418f-922b-8e90f0b4013c', - version: '8.3.0', - }, - synthetics: { - journey: { name: 'inline', id: 'inline', tags: null }, - type: 'heartbeat/summary', - }, - monitor: { - duration: { us: 269722 }, - origin: SourceType.UI, - name: 'One pixel monitor', - check_group: '051aba1c-0b74-11ed-9f0e-ba4e6fa109d5', - id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - timespan: { lt: '2022-07-24T17:24:06.094Z', gte: '2022-07-24T17:14:06.094Z' }, - type: DataStream.BROWSER, - status: 'up', - }, - url: { - scheme: 'data', - domain: '', - full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', - }, - observer: { - geo: { - continent_name: 'North America', - city_name: 'Iowa', - country_iso_code: 'US', - name: 'North America - US Central', - location: '41.8780, 93.0977', + pings: { + total: 3, + data: [ + { + summary: { up: 1, down: 0 }, + agent: { + name: 'cron-b010e1cc9518984e-27644714-4pd4h', + id: 'f8721d90-5aec-4815-a6f1-f4d4a6fb7482', + type: 'heartbeat', + ephemeral_id: 'd6a60494-5e52-418f-922b-8e90f0b4013c', + version: '8.3.0', }, - hostname: 'cron-b010e1cc9518984e-27644714-4pd4h', - ip: ['10.1.11.162'], - mac: ['ba:4e:6f:a1:09:d5'], - }, - '@timestamp': '2022-07-24T17:14:05.079Z', - ecs: { version: '8.0.0' }, - config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, - 'event.type': 'journey/end', - event: { - agent_id_status: 'auth_metadata_missing', - ingested: '2022-07-24T17:14:07Z', - type: 'heartbeat/summary', - dataset: 'browser', - }, - timestamp: '2022-07-24T17:14:05.079Z', - docId: 'AkYzMYIBqL6WCtugsFck', - }, - { - summary: { up: 1, down: 0 }, - agent: { - name: 'cron-b010e1cc9518984e-27644704-zs98t', - id: 'a9620214-591d-48e7-9e5d-10b7a9fb1a03', - type: 'heartbeat', - ephemeral_id: 'c5110885-81b4-4e9a-8747-690d19fbd225', - version: '8.3.0', - }, - synthetics: { - journey: { name: 'inline', id: 'inline', tags: null }, - type: 'heartbeat/summary', - }, - monitor: { - duration: { us: 227326 }, - origin: SourceType.UI, - name: 'One pixel monitor', - id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - check_group: '9eb87e53-0b72-11ed-b34f-aa618b4334ae', - timespan: { lt: '2022-07-24T17:14:05.020Z', gte: '2022-07-24T17:04:05.020Z' }, - type: DataStream.BROWSER, - status: 'up', - }, - url: { - scheme: 'data', - domain: '', - full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', - }, - observer: { - geo: { - continent_name: 'North America', - city_name: 'Iowa', - country_iso_code: 'US', - name: 'North America - US Central', - location: '41.8780, 93.0977', + synthetics: { + journey: { name: 'inline', id: 'inline', tags: null }, + type: 'heartbeat/summary', }, - hostname: 'cron-b010e1cc9518984e-27644704-zs98t', - ip: ['10.1.9.133'], - mac: ['aa:61:8b:43:34:ae'], - }, - '@timestamp': '2022-07-24T17:04:03.769Z', - ecs: { version: '8.0.0' }, - config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, - 'event.type': 'journey/end', - event: { - agent_id_status: 'auth_metadata_missing', - ingested: '2022-07-24T17:04:06Z', - type: 'heartbeat/summary', - dataset: 'browser', - }, - timestamp: '2022-07-24T17:04:03.769Z', - docId: 'mkYqMYIBqL6WCtughFUq', - }, - { - summary: { up: 1, down: 0 }, - agent: { - name: 'job-b010e1cc9518984e-dkw5k', - id: 'e3a4e3a8-bdd1-44fe-86f5-e451b80f80c5', - type: 'heartbeat', - ephemeral_id: 'f41a13ab-a85d-4614-89c0-8dbad6a32868', - version: '8.3.0', - }, - synthetics: { - journey: { name: 'inline', id: 'inline', tags: null }, - type: 'heartbeat/summary', - }, - monitor: { - duration: { us: 207700 }, - origin: SourceType.UI, - name: 'One pixel monitor', - timespan: { lt: '2022-07-24T17:11:49.702Z', gte: '2022-07-24T17:01:49.702Z' }, - check_group: '4e00ac5a-0b72-11ed-a97e-5203642c687d', - id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - type: DataStream.BROWSER, - status: 'up', - }, - url: { - scheme: 'data', - domain: '', - full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + monitor: { + duration: { us: 269722 }, + origin: SourceType.UI, + name: 'One pixel monitor', + check_group: '051aba1c-0b74-11ed-9f0e-ba4e6fa109d5', + id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + timespan: { lt: '2022-07-24T17:24:06.094Z', gte: '2022-07-24T17:14:06.094Z' }, + type: DataStream.BROWSER, + status: 'up', + }, + url: { + scheme: 'data', + domain: '', + full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + }, + observer: { + geo: { + continent_name: 'North America', + city_name: 'Iowa', + country_iso_code: 'US', + name: 'North America - US Central', + location: '41.8780, 93.0977', + }, + hostname: 'cron-b010e1cc9518984e-27644714-4pd4h', + ip: ['10.1.11.162'], + mac: ['ba:4e:6f:a1:09:d5'], + }, + '@timestamp': '2022-07-24T17:14:05.079Z', + ecs: { version: '8.0.0' }, + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, + 'event.type': 'journey/end', + event: { + agent_id_status: 'auth_metadata_missing', + ingested: '2022-07-24T17:14:07Z', + type: 'heartbeat/summary', + dataset: 'browser', + }, + timestamp: '2022-07-24T17:14:05.079Z', + docId: 'AkYzMYIBqL6WCtugsFck', }, - observer: { - geo: { - continent_name: 'North America', - city_name: 'Iowa', - country_iso_code: 'US', - name: 'North America - US Central', - location: '41.8780, 93.0977', + { + summary: { up: 1, down: 0 }, + agent: { + name: 'cron-b010e1cc9518984e-27644704-zs98t', + id: 'a9620214-591d-48e7-9e5d-10b7a9fb1a03', + type: 'heartbeat', + ephemeral_id: 'c5110885-81b4-4e9a-8747-690d19fbd225', + version: '8.3.0', + }, + synthetics: { + journey: { name: 'inline', id: 'inline', tags: null }, + type: 'heartbeat/summary', + }, + monitor: { + duration: { us: 227326 }, + origin: SourceType.UI, + name: 'One pixel monitor', + id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + check_group: '9eb87e53-0b72-11ed-b34f-aa618b4334ae', + timespan: { lt: '2022-07-24T17:14:05.020Z', gte: '2022-07-24T17:04:05.020Z' }, + type: DataStream.BROWSER, + status: 'up', + }, + url: { + scheme: 'data', + domain: '', + full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + }, + observer: { + geo: { + continent_name: 'North America', + city_name: 'Iowa', + country_iso_code: 'US', + name: 'North America - US Central', + location: '41.8780, 93.0977', + }, + hostname: 'cron-b010e1cc9518984e-27644704-zs98t', + ip: ['10.1.9.133'], + mac: ['aa:61:8b:43:34:ae'], + }, + '@timestamp': '2022-07-24T17:04:03.769Z', + ecs: { version: '8.0.0' }, + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, + 'event.type': 'journey/end', + event: { + agent_id_status: 'auth_metadata_missing', + ingested: '2022-07-24T17:04:06Z', + type: 'heartbeat/summary', + dataset: 'browser', }, - hostname: 'job-b010e1cc9518984e-dkw5k', - ip: ['10.1.9.132'], - mac: ['52:03:64:2c:68:7d'], + timestamp: '2022-07-24T17:04:03.769Z', + docId: 'mkYqMYIBqL6WCtughFUq', }, - '@timestamp': '2022-07-24T17:01:48.326Z', - ecs: { version: '8.0.0' }, - config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', - data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, - 'event.type': 'journey/end', - event: { - agent_id_status: 'auth_metadata_missing', - ingested: '2022-07-24T17:01:50Z', - type: 'heartbeat/summary', - dataset: 'browser', + { + summary: { up: 1, down: 0 }, + agent: { + name: 'job-b010e1cc9518984e-dkw5k', + id: 'e3a4e3a8-bdd1-44fe-86f5-e451b80f80c5', + type: 'heartbeat', + ephemeral_id: 'f41a13ab-a85d-4614-89c0-8dbad6a32868', + version: '8.3.0', + }, + synthetics: { + journey: { name: 'inline', id: 'inline', tags: null }, + type: 'heartbeat/summary', + }, + monitor: { + duration: { us: 207700 }, + origin: SourceType.UI, + name: 'One pixel monitor', + timespan: { lt: '2022-07-24T17:11:49.702Z', gte: '2022-07-24T17:01:49.702Z' }, + check_group: '4e00ac5a-0b72-11ed-a97e-5203642c687d', + id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + type: DataStream.BROWSER, + status: 'up', + }, + url: { + scheme: 'data', + domain: '', + full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + }, + observer: { + geo: { + continent_name: 'North America', + city_name: 'Iowa', + country_iso_code: 'US', + name: 'North America - US Central', + location: '41.8780, 93.0977', + }, + hostname: 'job-b010e1cc9518984e-dkw5k', + ip: ['10.1.9.132'], + mac: ['52:03:64:2c:68:7d'], + }, + '@timestamp': '2022-07-24T17:01:48.326Z', + ecs: { version: '8.0.0' }, + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, + 'event.type': 'journey/end', + event: { + agent_id_status: 'auth_metadata_missing', + ingested: '2022-07-24T17:01:50Z', + type: 'heartbeat/summary', + dataset: 'browser', + }, + timestamp: '2022-07-24T17:01:48.326Z', + docId: 'kUYoMYIBqL6WCtugc1We', }, - timestamp: '2022-07-24T17:01:48.326Z', - docId: 'kUYoMYIBqL6WCtugc1We', - }, - ], - loading: false, + ], + loading: false, + }, syntheticsMonitor: { id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', type: DataStream.BROWSER, diff --git a/x-pack/plugins/synthetics/server/common/pings/query_pings.ts b/x-pack/plugins/synthetics/server/common/pings/query_pings.ts index b6d1b4292392..872336767aec 100644 --- a/x-pack/plugins/synthetics/server/common/pings/query_pings.ts +++ b/x-pack/plugins/synthetics/server/common/pings/query_pings.ts @@ -68,6 +68,7 @@ export const queryPings: UMElasticsearchQueryFn = status, sort, size: sizeParam, + pageIndex, locations, excludedLocations, }) => { @@ -75,6 +76,7 @@ export const queryPings: UMElasticsearchQueryFn = const searchBody = { size, + from: pageIndex !== undefined ? pageIndex * size : 0, ...(index ? { from: index * size } : {}), query: { bool: { diff --git a/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts b/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts index e94c928caed5..def868e404db 100644 --- a/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts +++ b/x-pack/plugins/synthetics/server/routes/pings/get_pings.ts @@ -23,13 +23,24 @@ export const syntheticsGetPingsRoute: UMRestApiRouteFactory = (libs: UMServerLib monitorId: schema.maybe(schema.string()), index: schema.maybe(schema.number()), size: schema.maybe(schema.number()), + pageIndex: schema.maybe(schema.number()), sort: schema.maybe(schema.string()), status: schema.maybe(schema.string()), }), }, handler: async ({ uptimeEsClient, request, response }): Promise => { - const { from, to, index, monitorId, status, sort, size, locations, excludedLocations } = - request.query; + const { + from, + to, + index, + monitorId, + status, + sort, + size, + pageIndex, + locations, + excludedLocations, + } = request.query; return await queryPings({ uptimeEsClient, @@ -39,6 +50,7 @@ export const syntheticsGetPingsRoute: UMRestApiRouteFactory = (libs: UMServerLib status, sort, size, + pageIndex, locations: locations ? JSON.parse(locations) : [], excludedLocations, }); From 1ed2ec8e57ab5da100988b00c697e2d6d6d615e9 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Mon, 31 Oct 2022 14:46:52 +0100 Subject: [PATCH 05/87] [Files] move to src (#144044) --- .github/CODEOWNERS | 4 +- .i18nrc.json | 6 +- docs/developer/plugin-list.asciidoc | 8 +- .../files_example/.i18nrc.json | 0 .../files_example/README.md | 0 .../files_example/common/index.ts | 5 +- .../files_example/kibana.json | 0 .../files_example/public/application.tsx | 5 +- .../files_example/public/components/app.tsx | 5 +- .../public/components/confirm_button.tsx | 5 +- .../public/components/details_flyout.tsx | 6 +- .../public/components/file_picker.tsx | 5 +- .../files_example/public/components/modal.tsx | 5 +- .../files_example/public/imports.ts | 5 +- .../files_example/public/index.ts | 5 +- .../files_example/public/plugin.ts | 5 +- .../files_example/public/types.ts | 5 +- .../files_example/server/index.ts | 5 +- .../files_example/server/plugin.ts | 5 +- .../files_example/server/types.ts | 5 +- examples/files_example/tsconfig.json | 20 +++++ src/dev/storybook/aliases.ts | 2 +- {x-pack => src}/plugins/files/.i18nrc.json | 0 .../plugins/files/.storybook/main.ts | 5 +- .../plugins/files/.storybook/manager.ts | 7 +- {x-pack => src}/plugins/files/README.md | 0 .../plugins/files/common/api_routes.ts | 5 +- .../plugins/files/common/constants.ts | 5 +- .../files/common/file_kinds_registry/index.ts | 6 +- {x-pack => src}/plugins/files/common/index.ts | 5 +- {x-pack => src}/plugins/files/common/types.ts | 6 +- .../plugins/files/docs/tutorial.mdx | 2 +- src/plugins/files/jest.config.js | 16 ++++ .../plugins/files/jest.integration.config.js | 7 +- {x-pack => src}/plugins/files/kibana.json | 0 .../files/public/components/context.tsx | 5 +- .../components/clear_filter_button.tsx | 6 +- .../file_picker/components/error_content.tsx | 5 +- .../file_picker/components/file_card.scss | 0 .../file_picker/components/file_card.tsx | 5 +- .../file_picker/components/file_grid.tsx | 5 +- .../file_picker/components/modal_footer.tsx | 5 +- .../file_picker/components/pagination.tsx | 5 +- .../file_picker/components/search_field.tsx | 5 +- .../file_picker/components/select_button.tsx | 5 +- .../file_picker/components/title.tsx | 6 +- .../file_picker/components/upload_files.tsx | 5 +- .../public/components/file_picker/context.tsx | 5 +- .../components/file_picker/file_picker.scss | 0 .../file_picker/file_picker.stories.tsx | 6 +- .../file_picker/file_picker.test.tsx | 6 +- .../components/file_picker/file_picker.tsx | 5 +- .../file_picker/file_picker_state.test.ts | 5 +- .../file_picker/file_picker_state.ts | 6 +- .../components/file_picker/i18n_texts.ts | 50 ++++++++++++ .../public/components/file_picker/index.tsx | 5 +- .../components/image/components/blurhash.tsx | 6 +- .../components/image/components/img.tsx | 6 +- .../components/image/components/index.ts | 5 +- .../image/image.constants.stories.tsx | 5 +- .../public/components/image/image.stories.tsx | 6 +- .../files/public/components/image/image.tsx | 6 +- .../files/public/components/image/index.ts | 5 +- .../files/public/components/image/styles.ts | 5 +- .../components/image/use_viewport_observer.ts | 5 +- .../image/viewport_observer.test.ts | 6 +- .../components/image/viewport_observer.ts | 6 +- .../plugins/files/public/components/index.ts | 5 +- .../files/public/components/stories_shared.ts | 5 +- .../upload_file/components/cancel_button.tsx | 5 +- .../upload_file/components/clear_button.tsx | 5 +- .../upload_file/components/control_button.tsx | 5 +- .../upload_file/components/index.ts | 5 +- .../upload_file/components/retry_button.tsx | 6 +- .../upload_file/components/upload_button.tsx | 5 +- .../public/components/upload_file/context.ts | 6 +- .../components/upload_file/i18n_texts.ts | 42 ++++++++++ .../public/components/upload_file/index.tsx | 5 +- .../upload_file/upload_file.component.tsx | 5 +- .../upload_file/upload_file.stories.tsx | 6 +- .../upload_file/upload_file.test.tsx | 5 +- .../components/upload_file/upload_file.tsx | 5 +- .../upload_file/upload_state.test.ts | 5 +- .../components/upload_file/upload_state.ts | 5 +- .../components/upload_file/util/index.ts | 5 +- .../upload_file/util/parse_file_name.test.ts | 5 +- .../upload_file/util/parse_file_name.ts | 5 +- .../upload_file/util/simple_state_subject.ts | 5 +- .../public/components/use_behavior_subject.ts | 5 +- .../components/util/image_metadata.test.ts | 6 +- .../public/components/util/image_metadata.ts | 5 +- .../files/public/components/util/index.ts | 5 +- .../public/files_client/files_client.test.ts | 5 +- .../files/public/files_client/files_client.ts | 5 +- .../files/public/files_client/index.ts | 5 +- {x-pack => src}/plugins/files/public/index.ts | 5 +- {x-pack => src}/plugins/files/public/mocks.ts | 5 +- .../plugins/files/public/plugin.ts | 5 +- {x-pack => src}/plugins/files/public/types.ts | 5 +- .../plugins/files/server/audit_events.ts | 5 +- .../blob_storage_service/adapters/README.md | 0 .../es/content_stream/content_stream.test.ts | 5 +- .../es/content_stream/content_stream.ts | 5 +- .../adapters/es/content_stream/index.ts | 5 +- .../adapters/es/es.test.ts | 6 +- .../blob_storage_service/adapters/es/es.ts | 5 +- .../blob_storage_service/adapters/es/index.ts | 5 +- .../adapters/es/integration_tests/es.test.ts | 5 +- .../adapters/es/mappings.ts | 5 +- .../blob_storage_service/adapters/index.ts | 5 +- .../blob_storage_service.ts | 6 +- .../server/blob_storage_service/index.ts | 5 +- .../server/blob_storage_service/types.ts | 5 +- .../plugins/files/server/feature.ts | 9 ++- .../plugins/files/server/file/errors.ts | 5 +- .../plugins/files/server/file/file.test.ts | 6 +- .../plugins/files/server/file/file.ts | 5 +- .../server/file/file_attributes_reducer.ts | 6 +- .../plugins/files/server/file/index.ts | 5 +- .../plugins/files/server/file/to_json.ts | 5 +- .../file_client/create_es_file_client.ts | 5 +- .../files/server/file_client/file_client.ts | 6 +- .../file_metadata_client/adapters/es_index.ts | 5 +- .../file_metadata_client/adapters/index.ts | 5 +- .../adapters/query_filters.ts | 6 +- .../adapters/saved_objects.ts | 5 +- .../file_metadata_client.ts | 5 +- .../file_client/file_metadata_client/index.ts | 5 +- .../plugins/files/server/file_client/index.ts | 5 +- .../integration_tests/es_file_client.test.ts | 6 +- .../file_client/stream_transforms/index.ts | 5 +- .../max_byte_size_transform/errors.ts | 5 +- .../max_byte_size_transform/index.ts | 5 +- .../max_byte_size_transform.test.ts | 5 +- .../max_byte_size_transform.ts | 5 +- .../plugins/files/server/file_client/types.ts | 5 +- .../plugins/files/server/file_client/utils.ts | 5 +- .../files/server/file_service/errors.ts | 5 +- .../server/file_service/file_action_types.ts | 5 +- .../files/server/file_service/file_service.ts | 5 +- .../file_service/file_service_factory.ts | 5 +- .../files/server/file_service/index.ts | 5 +- .../file_service/internal_file_service.ts | 5 +- .../files/server/file_share_service/errors.ts | 5 +- .../generate_share_token.test.ts | 5 +- .../generate_share_token.ts | 5 +- .../files/server/file_share_service/index.ts | 5 +- .../internal_file_share_service.ts | 6 +- .../files/server/file_share_service/types.ts | 5 +- {x-pack => src}/plugins/files/server/index.ts | 5 +- .../files/server/integration_tests/README.md | 0 .../integration_tests/file_service.test.ts | 9 +-- {x-pack => src}/plugins/files/server/mocks.ts | 6 +- .../plugins/files/server/plugin.ts | 5 +- .../plugins/files/server/routes/api_routes.ts | 5 +- .../files/server/routes/common.test.ts | 5 +- .../plugins/files/server/routes/common.ts | 6 +- .../files/server/routes/common_schemas.ts | 5 +- .../files/server/routes/file_kind/create.ts | 5 +- .../files/server/routes/file_kind/delete.ts | 5 +- .../files/server/routes/file_kind/download.ts | 5 +- .../server/routes/file_kind/enhance_router.ts | 5 +- .../server/routes/file_kind/get_by_id.ts | 5 +- .../files/server/routes/file_kind/helpers.ts | 5 +- .../files/server/routes/file_kind/index.ts | 6 +- .../integration_tests/file_kind_http.test.ts | 5 +- .../files/server/routes/file_kind/list.ts | 6 +- .../server/routes/file_kind/share/get.ts | 6 +- .../server/routes/file_kind/share/list.ts | 6 +- .../server/routes/file_kind/share/share.ts | 6 +- .../server/routes/file_kind/share/unshare.ts | 6 +- .../files/server/routes/file_kind/types.ts | 5 +- .../files/server/routes/file_kind/update.ts | 5 +- .../server/routes/file_kind/upload.test.ts | 5 +- .../files/server/routes/file_kind/upload.ts | 5 +- .../plugins/files/server/routes/find.ts | 6 +- .../plugins/files/server/routes/index.ts | 5 +- .../routes/integration_tests/routes.test.ts | 5 +- .../plugins/files/server/routes/metrics.ts | 6 +- .../server/routes/public_facing/download.ts | 6 +- .../plugins/files/server/routes/test_utils.ts | 5 +- .../plugins/files/server/routes/types.ts | 5 +- .../files/server/saved_objects/file.ts | 5 +- .../files/server/saved_objects/file_share.ts | 5 +- .../files/server/saved_objects/index.ts | 5 +- .../plugins/files/server/test_utils/index.ts | 5 +- .../setup_integration_environment.ts | 12 +-- {x-pack => src}/plugins/files/server/types.ts | 6 +- .../plugins/files/server/usage/counters.ts | 5 +- .../plugins/files/server/usage/index.ts | 5 +- .../usage/integration_tests/usage.test.ts | 5 +- .../server/usage/register_usage_collector.ts | 6 +- .../plugins/files/server/usage/schema.ts | 5 +- {x-pack => src}/plugins/files/tsconfig.json | 6 +- src/plugins/telemetry/schema/oss_plugins.json | 77 +++++++++++++++++++ tsconfig.base.json | 8 +- x-pack/.i18nrc.json | 1 - x-pack/examples/files_example/tsconfig.json | 22 ------ x-pack/plugins/files/jest.config.js | 15 ---- .../components/file_picker/i18n_texts.ts | 49 ------------ .../components/upload_file/i18n_texts.ts | 41 ---------- .../services/endpoint_response_actions.ts | 2 +- .../plugins/security_solution/tsconfig.json | 4 +- .../schema/xpack_plugins.json | 77 ------------------- 204 files changed, 792 insertions(+), 588 deletions(-) rename {x-pack/examples => examples}/files_example/.i18nrc.json (100%) rename {x-pack/examples => examples}/files_example/README.md (100%) rename {x-pack/examples => examples}/files_example/common/index.ts (78%) rename {x-pack/examples => examples}/files_example/kibana.json (100%) rename {x-pack/examples => examples}/files_example/public/application.tsx (84%) rename {x-pack/examples => examples}/files_example/public/components/app.tsx (96%) rename {x-pack/examples => examples}/files_example/public/components/confirm_button.tsx (85%) rename {x-pack/examples => examples}/files_example/public/components/details_flyout.tsx (94%) rename {x-pack/examples => examples}/files_example/public/components/file_picker.tsx (79%) rename {x-pack/examples => examples}/files_example/public/components/modal.tsx (84%) rename {x-pack/examples => examples}/files_example/public/imports.ts (69%) rename {x-pack/examples => examples}/files_example/public/index.ts (66%) rename {x-pack/examples => examples}/files_example/public/plugin.ts (90%) rename {x-pack/examples => examples}/files_example/public/types.ts (79%) rename {x-pack/examples => examples}/files_example/server/index.ts (72%) rename {x-pack/examples => examples}/files_example/server/plugin.ts (83%) rename {x-pack/examples => examples}/files_example/server/types.ts (66%) create mode 100644 examples/files_example/tsconfig.json rename {x-pack => src}/plugins/files/.i18nrc.json (100%) rename {x-pack => src}/plugins/files/.storybook/main.ts (64%) rename {x-pack => src}/plugins/files/.storybook/manager.ts (63%) rename {x-pack => src}/plugins/files/README.md (100%) rename {x-pack => src}/plugins/files/common/api_routes.ts (93%) rename {x-pack => src}/plugins/files/common/constants.ts (79%) rename {x-pack => src}/plugins/files/common/file_kinds_registry/index.ts (89%) rename {x-pack => src}/plugins/files/common/index.ts (77%) rename {x-pack => src}/plugins/files/common/types.ts (98%) rename {x-pack => src}/plugins/files/docs/tutorial.mdx (99%) create mode 100644 src/plugins/files/jest.config.js rename {x-pack => src}/plugins/files/jest.integration.config.js (52%) rename {x-pack => src}/plugins/files/kibana.json (100%) rename {x-pack => src}/plugins/files/public/components/context.tsx (86%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/clear_filter_button.tsx (85%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/error_content.tsx (84%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/file_card.scss (100%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/file_card.tsx (94%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/file_grid.tsx (86%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/modal_footer.tsx (91%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/pagination.tsx (84%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/search_field.tsx (85%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/select_button.tsx (85%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/title.tsx (69%) rename {x-pack => src}/plugins/files/public/components/file_picker/components/upload_files.tsx (86%) rename {x-pack => src}/plugins/files/public/components/file_picker/context.tsx (88%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.scss (100%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.stories.tsx (96%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.test.tsx (95%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker.tsx (94%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker_state.test.ts (97%) rename {x-pack => src}/plugins/files/public/components/file_picker/file_picker_state.ts (97%) create mode 100644 src/plugins/files/public/components/file_picker/i18n_texts.ts rename {x-pack => src}/plugins/files/public/components/file_picker/index.tsx (75%) rename {x-pack => src}/plugins/files/public/components/image/components/blurhash.tsx (89%) rename {x-pack => src}/plugins/files/public/components/image/components/img.tsx (89%) rename {x-pack => src}/plugins/files/public/components/image/components/index.ts (59%) rename {x-pack => src}/plugins/files/public/components/image/image.constants.stories.tsx (97%) rename {x-pack => src}/plugins/files/public/components/image/image.stories.tsx (92%) rename {x-pack => src}/plugins/files/public/components/image/image.tsx (93%) rename {x-pack => src}/plugins/files/public/components/image/index.ts (57%) rename {x-pack => src}/plugins/files/public/components/image/styles.ts (72%) rename {x-pack => src}/plugins/files/public/components/image/use_viewport_observer.ts (85%) rename {x-pack => src}/plugins/files/public/components/image/viewport_observer.test.ts (92%) rename {x-pack => src}/plugins/files/public/components/image/viewport_observer.ts (89%) rename {x-pack => src}/plugins/files/public/components/index.ts (67%) rename {x-pack => src}/plugins/files/public/components/stories_shared.ts (77%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/cancel_button.tsx (86%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/clear_button.tsx (76%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/control_button.tsx (86%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/index.ts (58%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/retry_button.tsx (81%) rename {x-pack => src}/plugins/files/public/components/upload_file/components/upload_button.tsx (87%) rename {x-pack => src}/plugins/files/public/components/upload_file/context.ts (66%) create mode 100644 src/plugins/files/public/components/upload_file/i18n_texts.ts rename {x-pack => src}/plugins/files/public/components/upload_file/index.tsx (76%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.component.tsx (95%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.stories.tsx (95%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.test.tsx (97%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_file.tsx (95%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_state.test.ts (97%) rename {x-pack => src}/plugins/files/public/components/upload_file/upload_state.ts (97%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/index.ts (61%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/parse_file_name.test.ts (82%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/parse_file_name.ts (71%) rename {x-pack => src}/plugins/files/public/components/upload_file/util/simple_state_subject.ts (78%) rename {x-pack => src}/plugins/files/public/components/use_behavior_subject.ts (66%) rename {x-pack => src}/plugins/files/public/components/util/image_metadata.test.ts (86%) rename {x-pack => src}/plugins/files/public/components/util/image_metadata.ts (92%) rename {x-pack => src}/plugins/files/public/components/util/index.ts (61%) rename {x-pack => src}/plugins/files/public/files_client/files_client.test.ts (89%) rename {x-pack => src}/plugins/files/public/files_client/files_client.ts (96%) rename {x-pack => src}/plugins/files/public/files_client/index.ts (53%) rename {x-pack => src}/plugins/files/public/index.ts (75%) rename {x-pack => src}/plugins/files/public/mocks.ts (80%) rename {x-pack => src}/plugins/files/public/plugin.ts (91%) rename {x-pack => src}/plugins/files/public/types.ts (96%) rename {x-pack => src}/plugins/files/server/audit_events.ts (79%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/README.md (100%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts (98%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts (98%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts (69%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/es.test.ts (91%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/es.ts (96%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/index.ts (56%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts (96%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/es/mappings.ts (86%) rename {x-pack => src}/plugins/files/server/blob_storage_service/adapters/index.ts (56%) rename {x-pack => src}/plugins/files/server/blob_storage_service/blob_storage_service.ts (88%) rename {x-pack => src}/plugins/files/server/blob_storage_service/index.ts (65%) rename {x-pack => src}/plugins/files/server/blob_storage_service/types.ts (90%) rename {x-pack => src}/plugins/files/server/feature.ts (77%) rename {x-pack => src}/plugins/files/server/file/errors.ts (76%) rename {x-pack => src}/plugins/files/server/file/file.test.ts (95%) rename {x-pack => src}/plugins/files/server/file/file.ts (96%) rename {x-pack => src}/plugins/files/server/file/file_attributes_reducer.ts (86%) rename {x-pack => src}/plugins/files/server/file/index.ts (69%) rename {x-pack => src}/plugins/files/server/file/to_json.ts (86%) rename {x-pack => src}/plugins/files/server/file_client/create_es_file_client.ts (90%) rename {x-pack => src}/plugins/files/server/file_client/file_client.ts (97%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts (95%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/index.ts (60%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts (91%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts (95%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts (93%) rename {x-pack => src}/plugins/files/server/file_client/file_metadata_client/index.ts (72%) rename {x-pack => src}/plugins/files/server/file_client/index.ts (81%) rename {x-pack => src}/plugins/files/server/file_client/integration_tests/es_file_client.test.ts (96%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/index.ts (55%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts (65%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts (55%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts (87%) rename {x-pack => src}/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts (79%) rename {x-pack => src}/plugins/files/server/file_client/types.ts (94%) rename {x-pack => src}/plugins/files/server/file_client/utils.ts (71%) rename {x-pack => src}/plugins/files/server/file_service/errors.ts (61%) rename {x-pack => src}/plugins/files/server/file_service/file_action_types.ts (91%) rename {x-pack => src}/plugins/files/server/file_service/file_service.ts (92%) rename {x-pack => src}/plugins/files/server/file_service/file_service_factory.ts (96%) rename {x-pack => src}/plugins/files/server/file_service/index.ts (71%) rename {x-pack => src}/plugins/files/server/file_service/internal_file_service.ts (95%) rename {x-pack => src}/plugins/files/server/file_share_service/errors.ts (74%) rename {x-pack => src}/plugins/files/server/file_share_service/generate_share_token.test.ts (70%) rename {x-pack => src}/plugins/files/server/file_share_service/generate_share_token.ts (82%) rename {x-pack => src}/plugins/files/server/file_share_service/index.ts (74%) rename {x-pack => src}/plugins/files/server/file_share_service/internal_file_share_service.ts (97%) rename {x-pack => src}/plugins/files/server/file_share_service/types.ts (85%) rename {x-pack => src}/plugins/files/server/index.ts (85%) rename {x-pack => src}/plugins/files/server/integration_tests/README.md (100%) rename {x-pack => src}/plugins/files/server/integration_tests/file_service.test.ts (98%) rename {x-pack => src}/plugins/files/server/mocks.ts (92%) rename {x-pack => src}/plugins/files/server/plugin.ts (94%) rename {x-pack => src}/plugins/files/server/routes/api_routes.ts (89%) rename {x-pack => src}/plugins/files/server/routes/common.test.ts (91%) rename {x-pack => src}/plugins/files/server/routes/common.ts (87%) rename {x-pack => src}/plugins/files/server/routes/common_schemas.ts (87%) rename {x-pack => src}/plugins/files/server/routes/file_kind/create.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/delete.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/download.ts (90%) rename {x-pack => src}/plugins/files/server/routes/file_kind/enhance_router.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/get_by_id.ts (88%) rename {x-pack => src}/plugins/files/server/routes/file_kind/helpers.ts (85%) rename {x-pack => src}/plugins/files/server/routes/file_kind/index.ts (86%) rename {x-pack => src}/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts (97%) rename {x-pack => src}/plugins/files/server/routes/file_kind/list.ts (91%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/get.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/list.ts (88%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/share.ts (92%) rename {x-pack => src}/plugins/files/server/routes/file_kind/share/unshare.ts (88%) rename {x-pack => src}/plugins/files/server/routes/file_kind/types.ts (81%) rename {x-pack => src}/plugins/files/server/routes/file_kind/update.ts (89%) rename {x-pack => src}/plugins/files/server/routes/file_kind/upload.test.ts (93%) rename {x-pack => src}/plugins/files/server/routes/file_kind/upload.ts (94%) rename {x-pack => src}/plugins/files/server/routes/find.ts (92%) rename {x-pack => src}/plugins/files/server/routes/index.ts (74%) rename {x-pack => src}/plugins/files/server/routes/integration_tests/routes.test.ts (97%) rename {x-pack => src}/plugins/files/server/routes/metrics.ts (84%) rename {x-pack => src}/plugins/files/server/routes/public_facing/download.ts (91%) rename {x-pack => src}/plugins/files/server/routes/test_utils.ts (82%) rename {x-pack => src}/plugins/files/server/routes/types.ts (86%) rename {x-pack => src}/plugins/files/server/saved_objects/file.ts (85%) rename {x-pack => src}/plugins/files/server/saved_objects/file_share.ts (84%) rename {x-pack => src}/plugins/files/server/saved_objects/index.ts (67%) rename {x-pack => src}/plugins/files/server/test_utils/index.ts (63%) rename {x-pack => src}/plugins/files/server/test_utils/setup_integration_environment.ts (92%) rename {x-pack => src}/plugins/files/server/types.ts (85%) rename {x-pack => src}/plugins/files/server/usage/counters.ts (84%) rename {x-pack => src}/plugins/files/server/usage/index.ts (62%) rename {x-pack => src}/plugins/files/server/usage/integration_tests/usage.test.ts (91%) rename {x-pack => src}/plugins/files/server/usage/register_usage_collector.ts (85%) rename {x-pack => src}/plugins/files/server/usage/schema.ts (89%) rename {x-pack => src}/plugins/files/tsconfig.json (62%) delete mode 100644 x-pack/examples/files_example/tsconfig.json delete mode 100644 x-pack/plugins/files/jest.config.js delete mode 100644 x-pack/plugins/files/public/components/file_picker/i18n_texts.ts delete mode 100644 x-pack/plugins/files/public/components/upload_file/i18n_texts.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4dc48e657542..f536168edb6e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -84,8 +84,8 @@ /x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services /x-pack/plugins/runtime_fields @elastic/kibana-app-services /src/plugins/dashboard/public/application/embeddable/viewport/print_media @elastic/kibana-app-services -x-pack/plugins/files @elastic/kibana-app-services -x-pack/examples/files_example @elastic/kibana-app-services +/src/plugins/files @elastic/kibana-app-services +/examples/files_example @elastic/kibana-app-services /x-pack/test/search_sessions_integration/ @elastic/kibana-app-services /test/plugin_functional/test_suites/panel_actions @elastic/kibana-app-services /test/plugin_functional/test_suites/data_plugin @elastic/kibana-app-services diff --git a/.i18nrc.json b/.i18nrc.json index 874c4ecbcc1b..2894905ae8f8 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -9,10 +9,7 @@ "charts": "src/plugins/charts", "console": "src/plugins/console", "contentManagement": "packages/content-management", - "core": [ - "src/core", - "packages/core" - ], + "core": ["src/core", "packages/core"], "customIntegrations": "src/plugins/custom_integrations", "dashboard": "src/plugins/dashboard", "controls": "src/plugins/controls", @@ -41,6 +38,7 @@ "expressionTagcloud": "src/plugins/chart_expressions/expression_tagcloud", "eventAnnotation": "src/plugins/event_annotation", "fieldFormats": "src/plugins/field_formats", + "files": "src/plugins/files", "flot": "packages/kbn-flot-charts/lib", "guidedOnboarding": "src/plugins/guided_onboarding", "guidedOnboardingPackage": "packages/kbn-guided-onboarding", diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index feb87de90c2e..32d807e016eb 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -176,6 +176,10 @@ for use in their own application. |Index pattern fields formatters +|{kib-repo}blob/{branch}/src/plugins/files/README.md[files] +|File upload, download, sharing, and serving over HTTP implementation in Kibana. + + |{kib-repo}blob/{branch}/src/plugins/guided_onboarding/README.md[guidedOnboarding] |This plugin contains the code for the Guided Onboarding project. Guided onboarding consists of guides for Solutions (Enterprise Search, Observability, Security) that can be completed as a checklist of steps. The guides help users to ingest their data and to navigate to the correct Solutions pages. @@ -491,10 +495,6 @@ activities. |The features plugin enhance Kibana with a per-feature privilege system. -|{kib-repo}blob/{branch}/x-pack/plugins/files/README.md[files] -|File upload, download, sharing, and serving over HTTP implementation in Kibana. - - |{kib-repo}blob/{branch}/x-pack/plugins/file_upload[fileUpload] |WARNING: Missing README. diff --git a/x-pack/examples/files_example/.i18nrc.json b/examples/files_example/.i18nrc.json similarity index 100% rename from x-pack/examples/files_example/.i18nrc.json rename to examples/files_example/.i18nrc.json diff --git a/x-pack/examples/files_example/README.md b/examples/files_example/README.md similarity index 100% rename from x-pack/examples/files_example/README.md rename to examples/files_example/README.md diff --git a/x-pack/examples/files_example/common/index.ts b/examples/files_example/common/index.ts similarity index 78% rename from x-pack/examples/files_example/common/index.ts rename to examples/files_example/common/index.ts index aeb807e30aad..566edb64b424 100644 --- a/x-pack/examples/files_example/common/index.ts +++ b/examples/files_example/common/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FileKind, FileImageMetadata } from '@kbn/files-plugin/common'; diff --git a/x-pack/examples/files_example/kibana.json b/examples/files_example/kibana.json similarity index 100% rename from x-pack/examples/files_example/kibana.json rename to examples/files_example/kibana.json diff --git a/x-pack/examples/files_example/public/application.tsx b/examples/files_example/public/application.tsx similarity index 84% rename from x-pack/examples/files_example/public/application.tsx rename to examples/files_example/public/application.tsx index 0bad6975c6da..0795ec3a7742 100644 --- a/x-pack/examples/files_example/public/application.tsx +++ b/examples/files_example/public/application.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/examples/files_example/public/components/app.tsx b/examples/files_example/public/components/app.tsx similarity index 96% rename from x-pack/examples/files_example/public/components/app.tsx rename to examples/files_example/public/components/app.tsx index 9d10e33a8b23..1f77ca9566cb 100644 --- a/x-pack/examples/files_example/public/components/app.tsx +++ b/examples/files_example/public/components/app.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useState } from 'react'; diff --git a/x-pack/examples/files_example/public/components/confirm_button.tsx b/examples/files_example/public/components/confirm_button.tsx similarity index 85% rename from x-pack/examples/files_example/public/components/confirm_button.tsx rename to examples/files_example/public/components/confirm_button.tsx index 05e64243bb37..b60f84b3369d 100644 --- a/x-pack/examples/files_example/public/components/confirm_button.tsx +++ b/examples/files_example/public/components/confirm_button.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useState, FunctionComponent } from 'react'; diff --git a/x-pack/examples/files_example/public/components/details_flyout.tsx b/examples/files_example/public/components/details_flyout.tsx similarity index 94% rename from x-pack/examples/files_example/public/components/details_flyout.tsx rename to examples/files_example/public/components/details_flyout.tsx index a417752d1a66..0303095a11a0 100644 --- a/x-pack/examples/files_example/public/components/details_flyout.tsx +++ b/examples/files_example/public/components/details_flyout.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import moment from 'moment'; import type { FunctionComponent } from 'react'; import React from 'react'; diff --git a/x-pack/examples/files_example/public/components/file_picker.tsx b/examples/files_example/public/components/file_picker.tsx similarity index 79% rename from x-pack/examples/files_example/public/components/file_picker.tsx rename to examples/files_example/public/components/file_picker.tsx index bc30ab92654d..72a205775574 100644 --- a/x-pack/examples/files_example/public/components/file_picker.tsx +++ b/examples/files_example/public/components/file_picker.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/examples/files_example/public/components/modal.tsx b/examples/files_example/public/components/modal.tsx similarity index 84% rename from x-pack/examples/files_example/public/components/modal.tsx rename to examples/files_example/public/components/modal.tsx index d8289257617c..a314e5bd8ea4 100644 --- a/x-pack/examples/files_example/public/components/modal.tsx +++ b/examples/files_example/public/components/modal.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FunctionComponent } from 'react'; diff --git a/x-pack/examples/files_example/public/imports.ts b/examples/files_example/public/imports.ts similarity index 69% rename from x-pack/examples/files_example/public/imports.ts rename to examples/files_example/public/imports.ts index 82835ba21361..f21a30a390e6 100644 --- a/x-pack/examples/files_example/public/imports.ts +++ b/examples/files_example/public/imports.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { diff --git a/x-pack/examples/files_example/public/index.ts b/examples/files_example/public/index.ts similarity index 66% rename from x-pack/examples/files_example/public/index.ts rename to examples/files_example/public/index.ts index 15e472c4f4cc..e3128e606451 100644 --- a/x-pack/examples/files_example/public/index.ts +++ b/examples/files_example/public/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FilesExamplePlugin } from './plugin'; diff --git a/x-pack/examples/files_example/public/plugin.ts b/examples/files_example/public/plugin.ts similarity index 90% rename from x-pack/examples/files_example/public/plugin.ts rename to examples/files_example/public/plugin.ts index 4906b59d4d6f..ba0b1dfd5437 100644 --- a/x-pack/examples/files_example/public/plugin.ts +++ b/examples/files_example/public/plugin.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { AppNavLinkStatus } from '@kbn/core-application-browser'; diff --git a/x-pack/examples/files_example/public/types.ts b/examples/files_example/public/types.ts similarity index 79% rename from x-pack/examples/files_example/public/types.ts rename to examples/files_example/public/types.ts index 0ac384055aaf..4ca9eb148872 100644 --- a/x-pack/examples/files_example/public/types.ts +++ b/examples/files_example/public/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { MyImageMetadata } from '../common'; diff --git a/x-pack/examples/files_example/server/index.ts b/examples/files_example/server/index.ts similarity index 72% rename from x-pack/examples/files_example/server/index.ts rename to examples/files_example/server/index.ts index 5b6de87308e5..d7edefbe1876 100644 --- a/x-pack/examples/files_example/server/index.ts +++ b/examples/files_example/server/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { PluginInitializerContext } from '@kbn/core/server'; diff --git a/x-pack/examples/files_example/server/plugin.ts b/examples/files_example/server/plugin.ts similarity index 83% rename from x-pack/examples/files_example/server/plugin.ts rename to examples/files_example/server/plugin.ts index 2b077d6f3e88..5ab9571a6420 100644 --- a/x-pack/examples/files_example/server/plugin.ts +++ b/examples/files_example/server/plugin.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; diff --git a/x-pack/examples/files_example/server/types.ts b/examples/files_example/server/types.ts similarity index 66% rename from x-pack/examples/files_example/server/types.ts rename to examples/files_example/server/types.ts index b1cef58620ca..7f12e7fd94a1 100644 --- a/x-pack/examples/files_example/server/types.ts +++ b/examples/files_example/server/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FilesSetup, FilesStart } from '@kbn/files-plugin/server'; diff --git a/examples/files_example/tsconfig.json b/examples/files_example/tsconfig.json new file mode 100644 index 000000000000..2ce0ddb8f7d6 --- /dev/null +++ b/examples/files_example/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target/types" + }, + "include": [ + "index.ts", + "common/**/*", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*" + ], + "exclude": [], + "kbn_references": [ + { "path": "../../src/core/tsconfig.json" }, + { "path": "../developer_examples/tsconfig.json" }, + { "path": "../../src/plugins/files/tsconfig.json" }, + ] +} diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 85999d75b899..7ad2c16224d6 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -33,7 +33,7 @@ export const storybookAliases = { expression_reveal_image: 'src/plugins/expression_reveal_image/.storybook', expression_shape: 'src/plugins/expression_shape/.storybook', expression_tagcloud: 'src/plugins/chart_expressions/expression_tagcloud/.storybook', - files: 'x-pack/plugins/files/.storybook', + files: 'src/plugins/files/.storybook', fleet: 'x-pack/plugins/fleet/.storybook', home: 'src/plugins/home/.storybook', infra: 'x-pack/plugins/infra/.storybook', diff --git a/x-pack/plugins/files/.i18nrc.json b/src/plugins/files/.i18nrc.json similarity index 100% rename from x-pack/plugins/files/.i18nrc.json rename to src/plugins/files/.i18nrc.json diff --git a/x-pack/plugins/files/.storybook/main.ts b/src/plugins/files/.storybook/main.ts similarity index 64% rename from x-pack/plugins/files/.storybook/main.ts rename to src/plugins/files/.storybook/main.ts index e82ec6c47bbe..f9d5b3ea3edd 100644 --- a/x-pack/plugins/files/.storybook/main.ts +++ b/src/plugins/files/.storybook/main.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { defaultConfig } from '@kbn/storybook'; diff --git a/x-pack/plugins/files/.storybook/manager.ts b/src/plugins/files/.storybook/manager.ts similarity index 63% rename from x-pack/plugins/files/.storybook/manager.ts rename to src/plugins/files/.storybook/manager.ts index 167046920a79..d49eea178479 100644 --- a/x-pack/plugins/files/.storybook/manager.ts +++ b/src/plugins/files/.storybook/manager.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { addons } from '@storybook/addons'; @@ -13,7 +14,7 @@ addons.setConfig({ theme: create({ base: 'light', brandTitle: 'Kibana React Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/main/x-pack/plugins/files', + brandUrl: 'https://github.com/elastic/kibana/tree/main/src/plugins/files', }), showPanel: true.valueOf, selectedPanel: PANEL_ID, diff --git a/x-pack/plugins/files/README.md b/src/plugins/files/README.md similarity index 100% rename from x-pack/plugins/files/README.md rename to src/plugins/files/README.md diff --git a/x-pack/plugins/files/common/api_routes.ts b/src/plugins/files/common/api_routes.ts similarity index 93% rename from x-pack/plugins/files/common/api_routes.ts rename to src/plugins/files/common/api_routes.ts index 2f522e7c7715..7d95d24be9ec 100644 --- a/x-pack/plugins/files/common/api_routes.ts +++ b/src/plugins/files/common/api_routes.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { TypeOf, Type } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/common/constants.ts b/src/plugins/files/common/constants.ts similarity index 79% rename from x-pack/plugins/files/common/constants.ts rename to src/plugins/files/common/constants.ts index 665945c1c65c..19f0736eeaf4 100644 --- a/x-pack/plugins/files/common/constants.ts +++ b/src/plugins/files/common/constants.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ /** diff --git a/x-pack/plugins/files/common/file_kinds_registry/index.ts b/src/plugins/files/common/file_kinds_registry/index.ts similarity index 89% rename from x-pack/plugins/files/common/file_kinds_registry/index.ts rename to src/plugins/files/common/file_kinds_registry/index.ts index 5df6744546c0..afed906bd0aa 100644 --- a/x-pack/plugins/files/common/file_kinds_registry/index.ts +++ b/src/plugins/files/common/file_kinds_registry/index.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { createGetterSetter } from '@kbn/kibana-utils-plugin/common'; import assert from 'assert'; import { FileKind } from '..'; diff --git a/x-pack/plugins/files/common/index.ts b/src/plugins/files/common/index.ts similarity index 77% rename from x-pack/plugins/files/common/index.ts rename to src/plugins/files/common/index.ts index be06c5708ce0..ece05d00a8bd 100755 --- a/x-pack/plugins/files/common/index.ts +++ b/src/plugins/files/common/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { FILE_SO_TYPE, PLUGIN_ID, PLUGIN_NAME, ES_FIXED_SIZE_INDEX_BLOB_STORE } from './constants'; diff --git a/x-pack/plugins/files/common/types.ts b/src/plugins/files/common/types.ts similarity index 98% rename from x-pack/plugins/files/common/types.ts rename to src/plugins/files/common/types.ts index 53f97962597a..48b05076fe02 100644 --- a/x-pack/plugins/files/common/types.ts +++ b/src/plugins/files/common/types.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import type { SavedObject } from '@kbn/core/server'; import type { Observable } from 'rxjs'; import type { Readable } from 'stream'; diff --git a/x-pack/plugins/files/docs/tutorial.mdx b/src/plugins/files/docs/tutorial.mdx similarity index 99% rename from x-pack/plugins/files/docs/tutorial.mdx rename to src/plugins/files/docs/tutorial.mdx index b3bfed56dd86..deef2de26045 100644 --- a/x-pack/plugins/files/docs/tutorial.mdx +++ b/src/plugins/files/docs/tutorial.mdx @@ -53,7 +53,7 @@ Consumers of the file service are able to decide what metadata they want to asso ### How to set up files for your plugin -All setup examples are based on the [`filesExample` plugin](https://github.com/elastic/kibana/blob/d431e87f7ff43833bff085e5bb5b2ab603bfa05d/x-pack/examples/files_example/README.md). +All setup examples are based on the [`filesExample` plugin](https://github.com/elastic/kibana/blob/d431e87f7ff43833bff085e5bb5b2ab603bfa05d/examples/files_example/README.md). First add the `files` plugin as a required dependency in your `kibana.json`: diff --git a/src/plugins/files/jest.config.js b/src/plugins/files/jest.config.js new file mode 100644 index 000000000000..96e2f529c9ac --- /dev/null +++ b/src/plugins/files/jest.config.js @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/src/plugins/files'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/files', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/files/{common,public,server}/**/*.{js,ts,tsx}'], +}; diff --git a/x-pack/plugins/files/jest.integration.config.js b/src/plugins/files/jest.integration.config.js similarity index 52% rename from x-pack/plugins/files/jest.integration.config.js rename to src/plugins/files/jest.integration.config.js index fbcfd8ed04b6..f0fa0a8ccef4 100644 --- a/x-pack/plugins/files/jest.integration.config.js +++ b/src/plugins/files/jest.integration.config.js @@ -1,12 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ module.exports = { preset: '@kbn/test/jest_integration', rootDir: '../../..', - roots: ['/x-pack/plugins/files'], + roots: ['/src/plugins/files'], }; diff --git a/x-pack/plugins/files/kibana.json b/src/plugins/files/kibana.json similarity index 100% rename from x-pack/plugins/files/kibana.json rename to src/plugins/files/kibana.json diff --git a/x-pack/plugins/files/public/components/context.tsx b/src/plugins/files/public/components/context.tsx similarity index 86% rename from x-pack/plugins/files/public/components/context.tsx rename to src/plugins/files/public/components/context.tsx index a18ea212beff..fbf73999b625 100644 --- a/x-pack/plugins/files/public/components/context.tsx +++ b/src/plugins/files/public/components/context.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { createContext, useContext, type FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx b/src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx similarity index 85% rename from x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx rename to src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx index 8ce3383c7e85..c8a373f70cd5 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/clear_filter_button.tsx +++ b/src/plugins/files/public/components/file_picker/components/clear_filter_button.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import type { FunctionComponent } from 'react'; import useObservable from 'react-use/lib/useObservable'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/error_content.tsx b/src/plugins/files/public/components/file_picker/components/error_content.tsx similarity index 84% rename from x-pack/plugins/files/public/components/file_picker/components/error_content.tsx rename to src/plugins/files/public/components/file_picker/components/error_content.tsx index c2925c793fe6..d37b2ffdc2f4 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/error_content.tsx +++ b/src/plugins/files/public/components/file_picker/components/error_content.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_card.scss b/src/plugins/files/public/components/file_picker/components/file_card.scss similarity index 100% rename from x-pack/plugins/files/public/components/file_picker/components/file_card.scss rename to src/plugins/files/public/components/file_picker/components/file_card.scss diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_card.tsx b/src/plugins/files/public/components/file_picker/components/file_card.tsx similarity index 94% rename from x-pack/plugins/files/public/components/file_picker/components/file_card.tsx rename to src/plugins/files/public/components/file_picker/components/file_card.tsx index 89d8e84c0397..398634bc352d 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/file_card.tsx +++ b/src/plugins/files/public/components/file_picker/components/file_card.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useMemo } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/file_grid.tsx b/src/plugins/files/public/components/file_picker/components/file_grid.tsx similarity index 86% rename from x-pack/plugins/files/public/components/file_picker/components/file_grid.tsx rename to src/plugins/files/public/components/file_picker/components/file_grid.tsx index 2f2a9722d55b..b2d9658e0a07 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/file_grid.tsx +++ b/src/plugins/files/public/components/file_picker/components/file_grid.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx b/src/plugins/files/public/components/file_picker/components/modal_footer.tsx similarity index 91% rename from x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx rename to src/plugins/files/public/components/file_picker/components/modal_footer.tsx index 643efec8abeb..0a9ad3b3dcaf 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/modal_footer.tsx +++ b/src/plugins/files/public/components/file_picker/components/modal_footer.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiModalFooter } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/pagination.tsx b/src/plugins/files/public/components/file_picker/components/pagination.tsx similarity index 84% rename from x-pack/plugins/files/public/components/file_picker/components/pagination.tsx rename to src/plugins/files/public/components/file_picker/components/pagination.tsx index 397a1cda06e4..3384edcab16c 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/pagination.tsx +++ b/src/plugins/files/public/components/file_picker/components/pagination.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/search_field.tsx b/src/plugins/files/public/components/file_picker/components/search_field.tsx similarity index 85% rename from x-pack/plugins/files/public/components/file_picker/components/search_field.tsx rename to src/plugins/files/public/components/file_picker/components/search_field.tsx index bb1fe3580d2b..e1feb83800ab 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/search_field.tsx +++ b/src/plugins/files/public/components/file_picker/components/search_field.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/select_button.tsx b/src/plugins/files/public/components/file_picker/components/select_button.tsx similarity index 85% rename from x-pack/plugins/files/public/components/file_picker/components/select_button.tsx rename to src/plugins/files/public/components/file_picker/components/select_button.tsx index b6f1fa846fa4..c1a1fbdef3b5 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/select_button.tsx +++ b/src/plugins/files/public/components/file_picker/components/select_button.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButton } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/title.tsx b/src/plugins/files/public/components/file_picker/components/title.tsx similarity index 69% rename from x-pack/plugins/files/public/components/file_picker/components/title.tsx rename to src/plugins/files/public/components/file_picker/components/title.tsx index de1015241f65..2d4de8881fa7 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/title.tsx +++ b/src/plugins/files/public/components/file_picker/components/title.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import type { FunctionComponent } from 'react'; import { EuiTitle } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx b/src/plugins/files/public/components/file_picker/components/upload_files.tsx similarity index 86% rename from x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx rename to src/plugins/files/public/components/file_picker/components/upload_files.tsx index 143d20fd63ec..a33f458bdf9d 100644 --- a/x-pack/plugins/files/public/components/file_picker/components/upload_files.tsx +++ b/src/plugins/files/public/components/file_picker/components/upload_files.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/context.tsx b/src/plugins/files/public/components/file_picker/context.tsx similarity index 88% rename from x-pack/plugins/files/public/components/file_picker/context.tsx rename to src/plugins/files/public/components/file_picker/context.tsx index 67e745b74582..48d0ea398625 100644 --- a/x-pack/plugins/files/public/components/file_picker/context.tsx +++ b/src/plugins/files/public/components/file_picker/context.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { createContext, useContext, useMemo, useEffect } from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.scss b/src/plugins/files/public/components/file_picker/file_picker.scss similarity index 100% rename from x-pack/plugins/files/public/components/file_picker/file_picker.scss rename to src/plugins/files/public/components/file_picker/file_picker.scss diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx b/src/plugins/files/public/components/file_picker/file_picker.stories.tsx similarity index 96% rename from x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx rename to src/plugins/files/public/components/file_picker/file_picker.stories.tsx index 9d40b112b406..517663ebbbbb 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.stories.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.stories.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx b/src/plugins/files/public/components/file_picker/file_picker.test.tsx similarity index 95% rename from x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx rename to src/plugins/files/public/components/file_picker/file_picker.test.tsx index b9005c89503f..58c86739755a 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.test.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.test.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; import { act } from 'react-dom/test-utils'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker.tsx b/src/plugins/files/public/components/file_picker/file_picker.tsx similarity index 94% rename from x-pack/plugins/files/public/components/file_picker/file_picker.tsx rename to src/plugins/files/public/components/file_picker/file_picker.tsx index 6c95cd225ae2..9472f87f7b91 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker.tsx +++ b/src/plugins/files/public/components/file_picker/file_picker.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts b/src/plugins/files/public/components/file_picker/file_picker_state.test.ts similarity index 97% rename from x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts rename to src/plugins/files/public/components/file_picker/file_picker_state.test.ts index 3a5adb08a7af..0e7971e60bdc 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker_state.test.ts +++ b/src/plugins/files/public/components/file_picker/file_picker_state.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ jest.mock('rxjs', () => { diff --git a/x-pack/plugins/files/public/components/file_picker/file_picker_state.ts b/src/plugins/files/public/components/file_picker/file_picker_state.ts similarity index 97% rename from x-pack/plugins/files/public/components/file_picker/file_picker_state.ts rename to src/plugins/files/public/components/file_picker/file_picker_state.ts index 708288f9cb4d..42214f77c9cf 100644 --- a/x-pack/plugins/files/public/components/file_picker/file_picker_state.ts +++ b/src/plugins/files/public/components/file_picker/file_picker_state.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { map, tap, diff --git a/src/plugins/files/public/components/file_picker/i18n_texts.ts b/src/plugins/files/public/components/file_picker/i18n_texts.ts new file mode 100644 index 000000000000..0958e99cdffe --- /dev/null +++ b/src/plugins/files/public/components/file_picker/i18n_texts.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; + +export const i18nTexts = { + title: i18n.translate('files.filePicker.title', { + defaultMessage: 'Select a file', + }), + loadingFilesErrorTitle: i18n.translate('files.filePicker.error.loadingTitle', { + defaultMessage: 'Could not load files', + }), + retryButtonLabel: i18n.translate('files.filePicker.error.retryButtonLabel', { + defaultMessage: 'Retry', + }), + emptyStatePrompt: i18n.translate('files.filePicker.emptyStatePrompt', { + defaultMessage: 'No files found', + }), + emptyStatePromptSubtitle: i18n.translate('files.filePicker.emptyStatePromptSubtitle', { + defaultMessage: 'Upload your first file.', + }), + selectFileLabel: i18n.translate('files.filePicker.selectFileButtonLable', { + defaultMessage: 'Select file', + }), + selectFilesLabel: (nrOfFiles: number) => + i18n.translate('files.filePicker.selectFilesButtonLable', { + defaultMessage: 'Select {nrOfFiles} files', + values: { nrOfFiles }, + }), + searchFieldPlaceholder: i18n.translate('files.filePicker.searchFieldPlaceholder', { + defaultMessage: 'my-file-*', + }), + emptyFileGridPrompt: i18n.translate('files.filePicker.emptyGridPrompt', { + defaultMessage: 'No files matched filter', + }), + loadMoreButtonLabel: i18n.translate('files.filePicker.loadMoreButtonLabel', { + defaultMessage: 'Load more', + }), + clearFilterButton: i18n.translate('files.filePicker.clearFilterButtonLabel', { + defaultMessage: 'Clear filter', + }), + uploadFilePlaceholderText: i18n.translate('files.filePicker.uploadFilePlaceholderText', { + defaultMessage: 'Drag and drop to upload new files', + }), +}; diff --git a/x-pack/plugins/files/public/components/file_picker/index.tsx b/src/plugins/files/public/components/file_picker/index.tsx similarity index 75% rename from x-pack/plugins/files/public/components/file_picker/index.tsx rename to src/plugins/files/public/components/file_picker/index.tsx index 47c892ef1cad..9ec6b9f77803 100644 --- a/x-pack/plugins/files/public/components/file_picker/index.tsx +++ b/src/plugins/files/public/components/file_picker/index.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { lazy, Suspense } from 'react'; diff --git a/x-pack/plugins/files/public/components/image/components/blurhash.tsx b/src/plugins/files/public/components/image/components/blurhash.tsx similarity index 89% rename from x-pack/plugins/files/public/components/image/components/blurhash.tsx rename to src/plugins/files/public/components/image/components/blurhash.tsx index 62dfb8b1f075..7a931e91ddae 100644 --- a/x-pack/plugins/files/public/components/image/components/blurhash.tsx +++ b/src/plugins/files/public/components/image/components/blurhash.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { decode } from 'blurhash'; import React, { useRef, useEffect } from 'react'; import type { FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/image/components/img.tsx b/src/plugins/files/public/components/image/components/img.tsx similarity index 89% rename from x-pack/plugins/files/public/components/image/components/img.tsx rename to src/plugins/files/public/components/image/components/img.tsx index 25f45eec22f6..855d4547058a 100644 --- a/x-pack/plugins/files/public/components/image/components/img.tsx +++ b/src/plugins/files/public/components/image/components/img.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import type { ImgHTMLAttributes, MutableRefObject } from 'react'; import type { EuiImageSize } from '@elastic/eui/src/components/image/image_types'; diff --git a/x-pack/plugins/files/public/components/image/components/index.ts b/src/plugins/files/public/components/image/components/index.ts similarity index 59% rename from x-pack/plugins/files/public/components/image/components/index.ts rename to src/plugins/files/public/components/image/components/index.ts index 7fee8f7fd63f..bae3c92eab51 100644 --- a/x-pack/plugins/files/public/components/image/components/index.ts +++ b/src/plugins/files/public/components/image/components/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { Img } from './img'; diff --git a/x-pack/plugins/files/public/components/image/image.constants.stories.tsx b/src/plugins/files/public/components/image/image.constants.stories.tsx similarity index 97% rename from x-pack/plugins/files/public/components/image/image.constants.stories.tsx rename to src/plugins/files/public/components/image/image.constants.stories.tsx index cc5ff23cd281..b9b3a5c3831c 100644 --- a/x-pack/plugins/files/public/components/image/image.constants.stories.tsx +++ b/src/plugins/files/public/components/image/image.constants.stories.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export function getImageData(): Blob { diff --git a/x-pack/plugins/files/public/components/image/image.stories.tsx b/src/plugins/files/public/components/image/image.stories.tsx similarity index 92% rename from x-pack/plugins/files/public/components/image/image.stories.tsx rename to src/plugins/files/public/components/image/image.stories.tsx index ff8825485f9c..d26a74470bdc 100644 --- a/x-pack/plugins/files/public/components/image/image.stories.tsx +++ b/src/plugins/files/public/components/image/image.stories.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { ComponentStory, ComponentMeta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/image/image.tsx b/src/plugins/files/public/components/image/image.tsx similarity index 93% rename from x-pack/plugins/files/public/components/image/image.tsx rename to src/plugins/files/public/components/image/image.tsx index 0b6c9d48fa81..e2cb78d910e3 100644 --- a/x-pack/plugins/files/public/components/image/image.tsx +++ b/src/plugins/files/public/components/image/image.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React, { HTMLAttributes } from 'react'; import { type ImgHTMLAttributes, useState, useEffect } from 'react'; import { css } from '@emotion/react'; diff --git a/x-pack/plugins/files/public/components/image/index.ts b/src/plugins/files/public/components/image/index.ts similarity index 57% rename from x-pack/plugins/files/public/components/image/index.ts rename to src/plugins/files/public/components/image/index.ts index 05ffe3dd1c4e..2e7825acc126 100644 --- a/x-pack/plugins/files/public/components/image/index.ts +++ b/src/plugins/files/public/components/image/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { Image } from './image'; diff --git a/x-pack/plugins/files/public/components/image/styles.ts b/src/plugins/files/public/components/image/styles.ts similarity index 72% rename from x-pack/plugins/files/public/components/image/styles.ts rename to src/plugins/files/public/components/image/styles.ts index b14121c667a5..d69580bcb51a 100644 --- a/x-pack/plugins/files/public/components/image/styles.ts +++ b/src/plugins/files/public/components/image/styles.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { css } from '@emotion/react'; diff --git a/x-pack/plugins/files/public/components/image/use_viewport_observer.ts b/src/plugins/files/public/components/image/use_viewport_observer.ts similarity index 85% rename from x-pack/plugins/files/public/components/image/use_viewport_observer.ts rename to src/plugins/files/public/components/image/use_viewport_observer.ts index c1951b4448de..6e43cc9d124f 100644 --- a/x-pack/plugins/files/public/components/image/use_viewport_observer.ts +++ b/src/plugins/files/public/components/image/use_viewport_observer.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { useCallback, useEffect, useRef, useState } from 'react'; diff --git a/x-pack/plugins/files/public/components/image/viewport_observer.test.ts b/src/plugins/files/public/components/image/viewport_observer.test.ts similarity index 92% rename from x-pack/plugins/files/public/components/image/viewport_observer.test.ts rename to src/plugins/files/public/components/image/viewport_observer.test.ts index 5e5ebd3d4202..f5dafb25fc72 100644 --- a/x-pack/plugins/files/public/components/image/viewport_observer.test.ts +++ b/src/plugins/files/public/components/image/viewport_observer.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { TestScheduler } from 'rxjs/testing'; import { ViewportObserver } from './viewport_observer'; diff --git a/x-pack/plugins/files/public/components/image/viewport_observer.ts b/src/plugins/files/public/components/image/viewport_observer.ts similarity index 89% rename from x-pack/plugins/files/public/components/image/viewport_observer.ts rename to src/plugins/files/public/components/image/viewport_observer.ts index c0efe3d09559..165af5aecb98 100644 --- a/x-pack/plugins/files/public/components/image/viewport_observer.ts +++ b/src/plugins/files/public/components/image/viewport_observer.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { once } from 'lodash'; import { Observable, ReplaySubject } from 'rxjs'; import { take } from 'rxjs/operators'; diff --git a/x-pack/plugins/files/public/components/index.ts b/src/plugins/files/public/components/index.ts similarity index 67% rename from x-pack/plugins/files/public/components/index.ts rename to src/plugins/files/public/components/index.ts index c5ab1382b4df..e4470d4a58be 100644 --- a/x-pack/plugins/files/public/components/index.ts +++ b/src/plugins/files/public/components/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { Image, type ImageProps } from './image'; diff --git a/x-pack/plugins/files/public/components/stories_shared.ts b/src/plugins/files/public/components/stories_shared.ts similarity index 77% rename from x-pack/plugins/files/public/components/stories_shared.ts rename to src/plugins/files/public/components/stories_shared.ts index a82ec3295b1d..f20058ea0f58 100644 --- a/x-pack/plugins/files/public/components/stories_shared.ts +++ b/src/plugins/files/public/components/stories_shared.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FileKind } from '../../common'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx b/src/plugins/files/public/components/upload_file/components/cancel_button.tsx similarity index 86% rename from x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx rename to src/plugins/files/public/components/upload_file/components/cancel_button.tsx index b71a6221f3b2..4bf6aead0912 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/cancel_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/cancel_button.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButton, EuiButtonIcon } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx b/src/plugins/files/public/components/upload_file/components/clear_button.tsx similarity index 76% rename from x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx rename to src/plugins/files/public/components/upload_file/components/clear_button.tsx index 929fe0dcc65b..09733a9c5876 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/clear_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/clear_button.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButtonEmpty } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/control_button.tsx b/src/plugins/files/public/components/upload_file/components/control_button.tsx similarity index 86% rename from x-pack/plugins/files/public/components/upload_file/components/control_button.tsx rename to src/plugins/files/public/components/upload_file/components/control_button.tsx index 351cf2c39edd..c52d72545e04 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/control_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/control_button.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FunctionComponent } from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/index.ts b/src/plugins/files/public/components/upload_file/components/index.ts similarity index 58% rename from x-pack/plugins/files/public/components/upload_file/components/index.ts rename to src/plugins/files/public/components/upload_file/components/index.ts index fbc7ffd8eda7..427af9af2cc4 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/index.ts +++ b/src/plugins/files/public/components/upload_file/components/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { ControlButton } from './control_button'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx b/src/plugins/files/public/components/upload_file/components/retry_button.tsx similarity index 81% rename from x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx rename to src/plugins/files/public/components/upload_file/components/retry_button.tsx index 355495aa25c1..273515331b3c 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/retry_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/retry_button.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { EuiButton } from '@elastic/eui'; import type { FunctionComponent } from 'react'; import React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx b/src/plugins/files/public/components/upload_file/components/upload_button.tsx similarity index 87% rename from x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx rename to src/plugins/files/public/components/upload_file/components/upload_button.tsx index ff6320ab0b95..2bd024ad2e1a 100644 --- a/x-pack/plugins/files/public/components/upload_file/components/upload_button.tsx +++ b/src/plugins/files/public/components/upload_file/components/upload_button.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButton } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/context.ts b/src/plugins/files/public/components/upload_file/context.ts similarity index 66% rename from x-pack/plugins/files/public/components/upload_file/context.ts rename to src/plugins/files/public/components/upload_file/context.ts index e88f5d244148..187639cb3dda 100644 --- a/x-pack/plugins/files/public/components/upload_file/context.ts +++ b/src/plugins/files/public/components/upload_file/context.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import type { UploadState } from './upload_state'; diff --git a/src/plugins/files/public/components/upload_file/i18n_texts.ts b/src/plugins/files/public/components/upload_file/i18n_texts.ts new file mode 100644 index 000000000000..19ac5b3e0a67 --- /dev/null +++ b/src/plugins/files/public/components/upload_file/i18n_texts.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; + +export const i18nTexts = { + defaultPickerLabel: i18n.translate('files.uploadFile.defaultFilePickerLabel', { + defaultMessage: 'Upload a file', + }), + upload: i18n.translate('files.uploadFile.uploadButtonLabel', { + defaultMessage: 'Upload', + }), + uploading: i18n.translate('files.uploadFile.uploadingButtonLabel', { + defaultMessage: 'Uploading', + }), + uploadComplete: i18n.translate('files.uploadFile.uploadCompleteButtonLabel', { + defaultMessage: 'Upload complete', + }), + retry: i18n.translate('files.uploadFile.retryButtonLabel', { + defaultMessage: 'Retry', + }), + clear: i18n.translate('files.uploadFile.clearButtonLabel', { + defaultMessage: 'Clear', + }), + cancel: i18n.translate('files.uploadFile.cancelButtonLabel', { + defaultMessage: 'Cancel', + }), + uploadDone: i18n.translate('files.uploadFile.uploadDoneToolTipContent', { + defaultMessage: 'Your file was successfully uploaded!', + }), + fileTooLarge: (expectedSize: string) => + i18n.translate('files.uploadFile.fileTooLargeErrorMessage', { + defaultMessage: + 'File is too large. Maximum size is {expectedSize, plural, one {# byte} other {# bytes} }.', + values: { expectedSize }, + }), +}; diff --git a/x-pack/plugins/files/public/components/upload_file/index.tsx b/src/plugins/files/public/components/upload_file/index.tsx similarity index 76% rename from x-pack/plugins/files/public/components/upload_file/index.tsx rename to src/plugins/files/public/components/upload_file/index.tsx index 8e9e89c33c79..83aae0a111b4 100644 --- a/x-pack/plugins/files/public/components/upload_file/index.tsx +++ b/src/plugins/files/public/components/upload_file/index.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { lazy, Suspense } from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx b/src/plugins/files/public/components/upload_file/upload_file.component.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx rename to src/plugins/files/public/components/upload_file/upload_file.component.tsx index 8c81ae3fdcb2..92e3cb85cb39 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.component.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.component.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx b/src/plugins/files/public/components/upload_file/upload_file.stories.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx rename to src/plugins/files/public/components/upload_file/upload_file.stories.tsx index 635400223fc1..2a07b8b8f5db 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.stories.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.stories.tsx @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import React from 'react'; import { ComponentMeta, ComponentStory } from '@storybook/react'; import { action } from '@storybook/addon-actions'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx b/src/plugins/files/public/components/upload_file/upload_file.test.tsx similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx rename to src/plugins/files/public/components/upload_file/upload_file.test.tsx index 7682b085eb06..a8230094ccd7 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.test.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.test.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_file.tsx b/src/plugins/files/public/components/upload_file/upload_file.tsx similarity index 95% rename from x-pack/plugins/files/public/components/upload_file/upload_file.tsx rename to src/plugins/files/public/components/upload_file/upload_file.tsx index ae23739afbf2..0d468c299115 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_file.tsx +++ b/src/plugins/files/public/components/upload_file/upload_file.tsx @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiFilePicker } from '@elastic/eui'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_state.test.ts b/src/plugins/files/public/components/upload_file/upload_state.test.ts similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_state.test.ts rename to src/plugins/files/public/components/upload_file/upload_state.test.ts index a834103a2c9c..7a73009c35c4 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_state.test.ts +++ b/src/plugins/files/public/components/upload_file/upload_state.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { DeeplyMockedKeys } from '@kbn/utility-types-jest'; diff --git a/x-pack/plugins/files/public/components/upload_file/upload_state.ts b/src/plugins/files/public/components/upload_file/upload_state.ts similarity index 97% rename from x-pack/plugins/files/public/components/upload_file/upload_state.ts rename to src/plugins/files/public/components/upload_file/upload_state.ts index 061f65115c79..d9331c18868a 100644 --- a/x-pack/plugins/files/public/components/upload_file/upload_state.ts +++ b/src/plugins/files/public/components/upload_file/upload_state.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { diff --git a/x-pack/plugins/files/public/components/upload_file/util/index.ts b/src/plugins/files/public/components/upload_file/util/index.ts similarity index 61% rename from x-pack/plugins/files/public/components/upload_file/util/index.ts rename to src/plugins/files/public/components/upload_file/util/index.ts index e8fbb4e1eced..18bdee6fcffe 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/index.ts +++ b/src/plugins/files/public/components/upload_file/util/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { SimpleStateSubject, createStateSubject } from './simple_state_subject'; diff --git a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts b/src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts similarity index 82% rename from x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts rename to src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts index bfe27b50a9f4..76d342a70cf7 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.test.ts +++ b/src/plugins/files/public/components/upload_file/util/parse_file_name.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { parseFileName } from './parse_file_name'; diff --git a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts b/src/plugins/files/public/components/upload_file/util/parse_file_name.ts similarity index 71% rename from x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts rename to src/plugins/files/public/components/upload_file/util/parse_file_name.ts index 485b3013631d..aaa7b9a759f7 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/parse_file_name.ts +++ b/src/plugins/files/public/components/upload_file/util/parse_file_name.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ interface Result { diff --git a/x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts b/src/plugins/files/public/components/upload_file/util/simple_state_subject.ts similarity index 78% rename from x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts rename to src/plugins/files/public/components/upload_file/util/simple_state_subject.ts index a55259b4962e..b5cc19a9ea3e 100644 --- a/x-pack/plugins/files/public/components/upload_file/util/simple_state_subject.ts +++ b/src/plugins/files/public/components/upload_file/util/simple_state_subject.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { merge } from 'lodash'; diff --git a/x-pack/plugins/files/public/components/use_behavior_subject.ts b/src/plugins/files/public/components/use_behavior_subject.ts similarity index 66% rename from x-pack/plugins/files/public/components/use_behavior_subject.ts rename to src/plugins/files/public/components/use_behavior_subject.ts index f68ae6faef28..441a14667df1 100644 --- a/x-pack/plugins/files/public/components/use_behavior_subject.ts +++ b/src/plugins/files/public/components/use_behavior_subject.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { BehaviorSubject } from 'rxjs'; diff --git a/x-pack/plugins/files/public/components/util/image_metadata.test.ts b/src/plugins/files/public/components/util/image_metadata.test.ts similarity index 86% rename from x-pack/plugins/files/public/components/util/image_metadata.test.ts rename to src/plugins/files/public/components/util/image_metadata.test.ts index 16980aee0029..de4cba5c82dc 100644 --- a/x-pack/plugins/files/public/components/util/image_metadata.test.ts +++ b/src/plugins/files/public/components/util/image_metadata.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { fitToBox } from './image_metadata'; describe('util', () => { describe('fitToBox', () => { diff --git a/x-pack/plugins/files/public/components/util/image_metadata.ts b/src/plugins/files/public/components/util/image_metadata.ts similarity index 92% rename from x-pack/plugins/files/public/components/util/image_metadata.ts rename to src/plugins/files/public/components/util/image_metadata.ts index 9c6e74f4c010..75a42efed585 100644 --- a/x-pack/plugins/files/public/components/util/image_metadata.ts +++ b/src/plugins/files/public/components/util/image_metadata.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import * as bh from 'blurhash'; diff --git a/x-pack/plugins/files/public/components/util/index.ts b/src/plugins/files/public/components/util/index.ts similarity index 61% rename from x-pack/plugins/files/public/components/util/index.ts rename to src/plugins/files/public/components/util/index.ts index e3e30fdb17bb..5c25ffd636a5 100644 --- a/x-pack/plugins/files/public/components/util/index.ts +++ b/src/plugins/files/public/components/util/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { getImageMetadata, isImage, fitToBox } from './image_metadata'; diff --git a/x-pack/plugins/files/public/files_client/files_client.test.ts b/src/plugins/files/public/files_client/files_client.test.ts similarity index 89% rename from x-pack/plugins/files/public/files_client/files_client.test.ts rename to src/plugins/files/public/files_client/files_client.test.ts index 63bed16c07ea..caef61d23111 100644 --- a/x-pack/plugins/files/public/files_client/files_client.test.ts +++ b/src/plugins/files/public/files_client/files_client.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { apiRoutes } from './files_client'; diff --git a/x-pack/plugins/files/public/files_client/files_client.ts b/src/plugins/files/public/files_client/files_client.ts similarity index 96% rename from x-pack/plugins/files/public/files_client/files_client.ts rename to src/plugins/files/public/files_client/files_client.ts index f92b2c91d279..86a2c1c92957 100644 --- a/x-pack/plugins/files/public/files_client/files_client.ts +++ b/src/plugins/files/public/files_client/files_client.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { HttpStart } from '@kbn/core/public'; diff --git a/x-pack/plugins/files/public/files_client/index.ts b/src/plugins/files/public/files_client/index.ts similarity index 53% rename from x-pack/plugins/files/public/files_client/index.ts rename to src/plugins/files/public/files_client/index.ts index 60f3022e825d..cc493c053e61 100644 --- a/x-pack/plugins/files/public/files_client/index.ts +++ b/src/plugins/files/public/files_client/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { createFilesClient } from './files_client'; diff --git a/x-pack/plugins/files/public/index.ts b/src/plugins/files/public/index.ts similarity index 75% rename from x-pack/plugins/files/public/index.ts rename to src/plugins/files/public/index.ts index a9bd88615ff1..5822efb65573 100644 --- a/x-pack/plugins/files/public/index.ts +++ b/src/plugins/files/public/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FilesPlugin } from './plugin'; diff --git a/x-pack/plugins/files/public/mocks.ts b/src/plugins/files/public/mocks.ts similarity index 80% rename from x-pack/plugins/files/public/mocks.ts rename to src/plugins/files/public/mocks.ts index c34438d096a2..c19843f3f098 100644 --- a/x-pack/plugins/files/public/mocks.ts +++ b/src/plugins/files/public/mocks.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; diff --git a/x-pack/plugins/files/public/plugin.ts b/src/plugins/files/public/plugin.ts similarity index 91% rename from x-pack/plugins/files/public/plugin.ts rename to src/plugins/files/public/plugin.ts index 2f5481f8f251..a91b565d2a54 100644 --- a/x-pack/plugins/files/public/plugin.ts +++ b/src/plugins/files/public/plugin.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; diff --git a/x-pack/plugins/files/public/types.ts b/src/plugins/files/public/types.ts similarity index 96% rename from x-pack/plugins/files/public/types.ts rename to src/plugins/files/public/types.ts index fcc5c11b1ae4..eb5d28a02f6d 100644 --- a/x-pack/plugins/files/public/types.ts +++ b/src/plugins/files/public/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FileJSON } from '../common'; diff --git a/x-pack/plugins/files/server/audit_events.ts b/src/plugins/files/server/audit_events.ts similarity index 79% rename from x-pack/plugins/files/server/audit_events.ts rename to src/plugins/files/server/audit_events.ts index ab5d33a65b76..aea5b6b199fd 100644 --- a/x-pack/plugins/files/server/audit_events.ts +++ b/src/plugins/files/server/audit_events.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EcsEventOutcome } from '@kbn/logging'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/README.md b/src/plugins/files/server/blob_storage_service/adapters/README.md similarity index 100% rename from x-pack/plugins/files/server/blob_storage_service/adapters/README.md rename to src/plugins/files/server/blob_storage_service/adapters/README.md diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts similarity index 98% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts index 56f61e83e47f..48410081da3f 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts similarity index 98% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts index 746c66798b5e..b4b34b5cca83 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import cuid from 'cuid'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts similarity index 69% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts index a31e0c8b672d..e3a21c52f3f0 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts similarity index 91% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts index 9d1ddda73971..bc2cbe0870d5 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/es.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { Readable } from 'stream'; import { promisify } from 'util'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts b/src/plugins/files/server/blob_storage_service/adapters/es/es.ts similarity index 96% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/es.ts index 96421a06e95c..2bf582e18d32 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/es.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/es.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import assert from 'assert'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts b/src/plugins/files/server/blob_storage_service/adapters/es/index.ts similarity index 56% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/index.ts index 75ac82acb66d..c0c37cd4c287 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/index.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts similarity index 96% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts index 8bcc8c503bb4..8e5b7d63218e 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/integration_tests/es.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import sinon from 'sinon'; diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts b/src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts similarity index 86% rename from x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts rename to src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts index dbcd57a06ba1..6f7f99d81819 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/es/mappings.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/es/mappings.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { diff --git a/x-pack/plugins/files/server/blob_storage_service/adapters/index.ts b/src/plugins/files/server/blob_storage_service/adapters/index.ts similarity index 56% rename from x-pack/plugins/files/server/blob_storage_service/adapters/index.ts rename to src/plugins/files/server/blob_storage_service/adapters/index.ts index 75ac82acb66d..c0c37cd4c287 100644 --- a/x-pack/plugins/files/server/blob_storage_service/adapters/index.ts +++ b/src/plugins/files/server/blob_storage_service/adapters/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { ElasticsearchBlobStorageClient, MAX_BLOB_STORE_SIZE_BYTES } from './es'; diff --git a/x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts b/src/plugins/files/server/blob_storage_service/blob_storage_service.ts similarity index 88% rename from x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts rename to src/plugins/files/server/blob_storage_service/blob_storage_service.ts index ecd2c6e3d3da..0cc4ba81997b 100644 --- a/x-pack/plugins/files/server/blob_storage_service/blob_storage_service.ts +++ b/src/plugins/files/server/blob_storage_service/blob_storage_service.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { BlobStorageSettings, ES_FIXED_SIZE_INDEX_BLOB_STORE } from '../../common'; import { BlobStorageClient } from './types'; diff --git a/x-pack/plugins/files/server/blob_storage_service/index.ts b/src/plugins/files/server/blob_storage_service/index.ts similarity index 65% rename from x-pack/plugins/files/server/blob_storage_service/index.ts rename to src/plugins/files/server/blob_storage_service/index.ts index fd8d4e190c09..4b1d0ec29a2d 100644 --- a/x-pack/plugins/files/server/blob_storage_service/index.ts +++ b/src/plugins/files/server/blob_storage_service/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { BlobStorageService } from './blob_storage_service'; diff --git a/x-pack/plugins/files/server/blob_storage_service/types.ts b/src/plugins/files/server/blob_storage_service/types.ts similarity index 90% rename from x-pack/plugins/files/server/blob_storage_service/types.ts rename to src/plugins/files/server/blob_storage_service/types.ts index 6a5c40708a97..7ced9ec9df70 100644 --- a/x-pack/plugins/files/server/blob_storage_service/types.ts +++ b/src/plugins/files/server/blob_storage_service/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { JsonValue } from '@kbn/utility-types'; diff --git a/x-pack/plugins/files/server/feature.ts b/src/plugins/files/server/feature.ts similarity index 77% rename from x-pack/plugins/files/server/feature.ts rename to src/plugins/files/server/feature.ts index 1685e95cc9fa..81ba7978e49f 100644 --- a/x-pack/plugins/files/server/feature.ts +++ b/src/plugins/files/server/feature.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { DEFAULT_APP_CATEGORIES } from '@kbn/core-application-common'; @@ -15,14 +16,14 @@ import { hiddenTypes } from './saved_objects'; // TODO: This should be registered once we have a management section for files content export const filesFeature: KibanaFeatureConfig = { id: PLUGIN_ID, - name: i18n.translate('xpack.files.featureRegistry.filesFeatureName', { + name: i18n.translate('files.featureRegistry.filesFeatureName', { defaultMessage: 'Files', }), minimumLicense: 'basic', order: 10000, category: DEFAULT_APP_CATEGORIES.management, app: [PLUGIN_ID], - privilegesTooltip: i18n.translate('xpack.files.featureRegistry.filesPrivilegesTooltip', { + privilegesTooltip: i18n.translate('files.featureRegistry.filesPrivilegesTooltip', { defaultMessage: 'Provide access to files across all apps', }), privileges: { diff --git a/x-pack/plugins/files/server/file/errors.ts b/src/plugins/files/server/file/errors.ts similarity index 76% rename from x-pack/plugins/files/server/file/errors.ts rename to src/plugins/files/server/file/errors.ts index 34ce179555ff..db504adf79d2 100644 --- a/x-pack/plugins/files/server/file/errors.ts +++ b/src/plugins/files/server/file/errors.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ /* eslint-disable max-classes-per-file */ diff --git a/x-pack/plugins/files/server/file/file.test.ts b/src/plugins/files/server/file/file.test.ts similarity index 95% rename from x-pack/plugins/files/server/file/file.test.ts rename to src/plugins/files/server/file/file.test.ts index b2e9167c685b..b42a360682cf 100644 --- a/x-pack/plugins/files/server/file/file.test.ts +++ b/src/plugins/files/server/file/file.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { of } from 'rxjs'; import type { ElasticsearchClient, ISavedObjectsRepository } from '@kbn/core/server'; import { createSandbox } from 'sinon'; diff --git a/x-pack/plugins/files/server/file/file.ts b/src/plugins/files/server/file/file.ts similarity index 96% rename from x-pack/plugins/files/server/file/file.ts rename to src/plugins/files/server/file/file.ts index c1b9d8ad12fd..d8f246d86488 100644 --- a/x-pack/plugins/files/server/file/file.ts +++ b/src/plugins/files/server/file/file.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/file/file_attributes_reducer.ts b/src/plugins/files/server/file/file_attributes_reducer.ts similarity index 86% rename from x-pack/plugins/files/server/file/file_attributes_reducer.ts rename to src/plugins/files/server/file/file_attributes_reducer.ts index fdb2768408af..1a035c32e124 100644 --- a/x-pack/plugins/files/server/file/file_attributes_reducer.ts +++ b/src/plugins/files/server/file/file_attributes_reducer.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { FileJSON, UpdatableFileMetadata } from '../../common'; export type Action = diff --git a/x-pack/plugins/files/server/file/index.ts b/src/plugins/files/server/file/index.ts similarity index 69% rename from x-pack/plugins/files/server/file/index.ts rename to src/plugins/files/server/file/index.ts index 2b584945cb71..3aa670935664 100644 --- a/x-pack/plugins/files/server/file/index.ts +++ b/src/plugins/files/server/file/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import * as fileErrors from './errors'; diff --git a/x-pack/plugins/files/server/file/to_json.ts b/src/plugins/files/server/file/to_json.ts similarity index 86% rename from x-pack/plugins/files/server/file/to_json.ts rename to src/plugins/files/server/file/to_json.ts index 98096940fe75..d1cb00277549 100644 --- a/x-pack/plugins/files/server/file/to_json.ts +++ b/src/plugins/files/server/file/to_json.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { pickBy } from 'lodash'; diff --git a/x-pack/plugins/files/server/file_client/create_es_file_client.ts b/src/plugins/files/server/file_client/create_es_file_client.ts similarity index 90% rename from x-pack/plugins/files/server/file_client/create_es_file_client.ts rename to src/plugins/files/server/file_client/create_es_file_client.ts index 9f453a6a25bf..1fb14b1fdfbb 100644 --- a/x-pack/plugins/files/server/file_client/create_es_file_client.ts +++ b/src/plugins/files/server/file_client/create_es_file_client.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { Logger, ElasticsearchClient } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/file_client/file_client.ts b/src/plugins/files/server/file_client/file_client.ts similarity index 97% rename from x-pack/plugins/files/server/file_client/file_client.ts rename to src/plugins/files/server/file_client/file_client.ts index 6954ac9c635d..4e49bc1e1d69 100644 --- a/x-pack/plugins/files/server/file_client/file_client.ts +++ b/src/plugins/files/server/file_client/file_client.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import moment from 'moment'; import { Readable } from 'stream'; import mimeType from 'mime'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts similarity index 95% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts index dcfe39e11207..8e78c471dde2 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/es_index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { once } from 'lodash'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts similarity index 60% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts index 9e7273b685f8..965cbe0fa190 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/index.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { SavedObjectsFileMetadataClient } from './saved_objects'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts similarity index 91% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts index e5c49b8f12b9..14e757fae691 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/query_filters.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { pipe, forEach } from 'lodash/fp'; import { escapeKuery, KueryNode, nodeBuilder, nodeTypes } from '@kbn/es-query'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts b/src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts similarity index 95% rename from x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts rename to src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts index b1a43a05bfb7..f0f547bb4704 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/adapters/saved_objects.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { reduce } from 'lodash'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts b/src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts similarity index 93% rename from x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts rename to src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts index 5136fc9744d5..2738d75d8222 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { ES_FIXED_SIZE_INDEX_BLOB_STORE } from '../../../common/constants'; diff --git a/x-pack/plugins/files/server/file_client/file_metadata_client/index.ts b/src/plugins/files/server/file_client/file_metadata_client/index.ts similarity index 72% rename from x-pack/plugins/files/server/file_client/file_metadata_client/index.ts rename to src/plugins/files/server/file_client/file_metadata_client/index.ts index 690a6b472b00..97948a5ebee3 100644 --- a/x-pack/plugins/files/server/file_client/file_metadata_client/index.ts +++ b/src/plugins/files/server/file_client/file_metadata_client/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export type { diff --git a/x-pack/plugins/files/server/file_client/index.ts b/src/plugins/files/server/file_client/index.ts similarity index 81% rename from x-pack/plugins/files/server/file_client/index.ts rename to src/plugins/files/server/file_client/index.ts index 46eec400b77b..f034f67ec9c6 100644 --- a/x-pack/plugins/files/server/file_client/index.ts +++ b/src/plugins/files/server/file_client/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { EsIndexFilesMetadataClient, SavedObjectsFileMetadataClient } from './file_metadata_client'; diff --git a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts b/src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts similarity index 96% rename from x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts rename to src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts index 0ae1b9c7d29f..c9d78cb33ac1 100644 --- a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts +++ b/src/plugins/files/server/file_client/integration_tests/es_file_client.test.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { Readable } from 'stream'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { TestEnvironmentUtils, setupIntegrationEnvironment } from '../../test_utils'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/index.ts b/src/plugins/files/server/file_client/stream_transforms/index.ts similarity index 55% rename from x-pack/plugins/files/server/file_client/stream_transforms/index.ts rename to src/plugins/files/server/file_client/stream_transforms/index.ts index b3a82e897a02..a89ef117795a 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/index.ts +++ b/src/plugins/files/server/file_client/stream_transforms/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts similarity index 65% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts index 3b2c236e8a28..8c846f9bde10 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/errors.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export class MaxByteSizeExceededError extends Error { diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts similarity index 55% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts index b3a82e897a02..a89ef117795a 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { enforceMaxByteSizeTransform } from './max_byte_size_transform'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts similarity index 87% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts index 9697624edb47..0b9ca5fe8a45 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Readable, Writable, pipeline } from 'stream'; diff --git a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts similarity index 79% rename from x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts rename to src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts index c2634bcbf8fe..a94f9858a996 100644 --- a/x-pack/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts +++ b/src/plugins/files/server/file_client/stream_transforms/max_byte_size_transform/max_byte_size_transform.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Transform } from 'stream'; diff --git a/x-pack/plugins/files/server/file_client/types.ts b/src/plugins/files/server/file_client/types.ts similarity index 94% rename from x-pack/plugins/files/server/file_client/types.ts rename to src/plugins/files/server/file_client/types.ts index 19a50f7249fa..5f991f0bbceb 100644 --- a/x-pack/plugins/files/server/file_client/types.ts +++ b/src/plugins/files/server/file_client/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { File, FileShareJSONWithToken, UpdatableFileMetadata } from '../../common/types'; diff --git a/x-pack/plugins/files/server/file_client/utils.ts b/src/plugins/files/server/file_client/utils.ts similarity index 71% rename from x-pack/plugins/files/server/file_client/utils.ts rename to src/plugins/files/server/file_client/utils.ts index b8b51117e8ac..88e0901680f0 100644 --- a/x-pack/plugins/files/server/file_client/utils.ts +++ b/src/plugins/files/server/file_client/utils.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FileMetadata } from '../../common'; diff --git a/x-pack/plugins/files/server/file_service/errors.ts b/src/plugins/files/server/file_service/errors.ts similarity index 61% rename from x-pack/plugins/files/server/file_service/errors.ts rename to src/plugins/files/server/file_service/errors.ts index 905f26cf8fe1..67bd93e0c782 100644 --- a/x-pack/plugins/files/server/file_service/errors.ts +++ b/src/plugins/files/server/file_service/errors.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export class FileNotFoundError extends Error { diff --git a/x-pack/plugins/files/server/file_service/file_action_types.ts b/src/plugins/files/server/file_service/file_action_types.ts similarity index 91% rename from x-pack/plugins/files/server/file_service/file_action_types.ts rename to src/plugins/files/server/file_service/file_action_types.ts index f0242cb523d4..dfe5ed2f0ba9 100644 --- a/x-pack/plugins/files/server/file_service/file_action_types.ts +++ b/src/plugins/files/server/file_service/file_action_types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { Pagination, UpdatableFileMetadata } from '../../common/types'; diff --git a/x-pack/plugins/files/server/file_service/file_service.ts b/src/plugins/files/server/file_service/file_service.ts similarity index 92% rename from x-pack/plugins/files/server/file_service/file_service.ts rename to src/plugins/files/server/file_service/file_service.ts index e48b0a6ea38c..9dc1b0769ced 100644 --- a/x-pack/plugins/files/server/file_service/file_service.ts +++ b/src/plugins/files/server/file_service/file_service.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FilesMetrics, File, FileJSON } from '../../common'; diff --git a/x-pack/plugins/files/server/file_service/file_service_factory.ts b/src/plugins/files/server/file_service/file_service_factory.ts similarity index 96% rename from x-pack/plugins/files/server/file_service/file_service_factory.ts rename to src/plugins/files/server/file_service/file_service_factory.ts index 393777c9a9ab..50ceafb6fc24 100644 --- a/x-pack/plugins/files/server/file_service/file_service_factory.ts +++ b/src/plugins/files/server/file_service/file_service_factory.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { diff --git a/x-pack/plugins/files/server/file_service/index.ts b/src/plugins/files/server/file_service/index.ts similarity index 71% rename from x-pack/plugins/files/server/file_service/index.ts rename to src/plugins/files/server/file_service/index.ts index 457e5f3d4dfb..5d332a51d3a5 100644 --- a/x-pack/plugins/files/server/file_service/index.ts +++ b/src/plugins/files/server/file_service/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { FileServiceFactoryImpl as FileServiceFactory } from './file_service_factory'; diff --git a/x-pack/plugins/files/server/file_service/internal_file_service.ts b/src/plugins/files/server/file_service/internal_file_service.ts similarity index 95% rename from x-pack/plugins/files/server/file_service/internal_file_service.ts rename to src/plugins/files/server/file_service/internal_file_service.ts index 7768237e9fd5..7f6922a3842d 100644 --- a/x-pack/plugins/files/server/file_service/internal_file_service.ts +++ b/src/plugins/files/server/file_service/internal_file_service.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Logger, SavedObjectsErrorHelpers } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/file_share_service/errors.ts b/src/plugins/files/server/file_share_service/errors.ts similarity index 74% rename from x-pack/plugins/files/server/file_share_service/errors.ts rename to src/plugins/files/server/file_share_service/errors.ts index 89979f068997..193b30e6e188 100644 --- a/x-pack/plugins/files/server/file_share_service/errors.ts +++ b/src/plugins/files/server/file_share_service/errors.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ /* eslint-disable max-classes-per-file */ diff --git a/x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts b/src/plugins/files/server/file_share_service/generate_share_token.test.ts similarity index 70% rename from x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts rename to src/plugins/files/server/file_share_service/generate_share_token.test.ts index 93767c748498..53122395f668 100644 --- a/x-pack/plugins/files/server/file_share_service/generate_share_token.test.ts +++ b/src/plugins/files/server/file_share_service/generate_share_token.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { generateShareToken } from './generate_share_token'; diff --git a/x-pack/plugins/files/server/file_share_service/generate_share_token.ts b/src/plugins/files/server/file_share_service/generate_share_token.ts similarity index 82% rename from x-pack/plugins/files/server/file_share_service/generate_share_token.ts rename to src/plugins/files/server/file_share_service/generate_share_token.ts index ef779db49223..d20bf8bd9739 100644 --- a/x-pack/plugins/files/server/file_share_service/generate_share_token.ts +++ b/src/plugins/files/server/file_share_service/generate_share_token.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import crypto from 'crypto'; diff --git a/x-pack/plugins/files/server/file_share_service/index.ts b/src/plugins/files/server/file_share_service/index.ts similarity index 74% rename from x-pack/plugins/files/server/file_share_service/index.ts rename to src/plugins/files/server/file_share_service/index.ts index dd52ec05777c..d4f2f1eba9df 100644 --- a/x-pack/plugins/files/server/file_share_service/index.ts +++ b/src/plugins/files/server/file_share_service/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { InternalFileShareService } from './internal_file_share_service'; diff --git a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts b/src/plugins/files/server/file_share_service/internal_file_share_service.ts similarity index 97% rename from x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts rename to src/plugins/files/server/file_share_service/internal_file_share_service.ts index 4d5bd95bf4b2..beef345cc851 100644 --- a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts +++ b/src/plugins/files/server/file_share_service/internal_file_share_service.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import moment from 'moment'; import { SavedObjectsClientContract, diff --git a/x-pack/plugins/files/server/file_share_service/types.ts b/src/plugins/files/server/file_share_service/types.ts similarity index 85% rename from x-pack/plugins/files/server/file_share_service/types.ts rename to src/plugins/files/server/file_share_service/types.ts index bf3147d93308..9e353172eb7a 100644 --- a/x-pack/plugins/files/server/file_share_service/types.ts +++ b/src/plugins/files/server/file_share_service/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { FileShareJSON, FileShare } from '../../common/types'; diff --git a/x-pack/plugins/files/server/index.ts b/src/plugins/files/server/index.ts similarity index 85% rename from x-pack/plugins/files/server/index.ts rename to src/plugins/files/server/index.ts index fe2bd3e69eec..5fb3a1e7f6c8 100755 --- a/x-pack/plugins/files/server/index.ts +++ b/src/plugins/files/server/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { PluginInitializerContext } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/integration_tests/README.md b/src/plugins/files/server/integration_tests/README.md similarity index 100% rename from x-pack/plugins/files/server/integration_tests/README.md rename to src/plugins/files/server/integration_tests/README.md diff --git a/x-pack/plugins/files/server/integration_tests/file_service.test.ts b/src/plugins/files/server/integration_tests/file_service.test.ts similarity index 98% rename from x-pack/plugins/files/server/integration_tests/file_service.test.ts rename to src/plugins/files/server/integration_tests/file_service.test.ts index 9ea208ca2985..30c3ecd5d9e4 100644 --- a/x-pack/plugins/files/server/integration_tests/file_service.test.ts +++ b/src/plugins/files/server/integration_tests/file_service.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { CoreStart, ElasticsearchClient } from '@kbn/core/server'; @@ -37,7 +38,6 @@ describe('FileService', () => { let fileService: FileServiceStart; let blobStorageService: BlobStorageService; let esClient: ElasticsearchClient; - let coreSetup: Awaited>; let coreStart: CoreStart; let fileServiceFactory: FileServiceFactory; let security: ReturnType; @@ -48,8 +48,7 @@ describe('FileService', () => { manageES = await startES(); kbnRoot = createRootWithCorePlugins(); await kbnRoot.preboot(); - coreSetup = await kbnRoot.setup(); - FileServiceFactory.setup(coreSetup.savedObjects); + await kbnRoot.setup(); coreStart = await kbnRoot.start(); setFileKindsRegistry(new FileKindsRegistryImpl()); const fileKindsRegistry = getFileKindsRegistry(); diff --git a/x-pack/plugins/files/server/mocks.ts b/src/plugins/files/server/mocks.ts similarity index 92% rename from x-pack/plugins/files/server/mocks.ts rename to src/plugins/files/server/mocks.ts index de9a495818ff..60f0b5c38ee8 100644 --- a/x-pack/plugins/files/server/mocks.ts +++ b/src/plugins/files/server/mocks.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { KibanaRequest } from '@kbn/core/server'; import { DeeplyMockedKeys } from '@kbn/utility-types-jest'; import * as stream from 'stream'; diff --git a/x-pack/plugins/files/server/plugin.ts b/src/plugins/files/server/plugin.ts similarity index 94% rename from x-pack/plugins/files/server/plugin.ts rename to src/plugins/files/server/plugin.ts index 08357e28bd3d..95408f1fc18c 100755 --- a/x-pack/plugins/files/server/plugin.ts +++ b/src/plugins/files/server/plugin.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { diff --git a/x-pack/plugins/files/server/routes/api_routes.ts b/src/plugins/files/server/routes/api_routes.ts similarity index 89% rename from x-pack/plugins/files/server/routes/api_routes.ts rename to src/plugins/files/server/routes/api_routes.ts index b40696bfe61e..1c0df1808f22 100644 --- a/x-pack/plugins/files/server/routes/api_routes.ts +++ b/src/plugins/files/server/routes/api_routes.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { diff --git a/x-pack/plugins/files/server/routes/common.test.ts b/src/plugins/files/server/routes/common.test.ts similarity index 91% rename from x-pack/plugins/files/server/routes/common.test.ts rename to src/plugins/files/server/routes/common.test.ts index 1f9292e3ff07..3b10adb5226f 100644 --- a/x-pack/plugins/files/server/routes/common.test.ts +++ b/src/plugins/files/server/routes/common.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { File } from '../file'; diff --git a/x-pack/plugins/files/server/routes/common.ts b/src/plugins/files/server/routes/common.ts similarity index 87% rename from x-pack/plugins/files/server/routes/common.ts rename to src/plugins/files/server/routes/common.ts index 8e17a39511b5..aba84ee6487e 100644 --- a/x-pack/plugins/files/server/routes/common.ts +++ b/src/plugins/files/server/routes/common.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import mime from 'mime'; import type { ResponseHeaders } from '@kbn/core/server'; import type { File } from '../../common/types'; diff --git a/x-pack/plugins/files/server/routes/common_schemas.ts b/src/plugins/files/server/routes/common_schemas.ts similarity index 87% rename from x-pack/plugins/files/server/routes/common_schemas.ts rename to src/plugins/files/server/routes/common_schemas.ts index 449e4995ac5d..3f99f1cca805 100644 --- a/x-pack/plugins/files/server/routes/common_schemas.ts +++ b/src/plugins/files/server/routes/common_schemas.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/create.ts b/src/plugins/files/server/routes/file_kind/create.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/create.ts rename to src/plugins/files/server/routes/file_kind/create.ts index 78a7260771a1..7609265313bd 100644 --- a/x-pack/plugins/files/server/routes/file_kind/create.ts +++ b/src/plugins/files/server/routes/file_kind/create.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/delete.ts b/src/plugins/files/server/routes/file_kind/delete.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/delete.ts rename to src/plugins/files/server/routes/file_kind/delete.ts index ec23525f2686..da7bb7bade21 100644 --- a/x-pack/plugins/files/server/routes/file_kind/delete.ts +++ b/src/plugins/files/server/routes/file_kind/delete.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/download.ts b/src/plugins/files/server/routes/file_kind/download.ts similarity index 90% rename from x-pack/plugins/files/server/routes/file_kind/download.ts rename to src/plugins/files/server/routes/file_kind/download.ts index d4ae37ddb662..4776d37485c9 100644 --- a/x-pack/plugins/files/server/routes/file_kind/download.ts +++ b/src/plugins/files/server/routes/file_kind/download.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/enhance_router.ts b/src/plugins/files/server/routes/file_kind/enhance_router.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/enhance_router.ts rename to src/plugins/files/server/routes/file_kind/enhance_router.ts index b2a4f58fb8fd..87be1c4e08ea 100644 --- a/x-pack/plugins/files/server/routes/file_kind/enhance_router.ts +++ b/src/plugins/files/server/routes/file_kind/enhance_router.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { RequestHandler, RouteMethod, RouteRegistrar } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/routes/file_kind/get_by_id.ts b/src/plugins/files/server/routes/file_kind/get_by_id.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/get_by_id.ts rename to src/plugins/files/server/routes/file_kind/get_by_id.ts index 4d86e05564fd..914d1e70b77d 100644 --- a/x-pack/plugins/files/server/routes/file_kind/get_by_id.ts +++ b/src/plugins/files/server/routes/file_kind/get_by_id.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/helpers.ts b/src/plugins/files/server/routes/file_kind/helpers.ts similarity index 85% rename from x-pack/plugins/files/server/routes/file_kind/helpers.ts rename to src/plugins/files/server/routes/file_kind/helpers.ts index 12006fb87837..4ec6afccebd7 100644 --- a/x-pack/plugins/files/server/routes/file_kind/helpers.ts +++ b/src/plugins/files/server/routes/file_kind/helpers.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { IKibanaResponse, kibanaResponseFactory } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/routes/file_kind/index.ts b/src/plugins/files/server/routes/file_kind/index.ts similarity index 86% rename from x-pack/plugins/files/server/routes/file_kind/index.ts rename to src/plugins/files/server/routes/file_kind/index.ts index 1bd61b8fb2f2..40649656790c 100644 --- a/x-pack/plugins/files/server/routes/file_kind/index.ts +++ b/src/plugins/files/server/routes/file_kind/index.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { FileKind } from '../../../common/types'; import { FilesRouter } from '../types'; diff --git a/x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts b/src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts similarity index 97% rename from x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts rename to src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts index 6acd1e331734..58a6d195a0bd 100644 --- a/x-pack/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts +++ b/src/plugins/files/server/routes/file_kind/integration_tests/file_kind_http.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { UpdatableFileMetadata } from '../../../../common/types'; diff --git a/x-pack/plugins/files/server/routes/file_kind/list.ts b/src/plugins/files/server/routes/file_kind/list.ts similarity index 91% rename from x-pack/plugins/files/server/routes/file_kind/list.ts rename to src/plugins/files/server/routes/file_kind/list.ts index 96d1d8cc2727..54d8e98fc24f 100644 --- a/x-pack/plugins/files/server/routes/file_kind/list.ts +++ b/src/plugins/files/server/routes/file_kind/list.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import type { FileJSON, FileKind } from '../../../common/types'; import { CreateRouteDefinition, FILES_API_ROUTES } from '../api_routes'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/get.ts b/src/plugins/files/server/routes/file_kind/share/get.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/share/get.ts rename to src/plugins/files/server/routes/file_kind/share/get.ts index b39e7c2ccbc9..07e00d4ad800 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/get.ts +++ b/src/plugins/files/server/routes/file_kind/share/get.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { FileShareNotFoundError } from '../../../file_share_service/errors'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/list.ts b/src/plugins/files/server/routes/file_kind/share/list.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/share/list.ts rename to src/plugins/files/server/routes/file_kind/share/list.ts index 91a893d2dd31..470102cb815f 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/list.ts +++ b/src/plugins/files/server/routes/file_kind/share/list.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { CreateRouteDefinition, FILES_API_ROUTES } from '../../api_routes'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/share.ts b/src/plugins/files/server/routes/file_kind/share/share.ts similarity index 92% rename from x-pack/plugins/files/server/routes/file_kind/share/share.ts rename to src/plugins/files/server/routes/file_kind/share/share.ts index f4c8f660e080..3d3c5adb53e7 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/share.ts +++ b/src/plugins/files/server/routes/file_kind/share/share.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { ExpiryDateInThePastError } from '../../../file_share_service/errors'; import { CreateHandler, FileKindRouter } from '../types'; diff --git a/x-pack/plugins/files/server/routes/file_kind/share/unshare.ts b/src/plugins/files/server/routes/file_kind/share/unshare.ts similarity index 88% rename from x-pack/plugins/files/server/routes/file_kind/share/unshare.ts rename to src/plugins/files/server/routes/file_kind/share/unshare.ts index 49e59898433b..a41f5db8a597 100644 --- a/x-pack/plugins/files/server/routes/file_kind/share/unshare.ts +++ b/src/plugins/files/server/routes/file_kind/share/unshare.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { CreateRouteDefinition, FILES_API_ROUTES } from '../../api_routes'; diff --git a/x-pack/plugins/files/server/routes/file_kind/types.ts b/src/plugins/files/server/routes/file_kind/types.ts similarity index 81% rename from x-pack/plugins/files/server/routes/file_kind/types.ts rename to src/plugins/files/server/routes/file_kind/types.ts index 148767f27a28..c82b097d7472 100644 --- a/x-pack/plugins/files/server/routes/file_kind/types.ts +++ b/src/plugins/files/server/routes/file_kind/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { IRouter, RequestHandler } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/routes/file_kind/update.ts b/src/plugins/files/server/routes/file_kind/update.ts similarity index 89% rename from x-pack/plugins/files/server/routes/file_kind/update.ts rename to src/plugins/files/server/routes/file_kind/update.ts index 9621fc56c311..048e846322c5 100644 --- a/x-pack/plugins/files/server/routes/file_kind/update.ts +++ b/src/plugins/files/server/routes/file_kind/update.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.test.ts b/src/plugins/files/server/routes/file_kind/upload.test.ts similarity index 93% rename from x-pack/plugins/files/server/routes/file_kind/upload.test.ts rename to src/plugins/files/server/routes/file_kind/upload.test.ts index 59a906f5ea98..49a207ea8034 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.test.ts +++ b/src/plugins/files/server/routes/file_kind/upload.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Readable } from 'stream'; diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.ts b/src/plugins/files/server/routes/file_kind/upload.ts similarity index 94% rename from x-pack/plugins/files/server/routes/file_kind/upload.ts rename to src/plugins/files/server/routes/file_kind/upload.ts index 10c230de469b..88ef492ba11f 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.ts +++ b/src/plugins/files/server/routes/file_kind/upload.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; diff --git a/x-pack/plugins/files/server/routes/find.ts b/src/plugins/files/server/routes/find.ts similarity index 92% rename from x-pack/plugins/files/server/routes/find.ts rename to src/plugins/files/server/routes/find.ts index 80a398189dae..4ad1deaceb07 100644 --- a/x-pack/plugins/files/server/routes/find.ts +++ b/src/plugins/files/server/routes/find.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import type { CreateHandler, FilesRouter } from './types'; import { FileJSON } from '../../common'; diff --git a/x-pack/plugins/files/server/routes/index.ts b/src/plugins/files/server/routes/index.ts similarity index 74% rename from x-pack/plugins/files/server/routes/index.ts rename to src/plugins/files/server/routes/index.ts index 0a71599ac773..69565ebc8492 100644 --- a/x-pack/plugins/files/server/routes/index.ts +++ b/src/plugins/files/server/routes/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FilesRouter } from './types'; diff --git a/x-pack/plugins/files/server/routes/integration_tests/routes.test.ts b/src/plugins/files/server/routes/integration_tests/routes.test.ts similarity index 97% rename from x-pack/plugins/files/server/routes/integration_tests/routes.test.ts rename to src/plugins/files/server/routes/integration_tests/routes.test.ts index a01f377a0364..b7cfb34e0638 100644 --- a/x-pack/plugins/files/server/routes/integration_tests/routes.test.ts +++ b/src/plugins/files/server/routes/integration_tests/routes.test.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { CreateFileKindHttpEndpoint } from '../../../common/api_routes'; diff --git a/x-pack/plugins/files/server/routes/metrics.ts b/src/plugins/files/server/routes/metrics.ts similarity index 84% rename from x-pack/plugins/files/server/routes/metrics.ts rename to src/plugins/files/server/routes/metrics.ts index 9ae898e17bb8..6e3a63b7b67c 100644 --- a/x-pack/plugins/files/server/routes/metrics.ts +++ b/src/plugins/files/server/routes/metrics.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { FILES_MANAGE_PRIVILEGE } from '../../common/constants'; import type { FilesRouter } from './types'; diff --git a/x-pack/plugins/files/server/routes/public_facing/download.ts b/src/plugins/files/server/routes/public_facing/download.ts similarity index 91% rename from x-pack/plugins/files/server/routes/public_facing/download.ts rename to src/plugins/files/server/routes/public_facing/download.ts index bd77cabaf7e4..1635f9a7d39f 100644 --- a/x-pack/plugins/files/server/routes/public_facing/download.ts +++ b/src/plugins/files/server/routes/public_facing/download.ts @@ -1,9 +1,11 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { schema } from '@kbn/config-schema'; import { Readable } from 'stream'; import { NoDownloadAvailableError } from '../../file/errors'; diff --git a/x-pack/plugins/files/server/routes/test_utils.ts b/src/plugins/files/server/routes/test_utils.ts similarity index 82% rename from x-pack/plugins/files/server/routes/test_utils.ts rename to src/plugins/files/server/routes/test_utils.ts index 3ec4233fbcbf..58f00ddbab0f 100644 --- a/x-pack/plugins/files/server/routes/test_utils.ts +++ b/src/plugins/files/server/routes/test_utils.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/x-pack/plugins/files/server/routes/types.ts b/src/plugins/files/server/routes/types.ts similarity index 86% rename from x-pack/plugins/files/server/routes/types.ts rename to src/plugins/files/server/routes/types.ts index f47808a85c3b..cfe47a765235 100644 --- a/x-pack/plugins/files/server/routes/types.ts +++ b/src/plugins/files/server/routes/types.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { diff --git a/x-pack/plugins/files/server/saved_objects/file.ts b/src/plugins/files/server/saved_objects/file.ts similarity index 85% rename from x-pack/plugins/files/server/saved_objects/file.ts rename to src/plugins/files/server/saved_objects/file.ts index 352a00016f86..af8f7ef9ef08 100644 --- a/x-pack/plugins/files/server/saved_objects/file.ts +++ b/src/plugins/files/server/saved_objects/file.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SavedObjectsType, SavedObjectsFieldMapping } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/saved_objects/file_share.ts b/src/plugins/files/server/saved_objects/file_share.ts similarity index 84% rename from x-pack/plugins/files/server/saved_objects/file_share.ts rename to src/plugins/files/server/saved_objects/file_share.ts index e71253582b38..244a027e7f73 100644 --- a/x-pack/plugins/files/server/saved_objects/file_share.ts +++ b/src/plugins/files/server/saved_objects/file_share.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { SavedObjectsFieldMapping, SavedObjectsType } from '@kbn/core/server'; diff --git a/x-pack/plugins/files/server/saved_objects/index.ts b/src/plugins/files/server/saved_objects/index.ts similarity index 67% rename from x-pack/plugins/files/server/saved_objects/index.ts rename to src/plugins/files/server/saved_objects/index.ts index 2871e4f52f27..c8c03781db99 100644 --- a/x-pack/plugins/files/server/saved_objects/index.ts +++ b/src/plugins/files/server/saved_objects/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { fileObjectType } from './file'; diff --git a/x-pack/plugins/files/server/test_utils/index.ts b/src/plugins/files/server/test_utils/index.ts similarity index 63% rename from x-pack/plugins/files/server/test_utils/index.ts rename to src/plugins/files/server/test_utils/index.ts index 98215f70649d..5e5b871cece1 100644 --- a/x-pack/plugins/files/server/test_utils/index.ts +++ b/src/plugins/files/server/test_utils/index.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { setupIntegrationEnvironment } from './setup_integration_environment'; diff --git a/x-pack/plugins/files/server/test_utils/setup_integration_environment.ts b/src/plugins/files/server/test_utils/setup_integration_environment.ts similarity index 92% rename from x-pack/plugins/files/server/test_utils/setup_integration_environment.ts rename to src/plugins/files/server/test_utils/setup_integration_environment.ts index 1c31649d1e8f..e0c01ca8f0a6 100644 --- a/x-pack/plugins/files/server/test_utils/setup_integration_environment.ts +++ b/src/plugins/files/server/test_utils/setup_integration_environment.ts @@ -1,8 +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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { defaults } from 'lodash'; @@ -20,11 +21,6 @@ export type TestEnvironmentUtils = Awaited/x-pack/plugins/files'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/files', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/files/{common,public,server}/**/*.{js,ts,tsx}'], -}; diff --git a/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts b/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts deleted file mode 100644 index 59ea5457ec6c..000000000000 --- a/x-pack/plugins/files/public/components/file_picker/i18n_texts.ts +++ /dev/null @@ -1,49 +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 i18nTexts = { - title: i18n.translate('xpack.files.filePicker.title', { - defaultMessage: 'Select a file', - }), - loadingFilesErrorTitle: i18n.translate('xpack.files.filePicker.error.loadingTitle', { - defaultMessage: 'Could not load files', - }), - retryButtonLabel: i18n.translate('xpack.files.filePicker.error.retryButtonLabel', { - defaultMessage: 'Retry', - }), - emptyStatePrompt: i18n.translate('xpack.files.filePicker.emptyStatePrompt', { - defaultMessage: 'No files found', - }), - emptyStatePromptSubtitle: i18n.translate('xpack.files.filePicker.emptyStatePromptSubtitle', { - defaultMessage: 'Upload your first file.', - }), - selectFileLabel: i18n.translate('xpack.files.filePicker.selectFileButtonLable', { - defaultMessage: 'Select file', - }), - selectFilesLabel: (nrOfFiles: number) => - i18n.translate('xpack.files.filePicker.selectFilesButtonLable', { - defaultMessage: 'Select {nrOfFiles} files', - values: { nrOfFiles }, - }), - searchFieldPlaceholder: i18n.translate('xpack.files.filePicker.searchFieldPlaceholder', { - defaultMessage: 'my-file-*', - }), - emptyFileGridPrompt: i18n.translate('xpack.files.filePicker.emptyGridPrompt', { - defaultMessage: 'No files matched filter', - }), - loadMoreButtonLabel: i18n.translate('xpack.files.filePicker.loadMoreButtonLabel', { - defaultMessage: 'Load more', - }), - clearFilterButton: i18n.translate('xpack.files.filePicker.clearFilterButtonLabel', { - defaultMessage: 'Clear filter', - }), - uploadFilePlaceholderText: i18n.translate('xpack.files.filePicker.uploadFilePlaceholderText', { - defaultMessage: 'Drag and drop to upload new files', - }), -}; diff --git a/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts b/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts deleted file mode 100644 index b58616e3d86b..000000000000 --- a/x-pack/plugins/files/public/components/upload_file/i18n_texts.ts +++ /dev/null @@ -1,41 +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 i18nTexts = { - defaultPickerLabel: i18n.translate('xpack.files.uploadFile.defaultFilePickerLabel', { - defaultMessage: 'Upload a file', - }), - upload: i18n.translate('xpack.files.uploadFile.uploadButtonLabel', { - defaultMessage: 'Upload', - }), - uploading: i18n.translate('xpack.files.uploadFile.uploadingButtonLabel', { - defaultMessage: 'Uploading', - }), - uploadComplete: i18n.translate('xpack.files.uploadFile.uploadCompleteButtonLabel', { - defaultMessage: 'Upload complete', - }), - retry: i18n.translate('xpack.files.uploadFile.retryButtonLabel', { - defaultMessage: 'Retry', - }), - clear: i18n.translate('xpack.files.uploadFile.clearButtonLabel', { - defaultMessage: 'Clear', - }), - cancel: i18n.translate('xpack.files.uploadFile.cancelButtonLabel', { - defaultMessage: 'Cancel', - }), - uploadDone: i18n.translate('xpack.files.uploadFile.uploadDoneToolTipContent', { - defaultMessage: 'Your file was successfully uploaded!', - }), - fileTooLarge: (expectedSize: string) => - i18n.translate('xpack.files.uploadFile.fileTooLargeErrorMessage', { - defaultMessage: - 'File is too large. Maximum size is {expectedSize, plural, one {# byte} other {# bytes} }.', - values: { expectedSize }, - }), -}; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts b/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts index e778a94e90ac..ddbdd660efb5 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts @@ -226,7 +226,7 @@ export const sendEndpointActionResponse = async ( // Index the file content (just one chunk) // call to `.index()` copied from File plugin here: - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 + // https://github.com/elastic/kibana/blob/main/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 await esClient.index( { index: FILE_STORAGE_DATA_INDEX, diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 51a166cccd5e..9dd16bd332c1 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -19,6 +19,7 @@ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../src/plugins/files/tsconfig.json"}, { "path": "../../../src/plugins/home/tsconfig.json" }, { "path": "../../../src/plugins/inspector/tsconfig.json" }, { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, @@ -46,7 +47,6 @@ { "path": "../security/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, { "path": "../threat_intelligence/tsconfig.json" }, - { "path": "../timelines/tsconfig.json" }, - { "path": "../files/tsconfig.json"} + { "path": "../timelines/tsconfig.json" } ] } diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index 5eb2c8d5a586..aa1ad2036316 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -5116,83 +5116,6 @@ } } }, - "files": { - "properties": { - "countByExtension": { - "type": "array", - "items": { - "properties": { - "extension": { - "type": "keyword" - }, - "count": { - "type": "long" - } - } - } - }, - "countByStatus": { - "properties": { - "AWAITING_UPLOAD": { - "type": "long", - "_meta": { - "description": "Number of files awaiting upload" - } - }, - "DELETED": { - "type": "long", - "_meta": { - "description": "Number of files that are marked as deleted" - } - }, - "READY": { - "type": "long", - "_meta": { - "description": "Number of files that are ready for download" - } - }, - "UPLOADING": { - "type": "long", - "_meta": { - "description": "Number of files that are currently uploading" - } - }, - "UPLOAD_ERROR": { - "type": "long", - "_meta": { - "description": "Number of files that failed to upload" - } - } - } - }, - "storage": { - "properties": { - "esFixedSizeIndex": { - "properties": { - "capacity": { - "type": "long", - "_meta": { - "description": "Capacity of the fixed size index" - } - }, - "available": { - "type": "long", - "_meta": { - "description": "Available storage in bytes" - } - }, - "used": { - "type": "long", - "_meta": { - "description": "Used storage in bytes" - } - } - } - } - } - } - } - }, "fleet": { "properties": { "agents_enabled": { From 91f545384332d98e004438b95722210ef393876a Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Mon, 31 Oct 2022 14:47:52 +0100 Subject: [PATCH 06/87] Upgrade @elastic/makelogs from v6.0.0 to v6.1.1 (#144231) --- package.json | 2 +- yarn.lock | 175 ++++----------------------------------------------- 2 files changed, 12 insertions(+), 165 deletions(-) diff --git a/package.json b/package.json index 10d91828024d..54dd5abbe12c 100644 --- a/package.json +++ b/package.json @@ -703,7 +703,7 @@ "@cypress/snapshot": "^2.1.7", "@cypress/webpack-preprocessor": "^5.12.2", "@elastic/eslint-plugin-eui": "0.0.2", - "@elastic/makelogs": "^6.0.0", + "@elastic/makelogs": "^6.1.1", "@elastic/synthetics": "^1.0.0-beta.22", "@emotion/babel-preset-css-prop": "^11.10.0", "@emotion/jest": "^11.10.0", diff --git a/yarn.lock b/yarn.lock index d75fc26e8af5..26a0a9e6b52d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1585,10 +1585,10 @@ resolved "https://registry.yarnpkg.com/@elastic/filesaver/-/filesaver-1.1.2.tgz#1998ffb3cd89c9da4ec12a7793bfcae10e30c77a" integrity sha512-YZbSufYFBhAj+S2cJgiKALoxIJevqXN2MSr6Yqr42rJdaPuM31cj6pUDwflkql1oDjupqD9la+MfxPFjXI1JFQ== -"@elastic/makelogs@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@elastic/makelogs/-/makelogs-6.0.0.tgz#d6d74d5d0f020123c54160370d49ca5e0aab1fe1" - integrity sha512-i+BMxM3pKy9CAqcvMvdHLxvM0Dlnx+4JeScWHM9fFn4+2rAHGCqWflm/UGhTgQh3xn+yXKMLoEbfMIi5Aw1ysw== +"@elastic/makelogs@^6.1.1": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@elastic/makelogs/-/makelogs-6.1.1.tgz#5bc173b16acdfd7844fd85c97824ddcffd67cfb3" + integrity sha512-cmfXFQITwyT4SV+Ryerg/vVbGQ9E2BhYKQ9flG85Ba3blGVmOjkgv7TYQam6xAIvGXFGBBrcyqEwmuw7xZ5ZNQ== dependencies: async "^1.4.2" commander "^5.0.0" @@ -1597,7 +1597,6 @@ moment "^2.10.6" progress "^1.1.8" through2 "^2.0.0" - update-notifier "^0.5.0" "@elastic/node-crypto@1.1.1": version "1.1.1" @@ -10759,20 +10758,6 @@ config-chain@^1.1.12: ini "^1.3.4" proto-list "~1.2.1" -configstore@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-1.4.0.tgz#c35781d0501d268c25c54b8b17f6240e8a4fb021" - integrity sha1-w1eB0FAdJowlxUuLF/YkDopPsCE= - dependencies: - graceful-fs "^4.1.2" - mkdirp "^0.5.0" - object-assign "^4.0.1" - os-tmpdir "^1.0.0" - osenv "^0.1.0" - uuid "^2.0.1" - write-file-atomic "^1.1.2" - xdg-basedir "^2.0.0" - configstore@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" @@ -12580,7 +12565,7 @@ duplexer@^0.1.2: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== -duplexify@^3.2.0, duplexify@^3.4.2, duplexify@^3.5.3: +duplexify@^3.4.2, duplexify@^3.5.3: version "3.7.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== @@ -14957,22 +14942,6 @@ got@11.8.5, got@^11.8.2: p-cancelable "^2.0.0" responselike "^2.0.0" -got@^3.2.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/got/-/got-3.3.1.tgz#e5d0ed4af55fc3eef4d56007769d98192bcb2eca" - integrity sha1-5dDtSvVfw+701WAHdp2YGSvLLso= - dependencies: - duplexify "^3.2.0" - infinity-agent "^2.0.0" - is-redirect "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - nested-error-stacks "^1.0.0" - object-assign "^3.0.0" - prepend-http "^1.0.0" - read-all-stream "^3.0.0" - timed-out "^2.0.0" - got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -15846,11 +15815,6 @@ infer-owner@^1.0.3, infer-owner@^1.0.4: resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== -infinity-agent@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/infinity-agent/-/infinity-agent-2.0.3.tgz#45e0e2ff7a9eb030b27d62b74b3744b7a7ac4216" - integrity sha1-ReDi/3qesDCyfWK3SzdEt6esQhY= - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -16345,11 +16309,6 @@ is-nil@^1.0.0: resolved "https://registry.yarnpkg.com/is-nil/-/is-nil-1.0.1.tgz#2daba29e0b585063875e7b539d071f5b15937969" integrity sha1-LauingtYUGOHXntTnQcfWxWTeWk= -is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= - is-npm@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" @@ -16474,11 +16433,6 @@ is-promise@^2.1, is-promise@^2.1.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= - is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.2, is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -16509,7 +16463,7 @@ is-shared-array-buffer@^1.0.1: resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== -is-stream@^1.0.0, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -17921,13 +17875,6 @@ language-tags@^1.0.5: dependencies: language-subtag-registry "~0.3.2" -latest-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-1.0.1.tgz#72cfc46e3e8d1be651e1ebb54ea9f6ea96f374bb" - integrity sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs= - dependencies: - package-json "^1.0.0" - latest-version@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" @@ -19299,7 +19246,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: +mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: version "0.5.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== @@ -19645,13 +19592,6 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1, neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -nested-error-stacks@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz#19f619591519f096769a5ba9a86e6eeec823c3cf" - integrity sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88= - dependencies: - inherits "~2.0.1" - nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61" @@ -20093,11 +20033,6 @@ object-assign@4.X, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4. resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - integrity sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I= - object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -20442,7 +20377,7 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@^0.1.0, osenv@^0.1.4: +osenv@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== @@ -20594,14 +20529,6 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" -package-json@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-1.2.0.tgz#c8ecac094227cdf76a316874ed05e27cc939a0e0" - integrity sha1-yOysCUInzfdqMWh07QXifMk5oOA= - dependencies: - got "^3.2.0" - registry-url "^3.0.0" - package-json@^6.3.0: version "6.5.0" resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" @@ -21509,11 +21436,6 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" @@ -22083,7 +22005,7 @@ rc-pagination@^1.20.1: prop-types "^15.5.7" react-lifecycles-compat "^3.0.4" -rc@^1.0.1, rc@^1.2.7, rc@^1.2.8: +rc@^1.2.7, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -22689,14 +22611,6 @@ reactcss@^1.2.0: dependencies: lodash "^4.0.1" -read-all-stream@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" - integrity sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po= - dependencies: - pinkie-promise "^2.0.0" - readable-stream "^2.0.0" - read-installed@~4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" @@ -23035,13 +22949,6 @@ registry-auth-token@^4.0.0: dependencies: rc "^1.2.8" -registry-url@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= - dependencies: - rc "^1.0.1" - registry-url@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" @@ -23281,13 +23188,6 @@ repeat-string@^1.0.0, repeat-string@^1.5.4, repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -repeating@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-1.1.3.tgz#3d4114218877537494f97f77f9785fab810fa4ac" - integrity sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw= - dependencies: - is-finite "^1.0.0" - repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" @@ -23874,13 +23774,6 @@ selfsigned@^2.0.1: dependencies: node-forge "^1" -semver-diff@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" - integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= - dependencies: - semver "^5.0.3" - semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" @@ -23888,7 +23781,7 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -24223,7 +24116,7 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -slide@^1.1.5, slide@~1.1.3: +slide@~1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= @@ -24776,13 +24669,6 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= -string-length@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" - integrity sha1-VpcPscOFWOnnC3KL894mmsRa36w= - dependencies: - strip-ansi "^3.0.0" - string-length@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1" @@ -25567,11 +25453,6 @@ time-stamp@^1.0.0: resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= -timed-out@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-2.0.0.tgz#f38b0ae81d3747d628001f41dafc652ace671c0a" - integrity sha1-84sK6B03R9YoAB9B2vxlKs5nHAo= - timers-browserify@^2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.6.tgz#241e76927d9ca05f4d959819022f5b3664b64bae" @@ -26404,19 +26285,6 @@ update-browserslist-db@^1.0.9: escalade "^3.1.1" picocolors "^1.0.0" -update-notifier@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-0.5.0.tgz#07b5dc2066b3627ab3b4f530130f7eddda07a4cc" - integrity sha1-B7XcIGazYnqztPUwEw9+3doHpMw= - dependencies: - chalk "^1.0.0" - configstore "^1.0.0" - is-npm "^1.0.0" - latest-version "^1.0.0" - repeating "^1.1.2" - semver-diff "^2.0.0" - string-length "^1.0.0" - update-notifier@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" @@ -26620,11 +26488,6 @@ uuid@3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== -uuid@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" - integrity sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho= - uuid@^3.3.2, uuid@^3.3.3: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -27729,15 +27592,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@^1.1.2: - version "1.3.4" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" - integrity sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8= - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" @@ -27773,13 +27627,6 @@ x-default-browser@^0.4.0: optionalDependencies: default-browser-id "^1.0.4" -xdg-basedir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" - integrity sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I= - dependencies: - os-homedir "^1.0.0" - xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" From 499e80034691ddbc84bff2716e363ef3ec1d2786 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Mon, 31 Oct 2022 09:56:22 -0400 Subject: [PATCH 07/87] [Fleet] Add the @custom pipeline only to the main datastream ingest pipelines (#144150) --- .../ingest_pipeline/install.test.ts | 16 ++++++++++++++++ .../epm/elasticsearch/ingest_pipeline/install.ts | 8 ++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts index d69fd167ee11..7ea61bde7a0e 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.test.ts @@ -39,6 +39,14 @@ describe('Install pipeline tests', () => { await res.install(esClient, logger); expect(esClient.ingest.putPipeline).toBeCalled(); + + // It should add the @custom pipeline for the main pipeline + const pipelinesWithCustomProcessor = esClient.ingest.putPipeline.mock.calls.filter((call) => + // @ts-ignore-error + call[0]?.body.includes('@custom') + ); + + expect(pipelinesWithCustomProcessor).toHaveLength(1); }); it('should work with datastream with ingest pipelines define in the package', async () => { @@ -73,6 +81,14 @@ describe('Install pipeline tests', () => { await res.install(esClient, logger); expect(esClient.ingest.putPipeline).toBeCalledTimes(2); + + // It should add the @custom pipeline only for the main pipeline + const pipelinesWithCustomProcessor = esClient.ingest.putPipeline.mock.calls.filter((call) => + // @ts-ignore-error + call[0]?.body.includes('@custom') + ); + + expect(pipelinesWithCustomProcessor).toHaveLength(1); }); }); }); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts index 2d9fdb31036e..7ada81c26c92 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts @@ -157,7 +157,8 @@ export async function installAllPipelines({ let datastreamPipelineCreated = false; pipelinePaths.forEach((path) => { const { name, extension } = getNameAndExtension(path); - if (name === dataStream?.ingest_pipeline) { + const isMainPipeline = name === dataStream?.ingest_pipeline; + if (isMainPipeline) { datastreamPipelineCreated = true; } const nameForInstallation = getPipelineNameForInstallation({ @@ -168,9 +169,8 @@ export async function installAllPipelines({ const content = getAsset(path).toString('utf-8'); pipelinesInfos.push({ nameForInstallation, - customIngestPipelineNameForInstallation: dataStream - ? getCustomPipelineNameForDatastream(dataStream) - : undefined, + customIngestPipelineNameForInstallation: + dataStream && isMainPipeline ? getCustomPipelineNameForDatastream(dataStream) : undefined, content, extension, }); From 060768955e1ffd9a5b51d7796558d5af2991b598 Mon Sep 17 00:00:00 2001 From: Rodney Norris Date: Mon, 31 Oct 2022 09:26:56 -0500 Subject: [PATCH 08/87] [Enterprise Search][Tech Debt] Tests for pipelines / ml inference (#144148) * test inference history logic * test IndexPipelinesConfigurationsLogic * test AddMLInferencePipelineModal Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../pipelines/inference_history_logic.test.ts | 99 +++++ .../pipelines/inference_history_logic.ts | 4 +- .../add_ml_inference_pipeline_modal.test.tsx | 409 ++++++++++++++++++ .../add_ml_inference_pipeline_modal.tsx | 11 +- ...ipelines_json_configurations_logic.test.ts | 121 ++++++ .../pipelines_json_configurations_logic.ts | 4 +- 6 files changed, 638 insertions(+), 10 deletions(-) create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.test.ts create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.test.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.test.ts new file mode 100644 index 000000000000..16722f7add9e --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.test.ts @@ -0,0 +1,99 @@ +/* + * Copyright 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 { LogicMounter, mockFlashMessageHelpers } from '../../../../__mocks__/kea_logic'; + +import { nextTick } from '@kbn/test-jest-helpers'; + +import { HttpError } from '../../../../../../common/types/api'; +import { MlInferenceHistoryResponse } from '../../../../../../common/types/pipelines'; +import { FetchMlInferencePipelineHistoryApiLogic } from '../../../api/pipelines/fetch_ml_inference_pipeline_history'; + +import { InferenceHistoryValues, InferenceHistoryLogic } from './inference_history_logic'; + +const DEFAULT_VALUES: InferenceHistoryValues = { + fetchIndexInferenceHistoryStatus: 0, + indexName: '', + inferenceHistory: undefined, + inferenceHistoryData: undefined, + isLoading: true, +}; + +describe('InferenceHistoryLogic', () => { + const { mount } = new LogicMounter(InferenceHistoryLogic); + const { mount: mountFetchMlInferencePipelineHistoryApiLogic } = new LogicMounter( + FetchMlInferencePipelineHistoryApiLogic + ); + + beforeEach(() => { + jest.clearAllMocks(); + mountFetchMlInferencePipelineHistoryApiLogic(); + mount(); + }); + + it('has expected default values', () => { + expect(InferenceHistoryLogic.values).toEqual(DEFAULT_VALUES); + }); + + describe('listeners', () => { + it('flashes errors on history fetch error', async () => { + const error = { + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpError; + FetchMlInferencePipelineHistoryApiLogic.actions.apiError(error); + await nextTick(); + + expect(mockFlashMessageHelpers.flashAPIErrors).toHaveBeenCalledWith(error); + }); + it('clears flash messages on history fetch', async () => { + FetchMlInferencePipelineHistoryApiLogic.actions.makeRequest({ indexName: 'test' }); + await nextTick(); + expect(mockFlashMessageHelpers.clearFlashMessages).toHaveBeenCalledTimes(1); + }); + }); + + describe('selectors', () => { + describe('inferenceHistory', () => { + it('returns history from api response', () => { + const historyResponse: MlInferenceHistoryResponse = { + history: [ + { + doc_count: 10, + pipeline: 'unit-test', + }, + { + doc_count: 12, + pipeline: 'unit-test-002', + }, + ], + }; + FetchMlInferencePipelineHistoryApiLogic.actions.apiSuccess(historyResponse); + + expect(InferenceHistoryLogic.values.inferenceHistory).toEqual(historyResponse.history); + }); + }); + describe('isLoading', () => { + it('returns false for success', () => { + FetchMlInferencePipelineHistoryApiLogic.actions.apiSuccess({ history: [] }); + expect(InferenceHistoryLogic.values.isLoading).toBe(false); + }); + it('returns false for error', () => { + FetchMlInferencePipelineHistoryApiLogic.actions.apiError({ + body: { + error: '', + message: 'this is an error', + statusCode: 500, + }, + } as HttpError); + expect(InferenceHistoryLogic.values.isLoading).toBe(false); + }); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts index 1a27f5dfd834..e1ec8feb77f0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_history_logic.ts @@ -18,14 +18,14 @@ import { } from '../../../api/pipelines/fetch_ml_inference_pipeline_history'; import { IndexNameLogic } from '../index_name_logic'; -interface InferenceHistoryActions { +export interface InferenceHistoryActions { fetchIndexInferenceHistory: Actions< FetchMlInferencePipelineHistoryApiLogicArgs, FetchMlInferencePipelineHistoryApiLogicResponse >['makeRequest']; } -interface InferenceHistoryValues { +export interface InferenceHistoryValues { fetchIndexInferenceHistoryStatus: Status; indexName: string; inferenceHistory: MlInferenceHistoryItem[] | undefined; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.test.tsx new file mode 100644 index 000000000000..4948257a18af --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.test.tsx @@ -0,0 +1,409 @@ +/* + * Copyright 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 { setMockValues, setMockActions } from '../../../../../__mocks__/kea_logic'; + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { + EuiButton, + EuiButtonEmpty, + EuiCallOut, + EuiStepsHorizontal, + EuiLoadingSpinner, +} from '@elastic/eui'; +import { TrainedModelConfigResponse } from '@kbn/ml-plugin/common/types/trained_models'; + +import { + AddMLInferencePipelineModal, + AddProcessorContent, + ModalFooter, + ModalSteps, +} from './add_ml_inference_pipeline_modal'; +import { ConfigurePipeline } from './configure_pipeline'; +import { AddInferencePipelineSteps, EMPTY_PIPELINE_CONFIGURATION } from './ml_inference_logic'; +import { NoModelsPanel } from './no_models'; +import { ReviewPipeline } from './review_pipeline'; +import { TestPipeline } from './test_pipeline'; + +const supportedMLModels: TrainedModelConfigResponse[] = [ + { + inference_config: { + ner: {}, + }, + input: { + field_names: [], + }, + model_id: 'test_model_id', + model_type: 'pytorch', + tags: ['test_tag'], + version: '1', + }, +]; +const DEFAULT_VALUES = { + addInferencePipelineModal: { + configuration: { ...EMPTY_PIPELINE_CONFIGURATION }, + indexName: 'unit-test-index', + simulateBody: '', + step: AddInferencePipelineSteps.Configuration, + }, + createErrors: [], + indexName: 'unit-test-index', + isLoading: false, + isPipelineDataValid: true, + supportedMLModels, +}; +const onClose = jest.fn(); + +describe('AddMLInferencePipelineModal', () => { + beforeEach(() => { + jest.clearAllMocks(); + setMockValues({ ...DEFAULT_VALUES }); + setMockActions({ + setIndexName: jest.fn(), + }); + }); + it('renders AddProcessorContent', () => { + const wrapper = shallow(); + expect(wrapper.find(AddProcessorContent)).toHaveLength(1); + }); + describe('AddProcessorContent', () => { + it('renders spinner when loading', () => { + setMockValues({ ...DEFAULT_VALUES, isLoading: true }); + const wrapper = shallow(); + expect(wrapper.find(EuiLoadingSpinner)).toHaveLength(1); + }); + it('renders no models panel when there are no models', () => { + setMockValues({ ...DEFAULT_VALUES, supportedMLModels: [] }); + const wrapper = shallow(); + expect(wrapper.find(NoModelsPanel)).toHaveLength(1); + }); + it('renders ModalSteps', () => { + const wrapper = shallow(); + expect(wrapper.find(ModalSteps)).toHaveLength(1); + }); + it('renders ModalFooter', () => { + const wrapper = shallow(); + expect(wrapper.find(ModalFooter)).toHaveLength(1); + }); + it('renders errors', () => { + const errorMsg = 'oh no!'; + setMockValues({ ...DEFAULT_VALUES, createErrors: [errorMsg] }); + const wrapper = shallow(); + + expect(wrapper.find(EuiCallOut)).toHaveLength(1); + const errorCallout = wrapper.find(EuiCallOut); + expect(errorCallout.prop('color')).toBe('danger'); + expect(errorCallout.prop('iconType')).toBe('alert'); + expect(errorCallout.find('p')).toHaveLength(1); + expect(errorCallout.find('p').text()).toBe(errorMsg); + }); + it('renders configure step', () => { + const wrapper = shallow(); + expect(wrapper.find(ConfigurePipeline)).toHaveLength(1); + }); + it('renders test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(); + expect(wrapper.find(TestPipeline)).toHaveLength(1); + }); + it('renders review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(); + expect(wrapper.find(ReviewPipeline)).toHaveLength(1); + }); + }); + describe('ModalSteps', () => { + const CONFIGURE_STEP_INDEX = 0; + const TEST_STEP_INDEX = 1; + const REVIEW_STEP_INDEX = 2; + const setAddInferencePipelineStep = jest.fn(); + beforeEach(() => { + setMockActions({ + setAddInferencePipelineStep, + }); + }); + it('renders EuiStepsHorizontal', () => { + const wrapper = shallow(); + expect(wrapper.find(EuiStepsHorizontal)).toHaveLength(1); + }); + it('configure step is complete with valid data', () => { + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const configureStep = steps.prop('steps')[CONFIGURE_STEP_INDEX]; + expect(configureStep.title).toBe('Configure'); + expect(configureStep.status).toBe('complete'); + }); + it('configure step is current with invalid data', () => { + setMockValues({ + ...DEFAULT_VALUES, + isPipelineDataValid: false, + }); + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const configureStep = steps.prop('steps')[CONFIGURE_STEP_INDEX]; + expect(configureStep.title).toBe('Configure'); + expect(configureStep.status).toBe('current'); + }); + it('test step is current when on step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const testStep = steps.prop('steps')[TEST_STEP_INDEX]; + expect(testStep.title).toBe('Test'); + expect(testStep.status).toBe('current'); + }); + it('review step is current when on step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const reviewStep = steps.prop('steps')[REVIEW_STEP_INDEX]; + expect(reviewStep.title).toBe('Review'); + expect(reviewStep.status).toBe('current'); + }); + it('clicking configure step updates step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const configStep = steps.prop('steps')[CONFIGURE_STEP_INDEX]; + configStep.onClick({} as any); + expect(setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Configuration + ); + }); + it('clicking test step updates step', () => { + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const testStep = steps.prop('steps')[TEST_STEP_INDEX]; + testStep.onClick({} as any); + expect(setAddInferencePipelineStep).toHaveBeenCalledWith(AddInferencePipelineSteps.Test); + }); + it('clicking review step updates step', () => { + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const reviewStep = steps.prop('steps')[REVIEW_STEP_INDEX]; + reviewStep.onClick({} as any); + expect(setAddInferencePipelineStep).toHaveBeenCalledWith(AddInferencePipelineSteps.Review); + }); + it('cannot click test step when data is invalid', () => { + setMockValues({ + ...DEFAULT_VALUES, + isPipelineDataValid: false, + }); + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const testStep = steps.prop('steps')[TEST_STEP_INDEX]; + testStep.onClick({} as any); + expect(setAddInferencePipelineStep).not.toHaveBeenCalled(); + }); + it('cannot click review step when data is invalid', () => { + setMockValues({ + ...DEFAULT_VALUES, + isPipelineDataValid: false, + }); + const wrapper = shallow(); + const steps = wrapper.find(EuiStepsHorizontal); + const reviewStep = steps.prop('steps')[REVIEW_STEP_INDEX]; + reviewStep.onClick({} as any); + expect(setAddInferencePipelineStep).not.toHaveBeenCalled(); + }); + }); + describe('ModalFooter', () => { + const ingestionMethod = 'crawler'; + const actions = { + attachPipeline: jest.fn(), + createPipeline: jest.fn(), + setAddInferencePipelineStep: jest.fn(), + }; + beforeEach(() => { + setMockActions(actions); + }); + it('renders cancel button on config step', () => { + const wrapper = shallow(); + const cancelBtn = wrapper.find(EuiButtonEmpty); + expect(cancelBtn).toHaveLength(1); + expect(cancelBtn.prop('children')).toBe('Cancel'); + cancelBtn.prop('onClick')!({} as any); + expect(onClose).toHaveBeenCalledTimes(1); + }); + it('renders cancel button on test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const cancelBtn = wrapper.find(EuiButtonEmpty).at(1); + expect(cancelBtn.prop('children')).toBe('Cancel'); + cancelBtn.prop('onClick')!({} as any); + expect(onClose).toHaveBeenCalledTimes(1); + }); + it('renders cancel button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const cancelBtn = wrapper.find(EuiButtonEmpty).at(1); + expect(cancelBtn.prop('children')).toBe('Cancel'); + cancelBtn.prop('onClick')!({} as any); + expect(onClose).toHaveBeenCalledTimes(1); + }); + it('renders back button on test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const backBtn = wrapper.find(EuiButtonEmpty).at(0); + expect(backBtn.prop('children')).toBe('Back'); + backBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Configuration + ); + }); + it('renders back button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + }, + }); + const wrapper = shallow(); + expect(wrapper.find(EuiButtonEmpty)).toHaveLength(2); + const backBtn = wrapper.find(EuiButtonEmpty).at(0); + expect(backBtn.prop('children')).toBe('Back'); + backBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Test + ); + }); + it('renders enabled Continue with valid data', () => { + const wrapper = shallow(); + const contBtn = wrapper.find(EuiButton); + expect(contBtn).toHaveLength(1); + expect(contBtn.prop('children')).toBe('Continue'); + expect(contBtn.prop('disabled')).toBe(false); + contBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Test + ); + }); + it('renders disabled Continue with invalid data', () => { + setMockValues({ ...DEFAULT_VALUES, isPipelineDataValid: false }); + const wrapper = shallow(); + expect(wrapper.find(EuiButton)).toHaveLength(1); + expect(wrapper.find(EuiButton).prop('children')).toBe('Continue'); + expect(wrapper.find(EuiButton).prop('disabled')).toBe(true); + }); + it('renders Continue button on test step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Test, + }, + }); + const wrapper = shallow(); + const contBtn = wrapper.find(EuiButton); + expect(contBtn).toHaveLength(1); + expect(contBtn.prop('children')).toBe('Continue'); + expect(contBtn.prop('disabled')).toBe(false); + contBtn.prop('onClick')!({} as any); + expect(actions.setAddInferencePipelineStep).toHaveBeenCalledWith( + AddInferencePipelineSteps.Review + ); + }); + it('renders create button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + configuration: { + destinationField: 'test', + existingPipeline: false, + modelID: 'test-model', + pipelineName: 'my-test-pipeline', + sourceField: 'body', + }, + }, + }); + + const wrapper = shallow(); + const actionButton = wrapper.find(EuiButton); + expect(actionButton).toHaveLength(1); + expect(actionButton.prop('children')).toBe('Create'); + expect(actionButton.prop('color')).toBe('success'); + actionButton.prop('onClick')!({} as any); + expect(actions.createPipeline).toHaveBeenCalledTimes(1); + }); + it('renders attach button on review step', () => { + setMockValues({ + ...DEFAULT_VALUES, + addInferencePipelineModal: { + ...DEFAULT_VALUES.addInferencePipelineModal, + step: AddInferencePipelineSteps.Review, + configuration: { + destinationField: 'test', + existingPipeline: true, + modelID: 'test-model', + pipelineName: 'my-test-pipeline', + sourceField: 'body', + }, + }, + }); + + const wrapper = shallow(); + const actionButton = wrapper.find(EuiButton); + expect(actionButton).toHaveLength(1); + expect(actionButton.prop('children')).toBe('Attach'); + expect(actionButton.prop('color')).toBe('primary'); + actionButton.prop('onClick')!({} as any); + expect(actions.attachPipeline).toHaveBeenCalledTimes(1); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx index cc0cc3eb8f95..f2d24260a4b0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx @@ -77,7 +77,7 @@ export const AddMLInferencePipelineModal: React.FC = ({ onClose }) => { +export const AddProcessorContent: React.FC = ({ onClose }) => { const { ingestionMethod } = useValues(IndexViewLogic); const { createErrors, @@ -125,7 +125,7 @@ const AddProcessorContent: React.FC = ({ onClo ); }; -const ModalSteps: React.FC = () => { +export const ModalSteps: React.FC = () => { const { addInferencePipelineModal: { step }, isPipelineDataValid, @@ -183,10 +183,9 @@ const ModalSteps: React.FC = () => { return ; }; -const ModalFooter: React.FC = ({ - ingestionMethod, - onClose, -}) => { +export const ModalFooter: React.FC< + AddMLInferencePipelineModalProps & { ingestionMethod: string } +> = ({ ingestionMethod, onClose }) => { const { addInferencePipelineModal: modal, isPipelineDataValid } = useValues(MLInferenceLogic); const { attachPipeline, createPipeline, setAddInferencePipelineStep } = useActions(MLInferenceLogic); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts new file mode 100644 index 000000000000..2359cf6e6739 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.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 { LogicMounter } from '../../../../__mocks__/kea_logic'; + +import { nextTick } from '@kbn/test-jest-helpers'; + +import { FetchCustomPipelineApiLogic } from '../../../api/index/fetch_custom_pipeline_api_logic'; + +import { + IndexPipelinesConfigurationsLogic, + IndexPipelinesConfigurationsValues, +} from './pipelines_json_configurations_logic'; + +const indexName = 'unit-test-index'; +const DEFAULT_VALUES: IndexPipelinesConfigurationsValues = { + indexName, + indexPipelinesData: undefined, + pipelineNames: [], + pipelines: {}, + selectedPipeline: undefined, + selectedPipelineId: '', + selectedPipelineJSON: '', +}; + +describe('IndexPipelinesConfigurationsLogic', () => { + const { mount } = new LogicMounter(IndexPipelinesConfigurationsLogic); + const { mount: mountFetchCustomPipelineApiLogic } = new LogicMounter(FetchCustomPipelineApiLogic); + + beforeEach(async () => { + jest.clearAllMocks(); + const indexNameProps = { indexName }; + mountFetchCustomPipelineApiLogic(); + mount(undefined, indexNameProps); + }); + + it('has expected default values', () => { + expect(IndexPipelinesConfigurationsLogic.values).toEqual(DEFAULT_VALUES); + }); + + describe('actions', () => { + it('selectPipeline updates selectedPipelineId', () => { + IndexPipelinesConfigurationsLogic.actions.selectPipeline('unit-test'); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual('unit-test'); + }); + it('fetchIndexPipelinesDataSuccess selects index ingest pipeline if found', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + [indexName]: { + processors: [], + version: 1, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual(indexName); + }); + it('fetchIndexPipelinesDataSuccess selects first pipeline as default pipeline', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual( + 'ent-search-generic-ingest' + ); + }); + }); + + describe('selectors', () => { + it('pipelineNames returns names of pipelines', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + [indexName]: { + processors: [], + version: 1, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.pipelineNames).toEqual([ + 'ent-search-generic-ingest', + indexName, + ]); + }); + it('selectedPipeline returns full pipeline', async () => { + const pipelines = { + 'ent-search-generic-ingest': { + version: 1, + }, + foo: { + version: 2, + }, + bar: { + version: 3, + }, + }; + FetchCustomPipelineApiLogic.actions.apiSuccess(pipelines); + IndexPipelinesConfigurationsLogic.actions.selectPipeline('foo'); + await nextTick(); + + expect(IndexPipelinesConfigurationsLogic.values.selectedPipeline).toEqual(pipelines.foo); + expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineJSON.length).toBeGreaterThan( + 0 + ); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts index 4bdf541cc7c7..d450dff591f6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.ts @@ -25,9 +25,9 @@ interface IndexPipelinesConfigurationsActions { selectPipeline: (pipeline: string) => { pipeline: string }; } -interface IndexPipelinesConfigurationsValues { +export interface IndexPipelinesConfigurationsValues { indexName: string; - indexPipelinesData: FetchCustomPipelineApiLogicResponse; + indexPipelinesData: FetchCustomPipelineApiLogicResponse | undefined; pipelineNames: string[]; pipelines: Record; selectedPipeline: IngestPipeline | undefined; From 2654c307d522e96d7f882628f53ba014a3b058fa Mon Sep 17 00:00:00 2001 From: Antonio Date: Mon, 31 Oct 2022 15:31:11 +0100 Subject: [PATCH 09/87] * Defined a smaller min-width for the cases modal. (#144230) --- .../all_cases/selector_modal/all_cases_selector_modal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx index 89bd623307f1..0ba5a65bf320 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx @@ -29,7 +29,7 @@ export interface AllCasesSelectorModalProps { const Modal = styled(EuiModal)` ${({ theme }) => ` - width: ${theme.eui.euiBreakpoints.xl}; + min-width: ${theme.eui.euiBreakpoints.l}; max-width: ${theme.eui.euiBreakpoints.xl}; `} `; From ebb9dbdc1a787d3dcb5b2d990cf87e390d5c1a6f Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Mon, 31 Oct 2022 07:40:21 -0700 Subject: [PATCH 10/87] Reports: Set content-disposition to `attachment` for report download (#144136) * remove content-disposition * Fix content-disposition and content-type * fix tests Co-authored-by: Jean-Louis Leysens --- package.json | 1 - .../routes/lib/get_document_payload.test.ts | 10 +++++----- .../server/routes/lib/get_document_payload.ts | 16 ++++++++-------- .../server/routes/lib/job_response_handler.ts | 2 +- .../management/integration_tests/jobs.test.ts | 4 ++-- yarn.lock | 2 +- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 54dd5abbe12c..a7f855e7cd15 100644 --- a/package.json +++ b/package.json @@ -472,7 +472,6 @@ "commander": "^4.1.1", "compare-versions": "3.5.1", "constate": "^3.3.2", - "content-disposition": "^0.5.4", "copy-to-clipboard": "^3.0.8", "core-js": "^3.25.5", "cronstrue": "^1.51.0", diff --git a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts index d2ed0b86e2cc..b342b52cdb9b 100644 --- a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts +++ b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.test.ts @@ -58,8 +58,8 @@ describe('getDocumentPayload', () => { contentType: 'application/pdf', content: expect.any(Readable), headers: expect.objectContaining({ - 'Content-Disposition': 'inline; filename="Some PDF report.pdf"', - 'Content-Length': 1024, + 'Content-Disposition': 'attachment; filename="Some PDF report.pdf"', + 'Content-Length': '1024', }), statusCode: 200, }) @@ -86,8 +86,8 @@ describe('getDocumentPayload', () => { contentType: 'text/csv', content: expect.any(Readable), headers: expect.objectContaining({ - 'Content-Disposition': 'inline; filename="Some CSV report.csv"', - 'Content-Length': 1024, + 'Content-Disposition': 'attachment; filename="Some CSV report.csv"', + 'Content-Length': '1024', 'kbn-csv-contains-formulas': true, 'kbn-max-size-reached': true, }), @@ -137,7 +137,7 @@ describe('getDocumentPayload', () => { contentType: 'text/plain', content: 'pending', headers: { - 'retry-after': 30, + 'retry-after': '30', }, statusCode: 503, }) diff --git a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts index 02f1eb5dee12..3840905f73c8 100644 --- a/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts +++ b/x-pack/plugins/reporting/server/routes/lib/get_document_payload.ts @@ -5,12 +5,11 @@ * 2.0. */ +import { ResponseHeaders } from '@kbn/core-http-server'; import { Stream } from 'stream'; -// @ts-ignore -import contentDisposition from 'content-disposition'; +import { ReportingCore } from '../..'; import { CSV_JOB_TYPE, CSV_JOB_TYPE_DEPRECATED } from '../../../common/constants'; import { ReportApiJSON } from '../../../common/types'; -import { ReportingCore } from '../..'; import { getContentStream, statuses } from '../../lib'; import { ExportTypeDefinition } from '../../types'; import { jobsQueryFactory } from './jobs_query'; @@ -24,7 +23,7 @@ interface Payload { statusCode: number; content: string | Stream | ErrorFromPayload; contentType: string | null; - headers: Record; + headers: ResponseHeaders; } type TaskRunResult = Required['output']; @@ -65,15 +64,16 @@ export function getDocumentPayloadFactory(reporting: ReportingCore) { const content = await getContentStream(reporting, { id, index }, { encoding }); const filename = getTitle(exportType, title); const headers = getReportingHeaders(output, exportType); + const contentType = output.content_type ?? 'text/plain'; return { content, statusCode: 200, - contentType: output.content_type, + contentType, headers: { ...headers, - 'Content-Disposition': contentDisposition(filename, { type: 'inline' }), - 'Content-Length': output.size, + 'Content-Disposition': `attachment; filename="${filename}"`, + 'Content-Length': `${output.size ?? ''}`, }, }; } @@ -99,7 +99,7 @@ export function getDocumentPayloadFactory(reporting: ReportingCore) { statusCode: 503, content: status, contentType: 'text/plain', - headers: { 'retry-after': 30 }, + headers: { 'retry-after': '30' }, }; } diff --git a/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts b/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts index 379454de7a0a..fb5edc6b25f7 100644 --- a/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts +++ b/x-pack/plugins/reporting/server/routes/lib/job_response_handler.ts @@ -54,7 +54,7 @@ export async function downloadJobResponseHandler( statusCode: payload.statusCode, headers: { ...payload.headers, - 'content-type': payload.contentType || '', + 'content-type': payload.contentType, }, }); } catch (err) { diff --git a/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts b/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts index f46ce228fa82..dce551209c05 100644 --- a/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts +++ b/x-pack/plugins/reporting/server/routes/management/integration_tests/jobs.test.ts @@ -268,7 +268,7 @@ describe('GET /api/reporting/jobs/download', () => { .get('/api/reporting/jobs/download/dank') .expect(200) .expect('Content-Type', 'text/plain; charset=utf-8') - .expect('content-disposition', 'inline; filename="report.csv"'); + .expect('content-disposition', 'attachment; filename="report.csv"'); }); it('succeeds when security is not there or disabled', async () => { @@ -285,7 +285,7 @@ describe('GET /api/reporting/jobs/download', () => { .get('/api/reporting/jobs/download/dope') .expect(200) .expect('Content-Type', 'text/plain; charset=utf-8') - .expect('content-disposition', 'inline; filename="report.csv"'); + .expect('content-disposition', 'attachment; filename="report.csv"'); }); it('forwards job content stream', async () => { diff --git a/yarn.lock b/yarn.lock index 26a0a9e6b52d..63bb314bd359 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10807,7 +10807,7 @@ container-info@^1.0.1: resolved "https://registry.yarnpkg.com/container-info/-/container-info-1.0.1.tgz#6b383cb5e197c8d921e88983388facb04124b56b" integrity sha512-wk/+uJvPHOFG+JSwQS+fw6H6yw3Oyc8Kw9L4O2MN817uA90OqJ59nlZbbLPqDudsjJ7Tetee3pwExdKpd2ahjQ== -content-disposition@0.5.4, content-disposition@^0.5.4: +content-disposition@0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== From 6f1df849cb36e65a1917e8046abb902c87815abf Mon Sep 17 00:00:00 2001 From: doakalexi <109488926+doakalexi@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:43:29 -0400 Subject: [PATCH 11/87] =?UTF-8?q?[ResponseOps][Actions]=20Improve=20Task?= =?UTF-8?q?=20Manager=E2=80=99s=20retry=20logic=20for=20ad-hoc=20tasks=20(?= =?UTF-8?q?#143860)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improving task manager retry logic * Fixing functional tests * Fixing logic --- .../server/task_running/task_runner.test.ts | 13 +++++++------ .../server/task_running/task_runner.ts | 14 +++++++++++--- .../test_suites/task_manager/task_management.ts | 4 ++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts b/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts index a9c58b1302f5..b66f4bc41864 100644 --- a/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts +++ b/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts @@ -28,6 +28,7 @@ import apm from 'elastic-apm-node'; import { executionContextServiceMock } from '@kbn/core/server/mocks'; import { usageCountersServiceMock } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counters_service.mock'; import { + calculateDelay, TASK_MANAGER_RUN_TRANSACTION_TYPE, TASK_MANAGER_TRANSACTION_TYPE, TASK_MANAGER_TRANSACTION_TYPE_MARK_AS_RUNNING, @@ -300,9 +301,8 @@ describe('TaskManagerRunner', () => { expect(instance.attempts).toEqual(initialAttempts + 1); expect(instance.status).toBe('running'); expect(instance.startedAt!.getTime()).toEqual(Date.now()); - expect(instance.retryAt!.getTime()).toEqual( - minutesFromNow((initialAttempts + 1) * 5).getTime() + timeoutMinutes * 60 * 1000 - ); + const expectedRunAt = Date.now() + calculateDelay(initialAttempts + 1); + expect(instance.retryAt!.getTime()).toEqual(expectedRunAt + timeoutMinutes * 60 * 1000); expect(instance.enabled).not.toBeDefined(); }); @@ -569,7 +569,7 @@ describe('TaskManagerRunner', () => { sinon.assert.calledWith(getRetryStub, initialAttempts + 1); const instance = store.update.mock.calls[0][0]; - const attemptDelay = (initialAttempts + 1) * 5 * 60 * 1000; + const attemptDelay = calculateDelay(initialAttempts + 1); const timeoutDelay = timeoutMinutes * 60 * 1000; expect(instance.retryAt!.getTime()).toEqual( new Date(Date.now() + attemptDelay + timeoutDelay).getTime() @@ -817,7 +817,8 @@ describe('TaskManagerRunner', () => { const instance = store.update.mock.calls[0][0]; expect(instance.id).toEqual(id); - expect(instance.runAt.getTime()).toEqual(minutesFromNow(initialAttempts * 5).getTime()); + const expectedRunAt = new Date(Date.now() + calculateDelay(initialAttempts)); + expect(instance.runAt.getTime()).toEqual(expectedRunAt.getTime()); expect(instance.params).toEqual({ a: 'b' }); expect(instance.state).toEqual({ hey: 'there' }); expect(instance.enabled).not.toBeDefined(); @@ -1169,7 +1170,7 @@ describe('TaskManagerRunner', () => { sinon.assert.calledWith(getRetryStub, initialAttempts, error); const instance = store.update.mock.calls[0][0]; - const expectedRunAt = new Date(Date.now() + initialAttempts * 5 * 60 * 1000); + const expectedRunAt = new Date(Date.now() + calculateDelay(initialAttempts)); expect(instance.runAt.getTime()).toEqual(expectedRunAt.getTime()); expect(instance.enabled).not.toBeDefined(); }); diff --git a/x-pack/plugins/task_manager/server/task_running/task_runner.ts b/x-pack/plugins/task_manager/server/task_running/task_runner.ts index a5865abc46bb..d2038621d6db 100644 --- a/x-pack/plugins/task_manager/server/task_running/task_runner.ts +++ b/x-pack/plugins/task_manager/server/task_running/task_runner.ts @@ -53,8 +53,6 @@ import { import { TaskTypeDictionary } from '../task_type_dictionary'; import { isUnrecoverableError } from './errors'; import type { EventLoopDelayConfig } from '../config'; - -const defaultBackoffPerFailure = 5 * 60 * 1000; export const EMPTY_RUN_RESULT: SuccessfulRunResult = { state: {} }; export const TASK_MANAGER_RUN_TRANSACTION_TYPE = 'task-run'; @@ -654,7 +652,7 @@ export class TaskManagerRunner implements TaskRunner { if (retry instanceof Date) { result = retry; } else if (retry === true) { - result = new Date(Date.now() + attempts * defaultBackoffPerFailure); + result = new Date(Date.now() + calculateDelay(attempts)); } // Add a duration to the result @@ -717,3 +715,13 @@ export function asRan(task: InstanceOf): RanTask task, }; } + +export function calculateDelay(attempts: number) { + if (attempts === 1) { + return 30 * 1000; // 30s + } else { + // get multiples of 5 min + const defaultBackoffPerFailure = 5 * 60 * 1000; + return defaultBackoffPerFailure * Math.pow(2, attempts - 2); + } +} diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts index c4b5a2831183..dadc32bca721 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/task_management.ts @@ -338,9 +338,9 @@ export default function ({ getService }: FtrProviderContext) { await retry.try(async () => { const scheduledTask = await currentTask(task.id); - expect(scheduledTask.attempts).to.be.greaterThan(0); + expect(scheduledTask.attempts).to.be.greaterThan(1); expect(Date.parse(scheduledTask.runAt)).to.be.greaterThan( - Date.parse(task.runAt) + 5 * 60 * 1000 + Date.parse(task.runAt) + 30 * 1000 ); }); }); From fc73de3cf213dc61e5090eff0bc477dda64fb37b Mon Sep 17 00:00:00 2001 From: Saarika <55930906+saarikabhasi@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:46:52 -0400 Subject: [PATCH 12/87] show '.ent-search-engine-documents' indices in create engine (#143914) * show '.ent-search-engine-documents' indices in create engine * Filter indices and aliases correctly * Fix expandWildcards on alwaysShowPattern * Fix Types error * Fix add deleted index in not Containing block and some i18n_check --fix Co-authored-by: Brian McGue Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../enterprise_search/common/types/indices.ts | 4 +++ .../server/__mocks__/fetch_indices.mock.ts | 34 +++++++++++++++++- .../server/lib/indices/fetch_indices.test.ts | 35 +++++++++++++++---- .../server/lib/indices/fetch_indices.ts | 27 +++++++++----- .../utils/extract_always_show_indices.test.ts | 4 +-- .../utils/extract_always_show_indices.ts | 8 ++--- .../lib/indices/utils/get_index_data.test.ts | 32 ++++++++++++++--- .../lib/indices/utils/get_index_data.ts | 16 ++++++--- .../routes/enterprise_search/indices.ts | 7 +++- 9 files changed, 137 insertions(+), 30 deletions(-) diff --git a/x-pack/plugins/enterprise_search/common/types/indices.ts b/x-pack/plugins/enterprise_search/common/types/indices.ts index 3fbd9dccb3ef..571a62cdd88f 100644 --- a/x-pack/plugins/enterprise_search/common/types/indices.ts +++ b/x-pack/plugins/enterprise_search/common/types/indices.ts @@ -15,6 +15,10 @@ import { import { Connector } from './connectors'; import { Crawler } from './crawler'; +export interface AlwaysShowPattern { + alias_pattern: string; + index_pattern: string; +} export interface ElasticsearchIndex { count: number; // Elasticsearch _count health?: HealthStatus; diff --git a/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts b/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts index bcdf0404e9ec..dc8d2b0b255e 100644 --- a/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts +++ b/x-pack/plugins/enterprise_search/server/__mocks__/fetch_indices.mock.ts @@ -67,6 +67,20 @@ export const mockMultiIndexResponse = { 'search-alias-search-prefixed-regular-index': {}, }, }, + '.ent-search-engine-documents-12345': { + aliases: { + 'alias-.ent-search-engine-documents-12345': {}, + 'search-alias-.ent-search-engine-documents-12345': {}, + }, + settings: { index: { hidden: 'true' } }, + }, + 'search-prefixed-.ent-search-engine-documents-12345': { + aliases: { + 'alias-search-prefixed-.ent-search-engine-documents-12345': {}, + 'search-alias-search-prefixed-.ent-search-engine-documents-12345': {}, + }, + settings: { index: { hidden: 'true' } }, + }, }; export const mockMultiStatsResponse: { @@ -109,6 +123,24 @@ export const mockMultiStatsResponse: { 'search-prefixed-regular-index': { ...mockSingleIndexStatsResponse.indices['search-regular-index'], }, + '.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'alias-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'search-alias-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'search-prefixed-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'alias-search-prefixed-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, + 'search-alias-search-prefixed-.ent-search-engine-documents-12345': { + ...mockSingleIndexStatsResponse.indices['search-regular-index'], + }, }, }; @@ -124,8 +156,8 @@ export const getIndexReturnValue = (indexName: string) => { ...mockMultiStatsResponse.indices[indexName], alias: indexName.startsWith('alias') || indexName.startsWith('search-alias'), count: 100, + hidden: indexName.includes('hidden') || indexName.includes('.ent-search-engine-documents'), name: indexName, - hidden: indexName.includes('hidden'), privileges: { manage: true, read: true }, total: { ...mockMultiStatsResponse.indices[indexName].total, diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts index 4a01295fbeaa..767587a26cf7 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.test.ts @@ -385,7 +385,13 @@ describe('fetchIndices lib function', () => { expect(mockClient.asCurrentUser.indices.stats).not.toHaveBeenCalled(); }); - describe('alwaysShowSearchPattern', () => { + describe('alwaysShowPattern', () => { + const sortIndices = (index1: any, index2: any) => { + if (index1.name < index2.name) return -1; + if (index1.name > index2.name) return 1; + return 0; + }; + beforeEach(() => { mockClient.asCurrentUser.indices.get.mockImplementation(() => mockMultiIndexResponse); mockClient.asCurrentUser.indices.stats.mockImplementation(() => mockMultiStatsResponse); @@ -401,13 +407,14 @@ describe('fetchIndices lib function', () => { '*', false, true, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); // This is the list of mock indices and aliases that are: // - Non-hidden indices and aliases + // - hidden indices that starts with ".ent-search-engine-documents" // - search- prefixed aliases that point to hidden indices - expect(returnValue).toEqual( + expect(returnValue.sort(sortIndices)).toEqual( [ 'regular-index', 'alias-regular-index', @@ -415,9 +422,14 @@ describe('fetchIndices lib function', () => { 'search-prefixed-regular-index', 'alias-search-prefixed-regular-index', 'search-alias-search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-alias-.ent-search-engine-documents-12345', + 'search-alias-search-prefixed-.ent-search-engine-documents-12345', 'search-alias-hidden-index', 'search-alias-search-prefixed-hidden-index', - ].map(getIndexReturnValue) + ] + .map(getIndexReturnValue) + .sort(sortIndices) ); // This is the list of mock indices and aliases that are: @@ -430,6 +442,9 @@ describe('fetchIndices lib function', () => { 'search-prefixed-hidden-index', 'alias-hidden-index', 'alias-search-prefixed-hidden-index', + 'alias-.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', + 'alias-search-prefixed-.ent-search-engine-documents-12345', ].map(getIndexReturnValue) ) ); @@ -463,11 +478,19 @@ describe('fetchIndices lib function', () => { '*', true, true, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); expect(returnValue).toEqual( - expect.arrayContaining(Object.keys(mockMultiStatsResponse.indices).map(getIndexReturnValue)) + expect.not.arrayContaining(['alias-.ent-search-engine-documents-12345']) + ); + + // this specific alias should not be returned because... + const expectedIndices = Object.keys(mockMultiStatsResponse.indices).filter( + (indexName) => indexName !== 'alias-.ent-search-engine-documents-12345' + ); + expect(returnValue.sort(sortIndices)).toEqual( + expectedIndices.map(getIndexReturnValue).sort(sortIndices) ); expect(mockClient.asCurrentUser.indices.get).toHaveBeenCalledWith({ diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts index fd9180ba7113..e0a1750d2a8e 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/fetch_indices.ts @@ -13,7 +13,7 @@ import { } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { IScopedClusterClient } from '@kbn/core/server'; -import { ElasticsearchIndexWithPrivileges } from '../../../common/types/indices'; +import { AlwaysShowPattern, ElasticsearchIndexWithPrivileges } from '../../../common/types/indices'; import { fetchIndexCounts } from './fetch_index_counts'; import { fetchIndexPrivileges } from './fetch_index_privileges'; @@ -34,12 +34,14 @@ export const fetchIndices = async ( indexPattern: string, returnHiddenIndices: boolean, includeAliases: boolean, - alwaysShowSearchPattern?: 'search-' + alwaysShowPattern?: AlwaysShowPattern ): Promise => { // This call retrieves alias and settings information about indices - // If we provide an override pattern with alwaysShowSearchPattern we get everything and filter out hiddens. + // If we provide an override pattern with alwaysShowPattern we get everything and filter out hiddens. const expandWildcards: ExpandWildcard[] = - returnHiddenIndices || alwaysShowSearchPattern ? ['hidden', 'all'] : ['open']; + returnHiddenIndices || alwaysShowPattern?.alias_pattern || alwaysShowPattern?.index_pattern + ? ['hidden', 'all'] + : ['open']; const { allIndexMatches, indexAndAliasNames, indicesNames, alwaysShowMatchNames } = await getIndexData( @@ -48,7 +50,7 @@ export const fetchIndices = async ( expandWildcards, returnHiddenIndices, includeAliases, - alwaysShowSearchPattern + alwaysShowPattern ); if (indicesNames.length === 0) { @@ -80,19 +82,28 @@ export const fetchIndices = async ( privileges: { manage: false, read: false, ...indexPrivileges[name] }, }; return includeAliases - ? [indexEntry, ...expandAliases(name, aliases, indexData, totalIndexData)] + ? [ + indexEntry, + ...expandAliases( + name, + aliases, + indexData, + totalIndexData, + ...(name.startsWith('.ent-search-engine-documents') ? [alwaysShowPattern] : []) + ), + ] : [indexEntry]; }); let indicesData = regularIndexData; - if (alwaysShowSearchPattern && includeAliases) { + if (alwaysShowPattern?.alias_pattern && includeAliases) { const indexNamesAlreadyIncluded = regularIndexData.map(({ name }) => name); const itemsToInclude = getAlwaysShowAliases(indexNamesAlreadyIncluded, alwaysShowMatchNames) .map(getIndexDataMapper(totalIndexData)) .flatMap(({ name, aliases, ...indexData }) => { - return expandAliases(name, aliases, indexData, totalIndexData, alwaysShowSearchPattern); + return expandAliases(name, aliases, indexData, totalIndexData, alwaysShowPattern); }); indicesData = [...indicesData, ...itemsToInclude]; diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts index 927109359c31..720cbb9e0484 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.test.ts @@ -87,13 +87,13 @@ describe('expandAliases util function', () => { ]); }); - it('expands only aliases that starts with alwaysShowSearchPattern', () => { + it('expands only aliases that starts with alwaysShowPattern', () => { const expandedAliasList = expandAliases( mockIndexName, mockAliases, mockIndex, mockIndicesData, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); expect(expandedAliasList).toEqual([ diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts index 47103639b786..55a17bf7ba0f 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/extract_always_show_indices.ts @@ -7,7 +7,7 @@ import { SecurityHasPrivilegesPrivileges } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ElasticsearchIndex } from '../../../../common/types/indices'; +import { AlwaysShowPattern, ElasticsearchIndex } from '../../../../common/types/indices'; export const getAlwaysShowAliases = (indexAndAliasNames: string[], alwaysShowNames: string[]) => { if (alwaysShowNames.length === 0) return []; @@ -23,10 +23,10 @@ export const expandAliases = ( indexCounts: Record; indexPrivileges: Record; }, - alwaysShowSearchPattern?: 'search-' + alwaysShowPattern?: AlwaysShowPattern ) => { - const filteredAliases = alwaysShowSearchPattern - ? aliases.filter((alias) => alias.startsWith(alwaysShowSearchPattern)) + const filteredAliases = alwaysShowPattern + ? aliases.filter((alias) => alias.startsWith(alwaysShowPattern.alias_pattern)) : aliases; return filteredAliases.map((alias) => ({ alias: true, diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts index 7e9859a4e807..cfbec2012bb7 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.test.ts @@ -116,12 +116,16 @@ describe('getIndexData util function', () => { 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], indicesNames: [ 'hidden-index', 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], }); }); @@ -164,21 +168,29 @@ describe('getIndexData util function', () => { 'search-prefixed-regular-index', 'alias-search-prefixed-regular-index', 'search-alias-search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'alias-.ent-search-engine-documents-12345', + 'search-alias-.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', + 'alias-search-prefixed-.ent-search-engine-documents-12345', + 'search-alias-search-prefixed-.ent-search-engine-documents-12345', ], indicesNames: [ 'hidden-index', 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], }); }); // This is a happy path tests for a case where we set all parameter on route // There are other possible cases where if you set includeAliases to false and still - // pass a search- pattern. you will get some weird results back. It won't be false but + // pass a 'search-' pattern and '.ent-search-engine-documents'. you will get some weird results back. It won't be false but // useless. These will go away on the next iterations we have. - it('returns non-hidden and alwaysShowSearchPattern matching indices', async () => { + it('returns non-hidden and alwaysShowPattern matching indices ', async () => { mockClient.asCurrentUser.indices.get.mockImplementationOnce(() => { return mockMultiIndexResponse; }); @@ -189,7 +201,7 @@ describe('getIndexData util function', () => { ['hidden', 'all'], false, true, - 'search-' + { alias_pattern: 'search-', index_pattern: '.ent-search-engine-documents' } ); expect(mockClient.asCurrentUser.indices.get).toHaveBeenCalledWith({ @@ -206,6 +218,8 @@ describe('getIndexData util function', () => { 'regular-index', 'search-prefixed-hidden-index', 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', ], expandWildcards: ['hidden', 'all'], indexAndAliasNames: [ @@ -221,8 +235,18 @@ describe('getIndexData util function', () => { 'search-prefixed-regular-index', 'alias-search-prefixed-regular-index', 'search-alias-search-prefixed-regular-index', + '.ent-search-engine-documents-12345', + 'alias-.ent-search-engine-documents-12345', + 'search-alias-.ent-search-engine-documents-12345', + 'search-prefixed-.ent-search-engine-documents-12345', + 'alias-search-prefixed-.ent-search-engine-documents-12345', + 'search-alias-search-prefixed-.ent-search-engine-documents-12345', + ], + indicesNames: [ + 'regular-index', + 'search-prefixed-regular-index', + '.ent-search-engine-documents-12345', ], - indicesNames: ['regular-index', 'search-prefixed-regular-index'], }); }); }); diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts index e3c667141e95..7ac4b8d2d858 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/utils/get_index_data.ts @@ -9,6 +9,8 @@ import { ExpandWildcard } from '@elastic/elasticsearch/lib/api/types'; import { IScopedClusterClient } from '@kbn/core/server'; +import { AlwaysShowPattern } from '../../../../common/types/indices'; + import { TotalIndexData } from '../fetch_indices'; import { mapIndexStats } from './map_index_stats'; @@ -19,7 +21,7 @@ export const getIndexData = async ( expandWildcards: ExpandWildcard[], returnHiddenIndices: boolean, includeAliases: boolean, - alwaysShowSearchPattern?: 'search-' + alwaysShowPattern?: AlwaysShowPattern ) => { const totalIndices = await client.asCurrentUser.indices.get({ expand_wildcards: expandWildcards, @@ -31,7 +33,7 @@ export const getIndexData = async ( index: indexPattern, }); - // Index names that with one of their aliases match with the alwaysShowSearchPattern + // Index names that with one of their aliases match with the alwaysShowPattern const alwaysShowPatternMatches = new Set(); const indexAndAliasNames: string[] = Object.keys(totalIndices).reduce( @@ -44,7 +46,10 @@ export const getIndexData = async ( accum.push(alias); // Add indexName to the set if an alias matches the pattern - if (alwaysShowSearchPattern && alias.startsWith(alwaysShowSearchPattern)) { + if ( + alwaysShowPattern?.alias_pattern && + alias.startsWith(alwaysShowPattern?.alias_pattern) + ) { alwaysShowPatternMatches.add(indexName); } }); @@ -57,7 +62,10 @@ export const getIndexData = async ( const indicesNames = returnHiddenIndices ? Object.keys(totalIndices) : Object.keys(totalIndices).filter( - (indexName) => !(totalIndices[indexName]?.settings?.index?.hidden === 'true') + (indexName) => + !(totalIndices[indexName]?.settings?.index?.hidden === 'true') || + (alwaysShowPattern?.index_pattern && + indexName.startsWith(alwaysShowPattern.index_pattern)) ); return { allIndexMatches: totalIndices, diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts index aa6c4f5c3db7..25fbac7328f7 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts @@ -16,6 +16,7 @@ import { i18n } from '@kbn/i18n'; import { DEFAULT_PIPELINE_NAME } from '../../../common/constants'; import { ErrorCode } from '../../../common/types/error_codes'; +import { AlwaysShowPattern } from '../../../common/types/indices'; import type { CreateMlInferencePipelineResponse, @@ -63,7 +64,11 @@ export function registerIndexRoutes({ { path: '/internal/enterprise_search/search_indices', validate: false }, elasticsearchErrorHandler(log, async (context, _, response) => { const { client } = (await context.core).elasticsearch; - const indices = await fetchIndices(client, '*', false, true, 'search-'); + const patterns: AlwaysShowPattern = { + alias_pattern: 'search-', + index_pattern: '.ent-search-engine-documents', + }; + const indices = await fetchIndices(client, '*', false, true, patterns); return response.ok({ body: indices, From 86d33de9b2e673b454ecb90c783a1f2d917b154a Mon Sep 17 00:00:00 2001 From: Kevin Logan <56395104+kevinlog@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:54:53 -0400 Subject: [PATCH 13/87] [Security Solution] Add Respond button to launch Response Console from Host Details (#143988) --- .../security_solution/hosts/common/index.ts | 1 + .../components/header_page/index.test.tsx | 13 ++++ .../common/components/header_page/index.tsx | 4 +- .../responder_action_button.tsx | 49 ++++++++++++ .../responder_context_menu_item.tsx | 77 +++---------------- .../endpoint_responder/translations.ts | 27 +++++++ .../use_responder_action_data.ts | 72 +++++++++++++++++ .../take_action_dropdown/index.test.tsx | 2 +- .../public/hosts/pages/details/index.tsx | 6 ++ .../factory/hosts/details/helpers.ts | 1 + 10 files changed, 182 insertions(+), 70 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_action_button.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/components/endpoint_responder/translations.ts create mode 100644 x-pack/plugins/security_solution/public/detections/components/endpoint_responder/use_responder_action_data.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts index ab2c2d4d7c94..15e2d99772af 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts @@ -32,6 +32,7 @@ export interface EndpointFields { /** A count of pending endpoint actions against the host */ pendingActions?: Maybe; elasticAgentStatus?: Maybe; + fleetAgentId?: Maybe; id?: Maybe; } diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx index eef91978bba2..762ce80c7c6a 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx @@ -138,4 +138,17 @@ describe('HeaderPage', () => { ); expect(securitySolutionHeaderPage).not.toHaveStyleRule('padding-bottom', euiDarkVars.euiSizeL); }); + + test('it renders the right side items', () => { + const wrapper = mount( + + {'Right side item'}]} + /> + + ); + + expect(wrapper.find('[data-test-subj="right-side-item"]').exists()).toBe(true); + }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx b/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx index 0e6a51fdb268..39988e566600 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx @@ -69,6 +69,7 @@ export interface HeaderPageProps extends HeaderProps { subtitle2?: SubtitleProps['items']; title: TitleProp; titleNode?: React.ReactElement; + rightSideItems?: React.ReactNode[]; } export const HeaderLinkBack: React.FC<{ backOptions: BackOptions }> = React.memo( @@ -108,9 +109,10 @@ const HeaderPageComponent: React.FC = ({ subtitle2, title, titleNode, + rightSideItems, }) => ( <> - + {backOptions && } {!backOptions && backComponent && <>{backComponent}} diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_action_button.tsx b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_action_button.tsx new file mode 100644 index 000000000000..6701d6e5cb36 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_action_button.tsx @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiButton, EuiToolTip } from '@elastic/eui'; +import React, { memo } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + type ResponderContextMenuItemProps, + useResponderActionData, +} from './use_responder_action_data'; +import { useUserPrivileges } from '../../../common/components/user_privileges'; + +export const ResponderActionButton = memo( + ({ endpointId, onClick }) => { + const { handleResponseActionsClick, isDisabled, tooltip } = useResponderActionData({ + endpointId, + onClick, + }); + const endpointPrivileges = useUserPrivileges().endpointPrivileges; + + if (!endpointPrivileges.canAccessResponseConsole) { + return null; + } + + const actionButtonKey = 'endpointResponseActions-action-button'; + + return ( + + + + + + ); + } +); +ResponderActionButton.displayName = 'ResponderActionButton'; diff --git a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx index 9a6428b183d6..9d50884b6864 100644 --- a/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/endpoint_responder/responder_context_menu_item.tsx @@ -6,78 +6,19 @@ */ import { EuiContextMenuItem } from '@elastic/eui'; -import type { ReactNode } from 'react'; -import React, { memo, useCallback, useMemo } from 'react'; +import React, { memo } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; -import { i18n } from '@kbn/i18n'; -import { useGetEndpointDetails, useWithShowEndpointResponder } from '../../../management/hooks'; -import { HostStatus } from '../../../../common/endpoint/types'; - -export const NOT_FROM_ENDPOINT_HOST_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.notSupportedTooltip', - { - defaultMessage: 'Add the Elastic Defend integration via Elastic Agent to enable this feature', - } -); -export const HOST_ENDPOINT_UNENROLLED_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.unenrolledTooltip', - { defaultMessage: 'Host is no longer enrolled with the Elastic Defend integration' } -); -export const LOADING_ENDPOINT_DATA_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.loadingTooltip', - { defaultMessage: 'Loading' } -); -export const METADATA_API_ERROR_TOOLTIP = i18n.translate( - 'xpack.securitySolution.endpoint.detections.takeAction.responseActionConsole.generalMetadataErrorTooltip', - { defaultMessage: 'Failed to retrieve Endpoint metadata' } -); - -export interface ResponderContextMenuItemProps { - endpointId: string; - onClick?: () => void; -} +import { + type ResponderContextMenuItemProps, + useResponderActionData, +} from './use_responder_action_data'; export const ResponderContextMenuItem = memo( ({ endpointId, onClick }) => { - const showEndpointResponseActionsConsole = useWithShowEndpointResponder(); - const { - data: endpointHostInfo, - isFetching, - error, - } = useGetEndpointDetails(endpointId, { enabled: Boolean(endpointId) }); - - const [isDisabled, tooltip]: [disabled: boolean, tooltip: ReactNode] = useMemo(() => { - if (!endpointId) { - return [true, NOT_FROM_ENDPOINT_HOST_TOOLTIP]; - } - - // Still loading Endpoint host info - if (isFetching) { - return [true, LOADING_ENDPOINT_DATA_TOOLTIP]; - } - - // if we got an error and it's a 400 with unenrolled in the error message (alerts can exist for endpoint that are no longer around) - // or, - // the Host status is `unenrolled` - if ( - (error && error.body?.statusCode === 400 && error.body?.message.includes('unenrolled')) || - endpointHostInfo?.host_status === HostStatus.UNENROLLED - ) { - return [true, HOST_ENDPOINT_UNENROLLED_TOOLTIP]; - } - - // return general error tooltip - if (error) { - return [true, METADATA_API_ERROR_TOOLTIP]; - } - - return [false, undefined]; - }, [endpointHostInfo, endpointId, error, isFetching]); - - const handleResponseActionsClick = useCallback(() => { - if (endpointHostInfo) showEndpointResponseActionsConsole(endpointHostInfo.metadata); - if (onClick) onClick(); - }, [endpointHostInfo, onClick, showEndpointResponseActionsConsole]); + const { handleResponseActionsClick, isDisabled, tooltip } = useResponderActionData({ + endpointId, + onClick, + }); return ( void; +} + +export const useResponderActionData = ({ + endpointId, + onClick, +}: ResponderContextMenuItemProps): { + handleResponseActionsClick: () => void; + isDisabled: boolean; + tooltip: ReactNode; +} => { + const showEndpointResponseActionsConsole = useWithShowEndpointResponder(); + const { + data: endpointHostInfo, + isFetching, + error, + } = useGetEndpointDetails(endpointId, { enabled: Boolean(endpointId) }); + + const [isDisabled, tooltip]: [disabled: boolean, tooltip: ReactNode] = useMemo(() => { + if (!endpointId) { + return [true, NOT_FROM_ENDPOINT_HOST_TOOLTIP]; + } + + // Still loading Endpoint host info + if (isFetching) { + return [true, LOADING_ENDPOINT_DATA_TOOLTIP]; + } + + // if we got an error and it's a 400 with unenrolled in the error message (alerts can exist for endpoint that are no longer around) + // or, + // the Host status is `unenrolled` + if ( + (error && error.body?.statusCode === 400 && error.body?.message.includes('unenrolled')) || + endpointHostInfo?.host_status === HostStatus.UNENROLLED + ) { + return [true, HOST_ENDPOINT_UNENROLLED_TOOLTIP]; + } + + // return general error tooltip + if (error) { + return [true, METADATA_API_ERROR_TOOLTIP]; + } + + return [false, undefined]; + }, [endpointHostInfo, endpointId, error, isFetching]); + + const handleResponseActionsClick = useCallback(() => { + if (endpointHostInfo) showEndpointResponseActionsConsole(endpointHostInfo.metadata); + if (onClick) onClick(); + }, [endpointHostInfo, onClick, showEndpointResponseActionsConsole]); + + return { handleResponseActionsClick, isDisabled, tooltip }; +}; diff --git a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx index e6aa1b8efd1b..6d93f5645b6e 100644 --- a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx @@ -26,7 +26,7 @@ import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_exper import { NOT_FROM_ENDPOINT_HOST_TOOLTIP, HOST_ENDPOINT_UNENROLLED_TOOLTIP, -} from '../endpoint_responder/responder_context_menu_item'; +} from '../endpoint_responder/translations'; import { endpointMetadataHttpMocks } from '../../../management/pages/endpoint_hosts/mocks'; import type { HttpSetup } from '@kbn/core/public'; import { diff --git a/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx b/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx index 9d430654c774..7f09845c5108 100644 --- a/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx +++ b/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx @@ -64,6 +64,7 @@ import { useSourcererDataView } from '../../../common/containers/sourcerer'; import { LandingPageComponent } from '../../../common/components/landing_page'; import { AlertCountByRuleByStatus } from '../../../common/components/alert_count_by_status'; import { useLicense } from '../../../common/hooks/use_license'; +import { ResponderActionButton } from '../../../detections/components/endpoint_responder/responder_action_button'; const ES_HOST_FIELD = 'host.hostname'; const HostOverviewManage = manageQuery(HostOverview); @@ -187,6 +188,11 @@ const HostDetailsComponent: React.FC = ({ detailName, hostDeta /> } title={detailName} + rightSideItems={[ + hostOverview.endpoint?.fleetAgentId && ( + + ), + ]} /> Date: Mon, 31 Oct 2022 11:14:13 -0400 Subject: [PATCH 14/87] [ResponseOps][Actions] support mustache context variables with periods in the name (#143703) * Converting names with periods to objects * Adding tests * Fixing bug * Fixing comment * Adding new test --- .../server/lib/mustache_renderer.test.ts | 71 +++++++++++++++++++ .../actions/server/lib/mustache_renderer.ts | 28 +++++++- 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts b/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts index 4fa76f5a133c..964a793d8f81 100644 --- a/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts +++ b/x-pack/plugins/actions/server/lib/mustache_renderer.test.ts @@ -340,4 +340,75 @@ describe('mustache_renderer', () => { const expected = '1 - {"c":2,"d":[3,4]} -- 5,{"f":6,"g":7}'; expect(renderMustacheString('{{a}} - {{b}} -- {{e}}', deepVariables, 'none')).toEqual(expected); }); + + describe('converting dot variables', () => { + it('handles multiple dots', () => { + const dotVariables = { + context: [ + { + _index: '.internal.alerts-observability.metrics.alerts-default-000001', + _id: 'a8616ced-c22b-466c-a964-8db53af930ef', + '_score.test': 1, + _source: { + 'kibana.alert.rule.category': 'Metric threshold', + 'kibana.alert.rule.consumer': 'infrastructure', + 'kibana.alert.rule.execution.uuid': 'c42da290-30be-4e90-a7fb-75e160bac758', + 'kibana.alert.rule.name': 'test rule', + 'kibana.alert.rule.producer': 'infrastructure', + 'kibana.alert.rule.rule_type_id': 'metrics.alert.threshold', + 'kibana.alert.rule.uuid': '534c0f20-5533-11ed-b0da-c1155191eec9', + 'kibana.space_ids': ['default'], + 'kibana.alert.rule.tags': [], + '@timestamp': '2022-10-26T13:50:06.516Z', + 'kibana.alert.reason': + 'event.duration is 235,545,454.54545 in the last 1 min for execute. Alert when > 0.', + 'kibana.alert.duration.us': 759925000, + 'kibana.alert.time_range': { + gte: '2022-10-26T13:37:26.591Z', + }, + 'kibana.alert.instance.id': 'execute', + 'kibana.alert.start': '2022-10-26T13:37:26.591Z', + 'kibana.alert.uuid': 'a8616ced-c22b-466c-a964-8db53af930ef', + 'kibana.alert.status': 'active', + 'kibana.alert.workflow_status': 'open', + 'event.kind': 'signal', + 'event.action': 'active', + 'kibana.version': '8.6.0', + tags: [], + }, + }, + ], + }; + + expect( + renderMustacheObject( + { + x: '{{context.0._source.kibana.alert.rule.category}} - {{context.0._score.test}} - {{context.0._source.kibana.alert.time_range.gte}}', + }, + dotVariables + ) + ).toMatchInlineSnapshot(` + Object { + "x": "Metric threshold - 1 - 2022-10-26T13:37:26.591Z", + } + `); + + expect( + renderMustacheString( + '{{context.0._source.kibana.alert.rule.category}} - {{context.0._score.test}} - {{context.0._source.kibana.alert.time_range.gte}}', + dotVariables, + 'none' + ) + ).toEqual('Metric threshold - 1 - 2022-10-26T13:37:26.591Z'); + }); + + it('should replace single value with the object', () => { + expect(renderMustacheObject({ x: '{{a}}' }, { a: 1, 'a.b': 2 })).toMatchInlineSnapshot(` + Object { + "x": "{\\"b\\":2}", + } + `); + expect(renderMustacheString('{{a}}', { a: 1, 'a.b': 2 }, 'none')).toEqual('{"b":2}'); + }); + }); }); diff --git a/x-pack/plugins/actions/server/lib/mustache_renderer.ts b/x-pack/plugins/actions/server/lib/mustache_renderer.ts index 3602cebaa7bf..fc4381fa0c9c 100644 --- a/x-pack/plugins/actions/server/lib/mustache_renderer.ts +++ b/x-pack/plugins/actions/server/lib/mustache_renderer.ts @@ -6,7 +6,7 @@ */ import Mustache from 'mustache'; -import { isString, isPlainObject, cloneDeepWith } from 'lodash'; +import { isString, isPlainObject, cloneDeepWith, merge } from 'lodash'; export type Escape = 'markdown' | 'slack' | 'json' | 'none'; type Variables = Record; @@ -57,10 +57,36 @@ export function renderMustacheObject(params: Params, variables: Variable // return variables cloned, with a toString() added to objects function augmentObjectVariables(variables: Variables): Variables { const result = JSON.parse(JSON.stringify(variables)); + // convert variables with '.' in the name to objects + convertDotVariables(result); addToStringDeep(result); return result; } +function convertDotVariables(variables: Variables) { + Object.keys(variables).forEach((key) => { + if (key.includes('.')) { + const obj = buildObject(key, variables[key]); + variables = merge(variables, obj); + } + if (typeof variables[key] === 'object' && variables[key] != null) { + convertDotVariables(variables[key] as Variables); + } + }); +} + +function buildObject(key: string, value: unknown) { + const newObject: Variables = {}; + let tempObject = newObject; + const splits = key.split('.'); + const length = splits.length - 1; + splits.forEach((k, index) => { + tempObject[k] = index === length ? value : ({} as unknown); + tempObject = tempObject[k] as Variables; + }); + return newObject; +} + function addToStringDeep(object: unknown): void { // for objects, add a toString method, and then walk if (isNonNullObject(object)) { From 8eeba8b22baf6312e66b7ce730e7a43e079ff11e Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 31 Oct 2022 09:17:50 -0600 Subject: [PATCH 15/87] [Maps] capture metrics for layer_groups in telemetry (#144068) * [Maps] capture metrics for layer_groups in telemetry * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * tslint fixes * telemetry_check fixes * fix jest test Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../telemetry/layer_stats_collector.test.ts | 10 +++++-- .../common/telemetry/layer_stats_collector.ts | 12 +++++--- .../sample_map_saved_objects.json | 2 +- x-pack/plugins/maps/common/telemetry/types.ts | 1 + .../maps_telemetry/collectors/register.ts | 12 ++++++++ .../map_stats/map_stats_collector.test.ts | 15 ++++++++-- .../schema/xpack_plugins.json | 28 +++++++++++++++++++ 7 files changed, 70 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts index fbdfad705a0d..1b9c6adfa2eb 100644 --- a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts +++ b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.test.ts @@ -12,14 +12,14 @@ import { MapSavedObjectAttributes } from '../map_saved_object_type'; const expecteds = [ { - layerCount: 3, + layerCount: 4, basemapCounts: { roadmap: 1 }, joinCounts: {}, - layerCounts: { ems_basemap: 1, ems_region: 1, es_agg_clusters: 1 }, + layerCounts: { ems_basemap: 1, ems_region: 1, es_agg_clusters: 1, layer_group: 1 }, resolutionCounts: { coarse: 1 }, scalingCounts: {}, emsFileCounts: { italy_provinces: 1 }, - layerTypeCounts: { TILE: 1, GEOJSON_VECTOR: 2 }, + layerTypeCounts: { GEOJSON_VECTOR: 2, LAYER_GROUP: 1, TILE: 1 }, sourceCount: 3, }, { @@ -93,6 +93,10 @@ describe.each(testsToRun)('LayerStatsCollector %#', (attributes, expected) => { expect(statsCollector.getLayerCounts()).toEqual(expected.layerCounts); }); + test('getLayerTypeCounts', () => { + expect(statsCollector.getLayerTypeCounts()).toEqual(expected.layerTypeCounts); + }); + test('getResolutionCounts', () => { expect(statsCollector.getResolutionCounts()).toEqual(expected.resolutionCounts); }); diff --git a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts index 0978b3ace87e..e31f4120194f 100644 --- a/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts +++ b/x-pack/plugins/maps/common/telemetry/layer_stats_collector.ts @@ -155,14 +155,18 @@ function getJoinKey(layerDescriptor: LayerDescriptor): JOIN_KEYS | null { } function getLayerKey(layerDescriptor: LayerDescriptor): LAYER_KEYS | null { - if (!layerDescriptor.sourceDescriptor) { - return null; - } - if (layerDescriptor.type === LAYER_TYPE.HEATMAP) { return LAYER_KEYS.ES_AGG_HEATMAP; } + if (layerDescriptor.type === LAYER_TYPE.LAYER_GROUP) { + return LAYER_KEYS.LAYER_GROUP; + } + + if (!layerDescriptor.sourceDescriptor) { + return null; + } + if (layerDescriptor.sourceDescriptor.type === SOURCE_TYPES.EMS_FILE) { return LAYER_KEYS.EMS_REGION; } diff --git a/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json b/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json index 908bacb091ae..a8efb534de5c 100644 --- a/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json +++ b/x-pack/plugins/maps/common/telemetry/test_resources/sample_map_saved_objects.json @@ -6,7 +6,7 @@ "title": "Italy Map", "description": "", "mapStateJSON": "{\"zoom\":4.82,\"center\":{\"lon\":11.41545,\"lat\":42.0865},\"timeFilters\":{\"from\":\"now-15w\",\"to\":\"now\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":0},\"query\":{\"language\":\"lucene\",\"query\":\"\"}}", - "layerListJSON": "[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"italy_provinces\"},\"id\":\"0oye8\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#0c1f70\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}}},\"type\":\"GEOJSON_VECTOR\"},{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"053fe296-f5ae-4cb0-9e73-a5752cb9ba74\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"resolution\":\"COARSE\"},\"id\":\"1gx22\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"minSize\":4,\"maxSize\":32}}}},\"type\":\"GEOJSON_VECTOR\"}]", + "layerListJSON": "[{\"id\":\"123\",\"label\":\"Layer Group\",\"sourceDescriptor\":null,\"type\":\"LAYER_GROUP\"},{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"road_map\"},\"id\":\"csq5v\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.65,\"visible\":true,\"style\":{\"type\":\"TILE\",\"properties\":{}},\"type\":\"TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_FILE\",\"id\":\"italy_provinces\"},\"id\":\"0oye8\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#0c1f70\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":10}}}},\"type\":\"GEOJSON_VECTOR\"},{\"sourceDescriptor\":{\"type\":\"ES_GEO_GRID\",\"id\":\"053fe296-f5ae-4cb0-9e73-a5752cb9ba74\",\"indexPatternId\":\"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\"geoField\":\"DestLocation\",\"requestType\":\"point\",\"resolution\":\"COARSE\"},\"id\":\"1gx22\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"fillColor\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"color\":\"Greens\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":1}},\"iconSize\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"Count\",\"name\":\"doc_count\",\"origin\":\"source\"},\"minSize\":4,\"maxSize\":32}}}},\"type\":\"GEOJSON_VECTOR\"}]", "uiStateJSON": "{}" }, "references": [ diff --git a/x-pack/plugins/maps/common/telemetry/types.ts b/x-pack/plugins/maps/common/telemetry/types.ts index 7b0dfc4eae3b..b0d740bf4f23 100644 --- a/x-pack/plugins/maps/common/telemetry/types.ts +++ b/x-pack/plugins/maps/common/telemetry/types.ts @@ -29,6 +29,7 @@ export enum LAYER_KEYS { EMS_REGION = 'ems_region', EMS_BASEMAP = 'ems_basemap', KBN_TMS_RASTER = 'kbn_tms_raster', + LAYER_GROUP = 'layer_group', UX_TMS_RASTER = 'ux_tms_raster', // configured in the UX layer wizard of Maps UX_TMS_MVT = 'ux_tms_mvt', // configured in the UX layer wizard of Maps UX_WMS = 'ux_wms', // configured in the UX layer wizard of Maps diff --git a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts index 24b2707064c3..9f2e520c428a 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/collectors/register.ts @@ -166,6 +166,18 @@ export function registerMapsUsageCollector(usageCollection?: UsageCollectionSetu _meta: { description: 'total number of kbn tms layers in cluster' }, }, }, + layer_group: { + min: { type: 'long', _meta: { description: 'min number of layer groups per map' } }, + max: { type: 'long', _meta: { description: 'max number of layer groups per map' } }, + avg: { + type: 'float', + _meta: { description: 'avg number of layer groups per map' }, + }, + total: { + type: 'long', + _meta: { description: 'total number of layer groups in cluster' }, + }, + }, ux_tms_mvt: { min: { type: 'long', _meta: { description: 'min number of ux tms-mvt layers per map' } }, max: { type: 'long', _meta: { description: 'max number of ux tms-mvt layers per map' } }, diff --git a/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts b/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts index 48860338ae11..a4dd0df8e271 100644 --- a/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts +++ b/x-pack/plugins/maps/server/maps_telemetry/map_stats/map_stats_collector.test.ts @@ -84,6 +84,12 @@ test('returns expected telemetry data from saved objects', () => { min: 1, total: 1, }, + layer_group: { + avg: 0.2, + max: 1, + min: 1, + total: 1, + }, }, scalingOptions: { limit: { @@ -151,6 +157,11 @@ test('returns expected telemetry data from saved objects', () => { max: 1, min: 1, }, + LAYER_GROUP: { + avg: 0.2, + max: 1, + min: 1, + }, TILE: { avg: 0.6, max: 1, @@ -163,8 +174,8 @@ test('returns expected telemetry data from saved objects', () => { }, }, layersCount: { - avg: 2, - max: 3, + avg: 2.2, + max: 4, min: 1, }, }, diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index aa1ad2036316..af3909524508 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -5618,6 +5618,34 @@ } } }, + "layer_group": { + "properties": { + "min": { + "type": "long", + "_meta": { + "description": "min number of layer groups per map" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "max number of layer groups per map" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "avg number of layer groups per map" + } + }, + "total": { + "type": "long", + "_meta": { + "description": "total number of layer groups in cluster" + } + } + } + }, "ux_tms_mvt": { "properties": { "min": { From 026de51644cc38dd35488fae8765e191abd091be Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Mon, 31 Oct 2022 08:18:35 -0700 Subject: [PATCH 16/87] Update CODEOWNERS (#143554) --- .github/CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f536168edb6e..974afddddef6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -205,6 +205,7 @@ /x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/ @elastic/ml-ui /x-pack/test/screenshot_creation/apps/ml_docs @elastic/ml-ui /x-pack/test/screenshot_creation/services/ml_screenshots.ts @elastic/ml-ui +/docs/api/machine-learning/ @elastic/mlr-docs # Additional plugins and packages maintained by the ML team. /x-pack/plugins/aiops/ @elastic/ml-ui @@ -352,6 +353,8 @@ /x-pack/test/functional/services/cases/ @elastic/response-ops /x-pack/test/functional_with_es_ssl/apps/cases/ @elastic/response-ops /x-pack/test/api_integration/apis/cases/ @elastic/response-ops +/docs/api/cases @elastic/mlr-docs +/x-pack/plugins/cases/docs/openapi @elastic/mlr-docs # Enterprise Search /x-pack/plugins/enterprise_search @elastic/enterprise-search-frontend From aa9614d792f24937b63ece85b153b16177fd619e Mon Sep 17 00:00:00 2001 From: Lukas Olson Date: Mon, 31 Oct 2022 08:47:33 -0700 Subject: [PATCH 17/87] Fix autocomplete value suggestion time range (#144134) * fix: autocomplete time range rounding * Use absolute date so tests will actually pass for longer than a day Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../value_suggestion_provider.test.ts | 39 +++++++++++++------ .../providers/value_suggestion_provider.ts | 2 +- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts index 310e3d402df3..07dbf4eacec2 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.test.ts @@ -21,24 +21,19 @@ describe('FieldSuggestions', () => { const uiSettings = { get: (key: string) => uiConfig[key], } as IUiSettingsClient; + let getTimeMock: jest.Mock; + let createFilterMock: jest.Mock; beforeEach(() => { + getTimeMock = jest.fn().mockReturnValue({ to: 'now', from: 'now-15m' }); + createFilterMock = jest.fn().mockReturnValue({ time: 'fake' }); http = { fetch: jest.fn().mockResolvedValue([]) }; getValueSuggestions = setupValueSuggestionProvider({ http, uiSettings } as CoreSetup, { timefilter: { timefilter: { - createFilter: () => { - return { - time: 'fake', - }; - }, - getTime: () => { - return { - to: 'now', - from: 'now-15m', - }; - }, + createFilter: createFilterMock, + getTime: getTimeMock, }, } as unknown as TimefilterSetup, }); @@ -234,6 +229,28 @@ describe('FieldSuggestions', () => { expect(http.fetch).toHaveBeenCalled(); }); + it('should round timefilter `to` value', async () => { + getTimeMock.mockReturnValue({ from: '2022-10-27||/d', to: '2022-10-27||/d' }); + + const [field] = stubFields.filter( + ({ type, aggregatable }) => type === 'string' && aggregatable + ); + + await getValueSuggestions({ + indexPattern: stubIndexPattern, + field, + query: '', + useTimeRange: true, + }); + + expect(createFilterMock.mock.calls[0][1]).toMatchInlineSnapshot(` + Object { + "from": "2022-10-27T04:00:00.000Z", + "to": "2022-10-28T03:59:59.999Z", + } + `); + }); + it('should use terms_enum', async () => { uiConfig = { [UI_SETTINGS.FILTERS_EDITOR_SUGGEST_VALUES]: true, diff --git a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts index f935cd9362b5..127754583d44 100644 --- a/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts +++ b/src/plugins/unified_search/public/autocomplete/providers/value_suggestion_provider.ts @@ -32,7 +32,7 @@ const getAutocompleteTimefilter = ({ timefilter }: TimefilterSetup, indexPattern // Use a rounded timerange so that memoizing works properly const roundedTimerange = { from: dateMath.parse(timeRange.from)!.startOf('minute').toISOString(), - to: dateMath.parse(timeRange.to)!.endOf('minute').toISOString(), + to: dateMath.parse(timeRange.to, { roundUp: true })!.endOf('minute').toISOString(), }; return timefilter.createFilter(indexPattern, roundedTimerange); }; From 49598dd77c2c836ca550466adcff2b82de572202 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Mon, 31 Oct 2022 11:19:27 -0500 Subject: [PATCH 18/87] [optimizer] Use default memory limit when thread count <=3 (#144195) We're seeing OOM errors with the `--profile` flag and a memory cap of 2gb. This removes the limit, using the node.js default and allowing overrides with NODE_OPTIONS --- packages/kbn-optimizer/src/optimizer/observe_worker.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/kbn-optimizer/src/optimizer/observe_worker.ts b/packages/kbn-optimizer/src/optimizer/observe_worker.ts index 338f64a63b3d..b73e441671ea 100644 --- a/packages/kbn-optimizer/src/optimizer/observe_worker.ts +++ b/packages/kbn-optimizer/src/optimizer/observe_worker.ts @@ -74,7 +74,6 @@ function usingWorkerProc( ...(inspectFlag && config.inspectWorkers ? [`${inspectFlag}=${inspectPortCounter++}`] : []), - ...(config.maxWorkerCount <= 3 ? ['--max-old-space-size=2048'] : []), ], buffer: false, stderr: 'pipe', From df1a662e355078cdf7575a31434be20babe7bc3d Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Mon, 31 Oct 2022 09:48:22 -0700 Subject: [PATCH 19/87] [DOCS] Add redirect for alerts and actions (#144251) --- docs/redirects.asciidoc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/redirects.asciidoc b/docs/redirects.asciidoc index fe1f3b9521cf..a0193baaa0ab 100644 --- a/docs/redirects.asciidoc +++ b/docs/redirects.asciidoc @@ -419,4 +419,9 @@ This page has been deleted. Refer to <>. [role="exclude",id="ml-sync"] == Sync machine learning objects API -This page has been deleted. Refer to <>. \ No newline at end of file +This page has been deleted. Refer to <>. + +[role="exclude",id="managing-alerts-and-actions"] +== Alerts and Actions + +This page has been deleted. Refer to <>. \ No newline at end of file From 399a1189a9a1733cbbc19b3d3a25d57d16377923 Mon Sep 17 00:00:00 2001 From: Baturalp Gurdin <9674241+suchcodemuchwow@users.noreply.github.com> Date: Mon, 31 Oct 2022 17:56:59 +0100 Subject: [PATCH 20/87] remove unnecessary import aliases (#144250) * remove unnecessary import aliases * update doc link to PerformanceMetricEvent --- .../kbn-ebt-tools/src/performance_metric_events/helpers.ts | 2 +- .../kbn-ebt-tools/src/performance_metric_events/index.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts b/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts index ed971118687c..f9aecd2bd7ec 100644 --- a/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts +++ b/packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts @@ -28,7 +28,7 @@ export function registerPerformanceMetricEventType( /** * Report a `performance_metric` event type. * @param analytics The {@link AnalyticsClient} to report the events. - * @param eventData The data to send, conforming the structure of a {@link MetricEvent}. + * @param eventData The data to send, conforming the structure of a {@link PerformanceMetricEvent}. */ export function reportPerformanceMetricEvent( analytics: Pick, diff --git a/packages/kbn-ebt-tools/src/performance_metric_events/index.ts b/packages/kbn-ebt-tools/src/performance_metric_events/index.ts index 0002b082754d..d081f6f331d9 100644 --- a/packages/kbn-ebt-tools/src/performance_metric_events/index.ts +++ b/packages/kbn-ebt-tools/src/performance_metric_events/index.ts @@ -5,8 +5,5 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export type { PerformanceMetricEvent as MetricEvent } from './schema'; -export { - registerPerformanceMetricEventType as registerPerformanceMetricEventType, - reportPerformanceMetricEvent, -} from './helpers'; +export type { PerformanceMetricEvent } from './schema'; +export { registerPerformanceMetricEventType, reportPerformanceMetricEvent } from './helpers'; From 1fa1e47046081ba22d557b2dc87b6e8e018dfd2c Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Mon, 31 Oct 2022 13:07:44 -0400 Subject: [PATCH 21/87] [Fleet] Log agent usage every n minutes (#144037) --- .../scripts/create_agents/create_agents.ts | 2 - .../fleet/server/collectors/register.ts | 10 +++ x-pack/plugins/fleet/server/plugin.ts | 5 +- .../server/services/fleet_usage_logger.ts | 70 +++++++++++++++++++ 4 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugins/fleet/server/services/fleet_usage_logger.ts diff --git a/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts b/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts index 31df24c70a5d..0a9d14339729 100644 --- a/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts +++ b/x-pack/plugins/fleet/scripts/create_agents/create_agents.ts @@ -99,8 +99,6 @@ async function createAgentPolicy(id: string) { namespace: 'default', description: '', monitoring_enabled: ['logs'], - data_output_id: 'fleet-default-output', - monitoring_output_id: 'fleet-default-output', }), headers: { Authorization: auth, diff --git a/x-pack/plugins/fleet/server/collectors/register.ts b/x-pack/plugins/fleet/server/collectors/register.ts index f19682a5a243..a194ff9b560e 100644 --- a/x-pack/plugins/fleet/server/collectors/register.ts +++ b/x-pack/plugins/fleet/server/collectors/register.ts @@ -37,6 +37,16 @@ export const fetchUsage = async (core: CoreSetup, config: FleetConfigType) => { return usage; }; +export const fetchAgentsUsage = async (core: CoreSetup, config: FleetConfigType) => { + const [soClient, esClient] = await getInternalClients(core); + const usage = { + agents_enabled: getIsAgentsEnabled(config), + agents: await getAgentUsage(config, soClient, esClient), + fleet_server: await getFleetServerUsage(soClient, esClient), + }; + return usage; +}; + export function registerFleetUsageCollector( core: CoreSetup, config: FleetConfigType, diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 7d00f944fbf8..5d177641daee 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -101,7 +101,7 @@ import { AgentServiceImpl, PackageServiceImpl, } from './services'; -import { registerFleetUsageCollector, fetchUsage } from './collectors/register'; +import { registerFleetUsageCollector, fetchUsage, fetchAgentsUsage } from './collectors/register'; import { getAuthzFromRequest, makeRouterWithFleetAuthz } from './routes/security'; import { FleetArtifactsClient } from './services/artifacts'; import type { FleetRouter } from './types/request_context'; @@ -110,6 +110,7 @@ import { setupFleet } from './services/setup'; import { BulkActionsResolver } from './services/agents'; import type { PackagePolicyService } from './services/package_policy_service'; import { PackagePolicyServiceImpl } from './services/package_policy'; +import { registerFleetUsageLogger, startFleetUsageLogger } from './services/fleet_usage_logger'; export interface FleetSetupDeps { security: SecurityPluginSetup; @@ -388,6 +389,7 @@ export class FleetPlugin this.kibanaVersion, this.isProductionMode ); + registerFleetUsageLogger(deps.taskManager, async () => fetchAgentsUsage(core, config)); const router: FleetRouter = core.http.createRouter(); // Allow read-only users access to endpoints necessary for Integrations UI @@ -455,6 +457,7 @@ export class FleetPlugin this.telemetryEventsSender.start(plugins.telemetry, core); this.bulkActionsResolver?.start(plugins.taskManager); this.fleetUsageSender?.start(plugins.taskManager); + startFleetUsageLogger(plugins.taskManager); const logger = appContextService.getLogger(); diff --git a/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts b/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts new file mode 100644 index 000000000000..6aa84262dc54 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import type { + ConcreteTaskInstance, + TaskManagerStartContract, + TaskManagerSetupContract, +} from '@kbn/task-manager-plugin/server'; + +import type { fetchAgentsUsage } from '../collectors/register'; + +import { appContextService } from './app_context'; + +const TASK_ID = 'Fleet-Usage-Logger-Task'; +const TASK_TYPE = 'Fleet-Usage-Logger'; + +export async function registerFleetUsageLogger( + taskManager: TaskManagerSetupContract, + fetchUsage: () => ReturnType +) { + taskManager.registerTaskDefinitions({ + [TASK_TYPE]: { + title: 'Fleet Usage Logger', + timeout: '1m', + maxAttempts: 1, + createTaskRunner: ({ taskInstance }: { taskInstance: ConcreteTaskInstance }) => { + return { + async run() { + try { + const usageData = await fetchUsage(); + if (appContextService.getLogger().isLevelEnabled('debug')) { + appContextService.getLogger().debug(`Fleet Usage: ${JSON.stringify(usageData)}`); + } else { + appContextService.getLogger().info(`Fleet Usage: ${JSON.stringify(usageData)}`); + } + } catch (error) { + appContextService + .getLogger() + .error('Error occurred while fetching fleet usage: ' + error); + } + }, + + async cancel() {}, + }; + }, + }, + }); +} + +export async function startFleetUsageLogger(taskManager: TaskManagerStartContract) { + const isDebugLogLevelEnabled = appContextService.getLogger().isLevelEnabled('debug'); + const isInfoLogLevelEnabled = appContextService.getLogger().isLevelEnabled('info'); + if (!isInfoLogLevelEnabled) { + return; + } + appContextService.getLogger().info(`Task ${TASK_ID} scheduled with interval 5m`); + await taskManager?.ensureScheduled({ + id: TASK_ID, + taskType: TASK_TYPE, + schedule: { + interval: isDebugLogLevelEnabled ? '5m' : '15m', + }, + scope: ['fleet'], + state: {}, + params: {}, + }); +} From afd7a719ba1df732ba7cf0130f362c9f973095c2 Mon Sep 17 00:00:00 2001 From: Luke Gmys Date: Mon, 31 Oct 2022 18:12:19 +0100 Subject: [PATCH 22/87] [TIP] Add TLP Badges support (#143431) [TIP] Add TLP Badges support --- .../__snapshots__/field.test.tsx.snap | 215 +++--------------- .../components/field_value/field.test.tsx | 28 ++- .../components/field_value/field_value.tsx | 7 +- .../components/flyout/flyout.stories.tsx | 41 ++-- .../__snapshots__/tlp_badge.test.tsx.snap | 47 ++++ .../indicators/components/tlp_badge/index.tsx | 8 + .../tlp_badge/tlp_badge.stories.tsx | 57 +++++ .../components/tlp_badge/tlp_badge.test.tsx | 31 +++ .../components/tlp_badge/tlp_badge.tsx | 40 ++++ .../modules/indicators/types/indicator.ts | 14 ++ 10 files changed, 266 insertions(+), 222 deletions(-) create mode 100644 x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/__snapshots__/tlp_badge.test.tsx.snap create mode 100644 x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/index.tsx create mode 100644 x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.stories.tsx create mode 100644 x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.test.tsx create mode 100644 x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap index f90ff68de3b1..8dd105a29983 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/__snapshots__/field.test.tsx.snap @@ -1,196 +1,39 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[` should render tlp marking badge 1`] = ` + + + + + Red + + + + +`; + exports[` should return - 1`] = ` -Object { - "asFragment": [Function], - "baseElement": -
- - -
- , - "container":
- - -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} + + - + `; exports[` should return date-formatted value 1`] = ` -Object { - "asFragment": [Function], - "baseElement": -
- Dec 31, 2021 @ 20:01:01.000 -
- , - "container":
- Dec 31, 2021 @ 20:01:01.000 -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} + + Dec 31, 2021 @ 20:01:01.000 + `; exports[` should return non formatted value 1`] = ` -Object { - "asFragment": [Function], - "baseElement": -
- 0.0.0.0 -
- , - "container":
- 0.0.0.0 -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} + + 0.0.0.0 + `; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx index da78e8db55bc..c18d0caa5a6e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { IndicatorFieldValue } from '.'; -import { generateMockIndicator } from '../../types'; +import { generateMockIndicator, generateMockIndicatorWithTlp } from '../../types'; import { EMPTY_VALUE } from '../../../../common/constants'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; @@ -19,23 +19,37 @@ describe('', () => { it('should return non formatted value', () => { const mockField = 'threat.indicator.ip'; - const component = render(); - expect(component).toMatchSnapshot(); + const { asFragment } = render( + + ); + expect(asFragment()).toMatchSnapshot(); }); it(`should return ${EMPTY_VALUE}`, () => { const mockField = 'abc'; - const component = render(); - expect(component).toMatchSnapshot(); + const { asFragment } = render( + + ); + expect(asFragment()).toMatchSnapshot(); }); it('should return date-formatted value', () => { const mockField = 'threat.indicator.first_seen'; - const component = render( + const { asFragment } = render( ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); + }); + + it('should render tlp marking badge', () => { + const mockField = 'threat.indicator.marking.tlp'; + const { asFragment } = render( + + + + ); + expect(asFragment()).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx index c46e08eac302..00e52cd68baf 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx @@ -11,6 +11,7 @@ import { EMPTY_VALUE } from '../../../../common/constants'; import { Indicator, RawIndicatorFieldId } from '../../types'; import { DateFormatter } from '../../../../components/date_formatter'; import { unwrapValue } from '../../utils'; +import { TLPBadge } from '../tlp_badge'; export interface IndicatorFieldValueProps { /** @@ -29,8 +30,12 @@ export interface IndicatorFieldValueProps { */ export const IndicatorFieldValue: VFC = ({ indicator, field }) => { const fieldType = useFieldTypes()[field]; - const value = unwrapValue(indicator, field as RawIndicatorFieldId); + + if (field === RawIndicatorFieldId.MarkingTLP) { + return ; + } + return fieldType === 'date' ? ( ) : value ? ( diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx index d697338d70ba..80b75a605ccc 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx @@ -7,50 +7,35 @@ import React from 'react'; import { Story } from '@storybook/react'; -import { CoreStart } from '@kbn/core/public'; -import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; -import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; -import { mockUiSettingsService } from '../../../../common/mocks/mock_kibana_ui_settings_service'; -import { mockKibanaTimelinesService } from '../../../../common/mocks/mock_kibana_timelines_service'; +import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; import { generateMockIndicator, Indicator } from '../../types'; import { IndicatorsFlyout } from '.'; -import { IndicatorsFiltersContext } from '../../containers/filters'; export default { component: IndicatorsFlyout, title: 'IndicatorsFlyout', }; -const coreMock = { - uiSettings: mockUiSettingsService(), - timelines: mockKibanaTimelinesService, -} as unknown as CoreStart; -const KibanaReactContext = createKibanaReactContext(coreMock); - export const Default: Story = () => { const mockIndicator: Indicator = generateMockIndicator(); return ( - - - window.alert('Closing flyout')} - /> - - + + window.alert('Closing flyout')} + /> + ); }; export const EmptyIndicator: Story = () => { return ( - - - window.alert('Closing flyout')} - /> - - + + window.alert('Closing flyout')} + /> + ); }; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/__snapshots__/tlp_badge.test.tsx.snap b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/__snapshots__/tlp_badge.test.tsx.snap new file mode 100644 index 000000000000..22522c97624a --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/__snapshots__/tlp_badge.test.tsx.snap @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TLPBadge should handle proper value 1`] = ` + + + + + Green + + + + +`; + +exports[`TLPBadge should handle value in various casing with extra spaces 1`] = ` + + + + + Red + + + + +`; + +exports[`TLPBadge should return - if color doesn't exist 1`] = ` + + - + +`; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/index.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/index.tsx new file mode 100644 index 000000000000..1fbe78837f77 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/index.tsx @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './tlp_badge'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.stories.tsx new file mode 100644 index 000000000000..dd70fd29ee86 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.stories.tsx @@ -0,0 +1,57 @@ +/* + * Copyright 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 { ComponentStory } from '@storybook/react'; +import React from 'react'; +import { TLPBadge, TLPBadgeProps } from './tlp_badge'; + +export default { + component: TLPBadge, + title: 'TLPBadge', +}; + +const Template: ComponentStory = (args: TLPBadgeProps) => ; + +export const Red = Template.bind({}); +Red.args = { + value: 'RED', +}; + +export const Amber = Template.bind({}); +Amber.args = { + value: 'AMBER', +}; + +export const AmberStrict = Template.bind({}); +AmberStrict.args = { + value: 'AMBER+STRICT', +}; + +export const Green = Template.bind({}); +Green.args = { + value: 'GREEN', +}; + +export const White = Template.bind({}); +White.args = { + value: 'WHITE', +}; + +export const Clear = Template.bind({}); +Clear.args = { + value: 'CLEAR', +}; + +export const Empty = Template.bind({}); +Empty.args = { + value: undefined, +}; + +export const Other = Template.bind({}); +Other.args = { + value: 'other', +}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.test.tsx new file mode 100644 index 000000000000..6f18c84640b7 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.test.tsx @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { EMPTY_VALUE } from '../../../../common/constants'; +import { TLPBadge } from './tlp_badge'; + +describe('TLPBadge', () => { + it(`should return ${EMPTY_VALUE} if color doesn't exist`, () => { + const invalidValue = 'abc'; + const { asFragment } = render(); + expect(asFragment()).toMatchSnapshot(); + }); + + it('should handle value in various casing with extra spaces', () => { + const value = ' RED '; + const { asFragment } = render(); + expect(asFragment()).toMatchSnapshot(); + }); + + it('should handle proper value', () => { + const value = 'green'; + const { asFragment } = render(); + expect(asFragment()).toMatchSnapshot(); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.tsx new file mode 100644 index 000000000000..d8d4d6ca6dc5 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/tlp_badge/tlp_badge.tsx @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiBadge } from '@elastic/eui'; +import capitalize from 'lodash/capitalize'; +import React, { useMemo, VFC } from 'react'; +import { EMPTY_VALUE } from '../../../../common/constants'; + +export interface TLPBadgeProps { + value: string | undefined | null; +} + +const LEVEL_TO_COLOR: Record = { + red: 'danger', + amber: 'warning', + 'amber+strict': 'warning', + green: 'success', + white: 'hollow', + clear: 'hollow', +} as const; + +export const TLPBadge: VFC = ({ value }) => { + const normalizedValue = value?.toLowerCase().trim(); + const color = LEVEL_TO_COLOR[normalizedValue || '']; + + const displayValue = useMemo( + () => normalizedValue?.replaceAll(/\W/g, ' ').split(' ').map(capitalize).join(' '), + [normalizedValue] + ); + + if (!color) { + return <>{EMPTY_VALUE}; + } + + return {displayValue}; +}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts index 823809a7750a..c74209663999 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts @@ -100,6 +100,20 @@ export const generateMockIndicator = (): Indicator => { return indicator; }; +/** + * Used to create an Indicator with tlp marking + */ +export const generateMockIndicatorWithTlp = (): Indicator => { + const indicator = generateMockBaseIndicator(); + + indicator.fields['threat.indicator.type'] = ['type']; + indicator.fields['threat.indicator.ip'] = ['0.0.0.0']; + indicator.fields['threat.indicator.name'] = ['0.0.0.0']; + indicator.fields['threat.indicator.marking.tlp'] = ['RED']; + + return indicator; +}; + /** * Used to create a Url Indicator. */ From c1b30cc93b72974a3abdc8e84d125bb0190a2a50 Mon Sep 17 00:00:00 2001 From: christineweng <18648970+christineweng@users.noreply.github.com> Date: Mon, 31 Oct 2022 12:41:13 -0500 Subject: [PATCH 23/87] [Security Solution] Fixes drop down disabled in Top N (#144077) * removed disable dropdown in top_n and reverse order of dropdown to have detection alerts at the top * removed check disabled related tests, added check alerts tests, clean ups * removed disable dropdown in top_n and reverse order of dropdown to have detection alerts at the top * removed check disabled related tests, added check alerts tests, clean ups * clean up * add back option length check and update eui margin --- .../common/components/top_n/helpers.test.tsx | 5 +- .../public/common/components/top_n/helpers.ts | 11 +++- .../common/components/top_n/index.test.tsx | 34 +++++++------ .../common/components/top_n/top_n.test.tsx | 51 ------------------- .../public/common/components/top_n/top_n.tsx | 13 ++--- .../common/components/top_n/translations.ts | 4 +- 6 files changed, 36 insertions(+), 82 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx index 209c0a5ace40..b40130c0a343 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx @@ -18,19 +18,16 @@ import { rawEvents, removeIgnoredAlertFilters, shouldIgnoreAlertFilters, + detectionAlertsTables, } from './helpers'; import { SourcererScopeName } from '../../store/sourcerer/model'; -/** the following scopes are detection alert tables */ -const detectionAlertsTables = [TableId.alertsOnAlertsPage, TableId.alertsOnRuleDetailsPage]; - /** the following scopes are NOT detection alert tables */ const otherScopes = [ TableId.hostsPageEvents, TableId.hostsPageSessions, TableId.networkPageEvents, TimelineId.active, - TimelineId.casePage, TimelineId.test, TableId.alternateTest, TableId.kubernetesPageSessions, diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts index 75d22f475b68..170714df654e 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts +++ b/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts @@ -65,6 +65,13 @@ export interface TopNOption { 'data-test-subj': string; } +/** the following scopes are detection alert tables */ +export const detectionAlertsTables: string[] = [ + TableId.alertsOnAlertsPage, + TableId.alertsOnRuleDetailsPage, + TimelineId.casePage, +]; + /** A (stable) array containing only the 'All events' option */ export const allEvents: TopNOption[] = [ { @@ -117,8 +124,8 @@ export const getOptions = (activeTimelineEventsType?: TimelineEventsType): TopNO }; /** returns true if the specified timelineId is a detections alert table */ -export const isDetectionsAlertsTable = (tableId: string | undefined): boolean => - tableId === TableId.alertsOnAlertsPage || tableId === TableId.alertsOnRuleDetailsPage; +export const isDetectionsAlertsTable = (scopeId: string | undefined): boolean => + scopeId ? detectionAlertsTables.includes(scopeId) : false; /** * The following fields are used to filter alerts tables, (i.e. tables in the diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx index 7a5b4a351a98..f493cbc64f53 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx @@ -26,6 +26,7 @@ import type { Props } from './top_n'; import { StatefulTopN } from '.'; import { TableId, TimelineId } from '../../../../common/types/timeline'; import { tGridReducer } from '@kbn/timelines-plugin/public'; +import { detectionAlertsTables } from './helpers'; jest.mock('react-router-dom', () => { const original = jest.requireActual('react-router-dom'); @@ -158,7 +159,7 @@ const store = createStore( storage ); -let testProps = { +const testProps = { browserFields: mockBrowserFields, field, indexPattern: mockIndexPattern, @@ -361,21 +362,24 @@ describe('StatefulTopN', () => { expect(props.to).toEqual('2020-04-15T03:46:09.047Z'); }); }); - describe('rendering in a NON-active timeline context', () => { - test(`defaults to the 'Alert events' option when rendering in a NON-active timeline context (e.g. the Alerts table on the Detections page) when 'documentType' from 'useTimelineTypeContext()' is 'alerts'`, async () => { - testProps = { - ...testProps, - scopeId: TableId.alertsOnAlertsPage, - }; - const wrapper = mount( - - - - ); - await waitFor(() => { - const props = wrapper.find('[data-test-subj="top-n"]').first().props() as Props; - expect(props.defaultView).toEqual('alert'); + describe('rendering in alerts context', () => { + detectionAlertsTables.forEach((tableId) => { + test(`defaults to the 'Alert events' option when rendering in Alerts`, async () => { + const wrapper = mount( + + + + ); + await waitFor(() => { + const props = wrapper.find('[data-test-subj="top-n"]').first().props() as Props; + expect(props.defaultView).toEqual('alert'); + }); }); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx index 155ff517119b..1e43949cd26c 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx @@ -10,7 +10,6 @@ import { mount } from 'enzyme'; import React from 'react'; import { waitFor } from '@testing-library/react'; -import { TableId, TimelineId } from '../../../../common/types'; import '../../mock/match_media'; import { TestProviders, mockIndexPattern } from '../../mock'; @@ -136,56 +135,6 @@ describe('TopN', () => { }); }); - describe('view selection', () => { - const detectionAlertsTimelines = [TableId.alertsOnAlertsPage, TableId.alertsOnRuleDetailsPage]; - - const nonDetectionAlertTables = [ - TableId.hostsPageEvents, - TableId.networkPageEvents, - TimelineId.casePage, - ]; - - test('it disables view selection when scopeId is undefined', () => { - const wrapper = mount( - - - - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(true); - }); - - test('it disables view selection when timelineId is `active`', () => { - const wrapper = mount( - - - - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(true); - }); - - detectionAlertsTimelines.forEach((tableId) => { - test(`it enables view selection for detection alert table '${tableId}'`, () => { - const wrapper = mount( - - - - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(false); - }); - }); - - nonDetectionAlertTables.forEach((tableId) => { - test(`it disables view selection for NON detection alert table '${tableId}'`, () => { - const wrapper = mount( - - - - ); - expect(wrapper.find('[data-test-subj="view-select"]').first().props().disabled).toBe(true); - }); - }); - }); - describe('events view', () => { let wrapper: ReactWrapper; diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx index 75e4901facb4..365435ff24d2 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx @@ -17,11 +17,7 @@ import type { InputsModelId } from '../../store/inputs/constants'; import type { TimelineEventsType } from '../../../../common/types/timeline'; import { useSourcererDataView } from '../../containers/sourcerer'; import type { TopNOption } from './helpers'; -import { - isDetectionsAlertsTable, - getSourcererScopeName, - removeIgnoredAlertFilters, -} from './helpers'; +import { getSourcererScopeName, removeIgnoredAlertFilters } from './helpers'; import * as i18n from './translations'; import type { AlertsStackByField } from '../../../detections/components/alerts_kpis/common/types'; @@ -38,11 +34,12 @@ const CloseButton = styled(EuiButtonIcon)` const ViewSelect = styled(EuiSuperSelect)` z-index: 999999; - width: 155px; + width: 170px; `; const TopNContent = styled.div` margin-top: 4px; + margin-right: ${({ theme }) => theme.eui.euiSizeXS}; .euiPanel { border: none; @@ -101,13 +98,13 @@ const TopNComponent: React.FC = ({ () => ( ), - [onViewSelected, options, scopeId, view] + [onViewSelected, options, view] ); // alert workflow statuses (e.g. open | closed) and other alert-specific diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts b/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts index e482f4cd7b16..058e0a8cf2c6 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts @@ -12,7 +12,7 @@ export const CLOSE = i18n.translate('xpack.securitySolution.topN.closeButtonLabe }); export const ALL_EVENTS = i18n.translate('xpack.securitySolution.topN.allEventsSelectLabel', { - defaultMessage: 'All events', + defaultMessage: 'Alerts and events', }); export const RAW_EVENTS = i18n.translate('xpack.securitySolution.topN.rawEventsSelectLabel', { @@ -20,5 +20,5 @@ export const RAW_EVENTS = i18n.translate('xpack.securitySolution.topN.rawEventsS }); export const ALERT_EVENTS = i18n.translate('xpack.securitySolution.topN.alertEventsSelectLabel', { - defaultMessage: 'Detection Alerts', + defaultMessage: 'Detection alerts', }); From 59d6cfc7c0b07815ca4ee1b1ddfaad8d62e657b3 Mon Sep 17 00:00:00 2001 From: spalger Date: Mon, 31 Oct 2022 11:41:44 -0600 Subject: [PATCH 24/87] bust invalid cache after files plugin merge --- packages/kbn-optimizer/src/node/node_auto_tranpilation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts index 2710ba8a5421..b8ca3de021f2 100644 --- a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts +++ b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts @@ -135,7 +135,7 @@ export function registerNodeAutoTranspilation() { const cache = new Cache({ pathRoot: REPO_ROOT, - dir: Path.resolve(REPO_ROOT, 'data/node_auto_transpilation_cache_v3', UPSTREAM_BRANCH), + dir: Path.resolve(REPO_ROOT, 'data/node_auto_transpilation_cache_v4', UPSTREAM_BRANCH), prefix: determineCachePrefix(), log: process.env.DEBUG_NODE_TRANSPILER_CACHE ? Fs.createWriteStream(Path.resolve(REPO_ROOT, 'node_auto_transpilation_cache.log'), { From a6e9536c76be5bfd325eb0308edb6d8a38ca71a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:46:49 -0700 Subject: [PATCH 25/87] Update dependency core-js to ^3.26.0 (main) (#144211) * Update dependency core-js to ^3.26.0 * dedupe * update core-js version Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Budzenski --- package.json | 2 +- packages/kbn-babel-preset/node_preset.js | 2 +- packages/kbn-babel-preset/webpack_preset.js | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a7f855e7cd15..1bb692e36df8 100644 --- a/package.json +++ b/package.json @@ -473,7 +473,7 @@ "compare-versions": "3.5.1", "constate": "^3.3.2", "copy-to-clipboard": "^3.0.8", - "core-js": "^3.25.5", + "core-js": "^3.26.0", "cronstrue": "^1.51.0", "cuid": "^2.1.8", "cytoscape": "^3.10.0", diff --git a/packages/kbn-babel-preset/node_preset.js b/packages/kbn-babel-preset/node_preset.js index 31cebf7e1715..dfbca5a364f5 100644 --- a/packages/kbn-babel-preset/node_preset.js +++ b/packages/kbn-babel-preset/node_preset.js @@ -31,7 +31,7 @@ module.exports = (_, options = {}) => { // Because of that we should use for that value the same version we install // in the package.json in order to have the same polyfills between the environment // and the tests - corejs: '3.25.5', + corejs: '3.26.0', bugfixes: true, ...(options['@babel/preset-env'] || {}), diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js index 171b00911db1..d7359345bf22 100644 --- a/packages/kbn-babel-preset/webpack_preset.js +++ b/packages/kbn-babel-preset/webpack_preset.js @@ -18,7 +18,7 @@ module.exports = (_, options = {}) => { modules: false, // Please read the explanation for this // in node_preset.js - corejs: '3.25.5', + corejs: '3.26.0', bugfixes: true, }, ], diff --git a/yarn.lock b/yarn.lock index 63bb314bd359..2b750cbf1980 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10923,10 +10923,10 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== -core-js@^3.0.4, core-js@^3.25.5, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: - version "3.25.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.25.5.tgz#e86f651a2ca8a0237a5f064c2fe56cef89646e27" - integrity sha512-nbm6eZSjm+ZuBQxCUPQKQCoUEfFOXjUZ8dTTyikyKaWrTYmAVbykQfwsKE5dBK88u3QCkCrzsx/PPlKfhsvgpw== +core-js@^3.0.4, core-js@^3.26.0, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: + version "3.26.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.0.tgz#a516db0ed0811be10eac5d94f3b8463d03faccfe" + integrity sha512-+DkDrhoR4Y0PxDz6rurahuB+I45OsEUv8E1maPTB6OuHRohMMcznBq9TMpdpDMm/hUPob/mJJS3PqgbHpMTQgw== core-util-is@1.0.2, core-util-is@^1.0.2, core-util-is@~1.0.0: version "1.0.2" From 205d5c4e16d8870c0b1f8b7c04d9b16ee98359bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Mon, 31 Oct 2022 13:57:36 -0400 Subject: [PATCH 26/87] [APM] Mobile APM - Filter (#144172) * [APM] Mobile APM - Filter * adding transaction type filter * adding transaction type * removing transaction type fitler * addressing pr comments * Update elasticsearch_fieldnames.ts * Update get_mobile_filters.ts --- .../apm/common/elasticsearch_fieldnames.ts | 5 + .../service_overview_charts/filters/index.tsx | 87 +++++++++++ .../service_oveview_mobile_charts.tsx | 26 +++- .../routing/service_detail/index.tsx | 4 + .../get_global_apm_server_route_repository.ts | 2 + .../routes/mobile/get_mobile_filters.ts | 147 ++++++++++++++++++ .../plugins/apm/server/routes/mobile/route.ts | 59 +++++++ 7 files changed, 329 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/filters/index.tsx create mode 100644 x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts create mode 100644 x-pack/plugins/apm/server/routes/mobile/route.ts diff --git a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts index bbd5755e3afb..6fa3625c7ff7 100644 --- a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts +++ b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts @@ -123,6 +123,7 @@ export const HOST = 'host'; export const HOST_HOSTNAME = 'host.hostname'; // Do not use. Please use `HOST_NAME` instead. export const HOST_NAME = 'host.name'; export const HOST_OS_PLATFORM = 'host.os.platform'; +export const HOST_OS_VERSION = 'host.os.version'; export const CONTAINER_ID = 'container.id'; export const CONTAINER = 'container'; export const CONTAINER_IMAGE = 'container.image.name'; @@ -157,3 +158,7 @@ export const FAAS_BILLED_DURATION = 'faas.billed_duration'; // Metadata export const TIER = '_tier'; export const INDEX = '_index'; + +// Mobile +export const DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'; +export const NETWORK_CONNECTION_TYPE = 'network.connection.type'; diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/filters/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/filters/index.tsx new file mode 100644 index 000000000000..8cad711759aa --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/filters/index.tsx @@ -0,0 +1,87 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; +import React from 'react'; +import { useHistory } from 'react-router-dom'; +import { Environment } from '../../../../../../common/environment_rt'; +import { useApmServiceContext } from '../../../../../context/apm_service/use_apm_service_context'; +import { useFetcher } from '../../../../../hooks/use_fetcher'; +import type { APIReturnType } from '../../../../../services/rest/create_call_apm_api'; +import { push } from '../../../../shared/links/url_helpers'; + +type MobileFilter = + APIReturnType<'GET /internal/apm/services/{serviceName}/mobile/filters'>['mobileFilters'][0]; + +interface Props { + end: string; + environment: Environment; + kuery: string; + start: string; + filters: Record; +} + +const ALL_OPTION = { + value: 'all', + text: 'All', +}; + +export function MobileFilters({ + end, + environment, + kuery, + start, + filters, +}: Props) { + const history = useHistory(); + const { serviceName } = useApmServiceContext(); + const { data = { mobileFilters: [] } } = useFetcher( + (callApmApi) => { + return callApmApi( + 'GET /internal/apm/services/{serviceName}/mobile/filters', + { + params: { + path: { serviceName }, + query: { end, environment, kuery, start }, + }, + } + ); + }, + [end, environment, kuery, serviceName, start] + ); + + function toSelectOptions(items?: string[]) { + return [ + ALL_OPTION, + ...(items?.map((item) => ({ value: item, text: item })) || []), + ]; + } + + function onChangeFilter(key: MobileFilter['key'], value: string) { + push(history, { + query: { [key]: value === ALL_OPTION.value ? '' : value }, + }); + } + + return ( + + {data.mobileFilters.map((filter) => { + return ( + + { + onChangeFilter(filter.key, e.target.value); + }} + /> + + ); + })} + + ); +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx index 4dd20ca8a0d9..60871e58dd88 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx @@ -18,6 +18,7 @@ import { TransactionsTable } from '../../../shared/transactions_table'; import { AggregatedTransactionsBadge } from '../../../shared/aggregated_transactions_badge'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; +import { MobileFilters } from './filters'; interface Props { latencyChartHeight: number; @@ -37,7 +38,16 @@ export function ServiceOverviewMobileCharts({ const { query, - query: { environment, kuery, rangeFrom, rangeTo }, + query: { + environment, + kuery, + rangeFrom, + rangeTo, + device, + osVersion, + appVersion, + netConnectionType, + }, } = useApmParams('/services/{serviceName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -51,6 +61,20 @@ export function ServiceOverviewMobileCharts({ return ( + + + {fallbackToTransactions && ( diff --git a/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx b/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx index 7cc2f7b113fe..96600d8b85b5 100644 --- a/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx @@ -149,6 +149,10 @@ export const serviceDetail = { pageSize: toNumberRt, sortField: t.string, sortDirection: t.union([t.literal('asc'), t.literal('desc')]), + device: t.string, + osVersion: t.string, + appVersion: t.string, + netConnectionType: t.string, }), }), }, diff --git a/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts b/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts index 03971c6d115b..84ef941462b3 100644 --- a/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts +++ b/x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts @@ -41,6 +41,7 @@ import { traceRouteRepository } from '../traces/route'; import { transactionRouteRepository } from '../transactions/route'; import { storageExplorerRouteRepository } from '../storage_explorer/route'; import { labsRouteRepository } from '../settings/labs/route'; +import { mobileRouteRepository } from '../mobile/route'; function getTypedGlobalApmServerRouteRepository() { const repository = { @@ -75,6 +76,7 @@ function getTypedGlobalApmServerRouteRepository() { ...debugTelemetryRoute, ...timeRangeMetadataRoute, ...labsRouteRepository, + ...mobileRouteRepository, }; return repository; diff --git a/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts b/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts new file mode 100644 index 000000000000..3bbd43e8ca9e --- /dev/null +++ b/x-pack/plugins/apm/server/routes/mobile/get_mobile_filters.ts @@ -0,0 +1,147 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { + termQuery, + kqlQuery, + rangeQuery, +} from '@kbn/observability-plugin/server'; +import { + DEVICE_MODEL_IDENTIFIER, + HOST_OS_VERSION, + NETWORK_CONNECTION_TYPE, + SERVICE_NAME, + SERVICE_VERSION, +} from '../../../common/elasticsearch_fieldnames'; +import { environmentQuery } from '../../../common/utils/environment_query'; +import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; +import { + getDocumentTypeFilterForTransactions, + getProcessorEventForTransactions, +} from '../../lib/helpers/transactions'; + +type MobileFiltersTypes = + | 'device' + | 'appVersion' + | 'osVersion' + | 'netConnectionType'; +type MobileFilters = Array<{ + key: MobileFiltersTypes; + options: string[]; + label: string; +}>; + +export async function getMobileFilters({ + kuery, + apmEventClient, + serviceName, + environment, + start, + end, + searchAggregatedTransactions, +}: { + kuery: string; + apmEventClient: APMEventClient; + serviceName: string; + environment: string; + start: number; + end: number; + searchAggregatedTransactions: boolean; +}): Promise { + const response = await apmEventClient.search('get_mobile_filters', { + apm: { + events: [getProcessorEventForTransactions(searchAggregatedTransactions)], + }, + body: { + track_total_hits: false, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(SERVICE_NAME, serviceName), + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...getDocumentTypeFilterForTransactions( + searchAggregatedTransactions + ), + ], + }, + }, + aggs: { + devices: { + terms: { + field: DEVICE_MODEL_IDENTIFIER, + size: 10, + }, + }, + osVersions: { + terms: { + field: HOST_OS_VERSION, + size: 10, + }, + }, + appVersions: { + terms: { + field: SERVICE_VERSION, + size: 10, + }, + }, + netConnectionTypes: { + terms: { + field: NETWORK_CONNECTION_TYPE, + size: 10, + }, + }, + }, + }, + }); + + return [ + { + key: 'device', + label: i18n.translate('xpack.apm.mobile.filters.device', { + defaultMessage: 'Device', + }), + options: + response.aggregations?.devices?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + { + key: 'osVersion', + label: i18n.translate('xpack.apm.mobile.filters.osVersion', { + defaultMessage: 'OS version', + }), + options: + response.aggregations?.osVersions?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + { + key: 'appVersion', + label: i18n.translate('xpack.apm.mobile.filters.appVersion', { + defaultMessage: 'App version', + }), + options: + response.aggregations?.appVersions?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + { + key: 'netConnectionType', + label: i18n.translate('xpack.apm.mobile.filters.nct', { + defaultMessage: 'NCT', + }), + options: + response.aggregations?.netConnectionTypes?.buckets?.map( + ({ key }) => key as string + ) || [], + }, + ]; +} diff --git a/x-pack/plugins/apm/server/routes/mobile/route.ts b/x-pack/plugins/apm/server/routes/mobile/route.ts new file mode 100644 index 000000000000..584d6d85f362 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/mobile/route.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import * as t from 'io-ts'; +import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; +import { setupRequest } from '../../lib/helpers/setup_request'; +import { getSearchTransactionsEvents } from '../../lib/helpers/transactions'; +import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; +import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; +import { getMobileFilters } from './get_mobile_filters'; + +const mobileFilters = createApmServerRoute({ + endpoint: 'GET /internal/apm/services/{serviceName}/mobile/filters', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([kueryRt, rangeRt, environmentRt]), + }), + options: { tags: ['access:apm'] }, + handler: async ( + resources + ): Promise<{ + mobileFilters: Awaited>; + }> => { + const [setup, apmEventClient] = await Promise.all([ + setupRequest(resources), + getApmEventClient(resources), + ]); + const { params } = resources; + const { serviceName } = params.path; + const { kuery, environment, start, end } = params.query; + const searchAggregatedTransactions = await getSearchTransactionsEvents({ + apmEventClient, + config: setup.config, + kuery, + start, + end, + }); + const filters = await getMobileFilters({ + kuery, + environment, + start, + end, + serviceName, + apmEventClient, + searchAggregatedTransactions, + }); + return { mobileFilters: filters }; + }, +}); + +export const mobileRouteRepository = { + ...mobileFilters, +}; From 4695c9a6eb92945c44b26051ab39bcc38e20d1b9 Mon Sep 17 00:00:00 2001 From: Rodney Norris Date: Mon, 31 Oct 2022 13:14:45 -0500 Subject: [PATCH 27/87] fix: scroll to errors in add inference modal (#144198) Updated the AddMLInferencePipelineModal to scroll to the top of the modal if we have create errors to render. --- .../ml_inference/add_ml_inference_pipeline_modal.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx index f2d24260a4b0..bc8d8d7962ca 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_pipeline_modal.tsx @@ -85,6 +85,15 @@ export const AddProcessorContent: React.FC = ( isLoading, addInferencePipelineModal: { step }, } = useValues(MLInferenceLogic); + // Using the value of create errors to reduce unnecessary hook calls + const createErrorsHookDep = createErrors.join('|'); + useEffect(() => { + if (createErrors.length === 0) return; + const modalOverflow = document.getElementsByClassName('euiModalBody__overflow'); + if (modalOverflow.length === 0) return; + modalOverflow[0].scrollTop = 0; + }, [createErrorsHookDep]); + if (isLoading) { return ( From e92b38415d1d1b8720cf3931fb88260ca70cc8a8 Mon Sep 17 00:00:00 2001 From: Rashmi Kulkarni Date: Mon, 31 Oct 2022 11:25:02 -0700 Subject: [PATCH 28/87] checking for flakiness of index pattern filter test (#144180) * checking for flakiness of index pattern filter test * added a small code change to check if the popover is open --- .../apps/management/_index_pattern_filter.ts | 7 +++---- test/functional/page_objects/settings_page.ts | 14 ++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/test/functional/apps/management/_index_pattern_filter.ts b/test/functional/apps/management/_index_pattern_filter.ts index e1e39e93cc6c..0503ac2e4bf6 100644 --- a/test/functional/apps/management/_index_pattern_filter.ts +++ b/test/functional/apps/management/_index_pattern_filter.ts @@ -13,12 +13,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); const retry = getService('retry'); const PageObjects = getPageObjects(['settings']); - const esArchiver = getService('esArchiver'); - // Failing: See https://github.com/elastic/kibana/issues/143109 - describe.skip('index pattern filter', function describeIndexTests() { + describe('index pattern filter', function describeIndexTests() { before(async function () { - await esArchiver.emptyKibanaIndex(); + await kibanaServer.savedObjects.cleanStandardList(); await kibanaServer.uiSettings.replace({}); await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaIndexPatterns(); @@ -30,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { afterEach(async function () { await PageObjects.settings.removeIndexPattern(); + await kibanaServer.savedObjects.cleanStandardList(); }); it('should filter indexed fields', async function () { diff --git a/test/functional/page_objects/settings_page.ts b/test/functional/page_objects/settings_page.ts index 7f48d5acc4ec..bfa038e5014e 100644 --- a/test/functional/page_objects/settings_page.ts +++ b/test/functional/page_objects/settings_page.ts @@ -306,9 +306,11 @@ export class SettingsPageObject extends FtrService { } async clearFieldTypeFilter(type: string) { - await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); await this.retry.try(async () => { - await this.testSubjects.existOrFail('indexedFieldTypeFilterDropdown-popover'); + await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); + await this.find.byCssSelector( + '.euiPopover-isOpen[data-test-subj="indexedFieldTypeFilterDropdown-popover"]' + ); }); await this.retry.try(async () => { await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}-checked`); @@ -319,8 +321,12 @@ export class SettingsPageObject extends FtrService { } async setFieldTypeFilter(type: string) { - await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); - await this.testSubjects.existOrFail('indexedFieldTypeFilterDropdown-popover'); + await this.retry.try(async () => { + await this.testSubjects.clickWhenNotDisabledWithoutRetry('indexedFieldTypeFilterDropdown'); + await this.find.byCssSelector( + '.euiPopover-isOpen[data-test-subj="indexedFieldTypeFilterDropdown-popover"]' + ); + }); await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}`); await this.testSubjects.click(`indexedFieldTypeFilterDropdown-option-${type}`); await this.testSubjects.existOrFail(`indexedFieldTypeFilterDropdown-option-${type}-checked`); From 01d76ebd13669d8b0d90ea91b1094f4acde3f1b3 Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Mon, 31 Oct 2022 15:16:37 -0400 Subject: [PATCH 29/87] [Security Solution][Investigations] - Alert Details Summary Page (#141709) * initialize alert details page * fix checks * fix types * remove unused import * update details page * fix cases tests * update based on PR feedback: * disable filter in and filter out in alerts details page * fix types * PR feedback * sync with main --- .../src/technical_field_names.ts | 38 + .../common/experimental_features.ts | 5 + .../common/types/timeline/index.ts | 1 + .../e2e/cases/attach_alert_to_case.cy.ts | 15 +- .../detection_alert_details/navigation.cy.ts | 59 + .../cypress/e2e/urls/not_found.cy.ts | 3 +- .../cypress/screens/alerts.ts | 5 + .../cypress/screens/alerts_details.ts | 2 + .../common/components/header_page/index.tsx | 4 +- .../common/components/hover_actions/index.tsx | 24 +- .../hover_actions/use_hover_action_items.tsx | 20 +- .../components/link_to/__mocks__/index.ts | 1 + .../public/common/components/link_to/index.ts | 1 + .../components/link_to/redirect_to_alerts.tsx | 19 + .../navigation/breadcrumbs/index.ts | 8 + .../cases/use_get_related_cases_by_event.ts | 54 + .../common/hooks/use_get_fields_data.ts | 135 ++ .../public/common/utils/route/types.ts | 6 + .../alert_context_menu.test.tsx | 353 +-- .../timeline_actions/alert_context_menu.tsx | 14 +- .../use_open_alert_details.tsx | 54 + .../__mocks__/alert_details_response.ts | 2020 +++++++++++++++++ .../pages/alert_details/__mocks__/index.ts | 8 + .../alert_details/components/error_page.tsx | 33 + .../pages/alert_details/components/header.tsx | 32 + .../alert_details/components/loading_page.tsx | 21 + .../pages/alert_details/index.test.tsx | 144 ++ .../detections/pages/alert_details/index.tsx | 93 + .../alert_render_panel.test.tsx | 57 + .../summary/alert_renderer_panel/index.tsx | 55 + .../summary/cases_panel/cases_panel.test.tsx | 164 ++ .../cases_panel/cases_panel_actions.tsx | 102 + .../tabs/summary/cases_panel/index.tsx | 179 ++ .../summary/get_mitre_threat_component.ts | 123 + .../summary/host_panel/host_panel.test.tsx | 133 ++ .../summary/host_panel/host_panel_actions.tsx | 99 + .../tabs/summary/host_panel/index.tsx | 195 ++ .../alert_details/tabs/summary/index.tsx | 84 + .../tabs/summary/rule_panel/index.tsx | 156 ++ .../summary/rule_panel/rule_panel.test.tsx | 55 + .../summary/rule_panel/rule_panel_actions.tsx | 78 + .../alert_details/tabs/summary/translation.ts | 226 ++ .../tabs/summary/user_panel/index.tsx | 160 ++ .../summary/user_panel/user_panel.test.tsx | 112 + .../summary/user_panel/user_panel_actions.tsx | 99 + .../alert_details/tabs/summary/wrappers.tsx | 60 + .../pages/alert_details/translations.ts | 44 + .../detections/pages/alert_details/types.ts | 14 + .../pages/alert_details/utils/breadcrumbs.ts | 48 + .../utils/get_timeline_event_data.ts | 13 + .../pages/alert_details/utils/navigation.ts | 23 + .../public/detections/pages/alerts/index.tsx | 36 +- .../security_solution/public/helpers.tsx | 8 + .../event_details/expandable_event.tsx | 73 +- .../event_details/flyout/header.tsx | 5 + .../side_panel/event_details/flyout/index.tsx | 2 + .../side_panel/event_details/index.tsx | 3 + .../side_panel/event_details/translations.ts | 7 + .../hooks/use_detail_panel.test.tsx | 237 +- .../side_panel/hooks/use_detail_panel.tsx | 73 +- .../timeline/body/actions/index.test.tsx | 3 + .../timeline/body/actions/index.tsx | 3 - .../body/events/event_column_view.test.tsx | 3 + .../body/renderers/alert_renderer/index.tsx | 15 + .../use_session_view.test.tsx | 8 +- .../session_tab_content/use_session_view.tsx | 8 +- .../timelines/containers/details/index.tsx | 5 +- .../timelines/public/store/t_grid/types.ts | 1 + .../test/security_solution_cypress/config.ts | 4 +- 69 files changed, 5687 insertions(+), 258 deletions(-) create mode 100644 x-pack/plugins/security_solution/cypress/e2e/detection_alert_details/navigation.cy.ts create mode 100644 x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_alerts.tsx create mode 100644 x-pack/plugins/security_solution/public/common/containers/cases/use_get_related_cases_by_event.ts create mode 100644 x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts create mode 100644 x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_open_alert_details.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/alert_details_response.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/index.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/components/error_page.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/components/header.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/components/loading_page.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/index.test.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/index.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/alert_render_panel.test.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/index.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel.test.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel_actions.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/index.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/get_mitre_threat_component.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel.test.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel_actions.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/index.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/index.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/index.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel.test.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel_actions.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/translation.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/index.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel.test.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel_actions.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/wrappers.tsx create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/translations.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/types.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/breadcrumbs.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/get_timeline_event_data.ts create mode 100644 x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/navigation.ts diff --git a/packages/kbn-rule-data-utils/src/technical_field_names.ts b/packages/kbn-rule-data-utils/src/technical_field_names.ts index 672c25d4e8fa..0e61cba7511a 100644 --- a/packages/kbn-rule-data-utils/src/technical_field_names.ts +++ b/packages/kbn-rule-data-utils/src/technical_field_names.ts @@ -12,6 +12,7 @@ const KIBANA_NAMESPACE = 'kibana' as const; const ALERT_NAMESPACE = `${KIBANA_NAMESPACE}.alert` as const; const ALERT_RULE_NAMESPACE = `${ALERT_NAMESPACE}.rule` as const; +const ALERT_RULE_THREAT_NAMESPACE = `${ALERT_RULE_NAMESPACE}.threat` as const; const ECS_VERSION = 'ecs.version' as const; const EVENT_ACTION = 'event.action' as const; @@ -68,6 +69,23 @@ const ALERT_RULE_TYPE_ID = `${ALERT_RULE_NAMESPACE}.rule_type_id` as const; const ALERT_RULE_UPDATED_AT = `${ALERT_RULE_NAMESPACE}.updated_at` as const; const ALERT_RULE_UPDATED_BY = `${ALERT_RULE_NAMESPACE}.updated_by` as const; const ALERT_RULE_VERSION = `${ALERT_RULE_NAMESPACE}.version` as const; + +// Fields pertaining to the threat tactic associated with the rule +const ALERT_THREAT_FRAMEWORK = `${ALERT_RULE_THREAT_NAMESPACE}.framework` as const; +const ALERT_THREAT_TACTIC_ID = `${ALERT_RULE_THREAT_NAMESPACE}.tactic.id` as const; +const ALERT_THREAT_TACTIC_NAME = `${ALERT_RULE_THREAT_NAMESPACE}.tactic.name` as const; +const ALERT_THREAT_TACTIC_REFERENCE = `${ALERT_RULE_THREAT_NAMESPACE}.tactic.reference` as const; +const ALERT_THREAT_TECHNIQUE_ID = `${ALERT_RULE_THREAT_NAMESPACE}.technique.id` as const; +const ALERT_THREAT_TECHNIQUE_NAME = `${ALERT_RULE_THREAT_NAMESPACE}.technique.name` as const; +const ALERT_THREAT_TECHNIQUE_REFERENCE = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.reference` as const; +const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.subtechnique.id` as const; +const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.subtechnique.name` as const; +const ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE = + `${ALERT_RULE_THREAT_NAMESPACE}.technique.subtechnique.reference` as const; + // the feature instantiating a rule type. // Rule created in stack --> alerts // Rule created in siem --> siem @@ -137,6 +155,16 @@ const fields = { ALERT_WORKFLOW_USER, ALERT_RULE_UUID, ALERT_RULE_CATEGORY, + ALERT_THREAT_FRAMEWORK, + ALERT_THREAT_TACTIC_ID, + ALERT_THREAT_TACTIC_NAME, + ALERT_THREAT_TACTIC_REFERENCE, + ALERT_THREAT_TECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_REFERENCE, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, SPACE_IDS, VERSION, }; @@ -195,6 +223,16 @@ export { KIBANA_NAMESPACE, ALERT_RULE_UUID, ALERT_RULE_CATEGORY, + ALERT_THREAT_FRAMEWORK, + ALERT_THREAT_TACTIC_ID, + ALERT_THREAT_TACTIC_NAME, + ALERT_THREAT_TACTIC_REFERENCE, + ALERT_THREAT_TECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_REFERENCE, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, TAGS, TIMESTAMP, SPACE_IDS, diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index 1c4c8c6bfb67..ab5a9bdf9638 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -75,6 +75,11 @@ export const allowedExperimentalValues = Object.freeze({ * Enables the Guided Onboarding tour in security */ guidedOnboarding: false, + + /** + * Enables the alert details page currently only accessible via the alert details flyout and alert table context menu + */ + alertDetailsPageEnabled: false, }); type ExperimentalConfigKeys = Array; diff --git a/x-pack/plugins/security_solution/common/types/timeline/index.ts b/x-pack/plugins/security_solution/common/types/timeline/index.ts index 64621f0a0598..706283288f58 100644 --- a/x-pack/plugins/security_solution/common/types/timeline/index.ts +++ b/x-pack/plugins/security_solution/common/types/timeline/index.ts @@ -319,6 +319,7 @@ export enum TimelineId { active = 'timeline-1', casePage = 'timeline-case', test = 'timeline-test', // Reserved for testing purposes + detectionsAlertDetailsPage = 'detections-alert-details-page', } export enum TableId { diff --git a/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts index 8a6d3d9a5fed..bc6d279e979e 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/cases/attach_alert_to_case.cy.ts @@ -15,7 +15,7 @@ import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { login, visit, waitForPageWithoutDateRange } from '../../tasks/login'; import { ALERTS_URL } from '../../urls/navigation'; -import { ATTACH_ALERT_TO_CASE_BUTTON, TIMELINE_CONTEXT_MENU_BTN } from '../../screens/alerts'; +import { ATTACH_ALERT_TO_CASE_BUTTON, ATTACH_TO_NEW_CASE_BUTTON } from '../../screens/alerts'; import { LOADING_INDICATOR } from '../../screens/security_header'; const loadDetectionsPage = (role: ROLES) => { @@ -40,9 +40,16 @@ describe('Alerts timeline', () => { waitForPageToBeLoaded(); }); - it('should not allow user with read only privileges to attach alerts to cases', () => { - // Disabled actions for read only users are hidden, so actions button should not show - cy.get(TIMELINE_CONTEXT_MENU_BTN).should('not.exist'); + it('should not allow user with read only privileges to attach alerts to existing cases', () => { + // Disabled actions for read only users are hidden, so only open alert details button should show + expandFirstAlertActions(); + cy.get(ATTACH_ALERT_TO_CASE_BUTTON).should('not.exist'); + }); + + it('should not allow user with read only privileges to attach alerts to a new case', () => { + // Disabled actions for read only users are hidden, so only open alert details button should show + expandFirstAlertActions(); + cy.get(ATTACH_TO_NEW_CASE_BUTTON).should('not.exist'); }); }); diff --git a/x-pack/plugins/security_solution/cypress/e2e/detection_alert_details/navigation.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/detection_alert_details/navigation.cy.ts new file mode 100644 index 000000000000..4e9953b88e49 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/e2e/detection_alert_details/navigation.cy.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { expandFirstAlert, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; +import { cleanKibana } from '../../tasks/common'; +import { login, visit } from '../../tasks/login'; + +import { getNewRule } from '../../objects/rule'; +import type { CustomRule } from '../../objects/rule'; + +import { ALERTS_URL } from '../../urls/navigation'; +import { + OPEN_ALERT_DETAILS_PAGE_CONTEXT_MENU_BTN, + TIMELINE_CONTEXT_MENU_BTN, +} from '../../screens/alerts'; +import { PAGE_TITLE } from '../../screens/common/page'; +import { OPEN_ALERT_DETAILS_PAGE } from '../../screens/alerts_details'; + +describe('Alert Details Page Navigation', () => { + describe('navigating to alert details page', () => { + let rule: CustomRule; + before(() => { + rule = getNewRule(); + cleanKibana(); + login(); + createCustomRuleEnabled(rule, 'rule1'); + visit(ALERTS_URL); + waitForAlertsPanelToBeLoaded(); + }); + + describe('context menu', () => { + it('should navigate to the details page from the alert context menu', () => { + cy.get(TIMELINE_CONTEXT_MENU_BTN).first().click({ force: true }); + cy.get(OPEN_ALERT_DETAILS_PAGE_CONTEXT_MENU_BTN).click({ force: true }); + cy.get(PAGE_TITLE).should('contain.text', rule.name); + cy.url().should('include', '/summary'); + }); + }); + + describe('flyout', () => { + beforeEach(() => { + visit(ALERTS_URL); + waitForAlertsPanelToBeLoaded(); + }); + + it('should navigate to the details page from the alert flyout', () => { + expandFirstAlert(); + cy.get(OPEN_ALERT_DETAILS_PAGE).click({ force: true }); + cy.get(PAGE_TITLE).should('contain.text', rule.name); + cy.url().should('include', '/summary'); + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts index 8bd3e6a9ed93..4dc7d5231dcd 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/urls/not_found.cy.ts @@ -30,7 +30,8 @@ describe('Display not found page', () => { visit(TIMELINES_URL); }); - it('navigates to the alerts page with incorrect link', () => { + // TODO: We need to determine what we want the behavior to be here + it.skip('navigates to the alerts page with incorrect link', () => { visit(`${ALERTS_URL}/randomUrl`); cy.get(NOT_FOUND).should('exist'); }); diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts.ts b/x-pack/plugins/security_solution/cypress/screens/alerts.ts index 2434b713a645..acb2f47bcf27 100644 --- a/x-pack/plugins/security_solution/cypress/screens/alerts.ts +++ b/x-pack/plugins/security_solution/cypress/screens/alerts.ts @@ -71,6 +71,9 @@ export const OPEN_ALERT_BTN = '[data-test-subj="open-alert-status"]'; export const OPENED_ALERTS_FILTER_BTN = '[data-test-subj="openAlerts"]'; +export const OPEN_ALERT_DETAILS_PAGE_CONTEXT_MENU_BTN = + '[data-test-subj="open-alert-details-page-menu-item"]'; + export const PROCESS_NAME_COLUMN = '[data-test-subj="dataGridHeaderCell-process.name"]'; export const PROCESS_NAME = '[data-test-subj="formatted-field-process.name"]'; @@ -103,6 +106,8 @@ export const USER_NAME = '[data-test-subj^=formatted-field][data-test-subj$=user export const ATTACH_ALERT_TO_CASE_BUTTON = '[data-test-subj="add-to-existing-case-action"]'; +export const ATTACH_TO_NEW_CASE_BUTTON = '[data-test-subj="add-to-new-case-action"]'; + export const USER_COLUMN = '[data-gridcell-column-id="user.name"]'; export const HOST_RISK_HEADER_COLIMN = diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts b/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts index 596330707511..9a1ac0b8d08f 100644 --- a/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts +++ b/x-pack/plugins/security_solution/cypress/screens/alerts_details.ts @@ -81,3 +81,5 @@ export const INSIGHTS_RELATED_ALERTS_BY_ANCESTRY = `[data-test-subj='related-ale export const INSIGHTS_INVESTIGATE_ANCESTRY_ALERTS_IN_TIMELINE_BUTTON = `[data-test-subj='investigate-ancestry-in-timeline']`; export const ENRICHED_DATA_ROW = `[data-test-subj='EnrichedDataRow']`; + +export const OPEN_ALERT_DETAILS_PAGE = `[data-test-subj="open-alert-details-page"]`; diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx b/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx index 39988e566600..4b79d36dfef8 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx @@ -65,11 +65,11 @@ export interface HeaderPageProps extends HeaderProps { badgeOptions?: BadgeOptions; children?: React.ReactNode; draggableArguments?: DraggableArguments; + rightSideItems?: React.ReactNode[]; subtitle?: SubtitleProps['items']; subtitle2?: SubtitleProps['items']; title: TitleProp; titleNode?: React.ReactElement; - rightSideItems?: React.ReactNode[]; } export const HeaderLinkBack: React.FC<{ backOptions: BackOptions }> = React.memo( @@ -105,11 +105,11 @@ const HeaderPageComponent: React.FC = ({ children, draggableArguments, isLoading, + rightSideItems, subtitle, subtitle2, title, titleNode, - rightSideItems, }) => ( <> diff --git a/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx b/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx index af9d206a35db..4e31d2b64f83 100644 --- a/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/hover_actions/index.tsx @@ -6,7 +6,7 @@ */ import { EuiFocusTrap, EuiScreenReaderOnly } from '@elastic/eui'; -import React, { useCallback, useEffect, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import type { DraggableId } from 'react-beautiful-dnd'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; @@ -35,7 +35,7 @@ AdditionalContent.displayName = 'AdditionalContent'; const StyledHoverActionsContainer = styled.div<{ $showTopN: boolean; $showOwnFocus: boolean; - $hideTopN: boolean; + $hiddenActionsCount: number; $isActive: boolean; }>` display: flex; @@ -82,7 +82,7 @@ const StyledHoverActionsContainer = styled.div<{ `; const StyledHoverActionsContainerWithPaddingsAndMinWidth = styled(StyledHoverActionsContainer)` - min-width: ${({ $hideTopN }) => `${$hideTopN ? '112px' : '138px'}`}; + min-width: ${({ $hiddenActionsCount }) => `${138 - $hiddenActionsCount * 26}px`}; padding: ${(props) => `0 ${props.theme.eui.euiSizeS}`}; position: relative; `; @@ -161,7 +161,6 @@ export const HoverActions: React.FC = React.memo( setIsActive((prev) => !prev); setIsOverflowPopoverOpen(!isOverflowPopoverOpen); }, [isOverflowPopoverOpen, setIsOverflowPopoverOpen]); - const handleHoverActionClicked = useCallback(() => { if (closeTopN) { closeTopN(); @@ -216,6 +215,20 @@ export const HoverActions: React.FC = React.memo( ); const isCaseView = scopeId === TimelineId.casePage; + const isTimelineView = scopeId === TimelineId.active; + const isAlertDetailsView = scopeId === TimelineId.detectionsAlertDetailsPage; + + const hideFilters = useMemo( + () => isAlertDetailsView && !isTimelineView, + [isTimelineView, isAlertDetailsView] + ); + + const hiddenActionsCount = useMemo(() => { + const hiddenTopNActions = hideTopN ? 1 : 0; // hides the `Top N` button + const hiddenFilterActions = hideFilters ? 2 : 0; // hides both the `Filter In` and `Filter out` buttons + + return hiddenTopNActions + hiddenFilterActions; + }, [hideFilters, hideTopN]); const { overflowActionItems, allActionItems } = useHoverActionItems({ dataProvider, @@ -225,6 +238,7 @@ export const HoverActions: React.FC = React.memo( enableOverflowButton: enableOverflowButton && !isCaseView, field, fieldType, + hideFilters, isAggregatable, handleHoverActionClicked, hideAddToTimeline, @@ -258,7 +272,7 @@ export const HoverActions: React.FC = React.memo( onKeyDown={onKeyDown} $showTopN={showTopN} $showOwnFocus={showOwnFocus} - $hideTopN={hideTopN} + $hiddenActionsCount={hiddenActionsCount} $isActive={isActive} className={isActive ? 'hoverActions-active' : ''} > diff --git a/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx b/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx index 97c096329a94..9aa2e27d0716 100644 --- a/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx +++ b/x-pack/plugins/security_solution/public/common/components/hover_actions/use_hover_action_items.tsx @@ -33,6 +33,7 @@ export interface UseHoverActionItemsProps { isAggregatable: boolean; handleHoverActionClicked: () => void; hideAddToTimeline: boolean; + hideFilters?: boolean; hideTopN: boolean; isCaseView: boolean; isObjectArray: boolean; @@ -64,6 +65,7 @@ export const useHoverActionItems = ({ fieldType, isAggregatable, handleHoverActionClicked, + hideFilters, hideTopN, hideAddToTimeline, isCaseView, @@ -132,12 +134,18 @@ export const useHoverActionItems = ({ OnAddToTimeline(); }, [handleHoverActionClicked, OnAddToTimeline]); - /* - * In the case of `DisableOverflowButton`, we show filters only when topN is NOT opened. As after topN button is clicked, the chart panel replace current hover actions in the hover actions' popover, so we have to hide all the actions. - * in the case of `EnableOverflowButton`, we only need to hide all the items in the overflow popover as the chart's panel opens in the overflow popover, so non-overflowed actions are not affected. - */ - const showFilters = - values != null && (enableOverflowButton || (!showTopN && !enableOverflowButton)) && !isCaseView; + const showFilters = useMemo(() => { + if (hideFilters) return false; + /* + * In the case of `DisableOverflowButton`, we show filters only when topN is NOT opened. As after topN button is clicked, the chart panel replace current hover actions in the hover actions' popover, so we have to hide all the actions. + * in the case of `EnableOverflowButton`, we only need to hide all the items in the overflow popover as the chart's panel opens in the overflow popover, so non-overflowed actions are not affected. + */ + return ( + values != null && + (enableOverflowButton || (!showTopN && !enableOverflowButton)) && + !isCaseView + ); + }, [enableOverflowButton, hideFilters, isCaseView, showTopN, values]); const shouldDisableColumnToggle = (isObjectArray && field !== 'geo_point') || isCaseView; const showTopNBtn = useMemo( diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts b/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts index 52ed72dc1a2b..b7bfb751e4fa 100644 --- a/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts @@ -12,6 +12,7 @@ export { getAppLandingUrl } from '../redirect_to_landing'; export { getHostDetailsUrl, getHostsUrl } from '../redirect_to_hosts'; export { getNetworkUrl, getNetworkDetailsUrl } from '../redirect_to_network'; export { getTimelineTabsUrl, getTimelineUrl } from '../redirect_to_timelines'; +export { getAlertDetailsUrl, getAlertDetailsTabUrl } from '../redirect_to_alerts'; export { getCaseDetailsUrl, getCaseUrl, diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/index.ts b/x-pack/plugins/security_solution/public/common/components/link_to/index.ts index 1d0374711621..4630ae0f6f71 100644 --- a/x-pack/plugins/security_solution/public/common/components/link_to/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/link_to/index.ts @@ -12,6 +12,7 @@ import { useAppUrl } from '../../lib/kibana/hooks'; import type { SecurityPageName } from '../../../app/types'; import { needsUrlState } from '../../links'; +export { getAlertDetailsUrl, getAlertDetailsTabUrl } from './redirect_to_alerts'; export { getDetectionEngineUrl, getRuleDetailsUrl } from './redirect_to_detection_engine'; export { getHostDetailsUrl, getTabsOnHostDetailsUrl, getHostsUrl } from './redirect_to_hosts'; export { getKubernetesUrl, getKubernetesDetailsUrl } from './redirect_to_kubernetes'; diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_alerts.tsx b/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_alerts.tsx new file mode 100644 index 000000000000..d29530f2cdfc --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_alerts.tsx @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ALERTS_PATH } from '../../../../common/constants'; +import type { AlertDetailRouteType } from '../../../detections/pages/alert_details/types'; +import { appendSearch } from './helpers'; + +export const getAlertDetailsUrl = (alertId: string, search?: string) => + `/${alertId}/summary${appendSearch(search)}`; + +export const getAlertDetailsTabUrl = ( + detailName: string, + tabName: AlertDetailRouteType, + search?: string +) => `${ALERTS_PATH}/${detailName}/${tabName}${appendSearch(search)}`; diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts index fa2178c52d94..afcaff3f3d06 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts @@ -15,6 +15,7 @@ import { getTrailingBreadcrumbs as getIPDetailsBreadcrumbs } from '../../../../n import { getTrailingBreadcrumbs as getDetectionRulesBreadcrumbs } from '../../../../detections/pages/detection_engine/rules/utils'; import { getTrailingBreadcrumbs as getUsersBreadcrumbs } from '../../../../users/pages/details/utils'; import { getTrailingBreadcrumbs as getKubernetesBreadcrumbs } from '../../../../kubernetes/pages/utils/breadcrumbs'; +import { getTrailingBreadcrumbs as getAlertDetailBreadcrumbs } from '../../../../detections/pages/alert_details/utils/breadcrumbs'; import { SecurityPageName } from '../../../../app/types'; import type { RouteSpyState, @@ -22,6 +23,7 @@ import type { NetworkRouteSpyState, AdministrationRouteSpyState, UsersRouteSpyState, + AlertDetailRouteSpyState, } from '../../../utils/route/types'; import { timelineActions } from '../../../../timelines/store/timeline'; import { TimelineId } from '../../../../../common/types/timeline'; @@ -132,6 +134,9 @@ const getTrailingBreadcrumbsForRoutes = ( if (isKubernetesRoutes(spyState)) { return getKubernetesBreadcrumbs(spyState, getSecuritySolutionUrl); } + if (isAlertRoutes(spyState)) { + return getAlertDetailBreadcrumbs(spyState, getSecuritySolutionUrl); + } return []; }; @@ -150,6 +155,9 @@ const isCaseRoutes = (spyState: RouteSpyState) => spyState.pageName === Security const isKubernetesRoutes = (spyState: RouteSpyState) => spyState.pageName === SecurityPageName.kubernetes; +const isAlertRoutes = (spyState: RouteSpyState): spyState is AlertDetailRouteSpyState => + spyState.pageName === SecurityPageName.alerts; + const isRulesRoutes = (spyState: RouteSpyState): spyState is AdministrationRouteSpyState => spyState.pageName === SecurityPageName.rules || spyState.pageName === SecurityPageName.rulesCreate; diff --git a/x-pack/plugins/security_solution/public/common/containers/cases/use_get_related_cases_by_event.ts b/x-pack/plugins/security_solution/public/common/containers/cases/use_get_related_cases_by_event.ts new file mode 100644 index 000000000000..e032c2d63c40 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/containers/cases/use_get_related_cases_by_event.ts @@ -0,0 +1,54 @@ +/* + * Copyright 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 { useCallback, useState, useEffect } from 'react'; +import { useKibana, useToasts } from '../../lib/kibana'; +import { CASES_ERROR_TOAST } from '../../components/event_details/insights/translations'; +import { APP_ID } from '../../../../common/constants'; + +type RelatedCases = Array<{ id: string; title: string }>; + +export const useGetRelatedCasesByEvent = (eventId: string) => { + const { + services: { cases }, + } = useKibana(); + const toasts = useToasts(); + + const [relatedCases, setRelatedCases] = useState(undefined); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + + const getRelatedCases = useCallback(async () => { + setLoading(true); + let relatedCasesResponse: RelatedCases = []; + try { + if (eventId) { + relatedCasesResponse = + (await cases.api.getRelatedCases(eventId, { + owner: APP_ID, + })) ?? []; + } + } catch (err) { + setError(err); + toasts.addWarning(CASES_ERROR_TOAST(err)); + } finally { + setRelatedCases(relatedCasesResponse); + setLoading(false); + } + }, [eventId, cases.api, toasts]); + + useEffect(() => { + getRelatedCases(); + }, [eventId, getRelatedCases]); + + return { + loading, + error, + relatedCases, + refetchRelatedCases: getRelatedCases, + }; +}; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts b/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts new file mode 100644 index 000000000000..4190010301a4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts @@ -0,0 +1,135 @@ +/* + * Copyright 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 { useCallback, useMemo } from 'react'; +import { getOr } from 'lodash/fp'; +import type { SearchHit } from '../../../common/search_strategy'; + +/** + * Since the fields api may return a string array as well as an object array + * Getting the nestedPath of an object array would require first getting the top level `fields` key + * The field api keys do not provide an index value for the original order of each object + * for example, we might expect fields to reference kibana.alert.parameters.0.index, but the index information is represented by the array position. + * This should be generally fine, but given the flattened nature of the top level key, utilities like `get` or `getOr` won't work since the path isn't actually nested + * This utility allows users to not only get simple fields, but if they provide a path like `kibana.alert.parameters.index`, it will return an array of all index values + * for each object in the parameters array. As an added note, this work stemmed from a hope to be able to purely use the fields api in place of the data produced by + * `getDataFromFieldsHits` found in `x-pack/plugins/timelines/common/utils/field_formatters.ts` + */ +const getAllDotIndicesInReverse = (dotField: string): number[] => { + const dotRegx = RegExp('[.]', 'g'); + const indicesOfAllDotsInString = []; + let result = dotRegx.exec(dotField); + while (result) { + indicesOfAllDotsInString.push(result.index); + result = dotRegx.exec(dotField); + } + /** + * Put in reverse so we start look up from the most likely to be found; + * [[kibana.alert.parameters, index], ['kibana.alert', 'parameters.index'], ['kibana', 'alert.parameters.index']] + */ + return indicesOfAllDotsInString.reverse(); +}; + +/** + * We get the dot paths so we can look up each path to see if any of the nested fields exist + * */ + +const getAllPotentialDotPaths = (dotField: string): string[][] => { + const reverseDotIndices = getAllDotIndicesInReverse(dotField); + + // The nested array paths seem to be at most a tuple (i.e.: `kibana.alert.parameters`, `some.nested.parameters.field`) + const pathTuples = reverseDotIndices.map((dotIndex: number) => { + return [dotField.slice(0, dotIndex), dotField.slice(dotIndex + 1)]; + }); + + return pathTuples; +}; + +const getNestedValue = (startPath: string, endPath: string, data: Record) => { + const foundPrimaryPath = data[startPath]; + if (Array.isArray(foundPrimaryPath)) { + // If the nested path points to an array of objects return the nested value of every object in the array + return foundPrimaryPath + .map((nestedObj) => getOr(null, endPath, nestedObj)) // TODO:QUESTION: does it make sense to leave undefined or null values as array position could be important? + .filter((val) => val !== null); + } else { + // The nested path is just a nested object, so use getOr + return getOr(undefined, endPath, foundPrimaryPath); + } +}; + +/** + * we get the field value from a fields response and by breaking down to look at each individual path, + * we're able to get both top level fields as well as nested fields that don't provide index information. + * In the case where a user enters kibana.alert.parameters.someField, a mapped array of the subfield value will be returned + */ +const getFieldsValue = ( + dotField: string, + data: SearchHit['fields'] | undefined, + cacheNestedField: (fullPath: string, value: unknown) => void +) => { + if (!dotField || !data) return undefined; + + // If the dotField exists and is not a nested object return it + if (Object.hasOwn(data, dotField)) return data[dotField]; + else { + const pathTuples = getAllPotentialDotPaths(dotField); + for (const [startPath, endPath] of pathTuples) { + const foundPrimaryPath = Object.hasOwn(data, startPath) ? data[startPath] : null; + if (foundPrimaryPath) { + const nestedValue = getNestedValue(startPath, endPath, data); + // We cache only the values that need extra work to find. This can be an array of values or a single value + cacheNestedField(dotField, nestedValue); + return nestedValue; + } + } + } + + // Return undefined if nothing is found + return undefined; +}; + +export type GetFieldsDataValue = string | string[] | null | undefined; +export type GetFieldsData = (field: string) => GetFieldsDataValue; + +export const useGetFieldsData = (fieldsData: SearchHit['fields'] | undefined): GetFieldsData => { + // TODO: Move cache to top level container such as redux or context. Make it store type agnostic if possible + // TODO: Handle updates where data is re-requested and the cache is reset. + const cachedOriginalData = useMemo(() => fieldsData, [fieldsData]); + const cachedExpensiveNestedValues: Record = useMemo(() => ({}), []); + + // Speed up any lookups elsewhere by caching the field. + const cacheNestedValues = useCallback( + (fullPath: string, value: unknown) => { + cachedExpensiveNestedValues[fullPath] = value; + }, + [cachedExpensiveNestedValues] + ); + + return useCallback( + (field: string) => { + let fieldsValue; + // Get an expensive value from the cache if it exists, otherwise search for the value + if (Object.hasOwn(cachedExpensiveNestedValues, field)) { + fieldsValue = cachedExpensiveNestedValues[field]; + } else { + fieldsValue = cachedOriginalData + ? getFieldsValue(field, cachedOriginalData, cacheNestedValues) + : undefined; + } + + if (Array.isArray(fieldsValue)) { + // Return the value if it's singular, otherwise return an expected array of values + if (fieldsValue.length === 0) return undefined; + else return fieldsValue; + } + // Otherwise return the given fieldsValue if it isn't an array + return fieldsValue; + }, + [cacheNestedValues, cachedExpensiveNestedValues, cachedOriginalData] + ); +}; diff --git a/x-pack/plugins/security_solution/public/common/utils/route/types.ts b/x-pack/plugins/security_solution/public/common/utils/route/types.ts index 71d58f487da6..168c91854584 100644 --- a/x-pack/plugins/security_solution/public/common/utils/route/types.ts +++ b/x-pack/plugins/security_solution/public/common/utils/route/types.ts @@ -13,6 +13,7 @@ import type { TimelineType } from '../../../../common/types/timeline'; import type { HostsTableType } from '../../../hosts/store/model'; import type { NetworkRouteType } from '../../../network/pages/navigation/types'; +import type { AlertDetailRouteType } from '../../../detections/pages/alert_details/types'; import type { AdministrationSubTab as AdministrationType } from '../../../management/types'; import type { FlowTarget } from '../../../../common/search_strategy'; import type { UsersTableType } from '../../../users/store/model'; @@ -21,6 +22,7 @@ import type { SecurityPageName } from '../../../app/types'; export type SiemRouteType = | HostsTableType | NetworkRouteType + | AlertDetailRouteType | TimelineType | AdministrationType | UsersTableType; @@ -47,6 +49,10 @@ export interface NetworkRouteSpyState extends RouteSpyState { tabName: NetworkRouteType | undefined; } +export interface AlertDetailRouteSpyState extends RouteSpyState { + tabName: AlertDetailRouteType | undefined; +} + export interface AdministrationRouteSpyState extends RouteSpyState { tabName: AdministrationType | undefined; } diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx index 76d3c979ffb0..a0fa1f668396 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx @@ -18,6 +18,15 @@ import { useUserPrivileges } from '../../../../common/components/user_privileges jest.mock('../../../../common/components/user_privileges'); +const testSecuritySolutionLinkHref = 'test-url'; +jest.mock('../../../../common/components/links', () => ({ + useGetSecuritySolutionLinkProps: () => () => ({ href: testSecuritySolutionLinkHref }), +})); + +jest.mock('../../../../common/hooks/use_experimental_features', () => ({ + useIsExperimentalFeatureEnabled: jest.fn().mockReturnValue(true), +})); + const ecsRowData: Ecs = { _id: '1', agent: { type: ['blah'] }, @@ -83,182 +92,232 @@ const markAsOpenButton = '[data-test-subj="open-alert-status"]'; const markAsAcknowledgedButton = '[data-test-subj="acknowledged-alert-status"]'; const markAsClosedButton = '[data-test-subj="close-alert-status"]'; const addEndpointEventFilterButton = '[data-test-subj="add-event-filter-menu-item"]'; +const openAlertDetailsPageButton = '[data-test-subj="open-alert-details-page-menu-item"]'; -describe('InvestigateInResolverAction', () => { - test('it render AddToCase context menu item if timelineId === TableId.alertsOnAlertsPage', () => { - const wrapper = mount(, { - wrappingComponent: TestProviders, +describe('Alert table context menu', () => { + describe('Case actions', () => { + test('it render AddToCase context menu item if timelineId === TimelineId.detectionsPage', () => { + const wrapper = mount(, { + wrappingComponent: TestProviders, + }); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); }); - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); - }); + test('it render AddToCase context menu item if timelineId === TimelineId.detectionsRulesDetailsPage', () => { + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); + }); - test('it render AddToCase context menu item if timelineId === TableId.alertsOnRuleDetailsPage', () => { - const wrapper = mount( - , - { + test('it render AddToCase context menu item if timelineId === TimelineId.active', () => { + const wrapper = mount(, { wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); - }); + }); - test('it render AddToCase context menu item if timelineId === TimelineId.active', () => { - const wrapper = mount(, { - wrappingComponent: TestProviders, + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); }); - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(true); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(true); + test('it does NOT render AddToCase context menu item when timelineId is not in the allowed list', () => { + const wrapper = mount(, { + wrappingComponent: TestProviders, + }); + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(false); + expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(false); + }); }); - test('it does NOT render AddToCase context menu item when timelineId is not in the allowed list', () => { - const wrapper = mount(, { - wrappingComponent: TestProviders, + describe('Alert status actions', () => { + test('it renders the correct status action buttons', () => { + const wrapper = mount(, { + wrappingComponent: TestProviders, + }); + + wrapper.find(actionMenuButton).simulate('click'); + + expect(wrapper.find(markAsOpenButton).first().exists()).toEqual(false); + expect(wrapper.find(markAsAcknowledgedButton).first().exists()).toEqual(true); + expect(wrapper.find(markAsClosedButton).first().exists()).toEqual(true); }); - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addToExistingCaseButton).first().exists()).toEqual(false); - expect(wrapper.find(addToNewCaseButton).first().exists()).toEqual(false); }); - test('it renders the correct status action buttons', () => { - const wrapper = mount(, { - wrappingComponent: TestProviders, - }); + describe('Endpoint event filter actions', () => { + describe('AddEndpointEventFilter', () => { + const endpointEventProps = { + ...props, + ecsRowData: { ...ecsRowData, agent: { type: ['endpoint'] }, event: { kind: ['event'] } }, + }; + + describe('when users can access endpoint management', () => { + beforeEach(() => { + (useUserPrivileges as jest.Mock).mockReturnValue({ + ...mockInitialUserPrivilegesState(), + endpointPrivileges: { loading: false, canAccessEndpointManagement: true }, + }); + }); - wrapper.find(actionMenuButton).simulate('click'); + test('it disables AddEndpointEventFilter when timeline id is not host events page', () => { + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + }); - expect(wrapper.find(markAsOpenButton).first().exists()).toEqual(false); - expect(wrapper.find(markAsAcknowledgedButton).first().exists()).toEqual(true); - expect(wrapper.find(markAsClosedButton).first().exists()).toEqual(true); - }); + test('it enables AddEndpointEventFilter when timeline id is host events page', () => { + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual( + false + ); + }); - describe('AddEndpointEventFilter', () => { - const endpointEventProps = { - ...props, - ecsRowData: { ...ecsRowData, agent: { type: ['endpoint'] }, event: { kind: ['event'] } }, - }; - - describe('when users can access endpoint management', () => { - beforeEach(() => { - (useUserPrivileges as jest.Mock).mockReturnValue({ - ...mockInitialUserPrivilegesState(), - endpointPrivileges: { loading: false, canAccessEndpointManagement: true }, + test('it disables AddEndpointEventFilter when timeline id is host events page but is not from endpoint', () => { + const customProps = { + ...props, + ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, + }; + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); }); - }); - test('it disables AddEndpointEventFilter when timeline id is not host events page', () => { - const wrapper = mount( - , - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); - }); + test('it enables AddEndpointEventFilter when timeline id is user events page', () => { + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual( + false + ); + }); - test('it enables AddEndpointEventFilter when timeline id is host events page', () => { - const wrapper = mount( - , - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(false); + test('it disables AddEndpointEventFilter when timeline id is user events page but is not from endpoint', () => { + const customProps = { + ...props, + ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, + }; + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + }); }); - test('it disables AddEndpointEventFilter when timeline id is host events page but is not from endpoint', () => { - const customProps = { - ...props, - ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, - }; - const wrapper = mount( - , - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); - }); + describe('when users can NOT access endpoint management', () => { + beforeEach(() => { + (useUserPrivileges as jest.Mock).mockReturnValue({ + ...mockInitialUserPrivilegesState(), + endpointPrivileges: { loading: false, canAccessEndpointManagement: false }, + }); + }); - test('it enables AddEndpointEventFilter when timeline id is user events page', () => { - const wrapper = mount( - , - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(false); - }); + test('it disables AddEndpointEventFilter when timeline id is host events page but cannot acces endpoint management', () => { + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + }); - test('it disables AddEndpointEventFilter when timeline id is user events page but is not from endpoint', () => { - const customProps = { - ...props, - ecsRowData: { ...ecsRowData, agent: { type: ['other'] }, event: { kind: ['event'] } }, - }; - const wrapper = mount( - , - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); - }); - }); - describe('when users can NOT access endpoint management', () => { - beforeEach(() => { - (useUserPrivileges as jest.Mock).mockReturnValue({ - ...mockInitialUserPrivilegesState(), - endpointPrivileges: { loading: false, canAccessEndpointManagement: false }, + test('it disables AddEndpointEventFilter when timeline id is user events page but cannot acces endpoint management', () => { + const wrapper = mount( + , + { + wrappingComponent: TestProviders, + } + ); + + wrapper.find(actionMenuButton).simulate('click'); + expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); + expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); }); }); + }); + }); - test('it disables AddEndpointEventFilter when timeline id is host events page but cannot acces endpoint management', () => { - const wrapper = mount( - , - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + describe('Open alert details action', () => { + test('it does not render the open alert details page action if kibana.alert.rule.uuid is not set', () => { + const nonAlertProps = { + ...props, + ecsRowData: { + ...ecsRowData, + kibana: { + alert: { + workflow_status: ['open'], + rule: { + parameters: {}, + uuid: [], + }, + }, + }, + }, + }; + + const wrapper = mount(, { + wrappingComponent: TestProviders, }); - test('it disables AddEndpointEventFilter when timeline id is user events page but cannot acces endpoint management', () => { - const wrapper = mount( - , - { - wrappingComponent: TestProviders, - } - ); - - wrapper.find(actionMenuButton).simulate('click'); - expect(wrapper.find(addEndpointEventFilterButton).first().exists()).toEqual(true); - expect(wrapper.find(addEndpointEventFilterButton).first().props().disabled).toEqual(true); + wrapper.find(actionMenuButton).simulate('click'); + + expect(wrapper.find(openAlertDetailsPageButton).first().exists()).toEqual(false); + }); + + test('it renders the open alert details action button', () => { + const wrapper = mount(, { + wrappingComponent: TestProviders, }); + + wrapper.find(actionMenuButton).simulate('click'); + + expect(wrapper.find(openAlertDetailsPageButton).first().exists()).toEqual(true); }); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx index 842cdfe82fff..40d6feda3b92 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx @@ -43,6 +43,7 @@ import { useEventFilterAction } from './use_event_filter_action'; import { useAddToCaseActions } from './use_add_to_case_actions'; import { isAlertFromEndpointAlert } from '../../../../common/utils/endpoint_alert_check'; import type { Rule } from '../../../../detection_engine/rule_management/logic/types'; +import { useOpenAlertDetailsAction } from './use_open_alert_details'; interface AlertContextMenuProps { ariaLabel?: string; @@ -50,7 +51,6 @@ interface AlertContextMenuProps { columnValues: string; disabled: boolean; ecsRowData: Ecs; - refetch: inputsModel.Refetch; onRuleChange?: () => void; scopeId: string; } @@ -61,7 +61,6 @@ const AlertContextMenuComponent: React.FC (ecsRowData?.kibana?.alert ? ecsRowData?._id : null); + const alertId = getAlertId(); const ruleId = get(0, ecsRowData?.kibana?.alert?.rule?.uuid); const ruleName = get(0, ecsRowData?.kibana?.alert?.rule?.name); const isInDetections = [TableId.alertsOnAlertsPage, TableId.alertsOnRuleDetailsPage].includes( @@ -209,6 +209,12 @@ const AlertContextMenuComponent: React.FC !isEvent && ruleId @@ -217,6 +223,7 @@ const AlertContextMenuComponent: React.FC void; + alertId: string | null; +} + +export const ACTION_OPEN_ALERT_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.detectionEngine.alerts.actions.openAlertDetails', + { + defaultMessage: 'Open alert details page', + } +); + +export const useOpenAlertDetailsAction = ({ ruleId, closePopover, alertId }: Props) => { + const isAlertDetailsPageEnabled = useIsExperimentalFeatureEnabled('alertDetailsPageEnabled'); + const alertDetailsActionItems = []; + const { onClick } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.alerts, + path: alertId ? getAlertDetailsUrl(alertId) : '', + }); + + // We check ruleId to confirm this is an alert, as this page does not support events as of 8.6 + if (ruleId && alertId && isAlertDetailsPageEnabled) { + alertDetailsActionItems.push( + + {ACTION_OPEN_ALERT_DETAILS_PAGE} + + ); + } + + return { + alertDetailsActionItems, + }; +}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/alert_details_response.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/alert_details_response.ts new file mode 100644 index 000000000000..67c5415fb2b2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/alert_details_response.ts @@ -0,0 +1,2020 @@ +/* + * Copyright 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 { Ecs } from '../../../../../common/ecs'; + +// This data was generated using the endpoint test alert generator +export const getMockAlertDetailsFieldsResponse = () => ({ + _index: '.internal.alerts-security.alerts-default-000001', + _id: 'f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325', + _score: 1, + fields: { + 'kibana.alert.severity': ['medium'], + 'process.hash.md5': ['fake md5'], + 'kibana.alert.rule.updated_by': ['elastic'], + 'signal.ancestors.depth': [0], + 'event.category': ['malware'], + 'kibana.alert.rule.rule_name_override': ['message'], + 'Endpoint.capabilities': ['isolation', 'kill_process', 'suspend_process', 'running_processes'], + 'process.parent.pid': [1], + 'process.hash.sha256': ['fake sha256'], + 'host.hostname': ['Host-4cfuh42w7g'], + 'kibana.alert.rule.tags': ['Elastic', 'Endpoint Security'], + 'host.mac': ['f2-32-1b-dc-ec-80'], + 'elastic.agent.id': ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + 'dll.hash.sha256': ['8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2'], + 'kibana.alert.ancestors.depth': [0], + 'signal.rule.enabled': ['true'], + 'signal.rule.max_signals': [10000], + 'host.os.version': ['10.0'], + 'signal.rule.updated_at': ['2022-09-29T19:39:38.137Z'], + 'kibana.alert.risk_score': [47], + 'Endpoint.policy.applied.id': ['C2A9093E-E289-4C0A-AA44-8C32A414FA7A'], + 'kibana.alert.rule.severity_mapping.severity': ['low', 'medium', 'high', 'critical'], + 'event.agent_id_status': ['auth_metadata_missing'], + 'kibana.alert.original_event.id': ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + 'kibana.alert.rule.risk_score_mapping.value': [''], + 'process.Ext.ancestry': ['kj0le842x0', '1r4s9i1br4'], + 'signal.original_event.code': ['memory_signature'], + 'kibana.alert.original_event.module': ['endpoint'], + 'kibana.alert.rule.interval': ['5m'], + 'kibana.alert.rule.type': ['query'], + 'signal.original_event.sequence': [1232], + 'Endpoint.state.isolation': [true], + 'host.architecture': ['x7n6yt4fol'], + 'kibana.alert.rule.immutable': ['true'], + 'kibana.alert.original_event.type': ['info'], + 'event.code': ['memory_signature'], + 'agent.id': ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + 'signal.original_event.module': ['endpoint'], + 'kibana.alert.rule.exceptions_list.list_id': ['endpoint_list'], + 'signal.rule.from': ['now-10m'], + 'kibana.alert.rule.exceptions_list.type': ['endpoint'], + 'process.group_leader.entity_id': ['b74mw1jkrm'], + 'dll.Ext.malware_classification.version': ['3.0.0'], + 'kibana.alert.rule.enabled': ['true'], + 'kibana.alert.rule.version': ['100'], + 'kibana.alert.ancestors.type': ['event'], + 'process.entry_leader.name': ['fake entry'], + 'dll.Ext.compile_time': [1534424710], + 'signal.ancestors.index': ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + 'dll.Ext.malware_classification.score': [0], + 'process.entity_id': ['d3v4to81q9'], + 'host.ip': ['10.184.3.36', '10.170.218.86'], + 'agent.type': ['endpoint'], + 'signal.original_event.category': ['malware'], + 'signal.original_event.id': ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + 'process.uptime': [0], + 'Endpoint.policy.applied.name': ['With Eventing'], + 'host.id': ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + 'process.Ext.code_signature.subject_name': ['bad signer'], + 'process.Ext.token.integrity_level_name': ['high'], + 'signal.original_event.type': ['info'], + 'kibana.alert.rule.max_signals': [10000], + 'signal.rule.author': ['Elastic'], + 'kibana.alert.rule.risk_score': [47], + 'dll.Ext.malware_classification.identifier': ['Whitelisted'], + 'dll.Ext.mapped_address': [5362483200], + 'signal.original_event.dataset': ['endpoint'], + 'kibana.alert.rule.consumer': ['siem'], + 'kibana.alert.rule.indices': ['logs-endpoint.alerts-*'], + 'kibana.alert.rule.category': ['Custom Query Rule'], + 'host.os.Ext.variant': ['Windows Server'], + 'event.ingested': ['2022-09-29T19:37:00.000Z'], + 'event.action': ['start'], + 'signal.rule.updated_by': ['elastic'], + '@timestamp': ['2022-09-29T19:40:26.051Z'], + 'kibana.alert.original_event.action': ['start'], + 'host.os.platform': ['Windows'], + 'process.session_leader.entity_id': ['b74mw1jkrm'], + 'kibana.alert.rule.severity': ['medium'], + 'kibana.alert.original_event.agent_id_status': ['auth_metadata_missing'], + 'Endpoint.status': ['enrolled'], + 'data_stream.dataset': ['endpoint.alerts'], + 'signal.rule.timestamp_override': ['event.ingested'], + 'kibana.alert.rule.execution.uuid': ['abf39d36-0f1c-4bf9-ae42-1039285380b5'], + 'kibana.alert.uuid': ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + 'kibana.version': ['8.6.0'], + 'process.hash.sha1': ['fake sha1'], + 'event.id': ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + 'process.entry_leader.pid': [865], + 'signal.rule.license': ['Elastic License v2'], + 'signal.ancestors.type': ['event'], + 'kibana.alert.rule.rule_id': ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + 'process.session_leader.pid': [745], + 'signal.rule.type': ['query'], + 'Endpoint.policy.applied.version': [5], + 'dll.hash.md5': ['1f2d082566b0fc5f2c238a5180db7451'], + 'kibana.alert.ancestors.id': ['7L3AioMBWJvcpv7vlX2O'], + 'user.name': ['root'], + 'source.ip': ['10.184.3.46'], + 'signal.rule.rule_name_override': ['message'], + 'process.group_leader.name': ['fake leader'], + 'host.os.full': ['Windows Server 2016'], + 'kibana.alert.original_event.code': ['memory_signature'], + 'kibana.alert.rule.risk_score_mapping.field': ['event.risk_score'], + 'kibana.alert.rule.description': [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + 'process.pid': [2], + 'kibana.alert.rule.producer': ['siem'], + 'kibana.alert.rule.to': ['now'], + 'signal.rule.interval': ['5m'], + 'signal.rule.created_by': ['elastic'], + 'kibana.alert.rule.created_by': ['elastic'], + 'kibana.alert.rule.timestamp_override': ['event.ingested'], + 'kibana.alert.original_event.ingested': ['2022-09-29T19:37:00.000Z'], + 'signal.rule.id': ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + 'process.parent.entity_id': ['kj0le842x0'], + 'signal.rule.risk_score': [47], + 'signal.reason': [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + 'host.os.name': ['Windows'], + 'kibana.alert.rule.name': ['Endpoint Security'], + 'host.name': ['Host-4cfuh42w7g'], + 'signal.status': ['open'], + 'event.kind': ['signal'], + 'kibana.alert.rule.severity_mapping.value': ['21', '47', '73', '99'], + 'signal.rule.tags': ['Elastic', 'Endpoint Security'], + 'signal.rule.created_at': ['2022-09-29T19:39:38.137Z'], + 'kibana.alert.workflow_status': ['open'], + 'Endpoint.policy.applied.status': ['warning'], + 'kibana.alert.rule.uuid': ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + 'kibana.alert.original_event.category': ['malware'], + 'dll.Ext.malware_classification.threshold': [0], + 'kibana.alert.reason': [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + 'dll.pe.architecture': ['x64'], + 'data_stream.type': ['logs'], + 'signal.original_time': ['2022-10-09T07:14:42.194Z'], + 'signal.ancestors.id': ['7L3AioMBWJvcpv7vlX2O'], + 'process.name': ['explorer.exe'], + 'ecs.version': ['1.6.0'], + 'signal.rule.severity': ['medium'], + 'kibana.alert.ancestors.index': ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + 'Endpoint.configuration.isolation': [true], + 'Memory_protection.feature': ['signature'], + 'dll.code_signature.trusted': [true], + 'process.Ext.code_signature.trusted': [false], + 'kibana.alert.depth': [1], + 'agent.version': ['8.6.0'], + 'kibana.alert.rule.risk_score_mapping.operator': ['equals'], + 'host.os.family': ['windows'], + 'kibana.alert.rule.from': ['now-10m'], + 'Memory_protection.self_injection': [true], + 'process.start': ['2022-10-09T07:14:42.194Z'], + 'kibana.alert.rule.parameters': [ + { + severity_mapping: [ + { + severity: 'low', + field: 'event.severity', + value: '21', + operator: 'equals', + }, + { + severity: 'medium', + field: 'event.severity', + value: '47', + operator: 'equals', + }, + { + severity: 'high', + field: 'event.severity', + value: '73', + operator: 'equals', + }, + { + severity: 'critical', + field: 'event.severity', + value: '99', + operator: 'equals', + }, + ], + references: [], + description: + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + language: 'kuery', + type: 'query', + rule_name_override: 'message', + exceptions_list: [ + { + list_id: 'endpoint_list', + namespace_type: 'agnostic', + id: 'endpoint_list', + type: 'endpoint', + }, + ], + timestamp_override: 'event.ingested', + from: 'now-10m', + severity: 'medium', + max_signals: 10000, + risk_score: 47, + risk_score_mapping: [ + { + field: 'event.risk_score', + value: '', + operator: 'equals', + }, + ], + author: ['Elastic'], + query: 'event.kind:alert and event.module:(endpoint and not endgame)\n', + index: ['logs-endpoint.alerts-*'], + version: 100, + rule_id: '9a1a2dae-0b5f-4c3d-8305-a268d404c306', + license: 'Elastic License v2', + required_fields: [ + { + ecs: true, + name: 'event.kind', + type: 'keyword', + }, + { + ecs: true, + name: 'event.module', + type: 'keyword', + }, + ], + immutable: true, + related_integrations: [], + setup: '', + false_positives: [], + threat: [], + to: 'now', + }, + ], + 'signal.rule.version': ['100'], + 'signal.original_event.kind': ['alert'], + 'kibana.alert.status': ['active'], + 'kibana.alert.rule.severity_mapping.field': [ + 'event.severity', + 'event.severity', + 'event.severity', + 'event.severity', + ], + 'kibana.alert.original_event.dataset': ['endpoint'], + 'signal.depth': [1], + 'signal.rule.immutable': ['true'], + 'process.group_leader.pid': [116], + 'event.sequence': [1232], + 'kibana.alert.rule.rule_type_id': ['siem.queryRule'], + 'process.session_leader.name': ['fake session'], + 'signal.rule.name': ['Endpoint Security'], + 'signal.rule.rule_id': ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + 'event.module': ['endpoint'], + 'dll.hash.sha1': ['ca85243c0af6a6471bdaa560685c51eefd6dbc0d'], + 'kibana.alert.rule.severity_mapping.operator': ['equals', 'equals', 'equals', 'equals'], + 'process.Ext.malware_signature.all_names': ['Windows.Trojan.FakeAgent'], + 'kibana.alert.rule.license': ['Elastic License v2'], + 'kibana.alert.original_event.kind': ['alert'], + 'process.executable': ['C:/fake/explorer.exe'], + 'kibana.alert.rule.updated_at': ['2022-09-29T19:39:38.137Z'], + 'signal.rule.description': [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + 'dll.Ext.mapped_size': [0], + 'data_stream.namespace': ['default'], + 'kibana.alert.rule.author': ['Elastic'], + 'dll.code_signature.subject_name': ['Cybereason Inc'], + 'Endpoint.policy.applied.endpoint_policy_version': [3], + 'kibana.alert.original_event.sequence': [1232], + 'dll.path': ['C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe'], + 'process.Ext.user': ['SYSTEM'], + 'signal.original_event.action': ['start'], + 'signal.rule.to': ['now'], + 'kibana.alert.rule.created_at': ['2022-09-29T19:39:38.137Z'], + 'process.Ext.malware_signature.identifier': ['diagnostic-malware-signature-v1-fake'], + 'kibana.alert.rule.exceptions_list.namespace_type': ['agnostic'], + 'event.type': ['info'], + 'kibana.space_ids': ['default'], + 'process.entry_leader.entity_id': ['b74mw1jkrm'], + 'kibana.alert.rule.exceptions_list.id': ['endpoint_list'], + 'event.dataset': ['endpoint'], + 'kibana.alert.original_time': ['2022-10-09T07:14:42.194Z'], + }, +}); + +export const getMockAlertDetailsTimelineResponse = () => [ + { + category: 'kibana', + field: 'kibana.alert.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.hash.md5', + values: ['fake md5'], + originalValue: ['fake md5'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.updated_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.depth', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.category', + values: ['malware'], + originalValue: ['malware'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.rule_name_override', + values: ['message'], + originalValue: ['message'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.capabilities', + values: ['isolation', 'kill_process', 'suspend_process', 'running_processes'], + originalValue: ['isolation', 'kill_process', 'suspend_process', 'running_processes'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.parent.pid', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.hash.sha256', + values: ['fake sha256'], + originalValue: ['fake sha256'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.hostname', + values: ['Host-4cfuh42w7g'], + originalValue: ['Host-4cfuh42w7g'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.tags', + values: ['Elastic', 'Endpoint Security'], + originalValue: ['Elastic', 'Endpoint Security'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.mac', + values: ['f2-32-1b-dc-ec-80'], + originalValue: ['f2-32-1b-dc-ec-80'], + isObjectArray: false, + }, + { + category: 'elastic', + field: 'elastic.agent.id', + values: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + originalValue: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.hash.sha256', + values: ['8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2'], + originalValue: ['8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.depth', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.enabled', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.max_signals', + values: ['10000'], + originalValue: ['10000'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.version', + values: ['10.0'], + originalValue: ['10.0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.updated_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.id', + values: ['C2A9093E-E289-4C0A-AA44-8C32A414FA7A'], + originalValue: ['C2A9093E-E289-4C0A-AA44-8C32A414FA7A'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.severity', + values: ['low', 'medium', 'high', 'critical'], + originalValue: ['low', 'medium', 'high', 'critical'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.agent_id_status', + values: ['auth_metadata_missing'], + originalValue: ['auth_metadata_missing'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.id', + values: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + originalValue: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score_mapping.value', + values: [''], + originalValue: [''], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.ancestry', + values: ['kj0le842x0', '1r4s9i1br4'], + originalValue: ['kj0le842x0', '1r4s9i1br4'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.code', + values: ['memory_signature'], + originalValue: ['memory_signature'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.module', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.interval', + values: ['5m'], + originalValue: ['5m'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.type', + values: ['query'], + originalValue: ['query'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.sequence', + values: ['1232'], + originalValue: ['1232'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.state.isolation', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.architecture', + values: ['x7n6yt4fol'], + originalValue: ['x7n6yt4fol'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.immutable', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.type', + values: ['info'], + originalValue: ['info'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.code', + values: ['memory_signature'], + originalValue: ['memory_signature'], + isObjectArray: false, + }, + { + category: 'agent', + field: 'agent.id', + values: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + originalValue: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.module', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.list_id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.from', + values: ['now-10m'], + originalValue: ['now-10m'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.type', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.group_leader.entity_id', + values: ['b74mw1jkrm'], + originalValue: ['b74mw1jkrm'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.version', + values: ['3.0.0'], + originalValue: ['3.0.0'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.enabled', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.version', + values: ['100'], + originalValue: ['100'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.type', + values: ['event'], + originalValue: ['event'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entry_leader.name', + values: ['fake entry'], + originalValue: ['fake entry'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.compile_time', + values: ['1534424710'], + originalValue: ['1534424710'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.index', + values: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + originalValue: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.score', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entity_id', + values: ['d3v4to81q9'], + originalValue: ['d3v4to81q9'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.ip', + values: ['10.184.3.36', '10.170.218.86'], + originalValue: ['10.184.3.36', '10.170.218.86'], + isObjectArray: false, + }, + { + category: 'agent', + field: 'agent.type', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.category', + values: ['malware'], + originalValue: ['malware'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.id', + values: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + originalValue: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.uptime', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.name', + values: ['With Eventing'], + originalValue: ['With Eventing'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.id', + values: ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + originalValue: ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.code_signature.subject_name', + values: ['bad signer'], + originalValue: ['bad signer'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.token.integrity_level_name', + values: ['high'], + originalValue: ['high'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.type', + values: ['info'], + originalValue: ['info'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.max_signals', + values: ['10000'], + originalValue: ['10000'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.author', + values: ['Elastic'], + originalValue: ['Elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.identifier', + values: ['Whitelisted'], + originalValue: ['Whitelisted'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.mapped_address', + values: ['5362483200'], + originalValue: ['5362483200'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.dataset', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.consumer', + values: ['siem'], + originalValue: ['siem'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.indices', + values: ['logs-endpoint.alerts-*'], + originalValue: ['logs-endpoint.alerts-*'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.category', + values: ['Custom Query Rule'], + originalValue: ['Custom Query Rule'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.Ext.variant', + values: ['Windows Server'], + originalValue: ['Windows Server'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.ingested', + values: ['2022-09-29T19:37:00.000Z'], + originalValue: ['2022-09-29T19:37:00.000Z'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.action', + values: ['start'], + originalValue: ['start'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.updated_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'base', + field: '@timestamp', + values: ['2022-09-29T19:40:26.051Z'], + originalValue: ['2022-09-29T19:40:26.051Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.action', + values: ['start'], + originalValue: ['start'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.platform', + values: ['Windows'], + originalValue: ['Windows'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.session_leader.entity_id', + values: ['b74mw1jkrm'], + originalValue: ['b74mw1jkrm'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.agent_id_status', + values: ['auth_metadata_missing'], + originalValue: ['auth_metadata_missing'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.status', + values: ['enrolled'], + originalValue: ['enrolled'], + isObjectArray: false, + }, + { + category: 'data_stream', + field: 'data_stream.dataset', + values: ['endpoint.alerts'], + originalValue: ['endpoint.alerts'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.timestamp_override', + values: ['event.ingested'], + originalValue: ['event.ingested'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.execution.uuid', + values: ['abf39d36-0f1c-4bf9-ae42-1039285380b5'], + originalValue: ['abf39d36-0f1c-4bf9-ae42-1039285380b5'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.uuid', + values: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + originalValue: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.version', + values: ['8.6.0'], + originalValue: ['8.6.0'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.hash.sha1', + values: ['fake sha1'], + originalValue: ['fake sha1'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.id', + values: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + originalValue: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entry_leader.pid', + values: ['865'], + originalValue: ['865'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.license', + values: ['Elastic License v2'], + originalValue: ['Elastic License v2'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.type', + values: ['event'], + originalValue: ['event'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.rule_id', + values: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + originalValue: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.session_leader.pid', + values: ['745'], + originalValue: ['745'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.type', + values: ['query'], + originalValue: ['query'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.version', + values: ['5'], + originalValue: ['5'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.hash.md5', + values: ['1f2d082566b0fc5f2c238a5180db7451'], + originalValue: ['1f2d082566b0fc5f2c238a5180db7451'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.id', + values: ['7L3AioMBWJvcpv7vlX2O'], + originalValue: ['7L3AioMBWJvcpv7vlX2O'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.rule_name_override', + values: ['message'], + originalValue: ['message'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.group_leader.name', + values: ['fake leader'], + originalValue: ['fake leader'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.full', + values: ['Windows Server 2016'], + originalValue: ['Windows Server 2016'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.code', + values: ['memory_signature'], + originalValue: ['memory_signature'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score_mapping.field', + values: ['event.risk_score'], + originalValue: ['event.risk_score'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.description', + values: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + originalValue: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.pid', + values: ['2'], + originalValue: ['2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.producer', + values: ['siem'], + originalValue: ['siem'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.to', + values: ['now'], + originalValue: ['now'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.interval', + values: ['5m'], + originalValue: ['5m'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.created_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.created_by', + values: ['elastic'], + originalValue: ['elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.timestamp_override', + values: ['event.ingested'], + originalValue: ['event.ingested'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.ingested', + values: ['2022-09-29T19:37:00.000Z'], + originalValue: ['2022-09-29T19:37:00.000Z'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.id', + values: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + originalValue: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.parent.entity_id', + values: ['kj0le842x0'], + originalValue: ['kj0le842x0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.reason', + values: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + originalValue: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.name', + values: ['Windows'], + originalValue: ['Windows'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.name', + values: ['Endpoint Security'], + originalValue: ['Endpoint Security'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.name', + values: ['Host-4cfuh42w7g'], + originalValue: ['Host-4cfuh42w7g'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.status', + values: ['open'], + originalValue: ['open'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.kind', + values: ['signal'], + originalValue: ['signal'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.value', + values: ['21', '47', '73', '99'], + originalValue: ['21', '47', '73', '99'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.tags', + values: ['Elastic', 'Endpoint Security'], + originalValue: ['Elastic', 'Endpoint Security'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.created_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.workflow_status', + values: ['open'], + originalValue: ['open'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.status', + values: ['warning'], + originalValue: ['warning'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.uuid', + values: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + originalValue: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.category', + values: ['malware'], + originalValue: ['malware'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.malware_classification.threshold', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.reason', + values: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + originalValue: [ + 'malware event with process explorer.exe, on Host-4cfuh42w7g created medium alert Endpoint Security.', + ], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.pe.architecture', + values: ['x64'], + originalValue: ['x64'], + isObjectArray: false, + }, + { + category: 'data_stream', + field: 'data_stream.type', + values: ['logs'], + originalValue: ['logs'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_time', + values: ['2022-10-09T07:14:42.194Z'], + originalValue: ['2022-10-09T07:14:42.194Z'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.ancestors.id', + values: ['7L3AioMBWJvcpv7vlX2O'], + originalValue: ['7L3AioMBWJvcpv7vlX2O'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.name', + values: ['explorer.exe'], + originalValue: ['explorer.exe'], + isObjectArray: false, + }, + { + category: 'ecs', + field: 'ecs.version', + values: ['1.6.0'], + originalValue: ['1.6.0'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.ancestors.index', + values: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + originalValue: ['.ds-logs-endpoint.alerts-default-2022.09.29-000001'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.configuration.isolation', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'Memory_protection', + field: 'Memory_protection.feature', + values: ['signature'], + originalValue: ['signature'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.code_signature.trusted', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.code_signature.trusted', + values: ['false'], + originalValue: ['false'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.depth', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, + { + category: 'agent', + field: 'agent.version', + values: ['8.6.0'], + originalValue: ['8.6.0'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.risk_score_mapping.operator', + values: ['equals'], + originalValue: ['equals'], + isObjectArray: false, + }, + { + category: 'host', + field: 'host.os.family', + values: ['windows'], + originalValue: ['windows'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.from', + values: ['now-10m'], + originalValue: ['now-10m'], + isObjectArray: false, + }, + { + category: 'Memory_protection', + field: 'Memory_protection.self_injection', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.start', + values: ['2022-10-09T07:14:42.194Z'], + originalValue: ['2022-10-09T07:14:42.194Z'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.severity', + values: ['low', 'medium', 'high', 'critical'], + originalValue: ['low', 'medium', 'high', 'critical'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.field', + values: ['event.severity'], + originalValue: ['event.severity'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.value', + values: ['21', '47', '73', '99'], + originalValue: ['21', '47', '73', '99'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity_mapping.operator', + values: ['equals'], + originalValue: ['equals'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.references', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.description', + values: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + originalValue: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.language', + values: ['kuery'], + originalValue: ['kuery'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.type', + values: ['query'], + originalValue: ['query'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.rule_name_override', + values: ['message'], + originalValue: ['message'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.list_id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.namespace_type', + values: ['agnostic'], + originalValue: ['agnostic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.exceptions_list.type', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.timestamp_override', + values: ['event.ingested'], + originalValue: ['event.ingested'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.from', + values: ['now-10m'], + originalValue: ['now-10m'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.severity', + values: ['medium'], + originalValue: ['medium'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.max_signals', + values: ['10000'], + originalValue: ['10000'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score', + values: ['47'], + originalValue: ['47'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score_mapping.field', + values: ['event.risk_score'], + originalValue: ['event.risk_score'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score_mapping.value', + values: [''], + originalValue: [''], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.risk_score_mapping.operator', + values: ['equals'], + originalValue: ['equals'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.author', + values: ['Elastic'], + originalValue: ['Elastic'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.query', + values: ['event.kind:alert and event.module:(endpoint and not endgame)\n'], + originalValue: ['event.kind:alert and event.module:(endpoint and not endgame)\n'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.index', + values: ['logs-endpoint.alerts-*'], + originalValue: ['logs-endpoint.alerts-*'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.version', + values: ['100'], + originalValue: ['100'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.rule_id', + values: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + originalValue: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.license', + values: ['Elastic License v2'], + originalValue: ['Elastic License v2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.required_fields.ecs', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.required_fields.name', + values: ['event.kind', 'event.module'], + originalValue: ['event.kind', 'event.module'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.required_fields.type', + values: ['keyword'], + originalValue: ['keyword'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.immutable', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.related_integrations', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.setup', + values: [''], + originalValue: [''], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.false_positives', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.threat', + values: [], + originalValue: [], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.to', + values: ['now'], + originalValue: ['now'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.version', + values: ['100'], + originalValue: ['100'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.kind', + values: ['alert'], + originalValue: ['alert'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.status', + values: ['active'], + originalValue: ['active'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.field', + values: ['event.severity', 'event.severity', 'event.severity', 'event.severity'], + originalValue: ['event.severity', 'event.severity', 'event.severity', 'event.severity'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.dataset', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.depth', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.immutable', + values: ['true'], + originalValue: ['true'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.group_leader.pid', + values: ['116'], + originalValue: ['116'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.sequence', + values: ['1232'], + originalValue: ['1232'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.rule_type_id', + values: ['siem.queryRule'], + originalValue: ['siem.queryRule'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.session_leader.name', + values: ['fake session'], + originalValue: ['fake session'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.name', + values: ['Endpoint Security'], + originalValue: ['Endpoint Security'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.rule_id', + values: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + originalValue: ['9a1a2dae-0b5f-4c3d-8305-a268d404c306'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.module', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.hash.sha1', + values: ['ca85243c0af6a6471bdaa560685c51eefd6dbc0d'], + originalValue: ['ca85243c0af6a6471bdaa560685c51eefd6dbc0d'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.severity_mapping.operator', + values: ['equals', 'equals', 'equals', 'equals'], + originalValue: ['equals', 'equals', 'equals', 'equals'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.malware_signature.all_names', + values: ['Windows.Trojan.FakeAgent'], + originalValue: ['Windows.Trojan.FakeAgent'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.license', + values: ['Elastic License v2'], + originalValue: ['Elastic License v2'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.kind', + values: ['alert'], + originalValue: ['alert'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.executable', + values: ['C:/fake/explorer.exe'], + originalValue: ['C:/fake/explorer.exe'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.updated_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.description', + values: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + originalValue: [ + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + ], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.Ext.mapped_size', + values: ['0'], + originalValue: ['0'], + isObjectArray: false, + }, + { + category: 'data_stream', + field: 'data_stream.namespace', + values: ['default'], + originalValue: ['default'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.author', + values: ['Elastic'], + originalValue: ['Elastic'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.code_signature.subject_name', + values: ['Cybereason Inc'], + originalValue: ['Cybereason Inc'], + isObjectArray: false, + }, + { + category: 'user', + field: 'user.name', + values: ['root'], + originalValue: ['root'], + isObjectArray: false, + }, + { + category: 'source', + field: 'source.ip', + values: ['10.184.3.46'], + originalValue: ['10.184.3.46'], + isObjectArray: false, + }, + { + category: 'Endpoint', + field: 'Endpoint.policy.applied.endpoint_policy_version', + values: ['3'], + originalValue: ['3'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_event.sequence', + values: ['1232'], + originalValue: ['1232'], + isObjectArray: false, + }, + { + category: 'dll', + field: 'dll.path', + values: ['C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe'], + originalValue: ['C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.user', + values: ['SYSTEM'], + originalValue: ['SYSTEM'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.original_event.action', + values: ['start'], + originalValue: ['start'], + isObjectArray: false, + }, + { + category: 'signal', + field: 'signal.rule.to', + values: ['now'], + originalValue: ['now'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.created_at', + values: ['2022-09-29T19:39:38.137Z'], + originalValue: ['2022-09-29T19:39:38.137Z'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.Ext.malware_signature.identifier', + values: ['diagnostic-malware-signature-v1-fake'], + originalValue: ['diagnostic-malware-signature-v1-fake'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.namespace_type', + values: ['agnostic'], + originalValue: ['agnostic'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.type', + values: ['info'], + originalValue: ['info'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.space_ids', + values: ['default'], + originalValue: ['default'], + isObjectArray: false, + }, + { + category: 'process', + field: 'process.entry_leader.entity_id', + values: ['b74mw1jkrm'], + originalValue: ['b74mw1jkrm'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.rule.exceptions_list.id', + values: ['endpoint_list'], + originalValue: ['endpoint_list'], + isObjectArray: false, + }, + { + category: 'event', + field: 'event.dataset', + values: ['endpoint'], + originalValue: ['endpoint'], + isObjectArray: false, + }, + { + category: 'kibana', + field: 'kibana.alert.original_time', + values: ['2022-10-09T07:14:42.194Z'], + originalValue: ['2022-10-09T07:14:42.194Z'], + isObjectArray: false, + }, + { + category: '_index', + field: '_index', + values: ['.internal.alerts-security.alerts-default-000001'], + originalValue: ['.internal.alerts-security.alerts-default-000001'], + isObjectArray: false, + }, + { + category: '_id', + field: '_id', + values: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + originalValue: ['f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325'], + isObjectArray: false, + }, + { + category: '_score', + field: '_score', + values: ['1'], + originalValue: ['1'], + isObjectArray: false, + }, +]; + +export const getMockAlertNestedDetailsTimelineResponse = (): Ecs => ({ + _id: 'f6aa8643ecee466753c45308ea8dc72aba0a44e1faac5f6183fd2ad6666c1325', + timestamp: '2022-09-29T19:40:26.051Z', + _index: '.internal.alerts-security.alerts-default-000001', + kibana: { + alert: { + rule: { + from: ['now-10m'], + name: ['Endpoint Security'], + to: ['now'], + uuid: ['738e91f2-402e-11ed-be15-7be3bb26d7b2'], + type: ['query'], + version: ['100'], + parameters: {}, + }, + workflow_status: ['open'], + original_time: ['2022-10-09T07:14:42.194Z'], + severity: ['medium'], + }, + }, + event: { + code: ['memory_signature'], + module: ['endpoint'], + action: ['start'], + category: ['malware'], + dataset: ['endpoint'], + id: ['7799e1d5-5dc1-4173-9d11-562496cd863b'], + kind: ['signal'], + type: ['info'], + }, + host: { + name: ['Host-4cfuh42w7g'], + os: { + family: ['windows'], + name: ['Windows'], + }, + id: ['04794e4e-59cb-4c4a-a8ee-3e6c5b65743c'], + ip: ['10.184.3.36', '10.170.218.86'], + }, + source: { + ip: ['10.184.3.46'], + }, + agent: { + type: ['endpoint'], + id: ['d08ed3f8-9852-4d0c-a5b1-b48060705369'], + }, + process: { + hash: { + md5: ['fake md5'], + sha1: ['fake sha1'], + sha256: ['fake sha256'], + }, + parent: { + pid: [1], + }, + pid: [2], + name: ['explorer.exe'], + entity_id: ['d3v4to81q9'], + executable: ['C:/fake/explorer.exe'], + entry_leader: { + entity_id: ['b74mw1jkrm'], + name: ['fake entry'], + pid: ['865'], + }, + session_leader: { + entity_id: ['b74mw1jkrm'], + name: ['fake session'], + pid: ['745'], + }, + group_leader: { + entity_id: ['b74mw1jkrm'], + name: ['fake leader'], + pid: ['116'], + }, + }, + user: { + name: ['root'], + }, +}); + +export const mockAlertDetailsFieldsResponse = getMockAlertDetailsFieldsResponse(); + +export const mockAlertDetailsTimelineResponse = getMockAlertDetailsTimelineResponse(); + +export const mockAlertNestedDetailsTimelineResponse = getMockAlertNestedDetailsTimelineResponse(); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/index.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/index.ts new file mode 100644 index 000000000000..0771ffa5ccf9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/__mocks__/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './alert_details_response'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/error_page.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/error_page.tsx new file mode 100644 index 000000000000..c050118a848d --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/error_page.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { memo } from 'react'; +import { EuiCode, EuiEmptyPrompt } from '@elastic/eui'; +import { ERROR_PAGE_TITLE, ERROR_PAGE_BODY } from '../translations'; + +export const AlertDetailsErrorPage = memo(({ eventId }: { eventId: string }) => { + return ( + {ERROR_PAGE_TITLE}} + body={ +
+

{ERROR_PAGE_BODY}

+

+ {`_id: ${eventId}`} +

+
+ } + /> + ); +}); + +AlertDetailsErrorPage.displayName = 'AlertDetailsErrorPage'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/header.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/header.tsx new file mode 100644 index 000000000000..f87162eba453 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/header.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { PreferenceFormattedDate } from '../../../../common/components/formatted_date'; +import { HeaderPage } from '../../../../common/components/header_page'; + +interface AlertDetailsHeaderProps { + loading: boolean; + ruleName?: string; + timestamp?: string; +} + +export const AlertDetailsHeader = React.memo( + ({ loading, ruleName, timestamp }: AlertDetailsHeaderProps) => { + return ( + : ''} + title={ruleName} + /> + ); + } +); + +AlertDetailsHeader.displayName = 'AlertDetailsHeader'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/loading_page.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/loading_page.tsx new file mode 100644 index 000000000000..ee24b2e63687 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/components/loading_page.tsx @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { memo } from 'react'; +import { EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui'; +import { LOADING_PAGE_MESSAGE } from '../translations'; + +export const AlertDetailsLoadingPage = memo(({ eventId }: { eventId: string }) => ( + } + body={

{LOADING_PAGE_MESSAGE}

} + /> +)); + +AlertDetailsLoadingPage.displayName = 'AlertDetailsLoadingPage'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.test.tsx new file mode 100644 index 000000000000..bee3abe3bc15 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.test.tsx @@ -0,0 +1,144 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { Router, useParams } from 'react-router-dom'; +import { render } from '@testing-library/react'; +import { AlertDetailsPage } from '.'; +import { TestProviders } from '../../../common/mock'; +import { + mockAlertDetailsFieldsResponse, + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from './__mocks__'; +import { ALERT_RULE_NAME } from '@kbn/rule-data-utils'; +import { useTimelineEventsDetails } from '../../../timelines/containers/details'; + +// Node modules mocks +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useParams: jest.fn(), +})); + +const mockDispatch = jest.fn(); +jest.mock('react-redux', () => ({ + ...jest.requireActual('react-redux'), + useDispatch: () => mockDispatch, +})); + +(useParams as jest.Mock).mockReturnValue(mockAlertDetailsFieldsResponse._id); + +// Internal Mocks +jest.mock('../../../timelines/containers/details'); +jest.mock('../../../timelines/store/timeline', () => ({ + ...jest.requireActual('../../../timelines/store/timeline'), + timelineActions: { + createTimeline: jest.fn().mockReturnValue('new-timeline'), + }, +})); + +jest.mock('../../../common/containers/sourcerer', () => { + const mockSourcererReturn = { + browserFields: {}, + loading: true, + indexPattern: {}, + selectedPatterns: [], + missingPatterns: [], + }; + return { + useSourcererDataView: jest.fn().mockReturnValue(mockSourcererReturn), + }; +}); + +type Action = 'PUSH' | 'POP' | 'REPLACE'; +const pop: Action = 'POP'; +const getMockHistory = () => ({ + length: 1, + location: { + pathname: `/alerts/${mockAlertDetailsFieldsResponse._id}/summary`, + search: '', + state: '', + hash: '', + }, + action: pop, + push: jest.fn(), + replace: jest.fn(), + go: jest.fn(), + goBack: jest.fn(), + goForward: jest.fn(), + block: jest.fn(), + createHref: jest.fn(), + listen: jest.fn(), +}); + +describe('Alert Details Page', () => { + it('should render the loading page', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([true, null, null, null, jest.fn()]); + const { getByTestId } = render( + + + + + + ); + + expect(getByTestId('alert-details-page-loading')).toBeVisible(); + }); + + it('should render the error page', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([false, null, null, null, jest.fn()]); + const { getByTestId } = render( + + + + + + ); + + expect(getByTestId('alert-details-page-error')).toBeVisible(); + }); + + it('should render the header', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([ + false, + mockAlertDetailsTimelineResponse, + mockAlertDetailsFieldsResponse, + mockAlertNestedDetailsTimelineResponse, + jest.fn(), + ]); + const { getByTestId } = render( + + + + + + ); + + expect(getByTestId('header-page-title')).toHaveTextContent( + mockAlertDetailsFieldsResponse.fields[ALERT_RULE_NAME][0] + ); + }); + + it('should create a timeline', () => { + (useTimelineEventsDetails as jest.Mock).mockReturnValue([ + false, + mockAlertDetailsTimelineResponse, + mockAlertDetailsFieldsResponse, + mockAlertNestedDetailsTimelineResponse, + jest.fn(), + ]); + render( + + + + + + ); + + expect(mockDispatch).toHaveBeenCalledWith('new-timeline'); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.tsx new file mode 100644 index 000000000000..530c00532bbb --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/index.tsx @@ -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 React, { memo, useEffect, useMemo } from 'react'; +import { Switch, useParams } from 'react-router-dom'; +import { Route } from '@kbn/kibana-react-plugin/public'; +import { ALERT_RULE_NAME, TIMESTAMP } from '@kbn/rule-data-utils'; +import { EuiSpacer } from '@elastic/eui'; +import { useDispatch } from 'react-redux'; +import { timelineActions } from '../../../timelines/store/timeline'; +import { TimelineId } from '../../../../common/types'; +import { useGetFieldsData } from '../../../common/hooks/use_get_fields_data'; +import { useSourcererDataView } from '../../../common/containers/sourcerer'; +import { SourcererScopeName } from '../../../common/store/sourcerer/model'; +import { SpyRoute } from '../../../common/utils/route/spy_routes'; +import { getAlertDetailsTabUrl } from '../../../common/components/link_to'; +import { AlertDetailRouteType } from './types'; +import { SecuritySolutionTabNavigation } from '../../../common/components/navigation'; +import { getAlertDetailsNavTabs } from './utils/navigation'; +import { SecurityPageName } from '../../../../common/constants'; +import { eventID } from '../../../../common/endpoint/models/event'; +import { useTimelineEventsDetails } from '../../../timelines/containers/details'; +import { AlertDetailsLoadingPage } from './components/loading_page'; +import { AlertDetailsErrorPage } from './components/error_page'; +import { AlertDetailsHeader } from './components/header'; +import { DetailsSummaryTab } from './tabs/summary'; + +export const AlertDetailsPage = memo(() => { + const { detailName: eventId } = useParams<{ detailName: string }>(); + const dispatch = useDispatch(); + const sourcererDataView = useSourcererDataView(SourcererScopeName.detections); + const indexName = useMemo( + () => sourcererDataView.selectedPatterns.join(','), + [sourcererDataView.selectedPatterns] + ); + + const [loading, detailsData, searchHit, dataAsNestedObject] = useTimelineEventsDetails({ + indexName, + eventId, + runtimeMappings: sourcererDataView.runtimeMappings, + skip: !eventID, + }); + const dataNotFound = !loading && !detailsData; + const hasData = !loading && detailsData; + + // Example of using useGetFieldsData. Only place it is used currently + const getFieldsData = useGetFieldsData(searchHit?.fields); + const timestamp = getFieldsData(TIMESTAMP) as string | undefined; + const ruleName = getFieldsData(ALERT_RULE_NAME) as string | undefined; + + useEffect(() => { + // TODO: move detail panel to it's own redux state + dispatch( + timelineActions.createTimeline({ + id: TimelineId.detectionsAlertDetailsPage, + columns: [], + dataViewId: null, + indexNames: [], + expandedDetail: {}, + show: false, + }) + ); + }, [dispatch]); + + return ( + <> + {loading && } + {dataNotFound && } + {hasData && ( + <> + + + + + + + + + + )} + + + ); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/alert_render_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/alert_render_panel.test.tsx new file mode 100644 index 000000000000..c3952801e5ca --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/alert_render_panel.test.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { get } from 'lodash/fp'; +import { render } from '@testing-library/react'; +import { AlertRendererPanel } from '.'; +import { TestProviders } from '../../../../../../common/mock'; +import { mockAlertNestedDetailsTimelineResponse } from '../../../__mocks__'; +import { ALERT_RENDERER_FIELDS } from '../../../../../../timelines/components/timeline/body/renderers/alert_renderer'; + +describe('AlertDetailsPage - SummaryTab - AlertRendererPanel', () => { + it('should render the reason renderer', () => { + const { getByTestId } = render( + + + + ); + + expect(getByTestId('alert-renderer-panel')).toBeVisible(); + }); + + it('should render the render the expected values', () => { + const { getByTestId } = render( + + + + ); + const alertRendererPanelPanel = getByTestId('alert-renderer-panel'); + + ALERT_RENDERER_FIELDS.forEach((rendererField) => { + const fieldValues: string[] | null = get( + rendererField, + mockAlertNestedDetailsTimelineResponse + ); + if (fieldValues && fieldValues.length > 0) { + fieldValues.forEach((value) => { + expect(alertRendererPanelPanel).toHaveTextContent(value); + }); + } + }); + }); + + it('should not render the reason renderer if data is not provided', () => { + const { queryByTestId } = render( + + + + ); + + expect(queryByTestId('alert-renderer-panel')).toBeNull(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/index.tsx new file mode 100644 index 000000000000..b5de487aa587 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/alert_renderer_panel/index.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import styled from 'styled-components'; +import { defaultRowRenderers } from '../../../../../../timelines/components/timeline/body/renderers'; +import { getRowRenderer } from '../../../../../../timelines/components/timeline/body/renderers/get_row_renderer'; +import { TimelineId } from '../../../../../../../common/types'; +import { SummaryPanel } from '../wrappers'; +import { ALERT_REASON_PANEL_TITLE } from '../translation'; +import type { Ecs } from '../../../../../../../common/ecs'; + +export interface AlertRendererPanelProps { + dataAsNestedObject: Ecs | null; +} + +const RendererContainer = styled.div` + overflow-x: auto; + + & .euiFlexGroup { + justify-content: flex-start; + } +`; + +export const AlertRendererPanel = React.memo(({ dataAsNestedObject }: AlertRendererPanelProps) => { + const renderer = useMemo( + () => + dataAsNestedObject != null + ? getRowRenderer({ data: dataAsNestedObject, rowRenderers: defaultRowRenderers }) + : null, + [dataAsNestedObject] + ); + + return ( + + {renderer != null && dataAsNestedObject != null && ( +
+ + {renderer.renderRow({ + data: dataAsNestedObject, + isDraggable: false, + scopeId: TimelineId.detectionsAlertDetailsPage, + })} + +
+ )} +
+ ); +}); + +AlertRendererPanel.displayName = 'AlertRendererPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel.test.tsx new file mode 100644 index 000000000000..51e4f084b02e --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel.test.tsx @@ -0,0 +1,164 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { CasesPanel } from '.'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import { ERROR_LOADING_CASES, LOADING_CASES } from '../translation'; +import { useGetRelatedCasesByEvent } from '../../../../../../common/containers/cases/use_get_related_cases_by_event'; +import { useGetUserCasesPermissions } from '../../../../../../common/lib/kibana'; + +jest.mock('../../../../../../common/containers/cases/use_get_related_cases_by_event'); +jest.mock('../../../../../../common/lib/kibana'); + +const defaultPanelProps = { + eventId: mockAlertNestedDetailsTimelineResponse._id, + dataAsNestedObject: mockAlertNestedDetailsTimelineResponse, + detailsData: mockAlertDetailsTimelineResponse, +}; + +describe('AlertDetailsPage - SummaryTab - CasesPanel', () => { + describe('No data', () => { + beforeEach(() => { + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: true, + }); + }); + it('should render the loading panel', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: true, + }); + const { getByText } = render( + + + + ); + expect(getByText(LOADING_CASES)).toBeVisible(); + }); + + it('should render the error panel if an error is returned', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + error: true, + }); + const { getByText } = render( + + + + ); + + expect(getByText(ERROR_LOADING_CASES)).toBeVisible(); + }); + + it('should render the error panel if data is undefined', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + error: false, + relatedCases: undefined, + }); + const { getByText } = render( + + + + ); + + expect(getByText(ERROR_LOADING_CASES)).toBeVisible(); + }); + + describe('Partial permissions', () => { + it('should only render the add to new case button', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [], + }); + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: false, + }); + const { getByTestId, queryByTestId } = render( + + + + ); + + expect(getByTestId('add-to-new-case-button')).toBeVisible(); + expect(queryByTestId('add-to-existing-case-button')).toBe(null); + }); + + it('should only render the add to existing case button', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [], + }); + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: false, + update: true, + }); + const { getByTestId, queryByTestId } = render( + + + + ); + + expect(getByTestId('add-to-existing-case-button')).toBeVisible(); + expect(queryByTestId('add-to-new-case-button')).toBe(null); + }); + + it('should render both add to new case and add to existing case buttons', () => { + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [], + }); + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: true, + }); + const { getByTestId, queryByTestId } = render( + + + + ); + + expect(getByTestId('add-to-new-case-button')).toBeVisible(); + expect(queryByTestId('add-to-existing-case-button')).toBeVisible(); + }); + }); + }); + describe('has related cases', () => { + const mockRelatedCase = { + title: 'test case', + id: 'test-case-id', + }; + + beforeEach(() => { + (useGetUserCasesPermissions as jest.Mock).mockReturnValue({ + create: true, + update: true, + }); + (useGetRelatedCasesByEvent as jest.Mock).mockReturnValue({ + loading: false, + relatedCases: [mockRelatedCase], + }); + }); + + it('should show the related case', () => { + const { getByTestId } = render( + + + + ); + + expect(getByTestId('case-panel')).toHaveTextContent(mockRelatedCase.title); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel_actions.tsx new file mode 100644 index 000000000000..4ffc16603cb0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/cases_panel_actions.tsx @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import type { CasesPermissions } from '@kbn/cases-plugin/common'; +import React, { useCallback, useMemo, useState } from 'react'; +import type { CasesPanelProps } from '.'; +import { + ADD_TO_EXISTING_CASE_BUTTON, + ADD_TO_NEW_CASE_BUTTON, + SUMMARY_PANEL_ACTIONS, +} from '../translation'; + +export const CASES_PANEL_ACTIONS_CLASS = 'cases-panel-actions-trigger'; + +export interface CasesPanelActionsProps extends CasesPanelProps { + addToNewCase: () => void; + addToExistingCase: () => void; + className?: string; + userCasesPermissions: CasesPermissions; +} + +export const CasesPanelActions = React.memo( + ({ + addToNewCase, + addToExistingCase, + className, + userCasesPermissions, + }: CasesPanelActionsProps) => { + const [isPopoverOpen, setPopover] = useState(false); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const items = useMemo(() => { + const options = []; + + if (userCasesPermissions.create) { + options.push( + + {ADD_TO_NEW_CASE_BUTTON} + + ); + } + + if (userCasesPermissions.update) { + options.push( + + {ADD_TO_EXISTING_CASE_BUTTON} + + ); + } + return options; + }, [addToExistingCase, addToNewCase, userCasesPermissions.create, userCasesPermissions.update]); + + const button = useMemo( + () => ( + + ), + [onButtonClick] + ); + + return ( +
+ + + +
+ ); + } +); + +CasesPanelActions.displayName = 'CasesPanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/index.tsx new file mode 100644 index 000000000000..e54d7a6c4d58 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/cases_panel/index.tsx @@ -0,0 +1,179 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useMemo } from 'react'; +import { + EuiButton, + EuiEmptyPrompt, + EuiFlexGroup, + EuiFlexItem, + EuiLoadingSpinner, +} from '@elastic/eui'; +import type { Ecs } from '@kbn/cases-plugin/common'; +import { CommentType } from '@kbn/cases-plugin/common'; +import type { CaseAttachmentsWithoutOwner } from '@kbn/cases-plugin/public'; +import type { TimelineEventsDetailsItem } from '../../../../../../../common/search_strategy'; +import { useGetUserCasesPermissions, useKibana } from '../../../../../../common/lib/kibana'; +import { CaseDetailsLink } from '../../../../../../common/components/links'; +import { useGetRelatedCasesByEvent } from '../../../../../../common/containers/cases/use_get_related_cases_by_event'; +import { + ADD_TO_EXISTING_CASE_BUTTON, + ADD_TO_NEW_CASE_BUTTON, + CASES_PANEL_TITLE, + CASE_NO_READ_PERMISSIONS, + ERROR_LOADING_CASES, + LOADING_CASES, + NO_RELATED_CASES_FOUND, +} from '../translation'; +import { SummaryPanel } from '../wrappers'; +import { CasesPanelActions, CASES_PANEL_ACTIONS_CLASS } from './cases_panel_actions'; + +export interface CasesPanelProps { + eventId: string; + dataAsNestedObject: Ecs | null; + detailsData: TimelineEventsDetailsItem[]; +} + +const CasesPanelLoading = () => ( + } + title={

{LOADING_CASES}

} + titleSize="xxs" + /> +); + +const CasesPanelError = () => <>{ERROR_LOADING_CASES}; + +export const CasesPanelNoReadPermissions = () => ; + +export const CasesPanel = React.memo( + ({ eventId, dataAsNestedObject, detailsData }) => { + const { cases: casesUi } = useKibana().services; + const { loading, error, relatedCases, refetchRelatedCases } = + useGetRelatedCasesByEvent(eventId); + const userCasesPermissions = useGetUserCasesPermissions(); + + const caseAttachments: CaseAttachmentsWithoutOwner = useMemo(() => { + return dataAsNestedObject + ? [ + { + alertId: eventId, + index: dataAsNestedObject._index ?? '', + type: CommentType.alert, + rule: casesUi.helpers.getRuleIdFromEvent({ + ecs: dataAsNestedObject, + data: detailsData, + }), + }, + ] + : []; + }, [casesUi.helpers, dataAsNestedObject, detailsData, eventId]); + + const createCaseFlyout = casesUi.hooks.getUseCasesAddToNewCaseFlyout({ + onSuccess: refetchRelatedCases, + }); + + const selectCaseModal = casesUi.hooks.getUseCasesAddToExistingCaseModal({ + onRowClick: refetchRelatedCases, + }); + + const addToNewCase = useCallback(() => { + if (userCasesPermissions.create) { + createCaseFlyout.open({ attachments: caseAttachments }); + } + }, [userCasesPermissions.create, createCaseFlyout, caseAttachments]); + + const addToExistingCase = useCallback(() => { + if (userCasesPermissions.update) { + selectCaseModal.open({ attachments: caseAttachments }); + } + }, [caseAttachments, selectCaseModal, userCasesPermissions.update]); + + const renderCasesActions = useCallback( + () => ( + + ), + [ + addToExistingCase, + addToNewCase, + dataAsNestedObject, + detailsData, + eventId, + userCasesPermissions, + ] + ); + + if (loading) return ; + + if (error || relatedCases === undefined) return ; + + const hasRelatedCases = relatedCases && relatedCases.length > 0; + + return ( + + {hasRelatedCases ? ( + + {relatedCases?.map(({ id, title }) => ( + + + {title} + + + ))} + + ) : ( + + {userCasesPermissions.update && ( + + + {ADD_TO_EXISTING_CASE_BUTTON} + + + )} + {userCasesPermissions.create && ( + + + {ADD_TO_NEW_CASE_BUTTON} + + + )} +
+ } + /> + )} + + ); + } +); + +CasesPanel.displayName = 'CasesPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/get_mitre_threat_component.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/get_mitre_threat_component.ts new file mode 100644 index 000000000000..32a6e1b32df1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/get_mitre_threat_component.ts @@ -0,0 +1,123 @@ +/* + * Copyright 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 { + Threat, + Threats, + ThreatSubtechnique, +} from '@kbn/securitysolution-io-ts-alerting-types'; +import { find } from 'lodash/fp'; +import { + ALERT_THREAT_FRAMEWORK, + ALERT_THREAT_TACTIC_ID, + ALERT_THREAT_TACTIC_NAME, + ALERT_THREAT_TACTIC_REFERENCE, + ALERT_THREAT_TECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_REFERENCE, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, + ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, + KIBANA_NAMESPACE, +} from '@kbn/rule-data-utils'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import { buildThreatDescription } from '../../../../components/rules/description_step/helpers'; + +// TODO - it may make more sense to query source here for this information rather than piecing it together from the fields api +export const getMitreTitleAndDescription = (data: TimelineEventsDetailsItem[] | null) => { + const threatFrameworks = [ + ...(find({ field: ALERT_THREAT_FRAMEWORK, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + + const tacticIdValues = [ + ...(find({ field: ALERT_THREAT_TACTIC_ID, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + const tacticNameValues = [ + ...(find({ field: ALERT_THREAT_TACTIC_NAME, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + const tacticReferenceValues = [ + ...(find({ field: ALERT_THREAT_TACTIC_REFERENCE, category: KIBANA_NAMESPACE }, data)?.values ?? + []), + ]; + + const techniqueIdValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_ID, category: KIBANA_NAMESPACE }, data)?.values ?? []), + ]; + const techniqueNameValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_NAME, category: KIBANA_NAMESPACE }, data)?.values ?? + []), + ]; + const techniqueReferenceValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_REFERENCE, category: KIBANA_NAMESPACE }, data) + ?.values ?? []), + ]; + + const subTechniqueIdValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID, category: KIBANA_NAMESPACE }, data) + ?.values ?? []), + ]; + const subTechniqueNameValues = [ + ...(find({ field: ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME, category: KIBANA_NAMESPACE }, data) + ?.values ?? []), + ]; + const subTechniqueReferenceValues = [ + ...(find( + { field: ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE, category: KIBANA_NAMESPACE }, + data + )?.values ?? []), + ]; + + const threatData: Threats = + // Use the top level framework as every threat should have a framework + threatFrameworks?.map((framework, index) => { + const threat: Threat = { + framework, + tactic: { + id: tacticIdValues[index], + name: tacticNameValues[index], + reference: tacticReferenceValues[index], + }, + technique: [], + }; + + // TODO: + // Fields api doesn't provide null entries to keep the same length of values for flattend objects + // So for the time being rather than showing incorrect data, we'll only show tactic information when the length of both line up + // We can replace this with a _source request and just pass that. + if (tacticIdValues.length === techniqueIdValues.length) { + const subtechnique: ThreatSubtechnique[] = []; + const techniqueId = techniqueIdValues[index]; + subTechniqueIdValues.forEach((subId, subIndex) => { + // TODO: see above comment. Without this matching, a subtechnique can be incorrectly matched with a higher level technique + if (subId.includes(techniqueId)) { + subtechnique.push({ + id: subTechniqueIdValues[subIndex], + name: subTechniqueNameValues[subIndex], + reference: subTechniqueReferenceValues[subIndex], + }); + } + }); + + threat.technique?.push({ + id: techniqueId, + name: techniqueNameValues[index], + reference: techniqueReferenceValues[index], + subtechnique, + }); + } + + return threat; + }) ?? []; + + // TODO: discuss moving buildThreatDescription to a shared common folder + return threatData && threatData.length > 0 + ? buildThreatDescription({ + label: threatData[0].framework, + threat: threatData, + }) + : null; +}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel.test.tsx new file mode 100644 index 000000000000..407a604bc9e4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel.test.tsx @@ -0,0 +1,133 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { find } from 'lodash/fp'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import type { HostPanelProps } from '.'; +import { HostPanel } from '.'; +import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { RiskSeverity } from '../../../../../../../common/search_strategy'; +import { useRiskScore } from '../../../../../../risk_score/containers'; + +jest.mock('../../../../../../risk_score/containers'); +const mockUseRiskScore = useRiskScore as jest.Mock; + +jest.mock('../../../../../containers/detection_engine/alerts/use_host_isolation_status', () => { + return { + useHostIsolationStatus: jest.fn().mockReturnValue({ + loading: false, + isIsolated: false, + agentStatus: 'healthy', + }), + }; +}); + +describe('AlertDetailsPage - SummaryTab - HostPanel', () => { + const defaultRiskReturnValues = { + inspect: null, + refetch: () => {}, + isModuleEnabled: true, + isLicenseValid: true, + loading: false, + }; + const HostPanelWithDefaultProps = (propOverrides: Partial) => ( + + + + ); + + beforeEach(() => { + mockUseRiskScore.mockReturnValue({ ...defaultRiskReturnValues }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('should render basic host fields', () => { + const { getByTestId } = render(); + const simpleHostFields = ['host.name', 'host.os.name']; + + simpleHostFields.forEach((simpleHostField) => { + expect(getByTestId('host-panel')).toHaveTextContent( + getTimelineEventData(simpleHostField, mockAlertDetailsTimelineResponse) + ); + }); + }); + + describe('Agent status', () => { + it('should show healthy', () => { + const { getByTestId } = render(); + expect(getByTestId('host-panel-agent-status')).toHaveTextContent('Healthy'); + }); + }); + + describe('host risk', () => { + it('should not show risk if the license is not valid', () => { + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: false, + data: null, + }); + const { queryByTestId } = render(); + expect(queryByTestId('host-panel-risk')).toBe(null); + }); + + it('should render risk fields', () => { + const calculatedScoreNorm = 98.9; + const calculatedLevel = RiskSeverity.critical; + + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: true, + data: [ + { + host: { + name: mockAlertNestedDetailsTimelineResponse.host?.name, + risk: { + calculated_score_norm: calculatedScoreNorm, + calculated_level: calculatedLevel, + }, + }, + }, + ], + }); + const { getByTestId } = render(); + + expect(getByTestId('host-panel-risk')).toHaveTextContent( + `${Math.round(calculatedScoreNorm)}` + ); + expect(getByTestId('host-panel-risk')).toHaveTextContent(calculatedLevel); + }); + }); + + describe('host ip', () => { + it('should render all the ip fields', () => { + const { getByTestId } = render(); + const ipFields = find( + { field: 'host.ip', category: 'host' }, + mockAlertDetailsTimelineResponse + )?.values as string[]; + expect(getByTestId('host-panel-ip')).toHaveTextContent(ipFields[0]); + expect(getByTestId('host-panel-ip')).toHaveTextContent('+1 More'); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel_actions.tsx new file mode 100644 index 000000000000..d078785bf93f --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/host_panel_actions.tsx @@ -0,0 +1,99 @@ +/* + * Copyright 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 { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import { SecurityPageName } from '../../../../../../app/types'; +import { useGetSecuritySolutionLinkProps } from '../../../../../../common/components/links'; +import { getHostDetailsUrl } from '../../../../../../common/components/link_to'; + +import { OPEN_HOST_DETAILS_PAGE, SUMMARY_PANEL_ACTIONS, VIEW_HOST_SUMMARY } from '../translation'; + +export const HOST_PANEL_ACTIONS_CLASS = 'host-panel-actions-trigger'; + +export const HostPanelActions = React.memo( + ({ + className, + openHostDetailsPanel, + hostName, + }: { + className?: string; + hostName: string; + openHostDetailsPanel: (hostName: string) => void; + }) => { + const [isPopoverOpen, setPopover] = useState(false); + const { href } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.hosts, + path: getHostDetailsUrl(hostName), + }); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const handleOpenHostDetailsPanel = useCallback(() => { + openHostDetailsPanel(hostName); + closePopover(); + }, [hostName, openHostDetailsPanel]); + + const items = useMemo( + () => [ + + {VIEW_HOST_SUMMARY} + , + + {OPEN_HOST_DETAILS_PAGE} + , + ], + [handleOpenHostDetailsPanel, href] + ); + + const button = useMemo( + () => ( + + ), + [onButtonClick] + ); + + return ( +
+ + + +
+ ); + } +); + +HostPanelActions.displayName = 'HostPanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/index.tsx new file mode 100644 index 000000000000..f1df3cf0f97d --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/host_panel/index.tsx @@ -0,0 +1,195 @@ +/* + * Copyright 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 { EuiTitle, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import React, { useCallback, useMemo } from 'react'; +import { find } from 'lodash/fp'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { TimelineId } from '../../../../../../../common/types'; +import { isAlertFromEndpointEvent } from '../../../../../../common/utils/endpoint_alert_check'; +import { SummaryValueCell } from '../../../../../../common/components/event_details/table/summary_value_cell'; +import { useRiskScore } from '../../../../../../risk_score/containers'; +import { RiskScoreEntity } from '../../../../../../../common/search_strategy'; +import { getEmptyTagValue } from '../../../../../../common/components/empty_value'; +import { RiskScore } from '../../../../../../common/components/severity/common'; +import { + FirstLastSeen, + FirstLastSeenType, +} from '../../../../../../common/components/first_last_seen'; +import { DefaultFieldRenderer } from '../../../../../../timelines/components/field_renderers/field_renderers'; +import { HostDetailsLink, NetworkDetailsLink } from '../../../../../../common/components/links'; +import type { SelectedDataView } from '../../../../../../common/store/sourcerer/model'; +import { getEnrichedFieldInfo } from '../../../../../../common/components/event_details/helpers'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { + AGENT_STATUS_TITLE, + HOST_NAME_TITLE, + HOST_PANEL_TITLE, + HOST_RISK_CLASSIFICATION, + HOST_RISK_SCORE, + IP_ADDRESSES_TITLE, + LAST_SEEN_TITLE, + OPERATING_SYSTEM_TITLE, +} from '../translation'; +import { SummaryPanel } from '../wrappers'; +import { HostPanelActions, HOST_PANEL_ACTIONS_CLASS } from './host_panel_actions'; + +export interface HostPanelProps { + data: TimelineEventsDetailsItem[]; + id: string; + openHostDetailsPanel: (hostName: string, onClose?: (() => void) | undefined) => void; + selectedPatterns: SelectedDataView['selectedPatterns']; + browserFields: SelectedDataView['browserFields']; +} + +const HostPanelSection: React.FC<{ + title?: string | React.ReactElement; + grow?: FlexItemGrowSize; +}> = ({ grow, title, children }) => + children ? ( + + {title && ( + <> + +
{title}
+
+ + + )} + {children} +
+ ) : null; + +export const HostPanel = React.memo( + ({ data, id, browserFields, openHostDetailsPanel, selectedPatterns }: HostPanelProps) => { + const hostName = getTimelineEventData('host.name', data); + const hostOs = getTimelineEventData('host.os.name', data); + + const enrichedAgentStatus = useMemo(() => { + const item = find({ field: 'agent.id', category: 'agent' }, data); + if (!data || !isAlertFromEndpointEvent({ data })) return null; + return ( + item && + getEnrichedFieldInfo({ + eventId: id, + contextId: TimelineId.detectionsAlertDetailsPage, + scopeId: TimelineId.detectionsAlertDetailsPage, + browserFields, + item, + field: { id: 'agent.id', overrideField: 'agent.status' }, + linkValueField: undefined, + }) + ); + }, [browserFields, data, id]); + + const { data: hostRisk, isLicenseValid: isRiskLicenseValid } = useRiskScore({ + riskEntity: RiskScoreEntity.host, + skip: hostName == null, + }); + + const [hostRiskScore, hostRiskLevel] = useMemo(() => { + const hostRiskData = hostRisk && hostRisk.length > 0 ? hostRisk[0] : undefined; + const hostRiskValue = hostRiskData + ? Math.round(hostRiskData.host.risk.calculated_score_norm) + : getEmptyTagValue(); + const hostRiskSeverity = hostRiskData ? ( + + ) : ( + getEmptyTagValue() + ); + + return [hostRiskValue, hostRiskSeverity]; + }, [hostRisk]); + + const hostIpFields = useMemo( + () => find({ field: 'host.ip', category: 'host' }, data)?.values ?? [], + [data] + ); + + const renderHostIp = useCallback( + (ip: string) => (ip != null ? : getEmptyTagValue()), + [] + ); + + const renderHostActions = useCallback( + () => , + [hostName, openHostDetailsPanel] + ); + + return ( + + + + + + + + + + + + + + {hostOs} + {enrichedAgentStatus && ( + + + + )} + + + {isRiskLicenseValid && ( + <> + + {hostRiskScore && ( + {hostRiskScore} + )} + {hostRiskLevel && ( + + {hostRiskLevel} + + )} + + + + )} + + + + + + + + + + + + + + + + ); + } +); + +HostPanel.displayName = 'HostPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/index.tsx new file mode 100644 index 000000000000..1b63b778453a --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/index.tsx @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup } from '@elastic/eui'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import { TimelineId } from '../../../../../../common/types'; +import { useDetailPanel } from '../../../../../timelines/components/side_panel/hooks/use_detail_panel'; +import { useGetUserCasesPermissions } from '../../../../../common/lib/kibana'; +import type { SelectedDataView } from '../../../../../common/store/sourcerer/model'; +import { SourcererScopeName } from '../../../../../common/store/sourcerer/model'; +import type { Ecs } from '../../../../../../common/ecs'; +import { AlertRendererPanel } from './alert_renderer_panel'; +import { RulePanel } from './rule_panel'; +import { CasesPanel, CasesPanelNoReadPermissions } from './cases_panel'; +import { HostPanel } from './host_panel'; +import { UserPanel } from './user_panel'; +import { SummaryColumn, SummaryRow } from './wrappers'; + +export interface DetailsSummaryTabProps { + eventId: string; + dataAsNestedObject: Ecs | null; + detailsData: TimelineEventsDetailsItem[]; + sourcererDataView: SelectedDataView; +} + +export const DetailsSummaryTab = React.memo( + ({ dataAsNestedObject, detailsData, eventId, sourcererDataView }: DetailsSummaryTabProps) => { + const userCasesPermissions = useGetUserCasesPermissions(); + + const { DetailsPanel, openHostDetailsPanel, openUserDetailsPanel } = useDetailPanel({ + isFlyoutView: true, + sourcererScope: SourcererScopeName.detections, + scopeId: TimelineId.detectionsAlertDetailsPage, + }); + + return ( + <> + + + + + + + + + + + {userCasesPermissions.read ? ( + + ) : ( + + )} + + + {DetailsPanel} + + ); + } +); + +DetailsSummaryTab.displayName = 'DetailsSummaryTab'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/index.tsx new file mode 100644 index 000000000000..362939b89b41 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/index.tsx @@ -0,0 +1,156 @@ +/* + * Copyright 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 { EuiTitle, EuiSpacer, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import type { Severity } from '@kbn/securitysolution-io-ts-alerting-types'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import React, { useCallback, useMemo } from 'react'; +import { css } from '@emotion/react'; +import { find } from 'lodash/fp'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { + ALERT_RISK_SCORE, + ALERT_RULE_DESCRIPTION, + ALERT_RULE_NAME, + ALERT_RULE_UUID, + ALERT_SEVERITY, + KIBANA_NAMESPACE, +} from '@kbn/rule-data-utils'; +import { TimelineId } from '../../../../../../../common/types'; +import { SeverityBadge } from '../../../../../components/rules/severity_badge'; +import { getEnrichedFieldInfo } from '../../../../../../common/components/event_details/helpers'; +import type { SelectedDataView } from '../../../../../../common/store/sourcerer/model'; +import { FormattedFieldValue } from '../../../../../../timelines/components/timeline/body/renderers/formatted_field'; +import { + RISK_SCORE_TITLE, + RULE_DESCRIPTION_TITLE, + RULE_NAME_TITLE, + RULE_PANEL_TITLE, + SEVERITY_TITLE, +} from '../translation'; +import { getMitreTitleAndDescription } from '../get_mitre_threat_component'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { SummaryPanel } from '../wrappers'; +import { RulePanelActions, RULE_PANEL_ACTIONS_CLASS } from './rule_panel_actions'; + +export interface RulePanelProps { + data: TimelineEventsDetailsItem[]; + id: string; + browserFields: SelectedDataView['browserFields']; +} + +const threatTacticContainerStyles = css` + flex-wrap: nowrap; + & .euiFlexGroup { + flex-wrap: nowrap; + } +`; + +interface RuleSectionProps { + ['data-test-subj']?: string; + title: string; + grow?: FlexItemGrowSize; +} +const RuleSection: React.FC = ({ + grow, + title, + children, + 'data-test-subj': dataTestSubj, +}) => ( + + +
{title}
+
+ + {children} +
+); + +export const RulePanel = React.memo(({ data, id, browserFields }: RulePanelProps) => { + const ruleUuid = useMemo(() => getTimelineEventData(ALERT_RULE_UUID, data), [data]); + const threatDetails = useMemo(() => getMitreTitleAndDescription(data), [data]); + const alertRiskScore = useMemo(() => getTimelineEventData(ALERT_RISK_SCORE, data), [data]); + const alertSeverity = useMemo( + () => getTimelineEventData(ALERT_SEVERITY, data) as Severity, + [data] + ); + const alertRuleDescription = useMemo( + () => getTimelineEventData(ALERT_RULE_DESCRIPTION, data), + [data] + ); + const shouldShowThreatDetails = !!threatDetails && threatDetails?.length > 0; + + const renderRuleActions = useCallback(() => , [ruleUuid]); + const ruleNameData = useMemo(() => { + const item = find({ field: ALERT_RULE_NAME, category: KIBANA_NAMESPACE }, data); + const linkValueField = find({ field: ALERT_RULE_UUID, category: KIBANA_NAMESPACE }, data); + return ( + item && + getEnrichedFieldInfo({ + eventId: id, + contextId: TimelineId.detectionsAlertDetailsPage, + scopeId: TimelineId.detectionsAlertDetailsPage, + browserFields, + item, + linkValueField, + }) + ); + }, [browserFields, data, id]); + + return ( + + + + + + + + {alertRiskScore} + + + + + + + + {alertRuleDescription} + + + + + {shouldShowThreatDetails && ( + + {threatDetails[0].description} + + )} + + + + + + ); +}); + +RulePanel.displayName = 'RulePanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel.test.tsx new file mode 100644 index 000000000000..a41659fd2bcf --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel.test.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { ALERT_RISK_SCORE, ALERT_RULE_DESCRIPTION, ALERT_RULE_NAME } from '@kbn/rule-data-utils'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import type { RulePanelProps } from '.'; +import { RulePanel } from '.'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { mockBrowserFields } from '../../../../../../common/containers/source/mock'; + +describe('AlertDetailsPage - SummaryTab - RulePanel', () => { + const RulePanelWithDefaultProps = (propOverrides: Partial) => ( + + + + ); + it('should render basic rule fields', () => { + const { getByTestId } = render(); + const simpleRuleFields = [ALERT_RISK_SCORE, ALERT_RULE_DESCRIPTION]; + + simpleRuleFields.forEach((simpleRuleField) => { + expect(getByTestId('rule-panel')).toHaveTextContent( + getTimelineEventData(simpleRuleField, mockAlertDetailsTimelineResponse) + ); + }); + }); + + it('should render the expected severity', () => { + const { getByTestId } = render(); + expect(getByTestId('rule-panel-severity')).toHaveTextContent('Medium'); + }); + + describe('Rule name link', () => { + it('should render the rule name as a link button', () => { + const { getByTestId } = render(); + const ruleName = getTimelineEventData(ALERT_RULE_NAME, mockAlertDetailsTimelineResponse); + expect(getByTestId('ruleName')).toHaveTextContent(ruleName); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel_actions.tsx new file mode 100644 index 000000000000..a2eec20864a2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/rule_panel/rule_panel_actions.tsx @@ -0,0 +1,78 @@ +/* + * Copyright 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 { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import { getRuleDetailsUrl } from '../../../../../../common/components/link_to'; +import { SecurityPageName } from '../../../../../../app/types'; +import { useGetSecuritySolutionLinkProps } from '../../../../../../common/components/links'; + +import { SUMMARY_PANEL_ACTIONS, OPEN_RULE_DETAILS_PAGE } from '../translation'; + +export const RULE_PANEL_ACTIONS_CLASS = 'rule-panel-actions-trigger'; + +export const RulePanelActions = React.memo( + ({ className, ruleUuid }: { className?: string; ruleUuid: string }) => { + const [isPopoverOpen, setPopover] = useState(false); + const { href } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.rules, + path: getRuleDetailsUrl(ruleUuid), + }); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const items = useMemo( + () => [ + + {OPEN_RULE_DETAILS_PAGE} + , + ], + [href] + ); + + const button = useMemo( + () => ( + + ), + [onButtonClick] + ); + + return ( +
+ + + +
+ ); + } +); + +RulePanelActions.displayName = 'RulePanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/translation.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/translation.ts new file mode 100644 index 000000000000..a0b4246b7c27 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/translation.ts @@ -0,0 +1,226 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const CASES_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.cases.title', + { + defaultMessage: 'Cases', + } +); + +export const ALERT_REASON_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.alertReason.title', + { + defaultMessage: 'Alert reason', + } +); + +export const RULE_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.title', + { + defaultMessage: 'Rule', + } +); + +export const HOST_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.title', + { + defaultMessage: 'Host', + } +); + +export const USER_PANEL_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.title', + { + defaultMessage: 'User', + } +); + +export const RULE_NAME_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.name', + { + defaultMessage: 'Rule name', + } +); + +export const RISK_SCORE_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.riskScore', + { + defaultMessage: 'Risk score', + } +); + +export const SEVERITY_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.severity', + { + defaultMessage: 'Severity', + } +); + +export const RULE_DESCRIPTION_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.description', + { + defaultMessage: 'Rule description', + } +); + +export const OPEN_RULE_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.rule.action.openRuleDetailsPage', + { + defaultMessage: 'Open rule details page', + } +); + +export const NO_RELATED_CASES_FOUND = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.noCasesFound', + { + defaultMessage: 'Related cases were not found for this alert', + } +); + +export const LOADING_CASES = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.loading', + { + defaultMessage: 'Loading related cases...', + } +); + +export const ERROR_LOADING_CASES = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.error', + { + defaultMessage: 'Error loading related cases', + } +); + +export const CASE_NO_READ_PERMISSIONS = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.noRead', + { + defaultMessage: + 'You do not have the required permissions to view related cases. If you need to view cases, contact your Kibana administrator', + } +); + +export const ADD_TO_EXISTING_CASE_BUTTON = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.addToExistingCase', + { + defaultMessage: 'Add to existing case', + } +); + +export const ADD_TO_NEW_CASE_BUTTON = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.case.addToNewCase', + { + defaultMessage: 'Add to new case', + } +); + +export const HOST_NAME_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.hostName.title', + { + defaultMessage: 'Host name', + } +); + +export const OPERATING_SYSTEM_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.osName.title', + { + defaultMessage: 'Operating system', + } +); + +export const AGENT_STATUS_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.agentStatus.title', + { + defaultMessage: 'Agent status', + } +); + +export const IP_ADDRESSES_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.ipAddresses.title', + { + defaultMessage: 'IP addresses', + } +); + +export const LAST_SEEN_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.lastSeen.title', + { + defaultMessage: 'Last seen', + } +); + +export const VIEW_HOST_SUMMARY = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.action.viewHostSummary', + { + defaultMessage: 'View host summary', + } +); + +export const OPEN_HOST_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.action.openHostDetailsPage', + { + defaultMessage: 'Open host details page', + } +); + +export const HOST_RISK_SCORE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.riskScore', + { + defaultMessage: 'Host risk score', + } +); + +export const HOST_RISK_CLASSIFICATION = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.host.riskClassification', + { + defaultMessage: 'Host risk classification', + } +); + +export const USER_NAME_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.userName.title', + { + defaultMessage: 'User name', + } +); + +export const USER_RISK_SCORE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.riskScore', + { + defaultMessage: 'User risk score', + } +); + +export const USER_RISK_CLASSIFICATION = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.riskClassification', + { + defaultMessage: 'User risk classification', + } +); + +export const VIEW_USER_SUMMARY = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.action.viewUserSummary', + { + defaultMessage: 'View user summary', + } +); + +export const OPEN_USER_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.user.action.openUserDetailsPage', + { + defaultMessage: 'Open user details page', + } +); + +export const SUMMARY_PANEL_ACTIONS = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.summary.panelMoreActions', + { + defaultMessage: 'More actions', + } +); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/index.tsx new file mode 100644 index 000000000000..ab5862346793 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/index.tsx @@ -0,0 +1,160 @@ +/* + * Copyright 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 { EuiTitle, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import React, { useCallback, useMemo } from 'react'; +import { find } from 'lodash/fp'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { useRiskScore } from '../../../../../../risk_score/containers'; +import { RiskScoreEntity } from '../../../../../../../common/search_strategy'; +import { getEmptyTagValue } from '../../../../../../common/components/empty_value'; +import { RiskScore } from '../../../../../../common/components/severity/common'; +import { + FirstLastSeen, + FirstLastSeenType, +} from '../../../../../../common/components/first_last_seen'; +import { DefaultFieldRenderer } from '../../../../../../timelines/components/field_renderers/field_renderers'; +import { NetworkDetailsLink, UserDetailsLink } from '../../../../../../common/components/links'; +import type { SelectedDataView } from '../../../../../../common/store/sourcerer/model'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { + IP_ADDRESSES_TITLE, + LAST_SEEN_TITLE, + USER_NAME_TITLE, + USER_PANEL_TITLE, + USER_RISK_CLASSIFICATION, + USER_RISK_SCORE, +} from '../translation'; +import { SummaryPanel } from '../wrappers'; +import { UserPanelActions, USER_PANEL_ACTIONS_CLASS } from './user_panel_actions'; + +export interface UserPanelProps { + data: TimelineEventsDetailsItem[] | null; + selectedPatterns: SelectedDataView['selectedPatterns']; + openUserDetailsPanel: (userName: string, onClose?: (() => void) | undefined) => void; +} + +const UserPanelSection: React.FC<{ + title?: string | React.ReactElement; + grow?: FlexItemGrowSize; +}> = ({ grow, title, children }) => + children ? ( + + {title && ( + <> + +
{title}
+
+ + + )} + {children} +
+ ) : null; + +export const UserPanel = React.memo( + ({ data, selectedPatterns, openUserDetailsPanel }: UserPanelProps) => { + const userName = useMemo(() => getTimelineEventData('user.name', data), [data]); + + const { data: userRisk, isLicenseValid: isRiskLicenseValid } = useRiskScore({ + riskEntity: RiskScoreEntity.user, + skip: userName == null, + }); + + const renderUserActions = useCallback( + () => , + [openUserDetailsPanel, userName] + ); + + const [userRiskScore, userRiskLevel] = useMemo(() => { + const userRiskData = userRisk && userRisk.length > 0 ? userRisk[0] : undefined; + const userRiskValue = userRiskData + ? Math.round(userRiskData.user.risk.calculated_score_norm) + : getEmptyTagValue(); + const userRiskSeverity = userRiskData ? ( + + ) : ( + getEmptyTagValue() + ); + + return [userRiskValue, userRiskSeverity]; + }, [userRisk]); + + const sourceIpFields = useMemo( + () => find({ field: 'source.ip', category: 'source' }, data)?.values ?? [], + [data] + ); + + const renderSourceIp = useCallback( + (ip: string) => (ip != null ? : getEmptyTagValue()), + [] + ); + + return ( + + + + + + + + + {userName ? : getEmptyTagValue()} + + + + {isRiskLicenseValid && ( + <> + + {userRiskScore && ( + {userRiskScore} + )} + {userRiskLevel && ( + + {userRiskLevel} + + )} + + + + )} + + + + + + + + + + + + + + + + ); + } +); + +UserPanel.displayName = 'UserPanel'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel.test.tsx new file mode 100644 index 000000000000..aa9325399333 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel.test.tsx @@ -0,0 +1,112 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { TestProviders } from '../../../../../../common/mock'; +import { + mockAlertDetailsTimelineResponse, + mockAlertNestedDetailsTimelineResponse, +} from '../../../__mocks__'; +import type { UserPanelProps } from '.'; +import { UserPanel } from '.'; +import { getTimelineEventData } from '../../../utils/get_timeline_event_data'; +import { RiskSeverity } from '../../../../../../../common/search_strategy'; +import { useRiskScore } from '../../../../../../risk_score/containers'; +import { find } from 'lodash/fp'; + +jest.mock('../../../../../../risk_score/containers'); +const mockUseRiskScore = useRiskScore as jest.Mock; + +describe('AlertDetailsPage - SummaryTab - UserPanel', () => { + const defaultRiskReturnValues = { + inspect: null, + refetch: () => {}, + isModuleEnabled: true, + isLicenseValid: true, + loading: false, + }; + const UserPanelWithDefaultProps = (propOverrides: Partial) => ( + + + + ); + + beforeEach(() => { + mockUseRiskScore.mockReturnValue({ ...defaultRiskReturnValues }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('should render basic user fields', () => { + const { getByTestId } = render(); + const simpleUserFields = ['user.name']; + + simpleUserFields.forEach((simpleUserField) => { + expect(getByTestId('user-panel')).toHaveTextContent( + getTimelineEventData(simpleUserField, mockAlertDetailsTimelineResponse) + ); + }); + }); + + describe('user risk', () => { + it('should not show risk if the license is not valid', () => { + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: false, + data: null, + }); + const { queryByTestId } = render(); + expect(queryByTestId('user-panel-risk')).toBe(null); + }); + + it('should render risk fields', () => { + const calculatedScoreNorm = 98.9; + const calculatedLevel = RiskSeverity.critical; + + mockUseRiskScore.mockReturnValue({ + ...defaultRiskReturnValues, + isLicenseValid: true, + data: [ + { + user: { + name: mockAlertNestedDetailsTimelineResponse.user?.name, + risk: { + calculated_score_norm: calculatedScoreNorm, + calculated_level: calculatedLevel, + }, + }, + }, + ], + }); + const { getByTestId } = render(); + + expect(getByTestId('user-panel-risk')).toHaveTextContent( + `${Math.round(calculatedScoreNorm)}` + ); + expect(getByTestId('user-panel-risk')).toHaveTextContent(calculatedLevel); + }); + }); + + describe('source ip', () => { + it('should render all the ip fields', () => { + const { getByTestId } = render(); + const ipFields = find( + { field: 'source.ip', category: 'source' }, + mockAlertDetailsTimelineResponse + )?.values as string[]; + expect(getByTestId('user-panel-ip')).toHaveTextContent(ipFields[0]); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel_actions.tsx new file mode 100644 index 000000000000..575673a494a2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/user_panel/user_panel_actions.tsx @@ -0,0 +1,99 @@ +/* + * Copyright 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 { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import { getUsersDetailsUrl } from '../../../../../../common/components/link_to/redirect_to_users'; +import { SecurityPageName } from '../../../../../../app/types'; +import { useGetSecuritySolutionLinkProps } from '../../../../../../common/components/links'; + +import { OPEN_USER_DETAILS_PAGE, SUMMARY_PANEL_ACTIONS, VIEW_USER_SUMMARY } from '../translation'; + +export const USER_PANEL_ACTIONS_CLASS = 'user-panel-actions-trigger'; + +export const UserPanelActions = React.memo( + ({ + className, + openUserDetailsPanel, + userName, + }: { + className?: string; + userName: string; + openUserDetailsPanel: (userName: string) => void; + }) => { + const [isPopoverOpen, setPopover] = useState(false); + const { href } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.users, + path: getUsersDetailsUrl(userName), + }); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = () => { + setPopover(false); + }; + + const handleopenUserDetailsPanel = useCallback(() => { + openUserDetailsPanel(userName); + closePopover(); + }, [userName, openUserDetailsPanel]); + + const items = useMemo( + () => [ + + {VIEW_USER_SUMMARY} + , + + {OPEN_USER_DETAILS_PAGE} + , + ], + [handleopenUserDetailsPanel, href] + ); + + const button = useMemo( + () => ( + + ), + [onButtonClick] + ); + + return ( +
+ + + +
+ ); + } +); + +UserPanelActions.displayName = 'UserPanelActions'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/wrappers.tsx b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/wrappers.tsx new file mode 100644 index 000000000000..af3b33d9b0be --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/tabs/summary/wrappers.tsx @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { css } from '@emotion/react'; +import type { FlexItemGrowSize } from '@elastic/eui/src/components/flex/flex_item'; +import { HoverVisibilityContainer } from '../../../../../common/components/hover_visibility_container'; + +export const SummaryColumn: React.FC<{ grow?: FlexItemGrowSize }> = ({ children, grow }) => ( + + + {children} + + +); + +export const SummaryRow: React.FC<{ grow?: FlexItemGrowSize }> = ({ children, grow }) => ( + + + {children} + + +); + +export const SummaryPanel: React.FC<{ + grow?: FlexItemGrowSize; + title: string; + actionsClassName?: string; + renderActionsPopover?: () => JSX.Element; +}> = ({ actionsClassName, children, grow = false, renderActionsPopover, title }) => ( + + + + + + +

{title}

+
+
+ {actionsClassName && renderActionsPopover ? ( + {renderActionsPopover()} + ) : null} +
+
+ + {children} +
+
+); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/translations.ts new file mode 100644 index 000000000000..cc95a183cb5a --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/translations.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const SUMMARY_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.navigation.summary', + { + defaultMessage: 'Summary', + } +); + +export const BACK_TO_ALERTS_LINK = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.header.backToAlerts', + { + defaultMessage: 'Back to alerts', + } +); + +export const LOADING_PAGE_MESSAGE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.loadingPage.message', + { + defaultMessage: 'Loading details page...', + } +); + +export const ERROR_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.errorPage.title', + { + defaultMessage: 'Unable to load the details page', + } +); + +export const ERROR_PAGE_BODY = i18n.translate( + 'xpack.securitySolution.alerts.alertDetails.errorPage.message', + { + defaultMessage: + 'There was an error loading the details page. Please confirm the following id points to a valid document', + } +); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/types.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/types.ts new file mode 100644 index 000000000000..3b4138a9d3d7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/types.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { NavTab } from '../../../common/components/navigation/types'; + +export enum AlertDetailRouteType { + summary = 'summary', +} + +export type AlertDetailNavTabs = Record<`${AlertDetailRouteType}`, NavTab>; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/breadcrumbs.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/breadcrumbs.ts new file mode 100644 index 000000000000..632c40816476 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/breadcrumbs.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ChromeBreadcrumb } from '@kbn/core/public'; +import type { GetSecuritySolutionUrl } from '../../../../common/components/link_to'; +import { getAlertDetailsUrl } from '../../../../common/components/link_to'; +import { SecurityPageName } from '../../../../../common/constants'; +import type { AlertDetailRouteSpyState } from '../../../../common/utils/route/types'; +import { AlertDetailRouteType } from '../types'; +import * as i18n from '../translations'; + +const TabNameMappedToI18nKey: Record = { + [AlertDetailRouteType.summary]: i18n.SUMMARY_PAGE_TITLE, +}; + +export const getTrailingBreadcrumbs = ( + params: AlertDetailRouteSpyState, + getSecuritySolutionUrl: GetSecuritySolutionUrl +): ChromeBreadcrumb[] => { + let breadcrumb: ChromeBreadcrumb[] = []; + + if (params.detailName != null) { + breadcrumb = [ + ...breadcrumb, + { + text: params.state?.ruleName ?? params.detailName, + href: getSecuritySolutionUrl({ + path: getAlertDetailsUrl(params.detailName, ''), + deepLinkId: SecurityPageName.alerts, + }), + }, + ]; + } + if (params.tabName != null) { + breadcrumb = [ + ...breadcrumb, + { + text: TabNameMappedToI18nKey[params.tabName], + href: '', + }, + ]; + } + return breadcrumb; +}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/get_timeline_event_data.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/get_timeline_event_data.ts new file mode 100644 index 000000000000..7d5dbc544008 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/get_timeline_event_data.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { TimelineEventsDetailsItem } from '../../../../../common/search_strategy'; + +export const getTimelineEventData = (field: string, data: TimelineEventsDetailsItem[] | null) => { + const valueArray = data?.find((datum) => datum.field === field)?.values; + return valueArray && valueArray.length > 0 ? valueArray[0] : ''; +}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/navigation.ts b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/navigation.ts new file mode 100644 index 000000000000..540cd99ad9bd --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/pages/alert_details/utils/navigation.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { AlertDetailNavTabs } from '../types'; +import { ALERTS_PATH } from '../../../../../common/constants'; +import { AlertDetailRouteType } from '../types'; +import * as i18n from '../translations'; + +export const getAlertDetailsTabUrl = (alertId: string, tabName: AlertDetailRouteType) => + `${ALERTS_PATH}/${alertId}/${tabName}`; + +export const getAlertDetailsNavTabs = (alertId: string): AlertDetailNavTabs => ({ + [AlertDetailRouteType.summary]: { + id: AlertDetailRouteType.summary, + name: i18n.SUMMARY_PAGE_TITLE, + href: getAlertDetailsTabUrl(alertId, AlertDetailRouteType.summary), + disabled: false, + }, +}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx index 288b389215e4..d9ac9813ec72 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx @@ -6,16 +6,20 @@ */ import React from 'react'; -import { Switch } from 'react-router-dom'; +import { Redirect, Switch } from 'react-router-dom'; import { Route } from '@kbn/kibana-react-plugin/public'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; +import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features'; import { ALERTS_PATH, SecurityPageName } from '../../../../common/constants'; import { NotFoundPage } from '../../../app/404'; import * as i18n from './translations'; import { DetectionEnginePage } from '../detection_engine/detection_engine'; import { SpyRoute } from '../../../common/utils/route/spy_routes'; import { useReadonlyHeader } from '../../../use_readonly_header'; +import { AlertDetailsPage } from '../alert_details'; +import { AlertDetailRouteType } from '../alert_details/types'; +import { getAlertDetailsTabUrl } from '../alert_details/utils/navigation'; const AlertsRoute = () => ( @@ -24,12 +28,40 @@ const AlertsRoute = () => ( ); +const AlertDetailsRoute = () => ( + + + +); + const AlertsContainerComponent: React.FC = () => { useReadonlyHeader(i18n.READ_ONLY_BADGE_TOOLTIP); - + const isAlertDetailsPageEnabled = useIsExperimentalFeatureEnabled('alertDetailsPageEnabled'); return ( + {isAlertDetailsPageEnabled && ( + <> + {/* Redirect to the summary page if only the detail name is provided */} + ( + + )} + /> + + + )} ); diff --git a/x-pack/plugins/security_solution/public/helpers.tsx b/x-pack/plugins/security_solution/public/helpers.tsx index 0187e50d195d..e69115525630 100644 --- a/x-pack/plugins/security_solution/public/helpers.tsx +++ b/x-pack/plugins/security_solution/public/helpers.tsx @@ -168,6 +168,14 @@ export const isDetectionsPath = (pathname: string): boolean => { }); }; +export const isAlertDetailsPage = (pathname: string): boolean => { + return !!matchPath(pathname, { + path: `${ALERTS_PATH}/:detailName/:tabName`, + strict: false, + exact: true, + }); +}; + export const isThreatIntelligencePath = (pathname: string): boolean => { return !!matchPath(pathname, { path: `(${THREAT_INTELLIGENCE_PATH})`, diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx index acf74257c862..7270e7a65f9f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/expandable_event.tsx @@ -18,6 +18,12 @@ import { import React from 'react'; import styled from 'styled-components'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { getAlertDetailsUrl } from '../../../../common/components/link_to'; +import { + SecuritySolutionLinkAnchor, + useGetSecuritySolutionLinkProps, +} from '../../../../common/components/links'; import type { Ecs } from '../../../../../common/ecs'; import type { TimelineTabs } from '../../../../../common/types/timeline'; import type { BrowserFields } from '../../../../common/containers/source'; @@ -25,6 +31,7 @@ import { EventDetails } from '../../../../common/components/event_details/event_ import type { TimelineEventsDetailsItem } from '../../../../../common/search_strategy/timeline'; import * as i18n from './translations'; import { PreferenceFormattedDate } from '../../../../common/components/formatted_date'; +import { SecurityPageName } from '../../../../../common/constants'; export type HandleOnEventClosed = () => void; interface Props { @@ -44,6 +51,7 @@ interface Props { } interface ExpandableEventTitleProps { + eventId: string; isAlert: boolean; loading: boolean; ruleName?: string; @@ -68,31 +76,50 @@ const StyledEuiFlexItem = styled(EuiFlexItem)` `; export const ExpandableEventTitle = React.memo( - ({ isAlert, loading, handleOnEventClosed, ruleName, timestamp }) => ( - - - {!loading && ( - <> - -

{isAlert && !isEmpty(ruleName) ? ruleName : i18n.EVENT_DETAILS}

-
- {timestamp && ( - <> - - - - )} - - - )} -
- {handleOnEventClosed && ( + ({ eventId, isAlert, loading, handleOnEventClosed, ruleName, timestamp }) => { + const isAlertDetailsPageEnabled = useIsExperimentalFeatureEnabled('alertDetailsPageEnabled'); + const { onClick } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.alerts, + path: eventId && isAlert ? getAlertDetailsUrl(eventId) : '', + }); + return ( + - + {!loading && ( + <> + +

{isAlert && !isEmpty(ruleName) ? ruleName : i18n.EVENT_DETAILS}

+
+ {timestamp && ( + <> + + + + )} + {isAlert && eventId && isAlertDetailsPageEnabled && ( + <> + + + {i18n.OPEN_ALERT_DETAILS_PAGE} + + + + )} + + )}
- )} -
- ) + {handleOnEventClosed && ( + + + + )} +
+ ); + } ); ExpandableEventTitle.displayName = 'ExpandableEventTitle'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx index 39a4899dbc33..bc9af3fa8546 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/header.tsx @@ -12,6 +12,7 @@ import { ExpandableEventTitle } from '../expandable_event'; import { BackToAlertDetailsLink } from './back_to_alert_details_link'; interface FlyoutHeaderComponentProps { + eventId: string; isAlert: boolean; isHostIsolationPanelOpen: boolean; isolateAction: 'isolateHost' | 'unisolateHost'; @@ -22,6 +23,7 @@ interface FlyoutHeaderComponentProps { } const FlyoutHeaderContentComponent = ({ + eventId, isAlert, isHostIsolationPanelOpen, isolateAction, @@ -36,6 +38,7 @@ const FlyoutHeaderContentComponent = ({ ) : ( { { }, [ isAlert, + alertId, isHostIsolationPanelOpen, isolateAction, loading, diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx index 9067443f6dea..29a1940413da 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/index.tsx @@ -80,6 +80,7 @@ const EventDetailsPanelComponent: React.FC = ({ () => isFlyoutView || isHostIsolationPanelOpen ? ( = ({ /> ) : ( = ({ /> ), [ + expandedEvent.eventId, handleOnEventClosed, isAlert, isFlyoutView, diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts index 2910e04747e3..39292052cf8d 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/translations.ts @@ -14,6 +14,13 @@ export const MESSAGE = i18n.translate( } ); +export const OPEN_ALERT_DETAILS_PAGE = i18n.translate( + 'xpack.securitySolution.timeline.expandableEvent.openAlertDetails', + { + defaultMessage: 'Open alert details page', + } +); + export const CLOSE = i18n.translate( 'xpack.securitySolution.timeline.expandableEvent.closeEventDetailsLabel', { diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx index 02013a7af6bf..3c77300cf060 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx @@ -11,6 +11,7 @@ import { timelineActions } from '../../../store/timeline'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; import { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { TimelineId, TimelineTabs } from '../../../../../common/types'; +import { FlowTargetSourceDest } from '../../../../../common/search_strategy'; const mockDispatch = jest.fn(); jest.mock('../../../../common/lib/kibana'); @@ -51,71 +52,237 @@ describe('useDetailPanel', () => { (useDeepEqualSelector as jest.Mock).mockClear(); }); - test('should return openDetailsPanel fn, handleOnDetailsPanelClosed fn, shouldShowDetailsPanel, and the DetailsPanel component', async () => { + test('should return open fns (event, host, network, user), handleOnDetailsPanelClosed fn, shouldShowDetailsPanel, and the DetailsPanel component', async () => { await act(async () => { const { result, waitForNextUpdate } = renderHook(() => { return useDetailPanel(defaultProps); }); await waitForNextUpdate(); - expect(result.current.openDetailsPanel).toBeDefined(); + expect(result.current.openEventDetailsPanel).toBeDefined(); + expect(result.current.openHostDetailsPanel).toBeDefined(); + expect(result.current.openNetworkDetailsPanel).toBeDefined(); + expect(result.current.openUserDetailsPanel).toBeDefined(); expect(result.current.handleOnDetailsPanelClosed).toBeDefined(); expect(result.current.shouldShowDetailsPanel).toBe(false); expect(result.current.DetailsPanel).toBeNull(); }); }); - test('should fire redux action to open details panel', async () => { + describe('open event details', () => { const testEventId = '123'; - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => { - return useDetailPanel(defaultProps); + test('should fire redux action to open event details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openEventDetailsPanel(testEventId); + + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); }); - await waitForNextUpdate(); + }); - result.current?.openDetailsPanel(testEventId); + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); - expect(mockDispatch).toHaveBeenCalled(); - expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); + const mockOnClose = jest.fn(); + result.current?.openEventDetailsPanel(testEventId, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); + + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openEventDetailsPanel(testEventId, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + + result.current?.openEventDetailsPanel(testEventId, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(secondMockOnClose).toHaveBeenCalled(); + }); }); }); - test('should call provided onClose callback provided to openDetailsPanel fn', async () => { - const testEventId = '123'; - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => { - return useDetailPanel(defaultProps); + describe('open host details', () => { + const hostName = 'my-host'; + test('should fire redux action to open host details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openHostDetailsPanel(hostName); + + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); }); - await waitForNextUpdate(); + }); + + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + result.current?.openHostDetailsPanel(hostName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); + + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openHostDetailsPanel(hostName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + + result.current?.openEventDetailsPanel(hostName, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); - const mockOnClose = jest.fn(); - result.current?.openDetailsPanel(testEventId, mockOnClose); - result.current?.handleOnDetailsPanelClosed(); + expect(secondMockOnClose).toHaveBeenCalled(); + }); + }); + }); + + describe('open network details', () => { + const ip = '1.2.3.4'; + const flowTarget = FlowTargetSourceDest.source; + test('should fire redux action to open host details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openNetworkDetailsPanel(ip, flowTarget); - expect(mockOnClose).toHaveBeenCalled(); + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); + }); + }); + + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + result.current?.openNetworkDetailsPanel(ip, flowTarget, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); + + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openNetworkDetailsPanel(ip, flowTarget, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + + result.current?.openNetworkDetailsPanel(ip, flowTarget, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(secondMockOnClose).toHaveBeenCalled(); + }); }); }); - test('should call the last onClose callback provided to openDetailsPanel fn', async () => { - // Test that the onClose ref is properly updated - const testEventId = '123'; - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => { - return useDetailPanel(defaultProps); + describe('open user details', () => { + const userName = 'IAmBatman'; + test('should fire redux action to open host details panel', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + result.current?.openUserDetailsPanel(userName); + + expect(mockDispatch).toHaveBeenCalled(); + expect(timelineActions.toggleDetailPanel).toHaveBeenCalled(); }); - await waitForNextUpdate(); + }); + + test('should call provided onClose callback provided to openEventDetailsPanel fn', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); + + const mockOnClose = jest.fn(); + result.current?.openUserDetailsPanel(userName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(mockOnClose).toHaveBeenCalled(); + }); + }); - const mockOnClose = jest.fn(); - const secondMockOnClose = jest.fn(); - result.current?.openDetailsPanel(testEventId, mockOnClose); - result.current?.handleOnDetailsPanelClosed(); + test('should call the last onClose callback provided to openEventDetailsPanel fn', async () => { + // Test that the onClose ref is properly updated + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => { + return useDetailPanel(defaultProps); + }); + await waitForNextUpdate(); - expect(mockOnClose).toHaveBeenCalled(); + const mockOnClose = jest.fn(); + const secondMockOnClose = jest.fn(); + result.current?.openUserDetailsPanel(userName, mockOnClose); + result.current?.handleOnDetailsPanelClosed(); - result.current?.openDetailsPanel(testEventId, secondMockOnClose); - result.current?.handleOnDetailsPanelClosed(); + expect(mockOnClose).toHaveBeenCalled(); - expect(secondMockOnClose).toHaveBeenCalled(); + result.current?.openUserDetailsPanel(userName, secondMockOnClose); + result.current?.handleOnDetailsPanelClosed(); + + expect(secondMockOnClose).toHaveBeenCalled(); + }); }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx index e98bcfdcc37e..a43036e2d8a1 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx @@ -9,12 +9,13 @@ import React, { useMemo, useCallback, useRef } from 'react'; import { useDispatch } from 'react-redux'; import type { EntityType } from '@kbn/timelines-plugin/common'; import { getScopedActions, isInTableScope, isTimelineScope } from '../../../../helpers'; +import type { FlowTargetSourceDest } from '../../../../../common/search_strategy'; import { timelineSelectors } from '../../../store/timeline'; import { useSourcererDataView } from '../../../../common/containers/sourcerer'; import type { SourcererScopeName } from '../../../../common/store/sourcerer/model'; import { activeTimeline } from '../../../containers/active_timeline_context'; -import type { TimelineTabs } from '../../../../../common/types/timeline'; -import { TimelineId } from '../../../../../common/types/timeline'; +import type { TimelineExpandedDetailType } from '../../../../../common/types/timeline'; +import { TimelineTabs, TimelineId } from '../../../../../common/types/timeline'; import { timelineDefaults } from '../../../store/timeline/defaults'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; import { DetailsPanel as DetailsPanelComponent } from '..'; @@ -28,7 +29,14 @@ export interface UseDetailPanelConfig { tabType?: TimelineTabs; } export interface UseDetailPanelReturn { - openDetailsPanel: (eventId?: string, onClose?: () => void) => void; + openEventDetailsPanel: (eventId?: string, onClose?: () => void) => void; + openHostDetailsPanel: (hostName: string, onClose?: () => void) => void; + openNetworkDetailsPanel: ( + ip: string, + flowTarget: FlowTargetSourceDest, + onClose?: () => void + ) => void; + openUserDetailsPanel: (userName: string, onClose?: () => void) => void; handleOnDetailsPanelClosed: () => void; DetailsPanel: JSX.Element | null; shouldShowDetailsPanel: boolean; @@ -39,7 +47,7 @@ export const useDetailPanel = ({ isFlyoutView, sourcererScope, scopeId, - tabType, + tabType = TimelineTabs.query, }: UseDetailPanelConfig): UseDetailPanelReturn => { const { browserFields, selectedPatterns, runtimeMappings } = useSourcererDataView(sourcererScope); const dispatch = useDispatch(); @@ -50,11 +58,13 @@ export const useDetailPanel = ({ return dataTableSelectors.getTableByIdSelector(); } }, [scopeId]); + const eventDetailsIndex = useMemo(() => selectedPatterns.join(','), [selectedPatterns]); const expandedDetail = useDeepEqualSelector( (state) => ((getScope && getScope(state, scopeId)) ?? timelineDefaults)?.expandedDetail ); const onPanelClose = useRef(() => {}); + const noopPanelClose = () => {}; const shouldShowDetailsPanel = useMemo(() => { if ( @@ -68,31 +78,59 @@ export const useDetailPanel = ({ return false; }, [expandedDetail, tabType]); const scopedActions = getScopedActions(scopeId); + + // We could just surface load details panel, but rather than have users be concerned + // of the config for a panel, they can just pass the base necessary values to a panel specific function const loadDetailsPanel = useCallback( - (eventId?: string) => { - if (eventId && scopedActions) { + (panelConfig?: TimelineExpandedDetailType) => { + if (panelConfig && scopedActions) { if (isTimelineScope(scopeId)) { dispatch( scopedActions.toggleDetailPanel({ - panelView: 'eventDetail', + ...panelConfig, tabType, id: scopeId, - params: { - eventId, - indexName: selectedPatterns.join(','), - }, }) ); } } }, - [scopedActions, scopeId, dispatch, tabType, selectedPatterns] + [scopedActions, scopeId, dispatch, tabType] ); - const openDetailsPanel = useCallback( + const openEventDetailsPanel = useCallback( (eventId?: string, onClose?: () => void) => { - loadDetailsPanel(eventId); - onPanelClose.current = onClose ?? (() => {}); + if (eventId) { + loadDetailsPanel({ + panelView: 'eventDetail', + params: { eventId, indexName: eventDetailsIndex }, + }); + } + onPanelClose.current = onClose ?? noopPanelClose; + }, + [loadDetailsPanel, eventDetailsIndex] + ); + + const openHostDetailsPanel = useCallback( + (hostName: string, onClose?: () => void) => { + loadDetailsPanel({ panelView: 'hostDetail', params: { hostName } }); + onPanelClose.current = onClose ?? noopPanelClose; + }, + [loadDetailsPanel] + ); + + const openNetworkDetailsPanel = useCallback( + (ip: string, flowTarget: FlowTargetSourceDest, onClose?: () => void) => { + loadDetailsPanel({ panelView: 'networkDetail', params: { ip, flowTarget } }); + onPanelClose.current = onClose ?? noopPanelClose; + }, + [loadDetailsPanel] + ); + + const openUserDetailsPanel = useCallback( + (userName: string, onClose?: () => void) => { + loadDetailsPanel({ panelView: 'userDetail', params: { userName } }); + onPanelClose.current = onClose ?? noopPanelClose; }, [loadDetailsPanel] ); @@ -139,7 +177,10 @@ export const useDetailPanel = ({ ); return { - openDetailsPanel, + openEventDetailsPanel, + openHostDetailsPanel, + openNetworkDetailsPanel, + openUserDetailsPanel, handleOnDetailsPanelClosed, shouldShowDetailsPanel, DetailsPanel, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx index 5807a9667942..9e8ea89d9175 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx @@ -60,6 +60,9 @@ jest.mock('../../../../../common/lib/kibana', () => { addSuccess: jest.fn(), addWarning: jest.fn(), }), + useNavigateTo: jest.fn().mockReturnValue({ + navigateTo: jest.fn(), + }), useGetUserCasesPermissions: originalKibanaLib.useGetUserCasesPermissions, }; }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx index a0384d770753..5454642ea589 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx @@ -8,7 +8,6 @@ import React, { useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { EuiButtonIcon, EuiCheckbox, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; -import { noop } from 'lodash/fp'; import styled from 'styled-components'; import { DEFAULT_ACTION_BUTTON_WIDTH } from '@kbn/timelines-plugin/public'; @@ -65,7 +64,6 @@ const ActionsComponent: React.FC = ({ onEventDetailsPanelOpened, onRowSelected, onRuleChange, - refetch, showCheckboxes, showNotes, timelineId, @@ -298,7 +296,6 @@ const ActionsComponent: React.FC = ({ ecsRowData={ecsData} scopeId={timelineId} disabled={isContextMenuDisabled} - refetch={refetch ?? noop} onRuleChange={onRuleChange} /> {isDisabled === false ? ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx index 6d329034650f..199c79c3ac58 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.test.tsx @@ -58,6 +58,9 @@ jest.mock('../../../../../common/lib/kibana', () => { cases: mockCasesContract(), }, }), + useNavigateTo: () => ({ + navigateTo: jest.fn(), + }), useToasts: jest.fn().mockReturnValue({ addError: jest.fn(), addSuccess: jest.fn(), diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx index 2ac4f756ffe2..b8af8c0f0948 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx @@ -37,6 +37,21 @@ import * as i18n from './translations'; export const DEFAULT_CONTEXT_ID = 'alert-renderer'; +export const ALERT_RENDERER_FIELDS = [ + DESTINATION_IP, + DESTINATION_PORT, + EVENT_CATEGORY, + FILE_NAME, + HOST_NAME, + KIBANA_ALERT_RULE_NAME, + KIBANA_ALERT_SEVERITY, + PROCESS_NAME, + PROCESS_PARENT_NAME, + SOURCE_IP, + SOURCE_PORT, + USER_NAME, +]; + const AlertRendererFlexGroup = styled(EuiFlexGroup)` gap: ${({ theme }) => theme.eui.euiSizeXS}; `; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx index 506353a9b704..b24663b81122 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.test.tsx @@ -71,12 +71,12 @@ jest.mock('../../../../common/lib/kibana', () => { }), }; }); -const mockDetails = () => {}; +const mockOpenDetailFn = jest.fn(); jest.mock('../../side_panel/hooks/use_detail_panel', () => { return { useDetailPanel: () => ({ - openDetailsPanel: mockDetails, + openEventDetailsPanel: mockOpenDetailFn, handleOnDetailsPanelClosed: () => {}, DetailsPanel: () =>
, shouldShowDetailsPanel: false, @@ -161,7 +161,7 @@ describe('useSessionView with active timeline and a session id and graph event i expect(kibana.services.sessionView.getSessionView).toHaveBeenCalledWith({ height: 1000, sessionEntityId: 'test', - loadAlertDetails: mockDetails, + loadAlertDetails: mockOpenDetailFn, canAccessEndpointManagement: false, }); }); @@ -241,7 +241,7 @@ describe('useSessionView with active timeline and a session id and graph event i ); expect(kibana.services.sessionView.getSessionView).toHaveBeenCalled(); - expect(result.current).toHaveProperty('openDetailsPanel'); + expect(result.current).toHaveProperty('openEventDetailsPanel'); expect(result.current).toHaveProperty('shouldShowDetailsPanel'); expect(result.current).toHaveProperty('SessionView'); expect(result.current).toHaveProperty('DetailsPanel'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx index 0cb001b6aa3e..6015477624d8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/session_tab_content/use_session_view.tsx @@ -295,7 +295,7 @@ export const useSessionView = ({ return SourcererScopeName.default; } }, [scopeId]); - const { openDetailsPanel, shouldShowDetailsPanel, DetailsPanel } = useDetailPanel({ + const { openEventDetailsPanel, shouldShowDetailsPanel, DetailsPanel } = useDetailPanel({ isFlyoutView: !isActiveTimeline(scopeId), entityType, sourcererScope, @@ -309,7 +309,7 @@ export const useSessionView = ({ return sessionViewConfig !== null ? sessionView.getSessionView({ ...sessionViewConfig, - loadAlertDetails: openDetailsPanel, + loadAlertDetails: openEventDetailsPanel, isFullScreen: fullScreen, height: heightMinusSearchBar, canAccessEndpointManagement, @@ -319,13 +319,13 @@ export const useSessionView = ({ height, sessionViewConfig, sessionView, - openDetailsPanel, + openEventDetailsPanel, fullScreen, canAccessEndpointManagement, ]); return { - openDetailsPanel, + openEventDetailsPanel, shouldShowDetailsPanel, SessionView: sessionViewComponent, DetailsPanel, diff --git a/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx b/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx index 17aacfae9d2b..0444510776d6 100644 --- a/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx @@ -16,6 +16,7 @@ import { isCompleteResponse, isErrorResponse } from '@kbn/data-plugin/common'; import { EntityType } from '@kbn/timelines-plugin/common'; import { useKibana } from '../../../common/lib/kibana'; import type { + SearchHit, TimelineEventsDetailsItem, TimelineEventsDetailsRequestOptions, TimelineEventsDetailsStrategyResponse, @@ -47,7 +48,7 @@ export const useTimelineEventsDetails = ({ }: UseTimelineEventsDetailsProps): [ boolean, EventsArgs['detailsData'], - object | undefined, + SearchHit | undefined, EventsArgs['ecs'], () => Promise ] => { @@ -67,7 +68,7 @@ export const useTimelineEventsDetails = ({ useState(null); const [ecsData, setEcsData] = useState(null); - const [rawEventData, setRawEventData] = useState(undefined); + const [rawEventData, setRawEventData] = useState(undefined); const timelineDetailsSearch = useCallback( (request: TimelineEventsDetailsRequestOptions | null) => { if (request == null || skip || isEmpty(request.eventId)) { diff --git a/x-pack/plugins/timelines/public/store/t_grid/types.ts b/x-pack/plugins/timelines/public/store/t_grid/types.ts index 3e8f99800377..b0c82c2abf63 100644 --- a/x-pack/plugins/timelines/public/store/t_grid/types.ts +++ b/x-pack/plugins/timelines/public/store/t_grid/types.ts @@ -46,6 +46,7 @@ export enum TableId { export enum TimelineId { active = 'timeline-1', casePage = 'timeline-case', + detectionsAlertDetailsPage = 'detections-alert-details-page', test = 'timeline-test', // Reserved for testing purposes } diff --git a/x-pack/test/security_solution_cypress/config.ts b/x-pack/test/security_solution_cypress/config.ts index e77ab1fe4d48..18d7577516fd 100644 --- a/x-pack/test/security_solution_cypress/config.ts +++ b/x-pack/test/security_solution_cypress/config.ts @@ -49,7 +49,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { // See https://github.com/elastic/kibana/pull/125396 for details '--xpack.alerting.rules.minimumScheduleInterval.value=1s', '--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true', - `--xpack.securitySolution.enableExperimental=${JSON.stringify([])}`, + `--xpack.securitySolution.enableExperimental=${JSON.stringify([ + 'alertDetailsPageEnabled', + ])}`, `--home.disableWelcomeScreen=true`, ], }, From 55959f3531f2d0a862b30062bca5108c811041c3 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 31 Oct 2022 13:20:20 -0600 Subject: [PATCH 30/87] [Maps] layer group wizard (#144129) * [Maps] layer group wizard * create editor * open parent layer details on adding child * show combining highlight instead of selected layer highlight * do not delete layers added to preview layer group * reuse settingsPanel.layerNameLabel tag so label is consistent in edit panel * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * checks fix * layer group description copy update Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/maps/common/constants.ts | 1 + .../maps/public/actions/layer_actions.ts | 39 +++++++++++-- .../classes/layers/layer_group/index.ts | 2 +- .../layers/layer_group/layer_group.tsx | 8 ++- .../wizards/layer_group_wizard/config.tsx | 28 +++++++++ .../wizards/layer_group_wizard/index.ts | 8 +++ .../wizards/layer_group_wizard/wizard.tsx | 57 +++++++++++++++++++ .../layers/wizards/load_layer_wizards.ts | 2 + .../layer_toc/toc_entry/toc_entry.tsx | 18 +++++- 9 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.tsx create mode 100644 x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/index.ts create mode 100644 x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.tsx diff --git a/x-pack/plugins/maps/common/constants.ts b/x-pack/plugins/maps/common/constants.ts index 94ae72a050e2..117bfa0eaaea 100644 --- a/x-pack/plugins/maps/common/constants.ts +++ b/x-pack/plugins/maps/common/constants.ts @@ -310,6 +310,7 @@ export const emsWorldLayerId = 'world_countries'; export enum WIZARD_ID { CHOROPLETH = 'choropleth', GEO_FILE = 'uploadGeoFile', + LAYER_GROUP = 'layerGroup', NEW_VECTOR = 'newVectorLayer', OBSERVABILITY = 'observabilityLayer', SECURITY = 'securityLayer', diff --git a/x-pack/plugins/maps/public/actions/layer_actions.ts b/x-pack/plugins/maps/public/actions/layer_actions.ts index 5ba9edaee58d..38cadc8d1363 100644 --- a/x-pack/plugins/maps/public/actions/layer_actions.ts +++ b/x-pack/plugins/maps/public/actions/layer_actions.ts @@ -228,6 +228,9 @@ export function removePreviewLayers() { ) => { getLayerList(getState()).forEach((layer) => { if (layer.isPreviewLayer()) { + if (isLayerGroup(layer)) { + dispatch(ungroupLayer(layer.getId())); + } dispatch(removeLayer(layer.getId())); } }); @@ -613,11 +616,21 @@ export function setLayerQuery(id: string, query: Query) { } export function setLayerParent(id: string, parent: string | undefined) { - return { - type: UPDATE_LAYER_PROP, - id, - propName: 'parent', - newValue: parent, + return ( + dispatch: ThunkDispatch, + getState: () => MapStoreState + ) => { + dispatch({ + type: UPDATE_LAYER_PROP, + id, + propName: 'parent', + newValue: parent, + }); + + if (parent) { + // Open parent layer details. Without opening parent details, layer disappears from legend and this confuses users + dispatch(showTOCDetails(parent)); + } }; } @@ -863,6 +876,22 @@ export function createLayerGroup(draggedLayerId: string, combineLayerId: string) }; } +function ungroupLayer(layerId: string) { + return ( + dispatch: ThunkDispatch, + getState: () => MapStoreState + ) => { + const layer = getLayerList(getState()).find((findLayer) => findLayer.getId() === layerId); + if (!layer || !isLayerGroup(layer)) { + return; + } + + (layer as LayerGroup).getChildren().forEach((childLayer) => { + dispatch(setLayerParent(childLayer.getId(), layer.getParent())); + }); + }; +} + export function moveLayerToLeftOfTarget(moveLayerId: string, targetLayerId: string) { return ( dispatch: ThunkDispatch, diff --git a/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts b/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts index 3b2848d03f5f..085ea4e8afea 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts +++ b/x-pack/plugins/maps/public/classes/layers/layer_group/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { isLayerGroup, LayerGroup } from './layer_group'; +export { DEFAULT_LAYER_GROUP_LABEL, isLayerGroup, LayerGroup } from './layer_group'; diff --git a/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx b/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx index c1a2a2964a31..7fa48628ef0d 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx +++ b/x-pack/plugins/maps/public/classes/layers/layer_group/layer_group.tsx @@ -36,6 +36,10 @@ export function isLayerGroup(layer: ILayer) { return layer instanceof LayerGroup; } +export const DEFAULT_LAYER_GROUP_LABEL = i18n.translate('xpack.maps.layerGroup.defaultName', { + defaultMessage: 'Layer group', +}); + export class LayerGroup implements ILayer { protected readonly _descriptor: LayerGroupDescriptor; private _children: ILayer[] = []; @@ -48,9 +52,7 @@ export class LayerGroup implements ILayer { label: typeof options.label === 'string' && options.label.length ? options.label - : i18n.translate('xpack.maps.layerGroup.defaultName', { - defaultMessage: 'Layer group', - }), + : DEFAULT_LAYER_GROUP_LABEL, sourceDescriptor: null, visible: typeof options.visible === 'boolean' ? options.visible : true, }; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.tsx new file mode 100644 index 000000000000..4418b20cf661 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/config.tsx @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { LayerWizard, RenderWizardArguments } from '../layer_wizard_registry'; +import { LayerGroupWizard } from './wizard'; +import { WIZARD_ID } from '../../../../../common/constants'; + +export const layerGroupWizardConfig: LayerWizard = { + id: WIZARD_ID.LAYER_GROUP, + order: 10, + categories: [], + description: i18n.translate('xpack.maps.layerGroupWizard.description', { + defaultMessage: 'Organize related layers in a hierarchy', + }), + icon: 'layers', + renderWizard: (renderWizardArguments: RenderWizardArguments) => { + return ; + }, + title: i18n.translate('xpack.maps.layerGroupWizard.title', { + defaultMessage: 'Layer group', + }), +}; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/index.ts b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/index.ts new file mode 100644 index 000000000000..06bd343d84a3 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { layerGroupWizardConfig } from './config'; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.tsx new file mode 100644 index 000000000000..2668730e694c --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/wizards/layer_group_wizard/wizard.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import React, { ChangeEvent, Component } from 'react'; +import { EuiFieldText, EuiFormRow, EuiPanel } from '@elastic/eui'; +import { RenderWizardArguments } from '../layer_wizard_registry'; +import { DEFAULT_LAYER_GROUP_LABEL, LayerGroup } from '../../layer_group'; + +interface State { + label: string; +} + +export class LayerGroupWizard extends Component { + state: State = { + label: DEFAULT_LAYER_GROUP_LABEL, + }; + + componentDidMount() { + this._previewLayer(); + } + + _onLabelChange = (e: ChangeEvent) => { + this.setState( + { + label: e.target.value, + }, + this._previewLayer + ); + }; + + _previewLayer() { + const layerDescriptor = LayerGroup.createDescriptor({ + label: this.state.label, + }); + + this.props.previewLayers([layerDescriptor]); + } + + render() { + return ( + + + + + + ); + } +} diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts b/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts index aa772d44341e..fbaba6325bf2 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts @@ -7,6 +7,7 @@ import { registerLayerWizardInternal } from './layer_wizard_registry'; import { uploadLayerWizardConfig } from './file_upload_wizard'; +import { layerGroupWizardConfig } from './layer_group_wizard'; import { esDocumentsLayerWizardConfig, esTopHitsLayerWizardConfig, @@ -36,6 +37,7 @@ export function registerLayerWizards() { } registerLayerWizardInternal(uploadLayerWizardConfig); + registerLayerWizardInternal(layerGroupWizardConfig); registerLayerWizardInternal(esDocumentsLayerWizardConfig); registerLayerWizardInternal(choroplethLayerWizardConfig); registerLayerWizardInternal(clustersLayerWizardConfig); diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx index 012c1e97ad52..ed426011e995 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx @@ -311,14 +311,26 @@ export class TOCEntry extends Component { ); }; + _hightlightAsSelectedLayer() { + if (this.props.isCombineLayer) { + return false; + } + + if (this.props.layer.isPreviewLayer()) { + return true; + } + + return ( + this.props.selectedLayer && this.props.selectedLayer.getId() === this.props.layer.getId() + ); + } + render() { const classes = classNames('mapTocEntry', { 'mapTocEntry-isDragging': this.props.isDragging, 'mapTocEntry-isDraggingOver': this.props.isDraggingOver, 'mapTocEntry-isCombineLayer': this.props.isCombineLayer, - 'mapTocEntry-isSelected': - this.props.layer.isPreviewLayer() || - (this.props.selectedLayer && this.props.selectedLayer.getId() === this.props.layer.getId()), + 'mapTocEntry-isSelected': this._hightlightAsSelectedLayer(), 'mapTocEntry-isInEditingMode': this.props.isFeatureEditorOpenForLayer, }); From 80b7010f01cd37769b1643fe06b156fba38fb14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Mon, 31 Oct 2022 15:27:41 -0400 Subject: [PATCH 31/87] [APM] AWS lambda estimated cost (#143986) * adding estimated cost * fixing * adding architecture to service details * fix ci * fix test * addressing PR comments * addressing PR comments * hide extimated cost when undefined * addressing pr comments * fixing test --- .../src/lib/apm/apm_fields.ts | 1 + .../src/lib/apm/serverless_function.ts | 3 + .../server/collectors/management/schema.ts | 8 ++ .../server/collectors/management/types.ts | 2 + src/plugins/telemetry/schema/oss_plugins.json | 12 +++ .../elasticsearch_fieldnames.test.ts.snap | 6 ++ .../apm/common/elasticsearch_fieldnames.ts | 1 + .../serverless_metrics/serverless_summary.tsx | 14 +++ .../app/settings/general_settings/index.tsx | 4 + .../service_icons/serverless_details.tsx | 12 +++ .../serverless/get_serverless_summary.ts | 89 +++++++++++++++++-- .../routes/metrics/serverless/helper.test.ts | 88 +++++++++++++++++- .../routes/metrics/serverless/helper.ts | 69 ++++++++++++++ .../server/routes/metrics/serverless/route.ts | 32 ++++++- .../services/get_service_metadata_details.ts | 3 + x-pack/plugins/observability/common/index.ts | 2 + .../observability/common/ui_settings_keys.ts | 2 + .../observability/server/ui_settings.ts | 27 +++++- .../serverless/serverless_summary.spec.ts | 2 +- 19 files changed, 366 insertions(+), 11 deletions(-) diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts b/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts index 07379b2a3002..e9b89fa4739d 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts @@ -57,6 +57,7 @@ export type ApmFields = Fields & 'error.grouping_name': string; 'error.grouping_key': string; 'host.name': string; + 'host.architecture': string; 'host.hostname': string; 'http.request.method': string; 'http.response.status_code': number; diff --git a/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts b/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts index c8287066cc27..433acf42ba6b 100644 --- a/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts +++ b/packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts @@ -26,11 +26,13 @@ export function serverlessFunction({ serviceName, environment, agentName, + architecture = 'arm', }: { functionName: string; environment: string; agentName: string; serviceName?: string; + architecture?: string; }) { const faasId = `arn:aws:lambda:us-west-2:001:function:${functionName}`; return new ServerlessFunction({ @@ -40,5 +42,6 @@ export function serverlessFunction({ 'service.environment': environment, 'agent.name': agentName, 'service.runtime.name': 'AWS_lambda', + 'host.architecture': architecture, }); } diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts index 22b2a5de751f..0aa6830adf86 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -442,6 +442,14 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, + 'observability:apmAWSLambdaPriceFactor': { + type: 'text', + _meta: { description: 'Non-default value of setting.' }, + }, + 'observability:apmAWSLambdaRequestCostPerMillion': { + type: 'integer', + _meta: { description: 'Non-default value of setting.' }, + }, 'banners:placement': { type: 'keyword', _meta: { description: 'Non-default value of setting.' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts index 695732310354..88220ed36788 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -43,6 +43,8 @@ export interface UsageStats { 'observability:enableComparisonByDefault': boolean; 'observability:enableServiceGroups': boolean; 'observability:apmEnableServiceMetrics': boolean; + 'observability:apmAWSLambdaPriceFactor': string; + 'observability:apmAWSLambdaRequestCostPerMillion': number; 'observability:enableInfrastructureHostsView': boolean; 'visualize:enableLabs': boolean; 'visualization:heatmap:maxBuckets': number; diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 43dc28b3e9e6..7ad52ecb20d2 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -8785,6 +8785,18 @@ "description": "Non-default value of setting." } }, + "observability:apmAWSLambdaPriceFactor": { + "type": "text", + "_meta": { + "description": "Non-default value of setting." + } + }, + "observability:apmAWSLambdaRequestCostPerMillion": { + "type": "integer", + "_meta": { + "description": "Non-default value of setting." + } + }, "banners:placement": { "type": "keyword", "_meta": { diff --git a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap index 8a1ae899ddd3..10c42bd763da 100644 --- a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap +++ b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap @@ -85,6 +85,8 @@ Object { } `; +exports[`Error HOST_ARCHITECTURE 1`] = `undefined`; + exports[`Error HOST_HOSTNAME 1`] = `"my hostname"`; exports[`Error HOST_NAME 1`] = `undefined`; @@ -338,6 +340,8 @@ exports[`Span FAAS_TRIGGER_TYPE 1`] = `undefined`; exports[`Span HOST 1`] = `undefined`; +exports[`Span HOST_ARCHITECTURE 1`] = `undefined`; + exports[`Span HOST_HOSTNAME 1`] = `undefined`; exports[`Span HOST_NAME 1`] = `undefined`; @@ -595,6 +599,8 @@ Object { } `; +exports[`Transaction HOST_ARCHITECTURE 1`] = `undefined`; + exports[`Transaction HOST_HOSTNAME 1`] = `"my hostname"`; exports[`Transaction HOST_NAME 1`] = `undefined`; diff --git a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts index 6fa3625c7ff7..4915dff2da4f 100644 --- a/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts +++ b/x-pack/plugins/apm/common/elasticsearch_fieldnames.ts @@ -123,6 +123,7 @@ export const HOST = 'host'; export const HOST_HOSTNAME = 'host.hostname'; // Do not use. Please use `HOST_NAME` instead. export const HOST_NAME = 'host.name'; export const HOST_OS_PLATFORM = 'host.os.platform'; +export const HOST_ARCHITECTURE = 'host.architecture'; export const HOST_OS_VERSION = 'host.os.version'; export const CONTAINER_ID = 'container.id'; export const CONTAINER = 'container'; diff --git a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx index f6d93cb9cd80..365937c8c48a 100644 --- a/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx +++ b/x-pack/plugins/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx @@ -163,6 +163,20 @@ export function ServerlessSummary({ serverlessId }: Props) { /> {showVerticalRule && } + {data?.estimatedCost && ( + + + + )} ); diff --git a/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx b/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx index 2faad60fb8b8..564cddd1af89 100644 --- a/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx +++ b/x-pack/plugins/apm/public/components/app/settings/general_settings/index.tsx @@ -16,6 +16,8 @@ import { defaultApmServiceEnvironment, enableComparisonByDefault, enableInspectEsQueries, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, } from '@kbn/observability-plugin/common'; import { isEmpty } from 'lodash'; import React from 'react'; @@ -30,6 +32,8 @@ const apmSettingsKeys = [ apmServiceGroupMaxNumberOfServices, enableInspectEsQueries, apmLabsButton, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, ]; export function GeneralSettings() { diff --git a/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx b/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx index 5d6e3f5df0b6..2c6fabc72c03 100644 --- a/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx +++ b/x-pack/plugins/apm/public/components/shared/service_icons/serverless_details.tsx @@ -72,5 +72,17 @@ export function ServerlessDetails({ serverless }: Props) { }); } + if (serverless.hostArchitecture) { + listItems.push({ + title: i18n.translate( + 'xpack.apm.serviceIcons.serviceDetails.cloud.architecture', + { defaultMessage: 'Architecture' } + ), + description: ( + {serverless.hostArchitecture} + ), + }); + } + return ; } diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_summary.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_summary.ts index d3f292a11b87..1b35e8fd22ed 100644 --- a/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_summary.ts +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/get_serverless_summary.ts @@ -14,14 +14,65 @@ import { FAAS_BILLED_DURATION, FAAS_DURATION, FAAS_ID, + HOST_ARCHITECTURE, METRICSET_NAME, METRIC_SYSTEM_FREE_MEMORY, METRIC_SYSTEM_TOTAL_MEMORY, SERVICE_NAME, } from '../../../../common/elasticsearch_fieldnames'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { calcMemoryUsedRate } from './helper'; import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client'; +import { calcEstimatedCost, calcMemoryUsedRate } from './helper'; + +export type AwsLambdaArchitecture = 'arm' | 'x86_64'; + +export type AWSLambdaPriceFactor = Record; + +async function getServerlessTransactionThroughput({ + end, + environment, + kuery, + serviceName, + start, + serverlessId, + apmEventClient, +}: { + environment: string; + kuery: string; + serviceName: string; + start: number; + end: number; + serverlessId?: string; + apmEventClient: APMEventClient; +}) { + const params = { + apm: { + events: [ProcessorEvent.transaction], + }, + body: { + track_total_hits: true, + size: 0, + query: { + bool: { + filter: [ + ...termQuery(SERVICE_NAME, serviceName), + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...kqlQuery(kuery), + ...termQuery(FAAS_ID, serverlessId), + ], + }, + }, + }, + }; + + const response = await apmEventClient.search( + 'get_serverless_transaction_throughout', + params + ); + + return response.hits.total.value; +} export async function getServerlessSummary({ end, @@ -31,6 +82,8 @@ export async function getServerlessSummary({ start, serverlessId, apmEventClient, + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, }: { environment: string; kuery: string; @@ -39,6 +92,8 @@ export async function getServerlessSummary({ end: number; serverlessId?: string; apmEventClient: APMEventClient; + awsLambdaPriceFactor?: AWSLambdaPriceFactor; + awsLambdaRequestCostPerMillion?: number; }) { const params = { apm: { @@ -65,14 +120,28 @@ export async function getServerlessSummary({ faasBilledDurationAvg: { avg: { field: FAAS_BILLED_DURATION } }, avgTotalMemory: { avg: { field: METRIC_SYSTEM_TOTAL_MEMORY } }, avgFreeMemory: { avg: { field: METRIC_SYSTEM_FREE_MEMORY } }, + sample: { + top_metrics: { + metrics: [{ field: HOST_ARCHITECTURE }], + sort: [{ '@timestamp': { order: 'desc' as const } }], + }, + }, }, }, }; - const response = await apmEventClient.search( - 'ger_serverless_summary', - params - ); + const [response, transactionThroughput] = await Promise.all([ + apmEventClient.search('get_serverless_summary', params), + getServerlessTransactionThroughput({ + end, + environment, + kuery, + serviceName, + apmEventClient, + start, + serverlessId, + }), + ]); return { memoryUsageAvgRate: calcMemoryUsedRate({ @@ -82,5 +151,15 @@ export async function getServerlessSummary({ serverlessFunctionsTotal: response.aggregations?.totalFunctions?.value, serverlessDurationAvg: response.aggregations?.faasDurationAvg?.value, billedDurationAvg: response.aggregations?.faasBilledDurationAvg?.value, + estimatedCost: calcEstimatedCost({ + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, + architecture: response.aggregations?.sample?.top?.[0]?.metrics?.[ + HOST_ARCHITECTURE + ] as AwsLambdaArchitecture | undefined, + transactionThroughput, + billedDuration: response.aggregations?.faasBilledDurationAvg.value, + totalMemory: response.aggregations?.avgTotalMemory.value, + }), }; } diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/helper.test.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.test.ts index c6927f36a8eb..d92b7edece8d 100644 --- a/x-pack/plugins/apm/server/routes/metrics/serverless/helper.test.ts +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.test.ts @@ -4,7 +4,11 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { calcMemoryUsed, calcMemoryUsedRate } from './helper'; +import { + calcMemoryUsed, + calcMemoryUsedRate, + calcEstimatedCost, +} from './helper'; describe('calcMemoryUsed', () => { it('returns undefined when memory values are no a number', () => { [ @@ -38,3 +42,85 @@ describe('calcMemoryUsedRate', () => { expect(calcMemoryUsedRate({ memoryFree: 50, memoryTotal: 100 })).toBe(0.5); }); }); + +const AWS_LAMBDA_PRICE_FACTOR = { + x86_64: 0.0000166667, + arm: 0.0000133334, +}; + +describe('calcEstimatedCost', () => { + it('returns undefined when price factor is not defined', () => { + expect( + calcEstimatedCost({ + totalMemory: 1, + billedDuration: 1, + transactionThroughput: 1, + architecture: 'arm', + }) + ).toBeUndefined(); + }); + + it('returns undefined when architecture is not defined', () => { + expect( + calcEstimatedCost({ + totalMemory: 1, + billedDuration: 1, + transactionThroughput: 1, + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + }) + ).toBeUndefined(); + }); + + it('returns undefined when compute usage is not defined', () => { + expect( + calcEstimatedCost({ + transactionThroughput: 1, + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture: 'arm', + }) + ).toBeUndefined(); + }); + + it('returns undefined when request cost per million is not defined', () => { + expect( + calcEstimatedCost({ + totalMemory: 1, + billedDuration: 1, + transactionThroughput: 1, + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture: 'arm', + }) + ).toBeUndefined(); + }); + + describe('x86_64 architecture', () => { + const architecture = 'x86_64'; + it('returns correct cost', () => { + expect( + calcEstimatedCost({ + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture, + billedDuration: 4000, + totalMemory: 536870912, // 0.5gb + transactionThroughput: 100000, + awsLambdaRequestCostPerMillion: 0.2, + }) + ).toEqual(0.03); + }); + }); + describe('arm architecture', () => { + const architecture = 'arm'; + it('returns correct cost', () => { + expect( + calcEstimatedCost({ + awsLambdaPriceFactor: AWS_LAMBDA_PRICE_FACTOR, + architecture, + billedDuration: 8000, + totalMemory: 536870912, // 0.5gb + transactionThroughput: 200000, + awsLambdaRequestCostPerMillion: 0.2, + }) + ).toEqual(0.05); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/helper.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.ts index 0c16ee101c73..2026cc9990a7 100644 --- a/x-pack/plugins/apm/server/routes/metrics/serverless/helper.ts +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/helper.ts @@ -5,6 +5,10 @@ * 2.0. */ import { isFiniteNumber } from '../../../../common/utils/is_finite_number'; +import { + AwsLambdaArchitecture, + AWSLambdaPriceFactor, +} from './get_serverless_summary'; export function calcMemoryUsedRate({ memoryFree, @@ -33,3 +37,68 @@ export function calcMemoryUsed({ return memoryTotal - memoryFree; } + +const GB = 1024 ** 3; +/** + * To calculate the compute usage we need to multiply the "system.memory.total" by "faas.billed_duration". + * But the result of this calculation is in Bytes-milliseconds, as the "system.memory.total" is stored in bytes and the "faas.billed_duration" is stored in milliseconds. + * But to calculate the overall cost AWS uses GB-second, so we need to convert the result to this unit. + */ +export function calcComputeUsageGBSeconds({ + billedDuration, + totalMemory, +}: { + billedDuration?: number | null; + totalMemory?: number | null; +}) { + if (!isFiniteNumber(billedDuration) || !isFiniteNumber(totalMemory)) { + return undefined; + } + + const totalMemoryGB = totalMemory / GB; + const billedDurationSec = billedDuration / 1000; + return totalMemoryGB * billedDurationSec; +} + +export function calcEstimatedCost({ + awsLambdaPriceFactor, + architecture, + transactionThroughput, + billedDuration, + totalMemory, + awsLambdaRequestCostPerMillion, +}: { + awsLambdaPriceFactor?: AWSLambdaPriceFactor; + architecture?: AwsLambdaArchitecture; + transactionThroughput: number; + billedDuration?: number | null; + totalMemory?: number | null; + awsLambdaRequestCostPerMillion?: number; +}) { + try { + const computeUsage = calcComputeUsageGBSeconds({ + billedDuration, + totalMemory, + }); + if ( + !awsLambdaPriceFactor || + !architecture || + !isFiniteNumber(awsLambdaRequestCostPerMillion) || + !isFiniteNumber(awsLambdaPriceFactor?.[architecture]) || + !isFiniteNumber(computeUsage) + ) { + return undefined; + } + + const priceFactor = awsLambdaPriceFactor?.[architecture]; + + const estimatedCost = + computeUsage * priceFactor + + transactionThroughput * (awsLambdaRequestCostPerMillion / 1000000); + + // Rounds up the decimals + return Math.ceil(estimatedCost * 100) / 100; + } catch (e) { + return undefined; + } +} diff --git a/x-pack/plugins/apm/server/routes/metrics/serverless/route.ts b/x-pack/plugins/apm/server/routes/metrics/serverless/route.ts index af2a0aa0834f..7fdf4dca1e2c 100644 --- a/x-pack/plugins/apm/server/routes/metrics/serverless/route.ts +++ b/x-pack/plugins/apm/server/routes/metrics/serverless/route.ts @@ -6,13 +6,20 @@ */ import * as t from 'io-ts'; +import { + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, +} from '@kbn/observability-plugin/common'; import { setupRequest } from '../../../lib/helpers/setup_request'; import { createApmServerRoute } from '../../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../../default_api_types'; import { getServerlessAgentMetricsCharts } from './get_serverless_agent_metrics_chart'; import { getServerlessActiveInstancesOverview } from './get_active_instances_overview'; import { getServerlessFunctionsOverview } from './get_serverless_functions_overview'; -import { getServerlessSummary } from './get_serverless_summary'; +import { + AWSLambdaPriceFactor, + getServerlessSummary, +} from './get_serverless_summary'; import { getActiveInstancesTimeseries } from './get_active_instances_timeseries'; import { getApmEventClient } from '../../../lib/helpers/get_apm_event_client'; @@ -163,8 +170,25 @@ const serverlessMetricsSummaryRoute = createApmServerRoute({ handler: async ( resources ): Promise>> => { - const { params } = resources; - const apmEventClient = await getApmEventClient(resources); + const { params, context } = resources; + const { + uiSettings: { client: uiSettingsClient }, + } = await context.core; + + const [ + apmEventClient, + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, + ] = await Promise.all([ + getApmEventClient(resources), + uiSettingsClient + .get(apmAWSLambdaPriceFactor) + .then( + (value): AWSLambdaPriceFactor => + JSON.parse(value) as AWSLambdaPriceFactor + ), + uiSettingsClient.get(apmAWSLambdaRequestCostPerMillion), + ]); const { serviceName } = params.path; const { environment, kuery, start, end, serverlessId } = params.query; @@ -177,6 +201,8 @@ const serverlessMetricsSummaryRoute = createApmServerRoute({ apmEventClient, serviceName, serverlessId, + awsLambdaPriceFactor, + awsLambdaRequestCostPerMillion, }); }, }); diff --git a/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts b/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts index 40e48101784c..dfe482325035 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_metadata_details.ts @@ -59,6 +59,7 @@ export interface ServiceMetadataDetails { type?: string; functionNames?: string[]; faasTriggerTypes?: string[]; + hostArchitecture?: string; }; cloud?: { provider?: string; @@ -102,6 +103,7 @@ export async function getServiceMetadataDetails({ ProcessorEvent.metric, ], }, + sort: [{ '@timestamp': { order: 'desc' as const } }], body: { track_total_hits: 1, size: 1, @@ -212,6 +214,7 @@ export async function getServiceMetadataDetails({ faasTriggerTypes: response.aggregations?.faasTriggerTypes.buckets.map( (bucket) => bucket.key as string ), + hostArchitecture: host?.architecture, } : undefined; diff --git a/x-pack/plugins/observability/common/index.ts b/x-pack/plugins/observability/common/index.ts index 7a2100e15225..a8332262eda9 100644 --- a/x-pack/plugins/observability/common/index.ts +++ b/x-pack/plugins/observability/common/index.ts @@ -26,6 +26,8 @@ export { enableInfrastructureHostsView, enableServiceMetrics, enableAwsLambdaMetrics, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, enableCriticalPath, } from './ui_settings_keys'; diff --git a/x-pack/plugins/observability/common/ui_settings_keys.ts b/x-pack/plugins/observability/common/ui_settings_keys.ts index 7de867608bfc..52258c5711d1 100644 --- a/x-pack/plugins/observability/common/ui_settings_keys.ts +++ b/x-pack/plugins/observability/common/ui_settings_keys.ts @@ -21,4 +21,6 @@ export const apmLabsButton = 'observability:apmLabsButton'; export const enableInfrastructureHostsView = 'observability:enableInfrastructureHostsView'; export const enableAwsLambdaMetrics = 'observability:enableAwsLambdaMetrics'; export const enableServiceMetrics = 'observability:apmEnableServiceMetrics'; +export const apmAWSLambdaPriceFactor = 'observability:apmAWSLambdaPriceFactor'; +export const apmAWSLambdaRequestCostPerMillion = 'observability:apmAWSLambdaRequestCostPerMillion'; export const enableCriticalPath = 'observability:apmEnableCriticalPath'; diff --git a/x-pack/plugins/observability/server/ui_settings.ts b/x-pack/plugins/observability/server/ui_settings.ts index a2bc38727e53..6f2bfb27a161 100644 --- a/x-pack/plugins/observability/server/ui_settings.ts +++ b/x-pack/plugins/observability/server/ui_settings.ts @@ -24,6 +24,8 @@ import { enableInfrastructureHostsView, enableServiceMetrics, enableAwsLambdaMetrics, + apmAWSLambdaPriceFactor, + apmAWSLambdaRequestCostPerMillion, enableCriticalPath, } from '../common/ui_settings_keys'; @@ -39,7 +41,7 @@ function feedbackLink({ href }: { href: string }) { )}`; } -type UiSettings = UiSettingsParams & { showInLabs?: boolean }; +type UiSettings = UiSettingsParams & { showInLabs?: boolean }; /** * uiSettings definitions for Observability. @@ -291,6 +293,29 @@ export const uiSettings: Record = { type: 'boolean', showInLabs: true, }, + [apmAWSLambdaPriceFactor]: { + category: [observabilityFeatureId], + name: i18n.translate('xpack.observability.apmAWSLambdaPricePerGbSeconds', { + defaultMessage: 'AWS lambda price factor', + }), + type: 'json', + value: JSON.stringify({ x86_64: 0.0000166667, arm: 0.0000133334 }, null, 2), + description: i18n.translate('xpack.observability.apmAWSLambdaPricePerGbSecondsDescription', { + defaultMessage: 'Price per Gb-second.', + }), + schema: schema.object({ + arm: schema.number(), + x86_64: schema.number(), + }), + }, + [apmAWSLambdaRequestCostPerMillion]: { + category: [observabilityFeatureId], + name: i18n.translate('xpack.observability.apmAWSLambdaRequestCostPerMillion', { + defaultMessage: 'AWS lambda price per 1M requests', + }), + value: 0.2, + schema: schema.number({ min: 0 }), + }, [enableCriticalPath]: { category: [observabilityFeatureId], name: i18n.translate('xpack.observability.enableCriticalPath', { diff --git a/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_summary.spec.ts b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_summary.spec.ts index eff5e1127801..223e7a448df4 100644 --- a/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_summary.spec.ts +++ b/x-pack/test/apm_api_integration/tests/metrics/serverless/serverless_summary.spec.ts @@ -57,7 +57,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { await generateData({ start, end, synthtraceEsClient }); }); - // after(() => synthtraceEsClient.clean()); + after(() => synthtraceEsClient.clean()); describe('Python service', () => { let serverlessSummary: APIReturnType<'GET /internal/apm/services/{serviceName}/metrics/serverless/summary'>; From efb8fb11df59370a83b77408ea16e5a362f96057 Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 31 Oct 2022 12:36:03 -0700 Subject: [PATCH 32/87] [babel/node] invalidate cache when synth pkg map is updated (#144258) --- packages/kbn-optimizer/src/node/node_auto_tranpilation.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts index b8ca3de021f2..6aa11a3f7020 100644 --- a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts +++ b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts @@ -41,6 +41,7 @@ import * as babel from '@babel/core'; import { addHook } from 'pirates'; import { REPO_ROOT, UPSTREAM_BRANCH } from '@kbn/utils'; import sourceMapSupport from 'source-map-support'; +import { readHashOfPackageMap } from '@kbn/synthetic-package-map'; import { Cache } from './cache'; @@ -83,6 +84,7 @@ function getBabelOptions(path: string) { */ function determineCachePrefix() { const json = JSON.stringify({ + synthPkgMapHash: readHashOfPackageMap(), babelVersion: babel.version, // get a config for a fake js, ts, and tsx file to make sure we // capture conditional config portions based on the file extension From fda6b27145088232dd75e7fc90cf3aa8a3c20bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Kopyci=C5=84ski?= Date: Mon, 31 Oct 2022 20:53:42 +0100 Subject: [PATCH 33/87] Optimize react-query dependencies (#144206) * Update react-query to ^4.12.0 * cleanup * bump * WIP * WIP * es-query * revert react-use Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/kbn-ui-shared-deps-npm/BUILD.bazel | 2 ++ packages/kbn-ui-shared-deps-npm/webpack.config.js | 2 ++ packages/kbn-ui-shared-deps-src/BUILD.bazel | 1 + packages/kbn-ui-shared-deps-src/src/definitions.js | 3 +++ packages/kbn-ui-shared-deps-src/src/entry.js | 3 +++ 5 files changed, 11 insertions(+) diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index f6406117ada5..fe0e97913fa4 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -43,6 +43,8 @@ RUNTIME_DEPS = [ "@npm//@elastic/numeral", "@npm//@emotion/cache", "@npm//@emotion/react", + "@npm//@tanstack/react-query", + "@npm//@tanstack/react-query-devtools", "@npm//babel-loader", "@npm//core-js", "@npm//css-loader", diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 8f6c2dad5c94..68396a15e371 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -82,6 +82,8 @@ module.exports = (_, argv) => { '@elastic/eui/dist/eui_theme_dark.json', '@elastic/numeral', '@emotion/react', + '@tanstack/react-query', + '@tanstack/react-query-devtools', 'classnames', 'fflate', 'history', diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 6fecff6dc2d2..97006c36eb28 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -42,6 +42,7 @@ RUNTIME_DEPS = [ "//packages/kbn-analytics", "//packages/kbn-babel-preset", "//packages/kbn-datemath", + "//packages/kbn-es-query", "//packages/kbn-flot-charts", "//packages/kbn-i18n", "//packages/kbn-i18n-react", diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index 069b7d82f907..96826b061676 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -74,11 +74,14 @@ const externals = { */ tslib: '__kbnSharedDeps__.TsLib', '@kbn/analytics': '__kbnSharedDeps__.KbnAnalytics', + '@kbn/es-query': '__kbnSharedDeps__.KbnEsQuery', '@kbn/std': '__kbnSharedDeps__.KbnStd', '@kbn/safer-lodash-set': '__kbnSharedDeps__.SaferLodashSet', 'rison-node': '__kbnSharedDeps__.RisonNode', history: '__kbnSharedDeps__.History', classnames: '__kbnSharedDeps__.Classnames', + '@tanstack/react-query': '__kbnSharedDeps__.ReactQuery', + '@tanstack/react-query-devtools': '__kbnSharedDeps__.ReactQueryDevtools', }; module.exports = { distDir, jsFilename, cssDistFilename, externals }; diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index 233872bacff5..c7c8f5e95342 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -54,8 +54,11 @@ export const Fflate = { unzlibSync, strFromU8 }; // runtime deps which don't need to be copied across all bundles export const TsLib = require('tslib'); export const KbnAnalytics = require('@kbn/analytics'); +export const KbnEsQuery = require('@kbn/es-query'); export const KbnStd = require('@kbn/std'); export const SaferLodashSet = require('@kbn/safer-lodash-set'); export const RisonNode = require('rison-node'); export const History = require('history'); export const Classnames = require('classnames'); +export const ReactQuery = require('@tanstack/react-query'); +export const ReactQueryDevtools = require('@tanstack/react-query-devtools'); From f876dc6a2dbff56d648722da253de052c759a175 Mon Sep 17 00:00:00 2001 From: Luke Gmys Date: Mon, 31 Oct 2022 20:55:56 +0100 Subject: [PATCH 34/87] [TIP] Use search strategies in Threat Intelligence (#143267) [TIP] Use search strategies in Threat Intelligence --- .../threat_intelligence/common/constants.ts | 18 +++ .../indicators => common}/types/indicator.ts | 0 .../plugins/threat_intelligence/kibana.json | 2 +- .../public/common/utils/dates.test.ts | 35 +----- .../public/common/utils/dates.tsx | 18 --- .../field_selector/field_selector.stories.tsx | 2 +- .../field_selector/field_selector.tsx | 2 +- .../components/barchart/wrapper.stories.tsx | 5 +- .../components/barchart/wrapper.tsx | 2 +- .../components/field_label/field_label.tsx | 2 +- .../components/field_value/field.stories.tsx | 2 +- .../components/field_value/field.test.tsx | 5 +- .../components/field_value/field_value.tsx | 2 +- .../fields_table/fields_table.stories.tsx | 2 +- .../flyout/fields_table/fields_table.tsx | 2 +- .../components/flyout/flyout.stories.tsx | 2 +- .../components/flyout/flyout.test.tsx | 2 +- .../indicators/components/flyout/flyout.tsx | 2 +- .../indicator_value_actions.tsx | 2 +- .../flyout/json_tab/json_tab.stories.tsx | 2 +- .../flyout/json_tab/json_tab.test.tsx | 2 +- .../components/flyout/json_tab/json_tab.tsx | 2 +- .../overview_tab/block/block.stories.tsx | 2 +- .../flyout/overview_tab/block/block.tsx | 2 +- .../highlighted_values_table.tsx | 2 +- .../overview_tab/overview_tab.stories.tsx | 2 +- .../flyout/overview_tab/overview_tab.test.tsx | 2 +- .../flyout/overview_tab/overview_tab.tsx | 2 +- .../flyout/table_tab/table_tab.stories.tsx | 2 +- .../flyout/table_tab/table_tab.test.tsx | 6 +- .../components/flyout/table_tab/table_tab.tsx | 2 +- .../table/components/actions_row_cell.tsx | 2 +- .../table/components/cell_actions.tsx | 2 +- .../components/cell_popover_renderer.tsx | 2 +- .../table/components/cell_renderer.tsx | 2 +- .../open_flyout_button.stories.tsx | 2 +- .../open_flyout_button.test.tsx | 2 +- .../open_flyout_button/open_flyout_button.tsx | 2 +- .../components/table/contexts/context.ts | 2 +- .../table/hooks/use_column_settings.ts | 2 +- .../components/table/table.stories.tsx | 2 +- .../components/table/table.test.tsx | 2 +- .../indicators/components/table/table.tsx | 2 +- .../hooks/use_aggregated_indicators.ts | 2 +- .../indicators/hooks/use_indicators.ts | 2 +- .../hooks/use_sourcerer_data_view.ts | 2 +- .../public/modules/indicators/index.ts | 1 - .../fetch_aggregated_indicators.test.ts | 36 +----- .../services/fetch_aggregated_indicators.ts | 45 +++---- .../services/fetch_indicators.test.ts | 6 +- .../indicators/services/fetch_indicators.ts | 7 +- .../indicators/utils/field_value.test.ts | 5 +- .../modules/indicators/utils/field_value.ts | 2 +- .../utils/get_indicator_query_params.ts | 19 +-- .../public/modules/indicators/utils/index.ts | 2 - .../public/modules/indicators/utils/search.ts | 6 +- .../indicators/utils/unwrap_value.test.ts | 2 +- .../modules/indicators/utils/unwrap_value.ts | 2 +- .../filter_in/filter_in.stories.tsx | 3 +- .../components/filter_in/filter_in.test.tsx | 3 +- .../components/filter_in/filter_in.tsx | 2 +- .../filter_out/filter_out.stories.tsx | 3 +- .../components/filter_out/filter_out.test.tsx | 3 +- .../components/filter_out/filter_out.tsx | 2 +- .../query_bar/hooks/use_filter_in_out.test.ts | 6 +- .../query_bar/hooks/use_filter_in_out.ts | 2 +- .../add_to_timeline.stories.tsx | 2 +- .../add_to_timeline/add_to_timeline.test.tsx | 2 +- .../add_to_timeline/add_to_timeline.tsx | 3 +- .../investigate_in_timeline.stories.tsx | 2 +- .../investigate_in_timeline.test.tsx | 6 +- .../investigate_in_timeline.tsx | 2 +- .../hooks/use_add_to_timeline.test.tsx | 6 +- .../timeline/hooks/use_add_to_timeline.ts | 3 +- .../use_investigate_in_timeline.test.tsx | 6 +- .../hooks/use_investigate_in_timeline.ts | 6 +- .../indicators/types => server}/index.ts | 7 +- .../threat_intelligence/server/plugin.ts | 54 +++++++++ .../server/search_strategy.ts | 110 ++++++++++++++++++ .../threat_intelligence/server/types.ts | 32 +++++ .../calculate_barchart_time_interval.test.ts | 39 +++++++ .../utils/calculate_barchart_time_interval.ts | 27 +++++ .../utils/get_indicator_query_params.ts | 27 +++++ .../utils/get_runtime_mappings.ts | 2 +- .../utils/indicator_name.test.ts} | 2 +- .../utils/indicator_name.ts} | 2 +- .../plugins/threat_intelligence/tsconfig.json | 3 + 87 files changed, 454 insertions(+), 211 deletions(-) create mode 100644 x-pack/plugins/threat_intelligence/common/constants.ts rename x-pack/plugins/threat_intelligence/{public/modules/indicators => common}/types/indicator.ts (100%) rename x-pack/plugins/threat_intelligence/{public/modules/indicators/types => server}/index.ts (52%) create mode 100644 x-pack/plugins/threat_intelligence/server/plugin.ts create mode 100644 x-pack/plugins/threat_intelligence/server/search_strategy.ts create mode 100644 x-pack/plugins/threat_intelligence/server/types.ts create mode 100644 x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts create mode 100644 x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts create mode 100644 x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts rename x-pack/plugins/threat_intelligence/{public/modules/indicators => server}/utils/get_runtime_mappings.ts (95%) rename x-pack/plugins/threat_intelligence/{public/modules/indicators/utils/display_name.test.ts => server/utils/indicator_name.test.ts} (99%) rename x-pack/plugins/threat_intelligence/{public/modules/indicators/utils/display_name.ts => server/utils/indicator_name.ts} (98%) diff --git a/x-pack/plugins/threat_intelligence/common/constants.ts b/x-pack/plugins/threat_intelligence/common/constants.ts new file mode 100644 index 000000000000..e5aa41d8ad2f --- /dev/null +++ b/x-pack/plugins/threat_intelligence/common/constants.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. + */ + +export const THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME = 'threatIntelligenceSearchStrategy'; + +export const BARCHART_AGGREGATION_NAME = 'barchartAggregation'; + +/** + * Used inside custom search strategy + */ +export const enum FactoryQueryType { + IndicatorGrid = 'indicatorGrid', + Barchart = 'barchart', +} diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts b/x-pack/plugins/threat_intelligence/common/types/indicator.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/types/indicator.ts rename to x-pack/plugins/threat_intelligence/common/types/indicator.ts diff --git a/x-pack/plugins/threat_intelligence/kibana.json b/x-pack/plugins/threat_intelligence/kibana.json index c640782b90f3..16fcf4eeb5c4 100644 --- a/x-pack/plugins/threat_intelligence/kibana.json +++ b/x-pack/plugins/threat_intelligence/kibana.json @@ -3,7 +3,7 @@ "version": "1.0.0", "kibanaVersion": "kibana", "ui": true, - "server": false, + "server": true, "owner": { "name": "Protections Experience Team", "githubTeam": "protections-experience" diff --git a/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts b/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts index 0fba6d4088de..3f8882a29c98 100644 --- a/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts +++ b/x-pack/plugins/threat_intelligence/public/common/utils/dates.test.ts @@ -7,12 +7,7 @@ import moment from 'moment-timezone'; import { TimeRangeBounds } from '@kbn/data-plugin/common'; -import { - barChartTimeAxisLabelFormatter, - calculateBarchartColumnTimeInterval, - dateFormatter, - getDateDifferenceInDays, -} from './dates'; +import { dateFormatter, getDateDifferenceInDays, barChartTimeAxisLabelFormatter } from './dates'; import { EMPTY_VALUE } from '../constants'; const mockValidStringDate = '1 Jan 2022 00:00:00 GMT'; @@ -88,32 +83,4 @@ describe('dates', () => { expect(typeof barChartTimeAxisLabelFormatter(dateRange)).toBe('function'); }); }); - - describe('calculateBarchartTimeInterval', () => { - it('should handle number dates', () => { - const from = moment(mockValidStringDate).valueOf(); - const to = moment(mockValidStringDate).add(1, 'days').valueOf(); - - const interval = calculateBarchartColumnTimeInterval(from, to); - expect(interval).toContain('ms'); - expect(parseInt(interval, 10) > 0).toBeTruthy(); - }); - - it('should handle moment dates', () => { - const from = moment(mockValidStringDate); - const to = moment(mockValidStringDate).add(1, 'days'); - - const interval = calculateBarchartColumnTimeInterval(from, to); - expect(interval).toContain('ms'); - expect(parseInt(interval, 10) > 0).toBeTruthy(); - }); - - it('should handle dateTo older than dateFrom', () => { - const from = moment(mockValidStringDate).add(1, 'days'); - const to = moment(mockValidStringDate); - - const interval = calculateBarchartColumnTimeInterval(from, to); - expect(parseInt(interval, 10) > 0).toBeFalsy(); - }); - }); }); diff --git a/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx b/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx index 8adb49b3e95a..2f5ab5d4c07e 100644 --- a/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx +++ b/x-pack/plugins/threat_intelligence/public/common/utils/dates.tsx @@ -14,7 +14,6 @@ import { EMPTY_VALUE } from '../constants'; moment.suppressDeprecationWarnings = true; export const FULL_DATE = 'MMMM Do YYYY @ HH:mm:ss'; -export const BARCHART_NUMBER_OF_COLUMNS = 16; /** * Converts a string or moment date to the 'MMMM Do YYYY @ HH:mm:ss' format. @@ -62,20 +61,3 @@ export const barChartTimeAxisLabelFormatter = (dateRange: TimeRangeBounds): Tick const format = niceTimeFormatByDay(diff); return timeFormatter(format); }; - -/** - * Calculates the time interval in ms for a specific number of columns - * @param dateFrom Min (older) date for the barchart - * @param dateTo Max (newer) date for the barchart - * @param numberOfColumns Desired number of columns (defaulted to {@link BARCHART_NUMBER_OF_COLUMNS}) - * @returns The interval in ms for a column (for example '100000ms') - */ -export const calculateBarchartColumnTimeInterval = ( - dateFrom: number | moment.Moment, - dateTo: number | moment.Moment, - numberOfColumns = BARCHART_NUMBER_OF_COLUMNS -): string => { - const from: number = moment.isMoment(dateFrom) ? dateFrom.valueOf() : dateFrom; - const to: number = moment.isMoment(dateTo) ? dateTo.valueOf() : dateTo; - return `${Math.floor(moment(to).diff(moment(from)) / numberOfColumns)}ms`; -}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx index 792e31ce109f..e58dc9a7dcc8 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; -import { RawIndicatorFieldId } from '../../../types'; +import { RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { IndicatorsFieldSelector } from '.'; const mockIndexPattern: DataView = { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx index 29af51472bd1..2707ba250784 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector/field_selector.tsx @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { DataViewField } from '@kbn/data-views-plugin/common'; import { EuiComboBoxOptionOption } from '@elastic/eui/src/components/combo_box/types'; import { SecuritySolutionDataViewBase } from '../../../../../types'; -import { RawIndicatorFieldId } from '../../../types'; +import { RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { useStyles } from './styles'; export const DROPDOWN_TEST_ID = 'tiIndicatorFieldSelectorDropdown'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx index 472bc7934bab..30170d50ca26 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx @@ -14,10 +14,11 @@ import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import { TimeRange } from '@kbn/es-query'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { IUiSettingsClient } from '@kbn/core/public'; +import { BARCHART_AGGREGATION_NAME } from '../../../../../common/constants'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; import { mockKibanaTimelinesService } from '../../../../common/mocks/mock_kibana_timelines_service'; import { IndicatorsBarChartWrapper } from '.'; -import { Aggregation, AGGREGATION_NAME, ChartSeries } from '../../services'; +import { Aggregation, ChartSeries } from '../../services'; export default { component: IndicatorsBarChartWrapper, @@ -84,7 +85,7 @@ const dataServiceMock = { of({ rawResponse: { aggregations: { - [AGGREGATION_NAME]: { + [BARCHART_AGGREGATION_NAME]: { buckets: [aggregation1, aggregation2], }, }, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx index 6df40e315009..57ec76d17bd4 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx @@ -18,7 +18,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { TimeRange } from '@kbn/es-query'; import { TimeRangeBounds } from '@kbn/data-plugin/common'; import { SecuritySolutionDataViewBase } from '../../../../types'; -import { RawIndicatorFieldId } from '../../types'; +import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { IndicatorsFieldSelector } from './field_selector'; import { IndicatorsBarChart } from './barchart'; import { ChartSeries } from '../../services'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx index cf55e5ad9c80..64e85bc8c5d7 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_label/field_label.tsx @@ -7,7 +7,7 @@ import React, { VFC } from 'react'; import { i18n } from '@kbn/i18n'; -import { RawIndicatorFieldId } from '../../types'; +import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; interface IndicatorFieldLabelProps { field: string; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx index b652ebe92e9f..da56583404a1 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; -import { generateMockIndicator } from '../../types'; +import { generateMockIndicator } from '../../../../../common/types/indicator'; import { IndicatorFieldValue } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx index c18d0caa5a6e..94751080fa00 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field.test.tsx @@ -8,7 +8,10 @@ import React from 'react'; import { render } from '@testing-library/react'; import { IndicatorFieldValue } from '.'; -import { generateMockIndicator, generateMockIndicatorWithTlp } from '../../types'; +import { + generateMockIndicator, + generateMockIndicatorWithTlp, +} from '../../../../../common/types/indicator'; import { EMPTY_VALUE } from '../../../../common/constants'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx index 00e52cd68baf..ff3d09fe4590 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/field_value/field_value.tsx @@ -8,7 +8,7 @@ import React, { VFC } from 'react'; import { useFieldTypes } from '../../../../hooks'; import { EMPTY_VALUE } from '../../../../common/constants'; -import { Indicator, RawIndicatorFieldId } from '../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { DateFormatter } from '../../../../components/date_formatter'; import { unwrapValue } from '../../utils'; import { TLPBadge } from '../tlp_badge'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx index 7cb9254351be..80bd24d59adc 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mockIndicatorsFiltersContext } from '../../../../../common/mocks/mock_indicators_filters_context'; import { IndicatorFieldsTable } from '.'; -import { generateMockIndicator } from '../../../types'; +import { generateMockIndicator } from '../../../../../../common/types/indicator'; import { StoryProvidersComponent } from '../../../../../common/mocks/story_providers'; import { IndicatorsFiltersContext } from '../../../containers/filters'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx index e5d89910dca3..3fe1f6259905 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table/fields_table.tsx @@ -8,7 +8,7 @@ import { EuiBasicTableColumn, EuiInMemoryTable, EuiInMemoryTableProps } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, VFC } from 'react'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorFieldValue } from '../../field_value'; import { IndicatorValueActions } from '../indicator_value_actions'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx index 80b75a605ccc..b23dfca2e61d 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; -import { generateMockIndicator, Indicator } from '../../types'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { IndicatorsFlyout } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx index fab9d2ed6d46..a50cf08b3f2b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { cleanup, render, screen } from '@testing-library/react'; import { IndicatorsFlyout, SUBTITLE_TEST_ID, TITLE_TEST_ID } from '.'; -import { generateMockIndicator, Indicator } from '../../types'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; const mockIndicator = generateMockIndicator(); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx index 97c5592b05e4..485ba92f6193 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx @@ -23,7 +23,7 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { InvestigateInTimelineButton } from '../../../timeline'; import { DateFormatter } from '../../../../components/date_formatter/date_formatter'; -import { Indicator, RawIndicatorFieldId } from '../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { IndicatorsFlyoutJson } from './json_tab'; import { IndicatorsFlyoutTable } from './table_tab'; import { unwrapValue } from '../../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx index e64592cbea07..4d4f1d94d84e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions/indicator_value_actions.tsx @@ -14,7 +14,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { FilterInButtonIcon, FilterOutButtonIcon } from '../../../../query_bar'; import { AddToTimelineContextMenu } from '../../../../timeline'; import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx index 9ae8576c8706..8d2eead239f4 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { Story } from '@storybook/react'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutJson } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx index 496e362c1a38..d56b328c6159 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { TestProvidersComponent } from '../../../../../common/mocks/test_providers'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { CODE_BLOCK_TEST_ID, IndicatorsFlyoutJson } from '.'; import { EMPTY_PROMPT_TEST_ID } from '../empty_prompt'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx index b3791edc5b9f..f7dc6ad59de0 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab/json_tab.tsx @@ -7,7 +7,7 @@ import React, { VFC } from 'react'; import { EuiCodeBlock } from '@elastic/eui'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorEmptyPrompt } from '../empty_prompt'; export const CODE_BLOCK_TEST_ID = 'tiFlyoutJsonCodeBlock'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx index 0a0db7b11492..0ae9c8b962d9 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { IndicatorsFiltersContext } from '../../../../containers/filters'; import { StoryProvidersComponent } from '../../../../../../common/mocks/story_providers'; -import { generateMockIndicator } from '../../../../types'; +import { generateMockIndicator } from '../../../../../../../common/types/indicator'; import { IndicatorBlock } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx index 48ac9867181b..3baa182530b8 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/block/block.tsx @@ -8,7 +8,7 @@ import { EuiPanel, EuiSpacer, EuiText } from '@elastic/eui'; import React, { VFC } from 'react'; import { css, euiStyled } from '@kbn/kibana-react-plugin/common'; -import { Indicator } from '../../../../types'; +import { Indicator } from '../../../../../../../common/types/indicator'; import { IndicatorFieldValue } from '../../../field_value'; import { IndicatorFieldLabel } from '../../../field_label'; import { IndicatorValueActions } from '../../indicator_value_actions'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx index 193e550fc401..5c60ed4684d9 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/highlighted_values_table/highlighted_values_table.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo, VFC } from 'react'; -import { Indicator, RawIndicatorFieldId } from '../../../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../../../common/types/indicator'; import { unwrapValue } from '../../../../utils'; import { IndicatorFieldsTable } from '../../fields_table'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx index 3b1c57b19c73..4c74ea25330d 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { StoryProvidersComponent } from '../../../../../common/mocks/story_providers'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutOverview } from '.'; import { IndicatorsFiltersContext } from '../../../containers/filters'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx index 94bdba9ea06f..df4201761a98 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.test.tsx @@ -8,7 +8,7 @@ import { TestProvidersComponent } from '../../../../../common/mocks/test_providers'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutOverview, TI_FLYOUT_OVERVIEW_HIGH_LEVEL_BLOCKS, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx index def4049aeee5..2c3e6dee5ffc 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab/overview_tab.tsx @@ -17,7 +17,7 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, VFC } from 'react'; import { EMPTY_VALUE } from '../../../../../common/constants'; -import { Indicator, RawIndicatorFieldId } from '../../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { unwrapValue } from '../../../utils'; import { IndicatorEmptyPrompt } from '../empty_prompt'; import { IndicatorBlock } from './block'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx index a8cea2e06ca2..1842d52171db 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.stories.tsx @@ -12,7 +12,7 @@ import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { mockIndicatorsFiltersContext } from '../../../../../common/mocks/mock_indicators_filters_context'; import { mockUiSettingsService } from '../../../../../common/mocks/mock_kibana_ui_settings_service'; import { mockKibanaTimelinesService } from '../../../../../common/mocks/mock_kibana_timelines_service'; -import { generateMockIndicator, Indicator } from '../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutTable } from '.'; import { IndicatorsFiltersContext } from '../../../containers/filters'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx index c70232da887f..aae9aa41cbf2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.test.tsx @@ -8,7 +8,11 @@ import React from 'react'; import { render } from '@testing-library/react'; import { TestProvidersComponent } from '../../../../../common/mocks/test_providers'; -import { generateMockIndicator, Indicator, RawIndicatorFieldId } from '../../../types'; +import { + generateMockIndicator, + Indicator, + RawIndicatorFieldId, +} from '../../../../../../common/types/indicator'; import { IndicatorsFlyoutTable, TABLE_TEST_ID } from '.'; import { unwrapValue } from '../../../utils'; import { EMPTY_PROMPT_TEST_ID } from '../empty_prompt'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx index 5c152684f0fa..0f0a699733cc 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab/table_tab.tsx @@ -6,7 +6,7 @@ */ import React, { VFC } from 'react'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorEmptyPrompt } from '../empty_prompt'; import { IndicatorFieldsTable } from '../fields_table'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx index 05b4f5b64c26..e8a58f279766 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx @@ -8,7 +8,7 @@ import React, { useContext, VFC } from 'react'; import { EuiFlexGroup } from '@elastic/eui'; import { InvestigateInTimelineButtonIcon } from '../../../../timeline'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { OpenIndicatorFlyoutButton } from './open_flyout_button'; import { IndicatorsTableContext } from '../contexts'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx index 8342a013bb11..2f606df1a8f1 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx @@ -7,7 +7,7 @@ import React, { VFC } from 'react'; import { EuiDataGridColumnCellActionProps } from '@elastic/eui/src/components/datagrid/data_grid_types'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { AddToTimelineCellAction } from '../../../../timeline'; import { FilterInCellAction, FilterOutCellAction } from '../../../../query_bar'; import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx index 95067ce87bc1..eba86eb4e8c3 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_popover_renderer.tsx @@ -16,7 +16,7 @@ import { CopyToClipboardButtonEmpty } from '../../copy_to_clipboard/copy_to_clip import { FilterInButtonEmpty, FilterOutButtonEmpty } from '../../../../query_bar'; import { AddToTimelineButtonEmpty } from '../../../../timeline'; import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../utils/field_value'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { Pagination } from '../../../services/fetch_indicators'; import { useStyles } from './styles'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx index d4aa529f5dfc..7a33c4d21dde 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx @@ -9,7 +9,7 @@ import { EuiDataGridCellValueElementProps } from '@elastic/eui'; import React, { useContext, useEffect } from 'react'; import { euiDarkVars as themeDark, euiLightVars as themeLight } from '@kbn/ui-theme'; import { useKibana } from '../../../../../hooks'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; import { IndicatorFieldValue } from '../../field_value'; import { IndicatorsTableContext } from '../contexts'; import { ActionsRowCell } from '.'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx index e7f62b73042d..d0bcec7068c2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { ComponentStory } from '@storybook/react'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { mockUiSettingsService } from '../../../../../../common/mocks/mock_kibana_ui_settings_service'; -import { generateMockIndicator, Indicator } from '../../../../types'; +import { generateMockIndicator, Indicator } from '../../../../../../../common/types/indicator'; import { OpenIndicatorFlyoutButton } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx index fe3fcca21129..f68be6d7ea55 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { BUTTON_TEST_ID, OpenIndicatorFlyoutButton } from '.'; -import { generateMockIndicator } from '../../../../types'; +import { generateMockIndicator } from '../../../../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../../../../common/mocks/test_providers'; const mockIndicator = generateMockIndicator(); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx index dee079463f05..7ae0584447a5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx @@ -8,7 +8,7 @@ import React, { VFC } from 'react'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Indicator } from '../../../../types'; +import { Indicator } from '../../../../../../../common/types/indicator'; export const BUTTON_TEST_ID = 'tiToggleIndicatorFlyoutButton'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts index 9bb89968c75a..e0125544a645 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts @@ -6,7 +6,7 @@ */ import { createContext, Dispatch, SetStateAction } from 'react'; -import { Indicator } from '../../../types'; +import { Indicator } from '../../../../../../common/types/indicator'; export interface IndicatorsTableContextValue { expanded: Indicator | undefined; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts index 680661f04d41..33f73922a3aa 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts @@ -8,7 +8,7 @@ import { EuiDataGridColumn, EuiDataGridSorting } from '@elastic/eui'; import { useCallback, useEffect, useMemo, useState } from 'react'; import negate from 'lodash/negate'; -import { RawIndicatorFieldId } from '../../../types'; +import { RawIndicatorFieldId } from '../../../../../../common/types/indicator'; import { useKibana } from '../../../../../hooks'; import { translateFieldLabel } from '../../field_label'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx index a4eccb880f6c..4822d403e3f4 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { DataView } from '@kbn/data-views-plugin/common'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; -import { generateMockIndicator, Indicator } from '../../types'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { IndicatorsTable } from '.'; import { IndicatorsFiltersContext } from '../../containers/filters/context'; import { DEFAULT_COLUMNS } from './hooks'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx index af28ac88a4d4..2d51a75cd2c8 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx @@ -9,7 +9,7 @@ import { act, render, screen } from '@testing-library/react'; import React from 'react'; import { IndicatorsTable, IndicatorsTableProps, TABLE_UPDATE_PROGRESS_TEST_ID } from '.'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; -import { generateMockIndicator, Indicator } from '../../types'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { BUTTON_TEST_ID } from './components/open_flyout_button'; import { TITLE_TEST_ID } from '../flyout'; import { SecuritySolutionDataViewBase } from '../../../../types'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx index 62e142075305..d27aaf0ea233 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx @@ -21,7 +21,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDataGridColumn } from '@elastic/eui/src/components/datagrid/data_grid_types'; import { CellActions, cellPopoverRendererFactory, cellRendererFactory } from './components'; import { BrowserFields, SecuritySolutionDataViewBase } from '../../../../types'; -import { Indicator, RawIndicatorFieldId } from '../../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { EmptyState } from '../../../../components/empty_state'; import { IndicatorsTableContext, IndicatorsTableContextValue } from './contexts'; import { IndicatorsFlyout } from '../flyout'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts index 52f7c01cac73..bdfd9fafa77e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts @@ -10,7 +10,7 @@ import { Filter, Query, TimeRange } from '@kbn/es-query'; import { useMemo, useState } from 'react'; import { TimeRangeBounds } from '@kbn/data-plugin/common'; import { useInspector, useKibana } from '../../../hooks'; -import { RawIndicatorFieldId } from '../types'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; import { useSourcererDataView } from '.'; import { ChartSeries, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts index 399254fe7568..3011d9b5101f 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts @@ -10,7 +10,7 @@ import { Filter, Query, TimeRange } from '@kbn/es-query'; import { useQuery } from '@tanstack/react-query'; import { EuiDataGridSorting } from '@elastic/eui'; import { useInspector, useKibana } from '../../../hooks'; -import { Indicator } from '../types'; +import { Indicator } from '../../../../common/types/indicator'; import { useSourcererDataView } from './use_sourcerer_data_view'; import { createFetchIndicators, FetchParams, Pagination } from '../services/fetch_indicators'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts index 5128f47ee1a7..94e8c7a489fe 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts @@ -7,7 +7,7 @@ import { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { RawIndicatorFieldId } from '../types'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; import { SecuritySolutionDataViewBase } from '../../../types'; import { useSecurityContext } from '../../../hooks/use_security_context'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts index a88503e53cc7..73affbb6e8a6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/index.ts @@ -11,4 +11,3 @@ export * from './hooks/use_sourcerer_data_view'; export * from './hooks/use_total_count'; export * from './utils/field_value'; export * from './utils/unwrap_value'; -export * from './types/indicator'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts index 007623943c53..45190d813714 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts @@ -8,15 +8,11 @@ import { mockedQueryService, mockedSearchService } from '../../../common/mocks/test_providers'; import { BehaviorSubject, throwError } from 'rxjs'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { - Aggregation, - AGGREGATION_NAME, - convertAggregationToChartSeries, - createFetchAggregatedIndicators, -} from '.'; +import { Aggregation, convertAggregationToChartSeries, createFetchAggregatedIndicators } from '.'; +import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../../../../common/constants'; const aggregationResponse = { - rawResponse: { aggregations: { [AGGREGATION_NAME]: { buckets: [] } } }, + rawResponse: { aggregations: { [BARCHART_AGGREGATION_NAME]: { buckets: [] } } }, }; const aggregation1: Aggregation = { @@ -88,33 +84,13 @@ describe('FetchAggregatedIndicatorsService', () => { expect.objectContaining({ params: expect.objectContaining({ body: expect.objectContaining({ - size: 0, query: expect.objectContaining({ bool: expect.anything() }), - runtime_mappings: { - 'threat.indicator.name': { script: expect.anything(), type: 'keyword' }, - 'threat.indicator.name_origin': { script: expect.anything(), type: 'keyword' }, - }, - aggregations: { - [AGGREGATION_NAME]: { - terms: { - field: 'myField', - }, - aggs: { - events: { - date_histogram: { - field: '@timestamp', - fixed_interval: expect.anything(), - min_doc_count: 0, - extended_bounds: expect.anything(), - }, - }, - }, - }, - }, - fields: ['@timestamp', 'myField'], }), index: [], }), + factoryQueryType: FactoryQueryType.Barchart, + dateRange: expect.anything(), + field: 'myField', }), expect.anything() ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts index f64b0eb7a668..88f880122e42 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts @@ -9,14 +9,13 @@ import { TimeRangeBounds } from '@kbn/data-plugin/common'; import type { ISearchStart, QueryStart } from '@kbn/data-plugin/public'; import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { calculateBarchartColumnTimeInterval } from '../../../common/utils/dates'; -import { RawIndicatorFieldId } from '../types'; -import { getIndicatorQueryParams, search } from '../utils'; +import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../../../../common/constants'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; +import { search } from '../utils/search'; +import { getIndicatorQueryParams } from '../utils/get_indicator_query_params'; const TIMESTAMP_FIELD = RawIndicatorFieldId.TimeStamp; -export const AGGREGATION_NAME = 'barchartAggregation'; - export interface AggregationValue { doc_count: number; key: number; @@ -33,7 +32,7 @@ export interface Aggregation { export interface RawAggregatedIndicatorsResponse { aggregations: { - [AGGREGATION_NAME]: { + [BARCHART_AGGREGATION_NAME]: { buckets: Aggregation[]; }; }; @@ -90,45 +89,33 @@ export const createFetchAggregatedIndicators = const dateFrom: number = (dateRange.min as moment.Moment).toDate().getTime(); const dateTo: number = (dateRange.max as moment.Moment).toDate().getTime(); - const interval = calculateBarchartColumnTimeInterval(dateFrom, dateTo); const sharedParams = getIndicatorQueryParams({ timeRange, filters, filterQuery }); const searchRequestBody = { - aggregations: { - [AGGREGATION_NAME]: { - terms: { - field, - }, - aggs: { - events: { - date_histogram: { - field: TIMESTAMP_FIELD, - fixed_interval: interval, - min_doc_count: 0, - extended_bounds: { - min: dateFrom, - max: dateTo, - }, - }, - }, - }, - }, - }, fields: [TIMESTAMP_FIELD, field], size: 0, ...sharedParams, }; const { - aggregations: { [AGGREGATION_NAME]: aggregation }, - } = await search( + aggregations: { [BARCHART_AGGREGATION_NAME]: aggregation }, + } = await search< + RawAggregatedIndicatorsResponse, + { dateRange: { from: number; to: number }; field: string } + >( searchService, { params: { index: selectedPatterns, body: searchRequestBody, }, + factoryQueryType: FactoryQueryType.Barchart, + dateRange: { + from: dateFrom, + to: dateTo, + }, + field, }, { signal, inspectorAdapter, requestName: 'Indicators barchart' } ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts index 388b1c9c9e7c..73cde89df4c7 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts @@ -9,6 +9,7 @@ import { mockedSearchService } from '../../../common/mocks/test_providers'; import { BehaviorSubject, throwError } from 'rxjs'; import { createFetchIndicators } from './fetch_indicators'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; +import { FactoryQueryType } from '../../../../common/constants'; const indicatorsResponse = { rawResponse: { hits: { hits: [], total: 0 } } }; @@ -47,15 +48,12 @@ describe('FetchIndicatorsService', () => { fields: [{ field: '*', include_unmapped: true }], from: 0, query: expect.objectContaining({ bool: expect.anything() }), - runtime_mappings: { - 'threat.indicator.name': { script: expect.anything(), type: 'keyword' }, - 'threat.indicator.name_origin': { script: expect.anything(), type: 'keyword' }, - }, size: 25, sort: [], }, index: [], }, + factoryQueryType: FactoryQueryType.IndicatorGrid, }), expect.anything() ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts index 0bdd5c52f413..c8dfd374920c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts @@ -8,8 +8,10 @@ import { ISearchStart } from '@kbn/data-plugin/public'; import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; -import { Indicator } from '../types'; -import { getIndicatorQueryParams, search } from '../utils'; +import { FactoryQueryType } from '../../../../common/constants'; +import { Indicator } from '../../../../common/types/indicator'; +import { getIndicatorQueryParams } from '../utils/get_indicator_query_params'; +import { search } from '../utils/search'; export interface RawIndicatorsResponse { hits: { @@ -75,6 +77,7 @@ export const createFetchIndicators = index: selectedPatterns, body: searchRequestBody, }, + factoryQueryType: FactoryQueryType.IndicatorGrid, }, { inspectorAdapter, requestName: 'Indicators table', signal } ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts index 8c38d8595533..6bdbca5b5187 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts @@ -6,7 +6,10 @@ */ import { fieldAndValueValid, getIndicatorFieldAndValue } from './field_value'; -import { generateMockFileIndicator, generateMockUrlIndicator } from '../types'; +import { + generateMockFileIndicator, + generateMockUrlIndicator, +} from '../../../../common/types/indicator'; import { EMPTY_VALUE } from '../../../common/constants'; describe('field_value', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts index 5756248a61f5..1211ebb48ffb 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts @@ -7,7 +7,7 @@ import { EMPTY_VALUE } from '../../../common/constants'; import { unwrapValue } from './unwrap_value'; -import { Indicator, RawIndicatorFieldId } from '../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../common/types/indicator'; /** * Retrieves a field/value pair from an Indicator diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts index cdf4e846c2ca..4bd091195fd6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts @@ -7,13 +7,12 @@ import { buildEsQuery, Filter, Query, TimeRange } from '@kbn/es-query'; import { THREAT_QUERY_BASE } from '../../../common/constants'; -import { RawIndicatorFieldId } from '..'; -import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './display_name'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; const TIMESTAMP_FIELD = RawIndicatorFieldId.TimeStamp; /** - * Prepare shared `runtime_mappings` and `query` fields used within indicator search request + * Prepare shared `query` fields used within indicator search request */ export const getIndicatorQueryParams = ({ filters, @@ -25,20 +24,6 @@ export const getIndicatorQueryParams = ({ timeRange?: TimeRange; }) => { return { - runtime_mappings: { - [RawIndicatorFieldId.Name]: { - type: 'keyword', - script: { - source: threatIndicatorNamesScript(), - }, - }, - [RawIndicatorFieldId.NameOrigin]: { - type: 'keyword', - script: { - source: threatIndicatorNamesOriginScript(), - }, - }, - } as const, query: buildEsQuery( undefined, [ diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts index 9a542d2960bd..04ca3df2a509 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/index.ts @@ -5,10 +5,8 @@ * 2.0. */ -export * from './display_name'; export * from './field_value'; export * from './get_field_schema'; export * from './get_indicator_query_params'; -export * from './get_runtime_mappings'; export * from './search'; export * from './unwrap_value'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts index 49cd371680ce..92ede2d4f3d9 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/search.ts @@ -13,6 +13,7 @@ import { } from '@kbn/data-plugin/common'; import { ISearchStart } from '@kbn/data-plugin/public'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; +import { THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME } from '../../../../common/constants'; interface SearchOptions { /** @@ -35,9 +36,9 @@ interface SearchOptions { * This is a searchService wrapper that will instrument your query with `inspector` and turn it into a Promise, * resolved when complete result set is returned or rejected on any error, other than Abort. */ -export const search = async ( +export const search = async ( searchService: ISearchStart, - searchRequest: IEsSearchRequest, + searchRequest: IEsSearchRequest & { factoryQueryType: string } & T, { inspectorAdapter, requestName, signal }: SearchOptions ): Promise => { const requestId = `${Date.now()}`; @@ -47,6 +48,7 @@ export const search = async ( searchService .search>(searchRequest, { abortSignal: signal, + strategy: THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME, }) .subscribe({ next: (response) => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts index 85d2e9b14787..8edb6b539720 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { RawIndicatorFieldId } from '../types'; +import { RawIndicatorFieldId } from '../../../../common/types/indicator'; import { unwrapValue } from './unwrap_value'; describe('unwrapValue()', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts index a79e17c99c49..8d3ef63ec9f0 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Indicator, RawIndicatorFieldId } from '../types'; +import { Indicator, RawIndicatorFieldId } from '../../../../common/types/indicator'; /** * Unpacks field value from raw indicator fields. Will return null if fields are missing entirely diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx index 7ce8a72c1751..6c0619492cac 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.stories.tsx @@ -10,7 +10,8 @@ import { Story } from '@storybook/react'; import { EuiContextMenuPanel, EuiDataGrid, EuiDataGridColumn } from '@elastic/eui'; import { EuiDataGridColumnVisibility } from '@elastic/eui/src/components/datagrid/data_grid_types'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; -import { generateMockIndicator, Indicator, IndicatorsFiltersContext } from '../../../indicators'; +import { IndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { FilterInButtonIcon, FilterInCellAction, FilterInContextMenu } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx index 9273ea007cb4..0bcb4d0a3358 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.test.tsx @@ -8,7 +8,8 @@ import React, { FunctionComponent } from 'react'; import { render } from '@testing-library/react'; import { EuiButtonIcon } from '@elastic/eui'; -import { generateMockIndicator, Indicator, useIndicatorsFiltersContext } from '../../../indicators'; +import { useIndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; import { FilterInButtonEmpty, diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx index 43fb9d06a79d..f87bb0813249 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in/filter_in.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, EuiButtonIcon, EuiContextMenuItem, EuiToolTip } from '@elastic/eui'; import { useFilterInOut } from '../../hooks'; import { FilterIn } from '../../utils'; -import { Indicator } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; import { useStyles } from './styles'; const ICON_TYPE = 'plusInCircle'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx index 93cba542f898..1585741bfbfa 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.stories.tsx @@ -10,7 +10,8 @@ import { Story } from '@storybook/react'; import { EuiContextMenuPanel, EuiDataGrid, EuiDataGridColumn } from '@elastic/eui'; import { EuiDataGridColumnVisibility } from '@elastic/eui/src/components/datagrid/data_grid_types'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; -import { generateMockIndicator, Indicator, IndicatorsFiltersContext } from '../../../indicators'; +import { IndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { FilterOutButtonIcon, FilterOutCellAction, FilterOutContextMenu } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx index 0f58416a25a8..ff9997960ef8 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.test.tsx @@ -8,7 +8,8 @@ import React, { FunctionComponent } from 'react'; import { render } from '@testing-library/react'; import { EuiButtonIcon } from '@elastic/eui'; -import { generateMockIndicator, Indicator, useIndicatorsFiltersContext } from '../../../indicators'; +import { useIndicatorsFiltersContext } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; import { FilterOutButtonEmpty, diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx index b2ed00a6f0f5..590cee62b1e2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out/filter_out.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, EuiButtonIcon, EuiContextMenuItem, EuiToolTip } from '@elastic/eui'; import { useFilterInOut } from '../../hooks'; import { FilterOut } from '../../utils'; -import { Indicator } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; import { useStyles } from './styles'; const ICON_TYPE = 'minusInCircle'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts index bd301c3b8d7c..369c6758df27 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts @@ -6,7 +6,11 @@ */ import { Renderer, renderHook, RenderHookResult } from '@testing-library/react-hooks'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../common/mocks/test_providers'; import { useFilterInOut, UseFilterInValue } from '.'; import { FilterIn } from '../utils'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts index d869271025d7..d45a5e3dd231 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts @@ -10,9 +10,9 @@ import { Filter } from '@kbn/es-query'; import { fieldAndValueValid, getIndicatorFieldAndValue, - Indicator, useIndicatorsFiltersContext, } from '../../indicators'; +import { Indicator } from '../../../../common/types/indicator'; import { FilterIn, FilterOut, updateFiltersArray } from '../utils'; export interface UseFilterInParam { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx index 2f5cb1707388..eef3b90782f6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.stories.tsx @@ -11,7 +11,7 @@ import { CoreStart } from '@kbn/core/public'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { EuiContextMenuPanel } from '@elastic/eui'; import { mockKibanaTimelinesService } from '../../../../common/mocks/mock_kibana_timelines_service'; -import { generateMockIndicator, Indicator } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { AddToTimelineButtonIcon, AddToTimelineContextMenu } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx index c69336cfa27a..2147987b9e1c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { generateMockIndicator, Indicator } from '../../../indicators'; +import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; import { EMPTY_VALUE } from '../../../../common/constants'; import { AddToTimelineButtonIcon } from '.'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx index 98b46b8cd9e0..d15c06426311 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline/add_to_timeline.tsx @@ -17,7 +17,8 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { generateDataProvider } from '../../utils'; -import { fieldAndValueValid, getIndicatorFieldAndValue, Indicator } from '../../../indicators'; +import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; import { useKibana } from '../../../../hooks'; import { useStyles } from './styles'; import { useAddToTimeline } from '../../hooks'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx index 572675e9d232..08fe4b782c2c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Story } from '@storybook/react'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; -import { generateMockUrlIndicator } from '../../../indicators'; +import { generateMockUrlIndicator } from '../../../../../common/types/indicator'; import { InvestigateInTimelineButton, InvestigateInTimelineButtonIcon } from '.'; export default { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx index c155fba23a0f..81850d049d83 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.test.tsx @@ -7,7 +7,11 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; import { InvestigateInTimelineButton, InvestigateInTimelineButtonIcon } from '.'; import { EMPTY_VALUE } from '../../../../common/constants'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx index 2ded440b80c4..c99c02ac8f8a 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline/investigate_in_timeline.tsx @@ -10,7 +10,7 @@ import { EuiButton, EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useInvestigateInTimeline } from '../../hooks'; -import { Indicator } from '../../../indicators'; +import { Indicator } from '../../../../../common/types/indicator'; const BUTTON_ICON_LABEL: string = i18n.translate( 'xpack.threatIntelligence.timeline.investigateInTimelineButtonIcon', diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx index 94c7914c9869..f77219f7f5c6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx @@ -7,7 +7,11 @@ import { EMPTY_VALUE } from '../../../common/constants'; import { Renderer, renderHook, RenderHookResult } from '@testing-library/react-hooks'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../common/mocks/test_providers'; import { useAddToTimeline, UseAddToTimelineValue } from '.'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts index 0cc0daf1a40d..f23866ac5e3e 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts @@ -8,7 +8,8 @@ import { DataProvider } from '@kbn/timelines-plugin/common'; import { AddToTimelineButtonProps } from '@kbn/timelines-plugin/public'; import { generateDataProvider } from '../utils'; -import { fieldAndValueValid, getIndicatorFieldAndValue, Indicator } from '../../indicators'; +import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../indicators'; +import { Indicator } from '../../../../common/types/indicator'; export interface UseAddToTimelineParam { /** diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx index 661d8188eb87..b8c45e209520 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx @@ -7,7 +7,11 @@ import { Renderer, renderHook, RenderHookResult } from '@testing-library/react-hooks'; import { useInvestigateInTimeline, UseInvestigateInTimelineValue } from '.'; -import { generateMockIndicator, generateMockUrlIndicator, Indicator } from '../../indicators'; +import { + generateMockIndicator, + generateMockUrlIndicator, + Indicator, +} from '../../../../common/types/indicator'; import { TestProvidersComponent } from '../../../common/mocks/test_providers'; describe('useInvestigateInTimeline()', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts index 5717b831d795..d656976cfa4b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts @@ -10,14 +10,12 @@ import moment from 'moment'; import { DataProvider } from '@kbn/timelines-plugin/common'; import { generateDataProvider } from '../utils'; import { SecuritySolutionContext } from '../../../containers/security_solution_context'; +import { fieldAndValueValid, getIndicatorFieldAndValue, unwrapValue } from '../../indicators'; import { - fieldAndValueValid, - getIndicatorFieldAndValue, Indicator, IndicatorFieldEventEnrichmentMap, RawIndicatorFieldId, - unwrapValue, -} from '../../indicators'; +} from '../../../../common/types/indicator'; export interface UseInvestigateInTimelineParam { /** diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/index.ts b/x-pack/plugins/threat_intelligence/server/index.ts similarity index 52% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/types/index.ts rename to x-pack/plugins/threat_intelligence/server/index.ts index 4ea5306322de..c658a352a607 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/types/index.ts +++ b/x-pack/plugins/threat_intelligence/server/index.ts @@ -5,4 +5,9 @@ * 2.0. */ -export * from './indicator'; +import { PluginInitializerContext } from '@kbn/core/server'; +import { ThreatIntelligencePlugin } from './plugin'; + +export const plugin = (context: PluginInitializerContext) => { + return new ThreatIntelligencePlugin(context); +}; diff --git a/x-pack/plugins/threat_intelligence/server/plugin.ts b/x-pack/plugins/threat_intelligence/server/plugin.ts new file mode 100644 index 000000000000..731659208dac --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/plugin.ts @@ -0,0 +1,54 @@ +/* + * Copyright 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 { PluginInitializerContext, Logger } from '@kbn/core/server'; +import { THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME } from '../common/constants'; +import { + IThreatIntelligencePlugin, + ThreatIntelligencePluginCoreSetupDependencies, + ThreatIntelligencePluginSetupDependencies, +} from './types'; +import { threatIntelligenceSearchStrategyProvider } from './search_strategy'; + +export class ThreatIntelligencePlugin implements IThreatIntelligencePlugin { + private readonly logger: Logger; + + constructor(context: PluginInitializerContext) { + this.logger = context.logger.get(); + } + + setup( + core: ThreatIntelligencePluginCoreSetupDependencies, + plugins: ThreatIntelligencePluginSetupDependencies + ) { + this.logger.debug('setup'); + + core.getStartServices().then(([_, { data: dataStartService }]) => { + const threatIntelligenceSearchStrategy = + threatIntelligenceSearchStrategyProvider(dataStartService); + + plugins.data.search.registerSearchStrategy( + THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME, + threatIntelligenceSearchStrategy + ); + + this.logger.debug(`search strategy "${THREAT_INTELLIGENCE_SEARCH_STRATEGY_NAME}" registered`); + }); + + return {}; + } + + start() { + this.logger.debug('start'); + + return {}; + } + + stop() { + this.logger.debug('stop'); + } +} diff --git a/x-pack/plugins/threat_intelligence/server/search_strategy.ts b/x-pack/plugins/threat_intelligence/server/search_strategy.ts new file mode 100644 index 000000000000..0ea7a7a9458a --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/search_strategy.ts @@ -0,0 +1,110 @@ +/* + * Copyright 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 { + ENHANCED_ES_SEARCH_STRATEGY, + IEsSearchRequest, + ISearchRequestParams, +} from '@kbn/data-plugin/common'; +import { ISearchStrategy, PluginStart, shimHitsTotal } from '@kbn/data-plugin/server'; +import { map } from 'rxjs/operators'; +import { BARCHART_AGGREGATION_NAME, FactoryQueryType } from '../common/constants'; +import { RawIndicatorFieldId } from '../common/types/indicator'; +import { calculateBarchartColumnTimeInterval } from './utils/calculate_barchart_time_interval'; +import { createRuntimeMappings } from './utils/get_indicator_query_params'; + +const TIMESTAMP_FIELD = RawIndicatorFieldId.TimeStamp; + +function isObj(req: unknown): req is Record { + return typeof req === 'object' && req !== null; +} + +function assertValidRequestType(req: unknown): asserts req is Record { + if (!isObj(req) || req.factoryQueryType == null) { + throw new Error('factoryQueryType is required'); + } +} + +type BarchartAggregationRequest = IEsSearchRequest & { + dateRange: { + from: number; + to: number; + }; + field: string; +}; + +function isBarchartRequest(req: unknown): req is BarchartAggregationRequest { + return isObj(req) && req.factoryQueryType === FactoryQueryType.Barchart; +} + +const getAggregationsQuery = (request: BarchartAggregationRequest) => { + const { + dateRange: { from: min, to: max }, + field, + } = request; + + const interval = calculateBarchartColumnTimeInterval(min, max); + + return { + aggregations: { + [BARCHART_AGGREGATION_NAME]: { + terms: { + field, + }, + aggs: { + events: { + date_histogram: { + field: TIMESTAMP_FIELD, + fixed_interval: interval, + min_doc_count: 0, + extended_bounds: { + min, + max, + }, + }, + }, + }, + }, + }, + fields: [TIMESTAMP_FIELD, field], + size: 0, + }; +}; + +export const threatIntelligenceSearchStrategyProvider = (data: PluginStart): ISearchStrategy => { + const es = data.search.getSearchStrategy(ENHANCED_ES_SEARCH_STRATEGY); + + return { + search: (request, options, deps) => { + assertValidRequestType(request); + + const runtimeMappings = createRuntimeMappings(); + + const dsl = { + ...request.params, + runtime_mappings: runtimeMappings, + ...(isBarchartRequest(request) ? getAggregationsQuery(request) : {}), + } as unknown as ISearchRequestParams; + + return es.search({ ...request, params: dsl }, options, deps).pipe( + map((response) => { + return { + ...response, + ...{ + rawResponse: shimHitsTotal(response.rawResponse, options), + }, + }; + }) + ); + }, + cancel: async (id, options, deps) => { + if (es.cancel) { + return es.cancel(id, options, deps); + } + }, + }; +}; diff --git a/x-pack/plugins/threat_intelligence/server/types.ts b/x-pack/plugins/threat_intelligence/server/types.ts new file mode 100644 index 000000000000..a9ad87a3f27c --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/types.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; + +import { DataPluginSetup, DataPluginStart } from '@kbn/data-plugin/server/plugin'; + +export interface ThreatIntelligencePluginSetupDependencies { + data: DataPluginSetup; +} + +export interface ThreatIntelligencePluginStartDependencies { + data: DataPluginStart; +} + +export type ThreatIntelligencePluginCoreSetupDependencies = CoreSetup< + ThreatIntelligencePluginStartDependencies, + {} +>; + +export type ThreatIntelligencePluginCoreStartDependencies = CoreStart; + +export type IThreatIntelligencePlugin = Plugin< + {}, + {}, + ThreatIntelligencePluginSetupDependencies, + ThreatIntelligencePluginStartDependencies +>; diff --git a/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts new file mode 100644 index 000000000000..98f705bf9d11 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import moment from 'moment'; +import { calculateBarchartColumnTimeInterval } from './calculate_barchart_time_interval'; + +const mockValidStringDate = '1 Jan 2022 00:00:00 GMT'; + +describe('calculateBarchartTimeInterval', () => { + it('should handle number dates', () => { + const from = moment(mockValidStringDate).valueOf(); + const to = moment(mockValidStringDate).add(1, 'days').valueOf(); + + const interval = calculateBarchartColumnTimeInterval(from, to); + expect(interval).toContain('ms'); + expect(parseInt(interval, 10) > 0).toBeTruthy(); + }); + + it('should handle moment dates', () => { + const from = moment(mockValidStringDate); + const to = moment(mockValidStringDate).add(1, 'days'); + + const interval = calculateBarchartColumnTimeInterval(from, to); + expect(interval).toContain('ms'); + expect(parseInt(interval, 10) > 0).toBeTruthy(); + }); + + it('should handle dateTo older than dateFrom', () => { + const from = moment(mockValidStringDate).add(1, 'days'); + const to = moment(mockValidStringDate); + + const interval = calculateBarchartColumnTimeInterval(from, to); + expect(parseInt(interval, 10) > 0).toBeFalsy(); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts new file mode 100644 index 000000000000..111e47bb6d19 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.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. + */ + +import moment from 'moment'; + +export const BARCHART_NUMBER_OF_COLUMNS = 16; + +/** + * Calculates the time interval in ms for a specific number of columns + * @param dateFrom Min (older) date for the barchart + * @param dateTo Max (newer) date for the barchart + * @param numberOfColumns Desired number of columns (defaulted to {@link BARCHART_NUMBER_OF_COLUMNS}) + * @returns The interval in ms for a column (for example '100000ms') + */ +export const calculateBarchartColumnTimeInterval = ( + dateFrom: number | moment.Moment, + dateTo: number | moment.Moment, + numberOfColumns = BARCHART_NUMBER_OF_COLUMNS +): string => { + const from: number = moment.isMoment(dateFrom) ? dateFrom.valueOf() : dateFrom; + const to: number = moment.isMoment(dateTo) ? dateTo.valueOf() : dateTo; + return `${Math.floor(moment(to).diff(moment(from)) / numberOfColumns)}ms`; +}; diff --git a/x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts b/x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts new file mode 100644 index 000000000000..5142c543c187 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.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. + */ + +import { RawIndicatorFieldId } from '../../common/types/indicator'; +import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './indicator_name'; + +/** + * Prepare `runtime_mappings` used within TI search + */ +export const createRuntimeMappings = () => ({ + [RawIndicatorFieldId.Name]: { + type: 'keyword', + script: { + source: threatIndicatorNamesScript(), + }, + }, + [RawIndicatorFieldId.NameOrigin]: { + type: 'keyword', + script: { + source: threatIndicatorNamesOriginScript(), + }, + }, +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_runtime_mappings.ts b/x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts similarity index 95% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_runtime_mappings.ts rename to x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts index ed62b18e7c9b..36380ffeaf0a 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_runtime_mappings.ts +++ b/x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './display_name'; +import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './indicator_name'; export const getRuntimeMappings = () => ({ diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.test.ts b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.ts similarity index 99% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.test.ts rename to x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.ts index cfc7f73a8d7f..a3b11eed667c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.test.ts +++ b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './display_name'; +import { threatIndicatorNamesOriginScript, threatIndicatorNamesScript } from './indicator_name'; describe('display name generation', () => { describe('threatIndicatorNamesScript()', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.ts b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts similarity index 98% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.ts rename to x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts index 31a149322efa..60486ab767a8 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/display_name.ts +++ b/x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts @@ -6,7 +6,7 @@ */ import dedent from 'dedent'; -import { RawIndicatorFieldId } from '../types'; +import { RawIndicatorFieldId } from '../../common/types/indicator'; /** * Mapping connects one ore more types to field values that should be used to generate threat.indicator.name field. diff --git a/x-pack/plugins/threat_intelligence/tsconfig.json b/x-pack/plugins/threat_intelligence/tsconfig.json index aea4550210c1..ccdf417105b1 100644 --- a/x-pack/plugins/threat_intelligence/tsconfig.json +++ b/x-pack/plugins/threat_intelligence/tsconfig.json @@ -4,12 +4,15 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + "declarationMap": true }, "include": [ "common/**/*", "public/**/*", + "server/**/*", "scripts/**/*", "public/**/*.json", + "server/**/*.json", "../../../typings/**/*" ], "kbn_references": [ From 5ca5ef3d00571dcc29fbd388f0640de194de6741 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Mon, 31 Oct 2022 21:04:08 +0100 Subject: [PATCH 35/87] [performance/journeys] revert data_stress_test_lens.ts journey step (#144261) * [performance/journeys] open lens dashboard from dashboard list * revert to original test structure * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * revert step name Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/performance/journeys/data_stress_test_lens.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/performance/journeys/data_stress_test_lens.ts b/x-pack/performance/journeys/data_stress_test_lens.ts index 1ea3094b15fc..bc27506afabb 100644 --- a/x-pack/performance/journeys/data_stress_test_lens.ts +++ b/x-pack/performance/journeys/data_stress_test_lens.ts @@ -6,7 +6,7 @@ */ import { Journey } from '@kbn/journeys'; -import { waitForChrome, waitForVisualizations } from '../utils'; +import { waitForVisualizations } from '../utils'; export const journey = new Journey({ kbnArchives: ['test/functional/fixtures/kbn_archiver/stress_test'], @@ -14,7 +14,5 @@ export const journey = new Journey({ }).step('Go to dashboard', async ({ page, kbnUrl, kibanaServer }) => { await kibanaServer.uiSettings.update({ 'histogram:maxBars': 100 }); await page.goto(kbnUrl.get(`/app/dashboards#/view/92b143a0-2e9c-11ed-b1b6-a504560b392c`)); - - await waitForChrome(page); await waitForVisualizations(page, 1); }); From e5179d39fb70c9e7b1f636ff693fe7b77d58629f Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:15:16 -0400 Subject: [PATCH 36/87] [Security Solution][Endpoint] adds new alert loading utility and un-skip FTR test for endpoint (#144133) * FTR generator for endpoint rule alerts + mappings for the security alerts index * new method to load endpoint alerts directly to the index (bypass the rule) * Modify endpoint FTR test to use new alert loading tool * Fix Bulk Delete body payload format * adjustments from code review feedback --- .../endpoint_solution_integrations.ts | 16 +- .../alerts_security_index_mappings.ts | 5366 +++++++++++++++++ .../endpoint_rule_alert_generator.ts | 274 + .../services/detections/index.ts | 104 +- 4 files changed, 5752 insertions(+), 8 deletions(-) create mode 100644 x-pack/test/security_solution_ftr/services/detections/alerts_security_index_mappings.ts create mode 100644 x-pack/test/security_solution_ftr/services/detections/endpoint_rule_alert_generator.ts diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts index 01c20030d2b8..314f8bcebd6d 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts @@ -9,6 +9,7 @@ import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/com import { TimelineResponse } from '@kbn/security-solution-plugin/common/types'; import { kibanaPackageJson } from '@kbn/utils'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { IndexedEndpointRuleAlerts } from '../../../security_solution_ftr/services/detections'; /** * Test suite is meant to cover usages of endpoint functionality or access to endpoint @@ -22,9 +23,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const testSubjects = getService('testSubjects'); const pageObjects = getPageObjects(['common', 'timeline']); - // FLAKY: https://github.com/elastic/kibana/issues/140701 - describe.skip('App level Endpoint functionality', () => { + describe('App level Endpoint functionality', () => { let indexedData: IndexedHostsAndAlertsResponse; + let indexedAlerts: IndexedEndpointRuleAlerts; let endpointAgentId: string; before(async () => { @@ -37,14 +38,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await endpointService.waitForUnitedEndpoints([endpointAgentId]); - // Ensure our Endpoint is for v8.0 (or whatever is running in kibana now) + // Ensure our Endpoint is for current version of kibana await endpointService.sendEndpointMetadataUpdate(endpointAgentId, { agent: { version: kibanaPackageJson.version }, }); - // start/stop the endpoint rule. This should cause the rule to run immediately - // and avoid us having to wait for the interval (of 5 minutes) - await detectionsTestService.stopStartEndpointRule(); + // Load alerts for our endpoint (so that we don't have to wait for the rule to run) + indexedAlerts = await detectionsTestService.loadEndpointRuleAlerts(endpointAgentId); }); after(async () => { @@ -52,6 +52,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { log.info('Cleaning up loaded endpoint data'); await endpointService.unloadEndpointData(indexedData); } + + if (indexedAlerts) { + await indexedAlerts.cleanup(); + } }); describe('from Timeline', () => { diff --git a/x-pack/test/security_solution_ftr/services/detections/alerts_security_index_mappings.ts b/x-pack/test/security_solution_ftr/services/detections/alerts_security_index_mappings.ts new file mode 100644 index 000000000000..40aefa609338 --- /dev/null +++ b/x-pack/test/security_solution_ftr/services/detections/alerts_security_index_mappings.ts @@ -0,0 +1,5366 @@ +/* + * Copyright 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 { + IndexName, + IndicesAlias, + IndicesIndexSettings, + MappingTypeMapping, + Name, +} from '@elastic/elasticsearch/lib/api/types'; + +interface IndexMappings { + type: string; + value: { + index: IndexName; + aliases: Record; + mappings: MappingTypeMapping; + settings: IndicesIndexSettings; + }; +} + +export const getAlertsIndexMappings = (): IndexMappings => { + // Mapping below was generated by running `esArchiver()`: + // node ./scripts/es_archiver.js save ~/tmp/es_archive_alerts .internal.alerts-security.alerts-default-* + + return { + type: 'index', + value: { + aliases: { + '.alerts-security.alerts-default': { + is_write_index: true, + }, + '.siem-signals-default': { + is_write_index: false, + }, + }, + index: '.internal.alerts-security.alerts-default-000001', + mappings: { + _meta: { + kibana: { + version: '8.6.0', + }, + namespace: 'default', + }, + dynamic: 'false', + properties: { + '@timestamp': { + type: 'date', + }, + agent: { + properties: { + build: { + properties: { + original: { + type: 'keyword', + }, + }, + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + client: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + cloud: { + properties: { + account: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + availability_zone: { + type: 'keyword', + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + machine: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + origin: { + properties: { + account: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + availability_zone: { + type: 'keyword', + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + machine: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + project: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + provider: { + type: 'keyword', + }, + region: { + type: 'keyword', + }, + service: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + project: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + provider: { + type: 'keyword', + }, + region: { + type: 'keyword', + }, + service: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + target: { + properties: { + account: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + availability_zone: { + type: 'keyword', + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + machine: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + project: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + provider: { + type: 'keyword', + }, + region: { + type: 'keyword', + }, + service: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + container: { + properties: { + id: { + type: 'keyword', + }, + image: { + properties: { + name: { + type: 'keyword', + }, + tag: { + type: 'keyword', + }, + }, + }, + labels: { + type: 'object', + }, + name: { + type: 'keyword', + }, + runtime: { + type: 'keyword', + }, + }, + }, + destination: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + dll: { + properties: { + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + }, + }, + dns: { + properties: { + answers: { + properties: { + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + ttl: { + type: 'long', + }, + type: { + type: 'keyword', + }, + }, + }, + header_flags: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + op_code: { + type: 'keyword', + }, + question: { + properties: { + class: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + resolved_ip: { + type: 'ip', + }, + response_code: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + ecs: { + properties: { + version: { + type: 'keyword', + }, + }, + }, + error: { + properties: { + code: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + message: { + type: 'match_only_text', + }, + stack_trace: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + event: { + properties: { + action: { + type: 'keyword', + }, + agent_id_status: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + code: { + type: 'keyword', + }, + created: { + type: 'date', + }, + dataset: { + type: 'keyword', + }, + duration: { + type: 'long', + }, + end: { + type: 'date', + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + ingested: { + type: 'date', + }, + kind: { + type: 'keyword', + }, + module: { + type: 'keyword', + }, + original: { + type: 'keyword', + }, + outcome: { + type: 'keyword', + }, + provider: { + type: 'keyword', + }, + reason: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + risk_score: { + type: 'float', + }, + risk_score_norm: { + type: 'float', + }, + sequence: { + type: 'long', + }, + severity: { + type: 'long', + }, + start: { + type: 'date', + }, + timezone: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + url: { + type: 'keyword', + }, + }, + }, + faas: { + properties: { + coldstart: { + type: 'boolean', + }, + execution: { + type: 'keyword', + }, + trigger: { + properties: { + request_id: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + }, + }, + file: { + properties: { + accessed: { + type: 'date', + }, + attributes: { + type: 'keyword', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + created: { + type: 'date', + }, + ctime: { + type: 'date', + }, + device: { + type: 'keyword', + }, + directory: { + type: 'keyword', + }, + drive_letter: { + type: 'keyword', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + extension: { + type: 'keyword', + }, + fork_name: { + type: 'keyword', + }, + gid: { + type: 'keyword', + }, + group: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + inode: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + mode: { + type: 'keyword', + }, + mtime: { + type: 'date', + }, + name: { + type: 'keyword', + }, + owner: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + size: { + type: 'long', + }, + target_path: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + uid: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + host: { + properties: { + architecture: { + type: 'keyword', + }, + boot: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + cpu: { + properties: { + usage: { + scaling_factor: 1000, + type: 'scaled_float', + }, + }, + }, + disk: { + properties: { + read: { + properties: { + bytes: { + type: 'long', + }, + }, + }, + write: { + properties: { + bytes: { + type: 'long', + }, + }, + }, + }, + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + hostname: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + network: { + properties: { + egress: { + properties: { + bytes: { + type: 'long', + }, + packets: { + type: 'long', + }, + }, + }, + ingress: { + properties: { + bytes: { + type: 'long', + }, + packets: { + type: 'long', + }, + }, + }, + }, + }, + os: { + properties: { + family: { + type: 'keyword', + }, + full: { + type: 'keyword', + }, + kernel: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platform: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + pid_ns_ino: { + type: 'keyword', + }, + risk: { + properties: { + calculated_level: { + type: 'keyword', + }, + calculated_score: { + type: 'float', + }, + calculated_score_norm: { + type: 'float', + }, + static_level: { + type: 'keyword', + }, + static_score: { + type: 'float', + }, + static_score_norm: { + type: 'float', + }, + }, + }, + type: { + type: 'keyword', + }, + uptime: { + type: 'long', + }, + }, + }, + http: { + properties: { + request: { + properties: { + body: { + properties: { + bytes: { + type: 'long', + }, + content: { + type: 'wildcard', + }, + }, + }, + bytes: { + type: 'long', + }, + id: { + type: 'keyword', + }, + method: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + referrer: { + type: 'keyword', + }, + }, + }, + response: { + properties: { + body: { + properties: { + bytes: { + type: 'long', + }, + content: { + type: 'wildcard', + }, + }, + }, + bytes: { + type: 'long', + }, + mime_type: { + type: 'keyword', + }, + status_code: { + type: 'long', + }, + }, + }, + version: { + type: 'keyword', + }, + }, + }, + kibana: { + properties: { + alert: { + properties: { + action_group: { + type: 'keyword', + }, + ancestors: { + properties: { + depth: { + type: 'long', + }, + id: { + type: 'keyword', + }, + index: { + type: 'keyword', + }, + rule: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + building_block_type: { + type: 'keyword', + }, + depth: { + type: 'long', + }, + duration: { + properties: { + us: { + type: 'long', + }, + }, + }, + end: { + type: 'date', + }, + group: { + properties: { + id: { + type: 'keyword', + }, + index: { + type: 'integer', + }, + }, + }, + instance: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + new_terms: { + type: 'keyword', + }, + original_event: { + properties: { + action: { + type: 'keyword', + }, + agent_id_status: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + code: { + type: 'keyword', + }, + created: { + type: 'date', + }, + dataset: { + type: 'keyword', + }, + duration: { + type: 'keyword', + }, + end: { + type: 'date', + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + ingested: { + type: 'date', + }, + kind: { + type: 'keyword', + }, + module: { + type: 'keyword', + }, + original: { + type: 'keyword', + }, + outcome: { + type: 'keyword', + }, + provider: { + type: 'keyword', + }, + reason: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + risk_score: { + type: 'float', + }, + risk_score_norm: { + type: 'float', + }, + sequence: { + type: 'long', + }, + severity: { + type: 'long', + }, + start: { + type: 'date', + }, + timezone: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + url: { + type: 'keyword', + }, + }, + }, + original_time: { + type: 'date', + }, + reason: { + type: 'keyword', + }, + risk_score: { + type: 'float', + }, + rule: { + properties: { + author: { + type: 'keyword', + }, + building_block_type: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + consumer: { + type: 'keyword', + }, + created_at: { + type: 'date', + }, + created_by: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + enabled: { + type: 'keyword', + }, + exceptions_list: { + type: 'object', + }, + execution: { + properties: { + uuid: { + type: 'keyword', + }, + }, + }, + false_positives: { + type: 'keyword', + }, + from: { + type: 'keyword', + }, + immutable: { + type: 'keyword', + }, + interval: { + type: 'keyword', + }, + license: { + type: 'keyword', + }, + max_signals: { + type: 'long', + }, + name: { + type: 'keyword', + }, + note: { + type: 'keyword', + }, + parameters: { + ignore_above: 4096, + type: 'flattened', + }, + producer: { + type: 'keyword', + }, + references: { + type: 'keyword', + }, + rule_id: { + type: 'keyword', + }, + rule_name_override: { + type: 'keyword', + }, + rule_type_id: { + type: 'keyword', + }, + tags: { + type: 'keyword', + }, + threat: { + properties: { + framework: { + type: 'keyword', + }, + tactic: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + technique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + subtechnique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + timeline_id: { + type: 'keyword', + }, + timeline_title: { + type: 'keyword', + }, + timestamp_override: { + type: 'keyword', + }, + to: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + updated_at: { + type: 'date', + }, + updated_by: { + type: 'keyword', + }, + uuid: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + severity: { + type: 'keyword', + }, + start: { + type: 'date', + }, + status: { + type: 'keyword', + }, + system_status: { + type: 'keyword', + }, + threshold_result: { + properties: { + cardinality: { + properties: { + field: { + type: 'keyword', + }, + value: { + type: 'long', + }, + }, + }, + count: { + type: 'long', + }, + from: { + type: 'date', + }, + terms: { + properties: { + field: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + }, + }, + time_range: { + format: 'epoch_millis||strict_date_optional_time', + type: 'date_range', + }, + uuid: { + type: 'keyword', + }, + workflow_reason: { + type: 'keyword', + }, + workflow_status: { + type: 'keyword', + }, + workflow_user: { + type: 'keyword', + }, + }, + }, + space_ids: { + type: 'keyword', + }, + version: { + type: 'version', + }, + }, + }, + labels: { + type: 'object', + }, + log: { + properties: { + file: { + properties: { + path: { + type: 'keyword', + }, + }, + }, + level: { + type: 'keyword', + }, + logger: { + type: 'keyword', + }, + origin: { + properties: { + file: { + properties: { + line: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + function: { + type: 'keyword', + }, + }, + }, + syslog: { + properties: { + facility: { + properties: { + code: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + priority: { + type: 'long', + }, + severity: { + properties: { + code: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + message: { + type: 'match_only_text', + }, + network: { + properties: { + application: { + type: 'keyword', + }, + bytes: { + type: 'long', + }, + community_id: { + type: 'keyword', + }, + direction: { + type: 'keyword', + }, + forwarded_ip: { + type: 'ip', + }, + iana_number: { + type: 'keyword', + }, + inner: { + properties: { + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + }, + }, + name: { + type: 'keyword', + }, + packets: { + type: 'long', + }, + protocol: { + type: 'keyword', + }, + transport: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + }, + }, + observer: { + properties: { + egress: { + properties: { + interface: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + zone: { + type: 'keyword', + }, + }, + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + hostname: { + type: 'keyword', + }, + ingress: { + properties: { + interface: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + vlan: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + zone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + os: { + properties: { + family: { + type: 'keyword', + }, + full: { + type: 'keyword', + }, + kernel: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platform: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + product: { + type: 'keyword', + }, + serial_number: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + vendor: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + orchestrator: { + properties: { + api_version: { + type: 'keyword', + }, + cluster: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + url: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + namespace: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + resource: { + properties: { + id: { + type: 'keyword', + }, + ip: { + type: 'ip', + }, + name: { + type: 'keyword', + }, + parent: { + properties: { + type: { + type: 'keyword', + }, + }, + }, + type: { + type: 'keyword', + }, + }, + }, + type: { + type: 'keyword', + }, + }, + }, + organization: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + package: { + properties: { + architecture: { + type: 'keyword', + }, + build_version: { + type: 'keyword', + }, + checksum: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + install_scope: { + type: 'keyword', + }, + installed: { + type: 'date', + }, + license: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + process: { + properties: { + args: { + type: 'keyword', + }, + args_count: { + type: 'long', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + command_line: { + type: 'wildcard', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + end: { + type: 'date', + }, + entity_id: { + type: 'keyword', + }, + entry_leader: { + properties: { + entity_id: { + type: 'keyword', + }, + }, + }, + executable: { + type: 'keyword', + }, + exit_code: { + type: 'long', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + parent: { + properties: { + args: { + type: 'keyword', + }, + args_count: { + type: 'long', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + command_line: { + type: 'wildcard', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + end: { + type: 'date', + }, + entity_id: { + type: 'keyword', + }, + executable: { + type: 'keyword', + }, + exit_code: { + type: 'long', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + pgid: { + type: 'long', + }, + pid: { + type: 'long', + }, + start: { + type: 'date', + }, + thread: { + properties: { + id: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + title: { + type: 'keyword', + }, + uptime: { + type: 'long', + }, + working_directory: { + type: 'keyword', + }, + }, + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + pgid: { + type: 'long', + }, + pid: { + type: 'long', + }, + session_leader: { + properties: { + entity_id: { + type: 'keyword', + }, + }, + }, + start: { + type: 'date', + }, + thread: { + properties: { + id: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }, + title: { + type: 'keyword', + }, + uptime: { + type: 'long', + }, + working_directory: { + type: 'keyword', + }, + }, + }, + registry: { + properties: { + data: { + properties: { + bytes: { + type: 'keyword', + }, + strings: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + hive: { + type: 'keyword', + }, + key: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + related: { + properties: { + hash: { + type: 'keyword', + }, + hosts: { + type: 'keyword', + }, + ip: { + type: 'ip', + }, + user: { + type: 'keyword', + }, + }, + }, + rule: { + properties: { + author: { + type: 'keyword', + }, + category: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + license: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + ruleset: { + type: 'keyword', + }, + uuid: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + server: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + service: { + properties: { + address: { + type: 'keyword', + }, + environment: { + type: 'keyword', + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + node: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + origin: { + properties: { + address: { + type: 'keyword', + }, + environment: { + type: 'keyword', + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + node: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + state: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + state: { + type: 'keyword', + }, + target: { + properties: { + address: { + type: 'keyword', + }, + environment: { + type: 'keyword', + }, + ephemeral_id: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + node: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + state: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + signal: { + properties: { + ancestors: { + properties: { + depth: { + path: 'kibana.alert.ancestors.depth', + type: 'alias', + }, + id: { + path: 'kibana.alert.ancestors.id', + type: 'alias', + }, + index: { + path: 'kibana.alert.ancestors.index', + type: 'alias', + }, + type: { + path: 'kibana.alert.ancestors.type', + type: 'alias', + }, + }, + }, + depth: { + path: 'kibana.alert.depth', + type: 'alias', + }, + group: { + properties: { + id: { + path: 'kibana.alert.group.id', + type: 'alias', + }, + index: { + path: 'kibana.alert.group.index', + type: 'alias', + }, + }, + }, + original_event: { + properties: { + action: { + path: 'kibana.alert.original_event.action', + type: 'alias', + }, + category: { + path: 'kibana.alert.original_event.category', + type: 'alias', + }, + code: { + path: 'kibana.alert.original_event.code', + type: 'alias', + }, + created: { + path: 'kibana.alert.original_event.created', + type: 'alias', + }, + dataset: { + path: 'kibana.alert.original_event.dataset', + type: 'alias', + }, + duration: { + path: 'kibana.alert.original_event.duration', + type: 'alias', + }, + end: { + path: 'kibana.alert.original_event.end', + type: 'alias', + }, + hash: { + path: 'kibana.alert.original_event.hash', + type: 'alias', + }, + id: { + path: 'kibana.alert.original_event.id', + type: 'alias', + }, + kind: { + path: 'kibana.alert.original_event.kind', + type: 'alias', + }, + module: { + path: 'kibana.alert.original_event.module', + type: 'alias', + }, + outcome: { + path: 'kibana.alert.original_event.outcome', + type: 'alias', + }, + provider: { + path: 'kibana.alert.original_event.provider', + type: 'alias', + }, + reason: { + path: 'kibana.alert.original_event.reason', + type: 'alias', + }, + risk_score: { + path: 'kibana.alert.original_event.risk_score', + type: 'alias', + }, + risk_score_norm: { + path: 'kibana.alert.original_event.risk_score_norm', + type: 'alias', + }, + sequence: { + path: 'kibana.alert.original_event.sequence', + type: 'alias', + }, + severity: { + path: 'kibana.alert.original_event.severity', + type: 'alias', + }, + start: { + path: 'kibana.alert.original_event.start', + type: 'alias', + }, + timezone: { + path: 'kibana.alert.original_event.timezone', + type: 'alias', + }, + type: { + path: 'kibana.alert.original_event.type', + type: 'alias', + }, + }, + }, + original_time: { + path: 'kibana.alert.original_time', + type: 'alias', + }, + reason: { + path: 'kibana.alert.reason', + type: 'alias', + }, + rule: { + properties: { + author: { + path: 'kibana.alert.rule.author', + type: 'alias', + }, + building_block_type: { + path: 'kibana.alert.building_block_type', + type: 'alias', + }, + created_at: { + path: 'kibana.alert.rule.created_at', + type: 'alias', + }, + created_by: { + path: 'kibana.alert.rule.created_by', + type: 'alias', + }, + description: { + path: 'kibana.alert.rule.description', + type: 'alias', + }, + enabled: { + path: 'kibana.alert.rule.enabled', + type: 'alias', + }, + false_positives: { + path: 'kibana.alert.rule.false_positives', + type: 'alias', + }, + from: { + path: 'kibana.alert.rule.from', + type: 'alias', + }, + id: { + path: 'kibana.alert.rule.uuid', + type: 'alias', + }, + immutable: { + path: 'kibana.alert.rule.immutable', + type: 'alias', + }, + interval: { + path: 'kibana.alert.rule.interval', + type: 'alias', + }, + license: { + path: 'kibana.alert.rule.license', + type: 'alias', + }, + max_signals: { + path: 'kibana.alert.rule.max_signals', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.name', + type: 'alias', + }, + note: { + path: 'kibana.alert.rule.note', + type: 'alias', + }, + references: { + path: 'kibana.alert.rule.references', + type: 'alias', + }, + risk_score: { + path: 'kibana.alert.risk_score', + type: 'alias', + }, + rule_id: { + path: 'kibana.alert.rule.rule_id', + type: 'alias', + }, + rule_name_override: { + path: 'kibana.alert.rule.rule_name_override', + type: 'alias', + }, + severity: { + path: 'kibana.alert.severity', + type: 'alias', + }, + tags: { + path: 'kibana.alert.rule.tags', + type: 'alias', + }, + threat: { + properties: { + framework: { + path: 'kibana.alert.rule.threat.framework', + type: 'alias', + }, + tactic: { + properties: { + id: { + path: 'kibana.alert.rule.threat.tactic.id', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.threat.tactic.name', + type: 'alias', + }, + reference: { + path: 'kibana.alert.rule.threat.tactic.reference', + type: 'alias', + }, + }, + }, + technique: { + properties: { + id: { + path: 'kibana.alert.rule.threat.technique.id', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.threat.technique.name', + type: 'alias', + }, + reference: { + path: 'kibana.alert.rule.threat.technique.reference', + type: 'alias', + }, + subtechnique: { + properties: { + id: { + path: 'kibana.alert.rule.threat.technique.subtechnique.id', + type: 'alias', + }, + name: { + path: 'kibana.alert.rule.threat.technique.subtechnique.name', + type: 'alias', + }, + reference: { + path: 'kibana.alert.rule.threat.technique.subtechnique.reference', + type: 'alias', + }, + }, + }, + }, + }, + }, + }, + timeline_id: { + path: 'kibana.alert.rule.timeline_id', + type: 'alias', + }, + timeline_title: { + path: 'kibana.alert.rule.timeline_title', + type: 'alias', + }, + timestamp_override: { + path: 'kibana.alert.rule.timestamp_override', + type: 'alias', + }, + to: { + path: 'kibana.alert.rule.to', + type: 'alias', + }, + type: { + path: 'kibana.alert.rule.type', + type: 'alias', + }, + updated_at: { + path: 'kibana.alert.rule.updated_at', + type: 'alias', + }, + updated_by: { + path: 'kibana.alert.rule.updated_by', + type: 'alias', + }, + version: { + path: 'kibana.alert.rule.version', + type: 'alias', + }, + }, + }, + status: { + path: 'kibana.alert.workflow_status', + type: 'alias', + }, + threshold_result: { + properties: { + cardinality: { + properties: { + field: { + path: 'kibana.alert.threshold_result.cardinality.field', + type: 'alias', + }, + value: { + path: 'kibana.alert.threshold_result.cardinality.value', + type: 'alias', + }, + }, + }, + count: { + path: 'kibana.alert.threshold_result.count', + type: 'alias', + }, + from: { + path: 'kibana.alert.threshold_result.from', + type: 'alias', + }, + terms: { + properties: { + field: { + path: 'kibana.alert.threshold_result.terms.field', + type: 'alias', + }, + value: { + path: 'kibana.alert.threshold_result.terms.value', + type: 'alias', + }, + }, + }, + }, + }, + }, + }, + source: { + properties: { + address: { + type: 'keyword', + }, + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + bytes: { + type: 'long', + }, + domain: { + type: 'keyword', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + mac: { + type: 'keyword', + }, + nat: { + properties: { + ip: { + type: 'ip', + }, + port: { + type: 'long', + }, + }, + }, + packets: { + type: 'long', + }, + port: { + type: 'long', + }, + registered_domain: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + user: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + span: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + tags: { + type: 'keyword', + }, + threat: { + properties: { + enrichments: { + properties: { + indicator: { + properties: { + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + confidence: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + email: { + properties: { + address: { + type: 'keyword', + }, + }, + }, + file: { + properties: { + accessed: { + type: 'date', + }, + attributes: { + type: 'keyword', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + created: { + type: 'date', + }, + ctime: { + type: 'date', + }, + device: { + type: 'keyword', + }, + directory: { + type: 'keyword', + }, + drive_letter: { + type: 'keyword', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + extension: { + type: 'keyword', + }, + fork_name: { + type: 'keyword', + }, + gid: { + type: 'keyword', + }, + group: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + inode: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + mode: { + type: 'keyword', + }, + mtime: { + type: 'date', + }, + name: { + type: 'keyword', + }, + owner: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + size: { + type: 'long', + }, + target_path: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + uid: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + first_seen: { + type: 'date', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + last_seen: { + type: 'date', + }, + marking: { + properties: { + tlp: { + type: 'keyword', + }, + }, + }, + modified_at: { + type: 'date', + }, + port: { + type: 'long', + }, + provider: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + registry: { + properties: { + data: { + properties: { + bytes: { + type: 'keyword', + }, + strings: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + hive: { + type: 'keyword', + }, + key: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + scanner_stats: { + type: 'long', + }, + sightings: { + type: 'long', + }, + type: { + type: 'keyword', + }, + url: { + properties: { + domain: { + type: 'keyword', + }, + extension: { + type: 'keyword', + }, + fragment: { + type: 'keyword', + }, + full: { + type: 'wildcard', + }, + original: { + type: 'wildcard', + }, + password: { + type: 'keyword', + }, + path: { + type: 'wildcard', + }, + port: { + type: 'long', + }, + query: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + scheme: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + username: { + type: 'keyword', + }, + }, + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + matched: { + properties: { + atomic: { + type: 'keyword', + }, + field: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + index: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + }, + type: 'nested', + }, + framework: { + type: 'keyword', + }, + group: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + indicator: { + properties: { + as: { + properties: { + number: { + type: 'long', + }, + organization: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + }, + }, + confidence: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + email: { + properties: { + address: { + type: 'keyword', + }, + }, + }, + file: { + properties: { + accessed: { + type: 'date', + }, + attributes: { + type: 'keyword', + }, + code_signature: { + properties: { + digest_algorithm: { + type: 'keyword', + }, + exists: { + type: 'boolean', + }, + signing_id: { + type: 'keyword', + }, + status: { + type: 'keyword', + }, + subject_name: { + type: 'keyword', + }, + team_id: { + type: 'keyword', + }, + timestamp: { + type: 'date', + }, + trusted: { + type: 'boolean', + }, + valid: { + type: 'boolean', + }, + }, + }, + created: { + type: 'date', + }, + ctime: { + type: 'date', + }, + device: { + type: 'keyword', + }, + directory: { + type: 'keyword', + }, + drive_letter: { + type: 'keyword', + }, + elf: { + properties: { + architecture: { + type: 'keyword', + }, + byte_order: { + type: 'keyword', + }, + cpu_type: { + type: 'keyword', + }, + creation_date: { + type: 'date', + }, + exports: { + type: 'flattened', + }, + header: { + properties: { + abi_version: { + type: 'keyword', + }, + class: { + type: 'keyword', + }, + data: { + type: 'keyword', + }, + entrypoint: { + type: 'long', + }, + object_version: { + type: 'keyword', + }, + os_abi: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + imports: { + type: 'flattened', + }, + sections: { + properties: { + chi2: { + type: 'long', + }, + entropy: { + type: 'long', + }, + flags: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + physical_offset: { + type: 'keyword', + }, + physical_size: { + type: 'long', + }, + type: { + type: 'keyword', + }, + virtual_address: { + type: 'long', + }, + virtual_size: { + type: 'long', + }, + }, + type: 'nested', + }, + segments: { + properties: { + sections: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + type: 'nested', + }, + shared_libraries: { + type: 'keyword', + }, + telfhash: { + type: 'keyword', + }, + }, + }, + extension: { + type: 'keyword', + }, + fork_name: { + type: 'keyword', + }, + gid: { + type: 'keyword', + }, + group: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + sha512: { + type: 'keyword', + }, + ssdeep: { + type: 'keyword', + }, + }, + }, + inode: { + type: 'keyword', + }, + mime_type: { + type: 'keyword', + }, + mode: { + type: 'keyword', + }, + mtime: { + type: 'date', + }, + name: { + type: 'keyword', + }, + owner: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + pe: { + properties: { + architecture: { + type: 'keyword', + }, + company: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + file_version: { + type: 'keyword', + }, + imphash: { + type: 'keyword', + }, + original_file_name: { + type: 'keyword', + }, + product: { + type: 'keyword', + }, + }, + }, + size: { + type: 'long', + }, + target_path: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + uid: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + first_seen: { + type: 'date', + }, + geo: { + properties: { + city_name: { + type: 'keyword', + }, + continent_code: { + type: 'keyword', + }, + continent_name: { + type: 'keyword', + }, + country_iso_code: { + type: 'keyword', + }, + country_name: { + type: 'keyword', + }, + location: { + type: 'geo_point', + }, + name: { + type: 'keyword', + }, + postal_code: { + type: 'keyword', + }, + region_iso_code: { + type: 'keyword', + }, + region_name: { + type: 'keyword', + }, + timezone: { + type: 'keyword', + }, + }, + }, + ip: { + type: 'ip', + }, + last_seen: { + type: 'date', + }, + marking: { + properties: { + tlp: { + type: 'keyword', + }, + }, + }, + modified_at: { + type: 'date', + }, + port: { + type: 'long', + }, + provider: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + registry: { + properties: { + data: { + properties: { + bytes: { + type: 'keyword', + }, + strings: { + type: 'wildcard', + }, + type: { + type: 'keyword', + }, + }, + }, + hive: { + type: 'keyword', + }, + key: { + type: 'keyword', + }, + path: { + type: 'keyword', + }, + value: { + type: 'keyword', + }, + }, + }, + scanner_stats: { + type: 'long', + }, + sightings: { + type: 'long', + }, + type: { + type: 'keyword', + }, + url: { + properties: { + domain: { + type: 'keyword', + }, + extension: { + type: 'keyword', + }, + fragment: { + type: 'keyword', + }, + full: { + type: 'wildcard', + }, + original: { + type: 'wildcard', + }, + password: { + type: 'keyword', + }, + path: { + type: 'wildcard', + }, + port: { + type: 'long', + }, + query: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + scheme: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + username: { + type: 'keyword', + }, + }, + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + software: { + properties: { + alias: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platforms: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + }, + }, + tactic: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + technique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + subtechnique: { + properties: { + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + }, + }, + }, + }, + }, + }, + tls: { + properties: { + cipher: { + type: 'keyword', + }, + client: { + properties: { + certificate: { + type: 'keyword', + }, + certificate_chain: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + }, + }, + issuer: { + type: 'keyword', + }, + ja3: { + type: 'keyword', + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + server_name: { + type: 'keyword', + }, + subject: { + type: 'keyword', + }, + supported_ciphers: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + curve: { + type: 'keyword', + }, + established: { + type: 'boolean', + }, + next_protocol: { + type: 'keyword', + }, + resumed: { + type: 'boolean', + }, + server: { + properties: { + certificate: { + type: 'keyword', + }, + certificate_chain: { + type: 'keyword', + }, + hash: { + properties: { + md5: { + type: 'keyword', + }, + sha1: { + type: 'keyword', + }, + sha256: { + type: 'keyword', + }, + }, + }, + issuer: { + type: 'keyword', + }, + ja3s: { + type: 'keyword', + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + subject: { + type: 'keyword', + }, + x509: { + properties: { + alternative_names: { + type: 'keyword', + }, + issuer: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + not_after: { + type: 'date', + }, + not_before: { + type: 'date', + }, + public_key_algorithm: { + type: 'keyword', + }, + public_key_curve: { + type: 'keyword', + }, + public_key_exponent: { + type: 'long', + }, + public_key_size: { + type: 'long', + }, + serial_number: { + type: 'keyword', + }, + signature_algorithm: { + type: 'keyword', + }, + subject: { + properties: { + common_name: { + type: 'keyword', + }, + country: { + type: 'keyword', + }, + distinguished_name: { + type: 'keyword', + }, + locality: { + type: 'keyword', + }, + organization: { + type: 'keyword', + }, + organizational_unit: { + type: 'keyword', + }, + state_or_province: { + type: 'keyword', + }, + }, + }, + version_number: { + type: 'keyword', + }, + }, + }, + }, + }, + version: { + type: 'keyword', + }, + version_protocol: { + type: 'keyword', + }, + }, + }, + trace: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + transaction: { + properties: { + id: { + type: 'keyword', + }, + }, + }, + url: { + properties: { + domain: { + type: 'keyword', + }, + extension: { + type: 'keyword', + }, + fragment: { + type: 'keyword', + }, + full: { + type: 'wildcard', + }, + original: { + type: 'wildcard', + }, + password: { + type: 'keyword', + }, + path: { + type: 'wildcard', + }, + port: { + type: 'long', + }, + query: { + type: 'keyword', + }, + registered_domain: { + type: 'keyword', + }, + scheme: { + type: 'keyword', + }, + subdomain: { + type: 'keyword', + }, + top_level_domain: { + type: 'keyword', + }, + username: { + type: 'keyword', + }, + }, + }, + user: { + properties: { + changes: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + domain: { + type: 'keyword', + }, + effective: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + risk: { + properties: { + calculated_level: { + type: 'keyword', + }, + calculated_score: { + type: 'float', + }, + calculated_score_norm: { + type: 'float', + }, + static_level: { + type: 'keyword', + }, + static_score: { + type: 'float', + }, + static_score_norm: { + type: 'float', + }, + }, + }, + roles: { + type: 'keyword', + }, + target: { + properties: { + domain: { + type: 'keyword', + }, + email: { + type: 'keyword', + }, + full_name: { + type: 'keyword', + }, + group: { + properties: { + domain: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + }, + }, + hash: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + roles: { + type: 'keyword', + }, + }, + }, + }, + }, + user_agent: { + properties: { + device: { + properties: { + name: { + type: 'keyword', + }, + }, + }, + name: { + type: 'keyword', + }, + original: { + type: 'keyword', + }, + os: { + properties: { + family: { + type: 'keyword', + }, + full: { + type: 'keyword', + }, + kernel: { + type: 'keyword', + }, + name: { + type: 'keyword', + }, + platform: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + version: { + type: 'keyword', + }, + }, + }, + version: { + type: 'keyword', + }, + }, + }, + vulnerability: { + properties: { + category: { + type: 'keyword', + }, + classification: { + type: 'keyword', + }, + description: { + type: 'keyword', + }, + enumeration: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + reference: { + type: 'keyword', + }, + report_id: { + type: 'keyword', + }, + scanner: { + properties: { + vendor: { + type: 'keyword', + }, + }, + }, + score: { + properties: { + base: { + type: 'float', + }, + environmental: { + type: 'float', + }, + temporal: { + type: 'float', + }, + version: { + type: 'keyword', + }, + }, + }, + severity: { + type: 'keyword', + }, + }, + }, + }, + }, + settings: { + index: { + auto_expand_replicas: '0-1', + hidden: 'true', + lifecycle: { + name: '.alerts-ilm-policy', + rollover_alias: '.alerts-security.alerts-default', + }, + mapping: { + total_fields: { + limit: 1900, + }, + }, + number_of_replicas: '0', + number_of_shards: '1', + }, + }, + }, + }; +}; diff --git a/x-pack/test/security_solution_ftr/services/detections/endpoint_rule_alert_generator.ts b/x-pack/test/security_solution_ftr/services/detections/endpoint_rule_alert_generator.ts new file mode 100644 index 000000000000..a02a1a246957 --- /dev/null +++ b/x-pack/test/security_solution_ftr/services/detections/endpoint_rule_alert_generator.ts @@ -0,0 +1,274 @@ +/* + * Copyright 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 { BaseDataGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/base_data_generator'; +import endpointPrePackagedRule from '@kbn/security-solution-plugin/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/elastic_endpoint_security.json'; +import { kibanaPackageJson } from '@kbn/utils'; +import { mergeWith } from 'lodash'; +import { EndpointMetadataGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/endpoint_metadata_generator'; +import { HostMetadata } from '@kbn/security-solution-plugin/common/endpoint/types'; +import { DeepPartial } from 'utility-types'; + +const mergeAndReplaceArrays = (destinationObj: T, srcObj: S): T => { + const customizer = (objValue: T[keyof T], srcValue: S[keyof S]) => { + if (Array.isArray(objValue)) { + return srcValue; + } + }; + + return mergeWith(destinationObj, srcObj, customizer); +}; + +type EndpointRuleAlert = Pick< + HostMetadata, + 'Endpoint' | 'agent' | 'elastic' | 'host' | 'data_stream' +> & { + [key: string]: any; +}; + +export class EndpointRuleAlertGenerator extends BaseDataGenerator { + /** Generates an Endpoint Rule Alert document */ + generate(overrides: DeepPartial = {}): EndpointRuleAlert { + const endpointMetadataGenerator = new EndpointMetadataGenerator(); + const endpointMetadata = endpointMetadataGenerator.generate({ + agent: { version: kibanaPackageJson.version }, + }); + const now = overrides['@timestamp'] ?? new Date().toISOString(); + const endpointAgentId = overrides?.agent?.id ?? this.seededUUIDv4(); + + return mergeAndReplaceArrays( + { + '@timestamp': now, + Endpoint: endpointMetadata.Endpoint, + agent: { + id: endpointAgentId, + type: 'endpoint', + version: kibanaPackageJson.version, + }, + elastic: endpointMetadata.elastic, + host: endpointMetadata.host, + data_stream: { + dataset: 'endpoint.alerts', + namespace: 'default', + type: 'logs', + }, + ecs: { + version: '1.4.0', + }, + file: { + Ext: { + code_signature: [ + { + subject_name: 'bad signer', + trusted: false, + }, + ], + malware_classification: { + identifier: 'endpointpe', + score: 1, + threshold: 0.66, + version: '3.0.33', + }, + quarantine_message: 'fake quarantine message', + quarantine_result: true, + temp_file_path: 'C:/temp/fake_malware.exe', + }, + accessed: 1666818167432, + created: 1666818167432, + hash: { + md5: 'fake file md5', + sha1: 'fake file sha1', + sha256: 'fake file sha256', + }, + mtime: 1666818167432, + name: 'fake_malware.exe', + owner: 'SYSTEM', + path: 'C:/fake_malware.exe', + size: 3456, + }, + dll: [ + { + Ext: { + compile_time: 1534424710, + malware_classification: { + identifier: 'Whitelisted', + score: 0, + threshold: 0, + version: '3.0.0', + }, + mapped_address: 5362483200, + mapped_size: 0, + }, + code_signature: { + subject_name: 'Cybereason Inc', + trusted: true, + }, + hash: { + md5: '1f2d082566b0fc5f2c238a5180db7451', + sha1: 'ca85243c0af6a6471bdaa560685c51eefd6dbc0d', + sha256: '8ad40c90a611d36eb8f9eb24fa04f7dbca713db383ff55a03aa0f382e92061a2', + }, + path: 'C:\\Program Files\\Cybereason ActiveProbe\\AmSvc.exe', + pe: { + architecture: 'x64', + }, + }, + ], + process: { + Ext: { + ancestry: ['epyg8z2d21', '26qhqfy8a1'], + code_signature: [ + { + subject_name: 'bad signer', + trusted: false, + }, + ], + token: { + domain: 'NT AUTHORITY', + integrity_level: 16384, + integrity_level_name: 'system', + privileges: [ + { + description: 'Replace a process level token', + enabled: false, + name: 'SeAssignPrimaryTokenPrivilege', + }, + ], + sid: 'S-1-5-18', + type: 'tokenPrimary', + user: 'SYSTEM', + }, + user: 'SYSTEM', + }, + entity_id: '0gwuy9lpud', + entry_leader: { + entity_id: '8kfl83q6vl', + name: 'fake entry', + pid: 945, + }, + executable: 'C:/malware.exe', + group_leader: { + entity_id: '8kfl83q6vl', + name: 'fake leader', + pid: 120, + }, + hash: { + md5: 'fake md5', + sha1: 'fake sha1', + sha256: 'fake sha256', + }, + name: 'malware writer', + parent: { + entity_id: 'epyg8z2d21', + pid: 1, + }, + pid: 2, + session_leader: { + entity_id: '8kfl83q6vl', + name: 'fake session', + pid: 279, + }, + start: 1666818167432, + uptime: 0, + }, + 'event.action': 'creation', + 'event.agent_id_status': 'auth_metadata_missing', + 'event.category': 'malware', + 'event.code': 'malicious_file', + 'event.dataset': 'endpoint', + 'event.id': this.seededUUIDv4(), + 'event.ingested': now, + 'event.kind': 'signal', + 'event.module': 'endpoint', + 'event.sequence': 5, + 'event.type': 'creation', + 'kibana.alert.ancestors': [ + { + depth: 0, + id: 'QBUaFoQBGSAAfHJkxoRQ', + index: '.ds-logs-endpoint.alerts-default-2022.10.26-000001', + type: 'event', + }, + ], + 'kibana.alert.depth': 1, + 'kibana.alert.original_event.action': 'creation', + 'kibana.alert.original_event.agent_id_status': 'auth_metadata_missing', + 'kibana.alert.original_event.category': 'malware', + 'kibana.alert.original_event.code': 'malicious_file', + 'kibana.alert.original_event.dataset': 'endpoint', + 'kibana.alert.original_event.id': this.seededUUIDv4(), + 'kibana.alert.original_event.ingested': now, + 'kibana.alert.original_event.kind': 'alert', + 'kibana.alert.original_event.module': 'endpoint', + 'kibana.alert.original_event.sequence': 5, + 'kibana.alert.original_event.type': 'creation', + 'kibana.alert.original_time': this.randomPastDate(), + 'kibana.alert.reason': + 'malware event with process malware writer, file fake_malware.exe, on Host-4xu9tiwmfp created medium alert Endpoint Security.', + 'kibana.alert.risk_score': 47, + 'kibana.alert.rule.actions': [], + 'kibana.alert.rule.author': ['Elastic'], + 'kibana.alert.rule.category': 'Custom Query Rule', + 'kibana.alert.rule.consumer': 'siem', + 'kibana.alert.rule.created_at': '2022-10-26T21:02:00.237Z', + 'kibana.alert.rule.created_by': 'some_user', + 'kibana.alert.rule.description': + 'Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts.', + 'kibana.alert.rule.enabled': true, + 'kibana.alert.rule.exceptions_list': [ + { + id: 'endpoint_list', + list_id: 'endpoint_list', + namespace_type: 'agnostic', + type: 'endpoint', + }, + ], + 'kibana.alert.rule.execution.uuid': this.seededUUIDv4(), + 'kibana.alert.rule.false_positives': [], + 'kibana.alert.rule.from': endpointPrePackagedRule.from, + 'kibana.alert.rule.immutable': true, + 'kibana.alert.rule.indices': endpointPrePackagedRule.index, + 'kibana.alert.rule.interval': '5m', + 'kibana.alert.rule.license': 'Elastic License v2', + 'kibana.alert.rule.max_signals': 10000, + 'kibana.alert.rule.name': endpointPrePackagedRule.name, + 'kibana.alert.rule.parameters': endpointPrePackagedRule, + 'kibana.alert.rule.producer': 'siem', + 'kibana.alert.rule.references': [], + 'kibana.alert.rule.risk_score': endpointPrePackagedRule.risk_score, + 'kibana.alert.rule.risk_score_mapping': [ + { + field: 'event.risk_score', + operator: 'equals', + value: '', + }, + ], + 'kibana.alert.rule.rule_id': endpointPrePackagedRule.rule_id, + 'kibana.alert.rule.rule_name_override': 'message', + 'kibana.alert.rule.rule_type_id': 'siem.queryRule', + 'kibana.alert.rule.severity': 'medium', + 'kibana.alert.rule.severity_mapping': endpointPrePackagedRule.severity_mapping, + 'kibana.alert.rule.tags': endpointPrePackagedRule.tags, + 'kibana.alert.rule.threat': [], + 'kibana.alert.rule.timestamp_override': endpointPrePackagedRule.timestamp_override, + 'kibana.alert.rule.to': 'now', + 'kibana.alert.rule.type': 'query', + 'kibana.alert.rule.updated_at': '2022-10-26T21:02:00.237Z', + 'kibana.alert.rule.updated_by': 'some_user', + 'kibana.alert.rule.uuid': '6eae8572-5571-11ed-a602-953b659b2e32', + 'kibana.alert.rule.version': 100, + 'kibana.alert.severity': 'medium', + 'kibana.alert.status': 'active', + 'kibana.alert.uuid': 'e25f166b83234cbcfc41600a0191ee6a0efec0f959c6899a325d8026711e6c02', + 'kibana.alert.workflow_status': 'open', + 'kibana.space_ids': ['default'], + 'kibana.version': kibanaPackageJson.version, + }, + overrides + ); + } +} diff --git a/x-pack/test/security_solution_ftr/services/detections/index.ts b/x-pack/test/security_solution_ftr/services/detections/index.ts index 024dede892be..2fbc8c158640 100644 --- a/x-pack/test/security_solution_ftr/services/detections/index.ts +++ b/x-pack/test/security_solution_ftr/services/detections/index.ts @@ -8,6 +8,7 @@ import { Response } from 'superagent'; import { EndpointError } from '@kbn/security-solution-plugin/common/endpoint/errors'; import { + DEFAULT_ALERTS_INDEX, DETECTION_ENGINE_QUERY_SIGNALS_URL, DETECTION_ENGINE_RULES_BULK_ACTION, DETECTION_ENGINE_RULES_URL, @@ -15,13 +16,23 @@ import { import { estypes } from '@elastic/elasticsearch'; import endpointPrePackagedRule from '@kbn/security-solution-plugin/server/lib/detection_engine/prebuilt_rules/content/prepackaged_rules/elastic_endpoint_security.json'; import { Rule } from '@kbn/security-solution-plugin/public/detection_engine/rule_management/logic/types'; +import { kibanaPackageJson } from '@kbn/utils'; +import { wrapErrorIfNeeded } from '@kbn/security-solution-plugin/common/endpoint/data_loaders/utils'; import { FtrService } from '../../../functional/ftr_provider_context'; +import { EndpointRuleAlertGenerator } from './endpoint_rule_alert_generator'; +import { getAlertsIndexMappings } from './alerts_security_index_mappings'; + +export interface IndexedEndpointRuleAlerts { + alerts: estypes.WriteResponseBase[]; + cleanup: () => Promise; +} export class DetectionsTestService extends FtrService { private readonly supertest = this.ctx.getService('supertest'); private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); private readonly config = this.ctx.getService('config'); + private readonly esClient = this.ctx.getService('es'); private readonly defaultTimeout = this.config.get('timeouts.waitFor'); /** @@ -51,6 +62,36 @@ export class DetectionsTestService extends FtrService { }; } + private async ensureEndpointRuleAlertsIndexExists(): Promise { + const indexMappings = getAlertsIndexMappings().value; + + if (indexMappings.mappings?._meta?.kibana.version) { + indexMappings.mappings._meta.kibana.version = kibanaPackageJson.version; + } + + try { + await this.esClient.indices.create({ + index: indexMappings.index, + body: { + settings: indexMappings.settings, + mappings: indexMappings.mappings, + aliases: indexMappings.aliases, + }, + }); + } catch (error) { + // ignore error that indicate index is already created + if ( + ['resource_already_exists_exception', 'invalid_alias_name_exception'].includes( + error?.body?.error?.type + ) + ) { + return; + } + + throw wrapErrorIfNeeded(error); + } + } + /** * Fetches the endpoint security rule using the pre-packaged `rule_id` */ @@ -99,10 +140,11 @@ export class DetectionsTestService extends FtrService { } /** - * Waits for alerts to have been loaded into `.alerts-security.alerts-default` index + * Waits for alerts to have been loaded by continuously calling the alerts api until data shows up * @param query + * @param timeoutMs */ - async waitForAlerts(query: object = { match_all: {} }, timeoutMs?: number) { + async waitForAlerts(query: object = { match_all: {} }, timeoutMs?: number): Promise { await this.retry.waitForWithTimeout( 'Checking alerts index for data', timeoutMs ?? this.defaultTimeout, @@ -128,4 +170,62 @@ export class DetectionsTestService extends FtrService { } ); } + + /** + * Loads alerts for Endpoint directly into the internal index that the Endpoint Rule + * would have written them to for a given endpoint + * @param endpointAgentId + * @param count + */ + async loadEndpointRuleAlerts( + endpointAgentId: string, + count: number = 2 + ): Promise { + this.log.info(`Loading ${count} endpoint rule alerts`); + + await this.ensureEndpointRuleAlertsIndexExists(); + + const alertsGenerator = new EndpointRuleAlertGenerator(); + const esClient = this.esClient; + const indexedAlerts: estypes.IndexResponse[] = []; + + for (let n = 0; n < count; n++) { + const alert = alertsGenerator.generate({ agent: { id: endpointAgentId } }); + const indexedAlert = await esClient.index({ + index: `${DEFAULT_ALERTS_INDEX}-default`, + refresh: 'wait_for', + body: alert, + }); + + indexedAlerts.push(indexedAlert); + } + + this.log.info(`Endpoint rule alerts created:`, indexedAlerts); + + return { + alerts: indexedAlerts, + cleanup: async (): Promise => { + if (indexedAlerts.length) { + this.log.info('cleaning up loaded endpoint rule alerts'); + + await esClient.bulk({ + body: indexedAlerts.map((indexedDoc) => { + return { + delete: { + _index: indexedDoc._index, + _id: indexedDoc._id, + }, + }; + }), + }); + + this.log.info( + `Deleted ${indexedAlerts.length} endpoint rule alerts. Ids: [${indexedAlerts + .map((alert) => alert._id) + .join()}]` + ); + } + }, + }; + } } From c5e48a336a9c4fe0a2c28e61ee15d2fef7539b06 Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 31 Oct 2022 13:31:55 -0700 Subject: [PATCH 37/87] [typecheck] delete temporary target_types dirs in packages (#144271) --- src/dev/typescript/run_type_check_cli.ts | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts index a7abbc8e2fbb..d1f0bab0a784 100644 --- a/src/dev/typescript/run_type_check_cli.ts +++ b/src/dev/typescript/run_type_check_cli.ts @@ -8,12 +8,14 @@ import Path from 'path'; import Fs from 'fs'; +import Fsp from 'fs/promises'; import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; import { REPO_ROOT } from '@kbn/utils'; import { Jsonc } from '@kbn/bazel-packages'; import { runBazel } from '@kbn/bazel-runner'; +import { asyncForEachWithLimit } from '@kbn/std'; import { BazelPackage, discoverBazelPackages } from '@kbn/bazel-packages'; import { PROJECTS } from './projects'; @@ -198,9 +200,24 @@ export async function runTypeCheckCli() { // cleanup if (flagsReader.boolean('cleanup')) { await cleanupRootRefsConfig(); - for (const path of created) { - Fs.unlinkSync(path); - } + + await asyncForEachWithLimit(created, 40, async (path) => { + await Fsp.unlink(path); + }); + + await asyncForEachWithLimit(bazelPackages, 40, async (pkg) => { + const targetTypesPaths = Path.resolve( + REPO_ROOT, + 'bazel-bin', + pkg.normalizedRepoRelativeDir, + 'target_type' + ); + + await Fsp.rm(targetTypesPaths, { + force: true, + recursive: true, + }); + }); } if (pluginBuildResult.failed) { From e502ecfd183ce41035ded8a39ddb009d3b867339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Mon, 31 Oct 2022 22:42:29 +0100 Subject: [PATCH 38/87] [APM] Show recommended minimum size when going below 5 minutes (#144170) --- .../error_count_rule_type/index.stories.tsx | 3 +- .../error_count_rule_type/index.tsx | 22 ++-- .../index.tsx | 5 +- .../transaction_duration_rule_type/index.tsx | 18 ++-- .../index.tsx | 18 ++-- .../apm_rule_params_container/index.test.tsx | 2 +- .../apm_rule_params_container/index.tsx | 100 +++++++++++++++++- .../components/alerting/utils/helper.ts | 6 +- .../triggers_actions_ui/public/index.ts | 2 +- 9 files changed, 134 insertions(+), 42 deletions(-) diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx index 9c422df230e2..424e490b732b 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.stories.tsx @@ -9,6 +9,7 @@ import { Meta, Story } from '@storybook/react'; import React, { useState } from 'react'; import { CoreStart } from '@kbn/core/public'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; +import { TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/public'; import { RuleParams, ErrorCountRuleType } from '.'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { createCallApmApi } from '../../../../services/rest/create_call_apm_api'; @@ -129,7 +130,7 @@ EditingInStackManagement.args = { serviceName: 'testServiceName', threshold: 25, windowSize: 1, - windowUnit: 'm', + windowUnit: TIME_UNITS.MINUTE, }, metadata: undefined, }; diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx index 218f35c85400..8868cd6ccce8 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/error_count_rule_type/index.tsx @@ -10,7 +10,10 @@ import { defaults, omit } from 'lodash'; import React, { useEffect } from 'react'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ForLastExpression } from '@kbn/triggers-actions-ui-plugin/public'; +import { + ForLastExpression, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { asInteger } from '../../../../../common/utils/formatters'; import { useFetcher } from '../../../../hooks/use_fetcher'; @@ -21,16 +24,12 @@ import { IsAboveField, ServiceField, } from '../../utils/fields'; -import { - AlertMetadata, - getIntervalAndTimeRange, - TimeUnit, -} from '../../utils/helper'; +import { AlertMetadata, getIntervalAndTimeRange } from '../../utils/helper'; import { ApmRuleParamsContainer } from '../../ui_components/apm_rule_params_container'; export interface RuleParams { windowSize?: number; - windowUnit?: TimeUnit; + windowUnit?: TIME_UNITS; threshold?: number; serviceName?: string; environment?: string; @@ -55,8 +54,8 @@ export function ErrorCountRuleType(props: Props) { { ...omit(metadata, ['start', 'end']), ...ruleParams }, { threshold: 25, - windowSize: 1, - windowUnit: 'm', + windowSize: 5, + windowUnit: TIME_UNITS.MINUTE, environment: ENVIRONMENT_ALL.value, } ); @@ -65,7 +64,7 @@ export function ErrorCountRuleType(props: Props) { (callApmApi) => { const { interval, start, end } = getIntervalAndTimeRange({ windowSize: params.windowSize, - windowUnit: params.windowUnit as TimeUnit, + windowUnit: params.windowUnit, }); if (interval && start && end) { return callApmApi( @@ -135,7 +134,8 @@ export function ErrorCountRuleType(props: Props) { return ( diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx index e211fea90052..c2423741a4e9 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx @@ -11,7 +11,10 @@ import { defaults, map, omit } from 'lodash'; import React, { useEffect } from 'react'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ForLastExpression } from '@kbn/triggers-actions-ui-plugin/public'; +import { + ForLastExpression, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; import { AggregationType } from '../../../../../common/rules/apm_rule_types'; import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; @@ -28,11 +31,7 @@ import { ServiceField, TransactionTypeField, } from '../../utils/fields'; -import { - AlertMetadata, - getIntervalAndTimeRange, - TimeUnit, -} from '../../utils/helper'; +import { AlertMetadata, getIntervalAndTimeRange } from '../../utils/helper'; import { ApmRuleParamsContainer } from '../../ui_components/apm_rule_params_container'; import { PopoverExpression } from '../../ui_components/popover_expression'; @@ -85,7 +84,7 @@ export function TransactionDurationRuleType(props: Props) { aggregationType: AggregationType.Avg, threshold: 1500, windowSize: 5, - windowUnit: 'm', + windowUnit: TIME_UNITS.MINUTE, environment: ENVIRONMENT_ALL.value, } ); @@ -94,7 +93,7 @@ export function TransactionDurationRuleType(props: Props) { (callApmApi) => { const { interval, start, end } = getIntervalAndTimeRange({ windowSize: params.windowSize, - windowUnit: params.windowUnit as TimeUnit, + windowUnit: params.windowUnit, }); if (interval && start && end) { return callApmApi( @@ -200,8 +199,9 @@ export function TransactionDurationRuleType(props: Props) { return ( { const { interval, start, end } = getIntervalAndTimeRange({ windowSize: params.windowSize, - windowUnit: params.windowUnit as TimeUnit, + windowUnit: params.windowUnit, }); if (interval && start && end) { return callApmApi( @@ -142,8 +141,9 @@ export function TransactionErrorRateRuleType(props: Props) { return ( { expect(() => render( {}} setRuleProperty={() => {}} diff --git a/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx b/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx index df252658e32c..1ad348edcf4a 100644 --- a/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/ui_components/apm_rule_params_container/index.tsx @@ -5,24 +5,48 @@ * 2.0. */ -import { EuiFlexGrid, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React, { useEffect } from 'react'; +import { EuiCallOut, EuiFlexGrid, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import React, { useEffect, useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import moment from 'moment'; +import { + getTimeUnitLabel, + TIME_UNITS, +} from '@kbn/triggers-actions-ui-plugin/public'; + +interface MinimumWindowSize { + value: number; + unit: TIME_UNITS; +} interface Props { setRuleParams: (key: string, value: any) => void; setRuleProperty: (key: string, value: any) => void; - defaults: Record; + defaultParams: Record; fields: React.ReactNode[]; chartPreview?: React.ReactNode; + minimumWindowSize?: MinimumWindowSize; } export function ApmRuleParamsContainer(props: Props) { - const { fields, setRuleParams, defaults, chartPreview } = props; + const { + fields, + setRuleParams, + defaultParams, + chartPreview, + minimumWindowSize, + } = props; const params: Record = { - ...defaults, + ...defaultParams, }; + const showMinimumWindowSizeWarning = useShowMinimumWindowSize({ + windowSize: params.windowSize, + windowUnit: params.windowUnit, + minimumWindowSize, + }); + useEffect(() => { // we only want to run this on mount to set default values Object.keys(params).forEach((key) => { @@ -33,6 +57,10 @@ export function ApmRuleParamsContainer(props: Props) { }, []); return ( <> + {showMinimumWindowSizeWarning && minimumWindowSize && ( + + )} + {fields.map((field, index) => ( @@ -41,8 +69,70 @@ export function ApmRuleParamsContainer(props: Props) { ))} + {chartPreview} ); } + +function MinimumWindowSizeWarning({ + minimumWindowSize, +}: { + minimumWindowSize: MinimumWindowSize; +}) { + const description = i18n.translate( + 'xpack.apm.alertTypes.minimumWindowSize.description', + { + defaultMessage: + 'The recommended minimum value is {sizeValue} {sizeUnit}. This is to ensure that the alert has enough data to evaluate. If you choose a value that is too low, the alert may not fire as expected.', + values: { + sizeValue: minimumWindowSize.value, + sizeUnit: getTimeUnitLabel(minimumWindowSize.unit), + }, + } + ); + + return ( + +

{description}

+
+ ); +} + +function useShowMinimumWindowSize({ + windowSize, + windowUnit, + minimumWindowSize, +}: { + windowSize?: number; + windowUnit?: TIME_UNITS; + minimumWindowSize?: MinimumWindowSize; +}) { + const [showMinimumWindowSizeWarning, setShowMinimumWindowSizeWarning] = + useState(false); + + useEffect(() => { + if (windowSize === undefined || minimumWindowSize === undefined) { + return; + } + + const currentWindowSize = moment + .duration(windowSize, windowUnit) + .asMilliseconds(); + const minimumWindowSizeAsMillis = moment + .duration(minimumWindowSize.value, minimumWindowSize.unit) + .asMilliseconds(); + + const shouldShow = currentWindowSize < minimumWindowSizeAsMillis; + setShowMinimumWindowSizeWarning(shouldShow); + }, [windowSize, windowUnit, minimumWindowSize]); + + return showMinimumWindowSizeWarning; +} diff --git a/x-pack/plugins/apm/public/components/alerting/utils/helper.ts b/x-pack/plugins/apm/public/components/alerting/utils/helper.ts index 4032c33fa30b..e5dc2a78b5a1 100644 --- a/x-pack/plugins/apm/public/components/alerting/utils/helper.ts +++ b/x-pack/plugins/apm/public/components/alerting/utils/helper.ts @@ -4,6 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + +import { TIME_UNITS } from '@kbn/triggers-actions-ui-plugin/public'; import moment from 'moment'; export interface AlertMetadata { @@ -14,8 +16,6 @@ export interface AlertMetadata { end?: string; } -export type TimeUnit = 's' | 'm' | 'h' | 'd'; - const BUCKET_SIZE = 20; export function getIntervalAndTimeRange({ @@ -23,7 +23,7 @@ export function getIntervalAndTimeRange({ windowUnit, }: { windowSize: number; - windowUnit: TimeUnit; + windowUnit: TIME_UNITS; }) { const end = Date.now(); const start = diff --git a/x-pack/plugins/triggers_actions_ui/public/index.ts b/x-pack/plugins/triggers_actions_ui/public/index.ts index 7500a66b70f1..0a560be762eb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/index.ts @@ -142,7 +142,7 @@ export { loadRule } from './application/lib/rule_api/get_rule'; export { loadAllActions } from './application/lib/action_connector_api'; export { suspendedComponentWithProps } from './application/lib/suspended_component_with_props'; export { loadActionTypes } from './application/lib/action_connector_api/connector_types'; -export type { TIME_UNITS } from './application/constants'; +export { TIME_UNITS } from './application/constants'; export { getTimeUnitLabel } from './common/lib/get_time_unit_label'; export type { TriggersAndActionsUiServices } from './application/app'; From 5c50cd4ffd35e8810e8bbdc5b960d76407098edc Mon Sep 17 00:00:00 2001 From: Zacqary Adam Xeper Date: Mon, 31 Oct 2022 19:26:53 -0500 Subject: [PATCH 39/87] [RAM] Allow users to see event logs from all spaces they have access to (#140449) * Add all_namespaces prop to global logs api * Display space column and disable link on inactive spaces * Add ability to link across spaces * Fix allNamespace query on default space * Fix KPI and link space switch to permissions * Open alternate space rules in new tab * Fix Jest 11 * Fix Jest 1 * Fix Jest 4 and 10 * Fix i18n * Move space column visibility out of data grid --- .../alerting/common/execution_log_types.ts | 1 + .../lib/get_execution_log_aggregation.test.ts | 11 +++ .../lib/get_execution_log_aggregation.ts | 8 +- .../server/routes/get_action_error_log.ts | 11 ++- .../server/routes/get_global_execution_kpi.ts | 5 +- .../routes/get_global_execution_logs.test.ts | 2 + .../routes/get_global_execution_logs.ts | 5 +- .../routes/get_rule_execution_log.test.ts | 2 + .../alerting/server/routes/lib/index.ts | 1 + .../server/routes/lib/rewrite_namespaces.ts | 11 +++ .../alerting/server/rules_client.mock.ts | 1 + .../server/rules_client/rules_client.ts | 95 +++++++++++++++++-- .../tests/get_action_error_log.test.ts | 61 ++++++++++++ .../tests/get_execution_log.test.ts | 4 + .../server/es/cluster_client_adapter.mock.ts | 1 + .../server/es/cluster_client_adapter.test.ts | 90 ++++++++++++------ .../server/es/cluster_client_adapter.ts | 80 ++++++++++++++-- .../event_log/server/event_log_client.mock.ts | 1 + .../event_log/server/event_log_client.test.ts | 2 +- .../event_log/server/event_log_client.ts | 30 +++++- x-pack/plugins/event_log/server/types.ts | 10 +- .../public/application/constants/index.ts | 1 + .../rule_api/load_action_error_log.test.ts | 2 + .../lib/rule_api/load_action_error_log.ts | 6 ++ .../load_execution_log_aggregations.ts | 7 +- .../load_global_execution_kpi_aggregations.ts | 3 + .../logs_list/components/logs_list.tsx | 1 + .../rule_action_error_log_flyout.tsx | 26 ++++- .../components/rule_error_log.tsx | 6 +- .../components/rule_event_log_data_grid.tsx | 41 ++++++-- ...rule_event_log_list_cell_renderer.test.tsx | 75 ++++++++++++++- .../rule_event_log_list_cell_renderer.tsx | 66 +++++++++++-- .../components/rule_event_log_list_kpi.tsx | 5 +- .../components/rule_event_log_list_table.tsx | 81 +++++++++++++++- .../common/lib/kibana/__mocks__/index.ts | 1 + .../public/common/lib/kibana/index.ts | 1 + .../common/lib/kibana/use_spaces_data.tsx | 24 +++++ 37 files changed, 704 insertions(+), 74 deletions(-) create mode 100644 x-pack/plugins/alerting/server/routes/lib/rewrite_namespaces.ts create mode 100644 x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.tsx diff --git a/x-pack/plugins/alerting/common/execution_log_types.ts b/x-pack/plugins/alerting/common/execution_log_types.ts index 223b45cb9892..2d5e34df8f76 100644 --- a/x-pack/plugins/alerting/common/execution_log_types.ts +++ b/x-pack/plugins/alerting/common/execution_log_types.ts @@ -61,6 +61,7 @@ export interface IExecutionLog { schedule_delay_ms: number; timed_out: boolean; rule_id: string; + space_ids: string[]; rule_name: string; } diff --git a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts index ee05e3cda32f..6a57baaacef2 100644 --- a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts +++ b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts @@ -280,6 +280,7 @@ describe('getExecutionLogAggregation', () => { 'error.message', 'kibana.version', 'rule.id', + 'kibana.space_ids', 'rule.name', 'kibana.alerting.outcome', ], @@ -486,6 +487,7 @@ describe('getExecutionLogAggregation', () => { 'error.message', 'kibana.version', 'rule.id', + 'kibana.space_ids', 'rule.name', 'kibana.alerting.outcome', ], @@ -692,6 +694,7 @@ describe('getExecutionLogAggregation', () => { 'error.message', 'kibana.version', 'rule.id', + 'kibana.space_ids', 'rule.name', 'kibana.alerting.outcome', ], @@ -954,6 +957,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3074, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -976,6 +980,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); @@ -1203,6 +1208,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3074, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -1225,6 +1231,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); @@ -1444,6 +1451,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3074, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -1466,6 +1474,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); @@ -1690,6 +1699,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, { id: '61bb867b-661a-471f-bf92-23471afa10b3', @@ -1712,6 +1722,7 @@ describe('formatExecutionLogResult', () => { schedule_delay_ms: 3133, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: [], }, ], }); diff --git a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts index c5a2c18ad679..b65499de20d4 100644 --- a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts +++ b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts @@ -18,6 +18,7 @@ const DEFAULT_MAX_BUCKETS_LIMIT = 1000; // do not retrieve more than this number const DEFAULT_MAX_KPI_BUCKETS_LIMIT = 10000; const RULE_ID_FIELD = 'rule.id'; +const SPACE_ID_FIELD = 'kibana.space_ids'; const RULE_NAME_FIELD = 'rule.name'; const PROVIDER_FIELD = 'event.provider'; const START_FIELD = 'event.start'; @@ -410,6 +411,7 @@ export function getExecutionLogAggregation({ ERROR_MESSAGE_FIELD, VERSION_FIELD, RULE_ID_FIELD, + SPACE_ID_FIELD, RULE_NAME_FIELD, ALERTING_OUTCOME_FIELD, ], @@ -494,8 +496,9 @@ function formatExecutionLogAggBucket(bucket: IExecutionUuidAggBucket): IExecutio status === 'failure' ? `${outcomeMessage} - ${outcomeErrorMessage}` : outcomeMessage; const version = outcomeAndMessage.kibana?.version ?? ''; - const ruleId = outcomeAndMessage.rule?.id ?? ''; - const ruleName = outcomeAndMessage.rule?.name ?? ''; + const ruleId = outcomeAndMessage ? outcomeAndMessage?.rule?.id ?? '' : ''; + const spaceIds = outcomeAndMessage ? outcomeAndMessage?.kibana?.space_ids ?? [] : []; + const ruleName = outcomeAndMessage ? outcomeAndMessage.rule?.name ?? '' : ''; return { id: bucket?.key ?? '', timestamp: bucket?.ruleExecution?.executeStartTime.value_as_string ?? '', @@ -515,6 +518,7 @@ function formatExecutionLogAggBucket(bucket: IExecutionUuidAggBucket): IExecutio schedule_delay_ms: scheduleDelayUs / Millis2Nanos, timed_out: timedOut, rule_id: ruleId, + space_ids: spaceIds, rule_name: ruleName, }; } diff --git a/x-pack/plugins/alerting/server/routes/get_action_error_log.ts b/x-pack/plugins/alerting/server/routes/get_action_error_log.ts index c833b65e34bb..7e8028cad7f1 100644 --- a/x-pack/plugins/alerting/server/routes/get_action_error_log.ts +++ b/x-pack/plugins/alerting/server/routes/get_action_error_log.ts @@ -34,15 +34,19 @@ const querySchema = schema.object({ per_page: schema.number({ defaultValue: 10, min: 1 }), page: schema.number({ defaultValue: 1, min: 1 }), sort: sortFieldsSchema, + namespace: schema.maybe(schema.string()), + with_auth: schema.maybe(schema.boolean()), }); const rewriteReq: RewriteRequestCase = ({ date_start: dateStart, date_end: dateEnd, per_page: perPage, + namespace, ...rest }) => ({ ...rest, + namespace, dateStart, dateEnd, perPage, @@ -64,8 +68,13 @@ export const getActionErrorLogRoute = ( verifyAccessAndContext(licenseState, async function (context, req, res) { const rulesClient = (await context.alerting).getRulesClient(); const { id } = req.params; + const withAuth = req.query.with_auth; + const rewrittenReq = rewriteReq({ id, ...req.query }); + const getter = ( + withAuth ? rulesClient.getActionErrorLogWithAuth : rulesClient.getActionErrorLog + ).bind(rulesClient); return res.ok({ - body: await rulesClient.getActionErrorLog(rewriteReq({ id, ...req.query })), + body: await getter(rewrittenReq), }); }) ) diff --git a/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts b/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts index 29937cc3d8c9..2aec9d998a9e 100644 --- a/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts +++ b/x-pack/plugins/alerting/server/routes/get_global_execution_kpi.ts @@ -7,7 +7,7 @@ import { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; -import { RewriteRequestCase, verifyAccessAndContext } from './lib'; +import { RewriteRequestCase, verifyAccessAndContext, rewriteNamespaces } from './lib'; import { GetGlobalExecutionKPIParams } from '../rules_client'; import { ILicenseState } from '../lib'; @@ -15,14 +15,17 @@ const querySchema = schema.object({ date_start: schema.string(), date_end: schema.maybe(schema.string()), filter: schema.maybe(schema.string()), + namespaces: schema.maybe(schema.arrayOf(schema.string())), }); const rewriteReq: RewriteRequestCase = ({ date_start: dateStart, date_end: dateEnd, + namespaces, ...rest }) => ({ ...rest, + namespaces: rewriteNamespaces(namespaces), dateStart, dateEnd, }); diff --git a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts index 43b08ed0787e..3ee2b0d1816b 100644 --- a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.test.ts @@ -47,6 +47,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: ['namespace'], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -69,6 +70,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3008, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: ['namespace'], }, ], }; diff --git a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts index 4695e5e7bdf8..e08ec1ac5bcb 100644 --- a/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts +++ b/x-pack/plugins/alerting/server/routes/get_global_execution_logs.ts @@ -9,7 +9,7 @@ import { IRouter } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; import { ILicenseState } from '../lib'; import { GetGlobalExecutionLogParams } from '../rules_client'; -import { RewriteRequestCase, verifyAccessAndContext } from './lib'; +import { RewriteRequestCase, verifyAccessAndContext, rewriteNamespaces } from './lib'; import { AlertingRequestHandlerContext, INTERNAL_BASE_ALERTING_API_PATH } from '../types'; const sortOrderSchema = schema.oneOf([schema.literal('asc'), schema.literal('desc')]); @@ -38,15 +38,18 @@ const querySchema = schema.object({ per_page: schema.number({ defaultValue: 10, min: 1 }), page: schema.number({ defaultValue: 1, min: 1 }), sort: sortFieldsSchema, + namespaces: schema.maybe(schema.arrayOf(schema.string())), }); const rewriteReq: RewriteRequestCase = ({ date_start: dateStart, date_end: dateEnd, per_page: perPage, + namespaces, ...rest }) => ({ ...rest, + namespaces: rewriteNamespaces(namespaces), dateStart, dateEnd, perPage, diff --git a/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts b/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts index 048da6cbabeb..eb22a6429809 100644 --- a/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts @@ -48,6 +48,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: ['namespace'], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -70,6 +71,7 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3008, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule_name', + space_ids: ['namespace'], }, ], }; diff --git a/x-pack/plugins/alerting/server/routes/lib/index.ts b/x-pack/plugins/alerting/server/routes/lib/index.ts index e772f091bb05..90d903ada6ee 100644 --- a/x-pack/plugins/alerting/server/routes/lib/index.ts +++ b/x-pack/plugins/alerting/server/routes/lib/index.ts @@ -19,3 +19,4 @@ export type { export { verifyAccessAndContext } from './verify_access_and_context'; export { countUsageOfPredefinedIds } from './count_usage_of_predefined_ids'; export { rewriteRule } from './rewrite_rule'; +export { rewriteNamespaces } from './rewrite_namespaces'; diff --git a/x-pack/plugins/alerting/server/routes/lib/rewrite_namespaces.ts b/x-pack/plugins/alerting/server/routes/lib/rewrite_namespaces.ts new file mode 100644 index 000000000000..5339b41526ef --- /dev/null +++ b/x-pack/plugins/alerting/server/routes/lib/rewrite_namespaces.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const rewriteNamespaces = (namespaces?: Array) => + namespaces + ? namespaces.map((id: string | undefined) => (id === 'default' ? undefined : id)) + : undefined; diff --git a/x-pack/plugins/alerting/server/rules_client.mock.ts b/x-pack/plugins/alerting/server/rules_client.mock.ts index aa29e64d2f46..46a6c36bdea2 100644 --- a/x-pack/plugins/alerting/server/rules_client.mock.ts +++ b/x-pack/plugins/alerting/server/rules_client.mock.ts @@ -34,6 +34,7 @@ const createRulesClientMock = () => { getGlobalExecutionKpiWithAuth: jest.fn(), getGlobalExecutionLogWithAuth: jest.fn(), getActionErrorLog: jest.fn(), + getActionErrorLogWithAuth: jest.fn(), getSpaceId: jest.fn(), bulkEdit: jest.fn(), bulkDeleteRules: jest.fn(), diff --git a/x-pack/plugins/alerting/server/rules_client/rules_client.ts b/x-pack/plugins/alerting/server/rules_client/rules_client.ts index 777cf340b53e..bd4f9deb36b5 100644 --- a/x-pack/plugins/alerting/server/rules_client/rules_client.ts +++ b/x-pack/plugins/alerting/server/rules_client/rules_client.ts @@ -419,6 +419,7 @@ export interface GetGlobalExecutionKPIParams { dateStart: string; dateEnd?: string; filter?: string; + namespaces?: Array; } export interface GetGlobalExecutionLogParams { @@ -428,6 +429,7 @@ export interface GetGlobalExecutionLogParams { page: number; perPage: number; sort: estypes.Sort; + namespaces?: Array; } export interface GetActionErrorLogByIdParams { @@ -438,6 +440,7 @@ export interface GetActionErrorLogByIdParams { page: number; perPage: number; sort: estypes.Sort; + namespace?: string; } interface ScheduleTaskOptions { @@ -458,6 +461,9 @@ const MAX_RULES_NUMBER_FOR_BULK_OPERATION = 10000; const API_KEY_GENERATE_CONCURRENCY = 50; const RULE_TYPE_CHECKS_CONCURRENCY = 50; +const actionErrorLogDefaultFilter = + 'event.provider:actions AND ((event.action:execute AND (event.outcome:failure OR kibana.alerting.status:warning)) OR (event.action:execute-timeout))'; + const alertingAuthorizationFilterOpts: AlertingAuthorizationFilterOpts = { type: AlertingAuthorizationFilterType.KQL, fieldNames: { ruleTypeId: 'alert.attributes.alertTypeId', consumer: 'alert.attributes.consumer' }, @@ -951,6 +957,7 @@ export class RulesClient { page, perPage, sort, + namespaces, }: GetGlobalExecutionLogParams): Promise { this.logger.debug(`getGlobalExecutionLogWithAuth(): getting global execution log`); @@ -1001,7 +1008,8 @@ export class RulesClient { perPage, sort, }), - } + }, + namespaces ); return formatExecutionLogResult(aggResult); @@ -1050,9 +1058,6 @@ export class RulesClient { }) ); - const defaultFilter = - 'event.provider:actions AND ((event.action:execute AND (event.outcome:failure OR kibana.alerting.status:warning)) OR (event.action:execute-timeout))'; - // default duration of instance summary is 60 * rule interval const dateNow = new Date(); const parsedDateStart = parseDate(dateStart, 'dateStart', dateNow); @@ -1069,7 +1074,9 @@ export class RulesClient { end: parsedDateEnd.toISOString(), page, per_page: perPage, - filter: filter ? `(${defaultFilter}) AND (${filter})` : defaultFilter, + filter: filter + ? `(${actionErrorLogDefaultFilter}) AND (${filter})` + : actionErrorLogDefaultFilter, sort: convertEsSortToEventLogSort(sort), }, rule.legacyId !== null ? [rule.legacyId] : undefined @@ -1083,10 +1090,85 @@ export class RulesClient { } } + public async getActionErrorLogWithAuth({ + id, + dateStart, + dateEnd, + filter, + page, + perPage, + sort, + namespace, + }: GetActionErrorLogByIdParams): Promise { + this.logger.debug(`getActionErrorLogWithAuth(): getting action error logs for rule ${id}`); + + let authorizationTuple; + try { + authorizationTuple = await this.authorization.getFindAuthorizationFilter( + AlertingAuthorizationEntity.Alert, + { + type: AlertingAuthorizationFilterType.KQL, + fieldNames: { + ruleTypeId: 'kibana.alert.rule.rule_type_id', + consumer: 'kibana.alert.rule.consumer', + }, + } + ); + } catch (error) { + this.auditLogger?.log( + ruleAuditEvent({ + action: RuleAuditAction.GET_ACTION_ERROR_LOG, + error, + }) + ); + throw error; + } + + this.auditLogger?.log( + ruleAuditEvent({ + action: RuleAuditAction.GET_ACTION_ERROR_LOG, + savedObject: { type: 'alert', id }, + }) + ); + + // default duration of instance summary is 60 * rule interval + const dateNow = new Date(); + const parsedDateStart = parseDate(dateStart, 'dateStart', dateNow); + const parsedDateEnd = parseDate(dateEnd, 'dateEnd', dateNow); + + const eventLogClient = await this.getEventLogClient(); + + try { + const errorResult = await eventLogClient.findEventsWithAuthFilter( + 'alert', + [id], + authorizationTuple.filter as KueryNode, + namespace, + { + start: parsedDateStart.toISOString(), + end: parsedDateEnd.toISOString(), + page, + per_page: perPage, + filter: filter + ? `(${actionErrorLogDefaultFilter}) AND (${filter})` + : actionErrorLogDefaultFilter, + sort: convertEsSortToEventLogSort(sort), + } + ); + return formatExecutionErrorsResult(errorResult); + } catch (err) { + this.logger.debug( + `rulesClient.getActionErrorLog(): error searching event log for rule ${id}: ${err.message}` + ); + throw err; + } + } + public async getGlobalExecutionKpiWithAuth({ dateStart, dateEnd, filter, + namespaces, }: GetGlobalExecutionKPIParams) { this.logger.debug(`getGlobalExecutionLogWithAuth(): getting global execution log`); @@ -1132,7 +1214,8 @@ export class RulesClient { start: parsedDateStart.toISOString(), end: parsedDateEnd.toISOString(), aggs: getExecutionKPIAggregation(filter), - } + }, + namespaces ); return formatExecutionKPIResult(aggResult); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts index 3a18634b4f5d..6b635abe5d7f 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts @@ -8,6 +8,7 @@ import { RulesClient, ConstructorOptions, GetActionErrorLogByIdParams } from '../rules_client'; import { savedObjectsClientMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; +import { fromKueryExpression } from '@kbn/es-query'; import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { alertingAuthorizationMock } from '../../authorization/alerting_authorization.mock'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; @@ -574,3 +575,63 @@ describe('getActionErrorLog()', () => { }); }); }); + +describe('getActionErrorLogWithAuth()', () => { + let rulesClient: RulesClient; + + beforeEach(() => { + rulesClient = new RulesClient(rulesClientParams); + }); + + test('returns the expected return values when called', async () => { + const ruleSO = getRuleSavedObject({}); + authorization.getFindAuthorizationFilter.mockResolvedValue({ + filter: fromKueryExpression('*'), + ensureRuleTypeIsAuthorized() {}, + }); + unsecuredSavedObjectsClient.get.mockResolvedValueOnce(ruleSO); + eventLogClient.findEventsWithAuthFilter.mockResolvedValueOnce(findResults); + + const result = await rulesClient.getActionErrorLogWithAuth(getActionErrorLogParams()); + expect(result).toEqual({ + totalErrors: 5, + errors: [ + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.106Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.102Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.098Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.096Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.086Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + ], + }); + }); +}); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts index 83b85f4879cf..ffc40cd705ab 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts @@ -385,6 +385,7 @@ describe('getExecutionLogForRule()', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -407,6 +408,7 @@ describe('getExecutionLogForRule()', () => { schedule_delay_ms: 3345, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, ], }); @@ -719,6 +721,7 @@ describe('getGlobalExecutionLogWithAuth()', () => { schedule_delay_ms: 3126, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, { id: '41b2755e-765a-4044-9745-b03875d5e79a', @@ -741,6 +744,7 @@ describe('getGlobalExecutionLogWithAuth()', () => { schedule_delay_ms: 3345, rule_id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', rule_name: 'rule-name', + space_ids: [], }, ], }); diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts index 3cb1b8d12c0b..adf1ecf0f788 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.mock.ts @@ -24,6 +24,7 @@ const createClusterClientMock = () => { getExistingIndexAliases: jest.fn(), setIndexAliasToHidden: jest.fn(), queryEventsBySavedObjects: jest.fn(), + queryEventsWithAuthFilter: jest.fn(), aggregateEventsBySavedObjects: jest.fn(), aggregateEventsWithAuthFilter: jest.fn(), shutdown: jest.fn(), diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts index ea3e98e599ab..a7a9e8bd0867 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts @@ -779,7 +779,7 @@ describe('aggregateEventsWithAuthFilter', () => { }); const options: AggregateEventsWithAuthFilter = { index: 'index-name', - namespace: 'namespace', + namespaces: ['namespace'], type: 'saved-object-type', aggregateOptions: DEFAULT_OPTIONS as AggregateOptionsType, authFilter: fromKueryExpression('test:test'), @@ -1515,7 +1515,7 @@ describe('getQueryBody', () => { describe('getQueryBodyWithAuthFilter', () => { const options = { index: 'index-name', - namespace: undefined, + namespaces: undefined, type: 'saved-object-type', authFilter: fromKueryExpression('test:test'), }; @@ -1559,11 +1559,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1580,7 +1586,7 @@ describe('getQueryBodyWithAuthFilter', () => { expect( getQueryBodyWithAuthFilter( logger, - { ...options, namespace: 'namespace' } as AggregateEventsWithAuthFilter, + { ...options, namespaces: ['namespace'] } as AggregateEventsWithAuthFilter, {} ) ).toEqual({ @@ -1619,10 +1625,16 @@ describe('getQueryBodyWithAuthFilter', () => { }, }, { - term: { - 'kibana.saved_objects.namespace': { - value: 'namespace', - }, + bool: { + should: [ + { + term: { + 'kibana.saved_objects.namespace': { + value: 'namespace', + }, + }, + }, + ], }, }, ], @@ -1713,11 +1725,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1772,11 +1790,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1838,11 +1862,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], @@ -1905,11 +1935,17 @@ describe('getQueryBodyWithAuthFilter', () => { }, { bool: { - must_not: { - exists: { - field: 'kibana.saved_objects.namespace', + should: [ + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, + }, + }, }, - }, + ], }, }, ], diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts index e807899d6290..0d38895dbd80 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts @@ -50,14 +50,26 @@ interface QueryOptionsEventsBySavedObjectFilter { legacyIds?: string[]; } -export interface AggregateEventsWithAuthFilter { +interface QueryOptionsEventsWithAuthFilter { index: string; namespace: string | undefined; type: string; + ids: string[]; + authFilter: KueryNode; +} + +export interface AggregateEventsWithAuthFilter { + index: string; + namespaces?: Array; + type: string; authFilter: KueryNode; aggregateOptions: AggregateOptionsType; } +export type FindEventsOptionsWithAuthFilter = QueryOptionsEventsWithAuthFilter & { + findOptions: FindOptionsType; +}; + export type FindEventsOptionsBySavedObjectFilter = QueryOptionsEventsBySavedObjectFilter & { findOptions: FindOptionsType; }; @@ -70,6 +82,12 @@ export interface AggregateEventsBySavedObjectResult { aggregations: Record | undefined; } +type GetQueryBodyWithAuthFilterOpts = + | (FindEventsOptionsWithAuthFilter & { + namespaces: AggregateEventsWithAuthFilter['namespaces']; + }) + | AggregateEventsWithAuthFilter; + // eslint-disable-next-line @typescript-eslint/no-explicit-any type AliasAny = any; @@ -389,6 +407,50 @@ export class ClusterClientAdapter { + const { index, type, ids, findOptions } = queryOptions; + const { page, per_page: perPage, sort } = findOptions; + + const esClient = await this.elasticsearchClientPromise; + + const query = getQueryBodyWithAuthFilter( + this.logger, + { ...queryOptions, namespaces: [queryOptions.namespace] }, + pick(queryOptions.findOptions, ['start', 'end', 'filter']) + ); + + const body: estypes.SearchRequest['body'] = { + size: perPage, + from: (page - 1) * perPage, + query, + ...(sort + ? { sort: sort.map((s) => ({ [s.sort_field]: { order: s.sort_order } })) as estypes.Sort } + : {}), + }; + + try { + const { + hits: { hits, total }, + } = await esClient.search({ + index, + track_total_hits: true, + body, + }); + return { + page, + per_page: perPage, + total: isNumber(total) ? total : total!.value, + data: hits.map((hit) => hit._source), + }; + } catch (err) { + throw new Error( + `querying for Event Log by for type "${type}" and ids "${ids}" failed with: ${err.message}` + ); + } + } + public async aggregateEventsBySavedObjects( queryOptions: AggregateEventsOptionsBySavedObjectFilter ): Promise { @@ -462,13 +524,15 @@ export class ClusterClientAdapter + getNamespaceQuery(namespace) + ); let dslFilterQuery: estypes.QueryDslBoolQuery['filter']; try { const filterKueryNode = filter ? fromKueryExpression(filter) : null; @@ -501,8 +565,12 @@ export function getQueryBodyWithAuthFilter( }, }, }, - // @ts-expect-error undefined is not assignable as QueryDslTermQuery value - namespaceQuery, + { + bool: { + // @ts-expect-error undefined is not assignable as QueryDslTermQuery value + should: namespaceQuery, + }, + }, ]; const musts: estypes.QueryDslQueryContainer[] = [ diff --git a/x-pack/plugins/event_log/server/event_log_client.mock.ts b/x-pack/plugins/event_log/server/event_log_client.mock.ts index 0e11ded65be6..a44a319626de 100644 --- a/x-pack/plugins/event_log/server/event_log_client.mock.ts +++ b/x-pack/plugins/event_log/server/event_log_client.mock.ts @@ -10,6 +10,7 @@ import { IEventLogClient } from './types'; const createEventLogClientMock = () => { const mock: jest.Mocked = { findEventsBySavedObjectIds: jest.fn(), + findEventsWithAuthFilter: jest.fn(), aggregateEventsBySavedObjectIds: jest.fn(), aggregateEventsWithAuthFilter: jest.fn(), }; diff --git a/x-pack/plugins/event_log/server/event_log_client.test.ts b/x-pack/plugins/event_log/server/event_log_client.test.ts index 5e4fd08819fb..b91ef3ef4383 100644 --- a/x-pack/plugins/event_log/server/event_log_client.test.ts +++ b/x-pack/plugins/event_log/server/event_log_client.test.ts @@ -256,7 +256,7 @@ describe('EventLogStart', () => { }); expect(esContext.esAdapter.aggregateEventsWithAuthFilter).toHaveBeenCalledWith({ index: esContext.esNames.indexPattern, - namespace: undefined, + namespaces: [undefined], type: 'saved-object-type', authFilter: testAuthFilter, aggregateOptions: { diff --git a/x-pack/plugins/event_log/server/event_log_client.ts b/x-pack/plugins/event_log/server/event_log_client.ts index 85a798d0fb8b..9a35868d248e 100644 --- a/x-pack/plugins/event_log/server/event_log_client.ts +++ b/x-pack/plugins/event_log/server/event_log_client.ts @@ -112,6 +112,31 @@ export class EventLogClient implements IEventLogClient { }); } + public async findEventsWithAuthFilter( + type: string, + ids: string[], + authFilter: KueryNode, + namespace: string | undefined, + options?: Partial + ): Promise { + if (!authFilter) { + throw new Error('No authorization filter defined!'); + } + + const findOptions = queryOptionsSchema.validate(options ?? {}); + + return await this.esContext.esAdapter.queryEventsWithAuthFilter({ + index: this.esContext.esNames.indexPattern, + namespace: namespace + ? this.spacesService?.spaceIdToNamespace(namespace) + : await this.getNamespace(), + type, + ids, + findOptions, + authFilter, + }); + } + public async aggregateEventsBySavedObjectIds( type: string, ids: string[], @@ -142,7 +167,8 @@ export class EventLogClient implements IEventLogClient { public async aggregateEventsWithAuthFilter( type: string, authFilter: KueryNode, - options?: AggregateOptionsType + options?: AggregateOptionsType, + namespaces?: Array ) { if (!authFilter) { throw new Error('No authorization filter defined!'); @@ -158,7 +184,7 @@ export class EventLogClient implements IEventLogClient { return await this.esContext.esAdapter.aggregateEventsWithAuthFilter({ index: this.esContext.esNames.indexPattern, - namespace: await this.getNamespace(), + namespaces: namespaces ?? [await this.getNamespace()], type, authFilter, aggregateOptions: { ...aggregateOptions, aggs } as AggregateOptionsType, diff --git a/x-pack/plugins/event_log/server/types.ts b/x-pack/plugins/event_log/server/types.ts index d610a8bff9c2..07a7e7ed2f7e 100644 --- a/x-pack/plugins/event_log/server/types.ts +++ b/x-pack/plugins/event_log/server/types.ts @@ -57,6 +57,13 @@ export interface IEventLogClient { options?: Partial, legacyIds?: string[] ): Promise; + findEventsWithAuthFilter( + type: string, + ids: string[], + authFilter: KueryNode, + namespace: string | undefined, + options?: Partial + ): Promise; aggregateEventsBySavedObjectIds( type: string, ids: string[], @@ -66,7 +73,8 @@ export interface IEventLogClient { aggregateEventsWithAuthFilter( type: string, authFilter: KueryNode, - options?: Partial + options?: Partial, + namespaces?: Array ): Promise; } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts b/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts index 19d3b038c635..a8b15215632c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/constants/index.ts @@ -44,6 +44,7 @@ export const DEFAULT_RULE_INTERVAL = '1m'; export const RULE_EXECUTION_LOG_COLUMN_IDS = [ 'rule_id', 'rule_name', + 'space_ids', 'id', 'timestamp', 'execution_duration', diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts index 56de4f5c4c89..de273fbf394e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.test.ts @@ -118,9 +118,11 @@ describe('loadActionErrorLog', () => { "date_end": "2022-03-23T16:17:53.482Z", "date_start": "2022-03-23T16:17:53.482Z", "filter": "(message: \\"test\\" OR error.message: \\"test\\") and kibana.alert.rule.execution.uuid: 123", + "namespace": undefined, "page": 1, "per_page": 10, "sort": "[{\\"@timestamp\\":{\\"order\\":\\"asc\\"}}]", + "with_auth": false, }, }, ] diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts index 10f2879085cd..7bfef44335a4 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_action_error_log.ts @@ -28,6 +28,8 @@ export interface LoadActionErrorLogProps { perPage?: number; page?: number; sort?: SortField[]; + namespace?: string; + withAuth?: boolean; } const SORT_MAP: Record = { @@ -60,6 +62,8 @@ export const loadActionErrorLog = ({ perPage = 10, page = 0, sort, + namespace, + withAuth = false, }: LoadActionErrorLogProps & { http: HttpSetup }) => { const renamedSort = getRenamedSort(sort); const filter = getFilter({ runId, message }); @@ -76,6 +80,8 @@ export const loadActionErrorLog = ({ // whereas data grid sorts are 0 indexed. page: page + 1, sort: renamedSort.length ? JSON.stringify(renamedSort) : undefined, + namespace, + with_auth: withAuth, }, } ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts index bf5e529499b4..671a1edce467 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_execution_log_aggregations.ts @@ -59,7 +59,10 @@ export interface LoadExecutionLogAggregationsProps { sort?: SortField[]; } -export type LoadGlobalExecutionLogAggregationsProps = Omit; +export type LoadGlobalExecutionLogAggregationsProps = Omit< + LoadExecutionLogAggregationsProps, + 'id' +> & { namespaces?: Array }; export const loadExecutionLogAggregations = async ({ id, @@ -103,6 +106,7 @@ export const loadGlobalExecutionLogAggregations = async ({ perPage = 10, page = 0, sort = [], + namespaces, }: LoadGlobalExecutionLogAggregationsProps & { http: HttpSetup }) => { const sortField: any[] = sort; const filter = getFilter({ outcomeFilter, message }); @@ -119,6 +123,7 @@ export const loadGlobalExecutionLogAggregations = async ({ // whereas data grid sorts are 0 indexed. page: page + 1, sort: sortField.length ? JSON.stringify(sortField) : undefined, + namespaces: namespaces ? JSON.stringify(namespaces) : undefined, }, } ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts index 332e14ad4383..7052257d1fc8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/load_global_execution_kpi_aggregations.ts @@ -16,6 +16,7 @@ export interface LoadGlobalExecutionKPIAggregationsProps { message?: string; dateStart: string; dateEnd?: string; + namespaces?: Array; } export const loadGlobalExecutionKPIAggregations = ({ @@ -25,6 +26,7 @@ export const loadGlobalExecutionKPIAggregations = ({ message, dateStart, dateEnd, + namespaces, }: LoadGlobalExecutionKPIAggregationsProps & { http: HttpSetup }) => { const filter = getFilter({ outcomeFilter, message }); @@ -33,6 +35,7 @@ export const loadGlobalExecutionKPIAggregations = ({ filter: filter.length ? filter.join(' and ') : undefined, date_start: dateStart, date_end: dateEnd, + namespaces: namespaces ? JSON.stringify(namespaces) : namespaces, }, }); }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx index 79e617ee05a4..404457af8fd0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/logs_list/components/logs_list.tsx @@ -20,6 +20,7 @@ export const LogsList = () => { refreshToken: 0, initialPageSize: 50, hasRuleNames: true, + hasAllSpaceSwitch: true, localStorageKey: GLOBAL_EVENT_LOG_LIST_STORAGE_KEY, }); }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx index 8c46e3574560..aa914e2818c0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_action_error_log_flyout.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, @@ -28,17 +28,29 @@ export interface RuleActionErrorLogFlyoutProps { runLog: IExecutionLog; refreshToken?: number; onClose: () => void; + activeSpaceId?: string; } export const RuleActionErrorLogFlyout = (props: RuleActionErrorLogFlyoutProps) => { - const { runLog, refreshToken, onClose } = props; + const { runLog, refreshToken, onClose, activeSpaceId } = props; const { euiTheme } = useEuiTheme(); - const { id, rule_id: ruleId, message, num_errored_actions: totalErrors } = runLog; + const { + id, + rule_id: ruleId, + message, + num_errored_actions: totalErrors, + space_ids: spaceIds = [], + } = runLog; const isFlyoutPush = useIsWithinBreakpoints(['xl']); + const logFromDifferentSpace = useMemo( + () => Boolean(activeSpaceId && !spaceIds?.includes(activeSpaceId)), + [activeSpaceId, spaceIds] + ); + return ( - + diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx index 7c14b17f8d12..e07dd0ce5f6e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx @@ -63,11 +63,13 @@ export type RuleErrorLogProps = { ruleId: string; runId?: string; refreshToken?: number; + spaceId?: string; + logFromDifferentSpace?: boolean; requestRefresh?: () => Promise; } & Pick; export const RuleErrorLog = (props: RuleErrorLogProps) => { - const { ruleId, runId, loadActionErrorLog, refreshToken } = props; + const { ruleId, runId, loadActionErrorLog, refreshToken, spaceId, logFromDifferentSpace } = props; const { uiSettings, notifications } = useKibana().services; @@ -138,6 +140,8 @@ export const RuleErrorLog = (props: RuleErrorLogProps) => { page: pagination.pageIndex, perPage: pagination.pageSize, sort: formattedSort, + namespace: spaceId, + withAuth: logFromDifferentSpace, }); setLogs(result.errors); setPagination({ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx index 0f6dcc13b166..20f3612f3a41 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_data_grid.tsx @@ -60,6 +60,7 @@ export interface RuleEventLogDataGrid { pageSizeOptions?: number[]; selectedRunLog?: IExecutionLog; showRuleNameAndIdColumns?: boolean; + showSpaceColumns?: boolean; onChangeItemsPerPage: (pageSize: number) => void; onChangePage: (pageIndex: number) => void; onFilterChange: (filter: string[]) => void; @@ -162,6 +163,7 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { visibleColumns, selectedRunLog, showRuleNameAndIdColumns = false, + showSpaceColumns = false, setVisibleColumns, setSortingColumns, onChangeItemsPerPage, @@ -215,6 +217,25 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { }, ] : []), + ...(showSpaceColumns + ? [ + { + id: 'space_ids', + displayAsText: i18n.translate( + 'xpack.triggersActionsUI.sections.ruleDetails.eventLogColumn.spaceIds', + { + defaultMessage: 'Space', + } + ), + isSortable: getIsColumnSortable('space_ids'), + actions: { + showSortAsc: false, + showSortDesc: false, + showHide: false, + }, + }, + ] + : []), { id: 'id', displayAsText: i18n.translate( @@ -429,16 +450,22 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { isSortable: getIsColumnSortable('timed_out'), }, ], - [getPaginatedRowIndex, onFlyoutOpen, onFilterChange, showRuleNameAndIdColumns, logs] + [ + getPaginatedRowIndex, + onFlyoutOpen, + onFilterChange, + showRuleNameAndIdColumns, + showSpaceColumns, + logs, + ] ); - const columnVisibilityProps = useMemo( - () => ({ + const columnVisibilityProps = useMemo(() => { + return { visibleColumns, setVisibleColumns, - }), - [visibleColumns, setVisibleColumns] - ); + }; + }, [visibleColumns, setVisibleColumns]); const sortingProps = useMemo( () => ({ @@ -560,6 +587,7 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { const actionErrors = logs[pagedRowIndex]?.num_errored_actions || (0 as number); const version = logs?.[pagedRowIndex]?.version; const ruleId = runLog?.rule_id; + const spaceIds = runLog?.space_ids; if (columnId === 'num_errored_actions' && runLog) { return ( @@ -592,6 +620,7 @@ export const RuleEventLogDataGrid = (props: RuleEventLogDataGrid) => { version={version} dateFormat={dateFormat} ruleId={ruleId} + spaceIds={spaceIds} /> diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx index de9cd783c1ff..08362962890e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import moment from 'moment'; -import { EuiIcon } from '@elastic/eui'; +import { EuiIcon, EuiLink } from '@elastic/eui'; import { shallow, mount } from 'enzyme'; import { RuleEventLogListCellRenderer, @@ -16,7 +16,53 @@ import { import { RuleEventLogListStatus } from './rule_event_log_list_status'; import { RuleDurationFormat } from '../../rules_list/components/rule_duration_format'; +jest.mock('react-router-dom', () => ({ + useHistory: () => ({ + location: { + pathname: '/logs', + }, + }), +})); + +jest.mock('../../../../common/lib/kibana', () => ({ + useSpacesData: () => ({ + spacesMap: new Map([ + ['space1', { id: 'space1' }], + ['space2', { id: 'space2' }], + ]), + activeSpaceId: 'space1', + }), + useKibana: () => ({ + services: { + http: { + basePath: { + get: () => '/basePath', + }, + }, + }, + }), +})); + describe('rule_event_log_list_cell_renderer', () => { + const savedLocation = window.location; + beforeAll(() => { + // @ts-ignore Mocking window.location + delete window.location; + // @ts-ignore + window.location = Object.assign( + new URL('https://localhost/app/management/insightsAndAlerting/triggersActions/logs'), + { + ancestorOrigins: '', + assign: jest.fn(), + reload: jest.fn(), + replace: jest.fn(), + } + ); + }); + afterAll(() => { + window.location = savedLocation; + }); + it('renders primitive values correctly', () => { const wrapper = mount(); @@ -67,4 +113,31 @@ describe('rule_event_log_list_cell_renderer', () => { expect(wrapper.find(RuleEventLogListStatus).text()).toEqual('newOutcome'); expect(wrapper.find(EuiIcon).props().color).toEqual('gray'); }); + + it('links to rules on the correct space', () => { + const wrapper1 = shallow( + + ); + // @ts-ignore data-href is not a native EuiLink prop + expect(wrapper1.find(EuiLink).props()['data-href']).toEqual('/rule/1'); + const wrapper2 = shallow( + + ); + // @ts-ignore data-href is not a native EuiLink prop + expect(wrapper2.find(EuiLink).props()['data-href']).toEqual( + '/basePath/s/space2/app/management/insightsAndAlerting/triggersActions/rule/1' + ); + + window.location = savedLocation; + }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx index 0f6e0477642b..bcca56ad0027 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_cell_renderer.tsx @@ -5,13 +5,14 @@ * 2.0. */ -import React, { useCallback } from 'react'; +import React, { useCallback, useMemo } from 'react'; import moment from 'moment'; import { EuiLink } from '@elastic/eui'; import { RuleAlertingOutcome } from '@kbn/alerting-plugin/common'; import { useHistory } from 'react-router-dom'; import { routeToRuleDetails } from '../../../constants'; import { formatRuleAlertCount } from '../../../../common/lib/format_rule_alert_count'; +import { useKibana, useSpacesData } from '../../../../common/lib/kibana'; import { RuleEventLogListStatus } from './rule_event_log_list_status'; import { RuleDurationFormat } from '../../rules_list/components/rule_duration_format'; import { @@ -27,20 +28,58 @@ export type ColumnId = typeof RULE_EXECUTION_LOG_COLUMN_IDS[number]; interface RuleEventLogListCellRendererProps { columnId: ColumnId; version?: string; - value?: string; + value?: string | string[]; dateFormat?: string; ruleId?: string; + spaceIds?: string[]; } export const RuleEventLogListCellRenderer = (props: RuleEventLogListCellRendererProps) => { - const { columnId, value, version, dateFormat = DEFAULT_DATE_FORMAT, ruleId } = props; + const { columnId, value, version, dateFormat = DEFAULT_DATE_FORMAT, ruleId, spaceIds } = props; + const spacesData = useSpacesData(); + const { http } = useKibana().services; + const history = useHistory(); - const onClickRuleName = useCallback( - () => ruleId && history.push(routeToRuleDetails.replace(':ruleId', ruleId)), - [ruleId, history] + const activeSpace = useMemo( + () => spacesData?.spacesMap.get(spacesData?.activeSpaceId), + [spacesData] + ); + + const ruleOnDifferentSpace = useMemo( + () => activeSpace && !spaceIds?.includes(activeSpace.id), + [activeSpace, spaceIds] ); + const ruleNamePathname = useMemo(() => { + if (!ruleId) return ''; + const ruleRoute = routeToRuleDetails.replace(':ruleId', ruleId); + if (ruleOnDifferentSpace) { + const [linkedSpaceId] = spaceIds ?? []; + const basePath = http.basePath.get(); + const spacePath = linkedSpaceId !== 'default' ? `/s/${linkedSpaceId}` : ''; + const historyPathname = history.location.pathname; + const newPathname = `${basePath.replace( + `/s/${activeSpace!.id}`, + '' + )}${spacePath}${window.location.pathname + .replace(basePath, '') + .replace(historyPathname, ruleRoute)}`; + return newPathname; + } + return ruleRoute; + }, [ruleId, ruleOnDifferentSpace, history, activeSpace, http, spaceIds]); + + const onClickRuleName = useCallback(() => { + if (!ruleId) return; + if (ruleOnDifferentSpace) { + const newUrl = window.location.href.replace(window.location.pathname, ruleNamePathname); + window.open(newUrl, '_blank'); + return; + } + history.push(ruleNamePathname); + }, [ruleNamePathname, history, ruleOnDifferentSpace, ruleId]); + if (typeof value === 'undefined') { return null; } @@ -54,15 +93,24 @@ export const RuleEventLogListCellRenderer = (props: RuleEventLogListCellRenderer } if (columnId === 'rule_name' && ruleId) { - return {value}; + return ( + + {value} + + ); + } + + if (columnId === 'space_ids') { + if (activeSpace && value.includes(activeSpace.id)) return <>{activeSpace.name}; + if (spacesData) return <>{spacesData.spacesMap.get(value[0])?.name ?? value[0]}; } if (RULE_EXECUTION_LOG_ALERT_COUNT_COLUMNS.includes(columnId)) { - return <>{formatRuleAlertCount(value, version)}; + return <>{formatRuleAlertCount(value as string, version)}; } if (RULE_EXECUTION_LOG_DURATION_COLUMNS.includes(columnId)) { - return ; + return ; } return <>{value}; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx index 970390359f0d..0696f857261e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_kpi.tsx @@ -84,6 +84,7 @@ export type RuleEventLogListKPIProps = { outcomeFilter?: string[]; message?: string; refreshToken?: number; + namespaces?: Array; } & Pick; export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { @@ -94,6 +95,7 @@ export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { outcomeFilter, message, refreshToken, + namespaces, loadExecutionKPIAggregations, loadGlobalExecutionKPIAggregations, } = props; @@ -122,6 +124,7 @@ export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { dateEnd: getParsedDate(dateEnd), outcomeFilter, message, + ...(namespaces ? { namespaces } : {}), }); setKpi(newKpi); } catch (e) { @@ -136,7 +139,7 @@ export const RuleEventLogListKPI = (props: RuleEventLogListKPIProps) => { useEffect(() => { loadKPIs(); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ruleId, dateStart, dateEnd, outcomeFilter, message]); + }, [ruleId, dateStart, dateEnd, outcomeFilter, message, namespaces]); useEffect(() => { if (isInitialized.current) { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx index 58cd6447ca73..1ea613e20055 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list_table.tsx @@ -18,9 +18,11 @@ import { Pagination, EuiSuperDatePicker, OnTimeChangeProps, + EuiSwitch, } from '@elastic/eui'; import { IExecutionLog } from '@kbn/alerting-plugin/common'; -import { useKibana } from '../../../../common/lib/kibana'; +import { SpacesContextProps } from '@kbn/spaces-plugin/public'; +import { useKibana, useSpacesData } from '../../../../common/lib/kibana'; import { RULE_EXECUTION_DEFAULT_INITIAL_VISIBLE_COLUMNS, GLOBAL_EXECUTION_DEFAULT_INITIAL_VISIBLE_COLUMNS, @@ -38,6 +40,8 @@ import { withBulkRuleOperations, } from '../../common/components/with_bulk_rule_api_operations'; +const getEmptyFunctionComponent: React.FC = ({ children }) => <>{children}; + const getParsedDate = (date: string) => { if (date.includes('now')) { return datemath.parse(date)?.format() || date; @@ -66,6 +70,13 @@ const getDefaultColumns = (columns: string[]) => { return [...LOCKED_COLUMNS, ...columnsWithoutLockedColumn]; }; +const ALL_SPACES_LABEL = i18n.translate( + 'xpack.triggersActionsUI.ruleEventLogList.showAllSpacesToggle', + { + defaultMessage: 'Show rules from all spaces', + } +); + const updateButtonProps = { iconOnly: true, fill: false, @@ -84,6 +95,7 @@ export type RuleEventLogListCommonProps = { overrideLoadExecutionLogAggregations?: RuleApis['loadExecutionLogAggregations']; overrideLoadGlobalExecutionLogAggregations?: RuleApis['loadGlobalExecutionLogAggregations']; hasRuleNames?: boolean; + hasAllSpaceSwitch?: boolean; } & Pick; export type RuleEventLogListTableProps = @@ -106,6 +118,7 @@ export const RuleEventLogListTable = ( overrideLoadExecutionLogAggregations, initialPageSize = 10, hasRuleNames = false, + hasAllSpaceSwitch = false, } = props; const { uiSettings, notifications } = useKibana().services; @@ -117,6 +130,7 @@ export const RuleEventLogListTable = ( const [internalRefreshToken, setInternalRefreshToken] = useState( refreshToken ); + const [showFromAllSpaces, setShowFromAllSpaces] = useState(false); // Data grid states const [logs, setLogs] = useState(); @@ -153,6 +167,24 @@ export const RuleEventLogListTable = ( ); }); + const spacesData = useSpacesData(); + const accessibleSpaceIds = useMemo( + () => (spacesData ? [...spacesData.spacesMap.values()].map((e) => e.id) : []), + [spacesData] + ); + const areMultipleSpacesAccessible = useMemo( + () => accessibleSpaceIds.length > 1, + [accessibleSpaceIds] + ); + const namespaces = useMemo( + () => (showFromAllSpaces && spacesData ? accessibleSpaceIds : undefined), + [showFromAllSpaces, spacesData, accessibleSpaceIds] + ); + const activeSpace = useMemo( + () => spacesData?.spacesMap.get(spacesData?.activeSpaceId), + [spacesData] + ); + const isInitialized = useRef(false); const isOnLastPage = useMemo(() => { @@ -197,6 +229,7 @@ export const RuleEventLogListTable = ( dateEnd: getParsedDate(dateEnd), page: pagination.pageIndex, perPage: pagination.pageSize, + namespaces, }); setLogs(result.data); setPagination({ @@ -290,6 +323,20 @@ export const RuleEventLogListTable = ( [search, setSearchText] ); + const onShowAllSpacesChange = useCallback(() => { + setShowFromAllSpaces((prev) => !prev); + const nextShowFromAllSpaces = !showFromAllSpaces; + + if (nextShowFromAllSpaces && !visibleColumns.includes('space_ids')) { + const ruleNameIndex = visibleColumns.findIndex((c) => c === 'rule_name'); + const newVisibleColumns = [...visibleColumns]; + newVisibleColumns.splice(ruleNameIndex + 1, 0, 'space_ids'); + setVisibleColumns(newVisibleColumns); + } else if (!nextShowFromAllSpaces && visibleColumns.includes('space_ids')) { + setVisibleColumns(visibleColumns.filter((c) => c !== 'space_ids')); + } + }, [setShowFromAllSpaces, showFromAllSpaces, visibleColumns]); + const renderList = () => { if (!logs) { return ; @@ -307,6 +354,7 @@ export const RuleEventLogListTable = ( dateFormat={dateFormat} selectedRunLog={selectedRunLog} showRuleNameAndIdColumns={hasRuleNames} + showSpaceColumns={showFromAllSpaces} onChangeItemsPerPage={onChangeItemsPerPage} onChangePage={onChangePage} onFlyoutOpen={onFlyoutOpen} @@ -329,6 +377,7 @@ export const RuleEventLogListTable = ( pagination.pageIndex, pagination.pageSize, searchText, + showFromAllSpaces, ]); useEffect(() => { @@ -350,7 +399,7 @@ export const RuleEventLogListTable = ( return ( - + ( updateButtonProps={updateButtonProps} /> + {hasAllSpaceSwitch && areMultipleSpacesAccessible && ( + + + + )} @@ -389,6 +447,7 @@ export const RuleEventLogListTable = ( outcomeFilter={filter} message={searchText} refreshToken={internalRefreshToken} + namespaces={namespaces} /> @@ -407,13 +466,29 @@ export const RuleEventLogListTable = ( runLog={selectedRunLog} refreshToken={refreshToken} onClose={onFlyoutClose} + activeSpaceId={activeSpace?.id} /> )} ); }; -export const RuleEventLogListTableWithApi = withBulkRuleOperations(RuleEventLogListTable); +const RuleEventLogListTableWithSpaces: React.FC = (props) => { + const { spaces } = useKibana().services; + + // eslint-disable-next-line react-hooks/exhaustive-deps + const SpacesContextWrapper = useCallback( + spaces ? spaces.ui.components.getSpacesContextProvider : getEmptyFunctionComponent, + [spaces] + ); + return ( + + + + ); +}; + +export const RuleEventLogListTableWithApi = withBulkRuleOperations(RuleEventLogListTableWithSpaces); // eslint-disable-next-line import/no-default-export export { RuleEventLogListTableWithApi as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts index 6772eacc2aae..e7c8215fd462 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/__mocks__/index.ts @@ -31,3 +31,4 @@ export const useCurrentUser = jest.fn(); export const withKibana = jest.fn(createWithKibanaMock()); export const KibanaContextProvider = jest.fn(createKibanaContextProviderMock()); export const useGetUserSavedObjectPermissions = jest.fn(); +export const useSpacesData = jest.fn(); diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts index 3970993a0c73..de8f3b63d1c5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/index.ts @@ -6,3 +6,4 @@ */ export * from './kibana_react'; +export * from './use_spaces_data'; diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.tsx b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.tsx new file mode 100644 index 000000000000..54f2baafa21c --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/kibana/use_spaces_data.tsx @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useState, useEffect } from 'react'; +import { SpacesData } from '@kbn/spaces-plugin/public'; +import { useKibana } from './kibana_react'; + +export const useSpacesData = () => { + const { spaces } = useKibana().services; + const [spacesData, setSpacesData] = useState(undefined); + const spacesService = spaces?.ui.useSpaces(); + + useEffect(() => { + (async () => { + const result = await spacesService?.spacesDataPromise; + setSpacesData(result); + })(); + }, [spaces, spacesService, setSpacesData]); + return spacesData; +}; From 73f1878983113d061890a8648f0548ac46823ca5 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 1 Nov 2022 01:03:52 +0000 Subject: [PATCH 40/87] chore(NA): include progress on Bazel tasks (#144275) * chore(NA): include progress on Bazel tasks * docs(NA): include docs on changed logic * chore(NA): removes warning about no progress when building types for typechecking Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .bazelrc.common | 9 +++++---- packages/kbn-bazel-runner/src/bazel_runner.js | 10 ++++++++++ src/dev/typescript/run_type_check_cli.ts | 3 --- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.bazelrc.common b/.bazelrc.common index 7b84ab44af7a..9acc4ebc875e 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -49,11 +49,12 @@ query --incompatible_no_implicit_file_export # Log configs ## different from default common --color=yes -common --noshow_progress +common --show_progress common --show_task_finish -build --noshow_loading_progress -query --noshow_loading_progress -build --show_result=0 +common --progress_report_interval=10 +common --show_progress_rate_limit=10 +common --show_loading_progress +build --show_result=1 # Specifies desired output mode for running tests. # Valid values are diff --git a/packages/kbn-bazel-runner/src/bazel_runner.js b/packages/kbn-bazel-runner/src/bazel_runner.js index 78d91e7ae479..cc9f2d7c4368 100644 --- a/packages/kbn-bazel-runner/src/bazel_runner.js +++ b/packages/kbn-bazel-runner/src/bazel_runner.js @@ -20,8 +20,18 @@ async function printLines(stream, prefix) { crlfDelay: Infinity, }); + // A validation between the previous logged line and the new one to log was introduced + // as the last line of the Bazel task when ran with progress enabled was being logged + // twice after parsing the log output with the logic we have here. + // The original output when letting Bazel taking care of it on its own doesn't include the repeated line + // so this check logic is useful until we get rid of Bazel. + let prevLine = null; for await (const line of int) { + if (prevLine === line) { + continue; + } console.log(prefix ? `${prefix} ${line}` : line); + prevLine = line; } } diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts index d1f0bab0a784..dd41be239e9f 100644 --- a/src/dev/typescript/run_type_check_cli.ts +++ b/src/dev/typescript/run_type_check_cli.ts @@ -144,9 +144,6 @@ function createTypeCheckConfigs(projects: Project[], bazelPackages: BazelPackage export async function runTypeCheckCli() { run( async ({ log, flagsReader, procRunner }) => { - log.warning( - `Building types for all bazel packages. This can take a while depending on your changes and won't show any progress while it runs.` - ); await runBazel(['build', '//packages:build_types', '--show_result=1'], { cwd: REPO_ROOT, logPrefix: '\x1b[94m[bazel]\x1b[39m', From 96a9f913d82815089a683b05cc89c362d2b2bab4 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 1 Nov 2022 00:43:58 -0400 Subject: [PATCH 41/87] [api-docs] Daily api_docs build (#144294) --- api_docs/actions.devdocs.json | 2 +- api_docs/actions.mdx | 2 +- api_docs/advanced_settings.mdx | 2 +- api_docs/aiops.mdx | 2 +- api_docs/alerting.devdocs.json | 28 +- api_docs/alerting.mdx | 4 +- api_docs/apm.devdocs.json | 62 +- api_docs/apm.mdx | 2 +- api_docs/banners.mdx | 2 +- api_docs/bfetch.mdx | 2 +- api_docs/canvas.mdx | 2 +- api_docs/cases.mdx | 2 +- api_docs/charts.mdx | 2 +- api_docs/cloud.mdx | 2 +- api_docs/cloud_chat.mdx | 2 +- api_docs/cloud_experiments.mdx | 2 +- api_docs/cloud_security_posture.mdx | 2 +- api_docs/console.mdx | 2 +- api_docs/controls.mdx | 2 +- api_docs/core.mdx | 2 +- api_docs/custom_integrations.mdx | 2 +- api_docs/dashboard.mdx | 2 +- api_docs/dashboard_enhanced.mdx | 2 +- api_docs/data.mdx | 2 +- api_docs/data_query.mdx | 2 +- api_docs/data_search.mdx | 2 +- api_docs/data_view_editor.mdx | 2 +- api_docs/data_view_field_editor.mdx | 2 +- api_docs/data_view_management.mdx | 2 +- api_docs/data_views.mdx | 2 +- api_docs/data_visualizer.mdx | 2 +- api_docs/deprecations_by_api.mdx | 2 +- api_docs/deprecations_by_plugin.mdx | 2 +- api_docs/deprecations_by_team.mdx | 2 +- api_docs/dev_tools.mdx | 2 +- api_docs/discover.mdx | 2 +- api_docs/discover_enhanced.mdx | 2 +- api_docs/embeddable.mdx | 2 +- api_docs/embeddable_enhanced.mdx | 2 +- api_docs/encrypted_saved_objects.mdx | 2 +- api_docs/enterprise_search.mdx | 2 +- api_docs/es_ui_shared.mdx | 2 +- api_docs/event_annotation.mdx | 2 +- api_docs/event_log.devdocs.json | 183 +++++- api_docs/event_log.mdx | 4 +- api_docs/expression_error.mdx | 2 +- api_docs/expression_gauge.mdx | 2 +- api_docs/expression_heatmap.mdx | 2 +- api_docs/expression_image.mdx | 2 +- api_docs/expression_legacy_metric_vis.mdx | 2 +- api_docs/expression_metric.mdx | 2 +- api_docs/expression_metric_vis.mdx | 2 +- api_docs/expression_partition_vis.mdx | 2 +- api_docs/expression_repeat_image.mdx | 2 +- api_docs/expression_reveal_image.mdx | 2 +- api_docs/expression_shape.mdx | 2 +- api_docs/expression_tagcloud.mdx | 2 +- api_docs/expression_x_y.mdx | 2 +- api_docs/expressions.mdx | 2 +- api_docs/features.mdx | 2 +- api_docs/field_formats.mdx | 2 +- api_docs/file_upload.mdx | 2 +- api_docs/files.devdocs.json | 550 +++++++++--------- api_docs/files.mdx | 2 +- api_docs/fleet.mdx | 2 +- api_docs/global_search.mdx | 2 +- api_docs/guided_onboarding.mdx | 2 +- api_docs/home.mdx | 2 +- api_docs/index_lifecycle_management.mdx | 2 +- api_docs/index_management.mdx | 2 +- api_docs/infra.mdx | 2 +- api_docs/inspector.mdx | 2 +- api_docs/interactive_setup.mdx | 2 +- api_docs/kbn_ace.mdx | 2 +- api_docs/kbn_aiops_components.mdx | 2 +- api_docs/kbn_aiops_utils.mdx | 2 +- api_docs/kbn_alerts.mdx | 2 +- api_docs/kbn_analytics.mdx | 2 +- api_docs/kbn_analytics_client.mdx | 2 +- ..._analytics_shippers_elastic_v3_browser.mdx | 2 +- ...n_analytics_shippers_elastic_v3_common.mdx | 2 +- ...n_analytics_shippers_elastic_v3_server.mdx | 2 +- api_docs/kbn_analytics_shippers_fullstory.mdx | 2 +- api_docs/kbn_analytics_shippers_gainsight.mdx | 2 +- api_docs/kbn_apm_config_loader.mdx | 2 +- api_docs/kbn_apm_synthtrace.devdocs.json | 10 +- api_docs/kbn_apm_synthtrace.mdx | 2 +- api_docs/kbn_apm_utils.mdx | 2 +- api_docs/kbn_axe_config.mdx | 2 +- api_docs/kbn_cases_components.mdx | 2 +- api_docs/kbn_chart_icons.mdx | 2 +- api_docs/kbn_ci_stats_core.mdx | 2 +- api_docs/kbn_ci_stats_performance_metrics.mdx | 2 +- api_docs/kbn_ci_stats_reporter.mdx | 2 +- api_docs/kbn_cli_dev_mode.mdx | 2 +- api_docs/kbn_coloring.mdx | 2 +- api_docs/kbn_config.mdx | 2 +- api_docs/kbn_config_mocks.mdx | 2 +- api_docs/kbn_config_schema.devdocs.json | 30 +- api_docs/kbn_config_schema.mdx | 2 +- .../kbn_content_management_table_list.mdx | 2 +- api_docs/kbn_core_analytics_browser.mdx | 2 +- .../kbn_core_analytics_browser_internal.mdx | 2 +- api_docs/kbn_core_analytics_browser_mocks.mdx | 2 +- api_docs/kbn_core_analytics_server.mdx | 2 +- .../kbn_core_analytics_server_internal.mdx | 2 +- api_docs/kbn_core_analytics_server_mocks.mdx | 2 +- api_docs/kbn_core_application_browser.mdx | 2 +- .../kbn_core_application_browser_internal.mdx | 2 +- .../kbn_core_application_browser_mocks.mdx | 2 +- api_docs/kbn_core_application_common.mdx | 2 +- api_docs/kbn_core_apps_browser_internal.mdx | 2 +- api_docs/kbn_core_apps_browser_mocks.mdx | 2 +- api_docs/kbn_core_base_browser_mocks.mdx | 2 +- api_docs/kbn_core_base_common.mdx | 2 +- api_docs/kbn_core_base_server_internal.mdx | 2 +- api_docs/kbn_core_base_server_mocks.mdx | 2 +- .../kbn_core_capabilities_browser_mocks.mdx | 2 +- api_docs/kbn_core_capabilities_common.mdx | 2 +- api_docs/kbn_core_capabilities_server.mdx | 2 +- .../kbn_core_capabilities_server_mocks.mdx | 2 +- api_docs/kbn_core_chrome_browser.mdx | 2 +- api_docs/kbn_core_chrome_browser_mocks.mdx | 2 +- api_docs/kbn_core_config_server_internal.mdx | 2 +- api_docs/kbn_core_deprecations_browser.mdx | 2 +- ...kbn_core_deprecations_browser_internal.mdx | 2 +- .../kbn_core_deprecations_browser_mocks.mdx | 2 +- api_docs/kbn_core_deprecations_common.mdx | 2 +- api_docs/kbn_core_deprecations_server.mdx | 2 +- .../kbn_core_deprecations_server_internal.mdx | 2 +- .../kbn_core_deprecations_server_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_browser.mdx | 2 +- api_docs/kbn_core_doc_links_browser_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_server.mdx | 2 +- api_docs/kbn_core_doc_links_server_mocks.mdx | 2 +- ...e_elasticsearch_client_server_internal.mdx | 2 +- ...core_elasticsearch_client_server_mocks.mdx | 2 +- api_docs/kbn_core_elasticsearch_server.mdx | 2 +- ...kbn_core_elasticsearch_server_internal.mdx | 2 +- .../kbn_core_elasticsearch_server_mocks.mdx | 2 +- .../kbn_core_environment_server_internal.mdx | 2 +- .../kbn_core_environment_server_mocks.mdx | 2 +- .../kbn_core_execution_context_browser.mdx | 2 +- ...ore_execution_context_browser_internal.mdx | 2 +- ...n_core_execution_context_browser_mocks.mdx | 2 +- .../kbn_core_execution_context_common.mdx | 2 +- .../kbn_core_execution_context_server.mdx | 2 +- ...core_execution_context_server_internal.mdx | 2 +- ...bn_core_execution_context_server_mocks.mdx | 2 +- api_docs/kbn_core_fatal_errors_browser.mdx | 2 +- .../kbn_core_fatal_errors_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_browser.mdx | 2 +- api_docs/kbn_core_http_browser_internal.mdx | 2 +- api_docs/kbn_core_http_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_common.mdx | 2 +- .../kbn_core_http_context_server_mocks.mdx | 2 +- ...re_http_request_handler_context_server.mdx | 2 +- api_docs/kbn_core_http_resources_server.mdx | 2 +- ...bn_core_http_resources_server_internal.mdx | 2 +- .../kbn_core_http_resources_server_mocks.mdx | 2 +- .../kbn_core_http_router_server_internal.mdx | 2 +- .../kbn_core_http_router_server_mocks.mdx | 2 +- api_docs/kbn_core_http_server.mdx | 2 +- api_docs/kbn_core_http_server_internal.mdx | 2 +- api_docs/kbn_core_http_server_mocks.mdx | 2 +- api_docs/kbn_core_i18n_browser.mdx | 2 +- api_docs/kbn_core_i18n_browser_mocks.mdx | 2 +- api_docs/kbn_core_i18n_server.mdx | 2 +- api_docs/kbn_core_i18n_server_internal.mdx | 2 +- api_docs/kbn_core_i18n_server_mocks.mdx | 2 +- .../kbn_core_injected_metadata_browser.mdx | 2 +- ...n_core_injected_metadata_browser_mocks.mdx | 2 +- ...kbn_core_integrations_browser_internal.mdx | 2 +- .../kbn_core_integrations_browser_mocks.mdx | 2 +- api_docs/kbn_core_lifecycle_browser.mdx | 2 +- api_docs/kbn_core_lifecycle_browser_mocks.mdx | 2 +- api_docs/kbn_core_lifecycle_server.mdx | 2 +- api_docs/kbn_core_lifecycle_server_mocks.mdx | 2 +- api_docs/kbn_core_logging_server.mdx | 2 +- ..._core_logging_server_internal.devdocs.json | 4 +- api_docs/kbn_core_logging_server_internal.mdx | 2 +- api_docs/kbn_core_logging_server_mocks.mdx | 2 +- ...ore_metrics_collectors_server_internal.mdx | 2 +- ...n_core_metrics_collectors_server_mocks.mdx | 2 +- api_docs/kbn_core_metrics_server.mdx | 2 +- api_docs/kbn_core_metrics_server_internal.mdx | 2 +- api_docs/kbn_core_metrics_server_mocks.mdx | 2 +- api_docs/kbn_core_mount_utils_browser.mdx | 2 +- api_docs/kbn_core_node_server.mdx | 2 +- api_docs/kbn_core_node_server_internal.mdx | 2 +- api_docs/kbn_core_node_server_mocks.mdx | 2 +- api_docs/kbn_core_notifications_browser.mdx | 2 +- ...bn_core_notifications_browser_internal.mdx | 2 +- .../kbn_core_notifications_browser_mocks.mdx | 2 +- api_docs/kbn_core_overlays_browser.mdx | 2 +- .../kbn_core_overlays_browser_internal.mdx | 2 +- api_docs/kbn_core_overlays_browser_mocks.mdx | 2 +- api_docs/kbn_core_plugins_browser.mdx | 2 +- api_docs/kbn_core_plugins_browser_mocks.mdx | 2 +- api_docs/kbn_core_plugins_server.mdx | 2 +- api_docs/kbn_core_plugins_server_mocks.mdx | 2 +- api_docs/kbn_core_preboot_server.mdx | 2 +- api_docs/kbn_core_preboot_server_mocks.mdx | 2 +- api_docs/kbn_core_rendering_browser_mocks.mdx | 2 +- .../kbn_core_rendering_server_internal.mdx | 2 +- api_docs/kbn_core_rendering_server_mocks.mdx | 2 +- .../kbn_core_saved_objects_api_browser.mdx | 2 +- .../kbn_core_saved_objects_api_server.mdx | 2 +- ...core_saved_objects_api_server_internal.mdx | 2 +- ...bn_core_saved_objects_api_server_mocks.mdx | 2 +- ...ore_saved_objects_base_server_internal.mdx | 2 +- ...n_core_saved_objects_base_server_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_browser.mdx | 2 +- ...bn_core_saved_objects_browser_internal.mdx | 2 +- .../kbn_core_saved_objects_browser_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_common.mdx | 2 +- ..._objects_import_export_server_internal.mdx | 2 +- ...ved_objects_import_export_server_mocks.mdx | 2 +- ...aved_objects_migration_server_internal.mdx | 2 +- ...e_saved_objects_migration_server_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_server.mdx | 2 +- ...kbn_core_saved_objects_server_internal.mdx | 2 +- .../kbn_core_saved_objects_server_mocks.mdx | 2 +- .../kbn_core_saved_objects_utils_server.mdx | 2 +- api_docs/kbn_core_status_common.mdx | 2 +- api_docs/kbn_core_status_common_internal.mdx | 2 +- api_docs/kbn_core_status_server.mdx | 2 +- api_docs/kbn_core_status_server_internal.mdx | 2 +- api_docs/kbn_core_status_server_mocks.mdx | 2 +- ...core_test_helpers_deprecations_getters.mdx | 2 +- ...n_core_test_helpers_http_setup_browser.mdx | 2 +- ...n_core_test_helpers_so_type_serializer.mdx | 2 +- api_docs/kbn_core_test_helpers_test_utils.mdx | 2 +- api_docs/kbn_core_theme_browser.mdx | 2 +- api_docs/kbn_core_theme_browser_internal.mdx | 2 +- api_docs/kbn_core_theme_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_browser.mdx | 2 +- .../kbn_core_ui_settings_browser_internal.mdx | 2 +- .../kbn_core_ui_settings_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_common.mdx | 2 +- api_docs/kbn_core_ui_settings_server.mdx | 2 +- .../kbn_core_ui_settings_server_internal.mdx | 2 +- .../kbn_core_ui_settings_server_mocks.mdx | 2 +- api_docs/kbn_core_usage_data_server.mdx | 2 +- .../kbn_core_usage_data_server_internal.mdx | 2 +- api_docs/kbn_core_usage_data_server_mocks.mdx | 2 +- api_docs/kbn_crypto.mdx | 2 +- api_docs/kbn_crypto_browser.mdx | 2 +- api_docs/kbn_datemath.mdx | 2 +- api_docs/kbn_dev_cli_errors.mdx | 2 +- api_docs/kbn_dev_cli_runner.mdx | 2 +- api_docs/kbn_dev_proc_runner.mdx | 2 +- api_docs/kbn_dev_utils.mdx | 2 +- api_docs/kbn_doc_links.mdx | 2 +- api_docs/kbn_docs_utils.mdx | 2 +- api_docs/kbn_ebt_tools.devdocs.json | 2 +- api_docs/kbn_ebt_tools.mdx | 2 +- api_docs/kbn_es.mdx | 2 +- api_docs/kbn_es_archiver.mdx | 2 +- api_docs/kbn_es_errors.mdx | 2 +- api_docs/kbn_es_query.mdx | 2 +- api_docs/kbn_es_types.mdx | 2 +- api_docs/kbn_eslint_plugin_imports.mdx | 2 +- api_docs/kbn_field_types.mdx | 2 +- api_docs/kbn_find_used_node_modules.mdx | 2 +- .../kbn_ftr_common_functional_services.mdx | 2 +- api_docs/kbn_generate.mdx | 2 +- api_docs/kbn_get_repo_files.mdx | 2 +- api_docs/kbn_guided_onboarding.mdx | 2 +- api_docs/kbn_handlebars.mdx | 2 +- api_docs/kbn_hapi_mocks.mdx | 2 +- api_docs/kbn_home_sample_data_card.mdx | 2 +- api_docs/kbn_home_sample_data_tab.mdx | 2 +- api_docs/kbn_i18n.mdx | 2 +- api_docs/kbn_i18n_react.mdx | 2 +- api_docs/kbn_import_resolver.mdx | 2 +- api_docs/kbn_interpreter.mdx | 2 +- api_docs/kbn_io_ts_utils.mdx | 2 +- api_docs/kbn_jest_serializers.mdx | 2 +- api_docs/kbn_journeys.mdx | 2 +- api_docs/kbn_kibana_manifest_schema.mdx | 2 +- .../kbn_language_documentation_popover.mdx | 2 +- api_docs/kbn_logging.mdx | 2 +- api_docs/kbn_logging_mocks.mdx | 2 +- api_docs/kbn_managed_vscode_config.mdx | 2 +- api_docs/kbn_mapbox_gl.mdx | 2 +- api_docs/kbn_ml_agg_utils.mdx | 2 +- api_docs/kbn_ml_is_populated_object.mdx | 2 +- api_docs/kbn_ml_string_hash.mdx | 2 +- api_docs/kbn_monaco.mdx | 2 +- api_docs/kbn_optimizer.mdx | 2 +- api_docs/kbn_optimizer_webpack_helpers.mdx | 2 +- api_docs/kbn_osquery_io_ts_types.mdx | 2 +- ..._performance_testing_dataset_extractor.mdx | 2 +- api_docs/kbn_plugin_generator.mdx | 2 +- api_docs/kbn_plugin_helpers.mdx | 2 +- api_docs/kbn_react_field.mdx | 2 +- api_docs/kbn_repo_source_classifier.mdx | 2 +- api_docs/kbn_rule_data_utils.devdocs.json | 152 ++++- api_docs/kbn_rule_data_utils.mdx | 4 +- .../kbn_securitysolution_autocomplete.mdx | 2 +- api_docs/kbn_securitysolution_es_utils.mdx | 2 +- ...ion_exception_list_components.devdocs.json | 8 +- ...ritysolution_exception_list_components.mdx | 2 +- api_docs/kbn_securitysolution_hook_utils.mdx | 2 +- ..._securitysolution_io_ts_alerting_types.mdx | 2 +- .../kbn_securitysolution_io_ts_list_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_utils.mdx | 2 +- api_docs/kbn_securitysolution_list_api.mdx | 2 +- .../kbn_securitysolution_list_constants.mdx | 2 +- api_docs/kbn_securitysolution_list_hooks.mdx | 2 +- api_docs/kbn_securitysolution_list_utils.mdx | 2 +- api_docs/kbn_securitysolution_rules.mdx | 2 +- api_docs/kbn_securitysolution_t_grid.mdx | 2 +- api_docs/kbn_securitysolution_utils.mdx | 2 +- api_docs/kbn_server_http_tools.mdx | 2 +- api_docs/kbn_server_route_repository.mdx | 2 +- api_docs/kbn_shared_svg.mdx | 2 +- api_docs/kbn_shared_ux_avatar_solution.mdx | 2 +- ...ared_ux_avatar_user_profile_components.mdx | 2 +- .../kbn_shared_ux_button_exit_full_screen.mdx | 2 +- ...hared_ux_button_exit_full_screen_mocks.mdx | 2 +- api_docs/kbn_shared_ux_button_toolbar.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_link_redirect_app.mdx | 2 +- .../kbn_shared_ux_link_redirect_app_mocks.mdx | 2 +- api_docs/kbn_shared_ux_markdown.mdx | 2 +- api_docs/kbn_shared_ux_markdown_mocks.mdx | 2 +- .../kbn_shared_ux_page_analytics_no_data.mdx | 2 +- ...shared_ux_page_analytics_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_no_data.mdx | 2 +- ...bn_shared_ux_page_kibana_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_template.mdx | 2 +- ...n_shared_ux_page_kibana_template_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data.mdx | 2 +- .../kbn_shared_ux_page_no_data_config.mdx | 2 +- ...bn_shared_ux_page_no_data_config_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_solution_nav.mdx | 2 +- .../kbn_shared_ux_prompt_no_data_views.mdx | 2 +- ...n_shared_ux_prompt_no_data_views_mocks.mdx | 2 +- api_docs/kbn_shared_ux_router.mdx | 2 +- api_docs/kbn_shared_ux_router_mocks.mdx | 2 +- api_docs/kbn_shared_ux_storybook_config.mdx | 2 +- api_docs/kbn_shared_ux_storybook_mock.mdx | 2 +- api_docs/kbn_shared_ux_utility.mdx | 2 +- api_docs/kbn_some_dev_log.mdx | 2 +- api_docs/kbn_sort_package_json.mdx | 2 +- api_docs/kbn_std.mdx | 2 +- api_docs/kbn_stdio_dev_helpers.mdx | 2 +- api_docs/kbn_storybook.mdx | 2 +- api_docs/kbn_telemetry_tools.mdx | 2 +- api_docs/kbn_test.mdx | 2 +- api_docs/kbn_test_jest_helpers.mdx | 2 +- api_docs/kbn_test_subj_selector.mdx | 2 +- api_docs/kbn_tooling_log.mdx | 2 +- api_docs/kbn_type_summarizer.mdx | 2 +- api_docs/kbn_type_summarizer_core.mdx | 2 +- api_docs/kbn_typed_react_router_config.mdx | 2 +- api_docs/kbn_ui_shared_deps_src.devdocs.json | 33 ++ api_docs/kbn_ui_shared_deps_src.mdx | 4 +- api_docs/kbn_ui_theme.mdx | 2 +- api_docs/kbn_user_profile_components.mdx | 2 +- api_docs/kbn_utility_types.mdx | 2 +- api_docs/kbn_utility_types_jest.mdx | 2 +- api_docs/kbn_utils.mdx | 2 +- api_docs/kbn_yarn_lock_validator.mdx | 2 +- api_docs/kibana_overview.mdx | 2 +- api_docs/kibana_react.mdx | 2 +- api_docs/kibana_utils.mdx | 2 +- api_docs/kubernetes_security.mdx | 2 +- api_docs/lens.mdx | 2 +- api_docs/license_api_guard.mdx | 2 +- api_docs/license_management.mdx | 2 +- api_docs/licensing.mdx | 2 +- api_docs/lists.mdx | 2 +- api_docs/management.mdx | 2 +- api_docs/maps.mdx | 2 +- api_docs/maps_ems.mdx | 2 +- api_docs/ml.mdx | 2 +- api_docs/monitoring.mdx | 2 +- api_docs/monitoring_collection.mdx | 2 +- api_docs/navigation.mdx | 2 +- api_docs/newsfeed.mdx | 2 +- api_docs/observability.devdocs.json | 220 +++++++ api_docs/observability.mdx | 4 +- api_docs/osquery.mdx | 2 +- api_docs/plugin_directory.mdx | 14 +- api_docs/presentation_util.mdx | 2 +- api_docs/profiling.mdx | 2 +- api_docs/remote_clusters.mdx | 2 +- api_docs/reporting.mdx | 2 +- api_docs/rollup.mdx | 2 +- api_docs/rule_registry.mdx | 2 +- api_docs/runtime_fields.mdx | 2 +- api_docs/saved_objects.mdx | 2 +- api_docs/saved_objects_finder.mdx | 2 +- api_docs/saved_objects_management.mdx | 2 +- api_docs/saved_objects_tagging.mdx | 2 +- api_docs/saved_objects_tagging_oss.mdx | 2 +- api_docs/saved_search.mdx | 2 +- api_docs/screenshot_mode.mdx | 2 +- api_docs/screenshotting.mdx | 2 +- api_docs/security.mdx | 2 +- api_docs/security_solution.devdocs.json | 4 +- api_docs/security_solution.mdx | 2 +- api_docs/session_view.mdx | 2 +- api_docs/share.mdx | 2 +- api_docs/snapshot_restore.mdx | 2 +- api_docs/spaces.mdx | 2 +- api_docs/stack_alerts.mdx | 2 +- api_docs/stack_connectors.mdx | 2 +- api_docs/task_manager.mdx | 2 +- api_docs/telemetry.mdx | 2 +- api_docs/telemetry_collection_manager.mdx | 2 +- api_docs/telemetry_collection_xpack.mdx | 2 +- api_docs/telemetry_management_section.mdx | 2 +- api_docs/threat_intelligence.mdx | 2 +- api_docs/timelines.mdx | 2 +- api_docs/transform.mdx | 2 +- api_docs/triggers_actions_ui.devdocs.json | 6 +- api_docs/triggers_actions_ui.mdx | 2 +- api_docs/ui_actions.mdx | 2 +- api_docs/ui_actions_enhanced.mdx | 2 +- api_docs/unified_field_list.mdx | 2 +- api_docs/unified_histogram.mdx | 2 +- api_docs/unified_search.mdx | 2 +- api_docs/unified_search_autocomplete.mdx | 2 +- api_docs/url_forwarding.mdx | 2 +- api_docs/usage_collection.mdx | 2 +- api_docs/ux.mdx | 2 +- api_docs/vis_default_editor.mdx | 2 +- api_docs/vis_type_gauge.mdx | 2 +- api_docs/vis_type_heatmap.mdx | 2 +- api_docs/vis_type_pie.mdx | 2 +- api_docs/vis_type_table.mdx | 2 +- api_docs/vis_type_timelion.mdx | 2 +- api_docs/vis_type_timeseries.mdx | 2 +- api_docs/vis_type_vega.mdx | 2 +- api_docs/vis_type_vislib.mdx | 2 +- api_docs/vis_type_xy.mdx | 2 +- api_docs/visualizations.mdx | 2 +- 444 files changed, 1415 insertions(+), 759 deletions(-) diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json index 3bd6ccebe2cd..88a9e275e1fb 100644 --- a/api_docs/actions.devdocs.json +++ b/api_docs/actions.devdocs.json @@ -1967,7 +1967,7 @@ }, "<", "ActionTypeConfig", - ">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"jwt\" | \"client\"; }>, configurationUtilities: ", + ">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"client\" | \"jwt\"; }>, configurationUtilities: ", "ActionsConfigurationUtilities", ") => Promise<{ accessToken: string | null; }>; enqueueExecution: (options: ", "ExecuteOptions", diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 6d980d46cb6a..5ea65a4401bd 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 82dd64815f77..5bf1f2193cca 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index ae94b9721b6d..92967fd705e0 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.devdocs.json b/api_docs/alerting.devdocs.json index 01fb744846ab..5ace082c7a03 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -2932,7 +2932,7 @@ "section": "def-common.IExecutionLogResult", "text": "IExecutionLogResult" }, - ">; getGlobalExecutionLogWithAuth: ({ dateStart, dateEnd, filter, page, perPage, sort, }: ", + ">; getGlobalExecutionLogWithAuth: ({ dateStart, dateEnd, filter, page, perPage, sort, namespaces, }: ", "GetGlobalExecutionLogParams", ") => Promise<", { @@ -2952,7 +2952,17 @@ "section": "def-common.IExecutionErrorsResult", "text": "IExecutionErrorsResult" }, - ">; getGlobalExecutionKpiWithAuth: ({ dateStart, dateEnd, filter, }: ", + ">; getActionErrorLogWithAuth: ({ id, dateStart, dateEnd, filter, page, perPage, sort, namespace, }: ", + "GetActionErrorLogByIdParams", + ") => Promise<", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.IExecutionErrorsResult", + "text": "IExecutionErrorsResult" + }, + ">; getGlobalExecutionKpiWithAuth: ({ dateStart, dateEnd, filter, namespaces, }: ", "GetGlobalExecutionKPIParams", ") => Promise<{ success: number; unknown: number; failure: number; warning: number; activeAlerts: number; newAlerts: number; recoveredAlerts: number; erroredActions: number; triggeredActions: number; }>; getRuleExecutionKPI: ({ id, dateStart, dateEnd, filter }: ", "GetRuleExecutionKPIParams", @@ -4266,6 +4276,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "alerting", + "id": "def-common.IExecutionLog.space_ids", + "type": "Array", + "tags": [], + "label": "space_ids", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/alerting/common/execution_log_types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "alerting", "id": "def-common.IExecutionLog.rule_name", diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index f324f610ed30..88823d4b8b0d 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 382 | 0 | 373 | 26 | +| 383 | 0 | 374 | 26 | ## Client diff --git a/api_docs/apm.devdocs.json b/api_docs/apm.devdocs.json index d2ab8b099626..0f36183912e2 100644 --- a/api_docs/apm.devdocs.json +++ b/api_docs/apm.devdocs.json @@ -795,7 +795,7 @@ "label": "APIEndpoint", "description": [], "signature": [ - "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/title\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\" | \"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\" | \"POST /internal/apm/latency/overall_distribution/transactions\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/nodes\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/summary\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/dependency\" | \"GET /internal/apm/services\" | \"POST /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/sorted_and_filtered_services\" | \"GET /internal/apm/service-groups\" | \"GET /internal/apm/service-group\" | \"POST /internal/apm/service-group\" | \"DELETE /internal/apm/service-group\" | \"GET /internal/apm/service-group/services\" | \"GET /internal/apm/service_groups/services_count\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/traces/find\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\" | \"GET /internal/apm/rule_types/transaction_duration/chart_preview\" | \"GET /internal/apm/rule_types/error_count/chart_preview\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_apm_policies\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/fleet/java_agent_versions\" | \"GET /internal/apm/dependencies/top_dependencies\" | \"GET /internal/apm/dependencies/upstream_services\" | \"GET /internal/apm/dependencies/metadata\" | \"GET /internal/apm/dependencies/charts/latency\" | \"GET /internal/apm/dependencies/charts/throughput\" | \"GET /internal/apm/dependencies/charts/error_rate\" | \"GET /internal/apm/dependencies/operations\" | \"GET /internal/apm/dependencies/charts/distribution\" | \"GET /internal/apm/dependencies/operations/spans\" | \"GET /internal/apm/correlations/field_candidates/transactions\" | \"POST /internal/apm/correlations/field_stats/transactions\" | \"GET /internal/apm/correlations/field_value_stats/transactions\" | \"POST /internal/apm/correlations/field_value_pairs/transactions\" | \"POST /internal/apm/correlations/significant_correlations/transactions\" | \"POST /internal/apm/correlations/p_values/transactions\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys\" | \"GET /internal/apm/storage_explorer\" | \"GET /internal/apm/services/{serviceName}/storage_details\" | \"GET /internal/apm/storage_chart\" | \"GET /internal/apm/storage_explorer/privileges\" | \"GET /internal/apm/storage_explorer_summary_stats\" | \"GET /internal/apm/storage_explorer/is_cross_cluster_search\" | \"GET /internal/apm/storage_explorer/get_services\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\" | \"GET /internal/apm/services/{serviceName}/infrastructure_attributes\" | \"GET /internal/apm/debug-telemetry\" | \"GET /internal/apm/time_range_metadata\" | \"GET /internal/apm/settings/labs\"" + "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/title\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\" | \"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\" | \"POST /internal/apm/latency/overall_distribution/transactions\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/nodes\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/summary\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/dependency\" | \"GET /internal/apm/services\" | \"POST /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/sorted_and_filtered_services\" | \"GET /internal/apm/service-groups\" | \"GET /internal/apm/service-group\" | \"POST /internal/apm/service-group\" | \"DELETE /internal/apm/service-group\" | \"GET /internal/apm/service-group/services\" | \"GET /internal/apm/service_groups/services_count\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/traces/find\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\" | \"GET /internal/apm/rule_types/transaction_duration/chart_preview\" | \"GET /internal/apm/rule_types/error_count/chart_preview\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_apm_policies\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/fleet/java_agent_versions\" | \"GET /internal/apm/dependencies/top_dependencies\" | \"GET /internal/apm/dependencies/upstream_services\" | \"GET /internal/apm/dependencies/metadata\" | \"GET /internal/apm/dependencies/charts/latency\" | \"GET /internal/apm/dependencies/charts/throughput\" | \"GET /internal/apm/dependencies/charts/error_rate\" | \"GET /internal/apm/dependencies/operations\" | \"GET /internal/apm/dependencies/charts/distribution\" | \"GET /internal/apm/dependencies/operations/spans\" | \"GET /internal/apm/correlations/field_candidates/transactions\" | \"POST /internal/apm/correlations/field_stats/transactions\" | \"GET /internal/apm/correlations/field_value_stats/transactions\" | \"POST /internal/apm/correlations/field_value_pairs/transactions\" | \"POST /internal/apm/correlations/significant_correlations/transactions\" | \"POST /internal/apm/correlations/p_values/transactions\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys\" | \"GET /internal/apm/storage_explorer\" | \"GET /internal/apm/services/{serviceName}/storage_details\" | \"GET /internal/apm/storage_chart\" | \"GET /internal/apm/storage_explorer/privileges\" | \"GET /internal/apm/storage_explorer_summary_stats\" | \"GET /internal/apm/storage_explorer/is_cross_cluster_search\" | \"GET /internal/apm/storage_explorer/get_services\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\" | \"GET /internal/apm/services/{serviceName}/infrastructure_attributes\" | \"GET /internal/apm/debug-telemetry\" | \"GET /internal/apm/time_range_metadata\" | \"GET /internal/apm/settings/labs\" | \"GET /internal/apm/services/{serviceName}/mobile/filters\"" ], "path": "x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts", "deprecated": false, @@ -857,7 +857,63 @@ "label": "APMServerRouteRepository", "description": [], "signature": [ - "{ \"GET /internal/apm/settings/labs\": ", + "{ \"GET /internal/apm/services/{serviceName}/mobile/filters\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/services/{serviceName}/mobile/filters\", ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { mobileFilters: MobileFilters; }, ", + "APMRouteCreateOptions", + ">; \"GET /internal/apm/settings/labs\": ", { "pluginId": "@kbn/server-route-repository", "scope": "common", @@ -6241,7 +6297,7 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { memoryUsageAvgRate: number | undefined; serverlessFunctionsTotal: number | undefined; serverlessDurationAvg: number | null | undefined; billedDurationAvg: number | null | undefined; }, ", + ", { memoryUsageAvgRate: number | undefined; serverlessFunctionsTotal: number | undefined; serverlessDurationAvg: number | null | undefined; billedDurationAvg: number | null | undefined; estimatedCost: number | undefined; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\": ", { diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index d54bfacf9cf1..e2406aade357 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index 0e9e7ca09f0a..cbe86334af55 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index eaa358301257..90f5ae36be4a 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 7f02db839b29..9b721c3f2cb6 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 39a4327903d7..9951038b5d7e 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index a65d7741ef83..2557bd792262 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index ab54eb06c927..c4c882be53a9 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_chat.mdx b/api_docs/cloud_chat.mdx index 135ed7f00675..2fe88b92fbf9 100644 --- a/api_docs/cloud_chat.mdx +++ b/api_docs/cloud_chat.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudChat title: "cloudChat" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudChat plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudChat'] --- import cloudChatObj from './cloud_chat.devdocs.json'; diff --git a/api_docs/cloud_experiments.mdx b/api_docs/cloud_experiments.mdx index c89b7b0df308..c9a49fc99206 100644 --- a/api_docs/cloud_experiments.mdx +++ b/api_docs/cloud_experiments.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudExperiments title: "cloudExperiments" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudExperiments plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudExperiments'] --- import cloudExperimentsObj from './cloud_experiments.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index 84f77ad414f6..232caa7696bb 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 134e69c608d1..6e3f73aaee1c 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index c9a449df68e3..8c9da68b8553 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 8bb82b47604b..79d390cf18f0 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github description: API docs for the core plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] --- import coreObj from './core.devdocs.json'; diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index b7b69b205996..33f7edb04777 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 4bd40bd07f3f..8a9641c1916e 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index e84e5a6ba3f9..9ec0ae390a91 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.mdx b/api_docs/data.mdx index e2ab37d8422b..7983d8d6dede 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 090fe6cc2748..13393a88c75e 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index b475f41bcc94..572b86ac53c3 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index f4cf53189f9e..5a008e9f925f 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index e399e0ff45f7..2689ef981f89 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index eb3ca6b3778d..8219b5be1f3d 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index d7b22eb8a47a..fef4a3d754bf 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index ee4c916ab8b0..fdc12f066f7d 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 89f5fe34bede..51d5e6f53e77 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 5524feaaed97..6947908a0ebe 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 10072b15d3d5..bc26e7084e61 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 67a253a4f126..9643bc44af38 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 89e7e7c5780d..de79f1c68c03 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 1325d99ba766..79badb47fbab 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index fb1138f02e3d..3533bcb7b839 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 9108e6ee0888..1c78dac6efe1 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index d0d2042fee1a..4981b4744a2a 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index db0e364bcd22..51b6fbd37810 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 6ea1f3c83b9b..a737c105f434 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index b6e1be1ef26d..8a639ebf03d5 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_log.devdocs.json b/api_docs/event_log.devdocs.json index 01751839f9f6..67c59c6e92b2 100644 --- a/api_docs/event_log.devdocs.json +++ b/api_docs/event_log.devdocs.json @@ -655,6 +655,48 @@ ], "returnComment": [] }, + { + "parentPluginId": "eventLog", + "id": "def-server.ClusterClientAdapter.queryEventsWithAuthFilter", + "type": "Function", + "tags": [], + "label": "queryEventsWithAuthFilter", + "description": [], + "signature": [ + "(queryOptions: ", + "FindEventsOptionsWithAuthFilter", + ") => Promise<", + { + "pluginId": "eventLog", + "scope": "server", + "docId": "kibEventLogPluginApi", + "section": "def-server.QueryEventsBySavedObjectResult", + "text": "QueryEventsBySavedObjectResult" + }, + ">" + ], + "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "eventLog", + "id": "def-server.ClusterClientAdapter.queryEventsWithAuthFilter.$1", + "type": "CompoundType", + "tags": [], + "label": "queryOptions", + "description": [], + "signature": [ + "FindEventsOptionsWithAuthFilter" + ], + "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "eventLog", "id": "def-server.ClusterClientAdapter.aggregateEventsBySavedObjects", @@ -961,6 +1003,124 @@ ], "returnComment": [] }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter", + "type": "Function", + "tags": [], + "label": "findEventsWithAuthFilter", + "description": [], + "signature": [ + "(type: string, ids: string[], authFilter: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + }, + ", namespace: string | undefined, options?: Partial<", + "FindOptionsType", + "> | undefined) => Promise<", + { + "pluginId": "eventLog", + "scope": "server", + "docId": "kibEventLogPluginApi", + "section": "def-server.QueryEventsBySavedObjectResult", + "text": "QueryEventsBySavedObjectResult" + }, + ">" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$2", + "type": "Array", + "tags": [], + "label": "ids", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$3", + "type": "Object", + "tags": [], + "label": "authFilter", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.KueryNode", + "text": "KueryNode" + } + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$4", + "type": "string", + "tags": [], + "label": "namespace", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsWithAuthFilter.$5", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "Partial<", + "FindOptionsType", + "> | undefined" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, { "parentPluginId": "eventLog", "id": "def-server.IEventLogClient.aggregateEventsBySavedObjectIds", @@ -1068,7 +1228,7 @@ }, ", options?: Partial<", "AggregateOptionsType", - "> | undefined) => Promise<", + "> | undefined, namespaces?: (string | undefined)[] | undefined) => Promise<", { "pluginId": "eventLog", "scope": "server", @@ -1134,6 +1294,21 @@ "deprecated": false, "trackAdoption": false, "isRequired": false + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.aggregateEventsWithAuthFilter.$4", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "(string | undefined)[] | undefined" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [] @@ -1324,7 +1499,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" + "(Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; kind?: string | undefined; hash?: string | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" ], "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", "deprecated": false, @@ -1344,7 +1519,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" + "DeepPartial | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; kind?: string | undefined; hash?: string | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -1359,7 +1534,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" + "Readonly<{ error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ consumer?: string | undefined; execution?: Readonly<{ status?: string | undefined; uuid?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: string | number | undefined; number_of_generated_actions?: string | number | undefined; alert_counts?: Readonly<{ recovered?: string | number | undefined; active?: string | number | undefined; new?: string | number | undefined; } & {}> | undefined; number_of_searches?: string | number | undefined; total_indexing_duration_ms?: string | number | undefined; es_search_duration_ms?: string | number | undefined; total_search_duration_ms?: string | number | undefined; execution_gap_duration_s?: string | number | undefined; rule_type_run_duration_ms?: string | number | undefined; process_alerts_duration_ms?: string | number | undefined; trigger_actions_duration_ms?: string | number | undefined; process_rule_duration_ms?: string | number | undefined; claim_to_start_duration_ms?: string | number | undefined; prepare_rule_duration_ms?: string | number | undefined; total_run_duration_ms?: string | number | undefined; total_enrichment_duration_ms?: string | number | undefined; } & {}> | undefined; status_order?: string | number | undefined; } & {}> | undefined; rule_type_id?: string | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; alerting?: Readonly<{ status?: string | undefined; outcome?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; schedule_delay?: string | number | undefined; scheduled?: string | undefined; } & {}> | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; namespace?: string | undefined; rel?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; space_ids?: string[] | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ name?: string | undefined; description?: string | undefined; category?: string | undefined; id?: string | undefined; uuid?: string | undefined; version?: string | undefined; license?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; category?: string[] | undefined; type?: string[] | undefined; id?: string | undefined; reason?: string | undefined; created?: string | undefined; outcome?: string | undefined; end?: string | undefined; original?: string | undefined; duration?: string | number | undefined; kind?: string | undefined; hash?: string | undefined; code?: string | undefined; url?: string | undefined; action?: string | undefined; severity?: string | number | undefined; dataset?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: string | number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 052566f8bcc0..8bde9bb1f9a6 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 106 | 0 | 106 | 10 | +| 115 | 0 | 115 | 11 | ## Server diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 659b9da3cf4b..466212be84fa 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 9f2979cabcb1..4f6213ab05df 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index 6f2af127202c..2791141c726d 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 535afee99a0b..03111be9f88d 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index 2d8ec17e1762..9a54a8f38d4b 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index c63b849c181c..df40548c3479 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 63fb6b4271b0..118c72b78bc4 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 95ec1e7803fa..f7130076a7bb 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 2fbe52f3dfcc..5c4e251c34a6 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index e2d79b171cda..1f2ab7602dab 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 2e181d154107..b117a80b23f9 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index 4822d7635fbd..b4fc3c7e51ff 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 868177b746dd..24f1634991a1 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 198334ba4cda..899b1701c470 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index e34c71768340..9f198fc261f7 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 4f6c8b8474fb..7f9ff54a7246 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 9b4c07a74c49..66d4d6aa0c7b 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.devdocs.json b/api_docs/files.devdocs.json index 8264e26e68ef..94f495ecaaf4 100644 --- a/api_docs/files.devdocs.json +++ b/api_docs/files.devdocs.json @@ -21,7 +21,7 @@ }, ") => JSX.Element" ], - "path": "x-pack/plugins/files/public/components/file_picker/index.tsx", + "path": "src/plugins/files/public/components/file_picker/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -42,7 +42,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/file_picker/index.tsx", + "path": "src/plugins/files/public/components/file_picker/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -61,7 +61,7 @@ "signature": [ "({ client, children }: React.PropsWithChildren) => JSX.Element" ], - "path": "x-pack/plugins/files/public/components/context.tsx", + "path": "src/plugins/files/public/components/context.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -75,7 +75,7 @@ "signature": [ "React.PropsWithChildren" ], - "path": "x-pack/plugins/files/public/components/context.tsx", + "path": "src/plugins/files/public/components/context.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -106,7 +106,7 @@ }, " & React.RefAttributes>" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -146,7 +146,7 @@ }, ") => JSX.Element" ], - "path": "x-pack/plugins/files/public/components/upload_file/index.tsx", + "path": "src/plugins/files/public/components/upload_file/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -167,7 +167,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/upload_file/index.tsx", + "path": "src/plugins/files/public/components/upload_file/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -197,7 +197,7 @@ }, " extends GlobalEndpoints" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -221,7 +221,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -238,7 +238,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -256,7 +256,7 @@ "signature": [ "(args: Readonly<{} & { id: string; }> & { abortSignal?: AbortSignal | undefined; } & { kind: string; }) => Promise<{ ok: true; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -273,7 +273,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -299,7 +299,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -316,7 +316,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -342,7 +342,7 @@ }, "[]; total: number; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -359,7 +359,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -385,7 +385,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -402,7 +402,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -420,7 +420,7 @@ "signature": [ "(args: Readonly<{} & { id: string; }> & Readonly<{ selfDestructOnAbort?: boolean | undefined; } & {}> & { body: unknown; kind: string; abortSignal?: AbortSignal | undefined; contentType?: string | undefined; }) => Promise<{ ok: true; size: number; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -436,7 +436,7 @@ "signature": [ "Readonly<{} & { id: string; }> & Readonly<{ selfDestructOnAbort?: boolean | undefined; } & {}> & { body: unknown; kind: string; abortSignal?: AbortSignal | undefined; contentType?: string | undefined; }" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -456,7 +456,7 @@ "signature": [ "(args: Readonly<{ fileName?: string | undefined; } & { id: string; }> & { abortSignal?: AbortSignal | undefined; } & { kind: string; }) => Promise" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -473,7 +473,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -499,7 +499,7 @@ }, ", \"id\" | \"fileKind\">) => string" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -523,7 +523,7 @@ }, ", \"id\" | \"fileKind\">" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -553,7 +553,7 @@ }, ">" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -570,7 +570,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -588,7 +588,7 @@ "signature": [ "(args: Readonly<{} & { id: string; }> & { abortSignal?: AbortSignal | undefined; } & { kind: string; }) => Promise<{ ok: true; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -605,7 +605,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -631,7 +631,7 @@ }, "; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -648,7 +648,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -674,7 +674,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -691,7 +691,7 @@ "signature": [ "E[\"inputs\"][\"body\"] & E[\"inputs\"][\"params\"] & E[\"inputs\"][\"query\"] & { abortSignal?: AbortSignal | undefined; } & { kind: string; } & ExtraArgs" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -709,7 +709,7 @@ "description": [ "\nA factory for creating a {@link ScopedFilesClient}" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -733,7 +733,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -759,7 +759,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -775,7 +775,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -803,7 +803,7 @@ }, " extends React.ImgHTMLAttributes" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -814,7 +814,7 @@ "tags": [], "label": "src", "description": [], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -825,7 +825,7 @@ "tags": [], "label": "alt", "description": [], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -848,7 +848,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -864,7 +864,7 @@ "signature": [ "\"m\" | \"s\" | \"l\" | \"xl\" | \"original\" | \"fullWidth\" | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -880,7 +880,7 @@ "signature": [ "React.HTMLAttributes | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false }, @@ -896,7 +896,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "x-pack/plugins/files/public/components/image/image.tsx", + "path": "src/plugins/files/public/components/image/image.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -924,7 +924,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -940,7 +940,7 @@ "signature": [ "Kind" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -958,7 +958,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -974,7 +974,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -990,7 +990,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1006,7 +1006,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1024,7 +1024,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1040,7 +1040,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1056,7 +1056,7 @@ "signature": [ "(files: UploadedFile[]) => void" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1070,7 +1070,7 @@ "signature": [ "UploadedFile[]" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1090,7 +1090,7 @@ "signature": [ "((e: Error) => void) | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1104,7 +1104,7 @@ "signature": [ "Error" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1124,7 +1124,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -1142,7 +1142,7 @@ "signature": [ "(() => void) | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -1163,7 +1163,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false }, @@ -1181,7 +1181,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/files/public/components/upload_file/upload_file.tsx", + "path": "src/plugins/files/public/components/upload_file/upload_file.tsx", "deprecated": false, "trackAdoption": false } @@ -1205,7 +1205,7 @@ }, "" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1221,7 +1221,7 @@ "signature": [ "Kind" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false }, @@ -1237,7 +1237,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -1255,7 +1255,7 @@ "signature": [ "(fileIds: string[]) => void" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1269,7 +1269,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1291,7 +1291,7 @@ "DoneNotification", "[]) => void) | undefined" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1306,7 +1306,7 @@ "DoneNotification", "[]" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1326,7 +1326,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/public/components/file_picker/file_picker.tsx", + "path": "src/plugins/files/public/components/file_picker/file_picker.tsx", "deprecated": false, "trackAdoption": false } @@ -1418,7 +1418,7 @@ }, "[]; total: number; }; }" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1505,7 +1505,7 @@ "section": "def-common.FilesMetrics", "text": "FilesMetrics" }, - ">; publicDownload: (arg: Omit & Readonly<{} & { token: string; }> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise; find: (arg: Omit | undefined; kind?: string | string[] | undefined; extension?: string | string[] | undefined; } & {}> & Readonly<{ page?: number | undefined; perPage?: number | undefined; } & {}> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise<{ files: ", + ">; publicDownload: (arg: Omit & Readonly<{} & { token: string; }> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise; find: (arg: Omit | undefined; extension?: string | string[] | undefined; kind?: string | string[] | undefined; } & {}> & Readonly<{ page?: number | undefined; perPage?: number | undefined; } & {}> & { abortSignal?: AbortSignal | undefined; }, \"kind\">) => Promise<{ files: ", { "pluginId": "files", "scope": "common", @@ -1515,7 +1515,7 @@ }, "[]; total: number; }>; }" ], - "path": "x-pack/plugins/files/public/types.ts", + "path": "src/plugins/files/public/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1531,7 +1531,7 @@ "description": [ "\nPublic setup-phase contract" ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1555,7 +1555,7 @@ "text": "FilesClientFactory" } ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": true, "references": [] @@ -1580,7 +1580,7 @@ }, ") => void" ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1602,7 +1602,7 @@ "text": "FileKind" } ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1632,7 +1632,7 @@ }, "; }" ], - "path": "x-pack/plugins/files/public/plugin.ts", + "path": "src/plugins/files/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "start", @@ -1671,7 +1671,7 @@ "text": "FileClient" } ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1693,7 +1693,7 @@ "text": "CreateEsFileClientArgs" } ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1713,7 +1713,7 @@ "description": [ "\nArguments to create an ES file client." ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1726,7 +1726,7 @@ "description": [ "\nThe name of the ES index that will store file metadata." ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -1739,7 +1739,7 @@ "description": [ "\nThe name of the ES index that will store file contents." ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -2941,7 +2941,7 @@ "default", "; }" ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -2957,7 +2957,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false }, @@ -2979,7 +2979,7 @@ "text": "Logger" } ], - "path": "x-pack/plugins/files/server/file_client/create_es_file_client.ts", + "path": "src/plugins/files/server/file_client/create_es_file_client.ts", "deprecated": false, "trackAdoption": false } @@ -3005,7 +3005,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3018,7 +3018,7 @@ "description": [ "\nFile name" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3031,7 +3031,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3047,7 +3047,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3063,7 +3063,7 @@ "signature": [ "Meta | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3079,7 +3079,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -3095,7 +3095,7 @@ "description": [ "\nArguments for a creating a file share" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3111,7 +3111,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false }, @@ -3129,7 +3129,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false }, @@ -3152,7 +3152,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -3166,7 +3166,7 @@ "tags": [], "label": "DeleteArg", "description": [], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3181,7 +3181,7 @@ "description": [ "\nUnique ID of file metadata to delete\n" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -3197,7 +3197,7 @@ "description": [ "\nArguments to delete a file." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3210,7 +3210,7 @@ "description": [ "\nFile ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -3223,7 +3223,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -3239,7 +3239,7 @@ "description": [ "\nDelete file shares for file arguments." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3252,7 +3252,7 @@ "description": [ "\nThe file id to delete the shares for." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -3268,7 +3268,7 @@ "description": [ "\nWraps the {@link FileMetadataClient} and {@link BlobStorageClient} client\nto provide basic file CRUD functionality.\n\nFor now this is just a shallow type of the implementation for export purposes." ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3281,7 +3281,7 @@ "description": [ "See {@link FileMetadata.FileKind}." ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false }, @@ -3307,7 +3307,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3323,7 +3323,7 @@ "signature": [ "CreateArgs" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3359,7 +3359,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3381,7 +3381,7 @@ "text": "GetArg" } ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3409,7 +3409,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3425,7 +3425,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3449,7 +3449,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3477,7 +3477,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3499,7 +3499,7 @@ "text": "DeleteArgs" } ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3535,7 +3535,7 @@ }, "[]; total: number; }>" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3558,7 +3558,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -3590,7 +3590,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3606,7 +3606,7 @@ "signature": [ "ShareArgs" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3628,7 +3628,7 @@ "signature": [ "(args: IdArg) => Promise" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -3645,7 +3645,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -3681,7 +3681,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_client/types.ts", + "path": "src/plugins/files/server/file_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -3704,7 +3704,7 @@ "text": "ListArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -3732,7 +3732,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3745,7 +3745,7 @@ "description": [ "\nUnique ID of a file, used to locate a file." ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false }, @@ -3777,7 +3777,7 @@ }, " & { FileKind: string; Meta?: M | undefined; }" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -3793,7 +3793,7 @@ "description": [ "\nAn abstraction of storage implementation of file object's (i.e., metadata)" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3825,7 +3825,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3848,7 +3848,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3884,7 +3884,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3906,7 +3906,7 @@ "text": "GetArg" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3942,7 +3942,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3965,7 +3965,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -3993,7 +3993,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4015,7 +4015,7 @@ "text": "DeleteArg" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4051,7 +4051,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4074,7 +4074,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -4110,7 +4110,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4132,7 +4132,7 @@ "text": "GetUsageMetricsArgs" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4152,7 +4152,7 @@ "description": [ "\nA simple interface for getting an instance of {@link FileServiceStart}" ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4183,7 +4183,7 @@ "text": "FileServiceStart" } ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4206,7 +4206,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4235,7 +4235,7 @@ "text": "FileServiceStart" } ], - "path": "x-pack/plugins/files/server/file_service/file_service_factory.ts", + "path": "src/plugins/files/server/file_service/file_service_factory.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4253,7 +4253,7 @@ "description": [ "\nPublic file service interface." ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4285,7 +4285,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4308,7 +4308,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4336,7 +4336,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4358,7 +4358,7 @@ "text": "UpdateFileArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4386,7 +4386,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4408,7 +4408,7 @@ "text": "DeleteFileArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4444,7 +4444,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4466,7 +4466,7 @@ "text": "GetByIdArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4502,7 +4502,7 @@ }, "[]; total: number; }>" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4524,7 +4524,7 @@ "text": "FindFileArgs" } ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4552,7 +4552,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4569,7 +4569,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4603,7 +4603,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4626,7 +4626,7 @@ "text": "ListArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4660,7 +4660,7 @@ }, " & { id: string; }>" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4683,7 +4683,7 @@ "text": "UpdateArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4701,7 +4701,7 @@ "signature": [ "(args: IdArg) => Promise" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4718,7 +4718,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false } @@ -4744,7 +4744,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4770,7 +4770,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4786,7 +4786,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/files/server/file_service/file_service.ts", + "path": "src/plugins/files/server/file_service/file_service.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4806,7 +4806,7 @@ "description": [ "\nWe only expose functionality here that do not require you to have a {@link File}\ninstance loaded." ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4830,7 +4830,7 @@ }, ">" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4846,7 +4846,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4882,7 +4882,7 @@ }, "[]; }>" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4904,7 +4904,7 @@ "text": "ListArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4940,7 +4940,7 @@ }, " & { id: string; }>" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4962,7 +4962,7 @@ "text": "UpdateArgs" } ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4982,7 +4982,7 @@ "signature": [ "(args: IdArg) => Promise" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4998,7 +4998,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "path": "src/plugins/files/server/file_share_service/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5033,7 +5033,7 @@ "text": "Pagination" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5049,7 +5049,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5084,7 +5084,7 @@ "text": "Pagination" } ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5100,7 +5100,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5116,7 +5116,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5132,7 +5132,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5148,7 +5148,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5164,7 +5164,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -5180,7 +5180,7 @@ "description": [ "\nGet a file" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5193,7 +5193,7 @@ "description": [ "\nUnique ID of file metadata" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5209,7 +5209,7 @@ "description": [ "\nArguments to get a file by ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5222,7 +5222,7 @@ "description": [ "\nFile ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5235,7 +5235,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -5251,7 +5251,7 @@ "description": [ "\nArgs to get usage metrics" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5267,7 +5267,7 @@ "signature": [ "{ capacity: number; }" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5300,7 +5300,7 @@ "text": "Pagination" } ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5316,7 +5316,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -5342,7 +5342,7 @@ }, "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5355,7 +5355,7 @@ "description": [ "\nA unique file ID." ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false }, @@ -5379,7 +5379,7 @@ }, " | undefined; FileKind?: string | undefined; Meta?: M | undefined; }" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", + "path": "src/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", "deprecated": false, "trackAdoption": false } @@ -5395,7 +5395,7 @@ "description": [ "\nUpdate file share arguments." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5408,7 +5408,7 @@ "description": [ "\nThe file share ID." ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false }, @@ -5424,7 +5424,7 @@ "signature": [ "{ name?: string | undefined; }" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false } @@ -5440,7 +5440,7 @@ "description": [ "\nArguments to update a file" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5453,7 +5453,7 @@ "description": [ "\nFile ID." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5466,7 +5466,7 @@ "description": [ "\nFile kind, must correspond to a registered {@link FileKind}." ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false }, @@ -5482,7 +5482,7 @@ "signature": [ "{ name: string; meta: unknown; alt: string | undefined; }" ], - "path": "x-pack/plugins/files/server/file_service/file_action_types.ts", + "path": "src/plugins/files/server/file_service/file_action_types.ts", "deprecated": false, "trackAdoption": false } @@ -5504,7 +5504,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5521,7 +5521,7 @@ "signature": [ "IdArg" ], - "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", + "path": "src/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5537,7 +5537,7 @@ "description": [ "\nFiles plugin setup contract" ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5563,7 +5563,7 @@ }, ") => void" ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": true, "references": [], @@ -5586,7 +5586,7 @@ "text": "FileKind" } ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5607,7 +5607,7 @@ "description": [ "\nFiles plugin start contract" ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5631,7 +5631,7 @@ "text": "FileServiceFactory" } ], - "path": "x-pack/plugins/files/server/types.ts", + "path": "src/plugins/files/server/types.ts", "deprecated": false, "trackAdoption": true, "references": [] @@ -5654,7 +5654,7 @@ "description": [ "\nDefines all the settings for supported blob stores.\n\nKey names map to unique blob store implementations and so must not be changed\nwithout a migration" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5670,7 +5670,7 @@ "signature": [ "{ index: string; } | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -5696,7 +5696,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5709,7 +5709,7 @@ "description": [ "\nThe file ID" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5732,7 +5732,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -5764,7 +5764,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5788,7 +5788,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5820,7 +5820,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5836,7 +5836,7 @@ "signature": [ "Readable" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5854,7 +5854,7 @@ "Observable", " | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -5876,7 +5876,7 @@ "Readable", ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5896,7 +5896,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -5932,7 +5932,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5955,7 +5955,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -5983,7 +5983,7 @@ }, "[]>" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -6009,7 +6009,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6031,7 +6031,7 @@ "text": "FileUnshareOptions" } ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -6059,7 +6059,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -6077,7 +6077,7 @@ "description": [ "\nSet of metadata captured for every image uploaded via the file services'\npublic components." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6093,7 +6093,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6106,7 +6106,7 @@ "description": [ "\nWidth, in px, of the original image" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6119,7 +6119,7 @@ "description": [ "\nHeight, in px, of the original image" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6145,7 +6145,7 @@ }, "" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6158,7 +6158,7 @@ "description": [ "\nUnique file ID." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6171,7 +6171,7 @@ "description": [ "\nISO string of when this file was created" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6184,7 +6184,7 @@ "description": [ "\nISO string of when the file was updated" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6199,7 +6199,7 @@ "description": [ "\nFile name.\n" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6215,7 +6215,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6231,7 +6231,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6249,7 +6249,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6265,7 +6265,7 @@ "signature": [ "Meta | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6281,7 +6281,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6296,7 +6296,7 @@ "description": [ "\nA unique kind that governs various aspects of the file. A consumer of the\nfiles service must register a file kind and link their files to a specific\nkind.\n" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6312,7 +6312,7 @@ "signature": [ "\"AWAITING_UPLOAD\" | \"UPLOADING\" | \"READY\" | \"UPLOAD_ERROR\" | \"DELETED\"" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6330,7 +6330,7 @@ "description": [ "\nA descriptor of meta values associated with a set or \"kind\" of files.\n" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6343,7 +6343,7 @@ "description": [ "\nUnique file kind ID" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6361,7 +6361,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6379,7 +6379,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6402,7 +6402,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6420,7 +6420,7 @@ "signature": [ "{ create?: HttpEndpointDefinition | undefined; update?: HttpEndpointDefinition | undefined; delete?: HttpEndpointDefinition | undefined; getById?: HttpEndpointDefinition | undefined; list?: HttpEndpointDefinition | undefined; download?: HttpEndpointDefinition | undefined; share?: HttpEndpointDefinition | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6436,7 +6436,7 @@ "description": [ "\nAttributes of a file that represent a serialised version of the file." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6449,7 +6449,7 @@ "description": [ "\nUnique ID share instance" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6462,7 +6462,7 @@ "description": [ "\nISO timestamp the share was created" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6475,7 +6475,7 @@ "description": [ "\nUnix timestamp (in milliseconds) of when this share expires" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6491,7 +6491,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6504,7 +6504,7 @@ "description": [ "\nThe ID of the file this share is linked to" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6520,7 +6520,7 @@ "description": [ "\nArguments to pass to share a file" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6536,7 +6536,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6554,7 +6554,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6570,7 +6570,7 @@ "description": [ "\nA collection of generally useful metrics about files." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6586,7 +6586,7 @@ "signature": [ "{ esFixedSizeIndex: { capacity: number; used: number; available: number; }; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6602,7 +6602,7 @@ "signature": [ "{ AWAITING_UPLOAD: number; UPLOADING: number; READY: number; UPLOAD_ERROR: number; DELETED: number; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6618,7 +6618,7 @@ "signature": [ "{ [x: string]: number; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6634,7 +6634,7 @@ "description": [ "\nArguments for unsharing a file" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6647,7 +6647,7 @@ "description": [ "\nSpecify the share instance to remove" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6663,7 +6663,7 @@ "description": [ "\nValues for paginating through results." ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6679,7 +6679,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -6695,7 +6695,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -6733,7 +6733,7 @@ }, " | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6750,7 +6750,7 @@ "signature": [ "\"esFixedSizeIndex\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6767,7 +6767,7 @@ "signature": [ "\"file\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6784,7 +6784,7 @@ "signature": [ "\"none\" | \"br\" | \"gzip\" | \"deflate\"" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6817,7 +6817,7 @@ }, " & { FileKind: string; Meta?: Meta | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6849,7 +6849,7 @@ }, ">" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6866,7 +6866,7 @@ "signature": [ "{ created: string; token: string; name?: string | undefined; valid_until: number; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6892,7 +6892,7 @@ }, " & { token: string; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6909,7 +6909,7 @@ "signature": [ "\"AWAITING_UPLOAD\" | \"UPLOADING\" | \"READY\" | \"UPLOAD_ERROR\" | \"DELETED\"" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6926,7 +6926,7 @@ "signature": [ "\"files\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6943,7 +6943,7 @@ "signature": [ "\"files\"" ], - "path": "x-pack/plugins/files/common/constants.ts", + "path": "src/plugins/files/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6960,7 +6960,7 @@ "signature": [ "{ name: string; meta: Meta | undefined; alt: string | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6977,7 +6977,7 @@ "signature": [ "{ name?: string | undefined; }" ], - "path": "x-pack/plugins/files/common/types.ts", + "path": "src/plugins/files/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 881ab6389c45..7fa464d93185 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index cb42acfa5f94..3035e0e0641d 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 582ac8e70514..f394f8841812 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index fcb943214823..09a89d44f0f5 100644 --- a/api_docs/guided_onboarding.mdx +++ b/api_docs/guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/guidedOnboarding title: "guidedOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the guidedOnboarding plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index ef70e6405810..c6842826a6b6 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index dbebd786a98c..81aa6e309245 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 409c88b5aa69..222a8affc952 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 47b3a408e497..520d78d49739 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 68cc882c211d..72a7c4beef39 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 0a75b7b3fcdb..725b53c8d5e1 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 6e8eaac719d7..c883f27e694f 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index aeed11bdb22d..59fe0acd596b 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index 418329f9bd10..c4bf8dcc5170 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index 3bd82d9fdf73..e02a461e07a5 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] --- import kbnAlertsObj from './kbn_alerts.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 308cbd75b1b1..47ef34e7033d 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index c0d900d2839b..8481e92961ab 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index 46192c334052..f11e6eaa6986 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index 8e3823904fd0..7f6c81657e18 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index 436193f458dc..a260493db0bb 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index e20e500f4764..0603fd70a01a 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_gainsight.mdx b/api_docs/kbn_analytics_shippers_gainsight.mdx index 92ce0d5f3942..5b3f6e7ebcc1 100644 --- a/api_docs/kbn_analytics_shippers_gainsight.mdx +++ b/api_docs/kbn_analytics_shippers_gainsight.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-gainsight title: "@kbn/analytics-shippers-gainsight" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-gainsight plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-gainsight'] --- import kbnAnalyticsShippersGainsightObj from './kbn_analytics_shippers_gainsight.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index a8b49e333a99..0a1876b6dc72 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.devdocs.json b/api_docs/kbn_apm_synthtrace.devdocs.json index 8c184492cae5..5202c4cf00ae 100644 --- a/api_docs/kbn_apm_synthtrace.devdocs.json +++ b/api_docs/kbn_apm_synthtrace.devdocs.json @@ -1070,7 +1070,7 @@ "section": "def-server.ApmException", "text": "ApmException" }, - "[]; 'error.grouping_name': string; 'error.grouping_key': string; 'host.name': string; 'host.hostname': string; 'http.request.method': string; 'http.response.status_code': number; 'kubernetes.pod.uid': string; 'kubernetes.pod.name': string; 'metricset.name': string; observer: ", + "[]; 'error.grouping_name': string; 'error.grouping_key': string; 'host.name': string; 'host.architecture': string; 'host.hostname': string; 'http.request.method': string; 'http.response.status_code': number; 'kubernetes.pod.uid': string; 'kubernetes.pod.name': string; 'metricset.name': string; observer: ", "Observer", "; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.version': string; 'service.environment': string; 'service.node.name': string; 'service.runtime.name': string; 'service.runtime.version': string; 'service.framework.name': string; 'service.target.name': string; 'service.target.type': string; 'span.action': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.resource': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; 'span.links': { trace: { id: string; }; span: { id: string; }; }[]; 'cloud.provider': string; 'cloud.project.name': string; 'cloud.service.name': string; 'cloud.availability_zone': string; 'cloud.machine.type': string; 'cloud.region': string; 'host.os.platform': string; 'faas.id': string; 'faas.name': string; 'faas.coldstart': boolean; 'faas.execution': string; 'faas.trigger.type': string; 'faas.trigger.request_id': string; }> & Partial<{ 'system.process.memory.size': number; 'system.memory.actual.free': number; 'system.memory.total': number; 'system.cpu.total.norm.pct': number; 'system.process.memory.rss.bytes': number; 'system.process.cpu.total.norm.pct': number; 'jvm.memory.heap.used': number; 'jvm.memory.non_heap.used': number; 'jvm.thread.count': number; 'faas.billed_duration': number; 'faas.timeout': number; 'faas.coldstart_duration': number; 'faas.duration': number; }>" ], @@ -1166,7 +1166,7 @@ "section": "def-server.ApmException", "text": "ApmException" }, - "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", + "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.architecture'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'service.target.name'?: string | undefined; 'service.target.type'?: string | undefined; 'span.action'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.response_time.sum.us'?: number | undefined; 'span.destination.service.response_time.count'?: number | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.name'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; 'faas.billed_duration'?: number | undefined; 'faas.timeout'?: number | undefined; 'faas.coldstart_duration'?: number | undefined; 'faas.duration'?: number | undefined; }[]" ], @@ -1222,7 +1222,7 @@ "section": "def-server.ApmException", "text": "ApmException" }, - "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", + "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'host.architecture'?: string | undefined; 'host.hostname'?: string | undefined; 'http.request.method'?: string | undefined; 'http.response.status_code'?: number | undefined; 'kubernetes.pod.uid'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; observer?: ", "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.duration.histogram'?: { values: number[]; counts: number[]; } | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'service.target.name'?: string | undefined; 'service.target.type'?: string | undefined; 'span.action'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.resource'?: string | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.name'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; 'faas.billed_duration'?: number | undefined; 'faas.timeout'?: number | undefined; 'faas.coldstart_duration'?: number | undefined; 'faas.duration'?: number | undefined; }[]" ], @@ -1405,7 +1405,7 @@ "label": "serverlessFunction", "description": [], "signature": [ - "({ functionName, serviceName, environment, agentName, }: { functionName: string; environment: string; agentName: string; serviceName?: string | undefined; }) => ", + "({ functionName, serviceName, environment, agentName, architecture, }: { functionName: string; environment: string; agentName: string; serviceName?: string | undefined; architecture?: string | undefined; }) => ", "ServerlessFunction" ], "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", @@ -1421,7 +1421,7 @@ "label": "__0", "description": [], "signature": [ - "{ functionName: string; environment: string; agentName: string; serviceName?: string | undefined; }" + "{ functionName: string; environment: string; agentName: string; serviceName?: string | undefined; architecture?: string | undefined; }" ], "path": "packages/kbn-apm-synthtrace/src/lib/apm/serverless_function.ts", "deprecated": false, diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index afddc7954e30..f2d158d806df 100644 --- a/api_docs/kbn_apm_synthtrace.mdx +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace title: "@kbn/apm-synthtrace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index ae6deb1f49b6..f9bda8cd345e 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index b09be2edee67..7eed0bacca67 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index e5a0470ef758..98f8a8e26d91 100644 --- a/api_docs/kbn_cases_components.mdx +++ b/api_docs/kbn_cases_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cases-components title: "@kbn/cases-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cases-components plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index 0a5b161ad442..9e7dad9e5af4 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index e139ed9c99b3..f9f7fba403a8 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index 2b9855163732..78416a96930b 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index c54baf30f450..e5069892fa2d 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index a50be181142e..9288a8e83e9f 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index bdcc09f8b705..aad5db9fd347 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 4bce0f0416f3..c90c6ac5f0ac 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index 56eee75c4475..24b8a4d6f7d3 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.devdocs.json b/api_docs/kbn_config_schema.devdocs.json index fba38fe0d44c..6f14501525b6 100644 --- a/api_docs/kbn_config_schema.devdocs.json +++ b/api_docs/kbn_config_schema.devdocs.json @@ -463,9 +463,6 @@ "label": "rightOperand", "description": [], "signature": [ - "A | ", - "Reference", - " | ", { "pluginId": "@kbn/config-schema", "scope": "server", @@ -473,7 +470,9 @@ "section": "def-server.Type", "text": "Type" }, - "" + " | A | ", + "Reference", + "" ], "path": "packages/kbn-config-schema/src/types/conditional_type.ts", "deprecated": false, @@ -1466,9 +1465,7 @@ "ConditionalTypeValue", ", B, C>(leftOperand: ", "Reference", - ", rightOperand: A | ", - "Reference", - " | ", + ", rightOperand: ", { "pluginId": "@kbn/config-schema", "scope": "server", @@ -1476,7 +1473,9 @@ "section": "def-server.Type", "text": "Type" }, - ", equalType: ", + " | A | ", + "Reference", + ", equalType: ", { "pluginId": "@kbn/config-schema", "scope": "server", @@ -2521,9 +2520,7 @@ "ConditionalTypeValue", ", B, C>(leftOperand: ", "Reference", - ", rightOperand: A | ", - "Reference", - " | ", + ", rightOperand: ", { "pluginId": "@kbn/config-schema", "scope": "server", @@ -2531,7 +2528,9 @@ "section": "def-server.Type", "text": "Type" }, - ", equalType: ", + " | A | ", + "Reference", + ", equalType: ", { "pluginId": "@kbn/config-schema", "scope": "server", @@ -2587,9 +2586,6 @@ "label": "rightOperand", "description": [], "signature": [ - "A | ", - "Reference", - " | ", { "pluginId": "@kbn/config-schema", "scope": "server", @@ -2597,7 +2593,9 @@ "section": "def-server.Type", "text": "Type" }, - "" + " | A | ", + "Reference", + "" ], "path": "packages/kbn-config-schema/index.ts", "deprecated": false, diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index f1e2c75a96be..c5bfda8a108f 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list.mdx b/api_docs/kbn_content_management_table_list.mdx index ae422092f611..640644dd2553 100644 --- a/api_docs/kbn_content_management_table_list.mdx +++ b/api_docs/kbn_content_management_table_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list title: "@kbn/content-management-table-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list'] --- import kbnContentManagementTableListObj from './kbn_content_management_table_list.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index ec862415cece..93ef2f659d64 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 71b5b81e0f9d..9710daec90e5 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 6f6061b8f5ec..2bf493eab65b 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index d4574a12b9b8..88ff29aa1895 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index 7c25b89678fb..8f2a8088cf00 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 36a470d0f8a9..0a3b97751da0 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index 291966f86854..4bdbc3545664 100644 --- a/api_docs/kbn_core_application_browser.mdx +++ b/api_docs/kbn_core_application_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser title: "@kbn/core-application-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser'] --- import kbnCoreApplicationBrowserObj from './kbn_core_application_browser.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index fd45bd721852..d301fea8b399 100644 --- a/api_docs/kbn_core_application_browser_internal.mdx +++ b/api_docs/kbn_core_application_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-internal title: "@kbn/core-application-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index cc2f5068ddad..ee6e76a22809 100644 --- a/api_docs/kbn_core_application_browser_mocks.mdx +++ b/api_docs/kbn_core_application_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-mocks title: "@kbn/core-application-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-mocks'] --- import kbnCoreApplicationBrowserMocksObj from './kbn_core_application_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_common.mdx b/api_docs/kbn_core_application_common.mdx index 7957456aedfc..3a7a01aa3d73 100644 --- a/api_docs/kbn_core_application_common.mdx +++ b/api_docs/kbn_core_application_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-common title: "@kbn/core-application-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-common'] --- import kbnCoreApplicationCommonObj from './kbn_core_application_common.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index 42bd1cad00ad..d396b616ce5a 100644 --- a/api_docs/kbn_core_apps_browser_internal.mdx +++ b/api_docs/kbn_core_apps_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-internal title: "@kbn/core-apps-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-internal'] --- import kbnCoreAppsBrowserInternalObj from './kbn_core_apps_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_mocks.mdx b/api_docs/kbn_core_apps_browser_mocks.mdx index e9bb20a318e1..63df5fb47ddd 100644 --- a/api_docs/kbn_core_apps_browser_mocks.mdx +++ b/api_docs/kbn_core_apps_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-mocks title: "@kbn/core-apps-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-mocks'] --- import kbnCoreAppsBrowserMocksObj from './kbn_core_apps_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index c82c6fd86bf9..21865790488c 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index 78ba7ed4f33e..3f26cee3ef0b 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index c743626f13c8..6062db7ca492 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index bc5d3e79f374..41ac3508ac4e 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index f6bc04072b0e..bd0456b73661 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.mdx +++ b/api_docs/kbn_core_capabilities_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-browser-mocks title: "@kbn/core-capabilities-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-browser-mocks'] --- import kbnCoreCapabilitiesBrowserMocksObj from './kbn_core_capabilities_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index cb301811a9b0..70e1e52d9da5 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index 5272d57b6307..65bb710cdd2f 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index c1590c3486bf..8ea8de936d8b 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index cd424cab8ea8..1bbf3102194d 100644 --- a/api_docs/kbn_core_chrome_browser.mdx +++ b/api_docs/kbn_core_chrome_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser title: "@kbn/core-chrome-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index 63ccbd8c5e74..63638e089206 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.mdx +++ b/api_docs/kbn_core_chrome_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser-mocks title: "@kbn/core-chrome-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser-mocks'] --- import kbnCoreChromeBrowserMocksObj from './kbn_core_chrome_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 8df48552bac4..74f2799d9a5e 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index 8b78100d0303..dd3821da4205 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index 6e0bb12b1a5e..41338f8efb4e 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index 080737870b48..5b620ac4cd43 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index 0e645904c4e1..b84a28ba947c 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index 383007543980..199040ad6d5a 100644 --- a/api_docs/kbn_core_deprecations_server.mdx +++ b/api_docs/kbn_core_deprecations_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server title: "@kbn/core-deprecations-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server'] --- import kbnCoreDeprecationsServerObj from './kbn_core_deprecations_server.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index 628dd25c7f3d..5d23f084abb3 100644 --- a/api_docs/kbn_core_deprecations_server_internal.mdx +++ b/api_docs/kbn_core_deprecations_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-internal title: "@kbn/core-deprecations-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-internal'] --- import kbnCoreDeprecationsServerInternalObj from './kbn_core_deprecations_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index cec24f8afb81..1d0c938d5172 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.mdx +++ b/api_docs/kbn_core_deprecations_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-mocks title: "@kbn/core-deprecations-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-mocks'] --- import kbnCoreDeprecationsServerMocksObj from './kbn_core_deprecations_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 301817f389f3..76bfb31e4ae2 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index 8d97cbcf1c2c..a6e0e3bcd018 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index b0d261f46fd9..303a88b0c591 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index d9a615b6c494..2a52e9295784 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index ed0db4e5b673..3b66f6c09efc 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index fa3e8d51eade..10120fdbabde 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index ecab13942a3d..d1070c300c6f 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index edac91c50c50..279be99a4cd0 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index e140e3d6c7a2..1b7ba38c4bc4 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index 052635bd3064..e1cb1def104b 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index b6f2597e0996..989fbedb5b96 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index 519f8fb45f2e..de06605342fd 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 70c558f5cdef..2ccb36ae62dd 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 026e69d9c5e9..15b2e254f046 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index 798e68b95a5b..17d3f25ce2b6 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index fcfebaa93f54..0c4078c10155 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 2095dbf49bd1..f14704772868 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index 40ff3c8277b5..7e368e7d2ecd 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index 0696ab01328a..dca1ed6dc358 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index 423f0bfae35a..2628319ec297 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index 43f84f449003..fb47a32dd758 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index 02137896f1bf..d368390b9ce6 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index fd8c23ebb90a..00b94f830d04 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index df1a8b53c561..dd6f30a295b9 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index 02cd4f0492d3..e48df4f6f93e 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_request_handler_context_server.mdx b/api_docs/kbn_core_http_request_handler_context_server.mdx index 798b9ec1d244..c685ae7c4cfa 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.mdx +++ b/api_docs/kbn_core_http_request_handler_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-request-handler-context-server title: "@kbn/core-http-request-handler-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-request-handler-context-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-request-handler-context-server'] --- import kbnCoreHttpRequestHandlerContextServerObj from './kbn_core_http_request_handler_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index 5c3424e8f3c8..cfdaf1e19dff 100644 --- a/api_docs/kbn_core_http_resources_server.mdx +++ b/api_docs/kbn_core_http_resources_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server title: "@kbn/core-http-resources-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server'] --- import kbnCoreHttpResourcesServerObj from './kbn_core_http_resources_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index 7d6246cd6529..d9b4b9707437 100644 --- a/api_docs/kbn_core_http_resources_server_internal.mdx +++ b/api_docs/kbn_core_http_resources_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-internal title: "@kbn/core-http-resources-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-internal'] --- import kbnCoreHttpResourcesServerInternalObj from './kbn_core_http_resources_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index 3641fcaac008..4893ebddee66 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.mdx +++ b/api_docs/kbn_core_http_resources_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-mocks title: "@kbn/core-http-resources-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-mocks'] --- import kbnCoreHttpResourcesServerMocksObj from './kbn_core_http_resources_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index f7a72dceadd5..4756727ff894 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index 4a7d4169c6b9..cdd177ceb0a5 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index 892f9fa00374..e96d6cf9adbe 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index eea1b267b766..6c904369552a 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index 00794d9d93bf..bc1aad5a7887 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 475a6a53e90c..dea993e2070b 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index ec65ddb482a4..fd660520c718 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server.mdx b/api_docs/kbn_core_i18n_server.mdx index db293785c71c..95a321317d36 100644 --- a/api_docs/kbn_core_i18n_server.mdx +++ b/api_docs/kbn_core_i18n_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server title: "@kbn/core-i18n-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server'] --- import kbnCoreI18nServerObj from './kbn_core_i18n_server.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index b93b02cee564..3fb2794d4112 100644 --- a/api_docs/kbn_core_i18n_server_internal.mdx +++ b/api_docs/kbn_core_i18n_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-internal title: "@kbn/core-i18n-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-internal'] --- import kbnCoreI18nServerInternalObj from './kbn_core_i18n_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index b1a827311333..c346597846c2 100644 --- a/api_docs/kbn_core_i18n_server_mocks.mdx +++ b/api_docs/kbn_core_i18n_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-mocks title: "@kbn/core-i18n-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-mocks'] --- import kbnCoreI18nServerMocksObj from './kbn_core_i18n_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser.mdx b/api_docs/kbn_core_injected_metadata_browser.mdx index 6f3d26a4344d..2cc4d782a3ba 100644 --- a/api_docs/kbn_core_injected_metadata_browser.mdx +++ b/api_docs/kbn_core_injected_metadata_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser title: "@kbn/core-injected-metadata-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser'] --- import kbnCoreInjectedMetadataBrowserObj from './kbn_core_injected_metadata_browser.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 357e5b3969a0..882f9db70828 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index 2677c4fdf61b..510755ca28d2 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index b0783728f0d8..986fcdf47388 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index ca8a21fa5d2f..95a8b7713abe 100644 --- a/api_docs/kbn_core_lifecycle_browser.mdx +++ b/api_docs/kbn_core_lifecycle_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser title: "@kbn/core-lifecycle-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser'] --- import kbnCoreLifecycleBrowserObj from './kbn_core_lifecycle_browser.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index e6a4557d94a0..bf829fe0c330 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser-mocks title: "@kbn/core-lifecycle-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser-mocks'] --- import kbnCoreLifecycleBrowserMocksObj from './kbn_core_lifecycle_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx index 957a5d4d5594..65a7d411ac12 100644 --- a/api_docs/kbn_core_lifecycle_server.mdx +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server title: "@kbn/core-lifecycle-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] --- import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx index 7e5036446c15..80cf8f97ea3a 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server-mocks title: "@kbn/core-lifecycle-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] --- import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index 375cf172ff97..fccbf0e6858d 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.devdocs.json b/api_docs/kbn_core_logging_server_internal.devdocs.json index ec9dae6cfd6b..b5bebc50d5c9 100644 --- a/api_docs/kbn_core_logging_server_internal.devdocs.json +++ b/api_docs/kbn_core_logging_server_internal.devdocs.json @@ -127,7 +127,7 @@ "section": "def-server.Type", "text": "Type" }, - " | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; }> | Readonly<{} & { type: \"file\"; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; fileName: string; }> | Readonly<{} & { type: \"rewrite\"; policy: Readonly<{} & { type: \"meta\"; mode: \"update\" | \"remove\"; properties: Readonly<{ value?: string | number | boolean | null | undefined; } & { path: string; }>[]; }>; appenders: string[]; }> | Readonly<{} & { type: \"rolling-file\"; strategy: ", + " | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; }> | Readonly<{} & { type: \"file\"; fileName: string; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; }> | Readonly<{} & { type: \"rewrite\"; policy: Readonly<{} & { type: \"meta\"; mode: \"update\" | \"remove\"; properties: Readonly<{ value?: string | number | boolean | null | undefined; } & { path: string; }>[]; }>; appenders: string[]; }> | Readonly<{} & { type: \"rolling-file\"; strategy: ", { "pluginId": "@kbn/core-logging-server", "scope": "server", @@ -135,7 +135,7 @@ "section": "def-server.NumericRollingStrategyConfig", "text": "NumericRollingStrategyConfig" }, - "; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; fileName: string; policy: Readonly<{} & { type: \"size-limit\"; size: ", + "; fileName: string; layout: Readonly<{} & { type: \"json\"; }> | Readonly<{ highlight?: boolean | undefined; pattern?: string | undefined; } & { type: \"pattern\"; }>; policy: Readonly<{} & { type: \"size-limit\"; size: ", { "pluginId": "@kbn/config-schema", "scope": "server", diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 4485a119a411..31758eb06d61 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 5d068030dac1..935f65eb6599 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index accaec79c3a2..4e9d8a27288a 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index a8dc80d9c911..7719f3f93c0e 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index c07de4acd5c9..6267d8d22bda 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index d86f712dbc64..b40ce4535504 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index c40c64470113..6424640974ff 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index 2781ea30cb43..8b22fc91b704 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 4b8a18859638..c05396dd7fa6 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 3ece7e82ef6a..5a7674ecc5f4 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index 592fc0e14faa..081ff2fedb3a 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index 555da48d472b..07a20b39465f 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index 031889b1f1e4..f930d676b1dc 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index 2e9fb397ffaf..698ac134de04 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index acbd74942691..5acd7b7579a6 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index 522afca0ab99..bb11d5056c99 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 043940754590..5e6be0a952f7 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index 2ce7e6dfc4ed..5091512c0d39 100644 --- a/api_docs/kbn_core_plugins_browser.mdx +++ b/api_docs/kbn_core_plugins_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser title: "@kbn/core-plugins-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index ea4210324bf3..237e6f01fd5b 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.mdx +++ b/api_docs/kbn_core_plugins_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser-mocks title: "@kbn/core-plugins-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index d9462aa9c8ac..746f29b9f1bd 100644 --- a/api_docs/kbn_core_plugins_server.mdx +++ b/api_docs/kbn_core_plugins_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server title: "@kbn/core-plugins-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] --- import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx index 2b78e429b539..5d9fc816d454 100644 --- a/api_docs/kbn_core_plugins_server_mocks.mdx +++ b/api_docs/kbn_core_plugins_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server-mocks title: "@kbn/core-plugins-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] --- import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index 547a1a89ce99..af46d97cc824 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 3dd0471b4347..988075cfc75e 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index e8a9f01db662..38e4214087f2 100644 --- a/api_docs/kbn_core_rendering_browser_mocks.mdx +++ b/api_docs/kbn_core_rendering_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser-mocks title: "@kbn/core-rendering-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser-mocks'] --- import kbnCoreRenderingBrowserMocksObj from './kbn_core_rendering_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_internal.mdx b/api_docs/kbn_core_rendering_server_internal.mdx index 73ab83480582..56d1065f9ede 100644 --- a/api_docs/kbn_core_rendering_server_internal.mdx +++ b/api_docs/kbn_core_rendering_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-internal title: "@kbn/core-rendering-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index 4819f95008dc..0235e7722d26 100644 --- a/api_docs/kbn_core_rendering_server_mocks.mdx +++ b/api_docs/kbn_core_rendering_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-mocks title: "@kbn/core-rendering-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-mocks'] --- import kbnCoreRenderingServerMocksObj from './kbn_core_rendering_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 347e94226dfa..750811c58c35 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 5876ed17f731..1dbe14157b57 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_internal.mdx b/api_docs/kbn_core_saved_objects_api_server_internal.mdx index 4aeb88914770..fd8ecde155ba 100644 --- a/api_docs/kbn_core_saved_objects_api_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-internal title: "@kbn/core-saved-objects-api-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-internal'] --- import kbnCoreSavedObjectsApiServerInternalObj from './kbn_core_saved_objects_api_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx index 7d8420b80d9d..4da85bb93e95 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-mocks title: "@kbn/core-saved-objects-api-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-mocks'] --- import kbnCoreSavedObjectsApiServerMocksObj from './kbn_core_saved_objects_api_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_internal.mdx b/api_docs/kbn_core_saved_objects_base_server_internal.mdx index 9a7619b1b054..bc74494b9fdf 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-internal title: "@kbn/core-saved-objects-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx index 1cf307cbe7a8..a75fda08b608 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-mocks title: "@kbn/core-saved-objects-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 531f642e937c..09d1b3b77f81 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index c0b38c07f8d5..3ede5635adf7 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index cbaa6ff9a52e..1f8c4e62ef8b 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index 73c27d89f89d..b869cf0aa850 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx index 1d6257cee7c7..b8b4962112b8 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-internal title: "@kbn/core-saved-objects-import-export-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-internal'] --- import kbnCoreSavedObjectsImportExportServerInternalObj from './kbn_core_saved_objects_import_export_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx index 9a5af295c0e0..b486d2184f7e 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-mocks title: "@kbn/core-saved-objects-import-export-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index 2a1deda3567e..178ec69d6237 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-internal title: "@kbn/core-saved-objects-migration-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx index dd4a7a0ebd9f..7a1b8ff360a4 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-mocks title: "@kbn/core-saved-objects-migration-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-mocks'] --- import kbnCoreSavedObjectsMigrationServerMocksObj from './kbn_core_saved_objects_migration_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 65f70ae0b159..ff59a9038b3d 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index 31db71779d30..561eb96e4194 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-internal title: "@kbn/core-saved-objects-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-internal'] --- import kbnCoreSavedObjectsServerInternalObj from './kbn_core_saved_objects_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index 8f4682f99620..8c6d05c218be 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-mocks title: "@kbn/core-saved-objects-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index eb333f0d10ca..2c8953ac3f89 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.mdx +++ b/api_docs/kbn_core_saved_objects_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-utils-server title: "@kbn/core-saved-objects-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-utils-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index 737673d2460f..4014ca3a29da 100644 --- a/api_docs/kbn_core_status_common.mdx +++ b/api_docs/kbn_core_status_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common title: "@kbn/core-status-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_common_internal.mdx b/api_docs/kbn_core_status_common_internal.mdx index 389126e420ff..e5a9a4d9ac9d 100644 --- a/api_docs/kbn_core_status_common_internal.mdx +++ b/api_docs/kbn_core_status_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common-internal title: "@kbn/core-status-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common-internal'] --- import kbnCoreStatusCommonInternalObj from './kbn_core_status_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index 451eeb33abdf..61ce4f91860e 100644 --- a/api_docs/kbn_core_status_server.mdx +++ b/api_docs/kbn_core_status_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server title: "@kbn/core-status-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index 535a89e5c002..85c001e2b45c 100644 --- a/api_docs/kbn_core_status_server_internal.mdx +++ b/api_docs/kbn_core_status_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-internal title: "@kbn/core-status-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-internal'] --- import kbnCoreStatusServerInternalObj from './kbn_core_status_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index cdcc0e1e54c9..e2f043961dc9 100644 --- a/api_docs/kbn_core_status_server_mocks.mdx +++ b/api_docs/kbn_core_status_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-mocks title: "@kbn/core-status-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-mocks'] --- import kbnCoreStatusServerMocksObj from './kbn_core_status_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index c827d97b9e83..d5397782b246 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index b545d60fbfc2..ae398a2899f0 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx index 4c54d7918741..d083d85e7d5c 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-so-type-serializer title: "@kbn/core-test-helpers-so-type-serializer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-so-type-serializer plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-so-type-serializer'] --- import kbnCoreTestHelpersSoTypeSerializerObj from './kbn_core_test_helpers_so_type_serializer.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index 126bf496a75e..c49b74c6696e 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.mdx +++ b/api_docs/kbn_core_test_helpers_test_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-test-utils title: "@kbn/core-test-helpers-test-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-test-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-test-utils'] --- import kbnCoreTestHelpersTestUtilsObj from './kbn_core_test_helpers_test_utils.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index b57e9f0252ae..90ccd636e728 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index 8d21465ab0df..12853ac70dc2 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] --- import kbnCoreThemeBrowserInternalObj from './kbn_core_theme_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index a9b20456a77c..4fc36fc3f4aa 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index 7236d98e1346..c02ba9ebfb10 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index f69dc5c1ae84..2f7f19fdb695 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index bd9dc0f3dd10..8732f477b966 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index b91f31539ce1..ab36862b2514 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index 06f3a3481583..8e3cabf207ca 100644 --- a/api_docs/kbn_core_ui_settings_server.mdx +++ b/api_docs/kbn_core_ui_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server title: "@kbn/core-ui-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server'] --- import kbnCoreUiSettingsServerObj from './kbn_core_ui_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index 9ba3cb0960f0..30dd4658f5f9 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.mdx +++ b/api_docs/kbn_core_ui_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-internal title: "@kbn/core-ui-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index 6962f3345bb4..b59d64ab8019 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-mocks title: "@kbn/core-ui-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index 0c03e61a1ba0..0a30968bc426 100644 --- a/api_docs/kbn_core_usage_data_server.mdx +++ b/api_docs/kbn_core_usage_data_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server title: "@kbn/core-usage-data-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server'] --- import kbnCoreUsageDataServerObj from './kbn_core_usage_data_server.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index cb0c573ee2af..8431d5e3f655 100644 --- a/api_docs/kbn_core_usage_data_server_internal.mdx +++ b/api_docs/kbn_core_usage_data_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-internal title: "@kbn/core-usage-data-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-internal plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-internal'] --- import kbnCoreUsageDataServerInternalObj from './kbn_core_usage_data_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index 9741f2aada8d..ee8976702801 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.mdx +++ b/api_docs/kbn_core_usage_data_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-mocks title: "@kbn/core-usage-data-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-mocks'] --- import kbnCoreUsageDataServerMocksObj from './kbn_core_usage_data_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 7380d4a9e6ec..346b09e150c2 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index b6ad79e313b5..41012dcdd2c2 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index fe67304aa5a6..8e7afe0ac51a 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 8fefa05379d4..099cbc79b200 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 5eb33c243040..212840ccd0b0 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index 06e95d715676..3bfe294e508b 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 72a2a72396ba..ebc8aac9b617 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 0b03273d3098..135b88699862 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index ababa7a6280c..0bf5620ce54e 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.devdocs.json b/api_docs/kbn_ebt_tools.devdocs.json index 24d17adf34e2..61d6c5217507 100644 --- a/api_docs/kbn_ebt_tools.devdocs.json +++ b/api_docs/kbn_ebt_tools.devdocs.json @@ -138,7 +138,7 @@ "tags": [], "label": "eventData", "description": [ - "The data to send, conforming the structure of a {@link MetricEvent }." + "The data to send, conforming the structure of a {@link PerformanceMetricEvent }." ], "signature": [ { diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 8d084e73b0b5..3dc15fd2849d 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index 6620e79134f9..252dc0b13ad8 100644 --- a/api_docs/kbn_es.mdx +++ b/api_docs/kbn_es.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es title: "@kbn/es" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] --- import kbnEsObj from './kbn_es.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index 16918d3ea4ae..5cd8a40812df 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index b4ec1adcb9ff..301e8cc59f6c 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index a219f9d35662..a5889ac2f1e7 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index fa75d5b3d852..1f619c69218c 100644 --- a/api_docs/kbn_es_types.mdx +++ b/api_docs/kbn_es_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-types title: "@kbn/es-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-types plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 2fe4763b31a4..c33d35e0aaee 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 72adbb9cfd67..587f50507d58 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index 97ee0cdaec20..05a1d2beefb1 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index 4b8ea51be5b8..d4e811af15c0 100644 --- a/api_docs/kbn_ftr_common_functional_services.mdx +++ b/api_docs/kbn_ftr_common_functional_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-services title: "@kbn/ftr-common-functional-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-services plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index e4461fa9efe4..b44a97cec869 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_get_repo_files.mdx b/api_docs/kbn_get_repo_files.mdx index bf4fe3ccc932..404db1cb0e1e 100644 --- a/api_docs/kbn_get_repo_files.mdx +++ b/api_docs/kbn_get_repo_files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-get-repo-files title: "@kbn/get-repo-files" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/get-repo-files plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/get-repo-files'] --- import kbnGetRepoFilesObj from './kbn_get_repo_files.devdocs.json'; diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index 584fab770b32..d735da10c6ce 100644 --- a/api_docs/kbn_guided_onboarding.mdx +++ b/api_docs/kbn_guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-guided-onboarding title: "@kbn/guided-onboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/guided-onboarding plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index b8549dfcd91d..eb427500f518 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index 247ed782b8ca..72b5e358f77f 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index f5b648d0269c..401931f044fb 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index 134e6eaa7a20..db210c5ffa92 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index 14798a9b4b52..b565f85abd2e 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx index 99eb15d86085..45f196144653 100644 --- a/api_docs/kbn_i18n_react.mdx +++ b/api_docs/kbn_i18n_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n-react title: "@kbn/i18n-react" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n-react plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] --- import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 653ecbf47a22..10a0f1bf5f44 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index a547d5a8bc47..a0dd4b7ad069 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 4f5b0c1facf9..47644e792668 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 576dca06dd4f..8721f02edf8d 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index 1c2c71b6f3ab..2292f6a6656f 100644 --- a/api_docs/kbn_journeys.mdx +++ b/api_docs/kbn_journeys.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-journeys title: "@kbn/journeys" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/journeys plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index eea0f3fed66e..5557a32a35de 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation_popover.mdx b/api_docs/kbn_language_documentation_popover.mdx index 04f64b4a5198..8ad47524939f 100644 --- a/api_docs/kbn_language_documentation_popover.mdx +++ b/api_docs/kbn_language_documentation_popover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation-popover title: "@kbn/language-documentation-popover" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation-popover plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation-popover'] --- import kbnLanguageDocumentationPopoverObj from './kbn_language_documentation_popover.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 64fa6c32eda5..8dd810ed7ec1 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 27197f3c3283..cacf11cf0e0f 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index a35a01132a87..127c0b469692 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index d28d926551a1..bcf5bcd3809b 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index a81c96e16e92..faa2b8152987 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index c75766d7852b..ad095b32a12d 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index 6e81fd81ffd0..33a7ac169134 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index ca79e9e07e9f..a836aea9a6c3 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 7d0063114a5a..6ff23c6825e5 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index 9fe2148dea28..698ce9b556e4 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index c8322ae9b2f2..f5a3b622d1da 100644 --- a/api_docs/kbn_osquery_io_ts_types.mdx +++ b/api_docs/kbn_osquery_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-osquery-io-ts-types title: "@kbn/osquery-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/osquery-io-ts-types plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 3f89f8bf99f1..e9d23683cabd 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index 8cfbd60145f5..fd990f870660 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index fc92e2282c50..922a6b1a87d9 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 809387d5177f..ff7cb8c6dcd1 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index 0e9b38aeb560..4667ce301e70 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.devdocs.json b/api_docs/kbn_rule_data_utils.devdocs.json index 6c8e6fe3b406..1071f55b81cc 100644 --- a/api_docs/kbn_rule_data_utils.devdocs.json +++ b/api_docs/kbn_rule_data_utils.devdocs.json @@ -850,6 +850,156 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_FRAMEWORK", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_FRAMEWORK", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.framework\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TACTIC_ID", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TACTIC_ID", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.tactic.id\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TACTIC_NAME", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TACTIC_NAME", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.tactic.name\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TACTIC_REFERENCE", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TACTIC_REFERENCE", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.tactic.reference\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_ID", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_ID", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.id\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_NAME", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_NAME", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.name\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_REFERENCE", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_REFERENCE", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.reference\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_ID", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.subtechnique.id\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_NAME", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.subtechnique.name\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/rule-data-utils", + "id": "def-common.ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE", + "type": "string", + "tags": [], + "label": "ALERT_THREAT_TECHNIQUE_SUBTECHNIQUE_REFERENCE", + "description": [], + "signature": [ + "\"kibana.alert.rule.threat.technique.subtechnique.reference\"" + ], + "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/rule-data-utils", "id": "def-common.ALERT_TIME_RANGE", @@ -1098,7 +1248,7 @@ "label": "TechnicalRuleDataFieldName", "description": [], "signature": [ - "\"tags\" | \"kibana\" | \"@timestamp\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.consumer\" | \"event.action\" | \"kibana.alert.rule.execution.uuid\" | \"kibana.alert\" | \"kibana.alert.rule\" | \"kibana.alert.rule.parameters\" | \"kibana.alert.rule.producer\" | \"kibana.space_ids\" | \"kibana.alert.uuid\" | \"kibana.alert.instance.id\" | \"kibana.alert.start\" | \"kibana.alert.time_range\" | \"kibana.alert.end\" | \"kibana.alert.duration.us\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.version\" | \"ecs.version\" | \"kibana.alert.risk_score\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.system_status\" | \"kibana.alert.action_group\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"kibana.alert.rule.category\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.created_at\" | \"kibana.alert.rule.created_by\" | \"kibana.alert.rule.description\" | \"kibana.alert.rule.enabled\" | \"kibana.alert.rule.from\" | \"kibana.alert.rule.interval\" | \"kibana.alert.rule.license\" | \"kibana.alert.rule.name\" | \"kibana.alert.rule.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"event.kind\" | \"event.module\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.building_block_type\" | \"kibana.alert.rule.exceptions_list\" | \"kibana.alert.rule.namespace\"" + "\"tags\" | \"kibana\" | \"@timestamp\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.consumer\" | \"event.action\" | \"kibana.alert.rule.execution.uuid\" | \"kibana.alert\" | \"kibana.alert.rule\" | \"kibana.alert.rule.parameters\" | \"kibana.alert.rule.producer\" | \"kibana.space_ids\" | \"kibana.alert.uuid\" | \"kibana.alert.instance.id\" | \"kibana.alert.start\" | \"kibana.alert.time_range\" | \"kibana.alert.end\" | \"kibana.alert.duration.us\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.version\" | \"ecs.version\" | \"kibana.alert.risk_score\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.system_status\" | \"kibana.alert.action_group\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"kibana.alert.rule.category\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.created_at\" | \"kibana.alert.rule.created_by\" | \"kibana.alert.rule.description\" | \"kibana.alert.rule.enabled\" | \"kibana.alert.rule.from\" | \"kibana.alert.rule.interval\" | \"kibana.alert.rule.license\" | \"kibana.alert.rule.name\" | \"kibana.alert.rule.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"event.kind\" | \"event.module\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.building_block_type\" | \"kibana.alert.rule.exceptions_list\" | \"kibana.alert.rule.namespace\" | \"kibana.alert.rule.threat.framework\" | \"kibana.alert.rule.threat.tactic.id\" | \"kibana.alert.rule.threat.tactic.name\" | \"kibana.alert.rule.threat.tactic.reference\" | \"kibana.alert.rule.threat.technique.id\" | \"kibana.alert.rule.threat.technique.name\" | \"kibana.alert.rule.threat.technique.reference\" | \"kibana.alert.rule.threat.technique.subtechnique.id\" | \"kibana.alert.rule.threat.technique.subtechnique.name\" | \"kibana.alert.rule.threat.technique.subtechnique.reference\"" ], "path": "packages/kbn-rule-data-utils/src/technical_field_names.ts", "deprecated": false, diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index e6eaa452df4c..723441004032 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 75 | 0 | 72 | 0 | +| 85 | 0 | 82 | 0 | ## Common diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index 0b6691362335..4617117610ce 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index be0fd7d5f410..8bc6a87d55be 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.devdocs.json b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json index 7f0855de80b6..cb66bc6e0fd6 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.devdocs.json +++ b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json @@ -623,7 +623,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -637,7 +637,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -776,7 +776,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -790,7 +790,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" + "\"symbol\" | \"object\" | React.ComponentType | \"body\" | \"path\" | \"circle\" | \"filter\" | \"data\" | \"line\" | \"area\" | \"time\" | \"label\" | \"legend\" | \"image\" | \"link\" | \"menu\" | \"stop\" | \"base\" | \"text\" | \"title\" | \"s\" | \"small\" | \"source\" | \"input\" | \"svg\" | \"meta\" | \"script\" | \"summary\" | \"desc\" | \"q\" | \"pattern\" | \"mask\" | \"slot\" | \"style\" | \"head\" | \"section\" | \"big\" | \"sub\" | \"sup\" | \"animate\" | \"progress\" | \"view\" | \"output\" | \"var\" | \"map\" | \"html\" | \"a\" | \"img\" | \"audio\" | \"br\" | \"form\" | \"main\" | \"abbr\" | \"address\" | \"article\" | \"aside\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"button\" | \"canvas\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"select\" | \"span\" | \"strong\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"video\" | \"wbr\" | \"webview\" | \"animateMotion\" | \"animateTransform\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index 0196ccc25cd2..6a0db0065f5a 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.mdx +++ b/api_docs/kbn_securitysolution_exception_list_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-exception-list-components title: "@kbn/securitysolution-exception-list-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-exception-list-components plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-exception-list-components'] --- import kbnSecuritysolutionExceptionListComponentsObj from './kbn_securitysolution_exception_list_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index 6d0cfec2dc06..feed204bb0bb 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 5bc823eae72a..eb1d7416ac8c 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index fa6d34d4f0d3..a710c4a36478 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 80473929963d..084e70906ff5 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index 22f2af2e4d00..d86079dc26a3 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index c74d45e4c008..d527deb50804 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index a55e1a1cc4a0..0fadb448e635 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 39ccbaa53237..89dcaf176aee 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index dbf0eb18e579..1ea6e8198002 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 9a7295c8b55d..ddc14cf7b423 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index a7cee61434f2..590994a51d2d 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index 3bdcd920c750..a81c7cf25267 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 854e05cbe619..ad30c111ce29 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 0522be0ba26d..5ba79aba31ca 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 55430e120e88..721c1f9e0fcc 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index 8e904a07ea05..da3b434ed058 100644 --- a/api_docs/kbn_shared_ux_avatar_solution.mdx +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-solution title: "@kbn/shared-ux-avatar-solution" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-solution plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] --- import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx index 67d87a900715..c68ac8d06200 100644 --- a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx +++ b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-user-profile-components title: "@kbn/shared-ux-avatar-user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-user-profile-components plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-user-profile-components'] --- import kbnSharedUxAvatarUserProfileComponentsObj from './kbn_shared_ux_avatar_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index 9e943182eede..9944cb0a6ae2 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen title: "@kbn/shared-ux-button-exit-full-screen" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] --- import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx index e6d1e66ceef8..32587102b469 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen-mocks title: "@kbn/shared-ux-button-exit-full-screen-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen-mocks'] --- import kbnSharedUxButtonExitFullScreenMocksObj from './kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index 689e099b2d18..fa84048a0d2e 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index aecc10d4feda..4ba03026595f 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index 997af8775682..9cba99902f2c 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx index da9dee483a61..545a31e8a92a 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app title: "@kbn/shared-ux-link-redirect-app" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] --- import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index 320dae6a826e..90d1e90b26dc 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown.mdx b/api_docs/kbn_shared_ux_markdown.mdx index e62b67714e39..b44927ed5718 100644 --- a/api_docs/kbn_shared_ux_markdown.mdx +++ b/api_docs/kbn_shared_ux_markdown.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown title: "@kbn/shared-ux-markdown" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown'] --- import kbnSharedUxMarkdownObj from './kbn_shared_ux_markdown.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index 9daa127d53f9..d68e853db538 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.mdx +++ b/api_docs/kbn_shared_ux_markdown_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown-mocks title: "@kbn/shared-ux-markdown-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown-mocks'] --- import kbnSharedUxMarkdownMocksObj from './kbn_shared_ux_markdown_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index f5237dc261af..8a707994ba47 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index 23be712fcd39..3ba2a29d2b3e 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index dee877d9f651..bdc14a6a7c09 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index d3550ea396b9..5e08157603fc 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index 1ab5b5f56ec4..6c0617f983c8 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template title: "@kbn/shared-ux-page-kibana-template" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx index 5ccda0f87758..f28c917a23c9 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks title: "@kbn/shared-ux-page-kibana-template-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] --- import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index 9890014bd3bb..944766e80215 100644 --- a/api_docs/kbn_shared_ux_page_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx index bd7f51f711c1..418a923ea7cf 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx index 7c88df72aa86..cc8f0143857e 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks title: "@kbn/shared-ux-page-no-data-config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] --- import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx index bc8a81678ce9..8739839369fb 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks title: "@kbn/shared-ux-page-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] --- import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 4ffb150b915e..106574c903bb 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index e7515afc34d6..e43f46dd298d 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index d41235e875ed..6a3807968393 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router.mdx b/api_docs/kbn_shared_ux_router.mdx index 3691a2238d30..202bec3b741b 100644 --- a/api_docs/kbn_shared_ux_router.mdx +++ b/api_docs/kbn_shared_ux_router.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router title: "@kbn/shared-ux-router" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router'] --- import kbnSharedUxRouterObj from './kbn_shared_ux_router.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router_mocks.mdx b/api_docs/kbn_shared_ux_router_mocks.mdx index 62d267c82fac..1aa25e970e8e 100644 --- a/api_docs/kbn_shared_ux_router_mocks.mdx +++ b/api_docs/kbn_shared_ux_router_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router-mocks title: "@kbn/shared-ux-router-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router-mocks plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router-mocks'] --- import kbnSharedUxRouterMocksObj from './kbn_shared_ux_router_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_config.mdx b/api_docs/kbn_shared_ux_storybook_config.mdx index 3eb2f5f415ab..9175bd7d3487 100644 --- a/api_docs/kbn_shared_ux_storybook_config.mdx +++ b/api_docs/kbn_shared_ux_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-config title: "@kbn/shared-ux-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-config plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-config'] --- import kbnSharedUxStorybookConfigObj from './kbn_shared_ux_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index fe50ab8c5bf4..8c199e7a47ee 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index d8181b1eb2c1..31db6c95984b 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index c14544eca4ed..daa1e5abdf07 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_sort_package_json.mdx b/api_docs/kbn_sort_package_json.mdx index 32333c883c08..dac9486e5e29 100644 --- a/api_docs/kbn_sort_package_json.mdx +++ b/api_docs/kbn_sort_package_json.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-package-json title: "@kbn/sort-package-json" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-package-json plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-package-json'] --- import kbnSortPackageJsonObj from './kbn_sort_package_json.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index f49b4a24f9fa..f9d7f2b4ea64 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index 5ec7f7ac133b..920779144a8e 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 8738ec7de8b3..5bf82c0949bd 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 13bf8bb0155d..599a8fa05739 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 61f3c487d1ee..7c490b6e198f 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 76db67df7141..9f8f7ea3bb61 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_subj_selector.mdx b/api_docs/kbn_test_subj_selector.mdx index aa5e32557694..94de51206988 100644 --- a/api_docs/kbn_test_subj_selector.mdx +++ b/api_docs/kbn_test_subj_selector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-subj-selector title: "@kbn/test-subj-selector" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-subj-selector plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 7fe10cbd6c49..3641b8c885cc 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer.mdx b/api_docs/kbn_type_summarizer.mdx index a42212019b22..aace1473048a 100644 --- a/api_docs/kbn_type_summarizer.mdx +++ b/api_docs/kbn_type_summarizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer title: "@kbn/type-summarizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer'] --- import kbnTypeSummarizerObj from './kbn_type_summarizer.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer_core.mdx b/api_docs/kbn_type_summarizer_core.mdx index 3c99f5f6eb22..640c782e0473 100644 --- a/api_docs/kbn_type_summarizer_core.mdx +++ b/api_docs/kbn_type_summarizer_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer-core title: "@kbn/type-summarizer-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer-core plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer-core'] --- import kbnTypeSummarizerCoreObj from './kbn_type_summarizer_core.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index 429296ee2ba4..331ec9c440ae 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_shared_deps_src.devdocs.json b/api_docs/kbn_ui_shared_deps_src.devdocs.json index aeefda9c3a78..95594baac9f5 100644 --- a/api_docs/kbn_ui_shared_deps_src.devdocs.json +++ b/api_docs/kbn_ui_shared_deps_src.devdocs.json @@ -439,6 +439,17 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.kbnesquery", + "type": "string", + "tags": [], + "label": "'@kbn/es-query'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/ui-shared-deps-src", "id": "def-server.externals.kbnstd", @@ -493,6 +504,28 @@ "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.tanstackreactquery", + "type": "string", + "tags": [], + "label": "'@tanstack/react-query'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-server.externals.tanstackreactquerydevtools", + "type": "string", + "tags": [], + "label": "'@tanstack/react-query-devtools'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index 51fc7bc1290f..da52a0ffb016 100644 --- a/api_docs/kbn_ui_shared_deps_src.mdx +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-shared-deps-src title: "@kbn/ui-shared-deps-src" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-shared-deps-src plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 41 | 0 | 32 | 0 | +| 44 | 0 | 35 | 0 | ## Server diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index a7c73d99f809..9c8c13d3462c 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 6e676aaf1aea..5355e2b5e475 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 038c7f582763..a909c0c6acd5 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index a26db5a0d25c..849035953e8e 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 80b00b1af3c8..f331c3fccf22 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index b06ce1c0c673..8f60e4659522 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index f39c64c5b005..d39d05d25c7a 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index b0fffca6f6b9..52cd3f372387 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index e959e755b325..aaa191874988 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index fc42bf43de6f..7ee870166566 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 81f477bc6ff8..956966f701bc 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 711cb567e74d..023e15937b79 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 11da12226c78..ff75e31f4ec1 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index 2f97638609a4..6230823babf6 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index d24c5cd96822..53200c1bf1d9 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index e26a5c1e909c..75c9a8405d00 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 50db26fd7327..c21b74e8b2cf 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 37c3ecaf9e32..8aec70c22eca 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 785cad8b7849..8ea284960ad4 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 38686f06a4cd..8d1e2fa705de 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index ff32f29fe594..929a725d4f4b 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 5073c35a400a..5a49d5e62856 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 37ecaa8a9d28..9bcb1145643f 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index 6a02699554b1..df3bdc250f20 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -10445,6 +10445,196 @@ } ] }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor", + "type": "Object", + "tags": [], + "label": "[apmAWSLambdaPriceFactor]", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.category", + "type": "Array", + "tags": [], + "label": "category", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.name", + "type": "Any", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"json\"" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.value", + "type": "string", + "tags": [], + "label": "value", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.description", + "type": "Any", + "tags": [], + "label": "description", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaPriceFactor.schema", + "type": "Object", + "tags": [], + "label": "schema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.ObjectType", + "text": "ObjectType" + }, + "<{ arm: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "; x86_64: ", + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "; }>" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion", + "type": "Object", + "tags": [], + "label": "[apmAWSLambdaRequestCostPerMillion]", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.category", + "type": "Array", + "tags": [], + "label": "category", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.name", + "type": "Any", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.value", + "type": "number", + "tags": [], + "label": "value", + "description": [], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observability", + "id": "def-server.uiSettings.apmAWSLambdaRequestCostPerMillion.schema", + "type": "Object", + "tags": [], + "label": "schema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "server", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-server.Type", + "text": "Type" + }, + "" + ], + "path": "x-pack/plugins/observability/server/ui_settings.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, { "parentPluginId": "observability", "id": "def-server.uiSettings.enableCriticalPath", @@ -10769,6 +10959,36 @@ } ], "misc": [ + { + "parentPluginId": "observability", + "id": "def-common.apmAWSLambdaPriceFactor", + "type": "string", + "tags": [], + "label": "apmAWSLambdaPriceFactor", + "description": [], + "signature": [ + "\"observability:apmAWSLambdaPriceFactor\"" + ], + "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "observability", + "id": "def-common.apmAWSLambdaRequestCostPerMillion", + "type": "string", + "tags": [], + "label": "apmAWSLambdaRequestCostPerMillion", + "description": [], + "signature": [ + "\"observability:apmAWSLambdaRequestCostPerMillion\"" + ], + "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-common.apmLabsButton", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 5cb9a100ab16..c42985a8a239 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 541 | 37 | 538 | 31 | +| 555 | 40 | 552 | 31 | ## Client diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 65917c0bb9de..be92d574c9f6 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index b050f5c6c380..ee80d5381276 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -21,7 +21,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 33053 | 511 | 23399 | 1091 | +| 33090 | 514 | 23436 | 1092 | ## Plugin Directory @@ -30,7 +30,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 225 | 8 | 220 | 24 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 36 | 1 | 32 | 2 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | AIOps plugin maintained by ML team. | 9 | 0 | 0 | 2 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 382 | 0 | 373 | 26 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 383 | 0 | 374 | 26 | | | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 38 | 0 | 38 | 56 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 81 | 1 | 72 | 2 | @@ -66,7 +66,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 9 | 0 | 9 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 114 | 3 | 110 | 5 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The Event Annotation service contains expressions for event annotations | 174 | 31 | 174 | 3 | -| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 106 | 0 | 106 | 10 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 115 | 0 | 115 | 11 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 17 | 0 | 15 | 2 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 58 | 0 | 58 | 2 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 108 | 14 | 104 | 3 | @@ -119,7 +119,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 34 | 0 | 34 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 541 | 37 | 538 | 31 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 555 | 40 | 552 | 31 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 21 | 0 | 21 | 3 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 243 | 8 | 187 | 12 | @@ -408,7 +408,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | Just some helpers for kibana plugin devs. | 1 | 0 | 1 | 0 | | | [Owner missing] | - | 21 | 0 | 10 | 0 | | | [Owner missing] | - | 6 | 0 | 6 | 1 | -| | [Owner missing] | - | 75 | 0 | 72 | 0 | +| | [Owner missing] | - | 85 | 0 | 82 | 0 | | | [Owner missing] | Security Solution auto complete | 56 | 1 | 41 | 1 | | | [Owner missing] | security solution elastic search utilities to use across plugins such lists, security_solution, cases, etc... | 67 | 0 | 61 | 1 | | | [Owner missing] | - | 89 | 0 | 78 | 1 | @@ -469,7 +469,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 8 | 0 | 2 | 0 | | | [Owner missing] | - | 113 | 1 | 65 | 0 | | | [Owner missing] | - | 83 | 0 | 83 | 1 | -| | [Owner missing] | - | 41 | 0 | 32 | 0 | +| | [Owner missing] | - | 44 | 0 | 35 | 0 | | | [Owner missing] | - | 7 | 0 | 6 | 0 | | | [Owner missing] | - | 55 | 0 | 5 | 0 | | | [Owner missing] | - | 34 | 0 | 14 | 1 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 1fb911c09c83..834412d903f4 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index 0b1d4fa6bbda..1c6a8316b50e 100644 --- a/api_docs/profiling.mdx +++ b/api_docs/profiling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profiling title: "profiling" image: https://source.unsplash.com/400x175/?github description: API docs for the profiling plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index aa8485f17127..fa81fafe3be7 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index a195cda65302..0b3844a14e7c 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index d28120921daa..4159132bb0bf 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 1fb56c4ac93d..c485a74657dc 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 794acdc6eb7d..e62fdb13b533 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index bc5a24028432..2cdb3842170e 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index 463626508323..d3942c9bd1f3 100644 --- a/api_docs/saved_objects_finder.mdx +++ b/api_docs/saved_objects_finder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsFinder title: "savedObjectsFinder" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsFinder plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index f80f55031473..7aca372c0de0 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 244aced5f404..6b21819c9d05 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index d878d16734aa..95d6c1876f64 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 109985ae02a7..8f2558df2887 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 18dfcdb88f71..2ee5af5f5590 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index e6007a1d7e1d..e40a161cab9d 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 21cf94dc2721..1cd9e1917d2f 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index d9495a9805ec..7b70697e0be3 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -64,7 +64,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly tGridEnabled: boolean; readonly tGridEventRenderedViewEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly disableIsolationUIPendingStatuses: boolean; readonly pendingActionResponsesWithAck: boolean; readonly policyListEnabled: boolean; readonly policyResponseInFleetEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly responseActionsConsoleEnabled: boolean; readonly insightsRelatedAlertsByProcessAncestry: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointRbacEnabled: boolean; readonly endpointRbacV1Enabled: boolean; readonly guidedOnboarding: boolean; }" + "{ readonly tGridEnabled: boolean; readonly tGridEventRenderedViewEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly disableIsolationUIPendingStatuses: boolean; readonly pendingActionResponsesWithAck: boolean; readonly policyListEnabled: boolean; readonly policyResponseInFleetEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly responseActionsConsoleEnabled: boolean; readonly insightsRelatedAlertsByProcessAncestry: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointRbacEnabled: boolean; readonly endpointRbacV1Enabled: boolean; readonly guidedOnboarding: boolean; readonly alertDetailsPageEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/public/plugin.tsx", "deprecated": false, @@ -2002,7 +2002,7 @@ "label": "ConfigType", "description": [], "signature": [ - "Readonly<{} & { signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; alertIgnoreFields: string[]; enableExperimental: string[]; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }> & { experimentalFeatures: Readonly<{ tGridEnabled: boolean; tGridEventRenderedViewEnabled: boolean; excludePoliciesInFilterEnabled: boolean; kubernetesEnabled: boolean; disableIsolationUIPendingStatuses: boolean; pendingActionResponsesWithAck: boolean; policyListEnabled: boolean; policyResponseInFleetEnabled: boolean; previewTelemetryUrlEnabled: boolean; responseActionsConsoleEnabled: boolean; insightsRelatedAlertsByProcessAncestry: boolean; extendedRuleExecutionLoggingEnabled: boolean; socTrendsEnabled: boolean; responseActionsEnabled: boolean; endpointRbacEnabled: boolean; endpointRbacV1Enabled: boolean; guidedOnboarding: boolean; }>; }" + "Readonly<{} & { signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; alertIgnoreFields: string[]; enableExperimental: string[]; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }> & { experimentalFeatures: Readonly<{ tGridEnabled: boolean; tGridEventRenderedViewEnabled: boolean; excludePoliciesInFilterEnabled: boolean; kubernetesEnabled: boolean; disableIsolationUIPendingStatuses: boolean; pendingActionResponsesWithAck: boolean; policyListEnabled: boolean; policyResponseInFleetEnabled: boolean; previewTelemetryUrlEnabled: boolean; responseActionsConsoleEnabled: boolean; insightsRelatedAlertsByProcessAncestry: boolean; extendedRuleExecutionLoggingEnabled: boolean; socTrendsEnabled: boolean; responseActionsEnabled: boolean; endpointRbacEnabled: boolean; endpointRbacV1Enabled: boolean; guidedOnboarding: boolean; alertDetailsPageEnabled: boolean; }>; }" ], "path": "x-pack/plugins/security_solution/server/config.ts", "deprecated": false, diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index 078713ae9573..fc356d331efa 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 53df7d487e68..a9a540693e03 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.mdx b/api_docs/share.mdx index cf815db50a11..601c5a85029b 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index c43aa484d38e..ff03dd109b86 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 8a752d5aa4aa..958ac2c02de8 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index c42136397580..446ce8f2ef53 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/stack_connectors.mdx b/api_docs/stack_connectors.mdx index 127672e5722c..cf6538ca9011 100644 --- a/api_docs/stack_connectors.mdx +++ b/api_docs/stack_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackConnectors title: "stackConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the stackConnectors plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 54bf2456dc55..c9ea42abeabe 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 960741ec019d..b82a55fc67fe 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index afa4101d77ea..1d3581a1377e 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index 4f9334d4cd26..cb55fb5dca9d 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index a2bdc6c2645e..a10b4eb42293 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index f3b71a66b37d..ecc74b099500 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 8b7b83f0b005..705156c9237e 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index 4ebcd6c410e8..85479a09c16b 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.devdocs.json b/api_docs/triggers_actions_ui.devdocs.json index 91a358988434..85c037770352 100644 --- a/api_docs/triggers_actions_ui.devdocs.json +++ b/api_docs/triggers_actions_ui.devdocs.json @@ -1095,7 +1095,7 @@ "label": "loadActionErrorLog", "description": [], "signature": [ - "({ id, http, dateStart, dateEnd, runId, message, perPage, page, sort, }: ", + "({ id, http, dateStart, dateEnd, runId, message, perPage, page, sort, namespace, withAuth, }: ", "LoadActionErrorLogProps", " & { http: ", { @@ -1124,7 +1124,7 @@ "id": "def-public.loadActionErrorLog.$1", "type": "CompoundType", "tags": [], - "label": "{\n id,\n http,\n dateStart,\n dateEnd,\n runId,\n message,\n perPage = 10,\n page = 0,\n sort,\n}", + "label": "{\n id,\n http,\n dateStart,\n dateEnd,\n runId,\n message,\n perPage = 10,\n page = 0,\n sort,\n namespace,\n withAuth = false,\n}", "description": [], "signature": [ "LoadActionErrorLogProps", @@ -3399,7 +3399,7 @@ "description": [], "signature": [ "BasicFields", - " & { tags?: string[] | undefined; kibana?: string[] | undefined; \"@timestamp\"?: string[] | undefined; \"kibana.alert.rule.rule_type_id\"?: string[] | undefined; \"kibana.alert.rule.consumer\"?: string[] | undefined; \"event.action\"?: string[] | undefined; \"kibana.alert.rule.execution.uuid\"?: string[] | undefined; \"kibana.alert\"?: string[] | undefined; \"kibana.alert.rule\"?: string[] | undefined; \"kibana.alert.rule.parameters\"?: string[] | undefined; \"kibana.alert.rule.producer\"?: string[] | undefined; \"kibana.space_ids\"?: string[] | undefined; \"kibana.alert.uuid\"?: string[] | undefined; \"kibana.alert.instance.id\"?: string[] | undefined; \"kibana.alert.start\"?: string[] | undefined; \"kibana.alert.time_range\"?: string[] | undefined; \"kibana.alert.end\"?: string[] | undefined; \"kibana.alert.duration.us\"?: string[] | undefined; \"kibana.alert.severity\"?: string[] | undefined; \"kibana.alert.status\"?: string[] | undefined; \"kibana.version\"?: string[] | undefined; \"ecs.version\"?: string[] | undefined; \"kibana.alert.risk_score\"?: string[] | undefined; \"kibana.alert.workflow_status\"?: string[] | undefined; \"kibana.alert.workflow_user\"?: string[] | undefined; \"kibana.alert.workflow_reason\"?: string[] | undefined; \"kibana.alert.system_status\"?: string[] | undefined; \"kibana.alert.action_group\"?: string[] | undefined; \"kibana.alert.reason\"?: string[] | undefined; \"kibana.alert.rule.author\"?: string[] | undefined; \"kibana.alert.rule.category\"?: string[] | undefined; \"kibana.alert.rule.uuid\"?: string[] | undefined; \"kibana.alert.rule.created_at\"?: string[] | undefined; \"kibana.alert.rule.created_by\"?: string[] | undefined; \"kibana.alert.rule.description\"?: string[] | undefined; \"kibana.alert.rule.enabled\"?: string[] | undefined; \"kibana.alert.rule.from\"?: string[] | undefined; \"kibana.alert.rule.interval\"?: string[] | undefined; \"kibana.alert.rule.license\"?: string[] | undefined; \"kibana.alert.rule.name\"?: string[] | undefined; \"kibana.alert.rule.note\"?: string[] | undefined; \"kibana.alert.rule.references\"?: string[] | undefined; \"kibana.alert.rule.rule_id\"?: string[] | undefined; \"kibana.alert.rule.rule_name_override\"?: string[] | undefined; \"kibana.alert.rule.tags\"?: string[] | undefined; \"kibana.alert.rule.to\"?: string[] | undefined; \"kibana.alert.rule.type\"?: string[] | undefined; \"kibana.alert.rule.updated_at\"?: string[] | undefined; \"kibana.alert.rule.updated_by\"?: string[] | undefined; \"kibana.alert.rule.version\"?: string[] | undefined; \"event.kind\"?: string[] | undefined; \"event.module\"?: string[] | undefined; \"kibana.alert.evaluation.threshold\"?: string[] | undefined; \"kibana.alert.evaluation.value\"?: string[] | undefined; \"kibana.alert.building_block_type\"?: string[] | undefined; \"kibana.alert.rule.exceptions_list\"?: string[] | undefined; \"kibana.alert.rule.namespace\"?: string[] | undefined; } & { [x: string]: unknown[]; }" + " & { tags?: string[] | undefined; kibana?: string[] | undefined; \"@timestamp\"?: string[] | undefined; \"kibana.alert.rule.rule_type_id\"?: string[] | undefined; \"kibana.alert.rule.consumer\"?: string[] | undefined; \"event.action\"?: string[] | undefined; \"kibana.alert.rule.execution.uuid\"?: string[] | undefined; \"kibana.alert\"?: string[] | undefined; \"kibana.alert.rule\"?: string[] | undefined; \"kibana.alert.rule.parameters\"?: string[] | undefined; \"kibana.alert.rule.producer\"?: string[] | undefined; \"kibana.space_ids\"?: string[] | undefined; \"kibana.alert.uuid\"?: string[] | undefined; \"kibana.alert.instance.id\"?: string[] | undefined; \"kibana.alert.start\"?: string[] | undefined; \"kibana.alert.time_range\"?: string[] | undefined; \"kibana.alert.end\"?: string[] | undefined; \"kibana.alert.duration.us\"?: string[] | undefined; \"kibana.alert.severity\"?: string[] | undefined; \"kibana.alert.status\"?: string[] | undefined; \"kibana.version\"?: string[] | undefined; \"ecs.version\"?: string[] | undefined; \"kibana.alert.risk_score\"?: string[] | undefined; \"kibana.alert.workflow_status\"?: string[] | undefined; \"kibana.alert.workflow_user\"?: string[] | undefined; \"kibana.alert.workflow_reason\"?: string[] | undefined; \"kibana.alert.system_status\"?: string[] | undefined; \"kibana.alert.action_group\"?: string[] | undefined; \"kibana.alert.reason\"?: string[] | undefined; \"kibana.alert.rule.author\"?: string[] | undefined; \"kibana.alert.rule.category\"?: string[] | undefined; \"kibana.alert.rule.uuid\"?: string[] | undefined; \"kibana.alert.rule.created_at\"?: string[] | undefined; \"kibana.alert.rule.created_by\"?: string[] | undefined; \"kibana.alert.rule.description\"?: string[] | undefined; \"kibana.alert.rule.enabled\"?: string[] | undefined; \"kibana.alert.rule.from\"?: string[] | undefined; \"kibana.alert.rule.interval\"?: string[] | undefined; \"kibana.alert.rule.license\"?: string[] | undefined; \"kibana.alert.rule.name\"?: string[] | undefined; \"kibana.alert.rule.note\"?: string[] | undefined; \"kibana.alert.rule.references\"?: string[] | undefined; \"kibana.alert.rule.rule_id\"?: string[] | undefined; \"kibana.alert.rule.rule_name_override\"?: string[] | undefined; \"kibana.alert.rule.tags\"?: string[] | undefined; \"kibana.alert.rule.to\"?: string[] | undefined; \"kibana.alert.rule.type\"?: string[] | undefined; \"kibana.alert.rule.updated_at\"?: string[] | undefined; \"kibana.alert.rule.updated_by\"?: string[] | undefined; \"kibana.alert.rule.version\"?: string[] | undefined; \"event.kind\"?: string[] | undefined; \"event.module\"?: string[] | undefined; \"kibana.alert.evaluation.threshold\"?: string[] | undefined; \"kibana.alert.evaluation.value\"?: string[] | undefined; \"kibana.alert.building_block_type\"?: string[] | undefined; \"kibana.alert.rule.exceptions_list\"?: string[] | undefined; \"kibana.alert.rule.namespace\"?: string[] | undefined; \"kibana.alert.rule.threat.framework\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.id\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.name\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.reference\"?: string[] | undefined; } & { [x: string]: unknown[]; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 7e50384f3ca7..ab6d92541717 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 0990c05001d0..3fa9fd4f16c9 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 4d9965a92108..49f9aeb5e01e 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_field_list.mdx b/api_docs/unified_field_list.mdx index 0fd2f7b77814..749598b46787 100644 --- a/api_docs/unified_field_list.mdx +++ b/api_docs/unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedFieldList title: "unifiedFieldList" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedFieldList plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedFieldList'] --- import unifiedFieldListObj from './unified_field_list.devdocs.json'; diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index 6d1182c4e79f..6b484ff311cc 100644 --- a/api_docs/unified_histogram.mdx +++ b/api_docs/unified_histogram.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedHistogram title: "unifiedHistogram" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedHistogram plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 3fd368c4511a..db9143d35659 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 1f92259c7acb..2d6f336b88fd 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 7e6b24221d81..288e3537bf6c 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index e427c39dab56..8f96f8151449 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index fcccdee65836..582351fc5699 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 803140abcb81..b76f552f28ff 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 569bab78f647..538653fb0e66 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index 62ea35efa43d..e90bc3786feb 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index a528eb0aeb82..9ab0f154bb46 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 0b581b56644a..7ae0e3acdd24 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index d4330ef7d033..7e1ecc59bbda 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index c657aefeebbc..3535d667ce19 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 4e066474dbb9..cfeffdc0255f 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index f5a7cf0c227f..69a0288f5d2d 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index d3d3b380862c..0eb36d7a76f5 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index d4147111f1bd..dc40695f4d72 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2022-10-31 +date: 2022-11-01 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; From f5acf76351faa3a15af993ffad6582a5a29e55fa Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Tue, 1 Nov 2022 01:14:21 -0400 Subject: [PATCH 42/87] CCS Smoke Test for Remote Clusters and Index Management (#142423) * Removed comment of the issue that was referenced for the skip. But the tests were already skipped. * Added initial tests and page objects for remtoe clusters. * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed the test and test names. * removed exclusive suite. * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed i18n issue. * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Added more testing stuff. * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Added more testing stuff. * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Added test and stuff. * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Fixed the tests. The only things to update now are the permissions so we stop using super user and also need to fix the cleanup. * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Fixed accessibility test to use new ccr page function. * Fixed an error in checks. * Restored original settings. * Adjusted cleanup. * Removed exclusive suite. * Removed unused variable. * Removed unused variable. * Working with perms. * Fixes per comments in PR. * added follower index user. * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Added comment about super user issue. * Removed the console.log. * Fixed nits per PR. * Removed extra assertion. Co-authored-by: cuffs Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../connection_status/connection_status.js | 8 +- .../remote_cluster_table.js | 56 +++++++-- .../apps/cross_cluster_replication.ts | 6 +- .../remote_clusters_index_management_flow.ts | 114 ++++++++++++++++++ x-pack/test/functional/config.base.js | 27 +++++ x-pack/test/functional/config.ccs.ts | 4 +- .../cross_cluster_replication_page.ts | 19 ++- .../page_objects/index_management_page.ts | 52 +++++--- .../page_objects/remote_clusters_page.ts | 26 ++++ 9 files changed, 278 insertions(+), 34 deletions(-) create mode 100644 x-pack/test/functional/apps/remote_clusters/ccs/remote_clusters_index_management_flow.ts diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js index 5202683e3417..73dc09898ba2 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/connection_status/connection_status.js @@ -41,11 +41,15 @@ export function ConnectionStatus({ isConnected, mode }) { return ( - {icon} + + {icon} + - {message} + + {message} + {!isConnected && mode === SNIFF_MODE && ( diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js index 35c51268f71e..83b85aaefd78 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js @@ -19,6 +19,7 @@ import { EuiInMemoryTable, EuiLink, EuiToolTip, + EuiText, } from '@elastic/eui'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; import { UIM_SHOW_DETAILS_CLICK } from '../../../constants'; @@ -205,24 +206,47 @@ export class RemoteClusterTable extends Component { defaultMessage: 'Mode', }), sortable: true, - render: (mode) => + render: (mode) => { + let modeMessage; mode === PROXY_MODE - ? mode - : i18n.translate('xpack.remoteClusters.remoteClusterList.table.sniffModeDescription', { - defaultMessage: 'default', - }), + ? (modeMessage = mode) + : (modeMessage = i18n.translate( + 'xpack.remoteClusters.remoteClusterList.table.sniffModeDescription', + { + defaultMessage: 'default', + } + )); + const modeMessageComponent = ( + + + {modeMessage} + + + ); + return modeMessageComponent; + }, }, { field: 'mode', name: i18n.translate('xpack.remoteClusters.remoteClusterList.table.addressesColumnTitle', { defaultMessage: 'Addresses', }), + dataTestSubj: 'remoteClustersAddress', truncateText: true, render: (mode, { seeds, proxyAddress }) => { - if (mode === PROXY_MODE) { - return proxyAddress; - } - return seeds.join(', '); + const clusterAddressString = mode === PROXY_MODE ? proxyAddress : seeds.join(', '); + const connectionMode = ( + + + {clusterAddressString} + + + ); + return connectionMode; }, }, { @@ -236,10 +260,16 @@ export class RemoteClusterTable extends Component { sortable: true, width: '160px', render: (mode, { connectedNodesCount, connectedSocketsCount }) => { - if (mode === PROXY_MODE) { - return connectedSocketsCount; - } - return connectedNodesCount; + const remoteNodesCount = + mode === PROXY_MODE ? connectedSocketsCount : connectedNodesCount; + const connectionMode = ( + + + {remoteNodesCount} + + + ); + return connectionMode; }, }, { diff --git a/x-pack/test/accessibility/apps/cross_cluster_replication.ts b/x-pack/test/accessibility/apps/cross_cluster_replication.ts index e3cbc4d48f84..8081c8fd142b 100644 --- a/x-pack/test/accessibility/apps/cross_cluster_replication.ts +++ b/x-pack/test/accessibility/apps/cross_cluster_replication.ts @@ -46,7 +46,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('crossClusterReplication'); await PageObjects.crossClusterReplication.clickCreateFollowerIndexButton(); await a11y.testAppSnapshot(); - await PageObjects.crossClusterReplication.createFollowerIndex(testLeader, testFollower); + await PageObjects.crossClusterReplication.createFollowerIndex( + testLeader, + testFollower, + false + ); }); it('follower index flyout', async () => { // https://github.com/elastic/kibana/issues/135503 diff --git a/x-pack/test/functional/apps/remote_clusters/ccs/remote_clusters_index_management_flow.ts b/x-pack/test/functional/apps/remote_clusters/ccs/remote_clusters_index_management_flow.ts new file mode 100644 index 000000000000..a0b35cbe1c2e --- /dev/null +++ b/x-pack/test/functional/apps/remote_clusters/ccs/remote_clusters_index_management_flow.ts @@ -0,0 +1,114 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ getPageObjects, getService }: FtrProviderContext) => { + const pageObjects = getPageObjects([ + 'common', + 'remoteClusters', + 'indexManagement', + 'crossClusterReplication', + ]); + const security = getService('security'); + const retry = getService('retry'); + const testSubjects = getService('testSubjects'); + const remoteEs = getService('remoteEs' as 'es'); + const localEs = getService('es'); + + describe('CCS Remote Clusters > Index Management', function () { + const leaderName = 'my-index'; + const followerName = 'my-follower'; + before(async () => { + await security.testUser.setRoles(['superuser']); + // This test is temporarily using superuser because of an issue with the permissions + // of the follower index creation wizard. There is an open issue to address the issue. + // We can change the permissions to use follower_index_user once the issue is fixed. + // https://github.com/elastic/kibana/issues/143720 + // await security.testUser.setRoles(['follower_index_user']); + }); + + describe('Remote Clusters', function () { + before(async () => { + await pageObjects.common.navigateToApp('remoteClusters'); + }); + + it('Verify "ftr-remote" remote cluster exists', async () => { + await retry.waitFor('table to be visible', async () => { + return await testSubjects.isDisplayed('remoteClusterListTable'); + }); + const remotes = await pageObjects.remoteClusters.getRemoteClustersList(); + expect(remotes.length).to.eql(1); + expect(remotes[0].remoteName).to.eql('ftr-remote'); + expect(remotes[0].remoteAddress).to.contain('localhost'); + expect(remotes[0].remoteStatus).to.eql('Connected'); + expect(remotes[0].remoteConnectionCount).to.eql('1'); + expect(remotes[0].remoteMode).to.eql('default'); + }); + }); + + describe('Cross Cluster Replication', function () { + before(async () => { + await remoteEs.indices.create({ + index: leaderName, + body: { + settings: { number_of_shards: 1, soft_deletes: { enabled: true } }, + }, + }); + await pageObjects.common.navigateToApp('crossClusterReplication'); + await retry.waitFor('indices table to be visible', async () => { + return await testSubjects.isDisplayed('createFollowerIndexButton'); + }); + }); + it('Create Follower Index', async () => { + await pageObjects.crossClusterReplication.clickCreateFollowerIndexButton(); + await pageObjects.crossClusterReplication.createFollowerIndex( + leaderName, + followerName, + true, + '1s' + ); + }); + }); + describe('Index Management', function () { + before(async () => { + await remoteEs.index({ + index: leaderName, + body: { a: 'b' }, + }); + await pageObjects.common.navigateToApp('indexManagement'); + await retry.waitForWithTimeout('indice table to be visible', 15000, async () => { + return await testSubjects.isDisplayed('indicesList'); + }); + }); + it('Verify that the follower index is duplicating from the remote.', async () => { + await pageObjects.indexManagement.clickIndiceAt(0); + await pageObjects.indexManagement.performIndexActionInDetailPanel('flush'); + await testSubjects.click('euiFlyoutCloseButton'); + await pageObjects.common.navigateToApp('indexManagement'); + await retry.waitForWithTimeout('indice table to be visible', 15000, async () => { + return await testSubjects.isDisplayed('indicesList'); + }); + + const indicesList = await pageObjects.indexManagement.getIndexList(); + const followerIndex = indicesList[0]; + expect(followerIndex.indexDocuments).to.eql('1'); + }); + }); + + after(async () => { + await localEs.indices.delete({ + index: followerName, + }); + await remoteEs.indices.delete({ + index: leaderName, + }); + await security.testUser.restoreDefaults(); + }); + }); +}; diff --git a/x-pack/test/functional/config.base.js b/x-pack/test/functional/config.base.js index 11ba4d6ebd44..f9953dc861ea 100644 --- a/x-pack/test/functional/config.base.js +++ b/x-pack/test/functional/config.base.js @@ -499,6 +499,33 @@ export default async function ({ readConfigFile }) { cluster: ['manage', 'manage_ccr'], }, }, + // There is an issue open for follower_index_user permissions not working correctly + // in kibana. + // https://github.com/elastic/kibana/issues/143720 + // follower_index_user: { + // elasticsearch: { + // cluster: ['monitor', 'manage', 'manage_ccr', 'transport_client', 'read_ccr', 'all'], + // indices: [ + // { + // names: ['*'], + // privileges: [ + // 'write', + // 'monitor', + // 'manage_follow_index', + // 'manage_leader_index', + // 'read', + // 'view_index_metadata', + // ], + // }, + // ], + // }, + // kibana: [ + // { + // base: ['all'], + // spaces: ['*'], + // }, + // ], + // }, manage_ilm: { elasticsearch: { diff --git a/x-pack/test/functional/config.ccs.ts b/x-pack/test/functional/config.ccs.ts index d04b542cfb96..62f988d8f2f0 100644 --- a/x-pack/test/functional/config.ccs.ts +++ b/x-pack/test/functional/config.ccs.ts @@ -18,6 +18,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('./apps/canvas'), require.resolve('./apps/lens/group1'), + require.resolve('./apps/remote_clusters/ccs/remote_clusters_index_management_flow'), require.resolve('./apps/rollup_job'), ], @@ -29,10 +30,11 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...functionalConfig.get('security'), remoteEsRoles: { ccs_remote_search: { + cluster: ['manage', 'manage_ccr'], indices: [ { names: ['*'], - privileges: ['read', 'view_index_metadata', 'read_cross_cluster'], + privileges: ['read', 'view_index_metadata', 'read_cross_cluster', 'monitor'], }, ], }, diff --git a/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts b/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts index c51b764f2de0..558de0f6e641 100644 --- a/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts +++ b/x-pack/test/functional/page_objects/cross_cluster_replication_page.ts @@ -39,9 +39,23 @@ export function CrossClusterReplicationPageProvider({ getService }: FtrProviderC return await testSubjects.isDisplayed('nameInput'); }); }, - async createFollowerIndex(leader: string, follower: string) { + async createFollowerIndex( + leader: string, + follower: string, + advancedSettings: boolean = false, + readPollTimeout?: string + ) { await testSubjects.setValue('leaderIndexInput', leader); await testSubjects.setValue('followerIndexInput', follower); + if (advancedSettings) { + await this.clickAdvancedSettingsToggle(); + await retry.waitFor('advanced settings to be shown', async () => { + return await testSubjects.isDisplayed('readPollTimeoutInput'); + }); + if (readPollTimeout) { + await testSubjects.setValue('readPollTimeoutInput', readPollTimeout); + } + } await testSubjects.click('submitButton'); await retry.waitForWithTimeout('follower index to be in table', 45000, async () => { return await testSubjects.isDisplayed('maxReadReqSize'); @@ -55,5 +69,8 @@ export function CrossClusterReplicationPageProvider({ getService }: FtrProviderC return await testSubjects.isDisplayed('settingsValues'); }); }, + async clickAdvancedSettingsToggle() { + await testSubjects.click('advancedSettingsToggle'); + }, }; } diff --git a/x-pack/test/functional/page_objects/index_management_page.ts b/x-pack/test/functional/page_objects/index_management_page.ts index fc2382eb5a93..6872b9449a2e 100644 --- a/x-pack/test/functional/page_objects/index_management_page.ts +++ b/x-pack/test/functional/page_objects/index_management_page.ts @@ -41,26 +41,46 @@ export function IndexManagementPageProvider({ getService }: FtrProviderContext) }); }, + async performIndexActionInDetailPanel(action: string) { + await this.clickContextMenuInDetailPanel(); + if (action === 'flush') { + await testSubjects.click('flushIndexMenuButton'); + } + }, + + async clickContextMenuInDetailPanel() { + await testSubjects.click('indexActionsContextMenuButton'); + }, + async getIndexList() { const table = await find.byCssSelector('table'); - const $ = await table.parseDomContent(); - const indexList = await $.findTestSubjects('indexTableRow') - .toArray() - .map((row) => { + const rows = await table.findAllByTestSubject('indexTableRow'); + return await Promise.all( + rows.map(async (row) => { return { - indexName: $(row).findTestSubject('indexTableIndexNameLink').text(), - indexHealth: $(row).findTestSubject('indexTableCell-health').text(), - indexStatus: $(row).findTestSubject('indexTableCell-status').text(), - indexPrimary: $(row).findTestSubject('indexTableCell-primary').text(), - indexReplicas: $(row).findTestSubject('indexTableCell-replica').text(), - indexDocuments: $(row) - .findTestSubject('indexTableCell-documents') - .text() - .replace('documents', ''), - indexSize: $(row).findTestSubject('indexTableCell-size').text(), + indexLink: await row.findByTestSubject('indexTableIndexNameLink'), + indexName: await ( + await row.findByTestSubject('indexTableIndexNameLink') + ).getVisibleText(), + indexHealth: await ( + await row.findByTestSubject('indexTableCell-health') + ).getVisibleText(), + indexStatus: await ( + await row.findByTestSubject('indexTableCell-status') + ).getVisibleText(), + indexPrimary: await ( + await row.findByTestSubject('indexTableCell-primary') + ).getVisibleText(), + indexReplicas: await ( + await row.findByTestSubject('indexTableCell-replica') + ).getVisibleText(), + indexDocuments: await ( + await (await row.findByTestSubject('indexTableCell-documents')).getVisibleText() + ).replace('documents', ''), + indexSize: await (await row.findByTestSubject('indexTableCell-size')).getVisibleText(), }; - }); - return indexList; + }) + ); }, async changeTabs( diff --git a/x-pack/test/functional/page_objects/remote_clusters_page.ts b/x-pack/test/functional/page_objects/remote_clusters_page.ts index 9dfa2db9ce6e..b6ce2eb4a39b 100644 --- a/x-pack/test/functional/page_objects/remote_clusters_page.ts +++ b/x-pack/test/functional/page_objects/remote_clusters_page.ts @@ -31,5 +31,31 @@ export function RemoteClustersPageProvider({ getService }: FtrProviderContext) { await comboBox.setCustom('comboBoxInput', seedNode); await testSubjects.click('remoteClusterFormSaveButton'); }, + async getRemoteClustersList() { + const table = await testSubjects.find('remoteClusterListTable'); + const rows = await table.findAllByCssSelector('.euiTableRow'); + return await Promise.all( + rows.map(async (row) => { + return { + remoteLink: await row.findByTestSubject('remoteClustersTableListClusterLink'), + remoteName: await ( + await row.findByTestSubject('remoteClustersTableListClusterLink') + ).getVisibleText(), + remoteStatus: await ( + await row.findByTestSubject('remoteClusterConnectionStatusMessage') + ).getVisibleText(), + remoteMode: await ( + await row.findByTestSubject('remoteClusterConnectionModeMessage') + ).getVisibleText(), + remoteAddress: await ( + await row.findByTestSubject('remoteClusterConnectionAddressMessage') + ).getVisibleText(), + remoteConnectionCount: await ( + await row.findByTestSubject('remoteClusterNodeCountMessage') + ).getVisibleText(), + }; + }) + ); + }, }; } From 9456303c97b8b479de1ef1abcab1d7305c84f918 Mon Sep 17 00:00:00 2001 From: Michael Dokolin Date: Tue, 1 Nov 2022 08:54:33 +0100 Subject: [PATCH 43/87] [Monaco] Add JSON syntax support to the Monaco editor (#143739) * Add JSON syntax support to the Monaco editor * Bump `monaco-editor` version * Fix the `monaco` package and usages to initialize lazily * Add a story demonstrating JSON schema usage --- package.json | 2 +- packages/kbn-monaco/src/helpers.ts | 10 +-- packages/kbn-monaco/src/monaco_imports.ts | 1 + packages/kbn-monaco/src/register_globals.ts | 5 +- packages/kbn-monaco/src/worker.d.ts | 14 ++++ packages/kbn-monaco/src/xjson/language.ts | 37 +++++----- packages/kbn-monaco/webpack.config.js | 72 +++++++++---------- .../code_editor/code_editor.stories.tsx | 35 +++++++++ .../public/code_editor/code_editor.test.tsx | 33 ++++++--- .../components/expression_input/language.ts | 6 +- .../formula/editor/math_tokenization.tsx | 6 +- yarn.lock | 8 +-- 12 files changed, 146 insertions(+), 83 deletions(-) create mode 100644 packages/kbn-monaco/src/worker.d.ts diff --git a/package.json b/package.json index 1bb692e36df8..eef3f24151e1 100644 --- a/package.json +++ b/package.json @@ -558,7 +558,7 @@ "moment": "^2.29.4", "moment-duration-format": "^2.3.2", "moment-timezone": "^0.5.34", - "monaco-editor": "^0.22.3", + "monaco-editor": "^0.24.0", "mustache": "^2.3.2", "node-fetch": "^2.6.7", "node-forge": "^1.3.1", diff --git a/packages/kbn-monaco/src/helpers.ts b/packages/kbn-monaco/src/helpers.ts index 25040bc1a55f..defdd00d6fdc 100644 --- a/packages/kbn-monaco/src/helpers.ts +++ b/packages/kbn-monaco/src/helpers.ts @@ -12,10 +12,12 @@ function registerLanguage(language: LangModuleType) { const { ID, lexerRules, languageConfiguration } = language; monaco.languages.register({ id: ID }); - monaco.languages.setMonarchTokensProvider(ID, lexerRules); - if (languageConfiguration) { - monaco.languages.setLanguageConfiguration(ID, languageConfiguration); - } + monaco.languages.onLanguage(ID, () => { + monaco.languages.setMonarchTokensProvider(ID, lexerRules); + if (languageConfiguration) { + monaco.languages.setLanguageConfiguration(ID, languageConfiguration); + } + }); } export { registerLanguage }; diff --git a/packages/kbn-monaco/src/monaco_imports.ts b/packages/kbn-monaco/src/monaco_imports.ts index 6a08c25b6347..07a24c8c8bd2 100644 --- a/packages/kbn-monaco/src/monaco_imports.ts +++ b/packages/kbn-monaco/src/monaco_imports.ts @@ -23,6 +23,7 @@ import 'monaco-editor/esm/vs/editor/contrib/hover/hover.js'; // Needed for hover import 'monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.js'; // Needed for signature import 'monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.js'; // Needed for brackets matching highlight +import 'monaco-editor/esm/vs/language/json/monaco.contribution.js'; import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js'; // Needed for basic javascript support import 'monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js'; // Needed for basic xml support diff --git a/packages/kbn-monaco/src/register_globals.ts b/packages/kbn-monaco/src/register_globals.ts index 54fc26cbf76d..8a69b05b9425 100644 --- a/packages/kbn-monaco/src/register_globals.ts +++ b/packages/kbn-monaco/src/register_globals.ts @@ -12,11 +12,9 @@ import { EsqlLang } from './esql'; import { monaco } from './monaco_imports'; import { registerLanguage } from './helpers'; -// @ts-ignore +import jsonWorkerSrc from '!!raw-loader!../../target_workers/json.editor.worker.js'; import xJsonWorkerSrc from '!!raw-loader!../../target_workers/xjson.editor.worker.js'; -// @ts-ignore import defaultWorkerSrc from '!!raw-loader!../../target_workers/default.editor.worker.js'; -// @ts-ignore import painlessWorkerSrc from '!!raw-loader!../../target_workers/painless.editor.worker.js'; /** @@ -32,6 +30,7 @@ registerLanguage(EsqlLang); const mapLanguageIdToWorker: { [key: string]: any } = { [XJsonLang.ID]: xJsonWorkerSrc, [PainlessLang.ID]: painlessWorkerSrc, + [monaco.languages.json.jsonDefaults.languageId]: jsonWorkerSrc, }; // @ts-ignore diff --git a/packages/kbn-monaco/src/worker.d.ts b/packages/kbn-monaco/src/worker.d.ts new file mode 100644 index 000000000000..6544070c684d --- /dev/null +++ b/packages/kbn-monaco/src/worker.d.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +declare module '!!raw-loader!*.editor.worker.js' { + const contents: string; + + // eslint-disable-next-line import/no-default-export + export default contents; +} diff --git a/packages/kbn-monaco/src/xjson/language.ts b/packages/kbn-monaco/src/xjson/language.ts index 017ae0a8c590..6ec9b1149c70 100644 --- a/packages/kbn-monaco/src/xjson/language.ts +++ b/packages/kbn-monaco/src/xjson/language.ts @@ -12,16 +12,12 @@ import { monaco } from '../monaco_imports'; import { WorkerProxyService } from './worker_proxy_service'; import { ID } from './constants'; -const wps = new WorkerProxyService(); +const OWNER = 'XJSON_GRAMMAR_CHECKER'; monaco.languages.onLanguage(ID, async () => { - return wps.setup(); -}); - -const OWNER = 'XJSON_GRAMMAR_CHECKER'; + const wps = new WorkerProxyService(); -export const registerGrammarChecker = () => { - const allDisposables: monaco.IDisposable[] = []; + wps.setup(); const updateAnnotations = async (model: monaco.editor.IModel): Promise => { if (model.isDisposed()) { @@ -50,21 +46,20 @@ export const registerGrammarChecker = () => { }; const onModelAdd = (model: monaco.editor.IModel) => { - if (model.getModeId() === ID) { - allDisposables.push( - model.onDidChangeContent(async () => { - updateAnnotations(model); - }) - ); + if (model.getModeId() !== ID) { + return; + } + const { dispose } = model.onDidChangeContent(async () => { updateAnnotations(model); - } - }; - allDisposables.push(monaco.editor.onDidCreateModel(onModelAdd)); - return () => { - wps.stop(); - allDisposables.forEach((d) => d.dispose()); + }); + + model.onWillDispose(() => { + dispose(); + }); + + updateAnnotations(model); }; -}; -registerGrammarChecker(); + monaco.editor.onDidCreateModel(onModelAdd); +}); diff --git a/packages/kbn-monaco/webpack.config.js b/packages/kbn-monaco/webpack.config.js index d35c60b15547..8c6f82cdb21f 100644 --- a/packages/kbn-monaco/webpack.config.js +++ b/packages/kbn-monaco/webpack.config.js @@ -8,43 +8,43 @@ const path = require('path'); -const createLangWorkerConfig = (lang) => { - const entry = - lang === 'default' - ? 'monaco-editor/esm/vs/editor/editor.worker.js' - : path.resolve(__dirname, 'src', lang, 'worker', `${lang}.worker.ts`); +const getWorkerEntry = (language) => { + switch (language) { + case 'default': + return 'monaco-editor/esm/vs/editor/editor.worker.js'; + case 'json': + return 'monaco-editor/esm/vs/language/json/json.worker.js'; + default: + return path.resolve(__dirname, 'src', language, 'worker', `${language}.worker.ts`); + } +}; - return { - mode: 'production', - entry, - output: { - path: path.resolve(__dirname, 'target_workers'), - filename: `${lang}.editor.worker.js`, - }, - resolve: { - extensions: ['.js', '.ts', '.tsx'], - }, - stats: 'errors-only', - module: { - rules: [ - { - test: /\.(js|ts)$/, - exclude: /node_modules/, - use: { - loader: 'babel-loader', - options: { - babelrc: false, - presets: [require.resolve('@kbn/babel-preset/webpack_preset')], - }, +const getWorkerConfig = (language) => ({ + mode: 'production', + entry: getWorkerEntry(language), + output: { + path: path.resolve(__dirname, 'target_workers'), + filename: `${language}.editor.worker.js`, + }, + resolve: { + extensions: ['.js', '.ts', '.tsx'], + }, + stats: 'errors-only', + module: { + rules: [ + { + test: /\.(js|ts)$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + babelrc: false, + presets: [require.resolve('@kbn/babel-preset/webpack_preset')], }, }, - ], - }, - }; -}; + }, + ], + }, +}); -module.exports = [ - createLangWorkerConfig('xjson'), - createLangWorkerConfig('painless'), - createLangWorkerConfig('default'), -]; +module.exports = ['default', 'json', 'painless', 'xjson'].map(getWorkerConfig); diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx index c85e03c433d6..b6edbbd1da97 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.stories.tsx @@ -238,4 +238,39 @@ storiesOf('CodeEditor', module) text: 'Hover dialog example can be triggered by hovering over a word', }, } + ) + .add( + 'json support', + () => ( +
+ { + monacoEditor.languages.json.jsonDefaults.setDiagnosticsOptions({ + validate: true, + schemas: [ + { + uri: editor.getModel()?.uri.toString() ?? '', + fileMatch: ['*'], + schema: { + type: 'object', + properties: { + version: { + enum: ['v1', 'v2'], + }, + }, + }, + }, + ], + }); + }} + height={250} + value="{}" + onChange={action('onChange')} + /> +
+ ), + { + info: { text: 'JSON language support' }, + } ); diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx index 97a8d8a84908..6d9b4f4ce384 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx @@ -34,23 +34,36 @@ const simpleLogLang: monaco.languages.IMonarchLanguage = { }, }; -monaco.languages.register({ id: 'loglang' }); -monaco.languages.setMonarchTokensProvider('loglang', simpleLogLang); - const logs = ` [Sun Mar 7 20:54:27 2004] [notice] [client xx.xx.xx.xx] This is a notice! [Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed [Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome `; -class ResizeObserver { - observe() {} - unobserve() {} - disconnect() {} -} - describe('', () => { - window.ResizeObserver = ResizeObserver; + beforeAll(() => { + Object.defineProperty(window, 'matchMedia', { + writable: true, + value: jest.fn().mockImplementation((query) => ({ + matches: false, + media: query, + onchange: null, + addListener: jest.fn(), // deprecated + removeListener: jest.fn(), // deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), + })), + }); + window.ResizeObserver = class ResizeObserver { + observe() {} + unobserve() {} + disconnect() {} + }; + + monaco.languages.register({ id: 'loglang' }); + monaco.languages.setMonarchTokensProvider('loglang', simpleLogLang); + }); test('is rendered', () => { const component = mountWithIntl( diff --git a/src/plugins/presentation_util/public/components/expression_input/language.ts b/src/plugins/presentation_util/public/components/expression_input/language.ts index 03b868af42aa..8f50ae97fa83 100644 --- a/src/plugins/presentation_util/public/components/expression_input/language.ts +++ b/src/plugins/presentation_util/public/components/expression_input/language.ts @@ -115,6 +115,8 @@ const expressionsLanguage: ExpressionsLanguage = { export function registerExpressionsLanguage(functions: ExpressionFunction[]) { expressionsLanguage.keywords = functions.map((fn) => fn.name); expressionsLanguage.deprecated = functions.filter((fn) => fn.deprecated).map((fn) => fn.name); - monaco.languages.register({ id: EXPRESSIONS_LANGUAGE_ID }); - monaco.languages.setMonarchTokensProvider(EXPRESSIONS_LANGUAGE_ID, expressionsLanguage); + monaco.languages.onLanguage(EXPRESSIONS_LANGUAGE_ID, () => { + monaco.languages.register({ id: EXPRESSIONS_LANGUAGE_ID }); + monaco.languages.setMonarchTokensProvider(EXPRESSIONS_LANGUAGE_ID, expressionsLanguage); + }); } diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx index 17394560f803..275a540b3c4d 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/math_tokenization.tsx @@ -62,5 +62,7 @@ export const lexerRules = { }, } as monaco.languages.IMonarchLanguage; -monaco.languages.setMonarchTokensProvider(LANGUAGE_ID, lexerRules); -monaco.languages.setLanguageConfiguration(LANGUAGE_ID, languageConfiguration); +monaco.languages.onLanguage(LANGUAGE_ID, () => { + monaco.languages.setMonarchTokensProvider(LANGUAGE_ID, lexerRules); + monaco.languages.setLanguageConfiguration(LANGUAGE_ID, languageConfiguration); +}); diff --git a/yarn.lock b/yarn.lock index 2b750cbf1980..c86e92cd6a02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19366,10 +19366,10 @@ moment-timezone@*, moment-timezone@^0.5.34: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== -monaco-editor@*, monaco-editor@^0.22.3: - version "0.22.3" - resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.22.3.tgz#69b42451d3116c6c08d9b8e052007ff891fd85d7" - integrity sha512-RM559z2CJbczZ3k2b+ouacMINkAYWwRit4/vs0g2X/lkYefDiu0k2GmgWjAuiIpQi+AqASPOKvXNmYc8KUSvVQ== +monaco-editor@*, monaco-editor@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.24.0.tgz#990b55096bcc95d08d8d28e55264c6eb17707269" + integrity sha512-o1f0Lz6ABFNTtnEqqqvlY9qzNx24rQZx1RgYNQ8SkWkE+Ka63keHH/RqxQ4QhN4fs/UYOnvAtEUZsPrzccH++A== monitor-event-loop-delay@^1.0.0: version "1.0.0" From fd6047bb22c10c2f7ff72e225f93f5d37aaaf331 Mon Sep 17 00:00:00 2001 From: Alex Horvath Date: Tue, 1 Nov 2022 09:10:22 +0100 Subject: [PATCH 44/87] Correct wrong multiplier for byte conversion (#143751) * Correct wrong multiplier for byte conversion Bug: shard size alert comes earlier than expected. * add test for threshold limit use shard sizes close to the limit, gbMultiplier has to be correct * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Smaller than the threshold Shard size not <= but < as threshold * eliminate ts-expect-error * code readability * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Fix estypes import Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Carlos Crespo --- .../lib/alerts/fetch_index_shard_size.test.ts | 90 +++++++++++++++++-- .../lib/alerts/fetch_index_shard_size.ts | 2 +- 2 files changed, 82 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts index 7fac9550996d..c00facef1df7 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts @@ -7,6 +7,7 @@ import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; import { fetchIndexShardSize } from './fetch_index_shard_size'; +import { estypes } from '@elastic/elasticsearch'; jest.mock('../../static_globals', () => ({ Globals: { @@ -24,7 +25,6 @@ import { Globals } from '../../static_globals'; describe('fetchIndexShardSize', () => { const esClient = elasticsearchServiceMock.createScopedClusterClient().asCurrentUser; - const clusters = [ { clusterUuid: 'cluster123', @@ -34,7 +34,21 @@ describe('fetchIndexShardSize', () => { const size = 10; const shardIndexPatterns = '*'; const threshold = 0.00000001; - const esRes = { + + const esRes: estypes.SearchResponse = { + took: 1, + timed_out: false, + _shards: { + total: 0, + successful: 0, + failed: 0, + skipped: 0, + }, + hits: { + total: 0, + max_score: 0, + hits: [], + }, aggregations: { clusters: { buckets: [ @@ -48,6 +62,39 @@ describe('fetchIndexShardSize', () => { { key: '.monitoring-es-7-2022.01.27', doc_count: 30, + hits: { + hits: { + total: { + value: 30, + relation: 'eq', + }, + max_score: null, + hits: [ + { + _index: '.monitoring-es-7-2022.01.27', + _id: 'JVkunX4BfK-FILsH9Wr_', + _score: null, + _source: { + index_stats: { + shards: { + primaries: 2, + }, + primaries: { + store: { + size_in_bytes: 2171105970, + }, + }, + }, + }, + sort: [1643314607570], + }, + ], + }, + }, + }, + { + key: '.monitoring-es-7-2022.01.28', + doc_count: 30, hits: { hits: { total: { @@ -67,7 +114,7 @@ describe('fetchIndexShardSize', () => { }, primaries: { store: { - size_in_bytes: 3537949, + size_in_bytes: 1073741823, }, }, }, @@ -118,12 +165,9 @@ describe('fetchIndexShardSize', () => { }, }, }; - it('fetch as expected', async () => { - esClient.search.mockResponse( - // @ts-expect-error not full response interface - esRes - ); + it('fetch as expected', async () => { + esClient.search.mockResponse(esRes); const result = await fetchIndexShardSize( esClient, clusters, @@ -135,7 +179,13 @@ describe('fetchIndexShardSize', () => { { ccs: undefined, shardIndex: '.monitoring-es-7-2022.01.27', - shardSize: 0, + shardSize: 1.01, + clusterUuid: 'NG2d5jHiSBGPE6HLlUN2Bg', + }, + { + ccs: undefined, + shardIndex: '.monitoring-es-7-2022.01.28', + shardSize: 1, clusterUuid: 'NG2d5jHiSBGPE6HLlUN2Bg', }, { @@ -146,6 +196,27 @@ describe('fetchIndexShardSize', () => { }, ]); }); + + it('higher alert threshold', async () => { + esClient.search.mockResponse(esRes); + const oneGBThreshold = 1; + const result = await fetchIndexShardSize( + esClient, + clusters, + oneGBThreshold, + shardIndexPatterns, + size + ); + expect(result).toEqual([ + { + ccs: undefined, + shardIndex: '.monitoring-es-7-2022.01.27', + shardSize: 1.01, + clusterUuid: 'NG2d5jHiSBGPE6HLlUN2Bg', + }, + ]); + }); + it('should call ES with correct query', async () => { await fetchIndexShardSize(esClient, clusters, threshold, shardIndexPatterns, size); expect(esClient.search).toHaveBeenCalledWith({ @@ -201,6 +272,7 @@ describe('fetchIndexShardSize', () => { }, }); }); + it('should call ES with correct query when ccs disabled', async () => { // @ts-ignore Globals.app.config.ui.ccs.enabled = false; diff --git a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts index f8163f5c35bc..5c32794cbf21 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts @@ -26,7 +26,7 @@ const memoizedIndexPatterns = (globPatterns: string) => { ) as RegExPatterns; }; -const gbMultiplier = 1000000000; +const gbMultiplier = Math.pow(1024, 3); export async function fetchIndexShardSize( esClient: ElasticsearchClient, From 2fb12fbc54bb1955f75ef9bc4c722d5fd60f9679 Mon Sep 17 00:00:00 2001 From: Pierre Gayvallet Date: Tue, 1 Nov 2022 09:16:32 +0100 Subject: [PATCH 45/87] Implement base browser-side logging system (#144107) * start refactoring and moving stuff around * add abstraction for BaseLogger * plug logging into core system * add logger factory to plugin init context * add unit tests for browser package * add more unit tests * [CI] Auto-commit changed files from 'node scripts/generate codeowners' * fix mock * add mocks, update system tests * update files due to merge * [CI] Auto-commit changed files from 'node scripts/generate codeowners' * update readme and package * remove chalk usages from client-side * add plugin context tests * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * fix new packages Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .github/CODEOWNERS | 3 + package.json | 3 + packages/BUILD.bazel | 6 + .../src/core_context.ts | 2 + .../base/core-base-browser-mocks/BUILD.bazel | 4 +- .../src/core_context.mock.ts | 2 + .../core-logging-browser-internal/BUILD.bazel | 114 +++++ .../core-logging-browser-internal/README.md | 3 + .../core-logging-browser-internal/index.ts | 9 + .../jest.config.js | 13 + .../kibana.jsonc | 7 + .../package.json | 10 + .../src/appenders/console_appender.test.ts | 56 +++ .../src/appenders/console_appender.ts | 38 ++ .../src/appenders/index.ts | 9 + .../src/index.ts | 10 + .../__snapshots__/pattern_layout.test.ts.snap | 37 ++ .../src/layouts/index.ts | 9 + .../src/layouts/pattern_layout.test.ts | 246 ++++++++++ .../src/layouts/pattern_layout.ts | 42 ++ .../src/logger.test.ts | 431 ++++++++++++++++++ .../src/logger.ts | 46 ++ .../src/logging_system.test.ts | 77 ++++ .../src/logging_system.ts | 74 +++ .../src/types.ts | 20 + .../tsconfig.json | 16 + .../core-logging-browser-mocks/BUILD.bazel | 115 +++++ .../core-logging-browser-mocks/README.md | 3 + .../core-logging-browser-mocks/index.ts | 9 + .../core-logging-browser-mocks/jest.config.js | 13 + .../core-logging-browser-mocks/kibana.jsonc | 7 + .../core-logging-browser-mocks/package.json | 10 + .../core-logging-browser-mocks/src/index.ts | 9 + .../src/logging_system.mock.ts | 37 ++ .../core-logging-browser-mocks/tsconfig.json | 18 + .../core-logging-common-internal/BUILD.bazel | 116 +++++ .../core-logging-common-internal/README.md | 3 + .../core-logging-common-internal/index.ts | 24 + .../jest.config.js | 13 + .../core-logging-common-internal/kibana.jsonc | 7 + .../core-logging-common-internal/package.json | 10 + .../core-logging-common-internal/src/index.ts | 25 + .../__snapshots__/pattern_layout.test.ts.snap | 37 ++ .../src/layouts/conversions/date.ts | 3 +- .../src/layouts/conversions/index.ts | 14 + .../src/layouts/conversions/level.ts | 18 + .../src/layouts/conversions/logger.ts | 18 + .../src/layouts/conversions/message.ts | 2 +- .../src/layouts/conversions/meta.ts | 2 +- .../src/layouts/conversions/types.ts} | 0 .../src/layouts/index.ts | 17 + .../src/layouts/pattern_layout.test.ts | 256 +++++++++++ .../src/layouts/pattern_layout.ts | 73 +++ .../src/logger.test.ts | 241 ++++++++++ .../src/logger.ts | 86 ++++ .../src/logger_context.test.ts | 26 ++ .../src/logger_context.ts | 46 ++ .../tsconfig.json | 16 + .../core-logging-server-internal/BUILD.bazel | 4 + .../src/appenders/console/console_appender.ts | 2 +- .../src/layouts/conversions/index.ts | 14 +- .../src/layouts/conversions/level.ts | 3 +- .../src/layouts/conversions/logger.ts | 3 +- .../src/layouts/conversions/pid.ts | 4 +- .../src/layouts/pattern_layout.ts | 33 +- .../src/logger.ts | 64 +-- .../src/logging_config.ts | 30 +- .../src/plugin_context.test.ts | 64 +++ .../src/plugin_context.ts | 5 + .../src/test_helpers/mocks.ts | 2 + .../core-plugins-browser-mocks/BUILD.bazel | 2 + .../src/plugins_service.mock.ts | 2 + .../src/plugin_initializer.ts | 2 + .../core-root-browser-internal/BUILD.bazel | 2 + .../src/core_system.test.mocks.ts | 7 + .../src/core_system.test.ts | 46 +- .../src/core_system.ts | 16 +- src/core/public/mocks.ts | 1 + tsconfig.base.json | 6 + yarn.lock | 12 + 80 files changed, 2756 insertions(+), 129 deletions(-) create mode 100644 packages/core/logging/core-logging-browser-internal/BUILD.bazel create mode 100644 packages/core/logging/core-logging-browser-internal/README.md create mode 100644 packages/core/logging/core-logging-browser-internal/index.ts create mode 100644 packages/core/logging/core-logging-browser-internal/jest.config.js create mode 100644 packages/core/logging/core-logging-browser-internal/kibana.jsonc create mode 100644 packages/core/logging/core-logging-browser-internal/package.json create mode 100644 packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.test.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/appenders/index.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/index.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap create mode 100644 packages/core/logging/core-logging-browser-internal/src/layouts/index.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.test.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/logger.test.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/logger.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/logging_system.test.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/logging_system.ts create mode 100644 packages/core/logging/core-logging-browser-internal/src/types.ts create mode 100644 packages/core/logging/core-logging-browser-internal/tsconfig.json create mode 100644 packages/core/logging/core-logging-browser-mocks/BUILD.bazel create mode 100644 packages/core/logging/core-logging-browser-mocks/README.md create mode 100644 packages/core/logging/core-logging-browser-mocks/index.ts create mode 100644 packages/core/logging/core-logging-browser-mocks/jest.config.js create mode 100644 packages/core/logging/core-logging-browser-mocks/kibana.jsonc create mode 100644 packages/core/logging/core-logging-browser-mocks/package.json create mode 100644 packages/core/logging/core-logging-browser-mocks/src/index.ts create mode 100644 packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts create mode 100644 packages/core/logging/core-logging-browser-mocks/tsconfig.json create mode 100644 packages/core/logging/core-logging-common-internal/BUILD.bazel create mode 100644 packages/core/logging/core-logging-common-internal/README.md create mode 100644 packages/core/logging/core-logging-common-internal/index.ts create mode 100644 packages/core/logging/core-logging-common-internal/jest.config.js create mode 100644 packages/core/logging/core-logging-common-internal/kibana.jsonc create mode 100644 packages/core/logging/core-logging-common-internal/package.json create mode 100644 packages/core/logging/core-logging-common-internal/src/index.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap rename packages/core/logging/{core-logging-server-internal => core-logging-common-internal}/src/layouts/conversions/date.ts (98%) create mode 100644 packages/core/logging/core-logging-common-internal/src/layouts/conversions/index.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts rename packages/core/logging/{core-logging-server-internal => core-logging-common-internal}/src/layouts/conversions/message.ts (94%) rename packages/core/logging/{core-logging-server-internal => core-logging-common-internal}/src/layouts/conversions/meta.ts (93%) rename packages/core/logging/{core-logging-server-internal/src/layouts/conversions/type.ts => core-logging-common-internal/src/layouts/conversions/types.ts} (100%) create mode 100644 packages/core/logging/core-logging-common-internal/src/layouts/index.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.test.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/logger.test.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/logger.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/logger_context.test.ts create mode 100644 packages/core/logging/core-logging-common-internal/src/logger_context.ts create mode 100644 packages/core/logging/core-logging-common-internal/tsconfig.json create mode 100644 packages/core/plugins/core-plugins-browser-internal/src/plugin_context.test.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 974afddddef6..43ff2c0fa979 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -788,6 +788,9 @@ packages/core/lifecycle/core-lifecycle-browser-mocks @elastic/kibana-core packages/core/lifecycle/core-lifecycle-server @elastic/kibana-core packages/core/lifecycle/core-lifecycle-server-internal @elastic/kibana-core packages/core/lifecycle/core-lifecycle-server-mocks @elastic/kibana-core +packages/core/logging/core-logging-browser-internal @elastic/kibana-core +packages/core/logging/core-logging-browser-mocks @elastic/kibana-core +packages/core/logging/core-logging-common-internal @elastic/kibana-core packages/core/logging/core-logging-server @elastic/kibana-core packages/core/logging/core-logging-server-internal @elastic/kibana-core packages/core/logging/core-logging-server-mocks @elastic/kibana-core diff --git a/package.json b/package.json index eef3f24151e1..a63be94afb18 100644 --- a/package.json +++ b/package.json @@ -243,6 +243,9 @@ "@kbn/core-lifecycle-server": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server", "@kbn/core-lifecycle-server-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-internal", "@kbn/core-lifecycle-server-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-mocks", + "@kbn/core-logging-browser-internal": "link:bazel-bin/packages/core/logging/core-logging-browser-internal", + "@kbn/core-logging-browser-mocks": "link:bazel-bin/packages/core/logging/core-logging-browser-mocks", + "@kbn/core-logging-common-internal": "link:bazel-bin/packages/core/logging/core-logging-common-internal", "@kbn/core-logging-server": "link:bazel-bin/packages/core/logging/core-logging-server", "@kbn/core-logging-server-internal": "link:bazel-bin/packages/core/logging/core-logging-server-internal", "@kbn/core-logging-server-mocks": "link:bazel-bin/packages/core/logging/core-logging-server-mocks", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 3dc520d9a824..f01c019499c7 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -108,6 +108,9 @@ filegroup( "//packages/core/lifecycle/core-lifecycle-server:build", "//packages/core/lifecycle/core-lifecycle-server-internal:build", "//packages/core/lifecycle/core-lifecycle-server-mocks:build", + "//packages/core/logging/core-logging-browser-internal:build", + "//packages/core/logging/core-logging-browser-mocks:build", + "//packages/core/logging/core-logging-common-internal:build", "//packages/core/logging/core-logging-server:build", "//packages/core/logging/core-logging-server-internal:build", "//packages/core/logging/core-logging-server-mocks:build", @@ -463,6 +466,9 @@ filegroup( "//packages/core/lifecycle/core-lifecycle-server:build_types", "//packages/core/lifecycle/core-lifecycle-server-internal:build_types", "//packages/core/lifecycle/core-lifecycle-server-mocks:build_types", + "//packages/core/logging/core-logging-browser-internal:build_types", + "//packages/core/logging/core-logging-browser-mocks:build_types", + "//packages/core/logging/core-logging-common-internal:build_types", "//packages/core/logging/core-logging-server:build_types", "//packages/core/logging/core-logging-server-internal:build_types", "//packages/core/logging/core-logging-server-mocks:build_types", diff --git a/packages/core/base/core-base-browser-internal/src/core_context.ts b/packages/core/base/core-base-browser-internal/src/core_context.ts index cf981dd75245..c5cd4303f5b3 100644 --- a/packages/core/base/core-base-browser-internal/src/core_context.ts +++ b/packages/core/base/core-base-browser-internal/src/core_context.ts @@ -7,11 +7,13 @@ */ import type { EnvironmentMode, PackageInfo } from '@kbn/config'; +import type { LoggerFactory } from '@kbn/logging'; import type { CoreId } from '@kbn/core-base-common-internal'; /** @internal */ export interface CoreContext { coreId: CoreId; + logger: LoggerFactory; env: { mode: Readonly; packageInfo: Readonly; diff --git a/packages/core/base/core-base-browser-mocks/BUILD.bazel b/packages/core/base/core-base-browser-mocks/BUILD.bazel index 28088cfd13dd..4eefc6034407 100644 --- a/packages/core/base/core-base-browser-mocks/BUILD.bazel +++ b/packages/core/base/core-base-browser-mocks/BUILD.bazel @@ -35,12 +35,14 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ + "//packages/kbn-logging-mocks", ] TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/core/base/core-base-browser-internal:npm_module_types", + "//packages/kbn-logging-mocks:npm_module_types", + "//packages/core/base/core-base-browser-internal:npm_module_types", ] jsts_transpiler( diff --git a/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts b/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts index e43efe1246ff..e871621b909e 100644 --- a/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts +++ b/packages/core/base/core-base-browser-mocks/src/core_context.mock.ts @@ -6,11 +6,13 @@ * Side Public License, v 1. */ +import { loggerMock } from '@kbn/logging-mocks'; import type { CoreContext } from '@kbn/core-base-browser-internal'; function createCoreContext({ production = false }: { production?: boolean } = {}): CoreContext { return { coreId: Symbol('core context mock'), + logger: loggerMock.create(), env: { mode: { dev: !production, diff --git a/packages/core/logging/core-logging-browser-internal/BUILD.bazel b/packages/core/logging/core-logging-browser-internal/BUILD.bazel new file mode 100644 index 000000000000..b707b68279e4 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/BUILD.bazel @@ -0,0 +1,114 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-logging-browser-internal" +PKG_REQUIRE_NAME = "@kbn/core-logging-browser-internal" + +SOURCE_FILES = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "//packages/core/logging/core-logging-common-internal", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/kbn-logging:npm_module_types", + "//packages/core/logging/core-logging-common-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/logging/core-logging-browser-internal/README.md b/packages/core/logging/core-logging-browser-internal/README.md new file mode 100644 index 000000000000..7888115e20cb --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-logging-browser-internal + +This package contains the internal types and implementation for Core's browser-side logging service. diff --git a/packages/core/logging/core-logging-browser-internal/index.ts b/packages/core/logging/core-logging-browser-internal/index.ts new file mode 100644 index 000000000000..f757b7f6ce38 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { BaseLogger, BrowserLoggingSystem, type IBrowserLoggingSystem } from './src'; diff --git a/packages/core/logging/core-logging-browser-internal/jest.config.js b/packages/core/logging/core-logging-browser-internal/jest.config.js new file mode 100644 index 000000000000..aec2a0f4d8e2 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/packages/core/logging/core-logging-browser-internal'], +}; diff --git a/packages/core/logging/core-logging-browser-internal/kibana.jsonc b/packages/core/logging/core-logging-browser-internal/kibana.jsonc new file mode 100644 index 000000000000..6d60078e34da --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-logging-browser-internal", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/logging/core-logging-browser-internal/package.json b/packages/core/logging/core-logging-browser-internal/package.json new file mode 100644 index 000000000000..56cf9d28f32b --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/package.json @@ -0,0 +1,10 @@ +{ + "name": "@kbn/core-logging-browser-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.test.ts b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.test.ts new file mode 100644 index 000000000000..8b8900be8e03 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.test.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogRecord, LogLevel } from '@kbn/logging'; +import { ConsoleAppender } from './console_appender'; + +test('`append()` correctly formats records and pushes them to console.', () => { + jest.spyOn(global.console, 'log').mockImplementation(() => { + // noop + }); + + const records: LogRecord[] = [ + { + context: 'context-1', + level: LogLevel.All, + message: 'message-1', + timestamp: new Date(), + pid: 5355, + }, + { + context: 'context-2', + level: LogLevel.Trace, + message: 'message-2', + timestamp: new Date(), + pid: 5355, + }, + { + context: 'context-3', + error: new Error('Error'), + level: LogLevel.Fatal, + message: 'message-3', + timestamp: new Date(), + pid: 5355, + }, + ]; + + const appender = new ConsoleAppender({ + format(record) { + return `mock-${JSON.stringify(record)}`; + }, + }); + + for (const record of records) { + appender.append(record); + // eslint-disable-next-line no-console + expect(console.log).toHaveBeenCalledWith(`mock-${JSON.stringify(record)}`); + } + + // eslint-disable-next-line no-console + expect(console.log).toHaveBeenCalledTimes(records.length); +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.ts b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.ts new file mode 100644 index 000000000000..4d35f3150b42 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/appenders/console_appender.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { Layout, LogRecord, DisposableAppender } from '@kbn/logging'; + +/** + * + * Appender that formats all the `LogRecord` instances it receives and logs them via built-in `console`. + * @internal + */ +export class ConsoleAppender implements DisposableAppender { + /** + * Creates ConsoleAppender instance. + * @param layout Instance of `Layout` sub-class responsible for `LogRecord` formatting. + */ + constructor(private readonly layout: Layout) {} + + /** + * Formats specified `record` and logs it via built-in `console`. + * @param record `LogRecord` instance to be logged. + */ + public append(record: LogRecord) { + // eslint-disable-next-line no-console + console.log(this.layout.format(record)); + } + + /** + * Disposes `ConsoleAppender`. + */ + public dispose() { + // noop + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/appenders/index.ts b/packages/core/logging/core-logging-browser-internal/src/appenders/index.ts new file mode 100644 index 000000000000..070f5fb429c8 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/appenders/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { ConsoleAppender } from './console_appender'; diff --git a/packages/core/logging/core-logging-browser-internal/src/index.ts b/packages/core/logging/core-logging-browser-internal/src/index.ts new file mode 100644 index 000000000000..618d4dd8a7ef --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { BaseLogger } from './logger'; +export { BrowserLoggingSystem, type IBrowserLoggingSystem } from './logging_system'; diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap b/packages/core/logging/core-logging-browser-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap new file mode 100644 index 000000000000..d3f9309a4773 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`\`format()\` correctly formats record with custom pattern. 1`] = `"mock-Some error stack-context-1-Some error stack"`; + +exports[`\`format()\` correctly formats record with custom pattern. 2`] = `"mock-message-2-context-2-message-2"`; + +exports[`\`format()\` correctly formats record with custom pattern. 3`] = `"mock-message-3-context-3-message-3"`; + +exports[`\`format()\` correctly formats record with custom pattern. 4`] = `"mock-message-4-context-4-message-4"`; + +exports[`\`format()\` correctly formats record with custom pattern. 5`] = `"mock-message-5-context-5-message-5"`; + +exports[`\`format()\` correctly formats record with custom pattern. 6`] = `"mock-message-6-context-6-message-6"`; + +exports[`\`format()\` correctly formats record with full pattern. 1`] = `"[2012-02-01T09:30:22.011-05:00][FATAL][context-1] Some error stack"`; + +exports[`\`format()\` correctly formats record with full pattern. 2`] = `"[2012-02-01T09:30:22.011-05:00][ERROR][context-2] message-2"`; + +exports[`\`format()\` correctly formats record with full pattern. 3`] = `"[2012-02-01T09:30:22.011-05:00][WARN ][context-3] message-3"`; + +exports[`\`format()\` correctly formats record with full pattern. 4`] = `"[2012-02-01T09:30:22.011-05:00][DEBUG][context-4] message-4"`; + +exports[`\`format()\` correctly formats record with full pattern. 5`] = `"[2012-02-01T09:30:22.011-05:00][INFO ][context-5] message-5"`; + +exports[`\`format()\` correctly formats record with full pattern. 6`] = `"[2012-02-01T09:30:22.011-05:00][TRACE][context-6] message-6"`; + +exports[`allows specifying the PID in custom pattern 1`] = `"%pid-context-1-Some error stack"`; + +exports[`allows specifying the PID in custom pattern 2`] = `"%pid-context-2-message-2"`; + +exports[`allows specifying the PID in custom pattern 3`] = `"%pid-context-3-message-3"`; + +exports[`allows specifying the PID in custom pattern 4`] = `"%pid-context-4-message-4"`; + +exports[`allows specifying the PID in custom pattern 5`] = `"%pid-context-5-message-5"`; + +exports[`allows specifying the PID in custom pattern 6`] = `"%pid-context-6-message-6"`; diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/index.ts b/packages/core/logging/core-logging-browser-internal/src/layouts/index.ts new file mode 100644 index 000000000000..75591053d34d --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { PatternLayout } from './pattern_layout'; diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.test.ts b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.test.ts new file mode 100644 index 000000000000..eb0961960b17 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.test.ts @@ -0,0 +1,246 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import stripAnsi from 'strip-ansi'; +import hasAnsi from 'has-ansi'; +import { LogLevel, LogRecord } from '@kbn/logging'; +import { PatternLayout } from './pattern_layout'; + +const stripAnsiSnapshotSerializer: jest.SnapshotSerializerPlugin = { + serialize(value: string) { + return stripAnsi(value); + }, + + test(value: any) { + return typeof value === 'string' && hasAnsi(value); + }, +}; + +const timestamp = new Date(Date.UTC(2012, 1, 1, 14, 30, 22, 11)); +const records: LogRecord[] = [ + { + context: 'context-1', + error: { + message: 'Some error message', + name: 'Some error name', + stack: 'Some error stack', + }, + level: LogLevel.Fatal, + message: 'message-1', + timestamp, + pid: 5355, + }, + { + context: 'context-2', + level: LogLevel.Error, + message: 'message-2', + timestamp, + pid: 5355, + }, + { + context: 'context-3', + level: LogLevel.Warn, + message: 'message-3', + timestamp, + pid: 5355, + }, + { + context: 'context-4', + level: LogLevel.Debug, + message: 'message-4', + timestamp, + pid: 5355, + }, + { + context: 'context-5', + level: LogLevel.Info, + message: 'message-5', + timestamp, + pid: 5355, + }, + { + context: 'context-6', + level: LogLevel.Trace, + message: 'message-6', + timestamp, + pid: 5355, + }, +]; + +expect.addSnapshotSerializer(stripAnsiSnapshotSerializer); + +test('`format()` correctly formats record with full pattern.', () => { + const layout = new PatternLayout(); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with custom pattern.', () => { + const layout = new PatternLayout('mock-%message-%logger-%message'); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with meta data.', () => { + const layout = new PatternLayout('[%date][%level][%logger]%meta %message'); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: { + // @ts-expect-error not valid ECS field + from: 'v7', + to: 'v8', + }, + }) + ).toBe( + '[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{"from":"v7","to":"v8"} message-meta' + ); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: {}, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{} message-meta'); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta] message-meta'); +}); + +test('allows specifying the PID in custom pattern', () => { + const layout = new PatternLayout('%pid-%logger-%message'); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` allows specifying pattern with meta.', () => { + const layout = new PatternLayout('%logger-%meta-%message'); + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + meta: { + from: 'v7', + to: 'v8', + }, + }; + // @ts-expect-error not valid ECS field + expect(layout.format(record)).toBe('context-{"from":"v7","to":"v8"}-message'); +}); + +describe('format', () => { + describe('timestamp', () => { + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + }; + it('uses ISO8601_TZ as default', () => { + const layout = new PatternLayout(); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context] message'); + }); + + describe('supports specifying a predefined format', () => { + it('ISO8601', () => { + const layout = new PatternLayout('[%date{ISO8601}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout('[%date{ISO8601_TZ}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout('[%date{ABSOLUTE}][%logger]'); + + expect(layout.format(record)).toBe('[09:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout('[%date{UNIX}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout('[%date{UNIX_MILLIS}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + + describe('supports specifying a predefined format and timezone', () => { + it('ISO8601', () => { + const layout = new PatternLayout('[%date{ISO8601}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout('[%date{ISO8601_TZ}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[2012-02-01T06:30:22.011-08:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout('[%date{ABSOLUTE}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[06:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout('[%date{UNIX}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout('[%date{UNIX_MILLIS}{America/Los_Angeles}][%logger]'); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + it('formats several conversions patterns correctly', () => { + const layout = new PatternLayout( + '[%date{ABSOLUTE}{America/Los_Angeles}][%logger][%date{UNIX}]' + ); + + expect(layout.format(record)).toBe('[06:30:22.011][context][1328106622]'); + }); + }); +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.ts b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.ts new file mode 100644 index 000000000000..0efdf33afabb --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/layouts/pattern_layout.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + PatternLayout as BasePatternLayout, + type Conversion, + LoggerConversion, + LevelConversion, + MetaConversion, + MessageConversion, + DateConversion, +} from '@kbn/core-logging-common-internal'; + +const DEFAULT_PATTERN = `[%date][%level][%logger] %message`; + +const conversions: Conversion[] = [ + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + DateConversion, +]; + +/** + * Layout that formats `LogRecord` using the `pattern` string with optional + * color highlighting (eg. to make log messages easier to read in the terminal). + * @internal + */ +export class PatternLayout extends BasePatternLayout { + constructor(pattern: string = DEFAULT_PATTERN) { + super({ + pattern, + highlight: false, + conversions, + }); + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/logger.test.ts b/packages/core/logging/core-logging-browser-internal/src/logger.test.ts new file mode 100644 index 000000000000..7c9606264602 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logger.test.ts @@ -0,0 +1,431 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevel, Appender } from '@kbn/logging'; +import { getLoggerContext } from '@kbn/core-logging-common-internal'; +import { BaseLogger, BROWSER_PID } from './logger'; + +const context = getLoggerContext(['context', 'parent', 'child']); +let appenderMocks: Appender[]; +let logger: BaseLogger; +const factory = { + get: jest.fn().mockImplementation(() => logger), +}; + +const timestamp = new Date(2012, 1, 1); +beforeEach(() => { + jest.spyOn(global, 'Date').mockImplementation(() => timestamp); + + appenderMocks = [{ append: jest.fn() }, { append: jest.fn() }]; + logger = new BaseLogger(context, LogLevel.All, appenderMocks, factory); +}); + +afterEach(() => { + jest.resetAllMocks(); + jest.restoreAllMocks(); +}); + +test('`trace()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.trace('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Trace, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.trace('message-2', { trace: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Trace, + message: 'message-2', + meta: { trace: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`debug()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.debug('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Debug, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.debug('message-2', { debug: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Debug, + message: 'message-2', + meta: { debug: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`info()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.info('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Info, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.info('message-2', { info: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Info, + message: 'message-2', + meta: { info: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`warn()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.warn('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Warn, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + const error = new Error('message-2'); + logger.warn(error); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error, + level: LogLevel.Warn, + message: 'message-2', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.warn('message-3', { warn: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Warn, + message: 'message-3', + meta: { warn: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`error()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.error('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Error, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + const error = new Error('message-2'); + logger.error(error); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error, + level: LogLevel.Error, + message: 'message-2', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.error('message-3', { error: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Error, + message: 'message-3', + meta: { error: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`fatal()` correctly forms `LogRecord` and passes it to all appenders.', () => { + logger.fatal('message-1'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Fatal, + message: 'message-1', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + const error = new Error('message-2'); + logger.fatal(error); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error, + level: LogLevel.Fatal, + message: 'message-2', + meta: undefined, + timestamp, + pid: BROWSER_PID, + }); + } + + // @ts-expect-error ECS custom meta + logger.fatal('message-3', { fatal: true }); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + error: undefined, + level: LogLevel.Fatal, + message: 'message-3', + meta: { fatal: true }, + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('`log()` just passes the record to all appenders.', () => { + const record = { + context, + level: LogLevel.Info, + message: 'message-1', + timestamp, + pid: 5355, + }; + + logger.log(record); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(record); + } +}); + +test('`get()` calls the logger factory with proper context and return the result', () => { + logger.get('sub', 'context'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'sub', 'context'); + + factory.get.mockClear(); + factory.get.mockImplementation(() => 'some-logger'); + + const childLogger = logger.get('other', 'sub'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'other', 'sub'); + expect(childLogger).toEqual('some-logger'); +}); + +test('logger with `Off` level does not pass any records to appenders.', () => { + const turnedOffLogger = new BaseLogger(context, LogLevel.Off, appenderMocks, factory); + turnedOffLogger.trace('trace-message'); + turnedOffLogger.debug('debug-message'); + turnedOffLogger.info('info-message'); + turnedOffLogger.warn('warn-message'); + turnedOffLogger.error('error-message'); + turnedOffLogger.fatal('fatal-message'); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).not.toHaveBeenCalled(); + } +}); + +test('logger with `All` level passes all records to appenders.', () => { + const catchAllLogger = new BaseLogger(context, LogLevel.All, appenderMocks, factory); + + catchAllLogger.trace('trace-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Trace, + message: 'trace-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.debug('debug-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Debug, + message: 'debug-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.info('info-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Info, + message: 'info-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.warn('warn-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(4); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Warn, + message: 'warn-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.error('error-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(5); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Error, + message: 'error-message', + timestamp, + pid: BROWSER_PID, + }); + } + + catchAllLogger.fatal('fatal-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(6); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Fatal, + message: 'fatal-message', + timestamp, + pid: BROWSER_PID, + }); + } +}); + +test('passes log record to appenders only if log level is supported.', () => { + const warnLogger = new BaseLogger(context, LogLevel.Warn, appenderMocks, factory); + + warnLogger.trace('trace-message'); + warnLogger.debug('debug-message'); + warnLogger.info('info-message'); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).not.toHaveBeenCalled(); + } + + warnLogger.warn('warn-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Warn, + message: 'warn-message', + timestamp, + pid: BROWSER_PID, + }); + } + + warnLogger.error('error-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(2); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Error, + message: 'error-message', + timestamp, + pid: BROWSER_PID, + }); + } + + warnLogger.fatal('fatal-message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith({ + context, + level: LogLevel.Fatal, + message: 'fatal-message', + timestamp, + pid: BROWSER_PID, + }); + } +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/logger.ts b/packages/core/logging/core-logging-browser-internal/src/logger.ts new file mode 100644 index 000000000000..31c3c9f4eccb --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logger.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevel, LogRecord, LogMeta } from '@kbn/logging'; +import { AbstractLogger } from '@kbn/core-logging-common-internal'; + +function isError(x: any): x is Error { + return x instanceof Error; +} + +export const BROWSER_PID = -1; + +/** @internal */ +export class BaseLogger extends AbstractLogger { + protected createLogRecord( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta + ): LogRecord { + if (isError(errorOrMessage)) { + return { + context: this.context, + error: errorOrMessage, + level, + message: errorOrMessage.message, + meta, + timestamp: new Date(), + pid: BROWSER_PID, + }; + } + + return { + context: this.context, + level, + message: errorOrMessage, + meta, + timestamp: new Date(), + pid: BROWSER_PID, + }; + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/logging_system.test.ts b/packages/core/logging/core-logging-browser-internal/src/logging_system.test.ts new file mode 100644 index 000000000000..61b32002e7ae --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logging_system.test.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { BrowserLoggingSystem } from './logging_system'; + +describe('', () => { + const timestamp = new Date(Date.UTC(2012, 1, 1, 14, 33, 22, 11)); + + let mockConsoleLog: jest.SpyInstance; + let loggingSystem: BrowserLoggingSystem; + + beforeEach(() => { + mockConsoleLog = jest.spyOn(global.console, 'log').mockReturnValue(undefined); + jest.spyOn(global, 'Date').mockImplementation(() => timestamp); + loggingSystem = new BrowserLoggingSystem({ logLevel: 'warn' }); + }); + + afterEach(() => { + mockConsoleLog.mockReset(); + }); + + describe('#get', () => { + it('returns the same logger for same context', () => { + const loggerA = loggingSystem.get('same.logger'); + const loggerB = loggingSystem.get('same.logger'); + expect(loggerA).toBe(loggerB); + }); + + it('returns different loggers for different contexts', () => { + const loggerA = loggingSystem.get('some.logger'); + const loggerB = loggingSystem.get('another.logger'); + expect(loggerA).not.toBe(loggerB); + }); + }); + + describe('logger configuration', () => { + it('properly configure the logger to use the correct context and pattern', () => { + const logger = loggingSystem.get('foo.bar'); + logger.warn('some message'); + + expect(mockConsoleLog.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "[2012-02-01T09:33:22.011-05:00][WARN ][foo.bar] some message", + ] + `); + }); + + it('properly configure the logger to use the correct level', () => { + const logger = loggingSystem.get('foo.bar'); + logger.trace('some trace message'); + logger.debug('some debug message'); + logger.info('some info message'); + logger.warn('some warn message'); + logger.error('some error message'); + logger.fatal('some fatal message'); + + expect(mockConsoleLog.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "[2012-02-01T04:33:22.011-05:00][WARN ][foo.bar] some warn message", + ], + Array [ + "[2012-01-31T23:33:22.011-05:00][ERROR][foo.bar] some error message", + ], + Array [ + "[2012-01-31T18:33:22.011-05:00][FATAL][foo.bar] some fatal message", + ], + ] + `); + }); + }); +}); diff --git a/packages/core/logging/core-logging-browser-internal/src/logging_system.ts b/packages/core/logging/core-logging-browser-internal/src/logging_system.ts new file mode 100644 index 000000000000..50f7c449996b --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/logging_system.ts @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevel, Logger, LoggerFactory, LogLevelId, DisposableAppender } from '@kbn/logging'; +import { getLoggerContext } from '@kbn/core-logging-common-internal'; +import type { LoggerConfigType } from './types'; +import { BaseLogger } from './logger'; +import { PatternLayout } from './layouts'; +import { ConsoleAppender } from './appenders'; + +export interface BrowserLoggingConfig { + logLevel: LogLevelId; +} + +const CONSOLE_APPENDER_ID = 'console'; + +/** + * @internal + */ +export interface IBrowserLoggingSystem extends LoggerFactory { + asLoggerFactory(): LoggerFactory; +} + +/** + * @internal + */ +export class BrowserLoggingSystem implements IBrowserLoggingSystem { + private readonly loggers: Map = new Map(); + private readonly appenders: Map = new Map(); + + constructor(private readonly loggingConfig: BrowserLoggingConfig) { + this.setupSystem(loggingConfig); + } + + public get(...contextParts: string[]): Logger { + const context = getLoggerContext(contextParts); + if (!this.loggers.has(context)) { + this.loggers.set(context, this.createLogger(context)); + } + return this.loggers.get(context)!; + } + + private createLogger(context: string) { + const { level, appenders } = this.getLoggerConfigByContext(context); + const loggerLevel = LogLevel.fromId(level); + const loggerAppenders = appenders.map((appenderKey) => this.appenders.get(appenderKey)!); + return new BaseLogger(context, loggerLevel, loggerAppenders, this.asLoggerFactory()); + } + + private getLoggerConfigByContext(context: string): LoggerConfigType { + return { + level: this.loggingConfig.logLevel, + appenders: [CONSOLE_APPENDER_ID], + name: context, + }; + } + + private setupSystem(loggingConfig: BrowserLoggingConfig) { + const consoleAppender = new ConsoleAppender(new PatternLayout()); + this.appenders.set(CONSOLE_APPENDER_ID, consoleAppender); + } + + /** + * Safe wrapper that allows passing logging service as immutable LoggerFactory. + */ + public asLoggerFactory(): LoggerFactory { + return { get: (...contextParts: string[]) => this.get(...contextParts) }; + } +} diff --git a/packages/core/logging/core-logging-browser-internal/src/types.ts b/packages/core/logging/core-logging-browser-internal/src/types.ts new file mode 100644 index 000000000000..29ef977f2f28 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/src/types.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogLevelId } from '@kbn/logging'; + +/** + * Describes the configuration of a given logger. + * + * @public + */ +export interface LoggerConfigType { + appenders: string[]; + name: string; + level: LogLevelId; +} diff --git a/packages/core/logging/core-logging-browser-internal/tsconfig.json b/packages/core/logging/core-logging-browser-internal/tsconfig.json new file mode 100644 index 000000000000..25957cd665d1 --- /dev/null +++ b/packages/core/logging/core-logging-browser-internal/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [ + "jest", + "node", + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/logging/core-logging-browser-mocks/BUILD.bazel b/packages/core/logging/core-logging-browser-mocks/BUILD.bazel new file mode 100644 index 000000000000..a5e2c1ac54b1 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/BUILD.bazel @@ -0,0 +1,115 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-logging-browser-mocks" +PKG_REQUIRE_NAME = "@kbn/core-logging-browser-mocks" + +SOURCE_FILES = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//react", + "//packages/kbn-logging-mocks", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", + "//packages/kbn-logging-mocks:npm_module_types", + "//packages/core/logging/core-logging-browser-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/logging/core-logging-browser-mocks/README.md b/packages/core/logging/core-logging-browser-mocks/README.md new file mode 100644 index 000000000000..eeb456fe2379 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/core-logging-browser-mocks + +This package contains the mocks for Core's browser-side logging service. diff --git a/packages/core/logging/core-logging-browser-mocks/index.ts b/packages/core/logging/core-logging-browser-mocks/index.ts new file mode 100644 index 000000000000..a8b4c9ff1a2f --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { loggingSystemMock } from './src'; diff --git a/packages/core/logging/core-logging-browser-mocks/jest.config.js b/packages/core/logging/core-logging-browser-mocks/jest.config.js new file mode 100644 index 000000000000..47449390afd0 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/packages/core/logging/core-logging-browser-mocks'], +}; diff --git a/packages/core/logging/core-logging-browser-mocks/kibana.jsonc b/packages/core/logging/core-logging-browser-mocks/kibana.jsonc new file mode 100644 index 000000000000..377320816c65 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-logging-browser-mocks", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/logging/core-logging-browser-mocks/package.json b/packages/core/logging/core-logging-browser-mocks/package.json new file mode 100644 index 000000000000..8ab9610e3547 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/package.json @@ -0,0 +1,10 @@ +{ + "name": "@kbn/core-logging-browser-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/logging/core-logging-browser-mocks/src/index.ts b/packages/core/logging/core-logging-browser-mocks/src/index.ts new file mode 100644 index 000000000000..07ff934f94df --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/src/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { loggingSystemMock } from './logging_system.mock'; diff --git a/packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts b/packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts new file mode 100644 index 000000000000..333b2cbb7bb8 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; +import type { IBrowserLoggingSystem } from '@kbn/core-logging-browser-internal'; + +const createLoggingSystemMock = () => { + const mockLog: MockedLogger = loggerMock.create(); + + mockLog.get.mockImplementation((...context) => ({ + ...mockLog, + context, + })); + + const mocked: jest.Mocked = { + get: jest.fn(), + asLoggerFactory: jest.fn(), + }; + + mocked.get.mockImplementation((...context) => ({ + ...mockLog, + context, + })); + mocked.asLoggerFactory.mockImplementation(() => mocked); + + return mocked; +}; + +export const loggingSystemMock = { + create: createLoggingSystemMock, + createLogger: loggerMock.create, +}; diff --git a/packages/core/logging/core-logging-browser-mocks/tsconfig.json b/packages/core/logging/core-logging-browser-mocks/tsconfig.json new file mode 100644 index 000000000000..571fbfcd8ef2 --- /dev/null +++ b/packages/core/logging/core-logging-browser-mocks/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/core/logging/core-logging-common-internal/BUILD.bazel b/packages/core/logging/core-logging-common-internal/BUILD.bazel new file mode 100644 index 000000000000..3c392281b23a --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/BUILD.bazel @@ -0,0 +1,116 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "core-logging-common-internal" +PKG_REQUIRE_NAME = "@kbn/core-logging-common-internal" + +SOURCE_FILES = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//lodash", + "@npm//moment-timezone", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/moment-timezone", + "@npm//lodash", + "//packages/kbn-logging:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +js_library( + name = "npm_module_types", + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "build_types", + deps = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/logging/core-logging-common-internal/README.md b/packages/core/logging/core-logging-common-internal/README.md new file mode 100644 index 000000000000..9358b0009781 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/README.md @@ -0,0 +1,3 @@ +# @kbn/core-logging-common-internal + +This package contains common types and the base implementation for the browser and server-side logging systems. diff --git a/packages/core/logging/core-logging-common-internal/index.ts b/packages/core/logging/core-logging-common-internal/index.ts new file mode 100644 index 000000000000..24d5e9331678 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + PatternLayout, + DateConversion, + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + type Conversion, + AbstractLogger, + type CreateLogRecordFn, + getLoggerContext, + getParentLoggerContext, + CONTEXT_SEPARATOR, + ROOT_CONTEXT_NAME, + DEFAULT_APPENDER_NAME, +} from './src'; diff --git a/packages/core/logging/core-logging-common-internal/jest.config.js b/packages/core/logging/core-logging-common-internal/jest.config.js new file mode 100644 index 000000000000..3a077c47c301 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/packages/core/logging/core-logging-common-internal'], +}; diff --git a/packages/core/logging/core-logging-common-internal/kibana.jsonc b/packages/core/logging/core-logging-common-internal/kibana.jsonc new file mode 100644 index 000000000000..353df47ee9dd --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/core-logging-common-internal", + "owner": "@elastic/kibana-core", + "runtimeDeps": [], + "typeDeps": [], +} diff --git a/packages/core/logging/core-logging-common-internal/package.json b/packages/core/logging/core-logging-common-internal/package.json new file mode 100644 index 000000000000..3c0aff6df7b0 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/package.json @@ -0,0 +1,10 @@ +{ + "name": "@kbn/core-logging-common-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "author": "Kibana Core", + "license": "SSPL-1.0 OR Elastic License 2.0", + "types": "./target_types/index.d.ts" +} diff --git a/packages/core/logging/core-logging-common-internal/src/index.ts b/packages/core/logging/core-logging-common-internal/src/index.ts new file mode 100644 index 000000000000..cf74f46eb6d6 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + PatternLayout, + DateConversion, + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + type Conversion, +} from './layouts'; +export { AbstractLogger, type CreateLogRecordFn } from './logger'; +export { + getLoggerContext, + getParentLoggerContext, + CONTEXT_SEPARATOR, + ROOT_CONTEXT_NAME, + DEFAULT_APPENDER_NAME, +} from './logger_context'; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap b/packages/core/logging/core-logging-common-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap new file mode 100644 index 000000000000..d3f9309a4773 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/__snapshots__/pattern_layout.test.ts.snap @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`\`format()\` correctly formats record with custom pattern. 1`] = `"mock-Some error stack-context-1-Some error stack"`; + +exports[`\`format()\` correctly formats record with custom pattern. 2`] = `"mock-message-2-context-2-message-2"`; + +exports[`\`format()\` correctly formats record with custom pattern. 3`] = `"mock-message-3-context-3-message-3"`; + +exports[`\`format()\` correctly formats record with custom pattern. 4`] = `"mock-message-4-context-4-message-4"`; + +exports[`\`format()\` correctly formats record with custom pattern. 5`] = `"mock-message-5-context-5-message-5"`; + +exports[`\`format()\` correctly formats record with custom pattern. 6`] = `"mock-message-6-context-6-message-6"`; + +exports[`\`format()\` correctly formats record with full pattern. 1`] = `"[2012-02-01T09:30:22.011-05:00][FATAL][context-1] Some error stack"`; + +exports[`\`format()\` correctly formats record with full pattern. 2`] = `"[2012-02-01T09:30:22.011-05:00][ERROR][context-2] message-2"`; + +exports[`\`format()\` correctly formats record with full pattern. 3`] = `"[2012-02-01T09:30:22.011-05:00][WARN ][context-3] message-3"`; + +exports[`\`format()\` correctly formats record with full pattern. 4`] = `"[2012-02-01T09:30:22.011-05:00][DEBUG][context-4] message-4"`; + +exports[`\`format()\` correctly formats record with full pattern. 5`] = `"[2012-02-01T09:30:22.011-05:00][INFO ][context-5] message-5"`; + +exports[`\`format()\` correctly formats record with full pattern. 6`] = `"[2012-02-01T09:30:22.011-05:00][TRACE][context-6] message-6"`; + +exports[`allows specifying the PID in custom pattern 1`] = `"%pid-context-1-Some error stack"`; + +exports[`allows specifying the PID in custom pattern 2`] = `"%pid-context-2-message-2"`; + +exports[`allows specifying the PID in custom pattern 3`] = `"%pid-context-3-message-3"`; + +exports[`allows specifying the PID in custom pattern 4`] = `"%pid-context-4-message-4"`; + +exports[`allows specifying the PID in custom pattern 5`] = `"%pid-context-5-message-5"`; + +exports[`allows specifying the PID in custom pattern 6`] = `"%pid-context-6-message-6"`; diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/date.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts similarity index 98% rename from packages/core/logging/core-logging-server-internal/src/layouts/conversions/date.ts rename to packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts index 66aad5b42354..024d3d26befb 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/date.ts +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts @@ -9,8 +9,7 @@ import moment from 'moment-timezone'; import { last } from 'lodash'; import { LogRecord } from '@kbn/logging'; - -import { Conversion } from './type'; +import { Conversion } from './types'; const dateRegExp = /%date({(?[^}]+)})?({(?[^}]+)})?/g; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/conversions/index.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/index.ts new file mode 100644 index 000000000000..3f0abcdb8f47 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { Conversion } from './types'; +export { LoggerConversion } from './logger'; +export { LevelConversion } from './level'; +export { MessageConversion } from './message'; +export { MetaConversion } from './meta'; +export { DateConversion } from './date'; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts new file mode 100644 index 000000000000..19bd60c3a199 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogRecord } from '@kbn/logging'; +import { Conversion } from './types'; + +export const LevelConversion: Conversion = { + pattern: /%level/g, + convert(record: LogRecord) { + const message = record.level.id.toUpperCase().padEnd(5); + return message; + }, +}; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts new file mode 100644 index 000000000000..f7ddb9864611 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { LogRecord } from '@kbn/logging'; +import { Conversion } from './types'; + +export const LoggerConversion: Conversion = { + pattern: /%logger/g, + convert(record: LogRecord) { + const message = record.context; + return message; + }, +}; diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/message.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts similarity index 94% rename from packages/core/logging/core-logging-server-internal/src/layouts/conversions/message.ts rename to packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts index 009eee4d33ea..97fc4c60101c 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/message.ts +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts @@ -7,7 +7,7 @@ */ import { LogRecord } from '@kbn/logging'; -import { Conversion } from './type'; +import { Conversion } from './types'; export const MessageConversion: Conversion = { pattern: /%message/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/meta.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts similarity index 93% rename from packages/core/logging/core-logging-server-internal/src/layouts/conversions/meta.ts rename to packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts index abeb13136f13..49bd79729da5 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/meta.ts +++ b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts @@ -7,7 +7,7 @@ */ import { LogRecord } from '@kbn/logging'; -import { Conversion } from './type'; +import { Conversion } from './types'; export const MetaConversion: Conversion = { pattern: /%meta/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/type.ts b/packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts similarity index 100% rename from packages/core/logging/core-logging-server-internal/src/layouts/conversions/type.ts rename to packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/index.ts b/packages/core/logging/core-logging-common-internal/src/layouts/index.ts new file mode 100644 index 000000000000..0d89459d9de9 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/index.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { PatternLayout } from './pattern_layout'; +export { + DateConversion, + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + type Conversion, +} from './conversions'; diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.test.ts b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.test.ts new file mode 100644 index 000000000000..b810321f8363 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.test.ts @@ -0,0 +1,256 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import stripAnsi from 'strip-ansi'; +import hasAnsi from 'has-ansi'; +import { LogLevel, LogRecord } from '@kbn/logging'; +import { PatternLayout } from './pattern_layout'; + +const stripAnsiSnapshotSerializer: jest.SnapshotSerializerPlugin = { + serialize(value: string) { + return stripAnsi(value); + }, + + test(value: any) { + return typeof value === 'string' && hasAnsi(value); + }, +}; + +const timestamp = new Date(Date.UTC(2012, 1, 1, 14, 30, 22, 11)); +const records: LogRecord[] = [ + { + context: 'context-1', + error: { + message: 'Some error message', + name: 'Some error name', + stack: 'Some error stack', + }, + level: LogLevel.Fatal, + message: 'message-1', + timestamp, + pid: 5355, + }, + { + context: 'context-2', + level: LogLevel.Error, + message: 'message-2', + timestamp, + pid: 5355, + }, + { + context: 'context-3', + level: LogLevel.Warn, + message: 'message-3', + timestamp, + pid: 5355, + }, + { + context: 'context-4', + level: LogLevel.Debug, + message: 'message-4', + timestamp, + pid: 5355, + }, + { + context: 'context-5', + level: LogLevel.Info, + message: 'message-5', + timestamp, + pid: 5355, + }, + { + context: 'context-6', + level: LogLevel.Trace, + message: 'message-6', + timestamp, + pid: 5355, + }, +]; + +expect.addSnapshotSerializer(stripAnsiSnapshotSerializer); + +test('`format()` correctly formats record with full pattern.', () => { + const layout = new PatternLayout(); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with custom pattern.', () => { + const layout = new PatternLayout({ pattern: 'mock-%message-%logger-%message' }); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` correctly formats record with meta data.', () => { + const layout = new PatternLayout({ pattern: '[%date][%level][%logger]%meta %message' }); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: { + // @ts-expect-error not valid ECS field + from: 'v7', + to: 'v8', + }, + }) + ).toBe( + '[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{"from":"v7","to":"v8"} message-meta' + ); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + meta: {}, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta]{} message-meta'); + + expect( + layout.format({ + context: 'context-meta', + level: LogLevel.Debug, + message: 'message-meta', + timestamp, + pid: 5355, + }) + ).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context-meta] message-meta'); +}); + +test('allows specifying the PID in custom pattern', () => { + const layout = new PatternLayout({ pattern: '%pid-%logger-%message' }); + + for (const record of records) { + expect(layout.format(record)).toMatchSnapshot(); + } +}); + +test('`format()` allows specifying pattern with meta.', () => { + const layout = new PatternLayout({ pattern: '%logger-%meta-%message' }); + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + meta: { + from: 'v7', + to: 'v8', + }, + }; + // @ts-expect-error not valid ECS field + expect(layout.format(record)).toBe('context-{"from":"v7","to":"v8"}-message'); +}); + +describe('format', () => { + describe('timestamp', () => { + const record = { + context: 'context', + level: LogLevel.Debug, + message: 'message', + timestamp, + pid: 5355, + }; + it('uses ISO8601_TZ as default', () => { + const layout = new PatternLayout(); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][DEBUG][context] message'); + }); + + describe('supports specifying a predefined format', () => { + it('ISO8601', () => { + const layout = new PatternLayout({ pattern: '[%date{ISO8601}][%logger]' }); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout({ pattern: '[%date{ISO8601_TZ}][%logger]' }); + + expect(layout.format(record)).toBe('[2012-02-01T09:30:22.011-05:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout({ pattern: '[%date{ABSOLUTE}][%logger]' }); + + expect(layout.format(record)).toBe('[09:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout({ pattern: '[%date{UNIX}][%logger]' }); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout({ pattern: '[%date{UNIX_MILLIS}][%logger]' }); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + + describe('supports specifying a predefined format and timezone', () => { + it('ISO8601', () => { + const layout = new PatternLayout({ + pattern: '[%date{ISO8601}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[2012-02-01T14:30:22.011Z][context]'); + }); + + it('ISO8601_TZ', () => { + const layout = new PatternLayout({ + pattern: '[%date{ISO8601_TZ}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[2012-02-01T06:30:22.011-08:00][context]'); + }); + + it('ABSOLUTE', () => { + const layout = new PatternLayout({ + pattern: '[%date{ABSOLUTE}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[06:30:22.011][context]'); + }); + + it('UNIX', () => { + const layout = new PatternLayout({ + pattern: '[%date{UNIX}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[1328106622][context]'); + }); + + it('UNIX_MILLIS', () => { + const layout = new PatternLayout({ + pattern: '[%date{UNIX_MILLIS}{America/Los_Angeles}][%logger]', + }); + + expect(layout.format(record)).toBe('[1328106622011][context]'); + }); + }); + it('formats several conversions patterns correctly', () => { + const layout = new PatternLayout({ + pattern: '[%date{ABSOLUTE}{America/Los_Angeles}][%logger][%date{UNIX}]', + }); + + expect(layout.format(record)).toBe('[06:30:22.011][context][1328106622]'); + }); + }); +}); diff --git a/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.ts b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.ts new file mode 100644 index 000000000000..13a9b35fd41b --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/layouts/pattern_layout.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { LogRecord, Layout } from '@kbn/logging'; +import { + Conversion, + LoggerConversion, + LevelConversion, + MetaConversion, + MessageConversion, + DateConversion, +} from './conversions'; + +/** + * Default pattern used by PatternLayout if it's not overridden in the configuration. + */ +const DEFAULT_PATTERN = `[%date][%level][%logger] %message`; + +const DEFAULT_CONVERSIONS: Conversion[] = [ + LoggerConversion, + MessageConversion, + LevelConversion, + MetaConversion, + DateConversion, +]; + +export interface PatternLayoutOptions { + pattern?: string; + highlight?: boolean; + conversions?: Conversion[]; +} + +/** + * Layout that formats `LogRecord` using the `pattern` string with optional + * color highlighting (eg. to make log messages easier to read in the terminal). + * @internal + */ +export class PatternLayout implements Layout { + private readonly pattern: string; + private readonly highlight: boolean; + private readonly conversions: Conversion[]; + + constructor({ + pattern = DEFAULT_PATTERN, + highlight = false, + conversions = DEFAULT_CONVERSIONS, + }: PatternLayoutOptions = {}) { + this.pattern = pattern; + this.highlight = highlight; + this.conversions = conversions; + } + + /** + * Formats `LogRecord` into a string based on the specified `pattern` and `highlighting` options. + * @param record Instance of `LogRecord` to format into string. + */ + public format(record: LogRecord): string { + let recordString = this.pattern; + for (const conversion of this.conversions) { + recordString = recordString.replace( + conversion.pattern, + conversion.convert.bind(null, record, this.highlight) + ); + } + + return recordString; + } +} diff --git a/packages/core/logging/core-logging-common-internal/src/logger.test.ts b/packages/core/logging/core-logging-common-internal/src/logger.test.ts new file mode 100644 index 000000000000..adf4275a7d6c --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger.test.ts @@ -0,0 +1,241 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Appender, LogLevel, LogMeta, LogRecord } from '@kbn/logging'; +import { getLoggerContext } from '@kbn/core-logging-common-internal'; +import { AbstractLogger, CreateLogRecordFn } from './logger'; + +describe('AbstractLogger', () => { + const context = getLoggerContext(['context', 'parent', 'child']); + const factory = { + get: jest.fn().mockImplementation(() => logger), + }; + + let appenderMocks: Appender[]; + + const createLogRecordSpy: jest.MockedFunction = jest.fn(); + + class TestLogger extends AbstractLogger { + createLogRecord( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta + ) { + return createLogRecordSpy(level, errorOrMessage, meta); + } + } + + let logger: TestLogger; + + beforeEach(() => { + appenderMocks = [{ append: jest.fn() }, { append: jest.fn() }]; + logger = new TestLogger(context, LogLevel.All, appenderMocks, factory); + + createLogRecordSpy.mockImplementation((level, message, meta) => { + return { + level, + message, + meta, + } as LogRecord; + }); + }); + + afterEach(() => { + createLogRecordSpy.mockReset(); + }); + + describe('#trace', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.trace('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Trace, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Trace } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.trace('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#debug', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.debug('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Debug, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Debug } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.debug('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#info', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.info('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Info, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Info } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.info('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#warn', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.warn('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Warn, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Warn } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.warn('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#error', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.error('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Error, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Error } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.error('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#fatal', () => { + it('calls `createLogRecord` with the correct parameters', () => { + const meta = { tags: ['foo', 'bar'] }; + logger.fatal('some message', meta); + + expect(createLogRecordSpy).toHaveBeenCalledTimes(1); + expect(createLogRecordSpy).toHaveBeenCalledWith(LogLevel.Fatal, 'some message', meta); + }); + + it('pass the log record down to all appenders', () => { + const logRecord = { message: 'dummy', level: LogLevel.Fatal } as LogRecord; + createLogRecordSpy.mockReturnValue(logRecord); + logger.fatal('some message'); + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(1); + expect(appenderMock.append).toHaveBeenCalledWith(logRecord); + } + }); + }); + + describe('#get', () => { + it('calls the logger factory with proper context and return the result', () => { + logger.get('sub', 'context'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'sub', 'context'); + + factory.get.mockClear(); + factory.get.mockImplementation(() => 'some-logger'); + + const childLogger = logger.get('other', 'sub'); + expect(factory.get).toHaveBeenCalledTimes(1); + expect(factory.get).toHaveBeenCalledWith(context, 'other', 'sub'); + expect(childLogger).toEqual('some-logger'); + }); + }); + + describe('log level', () => { + it('does not calls appenders for records with unsupported levels', () => { + logger = new TestLogger(context, LogLevel.Warn, appenderMocks, factory); + + logger.trace('some trace message'); + logger.debug('some debug message'); + logger.info('some info message'); + logger.warn('some warn message'); + logger.error('some error message'); + logger.fatal('some fatal message'); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Warn, + }) + ); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Error, + }) + ); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Fatal, + }) + ); + } + }); + }); + + describe('isLevelEnabled', () => { + const orderedLogLevels = [ + LogLevel.Fatal, + LogLevel.Error, + LogLevel.Warn, + LogLevel.Info, + LogLevel.Debug, + LogLevel.Trace, + LogLevel.All, + ]; + + for (const logLevel of orderedLogLevels) { + it(`returns the correct value for a '${logLevel.id}' level logger`, () => { + const levelLogger = new TestLogger(context, logLevel, appenderMocks, factory); + for (const level of orderedLogLevels) { + const levelEnabled = logLevel.supports(level); + expect(levelLogger.isLevelEnabled(level.id)).toEqual(levelEnabled); + } + }); + } + }); +}); diff --git a/packages/core/logging/core-logging-common-internal/src/logger.ts b/packages/core/logging/core-logging-common-internal/src/logger.ts new file mode 100644 index 000000000000..69d00ed57f39 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger.ts @@ -0,0 +1,86 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + Appender, + LogLevel, + LogRecord, + LoggerFactory, + LogMeta, + Logger, + LogLevelId, +} from '@kbn/logging'; + +/** + * @internal + */ +export type CreateLogRecordFn = ( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta +) => LogRecord; + +/** + * A basic, abstract logger implementation that delegates the create of log records to the child's createLogRecord function. + * @internal + */ +export abstract class AbstractLogger implements Logger { + constructor( + protected readonly context: string, + protected readonly level: LogLevel, + protected readonly appenders: Appender[], + protected readonly factory: LoggerFactory + ) {} + + protected abstract createLogRecord( + level: LogLevel, + errorOrMessage: string | Error, + meta?: Meta + ): LogRecord; + + public trace(message: string, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Trace, message, meta)); + } + + public debug(message: string, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Debug, message, meta)); + } + + public info(message: string, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Info, message, meta)); + } + + public warn(errorOrMessage: string | Error, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Warn, errorOrMessage, meta)); + } + + public error(errorOrMessage: string | Error, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Error, errorOrMessage, meta)); + } + + public fatal(errorOrMessage: string | Error, meta?: Meta): void { + this.log(this.createLogRecord(LogLevel.Fatal, errorOrMessage, meta)); + } + + public isLevelEnabled(levelId: LogLevelId): boolean { + return this.level.supports(LogLevel.fromId(levelId)); + } + + public log(record: LogRecord) { + if (!this.level.supports(record.level)) { + return; + } + for (const appender of this.appenders) { + appender.append(record); + } + } + + public get(...childContextPaths: string[]): Logger { + return this.factory.get(...[this.context, ...childContextPaths]); + } +} diff --git a/packages/core/logging/core-logging-common-internal/src/logger_context.test.ts b/packages/core/logging/core-logging-common-internal/src/logger_context.test.ts new file mode 100644 index 000000000000..664b9840fd07 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger_context.test.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getLoggerContext, getParentLoggerContext } from './logger_context'; + +describe('getLoggerContext', () => { + it('returns correct joined context name.', () => { + expect(getLoggerContext(['a', 'b', 'c'])).toEqual('a.b.c'); + expect(getLoggerContext(['a', 'b'])).toEqual('a.b'); + expect(getLoggerContext(['a'])).toEqual('a'); + expect(getLoggerContext([])).toEqual('root'); + }); +}); + +describe('getParentLoggerContext', () => { + it('returns correct parent context name.', () => { + expect(getParentLoggerContext('a.b.c')).toEqual('a.b'); + expect(getParentLoggerContext('a.b')).toEqual('a'); + expect(getParentLoggerContext('a')).toEqual('root'); + }); +}); diff --git a/packages/core/logging/core-logging-common-internal/src/logger_context.ts b/packages/core/logging/core-logging-common-internal/src/logger_context.ts new file mode 100644 index 000000000000..d62a3fd5bea8 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/src/logger_context.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * Separator string that used within nested context name (eg. plugins.pid). + */ +export const CONTEXT_SEPARATOR = '.'; + +/** + * Name of the `root` context that always exists and sits at the top of logger hierarchy. + */ +export const ROOT_CONTEXT_NAME = 'root'; + +/** + * Name of the appender that is always presented and used by `root` logger by default. + */ +export const DEFAULT_APPENDER_NAME = 'default'; + +/** + * Helper method that joins separate string context parts into single context string. + * In case joined context is an empty string, `root` context name is returned. + * @param contextParts List of the context parts (e.g. ['parent', 'child']. + * @returns {string} Joined context string (e.g. 'parent.child'). + */ +export const getLoggerContext = (contextParts: string[]): string => { + return contextParts.join(CONTEXT_SEPARATOR) || ROOT_CONTEXT_NAME; +}; + +/** + * Helper method that returns parent context for the specified one. + * @param context Context to find parent for. + * @returns Name of the parent context or `root` if the context is the top level one. + */ +export const getParentLoggerContext = (context: string): string => { + const lastIndexOfSeparator = context.lastIndexOf(CONTEXT_SEPARATOR); + if (lastIndexOfSeparator === -1) { + return ROOT_CONTEXT_NAME; + } + + return context.slice(0, lastIndexOfSeparator); +}; diff --git a/packages/core/logging/core-logging-common-internal/tsconfig.json b/packages/core/logging/core-logging-common-internal/tsconfig.json new file mode 100644 index 000000000000..25957cd665d1 --- /dev/null +++ b/packages/core/logging/core-logging-common-internal/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [ + "jest", + "node", + ] + }, + "include": [ + "**/*.ts", + ] +} diff --git a/packages/core/logging/core-logging-server-internal/BUILD.bazel b/packages/core/logging/core-logging-server-internal/BUILD.bazel index 6fe13febb2fb..1fc923fb7cae 100644 --- a/packages/core/logging/core-logging-server-internal/BUILD.bazel +++ b/packages/core/logging/core-logging-server-internal/BUILD.bazel @@ -37,10 +37,12 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "@npm//lodash", "@npm//moment-timezone", + "@npm//chalk", "@npm//elastic-apm-node", "//packages/kbn-safer-lodash-set", "//packages/kbn-config-schema", "//packages/kbn-std", + "//packages/core/logging/core-logging-common-internal", ] TYPES_DEPS = [ @@ -50,10 +52,12 @@ TYPES_DEPS = [ "@npm//rxjs", "@npm//@types/moment-timezone", "@npm//elastic-apm-node", + "@npm//chalk", "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-logging:npm_module_types", "//packages/kbn-config-schema:npm_module_types", "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/logging/core-logging-common-internal:npm_module_types", "//packages/core/logging/core-logging-server:npm_module_types", ] diff --git a/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts b/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts index b1fe6943c704..0602ea81289a 100644 --- a/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts +++ b/packages/core/logging/core-logging-server-internal/src/appenders/console/console_appender.ts @@ -7,7 +7,7 @@ */ import { schema } from '@kbn/config-schema'; -import { Layout, LogRecord, DisposableAppender } from '@kbn/logging'; +import type { Layout, LogRecord, DisposableAppender } from '@kbn/logging'; import { Layouts } from '../../layouts/layouts'; const { literal, object } = schema; diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts index 9203fdd02278..dad8fd42c5c0 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/index.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -export type { Conversion } from './type'; - -export { LoggerConversion } from './logger'; -export { LevelConversion } from './level'; -export { MessageConversion } from './message'; -export { MetaConversion } from './meta'; export { PidConversion } from './pid'; -export { DateConversion } from './date'; +export { LevelConversion } from './level'; +export { LoggerConversion } from './logger'; +export { + DateConversion, + MessageConversion, + MetaConversion, +} from '@kbn/core-logging-common-internal'; diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts index 17e45555aa87..38ae927b790a 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/level.ts @@ -8,8 +8,7 @@ import chalk from 'chalk'; import { LogRecord, LogLevel } from '@kbn/logging'; - -import { Conversion } from './type'; +import type { Conversion } from '@kbn/core-logging-common-internal'; const LEVEL_COLORS = new Map([ [LogLevel.Fatal, chalk.red], diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts index 1cb6f06b4e2c..71be5e6d0636 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/logger.ts @@ -8,8 +8,7 @@ import chalk from 'chalk'; import { LogRecord } from '@kbn/logging'; - -import { Conversion } from './type'; +import type { Conversion } from '@kbn/core-logging-common-internal'; export const LoggerConversion: Conversion = { pattern: /%logger/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts index cc43f4e874ad..0d6237554b77 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/conversions/pid.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { LogRecord } from '@kbn/logging'; -import { Conversion } from './type'; +import type { LogRecord } from '@kbn/logging'; +import type { Conversion } from '@kbn/core-logging-common-internal'; export const PidConversion: Conversion = { pattern: /%pid/g, diff --git a/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts b/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts index 8206537ef7de..58ddf5fd684f 100644 --- a/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts +++ b/packages/core/logging/core-logging-server-internal/src/layouts/pattern_layout.ts @@ -7,10 +7,11 @@ */ import { schema } from '@kbn/config-schema'; -import { LogRecord, Layout } from '@kbn/logging'; - import { - Conversion, + PatternLayout as BasePatternLayout, + type Conversion, +} from '@kbn/core-logging-common-internal'; +import { LoggerConversion, LevelConversion, MetaConversion, @@ -19,9 +20,6 @@ import { DateConversion, } from './conversions'; -/** - * Default pattern used by PatternLayout if it's not overridden in the configuration. - */ const DEFAULT_PATTERN = `[%date][%level][%logger] %message`; export const patternSchema = schema.string({ @@ -50,23 +48,14 @@ const conversions: Conversion[] = [ * color highlighting (eg. to make log messages easier to read in the terminal). * @internal */ -export class PatternLayout implements Layout { +export class PatternLayout extends BasePatternLayout { public static configSchema = patternLayoutSchema; - constructor(private readonly pattern = DEFAULT_PATTERN, private readonly highlight = false) {} - - /** - * Formats `LogRecord` into a string based on the specified `pattern` and `highlighting` options. - * @param record Instance of `LogRecord` to format into string. - */ - public format(record: LogRecord): string { - let recordString = this.pattern; - for (const conversion of conversions) { - recordString = recordString.replace( - conversion.pattern, - conversion.convert.bind(null, record, this.highlight) - ); - } - return recordString; + constructor(pattern: string = DEFAULT_PATTERN, highlight: boolean = false) { + super({ + pattern, + highlight, + conversions, + }); } } diff --git a/packages/core/logging/core-logging-server-internal/src/logger.ts b/packages/core/logging/core-logging-server-internal/src/logger.ts index 7a18d9a74eba..23718ca278a2 100644 --- a/packages/core/logging/core-logging-server-internal/src/logger.ts +++ b/packages/core/logging/core-logging-server-internal/src/logger.ts @@ -6,72 +6,16 @@ * Side Public License, v 1. */ import apmAgent from 'elastic-apm-node'; -import { - Appender, - LogLevel, - LogLevelId, - LogRecord, - LoggerFactory, - LogMeta, - Logger, -} from '@kbn/logging'; +import { LogLevel, LogRecord, LogMeta } from '@kbn/logging'; +import { AbstractLogger } from '@kbn/core-logging-common-internal'; function isError(x: any): x is Error { return x instanceof Error; } /** @internal */ -export class BaseLogger implements Logger { - constructor( - private readonly context: string, - private readonly level: LogLevel, - private readonly appenders: Appender[], - private readonly factory: LoggerFactory - ) {} - - public trace(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Trace, message, meta)); - } - - public debug(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Debug, message, meta)); - } - - public info(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Info, message, meta)); - } - - public warn(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Warn, errorOrMessage, meta)); - } - - public error(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Error, errorOrMessage, meta)); - } - - public fatal(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Fatal, errorOrMessage, meta)); - } - - public isLevelEnabled(levelId: LogLevelId): boolean { - return this.level.supports(LogLevel.fromId(levelId)); - } - - public log(record: LogRecord) { - if (!this.level.supports(record.level)) { - return; - } - - for (const appender of this.appenders) { - appender.append(record); - } - } - - public get(...childContextPaths: string[]): Logger { - return this.factory.get(...[this.context, ...childContextPaths]); - } - - private createLogRecord( +export class BaseLogger extends AbstractLogger { + protected createLogRecord( level: LogLevel, errorOrMessage: string | Error, meta?: Meta diff --git a/packages/core/logging/core-logging-server-internal/src/logging_config.ts b/packages/core/logging/core-logging-server-internal/src/logging_config.ts index 4d79c593fb6f..00eb1450f0ab 100644 --- a/packages/core/logging/core-logging-server-internal/src/logging_config.ts +++ b/packages/core/logging/core-logging-server-internal/src/logging_config.ts @@ -7,6 +7,12 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; +import { + ROOT_CONTEXT_NAME, + DEFAULT_APPENDER_NAME, + getLoggerContext, + getParentLoggerContext, +} from '@kbn/core-logging-common-internal'; import type { AppenderConfigType, LoggerConfigType } from '@kbn/core-logging-server'; import { Appenders } from './appenders/appenders'; @@ -14,21 +20,6 @@ import { Appenders } from './appenders/appenders'; // (otherwise it assumes an array of A|B instead of a tuple [A,B]) const toTuple = (a: A, b: B): [A, B] => [a, b]; -/** - * Separator string that used within nested context name (eg. plugins.pid). - */ -const CONTEXT_SEPARATOR = '.'; - -/** - * Name of the `root` context that always exists and sits at the top of logger hierarchy. - */ -const ROOT_CONTEXT_NAME = 'root'; - -/** - * Name of the appender that is always presented and used by `root` logger by default. - */ -const DEFAULT_APPENDER_NAME = 'default'; - const levelSchema = schema.oneOf( [ schema.literal('all'), @@ -109,7 +100,7 @@ export class LoggingConfig { * @returns {string} Joined context string (e.g. 'parent.child'). */ public static getLoggerContext(contextParts: string[]) { - return contextParts.join(CONTEXT_SEPARATOR) || ROOT_CONTEXT_NAME; + return getLoggerContext(contextParts); } /** @@ -118,12 +109,7 @@ export class LoggingConfig { * @returns Name of the parent context or `root` if the context is the top level one. */ public static getParentLoggerContext(context: string) { - const lastIndexOfSeparator = context.lastIndexOf(CONTEXT_SEPARATOR); - if (lastIndexOfSeparator === -1) { - return ROOT_CONTEXT_NAME; - } - - return context.slice(0, lastIndexOfSeparator); + return getParentLoggerContext(context); } /** diff --git a/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.test.ts b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.test.ts new file mode 100644 index 000000000000..1b1bea2279b6 --- /dev/null +++ b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.test.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { DiscoveredPlugin, PluginOpaqueId, PluginType } from '@kbn/core-base-common'; +import { type MockedLogger, loggerMock } from '@kbn/logging-mocks'; +import type { PluginInitializerContext } from '@kbn/core-plugins-browser'; +import { coreContextMock } from '@kbn/core-base-browser-mocks'; +import { createPluginInitializerContext } from './plugin_context'; + +const createPluginManifest = (pluginName: string): DiscoveredPlugin => { + return { + id: pluginName, + configPath: [pluginName], + type: PluginType.standard, + requiredPlugins: [], + optionalPlugins: [], + requiredBundles: [], + }; +}; + +const testPluginId = 'testPluginId'; + +describe('createPluginInitializerContext', () => { + let pluginId: PluginOpaqueId; + let pluginManifest: DiscoveredPlugin; + let pluginConfig: Record; + let coreContext: ReturnType; + let logger: MockedLogger; + let initContext: PluginInitializerContext; + + beforeEach(() => { + pluginId = Symbol(testPluginId); + pluginManifest = createPluginManifest(testPluginId); + pluginConfig = {}; + coreContext = coreContextMock.create(); + logger = coreContext.logger as MockedLogger; + + initContext = createPluginInitializerContext( + coreContext, + pluginId, + pluginManifest, + pluginConfig + ); + }); + + describe('logger.get', () => { + it('calls the underlying logger factory with the correct parameters', () => { + initContext.logger.get('service.sub'); + expect(logger.get).toHaveBeenCalledTimes(1); + expect(logger.get).toHaveBeenCalledWith('plugins', testPluginId, 'service.sub'); + }); + + it('returns the logger from the underlying factory', () => { + const underlyingLogger = loggerMock.create(); + logger.get.mockReturnValue(underlyingLogger); + expect(initContext.logger.get('anything')).toEqual(underlyingLogger); + }); + }); +}); diff --git a/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts index 41643b0e0250..351dd581b5f8 100644 --- a/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts +++ b/packages/core/plugins/core-plugins-browser-internal/src/plugin_context.ts @@ -35,6 +35,11 @@ export function createPluginInitializerContext( return { opaqueId, env: coreContext.env, + logger: { + get(...contextParts) { + return coreContext.logger.get('plugins', pluginManifest.id, ...contextParts); + }, + }, config: { get() { return pluginConfig as unknown as T; diff --git a/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts b/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts index fcd4e80c02de..7c013b17ec4c 100644 --- a/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts +++ b/packages/core/plugins/core-plugins-browser-internal/src/test_helpers/mocks.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { loggerMock } from '@kbn/logging-mocks'; import type { PluginInitializerContext } from '@kbn/core-plugins-browser'; export const createPluginInitializerContextMock = (config: unknown = {}) => { @@ -25,6 +26,7 @@ export const createPluginInitializerContextMock = (config: unknown = {}) => { dist: false, }, }, + logger: loggerMock.create(), config: { get: () => config as T, }, diff --git a/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel b/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel index a6c47b536d2e..dbe94e7ba964 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel +++ b/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel @@ -36,12 +36,14 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ + "//packages/kbn-logging-mocks", ] TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", "//packages/kbn-utility-types:npm_module_types", + "//packages/kbn-logging-mocks:npm_module_types", "//packages/core/plugins/core-plugins-browser-internal:npm_module_types", ] diff --git a/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts b/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts index c1539e787368..75ec4e457068 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts +++ b/packages/core/plugins/core-plugins-browser-mocks/src/plugins_service.mock.ts @@ -7,6 +7,7 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; +import { loggerMock } from '@kbn/logging-mocks'; import type { PluginInitializerContext } from '@kbn/core-plugins-browser'; import type { PluginsService, PluginsServiceSetup } from '@kbn/core-plugins-browser-internal'; @@ -43,6 +44,7 @@ const createPluginInitializerContextMock = (config: unknown = {}) => { dist: false, }, }, + logger: loggerMock.create(), config: { get: () => config as T, }, diff --git a/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts b/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts index 14aaaff31e94..c33abbfc386f 100644 --- a/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts +++ b/packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts @@ -7,6 +7,7 @@ */ import type { PluginOpaqueId } from '@kbn/core-base-common'; +import type { LoggerFactory } from '@kbn/logging'; import type { PackageInfo, EnvironmentMode } from '@kbn/config'; import type { Plugin } from './plugin'; @@ -37,6 +38,7 @@ export interface PluginInitializerContext mode: Readonly; packageInfo: Readonly; }; + readonly logger: LoggerFactory; readonly config: { get: () => T; }; diff --git a/packages/core/root/core-root-browser-internal/BUILD.bazel b/packages/core/root/core-root-browser-internal/BUILD.bazel index a95b5d6d1c40..05f41123181e 100644 --- a/packages/core/root/core-root-browser-internal/BUILD.bazel +++ b/packages/core/root/core-root-browser-internal/BUILD.bazel @@ -44,6 +44,7 @@ RUNTIME_DEPS = [ "//packages/kbn-i18n", "//packages/kbn-ebt-tools", "//packages/core/application/core-application-browser-internal", + "//packages/core/logging/core-logging-browser-internal", "//packages/core/injected-metadata/core-injected-metadata-browser-internal", "//packages/core/doc-links/core-doc-links-browser-internal", "//packages/core/theme/core-theme-browser-internal", @@ -76,6 +77,7 @@ TYPES_DEPS = [ "//packages/core/execution-context/core-execution-context-browser:npm_module_types", "//packages/core/application/core-application-browser-internal:npm_module_types", "//packages/core/base/core-base-browser-internal:npm_module_types", + "//packages/core/logging/core-logging-browser-internal:npm_module_types", "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", "//packages/core/doc-links/core-doc-links-browser-internal:npm_module_types", "//packages/core/theme/core-theme-browser-internal:npm_module_types", diff --git a/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts b/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts index 69560623e163..36cdcb4ae752 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.test.mocks.ts @@ -22,6 +22,7 @@ import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; import { renderingServiceMock } from '@kbn/core-rendering-browser-mocks'; import { integrationsServiceMock } from '@kbn/core-integrations-browser-mocks'; import { coreAppsMock } from '@kbn/core-apps-browser-mocks'; +import { loggingSystemMock } from '@kbn/core-logging-browser-mocks'; export const analyticsServiceStartMock = analyticsServiceMock.createAnalyticsServiceStart(); export const MockAnalyticsService = analyticsServiceMock.create(); @@ -137,3 +138,9 @@ export const ThemeServiceConstructor = jest.fn().mockImplementation(() => MockTh jest.doMock('@kbn/core-theme-browser-internal', () => ({ ThemeService: ThemeServiceConstructor, })); + +export const MockLoggingSystem = loggingSystemMock.create(); +export const LoggingSystemConstructor = jest.fn().mockImplementation(() => MockLoggingSystem); +jest.doMock('@kbn/core-logging-browser-internal', () => ({ + BrowserLoggingSystem: LoggingSystemConstructor, +})); diff --git a/packages/core/root/core-root-browser-internal/src/core_system.test.ts b/packages/core/root/core-root-browser-internal/src/core_system.test.ts index 8e2e980e5ea9..cb9618ce6034 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.test.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.test.ts @@ -38,8 +38,10 @@ import { MockAnalyticsService, analyticsServiceStartMock, fetchOptionalMemoryInfoMock, + MockLoggingSystem, + LoggingSystemConstructor, } from './core_system.test.mocks'; - +import type { EnvironmentMode } from '@kbn/config'; import { CoreSystem } from './core_system'; import { KIBANA_LOADED_EVENT, @@ -136,6 +138,7 @@ describe('constructor', () => { expect(CoreAppConstructor).toHaveBeenCalledTimes(1); expect(ThemeServiceConstructor).toHaveBeenCalledTimes(1); expect(AnalyticsServiceConstructor).toHaveBeenCalledTimes(1); + expect(LoggingSystemConstructor).toHaveBeenCalledTimes(1); }); it('passes injectedMetadata param to InjectedMetadataService', () => { @@ -180,6 +183,47 @@ describe('constructor', () => { stopCoreSystem(); expect(coreSystem.stop).toHaveBeenCalled(); }); + + describe('logging system', () => { + it('instantiate the logging system with the correct level when in dev mode', () => { + const envMode: EnvironmentMode = { + name: 'development', + dev: true, + prod: false, + }; + const injectedMetadata = { env: { mode: envMode } } as any; + + createCoreSystem({ + injectedMetadata, + }); + + expect(LoggingSystemConstructor).toHaveBeenCalledTimes(1); + expect(LoggingSystemConstructor).toHaveBeenCalledWith({ + logLevel: 'all', + }); + }); + it('instantiate the logging system with the correct level when in production mode', () => { + const envMode: EnvironmentMode = { + name: 'production', + dev: false, + prod: true, + }; + const injectedMetadata = { env: { mode: envMode } } as any; + + createCoreSystem({ + injectedMetadata, + }); + + expect(LoggingSystemConstructor).toHaveBeenCalledTimes(1); + expect(LoggingSystemConstructor).toHaveBeenCalledWith({ + logLevel: 'warn', + }); + }); + it('retrieves the logger factory from the logging system', () => { + createCoreSystem({}); + expect(MockLoggingSystem.asLoggerFactory).toHaveBeenCalledTimes(1); + }); + }); }); describe('#setup()', () => { diff --git a/packages/core/root/core-root-browser-internal/src/core_system.ts b/packages/core/root/core-root-browser-internal/src/core_system.ts index b3eae041b785..eb61e0547279 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.ts @@ -7,11 +7,13 @@ */ import { filter, firstValueFrom } from 'rxjs'; +import type { LogLevelId } from '@kbn/logging'; import type { CoreContext } from '@kbn/core-base-browser-internal'; import { InjectedMetadataService, type InjectedMetadataParams, } from '@kbn/core-injected-metadata-browser-internal'; +import { BrowserLoggingSystem } from '@kbn/core-logging-browser-internal'; import { DocLinksService } from '@kbn/core-doc-links-browser-internal'; import { ThemeService } from '@kbn/core-theme-browser-internal'; import type { AnalyticsServiceSetup, AnalyticsServiceStart } from '@kbn/core-analytics-browser'; @@ -78,6 +80,7 @@ interface ExtendedNavigator { * @internal */ export class CoreSystem { + private readonly loggingSystem: BrowserLoggingSystem; private readonly analytics: AnalyticsService; private readonly fatalErrors: FatalErrorsService; private readonly injectedMetadata: InjectedMetadataService; @@ -106,20 +109,24 @@ export class CoreSystem { this.rootDomElement = rootDomElement; - this.i18n = new I18nService(); + const logLevel: LogLevelId = injectedMetadata.env.mode.dev ? 'all' : 'warn'; + this.loggingSystem = new BrowserLoggingSystem({ logLevel }); this.injectedMetadata = new InjectedMetadataService({ injectedMetadata, }); - this.coreContext = { coreId: Symbol('core'), env: injectedMetadata.env }; + this.coreContext = { + coreId: Symbol('core'), + env: injectedMetadata.env, + logger: this.loggingSystem.asLoggerFactory(), + }; + this.i18n = new I18nService(); this.analytics = new AnalyticsService(this.coreContext); - this.fatalErrors = new FatalErrorsService(rootDomElement, () => { // Stop Core before rendering any fatal errors into the DOM this.stop(); }); - this.theme = new ThemeService(); this.notifications = new NotificationsService(); this.http = new HttpService(); @@ -136,7 +143,6 @@ export class CoreSystem { this.integrations = new IntegrationsService(); this.deprecations = new DeprecationsService(); this.executionContext = new ExecutionContextService(); - this.plugins = new PluginsService(this.coreContext, injectedMetadata.uiPlugins); this.coreApp = new CoreAppsService(this.coreContext); diff --git a/src/core/public/mocks.ts b/src/core/public/mocks.ts index 790b8ccf028c..c4f04ec3c331 100644 --- a/src/core/public/mocks.ts +++ b/src/core/public/mocks.ts @@ -32,6 +32,7 @@ export { } from '@kbn/core-saved-objects-browser-mocks'; export { applicationServiceMock, scopedHistoryMock } from '@kbn/core-application-browser-mocks'; export { deprecationsServiceMock } from '@kbn/core-deprecations-browser-mocks'; +export { loggingSystemMock } from '@kbn/core-logging-browser-mocks'; function createStorageMock() { const storageMock: jest.Mocked = { diff --git a/tsconfig.base.json b/tsconfig.base.json index 5c15b00b23d1..1b5fba04354e 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -204,6 +204,12 @@ "@kbn/core-lifecycle-server-internal/*": ["packages/core/lifecycle/core-lifecycle-server-internal/*"], "@kbn/core-lifecycle-server-mocks": ["packages/core/lifecycle/core-lifecycle-server-mocks"], "@kbn/core-lifecycle-server-mocks/*": ["packages/core/lifecycle/core-lifecycle-server-mocks/*"], + "@kbn/core-logging-browser-internal": ["packages/core/logging/core-logging-browser-internal"], + "@kbn/core-logging-browser-internal/*": ["packages/core/logging/core-logging-browser-internal/*"], + "@kbn/core-logging-browser-mocks": ["packages/core/logging/core-logging-browser-mocks"], + "@kbn/core-logging-browser-mocks/*": ["packages/core/logging/core-logging-browser-mocks/*"], + "@kbn/core-logging-common-internal": ["packages/core/logging/core-logging-common-internal"], + "@kbn/core-logging-common-internal/*": ["packages/core/logging/core-logging-common-internal/*"], "@kbn/core-logging-server": ["packages/core/logging/core-logging-server"], "@kbn/core-logging-server/*": ["packages/core/logging/core-logging-server/*"], "@kbn/core-logging-server-internal": ["packages/core/logging/core-logging-server-internal"], diff --git a/yarn.lock b/yarn.lock index c86e92cd6a02..5ce08cea40df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3116,6 +3116,18 @@ version "0.0.0" uid "" +"@kbn/core-logging-browser-internal@link:bazel-bin/packages/core/logging/core-logging-browser-internal": + version "0.0.0" + uid "" + +"@kbn/core-logging-browser-mocks@link:bazel-bin/packages/core/logging/core-logging-browser-mocks": + version "0.0.0" + uid "" + +"@kbn/core-logging-common-internal@link:bazel-bin/packages/core/logging/core-logging-common-internal": + version "0.0.0" + uid "" + "@kbn/core-logging-server-internal@link:bazel-bin/packages/core/logging/core-logging-server-internal": version "0.0.0" uid "" From 7b046316404a85f455ad7f03ded4394d5f69d996 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Tue, 1 Nov 2022 09:18:04 +0100 Subject: [PATCH 46/87] [Files] Make files namespace agnostic (#144019) * make files namespace agnostic * updated files SO hash --- .../saved_objects/migrations/check_registered_types.test.ts | 2 +- src/plugins/files/server/saved_objects/file.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts index 7dce76528a5a..b1aa1e5df923 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts @@ -85,7 +85,7 @@ describe('checking migration metadata changes on all registered SO types', () => "event_loop_delays_daily": "d2ed39cf669577d90921c176499908b4943fb7bd", "exception-list": "fe8cc004fd2742177cdb9300f4a67689463faf9c", "exception-list-agnostic": "49fae8fcd1967cc4be45ba2a2c66c4afbc1e341b", - "file": "280f28bd48b3ad1f1a9f84c6c0ae6dd5ed1179da", + "file": "70c2a768473057157f6ee5d29a436e5288d22ff4", "file-upload-usage-collection-telemetry": "8478924cf0057bd90df737155b364f98d05420a5", "fileShare": "3f88784b041bb8728a7f40763a08981828799a75", "fleet-fleet-server-host": "f00ca963f1bee868806319789cdc33f1f53a97e2", diff --git a/src/plugins/files/server/saved_objects/file.ts b/src/plugins/files/server/saved_objects/file.ts index af8f7ef9ef08..54d7fb57a3a0 100644 --- a/src/plugins/files/server/saved_objects/file.ts +++ b/src/plugins/files/server/saved_objects/file.ts @@ -48,7 +48,7 @@ const properties: Properties = { export const fileObjectType: SavedObjectsType = { name: FILE_SO_TYPE, hidden: true, - namespaceType: 'multiple-isolated', + namespaceType: 'agnostic', management: { importableAndExportable: false, }, From f8efa76e6e7b9a75e366cb5b5ebefb7bacd8e086 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Tue, 1 Nov 2022 09:22:34 +0100 Subject: [PATCH 47/87] [packages/kbn-journeys] start apm after browser start and stop after browser is closed (#144267) --- packages/kbn-journeys/journey/journey_ftr_harness.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/kbn-journeys/journey/journey_ftr_harness.ts b/packages/kbn-journeys/journey/journey_ftr_harness.ts index c8e876ce2873..7b9d8cc0266f 100644 --- a/packages/kbn-journeys/journey/journey_ftr_harness.ts +++ b/packages/kbn-journeys/journey/journey_ftr_harness.ts @@ -118,7 +118,6 @@ export class JourneyFtrHarness { private async onSetup() { await Promise.all([ - this.setupApm(), this.setupBrowserAndPage(), asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { await this.esArchiver.load(esArchive); @@ -127,6 +126,10 @@ export class JourneyFtrHarness { await this.kibanaServer.importExport.load(kbnArchive); }), ]); + + // It is important that we start the APM transaction after we open the browser and all the test data is loaded + // so that the scalability data extractor can focus on just the APM data produced by Kibana running under test. + await this.setupApm(); } private async tearDownBrowserAndPage() { @@ -181,9 +184,12 @@ export class JourneyFtrHarness { } private async onTeardown() { + await this.tearDownBrowserAndPage(); + // It is important that we complete the APM transaction after we close the browser and before we start + // unloading the test data so that the scalability data extractor can focus on just the APM data produced + // by Kibana running under test. + await this.teardownApm(); await Promise.all([ - this.tearDownBrowserAndPage(), - this.teardownApm(), asyncForEach(this.journeyConfig.getEsArchives(), async (esArchive) => { await this.esArchiver.unload(esArchive); }), From 74829e527f162c65c9f7b58de6274b464bcfc0c7 Mon Sep 17 00:00:00 2001 From: Yaroslav Kuznietsov Date: Tue, 1 Nov 2022 10:26:32 +0200 Subject: [PATCH 48/87] [Lens] Datatable expression types improvement. (#144173) * Fixed way of expression building at Lens datatable. * CollapseFn type safety added. * Removed duplicated export. * Small refactoring * Added datatableColumnFn expression. * Added type safety for datatable fn. * Update x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx Co-authored-by: Andrew Tate Co-authored-by: Andrew Tate --- .../lens/common/expressions/collapse/index.ts | 2 + .../expressions/datatable/datatable_column.ts | 7 +- .../common/expressions/datatable/index.ts | 2 +- .../datatable/visualization.test.tsx | 16 +- .../datatable/visualization.tsx | 188 ++++++++---------- 5 files changed, 99 insertions(+), 116 deletions(-) diff --git a/x-pack/plugins/lens/common/expressions/collapse/index.ts b/x-pack/plugins/lens/common/expressions/collapse/index.ts index 43874859411f..2b1e89af08bd 100644 --- a/x-pack/plugins/lens/common/expressions/collapse/index.ts +++ b/x-pack/plugins/lens/common/expressions/collapse/index.ts @@ -16,6 +16,8 @@ export interface CollapseArgs { fn: CollapseFunction[]; } +export type { CollapseExpressionFunction }; + /** * Collapses multiple rows into a single row using the specified function. * diff --git a/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts b/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts index f955cc1dfa2c..16e76d3baf2e 100644 --- a/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts +++ b/x-pack/plugins/lens/common/expressions/datatable/datatable_column.ts @@ -48,13 +48,14 @@ export interface ColumnState { } export type DatatableColumnResult = ColumnState & { type: 'lens_datatable_column' }; - -export const datatableColumn: ExpressionFunctionDefinition< +export type DatatableColumnFunction = ExpressionFunctionDefinition< 'lens_datatable_column', null, ColumnState & { sortingHint?: SortingHint }, DatatableColumnResult -> = { +>; + +export const datatableColumn: DatatableColumnFunction = { name: 'lens_datatable_column', aliases: [], type: 'lens_datatable_column', diff --git a/x-pack/plugins/lens/common/expressions/datatable/index.ts b/x-pack/plugins/lens/common/expressions/datatable/index.ts index 2fa031236029..7003fd8d486b 100644 --- a/x-pack/plugins/lens/common/expressions/datatable/index.ts +++ b/x-pack/plugins/lens/common/expressions/datatable/index.ts @@ -8,4 +8,4 @@ export * from './datatable_column'; export * from './datatable'; -export type { DatatableProps } from './types'; +export type { DatatableProps, DatatableExpressionFunction } from './types'; diff --git a/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx b/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx index e6683aee1349..a38d669d73cd 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx @@ -550,22 +550,16 @@ describe('Datatable Visualization', () => { expect(columnArgs[0].arguments).toEqual( expect.objectContaining({ columnId: ['c'], - hidden: [], - width: [], - isTransposed: [], + palette: [expect.any(Object)], transposable: [true], - alignment: [], colorMode: ['none'], }) ); expect(columnArgs[1].arguments).toEqual( expect.objectContaining({ columnId: ['b'], - hidden: [], - width: [], - isTransposed: [], + palette: [expect.objectContaining({})], transposable: [true], - alignment: [], colorMode: ['none'], }) ); @@ -592,14 +586,16 @@ describe('Datatable Visualization', () => { }); it('sets pagination based on state', () => { - expect(getDatatableExpressionArgs({ ...defaultExpressionTableState }).pageSize).toEqual([]); + expect(getDatatableExpressionArgs({ ...defaultExpressionTableState }).pageSize).toEqual( + undefined + ); expect( getDatatableExpressionArgs({ ...defaultExpressionTableState, paging: { size: 20, enabled: false }, }).pageSize - ).toEqual([]); + ).toEqual(undefined); expect( getDatatableExpressionArgs({ diff --git a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx index 60de4d4d1148..ccfaff17a8ec 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { render } from 'react-dom'; -import { Ast, AstFunction } from '@kbn/interpreter'; +import { Ast } from '@kbn/interpreter'; import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { PaletteRegistry, CUSTOM_PALETTE } from '@kbn/coloring'; @@ -16,6 +16,7 @@ import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { IconChartDatatable } from '@kbn/chart-icons'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; +import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; import type { FormBasedPersistedState } from '../../datasources/form_based/types'; import type { SuggestionRequest, @@ -28,7 +29,14 @@ import { TableDimensionEditor } from './components/dimension_editor'; import { TableDimensionEditorAdditionalSection } from './components/dimension_editor_addtional_section'; import type { LayerType } from '../../../common'; import { getDefaultSummaryLabel } from '../../../common/expressions/datatable/summary'; -import type { ColumnState, SortingState, PagingState } from '../../../common/expressions'; +import type { + ColumnState, + SortingState, + PagingState, + CollapseExpressionFunction, + DatatableColumnFunction, + DatatableExpressionFunction, +} from '../../../common/expressions'; import { DataTableToolbar } from './components/toolbar'; export interface DatatableVisualizationState { @@ -398,108 +406,84 @@ export const getDatatableVisualization = ({ const datasourceExpression = datasourceExpressionsByLayers[state.layerId]; + const lensCollapseFnAsts = columns + .filter((c) => c.collapseFn) + .map((c) => + buildExpressionFunction('lens_collapse', { + by: columns + .filter( + (col) => + col.columnId !== c.columnId && + datasource!.getOperationForColumnId(col.columnId)?.isBucketed + ) + .map((col) => col.columnId), + metric: columns + .filter((col) => !datasource!.getOperationForColumnId(col.columnId)?.isBucketed) + .map((col) => col.columnId), + fn: [c.collapseFn!], + }).toAst() + ); + + const datatableFnAst = buildExpressionFunction('lens_datatable', { + title: title || '', + description: description || '', + columns: columns + .filter((c) => !c.collapseFn) + .map((column) => { + const paletteParams = { + ...column.palette?.params, + // rewrite colors and stops as two distinct arguments + colors: (column.palette?.params?.stops || []).map(({ color }) => color), + stops: + column.palette?.params?.name === 'custom' + ? (column.palette?.params?.stops || []).map(({ stop }) => stop) + : [], + reverse: false, // managed at UI level + }; + const sortingHint = datasource!.getOperationForColumnId(column.columnId)!.sortingHint; + + const hasNoSummaryRow = column.summaryRow == null || column.summaryRow === 'none'; + + const canColor = + datasource!.getOperationForColumnId(column.columnId)?.dataType === 'number'; + + const datatableColumnFn = buildExpressionFunction( + 'lens_datatable_column', + { + columnId: column.columnId, + hidden: column.hidden, + oneClickFilter: column.oneClickFilter, + width: column.width, + isTransposed: column.isTransposed, + transposable: !datasource!.getOperationForColumnId(column.columnId)?.isBucketed, + alignment: column.alignment, + colorMode: canColor && column.colorMode ? column.colorMode : 'none', + palette: paletteService.get(CUSTOM_PALETTE).toExpression(paletteParams), + summaryRow: hasNoSummaryRow ? undefined : column.summaryRow!, + summaryLabel: hasNoSummaryRow + ? undefined + : column.summaryLabel ?? getDefaultSummaryLabel(column.summaryRow!), + sortingHint, + } + ); + return buildExpression([datatableColumnFn]).toAst(); + }), + sortingColumnId: state.sorting?.columnId || '', + sortingDirection: state.sorting?.direction || 'none', + fitRowToContent: state.rowHeight === 'auto', + headerRowHeight: state.headerRowHeight ?? 'single', + rowHeightLines: + !state.rowHeight || state.rowHeight === 'single' ? 1 : state.rowHeightLines ?? 2, + headerRowHeightLines: + !state.headerRowHeight || state.headerRowHeight === 'single' + ? 1 + : state.headerRowHeightLines ?? 2, + pageSize: state.paging?.enabled ? state.paging.size : undefined, + }).toAst(); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - ...columns - .filter((c) => c.collapseFn) - .map((c) => { - return { - type: 'function', - function: 'lens_collapse', - arguments: { - by: columns - .filter( - (col) => - col.columnId !== c.columnId && - datasource!.getOperationForColumnId(col.columnId)?.isBucketed - ) - .map((col) => col.columnId), - metric: columns - .filter((col) => !datasource!.getOperationForColumnId(col.columnId)?.isBucketed) - .map((col) => col.columnId), - fn: [c.collapseFn!], - }, - } as AstFunction; - }), - { - type: 'function', - function: 'lens_datatable', - arguments: { - title: [title || ''], - description: [description || ''], - columns: columns - .filter((c) => !c.collapseFn) - .map((column) => { - const paletteParams = { - ...column.palette?.params, - // rewrite colors and stops as two distinct arguments - colors: (column.palette?.params?.stops || []).map(({ color }) => color), - stops: - column.palette?.params?.name === 'custom' - ? (column.palette?.params?.stops || []).map(({ stop }) => stop) - : [], - reverse: false, // managed at UI level - }; - const sortingHint = datasource!.getOperationForColumnId( - column.columnId - )!.sortingHint; - - const hasNoSummaryRow = column.summaryRow == null || column.summaryRow === 'none'; - - const canColor = - datasource!.getOperationForColumnId(column.columnId)?.dataType === 'number'; - - return { - type: 'expression', - chain: [ - { - type: 'function', - function: 'lens_datatable_column', - arguments: { - columnId: [column.columnId], - hidden: typeof column.hidden === 'undefined' ? [] : [column.hidden], - oneClickFilter: - typeof column.oneClickFilter === 'undefined' - ? [] - : [column.oneClickFilter], - width: typeof column.width === 'undefined' ? [] : [column.width], - isTransposed: - typeof column.isTransposed === 'undefined' ? [] : [column.isTransposed], - transposable: [ - !datasource!.getOperationForColumnId(column.columnId)?.isBucketed, - ], - alignment: - typeof column.alignment === 'undefined' ? [] : [column.alignment], - colorMode: [canColor && column.colorMode ? column.colorMode : 'none'], - palette: [paletteService.get(CUSTOM_PALETTE).toExpression(paletteParams)], - summaryRow: hasNoSummaryRow ? [] : [column.summaryRow!], - summaryLabel: hasNoSummaryRow - ? [] - : [column.summaryLabel ?? getDefaultSummaryLabel(column.summaryRow!)], - sortingHint: sortingHint ? [sortingHint] : [], - }, - }, - ], - }; - }), - sortingColumnId: [state.sorting?.columnId || ''], - sortingDirection: [state.sorting?.direction || 'none'], - fitRowToContent: [state.rowHeight === 'auto'], - headerRowHeight: [state.headerRowHeight ?? 'single'], - rowHeightLines: [ - !state.rowHeight || state.rowHeight === 'single' ? 1 : state.rowHeightLines ?? 2, - ], - headerRowHeightLines: [ - !state.headerRowHeight || state.headerRowHeight === 'single' - ? 1 - : state.headerRowHeightLines ?? 2, - ], - pageSize: state.paging?.enabled ? [state.paging.size] : [], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), ...lensCollapseFnAsts, datatableFnAst], }; }, From 80310d8d78ae9bdf6269298e8bd3055290b94e80 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 1 Nov 2022 10:01:29 +0100 Subject: [PATCH 49/87] [Synthetics] Step details page screenshot (#143452) Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../common/runtime_types/ping/ping.ts | 3 +- .../e2e/page_objects/synthetics_app.tsx | 2 +- .../browser_steps_list.tsx | 2 +- .../monitor_test_result/empty_thumbnail.tsx | 2 +- .../journey_step_image_popover.tsx | 33 ++++-- .../journey_step_screenshot_with_label.tsx | 2 +- .../common/screenshot/empty_image.tsx | 102 ++++++++++++++++++ .../common/screenshot/journey_screenshot.tsx | 39 +++++++ ...journey_step_screenshot_container.test.tsx | 2 +- .../journey_step_screenshot_container.tsx | 16 ++- .../monitor_details_portal.tsx | 8 +- .../hooks/use_journey_steps.tsx | 27 ++++- .../monitor_summary/test_runs_table.tsx | 39 +------ .../screenshot/last_successful_screenshot.tsx | 47 ++++++++ .../components/step_image.tsx | 90 ++++++++++++++++ .../hooks/use_step_detail_page.ts | 68 ++++++++++++ .../hooks/use_step_details_breadcrumbs.ts | 28 +++++ .../step_details_page/step_detail_page.tsx | 94 ++++++++++++++++ .../step_details_page/step_title.tsx | 26 +++++ .../contexts/synthetics_theme_context.tsx | 4 +- .../public/apps/synthetics/routes.tsx | 21 ++++ .../synthetics/utils/testing/rtl_helpers.tsx | 1 + .../components/monitor/monitor_title.test.tsx | 2 + .../monitor/ping_list/ping_list.test.tsx | 4 + .../monitor_status.bar.test.tsx | 1 + .../columns/monitor_status_column.test.tsx | 9 ++ .../monitor_list_drawer.test.tsx.snap | 5 + .../monitor_status_list.test.tsx | 6 ++ .../state/reducers/monitor_status.test.ts | 2 + .../requests/get_monitor_availability.test.ts | 7 ++ 30 files changed, 632 insertions(+), 60 deletions(-) create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_image.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot.tsx rename x-pack/plugins/synthetics/public/apps/synthetics/components/common/{monitor_test_result => screenshot}/journey_step_screenshot_container.test.tsx (98%) rename x-pack/plugins/synthetics/public/apps/synthetics/components/common/{monitor_test_result => screenshot}/journey_step_screenshot_container.tsx (89%) create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/last_successful_screenshot.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/step_image.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx diff --git a/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts b/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts index dc8ab97c5f18..598a62265f1c 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/ping/ping.ts @@ -94,12 +94,12 @@ export const MonitorType = t.intersection([ id: t.string, status: t.string, type: t.string, + check_group: t.string, }), t.partial({ duration: t.type({ us: t.number, }), - check_group: t.string, ip: t.string, name: t.string, timespan: t.type({ @@ -268,6 +268,7 @@ export const makePing = (f: { status: f.status || 'up', duration: { us: f.duration || 100000 }, name: f.name, + check_group: 'myCheckGroup', }, ...(f.location ? { observer: { geo: { name: f.location } } } : {}), ...(f.url ? { url: { full: f.url } } : {}), diff --git a/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx b/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx index fc365abd823b..66d086fcea9d 100644 --- a/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx +++ b/x-pack/plugins/synthetics/e2e/page_objects/synthetics_app.tsx @@ -82,7 +82,7 @@ export function syntheticsAppPageProvider({ page, kibanaUrl }: { page: Page; kib async navigateToEditMonitor() { await this.clickByTestSubj('syntheticsMonitorListActions'); - await page.click('text=Edit'); + await page.click('text=Edit', { timeout: 2 * 60 * 1000 }); await this.findByText('Edit monitor'); }, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx index 81ecb7dc6002..ebc6cc265dfa 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx @@ -103,7 +103,7 @@ export const BrowserStepsList = ({ steps, error, loading, showStepNumber = false aria-label={VIEW_DETAILS} title={VIEW_DETAILS} size="s" - href={`${basePath}/app/uptime/journey/${item.monitor.check_group}/step/${item.synthetics?.step?.index}`} + href={`${basePath}/app/synthetics/journey/${item.monitor.check_group}/step/${item.synthetics?.step?.index}`} target="_self" iconType="apmTrace" /> diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx index bfc5851ade61..38ab5c66acba 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/empty_thumbnail.tsx @@ -15,7 +15,7 @@ export const THUMBNAIL_HEIGHT = 64; export const thumbnailStyle = css` padding: 0; - margin: 0; + margin: auto; width: ${THUMBNAIL_WIDTH}px; height: ${THUMBNAIL_HEIGHT}px; object-fit: contain; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx index 48ff7237223f..dda8c5343eb0 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_image_popover.tsx @@ -9,10 +9,13 @@ import React from 'react'; import { css } from '@emotion/react'; import { EuiImage, EuiPopover, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useRouteMatch } from 'react-router-dom'; +import { EmptyImage } from '../screenshot/empty_image'; import { ScreenshotRefImageData } from '../../../../../../common/runtime_types'; import { useCompositeImage } from '../../../hooks/use_composite_image'; import { EmptyThumbnail, thumbnailStyle } from './empty_thumbnail'; +import { STEP_DETAIL_ROUTE } from '../../../../../../common/constants'; const POPOVER_IMG_HEIGHT = 360; const POPOVER_IMG_WIDTH = 640; @@ -22,6 +25,7 @@ interface ScreenshotImageProps { imageCaption: JSX.Element; isStepFailed: boolean; isLoading: boolean; + asThumbnail?: boolean; } const ScreenshotThumbnail: React.FC = ({ @@ -30,6 +34,7 @@ const ScreenshotThumbnail: React.FC { return imageData ? ( - ) : ( + ) : asThumbnail ? ( + ) : ( + ); }; /** @@ -64,6 +71,7 @@ const RecomposedScreenshotImage: React.FC< setImageData, isStepFailed, isLoading, + asThumbnail, }) => { // initially an undefined URL value is passed to the image display, and a loading spinner is rendered. // `useCompositeImage` will call `setImageData` when the image is composited, and the updated `imageData` will display. @@ -76,6 +84,7 @@ const RecomposedScreenshotImage: React.FC< imageData={imageData} isStepFailed={isStepFailed} isLoading={isLoading} + asThumbnail={asThumbnail} /> ); }; @@ -88,6 +97,7 @@ export interface StepImagePopoverProps { isImagePopoverOpen: boolean; isStepFailed: boolean; isLoading: boolean; + asThumbnail?: boolean; } const JourneyStepImage: React.FC< @@ -104,6 +114,7 @@ const JourneyStepImage: React.FC< setImageData, isStepFailed, isLoading, + asThumbnail = true, }) => { if (imgSrc) { return ( @@ -113,6 +124,7 @@ const JourneyStepImage: React.FC< imageData={imageData} isStepFailed={isStepFailed} isLoading={isLoading} + asThumbnail={asThumbnail} /> ); } else if (imgRef) { @@ -125,6 +137,7 @@ const JourneyStepImage: React.FC< setImageData={setImageData} isStepFailed={isStepFailed} isLoading={isLoading} + asThumbnail={asThumbnail} /> ); } @@ -139,6 +152,7 @@ export const JourneyStepImagePopover: React.FC = ({ isImagePopoverOpen, isStepFailed, isLoading, + asThumbnail = true, }) => { const { euiTheme } = useEuiTheme(); @@ -158,12 +172,16 @@ export const JourneyStepImagePopover: React.FC = ({ const isImageLoading = isLoading || (!!imgRef && !imageData); + const isStepDetailPage = useRouteMatch(STEP_DETAIL_ROUTE)?.isExact; + + const thumbnailS = isStepDetailPage ? null : thumbnailStyle; + return ( = ({ imageData={imageData} isStepFailed={isStepFailed} isLoading={isImageLoading} + asThumbnail={asThumbnail} /> } isOpen={isImagePopoverOpen} @@ -195,12 +214,10 @@ export const JourneyStepImagePopover: React.FC = ({ object-fit: contain; `} /> + ) : asThumbnail ? ( + ) : ( - + )} ); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx index 12dcd4db95f0..f153aa07f2f4 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_with_label.tsx @@ -8,7 +8,7 @@ import React, { CSSProperties } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiText, useEuiTheme } from '@elastic/eui'; import { JourneyStep } from '../../../../../../common/runtime_types'; -import { JourneyStepScreenshotContainer } from './journey_step_screenshot_container'; +import { JourneyStepScreenshotContainer } from '../screenshot/journey_step_screenshot_container'; import { getTextColorForMonitorStatus, parseBadgeStatus } from './status_badge'; interface Props { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_image.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_image.tsx new file mode 100644 index 000000000000..57295b3e1daf --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_image.tsx @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { + useEuiTheme, + useEuiBackgroundColor, + EuiIcon, + EuiLoadingContent, + EuiText, +} from '@elastic/eui'; + +export const IMAGE_WIDTH = 360; +export const IMAGE_HEIGHT = 203; + +export const imageStyle = css` + padding: 0; + margin: auto; + width: ${IMAGE_WIDTH}px; + height: ${IMAGE_HEIGHT}px; + object-fit: contain; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; +`; + +export const EmptyImage = ({ + isLoading = false, + width = IMAGE_WIDTH, + height = IMAGE_HEIGHT, +}: { + isLoading: boolean; + width?: number; + height?: number; +}) => { + const { euiTheme } = useEuiTheme(); + + return ( +
+ {isLoading ? ( + + ) : ( +
+ + {IMAGE_UN_AVAILABLE} +
+ )} +
+ ); +}; + +export const SCREENSHOT_LOADING_ARIA_LABEL = i18n.translate( + 'xpack.synthetics.monitor.step.screenshot.ariaLabel', + { + defaultMessage: 'Step screenshot is being loaded.', + } +); + +export const SCREENSHOT_NOT_AVAILABLE = i18n.translate( + 'xpack.synthetics.monitor.step.screenshot.notAvailable', + { + defaultMessage: 'Step screenshot is not available.', + } +); + +export const IMAGE_UN_AVAILABLE = i18n.translate( + 'xpack.synthetics.monitor.step.screenshot.unAvailable', + { + defaultMessage: 'Image unavailable', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot.tsx new file mode 100644 index 000000000000..9199c3f7db7e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot.tsx @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { useJourneySteps } from '../../monitor_details/hooks/use_journey_steps'; +import { parseBadgeStatus } from '../monitor_test_result/status_badge'; +import { JourneyStepScreenshotContainer } from './journey_step_screenshot_container'; + +export const JourneyScreenshot = ({ checkGroupId }: { checkGroupId: string }) => { + const { loading: stepsLoading, stepEnds } = useJourneySteps(checkGroupId); + const stepLabels = stepEnds.map((stepEnd) => stepEnd?.synthetics?.step?.name ?? ''); + + const lastSignificantStep = useMemo(() => { + const copy = [...stepEnds]; + // Sort desc by timestamp + copy.sort( + (stepA, stepB) => + Number(new Date(stepB['@timestamp'])) - Number(new Date(stepA['@timestamp'])) + ); + return copy.find( + (stepEnd) => parseBadgeStatus(stepEnd?.synthetics?.step?.status ?? 'skipped') !== 'skipped' + ); + }, [stepEnds]); + + return ( + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.test.tsx rename to x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx index 4c95fade23d1..61219b57ae86 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.test.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx @@ -14,7 +14,7 @@ import * as observabilityPublic from '@kbn/observability-plugin/public'; import { getShortTimeStamp } from '../../../utils/monitor_test_result/timestamp'; import '../../../utils/testing/__mocks__/use_composite_image.mock'; import { mockRef } from '../../../utils/testing/__mocks__/screenshot_ref.mock'; -import * as retrieveHooks from './use_retrieve_step_image'; +import * as retrieveHooks from '../monitor_test_result/use_retrieve_step_image'; jest.mock('@kbn/observability-plugin/public'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx similarity index 89% rename from x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.tsx rename to x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx index 6c2653f7efaa..24045d5ac458 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_step_screenshot_container.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx @@ -10,6 +10,7 @@ import { css } from '@emotion/react'; import useIntersection from 'react-use/lib/useIntersection'; import { i18n } from '@kbn/i18n'; +import { EmptyImage } from './empty_image'; import { isScreenshotImageBlob, isScreenshotRef, @@ -18,10 +19,10 @@ import { import { SyntheticsSettingsContext } from '../../../contexts'; -import { useRetrieveStepImage } from './use_retrieve_step_image'; -import { ScreenshotOverlayFooter } from './screenshot_overlay_footer'; -import { JourneyStepImagePopover } from './journey_step_image_popover'; -import { EmptyThumbnail } from './empty_thumbnail'; +import { useRetrieveStepImage } from '../monitor_test_result/use_retrieve_step_image'; +import { ScreenshotOverlayFooter } from '../monitor_test_result/screenshot_overlay_footer'; +import { JourneyStepImagePopover } from '../monitor_test_result/journey_step_image_popover'; +import { EmptyThumbnail } from '../monitor_test_result/empty_thumbnail'; interface Props { checkGroup?: string; @@ -29,6 +30,7 @@ interface Props { stepStatus?: string; initialStepNo?: number; allStepsLoaded?: boolean; + asThumbnail?: boolean; retryFetchOnRevisit?: boolean; // Set to `true` fro "Run Once" / "Test Now" modes } @@ -39,6 +41,7 @@ export const JourneyStepScreenshotContainer = ({ allStepsLoaded, initialStepNo = 1, retryFetchOnRevisit = false, + asThumbnail = true, }: Props) => { const [stepNumber, setStepNumber] = useState(initialStepNo); const [isImagePopoverOpen, setIsImagePopoverOpen] = useState(false); @@ -135,9 +138,12 @@ export const JourneyStepScreenshotContainer = ({ isImagePopoverOpen={isImagePopoverOpen} isStepFailed={stepStatus === 'failed'} isLoading={Boolean(loading)} + asThumbnail={asThumbnail} /> - ) : ( + ) : asThumbnail ? ( + ) : ( + )} ); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx index 950d43917300..10de9f5a4c62 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; -import { EuiButtonEmpty } from '@elastic/eui'; +import { EuiLink, EuiIcon } from '@elastic/eui'; import { InPortal } from 'react-reverse-portal'; import { MonitorDetailsLinkPortalNode } from './portals'; @@ -25,8 +25,8 @@ export const MonitorDetailsLink = ({ name, id }: { name: string; id: string }) = pathname: `monitor/${id}`, }); return ( - - {name} - + + {name} + ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx index a6d2070d0e96..13f3d2459470 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx @@ -6,10 +6,14 @@ */ import { useFetcher } from '@kbn/observability-plugin/public'; -import { SyntheticsJourneyApiResponse } from '../../../../../../common/runtime_types'; +import { useParams } from 'react-router-dom'; +import { isStepEnd } from '../../common/monitor_test_result/browser_steps_list'; +import { JourneyStep, SyntheticsJourneyApiResponse } from '../../../../../../common/runtime_types'; import { fetchJourneySteps } from '../../../state'; export const useJourneySteps = (checkGroup: string | undefined) => { + const { stepIndex } = useParams<{ stepIndex: string }>(); + const { data, loading } = useFetcher(() => { if (!checkGroup) { return Promise.resolve(null); @@ -18,5 +22,24 @@ export const useJourneySteps = (checkGroup: string | undefined) => { return fetchJourneySteps({ checkGroup }); }, [checkGroup]); - return { data: data as SyntheticsJourneyApiResponse, loading: loading ?? false }; + const isFailed = + data?.steps.some( + (step) => + step.synthetics?.step?.status === 'failed' || step.synthetics?.step?.status === 'skipped' + ) ?? false; + + const stepEnds: JourneyStep[] = (data?.steps ?? []).filter(isStepEnd); + + const stepLabels = stepEnds.map((stepEnd) => stepEnd?.synthetics?.step?.name ?? ''); + + return { + data: data as SyntheticsJourneyApiResponse, + loading: loading ?? false, + isFailed, + stepEnds, + stepLabels, + currentStep: stepIndex + ? data?.steps.find((step) => step.synthetics?.step?.index === Number(stepIndex)) + : undefined, + }; }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx index 00ef508ed0d2..891d1694de4b 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx @@ -23,7 +23,7 @@ import { import { Criteria } from '@elastic/eui/src/components/basic_table/basic_table'; import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; -import { ConfigKey, DataStream, JourneyStep, Ping } from '../../../../../../common/runtime_types'; +import { ConfigKey, DataStream, Ping } from '../../../../../../common/runtime_types'; import { formatTestDuration, formatTestRunAt, @@ -33,13 +33,11 @@ import { useSyntheticsSettingsContext } from '../../../contexts/synthetics_setti import { sortPings } from '../../../utils/monitor_test_result/sort_pings'; import { selectPingsError } from '../../../state'; import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/status_badge'; -import { isStepEnd } from '../../common/monitor_test_result/browser_steps_list'; -import { JourneyStepScreenshotContainer } from '../../common/monitor_test_result/journey_step_screenshot_container'; import { useKibanaDateFormat } from '../../../../../hooks/use_kibana_date_format'; import { useSelectedMonitor } from '../hooks/use_selected_monitor'; import { useMonitorPings } from '../hooks/use_monitor_pings'; -import { useJourneySteps } from '../hooks/use_journey_steps'; +import { JourneyScreenshot } from '../../common/screenshot/journey_screenshot'; type SortableField = 'timestamp' | 'monitor.status' | 'monitor.duration.us'; @@ -98,7 +96,9 @@ export const TestRunsTable = ({ paginable = true, from, to }: TestRunsTableProps align: 'left', field: 'timestamp', name: SCREENSHOT_LABEL, - render: (_timestamp: string, item) => , + render: (_timestamp: string, item) => ( + + ), }, ] : []) as Array>), @@ -197,35 +197,6 @@ export const TestRunsTable = ({ paginable = true, from, to }: TestRunsTableProps ); }; -const JourneyScreenshot = ({ ping }: { ping: Ping }) => { - const { data: stepsData, loading: stepsLoading } = useJourneySteps(ping?.monitor?.check_group); - const stepEnds: JourneyStep[] = (stepsData?.steps ?? []).filter(isStepEnd); - const stepLabels = stepEnds.map((stepEnd) => stepEnd?.synthetics?.step?.name ?? ''); - - const lastSignificantStep = useMemo(() => { - const copy = [...stepEnds]; - // Sort desc by timestamp - copy.sort( - (stepA, stepB) => - Number(new Date(stepB['@timestamp'])) - Number(new Date(stepA['@timestamp'])) - ); - return copy.find( - (stepEnd) => parseBadgeStatus(stepEnd?.synthetics?.step?.status ?? 'skipped') !== 'skipped' - ); - }, [stepEnds]); - - return ( - - ); -}; - const TestDetailsLink = ({ isBrowserMonitor, timestamp, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/last_successful_screenshot.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/last_successful_screenshot.tsx new file mode 100644 index 000000000000..3874d29197d3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/last_successful_screenshot.tsx @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useFetcher } from '@kbn/observability-plugin/public'; +import { EuiSpacer } from '@elastic/eui'; +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { fetchLastSuccessfulCheck } from '../../../../state'; +import { JourneyStep } from '../../../../../../../common/runtime_types'; +import { EmptyImage } from '../../../common/screenshot/empty_image'; +import { JourneyStepScreenshotContainer } from '../../../common/screenshot/journey_step_screenshot_container'; + +export const LastSuccessfulScreenshot = ({ step }: { step: JourneyStep }) => { + const { stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + const { data, loading } = useFetcher(() => { + return fetchLastSuccessfulCheck({ + timestamp: step['@timestamp'], + monitorId: step.monitor.id, + stepIndex: Number(stepIndex), + location: step.observer?.geo?.name, + }); + }, [step._id, step['@timestamp']]); + + if (loading || !data) { + return ; + } + + return ( + <> + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/step_image.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/step_image.tsx new file mode 100644 index 000000000000..a08ba79444cc --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/step_image.tsx @@ -0,0 +1,90 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { EuiButtonGroup, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { LastSuccessfulScreenshot } from './screenshot/last_successful_screenshot'; +import { JourneyStep } from '../../../../../../common/runtime_types'; +import { JourneyStepScreenshotContainer } from '../../common/screenshot/journey_step_screenshot_container'; + +export const StepImage = ({ + step, + ping, + isFailed, + stepLabels, +}: { + ping: JourneyStep; + step: JourneyStep; + isFailed?: boolean; + stepLabels?: string[]; +}) => { + const toggleButtons = [ + { + id: `received`, + label: RECEIVED_LABEL, + }, + { + id: `expected`, + label: EXPECTED_LABEL, + }, + ]; + + const [idSelected, setIdSelected] = useState(`received`); + + const onChangeDisabled = (optionId: string) => { + setIdSelected(optionId); + }; + + return ( + <> + +

{SCREENSHOT_LABEL}

+
+ +
+ {idSelected === 'received' ? ( + + ) : ( + + )} + + + {isFailed && ( + onChangeDisabled(id)} + buttonSize="s" + isFullWidth + /> + )} +
+ + ); +}; + +const SCREENSHOT_LABEL = i18n.translate('xpack.synthetics.stepDetails.screenshot', { + defaultMessage: 'Screenshot', +}); + +const EXPECTED_LABEL = i18n.translate('xpack.synthetics.stepDetails.expected', { + defaultMessage: 'Expected', +}); + +const RECEIVED_LABEL = i18n.translate('xpack.synthetics.stepDetails.received', { + defaultMessage: 'Received', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts new file mode 100644 index 000000000000..4c79502ce665 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts @@ -0,0 +1,68 @@ +/* + * Copyright 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 { useParams } from 'react-router-dom'; +import { useMemo } from 'react'; +import { useSyntheticsSettingsContext } from '../../../contexts'; +import { useJourneySteps } from '../../monitor_details/hooks/use_journey_steps'; +import { JourneyStep, SyntheticsJourneyApiResponse } from '../../../../../../common/runtime_types'; + +export const useStepDetailPage = (): { + activeStep?: JourneyStep; + checkGroupId: string; + handleNextStepHref: string; + handlePreviousStepHref: string; + handleNextRunHref: string; + handlePreviousRunHref: string; + hasNextStep: boolean; + hasPreviousStep: boolean; + journey?: SyntheticsJourneyApiResponse; + stepIndex: number; +} => { + const { checkGroupId, stepIndex: stepIndexString } = useParams<{ + checkGroupId: string; + stepIndex: string; + }>(); + + const stepIndex = Number(stepIndexString); + + const { data: journey } = useJourneySteps(checkGroupId); + + const memoized = useMemo( + () => ({ + hasPreviousStep: stepIndex > 1 ? true : false, + activeStep: journey?.steps?.find((step) => step.synthetics?.step?.index === stepIndex), + hasNextStep: journey && journey.steps && stepIndex < journey.steps.length ? true : false, + }), + [journey, stepIndex] + ); + + const { basePath } = useSyntheticsSettingsContext(); + + const handleNextStepHref = `${basePath}/app/synthetics/journey/${checkGroupId}/step/${ + stepIndex + 1 + }`; + + const handlePreviousStepHref = `${basePath}/app/synthetics/journey/${checkGroupId}/step/${ + stepIndex - 1 + }`; + + const handleNextRunHref = `${basePath}/app/synthetics/journey/${journey?.details?.next?.checkGroup}/step/1`; + + const handlePreviousRunHref = `${basePath}/app/synthetics/journey/${journey?.details?.previous?.checkGroup}/step/1`; + + return { + checkGroupId, + journey, + stepIndex, + ...memoized, + handleNextStepHref, + handlePreviousStepHref, + handleNextRunHref, + handlePreviousRunHref, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts new file mode 100644 index 000000000000..b42417083cc3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { i18n } from '@kbn/i18n'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { useBreadcrumbs } from '../../../hooks/use_breadcrumbs'; +import { MONITORS_ROUTE } from '../../../../../../common/constants'; +import { PLUGIN } from '../../../../../../common/constants/plugin'; + +export const useStepDetailsBreadcrumbs = (extraCrumbs?: Array<{ text: string; href?: string }>) => { + const kibana = useKibana(); + const appPath = kibana.services.application?.getUrlForApp(PLUGIN.SYNTHETICS_PLUGIN_ID) ?? ''; + + useBreadcrumbs([ + { + text: MONITOR_MANAGEMENT_CRUMB, + href: `${appPath}/${MONITORS_ROUTE}`, + }, + ...(extraCrumbs ?? []), + ]); +}; + +const MONITOR_MANAGEMENT_CRUMB = i18n.translate('xpack.synthetics.monitorsPage.monitorsMCrumb', { + defaultMessage: 'Monitors', +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx new file mode 100644 index 000000000000..09122158e45e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { useTrackPageview } from '@kbn/observability-plugin/public'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiPanel, + EuiLoadingSpinner, +} from '@elastic/eui'; +import { StepImage } from './components/step_image'; +import { useJourneySteps } from '../monitor_details/hooks/use_journey_steps'; +import { MonitorDetailsLinkPortal } from '../monitor_add_edit/monitor_details_portal'; +import { useStepDetailsBreadcrumbs } from './hooks/use_step_details_breadcrumbs'; + +export const StepDetailPage = () => { + const { checkGroupId } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + useTrackPageview({ app: 'synthetics', path: 'stepDetail' }); + useTrackPageview({ app: 'synthetics', path: 'stepDetail', delay: 15000 }); + + const { data, loading, isFailed, currentStep, stepLabels } = useJourneySteps(checkGroupId); + + useStepDetailsBreadcrumbs([{ text: data?.details?.journey.monitor.name ?? '' }]); + + if (loading) { + return ( +
+ +
+ ); + } + + return ( + <> + {data?.details?.journey && ( + + )} + + + + {data?.details?.journey && currentStep && ( + + )} + + + + + + + {/* TODO: Add breakdown of network timings donut*/} + + + {/* TODO: Add breakdown of network events*/} + + + + + + + + {/* TODO: Add step metrics*/} + + + + + + {/* TODO: Add breakdown of object list*/} + + {/* TODO: Add breakdown of object weight*/} + + + + + + {/* TODO: Add breakdown of network events*/} + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx new file mode 100644 index 000000000000..5cb758e4b3d3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { useJourneySteps } from '../monitor_details/hooks/use_journey_steps'; + +export const StepTitle = () => { + const { checkGroupId, stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); + + const { data } = useJourneySteps(checkGroupId); + + const currentStep = data?.steps.find((step) => step.synthetics.step?.index === Number(stepIndex)); + + return ( + + {currentStep?.synthetics?.step?.name} + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx index 32844de9d04c..1415b1076cdd 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/contexts/synthetics_theme_context.tsx @@ -6,7 +6,7 @@ */ import { euiLightVars, euiDarkVars } from '@kbn/ui-theme'; -import React, { createContext, useMemo } from 'react'; +import React, { createContext, useContext, useMemo } from 'react'; import { EUI_CHARTS_THEME_DARK, EUI_CHARTS_THEME_LIGHT } from '@elastic/eui/dist/eui_charts_theme'; import { DARK_THEME, LIGHT_THEME, PartialTheme, Theme } from '@elastic/charts'; @@ -96,3 +96,5 @@ export const SyntheticsThemeContextProvider: React.FC = ({ return ; }; + +export const useSyntheticsThemeContext = () => useContext(SyntheticsThemeContext); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx index 6319610f8e8c..06b684dd3071 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx @@ -24,6 +24,7 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useInspectorContext } from '@kbn/observability-plugin/public'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public'; import { ErrorDetailsPage } from './components/error_details/error_details_page'; +import { StepTitle } from './components/step_details_page/step_title'; import { MonitorAddPage } from './components/monitor_add_edit/monitor_add_page'; import { MonitorEditPage } from './components/monitor_add_edit/monitor_edit_page'; import { MonitorDetailsPageTitle } from './components/monitor_details/monitor_details_page_title'; @@ -46,6 +47,7 @@ import { MONITOR_ERRORS_ROUTE, MONITOR_HISTORY_ROUTE, MONITOR_ROUTE, + STEP_DETAIL_ROUTE, ERROR_DETAILS_ROUTE, OVERVIEW_ROUTE, } from '../../../common/constants'; @@ -59,6 +61,7 @@ import { MonitorDetailsLastRun } from './components/monitor_details/monitor_deta import { MonitorSummary } from './components/monitor_details/monitor_summary/monitor_summary'; import { MonitorHistory } from './components/monitor_details/monitor_history/monitor_history'; import { MonitorErrors } from './components/monitor_details/monitor_errors/monitor_errors'; +import { StepDetailPage } from './components/step_details_page/step_detail_page'; type RouteProps = LazyObservabilityPageTemplateProps & { path: string; @@ -285,6 +288,24 @@ const getRoutes = ( ], }, }, + { + title: i18n.translate('xpack.synthetics.stepDetailsRoute.title', { + defaultMessage: 'Step details | {baseTitle}', + values: { baseTitle }, + }), + path: STEP_DETAIL_ROUTE, + component: () => , + dataTestSubj: 'syntheticsMonitorEditPage', + pageHeader: { + pageTitle: , + rightSideItems: [], + breadcrumbs: [ + { + text: , + }, + ], + }, + }, { title: i18n.translate('xpack.synthetics.errorDetailsRoute.title', { defaultMessage: 'Error details | {baseTitle}', diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx index 55ae549a032b..3168c1b07ee3 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx @@ -95,6 +95,7 @@ const createMockStore = () => { const mockAppUrls: Record = { uptime: '/app/uptime', + synthetics: '/app/synthetics', observability: '/app/observability', '/home#/tutorial/uptimeMonitors': '/home#/tutorial/uptimeMonitors', }; diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx index f9e3572ead51..e4594e8c6063 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx @@ -42,6 +42,7 @@ describe('MonitorTitle component', () => { id: defaultMonitorId, status: 'up', type: 'http', + check_group: 'test-group', }, url: { full: 'https://www.elastic.co/', @@ -58,6 +59,7 @@ describe('MonitorTitle component', () => { id: 'browser', status: 'up', type: 'browser', + check_group: 'test-group', }, url: { full: 'https://www.elastic.co/', diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx index ddb33e4dd5fe..f0e60b290282 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx @@ -32,6 +32,7 @@ describe('PingList component', () => { name: '', status: 'down', type: 'tcp', + check_group: 'test-group', }, }, { @@ -47,6 +48,7 @@ describe('PingList component', () => { name: '', status: 'down', type: 'tcp', + check_group: 'test-group', }, }, ]; @@ -120,6 +122,7 @@ describe('PingList component', () => { "type": "io", }, "monitor": Object { + "check_group": "test-group", "duration": Object { "us": 1430, }, @@ -160,6 +163,7 @@ describe('PingList component', () => { "type": "io", }, "monitor": Object { + "check_group": "test-group", "id": "auto-tcp-0X81440A68E839814D", "ip": "255.255.255.0", "name": "", diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx index 640d207fbb13..af5df9116002 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx @@ -28,6 +28,7 @@ describe('MonitorStatusBar component', () => { id: 'id1', status: 'up', type: 'http', + check_group: 'test-group', }, url: { full: 'https://www.example.com/', diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx index a69ebb3d349f..7869125014b0 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx @@ -37,6 +37,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -58,6 +59,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -79,6 +81,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -103,6 +106,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -124,6 +128,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -145,6 +150,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -169,6 +175,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -190,6 +197,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { @@ -211,6 +219,7 @@ describe('MonitorListStatusColumn', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap index a07a55df6dbf..0c037492bbc6 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap @@ -111,6 +111,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 121, }, @@ -125,6 +126,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo-0", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -139,6 +141,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo-1", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 1, }, @@ -153,6 +156,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are Object { "docId": "foo-2", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 2, }, @@ -289,6 +293,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there is o Object { "docId": "foo", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 121, }, diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx index f1a9d1b2629a..7318fc5188af 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx @@ -29,6 +29,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: {}, @@ -44,6 +45,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 123 }, + check_group: 'test-group', }, observer: { geo: {}, @@ -59,6 +61,7 @@ describe('MonitorStatusList component', () => { id: 'myUpMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { @@ -165,6 +168,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { @@ -182,6 +186,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { @@ -199,6 +204,7 @@ describe('MonitorStatusList component', () => { id: 'myMonitor', type: 'icmp', duration: { us: 234 }, + check_group: 'test-group', }, observer: { geo: { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts index f6c637e5fdb1..c7675d960777 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts @@ -25,6 +25,7 @@ describe('selectedFiltersReducer', () => { us: 1, }, type: 'browser', + check_group: 'test-group', }, }, }; @@ -42,6 +43,7 @@ describe('selectedFiltersReducer', () => { us: 1, }, type: 'browser', + check_group: 'test-group', }, }; expect( diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts index d84c4025d5dd..7069cfce1774 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts @@ -411,6 +411,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -432,6 +433,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -453,6 +455,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -542,6 +545,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -563,6 +567,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -584,6 +589,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, @@ -605,6 +611,7 @@ describe('monitor availability', () => { "monitorInfo": Object { "docId": "myDocId", "monitor": Object { + "check_group": "myCheckGroup", "duration": Object { "us": 100000, }, From 074216be1eef90265283250f87ef353d6b679e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20G=C3=B3mez?= Date: Tue, 1 Nov 2022 12:05:04 +0100 Subject: [PATCH 50/87] [Synthetics UI] Track state for last test run separatedly from the test run table (#144269) * Add `getMonitorLastRunAction` * Use the new state slice for the last run panels and info * Handle error case --- .../single_ping_result.tsx | 2 +- .../hooks/use_monitor_latest_ping.tsx | 15 +++-- .../monitor_summary/last_test_run.tsx | 8 +-- .../monitor_summary/monitor_details_panel.tsx | 7 ++- .../state/monitor_details/actions.ts | 5 ++ .../synthetics/state/monitor_details/api.ts | 10 ++++ .../state/monitor_details/effects.ts | 12 +++- .../synthetics/state/monitor_details/index.ts | 21 ++++++- .../state/monitor_details/selectors.ts | 2 +- .../__mocks__/synthetics_store.mock.ts | 57 +++++++++++++++++++ 10 files changed, 118 insertions(+), 21 deletions(-) diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx index bb0666abbab2..cf6e0f00ff57 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx @@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n'; import { Ping } from '../../../../../../common/runtime_types'; import { formatTestDuration } from '../../../utils/monitor_test_result/test_time_formats'; -export const SinglePingResult = ({ ping, loading }: { ping: Ping; loading: boolean }) => { +export const SinglePingResult = ({ ping, loading }: { ping?: Ping; loading: boolean }) => { const ip = !loading ? ping?.resolve?.ip : undefined; const durationUs = !loading ? ping?.monitor?.duration?.us ?? NaN : NaN; const rtt = !loading ? ping?.resolve?.rtt?.us ?? NaN : NaN; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx index 6b9ab1442b9e..2c989121d5ad 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx @@ -8,7 +8,7 @@ import { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { ConfigKey } from '../../../../../../common/runtime_types'; -import { getMonitorRecentPingsAction, selectLatestPing, selectPingsLoading } from '../../../state'; +import { getMonitorLastRunAction, selectLastRunMetadata } from '../../../state'; import { useSelectedLocation } from './use_selected_location'; import { useSelectedMonitor } from './use_selected_monitor'; @@ -26,8 +26,7 @@ export const useMonitorLatestPing = (params?: UseMonitorLatestPingParams) => { const monitorId = params?.monitorId ?? monitor?.id; const locationLabel = params?.locationLabel ?? location?.label; - const latestPing = useSelector(selectLatestPing); - const pingsLoading = useSelector(selectPingsLoading); + const { data: latestPing, loading } = useSelector(selectLastRunMetadata); const latestPingId = latestPing?.monitor.id; @@ -40,21 +39,21 @@ export const useMonitorLatestPing = (params?: UseMonitorLatestPingParams) => { useEffect(() => { if (monitorId && locationLabel && !isUpToDate) { - dispatch(getMonitorRecentPingsAction.get({ monitorId, locationId: locationLabel })); + dispatch(getMonitorLastRunAction.get({ monitorId, locationId: locationLabel })); } }, [dispatch, monitorId, locationLabel, isUpToDate]); if (!monitorId || !locationLabel) { - return { loading: pingsLoading, latestPing: null }; + return { loading, latestPing: undefined }; } if (!latestPing) { - return { loading: pingsLoading, latestPing: null }; + return { loading, latestPing: undefined }; } if (!isIdSame || !isLocationSame) { - return { loading: pingsLoading, latestPing: null }; + return { loading, latestPing: undefined }; } - return { loading: pingsLoading, latestPing }; + return { loading, latestPing }; }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx index a3e2bb6796d3..9fd35bc60cd0 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx @@ -19,7 +19,6 @@ import { EuiTitle, useEuiTheme, } from '@elastic/eui'; -import { useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; import { @@ -31,7 +30,6 @@ import { import { formatTestRunAt } from '../../../utils/monitor_test_result/test_time_formats'; import { useSyntheticsSettingsContext } from '../../../contexts'; -import { selectLatestPing, selectPingsLoading } from '../../../state'; import { BrowserStepsList } from '../../common/monitor_test_result/browser_steps_list'; import { SinglePingResult } from '../../common/monitor_test_result/single_ping_result'; import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/status_badge'; @@ -39,11 +37,11 @@ import { parseBadgeStatus, StatusBadge } from '../../common/monitor_test_result/ import { useKibanaDateFormat } from '../../../../../hooks/use_kibana_date_format'; import { useJourneySteps } from '../hooks/use_journey_steps'; import { useSelectedMonitor } from '../hooks/use_selected_monitor'; +import { useMonitorLatestPing } from '../hooks/use_monitor_latest_ping'; export const LastTestRun = () => { const { euiTheme } = useEuiTheme(); - const latestPing = useSelector(selectLatestPing); - const pingsLoading = useSelector(selectPingsLoading); + const { latestPing, loading: pingsLoading } = useMonitorLatestPing(); const { monitor } = useSelectedMonitor(); const { data: stepsData, loading: stepsLoading } = useJourneySteps( @@ -97,7 +95,7 @@ const PanelHeader = ({ loading, }: { monitor: EncryptedSyntheticsSavedMonitor | null; - latestPing: Ping; + latestPing?: Ping; loading: boolean; }) => { const { euiTheme } = useEuiTheme(); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx index 2fd702a187e3..3186715fc03b 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel.tsx @@ -19,18 +19,19 @@ import { } from '@elastic/eui'; import { capitalize } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { useDispatch, useSelector } from 'react-redux'; +import { useDispatch } from 'react-redux'; import { useParams } from 'react-router-dom'; import { useSelectedMonitor } from '../hooks/use_selected_monitor'; import { MonitorTags } from './monitor_tags'; import { MonitorEnabled } from '../../monitors_page/management/monitor_list_table/monitor_enabled'; import { LocationsStatus } from './locations_status'; -import { getMonitorAction, selectLatestPing } from '../../../state'; +import { getMonitorAction } from '../../../state'; import { ConfigKey } from '../../../../../../common/runtime_types'; +import { useMonitorLatestPing } from '../hooks/use_monitor_latest_ping'; export const MonitorDetailsPanel = () => { const { euiTheme } = useEuiTheme(); - const latestPing = useSelector(selectLatestPing); + const { latestPing } = useMonitorLatestPing(); const { monitorId } = useParams<{ monitorId: string }>(); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts index 31c5bdd2cbc9..b80598bf877c 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts @@ -25,6 +25,11 @@ export const getMonitorAction = createAsyncAction< EncryptedSyntheticsSavedMonitor >('[MONITOR DETAILS] GET MONITOR'); +export const getMonitorLastRunAction = createAsyncAction< + { monitorId: string; locationId: string }, + PingsResponse +>('[MONITOR DETAILS] GET LAST RUN'); + export const getMonitorRecentPingsAction = createAsyncAction< { monitorId: string; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts index 5c70db4b8f0a..c0c8d9ac6dbc 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts @@ -21,6 +21,16 @@ export interface QueryParams { dateEnd: string; } +export const fetchMonitorLastRun = async ({ + monitorId, + locationId, +}: { + monitorId: string; + locationId: string; +}): Promise => { + return fetchMonitorRecentPings({ monitorId, locationId, size: 1 }); +}; + export const fetchMonitorRecentPings = async ({ monitorId, locationId, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts index 1b1b686400d8..5330212b4b3a 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts @@ -7,8 +7,8 @@ import { takeLeading } from 'redux-saga/effects'; import { fetchEffectFactory } from '../utils/fetch_effect'; -import { getMonitorRecentPingsAction, getMonitorAction } from './actions'; -import { fetchSyntheticsMonitor, fetchMonitorRecentPings } from './api'; +import { getMonitorLastRunAction, getMonitorRecentPingsAction, getMonitorAction } from './actions'; +import { fetchSyntheticsMonitor, fetchMonitorRecentPings, fetchMonitorLastRun } from './api'; export function* fetchSyntheticsMonitorEffect() { yield takeLeading( @@ -20,6 +20,14 @@ export function* fetchSyntheticsMonitorEffect() { ) ); + yield takeLeading( + getMonitorLastRunAction.get, + fetchEffectFactory( + fetchMonitorLastRun, + getMonitorLastRunAction.success, + getMonitorLastRunAction.fail + ) + ); yield takeLeading( getMonitorAction.get, fetchEffectFactory(fetchSyntheticsMonitor, getMonitorAction.success, getMonitorAction.fail) diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts index d068c7a2a421..5661f4eb9cc3 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts @@ -12,6 +12,7 @@ import { checkIsStalePing } from '../../utils/monitor_test_result/check_pings'; import { IHttpSerializedFetchError } from '../utils/http_error'; import { + getMonitorLastRunAction, getMonitorRecentPingsAction, setMonitorDetailsLocationAction, getMonitorAction, @@ -23,6 +24,10 @@ export interface MonitorDetailsState { data: Ping[]; loading: boolean; }; + lastRun: { + data?: Ping; + loading: boolean; + }; syntheticsMonitorLoading: boolean; syntheticsMonitor: EncryptedSyntheticsSavedMonitor | null; error: IHttpSerializedFetchError | null; @@ -31,6 +36,7 @@ export interface MonitorDetailsState { const initialState: MonitorDetailsState = { pings: { total: 0, data: [], loading: false }, + lastRun: { loading: false }, syntheticsMonitor: null, syntheticsMonitorLoading: false, error: null, @@ -42,7 +48,20 @@ export const monitorDetailsReducer = createReducer(initialState, (builder) => { .addCase(setMonitorDetailsLocationAction, (state, action) => { state.selectedLocationId = action.payload; }) - + .addCase(getMonitorLastRunAction.get, (state, action) => { + state.lastRun.loading = true; + if (checkIsStalePing(action.payload.monitorId, state.lastRun.data)) { + state.lastRun.data = undefined; + } + }) + .addCase(getMonitorLastRunAction.success, (state, action) => { + state.lastRun.loading = false; + state.lastRun.data = action.payload.pings[0]; + }) + .addCase(getMonitorLastRunAction.fail, (state, action) => { + state.lastRun.loading = false; + state.error = action.payload; + }) .addCase(getMonitorRecentPingsAction.get, (state, action) => { state.pings.loading = true; state.pings.data = state.pings.data.filter( diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts index d54bcaba9512..0948802a6a94 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts @@ -17,7 +17,7 @@ export const selectSelectedLocationId = createSelector( (state) => state.selectedLocationId ); -export const selectLatestPing = createSelector(getState, (state) => state.pings.data[0] ?? null); +export const selectLastRunMetadata = createSelector(getState, (state) => state.lastRun); export const selectPingsLoading = createSelector(getState, (state) => state.pings.loading); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts index 5c23f46dfe89..0ed0e2fd8563 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts @@ -132,6 +132,63 @@ function getBrowserJourneyMockSlice() { function getMonitorDetailsMockSlice() { return { + lastRun: { + loading: false, + data: { + summary: { up: 1, down: 0 }, + agent: { + name: 'cron-b010e1cc9518984e-27644714-4pd4h', + id: 'f8721d90-5aec-4815-a6f1-f4d4a6fb7482', + type: 'heartbeat', + ephemeral_id: 'd6a60494-5e52-418f-922b-8e90f0b4013c', + version: '8.3.0', + }, + synthetics: { + journey: { name: 'inline', id: 'inline', tags: null }, + type: 'heartbeat/summary', + }, + monitor: { + duration: { us: 269722 }, + origin: SourceType.UI, + name: 'One pixel monitor', + check_group: '051aba1c-0b74-11ed-9f0e-ba4e6fa109d5', + id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + timespan: { lt: '2022-07-24T17:24:06.094Z', gte: '2022-07-24T17:14:06.094Z' }, + type: DataStream.BROWSER, + status: 'up', + }, + url: { + scheme: 'data', + domain: '', + full: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', + }, + observer: { + geo: { + continent_name: 'North America', + city_name: 'Iowa', + country_iso_code: 'US', + name: 'North America - US Central', + location: '41.8780, 93.0977', + }, + hostname: 'cron-b010e1cc9518984e-27644714-4pd4h', + ip: ['10.1.11.162'], + mac: ['ba:4e:6f:a1:09:d5'], + }, + '@timestamp': '2022-07-24T17:14:05.079Z', + ecs: { version: '8.0.0' }, + config_id: '4afd3980-0b72-11ed-9c10-b57918ea89d6', + data_stream: { namespace: 'default', type: 'synthetics', dataset: 'browser' }, + 'event.type': 'journey/end', + event: { + agent_id_status: 'auth_metadata_missing', + ingested: '2022-07-24T17:14:07Z', + type: 'heartbeat/summary', + dataset: 'browser', + }, + timestamp: '2022-07-24T17:14:05.079Z', + docId: 'AkYzMYIBqL6WCtugsFck', + }, + }, pings: { total: 3, data: [ From 436812d56f8460118523c2a60116615e2174c063 Mon Sep 17 00:00:00 2001 From: Dominique Clarke Date: Tue, 1 Nov 2022 07:58:00 -0400 Subject: [PATCH 51/87] [Synthetics] do not filter last check result by timespan (#143694) * synthetics - do not filter last check result by timespan * adjust e2e tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../public/apps/synthetics/hooks/use_status_by_location.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx index 21930e1d559c..5271f532a5c7 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx @@ -11,7 +11,6 @@ import { useMemo } from 'react'; import { Ping } from '../../../../common/runtime_types'; import { EXCLUDE_RUN_ONCE_FILTER, - getTimeSpanFilter, SUMMARY_FILTER, } from '../../../../common/constants/client_defaults'; import { SYNTHETICS_INDEX_PATTERN, UNNAMED_LOCATION } from '../../../../common/constants'; @@ -32,7 +31,6 @@ export function useStatusByLocation(monitorIdArg?: string) { filter: [ SUMMARY_FILTER, EXCLUDE_RUN_ONCE_FILTER, - getTimeSpanFilter(), { term: { config_id: monitorIdArg ?? monitorId, From c3934c6f8160d3ac2f8503f1c8d06e229fc65538 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 1 Nov 2022 13:02:19 +0100 Subject: [PATCH 52/87] [Synthetics Telemetry] Make consistent use of stackVersion (#143924) --- .../lib/adapters/framework/adapter_types.ts | 2 +- .../legacy_uptime/lib/telemetry/types.ts | 2 +- x-pack/plugins/synthetics/server/plugin.ts | 2 +- .../routes/monitor_cruds/add_monitor.ts | 2 +- .../bulk_cruds/add_monitor_bulk.ts | 2 +- .../bulk_cruds/delete_monitor_bulk.ts | 4 ++-- .../bulk_cruds/edit_monitor_bulk.ts | 2 +- .../routes/monitor_cruds/delete_monitor.ts | 4 ++-- .../routes/monitor_cruds/edit_monitor.test.ts | 2 +- .../routes/monitor_cruds/edit_monitor.ts | 2 +- .../telemetry/monitor_upgrade_sender.test.ts | 20 +++++++++---------- .../telemetry/monitor_upgrade_sender.ts | 14 ++++++------- .../project_monitor_formatter.ts | 2 +- .../service_api_client.test.ts | 2 +- .../synthetics_service/service_api_client.ts | 10 +++++----- .../synthetics_service/synthetics_service.ts | 6 +++--- 16 files changed, 39 insertions(+), 39 deletions(-) diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts index 90f12b736812..b5c41eb0c50b 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/adapters/framework/adapter_types.ts @@ -57,7 +57,7 @@ export interface UptimeServerSetup { savedObjectsClient?: SavedObjectsClientContract; authSavedObjectsClient?: SavedObjectsClientContract; encryptedSavedObjects: EncryptedSavedObjectsPluginStart; - kibanaVersion: string; + stackVersion: string; logger: Logger; telemetry: TelemetryEventsSender; uptimeEsClient: UptimeEsClient; diff --git a/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts b/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts index b9178c2d8ad6..69030bcdbf9f 100644 --- a/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts +++ b/x-pack/plugins/synthetics/server/legacy_uptime/lib/telemetry/types.ts @@ -41,7 +41,7 @@ export interface MonitorErrorEvent { code?: string; status?: number; url?: string; - kibanaVersion: string; + stackVersion: string; } export interface MonitorUpdateTelemetryChannelEvents { diff --git a/x-pack/plugins/synthetics/server/plugin.ts b/x-pack/plugins/synthetics/server/plugin.ts index 209ff9e57fac..8871b387eb62 100644 --- a/x-pack/plugins/synthetics/server/plugin.ts +++ b/x-pack/plugins/synthetics/server/plugin.ts @@ -81,7 +81,7 @@ export class Plugin implements PluginType { config, router: core.http.createRouter(), cloud: plugins.cloud, - kibanaVersion: this.initContext.env.packageInfo.version, + stackVersion: this.initContext.env.packageInfo.version, basePath: core.http.basePath, logger: this.logger, telemetry: this.telemetryEventsSender, diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts index 1f9a55e34761..6fcc91ec96ff 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts @@ -199,7 +199,7 @@ export const syncNewMonitor = async ({ errors: syncErrors, monitor: monitorSavedObject, isInlineScript: Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), - kibanaVersion: server.kibanaVersion, + stackVersion: server.stackVersion, }) ); diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts index 0f3288297427..8a7799e14f0c 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts @@ -138,7 +138,7 @@ const sendNewMonitorTelemetry = ( errors, monitor, isInlineScript: Boolean((monitor.attributes as MonitorFields)[ConfigKey.SOURCE_INLINE]), - kibanaVersion: server.kibanaVersion, + stackVersion: server.stackVersion, }) ); } diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts index 862bab6915f3..3c8351415574 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts @@ -34,7 +34,7 @@ export const deleteMonitorBulk = async ({ syntheticsMonitorClient: SyntheticsMonitorClient; request: KibanaRequest; }) => { - const { logger, telemetry, kibanaVersion } = server; + const { logger, telemetry, stackVersion } = server; const spaceId = server.spaces.spacesService.getSpaceId(request); try { @@ -60,7 +60,7 @@ export const deleteMonitorBulk = async ({ telemetry, formatTelemetryDeleteEvent( monitor, - kibanaVersion, + stackVersion, new Date().toISOString(), Boolean((monitor.attributes as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts index 5c28bdab9d3d..3f89aab5f1cc 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts @@ -106,7 +106,7 @@ export const syncEditedMonitorBulk = async ({ formatTelemetryUpdateEvent( editedMonitorSavedObject as SavedObjectsUpdateResponse, previousMonitor, - server.kibanaVersion, + server.stackVersion, Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors ) diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts index de1b0b90ef95..751e8c5d51ec 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts @@ -87,7 +87,7 @@ export const deleteMonitor = async ({ syntheticsMonitorClient: SyntheticsMonitorClient; request: KibanaRequest; }) => { - const { logger, telemetry, kibanaVersion, encryptedSavedObjects } = server; + const { logger, telemetry, stackVersion, encryptedSavedObjects } = server; const spaceId = server.spaces.spacesService.getSpaceId(request); const encryptedSavedObjectsClient = encryptedSavedObjects.getClient(); @@ -131,7 +131,7 @@ export const deleteMonitor = async ({ telemetry, formatTelemetryDeleteEvent( monitor, - kibanaVersion, + stackVersion, new Date().toISOString(), Boolean((normalizedMonitor.attributes as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts index 9f4492ce2dc7..88a60907baf3 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts @@ -28,7 +28,7 @@ describe('syncEditedMonitor', () => { const serverMock: UptimeServerSetup = { uptimeEsClient: { search: jest.fn() }, - kibanaVersion: null, + stackVersion: null, authSavedObjectsClient: { bulkUpdate: jest.fn(), get: jest.fn(), diff --git a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts index d6b50880ed35..041399278071 100644 --- a/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts +++ b/x-pack/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts @@ -175,7 +175,7 @@ export const syncEditedMonitor = async ({ formatTelemetryUpdateEvent( editedMonitorSavedObject as SavedObjectsUpdateResponse, previousMonitor, - server.kibanaVersion, + server.stackVersion, Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), errors ) diff --git a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts index 692f55d87297..65ee31dbb08a 100644 --- a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts +++ b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts @@ -32,7 +32,7 @@ import { sendTelemetryEvents, } from './monitor_upgrade_sender'; -const kibanaVersion = '8.2.0'; +const stackVersion = '8.2.0'; const id = '123456'; const errors = [ { @@ -91,12 +91,12 @@ describe('monitor upgrade telemetry helpers', () => { it('formats telemetry events', () => { const actual = formatTelemetryEvent({ monitor: testConfig, - kibanaVersion, + stackVersion, isInlineScript: false, errors, }); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -131,11 +131,11 @@ describe('monitor upgrade telemetry helpers', () => { }, }), isInlineScript, - kibanaVersion, + stackVersion, errors, }); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -157,12 +157,12 @@ describe('monitor upgrade telemetry helpers', () => { const actual = formatTelemetryUpdateEvent( createTestConfig({}, '2011-10-05T16:48:00.000Z'), testConfig, - kibanaVersion, + stackVersion, false, errors ); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -182,13 +182,13 @@ describe('monitor upgrade telemetry helpers', () => { it('handles formatting delete events', () => { const actual = formatTelemetryDeleteEvent( testConfig, - kibanaVersion, + stackVersion, '2011-10-05T16:48:00.000Z', false, errors ); expect(actual).toEqual({ - stackVersion: kibanaVersion, + stackVersion, configId: sha256.create().update(testConfig.id).hex(), locations: ['us_central', 'other'], locationsCount: 2, @@ -218,7 +218,7 @@ describe('sendTelemetryEvents', () => { it('should queue telemetry events with generic error', () => { const event = formatTelemetryEvent({ monitor: testConfig, - kibanaVersion, + stackVersion, isInlineScript: true, errors, }); diff --git a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts index 1cb4659359f5..d86792a7967c 100644 --- a/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts +++ b/x-pack/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts @@ -65,7 +65,7 @@ export function sendErrorTelemetryEvents( export function formatTelemetryEvent({ monitor, - kibanaVersion, + stackVersion, isInlineScript, lastUpdatedAt, durationSinceLastUpdated, @@ -73,7 +73,7 @@ export function formatTelemetryEvent({ errors, }: { monitor: SavedObject; - kibanaVersion: string; + stackVersion: string; isInlineScript: boolean; lastUpdatedAt?: string; durationSinceLastUpdated?: number; @@ -83,6 +83,7 @@ export function formatTelemetryEvent({ const { attributes } = monitor; return { + stackVersion, updatedAt: deletedAt || monitor.updated_at, lastUpdatedAt, durationSinceLastUpdated, @@ -94,7 +95,6 @@ export function formatTelemetryEvent({ locationsCount: attributes[ConfigKey.LOCATIONS].length, monitorNameLength: attributes[ConfigKey.NAME].length, monitorInterval: scheduleToMilli(attributes[ConfigKey.SCHEDULE]), - stackVersion: kibanaVersion, scriptType: getScriptType(attributes as Partial, isInlineScript), errors: errors && errors?.length @@ -115,7 +115,7 @@ export function formatTelemetryEvent({ export function formatTelemetryUpdateEvent( currentMonitor: SavedObjectsUpdateResponse, previousMonitor: SavedObject, - kibanaVersion: string, + stackVersion: string, isInlineScript: boolean, errors?: ServiceLocationErrors | null ) { @@ -127,8 +127,8 @@ export function formatTelemetryUpdateEvent( } return formatTelemetryEvent({ + stackVersion, monitor: currentMonitor as SavedObject, - kibanaVersion, durationSinceLastUpdated, lastUpdatedAt: previousMonitor.updated_at, isInlineScript, @@ -138,7 +138,7 @@ export function formatTelemetryUpdateEvent( export function formatTelemetryDeleteEvent( previousMonitor: SavedObject, - kibanaVersion: string, + stackVersion: string, deletedAt: string, isInlineScript: boolean, errors?: ServiceLocationErrors | null @@ -150,8 +150,8 @@ export function formatTelemetryDeleteEvent( } return formatTelemetryEvent({ + stackVersion, monitor: previousMonitor as SavedObject, - kibanaVersion, durationSinceLastUpdated, lastUpdatedAt: previousMonitor.updated_at, deletedAt, diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts index 6139b2fbe795..b7407042b027 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts @@ -208,7 +208,7 @@ export class ProjectMonitorFormatter { privateLocations: this.privateLocations, projectId: this.projectId, namespace: this.spaceId, - version: this.server.kibanaVersion, + version: this.server.stackVersion, }); if (errors.length) { diff --git a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts index f66cfb28136f..f9b32c8ba80c 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.test.ts @@ -74,7 +74,7 @@ describe('checkAccountAccessStatus', () => { const apiClient = new ServiceAPIClient( jest.fn() as unknown as Logger, { tls: { certificate: 'crt', key: 'k' } } as ServiceConfig, - { isDev: false, kibanaVersion: '8.4' } as UptimeServerSetup + { isDev: false, stackVersion: '8.4' } as UptimeServerSetup ); apiClient.locations = [ diff --git a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts index f447a21c3bee..7597797be848 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/service_api_client.ts @@ -35,14 +35,14 @@ export class ServiceAPIClient { public locations: PublicLocations; private logger: Logger; private readonly config?: ServiceConfig; - private readonly kibanaVersion: string; + private readonly stackVersion: string; private readonly server: UptimeServerSetup; constructor(logger: Logger, config: ServiceConfig, server: UptimeServerSetup) { this.config = config; const { username, password } = config ?? {}; this.username = username; - this.kibanaVersion = server.kibanaVersion; + this.stackVersion = server.stackVersion; if (username && password) { this.authorization = 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'); @@ -96,7 +96,7 @@ export class ServiceAPIClient { } addVersionHeader(req: AxiosRequestConfig) { - req.headers = { ...req.headers, 'x-kibana-version': this.kibanaVersion }; + req.headers = { ...req.headers, 'x-kibana-version': this.stackVersion }; return req; } @@ -157,7 +157,7 @@ export class ServiceAPIClient { data: { monitors: monitorsStreams, output, - stack_version: this.kibanaVersion, + stack_version: this.stackVersion, is_edit: isEdit, }, headers: this.authorization @@ -197,7 +197,7 @@ export class ServiceAPIClient { code: err.code, status: err.response?.data?.status, url, - kibanaVersion: this.server.kibanaVersion, + stackVersion: this.server.stackVersion, }); if (err.response?.data?.reason) { this.logger.error(err.response?.data?.reason); diff --git a/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts b/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts index 457d4e79e418..5107e0bf2674 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts @@ -180,7 +180,7 @@ export class SyntheticsService { type: 'runTaskError', code: e?.code, status: e.status, - kibanaVersion: service.server.kibanaVersion, + stackVersion: service.server.stackVersion, }); throw e; } @@ -226,7 +226,7 @@ export class SyntheticsService { type: 'scheduleTaskError', code: e?.code, status: e.status, - kibanaVersion: this.server.kibanaVersion, + stackVersion: this.server.stackVersion, }); this.logger?.error( @@ -437,7 +437,7 @@ export class SyntheticsService { type: 'runTaskError', code: e?.code, status: e.status, - kibanaVersion: this.server.kibanaVersion, + stackVersion: this.server.stackVersion, }); resolve(null); }); From 381fda59554aa8a7157ec4c3951b124e0062a803 Mon Sep 17 00:00:00 2001 From: Sean Story Date: Tue, 1 Nov 2022 07:06:42 -0500 Subject: [PATCH 53/87] Update mappings for filter rules, fix inconsistencies (#144191) * Update mappings for filter rules, fix inconsistencies * Add filtering rules when creating a connector * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Fix eslint warnings * fix failing tests * PR feedback from Sander * fix types tests * Mock timestamps better Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../common/types/connectors.ts | 57 +++++++ .../__mocks__/search_indices.mock.ts | 110 ++++++++++++- .../__mocks__/view_index.mock.ts | 111 ++++++++++++- .../plugins/enterprise_search/server/index.ts | 2 +- .../index_management/setup_indices.test.ts | 110 ++++++++++++- .../server/index_management/setup_indices.ts | 130 +++++++++++++-- .../lib/connectors/add_connector.test.ts | 153 ++++++++++++++++++ .../server/lib/connectors/add_connector.ts | 63 +++++++- 8 files changed, 710 insertions(+), 26 deletions(-) diff --git a/x-pack/plugins/enterprise_search/common/types/connectors.ts b/x-pack/plugins/enterprise_search/common/types/connectors.ts index 44105cf34c0c..6b38e1269a9e 100644 --- a/x-pack/plugins/enterprise_search/common/types/connectors.ts +++ b/x-pack/plugins/enterprise_search/common/types/connectors.ts @@ -38,11 +38,68 @@ export interface IngestPipelineParams { run_ml_inference: boolean; } +export enum FilteringPolicy { + EXCLUDE = 'exclude', + INCLUDE = 'include', +} + +export enum FilteringRuleRule { + CONTAINS = 'contains', + ENDS_WITH = 'ends_with', + EQUALS = 'equals', + GT = '>', + LT = '<', + REGEX = 'regex', + STARTS_WITH = 'starts_with', +} + +export interface FilteringRule { + created_at: string; + field: string; + id: string; + order: number; + policy: FilteringPolicy; + rule: FilteringRuleRule; + updated_at: string; + value: string; +} + +export interface FilteringValidation { + ids: string[]; + messages: string[]; +} + +export enum FilteringValidationState { + EDITED = 'edited', + INVALID = 'invalid', + VALID = 'valid', +} + +export interface FilteringRules { + advanced_snippet: { + created_at: string; + updated_at: string; + value: Record; + }; + rules: FilteringRule[]; + validation: { + errors: FilteringValidation[]; + state: FilteringValidationState; + }; +} + +export interface FilteringConfig { + active: FilteringRules; + domain: string; + draft: FilteringRules; +} + export interface Connector { api_key_id: string | null; configuration: ConnectorConfiguration; description: string | null; error: string | null; + filtering: FilteringConfig[]; id: string; index_name: string; is_native: boolean; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts index b8063d57ff98..8af3be8b9e0a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/search_indices.mock.ts @@ -7,7 +7,13 @@ import { ENTERPRISE_SEARCH_CONNECTOR_CRAWLER_SERVICE_TYPE } from '../../../../common/constants'; -import { ConnectorStatus, SyncStatus } from '../../../../common/types/connectors'; +import { + ConnectorStatus, + FilteringPolicy, + FilteringRuleRule, + FilteringValidationState, + SyncStatus, +} from '../../../../common/types/connectors'; import { ElasticsearchIndexWithIngestion } from '../../../../common/types/indices'; export const indices: ElasticsearchIndexWithIngestion[] = [ @@ -29,6 +35,57 @@ export const indices: ElasticsearchIndexWithIngestion[] = [ configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '2', index_name: 'connector', is_native: false, @@ -79,6 +136,57 @@ export const indices: ElasticsearchIndexWithIngestion[] = [ configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '4', index_name: 'connector-crawler', is_native: true, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts index db4080f18e7a..4d1039e2969b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/__mocks__/view_index.mock.ts @@ -7,7 +7,13 @@ import { ENTERPRISE_SEARCH_CONNECTOR_CRAWLER_SERVICE_TYPE } from '../../../../common/constants'; -import { SyncStatus, ConnectorStatus } from '../../../../common/types/connectors'; +import { + SyncStatus, + ConnectorStatus, + FilteringPolicy, + FilteringRuleRule, + FilteringValidationState, +} from '../../../../common/types/connectors'; import { ApiViewIndex, @@ -32,12 +38,64 @@ export const apiIndex: ApiViewIndex = { store: { size_in_bytes: '8024' }, }, }; + export const connectorIndex: ConnectorViewIndex = { connector: { api_key_id: null, configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '2', index_name: 'connector', is_native: false, @@ -94,6 +152,57 @@ export const connectorCrawlerIndex: CrawlerViewIndex = { configuration: { foo: { label: 'bar', value: 'barbar' } }, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], id: '4', index_name: 'connector-crawler', is_native: true, diff --git a/x-pack/plugins/enterprise_search/server/index.ts b/x-pack/plugins/enterprise_search/server/index.ts index dfcfa8ba4627..c91789eadac3 100644 --- a/x-pack/plugins/enterprise_search/server/index.ts +++ b/x-pack/plugins/enterprise_search/server/index.ts @@ -41,7 +41,7 @@ export const config: PluginConfigDescriptor = { export const CONNECTORS_INDEX = '.elastic-connectors'; export const CURRENT_CONNECTORS_INDEX = '.elastic-connectors-v1'; export const CONNECTORS_JOBS_INDEX = '.elastic-connectors-sync-jobs'; -export const CONNECTORS_VERSION = '1'; +export const CONNECTORS_VERSION = 1; export const CRAWLERS_INDEX = '.ent-search-actastic-crawler2_configurations'; export const ANALYTICS_COLLECTIONS_INDEX = '.elastic-analytics-collections'; export const ANALYTICS_VERSION = '1'; diff --git a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts index 69bc3c4ab7e6..cea60531f2d2 100644 --- a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.test.ts @@ -38,9 +38,86 @@ describe('Setup Indices', () => { configuration: { type: 'object', }, + description: { type: 'text' }, error: { type: 'keyword' }, + filtering: { + properties: { + active: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + domain: { type: 'keyword' }, + draft: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + }, + }, index_name: { type: 'keyword' }, + is_native: { type: 'boolean' }, language: { type: 'keyword' }, + last_deleted_document_count: { type: 'long' }, + last_indexed_document_count: { type: 'long' }, last_seen: { type: 'date' }, last_sync_error: { type: 'keyword' }, last_sync_status: { type: 'keyword' }, @@ -72,14 +149,41 @@ describe('Setup Indices', () => { }, properties: { completed_at: { type: 'date' }, - connector: { properties: connectorsMappings.properties }, connector_id: { type: 'keyword', }, created_at: { type: 'date' }, deleted_document_count: { type: 'integer' }, - error: { - type: 'keyword', + error: { type: 'keyword' }, + filtering: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + domain: { type: 'keyword' }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + warnings: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + }, }, indexed_document_count: { type: 'integer' }, status: { diff --git a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts index bf6d2d3f9601..8ac6b2e232ee 100644 --- a/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts +++ b/x-pack/plugins/enterprise_search/server/index_management/setup_indices.ts @@ -28,15 +28,88 @@ interface IndexDefinition { } const connectorMappingsProperties: Record = { - api_key_id: { - type: 'keyword', - }, - configuration: { - type: 'object', - }, + api_key_id: { type: 'keyword' }, + configuration: { type: 'object' }, + description: { type: 'text' }, error: { type: 'keyword' }, + filtering: { + properties: { + active: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + domain: { type: 'keyword' }, + draft: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + validation: { + properties: { + errors: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + state: { type: 'keyword' }, + }, + }, + }, + }, + }, + }, index_name: { type: 'keyword' }, + is_native: { type: 'boolean' }, language: { type: 'keyword' }, + last_deleted_document_count: { type: 'long' }, + last_indexed_document_count: { type: 'long' }, last_seen: { type: 'date' }, last_sync_error: { type: 'keyword' }, last_sync_status: { type: 'keyword' }, @@ -87,7 +160,7 @@ const indices: IndexDefinition[] = [ mappings: { _meta: { pipeline: defaultConnectorsPipelineMeta, - version: '1', + version: 1, }, properties: connectorMappingsProperties, }, @@ -98,23 +171,46 @@ const indices: IndexDefinition[] = [ aliases: ['.elastic-connectors-sync-jobs'], mappings: { _meta: { - version: '1', + version: 1, }, properties: { completed_at: { type: 'date' }, - connector: { properties: connectorMappingsProperties }, - connector_id: { - type: 'keyword', - }, + connector_id: { type: 'keyword' }, created_at: { type: 'date' }, deleted_document_count: { type: 'integer' }, - error: { - type: 'keyword', + error: { type: 'keyword' }, + filtering: { + properties: { + advanced_snippet: { + properties: { + created_at: { type: 'date' }, + updated_at: { type: 'date' }, + value: { type: 'object' }, + }, + }, + domain: { type: 'keyword' }, + rules: { + properties: { + created_at: { type: 'date' }, + field: { type: 'keyword' }, + id: { type: 'keyword' }, + order: { type: 'short' }, + policy: { type: 'keyword' }, + rule: { type: 'keyword' }, + updated_at: { type: 'date' }, + value: { type: 'keyword' }, + }, + }, + warnings: { + properties: { + ids: { type: 'keyword' }, + messages: { type: 'text' }, + }, + }, + }, }, indexed_document_count: { type: 'integer' }, - status: { - type: 'keyword', - }, + status: { type: 'keyword' }, worker_hostname: { type: 'keyword' }, }, }, diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts index cad0b3b88e38..d97a6f0b7999 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts @@ -88,6 +88,57 @@ describe('addConnector lib function', () => { configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + }, + ], index_name: 'index_name', is_native: false, language: 'fr', @@ -219,6 +270,57 @@ describe('addConnector lib function', () => { configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + }, + ], index_name: 'index_name', is_native: true, language: null, @@ -272,6 +374,57 @@ describe('addConnector lib function', () => { configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: expect.any(String), + updated_at: expect.any(String), + value: {}, + }, + rules: [ + { + created_at: expect.any(String), + field: '_', + id: 'DEFAULT', + order: 0, + policy: 'include', + rule: 'regex', + updated_at: expect.any(String), + value: '.*', + }, + ], + validation: { + errors: [], + state: 'valid', + }, + }, + }, + ], index_name: 'search-index_name', is_native: false, language: 'en', diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts index 1b02dda8d26a..05a3b9ab4b7e 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts @@ -7,9 +7,14 @@ import { IScopedClusterClient } from '@kbn/core/server'; -import { CONNECTORS_INDEX } from '../..'; -import { CONNECTORS_VERSION } from '../..'; -import { ConnectorDocument, ConnectorStatus } from '../../../common/types/connectors'; +import { CONNECTORS_INDEX, CONNECTORS_VERSION } from '../..'; +import { + ConnectorDocument, + ConnectorStatus, + FilteringPolicy, + FilteringRuleRule, + FilteringValidationState, +} from '../../../common/types/connectors'; import { ErrorCode } from '../../../common/types/error_codes'; import { DefaultConnectorsPipelineMeta, @@ -84,11 +89,63 @@ export const addConnector = async ( connectorsIndicesMapping[`${CONNECTORS_INDEX}-v${CONNECTORS_VERSION}`]?.mappings?._meta ?.pipeline; + const currentTimestamp = new Date().toISOString(); const document: ConnectorDocument = { api_key_id: null, configuration: {}, description: null, error: null, + filtering: [ + { + active: { + advanced_snippet: { + created_at: currentTimestamp, + updated_at: currentTimestamp, + value: {}, + }, + rules: [ + { + created_at: currentTimestamp, + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: currentTimestamp, + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + domain: 'DEFAULT', + draft: { + advanced_snippet: { + created_at: currentTimestamp, + updated_at: currentTimestamp, + value: {}, + }, + rules: [ + { + created_at: currentTimestamp, + field: '_', + id: 'DEFAULT', + order: 0, + policy: FilteringPolicy.INCLUDE, + rule: FilteringRuleRule.REGEX, + updated_at: currentTimestamp, + value: '.*', + }, + ], + validation: { + errors: [], + state: FilteringValidationState.VALID, + }, + }, + }, + ], index_name: input.index_name, is_native: input.is_native, language: input.language, From 66894cd62a63ad80e60e0ccec8283ce4558bbd95 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 1 Nov 2022 08:42:44 -0400 Subject: [PATCH 54/87] skip failing test suite (#131192) --- test/server_integration/http/ssl_redirect/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/server_integration/http/ssl_redirect/index.js b/test/server_integration/http/ssl_redirect/index.js index 8abe700e2614..7e0f78e8890c 100644 --- a/test/server_integration/http/ssl_redirect/index.js +++ b/test/server_integration/http/ssl_redirect/index.js @@ -9,7 +9,8 @@ export default function ({ getService }) { const supertest = getService('supertest'); - describe('kibana server with ssl', () => { + // Failing: See https://github.com/elastic/kibana/issues/131192 + describe.skip('kibana server with ssl', () => { it('redirects http requests at redirect port to https', async () => { const host = process.env.TEST_KIBANA_HOST || 'localhost'; const port = process.env.TEST_KIBANA_PORT || '5620'; From 1d06b5ffc1c2de8396fd0f92eb46b1e5882de1a3 Mon Sep 17 00:00:00 2001 From: Giorgos Bamparopoulos Date: Tue, 1 Nov 2022 12:55:14 +0000 Subject: [PATCH 55/87] [APM] Add beta badge and update tooltips in storage explorer (#144316) * Add beta badge to storage explorer * Update tooltip and callout text --- .../components/app/storage_explorer/index.tsx | 2 +- .../app/storage_explorer/summary_stats.tsx | 5 ++-- .../routing/home/storage_explorer.tsx | 28 +++++++++++++------ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx index ef0c198000dd..060c8c00da6e 100644 --- a/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/index.tsx @@ -120,7 +120,7 @@ export function StorageExplorer() {

diff --git a/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx b/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx index bb94e5c4507c..b6f6e5167f3d 100644 --- a/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx +++ b/x-pack/plugins/apm/public/components/app/storage_explorer/summary_stats.tsx @@ -104,7 +104,8 @@ export function SummaryStats() { tooltipContent={i18n.translate( 'xpack.apm.storageExplorer.summary.totalSize.tooltip', { - defaultMessage: 'The storage size used by the APM indices.', + defaultMessage: + 'Total storage size of all the APM indices currently, ignoring all filters.', } )} value={asDynamicBytes(data?.totalSize)} @@ -122,7 +123,7 @@ export function SummaryStats() { 'xpack.apm.storageExplorer.summary.diskSpaceUsedPct.tooltip', { defaultMessage: - 'The percentage of storage size used by the APM indices compared to the overall storage configured for Elasticsearch.', + 'The percentage of the storage capacity that is currently used by all the APM indices compared to the max. storage capacity currently configured for Elasticsearch.', } )} value={asPercent(data?.diskSpaceUsedPct, 1)} diff --git a/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx b/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx index 167d4f88ca8b..e971002dfbcd 100644 --- a/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx +++ b/x-pack/plugins/apm/public/components/routing/home/storage_explorer.tsx @@ -6,11 +6,12 @@ */ import React from 'react'; -import { EuiTitle } from '@elastic/eui'; +import { EuiTitle, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import * as t from 'io-ts'; import { EuiLink } from '@elastic/eui'; import { StorageExplorer } from '../../app/storage_explorer'; +import { BetaBadge } from '../../shared/beta_badge'; import { ApmMainTemplate } from '../templates/apm_main_template'; import { Breadcrumb } from '../../app/breadcrumb'; import { @@ -32,13 +33,24 @@ export const storageExplorer = { pageHeader={{ alignItems: 'center', pageTitle: ( - -

- {i18n.translate('xpack.apm.views.storageExplorer.title', { - defaultMessage: 'Storage explorer', - })} -

- + + + +

+ {i18n.translate('xpack.apm.views.storageExplorer.title', { + defaultMessage: 'Storage explorer', + })} +

+
+
+ + + +
), rightSideItems: [ From d9adcfee0e7b50087574dbcca93c3cf86de0a786 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Tue, 1 Nov 2022 15:58:05 +0300 Subject: [PATCH 56/87] [Lens] Shard failure notices make it impossible to use Lens (#142985) * [Lens] Shard failure notices make it impossible to use Lens * rename getTSDBRollupWarningMessages -> getShardFailuresWarningMessages * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * update UI * push some logic * fix CI * push some changes * delete outdated test * fix CI * push some logic * add KibanaThemeProvider * apply UI changes for shard_failure_open_modal_button * cleanup Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Joe Reuter --- src/plugins/data/public/index.ts | 4 + .../search/fetch/handle_warnings.test.ts | 9 +- .../public/search/fetch/handle_warnings.tsx | 38 +++++-- src/plugins/data/public/search/index.ts | 1 + .../data/public/search/search_service.ts | 4 +- src/plugins/data/public/search/types.ts | 11 +- .../shard_failure_open_modal_button.test.tsx | 6 +- .../shard_failure_open_modal_button.tsx | 57 ++++++---- .../datasources/form_based/form_based.tsx | 10 +- .../public/datasources/form_based/utils.tsx | 104 ++++++++++++------ .../workspace_panel/workspace_panel.tsx | 50 +++++---- .../lens/public/embeddable/embeddable.tsx | 40 ++++--- .../public/state_management/lens_slice.ts | 9 +- x-pack/plugins/lens/public/types.ts | 11 +- x-pack/plugins/lens/public/utils.ts | 36 ++++++ .../test/functional/apps/lens/group2/tsdb.ts | 23 ---- 16 files changed, 267 insertions(+), 146 deletions(-) diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index fa545d7648df..f7542ef17096 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -169,6 +169,7 @@ export type { IEsError, Reason, WaitUntilNextSessionCompletesOptions, + SearchResponseWarning, } from './search'; export { @@ -270,6 +271,9 @@ export type { GlobalQueryStateFromUrl, } from './query'; +export type { ShardFailureRequest } from './shard_failure_modal'; +export { ShardFailureOpenModalButton } from './shard_failure_modal'; + export type { AggsStart } from './search/aggs'; export { getTime } from '../common'; diff --git a/src/plugins/data/public/search/fetch/handle_warnings.test.ts b/src/plugins/data/public/search/fetch/handle_warnings.test.ts index 0d644d8dc081..55564645665c 100644 --- a/src/plugins/data/public/search/fetch/handle_warnings.test.ts +++ b/src/plugins/data/public/search/fetch/handle_warnings.test.ts @@ -13,6 +13,7 @@ import { setNotifications } from '../../services'; import { SearchResponseWarning } from '../types'; import { filterWarnings, handleWarnings } from './handle_warnings'; import * as extract from './extract_warnings'; +import { SearchRequest } from '../../../common'; jest.mock('@kbn/i18n', () => { return { @@ -152,6 +153,8 @@ describe('Filtering and showing warnings', () => { describe('filterWarnings', () => { const callback = jest.fn(); + const request = {} as SearchRequest; + const response = {} as estypes.SearchResponse; beforeEach(() => { callback.mockImplementation(() => { @@ -161,19 +164,19 @@ describe('Filtering and showing warnings', () => { it('filters out all', () => { callback.mockImplementation(() => true); - expect(filterWarnings(warnings, callback)).toEqual([]); + expect(filterWarnings(warnings, callback, request, response, 'id')).toEqual([]); }); it('filters out some', () => { callback.mockImplementation( (warning: SearchResponseWarning) => warning.reason?.type !== 'generic_shard_failure' ); - expect(filterWarnings(warnings, callback)).toEqual([warnings[2]]); + expect(filterWarnings(warnings, callback, request, response, 'id')).toEqual([warnings[2]]); }); it('filters out none', () => { callback.mockImplementation(() => false); - expect(filterWarnings(warnings, callback)).toEqual(warnings); + expect(filterWarnings(warnings, callback, request, response, 'id')).toEqual(warnings); }); }); }); diff --git a/src/plugins/data/public/search/fetch/handle_warnings.tsx b/src/plugins/data/public/search/fetch/handle_warnings.tsx index 1720ea1f76c0..3e1353ee2f9a 100644 --- a/src/plugins/data/public/search/fetch/handle_warnings.tsx +++ b/src/plugins/data/public/search/fetch/handle_warnings.tsx @@ -8,7 +8,7 @@ import { estypes } from '@elastic/elasticsearch'; import { debounce } from 'lodash'; -import { EuiSpacer } from '@elastic/eui'; +import { EuiSpacer, EuiTextAlign } from '@elastic/eui'; import { ThemeServiceStart } from '@kbn/core/public'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import React from 'react'; @@ -57,19 +57,23 @@ export function handleWarnings({ theme, callback, sessionId = '', + requestId, }: { request: SearchRequest; response: estypes.SearchResponse; theme: ThemeServiceStart; callback?: WarningHandlerCallback; sessionId?: string; + requestId?: string; }) { const warnings = extractWarnings(response); if (warnings.length === 0) { return; } - const internal = callback ? filterWarnings(warnings, callback) : warnings; + const internal = callback + ? filterWarnings(warnings, callback, request, response, requestId) + : warnings; if (internal.length === 0) { return; } @@ -95,12 +99,16 @@ export function handleWarnings({ <> {warning.text} - + + ({ + request: request as ShardFailureRequest, + response, + })} + /> + , { theme$: theme.theme$ } ); @@ -116,12 +124,22 @@ export function handleWarnings({ /** * @internal */ -export function filterWarnings(warnings: SearchResponseWarning[], cb: WarningHandlerCallback) { +export function filterWarnings( + warnings: SearchResponseWarning[], + cb: WarningHandlerCallback, + request: SearchRequest, + response: estypes.SearchResponse, + requestId: string | undefined +) { const unfiltered: SearchResponseWarning[] = []; // use the consumer's callback as a filter to receive warnings to handle on our side warnings.forEach((warning) => { - const consumerHandled = cb?.(warning); + const consumerHandled = cb?.(warning, { + requestId, + request, + response, + }); if (!consumerHandled) { unfiltered.push(warning); } diff --git a/src/plugins/data/public/search/index.ts b/src/plugins/data/public/search/index.ts index 72d2a25b15ea..6cf303d42404 100644 --- a/src/plugins/data/public/search/index.ts +++ b/src/plugins/data/public/search/index.ts @@ -9,6 +9,7 @@ export * from './expressions'; export type { + SearchResponseWarning, ISearchSetup, ISearchStart, ISearchStartSearchSource, diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index dbba423c8ea8..c4a135b64ca9 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -241,11 +241,13 @@ export class SearchService implements Plugin { onResponse: (request, response, options) => { if (!options.disableShardFailureWarning) { const { rawResponse } = response; + handleWarnings({ request: request.body, response: rawResponse, theme, sessionId: options.sessionId, + requestId: request.id, }); } return response; @@ -286,12 +288,12 @@ export class SearchService implements Plugin { if (!rawResponse) { return; } - handleWarnings({ request: request.json as SearchRequest, response: rawResponse, theme, callback, + requestId: request.id, }); }); }, diff --git a/src/plugins/data/public/search/types.ts b/src/plugins/data/public/search/types.ts index 4e3753018adb..d1fde7bd4d7e 100644 --- a/src/plugins/data/public/search/types.ts +++ b/src/plugins/data/public/search/types.ts @@ -11,7 +11,7 @@ import type { PackageInfo } from '@kbn/core/server'; import { DataViewsContract } from '@kbn/data-views-plugin/common'; import { RequestAdapter } from '@kbn/inspector-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import { ISearchGeneric, ISearchStartSearchSource } from '../../common/search'; +import { ISearchGeneric, ISearchStartSearchSource, SearchRequest } from '../../common/search'; import { AggsSetup, AggsSetupDependencies, AggsStart, AggsStartDependencies } from './aggs'; import { SearchUsageCollector } from './collectors'; import { ISessionsClient, ISessionService } from './session'; @@ -159,4 +159,11 @@ export type SearchResponseWarning = * function to prevent the search service from showing warning notifications by default. * @public */ -export type WarningHandlerCallback = (warnings: SearchResponseWarning) => boolean | undefined; +export type WarningHandlerCallback = ( + warnings: SearchResponseWarning, + meta: { + request: SearchRequest; + response: estypes.SearchResponse; + requestId: string | undefined; + } +) => boolean | undefined; diff --git a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx index 6893ae0126e8..00f0315e6927 100644 --- a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx +++ b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.test.tsx @@ -21,8 +21,10 @@ describe('ShardFailureOpenModalButton', () => { it('triggers the openModal function when "Show details" button is clicked', () => { const component = mountWithIntl( ({ + request: shardFailureRequest, + response: shardFailureResponse, + })} theme={theme} title="test" /> diff --git a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx index 63547b1391e5..b3862690eef0 100644 --- a/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx +++ b/src/plugins/data/public/shard_failure_modal/shard_failure_open_modal_button.tsx @@ -6,33 +6,41 @@ * Side Public License, v 1. */ -import React from 'react'; +import React, { useCallback } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiButton, EuiTextAlign } from '@elastic/eui'; +import { EuiLink, EuiButton, EuiButtonProps } from '@elastic/eui'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ThemeServiceStart } from '@kbn/core/public'; +import type { ThemeServiceStart } from '@kbn/core/public'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { getOverlays } from '../services'; import { ShardFailureModal } from './shard_failure_modal'; -import { ShardFailureRequest } from './shard_failure_types'; +import type { ShardFailureRequest } from './shard_failure_types'; // @internal export interface ShardFailureOpenModalButtonProps { - request: ShardFailureRequest; - response: estypes.SearchResponse; theme: ThemeServiceStart; title: string; + size?: EuiButtonProps['size']; + color?: EuiButtonProps['color']; + getRequestMeta: () => { + request: ShardFailureRequest; + response: estypes.SearchResponse; + }; + isButtonEmpty?: boolean; } // Needed for React.lazy // eslint-disable-next-line import/no-default-export export default function ShardFailureOpenModalButton({ - request, - response, + getRequestMeta, theme, title, + size = 's', + color = 'warning', + isButtonEmpty = false, }: ShardFailureOpenModalButtonProps) { - function onClick() { + const onClick = useCallback(() => { + const { request, response } = getRequestMeta(); const modal = getOverlays().openModal( toMountPoint( - - - - + + + ); } diff --git a/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx b/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx index b863c69d7f7a..95a13d46cdc5 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/form_based.tsx @@ -65,7 +65,7 @@ import { import { getFiltersInLayer, - getTSDBRollupWarningMessages, + getShardFailuresWarningMessages, getVisualDefaultsForLayer, isColumnInvalid, cloneLayer, @@ -89,10 +89,10 @@ import { } from './operations/layer_helpers'; import { FormBasedPrivateState, FormBasedPersistedState, DataViewDragDropOperation } from './types'; import { mergeLayer, mergeLayers } from './state_helpers'; -import { Datasource, VisualizeEditorContext } from '../../types'; +import type { Datasource, VisualizeEditorContext } from '../../types'; import { deleteColumn, isReferenced } from './operations'; import { GeoFieldWorkspacePanel } from '../../editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel'; -import { DraggingIdentifier } from '../../drag_drop'; +import type { DraggingIdentifier } from '../../drag_drop'; import { getStateTimeShiftWarningMessages } from './time_shift_utils'; import { getPrecisionErrorWarningMessages } from './utils'; import { DOCUMENT_FIELD_NAME } from '../../../common/constants'; @@ -897,8 +897,8 @@ export function getFormBasedDatasource({ ), ]; }, - getSearchWarningMessages: (state, warning) => { - return [...getTSDBRollupWarningMessages(state, warning)]; + getSearchWarningMessages: (state, warning, request, response) => { + return [...getShardFailuresWarningMessages(state, warning, request, response, core.theme)]; }, getDeprecationMessages: () => { const deprecatedMessages: React.ReactNode[] = []; diff --git a/x-pack/plugins/lens/public/datasources/form_based/utils.tsx b/x-pack/plugins/lens/public/datasources/form_based/utils.tsx index dfec3c723d18..bf72776fe42a 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/utils.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/utils.tsx @@ -8,15 +8,23 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { DocLinksStart } from '@kbn/core/public'; +import type { DocLinksStart, ThemeServiceStart } from '@kbn/core/public'; import type { DatatableUtilitiesService } from '@kbn/data-plugin/common'; import { TimeRange } from '@kbn/es-query'; -import { EuiLink, EuiTextColor, EuiButton, EuiSpacer } from '@elastic/eui'; +import { EuiLink, EuiTextColor, EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; import type { DatatableColumn } from '@kbn/expressions-plugin/common'; import { groupBy, escape, uniq } from 'lodash'; import type { Query } from '@kbn/data-plugin/common'; -import { SearchResponseWarning } from '@kbn/data-plugin/public/search/types'; +import { SearchRequest } from '@kbn/data-plugin/common'; + +import { + SearchResponseWarning, + ShardFailureOpenModalButton, + ShardFailureRequest, +} from '@kbn/data-plugin/public'; + +import { estypes } from '@elastic/elasticsearch'; import type { FramePublicAPI, IndexPattern, StateSetter } from '../../types'; import { renewIDs } from '../../utils'; import type { FormBasedLayer, FormBasedPersistedState, FormBasedPrivateState } from './types'; @@ -162,43 +170,67 @@ const accuracyModeEnabledWarning = (columnName: string, docLink: string) => ( /> ); -export function getTSDBRollupWarningMessages( +export function getShardFailuresWarningMessages( state: FormBasedPersistedState, - warning: SearchResponseWarning -) { + warning: SearchResponseWarning, + request: SearchRequest, + response: estypes.SearchResponse, + theme: ThemeServiceStart +): Array { if (state) { - const hasTSDBRollupWarnings = - warning.type === 'shard_failure' && - warning.reason.type === 'unsupported_aggregation_on_downsampled_index'; - if (!hasTSDBRollupWarnings) { - return []; + if (warning.type === 'shard_failure') { + switch (warning.reason.type) { + case 'unsupported_aggregation_on_downsampled_index': + return Object.values(state.layers).flatMap((layer) => + uniq( + Object.values(layer.columns) + .filter((col) => + [ + 'median', + 'percentile', + 'percentile_rank', + 'last_value', + 'unique_count', + 'standard_deviation', + ].includes(col.operationType) + ) + .map((col) => col.label) + ).map((label) => + i18n.translate('xpack.lens.indexPattern.tsdbRollupWarning', { + defaultMessage: + '{label} uses a function that is unsupported by rolled up data. Select a different function or change the time range.', + values: { + label, + }, + }) + ) + ); + default: + return [ + <> + + {warning.message} +

{warning.text}

+
+ + {warning.text ? ( + ({ + request: request as ShardFailureRequest, + response, + })} + color="primary" + isButtonEmpty={true} + /> + ) : null} + , + ]; + } } - return Object.values(state.layers).flatMap((layer) => - uniq( - Object.values(layer.columns) - .filter((col) => - [ - 'median', - 'percentile', - 'percentile_rank', - 'last_value', - 'unique_count', - 'standard_deviation', - ].includes(col.operationType) - ) - .map((col) => col.label) - ).map((label) => - i18n.translate('xpack.lens.indexPattern.tsdbRollupWarning', { - defaultMessage: - '{label} uses a function that is unsupported by rolled up data. Select a different function or change the time range.', - values: { - label, - }, - }) - ) - ); } - return []; } diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx index 2f2003970171..36399211c92e 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx @@ -36,6 +36,7 @@ import type { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common'; import type { Datatable } from '@kbn/expressions-plugin/public'; import { DropIllustration } from '@kbn/chart-icons'; import { trackUiCounterEvents } from '../../../lens_ui_telemetry'; +import { getSearchWarningMessages } from '../../../utils'; import { FramePublicAPI, isLensBrushEvent, @@ -231,32 +232,37 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({ (data: unknown, adapters?: Partial) => { if (renderDeps.current) { const [defaultLayerId] = Object.keys(renderDeps.current.datasourceLayers); + const datasource = Object.values(renderDeps.current.datasourceMap)[0]; + const datasourceState = Object.values(renderDeps.current.datasourceStates)[0].state; - const requestWarnings: string[] = []; - const datasource = Object.values(renderDeps.current?.datasourceMap)[0]; - const datasourceState = Object.values(renderDeps.current?.datasourceStates)[0].state; - if (adapters?.requests) { - plugins.data.search.showWarnings(adapters.requests, (warning) => { - const warningMessage = datasource.getSearchWarningMessages?.(datasourceState, warning); + let requestWarnings: Array = []; - requestWarnings.push(...(warningMessage || [])); - if (warningMessage && warningMessage.length) return true; - }); - } - if (adapters && adapters.tables) { - dispatchLens( - onActiveDataChange({ - activeData: Object.entries(adapters.tables?.tables).reduce>( - (acc, [key, value], index, tables) => ({ - ...acc, - [tables.length === 1 ? defaultLayerId : key]: value, - }), - {} - ), - requestWarnings, - }) + if (adapters?.requests) { + requestWarnings = getSearchWarningMessages( + adapters.requests, + datasource, + datasourceState, + { + searchService: plugins.data.search, + } ); } + + dispatchLens( + onActiveDataChange({ + activeData: + adapters && adapters.tables + ? Object.entries(adapters.tables?.tables).reduce>( + (acc, [key, value], index, tables) => ({ + ...acc, + [tables.length === 1 ? defaultLayerId : key]: value, + }), + {} + ) + : undefined, + requestWarnings, + }) + ); } }, [dispatchLens, plugins.data.search] diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index 103c75844f81..65c91b115ce7 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -87,7 +87,12 @@ import { LensAttributeService } from '../lens_attribute_service'; import type { ErrorMessage, TableInspectorAdapter } from '../editor_frame_service/types'; import { getLensInspectorService, LensInspector } from '../lens_inspector_service'; import { SharingSavedObjectProps, VisualizationDisplayOptions } from '../types'; -import { getActiveDatasourceIdFromDoc, getIndexPatternsObjects, inferTimeField } from '../utils'; +import { + getActiveDatasourceIdFromDoc, + getIndexPatternsObjects, + getSearchWarningMessages, + inferTimeField, +} from '../utils'; import { getLayerMetaInfo, combineQueryAndFilters } from '../app_plugin/show_underlying_data'; import { convertDataViewIntoLensIndexPattern } from '../data_views_service/loader'; @@ -531,21 +536,30 @@ export class Embeddable private handleWarnings(adapters?: Partial) { const activeDatasourceId = getActiveDatasourceIdFromDoc(this.savedVis); - if (!activeDatasourceId || !adapters?.requests) return; + + if (!activeDatasourceId || !adapters?.requests) { + return; + } + const activeDatasource = this.deps.datasourceMap[activeDatasourceId]; const docDatasourceState = this.savedVis?.state.datasourceStates[activeDatasourceId]; - const warnings: React.ReactNode[] = []; - this.deps.data.search.showWarnings(adapters.requests, (warning) => { - const warningMessage = activeDatasource.getSearchWarningMessages?.( - docDatasourceState, - warning - ); - warnings.push(...(warningMessage || [])); - if (warningMessage && warningMessage.length) return true; - }); - if (warnings && this.warningDomNode) { - render(, this.warningDomNode); + const requestWarnings = getSearchWarningMessages( + adapters.requests, + activeDatasource, + docDatasourceState, + { + searchService: this.deps.data.search, + } + ); + + if (requestWarnings.length && this.warningDomNode) { + render( + + + , + this.warningDomNode + ); } } diff --git a/x-pack/plugins/lens/public/state_management/lens_slice.ts b/x-pack/plugins/lens/public/state_management/lens_slice.ts index 3f3490906f88..f21d1e6c4aa1 100644 --- a/x-pack/plugins/lens/public/state_management/lens_slice.ts +++ b/x-pack/plugins/lens/public/state_management/lens_slice.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { ReactNode } from 'react'; import { createAction, createReducer, current, PayloadAction } from '@reduxjs/toolkit'; import { VisualizeFieldContext } from '@kbn/ui-actions-plugin/public'; import { mapValues, uniq } from 'lodash'; @@ -98,8 +99,8 @@ export const getPreloadedState = ({ export const setState = createAction>('lens/setState'); export const onActiveDataChange = createAction<{ - activeData: TableInspectorAdapter; - requestWarnings?: string[]; + activeData?: TableInspectorAdapter; + requestWarnings?: Array; }>('lens/onActiveDataChange'); export const setSaveable = createAction('lens/setSaveable'); export const enableAutoApply = createAction('lens/enableAutoApply'); @@ -265,8 +266,8 @@ export const makeLensReducer = (storeDeps: LensStoreDeps) => { ) => { return { ...state, - activeData, - requestWarnings, + ...(activeData ? { activeData } : {}), + ...(requestWarnings ? { requestWarnings } : {}), }; }, [setSaveable.type]: (state, { payload }: PayloadAction) => { diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index 94a0589f78b0..a8389c784171 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -31,6 +31,9 @@ import type { FieldSpec, DataViewSpec } from '@kbn/data-views-plugin/common'; import type { FieldFormatParams } from '@kbn/field-formats-plugin/common'; import { SearchResponseWarning } from '@kbn/data-plugin/public/search/types'; import type { EuiButtonIconColor } from '@elastic/eui'; +import { SearchRequest } from '@kbn/data-plugin/public'; +import { estypes } from '@elastic/elasticsearch'; +import React from 'react'; import type { DraggingIdentifier, DragDropIdentifier, DragContextState } from './drag_drop'; import type { DateRange, LayerType, SortingHint } from '../common'; import type { @@ -428,7 +431,13 @@ export interface Datasource { /** * The embeddable calls this function to display warnings about visualization on the dashboard */ - getSearchWarningMessages?: (state: P, warning: SearchResponseWarning) => string[] | undefined; + getSearchWarningMessages?: ( + state: P, + warning: SearchResponseWarning, + request: SearchRequest, + response: estypes.SearchResponse + ) => Array | undefined; + /** * Checks if the visualization created is time based, for example date histogram */ diff --git a/x-pack/plugins/lens/public/utils.ts b/x-pack/plugins/lens/public/utils.ts index 5b55dfe2054a..efa0d3c22646 100644 --- a/x-pack/plugins/lens/public/utils.ts +++ b/x-pack/plugins/lens/public/utils.ts @@ -14,6 +14,9 @@ import type { IUiSettingsClient, SavedObjectReference } from '@kbn/core/public'; import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/public'; import type { DatatableUtilitiesService } from '@kbn/data-plugin/common'; import { BrushTriggerEvent, ClickTriggerEvent } from '@kbn/charts-plugin/public'; +import { RequestAdapter } from '@kbn/inspector-plugin/common'; +import { ISearchStart } from '@kbn/data-plugin/public'; +import React from 'react'; import type { Document } from './persistence/saved_object_store'; import { Datasource, @@ -285,3 +288,36 @@ export const isOperationFromTheSameGroup = (op1?: DraggingIdentifier, op2?: Drag op1.layerId === op2.layerId ); }; + +export const getSearchWarningMessages = ( + adapter: RequestAdapter, + datasource: Datasource, + state: unknown, + deps: { + searchService: ISearchStart; + } +) => { + const warningsMap: Map> = new Map(); + + deps.searchService.showWarnings(adapter, (warning, meta) => { + const { request, response, requestId } = meta; + + const warningMessages = datasource.getSearchWarningMessages?.( + state, + warning, + request, + response + ); + + if (warningMessages?.length) { + const key = (requestId ?? '') + warning.type + warning.reason?.type ?? ''; + if (!warningsMap.has(key)) { + warningsMap.set(key, warningMessages); + } + return true; + } + return false; + }); + + return [...warningsMap.values()].flat(); +}; diff --git a/x-pack/test/functional/apps/lens/group2/tsdb.ts b/x-pack/test/functional/apps/lens/group2/tsdb.ts index d19ab9d19db7..debdd2cf0316 100644 --- a/x-pack/test/functional/apps/lens/group2/tsdb.ts +++ b/x-pack/test/functional/apps/lens/group2/tsdb.ts @@ -9,10 +9,8 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const queryBar = getService('queryBar'); const PageObjects = getPageObjects(['common', 'timePicker', 'lens', 'dashboard']); const testSubjects = getService('testSubjects'); - const retry = getService('retry'); const es = getService('es'); const log = getService('log'); const indexPatterns = getService('indexPatterns'); @@ -130,27 +128,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Median of kubernetes.container.memory.available.bytes uses a function that is unsupported by rolled up data. Select a different function or change the time range.' ); }); - it('still shows other warnings as toast', async () => { - await es.indices.delete({ index: [testRollupIndex] }); - // index a document which will produce a shard failure because a string field doesn't support median - await es.create({ - id: '1', - index: testRollupIndex, - document: { - 'kubernetes.container.memory.available.bytes': 'fsdfdsf', - '@timestamp': '2022-06-20', - }, - wait_for_active_shards: 1, - }); - await retry.try(async () => { - await queryBar.clickQuerySubmitButton(); - expect( - await (await testSubjects.find('euiToastHeader__title', 1000)).getVisibleText() - ).to.equal('1 of 3 shards failed'); - }); - // as the rollup index is gone, there is no inline warning left - await PageObjects.lens.assertNoInlineWarning(); - }); }); }); } From f404bec48c2abd1e5753964e486602970553c05d Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 1 Nov 2022 14:12:02 +0100 Subject: [PATCH 57/87] [Synthetics] Add network waterfall on step details page (#144315) --- .../common/react_router_helpers/index.ts | 13 + .../react_router_helpers/link_events.test.ts | 103 +++ .../react_router_helpers/link_events.ts | 32 + .../link_for_eui.test.tsx | 78 ++ .../react_router_helpers/link_for_eui.tsx | 75 ++ .../step_field_trend.test.tsx | 89 +++ .../step_field_trend/step_field_trend.tsx | 101 +++ .../step_detail/step_detail_container.tsx | 56 ++ .../step_detail/step_page_nav.tsx | 71 ++ .../step_detail/step_page_title.tsx | 64 ++ .../step_detail/use_monitor_breadcrumb.tsx | 64 ++ .../use_monitor_breadcrumbs.test.tsx | 160 ++++ .../use_step_waterfall_metrics.test.tsx | 103 +++ .../step_detail/use_step_waterfall_metrics.ts | 97 +++ .../waterfall/data_formatting.test.ts | 743 ++++++++++++++++++ .../step_detail/waterfall/data_formatting.ts | 456 +++++++++++ .../step_detail/waterfall/types.ts | 262 ++++++ .../waterfall_chart_container.test.tsx | 204 +++++ .../waterfall/waterfall_chart_container.tsx | 112 +++ .../waterfall_chart_wrapper.test.tsx | 311 ++++++++ .../waterfall/waterfall_chart_wrapper.tsx | 158 ++++ .../waterfall/waterfall_filter.test.tsx | 153 ++++ .../waterfall/waterfall_filter.tsx | 192 +++++ .../waterfall/waterfall_flyout.test.tsx | 139 ++++ .../waterfall/waterfall_flyout.tsx | 131 +++ .../waterfall/waterfall_sidebar_item.test.tsx | 64 ++ .../waterfall/waterfall_sidebar_item.tsx | 94 +++ .../network_waterfall/translations.ts | 15 + .../network_waterfall/waterfall/README.md | 123 +++ .../waterfall/components/constants.ts | 21 + .../waterfall/components/legend.tsx | 33 + .../components/middle_truncated_text.test.tsx | 99 +++ .../components/middle_truncated_text.tsx | 185 +++++ .../network_requests_total.test.tsx | 76 ++ .../components/network_requests_total.tsx | 69 ++ .../waterfall/components/sidebar.tsx | 57 ++ .../waterfall/components/styles.ts | 181 +++++ .../waterfall/components/translations.ts | 50 ++ .../components/use_bar_charts.test.tsx | 109 +++ .../waterfall/components/use_bar_charts.ts | 49 ++ .../waterfall/components/use_flyout.test.tsx | 91 +++ .../waterfall/components/use_flyout.ts | 92 +++ .../waterfall/components/waterfall.test.tsx | 46 ++ .../components/waterfall_bar_chart.tsx | 128 +++ .../waterfall/components/waterfall_chart.tsx | 156 ++++ .../components/waterfall_chart_fixed_axis.tsx | 70 ++ .../components/waterfall_flyout_table.tsx | 78 ++ .../components/waterfall_marker_icon.test.tsx | 62 ++ .../components/waterfall_marker_icon.tsx | 53 ++ .../waterfall_marker_test_helper.tsx | 59 ++ .../waterfall_marker_trend.test.tsx | 128 +++ .../components/waterfall_marker_trend.tsx | 20 + .../components/waterfall_markers.tsx | 179 +++++ .../waterfall_tooltip_content.test.tsx | 84 ++ .../components/waterfall_tooltip_content.tsx | 46 ++ .../waterfall/context/waterfall_chart.tsx | 106 +++ .../network_waterfall/waterfall/index.tsx | 18 + .../network_waterfall/waterfall/types.ts | 41 + .../components/screenshot/screenshot_link.tsx | 47 ++ .../step_screenshot_display.test.tsx | 91 +++ .../screenshot/step_screenshot_display.tsx | 197 +++++ .../step_details_page/step_detail_page.tsx | 17 +- .../step_details_page/step_title.tsx | 1 - .../state/network_events/actions.ts | 27 + .../synthetics/state/network_events/api.ts | 27 + .../state/network_events/effects.ts | 47 ++ .../synthetics/state/network_events/index.ts | 157 ++++ .../state/network_events/selectors.ts | 10 + .../apps/synthetics/state/root_effect.ts | 2 + .../apps/synthetics/state/root_reducer.ts | 3 + .../synthetics/utils/formatting/format.ts | 38 + .../utils/formatting/test_helpers.ts | 70 ++ .../__mocks__/synthetics_store.mock.ts | 1 + .../__mocks__/ut_router_history.mock.ts | 26 + .../public/hooks/use_chart_theme.ts | 20 + 75 files changed, 7427 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_detail_container.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_nav.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_title.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumb.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumbs.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.test.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/types.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/translations.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/README.md create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/constants.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/legend.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/sidebar.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/styles.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/translations.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_bar_chart.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart_fixed_axis.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_flyout_table.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_test_helper.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_markers.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/context/waterfall_chart.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/index.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/types.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/screenshot_link.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.test.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.tsx create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/actions.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts create mode 100644 x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts new file mode 100644 index 000000000000..62b8c94333e2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { letBrowserHandleEvent } from './link_events'; +export { + ReactRouterEuiLink, + ReactRouterEuiButton, + ReactRouterEuiButtonEmpty, +} from './link_for_eui'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts new file mode 100644 index 000000000000..1046f47f8f38 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright 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 { letBrowserHandleEvent } from '.'; + +describe('letBrowserHandleEvent', () => { + const event = { + defaultPrevented: false, + metaKey: false, + altKey: false, + ctrlKey: false, + shiftKey: false, + button: 0, + target: { + getAttribute: () => '_self', + }, + } as any; + + describe('the browser should handle the link when', () => { + it('default is prevented', () => { + expect(letBrowserHandleEvent({ ...event, defaultPrevented: true })).toBe(true); + }); + + it('is modified with metaKey', () => { + expect(letBrowserHandleEvent({ ...event, metaKey: true })).toBe(true); + }); + + it('is modified with altKey', () => { + expect(letBrowserHandleEvent({ ...event, altKey: true })).toBe(true); + }); + + it('is modified with ctrlKey', () => { + expect(letBrowserHandleEvent({ ...event, ctrlKey: true })).toBe(true); + }); + + it('is modified with shiftKey', () => { + expect(letBrowserHandleEvent({ ...event, shiftKey: true })).toBe(true); + }); + + it('it is not a left click event', () => { + expect(letBrowserHandleEvent({ ...event, button: 2 })).toBe(true); + }); + + it('the target is anything value other than _self', () => { + expect( + letBrowserHandleEvent({ + ...event, + target: targetValue('_blank'), + }) + ).toBe(true); + }); + }); + + describe('the browser should NOT handle the link when', () => { + it('default is not prevented', () => { + expect(letBrowserHandleEvent({ ...event, defaultPrevented: false })).toBe(false); + }); + + it('is not modified', () => { + expect( + letBrowserHandleEvent({ + ...event, + metaKey: false, + altKey: false, + ctrlKey: false, + shiftKey: false, + }) + ).toBe(false); + }); + + it('it is a left click event', () => { + expect(letBrowserHandleEvent({ ...event, button: 0 })).toBe(false); + }); + + it('the target is a value of _self', () => { + expect( + letBrowserHandleEvent({ + ...event, + target: targetValue('_self'), + }) + ).toBe(false); + }); + + it('the target has no value', () => { + expect( + letBrowserHandleEvent({ + ...event, + target: targetValue(null), + }) + ).toBe(false); + }); + }); +}); + +const targetValue = (value: string | null) => { + return { + getAttribute: () => value, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts new file mode 100644 index 000000000000..089a41b0795c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { MouseEvent } from 'react'; + +/** + * Helper functions for determining which events we should + * let browsers handle natively, e.g. new tabs/windows + */ + +type THandleEvent = (event: MouseEvent) => boolean; + +export const letBrowserHandleEvent: THandleEvent = (event) => + event.defaultPrevented || + isModifiedEvent(event) || + !isLeftClickEvent(event) || + isTargetBlank(event); + +const isModifiedEvent: THandleEvent = (event) => + !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); + +const isLeftClickEvent: THandleEvent = (event) => event.button === 0; + +const isTargetBlank: THandleEvent = (event) => { + const element = event.target as HTMLElement; + const target = element.getAttribute('target'); + return !!target && target !== '_self'; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx new file mode 100644 index 000000000000..4ab605b159c7 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { shallow, mount } from 'enzyme'; +import { EuiLink, EuiButton } from '@elastic/eui'; + +import '../../../utils/testing/__mocks__/ut_router_history.mock'; + +import { ReactRouterEuiLink, ReactRouterEuiButton } from './link_for_eui'; +import { mockHistory } from '../../../utils/testing/__mocks__/ut_router_history.mock'; + +describe('EUI & React Router Component Helpers', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('renders', () => { + const wrapper = shallow(); + + expect(wrapper.find(EuiLink)).toHaveLength(1); + }); + + it('renders an EuiButton', () => { + const wrapper = shallow(); + + expect(wrapper.find(EuiButton)).toHaveLength(1); + }); + + it('passes down all ...rest props', () => { + const wrapper = shallow(); + const link = wrapper.find(EuiLink); + + expect(link.prop('external')).toEqual(true); + expect(link.prop('data-test-subj')).toEqual('foo'); + }); + + it('renders with the correct href and onClick props', () => { + const wrapper = mount(); + const link = wrapper.find(EuiLink); + + expect(link.prop('onClick')).toBeInstanceOf(Function); + expect(link.prop('href')).toEqual('/enterprise_search/foo/bar'); + expect(mockHistory.createHref).toHaveBeenCalled(); + }); + + describe('onClick', () => { + it('prevents default navigation and uses React Router history', () => { + const wrapper = mount(); + + const simulatedEvent = { + button: 0, + target: { getAttribute: () => '_self' }, + preventDefault: jest.fn(), + }; + wrapper.find(EuiLink).find('a').simulate('click', simulatedEvent); + + expect(simulatedEvent.preventDefault).toHaveBeenCalled(); + expect(mockHistory.push).toHaveBeenCalled(); + }); + + it('does not prevent default browser behavior on new tab/window clicks', () => { + const wrapper = mount(); + + const simulatedEvent = { + shiftKey: true, + target: { getAttribute: () => '_blank' }, + }; + wrapper.find(EuiLink).find('a').simulate('click', simulatedEvent); + + expect(mockHistory.push).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx new file mode 100644 index 000000000000..a9b06d18938d --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx @@ -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 React from 'react'; +import { useHistory } from 'react-router-dom'; +import { + EuiLink, + EuiButton, + EuiButtonProps, + EuiButtonEmptyProps, + EuiLinkAnchorProps, + EuiButtonEmpty, +} from '@elastic/eui'; + +import { letBrowserHandleEvent } from './link_events'; + +/** + * Generates either an EuiLink or EuiButton with a React-Router-ified link + * + * Based off of EUI's recommendations for handling React Router: + * https://github.com/elastic/eui/blob/master/wiki/react-router.md#react-router-51 + */ + +interface IEuiReactRouterProps { + to: string; +} + +export const ReactRouterHelperForEui: React.FC = ({ to, children }) => { + const history = useHistory(); + + const onClick = (event: React.MouseEvent) => { + if (letBrowserHandleEvent(event)) return; + + // Prevent regular link behavior, which causes a browser refresh. + event.preventDefault(); + + // Push the route to the history. + history.push(to); + }; + + // Generate the correct link href (with basename etc. accounted for) + const href = history.createHref({ pathname: to }); + + const reactRouterProps = { href, onClick }; + return React.cloneElement(children as React.ReactElement, reactRouterProps); +}; + +type TEuiReactRouterLinkProps = EuiLinkAnchorProps & IEuiReactRouterProps; +type TEuiReactRouterButtonProps = EuiButtonProps & IEuiReactRouterProps; +type TEuiReactRouterButtonEmptyProps = EuiButtonEmptyProps & IEuiReactRouterProps; + +export const ReactRouterEuiLink: React.FC = ({ to, ...rest }) => ( + + + +); + +export const ReactRouterEuiButton: React.FC = ({ to, ...rest }) => ( + + + +); + +export const ReactRouterEuiButtonEmpty: React.FC = ({ + to, + ...rest +}) => ( + + + +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx new file mode 100644 index 000000000000..37e354ccfd12 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '../../../utils/testing'; +import { getLast48Intervals, StepFieldTrend } from './step_field_trend'; +import { JourneyStep } from '../../../../../../common/runtime_types'; + +const step: JourneyStep = { + _id: 'docID', + monitor: { + check_group: 'check_group', + duration: { + us: 123, + }, + id: 'id', + status: 'up', + type: 'browser', + timespan: { + gte: '2021-12-01T12:54:28.098Z', + lt: '2021-12-01T12:55:28.098Z', + }, + }, + synthetics: { + step: { + index: 4, + status: 'succeeded', + name: 'STEP_NAME', + duration: { + us: 9999, + }, + }, + type: 'step/end', + }, + '@timestamp': '2021-12-03T15:23:41.072Z', +}; + +describe('StepFieldTrend', () => { + it('it renders embeddable', async () => { + const { findByText } = render( + + ); + + expect(await findByText('Embeddable exploratory view')).toBeInTheDocument(); + }); +}); + +describe('getLast48Intervals', () => { + it('it returns expected values', () => { + // 48 minutes difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-12-03T14:35:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + step.monitor.timespan = { + gte: '2021-12-01T12:55:38.098Z', + lt: '2021-12-01T12:55:48.098Z', + }; + // 8 minutes difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-12-03T15:15:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + step.monitor.timespan = { + gte: '2021-12-01T12:54:28.098Z', + lt: '2021-12-01T13:55:28.098Z', + }; + + // 48h difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-12-01T14:35:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + step.monitor.timespan = { + gte: '2021-12-01T12:54:28.098Z', + lt: '2021-12-02T12:55:28.098Z', + }; + + // 48d difference + expect(getLast48Intervals(step)).toEqual({ + from: '2021-10-16T14:35:41.072Z', + to: '2021-12-03T15:23:41.072Z', + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx new file mode 100644 index 000000000000..0f29cbe23b2c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx @@ -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 React from 'react'; + +import { EuiButton } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import moment from 'moment'; +import { AllSeries, createExploratoryViewUrl } from '@kbn/observability-plugin/public'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { JourneyStep } from '../../../../../../common/runtime_types'; +import { useSyntheticsStartPlugins } from '../../../contexts'; + +export const getLast48Intervals = (activeStep: JourneyStep) => { + const timestamp = activeStep['@timestamp']; + const { lt, gte } = activeStep.monitor.timespan!; + const difference = moment(lt).diff(moment(gte), 'millisecond') * 48; + + return { + to: timestamp, + from: moment(timestamp).subtract(difference, 'millisecond').toISOString(), + }; +}; + +export function StepFieldTrend({ + title, + field, + step: activeStep, +}: { + title: string; + field: string; + step: JourneyStep; +}) { + const { observability } = useSyntheticsStartPlugins(); + + const EmbeddableExpView = observability!.ExploratoryViewEmbeddable; + + const basePath = useKibana().services.http?.basePath?.get(); + + const allSeries: AllSeries = [ + { + name: `${title}(${activeStep.synthetics.step?.name!})`, + selectedMetricField: field, + time: getLast48Intervals(activeStep), + seriesType: 'area', + dataType: 'synthetics', + reportDefinitions: { + 'monitor.name': [activeStep.monitor.name!], + 'synthetics.step.name.keyword': [activeStep.synthetics.step?.name!], + }, + operationType: 'last_value', + }, + ]; + + const href = createExploratoryViewUrl( + { + reportType: 'kpi-over-time', + allSeries, + }, + basePath + ); + + return ( + + + {EXPLORE_LABEL} + + } + reportType={'kpi-over-time'} + attributes={allSeries} + axisTitlesVisibility={{ x: false, yLeft: false, yRight: false }} + legendIsVisible={false} + dataTypesIndexPatterns={{ + synthetics: 'synthetics-*', + }} + withActions={false} + /> + + ); +} + +export const EXPLORE_LABEL = i18n.translate('xpack.synthetics.synthetics.markers.explore', { + defaultMessage: 'Explore', +}); + +const Wrapper = euiStyled.div` + height: 200px; + width: 400px; + &&& { + .expExpressionRenderer__expression { + padding-bottom: 0 !important; + } + } +`; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_detail_container.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_detail_container.tsx new file mode 100644 index 000000000000..3035bebf9587 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_detail_container.tsx @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiText, EuiLoadingSpinner } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { useStepDetailPage } from '../../../hooks/use_step_detail_page'; +import { useMonitorBreadcrumb } from './use_monitor_breadcrumb'; +import { WaterfallChartContainer } from './waterfall/waterfall_chart_container'; + +export const NO_STEP_DATA = i18n.translate('xpack.synthetics.synthetics.stepDetail.noData', { + defaultMessage: 'No data could be found for this step', +}); + +interface Props { + checkGroup: string; + stepIndex: number; +} + +export const StepDetailContainer: React.FC = ({ checkGroup, stepIndex }) => { + const { activeStep, journey } = useStepDetailPage(); + + useMonitorBreadcrumb({ details: journey?.details, activeStep, performanceBreakDownView: true }); + + return ( + <> + {!journey && ( + + + + + + )} + {journey && !activeStep && ( + + + +

{NO_STEP_DATA}

+
+
+
+ )} + {journey && activeStep && ( + + )} + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_nav.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_nav.tsx new file mode 100644 index 000000000000..bddad0132def --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_nav.tsx @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import moment from 'moment'; +import { i18n } from '@kbn/i18n'; + +export const PREVIOUS_CHECK_BUTTON_TEXT = i18n.translate( + 'xpack.synthetics.synthetics.stepDetail.previousCheckButtonText', + { + defaultMessage: 'Previous check', + } +); + +export const NEXT_CHECK_BUTTON_TEXT = i18n.translate( + 'xpack.synthetics.synthetics.stepDetail.nextCheckButtonText', + { + defaultMessage: 'Next check', + } +); + +interface Props { + previousCheckGroup?: string; + dateFormat: string; + checkTimestamp?: string; + nextCheckGroup?: string; + handlePreviousRun: () => void; + handleNextRun: () => void; +} +export const StepPageNavigation = ({ + previousCheckGroup, + dateFormat, + handleNextRun, + handlePreviousRun, + checkTimestamp, + nextCheckGroup, +}: Props) => { + return ( + + + + {PREVIOUS_CHECK_BUTTON_TEXT} + + + + {moment(checkTimestamp).format(dateFormat)} + + + + {NEXT_CHECK_BUTTON_TEXT} + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_title.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_title.tsx new file mode 100644 index 000000000000..2e90fc3299ba --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/step_page_title.tsx @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +interface Props { + stepName: string; + stepIndex: number; + totalSteps: number; + hasPreviousStep: boolean; + hasNextStep: boolean; + handlePreviousStep: () => void; + handleNextStep: () => void; +} + +export const StepPageTitleContent = ({ + stepIndex, + totalSteps, + handleNextStep, + handlePreviousStep, + hasNextStep, + hasPreviousStep, +}: Props) => { + return ( + + + + + + + + + + + + + + + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumb.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumb.tsx new file mode 100644 index 000000000000..e30039280b30 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumb.tsx @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import moment from 'moment'; +import { i18n } from '@kbn/i18n'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { getShortTimeStamp } from '../../../../../utils/monitor_test_result/timestamp'; +import { PLUGIN } from '../../../../../../../../common/constants/plugin'; +import { useBreadcrumbs } from '../../../../../hooks'; +import { SyntheticsJourneyApiResponse } from '../../../../../../../../common/runtime_types'; + +interface ActiveStep { + monitor: { + id: string; + name?: string; + }; +} + +interface Props { + details: SyntheticsJourneyApiResponse['details']; + activeStep?: ActiveStep; + performanceBreakDownView?: boolean; +} + +export const useMonitorBreadcrumb = ({ + details, + activeStep, + performanceBreakDownView = false, +}: Props) => { + const kibana = useKibana(); + const appPath = kibana.services.application?.getUrlForApp(PLUGIN.ID) ?? ''; + + useBreadcrumbs([ + ...(activeStep?.monitor + ? [ + { + text: activeStep?.monitor?.name || activeStep?.monitor.id, + href: `${appPath}/monitor/${btoa(activeStep?.monitor.id)}`, + }, + ] + : []), + ...(details?.journey?.monitor?.check_group + ? [ + { + text: getShortTimeStamp(moment(details?.timestamp)), + href: `${appPath}/journey/${details.journey.monitor.check_group}/steps`, + }, + ] + : []), + ...(performanceBreakDownView + ? [ + { + text: i18n.translate('xpack.synthetics.synthetics.performanceBreakDown.label', { + defaultMessage: 'Performance breakdown', + }), + }, + ] + : []), + ]); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumbs.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumbs.test.tsx new file mode 100644 index 000000000000..416b5c3ca10c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_monitor_breadcrumbs.test.tsx @@ -0,0 +1,160 @@ +/* + * Copyright 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 { ChromeBreadcrumb } from '@kbn/core/public'; +import React from 'react'; +import { Route } from 'react-router-dom'; +import { of } from 'rxjs'; +import { chromeServiceMock, uiSettingsServiceMock } from '@kbn/core/public/mocks'; +import { useMonitorBreadcrumb } from './use_monitor_breadcrumb'; +import { Ping, SyntheticsJourneyApiResponse } from '../../../../../../../../common/runtime_types'; +import { render } from '../../../../../utils/testing'; +import { OVERVIEW_ROUTE } from '../../../../../../../../common/constants'; + +describe('useMonitorBreadcrumbs', () => { + it('sets the given breadcrumbs for steps list view', () => { + let breadcrumbObj: ChromeBreadcrumb[] = []; + const getBreadcrumbs = () => { + return breadcrumbObj; + }; + + const core = { + chrome: { + ...chromeServiceMock.createStartContract(), + setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => { + breadcrumbObj = newBreadcrumbs; + }, + }, + uiSettings: { + ...uiSettingsServiceMock.createSetupContract(), + get(key: string, defaultOverride?: any): any { + return `MMM D, YYYY @ HH:mm:ss.SSS` || defaultOverride; + }, + get$(key: string, defaultOverride?: any): any { + return of(`MMM D, YYYY @ HH:mm:ss.SSS`) || of(defaultOverride); + }, + }, + }; + + const Component = () => { + useMonitorBreadcrumb({ + activeStep: { monitor: { id: 'test-monitor', check_group: 'fake-test-group' } } as Ping, + details: { + timestamp: '2021-01-04T11:25:19.104Z', + journey: { + monitor: { id: 'test-monitor', check_group: 'fake-test-group' }, + }, + } as SyntheticsJourneyApiResponse['details'], + }); + return <>Step Water Fall; + }; + + render( + + + , + { core } + ); + + expect(getBreadcrumbs()).toMatchInlineSnapshot(` + Array [ + Object { + "href": "", + "text": "Observability", + }, + Object { + "href": "/app/synthetics", + "onClick": [Function], + "text": "Synthetics", + }, + Object { + "href": "/app/uptime/monitor/dGVzdC1tb25pdG9y", + "onClick": [Function], + "text": "test-monitor", + }, + Object { + "href": "/app/uptime/journey/fake-test-group/steps", + "onClick": [Function], + "text": "Jan 4, 2021 6:25:19 AM", + }, + ] + `); + }); + + it('sets the given breadcrumbs for performance breakdown page', () => { + let breadcrumbObj: ChromeBreadcrumb[] = []; + const getBreadcrumbs = () => { + return breadcrumbObj; + }; + + const core = { + chrome: { + ...chromeServiceMock.createStartContract(), + setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => { + breadcrumbObj = newBreadcrumbs; + }, + }, + uiSettings: { + ...uiSettingsServiceMock.createSetupContract(), + get(key: string, defaultOverride?: any): any { + return `MMM D, YYYY @ HH:mm:ss.SSS` || defaultOverride; + }, + get$(key: string, defaultOverride?: any): any { + return of(`MMM D, YYYY @ HH:mm:ss.SSS`) || of(defaultOverride); + }, + }, + }; + + const Component = () => { + useMonitorBreadcrumb({ + activeStep: { monitor: { id: 'test-monitor', check_group: 'fake-test-group' } } as Ping, + details: { + timestamp: '2021-01-04T11:25:19.104Z', + journey: { + monitor: { id: 'test-monitor', check_group: 'fake-test-group' }, + }, + } as SyntheticsJourneyApiResponse['details'], + performanceBreakDownView: true, + }); + return <>Step Water Fall; + }; + + render( + + + , + { core } + ); + + expect(getBreadcrumbs()).toMatchInlineSnapshot(` + Array [ + Object { + "href": "", + "text": "Observability", + }, + Object { + "href": "/app/synthetics", + "onClick": [Function], + "text": "Synthetics", + }, + Object { + "href": "/app/uptime/monitor/dGVzdC1tb25pdG9y", + "onClick": [Function], + "text": "test-monitor", + }, + Object { + "href": "/app/uptime/journey/fake-test-group/steps", + "onClick": [Function], + "text": "Jan 4, 2021 6:25:19 AM", + }, + Object { + "text": "Performance breakdown", + }, + ] + `); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.test.tsx new file mode 100644 index 000000000000..ff1494b0ed71 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.test.tsx @@ -0,0 +1,103 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { renderHook } from '@testing-library/react-hooks'; +import { + BROWSER_TRACE_NAME, + BROWSER_TRACE_START, + BROWSER_TRACE_TYPE, + useStepWaterfallMetrics, +} from './use_step_waterfall_metrics'; +import * as reduxHooks from 'react-redux'; +import * as searchHooks from '@kbn/observability-plugin/public/hooks/use_es_search'; + +describe('useStepWaterfallMetrics', () => { + jest + .spyOn(reduxHooks, 'useSelector') + .mockReturnValue({ settings: { heartbeatIndices: 'heartbeat-*' } }); + + it('returns result as expected', () => { + // @ts-ignore + const searchHook = jest.spyOn(searchHooks, 'useEsSearch').mockReturnValue({ + loading: false, + data: { + hits: { + total: { value: 2, relation: 'eq' }, + hits: [ + { + fields: { + [BROWSER_TRACE_TYPE]: ['mark'], + [BROWSER_TRACE_NAME]: ['navigationStart'], + [BROWSER_TRACE_START]: [3456789], + }, + }, + { + fields: { + [BROWSER_TRACE_TYPE]: ['mark'], + [BROWSER_TRACE_NAME]: ['domContentLoaded'], + [BROWSER_TRACE_START]: [4456789], + }, + }, + ], + }, + } as any, + }); + + const { result } = renderHook( + (props) => + useStepWaterfallMetrics({ + checkGroup: '44D-444FFF-444-FFF-3333', + hasNavigationRequest: true, + stepIndex: 1, + }), + {} + ); + + expect(searchHook).toHaveBeenCalledWith( + { + body: { + _source: false, + fields: ['browser.*'], + query: { + bool: { + filter: [ + { + term: { + 'synthetics.step.index': 1, + }, + }, + { + term: { + 'monitor.check_group': '44D-444FFF-444-FFF-3333', + }, + }, + { + term: { + 'synthetics.type': 'step/metrics', + }, + }, + ], + }, + }, + size: 1000, + }, + index: 'synthetics-*', + }, + ['44D-444FFF-444-FFF-3333', true], + { name: 'getWaterfallStepMetrics' } + ); + expect(result.current).toEqual({ + loading: false, + metrics: [ + { + id: 'domContentLoaded', + offset: 1000, + }, + ], + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.ts new file mode 100644 index 000000000000..290bf7efbb02 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/use_step_waterfall_metrics.ts @@ -0,0 +1,97 @@ +/* + * Copyright 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 { createEsParams, useEsSearch } from '@kbn/observability-plugin/public'; +import { MarkerItems } from '../waterfall/context/waterfall_chart'; + +export interface Props { + checkGroup: string; + stepIndex: number; + hasNavigationRequest?: boolean; +} +export const BROWSER_TRACE_TYPE = 'browser.relative_trace.type'; +export const BROWSER_TRACE_NAME = 'browser.relative_trace.name'; +export const BROWSER_TRACE_START = 'browser.relative_trace.start.us'; +export const NAVIGATION_START = 'navigationStart'; + +export const useStepWaterfallMetrics = ({ checkGroup, hasNavigationRequest, stepIndex }: Props) => { + const { data, loading } = useEsSearch( + hasNavigationRequest + ? createEsParams({ + index: 'synthetics-*', + body: { + query: { + bool: { + filter: [ + { + term: { + 'synthetics.step.index': stepIndex, + }, + }, + { + term: { + 'monitor.check_group': checkGroup, + }, + }, + { + term: { + 'synthetics.type': 'step/metrics', + }, + }, + ], + }, + }, + fields: ['browser.*'], + size: 1000, + _source: false, + }, + }) + : {}, + [checkGroup, hasNavigationRequest], + { + name: 'getWaterfallStepMetrics', + } + ); + + if (!hasNavigationRequest) { + return { metrics: [], loading: false }; + } + + const metrics: MarkerItems = []; + + if (data && hasNavigationRequest) { + const metricDocs = data.hits.hits as unknown as Array<{ fields: any }>; + let navigationStart = 0; + let navigationStartExist = false; + + metricDocs.forEach(({ fields }) => { + if (fields[BROWSER_TRACE_TYPE]?.[0] === 'mark') { + const { [BROWSER_TRACE_NAME]: metricType, [BROWSER_TRACE_START]: metricValue } = fields; + if (metricType?.[0] === NAVIGATION_START) { + navigationStart = metricValue?.[0]; + navigationStartExist = true; + } + } + }); + + if (navigationStartExist) { + metricDocs.forEach(({ fields }) => { + if (fields[BROWSER_TRACE_TYPE]?.[0] === 'mark') { + const { [BROWSER_TRACE_NAME]: metricType, [BROWSER_TRACE_START]: metricValue } = fields; + if (metricType?.[0] !== NAVIGATION_START) { + metrics.push({ + id: metricType?.[0], + offset: (metricValue?.[0] - navigationStart) / 1000, + }); + } + } + }); + } + } + + return { metrics, loading }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.test.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.test.ts new file mode 100644 index 000000000000..aea92647dfe6 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.test.ts @@ -0,0 +1,743 @@ +/* + * Copyright 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 moment from 'moment'; +import { + colourPalette, + formatTooltipHeading, + getConnectingTime, + getSeriesAndDomain, + getSidebarItems, +} from './data_formatting'; +import { + NetworkItems, + MimeType, + FriendlyFlyoutLabels, + FriendlyTimingLabels, + Timings, + Metadata, +} from './types'; +import { WaterfallDataEntry } from '../../waterfall/types'; +import { mockMoment } from '../../../../../../utils/formatting/test_helpers'; + +export const networkItems: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'https://unpkg.com/todomvc-app-css@2.0.4/index.css', + status: 200, + mimeType: 'text/css', + requestSentTime: 18098833.175, + loadEndTime: 18098957.145, + timings: { + connect: 81.10800000213203, + wait: 34.577999998873565, + receive: 0.5520000013348181, + send: 0.3600000018195715, + total: 123.97000000055414, + proxy: -1, + blocked: 0.8540000017092098, + queueing: 2.263999998831423, + ssl: 55.38700000033714, + dns: 3.559999997378327, + }, + resourceSize: 1000, + transferSize: 1000, + requestHeaders: { + sample_request_header: 'sample request header', + }, + responseHeaders: { + sample_response_header: 'sample response header', + }, + certificates: { + issuer: 'Sample Issuer', + validFrom: '2021-02-22T18:35:26.000Z', + validTo: '2021-04-05T22:28:43.000Z', + subjectName: '*.elastic.co', + }, + ip: '104.18.8.22', + }, + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'https://unpkg.com/director@1.2.8/build/director.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 18098833.537, + loadEndTime: 18098977.648000002, + timings: { + blocked: 84.54599999822676, + receive: 3.068000001803739, + queueing: 3.69700000010198, + proxy: -1, + total: 144.1110000014305, + wait: 52.56100000042352, + connect: -1, + send: 0.2390000008745119, + ssl: -1, + dns: -1, + }, + }, +]; + +export const networkItemsWithoutFullTimings: NetworkItems = [ + networkItems[0], + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js', + status: 0, + mimeType: 'text/javascript', + requestSentTime: 18098834.097, + loadEndTime: 18098836.889999997, + timings: { + total: 2.7929999996558763, + blocked: -1, + ssl: -1, + wait: -1, + connect: -1, + dns: -1, + queueing: -1, + send: -1, + proxy: -1, + receive: -1, + }, + }, +]; + +export const networkItemsWithoutAnyTimings: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js', + status: 0, + mimeType: 'text/javascript', + requestSentTime: 18098834.097, + loadEndTime: 18098836.889999997, + timings: { + total: -1, + blocked: -1, + ssl: -1, + wait: -1, + connect: -1, + dns: -1, + queueing: -1, + send: -1, + proxy: -1, + receive: -1, + }, + }, +]; + +export const networkItemsWithoutTimingsObject: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js', + status: 0, + mimeType: 'text/javascript', + requestSentTime: 18098834.097, + loadEndTime: 18098836.889999997, + }, +]; + +export const networkItemsWithUncommonMimeType: NetworkItems = [ + { + timestamp: '2021-01-05T19:22:28.928Z', + method: 'GET', + url: 'https://unpkg.com/director@1.2.8/build/director.js', + status: 200, + mimeType: 'application/x-javascript', + requestSentTime: 18098833.537, + loadEndTime: 18098977.648000002, + timings: { + blocked: 84.54599999822676, + receive: 3.068000001803739, + queueing: 3.69700000010198, + proxy: -1, + total: 144.1110000014305, + wait: 52.56100000042352, + connect: -1, + send: 0.2390000008745119, + ssl: -1, + dns: -1, + }, + }, +]; + +describe('getConnectingTime', () => { + it('returns `connect` value if `ssl` is undefined', () => { + expect(getConnectingTime(10)).toBe(10); + }); + + it('returns `undefined` if `connect` is not defined', () => { + expect(getConnectingTime(undefined, 23)).toBeUndefined(); + }); + + it('returns `connect` value if `ssl` is 0', () => { + expect(getConnectingTime(10, 0)).toBe(10); + }); + + it('returns `connect` value if `ssl` is -1', () => { + expect(getConnectingTime(10, 0)).toBe(10); + }); + + it('reduces `connect` value by `ssl` value if both are defined', () => { + expect(getConnectingTime(10, 3)).toBe(7); + }); +}); + +describe('Palettes', () => { + it('A colour palette comprising timing and mime type colours is correctly generated', () => { + expect(colourPalette).toEqual({ + blocked: '#dcd4c4', + connect: '#da8b45', + dns: '#54b399', + font: '#aa6556', + html: '#f3b3a6', + media: '#d6bf57', + other: '#e7664c', + receive: '#54b399', + script: '#9170b8', + send: '#d36086', + ssl: '#edc5a2', + stylesheet: '#ca8eae', + wait: '#b0c9e0', + xhr: '#e7664c', + }); + }); +}); + +describe('getSeriesAndDomain', () => { + beforeEach(() => { + mockMoment(); + }); + + it('formats series timings', () => { + const actual = getSeriesAndDomain(networkItems); + expect(actual.series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "colour": "#dcd4c4", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#dcd4c4", + "value": "Queued / Blocked: 0.854ms", + }, + }, + "x": 0, + "y": 0.8540000017092098, + "y0": 0, + }, + Object { + "config": Object { + "colour": "#54b399", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#54b399", + "value": "DNS: 3.560ms", + }, + }, + "x": 0, + "y": 4.413999999087537, + "y0": 0.8540000017092098, + }, + Object { + "config": Object { + "colour": "#da8b45", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#da8b45", + "value": "Connecting: 25.721ms", + }, + }, + "x": 0, + "y": 30.135000000882428, + "y0": 4.413999999087537, + }, + Object { + "config": Object { + "colour": "#edc5a2", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#edc5a2", + "value": "TLS: 55.387ms", + }, + }, + "x": 0, + "y": 85.52200000121957, + "y0": 30.135000000882428, + }, + Object { + "config": Object { + "colour": "#d36086", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#d36086", + "value": "Sending request: 0.360ms", + }, + }, + "x": 0, + "y": 85.88200000303914, + "y0": 85.52200000121957, + }, + Object { + "config": Object { + "colour": "#b0c9e0", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#b0c9e0", + "value": "Waiting (TTFB): 34.578ms", + }, + }, + "x": 0, + "y": 120.4600000019127, + "y0": 85.88200000303914, + }, + Object { + "config": Object { + "colour": "#ca8eae", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#ca8eae", + "value": "Content downloading (CSS): 0.552ms", + }, + }, + "x": 0, + "y": 121.01200000324752, + "y0": 120.4600000019127, + }, + Object { + "config": Object { + "colour": "#dcd4c4", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#dcd4c4", + "value": "Queued / Blocked: 84.546ms", + }, + }, + "x": 1, + "y": 84.90799999795854, + "y0": 0.3619999997317791, + }, + Object { + "config": Object { + "colour": "#d36086", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#d36086", + "value": "Sending request: 0.239ms", + }, + }, + "x": 1, + "y": 85.14699999883305, + "y0": 84.90799999795854, + }, + Object { + "config": Object { + "colour": "#b0c9e0", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#b0c9e0", + "value": "Waiting (TTFB): 52.561ms", + }, + }, + "x": 1, + "y": 137.70799999925657, + "y0": 85.14699999883305, + }, + Object { + "config": Object { + "colour": "#9170b8", + "id": 1, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#9170b8", + "value": "Content downloading (JS): 3.068ms", + }, + }, + "x": 1, + "y": 140.7760000010603, + "y0": 137.70799999925657, + }, + ] + `); + }); + + it('handles series formatting when only total timing values are available', () => { + const { series } = getSeriesAndDomain(networkItemsWithoutFullTimings); + expect(series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "colour": "#dcd4c4", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#dcd4c4", + "value": "Queued / Blocked: 0.854ms", + }, + }, + "x": 0, + "y": 0.8540000017092098, + "y0": 0, + }, + Object { + "config": Object { + "colour": "#54b399", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#54b399", + "value": "DNS: 3.560ms", + }, + }, + "x": 0, + "y": 4.413999999087537, + "y0": 0.8540000017092098, + }, + Object { + "config": Object { + "colour": "#da8b45", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#da8b45", + "value": "Connecting: 25.721ms", + }, + }, + "x": 0, + "y": 30.135000000882428, + "y0": 4.413999999087537, + }, + Object { + "config": Object { + "colour": "#edc5a2", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#edc5a2", + "value": "TLS: 55.387ms", + }, + }, + "x": 0, + "y": 85.52200000121957, + "y0": 30.135000000882428, + }, + Object { + "config": Object { + "colour": "#d36086", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#d36086", + "value": "Sending request: 0.360ms", + }, + }, + "x": 0, + "y": 85.88200000303914, + "y0": 85.52200000121957, + }, + Object { + "config": Object { + "colour": "#b0c9e0", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#b0c9e0", + "value": "Waiting (TTFB): 34.578ms", + }, + }, + "x": 0, + "y": 120.4600000019127, + "y0": 85.88200000303914, + }, + Object { + "config": Object { + "colour": "#ca8eae", + "id": 0, + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#ca8eae", + "value": "Content downloading (CSS): 0.552ms", + }, + }, + "x": 0, + "y": 121.01200000324752, + "y0": 120.4600000019127, + }, + Object { + "config": Object { + "colour": "#9170b8", + "isHighlighted": true, + "showTooltip": true, + "tooltipProps": Object { + "colour": "#9170b8", + "value": "Content downloading (JS): 2.793ms", + }, + }, + "x": 1, + "y": 3.714999998046551, + "y0": 0.9219999983906746, + }, + ] + `); + }); + + it('handles series formatting when there is no timing information available', () => { + const { series } = getSeriesAndDomain(networkItemsWithoutAnyTimings); + expect(series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "colour": "", + "isHighlighted": true, + "showTooltip": false, + "tooltipProps": undefined, + }, + "x": 0, + "y": 0, + "y0": 0, + }, + ] + `); + }); + + it('handles formatting when there is no timing information available', () => { + const actual = getSeriesAndDomain(networkItemsWithoutAnyTimings); + expect(actual).toMatchInlineSnapshot(` + Object { + "domain": Object { + "max": 0, + "min": 0, + }, + "metadata": Array [ + Object { + "certificates": undefined, + "details": Array [ + Object { + "name": "Status", + "value": undefined, + }, + Object { + "name": "Content type", + "value": "text/javascript", + }, + Object { + "name": "Request start", + "value": "0.000 ms", + }, + Object { + "name": "DNS", + "value": undefined, + }, + Object { + "name": "Connecting", + "value": undefined, + }, + Object { + "name": "TLS", + "value": undefined, + }, + Object { + "name": "Waiting (TTFB)", + "value": undefined, + }, + Object { + "name": "Content downloading", + "value": undefined, + }, + Object { + "name": "Resource size", + "value": undefined, + }, + Object { + "name": "Transfer size", + "value": undefined, + }, + Object { + "name": "IP", + "value": undefined, + }, + ], + "requestHeaders": undefined, + "responseHeaders": undefined, + "url": "file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js", + "x": 0, + }, + ], + "series": Array [ + Object { + "config": Object { + "colour": "", + "isHighlighted": true, + "showTooltip": false, + "tooltipProps": undefined, + }, + "x": 0, + "y": 0, + "y0": 0, + }, + ], + "totalHighlightedRequests": 1, + } + `); + }); + + it('handles formatting when the timings object is undefined', () => { + const { series } = getSeriesAndDomain(networkItemsWithoutTimingsObject); + expect(series).toMatchInlineSnapshot(` + Array [ + Object { + "config": Object { + "isHighlighted": true, + "showTooltip": false, + }, + "x": 0, + "y": 0, + "y0": 0, + }, + ] + `); + }); + + it('handles formatting when mime type is not mapped to a specific mime type bucket', () => { + const { series } = getSeriesAndDomain(networkItemsWithUncommonMimeType); + /* verify that raw mime type appears in the tooltip config and that + * the colour is mapped to mime type other */ + const contentDownloadedingConfigItem = series.find((item: WaterfallDataEntry) => { + const { tooltipProps } = item.config; + if (tooltipProps && typeof tooltipProps.value === 'string') { + return ( + tooltipProps.value.includes('application/x-javascript') && + tooltipProps.colour === colourPalette[MimeType.Other] + ); + } + return false; + }); + expect(contentDownloadedingConfigItem).toBeDefined(); + }); + + it.each([ + [FriendlyFlyoutLabels[Metadata.Status], '200'], + [FriendlyFlyoutLabels[Metadata.MimeType], 'text/css'], + [FriendlyFlyoutLabels[Metadata.RequestStart], '0.000 ms'], + [FriendlyTimingLabels[Timings.Dns], '3.560 ms'], + [FriendlyTimingLabels[Timings.Connect], '25.721 ms'], + [FriendlyTimingLabels[Timings.Ssl], '55.387 ms'], + [FriendlyTimingLabels[Timings.Wait], '34.578 ms'], + [FriendlyTimingLabels[Timings.Receive], '0.552 ms'], + [FriendlyFlyoutLabels[Metadata.TransferSize], '1.000 KB'], + [FriendlyFlyoutLabels[Metadata.ResourceSize], '1.000 KB'], + [FriendlyFlyoutLabels[Metadata.IP], '104.18.8.22'], + ])('handles metadata details formatting', (name, value) => { + const { metadata } = getSeriesAndDomain(networkItems); + const metadataEntry = metadata[0]; + expect( + metadataEntry.details.find((item) => item.value === value && item.name === name) + ).toBeDefined(); + }); + + it('handles metadata headers formatting', () => { + const { metadata } = getSeriesAndDomain(networkItems); + const metadataEntry = metadata[0]; + metadataEntry.requestHeaders?.forEach((header) => { + expect(header).toEqual({ name: header.name, value: header.value }); + }); + metadataEntry.responseHeaders?.forEach((header) => { + expect(header).toEqual({ name: header.name, value: header.value }); + }); + }); + + it('handles certificate formatting', () => { + const { metadata } = getSeriesAndDomain([networkItems[0]]); + const metadataEntry = metadata[0]; + expect(metadataEntry.certificates).toEqual([ + { name: 'Issuer', value: networkItems[0].certificates?.issuer }, + { name: 'Valid from', value: moment(networkItems[0].certificates?.validFrom).format('L LT') }, + { name: 'Valid until', value: moment(networkItems[0].certificates?.validTo).format('L LT') }, + { name: 'Common name', value: networkItems[0].certificates?.subjectName }, + ]); + metadataEntry.responseHeaders?.forEach((header) => { + expect(header).toEqual({ name: header.name, value: header.value }); + }); + }); + it('counts the total number of highlighted items', () => { + // only one CSS file in this array of network Items + const actual = getSeriesAndDomain(networkItems, false, '', ['stylesheet']); + expect(actual.totalHighlightedRequests).toBe(1); + }); + + it('adds isHighlighted to waterfall entry when filter matches', () => { + // only one CSS file in this array of network Items + const { series } = getSeriesAndDomain(networkItems, false, '', ['stylesheet']); + series.forEach((item) => { + if (item.x === 0) { + expect(item.config.isHighlighted).toBe(true); + } else { + expect(item.config.isHighlighted).toBe(false); + } + }); + }); + + it('adds isHighlighted to waterfall entry when query matches', () => { + // only the second item matches this query + const { series } = getSeriesAndDomain(networkItems, false, 'director', []); + series.forEach((item) => { + if (item.x === 1) { + expect(item.config.isHighlighted).toBe(true); + } else { + expect(item.config.isHighlighted).toBe(false); + } + }); + }); +}); + +describe('getSidebarItems', () => { + it('passes the item index offset by 1 to offsetIndex for visual display', () => { + const actual = getSidebarItems(networkItems, false, '', []); + expect(actual[0].offsetIndex).toBe(1); + }); +}); + +describe('formatTooltipHeading', () => { + it('puts index and URL text together', () => { + expect(formatTooltipHeading(1, 'http://www.elastic.co/')).toEqual('1. http://www.elastic.co/'); + }); + + it('returns only the text if `index` is NaN', () => { + expect(formatTooltipHeading(NaN, 'http://www.elastic.co/')).toEqual('http://www.elastic.co/'); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.ts new file mode 100644 index 000000000000..8b7a29af3030 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/data_formatting.ts @@ -0,0 +1,456 @@ +/* + * Copyright 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 { euiPaletteColorBlind } from '@elastic/eui'; +import moment from 'moment'; + +import { NetworkEvent } from '../../../../../../../../../common/runtime_types'; +import { + NetworkItems, + NetworkItem, + FriendlyFlyoutLabels, + FriendlyTimingLabels, + FriendlyMimetypeLabels, + MimeType, + MimeTypesMap, + Timings, + Metadata, + TIMING_ORDER, + SidebarItems, + LegendItems, +} from './types'; +import { WaterfallData, WaterfallMetadata } from '../../waterfall'; + +export const extractItems = (data: NetworkEvent[]): NetworkItems => { + // NOTE: This happens client side as the "payload" property is mapped + // in such a way it can't be queried (or sorted on) via ES. + return data.sort((a: NetworkItem, b: NetworkItem) => { + return a.requestSentTime - b.requestSentTime; + }); +}; + +const formatValueForDisplay = (value: number, points: number = 3) => { + return Number(value).toFixed(points); +}; + +const getColourForMimeType = (mimeType?: string) => { + const key = mimeType && MimeTypesMap[mimeType] ? MimeTypesMap[mimeType] : MimeType.Other; + return colourPalette[key]; +}; + +const getFriendlyTooltipValue = ({ + value, + timing, + mimeType, +}: { + value: number; + timing: Timings; + mimeType?: string; +}) => { + let label = FriendlyTimingLabels[timing]; + if (timing === Timings.Receive && mimeType) { + const formattedMimeType: MimeType = MimeTypesMap[mimeType]; + label += ` (${FriendlyMimetypeLabels[formattedMimeType] || mimeType})`; + } + return `${label}: ${formatValueForDisplay(value)}ms`; +}; +export const isHighlightedItem = ( + item: NetworkItem, + query?: string, + activeFilters: string[] = [] +) => { + if (!query && activeFilters?.length === 0) { + return true; + } + + const matchQuery = query ? item.url?.includes(query) : true; + const matchFilters = + activeFilters.length > 0 ? activeFilters.includes(MimeTypesMap[item.mimeType!]) : true; + + return !!(matchQuery && matchFilters); +}; + +const getFriendlyMetadataValue = ({ value, postFix }: { value?: number; postFix?: string }) => { + // value === -1 indicates timing data cannot be extracted + if (value === undefined || value === -1) { + return undefined; + } + + let formattedValue = formatValueForDisplay(value); + + if (postFix) { + formattedValue = `${formattedValue} ${postFix}`; + } + + return formattedValue; +}; + +export const getConnectingTime = (connect?: number, ssl?: number) => { + if (ssl && connect && ssl > 0) { + return connect - ssl; + } else { + return connect; + } +}; + +export const getSeriesAndDomain = ( + items: NetworkItems, + onlyHighlighted = false, + query?: string, + activeFilters?: string[] +) => { + const getValueForOffset = (item: NetworkItem) => { + return item.requestSentTime; + }; + // The earliest point in time a request is sent or started. This will become our notion of "0". + let zeroOffset = Infinity; + items.forEach((i) => (zeroOffset = Math.min(zeroOffset, getValueForOffset(i)))); + + const getValue = (timings: NetworkEvent['timings'], timing: Timings) => { + if (!timings) return; + + // SSL is a part of the connect timing + if (timing === Timings.Connect) { + return getConnectingTime(timings.connect, timings.ssl); + } + return timings[timing]; + }; + + const series: WaterfallData = []; + const metadata: WaterfallMetadata = []; + let totalHighlightedRequests = 0; + + items.forEach((item, index) => { + const mimeTypeColour = getColourForMimeType(item.mimeType); + const offsetValue = getValueForOffset(item); + let currentOffset = offsetValue - zeroOffset; + metadata.push(formatMetadata({ item, index, requestStart: currentOffset })); + const isHighlighted = isHighlightedItem(item, query, activeFilters); + if (isHighlighted) { + totalHighlightedRequests++; + } + + if (!item.timings) { + series.push({ + x: index, + y0: 0, + y: 0, + config: { + isHighlighted, + showTooltip: false, + }, + }); + return; + } + + let timingValueFound = false; + + TIMING_ORDER.forEach((timing) => { + const value = getValue(item.timings, timing); + if (value && value >= 0) { + timingValueFound = true; + const colour = timing === Timings.Receive ? mimeTypeColour : colourPalette[timing]; + const y = currentOffset + value; + + series.push({ + x: index, + y0: currentOffset, + y, + config: { + id: index, + colour, + isHighlighted, + showTooltip: true, + tooltipProps: { + value: getFriendlyTooltipValue({ + value: y - currentOffset, + timing, + mimeType: item.mimeType, + }), + colour, + }, + }, + }); + currentOffset = y; + } + }); + + /* if no specific timing values are found, use the total time + * if total time is not available use 0, set showTooltip to false, + * and omit tooltip props */ + if (!timingValueFound) { + const total = item.timings.total; + const hasTotal = total !== -1; + series.push({ + x: index, + y0: hasTotal ? currentOffset : 0, + y: hasTotal ? currentOffset + item.timings.total : 0, + config: { + isHighlighted, + colour: hasTotal ? mimeTypeColour : '', + showTooltip: hasTotal, + tooltipProps: hasTotal + ? { + value: getFriendlyTooltipValue({ + value: total, + timing: Timings.Receive, + mimeType: item.mimeType, + }), + colour: mimeTypeColour, + } + : undefined, + }, + }); + } + }); + + const yValues = series.map((serie) => serie.y); + const domain = { min: 0, max: Math.max(...yValues) }; + + let filteredSeries = series; + if (onlyHighlighted) { + filteredSeries = series.filter((item) => item.config.isHighlighted); + } + + return { series: filteredSeries, domain, metadata, totalHighlightedRequests }; +}; + +const formatHeaders = (headers?: Record) => { + if (typeof headers === 'undefined') { + return undefined; + } + return Object.keys(headers).map((key) => ({ + name: key, + value: `${headers[key]}`, + })); +}; + +const formatMetadata = ({ + item, + index, + requestStart, +}: { + item: NetworkItem; + index: number; + requestStart: number; +}) => { + const { + certificates, + ip, + mimeType, + requestHeaders, + responseHeaders, + url, + resourceSize, + transferSize, + status, + } = item; + const { dns, connect, ssl, wait, receive, total } = item.timings || {}; + const contentDownloaded = receive && receive > 0 ? receive : total; + return { + x: index, + url, + requestHeaders: formatHeaders(requestHeaders), + responseHeaders: formatHeaders(responseHeaders), + certificates: certificates + ? [ + { + name: FriendlyFlyoutLabels[Metadata.CertificateIssuer], + value: certificates.issuer, + }, + { + name: FriendlyFlyoutLabels[Metadata.CertificateIssueDate], + value: certificates.validFrom + ? moment(certificates.validFrom).format('L LT') + : undefined, + }, + { + name: FriendlyFlyoutLabels[Metadata.CertificateExpiryDate], + value: certificates.validTo ? moment(certificates.validTo).format('L LT') : undefined, + }, + { + name: FriendlyFlyoutLabels[Metadata.CertificateSubject], + value: certificates.subjectName, + }, + ] + : undefined, + details: [ + { name: FriendlyFlyoutLabels[Metadata.Status], value: status ? `${status}` : undefined }, + { name: FriendlyFlyoutLabels[Metadata.MimeType], value: mimeType }, + { + name: FriendlyFlyoutLabels[Metadata.RequestStart], + value: getFriendlyMetadataValue({ value: requestStart, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Dns], + value: getFriendlyMetadataValue({ value: dns, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Connect], + value: getFriendlyMetadataValue({ value: getConnectingTime(connect, ssl), postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Ssl], + value: getFriendlyMetadataValue({ value: ssl, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Wait], + value: getFriendlyMetadataValue({ value: wait, postFix: 'ms' }), + }, + { + name: FriendlyTimingLabels[Timings.Receive], + value: getFriendlyMetadataValue({ + value: contentDownloaded, + postFix: 'ms', + }), + }, + { + name: FriendlyFlyoutLabels[Metadata.ResourceSize], + value: getFriendlyMetadataValue({ + value: resourceSize ? resourceSize / 1000 : undefined, + postFix: 'KB', + }), + }, + { + name: FriendlyFlyoutLabels[Metadata.TransferSize], + value: getFriendlyMetadataValue({ + value: transferSize ? transferSize / 1000 : undefined, + postFix: 'KB', + }), + }, + { + name: FriendlyFlyoutLabels[Metadata.IP], + value: ip, + }, + ], + }; +}; + +export const getSidebarItems = ( + items: NetworkItems, + onlyHighlighted: boolean, + query: string, + activeFilters: string[] +): SidebarItems => { + const sideBarItems = items.map((item, index) => { + const isHighlighted = isHighlightedItem(item, query, activeFilters); + const offsetIndex = index + 1; + const { url, status, method } = item; + return { url, status, method, isHighlighted, offsetIndex, index }; + }); + if (onlyHighlighted) { + return sideBarItems.filter((item) => item.isHighlighted); + } + return sideBarItems; +}; + +export const getLegendItems = (): LegendItems => { + let timingItems: LegendItems = []; + Object.values(Timings).forEach((timing) => { + // The "receive" timing is mapped to a mime type colour, so we don't need to show this in the legend + if (timing === Timings.Receive) { + return; + } + timingItems = [ + ...timingItems, + { name: FriendlyTimingLabels[timing], colour: TIMING_PALETTE[timing] }, + ]; + }); + + let mimeTypeItems: LegendItems = []; + Object.values(MimeType).forEach((mimeType) => { + mimeTypeItems = [ + ...mimeTypeItems, + { name: FriendlyMimetypeLabels[mimeType], colour: MIME_TYPE_PALETTE[mimeType] }, + ]; + }); + + return [...timingItems, ...mimeTypeItems]; +}; + +// Timing colour palette +type TimingColourPalette = { + [K in Timings]: string; +}; + +const SAFE_PALETTE = euiPaletteColorBlind({ rotations: 2 }); + +const buildTimingPalette = (): TimingColourPalette => { + const palette = Object.values(Timings).reduce>((acc, value) => { + switch (value) { + case Timings.Blocked: + acc[value] = SAFE_PALETTE[16]; + break; + case Timings.Dns: + acc[value] = SAFE_PALETTE[0]; + break; + case Timings.Connect: + acc[value] = SAFE_PALETTE[7]; + break; + case Timings.Ssl: + acc[value] = SAFE_PALETTE[17]; + break; + case Timings.Send: + acc[value] = SAFE_PALETTE[2]; + break; + case Timings.Wait: + acc[value] = SAFE_PALETTE[11]; + break; + case Timings.Receive: + acc[value] = SAFE_PALETTE[0]; + break; + } + return acc; + }, {}); + + return palette as TimingColourPalette; +}; + +const TIMING_PALETTE = buildTimingPalette(); + +// MimeType colour palette +type MimeTypeColourPalette = { + [K in MimeType]: string; +}; + +const buildMimeTypePalette = (): MimeTypeColourPalette => { + const palette = Object.values(MimeType).reduce>((acc, value) => { + switch (value) { + case MimeType.Html: + acc[value] = SAFE_PALETTE[19]; + break; + case MimeType.Script: + acc[value] = SAFE_PALETTE[3]; + break; + case MimeType.Stylesheet: + acc[value] = SAFE_PALETTE[4]; + break; + case MimeType.Media: + acc[value] = SAFE_PALETTE[5]; + break; + case MimeType.Font: + acc[value] = SAFE_PALETTE[8]; + break; + case MimeType.XHR: + case MimeType.Other: + acc[value] = SAFE_PALETTE[9]; + break; + } + return acc; + }, {}); + + return palette as MimeTypeColourPalette; +}; + +const MIME_TYPE_PALETTE = buildMimeTypePalette(); + +type ColourPalette = TimingColourPalette & MimeTypeColourPalette; + +export const colourPalette: ColourPalette = { ...TIMING_PALETTE, ...MIME_TYPE_PALETTE }; + +export const formatTooltipHeading = (index: number, fullText: string): string => + isNaN(index) ? fullText : `${index}. ${fullText}`; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/types.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/types.ts new file mode 100644 index 000000000000..ad4c635f31d3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/types.ts @@ -0,0 +1,262 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { NetworkEvent } from '../../../../../../../../../common/runtime_types'; + +export enum Timings { + Blocked = 'blocked', + Dns = 'dns', + Connect = 'connect', + Ssl = 'ssl', + Send = 'send', + Wait = 'wait', + Receive = 'receive', +} + +export enum Metadata { + Status = 'status', + ResourceSize = 'resourceSize', + TransferSize = 'transferSize', + CertificateIssuer = 'certificateIssuer', + CertificateIssueDate = 'certificateIssueDate', + CertificateExpiryDate = 'certificateExpiryDate', + CertificateSubject = 'certificateSubject', + IP = 'ip', + MimeType = 'mimeType', + RequestStart = 'requestStart', +} + +export const FriendlyTimingLabels = { + [Timings.Blocked]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.timings.blocked', + { + defaultMessage: 'Queued / Blocked', + } + ), + [Timings.Dns]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.dns', { + defaultMessage: 'DNS', + }), + [Timings.Connect]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.timings.connect', + { + defaultMessage: 'Connecting', + } + ), + [Timings.Ssl]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.ssl', { + defaultMessage: 'TLS', + }), + [Timings.Send]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.send', { + defaultMessage: 'Sending request', + }), + [Timings.Wait]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.timings.wait', { + defaultMessage: 'Waiting (TTFB)', + }), + [Timings.Receive]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.timings.receive', + { + defaultMessage: 'Content downloading', + } + ), +}; + +export const FriendlyFlyoutLabels = { + [Metadata.Status]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.status', + { + defaultMessage: 'Status', + } + ), + [Metadata.MimeType]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.contentType', + { + defaultMessage: 'Content type', + } + ), + [Metadata.RequestStart]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.requestStart', + { + defaultMessage: 'Request start', + } + ), + [Metadata.ResourceSize]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.resourceSize', + { + defaultMessage: 'Resource size', + } + ), + [Metadata.TransferSize]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.transferSize', + { + defaultMessage: 'Transfer size', + } + ), + [Metadata.CertificateIssuer]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateIssuer', + { + defaultMessage: 'Issuer', + } + ), + [Metadata.CertificateIssueDate]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateIssueDate', + { + defaultMessage: 'Valid from', + } + ), + [Metadata.CertificateExpiryDate]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateExpiryDate', + { + defaultMessage: 'Valid until', + } + ), + [Metadata.CertificateSubject]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.metadata.certificateSubject', + { + defaultMessage: 'Common name', + } + ), + [Metadata.IP]: i18n.translate('xpack.synthetics.synthetics.waterfallChart.labels.metadata.ip', { + defaultMessage: 'IP', + }), +}; + +export const TIMING_ORDER = [ + Timings.Blocked, + Timings.Dns, + Timings.Connect, + Timings.Ssl, + Timings.Send, + Timings.Wait, + Timings.Receive, +] as const; + +export const META_DATA_ORDER_FLYOUT = [ + Metadata.MimeType, + Timings.Dns, + Timings.Connect, + Timings.Ssl, + Timings.Wait, + Timings.Receive, +] as const; + +export type CalculatedTimings = { + [K in Timings]?: number; +}; + +export enum MimeType { + Html = 'html', + Script = 'script', + Stylesheet = 'stylesheet', + Media = 'media', + Font = 'font', + XHR = 'xhr', + Other = 'other', +} + +export const FriendlyMimetypeLabels = { + [MimeType.Html]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.html', + { + defaultMessage: 'HTML', + } + ), + [MimeType.Script]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.script', + { + defaultMessage: 'JS', + } + ), + [MimeType.Stylesheet]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.stylesheet', + { + defaultMessage: 'CSS', + } + ), + [MimeType.Media]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.media', + { + defaultMessage: 'Media', + } + ), + [MimeType.Font]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.font', + { + defaultMessage: 'Font', + } + ), + [MimeType.XHR]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.xhr', + { + defaultMessage: 'XHR', + } + ), + [MimeType.Other]: i18n.translate( + 'xpack.synthetics.synthetics.waterfallChart.labels.mimeTypes.other', + { + defaultMessage: 'Other', + } + ), +}; + +// NOTE: This list tries to cover the standard spec compliant mime types, +// and a few popular non-standard ones, but it isn't exhaustive. +export const MimeTypesMap: Record = { + 'text/html': MimeType.Html, + 'application/javascript': MimeType.Script, + 'text/javascript': MimeType.Script, + 'text/css': MimeType.Stylesheet, + // Images + 'image/apng': MimeType.Media, + 'image/bmp': MimeType.Media, + 'image/gif': MimeType.Media, + 'image/x-icon': MimeType.Media, + 'image/jpeg': MimeType.Media, + 'image/png': MimeType.Media, + 'image/svg+xml': MimeType.Media, + 'image/tiff': MimeType.Media, + 'image/webp': MimeType.Media, + // Common audio / video formats + 'audio/wave': MimeType.Media, + 'audio/wav': MimeType.Media, + 'audio/x-wav': MimeType.Media, + 'audio/x-pn-wav': MimeType.Media, + 'audio/webm': MimeType.Media, + 'video/webm': MimeType.Media, + 'video/mp4': MimeType.Media, + 'audio/ogg': MimeType.Media, + 'video/ogg': MimeType.Media, + 'application/ogg': MimeType.Media, + // Fonts + 'font/otf': MimeType.Font, + 'font/ttf': MimeType.Font, + 'font/woff': MimeType.Font, + 'font/woff2': MimeType.Font, + 'application/x-font-opentype': MimeType.Font, + 'application/font-woff': MimeType.Font, + 'application/font-woff2': MimeType.Font, + 'application/vnd.ms-fontobject': MimeType.Font, + 'application/font-sfnt': MimeType.Font, + + // XHR + 'application/json': MimeType.XHR, +}; + +export type NetworkItem = NetworkEvent; +export type NetworkItems = NetworkItem[]; + +export type SidebarItem = Pick & { + isHighlighted: boolean; + index: number; + offsetIndex: number; +}; +export type SidebarItems = SidebarItem[]; + +export interface LegendItem { + name: string; + colour: string; +} +export type LegendItems = LegendItem[]; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.test.tsx new file mode 100644 index 000000000000..3802ace38f45 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.test.tsx @@ -0,0 +1,204 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { screen } from '@testing-library/react'; +import { WaterfallChartContainer } from './waterfall_chart_container'; +import { render } from '../../../../../../utils/testing'; + +const networkEvents = { + events: [ + { + timestamp: '2021-01-21T10:31:21.537Z', + method: 'GET', + url: 'https://apv-static.minute.ly/videos/v-c2a526c7-450d-428e-1244649-a390-fb639ffead96-s45.746-54.421m.mp4', + status: 206, + mimeType: 'video/mp4', + requestSentTime: 241114127.474, + loadEndTime: 241116573.402, + timings: { + total: 2445.928000001004, + queueing: 1.7399999778717756, + blocked: 0.391999987186864, + receive: 2283.964000031119, + connect: 91.5709999972023, + wait: 28.795999998692423, + proxy: -1, + dns: 36.952000024029985, + send: 0.10000000474974513, + ssl: 64.28900000173599, + }, + }, + { + timestamp: '2021-01-21T10:31:22.174Z', + method: 'GET', + url: 'https://dpm.demdex.net/ibs:dpid=73426&dpuuid=31597189268188866891125449924942215949', + status: 200, + mimeType: 'image/gif', + requestSentTime: 241114749.202, + loadEndTime: 241114805.541, + timings: { + queueing: 1.2240000069141388, + receive: 2.218999987235293, + proxy: -1, + dns: -1, + send: 0.14200000441633165, + blocked: 1.033000007737428, + total: 56.33900000248104, + wait: 51.72099999617785, + ssl: -1, + connect: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.679Z', + method: 'GET', + url: 'https://dapi.cms.mlbinfra.com/v2/content/en-us/sel-t119-homepage-mediawall', + status: 200, + mimeType: 'application/json', + requestSentTime: 241114268.04299998, + loadEndTime: 241114665.609, + timings: { + total: 397.5659999996424, + dns: 29.5429999823682, + wait: 221.6830000106711, + queueing: 2.1410000044852495, + connect: 106.95499999565072, + ssl: 69.06899999012239, + receive: 2.027999988058582, + blocked: 0.877000013133511, + send: 23.719999997410923, + proxy: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.runtime.b313577971db9c857801.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114303.84899998, + loadEndTime: 241114370.361, + timings: { + send: 1.357000001007691, + wait: 40.12299998430535, + receive: 16.78500001435168, + ssl: -1, + queueing: 2.5670000177342445, + total: 66.51200001942925, + connect: -1, + blocked: 5.680000002030283, + proxy: -1, + dns: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.modules.7a266e7acfd42f2581a5.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114305.939, + loadEndTime: 241114938.264, + timings: { + wait: 51.61500000394881, + dns: -1, + ssl: -1, + receive: 506.5750000067055, + proxy: -1, + connect: -1, + blocked: 69.51599998865277, + queueing: 4.453999979887158, + total: 632.324999984121, + send: 0.16500000492669642, + }, + }, + ], +}; + +const defaultState = { + networkEvents: { + test: { + '1': { + ...networkEvents, + total: 100, + isWaterfallSupported: true, + loading: false, + }, + }, + }, +}; + +describe('WaterfallChartContainer', () => { + beforeAll(() => { + jest.useFakeTimers(); + }); + + it('does not display waterfall chart unavailable when isWaterfallSupported is true', () => { + render(, { + state: defaultState, + }); + expect(screen.queryByText('Waterfall chart unavailable')).not.toBeInTheDocument(); + }); + + it('displays waterfall chart unavailable when isWaterfallSupported is false', () => { + const state = { + networkEvents: { + test: { + '1': { + ...networkEvents, + total: 100, + isWaterfallSupported: false, + loading: false, + }, + }, + }, + }; + render(, { + state, + }); + expect(screen.getByText('Waterfall chart unavailable')).toBeInTheDocument(); + }); + + it('displays loading bar when loading', () => { + const state = { + networkEvents: { + test: { + '1': { + ...networkEvents, + total: 100, + isWaterfallSupported: false, + loading: true, + }, + }, + }, + }; + render(, { + state, + }); + expect(screen.getByLabelText('Waterfall chart loading')).toBeInTheDocument(); + }); + + it('displays no data available message when no events are available', () => { + const state = { + networkEvents: { + test: { + '1': { + events: [], + total: 0, + isWaterfallSupported: true, + loading: false, + }, + }, + }, + }; + render(, { + state, + }); + expect(screen.getByText('No waterfall data could be found for this step')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.tsx new file mode 100644 index 000000000000..effe2c2ed42c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_container.tsx @@ -0,0 +1,112 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiText, EuiLoadingChart, EuiCallOut } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React, { useEffect } from 'react'; +import { useSelector, useDispatch } from 'react-redux'; +import { networkEventsSelector } from '../../../../../../state/network_events/selectors'; +import { getNetworkEvents } from '../../../../../../state/network_events/actions'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { WaterfallChartWrapper } from './waterfall_chart_wrapper'; +import { extractItems } from './data_formatting'; +import { useStepWaterfallMetrics } from '../use_step_waterfall_metrics'; + +export const NO_DATA_TEXT = i18n.translate( + 'xpack.synthetics.synthetics.stepDetail.waterfallNoData', + { + defaultMessage: 'No waterfall data could be found for this step', + } +); + +interface Props { + checkGroup: string; + activeStep?: JourneyStep; + stepIndex: number; +} + +export const WaterfallChartContainer: React.FC = ({ checkGroup, stepIndex, activeStep }) => { + const dispatch = useDispatch(); + + useEffect(() => { + if (checkGroup && stepIndex) { + dispatch( + getNetworkEvents({ + checkGroup, + stepIndex, + }) + ); + } + }, [dispatch, stepIndex, checkGroup]); + + const _networkEvents = useSelector(networkEventsSelector); + const networkEvents = _networkEvents[checkGroup ?? '']?.[stepIndex]; + const waterfallLoaded = networkEvents && !networkEvents.loading; + const isWaterfallSupported = networkEvents?.isWaterfallSupported; + const hasEvents = networkEvents?.events?.length > 0; + + const { metrics } = useStepWaterfallMetrics({ + checkGroup, + stepIndex, + hasNavigationRequest: networkEvents?.hasNavigationRequest, + }); + + return ( + <> + {!waterfallLoaded && ( + + + + + + )} + {waterfallLoaded && !hasEvents && ( + + + +

{NO_DATA_TEXT}

+
+
+
+ )} + {waterfallLoaded && hasEvents && isWaterfallSupported && ( + + )} + {waterfallLoaded && hasEvents && !isWaterfallSupported && ( + + } + color="warning" + iconType="help" + > + + + )} + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.test.tsx new file mode 100644 index 000000000000..94df6a4e2e69 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.test.tsx @@ -0,0 +1,311 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { act, fireEvent, waitFor } from '@testing-library/react'; +import { WaterfallChartWrapper } from './waterfall_chart_wrapper'; +import { networkItems as mockNetworkItems } from './data_formatting.test'; + +import { extractItems, isHighlightedItem } from './data_formatting'; +import { BAR_HEIGHT } from '../../waterfall/components/constants'; +import { MimeType } from './types'; +import { + FILTER_POPOVER_OPEN_LABEL, + FILTER_REQUESTS_LABEL, + FILTER_COLLAPSE_REQUESTS_LABEL, +} from '../../waterfall/components/translations'; +import { render } from '../../../../../../utils/testing'; + +const getHighLightedItems = (query: string, filters: string[]) => { + return NETWORK_EVENTS.events.filter((item) => isHighlightedItem(item, query, filters)); +}; + +describe('WaterfallChartWrapper', () => { + beforeAll(() => { + jest.useFakeTimers(); + }); + + it('renders the correct sidebar items', () => { + const { getAllByTestId } = render( + + ); + + const sideBarItems = getAllByTestId('middleTruncatedTextSROnly'); + + expect(sideBarItems).toHaveLength(5); + }); + + it('search by query works', () => { + const { getAllByTestId, getByTestId, getByLabelText } = render( + + ); + + const filterInput = getByLabelText(FILTER_REQUESTS_LABEL); + + const searchText = '.js'; + + fireEvent.change(filterInput, { target: { value: searchText } }); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const highlightedItemsLength = getHighLightedItems(searchText, []).length; + expect(getAllByTestId('sideBarHighlightedItem')).toHaveLength(highlightedItemsLength); + + expect(getAllByTestId('sideBarDimmedItem')).toHaveLength( + NETWORK_EVENTS.events.length - highlightedItemsLength + ); + + const SIDE_BAR_ITEMS_HEIGHT = NETWORK_EVENTS.events.length * BAR_HEIGHT; + expect(getByTestId('wfSidebarContainer')).toHaveAttribute('height', `${SIDE_BAR_ITEMS_HEIGHT}`); + + expect(getByTestId('wfDataOnlyBarChart')).toHaveAttribute('height', `${SIDE_BAR_ITEMS_HEIGHT}`); + }); + + it('search by mime type works', () => { + const { getAllByTestId, getByLabelText, getAllByText } = render( + + ); + + const sideBarItems = getAllByTestId('middleTruncatedTextSROnly'); + + expect(sideBarItems).toHaveLength(5); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + fireEvent.click(getAllByText('XHR')[1]); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const highlightedItemsLength = getHighLightedItems('', [MimeType.XHR]).length; + + expect(getAllByTestId('sideBarHighlightedItem')).toHaveLength(highlightedItemsLength); + expect(getAllByTestId('sideBarDimmedItem')).toHaveLength( + NETWORK_EVENTS.events.length - highlightedItemsLength + ); + }); + + it('renders sidebar even when filter matches 0 resources', () => { + const { getAllByTestId, getByLabelText, getAllByText, queryAllByTestId } = render( + + ); + + const sideBarItems = getAllByTestId('middleTruncatedTextSROnly'); + + expect(sideBarItems).toHaveLength(5); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + fireEvent.click(getAllByText('CSS')[1]); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const highlightedItemsLength = getHighLightedItems('', [MimeType.Stylesheet]).length; + + // no CSS items found + expect(queryAllByTestId('sideBarHighlightedItem')).toHaveLength(0); + expect(getAllByTestId('sideBarDimmedItem')).toHaveLength( + NETWORK_EVENTS.events.length - highlightedItemsLength + ); + + fireEvent.click(getByLabelText(FILTER_COLLAPSE_REQUESTS_LABEL)); + + // filter bar is still accessible even when no resources match filter + expect(getByLabelText(FILTER_REQUESTS_LABEL)).toBeInTheDocument(); + + // no resources items are in the chart as none match filter + expect(queryAllByTestId('sideBarHighlightedItem')).toHaveLength(0); + expect(queryAllByTestId('sideBarDimmedItem')).toHaveLength(0); + }); + + it('opens flyout on sidebar click and closes on flyout close button', async () => { + const { getByText, getByTestId, queryByText, getByRole } = render( + + ); + + expect(getByText(`${mockNetworkItems[0].url}`)).toBeInTheDocument(); + expect(getByText(`1.`)).toBeInTheDocument(); + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + + // open flyout + // selector matches both button and accessible text. Button is the second element in the array; + const sidebarButton = getByTestId(`middleTruncatedTextButton1`); + fireEvent.click(sidebarButton); + + // check for sample flyout items + await waitFor(() => { + const waterfallFlyout = getByRole('dialog'); + expect(waterfallFlyout).toBeInTheDocument(); + expect(getByText('Content type')).toBeInTheDocument(); + expect(getByText(`${mockNetworkItems[0]?.mimeType}`)).toBeInTheDocument(); + // close flyout + const closeButton = getByTestId('euiFlyoutCloseButton'); + fireEvent.click(closeButton); + }); + + /* check that sample flyout items are gone from the DOM */ + await waitFor(() => { + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + }); + }); + + it('opens flyout on sidebar click and closes on second sidebar click', async () => { + const { getByText, getByTestId, queryByText } = render( + + ); + + expect(getByText(`${mockNetworkItems[0].url}`)).toBeInTheDocument(); + expect(getByText(`1.`)).toBeInTheDocument(); + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + + // open flyout + // selector matches both button and accessible text. Button is the second element in the array; + const sidebarButton = getByTestId(`middleTruncatedTextButton1`); + fireEvent.click(sidebarButton); + + // check for sample flyout items and that the flyout is focused + await waitFor(() => { + const waterfallFlyout = getByTestId('waterfallFlyout'); + expect(waterfallFlyout).toBeInTheDocument(); + expect(getByText('Content type')).toBeInTheDocument(); + expect(getByText(`${mockNetworkItems[0]?.mimeType}`)).toBeInTheDocument(); + }); + + fireEvent.click(sidebarButton); + + /* check that sample flyout items are gone from the DOM */ + await waitFor(() => { + expect(queryByText('Content type')).not.toBeInTheDocument(); + expect(queryByText(`${mockNetworkItems[0]?.mimeType}`)).not.toBeInTheDocument(); + }); + }); +}); + +const NETWORK_EVENTS = { + events: [ + { + timestamp: '2021-01-21T10:31:21.537Z', + method: 'GET', + url: 'https://apv-static.minute.ly/videos/v-c2a526c7-450d-428e-1244649-a390-fb639ffead96-s45.746-54.421m.mp4', + status: 206, + mimeType: 'video/mp4', + requestSentTime: 241114127.474, + loadEndTime: 241116573.402, + timings: { + total: 2445.928000001004, + queueing: 1.7399999778717756, + blocked: 0.391999987186864, + receive: 2283.964000031119, + connect: 91.5709999972023, + wait: 28.795999998692423, + proxy: -1, + dns: 36.952000024029985, + send: 0.10000000474974513, + ssl: 64.28900000173599, + }, + }, + { + timestamp: '2021-01-21T10:31:22.174Z', + method: 'GET', + url: 'https://dpm.demdex.net/ibs:dpid=73426&dpuuid=31597189268188866891125449924942215949', + status: 200, + mimeType: 'image/gif', + requestSentTime: 241114749.202, + loadEndTime: 241114805.541, + timings: { + queueing: 1.2240000069141388, + receive: 2.218999987235293, + proxy: -1, + dns: -1, + send: 0.14200000441633165, + blocked: 1.033000007737428, + total: 56.33900000248104, + wait: 51.72099999617785, + ssl: -1, + connect: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.679Z', + method: 'GET', + url: 'https://dapi.cms.mlbinfra.com/v2/content/en-us/sel-t119-homepage-mediawall', + status: 200, + mimeType: 'application/json', + requestSentTime: 241114268.04299998, + loadEndTime: 241114665.609, + timings: { + total: 397.5659999996424, + dns: 29.5429999823682, + wait: 221.6830000106711, + queueing: 2.1410000044852495, + connect: 106.95499999565072, + ssl: 69.06899999012239, + receive: 2.027999988058582, + blocked: 0.877000013133511, + send: 23.719999997410923, + proxy: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.runtime.b313577971db9c857801.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114303.84899998, + loadEndTime: 241114370.361, + timings: { + send: 1.357000001007691, + wait: 40.12299998430535, + receive: 16.78500001435168, + ssl: -1, + queueing: 2.5670000177342445, + total: 66.51200001942925, + connect: -1, + blocked: 5.680000002030283, + proxy: -1, + dns: -1, + }, + }, + { + timestamp: '2021-01-21T10:31:21.740Z', + method: 'GET', + url: 'https://platform.twitter.com/embed/embed.modules.7a266e7acfd42f2581a5.js', + status: 200, + mimeType: 'application/javascript', + requestSentTime: 241114305.939, + loadEndTime: 241114938.264, + timings: { + wait: 51.61500000394881, + dns: -1, + ssl: -1, + receive: 506.5750000067055, + proxy: -1, + connect: -1, + blocked: 69.51599998865277, + queueing: 4.453999979887158, + total: 632.324999984121, + send: 0.16500000492669642, + }, + }, + ], +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.tsx new file mode 100644 index 000000000000..724b06167ca3 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_chart_wrapper.tsx @@ -0,0 +1,158 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useMemo, useState } from 'react'; +import { EuiHealth } from '@elastic/eui'; +import { useTrackMetric, METRIC_TYPE } from '@kbn/observability-plugin/public'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { getSeriesAndDomain, getSidebarItems, getLegendItems } from './data_formatting'; +import { SidebarItem, LegendItem, NetworkItems } from './types'; +import { WaterfallProvider, WaterfallChart, RenderItem, useFlyout } from '../../waterfall'; +import { WaterfallFilter } from './waterfall_filter'; +import { WaterfallFlyout } from './waterfall_flyout'; +import { WaterfallSidebarItem } from './waterfall_sidebar_item'; +import { MarkerItems } from '../../waterfall/context/waterfall_chart'; + +export const renderLegendItem: RenderItem = (item) => { + return ( + + {item.name} + + ); +}; + +interface Props { + total: number; + activeStep?: JourneyStep; + data: NetworkItems; + markerItems?: MarkerItems; +} + +export const WaterfallChartWrapper: React.FC = ({ + data, + total, + markerItems, + activeStep, +}) => { + const [query, setQuery] = useState(''); + const [activeFilters, setActiveFilters] = useState([]); + const [onlyHighlighted, setOnlyHighlighted] = useState(false); + + const [networkData] = useState(data); + + const hasFilters = activeFilters.length > 0; + + const { series, domain, metadata, totalHighlightedRequests } = useMemo(() => { + return getSeriesAndDomain(networkData, onlyHighlighted, query, activeFilters); + }, [networkData, query, activeFilters, onlyHighlighted]); + + const sidebarItems = useMemo(() => { + return getSidebarItems(networkData, onlyHighlighted, query, activeFilters); + }, [networkData, query, activeFilters, onlyHighlighted]); + + const legendItems = useMemo(() => { + return getLegendItems(); + }, []); + + const { + flyoutData, + onBarClick, + onProjectionClick, + onSidebarClick, + isFlyoutVisible, + onFlyoutClose, + } = useFlyout(metadata); + + const renderFilter = useCallback(() => { + return ( + + ); + }, [activeFilters, setActiveFilters, onlyHighlighted, setOnlyHighlighted, query, setQuery]); + + const renderFlyout = useCallback(() => { + return ( + + ); + }, [flyoutData, isFlyoutVisible, onFlyoutClose]); + + const highestSideBarIndex = Math.max(...series.map((sr) => sr.x)); + + const renderSidebarItem: RenderItem = useCallback( + (item) => { + return ( + + ); + }, + [hasFilters, onlyHighlighted, onSidebarClick, highestSideBarIndex] + ); + + useTrackMetric({ app: 'uptime', metric: 'waterfall_chart_view', metricType: METRIC_TYPE.COUNT }); + useTrackMetric({ + app: 'uptime', + metric: 'waterfall_chart_view', + metricType: METRIC_TYPE.COUNT, + delay: 15000, + }); + + return ( + { + return {tooltipProps?.value}; + }, [])} + > + `${Number(d).toFixed(0)} ms`, [])} + domain={domain} + barStyleAccessor={useCallback(({ datum }) => { + if (!datum.config?.isHighlighted) { + return { + rect: { + fill: datum.config?.colour, + opacity: '0.1', + }, + }; + } + return datum.config.colour; + }, [])} + renderSidebarItem={renderSidebarItem} + renderLegendItem={renderLegendItem} + renderFlyout={renderFlyout} + renderFilter={renderFilter} + fullHeight={true} + /> + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.test.tsx new file mode 100644 index 000000000000..0a85cf4d13bc --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.test.tsx @@ -0,0 +1,153 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { act, fireEvent } from '@testing-library/react'; +import 'jest-canvas-mock'; +import { MIME_FILTERS, WaterfallFilter } from './waterfall_filter'; +import { + FILTER_REQUESTS_LABEL, + FILTER_COLLAPSE_REQUESTS_LABEL, + FILTER_POPOVER_OPEN_LABEL, +} from '../../waterfall/components/translations'; +import { render } from '../../../../../../utils/testing'; + +describe('waterfall filter', () => { + jest.useFakeTimers(); + + it('renders correctly', () => { + const { getByLabelText, getByTitle } = render( + + ); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + MIME_FILTERS.forEach((filter) => { + expect(getByTitle(filter.label)); + }); + }); + + it('filter icon changes color on active/inactive filters', () => { + const Component = () => { + const [activeFilters, setActiveFilters] = useState([]); + + return ( + + ); + }; + const { getByLabelText, getByTitle } = render(); + + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + + fireEvent.click(getByTitle('XHR')); + + expect(getByLabelText(FILTER_POPOVER_OPEN_LABEL)).toHaveAttribute( + 'class', + 'euiButtonIcon euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall' + ); + + // toggle it back to inactive + fireEvent.click(getByTitle('XHR')); + + expect(getByLabelText(FILTER_POPOVER_OPEN_LABEL)).toHaveAttribute( + 'class', + 'euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall' + ); + }); + + it('search input is working properly', () => { + const setQuery = jest.fn(); + + const Component = () => { + return ( + + ); + }; + const { getByLabelText } = render(); + + const testText = 'js'; + + fireEvent.change(getByLabelText(FILTER_REQUESTS_LABEL), { target: { value: testText } }); + + // inout has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + expect(setQuery).toHaveBeenCalledWith(testText); + }); + + it('resets checkbox when filters are removed', () => { + const Component = () => { + const [onlyHighlighted, setOnlyHighlighted] = useState(false); + const [query, setQuery] = useState(''); + const [activeFilters, setActiveFilters] = useState([]); + return ( + + ); + }; + const { getByLabelText, getByTitle } = render(); + const input = getByLabelText(FILTER_REQUESTS_LABEL); + // apply filters + const testText = 'js'; + fireEvent.change(input, { target: { value: testText } }); + fireEvent.click(getByLabelText(FILTER_POPOVER_OPEN_LABEL)); + const filterGroupButton = getByTitle('XHR'); + fireEvent.click(filterGroupButton); + + // input has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + const collapseCheckbox = getByLabelText(FILTER_COLLAPSE_REQUESTS_LABEL) as HTMLInputElement; + expect(collapseCheckbox).not.toBeDisabled(); + fireEvent.click(collapseCheckbox); + expect(collapseCheckbox).toBeChecked(); + + // remove filters + fireEvent.change(input, { target: { value: '' } }); + fireEvent.click(filterGroupButton); + + // input has debounce effect so hence the timer + act(() => { + jest.advanceTimersByTime(300); + }); + + // expect the checkbox to reset to disabled and unchecked + expect(collapseCheckbox).not.toBeChecked(); + expect(collapseCheckbox).toBeDisabled(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.tsx new file mode 100644 index 000000000000..5531dafd4542 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_filter.tsx @@ -0,0 +1,192 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { Dispatch, SetStateAction, useEffect, useState } from 'react'; +import { + EuiButtonIcon, + EuiCheckbox, + EuiFieldSearch, + EuiFilterButton, + EuiFilterGroup, + EuiFlexGroup, + EuiFlexItem, + EuiPopover, + EuiSpacer, +} from '@elastic/eui'; +import useDebounce from 'react-use/lib/useDebounce'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { + FILTER_REQUESTS_LABEL, + FILTER_SCREENREADER_LABEL, + FILTER_REMOVE_SCREENREADER_LABEL, + FILTER_POPOVER_OPEN_LABEL, + FILTER_COLLAPSE_REQUESTS_LABEL, +} from '../../waterfall/components/translations'; +import { MimeType, FriendlyMimetypeLabels } from './types'; + +interface Props { + query: string; + activeFilters: string[]; + setActiveFilters: Dispatch>; + setQuery: (val: string) => void; + onlyHighlighted: boolean; + setOnlyHighlighted: (val: boolean) => void; +} + +export const MIME_FILTERS = [ + { + label: FriendlyMimetypeLabels[MimeType.XHR], + mimeType: MimeType.XHR, + }, + { + label: FriendlyMimetypeLabels[MimeType.Html], + mimeType: MimeType.Html, + }, + { + label: FriendlyMimetypeLabels[MimeType.Script], + mimeType: MimeType.Script, + }, + { + label: FriendlyMimetypeLabels[MimeType.Stylesheet], + mimeType: MimeType.Stylesheet, + }, + { + label: FriendlyMimetypeLabels[MimeType.Font], + mimeType: MimeType.Font, + }, + { + label: FriendlyMimetypeLabels[MimeType.Media], + mimeType: MimeType.Media, + }, + { + label: FriendlyMimetypeLabels[MimeType.Other], + mimeType: MimeType.Other, + }, +]; + +export const WaterfallFilter = ({ + query, + setQuery, + activeFilters, + setActiveFilters, + onlyHighlighted, + setOnlyHighlighted, +}: Props) => { + const [value, setValue] = useState(query); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + + const trackMetric = useUiTracker({ app: 'uptime' }); + + const toggleFilters = (val: string) => { + setActiveFilters((prevState) => + prevState.includes(val) ? prevState.filter((filter) => filter !== val) : [...prevState, val] + ); + }; + useDebounce( + () => { + setQuery(value); + }, + 250, + [value] + ); + + /* reset checkbox when there is no query or active filters + * this prevents the checkbox from being checked in a disabled state */ + useEffect(() => { + if (!(query || activeFilters.length > 0)) { + setOnlyHighlighted(false); + } + }, [activeFilters.length, setOnlyHighlighted, query]); + + // indicates use of the query input box + useEffect(() => { + if (query) { + trackMetric({ metric: 'waterfall_filter_input_changed', metricType: METRIC_TYPE.CLICK }); + } + }, [query, trackMetric]); + + // indicates the collapse to show only highlighted checkbox has been clicked + useEffect(() => { + if (onlyHighlighted) { + trackMetric({ + metric: 'waterfall_filter_collapse_checked', + metricType: METRIC_TYPE.CLICK, + }); + } + }, [onlyHighlighted, trackMetric]); + + // indicates filters have been applied or changed + useEffect(() => { + if (activeFilters.length > 0) { + trackMetric({ + metric: `waterfall_filters_applied_changed`, + metricType: METRIC_TYPE.CLICK, + }); + } + }, [activeFilters, trackMetric]); + + return ( + + + { + setValue(evt.target.value); + }} + value={value} + /> + + + setIsPopoverOpen((prevState) => !prevState)} + color={activeFilters.length > 0 ? 'primary' : 'text'} + isSelected={activeFilters.length > 0} + /> + } + isOpen={isPopoverOpen} + closePopover={() => setIsPopoverOpen(false)} + anchorPosition="rightCenter" + > + + {MIME_FILTERS.map(({ label, mimeType }) => ( + toggleFilters(mimeType)} + key={label} + withNext={true} + aria-label={`${ + activeFilters.includes(mimeType) + ? FILTER_REMOVE_SCREENREADER_LABEL + : FILTER_SCREENREADER_LABEL + } ${label}`} + > + {label} + + ))} + + + 0)} + id="onlyHighlighted" + label={FILTER_COLLAPSE_REQUESTS_LABEL} + checked={onlyHighlighted} + onChange={(e) => { + setOnlyHighlighted(e.target.checked); + }} + /> + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.test.tsx new file mode 100644 index 000000000000..278ac92bd915 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.test.tsx @@ -0,0 +1,139 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { + WaterfallFlyout, + DETAILS, + CERTIFICATES, + REQUEST_HEADERS, + RESPONSE_HEADERS, +} from './waterfall_flyout'; +import { WaterfallMetadataEntry } from '../../waterfall/types'; +import { render } from '../../../../../../utils/testing'; + +describe('WaterfallFlyout', () => { + const flyoutData: WaterfallMetadataEntry = { + x: 0, + url: 'http://elastic.co', + requestHeaders: undefined, + responseHeaders: undefined, + certificates: undefined, + details: [ + { + name: 'Content type', + value: 'text/html', + }, + ], + }; + + const defaultProps = { + flyoutData, + isFlyoutVisible: true, + onFlyoutClose: () => null, + }; + + it('displays flyout information and omits sections that are undefined', () => { + const { getByText, queryByText } = render(); + + expect(getByText(flyoutData.url)).toBeInTheDocument(); + expect(queryByText(DETAILS)).toBeInTheDocument(); + flyoutData.details.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + + expect(queryByText(CERTIFICATES)).not.toBeInTheDocument(); + expect(queryByText(REQUEST_HEADERS)).not.toBeInTheDocument(); + expect(queryByText(RESPONSE_HEADERS)).not.toBeInTheDocument(); + }); + + it('displays flyout certificates information', () => { + const certificates = [ + { + name: 'Issuer', + value: 'Sample Issuer', + }, + { + name: 'Valid From', + value: 'January 1, 2020 7:00PM', + }, + { + name: 'Valid Until', + value: 'January 31, 2020 7:00PM', + }, + { + name: 'Common Name', + value: '*.elastic.co', + }, + ]; + const flyoutDataWithCertificates = { + ...flyoutData, + certificates, + }; + + const { getByText } = render( + + ); + + expect(getByText(flyoutData.url)).toBeInTheDocument(); + expect(getByText(DETAILS)).toBeInTheDocument(); + expect(getByText(CERTIFICATES)).toBeInTheDocument(); + flyoutData.certificates?.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + }); + + it('displays flyout request and response headers information', () => { + const requestHeaders = [ + { + name: 'sample_request_header', + value: 'Sample Request Header value', + }, + ]; + const responseHeaders = [ + { + name: 'sample_response_header', + value: 'sample response header value', + }, + ]; + const flyoutDataWithHeaders = { + ...flyoutData, + requestHeaders, + responseHeaders, + }; + const { getByText } = render( + + ); + + expect(getByText(flyoutData.url)).toBeInTheDocument(); + expect(getByText(DETAILS)).toBeInTheDocument(); + expect(getByText(REQUEST_HEADERS)).toBeInTheDocument(); + expect(getByText(RESPONSE_HEADERS)).toBeInTheDocument(); + flyoutData.requestHeaders?.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + flyoutData.responseHeaders?.forEach((detail) => { + expect(getByText(detail.name)).toBeInTheDocument(); + expect(getByText(`${detail.value}`)).toBeInTheDocument(); + }); + }); + + it('renders null when isFlyoutVisible is false', () => { + const { queryByText } = render(); + + expect(queryByText(flyoutData.url)).not.toBeInTheDocument(); + }); + + it('renders null when flyoutData is undefined', () => { + const { queryByText } = render(); + + expect(queryByText(flyoutData.url)).not.toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.tsx new file mode 100644 index 000000000000..4c78010e9c4e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_flyout.tsx @@ -0,0 +1,131 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useRef } from 'react'; + +import styled from 'styled-components'; + +import { + EuiFlyout, + EuiFlyoutHeader, + EuiFlyoutBody, + EuiTitle, + EuiSpacer, + EuiFlexItem, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { METRIC_TYPE, useUiTracker } from '@kbn/observability-plugin/public'; +import { Table } from '../../waterfall/components/waterfall_flyout_table'; +import { MiddleTruncatedText } from '../../waterfall'; +import { WaterfallMetadataEntry } from '../../waterfall/types'; +import { OnFlyoutClose } from '../../waterfall/components/use_flyout'; + +export const DETAILS = i18n.translate('xpack.synthetics.synthetics.waterfall.flyout.details', { + defaultMessage: 'Details', +}); + +export const CERTIFICATES = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.flyout.certificates', + { + defaultMessage: 'Certificate headers', + } +); + +export const REQUEST_HEADERS = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.flyout.requestHeaders', + { + defaultMessage: 'Request headers', + } +); + +export const RESPONSE_HEADERS = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.flyout.responseHeaders', + { + defaultMessage: 'Response headers', + } +); + +const FlyoutContainer = styled(EuiFlyout)` + z-index: ${(props) => props.theme.eui.euiZLevel5}; +`; + +export interface WaterfallFlyoutProps { + flyoutData?: WaterfallMetadataEntry; + onFlyoutClose: OnFlyoutClose; + isFlyoutVisible?: boolean; +} + +export const WaterfallFlyout = ({ + flyoutData, + isFlyoutVisible, + onFlyoutClose, +}: WaterfallFlyoutProps) => { + const flyoutRef = useRef(null); + const trackMetric = useUiTracker({ app: 'uptime' }); + + useEffect(() => { + if (isFlyoutVisible && flyoutData && flyoutRef.current) { + flyoutRef.current?.focus(); + } + }, [flyoutData, isFlyoutVisible, flyoutRef]); + + if (!flyoutData || !isFlyoutVisible) { + return null; + } + + const { x, url, details, certificates, requestHeaders, responseHeaders } = flyoutData; + + trackMetric({ metric: 'waterfall_flyout', metricType: METRIC_TYPE.CLICK }); + + return ( +
+ + + +

+ + + +

+
+
+ + + {!!requestHeaders && ( + <> + +
+ + )} + {!!responseHeaders && ( + <> + +
+ + )} + {!!certificates && ( + <> + +
+ + )} + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.test.tsx new file mode 100644 index 000000000000..c9fbcd224425 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.test.tsx @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import 'jest-canvas-mock'; +import { fireEvent } from '@testing-library/react'; + +import { SidebarItem } from './types'; +import { WaterfallSidebarItem } from './waterfall_sidebar_item'; +import { SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL } from '../../waterfall/components/translations'; +import { getChunks } from '../../waterfall/components/middle_truncated_text'; +import { render } from '../../../../../../utils/testing'; + +describe('waterfall filter', () => { + const url = 'http://www.elastic.co/observability/uptime'; + const index = 0; + const offsetIndex = index + 1; + const item: SidebarItem = { + url, + isHighlighted: true, + index, + offsetIndex, + }; + + it('renders sidebar item', () => { + const { getByText } = render(); + + const chunks = getChunks(url.replace('http://www.', '')); + + expect(getByText(`${offsetIndex}. ${chunks.first}`)); + expect(getByText(`${chunks.last}`)); + }); + + it('render screen reader text when renderFilterScreenReaderText is true', () => { + const { getByLabelText } = render( + + ); + + expect( + getByLabelText(`${SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL} ${url}`) + ).toBeInTheDocument(); + }); + + it('does not render screen reader text when renderFilterScreenReaderText is false', () => { + const onClick = jest.fn(); + const { getByRole } = render( + + ); + const button = getByRole('button'); + fireEvent.click(button); + + expect(button).toBeInTheDocument(); + expect(onClick).toBeCalled(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.tsx new file mode 100644 index 000000000000..193fe3312163 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/step_detail/waterfall/waterfall_sidebar_item.tsx @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { RefObject, useMemo, useCallback, useState } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiBadge } from '@elastic/eui'; +import { SidebarItem } from './types'; +import { MiddleTruncatedText } from '../../waterfall'; +import { SideBarItemHighlighter } from '../../waterfall/components/styles'; +import { SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL } from '../../waterfall/components/translations'; +import { OnSidebarClick } from '../../waterfall/components/use_flyout'; + +interface SidebarItemProps { + item: SidebarItem; + renderFilterScreenReaderText?: boolean; + onClick?: OnSidebarClick; + highestIndex: number; +} + +export const WaterfallSidebarItem = ({ + item, + highestIndex, + renderFilterScreenReaderText, + onClick, +}: SidebarItemProps) => { + const [buttonRef, setButtonRef] = useState>(); + const { status, offsetIndex, index, isHighlighted, url } = item; + + const handleSidebarClick = useMemo(() => { + if (onClick) { + return () => onClick({ buttonRef, networkItemIndex: index }); + } + }, [buttonRef, index, onClick]); + + const setRef = useCallback((ref) => setButtonRef(ref), [setButtonRef]); + + const isErrorStatusCode = (statusCode: number) => { + const is400 = statusCode >= 400 && statusCode <= 499; + const is500 = statusCode >= 500 && statusCode <= 599; + const isSpecific300 = statusCode === 301 || statusCode === 307 || statusCode === 308; + return is400 || is500 || isSpecific300; + }; + + const text = item.url; + + const ariaLabel = `${ + isHighlighted && renderFilterScreenReaderText + ? `${SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL} ` + : '' + }${text}`; + + return ( + + {!status || !isErrorStatusCode(status) ? ( + + + + + + ) : ( + + + + + + {status} + + + )} + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/translations.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/translations.ts new file mode 100644 index 000000000000..cf7ab30c8867 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/translations.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 { i18n } from '@kbn/i18n'; + +export const VIEW_PERFORMANCE = i18n.translate( + 'xpack.synthetics.pingList.synthetics.performanceBreakDown', + { + defaultMessage: 'View performance breakdown', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/README.md b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/README.md new file mode 100644 index 000000000000..cf8d3b5345ea --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/README.md @@ -0,0 +1,123 @@ +# Waterfall chart + +## Introduction + +The waterfall chart component aims to be agnostic in it's approach, so that a variety of consumers / solutions can use it. Some of Elastic Chart's features are used in a non-standard way to facilitate this flexibility, this README aims to cover some of the things that might be less obvious, and also provides a high level overview of implementation. + +## Requirements for usage + +The waterfall chart component asssumes that the consumer is making use of `KibanaReactContext`, and as such things like `useKibana` can be called. + +Consumers are also expected to be using the `` so that the waterfall chart can apply styled-component styles based on the EUI theme. + +These are the two hard requirements, but almost all plugins will be using these. + +## Rendering + +At it's core the watefall chart is a stacked bar chart that has been rotated through 90 degrees. As such it's important to understand that `x` is now represented as `y` and vice versa. + +## Flexibility + +This section aims to cover some things that are non-standard. + +### Tooltip + +By default the formatting of tooltip values is very basic, but for a waterfall chart there needs to be a great deal of flexibility to represent whatever breakdown you're trying to show. + +As such a custom tooltip component is used. This custom component would usually only have access to some basic props that pertain to the values of the hovered bar. The waterfall chart component extends this by making us of a waterfall chart context. + +The custom tooltip component can use the context to access the full set of chart data, find the relevant items (those with the same `x` value) and call a custom `renderTooltipItem` for each item, `renderTooltipItem` will be passed `item.config.tooltipProps`. Every consumer can choose what they use for their `tooltipProps`. + +Some consumers might need colours, some might need iconography and so on. The waterfall chart doesn't make assumptions, and will render out the React content returned by `renderTooltipItem`. + +IMPORTANT: `renderTooltipItem` is provided via context and not as a direct prop due to the fact the custom tooltip component would usually only have access to the props provided directly to it from Elastic Charts. + +### Colours + +The easiest way to facilitate specific colours for each stack (let's say your colours are mapped to a constraint like mime type) is to assign the colour directly on your datum `config` property, and then access this directly in the `barStyleAccessor` function, e.g. + +``` +barStyleAccessor={(datum) => { + return datum.datum.config.colour; +}) +``` + +### Config + +The notion of `config` has been mentioned already. But this is a place that consumers can store their solution specific properties. `renderTooltipItem` will make use of `config.tooltipProps`, and `barStyleAccessor` can make use of anything on `config`. + +### Sticky top axis + +By default there is no "sticky" axis functionality in Elastic Charts, therefore a second chart is rendered, this contains a replica of the top axis, and renders one empty data point (as a chart can't only have an axis). This second chart is then positioned in such a way that it covers the top of the real axis, and remains fixed. + +## Data + +The waterfall chart expects data in a relatively simple format, there are the usual plot properties (`x`, `y0`, and `y`) and then `config`. E.g. + +``` +const series = [ + {x: 0, y: 0, y: 100, config: { tooltipProps: { type: 'dns' }}}, + {x: 0, y0: 300, y: 500, config: { tooltipProps: { type: 'ssl' }}}, + {x: 1, y0: 250, y: 300, config: { tooltipProps: { propA: 'somethingBreakdownRelated' }}}, + {x: 1, y0: 500, y: 600, config: { tooltipProps: { propA: 'anotherBreakdown' }}}, +] +``` + +Gaps in bars are fine, and to be expected for certain solutions. + +## Sidebar items + +The waterfall chart component again doesn't make assumptions about consumer's sidebar items' content, but the waterfall chart does handle the rendering so the sidebar can be aligned and rendered properly alongside the chart itself. + +`sidebarItems` should be provided to the context, and a `renderSidebarItem` prop should be provided to the chart. + +A sidebar is optional. + +There is a great deal of flexibility here so that solutions can make use of this in the way they need. For example, if you'd like to add a toggle functionality, so that clicking an item shows / hides it's children, this would involve rendering your toggle in `renderSidebarItem` and then when clicked you can handle adjusting your data as necessary. + +IMPORTANT: It is important to understand that the chart itself makes use of a fixed height. The sidebar will create a space that has a matching height. Each item is assigned equal space vertically via Flexbox, so that the items align with the relevant bar to the right (these are two totally different rendering contexts, with the chart itself sitting within a `canvas` element). So it's important that whatever content you choose to render here doesn't exceed the available height available to each item. The chart's height is calculated as `numberOfBars * 32`, so content should be kept within that `32px` threshold. + +## Legend items + +Much the same as with the sidebar items, no assumptions are made here, solutions will have different aims. + +`legendItems` should be provided to the context, and a `renderLegendItem` prop should be provided to the chart. + +A legend is optional. + +## Overall usage + +Pulling all of this together, things look like this (for a specific solution): + +``` +const renderSidebarItem: RenderItem = (item, index) => { + return ; +}; + +const renderLegendItem: RenderItem = (item) => { + return {item.name}; +}; + + { + return {tooltipProps.value}; + }} +> + `${Number(d).toFixed(0)} ms`} + domain={{ min: domain.min, max: domain.max }} + barStyleAccessor={(datum) => { + return datum.datum.config.colour; + }} + renderSidebarItem={renderSidebarItem} + renderLegendItem={renderLegendItem} + /> + +``` + +A solution could easily forego a sidebar and legend for a more minimalistic view, e.g. maybe a mini waterfall within a table column. + + diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/constants.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/constants.ts new file mode 100644 index 000000000000..d36cb025f3c2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/constants.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// Pixel value +export const BAR_HEIGHT = 24; +// Flex grow value +export const MAIN_GROW_SIZE = 8; +// Flex grow value +export const SIDEBAR_GROW_SIZE = 2; +// Axis height +// NOTE: This isn't a perfect solution - changes in font size etc within charts could change the ideal height here. +export const FIXED_AXIS_HEIGHT = 24; + +// number of items to display in canvas, since canvas can only have limited size +export const CANVAS_MAX_ITEMS = 150; + +export const CHART_LEGEND_PADDING = 33; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/legend.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/legend.tsx new file mode 100644 index 000000000000..3fdfe2c65f0a --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/legend.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { IWaterfallContext } from '../context/waterfall_chart'; +import { WaterfallChartProps } from './waterfall_chart'; + +interface LegendProps { + items: Required['legendItems']; + render: Required['renderLegendItem']; +} + +const StyledFlexItem = euiStyled(EuiFlexItem)` + margin-right: ${(props) => props.theme.eui.euiSizeM}; + max-width: 7%; + min-width: 160px; +`; + +export const Legend: React.FC = ({ items, render }) => { + return ( + + {items.map((item, index) => ( + {render(item, index)} + ))} + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.test.tsx new file mode 100644 index 000000000000..707a561043b4 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.test.tsx @@ -0,0 +1,99 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { within, fireEvent, waitFor } from '@testing-library/react'; +import { getChunks, MiddleTruncatedText } from './middle_truncated_text'; +import { render } from '../../../../../../utils/testing'; + +const longString = + 'this-is-a-really-really-really-really-really-really-really-really-long-string.madeup.extension'; +const first = 'this-is-a-really-really-really-really-really-really-really-really-long-string.made'; +const last = 'up.extension'; + +describe('getChunks', () => { + it('Calculates chunks correctly', () => { + const result = getChunks(longString); + expect(result).toEqual({ + first, + last, + }); + }); +}); + +describe('Component', () => { + const url = 'http://www.elastic.co'; + it('renders truncated text and aria label', () => { + const { getByText, getByLabelText } = render( + + ); + + expect(getByText(first)).toBeInTheDocument(); + expect(getByText(last)).toBeInTheDocument(); + + expect(getByLabelText(longString)).toBeInTheDocument(); + }); + + it('renders screen reader only text', () => { + const { getByTestId } = render( + + ); + + const { getByText } = within(getByTestId('middleTruncatedTextSROnly')); + + expect(getByText(longString)).toBeInTheDocument(); + }); + + it('renders external link', () => { + const { getByText } = render( + + ); + const link = getByText('Open resource in new tab').closest('a'); + + expect(link).toHaveAttribute('href', url); + expect(link).toHaveAttribute('target', '_blank'); + }); + + it('renders a button when onClick function is passed', async () => { + const handleClick = jest.fn(); + const { getByTestId } = render( + + ); + const button = getByTestId('middleTruncatedTextButton1'); + fireEvent.click(button); + + await waitFor(() => { + expect(handleClick).toBeCalled(); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.tsx new file mode 100644 index 000000000000..7da52b2ce9bc --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/middle_truncated_text.tsx @@ -0,0 +1,185 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + EuiButtonEmpty, + EuiScreenReaderOnly, + EuiToolTip, + EuiLink, + EuiText, + EuiIcon, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { WaterfallTooltipContent } from './waterfall_tooltip_content'; +import { WaterfallChartTooltip } from './styles'; +import { FIXED_AXIS_HEIGHT } from './constants'; +import { formatTooltipHeading } from '../../step_detail/waterfall/data_formatting'; + +interface Props { + index: number; + highestIndex: number; + ariaLabel: string; + text: string; + onClick?: (event: React.MouseEvent) => void; + setButtonRef?: (ref: HTMLButtonElement | HTMLAnchorElement | null) => void; + url: string; +} + +const OuterContainer = euiStyled.span` + position: relative; + display: inline-flex; + align-items: center; + .euiToolTipAnchor { + min-width: 0; + } +`; // NOTE: min-width: 0 ensures flexbox and no-wrap children can co-exist + +const InnerContainer = euiStyled.span` + overflow: hidden; + display: flex; + align-items: center; +`; + +const IndexNumber = euiStyled(EuiText)` + font-family: ${(props) => props.theme.eui.euiCodeFontFamily}; + margin-right: ${(props) => props.theme.eui.euiSizeXS}; + line-height: ${FIXED_AXIS_HEIGHT}px; + text-align: right; + background-color: ${(props) => props.theme.eui.euiColorLightestShade}; +`; + +const FirstChunk = euiStyled.span` + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + line-height: ${FIXED_AXIS_HEIGHT}px; + text-align: left; +`; // safari doesn't auto align text left in some cases + +const LastChunk = euiStyled.span` + flex-shrink: 0; + line-height: ${FIXED_AXIS_HEIGHT}px; + text-align: left; +`; // safari doesn't auto align text left in some cases + +const StyledButton = euiStyled(EuiButtonEmpty)` + &&& { + border: none; + + .euiButtonContent { + display: inline-block; + padding: 0; + } + } +`; + +const SecureIcon = euiStyled(EuiIcon)` + margin-right: ${(props) => props.theme.eui.euiSizeXS}; +`; + +export const getChunks = (text: string = '') => { + const END_CHARS = 12; + const chars = text.split(''); + const splitPoint = chars.length - END_CHARS > 0 ? chars.length - END_CHARS : null; + const endChars = splitPoint ? chars.splice(splitPoint) : []; + return { first: chars.join(''), last: endChars.join('') }; +}; + +// Helper component for adding middle text truncation, e.g. +// really-really-really-long....ompressed.js +// Can be used to accomodate content in sidebar item rendering. +export const MiddleTruncatedText = ({ + index, + ariaLabel, + text: fullText, + onClick, + setButtonRef, + url, + highestIndex, +}: Props) => { + const secureHttps = fullText.startsWith('https://'); + const text = fullText.replace(/https:\/\/www.|http:\/\/www.|http:\/\/|https:\/\//, ''); + + const chunks = useMemo(() => { + return getChunks(text); + }, [text]); + + return ( + + + {fullText} + + + } + data-test-subj="middleTruncatedTextToolTip" + delay="long" + position="top" + > + <> + {onClick ? ( + + + + {index + '.'} + + {secureHttps && ( + + )} + {chunks.first} + {chunks.last} + + + ) : ( + + + {index}. {chunks.first} + + {chunks.last} + + )} + + + + + + + + + + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.test.tsx new file mode 100644 index 000000000000..e332be22d3da --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.test.tsx @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { NetworkRequestsTotal } from './network_requests_total'; +import { render } from '../../../../../../utils/testing'; + +describe('NetworkRequestsTotal', () => { + it('message in case total is greater than fetched', () => { + const { getByText } = render( + + ); + + expect(getByText('First 1000/1100 network requests')).toBeInTheDocument(); + expect(getByText('Info')).toBeInTheDocument(); + }); + + it('message in case total is equal to fetched requests', () => { + const { getByText } = render( + + ); + + expect(getByText('500 network requests')).toBeInTheDocument(); + }); + + it('does not show highlighted item message when showHighlightedNetworkEvents is false', () => { + const { queryByText } = render( + + ); + + expect(queryByText(/match the filter/)).not.toBeInTheDocument(); + }); + + it('does not show highlighted item message when highlightedNetworkEvents is less than 0', () => { + const { queryByText } = render( + + ); + + expect(queryByText(/match the filter/)).not.toBeInTheDocument(); + }); + + it('show highlighted item message when highlightedNetworkEvents is greater than 0 and showHighlightedNetworkEvents is true', () => { + const { getByText } = render( + + ); + + expect(getByText(/\(20 match the filter\)/)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.tsx new file mode 100644 index 000000000000..4fac0b3cd00d --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/network_requests_total.tsx @@ -0,0 +1,69 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; +import { EuiIconTip } from '@elastic/eui'; +import { NetworkRequestsTotalStyle } from './styles'; + +interface Props { + totalNetworkRequests: number; + fetchedNetworkRequests: number; + highlightedNetworkRequests: number; + showHighlightedNetworkRequests?: boolean; +} + +export const NetworkRequestsTotal = ({ + totalNetworkRequests, + fetchedNetworkRequests, + highlightedNetworkRequests, + showHighlightedNetworkRequests, +}: Props) => { + return ( + + + fetchedNetworkRequests ? ( + + ) : ( + totalNetworkRequests + ), + }} + />{' '} + {showHighlightedNetworkRequests && highlightedNetworkRequests >= 0 && ( + + )} + + {totalNetworkRequests > fetchedNetworkRequests && ( + + )} + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/sidebar.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/sidebar.tsx new file mode 100644 index 000000000000..6edab485b960 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/sidebar.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { FIXED_AXIS_HEIGHT, SIDEBAR_GROW_SIZE } from './constants'; +import { IWaterfallContext, useWaterfallContext } from '../context/waterfall_chart'; +import { + WaterfallChartSidebarContainer, + WaterfallChartSidebarContainerInnerPanel, + WaterfallChartSidebarContainerFlexGroup, + WaterfallChartSidebarFlexItem, + WaterfallChartSidebarWrapper, +} from './styles'; +import { WaterfallChartProps } from './waterfall_chart'; + +interface SidebarProps { + items: Required['sidebarItems']; + render: Required['renderSidebarItem']; +} + +export const Sidebar: React.FC = ({ items, render }) => { + const { onSidebarClick } = useWaterfallContext(); + const handleSidebarClick = useMemo(() => onSidebarClick, [onSidebarClick]); + + return ( + + + + + {items.map((item, index) => { + return ( + + {render(item, index, handleSidebarClick)} + + ); + })} + + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/styles.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/styles.ts new file mode 100644 index 000000000000..a48ce1f7c09b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/styles.ts @@ -0,0 +1,181 @@ +/* + * Copyright 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 { FunctionComponent } from 'react'; +import { StyledComponent } from 'styled-components'; +import { EuiPanel, EuiFlexGroup, EuiFlexItem, EuiText, EuiPanelProps } from '@elastic/eui'; +import { rgba } from 'polished'; +import { euiStyled, EuiTheme } from '@kbn/kibana-react-plugin/common'; +import { FIXED_AXIS_HEIGHT } from './constants'; + +interface WaterfallChartOuterContainerProps { + height?: string; +} + +const StyledScrollDiv = euiStyled.div` + &::-webkit-scrollbar { + height: ${({ theme }) => theme.eui.euiScrollBar}; + width: ${({ theme }) => theme.eui.euiScrollBar}; + } + &::-webkit-scrollbar-thumb { + background-clip: content-box; + background-color: ${({ theme }) => rgba(theme.eui.euiColorDarkShade, 0.5)}; + border: ${({ theme }) => theme.eui.euiScrollBarCorner} solid transparent; + } + &::-webkit-scrollbar-corner, + &::-webkit-scrollbar-track { + background-color: transparent; + } +`; + +export const WaterfallChartOuterContainer = euiStyled( + StyledScrollDiv +)` + height: ${(props) => (props.height ? `${props.height}` : 'auto')}; + overflow-y: ${(props) => (props.height ? 'scroll' : 'visible')}; + overflow-x: hidden; +`; + +export const WaterfallChartFixedTopContainer = euiStyled(StyledScrollDiv)` + position: sticky; + top: 0; + z-index: ${(props) => props.theme.eui.euiZLevel4}; + overflow-y: scroll; + overflow-x: hidden; +`; + +export const WaterfallChartAxisOnlyContainer = euiStyled(EuiFlexItem)` + margin-left: -16px; +`; + +export const WaterfallChartTopContainer = euiStyled(EuiFlexGroup)` +`; + +export const WaterfallChartFixedTopContainerSidebarCover: StyledComponent< + FunctionComponent, + EuiTheme +> = euiStyled(EuiPanel)` + height: 100%; + border-radius: 0 !important; + border: none; +`; // NOTE: border-radius !important is here as the "border" prop isn't working + +export const WaterfallChartFilterContainer = euiStyled.div` + && { + padding: 16px; + z-index: ${(props) => props.theme.eui.euiZLevel5}; + border-bottom: 0.3px solid ${(props) => props.theme.eui.euiColorLightShade}; + } +`; // NOTE: border-radius !important is here as the "border" prop isn't working + +export const WaterfallChartFixedAxisContainer = euiStyled.div` + z-index: ${(props) => props.theme.eui.euiZLevel4}; + height: 100%; + &&& { + .echAnnotation__icon { + top: 8px; + } + } +`; + +interface WaterfallChartSidebarContainer { + height: number; +} + +export const WaterfallChartSidebarWrapper = euiStyled(EuiFlexItem)` + z-index: ${(props) => props.theme.eui.euiZLevel5}; + min-width: 0; +`; // NOTE: min-width: 0 ensures flexbox and no-wrap children can co-exist + +export const WaterfallChartSidebarContainer = euiStyled.div` + height: ${(props) => `${props.height}px`}; + overflow-y: hidden; + overflow-x: hidden; +`; + +export const WaterfallChartSidebarContainerInnerPanel: StyledComponent< + FunctionComponent, + EuiTheme +> = euiStyled(EuiPanel)` + border: 0; + height: 100%; +`; + +export const WaterfallChartSidebarContainerFlexGroup = euiStyled(EuiFlexGroup)` + height: 100%; +`; + +// Ensures flex items honour no-wrap of children, rather than trying to extend to the full width of children. +export const WaterfallChartSidebarFlexItem = euiStyled(EuiFlexItem)` + min-width: 0; + padding-right: ${(props) => props.theme.eui.euiSizeS}; + justify-content: space-around; +`; + +export const SideBarItemHighlighter = euiStyled(EuiFlexItem)<{ isHighlighted: boolean }>` + opacity: ${(props) => (props.isHighlighted ? 1 : 0.4)}; + height: 100%; + .euiButtonEmpty { + height: ${FIXED_AXIS_HEIGHT}px; + font-size:${({ theme }) => theme.eui.euiFontSizeM}; + } +`; + +interface WaterfallChartChartContainer { + height: number; + chartIndex: number; +} + +export const WaterfallChartChartContainer = euiStyled.div` + width: 100%; + height: ${(props) => `${props.height + FIXED_AXIS_HEIGHT + 4}px`}; + margin-top: -${FIXED_AXIS_HEIGHT + 4}px; + z-index: ${(props) => Math.round(props.theme.eui.euiZLevel3 / (props.chartIndex + 1))}; + background-color: ${(props) => props.theme.eui.euiColorEmptyShade}; + + &&& { + .echCanvasRenderer { + height: calc(100% + 0px) !important; + } + } +`; + +export const WaterfallChartLegendContainer = euiStyled.div` + position: sticky; + bottom: 0; + z-index: ${(props) => props.theme.eui.euiZLevel5}; + background-color: ${(props) => props.theme.eui.euiColorLightestShade}; + padding: ${(props) => props.theme.eui.euiSizeXS}; + font-size: ${(props) => props.theme.eui.euiFontSizeXS}; + box-shadow: 0px -1px 4px 0px ${(props) => props.theme.eui.euiColorLightShade}; +`; // NOTE: EuiShadowColor is a little too dark to work with the background-color + +export const WaterfallTooltipResponsiveMaxWidth = euiStyled.div` + margin-top: 16px; + max-width: 90vw; +`; + +export const WaterfallChartTooltip = euiStyled(WaterfallTooltipResponsiveMaxWidth)` + background-color: ${(props) => props.theme.eui.euiColorDarkestShade}; + border-radius: ${(props) => props.theme.eui.euiBorderRadius}; + color: ${(props) => props.theme.eui.euiColorLightestShade}; + padding: ${(props) => props.theme.eui.euiSizeS}; + .euiToolTip__arrow { + background-color: ${(props) => props.theme.eui.euiColorDarkestShade}; + } +`; + +export const NetworkRequestsTotalStyle = euiStyled(EuiText)` + line-height: 28px; + padding: 0 ${(props) => props.theme.eui.euiSizeM}; + border-bottom: 0.3px solid ${(props) => props.theme.eui.euiColorLightShade}; + z-index: ${(props) => props.theme.eui.euiZLevel5}; +`; + +export const RelativeContainer = euiStyled.div` + position: relative; +`; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/translations.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/translations.ts new file mode 100644 index 000000000000..6bb0c03f7b99 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/translations.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const FILTER_REQUESTS_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.searchBox.placeholder', + { + defaultMessage: 'Filter network requests', + } +); + +export const FILTER_SCREENREADER_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.filterGroup.filterScreenreaderLabel', + { + defaultMessage: 'Filter by', + } +); + +export const FILTER_REMOVE_SCREENREADER_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.filterGroup.removeFilterScreenReaderLabel', + { + defaultMessage: 'Remove filter by', + } +); + +export const FILTER_POPOVER_OPEN_LABEL = i18n.translate( + 'xpack.synthetics.pingList.synthetics.waterfall.filters.popover', + { + defaultMessage: 'Click to open waterfall filters', + } +); + +export const FILTER_COLLAPSE_REQUESTS_LABEL = i18n.translate( + 'xpack.synthetics.pingList.synthetics.waterfall.filters.collapseRequestsLabel', + { + defaultMessage: 'Collapse to only show matching requests', + } +); + +export const SIDEBAR_FILTER_MATCHES_SCREENREADER_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.sidebar.filterMatchesScreenReaderLabel', + { + defaultMessage: 'Resource matches filter', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.test.tsx new file mode 100644 index 000000000000..a963fb1e2939 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useBarCharts } from './use_bar_charts'; +import { renderHook } from '@testing-library/react-hooks'; +import { IWaterfallContext } from '../context/waterfall_chart'; +import { CANVAS_MAX_ITEMS } from './constants'; + +const generateTestData = ( + { + xMultiplier, + }: { + xMultiplier: number; + } = { xMultiplier: 1 } +): IWaterfallContext['data'] => { + const numberOfItems = 1000; + const data: IWaterfallContext['data'] = []; + const testItem = { + x: 0, + y0: 0, + y: 4.345000023022294, + config: { + colour: '#b9a888', + showTooltip: true, + tooltipProps: { value: 'Queued / Blocked: 4.345ms', colour: '#b9a888' }, + }, + }; + + for (let i = 0; i < numberOfItems; i++) { + data.push( + { + ...testItem, + x: xMultiplier * i, + }, + { + ...testItem, + x: xMultiplier * i, + y0: 7, + y: 25, + } + ); + } + + return data; +}; + +describe('useBarChartsHooks', () => { + it('returns result as expected for non filtered data', () => { + const { result, rerender } = renderHook((props) => useBarCharts(props), { + initialProps: { data: [] as IWaterfallContext['data'] }, + }); + + expect(result.current).toHaveLength(0); + const newData = generateTestData(); + + rerender({ data: newData }); + + // Thousands items will result in 7 Canvas + expect(result.current.length).toBe(7); + + const firstChartItems = result.current[0]; + const lastChartItems = result.current[4]; + + // first chart items last item should be x 149, since we only display 150 items + expect(firstChartItems[firstChartItems.length - 1].x).toBe(CANVAS_MAX_ITEMS - 1); + + // first chart will only contain x values from 0 - 149; + expect(firstChartItems.find((item) => item.x > 149)).toBe(undefined); + + // since here are 5 charts, last chart first item should be x 600 + expect(lastChartItems[0].x).toBe(CANVAS_MAX_ITEMS * 4); + expect(lastChartItems[lastChartItems.length - 1].x).toBe(CANVAS_MAX_ITEMS * 5 - 1); + }); + + it('returns result as expected for filtered data', () => { + /* multiply x values to simulate filtered data, where x values can have gaps in the + * sequential order */ + const xMultiplier = 2; + const { result, rerender } = renderHook((props) => useBarCharts(props), { + initialProps: { data: [] as IWaterfallContext['data'] }, + }); + + expect(result.current).toHaveLength(0); + const newData = generateTestData({ xMultiplier }); + + rerender({ data: newData }); + + // Thousands items will result in 7 Canvas + expect(result.current.length).toBe(7); + + const firstChartItems = result.current[0]; + const lastChartItems = result.current[4]; + + // first chart items last item should be x 149, since we only display 150 items + expect(firstChartItems[firstChartItems.length - 1].x).toBe( + (CANVAS_MAX_ITEMS - 1) * xMultiplier + ); + + // since here are 5 charts, last chart first item should be x 600 + expect(lastChartItems[0].x).toBe(CANVAS_MAX_ITEMS * 4 * xMultiplier); + expect(lastChartItems[lastChartItems.length - 1].x).toBe( + (CANVAS_MAX_ITEMS * 5 - 1) * xMultiplier + ); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.ts new file mode 100644 index 000000000000..2baf89550491 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_bar_charts.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEffect, useState } from 'react'; +import { IWaterfallContext } from '../context/waterfall_chart'; +import { CANVAS_MAX_ITEMS } from './constants'; + +export interface UseBarHookProps { + data: IWaterfallContext['data']; +} + +export const useBarCharts = ({ data }: UseBarHookProps) => { + const [charts, setCharts] = useState>([]); + + useEffect(() => { + const chartsN: Array = []; + + if (data?.length > 0) { + let chartIndex = 0; + /* We want at most CANVAS_MAX_ITEMS **RESOURCES** per array. + * Resources !== individual timing items, but are comprised of many individual timing + * items. The X value of each item can be used as an id for the resource. + * We must keep track of the number of unique resources added to the each array. */ + const uniqueResources = new Set(); + let lastIndex: number; + data.forEach((item) => { + if (uniqueResources.size === CANVAS_MAX_ITEMS && item.x > lastIndex) { + chartIndex++; + uniqueResources.clear(); + } + uniqueResources.add(item.x); + lastIndex = item.x; + if (!chartsN[chartIndex]) { + chartsN.push([item]); + return; + } + chartsN[chartIndex].push(item); + }); + } + + setCharts(chartsN); + }, [data]); + + return charts; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.test.tsx new file mode 100644 index 000000000000..5b388874d508 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.test.tsx @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { renderHook, act } from '@testing-library/react-hooks'; +import { useFlyout } from './use_flyout'; +import { IWaterfallContext } from '../context/waterfall_chart'; + +import { ProjectedValues, XYChartElementEvent } from '@elastic/charts'; + +describe('useFlyoutHook', () => { + const metadata: IWaterfallContext['metadata'] = [ + { + x: 0, + url: 'http://elastic.co', + requestHeaders: undefined, + responseHeaders: undefined, + certificates: undefined, + details: [ + { + name: 'Content type', + value: 'text/html', + }, + ], + }, + ]; + + it('sets isFlyoutVisible to true and sets flyoutData when calling onSidebarClick', () => { + const index = 0; + const { result } = renderHook((props) => useFlyout(props.metadata), { + initialProps: { metadata }, + }); + + expect(result.current.isFlyoutVisible).toBe(false); + + act(() => { + result.current.onSidebarClick({ buttonRef: { current: null }, networkItemIndex: index }); + }); + + expect(result.current.isFlyoutVisible).toBe(true); + expect(result.current.flyoutData).toEqual(metadata[index]); + }); + + it('sets isFlyoutVisible to true and sets flyoutData when calling onBarClick', () => { + const index = 0; + const elementData = [ + { + datum: { + config: { + id: index, + }, + }, + }, + {}, + ]; + + const { result } = renderHook((props) => useFlyout(props.metadata), { + initialProps: { metadata }, + }); + + expect(result.current.isFlyoutVisible).toBe(false); + + act(() => { + result.current.onBarClick([elementData as XYChartElementEvent]); + }); + + expect(result.current.isFlyoutVisible).toBe(true); + expect(result.current.flyoutData).toEqual(metadata[0]); + }); + + it('sets isFlyoutVisible to true and sets flyoutData when calling onProjectionClick', () => { + const index = 0; + const geometry = { x: index }; + + const { result } = renderHook((props) => useFlyout(props.metadata), { + initialProps: { metadata }, + }); + + expect(result.current.isFlyoutVisible).toBe(false); + + act(() => { + result.current.onProjectionClick(geometry as ProjectedValues); + }); + + expect(result.current.isFlyoutVisible).toBe(true); + expect(result.current.flyoutData).toEqual(metadata[0]); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.ts new file mode 100644 index 000000000000..6e1795c4933e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/use_flyout.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 { RefObject, useCallback, useState } from 'react'; + +import { + ElementClickListener, + ProjectionClickListener, + ProjectedValues, + XYChartElementEvent, +} from '@elastic/charts'; + +import { WaterfallMetadata, WaterfallMetadataEntry } from '../types'; + +interface OnSidebarClickParams { + buttonRef?: ButtonRef; + networkItemIndex: number; +} + +export type ButtonRef = RefObject; +export type OnSidebarClick = (params: OnSidebarClickParams) => void; +export type OnProjectionClick = ProjectionClickListener; +export type OnElementClick = ElementClickListener; +export type OnFlyoutClose = () => void; + +export const useFlyout = (metadata: WaterfallMetadata) => { + const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); + const [flyoutData, setFlyoutData] = useState(undefined); + const [currentSidebarItemRef, setCurrentSidebarItemRef] = + useState>(); + + const handleFlyout = useCallback( + (flyoutEntry: WaterfallMetadataEntry) => { + setFlyoutData(flyoutEntry); + setIsFlyoutVisible(true); + }, + [setIsFlyoutVisible, setFlyoutData] + ); + + const onFlyoutClose = useCallback(() => { + setIsFlyoutVisible(false); + currentSidebarItemRef?.current?.focus(); + }, [currentSidebarItemRef, setIsFlyoutVisible]); + + const onBarClick: ElementClickListener = useCallback( + ([elementData]) => { + setIsFlyoutVisible(false); + const { datum } = (elementData as XYChartElementEvent)[0]; + const metadataEntry = metadata[datum.config.id]; + handleFlyout(metadataEntry); + }, + [metadata, handleFlyout] + ); + + const onProjectionClick: ProjectionClickListener = useCallback( + (projectionData) => { + setIsFlyoutVisible(false); + const { x } = projectionData as ProjectedValues; + if (typeof x === 'number' && x >= 0) { + const metadataEntry = metadata[x]; + handleFlyout(metadataEntry); + } + }, + [metadata, handleFlyout] + ); + + const onSidebarClick: OnSidebarClick = useCallback( + ({ buttonRef, networkItemIndex }) => { + if (isFlyoutVisible && buttonRef === currentSidebarItemRef) { + setIsFlyoutVisible(false); + } else { + const metadataEntry = metadata[networkItemIndex]; + setCurrentSidebarItemRef(buttonRef); + handleFlyout(metadataEntry); + } + }, + [currentSidebarItemRef, handleFlyout, isFlyoutVisible, metadata, setIsFlyoutVisible] + ); + + return { + flyoutData, + onBarClick, + onProjectionClick, + onSidebarClick, + isFlyoutVisible, + onFlyoutClose, + }; +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall.test.tsx new file mode 100644 index 000000000000..c1937764214e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall.test.tsx @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { WaterfallChart } from './waterfall_chart'; +import { renderLegendItem } from '../../step_detail/waterfall/waterfall_chart_wrapper'; + +import 'jest-canvas-mock'; +import { waitFor } from '@testing-library/dom'; +import { render } from '../../../../../../utils/testing'; + +describe('waterfall', () => { + it('sets the correct height in case of full height', () => { + const Component = () => { + return ( +
+ `${Number(d).toFixed(0)} ms`} + domain={{ + max: 3371, + min: 0, + }} + barStyleAccessor={(datum) => { + return datum.datum.config.colour; + }} + renderSidebarItem={undefined} + renderLegendItem={renderLegendItem} + fullHeight={true} + /> +
+ ); + }; + + const { getByTestId } = render(); + + const chartWrapper = getByTestId('waterfallOuterContainer'); + + waitFor(() => { + expect(chartWrapper).toHaveStyleRule('height', 'calc(100vh - 62px)'); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_bar_chart.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_bar_chart.tsx new file mode 100644 index 000000000000..3c9baed0dd3d --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_bar_chart.tsx @@ -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. + */ + +import React, { useMemo, useCallback } from 'react'; +import { + Axis, + BarSeries, + BarStyleAccessor, + Chart, + DomainRange, + Position, + ScaleType, + Settings, + TickFormatter, + TooltipInfo, +} from '@elastic/charts'; +import { useChartTheme } from '../../../../../../../../hooks/use_chart_theme'; +import { BAR_HEIGHT } from './constants'; +import { WaterfallChartChartContainer, WaterfallChartTooltip } from './styles'; +import { useWaterfallContext, WaterfallData } from '..'; +import { WaterfallTooltipContent } from './waterfall_tooltip_content'; +import { formatTooltipHeading } from '../../step_detail/waterfall/data_formatting'; +import { WaterfallChartMarkers } from './waterfall_markers'; + +const getChartHeight = (data: WaterfallData): number => { + // We get the last item x(number of bars) and adds 1 to cater for 0 index + const noOfXBars = new Set(data.map((item) => item.x)).size; + + return noOfXBars * BAR_HEIGHT; +}; + +const Tooltip = (tooltipInfo: TooltipInfo) => { + const { data, sidebarItems } = useWaterfallContext(); + return useMemo(() => { + const sidebarItem = sidebarItems?.find((item) => item.index === tooltipInfo.header?.value); + const relevantItems = data.filter((item) => { + return ( + item.x === tooltipInfo.header?.value && item.config.showTooltip && item.config.tooltipProps + ); + }); + return relevantItems.length ? ( + + {sidebarItem && ( + + )} + + ) : null; + }, [data, sidebarItems, tooltipInfo.header?.value]); +}; + +interface Props { + index: number; + chartData: WaterfallData; + tickFormat: TickFormatter; + domain: DomainRange; + barStyleAccessor: BarStyleAccessor; +} + +export const WaterfallBarChart = ({ + chartData, + tickFormat, + domain, + barStyleAccessor, + index, +}: Props) => { + const theme = useChartTheme(); + const { onElementClick, onProjectionClick } = useWaterfallContext(); + const handleElementClick = useMemo(() => onElementClick, [onElementClick]); + const handleProjectionClick = useMemo(() => onProjectionClick, [onProjectionClick]); + const memoizedTickFormat = useCallback(tickFormat, [tickFormat]); + + return ( + + + + + + + + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart.tsx new file mode 100644 index 000000000000..8e69e57616bf --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart.tsx @@ -0,0 +1,156 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useRef, useState } from 'react'; +import { EuiFlexGroup } from '@elastic/eui'; +import { TickFormatter, DomainRange, BarStyleAccessor } from '@elastic/charts'; +import useWindowSize from 'react-use/lib/useWindowSize'; +import { useWaterfallContext } from '../context/waterfall_chart'; +import { + WaterfallChartOuterContainer, + WaterfallChartFixedTopContainer, + WaterfallChartFixedTopContainerSidebarCover, + WaterfallChartSidebarWrapper, + WaterfallChartTopContainer, + RelativeContainer, + WaterfallChartFilterContainer, + WaterfallChartAxisOnlyContainer, + WaterfallChartLegendContainer, +} from './styles'; +import { CHART_LEGEND_PADDING, MAIN_GROW_SIZE, SIDEBAR_GROW_SIZE } from './constants'; +import { Sidebar } from './sidebar'; +import { Legend } from './legend'; +import { useBarCharts } from './use_bar_charts'; +import { WaterfallBarChart } from './waterfall_bar_chart'; +import { WaterfallChartFixedAxis } from './waterfall_chart_fixed_axis'; +import { NetworkRequestsTotal } from './network_requests_total'; + +export type RenderItem = ( + item: I, + index: number, + onClick?: (event: any) => void +) => JSX.Element; +export type RenderElement = () => JSX.Element; + +export interface WaterfallChartProps { + tickFormat: TickFormatter; + domain: DomainRange; + barStyleAccessor: BarStyleAccessor; + renderSidebarItem?: RenderItem; + renderLegendItem?: RenderItem; + renderFilter?: RenderElement; + renderFlyout?: RenderElement; + maxHeight?: string; + fullHeight?: boolean; +} + +export const WaterfallChart = ({ + tickFormat, + domain, + barStyleAccessor, + renderSidebarItem, + renderLegendItem, + renderFilter, + renderFlyout, + maxHeight = '800px', + fullHeight = false, +}: WaterfallChartProps) => { + const { + data, + showOnlyHighlightedNetworkRequests, + sidebarItems, + legendItems, + totalNetworkRequests, + highlightedNetworkRequests, + fetchedNetworkRequests, + } = useWaterfallContext(); + + const { width } = useWindowSize(); + + const chartWrapperDivRef = useRef(null); + const legendDivRef = useRef(null); + + const [height, setHeight] = useState(maxHeight); + + const shouldRenderSidebar = !!(sidebarItems && renderSidebarItem); + const shouldRenderLegend = !!(legendItems && legendItems.length > 0 && renderLegendItem); + + useEffect(() => { + if (fullHeight && chartWrapperDivRef.current && legendDivRef.current) { + const chartOffset = chartWrapperDivRef.current.getBoundingClientRect().top; + const legendOffset = legendDivRef.current.getBoundingClientRect().height; + setHeight(`calc(190vh - ${chartOffset + CHART_LEGEND_PADDING + legendOffset}px)`); + } + }, [chartWrapperDivRef, fullHeight, legendDivRef, width]); + + const chartsToDisplay = useBarCharts({ data }); + + return ( + + + + {shouldRenderSidebar && ( + + + + {renderFilter && ( + {renderFilter()} + )} + + )} + + + + + + + + + {shouldRenderSidebar && } + + + {chartsToDisplay.map((chartData, ind) => ( + + ))} + + + + {shouldRenderLegend && ( + + + + )} + {renderFlyout && renderFlyout()} + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart_fixed_axis.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart_fixed_axis.tsx new file mode 100644 index 000000000000..15b29beb1975 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_chart_fixed_axis.tsx @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { + Axis, + BarSeries, + BarStyleAccessor, + Chart, + DomainRange, + Position, + ScaleType, + Settings, + TickFormatter, + TooltipType, +} from '@elastic/charts'; +import { useChartTheme } from '../../../../../../../../hooks/use_chart_theme'; +import { WaterfallChartFixedAxisContainer } from './styles'; +import { WaterfallChartMarkers } from './waterfall_markers'; + +interface Props { + tickFormat: TickFormatter; + domain: DomainRange; + barStyleAccessor: BarStyleAccessor; +} + +export const WaterfallChartFixedAxis = ({ tickFormat, domain, barStyleAccessor }: Props) => { + const theme = useChartTheme(); + + return ( + + + + + + + + + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_flyout_table.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_flyout_table.tsx new file mode 100644 index 000000000000..8f723eb92fd9 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_flyout_table.tsx @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import styled from 'styled-components'; + +import { EuiText, EuiBasicTable, EuiSpacer } from '@elastic/eui'; + +interface Row { + name: string; + value?: string; +} + +interface Props { + rows: Row[]; + title: string; +} + +const StyledText = styled(EuiText)` + width: 100%; +`; + +class TableWithoutHeader extends EuiBasicTable { + renderTableHead() { + return <>; + } +} + +export const Table = (props: Props) => { + const { rows, title } = props; + const columns = useMemo( + () => [ + { + field: 'name', + name: '', + sortable: false, + render: (_name: string, item: Row) => ( + + {item.name} + + ), + }, + { + field: 'value', + name: '', + sortable: false, + render: (_name: string, item: Row) => { + return ( + + {item.value ?? '--'} + + ); + }, + }, + ], + [] + ); + + return ( + <> + +

{title}

+
+ + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.test.tsx new file mode 100644 index 000000000000..222f152c01b1 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.test.tsx @@ -0,0 +1,62 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { fireEvent, waitFor } from '@testing-library/dom'; +import { WaterfallMarkerIcon } from './waterfall_marker_icon'; +import { TestWrapper } from './waterfall_marker_test_helper'; +import { render } from '../../../../../../utils/testing'; + +describe('', () => { + it('renders a dot icon when `field` is an empty string', () => { + const { getByText } = render(); + expect(getByText('An icon indicating that this marker has no field associated with it')); + }); + + it('renders an embeddable when opened', async () => { + const { getByLabelText, getByText } = render( + + + + ); + + const expandButton = getByLabelText( + 'Use this icon button to show metrics for this annotation marker.' + ); + + fireEvent.click(expandButton); + + await waitFor(() => { + getByText('Test Field'); + }); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.tsx new file mode 100644 index 000000000000..675224bfa8f7 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_icon.tsx @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiButtonIcon, EuiIcon, EuiPopover } from '@elastic/eui'; +import { WaterfallMarkerTrend } from './waterfall_marker_trend'; + +export function WaterfallMarkerIcon({ field, label }: { field: string; label: string }) { + const [isOpen, setIsOpen] = useState(false); + + if (!field) { + return ( + + ); + } + + return ( + setIsOpen(false)} + anchorPosition="downLeft" + panelStyle={{ paddingBottom: 0, paddingLeft: 4 }} + zIndex={100} + button={ + setIsOpen((prevState) => !prevState)} + /> + } + > + + + ); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_test_helper.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_test_helper.tsx new file mode 100644 index 000000000000..ce033b6f2ef2 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_test_helper.tsx @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { SyntheticsStartupPluginsContext } from '../../../../../../contexts'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { WaterfallContext } from '../context/waterfall_chart'; + +const EmbeddableMock = ({ + title, + appendTitle, + reportType, + attributes, +}: { + title: string; + appendTitle: JSX.Element | undefined; + reportType: string; + attributes: unknown; + axisTitlesVisibility: { x: boolean; yLeft: boolean; yRight: boolean }; + legendIsVisible: boolean; +}) => ( +
+

{title}

+
{appendTitle}
+
{reportType}
+
{JSON.stringify(attributes)}
+
+); + +export const TestWrapper = ({ + basePath, + activeStep, + children, +}: { + basePath: string; + activeStep?: JourneyStep; + children: JSX.Element; +}) => ( + ), + }, + }} + > + + {children} + + +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.test.tsx new file mode 100644 index 000000000000..f75b25b056e0 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.test.tsx @@ -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. + */ + +import React from 'react'; +import { WaterfallMarkerTrend } from './waterfall_marker_trend'; +import moment from 'moment'; +import { TestWrapper } from './waterfall_marker_test_helper'; +import { render } from '../../../../../../utils/testing'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; + +describe('', () => { + const mockDiff = jest.fn(); + + jest.spyOn(moment.prototype, 'diff').mockImplementation(mockDiff); + + const timestamp = '2021-12-03T14:35:41.072Z'; + + let activeStep: JourneyStep | undefined; + beforeEach(() => { + activeStep = { + '@timestamp': timestamp, + _id: 'id', + synthetics: { + type: 'step/end', + step: { + index: 0, + status: 'succeeded', + name: 'test-name', + duration: { + us: 9999, + }, + }, + }, + monitor: { + id: 'mon-id', + check_group: 'group', + timespan: { + gte: '1988-10-09T12:00:00.000Z', + lt: '1988-10-10T12:00:00.000Z', + }, + }, + }; + // value diff in milliseconds + mockDiff.mockReturnValue(10 * 1000); + }); + + const BASE_PATH = 'xyz'; + + it('supplies props', () => { + const { getByLabelText, getByText, getByRole } = render( + + + , + { + core: { + http: { + basePath: { + get: () => BASE_PATH, + }, + }, + }, + } + ); + const heading = getByRole('heading'); + expect(heading.innerHTML).toEqual('test title'); + expect(getByLabelText('append title').innerHTML.indexOf(BASE_PATH)).not.toBe(-1); + expect(getByText('kpi-over-time')); + const attributesText = getByLabelText('attributes').innerHTML; + + expect(attributesText.includes('"2021-12-03T14:35:41.072Z"')).toBeTruthy(); + const attributes = JSON.parse(attributesText); + expect( + moment(attributes[0].time.from) + .add(10 * 1000 * 48, 'millisecond') + .toISOString() + ).toBe(timestamp); + }); + + it('handles timespan difference', () => { + const oneMinDiff = 60 * 1000; + mockDiff.mockReturnValue(oneMinDiff); + const { getByLabelText } = render( + + + + ); + + const attributesText = getByLabelText('attributes').innerHTML; + + expect(attributesText).toBe( + JSON.stringify([ + { + name: 'test title(test-name)', + selectedMetricField: 'field', + time: { to: '2021-12-03T14:35:41.072Z', from: '2021-12-03T13:47:41.072Z' }, + seriesType: 'area', + dataType: 'synthetics', + reportDefinitions: { + 'monitor.name': [null], + 'synthetics.step.name.keyword': ['test-name'], + }, + operationType: 'last_value', + }, + ]) + ); + + const attributes = JSON.parse(attributesText); + expect( + moment(attributes[0].time.from) + .add(oneMinDiff * 48, 'millisecond') + .toISOString() + ).toBe(timestamp); + }); + + it('returns null for missing active step', () => { + activeStep = undefined; + const { container } = render( + + + + ); + expect(container.innerHTML).toBe(''); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.tsx new file mode 100644 index 000000000000..5ab019670108 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_marker_trend.tsx @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; + +import { StepFieldTrend } from '../../../../../common/step_field_trend/step_field_trend'; +import { useWaterfallContext } from '../context/waterfall_chart'; + +export function WaterfallMarkerTrend({ title, field }: { title: string; field: string }) { + const { activeStep } = useWaterfallContext(); + + if (!activeStep) { + return null; + } + + return ; +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_markers.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_markers.tsx new file mode 100644 index 000000000000..1a8e5dd1d51b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_markers.tsx @@ -0,0 +1,179 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { AnnotationDomainType, LineAnnotation } from '@elastic/charts'; +import { i18n } from '@kbn/i18n'; +import { useTheme } from '@kbn/observability-plugin/public'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { useWaterfallContext } from '..'; +import { MarkerItems } from '../context/waterfall_chart'; +import { WaterfallMarkerIcon } from './waterfall_marker_icon'; + +export const FIELD_SYNTHETICS_LCP = 'browser.experience.lcp.us'; +export const FIELD_SYNTHETICS_FCP = 'browser.experience.fcp.us'; +export const FIELD_SYNTHETICS_DOCUMENT_ONLOAD = 'browser.experience.load.us'; +export const FIELD_SYNTHETICS_DCL = 'browser.experience.dcl.us'; +export const LAYOUT_SHIFT = 'layoutShift'; + +export function WaterfallChartMarkers() { + const { markerItems } = useWaterfallContext(); + + const theme = useTheme(); + + const markerItemsByOffset = useMemo( + () => + (markerItems ?? []).reduce((acc, cur) => { + acc.set(cur.offset, [...(acc.get(cur.offset) ?? []), cur]); + return acc; + }, new Map()), + [markerItems] + ); + + const annotations = useMemo(() => { + return Array.from(markerItemsByOffset.entries()).map(([offset, items]) => { + let uniqueIds = (items ?? []) + .map(({ id }) => id) + .filter((id, index, arr) => arr.indexOf(id) === index); + + // Omit coinciding layoutShift's with other vital marks + if (uniqueIds.length > 1) { + uniqueIds = uniqueIds.filter((id) => id !== LAYOUT_SHIFT); + } + + const label = uniqueIds.map((id) => getMarkersInfo(id, theme)?.label ?? id).join(' / '); + const id = uniqueIds[0]; + const markersInfo = getMarkersInfo(id, theme); + + return { + id, + offset, + label, + field: markersInfo?.field ?? '', + color: markersInfo?.color ?? theme.eui.euiColorMediumShade, + strokeWidth: markersInfo?.strokeWidth ?? 1, + }; + }); + }, [markerItemsByOffset, theme]); + + if (!markerItems) { + return null; + } + + return ( + + {annotations.map(({ id, offset, label, field, color, strokeWidth }) => { + const key = `${id}-${offset}`; + + return ( + } + style={{ + line: { + strokeWidth, + stroke: color, + opacity: 1, + }, + }} + /> + ); + })} + + ); +} + +function getMarkersInfo(id: string, theme: ReturnType) { + switch (id) { + case 'domContentLoaded': + return { + label: DOCUMENT_CONTENT_LOADED_LABEL, + color: theme.eui.euiColorVis0, + field: FIELD_SYNTHETICS_DCL, + strokeWidth: 2, + }; + case 'firstContentfulPaint': + return { + label: FCP_LABEL, + color: theme.eui.euiColorVis1, + field: FIELD_SYNTHETICS_FCP, + strokeWidth: 2, + }; + case 'largestContentfulPaint': + return { + label: LCP_LABEL, + color: theme.eui.euiColorVis2, + field: FIELD_SYNTHETICS_LCP, + strokeWidth: 2, + }; + case 'layoutShift': + return { + label: LAYOUT_SHIFT_LABEL, + color: theme.eui.euiColorVis6, + field: '', + strokeWidth: 1, + }; + case 'loadEvent': + return { + label: LOAD_EVENT_LABEL, + color: theme.eui.euiColorVis9, + field: FIELD_SYNTHETICS_DOCUMENT_ONLOAD, + strokeWidth: 2, + }; + } + + return undefined; +} + +const Wrapper = euiStyled.span` + &&& { + > .echAnnotation__icon { + top: 8px; + } + } +`; + +export const FCP_LABEL = i18n.translate('xpack.synthetics.synthetics.waterfall.fcpLabel', { + defaultMessage: 'First contentful paint', +}); + +export const LCP_LABEL = i18n.translate('xpack.synthetics.synthetics.waterfall.lcpLabel', { + defaultMessage: 'Largest contentful paint', +}); + +export const LAYOUT_SHIFT_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.layoutShiftLabel', + { + defaultMessage: 'Layout shift', + } +); + +export const LOAD_EVENT_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.loadEventLabel', + { + defaultMessage: 'Load event', + } +); + +export const DOCUMENT_CONTENT_LOADED_LABEL = i18n.translate( + 'xpack.synthetics.synthetics.waterfall.domContentLabel', + { + defaultMessage: 'DOM Content Loaded', + } +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.test.tsx new file mode 100644 index 000000000000..0df81cca48df --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.test.tsx @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { WaterfallTooltipContent } from './waterfall_tooltip_content'; +import { render } from '../../../../../../utils/testing'; + +jest.mock('../context/waterfall_chart', () => ({ + useWaterfallContext: jest.fn().mockReturnValue({ + data: [ + { + x: 0, + config: { + url: 'https://www.elastic.co', + tooltipProps: { + colour: '#000000', + value: 'test-val', + }, + showTooltip: true, + }, + }, + { + x: 0, + config: { + url: 'https://www.elastic.co/with/missing/tooltip.props', + showTooltip: true, + }, + }, + { + x: 1, + config: { + url: 'https://www.elastic.co/someresource.path', + tooltipProps: { + colour: '#010000', + value: 'test-val-missing', + }, + showTooltip: true, + }, + }, + ], + renderTooltipItem: (props: any) => ( +
+
{props.colour}
+
{props.value}
+
+ ), + sidebarItems: [ + { + isHighlighted: true, + index: 0, + offsetIndex: 1, + url: 'https://www.elastic.co', + status: 200, + method: 'GET', + }, + ], + }), +})); + +describe('WaterfallTooltipContent', () => { + it('renders tooltip', () => { + const { getByText, queryByText } = render( + + ); + expect(getByText('#000000')).toBeInTheDocument(); + expect(getByText('test-val')).toBeInTheDocument(); + expect(getByText('1. https://www.elastic.co')).toBeInTheDocument(); + expect(queryByText('#010000')).toBeNull(); + expect(queryByText('test-val-missing')).toBeNull(); + }); + + it(`doesn't render metric if tooltip props missing`, () => { + const { getAllByLabelText, getByText } = render( + + ); + const metricElements = getAllByLabelText('tooltip item'); + expect(metricElements).toHaveLength(1); + expect(getByText('test-val')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.tsx new file mode 100644 index 000000000000..b9f385c29b9f --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/components/waterfall_tooltip_content.tsx @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiText } from '@elastic/eui'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { useWaterfallContext } from '../context/waterfall_chart'; + +interface Props { + text: string; + url: string; +} + +const StyledText = euiStyled(EuiText)` + font-weight: bold; +`; + +const StyledHorizontalRule = euiStyled(EuiHorizontalRule)` + background-color: ${(props) => props.theme.eui.euiColorDarkShade}; +`; + +export const WaterfallTooltipContent: React.FC = ({ text, url }) => { + const { data, renderTooltipItem, sidebarItems } = useWaterfallContext(); + + const tooltipMetrics = data.filter( + (datum) => + datum.x === sidebarItems?.find((sidebarItem) => sidebarItem.url === url)?.index && + datum.config.tooltipProps && + datum.config.showTooltip + ); + return ( + <> + {text} + + + {tooltipMetrics.map((item, idx) => ( + {renderTooltipItem(item.config.tooltipProps)} + ))} + + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/context/waterfall_chart.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/context/waterfall_chart.tsx new file mode 100644 index 000000000000..115dd15b416f --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/context/waterfall_chart.tsx @@ -0,0 +1,106 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { createContext, useContext, Context } from 'react'; +import { JourneyStep } from '../../../../../../../../../common/runtime_types'; +import { WaterfallData, WaterfallDataEntry, WaterfallMetadata } from '../types'; +import { OnSidebarClick, OnElementClick, OnProjectionClick } from '../components/use_flyout'; +import { SidebarItems } from '../../step_detail/waterfall/types'; + +export type MarkerItems = Array<{ + id: + | 'domContentLoaded' + | 'firstContentfulPaint' + | 'largestContentfulPaint' + | 'layoutShift' + | 'loadEvent' + | 'navigationStart'; + offset: number; +}>; + +export interface IWaterfallContext { + totalNetworkRequests: number; + highlightedNetworkRequests: number; + fetchedNetworkRequests: number; + data: WaterfallData; + onElementClick?: OnElementClick; + onProjectionClick?: OnProjectionClick; + onSidebarClick?: OnSidebarClick; + showOnlyHighlightedNetworkRequests: boolean; + sidebarItems?: SidebarItems; + legendItems?: unknown[]; + metadata: WaterfallMetadata; + renderTooltipItem: ( + item: WaterfallDataEntry['config']['tooltipProps'], + index?: number + ) => JSX.Element; + markerItems?: MarkerItems; + activeStep?: JourneyStep; +} + +export const WaterfallContext = createContext>({}); + +interface ProviderProps { + totalNetworkRequests: number; + highlightedNetworkRequests: number; + fetchedNetworkRequests: number; + data: IWaterfallContext['data']; + onElementClick?: IWaterfallContext['onElementClick']; + onProjectionClick?: IWaterfallContext['onProjectionClick']; + onSidebarClick?: IWaterfallContext['onSidebarClick']; + showOnlyHighlightedNetworkRequests: IWaterfallContext['showOnlyHighlightedNetworkRequests']; + sidebarItems?: IWaterfallContext['sidebarItems']; + legendItems?: IWaterfallContext['legendItems']; + metadata: IWaterfallContext['metadata']; + renderTooltipItem: IWaterfallContext['renderTooltipItem']; + markerItems?: MarkerItems; + activeStep?: JourneyStep; +} + +export const WaterfallProvider: React.FC = ({ + children, + data, + markerItems, + onElementClick, + onProjectionClick, + onSidebarClick, + showOnlyHighlightedNetworkRequests, + sidebarItems, + legendItems, + metadata, + renderTooltipItem, + totalNetworkRequests, + highlightedNetworkRequests, + fetchedNetworkRequests, + activeStep, +}) => { + return ( + + {children} + + ); +}; + +export const useWaterfallContext = () => + useContext(WaterfallContext as unknown as Context); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/index.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/index.tsx new file mode 100644 index 000000000000..b83cb630aaa7 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/index.tsx @@ -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. + */ + +export type { RenderItem, WaterfallChartProps } from './components/waterfall_chart'; +export { WaterfallChart } from './components/waterfall_chart'; +export { WaterfallProvider, useWaterfallContext } from './context/waterfall_chart'; +export { MiddleTruncatedText } from './components/middle_truncated_text'; +export { useFlyout } from './components/use_flyout'; +export type { + WaterfallData, + WaterfallDataEntry, + WaterfallMetadata, + WaterfallMetadataEntry, +} from './types'; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/types.ts b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/types.ts new file mode 100644 index 000000000000..f1775a6fd189 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/network_waterfall/waterfall/types.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +interface PlotProperties { + x: number; + y: number; + y0: number; +} + +export interface WaterfallDataSeriesConfigProperties { + tooltipProps?: Record; + showTooltip: boolean; +} + +export interface WaterfallMetadataItem { + name: string; + value?: string; +} + +export interface WaterfallMetadataEntry { + x: number; + url: string; + requestHeaders?: WaterfallMetadataItem[]; + responseHeaders?: WaterfallMetadataItem[]; + certificates?: WaterfallMetadataItem[]; + details: WaterfallMetadataItem[]; +} + +export type WaterfallDataEntry = PlotProperties & { + config: WaterfallDataSeriesConfigProperties & Record; +}; + +export type WaterfallMetadata = WaterfallMetadataEntry[]; + +export type WaterfallData = WaterfallDataEntry[]; + +export type RenderItem = (item: I, index: number) => JSX.Element; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/screenshot_link.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/screenshot_link.tsx new file mode 100644 index 000000000000..803c1fcc5312 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/screenshot_link.tsx @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; +import { Ping } from '../../../../../../../common/runtime_types'; + +const LabelLink = euiStyled.div` + margin-bottom: ${(props) => props.theme.eui.euiSizeXS}; + font-size: ${({ theme }) => theme.eui.euiFontSizeS}; +`; + +interface Props { + lastSuccessfulCheck: Ping; +} + +export const ScreenshotLink = ({ lastSuccessfulCheck }: Props) => { + return ( + + + + + + + ), + }} + /> + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.test.tsx new file mode 100644 index 000000000000..7a275527de3c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.test.tsx @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { StepScreenshotDisplay } from './step_screenshot_display'; +import * as observabilityPublic from '@kbn/observability-plugin/public'; +import { mockRef } from '../../../../utils/testing/__mocks__/screenshot_ref.mock'; +import { render } from '../../../../utils/testing'; +import '../../../../utils/testing/__mocks__/use_composite_image.mock'; +jest.mock('@kbn/observability-plugin/public'); + +jest.mock('react-use/lib/useIntersection', () => () => ({ + isIntersecting: true, +})); + +describe('StepScreenshotDisplayProps', () => { + beforeAll(() => { + jest.spyOn(observabilityPublic, 'useFetcher').mockReturnValue({ + data: null, + status: observabilityPublic.FETCH_STATUS.SUCCESS, + refetch: () => {}, + }); + }); + + afterAll(() => { + (observabilityPublic.useFetcher as any).mockClear(); + }); + it('displays screenshot thumbnail when present', () => { + const { getByAltText } = render( + + ); + + expect(getByAltText('Screenshot for step with name "STEP_NAME"')).toBeInTheDocument(); + }); + + it('uses alternative text when step name not available', () => { + const { getByAltText } = render( + + ); + + expect(getByAltText('Screenshot')).toBeInTheDocument(); + }); + + it('displays No Image message when screenshot does not exist', () => { + const { getByTestId } = render( + + ); + expect(getByTestId('stepScreenshotImageUnavailable')).toBeInTheDocument(); + }); + + it('displays screenshot thumbnail for ref', () => { + jest.spyOn(observabilityPublic, 'useFetcher').mockReturnValue({ + status: observabilityPublic.FETCH_STATUS.SUCCESS, + data: { ...mockRef }, + refetch: () => null, + }); + + const { getByAltText } = render( + + ); + + expect(getByAltText('Screenshot for step with name "STEP_NAME"')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.tsx new file mode 100644 index 000000000000..1dbfe9595cc4 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/components/screenshot/step_screenshot_display.tsx @@ -0,0 +1,197 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiImage, + EuiLoadingSpinner, + EuiText, +} from '@elastic/eui'; +import styled from 'styled-components'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import React, { useEffect, useMemo, useRef, useState, FC } from 'react'; +import useIntersection from 'react-use/lib/useIntersection'; +import { useFetcher } from '@kbn/observability-plugin/public'; +import { getJourneyScreenshot } from '../../../../state'; +import { useCompositeImage } from '../../../../hooks'; +import { + useSyntheticsRefreshContext, + useSyntheticsSettingsContext, + useSyntheticsThemeContext, +} from '../../../../contexts'; +import { + isScreenshotRef as isAScreenshotRef, + ScreenshotRefImageData, +} from '../../../../../../../common/runtime_types'; + +interface StepScreenshotDisplayProps { + isFullScreenshot: boolean; + isScreenshotRef: boolean; + checkGroup?: string; + stepIndex?: number; + stepName?: string; + lazyLoad?: boolean; +} + +const IMAGE_MAX_WIDTH = 640; + +const StepImage = styled(EuiImage)` + &&& { + figcaption { + display: none; + } + objectFit: 'cover', + objectPosition: 'center top', + } +`; + +const BaseStepImage = ({ + stepIndex, + stepName, + url, +}: Pick & { url?: string }) => { + if (!url) return ; + return ( + + ); +}; + +type ComposedStepImageProps = Pick & { + url: string | undefined; + imgRef: ScreenshotRefImageData; + setUrl: React.Dispatch; +}; + +const ComposedStepImage = ({ + stepIndex, + stepName, + url, + imgRef, + setUrl, +}: ComposedStepImageProps) => { + useCompositeImage(imgRef, setUrl, url); + if (!url) return ; + return ; +}; + +export const StepScreenshotDisplay: FC = ({ + checkGroup, + isFullScreenshot: isScreenshotBlob, + isScreenshotRef, + stepIndex, + stepName, + lazyLoad = true, +}) => { + const containerRef = useRef(null); + const { + colors: { lightestShade: pageBackground }, + } = useSyntheticsThemeContext(); + + const { basePath } = useSyntheticsSettingsContext(); + + const intersection = useIntersection(containerRef, { + root: null, + rootMargin: '0px', + threshold: 1, + }); + const { lastRefresh } = useSyntheticsRefreshContext(); + + const [hasIntersected, setHasIntersected] = useState(false); + const isIntersecting = intersection?.isIntersecting; + useEffect(() => { + if (hasIntersected === false && isIntersecting === true) { + setHasIntersected(true); + } + }, [hasIntersected, isIntersecting, setHasIntersected]); + + const imgSrc = basePath + `/internal/uptime/journey/screenshot/${checkGroup}/${stepIndex}`; + + // When loading a legacy screenshot, set `url` to full-size screenshot path. + // Otherwise, we first need to composite the image. + const [url, setUrl] = useState(isScreenshotBlob ? imgSrc : undefined); + + // when the image is a composite, we need to fetch the data since we cannot specify a blob URL + const { data: screenshotRef } = useFetcher(() => { + if (isScreenshotRef) { + return getJourneyScreenshot(imgSrc); + } + }, [basePath, checkGroup, imgSrc, stepIndex, isScreenshotRef, lastRefresh]); + + const refDimensions = useMemo(() => { + if (isAScreenshotRef(screenshotRef)) { + const { height, width } = screenshotRef.ref.screenshotRef.screenshot_ref; + return { height, width }; + } + }, [screenshotRef]); + + const shouldRenderImage = hasIntersected || !lazyLoad; + return ( +
+ {shouldRenderImage && isScreenshotBlob && ( + + )} + {shouldRenderImage && isScreenshotRef && isAScreenshotRef(screenshotRef) && ( + + )} + {!isScreenshotBlob && !isScreenshotRef && ( + + + + + + + + + + + + + )} +
+ ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx index 09122158e45e..52af4964ee71 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx @@ -15,19 +15,24 @@ import { EuiPanel, EuiLoadingSpinner, } from '@elastic/eui'; +import { WaterfallChartContainer } from './components/network_waterfall/step_detail/waterfall/waterfall_chart_container'; import { StepImage } from './components/step_image'; import { useJourneySteps } from '../monitor_details/hooks/use_journey_steps'; import { MonitorDetailsLinkPortal } from '../monitor_add_edit/monitor_details_portal'; import { useStepDetailsBreadcrumbs } from './hooks/use_step_details_breadcrumbs'; export const StepDetailPage = () => { - const { checkGroupId } = useParams<{ checkGroupId: string; stepIndex: string }>(); + const { checkGroupId, stepIndex } = useParams<{ checkGroupId: string; stepIndex: string }>(); useTrackPageview({ app: 'synthetics', path: 'stepDetail' }); useTrackPageview({ app: 'synthetics', path: 'stepDetail', delay: 15000 }); const { data, loading, isFailed, currentStep, stepLabels } = useJourneySteps(checkGroupId); + const activeStep = data?.steps?.find( + (step) => step.synthetics?.step?.index === Number(stepIndex) + ); + useStepDetailsBreadcrumbs([{ text: data?.details?.journey.monitor.name ?? '' }]); if (loading) { @@ -88,7 +93,15 @@ export const StepDetailPage = () => { - {/* TODO: Add breakdown of network events*/} + {data && ( +
+ +
+ )} ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx index 5cb758e4b3d3..658ad28890a9 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx @@ -20,7 +20,6 @@ export const StepTitle = () => { return ( {currentStep?.synthetics?.step?.name} - ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/actions.ts new file mode 100644 index 000000000000..f391484d3920 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/actions.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. + */ + +import { createAction } from 'redux-actions'; +import { SyntheticsNetworkEventsApiResponse } from '../../../../../common/runtime_types'; + +export interface FetchNetworkEventsParams { + checkGroup: string; + stepIndex: number; +} + +export interface FetchNetworkEventsFailPayload { + checkGroup: string; + stepIndex: number; + error: Error; +} + +export const getNetworkEvents = createAction('GET_NETWORK_EVENTS'); +export const getNetworkEventsSuccess = createAction< + Pick & SyntheticsNetworkEventsApiResponse +>('GET_NETWORK_EVENTS_SUCCESS'); +export const getNetworkEventsFail = + createAction('GET_NETWORK_EVENTS_FAIL'); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts new file mode 100644 index 000000000000..8c52ebba47da --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/api.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. + */ + +import { + SyntheticsNetworkEventsApiResponse, + SyntheticsNetworkEventsApiResponseType, +} from '../../../../../common/runtime_types'; +import { API_URLS } from '../../../../../common/constants'; +import { apiService } from '../../../../utils/api_service'; +import { FetchNetworkEventsParams } from './actions'; + +export async function fetchNetworkEvents( + params: FetchNetworkEventsParams +): Promise { + return (await apiService.get( + API_URLS.NETWORK_EVENTS, + { + checkGroup: params.checkGroup, + stepIndex: params.stepIndex, + }, + SyntheticsNetworkEventsApiResponseType + )) as SyntheticsNetworkEventsApiResponse; +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts new file mode 100644 index 000000000000..1736619eb618 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { Action } from 'redux-actions'; +import { call, put, takeLatest } from 'redux-saga/effects'; +import { fetchNetworkEvents } from './api'; +import { SyntheticsNetworkEventsApiResponse } from '../../../../../common/runtime_types'; +import { + FetchNetworkEventsParams, + getNetworkEvents, + getNetworkEventsFail, + getNetworkEventsSuccess, +} from './actions'; + +export function* fetchNetworkEventsEffect() { + yield takeLatest( + getNetworkEvents, + function* (action: Action): Generator { + try { + const response = (yield call( + fetchNetworkEvents, + action.payload + )) as SyntheticsNetworkEventsApiResponse; + + yield put( + getNetworkEventsSuccess({ + checkGroup: action.payload.checkGroup, + stepIndex: action.payload.stepIndex, + ...response, + }) + ); + } catch (e) { + yield put( + getNetworkEventsFail({ + checkGroup: action.payload.checkGroup, + stepIndex: action.payload.stepIndex, + error: e, + }) + ); + } + } + ); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts new file mode 100644 index 000000000000..a3a5cc00c9bc --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/index.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 { handleActions, Action } from 'redux-actions'; +import { + NetworkEvent, + SyntheticsNetworkEventsApiResponse, +} from '../../../../../common/runtime_types'; +import { + FetchNetworkEventsFailPayload, + FetchNetworkEventsParams, + getNetworkEvents, + getNetworkEventsFail, + getNetworkEventsSuccess, +} from './actions'; + +export interface NetworkEventsState { + [checkGroup: string]: { + [stepIndex: number]: { + events: NetworkEvent[]; + total: number; + loading: boolean; + error?: Error; + isWaterfallSupported: boolean; + hasNavigationRequest?: boolean; + }; + }; +} + +const initialState: NetworkEventsState = {}; + +type Payload = FetchNetworkEventsParams & + SyntheticsNetworkEventsApiResponse & + FetchNetworkEventsFailPayload & + string[]; + +export const networkEventsReducer = handleActions( + { + [String(getNetworkEvents)]: ( + state: NetworkEventsState, + { payload: { checkGroup, stepIndex } }: Action + ) => ({ + ...state, + [checkGroup]: state[checkGroup] + ? { + [stepIndex]: state[checkGroup][stepIndex] + ? { + ...state[checkGroup][stepIndex], + loading: true, + events: [], + total: 0, + isWaterfallSupported: true, + } + : { + loading: true, + events: [], + total: 0, + isWaterfallSupported: true, + }, + } + : { + [stepIndex]: { + loading: true, + events: [], + total: 0, + isWaterfallSupported: true, + }, + }, + }), + + [String(getNetworkEventsSuccess)]: ( + state: NetworkEventsState, + { + payload: { + events, + total, + checkGroup, + stepIndex, + isWaterfallSupported, + hasNavigationRequest, + }, + }: Action + ) => { + return { + ...state, + [checkGroup]: state[checkGroup] + ? { + [stepIndex]: state[checkGroup][stepIndex] + ? { + ...state[checkGroup][stepIndex], + loading: false, + events, + total, + isWaterfallSupported, + hasNavigationRequest, + } + : { + loading: false, + events, + total, + isWaterfallSupported, + hasNavigationRequest, + }, + } + : { + [stepIndex]: { + loading: false, + events, + total, + isWaterfallSupported, + hasNavigationRequest, + }, + }, + }; + }, + + [String(getNetworkEventsFail)]: ( + state: NetworkEventsState, + { payload: { checkGroup, stepIndex, error } }: Action + ) => ({ + ...state, + [checkGroup]: state[checkGroup] + ? { + [stepIndex]: state[checkGroup][stepIndex] + ? { + ...state[checkGroup][stepIndex], + loading: false, + events: [], + total: 0, + error, + isWaterfallSupported: true, + } + : { + loading: false, + events: [], + total: 0, + error, + isWaterfallSupported: true, + }, + } + : { + [stepIndex]: { + loading: false, + events: [], + total: 0, + error, + isWaterfallSupported: true, + }, + }, + }), + }, + initialState +); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts new file mode 100644 index 000000000000..eae3b3e56d2b --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SyntheticsAppState } from '../root_reducer'; + +export const networkEventsSelector = ({ networkEvents }: SyntheticsAppState) => networkEvents; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts index 50b94bd67083..f8f13b7ed54e 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_effect.ts @@ -6,6 +6,7 @@ */ import { all, fork } from 'redux-saga/effects'; +import { fetchNetworkEventsEffect } from './network_events/effects'; import { fetchSyntheticsMonitorEffect } from './monitor_details'; import { fetchIndexStatusEffect } from './index_status'; import { fetchSyntheticsEnablementEffect } from './synthetics_enablement'; @@ -30,5 +31,6 @@ export const rootEffect = function* root(): Generator { fork(quietFetchOverviewEffect), fork(browserJourneyEffects), fork(fetchOverviewStatusEffect), + fork(fetchNetworkEventsEffect), ]); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts index c83605ffad1f..b9c7b6ec8db5 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts @@ -7,6 +7,7 @@ import { combineReducers } from '@reduxjs/toolkit'; +import { networkEventsReducer, NetworkEventsState } from './network_events'; import { monitorDetailsReducer, MonitorDetailsState } from './monitor_details'; import { uiReducer, UiState } from './ui'; import { indexStatusReducer, IndexStatusState } from './index_status'; @@ -26,6 +27,7 @@ export interface SyntheticsAppState { monitorDetails: MonitorDetailsState; overview: MonitorOverviewState; browserJourney: BrowserJourneyState; + networkEvents: NetworkEventsState; } export const rootReducer = combineReducers({ @@ -37,4 +39,5 @@ export const rootReducer = combineReducers({ monitorDetails: monitorDetailsReducer, overview: monitorOverviewReducer, browserJourney: browserJourneyReducer, + networkEvents: networkEventsReducer, }); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts index 2fd43d198b8b..5dab17f55ad6 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts @@ -5,6 +5,8 @@ * 2.0. */ import { i18n } from '@kbn/i18n'; +import moment, { Moment } from 'moment'; +import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../../common/constants'; // one second = 1 million micros const ONE_SECOND_AS_MICROS = 1000000; @@ -37,3 +39,39 @@ export const formatDuration = (durationMicros: number) => { defaultMessage: '{seconds} s', }); }; + +export const getShortTimeStamp = (timeStamp: moment.Moment, relative = false) => { + if (relative) { + const prevLocale: string = moment.locale() ?? 'en'; + + const shortLocale = moment.locale(SHORT_TS_LOCALE) === SHORT_TS_LOCALE; + + if (!shortLocale) { + moment.defineLocale(SHORT_TS_LOCALE, SHORT_TIMESPAN_LOCALE); + } + + let shortTimestamp; + if (typeof timeStamp === 'string') { + shortTimestamp = parseTimestamp(timeStamp).fromNow(); + } else { + shortTimestamp = timeStamp.fromNow(); + } + + // Reset it so, it doesn't impact other part of the app + moment.locale(prevLocale); + return shortTimestamp; + } else { + if (moment().diff(timeStamp, 'd') >= 1) { + return timeStamp.format('ll LTS'); + } + return timeStamp.format('LTS'); + } +}; + +export const parseTimestamp = (tsValue: string): Moment => { + let parsed = Date.parse(tsValue); + if (isNaN(parsed)) { + parsed = parseInt(tsValue, 10); + } + return moment(parsed); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts new file mode 100644 index 000000000000..0b32c4a2420e --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import moment from 'moment'; +import { Moment } from 'moment-timezone'; +import * as redux from 'react-redux'; +import * as reactRouterDom from 'react-router-dom'; + +export function mockMoment() { + // avoid timezone issues + jest.spyOn(moment.prototype, 'format').mockImplementation(function (this: Moment) { + return `Sept 4, 2020 9:31:38 AM`; + }); + + // convert relative time to absolute time to avoid timing issues + jest.spyOn(moment.prototype, 'fromNow').mockImplementation(function (this: Moment) { + return `15 minutes ago`; + }); + + // use static locale string to avoid issues + jest.spyOn(moment.prototype, 'toLocaleString').mockImplementation(function (this: Moment) { + return `Thu May 09 2019 10:15:11 GMT-0400`; + }); +} + +export function mockMomentTimezone() { + jest.mock('moment-timezone', () => { + return function () { + return { tz: { guess: () => 'America/New_York' } }; + }; + }); +} + +export function mockDate() { + // use static date string to avoid CI timing issues + jest.spyOn(Date.prototype, 'toString').mockImplementation(function (this: Date) { + return `Tue, 01 Jan 2019 00:00:00 GMT`; + }); +} + +export function mockDataPlugin() { + jest.mock('@kbn/data-plugin/public', () => { + return function () { + return { + esKuery: { + fromKueryExpression: () => 'an ast', + toElasticsearchQuery: () => 'an es query', + }, + }; + }; + }); +} + +export function mockReduxHooks(response?: any) { + jest.spyOn(redux, 'useDispatch').mockReturnValue(jest.fn()); + + jest.spyOn(redux, 'useSelector').mockReturnValue(response); +} + +export function mockDispatch() { + jest.spyOn(redux, 'useDispatch').mockReturnValue(jest.fn()); +} + +export function mockReactRouterDomHooks({ useParamsResponse }: { useParamsResponse: any }) { + jest.spyOn(reactRouterDom, 'useParams').mockReturnValue(useParamsResponse); +} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts index 0ed0e2fd8563..3e213879ca66 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts @@ -102,6 +102,7 @@ export const mockState: SyntheticsAppState = { syntheticsEnablement: { loading: false, error: null, enablement: null }, monitorDetails: getMonitorDetailsMockSlice(), browserJourney: getBrowserJourneyMockSlice(), + networkEvents: {}, }; function getBrowserJourneyMockSlice() { diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts new file mode 100644 index 000000000000..bf6fb576dd8f --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * NOTE: This variable name MUST start with 'mock*' in order for + * Jest to accept its use within a jest.mock() + */ +export const mockHistory = { + createHref: jest.fn(({ pathname }) => `/enterprise_search${pathname}`), + push: jest.fn(), + location: { + pathname: '/current-path', + }, +}; + +jest.mock('react-router-dom', () => ({ + useHistory: jest.fn(() => mockHistory), +})); + +/** + * For example usage, @see public/applications/shared/react_router_helpers/eui_link.test.tsx + */ diff --git a/x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts b/x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts new file mode 100644 index 000000000000..f9faca7927d9 --- /dev/null +++ b/x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EUI_CHARTS_THEME_DARK, EUI_CHARTS_THEME_LIGHT } from '@elastic/eui/dist/eui_charts_theme'; +import { useMemo } from 'react'; +import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; + +export const useChartTheme = () => { + const [darkMode] = useUiSetting$('theme:darkMode'); + + const theme = useMemo(() => { + return darkMode ? EUI_CHARTS_THEME_DARK.theme : EUI_CHARTS_THEME_LIGHT.theme; + }, [darkMode]); + + return theme; +}; From 387964b4fa8a995a1831473b5394827ceb28a244 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 1 Nov 2022 09:31:33 -0400 Subject: [PATCH 58/87] skip failing test suite (#143870) --- .../tests/alerting/builtin_alert_types/es_query/rule.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts index 86ea7a9c3a18..abb3b8b43f02 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/builtin_alert_types/es_query/rule.ts @@ -37,7 +37,8 @@ export default function ruleTests({ getService }: FtrProviderContext) { createEsDocumentsInGroups, } = getRuleServices(getService); - describe('rule', async () => { + // Failing: See https://github.com/elastic/kibana/issues/143870 + describe.skip('rule', async () => { let endDate: string; let connectorId: string; const objectRemover = new ObjectRemover(supertest); From 807b782f23c3ba92f69c03bd0b7dd2775d893752 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 1 Nov 2022 09:32:17 -0400 Subject: [PATCH 59/87] skip failing test suite (#142155) --- x-pack/test/functional/apps/spaces/spaces_selection.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/spaces/spaces_selection.ts b/x-pack/test/functional/apps/spaces/spaces_selection.ts index 65fa1c9f0014..254a883ebf92 100644 --- a/x-pack/test/functional/apps/spaces/spaces_selection.ts +++ b/x-pack/test/functional/apps/spaces/spaces_selection.ts @@ -22,7 +22,8 @@ export default function spaceSelectorFunctionalTests({ ]); const spacesService = getService('spaces'); - describe('Spaces', function () { + // Failing: See https://github.com/elastic/kibana/issues/142155 + describe.skip('Spaces', function () { const testSpacesIds = ['another-space', ...Array.from('123456789', (idx) => `space-${idx}`)]; before(async () => { for (const testSpaceId of testSpacesIds) { From 1acc9a4be9b72a9824a53135dc9b8866cf646584 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Tue, 1 Nov 2022 14:36:13 +0100 Subject: [PATCH 60/87] [APM] Use force_synthetic_source in API tests (#144300) --- .../elasticsearch_fieldnames.test.ts.snap | 18 ++++++++++++++++++ x-pack/plugins/apm/server/index.ts | 1 + .../create_apm_event_client/index.test.ts | 1 + .../create_apm_event_client/index.ts | 10 ++++++++++ .../server/lib/helpers/get_apm_event_client.ts | 5 ++++- x-pack/plugins/apm/server/plugin.ts | 1 + .../es_archiver/apm_8.0.0/mappings.json | 16 ---------------- .../infra_metrics_and_apm/mappings.json | 18 +----------------- .../test/apm_api_integration/configs/index.ts | 7 +++++++ 9 files changed, 43 insertions(+), 34 deletions(-) diff --git a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap index 10c42bd763da..d30a32fd04fc 100644 --- a/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap +++ b/x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap @@ -45,6 +45,8 @@ exports[`Error CONTAINER_IMAGE 1`] = `undefined`; exports[`Error DESTINATION_ADDRESS 1`] = `undefined`; +exports[`Error DEVICE_MODEL_IDENTIFIER 1`] = `undefined`; + exports[`Error ERROR_CULPRIT 1`] = `"handleOopsie"`; exports[`Error ERROR_EXC_HANDLED 1`] = `undefined`; @@ -93,6 +95,8 @@ exports[`Error HOST_NAME 1`] = `undefined`; exports[`Error HOST_OS_PLATFORM 1`] = `undefined`; +exports[`Error HOST_OS_VERSION 1`] = `undefined`; + exports[`Error HTTP_REQUEST_METHOD 1`] = `undefined`; exports[`Error HTTP_RESPONSE_STATUS_CODE 1`] = `undefined`; @@ -153,6 +157,8 @@ exports[`Error METRIC_SYSTEM_TOTAL_MEMORY 1`] = `undefined`; exports[`Error METRICSET_NAME 1`] = `undefined`; +exports[`Error NETWORK_CONNECTION_TYPE 1`] = `undefined`; + exports[`Error OBSERVER_HOSTNAME 1`] = `undefined`; exports[`Error OBSERVER_LISTENING 1`] = `undefined`; @@ -304,6 +310,8 @@ exports[`Span CONTAINER_IMAGE 1`] = `undefined`; exports[`Span DESTINATION_ADDRESS 1`] = `undefined`; +exports[`Span DEVICE_MODEL_IDENTIFIER 1`] = `undefined`; + exports[`Span ERROR_CULPRIT 1`] = `undefined`; exports[`Span ERROR_EXC_HANDLED 1`] = `undefined`; @@ -348,6 +356,8 @@ exports[`Span HOST_NAME 1`] = `undefined`; exports[`Span HOST_OS_PLATFORM 1`] = `undefined`; +exports[`Span HOST_OS_VERSION 1`] = `undefined`; + exports[`Span HTTP_REQUEST_METHOD 1`] = `undefined`; exports[`Span HTTP_RESPONSE_STATUS_CODE 1`] = `undefined`; @@ -408,6 +418,8 @@ exports[`Span METRIC_SYSTEM_TOTAL_MEMORY 1`] = `undefined`; exports[`Span METRICSET_NAME 1`] = `undefined`; +exports[`Span NETWORK_CONNECTION_TYPE 1`] = `undefined`; + exports[`Span OBSERVER_HOSTNAME 1`] = `undefined`; exports[`Span OBSERVER_LISTENING 1`] = `undefined`; @@ -559,6 +571,8 @@ exports[`Transaction CONTAINER_IMAGE 1`] = `undefined`; exports[`Transaction DESTINATION_ADDRESS 1`] = `undefined`; +exports[`Transaction DEVICE_MODEL_IDENTIFIER 1`] = `undefined`; + exports[`Transaction ERROR_CULPRIT 1`] = `undefined`; exports[`Transaction ERROR_EXC_HANDLED 1`] = `undefined`; @@ -607,6 +621,8 @@ exports[`Transaction HOST_NAME 1`] = `undefined`; exports[`Transaction HOST_OS_PLATFORM 1`] = `undefined`; +exports[`Transaction HOST_OS_VERSION 1`] = `undefined`; + exports[`Transaction HTTP_REQUEST_METHOD 1`] = `"GET"`; exports[`Transaction HTTP_RESPONSE_STATUS_CODE 1`] = `200`; @@ -673,6 +689,8 @@ exports[`Transaction METRIC_SYSTEM_TOTAL_MEMORY 1`] = `undefined`; exports[`Transaction METRICSET_NAME 1`] = `undefined`; +exports[`Transaction NETWORK_CONNECTION_TYPE 1`] = `undefined`; + exports[`Transaction OBSERVER_HOSTNAME 1`] = `undefined`; exports[`Transaction OBSERVER_LISTENING 1`] = `undefined`; diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index 85fb7efc5370..17682706571c 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -54,6 +54,7 @@ const configSchema = schema.object({ sourcemap: schema.string({ defaultValue: 'apm-*' }), onboarding: schema.string({ defaultValue: 'apm-*' }), }), + forceSyntheticSource: schema.boolean({ defaultValue: false }), }); // plugin config diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts index d5068669bf27..449455d1f6bf 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts @@ -54,6 +54,7 @@ describe('APMEventClient', () => { indices: {} as any, options: { includeFrozen: false, + forceSyntheticSource: false, }, }); diff --git a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts index f013448d6abe..a22db0bb58b6 100644 --- a/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.ts @@ -80,6 +80,7 @@ export interface APMEventClientConfig { indices: ApmIndicesConfig; options: { includeFrozen: boolean; + forceSyntheticSource: boolean; }; } @@ -89,6 +90,7 @@ export class APMEventClient { private readonly request: KibanaRequest; private readonly indices: ApmIndicesConfig; private readonly includeFrozen: boolean; + private readonly forceSyntheticSource: boolean; constructor(config: APMEventClientConfig) { this.esClient = config.esClient; @@ -96,6 +98,7 @@ export class APMEventClient { this.request = config.request; this.indices = config.indices; this.includeFrozen = config.options.includeFrozen; + this.forceSyntheticSource = config.options.forceSyntheticSource; } private callAsyncWithDebug({ @@ -149,11 +152,18 @@ export class APMEventClient { this.indices ); + const forceSyntheticSourceForThisRequest = + this.forceSyntheticSource && + params.apm.events.includes(ProcessorEvent.metric); + const searchParams = { ...withProcessorEventFilter, ...(this.includeFrozen ? { ignore_throttled: false } : {}), ignore_unavailable: true, preference: 'any', + ...(forceSyntheticSourceForThisRequest + ? { force_synthetic_source: true } + : {}), }; return this.callAsyncWithDebug({ diff --git a/x-pack/plugins/apm/server/lib/helpers/get_apm_event_client.ts b/x-pack/plugins/apm/server/lib/helpers/get_apm_event_client.ts index 6ee9bb94a62b..7ed4902fa061 100644 --- a/x-pack/plugins/apm/server/lib/helpers/get_apm_event_client.ts +++ b/x-pack/plugins/apm/server/lib/helpers/get_apm_event_client.ts @@ -36,7 +36,10 @@ export async function getApmEventClient({ debug: params.query._inspect, request, indices, - options: { includeFrozen }, + options: { + includeFrozen, + forceSyntheticSource: config.forceSyntheticSource, + }, }); }); } diff --git a/x-pack/plugins/apm/server/plugin.ts b/x-pack/plugins/apm/server/plugin.ts index de49cc793ede..a6509c677919 100644 --- a/x-pack/plugins/apm/server/plugin.ts +++ b/x-pack/plugins/apm/server/plugin.ts @@ -234,6 +234,7 @@ export class APMPlugin indices, options: { includeFrozen, + forceSyntheticSource: currentConfig.forceSyntheticSource, }, }); }, diff --git a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json index 2d05717fa572..ee8b97f7ac0a 100644 --- a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json +++ b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/apm_8.0.0/mappings.json @@ -7196,10 +7196,6 @@ "handled": { "type": "boolean" }, - "message": { - "norms": false, - "type": "text" - }, "module": { "ignore_above": 1024, "type": "keyword" @@ -7232,20 +7228,12 @@ "ignore_above": 1024, "type": "keyword" }, - "message": { - "norms": false, - "type": "text" - }, "param_message": { "ignore_above": 1024, "type": "keyword" } } }, - "message": { - "norms": false, - "type": "text" - }, "stack_trace": { "fields": { "text": { @@ -8460,10 +8448,6 @@ } } }, - "message": { - "norms": false, - "type": "text" - }, "metricset": { "properties": { "name": { diff --git a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json index 433359003605..5695c2a8494a 100644 --- a/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json +++ b/x-pack/test/apm_api_integration/common/fixtures/es_archiver/infra_metrics_and_apm/mappings.json @@ -464,10 +464,6 @@ "handled": { "type": "boolean" }, - "message": { - "norms": false, - "type": "text" - }, "module": { "ignore_above": 1024, "type": "keyword" @@ -496,20 +492,12 @@ "ignore_above": 1024, "type": "keyword" }, - "message": { - "norms": false, - "type": "text" - }, "param_message": { "ignore_above": 1024, "type": "keyword" } } }, - "message": { - "norms": false, - "type": "text" - }, "type": { "ignore_above": 1024, "type": "keyword" @@ -1158,10 +1146,6 @@ } } }, - "message": { - "norms": false, - "type": "text" - }, "network": { "properties": { "application": { @@ -17630,4 +17614,4 @@ } } } -} \ No newline at end of file +} diff --git a/x-pack/test/apm_api_integration/configs/index.ts b/x-pack/test/apm_api_integration/configs/index.ts index 3bc03eb5b425..e4dfc0b8e387 100644 --- a/x-pack/test/apm_api_integration/configs/index.ts +++ b/x-pack/test/apm_api_integration/configs/index.ts @@ -11,14 +11,21 @@ import { createTestConfig, CreateTestConfig } from '../common/config'; const apmFtrConfigs = { basic: { license: 'basic' as const, + kibanaConfig: { + 'xpack.apm.forceSyntheticSource': 'true', + }, }, trial: { license: 'trial' as const, + kibanaConfig: { + 'xpack.apm.forceSyntheticSource': 'true', + }, }, rules: { license: 'trial' as const, kibanaConfig: { 'xpack.ruleRegistry.write.enabled': 'true', + 'xpack.apm.forceSyntheticSource': 'true', }, }, }; From 6f5b716ddb695ef6203e91851124afce43bb64e5 Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:23:57 -0400 Subject: [PATCH 61/87] [Security Solution][Endpoint] Re-organize responder folder and hooks folder within endpoint management (#144277) * re-organized the `endpoint_responder/` folder * Rename `getEndpointResponseActionsConsoleCommands()` * re-organize the hooks folder * fix jest.mock() paths * Update jest test snapshot --- .../endpoint_action_failure_message.tsx | 2 +- .../get_file_action.tsx | 10 +++---- .../get_processes_action.tsx | 8 +++--- .../get_file_action.test.tsx | 28 +++++++++---------- .../get_processes_action.test.tsx | 20 ++++++------- .../integration_tests/isolate_action.test.tsx | 22 +++++++-------- .../kill_process_action.test.tsx | 20 ++++++------- .../integration_tests/release_action.test.tsx | 22 +++++++-------- .../suspend_process_action.test.tsx | 20 ++++++------- .../isolate_action.tsx | 6 ++-- .../kill_process_action.tsx | 10 +++---- .../release_action.tsx | 6 ++-- .../status_action.tsx | 24 ++++++++-------- .../suspend_process_action.tsx | 10 +++---- .../{ => components}/action_error.tsx | 6 ++-- .../{ => components}/action_log_button.tsx | 6 ++-- .../{ => components}/action_success.tsx | 6 ++-- .../header_endpoint_info.test.tsx | 18 ++++++------ .../{ => components}/header_endpoint_info.tsx | 8 +++--- .../{ => components}/offline_callout.test.tsx | 14 +++++----- .../{ => components}/offline_callout.tsx | 4 +-- .../hooks/use_console_action_submitter.tsx | 8 +++--- .../components/endpoint_responder/index.ts | 6 ++-- .../console_commands_definition.ts} | 26 ++++++++--------- .../{ => lib}/constants.tsx | 0 .../endpoint_action_response_codes.ts | 0 .../{ => lib}/get_command_about_info.tsx | 2 +- .../{ => lib}/utils.test.ts | 0 .../endpoint_responder/{ => lib}/utils.ts | 2 +- .../response_actions_log.test.tsx | 4 +-- .../response_action_file_download_link.tsx | 2 +- .../public/management/hooks/index.ts | 4 +-- .../use_get_action_details.test.ts | 0 .../use_get_action_details.ts | 0 .../use_get_endpoint_action_list.test.ts | 0 .../use_get_endpoint_action_list.ts | 0 ...t_endpoint_pending_actions_summary.test.ts | 0 ...se_get_endpoint_pending_actions_summary.ts | 0 .../use_get_file_info.test.ts | 0 .../use_get_file_info.ts | 0 ...use_send_get_endpoint_processes_request.ts | 0 .../use_send_get_file_request.ts | 0 .../use_send_isolate_endpoint_request.ts | 0 .../use_send_kill_process_endpoint_request.ts | 0 .../use_send_release_endpoint_request.ts | 0 ...e_send_suspend_process_endpoint_request.ts | 0 .../use_with_show_endpoint_responder.tsx | 16 +++++------ .../view/response_actions_list_page.test.tsx | 6 ++-- .../netflow_row_renderer.test.tsx.snap | 12 ++++---- 49 files changed, 181 insertions(+), 177 deletions(-) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/get_file_action.tsx (84%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/get_processes_action.tsx (91%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/integration_tests/get_file_action.test.tsx (84%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/integration_tests/get_processes_action.test.tsx (89%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/integration_tests/isolate_action.test.tsx (89%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/integration_tests/kill_process_action.test.tsx (92%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/integration_tests/release_action.test.tsx (89%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/integration_tests/suspend_process_action.test.tsx (92%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/isolate_action.tsx (81%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/kill_process_action.tsx (79%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/release_action.tsx (81%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/status_action.tsx (89%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => command_render_components}/suspend_process_action.tsx (79%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => components}/action_error.tsx (78%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => components}/action_log_button.tsx (90%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => components}/action_success.tsx (89%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => components}/header_endpoint_info.test.tsx (70%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => components}/header_endpoint_info.tsx (90%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => components}/offline_callout.test.tsx (74%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => components}/offline_callout.tsx (92%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{endpoint_response_actions_console_commands.ts => lib/console_commands_definition.ts} (93%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => lib}/constants.tsx (100%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => lib}/endpoint_action_response_codes.ts (100%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => lib}/get_command_about_info.tsx (100%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => lib}/utils.test.ts (100%) rename x-pack/plugins/security_solution/public/management/components/endpoint_responder/{ => lib}/utils.ts (94%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_action_details.test.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_action_details.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_endpoint_action_list.test.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_endpoint_action_list.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_endpoint_pending_actions_summary.test.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_endpoint_pending_actions_summary.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_file_info.test.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_get_file_info.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_send_get_endpoint_processes_request.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_send_get_file_request.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_send_isolate_endpoint_request.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_send_kill_process_endpoint_request.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_send_release_endpoint_request.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => response_actions}/use_send_suspend_process_endpoint_request.ts (100%) rename x-pack/plugins/security_solution/public/management/hooks/{endpoint => }/use_with_show_endpoint_responder.tsx (80%) diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx index 1e2745cb03e6..6a197890b4bf 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx @@ -9,7 +9,7 @@ import React, { memo, useMemo } from 'react'; import { EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { endpointActionResponseCodes } from '../endpoint_responder/endpoint_action_response_codes'; +import { endpointActionResponseCodes } from '../endpoint_responder/lib/endpoint_action_response_codes'; import type { ActionDetails, MaybeImmutable } from '../../../../common/endpoint/types'; interface EndpointActionFailureMessageProps { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_file_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx similarity index 84% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_file_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx index d0f090e6595c..b65e13003c26 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_file_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx @@ -7,11 +7,11 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { useSendGetFileRequest } from '../../hooks/endpoint/use_send_get_file_request'; -import type { ResponseActionGetFileRequestBody } from '../../../../common/endpoint/schema/actions'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; -import type { ActionRequestComponentProps } from './types'; -import { ResponseActionFileDownloadLink } from '../response_action_file_download_link'; +import { useSendGetFileRequest } from '../../../hooks/response_actions/use_send_get_file_request'; +import type { ResponseActionGetFileRequestBody } from '../../../../../common/endpoint/schema/actions'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; +import type { ActionRequestComponentProps } from '../types'; +import { ResponseActionFileDownloadLink } from '../../response_action_file_download_link'; export const GetFileActionResult = memo< ActionRequestComponentProps<{ diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_processes_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx similarity index 91% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_processes_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx index d7b05ae721ab..81ded3d02094 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_processes_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx @@ -9,13 +9,13 @@ import React, { memo, useMemo } from 'react'; import styled from 'styled-components'; import { EuiBasicTable } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; import type { GetProcessesActionOutputContent, ProcessesRequestBody, -} from '../../../../common/endpoint/types'; -import { useSendGetEndpointProcessesRequest } from '../../hooks/endpoint/use_send_get_endpoint_processes_request'; -import type { ActionRequestComponentProps } from './types'; +} from '../../../../../common/endpoint/types'; +import { useSendGetEndpointProcessesRequest } from '../../../hooks/response_actions/use_send_get_endpoint_processes_request'; +import type { ActionRequestComponentProps } from '../types'; // @ts-expect-error TS2769 const StyledEuiBasicTable = styled(EuiBasicTable)` diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_file_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx similarity index 84% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_file_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx index d69771446038..c2ad573616e3 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_file_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx @@ -5,26 +5,26 @@ * 2.0. */ -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; -import { getEndpointResponseActionsConsoleCommands } from '..'; +} from '../../../console/components/console_manager/mocks'; +import { getEndpointConsoleCommands } from '../..'; import React from 'react'; -import { enterConsoleCommand } from '../../console/mocks'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { GET_FILE_ROUTE } from '../../../../../common/endpoint/constants'; -import { getEndpointAuthzInitialStateMock } from '../../../../../common/endpoint/service/authz/mocks'; -import type { EndpointPrivileges } from '../../../../../common/endpoint/types'; -import { INSUFFICIENT_PRIVILEGES_FOR_COMMAND } from '../../../../common/translations'; +import { GET_FILE_ROUTE } from '../../../../../../common/endpoint/constants'; +import { getEndpointAuthzInitialStateMock } from '../../../../../../common/endpoint/service/authz/mocks'; +import type { EndpointPrivileges } from '../../../../../../common/endpoint/types'; +import { INSUFFICIENT_PRIVILEGES_FOR_COMMAND } from '../../../../../common/translations'; import type { HttpFetchOptionsWithPath } from '@kbn/core-http-browser'; -jest.mock('../../../../common/components/user_privileges'); +jest.mock('../../../../../common/components/user_privileges'); describe('When using get-file action from response actions console', () => { let render: ( @@ -50,7 +50,7 @@ describe('When using get-file action from response actions console', () => { return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_processes_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_processes_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx index e39cea0b7ce1..a99e8cdd17ef 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/get_processes_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx @@ -5,20 +5,20 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using processes action from response actions console', () => { let render: ( @@ -42,7 +42,7 @@ describe('When using processes action from response actions console', () => { return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/isolate_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/isolate_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx index f111b7aafbff..ab98acc5bd39 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/isolate_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx @@ -5,21 +5,21 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { getDeferred } from '../../../mocks/utils'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { getDeferred } from '../../../../mocks/utils'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using isolate action from response actions console', () => { let render: ( @@ -43,7 +43,7 @@ describe('When using isolate action from response actions console', () => { return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/kill_process_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/kill_process_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx index 631da12cc1d3..b6259e788224 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/kill_process_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx @@ -5,20 +5,20 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using the kill-process action from response actions console', () => { let render: ( @@ -42,7 +42,7 @@ describe('When using the kill-process action from response actions console', () return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/release_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/release_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx index e377d23c2c14..633c82a47897 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/release_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx @@ -5,21 +5,21 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { getDeferred } from '../../../mocks/utils'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { getDeferred } from '../../../../mocks/utils'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using the release action from response actions console', () => { let render: ( @@ -43,7 +43,7 @@ describe('When using the release action from response actions console', () => { return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/suspend_process_action.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/suspend_process_action.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx index a41ed9fe3d6e..f234ec1e2280 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/integration_tests/suspend_process_action.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx @@ -5,20 +5,20 @@ * 2.0. */ -import type { AppContextTestRender } from '../../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import type { AppContextTestRender } from '../../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../../common/mock/endpoint'; import { ConsoleManagerTestComponent, getConsoleManagerMockRenderResultQueriesAndActions, -} from '../../console/components/console_manager/mocks'; +} from '../../../console/components/console_manager/mocks'; import React from 'react'; -import { getEndpointResponseActionsConsoleCommands } from '../endpoint_response_actions_console_commands'; -import { enterConsoleCommand } from '../../console/mocks'; +import { getEndpointConsoleCommands } from '../../lib/console_commands_definition'; +import { enterConsoleCommand } from '../../../console/mocks'; import { waitFor } from '@testing-library/react'; -import { responseActionsHttpMocks } from '../../../mocks/response_actions_http_mocks'; -import { getEndpointAuthzInitialState } from '../../../../../common/endpoint/service/authz'; -import type { EndpointCapabilities } from '../../../../../common/endpoint/service/response_actions/constants'; -import { ENDPOINT_CAPABILITIES } from '../../../../../common/endpoint/service/response_actions/constants'; +import { responseActionsHttpMocks } from '../../../../mocks/response_actions_http_mocks'; +import { getEndpointAuthzInitialState } from '../../../../../../common/endpoint/service/authz'; +import type { EndpointCapabilities } from '../../../../../../common/endpoint/service/response_actions/constants'; +import { ENDPOINT_CAPABILITIES } from '../../../../../../common/endpoint/service/response_actions/constants'; describe('When using the suspend-process action from response actions console', () => { let render: ( @@ -42,7 +42,7 @@ describe('When using the suspend-process action from response actions console', return { consoleProps: { 'data-test-subj': 'test', - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId: 'a.b.c', endpointCapabilities: [...capabilities], endpointPrivileges: { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/isolate_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx similarity index 81% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/isolate_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx index 8df7692cf3ac..84bc9b9a6cae 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/isolate_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx @@ -6,9 +6,9 @@ */ import { memo, useMemo } from 'react'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; -import type { ActionRequestComponentProps } from './types'; -import { useSendIsolateEndpointRequest } from '../../hooks/endpoint/use_send_isolate_endpoint_request'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; +import type { ActionRequestComponentProps } from '../types'; +import { useSendIsolateEndpointRequest } from '../../../hooks/response_actions/use_send_isolate_endpoint_request'; export const IsolateActionResult = memo( ({ command, setStore, store, status, setStatus, ResultComponent }) => { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx similarity index 79% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx index bf501c31b9e8..657b6847e783 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/kill_process_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx @@ -6,11 +6,11 @@ */ import { memo, useMemo } from 'react'; -import type { KillOrSuspendProcessRequestBody } from '../../../../common/endpoint/types'; -import { parsedPidOrEntityIdParameter } from './utils'; -import { useSendKillProcessRequest } from '../../hooks/endpoint/use_send_kill_process_endpoint_request'; -import type { ActionRequestComponentProps } from './types'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +import type { KillOrSuspendProcessRequestBody } from '../../../../../common/endpoint/types'; +import { parsedPidOrEntityIdParameter } from '../lib/utils'; +import { useSendKillProcessRequest } from '../../../hooks/response_actions/use_send_kill_process_endpoint_request'; +import type { ActionRequestComponentProps } from '../types'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; export const KillProcessActionResult = memo< ActionRequestComponentProps<{ pid?: string[]; entityId?: string[] }> diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/release_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx similarity index 81% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/release_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx index 9b0f371ca003..b0f2db75b798 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/release_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx @@ -6,9 +6,9 @@ */ import { memo, useMemo } from 'react'; -import type { ActionRequestComponentProps } from './types'; -import { useSendReleaseEndpointRequest } from '../../hooks/endpoint/use_send_release_endpoint_request'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +import type { ActionRequestComponentProps } from '../types'; +import { useSendReleaseEndpointRequest } from '../../../hooks/response_actions/use_send_release_endpoint_request'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; export const ReleaseActionResult = memo( ({ command, setStore, store, status, setStatus, ResultComponent }) => { diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx index b75a48076584..342e7654ec39 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx @@ -7,20 +7,20 @@ import React, { memo, useEffect, useMemo, useCallback } from 'react'; import { EuiDescriptionList } from '@elastic/eui'; +import { v4 as uuidV4 } from 'uuid'; import { i18n } from '@kbn/i18n'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { v4 as uuidV4 } from 'uuid'; -import type { HostInfo, PendingActionsResponse } from '../../../../common/endpoint/types'; -import type { EndpointCommandDefinitionMeta } from './types'; -import type { EndpointHostIsolationStatusProps } from '../../../common/components/endpoint/host_isolation'; -import { useGetEndpointPendingActionsSummary } from '../../hooks/endpoint/use_get_endpoint_pending_actions_summary'; -import { FormattedDate } from '../../../common/components/formatted_date'; -import { useGetEndpointDetails } from '../../hooks'; -import type { CommandExecutionComponentProps } from '../console/types'; -import { FormattedError } from '../formatted_error'; -import { ConsoleCodeBlock } from '../console/components/console_code_block'; -import { POLICY_STATUS_TO_TEXT } from '../../pages/endpoint_hosts/view/host_constants'; -import { getAgentStatusText } from '../../../common/components/endpoint/agent_status_text'; +import type { HostInfo, PendingActionsResponse } from '../../../../../common/endpoint/types'; +import type { EndpointCommandDefinitionMeta } from '../types'; +import type { EndpointHostIsolationStatusProps } from '../../../../common/components/endpoint/host_isolation'; +import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'; +import { FormattedDate } from '../../../../common/components/formatted_date'; +import { useGetEndpointDetails } from '../../../hooks'; +import type { CommandExecutionComponentProps } from '../../console/types'; +import { FormattedError } from '../../formatted_error'; +import { ConsoleCodeBlock } from '../../console/components/console_code_block'; +import { POLICY_STATUS_TO_TEXT } from '../../../pages/endpoint_hosts/view/host_constants'; +import { getAgentStatusText } from '../../../../common/components/endpoint/agent_status_text'; export const EndpointStatusActionResult = memo< CommandExecutionComponentProps< diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx similarity index 79% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx index f8401a81fa11..02b125294a66 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/suspend_process_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx @@ -6,14 +6,14 @@ */ import { memo, useMemo } from 'react'; -import { parsedPidOrEntityIdParameter } from './utils'; +import { parsedPidOrEntityIdParameter } from '../lib/utils'; import type { SuspendProcessActionOutputContent, KillOrSuspendProcessRequestBody, -} from '../../../../common/endpoint/types'; -import { useSendSuspendProcessRequest } from '../../hooks/endpoint/use_send_suspend_process_endpoint_request'; -import type { ActionRequestComponentProps } from './types'; -import { useConsoleActionSubmitter } from './hooks/use_console_action_submitter'; +} from '../../../../../common/endpoint/types'; +import { useSendSuspendProcessRequest } from '../../../hooks/response_actions/use_send_suspend_process_endpoint_request'; +import type { ActionRequestComponentProps } from '../types'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; export const SuspendProcessActionResult = memo< ActionRequestComponentProps<{ pid?: string[]; entityId?: string[] }> diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_error.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx similarity index 78% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_error.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx index 3060f76247cb..ed3fa1928fbc 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_error.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx @@ -6,9 +6,9 @@ */ import React, { memo } from 'react'; -import { EndpointActionFailureMessage } from '../endpoint_action_failure_message'; -import type { CommandExecutionResultComponent } from '../console/components/command_execution_result'; -import type { ActionDetails, MaybeImmutable } from '../../../../common/endpoint/types'; +import { EndpointActionFailureMessage } from '../../endpoint_action_failure_message'; +import type { CommandExecutionResultComponent } from '../../console/components/command_execution_result'; +import type { ActionDetails, MaybeImmutable } from '../../../../../common/endpoint/types'; export const ActionError = memo<{ action: MaybeImmutable; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_log_button.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx similarity index 90% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_log_button.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx index 655bc0a6c891..79307689033d 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_log_button.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx @@ -8,9 +8,9 @@ import React, { memo, useCallback, useState } from 'react'; import { EuiButton, EuiFlyout, EuiFlyoutBody, EuiFlyoutHeader, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { EndpointResponderExtensionComponentProps } from './types'; -import { ResponseActionsLog } from '../endpoint_response_actions_list/response_actions_log'; -import { UX_MESSAGES } from '../endpoint_response_actions_list/translations'; +import type { EndpointResponderExtensionComponentProps } from '../types'; +import { ResponseActionsLog } from '../../endpoint_response_actions_list/response_actions_log'; +import { UX_MESSAGES } from '../../endpoint_response_actions_list/translations'; export const ActionLogButton = memo((props) => { const [showActionLogFlyout, setShowActionLogFlyout] = useState(false); diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_success.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_success.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx index 183fb2fe5d67..9f7a22ece872 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/action_success.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx @@ -6,9 +6,9 @@ */ import React, { memo, useMemo } from 'react'; -import { endpointActionResponseCodes } from './endpoint_action_response_codes'; -import type { ActionDetails, MaybeImmutable } from '../../../../common/endpoint/types'; -import type { CommandExecutionResultComponent, CommandExecutionResultProps } from '../console'; +import { endpointActionResponseCodes } from '../lib/endpoint_action_response_codes'; +import type { ActionDetails, MaybeImmutable } from '../../../../../common/endpoint/types'; +import type { CommandExecutionResultComponent, CommandExecutionResultProps } from '../../console'; export interface ActionSuccessProps extends CommandExecutionResultProps { action: MaybeImmutable>; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx similarity index 70% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx index 550b677d4d93..78667399f04d 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.test.tsx @@ -6,17 +6,17 @@ */ import React from 'react'; -import { EndpointActionGenerator } from '../../../../common/endpoint/data_generators/endpoint_action_generator'; -import type { HostInfo } from '../../../../common/endpoint/types'; -import type { AppContextTestRender } from '../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; -import { useGetEndpointDetails } from '../../hooks/endpoint/use_get_endpoint_details'; -import { useGetEndpointPendingActionsSummary } from '../../hooks/endpoint/use_get_endpoint_pending_actions_summary'; -import { mockEndpointDetailsApiResult } from '../../pages/endpoint_hosts/store/mock_endpoint_result_list'; +import { EndpointActionGenerator } from '../../../../../common/endpoint/data_generators/endpoint_action_generator'; +import type { HostInfo } from '../../../../../common/endpoint/types'; +import type { AppContextTestRender } from '../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details'; +import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'; +import { mockEndpointDetailsApiResult } from '../../../pages/endpoint_hosts/store/mock_endpoint_result_list'; import { HeaderEndpointInfo } from './header_endpoint_info'; -jest.mock('../../hooks/endpoint/use_get_endpoint_details'); -jest.mock('../../hooks/endpoint/use_get_endpoint_pending_actions_summary'); +jest.mock('../../../hooks/endpoint/use_get_endpoint_details'); +jest.mock('../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'); const getEndpointDetails = useGetEndpointDetails as jest.Mock; const getPendingActions = useGetEndpointPendingActionsSummary as jest.Mock; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx similarity index 90% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx index 296b98d2e9fb..37bfb77ce8a9 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/header_endpoint_info.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_endpoint_info.tsx @@ -15,10 +15,10 @@ import { EuiSpacer, } from '@elastic/eui'; import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react'; -import { useGetEndpointDetails } from '../../hooks/endpoint/use_get_endpoint_details'; -import { useGetEndpointPendingActionsSummary } from '../../hooks/endpoint/use_get_endpoint_pending_actions_summary'; -import type { EndpointHostIsolationStatusProps } from '../../../common/components/endpoint/host_isolation'; -import { EndpointAgentAndIsolationStatus } from '../endpoint_agent_and_isolation_status'; +import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details'; +import type { EndpointHostIsolationStatusProps } from '../../../../common/components/endpoint/host_isolation'; +import { EndpointAgentAndIsolationStatus } from '../../endpoint_agent_and_isolation_status'; +import { useGetEndpointPendingActionsSummary } from '../../../hooks/response_actions/use_get_endpoint_pending_actions_summary'; interface HeaderEndpointInfoProps { endpointId: string; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx similarity index 74% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.test.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx index 2b71c4f6e74b..b5124eaae122 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx @@ -6,15 +6,15 @@ */ import React from 'react'; -import type { HostInfo } from '../../../../common/endpoint/types'; -import { HostStatus } from '../../../../common/endpoint/types'; -import type { AppContextTestRender } from '../../../common/mock/endpoint'; -import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; -import { useGetEndpointDetails } from '../../hooks/endpoint/use_get_endpoint_details'; -import { mockEndpointDetailsApiResult } from '../../pages/endpoint_hosts/store/mock_endpoint_result_list'; +import type { HostInfo } from '../../../../../common/endpoint/types'; +import { HostStatus } from '../../../../../common/endpoint/types'; +import type { AppContextTestRender } from '../../../../common/mock/endpoint'; +import { createAppRootMockRenderer } from '../../../../common/mock/endpoint'; +import { useGetEndpointDetails } from '../../../hooks/endpoint/use_get_endpoint_details'; +import { mockEndpointDetailsApiResult } from '../../../pages/endpoint_hosts/store/mock_endpoint_result_list'; import { OfflineCallout } from './offline_callout'; -jest.mock('../../hooks/endpoint/use_get_endpoint_details'); +jest.mock('../../../hooks/endpoint/use_get_endpoint_details'); const getEndpointDetails = useGetEndpointDetails as jest.Mock; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx index 70d89c6b66a4..ed00a3c5ac33 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/offline_callout.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx @@ -9,8 +9,8 @@ import React, { memo } from 'react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { useGetEndpointDetails } from '../../hooks'; -import { HostStatus } from '../../../../common/endpoint/types'; +import { useGetEndpointDetails } from '../../../hooks'; +import { HostStatus } from '../../../../../common/endpoint/types'; interface OfflineCalloutProps { endpointId: string; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx index 98f8954f0dd6..17cffff68341 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx @@ -12,11 +12,11 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { useIsMounted } from '@kbn/securitysolution-hook-utils'; import { useTestIdGenerator } from '../../../hooks/use_test_id_generator'; import type { BaseActionRequestBody } from '../../../../../common/endpoint/schema/actions'; -import { ActionSuccess } from '../action_success'; -import { ActionError } from '../action_error'; +import { ActionSuccess } from '../components/action_success'; +import { ActionError } from '../components/action_error'; import { FormattedError } from '../../formatted_error'; -import { useGetActionDetails } from '../../../hooks/endpoint/use_get_action_details'; -import { ACTION_DETAILS_REFRESH_INTERVAL } from '../constants'; +import { useGetActionDetails } from '../../../hooks/response_actions/use_get_action_details'; +import { ACTION_DETAILS_REFRESH_INTERVAL } from '../lib/constants'; import type { ActionDetails, Immutable, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts index 35b632d1ea4e..2fb9c4fd7694 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts @@ -5,5 +5,7 @@ * 2.0. */ -export { getEndpointResponseActionsConsoleCommands } from './endpoint_response_actions_console_commands'; -export { ActionLogButton } from './action_log_button'; +export { getEndpointConsoleCommands } from './lib/console_commands_definition'; +export { ActionLogButton } from './components/action_log_button'; +export { HeaderEndpointInfo } from './components/header_endpoint_info'; +export { OfflineCallout } from './components/offline_callout'; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts similarity index 93% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts index 1b4768c13d14..b74304a21280 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_response_actions_console_commands.ts +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts @@ -9,21 +9,21 @@ import { i18n } from '@kbn/i18n'; import type { EndpointCapabilities, ConsoleResponseActionCommands, -} from '../../../../common/endpoint/service/response_actions/constants'; -import { GetFileActionResult } from './get_file_action'; -import type { Command, CommandDefinition } from '../console'; -import { IsolateActionResult } from './isolate_action'; -import { ReleaseActionResult } from './release_action'; -import { KillProcessActionResult } from './kill_process_action'; -import { SuspendProcessActionResult } from './suspend_process_action'; -import { EndpointStatusActionResult } from './status_action'; -import { GetProcessesActionResult } from './get_processes_action'; -import type { ParsedArgData } from '../console/service/parsed_command_input'; -import type { EndpointPrivileges, ImmutableArray } from '../../../../common/endpoint/types'; +} from '../../../../../common/endpoint/service/response_actions/constants'; +import { GetFileActionResult } from '../command_render_components/get_file_action'; +import type { Command, CommandDefinition } from '../../console'; +import { IsolateActionResult } from '../command_render_components/isolate_action'; +import { ReleaseActionResult } from '../command_render_components/release_action'; +import { KillProcessActionResult } from '../command_render_components/kill_process_action'; +import { SuspendProcessActionResult } from '../command_render_components/suspend_process_action'; +import { EndpointStatusActionResult } from '../command_render_components/status_action'; +import { GetProcessesActionResult } from '../command_render_components/get_processes_action'; +import type { ParsedArgData } from '../../console/service/parsed_command_input'; +import type { EndpointPrivileges, ImmutableArray } from '../../../../../common/endpoint/types'; import { INSUFFICIENT_PRIVILEGES_FOR_COMMAND, UPGRADE_ENDPOINT_FOR_RESPONDER, -} from '../../../common/translations'; +} from '../../../../common/translations'; import { getCommandAboutInfo } from './get_command_about_info'; const emptyArgumentValidator = (argData: ParsedArgData): true | string => { @@ -125,7 +125,7 @@ const COMMENT_ARG_ABOUT = i18n.translate( { defaultMessage: 'A comment to go along with the action' } ); -export const getEndpointResponseActionsConsoleCommands = ({ +export const getEndpointConsoleCommands = ({ endpointAgentId, endpointCapabilities, endpointPrivileges, diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/constants.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/constants.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_action_response_codes.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/endpoint_action_response_codes.ts rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_command_about_info.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_command_about_info.tsx rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx index 3a973defa2d0..5f3261d312d2 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/get_command_about_info.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx @@ -6,8 +6,8 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; import { EuiIconTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; const UNSUPPORTED_COMMAND_INFO = i18n.translate( 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.unsupportedCommandInfo', diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.test.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.test.ts rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts similarity index 94% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts rename to x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts index 0b8e59d0353f..d1d16b72a426 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/utils.ts +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { ResponseActionParametersWithPidOrEntityId } from '../../../../common/endpoint/types'; +import type { ResponseActionParametersWithPidOrEntityId } from '../../../../../common/endpoint/types'; export const parsedPidOrEntityIdParameter = (parameters: { pid?: string[]; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx index 01d19867d421..ea6cbffd830e 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.test.tsx @@ -30,8 +30,8 @@ let mockUseGetEndpointActionList: { data?: ActionListApiResponse; refetch: () => unknown; }; -jest.mock('../../hooks/endpoint/use_get_endpoint_action_list', () => { - const original = jest.requireActual('../../hooks/endpoint/use_get_endpoint_action_list'); +jest.mock('../../hooks/response_actions/use_get_endpoint_action_list', () => { + const original = jest.requireActual('../../hooks/response_actions/use_get_endpoint_action_list'); return { ...original, useGetEndpointActionList: () => mockUseGetEndpointActionList, diff --git a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx index 20701ff55559..3d9f41974969 100644 --- a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx +++ b/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx @@ -18,7 +18,7 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { FormattedError } from '../formatted_error'; -import { useGetFileInfo } from '../../hooks/endpoint/use_get_file_info'; +import { useGetFileInfo } from '../../hooks/response_actions/use_get_file_info'; import { useUserPrivileges } from '../../../common/components/user_privileges'; import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; import type { MaybeImmutable } from '../../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/index.ts b/x-pack/plugins/security_solution/public/management/hooks/index.ts index cf4e99180f0c..b439bcffb887 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/index.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/index.ts @@ -6,5 +6,5 @@ */ export { useGetEndpointDetails } from './endpoint/use_get_endpoint_details'; -export { useWithShowEndpointResponder } from './endpoint/use_with_show_endpoint_responder'; -export { useGetEndpointActionList } from './endpoint/use_get_endpoint_action_list'; +export { useWithShowEndpointResponder } from './use_with_show_endpoint_responder'; +export { useGetEndpointActionList } from './response_actions/use_get_endpoint_action_list'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_file_info.test.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_file_info.test.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_file_info.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_file_info.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_file_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_file_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts rename to x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_with_show_endpoint_responder.tsx b/x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx similarity index 80% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_with_show_endpoint_responder.tsx rename to x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx index 3ad37c76c7ff..bfd674960860 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_with_show_endpoint_responder.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/use_with_show_endpoint_responder.tsx @@ -7,15 +7,15 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { useUserPrivileges } from '../../../common/components/user_privileges'; +import { useUserPrivileges } from '../../common/components/user_privileges'; import { ActionLogButton, - getEndpointResponseActionsConsoleCommands, -} from '../../components/endpoint_responder'; -import { useConsoleManager } from '../../components/console'; -import type { HostMetadata } from '../../../../common/endpoint/types'; -import { HeaderEndpointInfo } from '../../components/endpoint_responder/header_endpoint_info'; -import { OfflineCallout } from '../../components/endpoint_responder/offline_callout'; + getEndpointConsoleCommands, + HeaderEndpointInfo, + OfflineCallout, +} from '../components/endpoint_responder'; +import { useConsoleManager } from '../components/console'; +import type { HostMetadata } from '../../../common/endpoint/types'; type ShowEndpointResponseActionsConsole = (endpointMetadata: HostMetadata) => void; @@ -48,7 +48,7 @@ export const useWithShowEndpointResponder = (): ShowEndpointResponseActionsConso endpoint: endpointMetadata, }, consoleProps: { - commands: getEndpointResponseActionsConsoleCommands({ + commands: getEndpointConsoleCommands({ endpointAgentId, endpointCapabilities: endpointMetadata.Endpoint.capabilities ?? [], endpointPrivileges, diff --git a/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx b/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx index d42585485bb9..a0b3b9050b7a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx @@ -27,8 +27,10 @@ let mockUseGetEndpointActionList: { data?: ActionListApiResponse; refetch: () => unknown; }; -jest.mock('../../../hooks/endpoint/use_get_endpoint_action_list', () => { - const original = jest.requireActual('../../../hooks/endpoint/use_get_endpoint_action_list'); +jest.mock('../../../hooks/response_actions/use_get_endpoint_action_list', () => { + const original = jest.requireActual( + '../../../hooks/response_actions/use_get_endpoint_action_list' + ); return { ...original, useGetEndpointActionList: () => mockUseGetEndpointActionList, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap index ad1cff9cdee6..4d54f7b8fb79 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap @@ -2,7 +2,12 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` - .c0 { + .c15 svg { + position: relative; + top: -1px; +} + +.c0 { display: inline-block; font-size: 12px; line-height: 1.5; @@ -16,11 +21,6 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` border-radius: 4px; } -.c15 svg { - position: relative; - top: -1px; -} - .c13, .c13 * { display: inline-block; From 8969009e3b105fcfafb8c5fa6a68ee15eb8d6972 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Tue, 1 Nov 2022 09:59:52 -0600 Subject: [PATCH 62/87] [Security solution] Guided onboarding unhappy path fixes (#144178) --- .../guided_onboarding_tour/README.md | 4 +- .../guided_onboarding_tour/tour.tsx | 2 +- .../guided_onboarding_tour/tour_config.ts | 37 +++-- .../guided_onboarding_tour/tour_step.test.tsx | 79 +++++++++-- .../guided_onboarding_tour/tour_step.tsx | 42 +++++- .../use_add_to_case_actions.tsx | 16 ++- .../timeline/body/actions/index.test.tsx | 129 +++++++++++++++++- .../timeline/body/actions/index.tsx | 7 +- 8 files changed, 276 insertions(+), 40 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md index eb30e20f1318..483d9c30cb82 100644 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md @@ -105,7 +105,7 @@ It was important that the `EuiTourStep` **anchor** is in the DOM when the tour s ``` createCaseFlyout.open({ attachments: caseAttachments, - ...(isTourShown(SecurityStepId.alertsCases) && activeStep === 4 + ...(isTourShown(SecurityStepId.alertsCases) && activeStep === AlertsCasesTourSteps.addAlertToCase ? { headerContent: ( // isTourAnchor=true no matter what in order to @@ -132,7 +132,7 @@ It was important that the `EuiTourStep` **anchor** is in the DOM when the tour s So we utilize the `useTourContext` to do the following check and increment the step in `handleAddToNewCaseClick`: ``` - if (isTourShown(SecurityStepId.alertsCases) && activeStep === 4) { + if (isTourShown(SecurityStepId.alertsCases) && activeStep === AlertsCasesTourSteps.addAlertToCase) { incrementStep(SecurityStepId.alertsCases); } ``` diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx index 43f6ca15b33c..80cadec5d04b 100644 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx @@ -19,7 +19,7 @@ import { securityTourConfig, SecurityStepId } from './tour_config'; export interface TourContextValue { activeStep: number; endTourStep: (stepId: SecurityStepId) => void; - incrementStep: (stepId: SecurityStepId, step?: number) => void; + incrementStep: (stepId: SecurityStepId) => void; isTourShown: (stepId: SecurityStepId) => boolean; } diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts index f7ed05be4c41..0a00c25417f8 100644 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts @@ -14,6 +14,15 @@ export const enum SecurityStepId { alertsCases = 'alertsCases', } +export const enum AlertsCasesTourSteps { + none = 0, + pointToAlertName = 1, + expandEvent = 2, + reviewAlertDetailsFlyout = 3, + addAlertToCase = 4, + createCase = 5, +} + export type StepConfig = Pick< EuiTourStepProps, 'step' | 'content' | 'anchorPosition' | 'title' | 'initialFocus' | 'anchor' @@ -40,7 +49,7 @@ export const getTourAnchor = (step: number, stepId: SecurityStepId) => const alertsCasesConfig: StepConfig[] = [ { ...defaultConfig, - step: 1, + step: AlertsCasesTourSteps.pointToAlertName, title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.ruleNameStep.tourTitle', { defaultMessage: 'Test alert for practice', }), @@ -52,12 +61,12 @@ const alertsCasesConfig: StepConfig[] = [ } ), anchorPosition: 'downCenter', - dataTestSubj: getTourAnchor(1, SecurityStepId.alertsCases), + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.pointToAlertName, SecurityStepId.alertsCases), initialFocus: `button[tour-step="nextButton"]`, }, { ...defaultConfig, - step: 2, + step: AlertsCasesTourSteps.expandEvent, title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.openFlyout.tourTitle', { defaultMessage: 'Review the alert details', }), @@ -69,12 +78,12 @@ const alertsCasesConfig: StepConfig[] = [ } ), anchorPosition: 'rightUp', - dataTestSubj: getTourAnchor(2, SecurityStepId.alertsCases), + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.expandEvent, SecurityStepId.alertsCases), hideNextButton: true, }, { ...defaultConfig, - step: 3, + step: AlertsCasesTourSteps.reviewAlertDetailsFlyout, title: i18n.translate( 'xpack.securitySolution.guided_onboarding.tour.flyoutOverview.tourTitle', { @@ -89,13 +98,19 @@ const alertsCasesConfig: StepConfig[] = [ } ), // needs to use anchor to properly place tour step - anchor: `[tour-step="${getTourAnchor(3, SecurityStepId.alertsCases)}"] .euiTabs`, + anchor: `[tour-step="${getTourAnchor( + AlertsCasesTourSteps.reviewAlertDetailsFlyout, + SecurityStepId.alertsCases + )}"] .euiTabs`, anchorPosition: 'leftUp', - dataTestSubj: getTourAnchor(3, SecurityStepId.alertsCases), + dataTestSubj: getTourAnchor( + AlertsCasesTourSteps.reviewAlertDetailsFlyout, + SecurityStepId.alertsCases + ), }, { ...defaultConfig, - step: 4, + step: AlertsCasesTourSteps.addAlertToCase, title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.addToCase.tourTitle', { defaultMessage: 'Create a case', }), @@ -103,12 +118,12 @@ const alertsCasesConfig: StepConfig[] = [ defaultMessage: 'From the Take action menu, add the alert to a new case.', }), anchorPosition: 'upRight', - dataTestSubj: getTourAnchor(4, SecurityStepId.alertsCases), + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.addAlertToCase, SecurityStepId.alertsCases), hideNextButton: true, }, { ...defaultConfig, - step: 5, + step: AlertsCasesTourSteps.createCase, title: i18n.translate('xpack.securitySolution.guided_onboarding.tour.createCase.tourTitle', { defaultMessage: `Add details`, }), @@ -120,7 +135,7 @@ const alertsCasesConfig: StepConfig[] = [ ), anchor: `[data-test-subj="create-case-flyout"]`, anchorPosition: 'leftUp', - dataTestSubj: getTourAnchor(5, SecurityStepId.alertsCases), + dataTestSubj: getTourAnchor(AlertsCasesTourSteps.createCase, SecurityStepId.alertsCases), hideNextButton: true, }, ]; diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx index 04f2cfd6a431..90f8b6de7c2f 100644 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx @@ -9,6 +9,12 @@ import { render } from '@testing-library/react'; import { GuidedOnboardingTourStep, SecurityTourStep } from './tour_step'; import { SecurityStepId } from './tour_config'; import { useTourContext } from './tour'; +import { mockGlobalState, SUB_PLUGINS_REDUCER, TestProviders } from '../../mock'; +import { TimelineId } from '../../../../common/types'; +import { createStore } from '../../store'; +import { tGridReducer } from '@kbn/timelines-plugin/public'; +import { kibanaObservable } from '@kbn/timelines-plugin/public/mock'; +import { createSecuritySolutionStorageMock } from '@kbn/timelines-plugin/public/mock/mock_local_storage'; jest.mock('./tour'); const mockTourStep = jest @@ -43,7 +49,8 @@ describe('GuidedOnboardingTourStep', () => { }); it('renders as a tour step', () => { const { getByTestId } = render( - {mockChildren} + {mockChildren}, + { wrapper: TestProviders } ); const tourStep = getByTestId('tourStepMock'); const header = getByTestId('h1'); @@ -54,7 +61,8 @@ describe('GuidedOnboardingTourStep', () => { const { getByTestId, queryByTestId } = render( {mockChildren} - + , + { wrapper: TestProviders } ); const tourStep = queryByTestId('tourStepMock'); const header = getByTestId('h1'); @@ -83,7 +91,8 @@ describe('SecurityTourStep', () => { render( {mockChildren} - + , + { wrapper: TestProviders } ); expect(mockTourStep).not.toHaveBeenCalled(); }); @@ -92,7 +101,8 @@ describe('SecurityTourStep', () => { render( {mockChildren} - + , + { wrapper: TestProviders } ); expect(mockTourStep).not.toHaveBeenCalled(); }); @@ -103,12 +113,16 @@ describe('SecurityTourStep', () => { incrementStep: jest.fn(), isTourShown: () => false, }); - render({mockChildren}); + render({mockChildren}, { + wrapper: TestProviders, + }); expect(mockTourStep).not.toHaveBeenCalled(); }); it('renders tour step with correct number of steppers', () => { - render({mockChildren}); + render({mockChildren}, { + wrapper: TestProviders, + }); const mockCall = { ...mockTourStep.mock.calls[0][0] }; expect(mockCall.step).toEqual(1); expect(mockCall.stepsTotal).toEqual(5); @@ -118,7 +132,8 @@ describe('SecurityTourStep', () => { render( {mockChildren} - + , + { wrapper: TestProviders } ); const mockCall = { ...mockTourStep.mock.calls[0][0] }; expect(mockCall.step).toEqual(5); @@ -134,7 +149,8 @@ describe('SecurityTourStep', () => { render( {mockChildren} - + , + { wrapper: TestProviders } ); const mockCall = { ...mockTourStep.mock.calls[0][0] }; expect(mockCall.footerAction).toMatchInlineSnapshot(` @@ -163,7 +179,8 @@ describe('SecurityTourStep', () => { const { container } = render( {mockChildren} - + , + { wrapper: TestProviders } ); const selectParent = container.querySelector( `[data-test-subj="tourStepMock"] [data-test-subj="h1"]` @@ -184,7 +201,8 @@ describe('SecurityTourStep', () => { const { container } = render( {mockChildren} - + , + { wrapper: TestProviders } ); const selectParent = container.querySelector( `[data-test-subj="tourStepMock"] [data-test-subj="h1"]` @@ -197,13 +215,17 @@ describe('SecurityTourStep', () => { }); it('if a tour step does not have children and has anchor, only render tour step', () => { - const { getByTestId } = render(); + const { getByTestId } = render( + , + { wrapper: TestProviders } + ); expect(getByTestId('tourStepMock')).toBeInTheDocument(); }); it('if a tour step does not have children and does not have anchor, render nothing', () => { const { queryByTestId } = render( - + , + { wrapper: TestProviders } ); expect(queryByTestId('tourStepMock')).not.toBeInTheDocument(); }); @@ -217,9 +239,40 @@ describe('SecurityTourStep', () => { render( {mockChildren} - + , + { wrapper: TestProviders } ); const mockCall = { ...mockTourStep.mock.calls[0][0] }; expect(mockCall.footerAction).toMatchInlineSnapshot(``); }); + + it('does not render step if timeline is open', () => { + const mockstate = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + [TimelineId.active]: { + ...mockGlobalState.timeline.timelineById.test, + show: true, + }, + }, + }, + }; + const { storage } = createSecuritySolutionStorageMock(); + const mockStore = createStore( + mockstate, + SUB_PLUGINS_REDUCER, + { dataTable: tGridReducer }, + kibanaObservable, + storage + ); + + render( + + {mockChildren} + + ); + expect(mockTourStep).not.toHaveBeenCalled(); + }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx index ef07c5ce44a4..b7ade00021ba 100644 --- a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx +++ b/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx @@ -11,26 +11,54 @@ import type { EuiTourStepProps } from '@elastic/eui'; import { EuiButton, EuiImage, EuiSpacer, EuiText, EuiTourStep } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import styled from 'styled-components'; +import { useShallowEqualSelector } from '../../hooks/use_selector'; +import { TimelineId } from '../../../../common/types'; +import { timelineDefaults } from '../../../timelines/store/timeline/defaults'; +import { timelineSelectors } from '../../../timelines/store/timeline'; import { useTourContext } from './tour'; -import { securityTourConfig, SecurityStepId } from './tour_config'; +import { AlertsCasesTourSteps, SecurityStepId, securityTourConfig } from './tour_config'; + interface SecurityTourStep { children?: React.ReactElement; step: number; stepId: SecurityStepId; } +const isStepExternallyMounted = (stepId: SecurityStepId, step: number) => + step === AlertsCasesTourSteps.createCase && stepId === SecurityStepId.alertsCases; + +const StyledTourStep = styled(EuiTourStep)` + &.euiPopover__panel[data-popover-open] { + z-index: ${({ step, stepId }) => + isStepExternallyMounted(stepId, step) ? '9000 !important' : '1000 !important'}; + } +`; + export const SecurityTourStep = ({ children, step, stepId }: SecurityTourStep) => { const { activeStep, incrementStep, isTourShown } = useTourContext(); const tourStep = useMemo( () => securityTourConfig[stepId].find((config) => config.step === step), [step, stepId] ); + + const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); + const showTimeline = useShallowEqualSelector( + (state) => (getTimeline(state, TimelineId.active) ?? timelineDefaults).show + ); + const onClick = useCallback(() => incrementStep(stepId), [incrementStep, stepId]); - // step === 5 && stepId === SecurityStepId.alertsCases is in Cases app and out of context. + + // step === AlertsCasesTourSteps.createCase && stepId === SecurityStepId.alertsCases is in Cases app and out of context. // If we mount this step, we know we need to render it // we are also managing the context on the siem end in the background - const overrideContext = step === 5 && stepId === SecurityStepId.alertsCases; - if (tourStep == null || ((step !== activeStep || !isTourShown(stepId)) && !overrideContext)) { + const overrideContext = isStepExternallyMounted(stepId, step); + + if ( + tourStep == null || + ((step !== activeStep || !isTourShown(stepId)) && !overrideContext) || + showTimeline + ) { return children ? children : null; } @@ -89,11 +117,13 @@ export const SecurityTourStep = ({ children, step, stepId }: SecurityTourStep) = // see type EuiTourStepAnchorProps return anchor != null ? ( <> - + <>{children} ) : children != null ? ( - {children} + + {children} + ) : null; }; diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx index 70455fa342ab..9f6fd3dd5610 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx @@ -10,7 +10,10 @@ import { EuiContextMenuItem } from '@elastic/eui'; import { CommentType } from '@kbn/cases-plugin/common'; import type { CaseAttachmentsWithoutOwner } from '@kbn/cases-plugin/public'; import { GuidedOnboardingTourStep } from '../../../../common/components/guided_onboarding_tour/tour_step'; -import { SecurityStepId } from '../../../../common/components/guided_onboarding_tour/tour_config'; +import { + AlertsCasesTourSteps, + SecurityStepId, +} from '../../../../common/components/guided_onboarding_tour/tour_config'; import { useTourContext } from '../../../../common/components/guided_onboarding_tour'; import { useGetUserCasesPermissions, useKibana } from '../../../../common/lib/kibana'; import type { TimelineNonEcsData } from '../../../../../common/search_strategy'; @@ -80,7 +83,11 @@ export const useAddToCaseActions = ({ onMenuItemClick(); createCaseFlyout.open({ attachments: caseAttachments, - ...(isTourShown(SecurityStepId.alertsCases) && activeStep === 4 + // activeStep will be 4 on first render because not yet incremented + // if the user closes the flyout without completing the form and comes back, we will be at step 5 + ...(isTourShown(SecurityStepId.alertsCases) && + (activeStep === AlertsCasesTourSteps.addAlertToCase || + activeStep === AlertsCasesTourSteps.createCase) ? { headerContent: ( // isTourAnchor=true no matter what in order to @@ -90,7 +97,10 @@ export const useAddToCaseActions = ({ } : {}), }); - if (isTourShown(SecurityStepId.alertsCases) && activeStep === 4) { + if ( + isTourShown(SecurityStepId.alertsCases) && + activeStep === AlertsCasesTourSteps.addAlertToCase + ) { incrementStep(SecurityStepId.alertsCases); } }, [onMenuItemClick, createCaseFlyout, caseAttachments, isTourShown, activeStep, incrementStep]); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx index 9e8ea89d9175..e34227f0bfe8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.test.tsx @@ -14,7 +14,14 @@ import { useIsExperimentalFeatureEnabled } from '../../../../../common/hooks/use import { mockCasesContract } from '@kbn/cases-plugin/public/mocks'; import { useShallowEqualSelector } from '../../../../../common/hooks/use_selector'; import { licenseService } from '../../../../../common/hooks/use_license'; - +import { useTourContext } from '../../../../../common/components/guided_onboarding_tour'; +import { + GuidedOnboardingTourStep, + SecurityTourStep, +} from '../../../../../common/components/guided_onboarding_tour/tour_step'; +import { SecurityStepId } from '../../../../../common/components/guided_onboarding_tour/tour_config'; + +jest.mock('../../../../../common/components/guided_onboarding_tour'); jest.mock('../../../../../detections/components/user_info', () => ({ useUserData: jest.fn().mockReturnValue([{ canUserCRUD: true, hasIndexWrite: true }]), })); @@ -106,6 +113,11 @@ const defaultProps = { describe('Actions', () => { beforeAll(() => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 1, + incrementStep: () => null, + isTourShown: () => false, + }); (useShallowEqualSelector as jest.Mock).mockReturnValue(mockTimelineModel); }); @@ -140,6 +152,121 @@ describe('Actions', () => { expect(wrapper.find('[data-test-subj="select-event"]').exists()).toBe(false); }); + describe('Guided Onboarding Step', () => { + const incrementStepMock = jest.fn(); + beforeEach(() => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 2, + incrementStep: incrementStepMock, + isTourShown: () => true, + }); + jest.clearAllMocks(); + }); + + const ecsData = { + ...mockTimelineData[0].ecs, + kibana: { alert: { rule: { uuid: ['123'], parameters: {} } } }, + }; + const isTourAnchorConditions: { [key: string]: unknown } = { + ecsData, + timelineId: TableId.alertsOnAlertsPage, + ariaRowindex: 1, + }; + + test('if isTourShown is false [isTourAnchor=false], SecurityTourStep is not active', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 2, + incrementStep: jest.fn(), + isTourShown: () => false, + }); + + const wrapper = mount( + + + + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(false); + }); + + test('if all conditions make isTourAnchor=true, SecurityTourStep is active', () => { + const wrapper = mount( + + + + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(true); + }); + + test('on expand event click and SecurityTourStep is active, incrementStep', () => { + const wrapper = mount( + + + + ); + + wrapper.find('[data-test-subj="expand-event"]').first().simulate('click'); + + expect(incrementStepMock).toHaveBeenCalledWith(SecurityStepId.alertsCases); + }); + + test('on expand event click and SecurityTourStep is active, but step is not 2, do not incrementStep', () => { + (useTourContext as jest.Mock).mockReturnValue({ + activeStep: 1, + incrementStep: incrementStepMock, + isTourShown: () => true, + }); + + const wrapper = mount( + + + + ); + + wrapper.find('[data-test-subj="expand-event"]').first().simulate('click'); + + expect(incrementStepMock).not.toHaveBeenCalled(); + }); + + test('on expand event click and SecurityTourStep is not active, do not incrementStep', () => { + const wrapper = mount( + + + + ); + + wrapper.find('[data-test-subj="expand-event"]').first().simulate('click'); + + expect(incrementStepMock).not.toHaveBeenCalled(); + }); + + test('if isTourAnchor=false, SecurityTourStep is not active', () => { + const wrapper = mount( + + + + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(false); + }); + describe.each(Object.keys(isTourAnchorConditions))('tour condition true: %s', (key: string) => { + it('Single condition does not make tour step exist', () => { + const wrapper = mount( + + + + ); + + expect(wrapper.find(GuidedOnboardingTourStep).exists()).toEqual(true); + expect(wrapper.find(SecurityTourStep).exists()).toEqual(false); + }); + }); + }); + describe('Alert context menu enabled?', () => { test('it disables for eventType=raw', () => { const wrapper = mount( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx index 5454642ea589..26ffd4ea8e28 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx @@ -203,7 +203,7 @@ const ActionsComponent: React.FC = ({ scopedActions, ]); - const { isTourShown, incrementStep } = useTourContext(); + const { activeStep, isTourShown, incrementStep } = useTourContext(); const isTourAnchor = useMemo( () => @@ -215,11 +215,12 @@ const ActionsComponent: React.FC = ({ ); const onExpandEvent = useCallback(() => { - if (isTourAnchor) { + const isStep2Active = activeStep === 2 && isTourShown(SecurityStepId.alertsCases); + if (isTourAnchor && isStep2Active) { incrementStep(SecurityStepId.alertsCases); } onEventDetailsPanelOpened(); - }, [incrementStep, isTourAnchor, onEventDetailsPanelOpened]); + }, [activeStep, incrementStep, isTourAnchor, isTourShown, onEventDetailsPanelOpened]); return ( From 58b53d8b5dc00f13c0695028967159867cdb7690 Mon Sep 17 00:00:00 2001 From: Giorgos Bamparopoulos Date: Tue, 1 Nov 2022 17:02:11 +0000 Subject: [PATCH 63/87] [APM] Average latency map for mobile service overview (#144127) * Add average latency map to mobile service overview --- x-pack/plugins/apm/kibana.json | 6 +- .../latency_map/embedded_map.test.tsx | 52 ++++++ .../latency_map/embedded_map.tsx | 173 ++++++++++++++++++ .../latency_map/get_layer_list.ts | 151 +++++++++++++++ .../latency_map/index.tsx | 28 +++ .../service_oveview_mobile_charts.tsx | 8 + .../use_filters_for_mobile_charts.ts | 73 ++++++++ .../data_view/create_static_data_view.ts | 12 ++ .../tests/data_view/static.spec.ts | 11 ++ 9 files changed, 512 insertions(+), 2 deletions(-) create mode 100644 x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.test.tsx create mode 100644 x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.tsx create mode 100644 x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/get_layer_list.ts create mode 100644 x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/index.tsx create mode 100644 x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/use_filters_for_mobile_charts.ts diff --git a/x-pack/plugins/apm/kibana.json b/x-pack/plugins/apm/kibana.json index 78233626091e..9572e06b6348 100644 --- a/x-pack/plugins/apm/kibana.json +++ b/x-pack/plugins/apm/kibana.json @@ -20,7 +20,8 @@ "share", "unifiedSearch", "dataViews", - "advancedSettings" + "advancedSettings", + "maps" ], "optionalPlugins": [ "actions", @@ -47,6 +48,7 @@ "kibanaUtils", "ml", "observability", - "esUiShared" + "esUiShared", + "maps" ] } diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.test.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.test.tsx new file mode 100644 index 000000000000..9718bb2afc37 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.test.tsx @@ -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 { render } from '@testing-library/react'; +import React from 'react'; +import { EmbeddedMap } from './embedded_map'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; +import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; +import { MemoryRouter } from 'react-router-dom'; + +describe('Embedded Map', () => { + it('it renders', async () => { + const mockSetLayerList = jest.fn(); + const mockUpdateInput = jest.fn(); + const mockRender = jest.fn(); + + const mockEmbeddable = embeddablePluginMock.createStartContract(); + mockEmbeddable.getEmbeddableFactory = jest.fn().mockImplementation(() => ({ + create: () => ({ + setLayerList: mockSetLayerList, + updateInput: mockUpdateInput, + render: mockRender, + }), + })); + + const { findByTestId } = render( + + + + + + + + ); + expect( + await findByTestId('serviceOverviewEmbeddedMap') + ).toBeInTheDocument(); + + expect(mockSetLayerList).toHaveBeenCalledTimes(1); + expect(mockUpdateInput).toHaveBeenCalledTimes(1); + expect(mockRender).toHaveBeenCalledTimes(1); + }); +}); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.tsx new file mode 100644 index 000000000000..8e30430a6e21 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/embedded_map.tsx @@ -0,0 +1,173 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useState, useRef } from 'react'; +import uuid from 'uuid'; +import { + MapEmbeddable, + MapEmbeddableInput, + MapEmbeddableOutput, +} from '@kbn/maps-plugin/public'; +import { MAP_SAVED_OBJECT_TYPE } from '@kbn/maps-plugin/common'; +import { + ErrorEmbeddable, + ViewMode, + isErrorEmbeddable, +} from '@kbn/embeddable-plugin/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { EuiText } from '@elastic/eui'; +import type { Filter } from '@kbn/es-query'; +import { ApmPluginStartDeps } from '../../../../../plugin'; +import { getLayerList } from './get_layer_list'; +import { useApmParams } from '../../../../../hooks/use_apm_params'; +import { useTimeRange } from '../../../../../hooks/use_time_range'; + +function EmbeddedMapComponent({ filters }: { filters: Filter[] }) { + const { + query: { rangeFrom, rangeTo, kuery }, + } = useApmParams('/services/{serviceName}/overview'); + + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const [error, setError] = useState(); + + const [embeddable, setEmbeddable] = useState< + MapEmbeddable | ErrorEmbeddable | undefined + >(); + + const embeddableRoot: React.RefObject = + useRef(null); + + const { + embeddable: embeddablePlugin, + maps, + notifications, + } = useKibana().services; + + useEffect(() => { + async function setupEmbeddable() { + const factory = embeddablePlugin?.getEmbeddableFactory< + MapEmbeddableInput, + MapEmbeddableOutput, + MapEmbeddable + >(MAP_SAVED_OBJECT_TYPE); + + if (!factory) { + setError(true); + notifications?.toasts.addDanger({ + title: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.error.toastTitle', + { + defaultMessage: 'An error occurred when adding map embeddable', + } + ), + text: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.error.toastDescription', + { + defaultMessage: `Embeddable factory with id "{embeddableFactoryId}" was not found.`, + values: { + embeddableFactoryId: MAP_SAVED_OBJECT_TYPE, + }, + } + ), + }); + return; + } + + const input: MapEmbeddableInput = { + attributes: { title: '' }, + id: uuid.v4(), + title: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.input.title', + { + defaultMessage: 'Latency by country', + } + ), + filters, + viewMode: ViewMode.VIEW, + isLayerTOCOpen: false, + query: { + query: kuery, + language: 'kuery', + }, + timeRange: { + from: start, + to: end, + }, + hideFilterActions: true, + }; + + const embeddableObject = await factory.create(input); + if (embeddableObject && !isErrorEmbeddable(embeddableObject)) { + const layerList = await getLayerList(maps); + await embeddableObject.setLayerList(layerList); + } + + setEmbeddable(embeddableObject); + } + + setupEmbeddable(); + // Set up exactly once after the component mounts + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + // We can only render after embeddable has already initialized + useEffect(() => { + if (embeddableRoot.current && embeddable) { + embeddable.render(embeddableRoot.current); + } + }, [embeddable, embeddableRoot]); + + useEffect(() => { + if (embeddable) { + embeddable.updateInput({ + filters, + query: { + query: kuery, + language: 'kuery', + }, + timeRange: { + from: start, + to: end, + }, + }); + } + }, [start, end, kuery, filters, embeddable]); + + return ( + <> + {error && ( + +

+ {i18n.translate('xpack.apm.serviceOverview.embeddedMap.error', { + defaultMessage: 'Could not load map', + })} +

+
+ )} + {!error && ( +
+ )} + + ); +} + +EmbeddedMapComponent.displayName = 'EmbeddedMap'; + +export const EmbeddedMap = React.memo(EmbeddedMapComponent); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/get_layer_list.ts b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/get_layer_list.ts new file mode 100644 index 000000000000..49bf9fdbe265 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/get_layer_list.ts @@ -0,0 +1,151 @@ +/* + * Copyright 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 { + EMSFileSourceDescriptor, + LayerDescriptor as BaseLayerDescriptor, + VectorLayerDescriptor as BaseVectorLayerDescriptor, + VectorStyleDescriptor, + AGG_TYPE, + COLOR_MAP_TYPE, + FIELD_ORIGIN, + LABEL_BORDER_SIZES, + LAYER_TYPE, + SOURCE_TYPES, + STYLE_TYPE, + SYMBOLIZE_AS_TYPES, +} from '@kbn/maps-plugin/common'; +import uuid from 'uuid'; +import type { MapsStartApi } from '@kbn/maps-plugin/public'; +import { i18n } from '@kbn/i18n'; +import { + CLIENT_GEO_COUNTRY_ISO_CODE, + TRANSACTION_DURATION, +} from '../../../../../../common/elasticsearch_fieldnames'; +import { APM_STATIC_DATA_VIEW_ID } from '../../../../../../common/data_view_constants'; + +interface VectorLayerDescriptor extends BaseVectorLayerDescriptor { + sourceDescriptor: EMSFileSourceDescriptor; +} + +const FIELD_NAME = 'apm-service-overview-layer-country'; +const COUNTRY_NAME = 'name'; +const TRANSACTION_DURATION_COUNTRY = `__kbnjoin__avg_of_transaction.duration.us__${FIELD_NAME}`; + +function getLayerStyle(): VectorStyleDescriptor { + return { + type: 'VECTOR', + properties: { + icon: { type: STYLE_TYPE.STATIC, options: { value: 'marker' } }, + fillColor: { + type: STYLE_TYPE.DYNAMIC, + options: { + color: 'Blue to Red', + colorCategory: 'palette_0', + fieldMetaOptions: { isEnabled: true, sigma: 3 }, + type: COLOR_MAP_TYPE.ORDINAL, + field: { + name: TRANSACTION_DURATION_COUNTRY, + origin: FIELD_ORIGIN.JOIN, + }, + useCustomColorRamp: false, + }, + }, + lineColor: { + type: STYLE_TYPE.DYNAMIC, + options: { color: '#3d3d3d', fieldMetaOptions: { isEnabled: true } }, + }, + lineWidth: { type: STYLE_TYPE.STATIC, options: { size: 1 } }, + iconSize: { type: STYLE_TYPE.STATIC, options: { size: 6 } }, + iconOrientation: { + type: STYLE_TYPE.STATIC, + options: { orientation: 0 }, + }, + labelText: { + type: STYLE_TYPE.DYNAMIC, + options: { + field: { + name: TRANSACTION_DURATION_COUNTRY, + origin: FIELD_ORIGIN.JOIN, + }, + }, + }, + labelZoomRange: { + options: { + useLayerZoomRange: true, + minZoom: 0, + maxZoom: 24, + }, + }, + labelColor: { + type: STYLE_TYPE.STATIC, + options: { color: '#000000' }, + }, + labelSize: { type: STYLE_TYPE.STATIC, options: { size: 14 } }, + labelBorderColor: { + type: STYLE_TYPE.STATIC, + options: { color: '#FFFFFF' }, + }, + symbolizeAs: { options: { value: SYMBOLIZE_AS_TYPES.CIRCLE } }, + labelBorderSize: { options: { size: LABEL_BORDER_SIZES.SMALL } }, + }, + isTimeAware: true, + }; +} + +export async function getLayerList(maps?: MapsStartApi) { + const basemapLayerDescriptor = maps + ? await maps.createLayerDescriptors.createBasemapLayerDescriptor() + : null; + + const pageLoadDurationByCountryLayer: VectorLayerDescriptor = { + joins: [ + { + leftField: 'iso2', + right: { + type: SOURCE_TYPES.ES_TERM_SOURCE, + id: FIELD_NAME, + term: CLIENT_GEO_COUNTRY_ISO_CODE, + metrics: [ + { + type: AGG_TYPE.AVG, + field: TRANSACTION_DURATION, + label: i18n.translate( + 'xpack.apm.serviceOverview.embeddedMap.metric.label', + { + defaultMessage: 'Page load duration', + } + ), + }, + ], + indexPatternId: APM_STATIC_DATA_VIEW_ID, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + }, + }, + ], + sourceDescriptor: { + type: SOURCE_TYPES.EMS_FILE, + id: 'world_countries', + tooltipProperties: [COUNTRY_NAME], + }, + style: getLayerStyle(), + id: uuid.v4(), + label: null, + minZoom: 0, + maxZoom: 24, + alpha: 0.75, + visible: true, + type: LAYER_TYPE.GEOJSON_VECTOR, + }; + + return [ + ...(basemapLayerDescriptor ? [basemapLayerDescriptor] : []), + pageLoadDurationByCountryLayer, + ] as BaseLayerDescriptor[]; +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/index.tsx new file mode 100644 index 000000000000..8a5917bd861b --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/latency_map/index.tsx @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiTitle, EuiSpacer } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import type { Filter } from '@kbn/es-query'; +import { EmbeddedMap } from './embedded_map'; + +export function LatencyMap({ filters }: { filters: Filter[] }) { + return ( + <> + +

+ {i18n.translate('xpack.apm.serviceOverview.embeddedMap.title', { + defaultMessage: 'Average latency per country', + })} +

+
+ + + + ); +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx index 60871e58dd88..cf603a189e17 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/service_oveview_mobile_charts.tsx @@ -18,7 +18,9 @@ import { TransactionsTable } from '../../../shared/transactions_table'; import { AggregatedTransactionsBadge } from '../../../shared/aggregated_transactions_badge'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; +import { LatencyMap } from './latency_map'; import { MobileFilters } from './filters'; +import { useFiltersForMobileCharts } from './use_filters_for_mobile_charts'; interface Props { latencyChartHeight: number; @@ -35,6 +37,7 @@ export function ServiceOverviewMobileCharts({ }: Props) { const { fallbackToTransactions, serviceName } = useApmServiceContext(); const router = useApmRouter(); + const filters = useFiltersForMobileCharts(); const { query, @@ -145,6 +148,11 @@ export function ServiceOverviewMobileCharts({ + + + + + ); } diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/use_filters_for_mobile_charts.ts b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/use_filters_for_mobile_charts.ts new file mode 100644 index 000000000000..5116a7949497 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_charts/use_filters_for_mobile_charts.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useMemo } from 'react'; +import { type QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import { isNil, isEmpty } from 'lodash'; +import { ProcessorEvent } from '@kbn/observability-plugin/common'; +import { environmentQuery } from '../../../../../common/utils/environment_query'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { + SERVICE_NAME, + TRANSACTION_TYPE, + PROCESSOR_EVENT, + HOST_OS_VERSION, + DEVICE_MODEL_IDENTIFIER, + NETWORK_CONNECTION_TYPE, + SERVICE_VERSION, +} from '../../../../../common/elasticsearch_fieldnames'; + +function termQuery( + field: T, + value: string | boolean | number | undefined | null +): QueryDslQueryContainer[] { + if (isNil(value) || isEmpty(value)) { + return []; + } + + return [{ term: { [field]: value } }]; +} + +export function useFiltersForMobileCharts() { + const { + path: { serviceName }, + query: { + environment, + transactionType, + device, + osVersion, + appVersion, + netConnectionType, + }, + } = useApmParams('/services/{serviceName}/overview'); + + return useMemo( + () => + [ + ...termQuery(PROCESSOR_EVENT, ProcessorEvent.transaction), + ...termQuery(SERVICE_NAME, serviceName), + ...termQuery(TRANSACTION_TYPE, transactionType), + ...termQuery(HOST_OS_VERSION, osVersion), + ...termQuery(DEVICE_MODEL_IDENTIFIER, device), + ...termQuery(NETWORK_CONNECTION_TYPE, netConnectionType), + ...termQuery(SERVICE_VERSION, appVersion), + ...environmentQuery(environment), + ].map((query) => ({ + meta: {}, + query, + })), + [ + environment, + transactionType, + serviceName, + osVersion, + device, + netConnectionType, + appVersion, + ] + ); +} diff --git a/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts b/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts index ff25167a0a12..21292d51f6dc 100644 --- a/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts +++ b/x-pack/plugins/apm/server/routes/data_view/create_static_data_view.ts @@ -11,6 +11,7 @@ import { i18n } from '@kbn/i18n'; import { TRACE_ID, TRANSACTION_ID, + TRANSACTION_DURATION, } from '../../../common/elasticsearch_fieldnames'; import { APM_STATIC_DATA_VIEW_ID } from '../../../common/data_view_constants'; import { hasHistoricalAgentData } from '../historical_data/has_historical_agent_data'; @@ -175,6 +176,17 @@ function createAndSaveStaticDataView({ labelTemplate: '{{value}}', }, }, + [TRANSACTION_DURATION]: { + id: 'duration', + params: { + inputFormat: 'microseconds', + outputFormat: 'asMilliseconds', + showSuffix: true, + useShortSuffix: true, + outputPrecision: 2, + includeSpaceWithSuffix: true, + }, + }, }, }, true diff --git a/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts b/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts index 0ed65724bfd4..093fec904460 100644 --- a/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts +++ b/x-pack/test/apm_api_integration/tests/data_view/static.spec.ts @@ -140,6 +140,17 @@ export default function ApiTest({ getService }: FtrProviderContext) { labelTemplate: '{{value}}', }, }, + 'transaction.duration.us': { + id: 'duration', + params: { + inputFormat: 'microseconds', + outputFormat: 'asMilliseconds', + showSuffix: true, + useShortSuffix: true, + outputPrecision: 2, + includeSpaceWithSuffix: true, + }, + }, }) ); }); From e17aa78872c41eaf173d46614f1fdba7f5d5a88b Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Tue, 1 Nov 2022 13:20:49 -0500 Subject: [PATCH 64/87] alternative path for upgrade reporting test for headless browser (#143994) * alternative path for headless browser * added timing debug output * fix type error * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../apps/reporting/reporting_smoke_tests.ts | 83 ++++++++++++------- 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts b/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts index f7b0eef003c9..2aa1cf113b35 100644 --- a/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts +++ b/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts @@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'header', 'home', 'dashboard', 'share']); const testSubjects = getService('testSubjects'); const log = getService('log'); + const retry = getService('retry'); const spaces = [ { space: 'default', basePath: '' }, @@ -40,7 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { { name: 'ecommerce', type: 'png', link: 'PNG Reports' }, ]; - describe('upgrade reporting smoke tests', () => { + describe('reporting ', () => { let completedReportCount: number; let usage: UsageStats; describe('initial state', () => { @@ -54,7 +55,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); spaces.forEach(({ space, basePath }) => { - describe('generate report for space ' + space, () => { + describe('space ' + space, () => { beforeEach(async () => { await PageObjects.common.navigateToActualUrl('home', '/tutorial_directory/sampleData', { basePath, @@ -65,44 +66,62 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); reportingTests.forEach(({ name, type, link }) => { it('name: ' + name + ' type: ' + type, async () => { + let startTime; await PageObjects.home.launchSampleDashboard(name); await PageObjects.share.openShareMenuItem(link); if (type === 'pdf_optimize') { await testSubjects.click('usePrintLayout'); } - const advOpt = await find.byXPath(`//button[descendant::*[text()='Advanced options']]`); - await advOpt.click(); - // Workaround for: https://github.com/elastic/kibana/issues/126540 - const isUrlTooLong = await testSubjects.exists('urlTooLongErrorMessage'); - if (isUrlTooLong) { - // Save dashboard - await PageObjects.dashboard.switchToEditMode(); - await PageObjects.dashboard.clickQuickSave(); - await PageObjects.share.openShareMenuItem(link); - if (type === 'pdf_optimize') { - await testSubjects.click('usePrintLayout'); - } - const advOpt2 = await find.byXPath( + const canReadClipboard = await browser.checkBrowserPermission('clipboard-read'); + // if we can read the clipboard (not Chrome headless) then get the reporting URL and post it + // else click the reporting button and wait for the count of completed reports to increment + if (canReadClipboard) { + log.debug('We have clipboard access. Getting the POST URL and posting it via API'); + const advOpt = await find.byXPath( `//button[descendant::*[text()='Advanced options']]` ); - await advOpt2.click(); - } - const postUrl = await find.byXPath(`//button[descendant::*[text()='Copy POST URL']]`); - await postUrl.click(); - const url = await browser.getClipboardValue(); - // Add try/catch for https://github.com/elastic/elastic-stack-testing/issues/1199 - // Waiting for job to finish sometimes gets socket hang up error, from what I - // observed during debug testing the command does complete. - // Checking expected report count will still fail if the job did not finish. - try { - await reportingAPI.expectAllJobsToFinishSuccessfully([ - await reportingAPI.postJob(parse(url).pathname + '?' + parse(url).query), - ]); - } catch (e) { - log.debug(`Error waiting for job to finish: ${e}`); + await advOpt.click(); + // Workaround for: https://github.com/elastic/kibana/issues/126540 + const isUrlTooLong = await testSubjects.exists('urlTooLongErrorMessage'); + if (isUrlTooLong) { + // Save dashboard + await PageObjects.dashboard.switchToEditMode(); + await PageObjects.dashboard.clickQuickSave(); + await PageObjects.share.openShareMenuItem(link); + if (type === 'pdf_optimize') { + await testSubjects.click('usePrintLayout'); + } + const advOpt2 = await find.byXPath( + `//button[descendant::*[text()='Advanced options']]` + ); + await advOpt2.click(); + } + const postUrl = await find.byXPath(`//button[descendant::*[text()='Copy POST URL']]`); + await postUrl.click(); + const url = await browser.getClipboardValue(); + // Add try/catch for https://github.com/elastic/elastic-stack-testing/issues/1199 + // Waiting for job to finish sometimes gets socket hang up error, from what I + // observed during debug testing the command does complete. + // Checking expected report count will still fail if the job did not finish. + try { + await reportingAPI.expectAllJobsToFinishSuccessfully([ + await reportingAPI.postJob(parse(url).pathname + '?' + parse(url).query), + ]); + } catch (e) { + log.debug(`Error waiting for job to finish: ${e}`); + } + startTime = new Date(); + } else { + log.debug(`We don't have clipboard access. Clicking the Generate report button`); + await testSubjects.click('generateReportButton'); + startTime = new Date(); } - usage = (await usageAPI.getUsageStats()) as UsageStats; - reportingAPI.expectCompletedReportCount(usage, completedReportCount + 1); + + await retry.tryForTime(50000, async () => { + usage = (await usageAPI.getUsageStats()) as UsageStats; + reportingAPI.expectCompletedReportCount(usage, completedReportCount + 1); + }); + log.debug(`Elapsed Time: ${new Date().getTime() - startTime.getTime()}`); }); }); }); From 5286358b28e2fe78a2ab4878a390db415d4cd027 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Tue, 1 Nov 2022 12:21:26 -0600 Subject: [PATCH 65/87] [Actionable Observability] Verify missing groups for Metric Threshold rule before scheduling no-data actions (#144205) --- .../lib/check_missing_group.ts | 75 +++++++++++++++ ...onvert_strings_to_missing_groups_record.ts | 26 ++++++ .../metric_threshold/lib/evaluate_rule.ts | 23 ++++- .../alerting/metric_threshold/lib/get_data.ts | 9 +- .../metric_threshold/lib/metric_query.ts | 92 ++++++++++--------- .../metric_threshold_executor.test.ts | 72 ++++++++++++++- .../metric_threshold_executor.ts | 14 ++- .../apis/metrics_ui/metric_threshold_alert.ts | 35 ++++++- 8 files changed, 287 insertions(+), 59 deletions(-) create mode 100644 x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts create mode 100644 x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/convert_strings_to_missing_groups_record.ts diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts new file mode 100644 index 000000000000..f5e2a19cb70e --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.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 { ElasticsearchClient } from '@kbn/core/server'; +import type { Logger } from '@kbn/logging'; +import { isString, get, identity } from 'lodash'; +import type { BucketKey } from './get_data'; +import { calculateCurrentTimeframe, createBaseFilters } from './metric_query'; +import { MetricExpressionParams } from '../../../../../common/alerting/metrics'; + +export interface MissingGroupsRecord { + key: string; + bucketKey: BucketKey; +} + +export const checkMissingGroups = async ( + esClient: ElasticsearchClient, + metricParams: MetricExpressionParams, + indexPattern: string, + groupBy: string | undefined | string[], + filterQuery: string | undefined, + logger: Logger, + timeframe: { start: number; end: number }, + missingGroups: MissingGroupsRecord[] = [] +): Promise => { + if (missingGroups.length === 0) { + return missingGroups; + } + const currentTimeframe = calculateCurrentTimeframe(metricParams, timeframe); + const baseFilters = createBaseFilters(metricParams, currentTimeframe, filterQuery); + const groupByFields = isString(groupBy) ? [groupBy] : groupBy ? groupBy : []; + + const searches = missingGroups.flatMap((group) => { + const groupByFilters = Object.values(group.bucketKey).map((key, index) => { + return { + match: { + [groupByFields[index]]: key, + }, + }; + }); + return [ + { index: indexPattern }, + { + size: 0, + terminate_after: 1, + track_total_hits: true, + query: { + bool: { + filter: [...baseFilters, ...groupByFilters], + }, + }, + }, + ]; + }); + + logger.trace(`Request: ${JSON.stringify({ searches })}`); + const response = await esClient.msearch({ searches }); + logger.trace(`Response: ${JSON.stringify(response)}`); + + const verifiedMissingGroups = response.responses + .map((resp, index) => { + const total = get(resp, 'hits.total.value', 0) as number; + if (!total) { + return missingGroups[index]; + } + return null; + }) + .filter(identity) as MissingGroupsRecord[]; + + return verifiedMissingGroups; +}; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/convert_strings_to_missing_groups_record.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/convert_strings_to_missing_groups_record.ts new file mode 100644 index 000000000000..ef1091579dd7 --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/convert_strings_to_missing_groups_record.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isString } from 'lodash'; +import { MissingGroupsRecord } from './check_missing_group'; + +export const convertStringsToMissingGroupsRecord = ( + missingGroups: Array +) => { + return missingGroups.map((subject) => { + if (isString(subject)) { + const parts = subject.split(','); + return { + key: subject, + bucketKey: parts.reduce((acc, part, index) => { + return { ...acc, [`groupBy${index}`]: part }; + }, {}), + }; + } + return subject; + }); +}; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts index f994726f21f8..2d0299a9043e 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts @@ -14,6 +14,7 @@ import { getIntervalInSeconds } from '../../../../../common/utils/get_interval_i import { DOCUMENT_COUNT_I18N } from '../../common/messages'; import { createTimerange } from './create_timerange'; import { getData } from './get_data'; +import { checkMissingGroups, MissingGroupsRecord } from './check_missing_group'; export interface EvaluatedRuleParams { criteria: MetricExpressionParams[]; @@ -29,6 +30,7 @@ export type Evaluation = Omit & { shouldFire: boolean; shouldWarn: boolean; isNoData: boolean; + bucketKey: Record; }; export const evaluateRule = async ( @@ -40,7 +42,7 @@ export const evaluateRule = async >> => { const { criteria, groupBy, filterQuery } = params; @@ -69,12 +71,24 @@ export const evaluateRule = async ; -type BucketKey = Record; +export type BucketKey = Record; interface AggregatedValue { value: number | null; values?: Record; @@ -69,6 +69,7 @@ const NO_DATA_RESPONSE = { value: null, warn: false, trigger: false, + bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, }; @@ -112,6 +113,7 @@ export const getData = async ( trigger: false, warn: false, value: null, + bucketKey: bucket.key, }; } else { const value = @@ -126,6 +128,7 @@ export const getData = async ( trigger: (shouldTrigger && shouldTrigger.value > 0) || false, warn: (shouldWarn && shouldWarn.value > 0) || false, value, + bucketKey: bucket.key, }; } } @@ -177,6 +180,7 @@ export const getData = async ( value, warn, trigger, + bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, }; } @@ -185,6 +189,7 @@ export const getData = async ( value, warn: (shouldWarn && shouldWarn.value > 0) || false, trigger: (shouldTrigger && shouldTrigger.value > 0) || false, + bucketKey: { groupBy0: UNGROUPED_FACTORY_KEY }, }, }; } else { diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts index 06da4c09a8be..45de5c1f8f4d 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts @@ -12,11 +12,56 @@ import { createPercentileAggregation } from './create_percentile_aggregation'; import { createRateAggsBuckets, createRateAggsBucketScript } from './create_rate_aggregation'; import { wrapInCurrentPeriod } from './wrap_in_period'; -const getParsedFilterQuery: (filterQuery: string | undefined) => Record | null = ( +const getParsedFilterQuery: (filterQuery: string | undefined) => Array> = ( filterQuery ) => { - if (!filterQuery) return null; - return JSON.parse(filterQuery); + if (!filterQuery) return []; + return [JSON.parse(filterQuery)]; +}; + +export const calculateCurrentTimeframe = ( + metricParams: MetricExpressionParams, + timeframe: { start: number; end: number } +) => ({ + ...timeframe, + start: moment(timeframe.end) + .subtract( + metricParams.aggType === Aggregators.RATE ? metricParams.timeSize * 2 : metricParams.timeSize, + metricParams.timeUnit + ) + .valueOf(), +}); + +export const createBaseFilters = ( + metricParams: MetricExpressionParams, + timeframe: { start: number; end: number }, + filterQuery?: string +) => { + const { metric } = metricParams; + const rangeFilters = [ + { + range: { + '@timestamp': { + gte: moment(timeframe.start).toISOString(), + lte: moment(timeframe.end).toISOString(), + }, + }, + }, + ]; + + const metricFieldFilters = metric + ? [ + { + exists: { + field: metric, + }, + }, + ] + : []; + + const parsedFilterQuery = getParsedFilterQuery(filterQuery); + + return [...rangeFilters, ...metricFieldFilters, ...parsedFilterQuery]; }; export const getElasticsearchMetricQuery = ( @@ -39,17 +84,7 @@ export const getElasticsearchMetricQuery = ( // We need to make a timeframe that represents the current timeframe as oppose // to the total timeframe (which includes the last period). - const currentTimeframe = { - ...timeframe, - start: moment(timeframe.end) - .subtract( - metricParams.aggType === Aggregators.RATE - ? metricParams.timeSize * 2 - : metricParams.timeSize, - metricParams.timeUnit - ) - .valueOf(), - }; + const currentTimeframe = calculateCurrentTimeframe(metricParams, timeframe); const metricAggregations = aggType === Aggregators.COUNT @@ -129,38 +164,13 @@ export const getElasticsearchMetricQuery = ( aggs.groupings.composite.after = afterKey; } - const rangeFilters = [ - { - range: { - '@timestamp': { - gte: moment(timeframe.start).toISOString(), - lte: moment(timeframe.end).toISOString(), - }, - }, - }, - ]; - - const metricFieldFilters = metric - ? [ - { - exists: { - field: metric, - }, - }, - ] - : []; - - const parsedFilterQuery = getParsedFilterQuery(filterQuery); + const baseFilters = createBaseFilters(metricParams, timeframe, filterQuery); return { track_total_hits: true, query: { bool: { - filter: [ - ...rangeFilters, - ...metricFieldFilters, - ...(parsedFilterQuery ? [parsedFilterQuery] : []), - ], + filter: baseFilters, }, }, size: 0, diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts index b345a83ab69d..d56984da1c85 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts @@ -157,6 +157,7 @@ describe('The metric threshold alert type', () => { shouldFire, shouldWarn, isNoData, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -266,6 +267,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -277,6 +279,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -297,6 +300,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -308,6 +312,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -328,6 +333,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -339,6 +345,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -359,6 +366,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -370,6 +378,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -390,6 +399,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -401,6 +411,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -412,6 +423,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -429,6 +441,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -440,6 +453,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -451,6 +465,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -461,7 +476,9 @@ describe('The metric threshold alert type', () => { 'test.metric.1', stateResult1 ); - expect(stateResult2.missingGroups).toEqual(expect.arrayContaining(['c'])); + expect(stateResult2.missingGroups).toEqual( + expect.arrayContaining([{ key: 'c', bucketKey: { groupBy0: 'c' } }]) + ); setEvaluationResults([ { a: { @@ -474,6 +491,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -485,6 +503,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -535,6 +554,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -546,6 +566,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -557,6 +578,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -579,6 +601,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -590,6 +613,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -601,6 +625,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -611,7 +636,9 @@ describe('The metric threshold alert type', () => { 'test.metric.1', stateResult1 ); - expect(stateResult2.missingGroups).toEqual(expect.arrayContaining(['c'])); + expect(stateResult2.missingGroups).toEqual( + expect.arrayContaining([{ key: 'c', bucketKey: { groupBy0: 'c' } }]) + ); setEvaluationResults([ { a: { @@ -624,6 +651,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -635,6 +663,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -692,6 +721,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, { @@ -705,6 +735,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -725,6 +756,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, {}, @@ -746,6 +778,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -757,6 +790,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, { @@ -770,6 +804,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -781,6 +816,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -803,6 +839,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, { @@ -816,6 +853,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -867,6 +905,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, }, ]); @@ -884,6 +923,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, }, ]); @@ -929,6 +969,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseCountCriterion, @@ -940,6 +981,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -958,6 +1000,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseCountCriterion, @@ -969,6 +1012,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1010,6 +1054,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1027,6 +1072,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1067,6 +1113,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1084,6 +1131,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1124,6 +1172,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1143,6 +1192,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1200,6 +1250,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1217,6 +1268,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1234,6 +1286,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1245,6 +1298,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1270,6 +1324,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1281,6 +1336,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1302,6 +1358,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1313,6 +1370,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, c: { ...baseNonCountCriterion, @@ -1324,6 +1382,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'c' }, }, }, ]); @@ -1344,6 +1403,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1355,6 +1415,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1405,6 +1466,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1422,6 +1484,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -1439,6 +1502,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1450,6 +1514,7 @@ describe('The metric threshold alert type', () => { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1473,6 +1538,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'a' }, }, b: { ...baseNonCountCriterion, @@ -1484,6 +1550,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'b' }, }, }, ]); @@ -1563,6 +1630,7 @@ describe('The metric threshold alert type', () => { shouldFire: false, shouldWarn, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts index 200ad68aa81d..a6fdbe3aa801 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts @@ -34,11 +34,13 @@ import { } from '../common/utils'; import { EvaluatedRuleParams, evaluateRule } from './lib/evaluate_rule'; +import { MissingGroupsRecord } from './lib/check_missing_group'; +import { convertStringsToMissingGroupsRecord } from './lib/convert_strings_to_missing_groups_record'; export type MetricThresholdRuleParams = Record; export type MetricThresholdRuleTypeState = RuleTypeState & { lastRunTimestamp?: number; - missingGroups?: string[]; + missingGroups?: Array; groupBy?: string | string[]; filterQuery?: string; }; @@ -144,7 +146,9 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => const filterQueryIsSame = isEqual(state.filterQuery, params.filterQuery); const groupByIsSame = isEqual(state.groupBy, params.groupBy); const previousMissingGroups = - alertOnGroupDisappear && filterQueryIsSame && groupByIsSame ? state.missingGroups : []; + alertOnGroupDisappear && filterQueryIsSame && groupByIsSame && state.missingGroups + ? state.missingGroups + : []; const alertResults = await evaluateRule( services.scopedClusterClient.asCurrentUser, @@ -155,7 +159,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => logger, state.lastRunTimestamp, { end: startedAt.valueOf() }, - previousMissingGroups + convertStringsToMissingGroupsRecord(previousMissingGroups) ); const resultGroupSet = new Set(); @@ -166,7 +170,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => } const groups = [...resultGroupSet]; - const nextMissingGroups = new Set(); + const nextMissingGroups = new Set(); const hasGroups = !isEqual(groups, [UNGROUPED_FACTORY_KEY]); let scheduledActionsCount = 0; @@ -180,7 +184,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => const isNoData = alertResults.some((result) => result[group]?.isNoData); if (isNoData && group !== UNGROUPED_FACTORY_KEY) { - nextMissingGroups.add(group); + nextMissingGroups.add({ key: group, bucketKey: alertResults[0][group].bucketKey }); } const nextState = isNoData diff --git a/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts b/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts index 5d6f38b368f2..603eecd6a8b6 100644 --- a/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts +++ b/x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts @@ -125,6 +125,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -174,6 +175,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'web' }, }, }, ]); @@ -206,7 +208,7 @@ export default function ({ getService }: FtrProviderContext) { logger, void 0, timeFrame, - ['middleware'] + [{ key: 'middleware', bucketKey: { groupBy0: 'middleware' } }] ); expect(results).to.eql([ { @@ -222,6 +224,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'web' }, }, middleware: { timeSize: 5, @@ -235,6 +238,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'middleware' }, }, }, ]); @@ -281,6 +285,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -312,6 +317,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -358,6 +364,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -388,7 +395,10 @@ export default function ({ getService }: FtrProviderContext) { logger, void 0, timeFrame, - ['web', 'prod'] + [ + { key: 'web', bucketKey: { groupBy0: 'web' } }, + { key: 'prod', bucketKey: { groupBy0: 'prod' } }, + ] ); expect(results).to.eql([ { @@ -404,6 +414,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: '*' }, }, web: { timeSize: 5, @@ -417,6 +428,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'web' }, }, prod: { timeSize: 5, @@ -430,6 +442,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'prod' }, }, }, ]); @@ -480,6 +493,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -522,6 +536,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -553,6 +568,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -598,6 +614,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'dev' }, }, prod: { timeSize: 5, @@ -611,6 +628,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'prod' }, }, }, ]); @@ -645,6 +663,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: 'prod' }, }, }, ]); @@ -665,7 +684,7 @@ export default function ({ getService }: FtrProviderContext) { logger, void 0, timeFrame, - ['dev'] + [{ key: 'dev', bucketKey: { groupBy0: 'dev' } }] ); expect(results).to.eql([ { @@ -681,12 +700,13 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'dev' }, }, }, ]); }); - it('should NOT resport any alerts when missing group recovers', async () => { + it('should NOT report any alerts when missing group recovers', async () => { const params = { ...baseParams, criteria: [ @@ -711,7 +731,7 @@ export default function ({ getService }: FtrProviderContext) { logger, moment(gauge.midpoint).subtract(1, 'm').valueOf(), timeFrame, - ['dev'] + [{ key: 'dev', bucketKey: { groupBy0: 'dev' } }] ); expect(results).to.eql([{}]); }); @@ -746,6 +766,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'prod' }, }, dev: { timeSize: 5, @@ -759,6 +780,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: false, isNoData: true, + bucketKey: { groupBy0: 'dev' }, }, }, ]); @@ -807,6 +829,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -851,6 +874,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: true, shouldWarn: false, isNoData: false, + bucketKey: { groupBy0: '*' }, }, }, ]); @@ -901,6 +925,7 @@ export default function ({ getService }: FtrProviderContext) { shouldFire: false, shouldWarn: true, isNoData: false, + bucketKey: { groupBy0: 'dev' }, }, }, ]); From f6203495d1858eaaa73ade8856a664e6208e5e67 Mon Sep 17 00:00:00 2001 From: Lee Drengenberg Date: Tue, 1 Nov 2022 13:35:44 -0500 Subject: [PATCH 66/87] check that the sample data menu is really open, retry (#144274) --- test/functional/page_objects/home_page.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/functional/page_objects/home_page.ts b/test/functional/page_objects/home_page.ts index c9dd27498c4a..3c143fa29a7e 100644 --- a/test/functional/page_objects/home_page.ts +++ b/test/functional/page_objects/home_page.ts @@ -131,7 +131,12 @@ export class HomePageObject extends FtrService { async launchSampleDataSet(id: string) { await this.addSampleDataSet(id); await this.common.closeToastIfExists(); - await this.testSubjects.click(`launchSampleDataSet${id}`); + await this.retry.try(async () => { + await this.testSubjects.click(`launchSampleDataSet${id}`); + await this.find.byCssSelector( + `.euiPopover-isOpen[data-test-subj="launchSampleDataSet${id}"]` + ); + }); } async clickAllKibanaPlugins() { From 656e072566bad28f7a2f71ed4229001f0e9c22ca Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Tue, 1 Nov 2022 22:01:06 +0300 Subject: [PATCH 67/87] [TSVB] In the case of 2 or more panels on the dashboard, TSVB renderComplete fires 2 times (#143999) * [TSVB] In the case of 2 or more panels on the dashboard, TSVB renderComplete fires 2 times * remove recreateDataView * fix PR comments * update limits --- packages/kbn-optimizer/limits.yml | 2 +- .../common/data_views/data_views.test.ts | 3 ++ .../common/data_views/data_views.ts | 41 +++++++++++++++---- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 49b1d6b8cc73..50b5b9e3e782 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -27,7 +27,7 @@ pageLoadAssetSize: dataViewEditor: 12000 dataViewFieldEditor: 27000 dataViewManagement: 5000 - dataViews: 46532 + dataViews: 46600 dataVisualizer: 27530 devTools: 38637 discover: 99999 diff --git a/src/plugins/data_views/common/data_views/data_views.test.ts b/src/plugins/data_views/common/data_views/data_views.test.ts index 64e9ee483ef3..637f525991a3 100644 --- a/src/plugins/data_views/common/data_views/data_views.test.ts +++ b/src/plugins/data_views/common/data_views/data_views.test.ts @@ -155,6 +155,9 @@ describe('IndexPatterns', () => { const gettedDataView = await indexPatterns.get(id); expect(dataView).toBe(gettedDataView); + + const dataView2 = await indexPatterns.create({ id }); + expect(dataView2).toBe(gettedDataView); }); test('allowNoIndex flag preserves existing fields when index is missing', async () => { diff --git a/src/plugins/data_views/common/data_views/data_views.ts b/src/plugins/data_views/common/data_views/data_views.ts index 60dd372dd7b8..cdb69b453708 100644 --- a/src/plugins/data_views/common/data_views/data_views.ts +++ b/src/plugins/data_views/common/data_views/data_views.ts @@ -823,7 +823,7 @@ export class DataViewsService { ? JSON.parse(savedObject.attributes.fieldFormatMap) : {}; - const indexPattern = await this.create(spec, true, displayErrors); + const indexPattern = await this.createFromSpec(spec, true, displayErrors); indexPattern.matchedIndices = indices; indexPattern.resetOriginalSavedObjectBody(); return indexPattern; @@ -898,7 +898,7 @@ export class DataViewsService { * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. * @returns DataView */ - async create( + private async createFromSpec( { id, name, title, ...restOfSpec }: DataViewSpec, skipFetchFields = false, displayErrors = true @@ -913,7 +913,7 @@ export class DataViewsService { ...restOfSpec, }; - const indexPattern = new DataView({ + const dataView = new DataView({ spec, fieldFormats: this.fieldFormats, shortDotsEnable, @@ -921,12 +921,39 @@ export class DataViewsService { }); if (!skipFetchFields) { - await this.refreshFields(indexPattern, displayErrors); + await this.refreshFields(dataView, displayErrors); } - this.dataViewCache.set(indexPattern.id!, Promise.resolve(indexPattern)); + return dataView; + } - return indexPattern; + /** + * Create data view instance. + * @param spec data view spec + * @param skipFetchFields if true, will not fetch fields + * @param displayErrors - If set false, API consumer is responsible for displaying and handling errors. + * @returns DataView + */ + async create( + spec: DataViewSpec, + skipFetchFields = false, + displayErrors = true + ): Promise { + if (spec.id) { + const cachedDataView = spec.id ? await this.dataViewCache.get(spec.id) : undefined; + + if (cachedDataView) { + return cachedDataView; + } + } + + const dataView = await this.createFromSpec(spec, skipFetchFields, displayErrors); + + if (dataView.id) { + return this.dataViewCache.set(dataView.id, Promise.resolve(dataView)); + } + + return dataView; } /** @@ -943,7 +970,7 @@ export class DataViewsService { skipFetchFields = false, displayErrors = true ) { - const indexPattern = await this.create(spec, skipFetchFields, displayErrors); + const indexPattern = await this.createFromSpec(spec, skipFetchFields, displayErrors); const createdIndexPattern = await this.createSavedObject(indexPattern, override, displayErrors); await this.setDefault(createdIndexPattern.id!); return createdIndexPattern!; From 4b1241526520d5c0d0c7fc6fd446f795ee8db39d Mon Sep 17 00:00:00 2001 From: Rodney Norris Date: Tue, 1 Nov 2022 14:22:53 -0500 Subject: [PATCH 68/87] disable ml inference pipeline delete (#144279) Disabled the delete pipeline action if the pipeline is used in more that one ml-inference parent pipeline. --- .../delete_inference_pipeline_button.test.tsx | 61 +++++++++++++++ .../delete_inference_pipeline_button.tsx | 75 +++++++++++++++++++ .../pipelines/inference_pipeline_card.tsx | 15 +--- 3 files changed, 140 insertions(+), 11 deletions(-) create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.test.tsx create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.tsx diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.test.tsx new file mode 100644 index 000000000000..1dd7d8eeccf2 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.test.tsx @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { EuiButtonEmpty, EuiToolTip } from '@elastic/eui'; + +import { InferencePipeline, TrainedModelState } from '../../../../../../common/types/pipelines'; + +import { DeleteInferencePipelineButton } from './delete_inference_pipeline_button'; + +export const DEFAULT_VALUES: InferencePipeline = { + modelId: 'sample-bert-ner-model', + modelState: TrainedModelState.Started, + pipelineName: 'Sample Processor', + pipelineReferences: ['index@ml-inference'], + types: ['pytorch', 'ner'], +}; + +describe('DeleteInferencePipelineButton', () => { + const onClickHandler = jest.fn(); + beforeEach(() => { + jest.clearAllMocks(); + }); + it('renders button with defaults', () => { + const wrapper = shallow( + + ); + const tooltip = wrapper.find(EuiToolTip); + expect(tooltip).toHaveLength(0); + + const btn = wrapper.find(EuiButtonEmpty); + expect(btn).toHaveLength(1); + expect(btn.prop('iconType')).toBe('trash'); + expect(btn.prop('color')).toBe('text'); + expect(btn.prop('children')).toBe('Delete pipeline'); + }); + it('renders disabled with tooltip with multiple references', () => { + const wrapper = shallow( + + ); + const tooltip = wrapper.find(EuiToolTip); + expect(tooltip).toHaveLength(1); + + const btn = wrapper.find(EuiButtonEmpty); + expect(btn).toHaveLength(1); + expect(btn.prop('disabled')).toBe(true); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.tsx new file mode 100644 index 000000000000..4ab47fec3222 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/delete_inference_pipeline_button.tsx @@ -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 React from 'react'; + +import { EuiButtonEmpty, EuiToolTip } from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; + +import { InferencePipeline } from '../../../../../../common/types/pipelines'; + +export interface DeleteInferencePipelineButtonProps { + 'data-telemetry-id'?: string; + onClick: () => void; + pipeline: InferencePipeline; +} + +const DELETE_PIPELINE_LABEL = i18n.translate( + 'xpack.enterpriseSearch.inferencePipelineCard.action.delete', + { + defaultMessage: 'Delete pipeline', + } +); + +export const DeleteInferencePipelineButton: React.FC = ( + props +) => { + if (props.pipeline.pipelineReferences.length > 1) { + const indexReferences = props.pipeline.pipelineReferences + .map((mlPipeline) => mlPipeline.replace('@ml-inference', '')) + .join(', '); + return ( + + + {DELETE_PIPELINE_LABEL} + + + ); + } + return ( + + {DELETE_PIPELINE_LABEL} + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx index 96e8487c3042..f83dfd3fea11 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/inference_pipeline_card.tsx @@ -36,6 +36,7 @@ import { IndexNameLogic } from '../index_name_logic'; import { IndexViewLogic } from '../index_view_logic'; +import { DeleteInferencePipelineButton } from './delete_inference_pipeline_button'; import { TrainedModelHealth } from './ml_model_health'; import { PipelinesLogic } from './pipelines_logic'; @@ -129,19 +130,11 @@ export const InferencePipelineCard: React.FC = (pipeline) =>
- - {i18n.translate( - 'xpack.enterpriseSearch.inferencePipelineCard.action.delete', - { defaultMessage: 'Delete pipeline' } - )} - + pipeline={pipeline} + />
From a7c7da316154beb56c75bdcb84348a5760803d74 Mon Sep 17 00:00:00 2001 From: doakalexi <109488926+doakalexi@users.noreply.github.com> Date: Tue, 1 Nov 2022 15:59:06 -0400 Subject: [PATCH 69/87] [ResponseOps] Ping the response-ops team whenever a new task type is added in a PR (#144196) * Adding test to track changes * Fixing type check * Fix types * Moving route * Filtering out test types --- x-pack/plugins/task_manager/server/mocks.ts | 1 + x-pack/plugins/task_manager/server/plugin.ts | 2 + .../sample_task_plugin/server/init_routes.ts | 21 +++ .../check_registered_task_types.ts | 134 ++++++++++++++++++ .../test_suites/task_manager/index.ts | 1 + 5 files changed, 159 insertions(+) create mode 100644 x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts diff --git a/x-pack/plugins/task_manager/server/mocks.ts b/x-pack/plugins/task_manager/server/mocks.ts index 97ebb227d17c..571149f08aa2 100644 --- a/x-pack/plugins/task_manager/server/mocks.ts +++ b/x-pack/plugins/task_manager/server/mocks.ts @@ -33,6 +33,7 @@ const createStartMock = () => { bulkSchedule: jest.fn(), bulkDisable: jest.fn(), bulkEnable: jest.fn(), + getRegisteredTypes: jest.fn(), }; return mock; }; diff --git a/x-pack/plugins/task_manager/server/plugin.ts b/x-pack/plugins/task_manager/server/plugin.ts index d16fab4a48e2..d2f93903cc7d 100644 --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -66,6 +66,7 @@ export type TaskManagerStartContract = Pick< bulkRemoveIfExist: (ids: string[]) => Promise; } & { supportsEphemeralTasks: () => boolean; + getRegisteredTypes: () => string[]; }; export class TaskManagerPlugin @@ -267,6 +268,7 @@ export class TaskManagerPlugin ephemeralRunNow: (task: EphemeralTask) => taskScheduling.ephemeralRunNow(task), supportsEphemeralTasks: () => this.config.ephemeral_tasks.enabled && this.shouldRunBackgroundTasks, + getRegisteredTypes: () => this.definitions.getAllTypes(), }; } diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts index d44ace998e1e..80da1e13712d 100644 --- a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/server/init_routes.ts @@ -374,4 +374,25 @@ export function initRoutes( } } ); + + router.get( + { + path: '/api/registered_tasks', + validate: {}, + }, + async ( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> => { + try { + const tm = await taskManagerStart; + return res.ok({ + body: tm.getRegisteredTypes(), + }); + } catch (err) { + return res.badRequest({ body: err }); + } + } + ); } diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts new file mode 100644 index 000000000000..5ea05186791f --- /dev/null +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts @@ -0,0 +1,134 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { Response as SupertestResponse } from 'supertest'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + + function getRegisteredTypes() { + return supertest + .get(`/api/registered_tasks`) + .expect(200) + .then((response: SupertestResponse) => response.body); + } + + const TEST_TYPES = [ + 'sampleOneTimeTaskTimingOut', + 'sampleRecurringTaskTimingOut', + 'sampleRecurringTaskWhichHangs', + 'sampleTask', + 'sampleTaskWithLimitedConcurrency', + 'sampleTaskWithSingleConcurrency', + 'singleAttemptSampleTask', + 'taskWhichExecutesOtherTasksEphemerally', + 'timedTask', + 'timedTaskWithLimitedConcurrency', + 'timedTaskWithSingleConcurrency', + ]; + + // This test is meant to fail when any change is made in task manager registered types. + // The intent is to trigger a code review from the Response Ops team to review the new task type changes. + describe('check_registered_task_types', () => { + it('should check changes on all registered task types', async () => { + const types = (await getRegisteredTypes()) + .filter((t: string) => !TEST_TYPES.includes(t)) + .sort(); + expect(types).to.eql([ + 'Fleet-Usage-Sender', + 'ML:saved-objects-sync', + 'UPTIME:SyntheticsService:Sync-Saved-Monitor-Objects', + 'actions:.cases-webhook', + 'actions:.email', + 'actions:.index', + 'actions:.jira', + 'actions:.opsgenie', + 'actions:.pagerduty', + 'actions:.resilient', + 'actions:.server-log', + 'actions:.servicenow', + 'actions:.servicenow-itom', + 'actions:.servicenow-sir', + 'actions:.slack', + 'actions:.swimlane', + 'actions:.teams', + 'actions:.webhook', + 'actions:.xmatters', + 'actions_telemetry', + 'alerting:.es-query', + 'alerting:.geo-containment', + 'alerting:.index-threshold', + 'alerting:apm.anomaly', + 'alerting:apm.error_rate', + 'alerting:apm.transaction_duration', + 'alerting:apm.transaction_error_rate', + 'alerting:logs.alert.document.count', + 'alerting:metrics.alert.anomaly', + 'alerting:metrics.alert.inventory.threshold', + 'alerting:metrics.alert.threshold', + 'alerting:monitoring_alert_cluster_health', + 'alerting:monitoring_alert_cpu_usage', + 'alerting:monitoring_alert_disk_usage', + 'alerting:monitoring_alert_elasticsearch_version_mismatch', + 'alerting:monitoring_alert_jvm_memory_usage', + 'alerting:monitoring_alert_kibana_version_mismatch', + 'alerting:monitoring_alert_license_expiration', + 'alerting:monitoring_alert_logstash_version_mismatch', + 'alerting:monitoring_alert_missing_monitoring_data', + 'alerting:monitoring_alert_nodes_changed', + 'alerting:monitoring_alert_thread_pool_search_rejections', + 'alerting:monitoring_alert_thread_pool_write_rejections', + 'alerting:monitoring_ccr_read_exceptions', + 'alerting:monitoring_shard_size', + 'alerting:siem.eqlRule', + 'alerting:siem.indicatorRule', + 'alerting:siem.mlRule', + 'alerting:siem.newTermsRule', + 'alerting:siem.notifications', + 'alerting:siem.queryRule', + 'alerting:siem.savedQueryRule', + 'alerting:siem.thresholdRule', + 'alerting:transform_health', + 'alerting:xpack.ml.anomaly_detection_alert', + 'alerting:xpack.ml.anomaly_detection_jobs_health', + 'alerting:xpack.uptime.alerts.durationAnomaly', + 'alerting:xpack.uptime.alerts.monitorStatus', + 'alerting:xpack.uptime.alerts.tls', + 'alerting:xpack.uptime.alerts.tlsCertificate', + 'alerting_health_check', + 'alerting_telemetry', + 'alerts_invalidate_api_keys', + 'apm-telemetry-task', + 'cases-telemetry-task', + 'cleanup_failed_action_executions', + 'cloud_security_posture-stats_task', + 'dashboard_telemetry', + 'endpoint:metadata-check-transforms-task', + 'endpoint:user-artifact-packager', + 'fleet:reassign_action:retry', + 'fleet:unenroll_action:retry', + 'fleet:update_agent_tags:retry', + 'fleet:upgrade_action:retry', + 'osquery:telemetry-configs', + 'osquery:telemetry-packs', + 'osquery:telemetry-saved-queries', + 'report:execute', + 'reports:monitor', + 'security:endpoint-diagnostics', + 'security:endpoint-meta-telemetry', + 'security:telemetry-configuration', + 'security:telemetry-detection-rules', + 'security:telemetry-lists', + 'security:telemetry-prebuilt-rule-alerts', + 'security:telemetry-timelines', + 'session_cleanup', + ]); + }); + }); +} diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts index 271206900859..6fd4f3e529dc 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts @@ -13,6 +13,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./task_management')); loadTestFile(require.resolve('./task_management_scheduled_at')); loadTestFile(require.resolve('./task_management_removed_types')); + loadTestFile(require.resolve('./check_registered_task_types')); loadTestFile(require.resolve('./migrations')); }); From ed97fa3e9d5131aa4587b56a7abb52f12f78d0e4 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Tue, 1 Nov 2022 16:18:16 -0400 Subject: [PATCH 70/87] Add legends to custom map layers and convert wms_source to typescript (#143321) * Add legends to custom map layers and convert wms_source to typescript Co-authored-by: Sean Sullivan Co-authored-by: Nick Peihl --- .../public/classes/custom_raster_source.tsx | 8 ++++- ...yer.test.ts => raster_tile_layer.test.tsx} | 9 ++++++ .../raster_tile_layer/raster_tile_layer.ts | 12 +++++++ .../kibana_tilemap_source.js | 6 ++++ .../classes/sources/raster_source/index.ts | 5 ++- .../sources/wms_source/wms_layer_wizard.tsx | 7 ++--- .../{wms_source.js => wms_source.tsx} | 31 +++++++++++++------ .../{xyz_tms_source.ts => xyz_tms_source.tsx} | 7 +++++ 8 files changed, 70 insertions(+), 15 deletions(-) rename x-pack/plugins/maps/public/classes/layers/raster_tile_layer/{raster_tile_layer.test.ts => raster_tile_layer.test.tsx} (92%) rename x-pack/plugins/maps/public/classes/sources/wms_source/{wms_source.js => wms_source.tsx} (69%) rename x-pack/plugins/maps/public/classes/sources/xyz_tms_source/{xyz_tms_source.ts => xyz_tms_source.tsx} (93%) diff --git a/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx b/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx index d36ed2485b5b..372023517375 100644 --- a/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx +++ b/x-pack/examples/third_party_maps_source_example/public/classes/custom_raster_source.tsx @@ -6,7 +6,7 @@ */ import _ from 'lodash'; -import { ReactElement } from 'react'; +import React, { ReactElement } from 'react'; import { calculateBounds } from '@kbn/data-plugin/common'; import { FieldFormatter, MIN_ZOOM, MAX_ZOOM } from '@kbn/maps-plugin/common'; import type { @@ -42,7 +42,13 @@ export class CustomRasterSource implements IRasterSource { constructor(sourceDescriptor: CustomRasterSourceDescriptor) { this._descriptor = sourceDescriptor; } + async hasLegendDetails(): Promise { + return true; + } + renderLegendDetails(): ReactElement | null { + return Radar legend; + } async canSkipSourceUpdate( dataRequest: DataRequest, nextRequestMeta: DataRequestMeta diff --git a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.ts b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.tsx similarity index 92% rename from x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.ts rename to x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.tsx index c42b338032f0..601c4012fae4 100644 --- a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.test.tsx @@ -6,6 +6,7 @@ */ import { RasterTileLayer } from './raster_tile_layer'; +import { ReactElement } from 'react'; import { SOURCE_TYPES } from '../../../../common/constants'; import { DataRequestMeta, XYZTMSSourceDescriptor } from '../../../../common/descriptor_types'; import { AbstractSource } from '../../sources/source'; @@ -26,12 +27,20 @@ class MockTileSource extends AbstractSource implements IRasterSource { super(descriptor); this._descriptor = descriptor; } + async hasLegendDetails(): Promise { + return false; + } + + renderLegendDetails(): ReactElement | null { + return null; + } async canSkipSourceUpdate( dataRequest: DataRequest, nextRequestMeta: DataRequestMeta ): Promise { return true; } + isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean { return false; } diff --git a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts index cc13b70d0106..bd1b266d3488 100644 --- a/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/raster_tile_layer/raster_tile_layer.ts @@ -6,6 +6,7 @@ */ import type { Map as MbMap, RasterTileSource } from '@kbn/mapbox-gl'; +import { ReactElement } from 'react'; import _ from 'lodash'; import { AbstractLayer } from '../layer'; import { SOURCE_DATA_REQUEST_ID, LAYER_TYPE, LAYER_STYLE_TYPE } from '../../../../common/constants'; @@ -41,6 +42,17 @@ export class RasterTileLayer extends AbstractLayer { return super.getSource() as IRasterSource; } + async hasLegendDetails(): Promise { + const source = this.getSource(); + return await source.hasLegendDetails(); + } + + renderLegendDetails(): ReactElement | null { + const dataRequest = this.getSourceDataRequest(); + const source = this.getSource(); + return source.renderLegendDetails(dataRequest); + } + getStyleForEditing() { return this._style; } diff --git a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js index 9abe2997b475..72be5aeac830 100644 --- a/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js +++ b/x-pack/plugins/maps/public/classes/sources/kibana_tilemap_source/kibana_tilemap_source.js @@ -41,7 +41,13 @@ export class KibanaTilemapSource extends AbstractSource { }, ]; } + async hasLegendDetails() { + return false; + } + renderLegendDetails() { + return null; + } isSourceStale(mbSource, sourceData) { if (!sourceData.url) { return false; diff --git a/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts b/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts index 53f1b75003ea..7165db534b41 100644 --- a/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts +++ b/x-pack/plugins/maps/public/classes/sources/raster_source/index.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { RasterTileSource } from '@kbn/mapbox-gl'; +import type { RasterTileSource } from '@kbn/mapbox-gl'; +import { ReactElement } from 'react'; import { DataRequest } from '../../util/data_request'; import { ITMSSource } from '../tms_source'; import { DataRequestMeta } from '../../../../common/descriptor_types'; @@ -15,4 +16,6 @@ export interface RasterTileSourceData { export interface IRasterSource extends ITMSSource { canSkipSourceUpdate(dataRequest: DataRequest, nextRequestMeta: DataRequestMeta): Promise; isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean; + hasLegendDetails(): Promise; + renderLegendDetails(dataRequest: DataRequest | undefined): ReactElement | null; } diff --git a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx index 3b1f5e728eed..0f9485d0ec1b 100644 --- a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx +++ b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_layer_wizard.tsx @@ -9,13 +9,12 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; // @ts-ignore import { WMSCreateSourceEditor } from './wms_create_source_editor'; -// @ts-ignore import { sourceTitle, WMSSource } from './wms_source'; import { LayerWizard, RenderWizardArguments } from '../../layers'; import { RasterTileLayer } from '../../layers/raster_tile_layer/raster_tile_layer'; import { LAYER_WIZARD_CATEGORY, WIZARD_ID } from '../../../../common/constants'; import { WebMapServiceLayerIcon } from '../../layers/wizards/icons/web_map_service_layer_icon'; - +import { WMSSourceDescriptor } from '../../../../common/descriptor_types'; export const wmsLayerWizardConfig: LayerWizard = { id: WIZARD_ID.WMS_LAYER, order: 10, @@ -25,14 +24,14 @@ export const wmsLayerWizardConfig: LayerWizard = { }), icon: WebMapServiceLayerIcon, renderWizard: ({ previewLayers }: RenderWizardArguments) => { - const onSourceConfigChange = (sourceConfig: unknown) => { + const onSourceConfigChange = (sourceConfig: Partial) => { if (!sourceConfig) { previewLayers([]); return; } const layerDescriptor = RasterTileLayer.createDescriptor({ - sourceDescriptor: WMSSource.createDescriptor(sourceConfig), + sourceDescriptor: WMSSource.createDescriptor(sourceConfig as Partial), }); previewLayers([layerDescriptor]); }; diff --git a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.js b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.tsx similarity index 69% rename from x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.js rename to x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.tsx index 3d682a504c2d..480b253264e5 100644 --- a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.js +++ b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_source.tsx @@ -5,40 +5,53 @@ * 2.0. */ -import { AbstractSource } from '../source'; +import { ReactElement } from 'react'; import { i18n } from '@kbn/i18n'; +import { RasterTileSource } from 'maplibre-gl'; +import { AbstractSource } from '../source'; import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; +// @ts-ignore import { WmsClient } from './wms_client'; import { SOURCE_TYPES } from '../../../../common/constants'; import { registerSource } from '../source_registry'; - +import { IRasterSource, RasterTileSourceData } from '../raster_source'; +import { WMSSourceDescriptor } from '../../../../common/descriptor_types'; export const sourceTitle = i18n.translate('xpack.maps.source.wmsTitle', { defaultMessage: 'Web Map Service', }); -export class WMSSource extends AbstractSource { +export class WMSSource extends AbstractSource implements IRasterSource { static type = SOURCE_TYPES.WMS; - - static createDescriptor({ serviceUrl, layers, styles }) { + readonly _descriptor: WMSSourceDescriptor; + static createDescriptor({ serviceUrl, layers, styles }: Partial) { return { type: WMSSource.type, serviceUrl, layers, styles, - }; + } as WMSSourceDescriptor; + } + constructor(sourceDescriptor: WMSSourceDescriptor) { + super(sourceDescriptor); + this._descriptor = sourceDescriptor; + } + async hasLegendDetails(): Promise { + return false; + } + + renderLegendDetails(): ReactElement | null { + return null; } - isSourceStale(mbSource, sourceData) { + isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData) { if (!sourceData.url) { return false; } return mbSource.tiles?.[0] !== sourceData.url; } - async canSkipSourceUpdate() { return false; } - async getImmutableProperties() { return [ { label: getDataSourceLabel(), value: sourceTitle }, diff --git a/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.ts b/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.tsx similarity index 93% rename from x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.ts rename to x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.tsx index c2c5e6404c8f..64f4734c3d80 100644 --- a/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/xyz_tms_source/xyz_tms_source.tsx @@ -6,6 +6,7 @@ */ import { i18n } from '@kbn/i18n'; +import { ReactElement } from 'react'; import { RasterTileSource } from 'maplibre-gl'; import { getDataSourceLabel, getUrlLabel } from '../../../../common/i18n_getters'; import { SOURCE_TYPES } from '../../../../common/constants'; @@ -56,7 +57,13 @@ export class XYZTMSSource extends AbstractSource implements IRasterSource { async getUrlTemplate(): Promise { return this._descriptor.urlTemplate; } + async hasLegendDetails(): Promise { + return false; + } + renderLegendDetails(): ReactElement | null { + return null; + } isSourceStale(mbSource: RasterTileSource, sourceData: RasterTileSourceData): boolean { if (!sourceData.url) { return false; From d7b08c67f9d49f47378d5232f9067912fe5675fc Mon Sep 17 00:00:00 2001 From: JD Kurma Date: Tue, 1 Nov 2022 16:27:52 -0400 Subject: [PATCH 71/87] [Security Solution] Telemetry Filter List Artifact (#142480) * filterlist artifact * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * add access modifiers * update interval time * update artifact unit test Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../telemetry/__mocks__/kibana-artifacts.zip | Bin 0 -> 1788 bytes .../server/lib/telemetry/artifact.test.ts | 60 +++++++++++++++++- .../server/lib/telemetry/artifact.ts | 2 +- .../server/lib/telemetry/filterlists/index.ts | 43 ++++++++++++- .../server/lib/telemetry/helpers.ts | 4 +- .../server/lib/telemetry/sender.ts | 4 +- .../lib/telemetry/tasks/configuration.ts | 2 +- .../server/lib/telemetry/tasks/filterlists.ts | 47 ++++++++++++++ .../server/lib/telemetry/tasks/index.ts | 2 + .../telemetry/tasks/prebuilt_rule_alerts.ts | 4 +- .../server/lib/telemetry/types.ts | 7 ++ 11 files changed, 161 insertions(+), 14 deletions(-) create mode 100644 x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip create mode 100644 x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip b/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip new file mode 100644 index 0000000000000000000000000000000000000000..779e8d257b7b0bf2406e31cc64250d2507df4c35 GIT binary patch literal 1788 zcmWIWW@Zs#00EWu#89rojW#kY3=AO53lz&u%*#wmEiTc^D$dWV=28FxrNp9=%(TSh zl42z*1&9z>xHvJlASYF~s5B?FShvg&MG~waB{exeB{e0!I3v->)C?%EWNBh-Y?x+d zVquh+nre|^lxARQmYiZ?WR{eil$>a6WSD4VY>}K|mSkdNWN2(;mTZukn3$AeU}A1* zX=ZGgsH6jS5y*59P=ec#S(OSj-_#UMz9=;(u_UuBHNLbc2V}o~N`84>PJUuav3_=D zQes}BKAI==DRv>;fwc&?D3zq04XzL)0DKN#I)ojOB1s+lQaXf6jQUL)D*K+OJjq? zWP@a5OG{v&69_(FkR#j-4qw9IM}*JxDRwr2FipOTKoFj^yGwEbJL zIX_t#w7>FOJ0*9M;Sn=s>xExVChk!a`7!%i#3KzOu?D>;`U8q7bIV$=KNm4eWJ5|i}uPS35yz&?J0T(B78!W9QoZQ z`76pyVXJ;7Eh;_#`qk>#t7(&O1TtjgWx4!wRaWd=rXn~sH)vY@t8Br>p3MBLz3=NG4~}W~|E07j zH(v=BTTs@0ZHi*)+B+%t)`_dtzBRR5Q8JrNwx@5-Y{ohJO*TALY&7)x!*qSsi)DMK z=+037Q1iG|#Wnb1n^W!nz!?)}HL(4XS(n1&@t$u^%5~2>VLMN@grxC#kb1l9%uU<Gwvz}m|Vc1fe}Q( pk|ekSLf49(%pe*W7#bMef%O+$D=^Uoc(byBWSM}l6i63>c>v6QN>%^> literal 0 HcmV?d00001 diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts index c8307b3dd3d7..b624336be51b 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts @@ -6,12 +6,66 @@ */ import { createMockTelemetryReceiver } from './__mocks__'; -import { artifactService } from './artifact'; +import { Artifact } from './artifact'; +import axios from 'axios'; +import type { TelemetryConfiguration } from './types'; + +jest.mock('axios'); +const mockedAxios = axios as jest.Mocked; describe('telemetry artifact test', () => { - test('diagnostics telemetry task should query and enqueue events', async () => { + test('start should retrieve cluster information', async () => { const mockTelemetryReceiver = createMockTelemetryReceiver(); - await artifactService.start(mockTelemetryReceiver); + const artifact = new Artifact(); + await artifact.start(mockTelemetryReceiver); expect(mockTelemetryReceiver.fetchClusterInfo).toHaveBeenCalled(); }); + + test('getArtifact should throw an error if manifest url is null', async () => { + const artifact = new Artifact(); + await expect(async () => artifact.getArtifact('test')).rejects.toThrow('No manifest url'); + }); + + test('getArtifact should throw an error if relative url is null', async () => { + const mockTelemetryReceiver = createMockTelemetryReceiver(); + const artifact = new Artifact(); + await artifact.start(mockTelemetryReceiver); + const axiosResponse = { + data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + }; + mockedAxios.get.mockImplementationOnce(() => Promise.resolve(axiosResponse)); + await expect(async () => artifact.getArtifact('artifactThatDoesNotExist')).rejects.toThrow( + 'No artifact for name artifactThatDoesNotExist' + ); + }); + + test('getArtifact should return respective artifact', async () => { + const mockTelemetryReceiver = createMockTelemetryReceiver(); + const artifact = new Artifact(); + await artifact.start(mockTelemetryReceiver); + const axiosResponse = { + data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + }; + mockedAxios.get + .mockImplementationOnce(() => Promise.resolve(axiosResponse)) + .mockImplementationOnce(() => + Promise.resolve({ + data: { + telemetry_max_buffer_size: 100, + max_security_list_telemetry_batch: 100, + max_endpoint_telemetry_batch: 300, + max_detection_rule_telemetry_batch: 1_000, + max_detection_alerts_batch: 50, + }, + }) + ); + const artifactObject: TelemetryConfiguration = (await artifact.getArtifact( + 'telemetry-buffer-and-batch-sizes-v1' + )) as unknown as TelemetryConfiguration; + expect(artifactObject.telemetry_max_buffer_size).toEqual(100); + expect(artifactObject.max_security_list_telemetry_batch).toEqual(100); + expect(artifactObject.max_endpoint_telemetry_batch).toEqual(300); + expect(artifactObject.max_detection_rule_telemetry_batch).toEqual(1_000); + expect(artifactObject.max_detection_alerts_batch).toEqual(50); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts index 07ec2b6f2e49..f531db6a5d6d 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts @@ -15,7 +15,7 @@ export interface IArtifact { getArtifact(name: string): Promise; } -class Artifact implements IArtifact { +export class Artifact implements IArtifact { private manifestUrl?: string; private readonly CDN_URL = 'https://artifacts.security.elastic.co'; private readonly AXIOS_TIMEOUT_MS = 10_000; diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts b/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts index 7c64a29da8f1..38ee5f132465 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts @@ -6,6 +6,9 @@ */ import type { AllowlistFields } from './types'; import type { TelemetryEvent } from '../types'; +import { endpointAllowlistFields } from './endpoint_alerts'; +import { exceptionListAllowlistFields } from './exception_lists'; +import { prebuiltRuleAllowlistFields } from './prebuilt_rules_alerts'; /** * Filters out Key/Values not required for downstream analysis @@ -38,6 +41,40 @@ export function copyAllowlistedFields( }, {}); } -export { endpointAllowlistFields } from './endpoint_alerts'; -export { exceptionListAllowlistFields } from './exception_lists'; -export { prebuiltRuleAllowlistFields } from './prebuilt_rules_alerts'; +export class FilterList { + private _endpointAlerts = endpointAllowlistFields; + private _exceptionLists = exceptionListAllowlistFields; + private _prebuiltRulesAlerts = prebuiltRuleAllowlistFields; + + public get endpointAlerts(): AllowlistFields { + return this._endpointAlerts; + } + + public set endpointAlerts(list: AllowlistFields) { + this._endpointAlerts = list; + } + + public get exceptionLists(): AllowlistFields { + return this._exceptionLists; + } + + public set exceptionLists(list: AllowlistFields) { + this._exceptionLists = list; + } + + public get prebuiltRulesAlerts(): AllowlistFields { + return this._prebuiltRulesAlerts; + } + + public set prebuiltRulesAlerts(list: AllowlistFields) { + this._prebuiltRulesAlerts = list; + } + + public resetAllToDefault() { + this._endpointAlerts = endpointAllowlistFields; + this._exceptionLists = exceptionListAllowlistFields; + this._prebuiltRulesAlerts = prebuiltRuleAllowlistFields; + } +} + +export const filterList = new FilterList(); diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts b/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts index 0fd7a0f6604c..9b3a847b63e2 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts @@ -10,7 +10,7 @@ import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-t import type { PackagePolicy } from '@kbn/fleet-plugin/common/types/models/package_policy'; import { merge } from 'lodash'; import type { Logger } from '@kbn/core/server'; -import { copyAllowlistedFields, exceptionListAllowlistFields } from './filterlists'; +import { copyAllowlistedFields, filterList } from './filterlists'; import type { PolicyConfig, PolicyData } from '../../../common/endpoint/types'; import type { ExceptionListItem, @@ -191,7 +191,7 @@ export const templateExceptionList = ( // cast exception list type to a TelemetryEvent for allowlist filtering const filteredListItem = copyAllowlistedFields( - exceptionListAllowlistFields, + filterList.exceptionLists, item as unknown as TelemetryEvent ); diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts index 1ff8d31ecd7f..848f66c3aaf0 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts @@ -19,7 +19,7 @@ import type { TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import type { ITelemetryReceiver } from './receiver'; -import { copyAllowlistedFields, endpointAllowlistFields } from './filterlists'; +import { copyAllowlistedFields, filterList } from './filterlists'; import { createTelemetryTaskConfigs } from './tasks'; import { createUsageCounterLabel, tlog } from './helpers'; import type { TelemetryEvent } from './types'; @@ -299,7 +299,7 @@ export class TelemetryEventsSender implements ITelemetryEventsSender { public processEvents(events: TelemetryEvent[]): TelemetryEvent[] { return events.map(function (obj: TelemetryEvent): TelemetryEvent { - return copyAllowlistedFields(endpointAllowlistFields, obj); + return copyAllowlistedFields(filterList.endpointAlerts, obj); }); } diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts index d266d2f1c769..27dd32f5d48f 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts @@ -18,7 +18,7 @@ export function createTelemetryConfigurationTaskConfig() { return { type: 'security:telemetry-configuration', title: 'Security Solution Telemetry Configuration Task', - interval: '45m', + interval: '1h', timeout: '1m', version: '1.0.0', runTask: async ( diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts new file mode 100644 index 000000000000..67a6c4d270b6 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { Logger } from '@kbn/core/server'; +import type { ITelemetryEventsSender } from '../sender'; +import type { TelemetryFilterListArtifact } from '../types'; +import type { ITelemetryReceiver } from '../receiver'; +import type { TaskExecutionPeriod } from '../task'; +import { artifactService } from '../artifact'; +import { filterList } from '../filterlists'; +import { tlog } from '../helpers'; + +export function createTelemetryFilterListArtifactTaskConfig() { + return { + type: 'security:telemetry-filterlist-artifact', + title: 'Security Solution Telemetry Filter List Artifact Task', + interval: '45m', + timeout: '1m', + version: '1.0.0', + runTask: async ( + taskId: string, + logger: Logger, + receiver: ITelemetryReceiver, + sender: ITelemetryEventsSender, + taskExecutionPeriod: TaskExecutionPeriod + ) => { + try { + const artifactName = 'telemetry-filterlists-v1'; + const artifact = (await artifactService.getArtifact( + artifactName + )) as unknown as TelemetryFilterListArtifact; + filterList.endpointAlerts = artifact.endpoint_alerts; + filterList.exceptionLists = artifact.exception_lists; + filterList.prebuiltRulesAlerts = artifact.prebuilt_rules_alerts; + return 0; + } catch (err) { + tlog(logger, `Failed to set telemetry filterlist artifact due to ${err.message}`); + filterList.resetAllToDefault(); + return 0; + } + }, + }; +} diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts index d56a4eb54be4..e25b3690ee88 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts @@ -14,6 +14,7 @@ import { createTelemetryPrebuiltRuleAlertsTaskConfig } from './prebuilt_rule_ale import { createTelemetryTimelineTaskConfig } from './timelines'; import { createTelemetryConfigurationTaskConfig } from './configuration'; import { telemetryConfiguration } from '../configuration'; +import { createTelemetryFilterListArtifactTaskConfig } from './filterlists'; export function createTelemetryTaskConfigs(): SecurityTelemetryTaskConfig[] { return [ @@ -26,5 +27,6 @@ export function createTelemetryTaskConfigs(): SecurityTelemetryTaskConfig[] { createTelemetryPrebuiltRuleAlertsTaskConfig(telemetryConfiguration.max_detection_alerts_batch), createTelemetryTimelineTaskConfig(), createTelemetryConfigurationTaskConfig(), + createTelemetryFilterListArtifactTaskConfig(), ]; } diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts index 33d33924fcf3..68b5ca6b01ce 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts @@ -12,7 +12,7 @@ import type { ESClusterInfo, ESLicense, TelemetryEvent } from '../types'; import type { TaskExecutionPeriod } from '../task'; import { TELEMETRY_CHANNEL_DETECTION_ALERTS, TASK_METRICS_CHANNEL } from '../constants'; import { batchTelemetryRecords, tlog, createTaskMetric } from '../helpers'; -import { copyAllowlistedFields, prebuiltRuleAllowlistFields } from '../filterlists'; +import { copyAllowlistedFields, filterList } from '../filterlists'; export function createTelemetryPrebuiltRuleAlertsTaskConfig(maxTelemetryBatch: number) { return { @@ -64,7 +64,7 @@ export function createTelemetryPrebuiltRuleAlertsTaskConfig(maxTelemetryBatch: n const processedAlerts = telemetryEvents.map( (event: TelemetryEvent): TelemetryEvent => - copyAllowlistedFields(prebuiltRuleAllowlistFields, event) + copyAllowlistedFields(filterList.prebuiltRulesAlerts, event) ); const enrichedAlerts = processedAlerts.map( diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/types.ts b/x-pack/plugins/security_solution/server/lib/telemetry/types.ts index 36462773b8e7..51396684bf3b 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/types.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/types.ts @@ -6,6 +6,7 @@ */ import type { AlertEvent, ResolverNode, SafeResolverEvent } from '../../../common/endpoint/types'; +import type { AllowlistFields } from './filterlists/types'; type BaseSearchTypes = string | number | boolean | object; export type SearchTypes = BaseSearchTypes | BaseSearchTypes[] | undefined; @@ -429,3 +430,9 @@ export interface TelemetryConfiguration { max_detection_rule_telemetry_batch: number; max_detection_alerts_batch: number; } + +export interface TelemetryFilterListArtifact { + endpoint_alerts: AllowlistFields; + exception_lists: AllowlistFields; + prebuilt_rules_alerts: AllowlistFields; +} From e476028e68aacb69ffb4e7b12e62d741a4dffbb0 Mon Sep 17 00:00:00 2001 From: Rudolf Meijering Date: Tue, 1 Nov 2022 22:00:29 +0100 Subject: [PATCH 72/87] Bump field limit for esArchiver indices using kibana package version template var (#144272) --- .../saved_objects/delete_unknown_types/mappings.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json b/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json index f745e0f69c5d..fb2337c15216 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json @@ -523,7 +523,10 @@ "number_of_shards": "1", "priority": "10", "refresh_interval": "1s", - "routing_partition_size": "1" + "routing_partition_size": "1", + "mapping": { + "total_fields": { "limit": 1500 } + } } } } From 29a070634949b88941d1c7bbf28e288a6c33d4a3 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 1 Nov 2022 17:07:01 -0400 Subject: [PATCH 73/87] skip failing test suite (#144369) --- .../test_suites/task_manager/check_registered_task_types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts index 5ea05186791f..1cd6614bf583 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts @@ -35,7 +35,8 @@ export default function ({ getService }: FtrProviderContext) { // This test is meant to fail when any change is made in task manager registered types. // The intent is to trigger a code review from the Response Ops team to review the new task type changes. - describe('check_registered_task_types', () => { + // Failing: See https://github.com/elastic/kibana/issues/144369 + describe.skip('check_registered_task_types', () => { it('should check changes on all registered task types', async () => { const types = (await getRegisteredTypes()) .filter((t: string) => !TEST_TYPES.includes(t)) From cb86777d1e340c48a0cab8d5fc80949632a2e7f6 Mon Sep 17 00:00:00 2001 From: Maja Grubic Date: Tue, 1 Nov 2022 23:15:15 +0100 Subject: [PATCH 74/87] [SharedUX][Bugfix] Solution nav with no data page (#144280) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../with_solution_nav.test.tsx.snap | 30 ++----------------- .../src/with_solution_nav.styles.ts | 4 +-- .../solution_nav/src/with_solution_nav.tsx | 9 ++---- 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap b/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap index 749d0a13ad8d..d31d61c4b812 100644 --- a/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap +++ b/packages/shared-ux/page/solution_nav/src/__snapshots__/with_solution_nav.test.tsx.snap @@ -52,20 +52,7 @@ exports[`WithSolutionNav renders wrapped component 1`] = ` } pageSideBarProps={ Object { - "className": "kbnStickyMenu", - "css": Object { - "map": undefined, - "name": "sx7fqw", - "next": undefined, - "styles": " - flex: 0 1 0%; - overflow: hidden; - @media screen and (prefers-reduced-motion: no-preference) { - transition: min-width 150ms cubic-bezier(.694, .0482, .335, 1); - } - ", - "toString": [Function], - }, + "className": "css-c34ez9", "minWidth": undefined, "paddingSize": "none", } @@ -125,20 +112,7 @@ exports[`WithSolutionNav with children 1`] = ` } pageSideBarProps={ Object { - "className": "kbnStickyMenu", - "css": Object { - "map": undefined, - "name": "sx7fqw", - "next": undefined, - "styles": " - flex: 0 1 0%; - overflow: hidden; - @media screen and (prefers-reduced-motion: no-preference) { - transition: min-width 150ms cubic-bezier(.694, .0482, .335, 1); - } - ", - "toString": [Function], - }, + "className": "css-c34ez9", "minWidth": undefined, "paddingSize": "none", } diff --git a/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts b/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts index 906f1fdd8e29..628b27ffba99 100644 --- a/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts +++ b/packages/shared-ux/page/solution_nav/src/with_solution_nav.styles.ts @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -import { css } from '@emotion/react'; +import { css } from '@emotion/css'; import { euiCanAnimate, EuiThemeComputed } from '@elastic/eui'; export const WithSolutionNavStyles = (euiTheme: EuiThemeComputed<{}>) => { return css` - flex: 0 1 0%; + flex: 0 1 0; overflow: hidden; ${euiCanAnimate} { transition: min-width ${euiTheme.animation.fast} ${euiTheme.animation.resistance}; diff --git a/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx b/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx index 0c3f0359c1f6..d35834e7cdd9 100644 --- a/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx +++ b/packages/shared-ux/page/solution_nav/src/with_solution_nav.tsx @@ -8,7 +8,6 @@ import React, { ComponentType, ReactNode, useState } from 'react'; import classNames from 'classnames'; -import { SerializedStyles } from '@emotion/serialize'; import { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types'; import { useIsWithinBreakpoints, useEuiTheme, useIsWithinMinBreakpoint } from '@elastic/eui'; import { SolutionNav, SolutionNavProps } from './solution_nav'; @@ -37,7 +36,6 @@ export const withSolutionNav =

(WrappedComponent: Compo const [isSideNavOpenOnDesktop, setisSideNavOpenOnDesktop] = useState( !JSON.parse(String(localStorage.getItem(SOLUTION_NAV_COLLAPSED_KEY))) ); - const { solutionNav, children, ...propagatedProps } = props; const { euiTheme } = useEuiTheme(); @@ -53,11 +51,11 @@ export const withSolutionNav =

(WrappedComponent: Compo isMediumBreakpoint || (canBeCollapsed && isLargerBreakpoint && !isSideNavOpenOnDesktop); const withSolutionNavStyles = WithSolutionNavStyles(euiTheme); const sideBarClasses = classNames( - 'kbnStickyMenu', { 'kbnSolutionNav__sidebar--shrink': isSidebarShrunk, }, - props.pageSideBarProps?.className + props.pageSideBarProps?.className, + withSolutionNavStyles ); const pageSideBar = ( @@ -68,12 +66,11 @@ export const withSolutionNav =

(WrappedComponent: Compo /> ); - const pageSideBarProps: TemplateProps['pageSideBarProps'] & { css: SerializedStyles } = { + const pageSideBarProps: TemplateProps['pageSideBarProps'] = { paddingSize: 'none' as 'none', ...props.pageSideBarProps, minWidth: isSidebarShrunk ? euiTheme.size.xxl : undefined, className: sideBarClasses, - css: withSolutionNavStyles, }; return ( From cf7d6cc6de7e925709146efa4c731f28038ef3c0 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 1 Nov 2022 17:23:24 -0500 Subject: [PATCH 75/87] Remove buildbuddy cache (#144356) * Remove buildbuddy cache * Update .buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh * Update .buildkite/scripts/common/setup_bazel.sh --- .buildkite/scripts/common/setup_bazel.sh | 15 ++------------- .buildkite/scripts/lifecycle/pre_command.sh | 3 --- .../scripts/steps/on_merge_ts_refs_api_docs.sh | 1 - src/dev/ci_setup/load_env_keys.sh | 3 --- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.buildkite/scripts/common/setup_bazel.sh b/.buildkite/scripts/common/setup_bazel.sh index 503ce2ef06c9..ea3c2453de6d 100755 --- a/.buildkite/scripts/common/setup_bazel.sh +++ b/.buildkite/scripts/common/setup_bazel.sh @@ -42,18 +42,7 @@ cat <> $KIBANA_DIR/.bazelrc EOF fi -if [[ "$BAZEL_CACHE_MODE" == "buildbuddy" ]]; then - echo "[bazel] enabling caching with Buildbuddy" -cat <> $KIBANA_DIR/.bazelrc - build --bes_results_url=https://app.buildbuddy.io/invocation/ - build --bes_backend=grpcs://remote.buildbuddy.io - build --remote_cache=grpcs://remote.buildbuddy.io - build --remote_timeout=3600 - build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY -EOF -fi - -if [[ "$BAZEL_CACHE_MODE" != @(gcs|populate-local-gcs|buildbuddy|none|) ]]; then - echo "invalid value for BAZEL_CACHE_MODE received ($BAZEL_CACHE_MODE), expected one of [gcs,populate-local-gcs|buildbuddy,none]" +if [[ "$BAZEL_CACHE_MODE" != @(gcs|populate-local-gcs|none|) ]]; then + echo "invalid value for BAZEL_CACHE_MODE received ($BAZEL_CACHE_MODE), expected one of [gcs,populate-local-gcs|none]" exit 1 fi diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index b5d1d905458e..b945f08d1dfd 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -145,9 +145,6 @@ export SYNTHETICS_REMOTE_KIBANA_URL export TEST_FAILURES_ES_PASSWORD } -KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key) -export KIBANA_BUILDBUDDY_CI_API_KEY - BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE="$HOME/.kibana-ci-bazel-remote-cache-local-dev.json" export BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE retry 5 5 vault read -field=service_account_json secret/kibana-issues/dev/kibana-ci-bazel-remote-cache-local-dev > "$BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE" diff --git a/.buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh b/.buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh index f2360e58851d..4ed14093a210 100755 --- a/.buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh +++ b/.buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh @@ -2,7 +2,6 @@ set -euo pipefail -export BAZEL_CACHE_MODE=buildbuddy # Populate Buildbuddy bazel remote cache for linux export DISABLE_BOOTSTRAP_VALIDATION=true .buildkite/scripts/bootstrap.sh diff --git a/src/dev/ci_setup/load_env_keys.sh b/src/dev/ci_setup/load_env_keys.sh index 5f7a6c26bab2..62d29db232ea 100644 --- a/src/dev/ci_setup/load_env_keys.sh +++ b/src/dev/ci_setup/load_env_keys.sh @@ -34,9 +34,6 @@ else PERCY_TOKEN=$(retry 5 vault read -field=value secret/kibana-issues/dev/percy) export PERCY_TOKEN - KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key) - export KIBANA_BUILDBUDDY_CI_API_KEY - # remove vault related secrets unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN VAULT_ADDR fi From 7d77d39e1fcea75f9c84dee236f2f7e835b507fd Mon Sep 17 00:00:00 2001 From: Spencer Date: Tue, 1 Nov 2022 15:26:44 -0700 Subject: [PATCH 76/87] [ts] set allowJs to true by default (#144281) * [ts] set allowJs to true by default * fix scripts/check_ts_projects, original implementation is now wildly inefficient * produce stats in check_ts_projects to make sure it's actually working * fix imports --- kbn_pm/tsconfig.json | 1 - packages/kbn-ace/tsconfig.json | 1 + packages/kbn-bazel-packages/tsconfig.json | 1 - packages/kbn-bazel-runner/tsconfig.json | 1 - packages/kbn-interpreter/tsconfig.json | 1 - packages/kbn-plugin-discovery/tsconfig.json | 1 - .../lib/mocha/decorate_mocha_ui.js | 7 +- .../lib/mocha/load_tests.ts | 7 +- .../lib/mocha/setup_mocha.ts | 2 - .../src/jest/configs/get_all_jest_paths.ts | 1 - packages/kbn-test/src/kbn/kbn_test_config.ts | 2 +- packages/kbn-ui-shared-deps-npm/tsconfig.json | 1 - packages/kbn-ui-shared-deps-src/tsconfig.json | 1 - .../keystore}/get_keystore.js | 2 +- .../keystore}/get_keystore.test.js | 2 +- src/cli/keystore/read_keystore.js | 2 +- src/{cli_plugin/lib => cli}/logger.js | 12 +- src/{cli_plugin/lib => cli}/logger.test.js | 0 src/cli/tsconfig.json | 17 +++ src/cli_encryption_keys/generate.js | 2 +- src/cli_encryption_keys/generate.test.js | 2 +- src/cli_encryption_keys/interactive.test.js | 2 +- src/cli_encryption_keys/tsconfig.json | 15 +++ src/cli_keystore/add.js | 2 +- src/cli_keystore/add.test.js | 2 +- src/cli_keystore/cli_keystore.js | 2 +- src/cli_keystore/create.js | 2 +- src/cli_keystore/create.test.js | 2 +- src/cli_keystore/list.js | 2 +- src/cli_keystore/list.test.js | 2 +- src/cli_keystore/tsconfig.json | 18 +++ src/cli_plugin/install/cleanup.test.js | 2 +- src/cli_plugin/install/download.test.js | 2 +- src/cli_plugin/install/index.js | 2 +- src/cli_plugin/install/kibana.test.js | 2 +- src/cli_plugin/install/pack.test.js | 2 +- src/cli_plugin/install/progress.test.js | 2 +- src/cli_plugin/lib/logger.d.ts | 20 --- src/cli_plugin/list/index.js | 2 +- src/cli_plugin/remove/index.js | 2 +- src/cli_plugin/remove/remove.test.js | 2 +- src/cli_plugin/tsconfig.json | 18 +++ src/cli_setup/cli_setup.ts | 2 +- src/cli_setup/tsconfig.json | 16 +++ src/cli_verification_code/tsconfig.json | 14 ++ src/dev/file.ts | 2 +- src/dev/tsconfig.json | 20 +++ src/dev/typescript/projects.ts | 2 +- .../typescript/run_check_ts_projects_cli.ts | 122 +++++++++++++----- src/dev/typescript/run_type_check_cli.ts | 13 +- src/fixtures/tsconfig.json | 15 +++ src/plugins/console/tsconfig.json | 5 + src/plugins/dashboard/tsconfig.json | 2 +- src/plugins/discover/tsconfig.json | 5 + .../components/manage_data/manage_data.tsx | 1 - .../public/components/add_data/add_data.tsx | 1 - .../components/manage_data/manage_data.tsx | 1 - src/plugins/vis_types/timelion/tsconfig.json | 1 + .../vis_types/timeseries/tsconfig.json | 5 + src/plugins/vis_types/vega/tsconfig.json | 4 +- .../vislib/public/vis_controller.tsx | 1 - src/plugins/vis_types/vislib/tsconfig.json | 5 +- src/setup_node_env/tsconfig.json | 16 +++ test/accessibility/services/a11y/a11y.ts | 1 - test/functional/services/common/browser.ts | 9 +- test/tsconfig.json | 1 + tsconfig.base.json | 5 + tsconfig.json | 16 --- x-pack/plugins/apm/ftr_e2e/tsconfig.json | 1 - .../components/shared/kuery_bar/index.tsx | 1 - .../scripts/infer_route_return_types/index.ts | 1 - .../lib/helpers/get_bucket_size/index.ts | 3 +- x-pack/plugins/apm/tsconfig.json | 3 +- x-pack/plugins/canvas/tsconfig.json | 8 +- .../cloud_gain_sight/tsconfig.json | 3 + .../geo/abstract_geo_file_importer.tsx | 1 - .../geo/geojson_importer/geojson_importer.ts | 6 +- .../shapefile_importer/shapefile_importer.tsx | 1 - x-pack/plugins/fleet/cypress/tsconfig.json | 1 - x-pack/plugins/fleet/tsconfig.json | 3 +- x-pack/plugins/graph/tsconfig.json | 5 + .../__jest__/api_responses/upload_license.js | 5 + .../__jest__/upload_license.test.tsx | 4 - .../start_trial/start_trial.tsx | 2 +- .../public/application/pipeline_edit_view.tsx | 3 - .../public/models/pipeline/pipeline.js | 8 +- .../logstash/public/models/pipeline/props.ts | 28 ++++ x-pack/plugins/maps/tsconfig.json | 5 + x-pack/plugins/ml/tsconfig.json | 5 + x-pack/plugins/monitoring/tsconfig.json | 5 + .../public/utils/get_bucket_size/index.ts | 2 +- x-pack/plugins/osquery/cypress/tsconfig.json | 1 - x-pack/plugins/osquery/tsconfig.json | 1 + .../job_action_menu/job_action_menu.js | 2 +- x-pack/plugins/screenshotting/tsconfig.json | 1 + .../plugins/security_solution/tsconfig.json | 1 + x-pack/test/tsconfig.json | 7 +- 97 files changed, 415 insertions(+), 158 deletions(-) rename src/{cli_keystore => cli/keystore}/get_keystore.js (95%) rename src/{cli_keystore => cli/keystore}/get_keystore.test.js (96%) rename src/{cli_plugin/lib => cli}/logger.js (85%) rename src/{cli_plugin/lib => cli}/logger.test.js (100%) create mode 100644 src/cli/tsconfig.json create mode 100644 src/cli_encryption_keys/tsconfig.json create mode 100644 src/cli_keystore/tsconfig.json delete mode 100644 src/cli_plugin/lib/logger.d.ts create mode 100644 src/cli_plugin/tsconfig.json create mode 100644 src/cli_setup/tsconfig.json create mode 100644 src/cli_verification_code/tsconfig.json create mode 100644 src/dev/tsconfig.json create mode 100644 src/fixtures/tsconfig.json create mode 100644 src/setup_node_env/tsconfig.json create mode 100644 x-pack/plugins/logstash/public/models/pipeline/props.ts diff --git a/kbn_pm/tsconfig.json b/kbn_pm/tsconfig.json index 53fea34be6d2..f8ef60867aca 100644 --- a/kbn_pm/tsconfig.json +++ b/kbn_pm/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "target", - "allowJs": true, "checkJs": true, "target": "ES2022", "module": "ESNext" diff --git a/packages/kbn-ace/tsconfig.json b/packages/kbn-ace/tsconfig.json index febbd6d200d0..8fd7178521b5 100644 --- a/packages/kbn-ace/tsconfig.json +++ b/packages/kbn-ace/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { + "allowJs": false, "declaration": true, "emitDeclarationOnly": true, "outDir": "./target_types", diff --git a/packages/kbn-bazel-packages/tsconfig.json b/packages/kbn-bazel-packages/tsconfig.json index 88c042aec7ed..54d35c4858e6 100644 --- a/packages/kbn-bazel-packages/tsconfig.json +++ b/packages/kbn-bazel-packages/tsconfig.json @@ -3,7 +3,6 @@ "compilerOptions": { "declaration": true, "emitDeclarationOnly": true, - "allowJs": true, "checkJs": true, "outDir": "target_types", "stripInternal": false, diff --git a/packages/kbn-bazel-runner/tsconfig.json b/packages/kbn-bazel-runner/tsconfig.json index 84a0388b2291..dbd1dff4ef9e 100644 --- a/packages/kbn-bazel-runner/tsconfig.json +++ b/packages/kbn-bazel-runner/tsconfig.json @@ -3,7 +3,6 @@ "compilerOptions": { "declaration": true, "emitDeclarationOnly": true, - "allowJs": true, "checkJs": true, "outDir": "target_types", "stripInternal": false, diff --git a/packages/kbn-interpreter/tsconfig.json b/packages/kbn-interpreter/tsconfig.json index 3f7db41bf648..3b6472026565 100644 --- a/packages/kbn-interpreter/tsconfig.json +++ b/packages/kbn-interpreter/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "allowJs": true, "declaration": true, "emitDeclarationOnly": true, "outDir": "./target_types", diff --git a/packages/kbn-plugin-discovery/tsconfig.json b/packages/kbn-plugin-discovery/tsconfig.json index 745082de9b59..819cbb943e5f 100644 --- a/packages/kbn-plugin-discovery/tsconfig.json +++ b/packages/kbn-plugin-discovery/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "allowJs": true, "checkJs": true, "outDir": "target_types", "stripInternal": false, diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js index 62104cebf9cb..a0db7db6f001 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js @@ -38,7 +38,12 @@ function allTestsAreSkipped(suite) { return childrenSkipped; } -export function decorateMochaUi(log, lifecycle, context, { rootTags }) { +/** + * @param {import('../lifecycle').Lifecycle} lifecycle + * @param {any} context + * @param {{ rootTags?: string[] }} options + */ +export function decorateMochaUi(lifecycle, context, { rootTags }) { // incremented at the start of each suite, decremented after // so that in each non-suite call we can know if we are within // a suite, or that when a suite is defined it is within a suite diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts index 32f61caf1b3c..f226d37c41ee 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/load_tests.ts @@ -17,7 +17,6 @@ import type { ProviderCollection } from '../providers'; import { loadTracer } from '../load_tracer'; import { decorateSnapshotUi } from '../snapshots/decorate_snapshot_ui'; -// @ts-expect-error not js yet import { decorateMochaUi } from './decorate_mocha_ui'; type TestProvider = (ctx: GenericFtrProviderContext) => void; @@ -48,9 +47,6 @@ export const loadTests = ({ updateBaselines, updateSnapshots, }: Options) => { - const dockerServers = config.get('dockerServers'); - const isDockerGroup = dockerServers && Object.keys(dockerServers).length; - const ctx: GenericFtrProviderContext = { loadTestFile, getService: providers.getService as any, @@ -80,8 +76,7 @@ export const loadTests = ({ function withMocha(debugPath: string, fn: () => void) { // mocha.suite hocus-pocus comes from: https://git.io/vDnXO - const context = decorateMochaUi(log, lifecycle, global, { - isDockerGroup, + const context = decorateMochaUi(lifecycle, global, { rootTags: config.get('rootTags'), }); mocha.suite.emit('pre-require', context, debugPath, mocha); diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts index 10c51517aec9..ae42945b6bfd 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts @@ -19,9 +19,7 @@ import { Config } from '../config'; import { ProviderCollection } from '../providers'; import { EsVersion } from '../es_version'; -// @ts-expect-error not ts yet import { MochaReporterProvider } from './reporter'; -// @ts-expect-error not ts yet import { validateCiGroupTags } from './validate_ci_group_tags'; interface Options { diff --git a/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts b/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts index 336e28bd16fd..ca071f33507b 100644 --- a/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts +++ b/packages/kbn-test/src/jest/configs/get_all_jest_paths.ts @@ -11,7 +11,6 @@ import Path from 'path'; import minimatch from 'minimatch'; import { getRepoFiles } from '@kbn/get-repo-files'; -// @ts-expect-error jest-preset is necessarily a JS file import { testMatch } from '../../../jest-preset'; const UNIT_CONFIG_NAME = 'jest.config.js'; diff --git a/packages/kbn-test/src/kbn/kbn_test_config.ts b/packages/kbn-test/src/kbn/kbn_test_config.ts index ad2af4c2ff81..01a7edbc861d 100644 --- a/packages/kbn-test/src/kbn/kbn_test_config.ts +++ b/packages/kbn-test/src/kbn/kbn_test_config.ts @@ -9,7 +9,7 @@ import url from 'url'; import { kibanaTestUser } from './users'; -interface UrlParts { +export interface UrlParts { protocol?: string; hostname?: string; port?: number; diff --git a/packages/kbn-ui-shared-deps-npm/tsconfig.json b/packages/kbn-ui-shared-deps-npm/tsconfig.json index 78b399657886..376457cce75e 100644 --- a/packages/kbn-ui-shared-deps-npm/tsconfig.json +++ b/packages/kbn-ui-shared-deps-npm/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "allowJs": true, "declaration": true, "emitDeclarationOnly": true, "outDir": "./target_types", diff --git a/packages/kbn-ui-shared-deps-src/tsconfig.json b/packages/kbn-ui-shared-deps-src/tsconfig.json index 78b399657886..376457cce75e 100644 --- a/packages/kbn-ui-shared-deps-src/tsconfig.json +++ b/packages/kbn-ui-shared-deps-src/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "allowJs": true, "declaration": true, "emitDeclarationOnly": true, "outDir": "./target_types", diff --git a/src/cli_keystore/get_keystore.js b/src/cli/keystore/get_keystore.js similarity index 95% rename from src/cli_keystore/get_keystore.js rename to src/cli/keystore/get_keystore.js index 11e957ffe984..d713f422cc68 100644 --- a/src/cli_keystore/get_keystore.js +++ b/src/cli/keystore/get_keystore.js @@ -9,7 +9,7 @@ import { existsSync } from 'fs'; import { join } from 'path'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../logger'; import { getConfigDirectory, getDataPath } from '@kbn/utils'; export function getKeystore() { diff --git a/src/cli_keystore/get_keystore.test.js b/src/cli/keystore/get_keystore.test.js similarity index 96% rename from src/cli_keystore/get_keystore.test.js rename to src/cli/keystore/get_keystore.test.js index 6c7c4397c172..b24164935fe4 100644 --- a/src/cli_keystore/get_keystore.test.js +++ b/src/cli/keystore/get_keystore.test.js @@ -7,7 +7,7 @@ */ import { getKeystore } from './get_keystore'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../logger'; import fs from 'fs'; import sinon from 'sinon'; diff --git a/src/cli/keystore/read_keystore.js b/src/cli/keystore/read_keystore.js index a4f007690a66..96f5d38f65d6 100644 --- a/src/cli/keystore/read_keystore.js +++ b/src/cli/keystore/read_keystore.js @@ -9,7 +9,7 @@ import { set } from '@kbn/safer-lodash-set'; import { Keystore } from '.'; -import { getKeystore } from '../../cli_keystore/get_keystore'; +import { getKeystore } from './get_keystore'; export function readKeystore(keystorePath = getKeystore()) { const keystore = new Keystore(keystorePath); diff --git a/src/cli_plugin/lib/logger.js b/src/cli/logger.js similarity index 85% rename from src/cli_plugin/lib/logger.js rename to src/cli/logger.js index d34b8561cc7a..0379765c6117 100644 --- a/src/cli_plugin/lib/logger.js +++ b/src/cli/logger.js @@ -10,13 +10,20 @@ * Logs messages and errors */ export class Logger { + /** + * @param {{silent?: boolean; quiet?: boolean;}} settings + */ constructor(settings = {}) { this.previousLineEnded = true; this.silent = !!settings.silent; this.quiet = !!settings.quiet; } - log(data, sameLine) { + /** + * @param {string} data + * @param {boolean} sameLine + */ + log(data, sameLine = false) { if (this.silent || this.quiet) return; if (!sameLine && !this.previousLineEnded) { @@ -34,6 +41,9 @@ export class Logger { this.previousLineEnded = !sameLine; } + /** + * @param {string} data + */ error(data) { if (this.silent) return; diff --git a/src/cli_plugin/lib/logger.test.js b/src/cli/logger.test.js similarity index 100% rename from src/cli_plugin/lib/logger.test.js rename to src/cli/logger.test.js diff --git a/src/cli/tsconfig.json b/src/cli/tsconfig.json new file mode 100644 index 000000000000..b3a8ab5220b9 --- /dev/null +++ b/src/cli/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true + }, + "include": [ + "keystore/**/*", + "serve/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../core/tsconfig.json" }, + { "path": "../setup_node_env/tsconfig.json" }, + ] +} diff --git a/src/cli_encryption_keys/generate.js b/src/cli_encryption_keys/generate.js index e3058da157c0..1f1eae3f2818 100644 --- a/src/cli_encryption_keys/generate.js +++ b/src/cli_encryption_keys/generate.js @@ -9,7 +9,7 @@ import { safeDump } from 'js-yaml'; import { isEmpty } from 'lodash'; import { interactive } from './interactive'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; export async function generate(encryptionConfig, command) { const logger = new Logger(); diff --git a/src/cli_encryption_keys/generate.test.js b/src/cli_encryption_keys/generate.test.js index 422c2bf8e204..1db27264a052 100644 --- a/src/cli_encryption_keys/generate.test.js +++ b/src/cli_encryption_keys/generate.test.js @@ -9,7 +9,7 @@ import { EncryptionConfig } from './encryption_config'; import { generate } from './generate'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; describe('encryption key generation', () => { const encryptionConfig = new EncryptionConfig(); diff --git a/src/cli_encryption_keys/interactive.test.js b/src/cli_encryption_keys/interactive.test.js index 79309e3ace64..69cf499ff144 100644 --- a/src/cli_encryption_keys/interactive.test.js +++ b/src/cli_encryption_keys/interactive.test.js @@ -9,7 +9,7 @@ import { EncryptionConfig } from './encryption_config'; import { generate } from './generate'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import * as prompt from '../cli_keystore/utils/prompt'; import fs from 'fs'; import crypto from 'crypto'; diff --git a/src/cli_encryption_keys/tsconfig.json b/src/cli_encryption_keys/tsconfig.json new file mode 100644 index 000000000000..6b6661d24f9c --- /dev/null +++ b/src/cli_encryption_keys/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "*.js", + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + { "path": "../cli_keystore/tsconfig.json" }, + ] +} diff --git a/src/cli_keystore/add.js b/src/cli_keystore/add.js index e584772298fe..96778665ac91 100644 --- a/src/cli_keystore/add.js +++ b/src/cli_keystore/add.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import { confirm, question } from './utils'; // import from path since add.test.js mocks 'fs' required for @kbn/utils import { createPromiseFromStreams, createConcatStream } from '@kbn/utils/target_node/src/streams'; diff --git a/src/cli_keystore/add.test.js b/src/cli_keystore/add.test.js index c9c4f4bf90da..2114690207aa 100644 --- a/src/cli_keystore/add.test.js +++ b/src/cli_keystore/add.test.js @@ -30,7 +30,7 @@ import { PassThrough } from 'stream'; import { Keystore } from '../cli/keystore'; import { add } from './add'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import * as prompt from './utils/prompt'; describe('Kibana keystore', () => { diff --git a/src/cli_keystore/cli_keystore.js b/src/cli_keystore/cli_keystore.js index 9f44e5d56e9d..0db5d0f33337 100644 --- a/src/cli_keystore/cli_keystore.js +++ b/src/cli_keystore/cli_keystore.js @@ -10,13 +10,13 @@ import _ from 'lodash'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import Command from '../cli/command'; +import { getKeystore } from '../cli/keystore/get_keystore'; import { Keystore } from '../cli/keystore'; import { createCli } from './create'; import { listCli } from './list'; import { addCli } from './add'; import { removeCli } from './remove'; -import { getKeystore } from './get_keystore'; const argv = process.argv.slice(); const program = new Command('bin/kibana-keystore'); diff --git a/src/cli_keystore/create.js b/src/cli_keystore/create.js index f229576972e1..7e0c1ee23c82 100644 --- a/src/cli_keystore/create.js +++ b/src/cli_keystore/create.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import { confirm } from './utils'; export async function create(keystore, command, options) { diff --git a/src/cli_keystore/create.test.js b/src/cli_keystore/create.test.js index 0e3328f660fb..2c5dcf6db844 100644 --- a/src/cli_keystore/create.test.js +++ b/src/cli_keystore/create.test.js @@ -29,7 +29,7 @@ import sinon from 'sinon'; import { Keystore } from '../cli/keystore'; import { create } from './create'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; import * as prompt from './utils/prompt'; describe('Kibana keystore', () => { diff --git a/src/cli_keystore/list.js b/src/cli_keystore/list.js index 21d5534ad2d5..5e136b0fe064 100644 --- a/src/cli_keystore/list.js +++ b/src/cli_keystore/list.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; export function list(keystore, command, options = {}) { const logger = new Logger(options); diff --git a/src/cli_keystore/list.test.js b/src/cli_keystore/list.test.js index 01bac0c4454d..43497a4e4c0a 100644 --- a/src/cli_keystore/list.test.js +++ b/src/cli_keystore/list.test.js @@ -27,7 +27,7 @@ jest.mock('fs', () => ({ import sinon from 'sinon'; import { Keystore } from '../cli/keystore'; import { list } from './list'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; describe('Kibana keystore', () => { describe('list', () => { diff --git a/src/cli_keystore/tsconfig.json b/src/cli_keystore/tsconfig.json new file mode 100644 index 000000000000..8cd8e6f3f232 --- /dev/null +++ b/src/cli_keystore/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "keystore/**/*", + "utils/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../setup_node_env/tsconfig.json" }, + { "path": "../cli/tsconfig.json" }, + { "path": "../cli_plugin/tsconfig.json" }, + ] +} diff --git a/src/cli_plugin/install/cleanup.test.js b/src/cli_plugin/install/cleanup.test.js index 4b7ad0763f55..3144594dbd94 100644 --- a/src/cli_plugin/install/cleanup.test.js +++ b/src/cli_plugin/install/cleanup.test.js @@ -11,7 +11,7 @@ import fs from 'fs'; import del from 'del'; import { cleanPrevious, cleanArtifacts } from './cleanup'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; describe('kibana cli', function () { describe('plugin installer', function () { diff --git a/src/cli_plugin/install/download.test.js b/src/cli_plugin/install/download.test.js index a0b5a2e1ad8e..5ebc4ad099fa 100644 --- a/src/cli_plugin/install/download.test.js +++ b/src/cli_plugin/install/download.test.js @@ -15,7 +15,7 @@ import nock from 'nock'; import globby from 'globby'; import del from 'del'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { UnsupportedProtocolError } from '../lib/errors'; import { download, _downloadSingle, _getFilePath, _checkFilePathDeprecation } from './download'; diff --git a/src/cli_plugin/install/index.js b/src/cli_plugin/install/index.js index dbad6bc8ba19..cdf0218de3c9 100644 --- a/src/cli_plugin/install/index.js +++ b/src/cli_plugin/install/index.js @@ -8,7 +8,7 @@ import { getConfigPath, kibanaPackageJson as pkg } from '@kbn/utils'; import { install } from './install'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { parse, parseMilliseconds } from './settings'; import { logWarnings } from '../lib/log_warnings'; diff --git a/src/cli_plugin/install/kibana.test.js b/src/cli_plugin/install/kibana.test.js index 6e044afcc7d0..7218f63a29e3 100644 --- a/src/cli_plugin/install/kibana.test.js +++ b/src/cli_plugin/install/kibana.test.js @@ -13,7 +13,7 @@ import sinon from 'sinon'; import del from 'del'; import { existingInstall, assertVersion } from './kibana'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; jest.spyOn(fs, 'statSync'); diff --git a/src/cli_plugin/install/pack.test.js b/src/cli_plugin/install/pack.test.js index cbb8438770f5..38542a7dad3d 100644 --- a/src/cli_plugin/install/pack.test.js +++ b/src/cli_plugin/install/pack.test.js @@ -13,7 +13,7 @@ import sinon from 'sinon'; import globby from 'globby'; import del from 'del'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { extract, getPackData } from './pack'; import { _downloadSingle } from './download'; diff --git a/src/cli_plugin/install/progress.test.js b/src/cli_plugin/install/progress.test.js index 3eb583ddb7b9..a2642648ad7b 100644 --- a/src/cli_plugin/install/progress.test.js +++ b/src/cli_plugin/install/progress.test.js @@ -9,7 +9,7 @@ import sinon from 'sinon'; import { Progress } from './progress'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; describe('kibana cli', function () { describe('plugin installer', function () { diff --git a/src/cli_plugin/lib/logger.d.ts b/src/cli_plugin/lib/logger.d.ts deleted file mode 100644 index dae325583967..000000000000 --- a/src/cli_plugin/lib/logger.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -interface LoggerOptions { - silent?: boolean; - quiet?: boolean; -} - -export declare class Logger { - constructor(settings?: LoggerOptions); - - log(data: string, sameLine?: boolean): void; - - error(data: string): void; -} diff --git a/src/cli_plugin/list/index.js b/src/cli_plugin/list/index.js index 02d1ed19f844..131582598c3e 100644 --- a/src/cli_plugin/list/index.js +++ b/src/cli_plugin/list/index.js @@ -8,7 +8,7 @@ import { fromRoot } from '@kbn/utils'; import { list } from './list'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { logWarnings } from '../lib/log_warnings'; function processCommand() { diff --git a/src/cli_plugin/remove/index.js b/src/cli_plugin/remove/index.js index 3f571e605028..0f94b9db391e 100644 --- a/src/cli_plugin/remove/index.js +++ b/src/cli_plugin/remove/index.js @@ -8,7 +8,7 @@ import { getConfigPath } from '@kbn/utils'; import { remove } from './remove'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { parse } from './settings'; import { logWarnings } from '../lib/log_warnings'; diff --git a/src/cli_plugin/remove/remove.test.js b/src/cli_plugin/remove/remove.test.js index 29309b7391b0..c975ab6b46be 100644 --- a/src/cli_plugin/remove/remove.test.js +++ b/src/cli_plugin/remove/remove.test.js @@ -13,7 +13,7 @@ import sinon from 'sinon'; import globby from 'globby'; import del from 'del'; -import { Logger } from '../lib/logger'; +import { Logger } from '../../cli/logger'; import { remove } from './remove'; describe('kibana cli', function () { diff --git a/src/cli_plugin/tsconfig.json b/src/cli_plugin/tsconfig.json new file mode 100644 index 000000000000..611a8c05d8a4 --- /dev/null +++ b/src/cli_plugin/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "install/**/*", + "lib/**/*", + "list/**/*", + "remove/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + ] +} diff --git a/src/cli_setup/cli_setup.ts b/src/cli_setup/cli_setup.ts index 241c0dc13157..b13e94551db5 100644 --- a/src/cli_setup/cli_setup.ts +++ b/src/cli_setup/cli_setup.ts @@ -24,7 +24,7 @@ import { kibanaConfigWriter, elasticsearch, } from './utils'; -import { Logger } from '../cli_plugin/lib/logger'; +import { Logger } from '../cli/logger'; const program = new Command('bin/kibana-setup'); diff --git a/src/cli_setup/tsconfig.json b/src/cli_setup/tsconfig.json new file mode 100644 index 000000000000..c59d1c32ee82 --- /dev/null +++ b/src/cli_setup/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "*.js", + "*.ts" + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + { "path": "../plugins/interactive_setup/tsconfig.json" }, + ] +} diff --git a/src/cli_verification_code/tsconfig.json b/src/cli_verification_code/tsconfig.json new file mode 100644 index 000000000000..ba74b96a36b6 --- /dev/null +++ b/src/cli_verification_code/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "*.js", + ], + "kbn_references": [ + { "path": "../cli/tsconfig.json" }, + ] +} diff --git a/src/dev/file.ts b/src/dev/file.ts index 16d64d8c0c21..f1560956aef5 100644 --- a/src/dev/file.ts +++ b/src/dev/file.ts @@ -9,7 +9,7 @@ import { dirname, extname, join, relative, resolve, sep, basename } from 'path'; export class File { - private path: string; + public readonly path: string; private relativePath: string; private ext: string; diff --git a/src/dev/tsconfig.json b/src/dev/tsconfig.json new file mode 100644 index 000000000000..5976c86154da --- /dev/null +++ b/src/dev/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "**/*.js", + "**/*.ts", + ], + "exclude": [ + "target/types/**/*" + ], + "kbn_references": [ + { "path": "../core/tsconfig.json" }, + { "path": "../../tsconfig.json" }, + { "path": "../../x-pack/plugins/screenshotting/tsconfig.json" }, + ] +} diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index e346a1de449c..7afb1e4649cb 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -31,7 +31,7 @@ export const PROJECTS = [ createProject('test/tsconfig.json', { name: 'kibana/test' }), createProject('x-pack/test/tsconfig.json', { name: 'x-pack/test' }), createProject('x-pack/performance/tsconfig.json', { name: 'x-pack/performance' }), - createProject('src/core/tsconfig.json'), + ...findProjects(['src/*/tsconfig.json']), createProject('.buildkite/tsconfig.json', { // this directory has additionally dependencies which scripts/type_check can't guarantee // are present or up-to-date, and users likely won't know how to manage either, so the diff --git a/src/dev/typescript/run_check_ts_projects_cli.ts b/src/dev/typescript/run_check_ts_projects_cli.ts index 1f5284f11c8c..9156c52a23d0 100644 --- a/src/dev/typescript/run_check_ts_projects_cli.ts +++ b/src/dev/typescript/run_check_ts_projects_cli.ts @@ -6,59 +6,105 @@ * Side Public License, v 1. */ -import { resolve, relative } from 'path'; - -import execa from 'execa'; +import Path from 'path'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { asyncMapWithLimit } from '@kbn/std'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { getRepoFiles } from '@kbn/get-repo-files'; +import globby from 'globby'; import { File } from '../file'; import { PROJECTS } from './projects'; +import type { Project } from './project'; + +class Stats { + counts = { + files: new Map(), + ignored: new Map(), + gitMatched: new Map(), + }; + + incr(proj: Project, metric: 'files' | 'ignored' | 'gitMatched', delta = 1) { + const cur = this.counts[metric].get(proj); + this.counts[metric].set(proj, (cur ?? 0) + delta); + } +} export async function runCheckTsProjectsCli() { run( async ({ log }) => { - const { stdout: files } = await execa('git', ['ls-tree', '--name-only', '-r', 'HEAD'], { - cwd: REPO_ROOT, + const stats = new Stats(); + let failed = false; + + const pathsAndProjects = await asyncMapWithLimit(PROJECTS, 5, async (proj) => { + const paths = await globby(proj.getIncludePatterns(), { + ignore: proj.getExcludePatterns(), + cwd: proj.directory, + onlyFiles: true, + absolute: true, + }); + stats.incr(proj, 'files', paths.length); + return { + proj, + paths, + }; }); - const isNotInTsProject: File[] = []; - const isInMultipleTsProjects: string[] = []; + const isInMultipleTsProjects = new Map>(); + const pathsToProject = new Map(); + for (const { proj, paths } of pathsAndProjects) { + for (const path of paths) { + if (!pathsToProject.has(path)) { + pathsToProject.set(path, proj); + continue; + } - for (const lineRaw of files.split('\n')) { - const line = lineRaw.trim(); + if (path.endsWith('.d.ts')) { + stats.incr(proj, 'ignored'); + continue; + } - if (!line) { - continue; + isInMultipleTsProjects.set( + path, + new Set([...(isInMultipleTsProjects.get(path) ?? []), proj]) + ); } + } + + if (isInMultipleTsProjects.size) { + failed = true; + const details = Array.from(isInMultipleTsProjects) + .map( + ([path, projects]) => + ` - ${Path.relative(process.cwd(), path)}:\n${Array.from(projects) + .map((p) => ` - ${Path.relative(process.cwd(), p.tsConfigPath)}`) + .join('\n')}` + ) + .join('\n'); + + log.error( + `The following files belong to multiple tsconfig.json files listed in src/dev/typescript/projects.ts\n${details}` + ); + } - const file = new File(resolve(REPO_ROOT, line)); + const isNotInTsProject: File[] = []; + for (const { abs } of await getRepoFiles()) { + const file = new File(abs); if (!file.isTypescript() || file.isFixture()) { continue; } - log.verbose('Checking %s', file.getAbsolutePath()); - - const projects = PROJECTS.filter((p) => p.isAbsolutePathSelected(file.getAbsolutePath())); - if (projects.length === 0) { + const proj = pathsToProject.get(file.getAbsolutePath()); + if (proj === undefined) { isNotInTsProject.push(file); + } else { + stats.incr(proj, 'gitMatched'); } - if (projects.length > 1 && !file.isTypescriptAmbient()) { - isInMultipleTsProjects.push( - ` - ${file.getRelativePath()}:\n${projects - .map((p) => ` - ${relative(process.cwd(), p.tsConfigPath)}`) - .join('\n')}` - ); - } - } - - if (!isNotInTsProject.length && !isInMultipleTsProjects.length) { - log.success('All ts files belong to a single ts project'); - return; } if (isNotInTsProject.length) { + failed = true; log.error( `The following files do not belong to a tsconfig.json file, or that tsconfig.json file is not listed in src/dev/typescript/projects.ts\n${isNotInTsProject .map((file) => ` - ${file.getRelativePath()}`) @@ -66,14 +112,20 @@ export async function runCheckTsProjectsCli() { ); } - if (isInMultipleTsProjects.length) { - const details = isInMultipleTsProjects.join('\n'); - log.error( - `The following files belong to multiple tsconfig.json files listed in src/dev/typescript/projects.ts\n${details}` - ); + for (const [metric, counts] of Object.entries(stats.counts)) { + log.verbose('metric:', metric); + for (const [proj, count] of Array.from(counts).sort((a, b) => + a[0].name.localeCompare(b[0].name) + )) { + log.verbose(' ', proj.name, count); + } } - process.exit(1); + if (failed) { + throw createFailError('see above errors'); + } else { + log.success('All ts files belong to a single ts project'); + } }, { description: diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts index dd41be239e9f..65704cd82574 100644 --- a/src/dev/typescript/run_type_check_cli.ts +++ b/src/dev/typescript/run_type_check_cli.ts @@ -144,6 +144,16 @@ function createTypeCheckConfigs(projects: Project[], bazelPackages: BazelPackage export async function runTypeCheckCli() { run( async ({ log, flagsReader, procRunner }) => { + if (flagsReader.boolean('clean-cache')) { + await asyncForEachWithLimit(PROJECTS, 10, async (proj) => { + await Fsp.rm(Path.resolve(proj.directory, 'target/types'), { + force: true, + recursive: true, + }); + }); + log.warning('Deleted all typescript caches'); + } + await runBazel(['build', '//packages:build_types', '--show_result=1'], { cwd: REPO_ROOT, logPrefix: '\x1b[94m[bazel]\x1b[39m', @@ -234,13 +244,14 @@ export async function runTypeCheckCli() { `, flags: { string: ['project'], - boolean: ['cleanup'], + boolean: ['clean-cache', 'cleanup'], default: { cleanup: true, }, help: ` --project [path] Path to a tsconfig.json file determines the project to check --help Show this message + --clean-cache Delete any existing TypeScript caches before running type check --no-cleanup Pass to avoid deleting the temporary tsconfig files written to disk `, }, diff --git a/src/fixtures/tsconfig.json b/src/fixtures/tsconfig.json new file mode 100644 index 000000000000..bd36efa96533 --- /dev/null +++ b/src/fixtures/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "telemetry_collectors/**/*", + ], + "kbn_references": [ + { "path": "../core/tsconfig.json" }, + { "path": "../plugins/usage_collection/tsconfig.json" }, + ] +} diff --git a/src/plugins/console/tsconfig.json b/src/plugins/console/tsconfig.json index 25abeb2ca24d..cc44f6119f2d 100644 --- a/src/plugins/console/tsconfig.json +++ b/src/plugins/console/tsconfig.json @@ -4,6 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index 9769a1dd4dec..96a2757909c1 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -5,7 +5,7 @@ "emitDeclarationOnly": true, "declaration": true, }, - "include": ["*.ts", ".storybook/**/*", "common/**/*", "public/**/*", "server/**/*"], + "include": ["*.ts", ".storybook/**/*.ts", "common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ { "path": "../../core/tsconfig.json" }, { "path": "../inspector/tsconfig.json" }, diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index 041cc6fc277c..4239fdfe2ea8 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -4,6 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": ["common/**/*", "public/**/*", "server/**/*", "../../../typings/**/*", ".storybook/**/*"], "kbn_references": [ diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.tsx index 9b93d3149c34..9ea508a9b871 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.tsx @@ -15,7 +15,6 @@ import { ApplicationStart } from '@kbn/core/public'; import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; import { FeatureCatalogueEntry } from '../../../services'; import { createAppNavigationHandler } from '../app_navigation_handler'; -// @ts-expect-error untyped component import { Synopsis } from '../synopsis'; import { getServices } from '../../kibana_services'; diff --git a/src/plugins/kibana_overview/public/components/add_data/add_data.tsx b/src/plugins/kibana_overview/public/components/add_data/add_data.tsx index 172fd7864a0b..6720f87c3117 100644 --- a/src/plugins/kibana_overview/public/components/add_data/add_data.tsx +++ b/src/plugins/kibana_overview/public/components/add_data/add_data.tsx @@ -13,7 +13,6 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from '@kbn/core/public'; import { RedirectAppLinks, useKibana } from '@kbn/kibana-react-plugin/public'; import { FeatureCatalogueEntry } from '@kbn/home-plugin/public'; -// @ts-expect-error untyped component import { Synopsis } from '../synopsis'; import { METRIC_TYPE, trackUiMetric } from '../../lib/ui_metric'; diff --git a/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx b/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx index 376af562221c..9d3d6476db9c 100644 --- a/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx +++ b/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx @@ -13,7 +13,6 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from '@kbn/core/public'; import { RedirectAppLinks, useKibana } from '@kbn/kibana-react-plugin/public'; import { FeatureCatalogueEntry } from '@kbn/home-plugin/public'; -// @ts-expect-error untyped component import { Synopsis } from '../synopsis'; import { METRIC_TYPE, trackUiMetric } from '../../lib/ui_metric'; diff --git a/src/plugins/vis_types/timelion/tsconfig.json b/src/plugins/vis_types/timelion/tsconfig.json index ce85b8190205..5a660d5d4d78 100644 --- a/src/plugins/vis_types/timelion/tsconfig.json +++ b/src/plugins/vis_types/timelion/tsconfig.json @@ -9,6 +9,7 @@ "common/**/*", "public/**/*", "server/**/*", + "server/timelion.json", "*.ts" ], "kbn_references": [ diff --git a/src/plugins/vis_types/timeseries/tsconfig.json b/src/plugins/vis_types/timeseries/tsconfig.json index 1d5497f4e06b..245443d4a37f 100644 --- a/src/plugins/vis_types/timeseries/tsconfig.json +++ b/src/plugins/vis_types/timeseries/tsconfig.json @@ -4,6 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", diff --git a/src/plugins/vis_types/vega/tsconfig.json b/src/plugins/vis_types/vega/tsconfig.json index 49e8216e3b39..b942db9888aa 100644 --- a/src/plugins/vis_types/vega/tsconfig.json +++ b/src/plugins/vis_types/vega/tsconfig.json @@ -11,7 +11,9 @@ "public/**/*", "*.ts", // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "public/test_utils/vega_map_test.json" + "public/test_utils/vega_map_test.json", + "public/test_utils/vegalite_graph.json", + "public/test_utils/vega_graph.json", ], "kbn_references": [ { "path": "../../../core/tsconfig.json" }, diff --git a/src/plugins/vis_types/vislib/public/vis_controller.tsx b/src/plugins/vis_types/vislib/public/vis_controller.tsx index 40a518a8c0c9..50c72a46e818 100644 --- a/src/plugins/vis_types/vislib/public/vis_controller.tsx +++ b/src/plugins/vis_types/vislib/public/vis_controller.tsx @@ -79,7 +79,6 @@ export const createVislibVisController = ( return; } - // @ts-expect-error const { Vis: Vislib } = await import('./vislib/vis'); const { uiState, event: fireEvent } = handlers; diff --git a/src/plugins/vis_types/vislib/tsconfig.json b/src/plugins/vis_types/vislib/tsconfig.json index ef2876e91c5f..0ff4d8d2900e 100644 --- a/src/plugins/vis_types/vislib/tsconfig.json +++ b/src/plugins/vis_types/vislib/tsconfig.json @@ -8,7 +8,10 @@ "include": [ "common/**/*", "public/**/*", - "server/**/*" + "server/**/*", + "public/fixtures/dispatch_heatmap_d3.json", + "public/fixtures/dispatch_heatmap_config.json", + "public/fixtures/dispatch_heatmap_data_point.json", ], "kbn_references": [ { "path": "../../../core/tsconfig.json" }, diff --git a/src/setup_node_env/tsconfig.json b/src/setup_node_env/tsconfig.json new file mode 100644 index 000000000000..c7c05f89d04a --- /dev/null +++ b/src/setup_node_env/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + }, + "include": [ + "harden/**/*", + "root/**/*", + "*.js", + ], + "kbn_references": [ + { "path": "../../tsconfig.json" }, + ] +} diff --git a/test/accessibility/services/a11y/a11y.ts b/test/accessibility/services/a11y/a11y.ts index dd0d6c7f682e..1215af1d106d 100644 --- a/test/accessibility/services/a11y/a11y.ts +++ b/test/accessibility/services/a11y/a11y.ts @@ -12,7 +12,6 @@ import { AXE_CONFIG, AXE_OPTIONS } from '@kbn/axe-config'; import { FtrService } from '../../ftr_provider_context'; import { AxeReport, printResult } from './axe_report'; -// @ts-ignore JS that is run in browser as is import { analyzeWithAxe, analyzeWithAxeWithClient } from './analyze_with_axe'; interface AxeContext { diff --git a/test/functional/services/common/browser.ts b/test/functional/services/common/browser.ts index aaebdcf6975a..6046aee567da 100644 --- a/test/functional/services/common/browser.ts +++ b/test/functional/services/common/browser.ts @@ -552,7 +552,14 @@ class BrowserService extends FtrService { a2: A2, a3: A3 ): Promise; - public async executeAsync(fn: (...args: any[]) => void, ...args: any[]): Promise { + public async executeAsync( + fn: string, + ...args: any[] + ): Promise; + public async executeAsync( + fn: string | ((...args: any[]) => void), + ...args: any[] + ): Promise { return await this.driver.executeAsyncScript( fn, ...cloneDeepWith(args, (arg) => { diff --git a/test/tsconfig.json b/test/tsconfig.json index 84c5b5eb5ce0..1b5cf6f7a0eb 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -29,6 +29,7 @@ ], "kbn_references": [ { "path": "../src/core/tsconfig.json" }, + { "path": "../src/setup_node_env/tsconfig.json" }, { "path": "../src/plugins/telemetry_management_section/tsconfig.json" }, { "path": "../src/plugins/advanced_settings/tsconfig.json" }, { "path": "../src/plugins/management/tsconfig.json" }, diff --git a/tsconfig.base.json b/tsconfig.base.json index 1b5fba04354e..ef94f9bef56c 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1222,6 +1222,11 @@ // We have to enable this option explicitly since `esModuleInterop` doesn't enable it automatically when ES2015 or // ESNext module format is used. "allowSyntheticDefaultImports": true, + // Several packages use .js files to provide types without requiring transpilation. In order for TS to support this + // regardless of where the pacakge is imported, we need to enable `allowJs` globally. In specific packages we might + // want to disable parsing of JS files, in which case `allowJs` should be set to `false` locally. These packages will + // not be able to import packages which include JS code, or import packages which depend on JS code. + "allowJs": true, // Emits __importStar and __importDefault helpers for runtime babel ecosystem compatibility. "esModuleInterop": true, // Resolve modules in the same way as Node.js. Aka make `require` works the diff --git a/tsconfig.json b/tsconfig.json index 9a00fdfdfc1f..a03576565d12 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,29 +1,13 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "allowJs": true, "outDir": "target/root_types" }, "include": [ "kibana.d.ts", - "typings/**/*", - "package.json", - "src/cli/**/*", - "src/cli_setup/**/*", - "src/cli_plugin/**/*", - "src/cli_keystore/**/*", - "src/setup_node_env/**/*", - "src/dev/**/*", - "src/fixtures/**/*", - - "x-pack/tasks/**/*", ], - "exclude": [], "kbn_references": [ { "path": "./src/core/tsconfig.json" }, - { "path": "./src/plugins/usage_collection/tsconfig.json" }, - { "path": "./src/plugins/interactive_setup/tsconfig.json" }, - { "path": "./x-pack/plugins/reporting/tsconfig.json" }, ] } diff --git a/x-pack/plugins/apm/ftr_e2e/tsconfig.json b/x-pack/plugins/apm/ftr_e2e/tsconfig.json index 9e423a05eb44..6a8ba7e1495a 100644 --- a/x-pack/plugins/apm/ftr_e2e/tsconfig.json +++ b/x-pack/plugins/apm/ftr_e2e/tsconfig.json @@ -9,7 +9,6 @@ ], "compilerOptions": { "target": "es2015", - "allowJs": true, "outDir": "target/types", "types": [ "cypress", diff --git a/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx b/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx index e8903fcad92b..c8e9de32c83f 100644 --- a/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx @@ -19,7 +19,6 @@ import { useApmParams } from '../../../hooks/use_apm_params'; import { useApmDataView } from '../../../hooks/use_apm_data_view'; import { fromQuery, toQuery } from '../links/url_helpers'; import { getBoolFilter } from './get_bool_filter'; -// @ts-expect-error import { Typeahead } from './typeahead'; import { useProcessorEvent } from './use_processor_event'; diff --git a/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts b/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts index 081d7cacef80..ee5a05f64ca4 100644 --- a/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts +++ b/x-pack/plugins/apm/scripts/infer_route_return_types/index.ts @@ -21,7 +21,6 @@ import { import Path from 'path'; import { execSync } from 'child_process'; import { argv } from 'yargs'; -// @ts-expect-error import { optimizeTsConfig } from '../optimize_tsconfig/optimize'; // This script adds explicit return types to route handlers, diff --git a/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts b/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts index 863929a2719a..a2946137cf91 100644 --- a/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts +++ b/x-pack/plugins/apm/server/lib/helpers/get_bucket_size/index.ts @@ -6,7 +6,6 @@ */ import moment from 'moment'; -// @ts-expect-error import { calculateAuto } from './calculate_auto'; export function getBucketSize({ @@ -22,7 +21,7 @@ export function getBucketSize({ }) { const duration = moment.duration(end - start, 'ms'); const bucketSize = Math.max( - calculateAuto.near(numBuckets, duration).asSeconds(), + calculateAuto.near(numBuckets, duration)?.asSeconds() ?? 0, minBucketSize || 1 ); diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index c382c84c4f4a..17ee8b7bcadd 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -12,9 +12,10 @@ "scripts/**/*", "server/**/*", "typings/**/*", + "jest.config.js", // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 "public/**/*.json", - "server/**/*.json" + "server/**/*.json", ], "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 22ac8de781cf..32e1e6e6d584 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -6,7 +6,12 @@ "declaration": true, // the plugin contains some heavy json files - "resolveJsonModule": false + "resolveJsonModule": false, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "../../../typings/**/*", @@ -22,6 +27,7 @@ "types/**/*" ], "kbn_references": [ + { "path": "../../../src/setup_node_env/tsconfig.json" }, { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/bfetch/tsconfig.json" }, { "path": "../../../src/plugins/charts/tsconfig.json" }, diff --git a/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json b/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json index b2f06a09a6e0..392e17e62f1d 100644 --- a/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json +++ b/x-pack/plugins/cloud_integrations/cloud_gain_sight/tsconfig.json @@ -12,6 +12,9 @@ "server/**/*", "../../../typings/**/*" ], + "exclude": [ + "server/assets/*.js", + ], "kbn_references": [ { "path": "../../../../src/core/tsconfig.json" }, { "path": "../../cloud/tsconfig.json" }, diff --git a/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx b/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx index afc95cc83076..14c47eea7035 100644 --- a/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx +++ b/x-pack/plugins/file_upload/public/importer/geo/abstract_geo_file_importer.tsx @@ -14,7 +14,6 @@ import { CreateDocsResponse, ImportResults } from '../types'; import { callImportRoute, Importer, IMPORT_RETRIES, MAX_CHUNK_CHAR_COUNT } from '../importer'; import { MB } from '../../../common/constants'; import type { ImportDoc, ImportFailure, ImportResponse } from '../../../common/types'; -// @ts-expect-error import { geoJsonCleanAndValidate } from './geojson_clean_and_validate'; import { createChunks } from './create_chunks'; diff --git a/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts b/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts index c3de1ac2e949..20b73a9ef2ac 100644 --- a/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts +++ b/x-pack/plugins/file_upload/public/importer/geo/geojson_importer/geojson_importer.ts @@ -7,7 +7,6 @@ import { Feature } from 'geojson'; import { i18n } from '@kbn/i18n'; -// @ts-expect-error import { JSONLoader, loadInBatches } from '../loaders'; import type { ImportFailure } from '../../../../common/types'; import { AbstractGeoFileImporter } from '../abstract_geo_file_importer'; @@ -36,12 +35,13 @@ export class GeoJsonImporter extends AbstractGeoFileImporter { }; if (this._iterator === undefined) { - this._iterator = await loadInBatches(this._getFile(), JSONLoader, { + // TODO: loadInBatches returns an AsyncIterable, not an AsyncInterator, which doesn't necessarily have a .next() function + this._iterator = (await loadInBatches(this._getFile(), JSONLoader, { json: { jsonpaths: ['$.features'], _rootObjectBatches: true, }, - }); + })) as any; } if (!this._getIsActive() || !this._iterator) { diff --git a/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx b/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx index 86877a7a4ff6..7fb30577ee00 100644 --- a/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx +++ b/x-pack/plugins/file_upload/public/importer/geo/shapefile_importer/shapefile_importer.tsx @@ -7,7 +7,6 @@ import React from 'react'; import { Feature } from 'geojson'; -// @ts-expect-error import { BrowserFileSystem, DBFLoader, loadInBatches, ShapefileLoader } from '../loaders'; import type { ImportFailure } from '../../../../common/types'; import { ShapefileEditor } from './shapefile_editor'; diff --git a/x-pack/plugins/fleet/cypress/tsconfig.json b/x-pack/plugins/fleet/cypress/tsconfig.json index c775711e6047..aba041b4e17b 100644 --- a/x-pack/plugins/fleet/cypress/tsconfig.json +++ b/x-pack/plugins/fleet/cypress/tsconfig.json @@ -8,7 +8,6 @@ "target/**/*" ], "compilerOptions": { - "allowJs": true, "outDir": "target/types", "types": [ "cypress", diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index 62cbbe3a4ef0..cb43a425b17c 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "allowJs": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, @@ -21,7 +20,7 @@ ], "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, // add references to other TypeScript projects the plugin depends on // requiredPlugins from ./kibana.json diff --git a/x-pack/plugins/graph/tsconfig.json b/x-pack/plugins/graph/tsconfig.json index 7ecc6018f8f6..8a17949e7981 100644 --- a/x-pack/plugins/graph/tsconfig.json +++ b/x-pack/plugins/graph/tsconfig.json @@ -5,6 +5,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "*.ts", diff --git a/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js b/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js index cef30efde47d..6625611172b0 100644 --- a/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js +++ b/x-pack/plugins/license_management/__jest__/api_responses/upload_license.js @@ -5,12 +5,14 @@ * 2.0. */ +/** @type {[number, Record, string]} */ export const UPLOAD_LICENSE_EXPIRED = [ 200, { 'Content-Type': 'application/json' }, '{"acknowledged": "true", "license_status": "expired"}', ]; +/** @type {[number, Record, string]} */ export const UPLOAD_LICENSE_REQUIRES_ACK = [ 200, { 'Content-Type': 'application/json' }, @@ -25,18 +27,21 @@ export const UPLOAD_LICENSE_REQUIRES_ACK = [ }`, ]; +/** @type {[number, Record, string]} */ export const UPLOAD_LICENSE_SUCCESS = [ 200, { 'Content-Type': 'application/json' }, '{"acknowledged": "true", "license_status": "valid"}', ]; +/** @type {[number, Record, string]} */ export const UPLOAD_LICENSE_INVALID = [ 200, { 'Content-Type': 'application/json' }, '{"acknowledged": "true", "license_status": "invalid"}', ]; +/** @type {[number, Record, string]} */ export const UPLOAD_LICENSE_TLS_NOT_ENABLED = [ 200, { 'Content-Type': 'application/json' }, diff --git a/x-pack/plugins/license_management/__jest__/upload_license.test.tsx b/x-pack/plugins/license_management/__jest__/upload_license.test.tsx index c24c2bf6a9c6..d5bc51df521c 100644 --- a/x-pack/plugins/license_management/__jest__/upload_license.test.tsx +++ b/x-pack/plugins/license_management/__jest__/upload_license.test.tsx @@ -11,13 +11,10 @@ import { LocationDescriptorObject } from 'history'; import { httpServiceMock, scopedHistoryMock } from '@kbn/core/public/mocks'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -// @ts-ignore import { uploadLicense } from '../public/application/store/actions/upload_license'; -// @ts-ignore import { licenseManagementStore } from '../public/application/store/store'; -// @ts-ignore import { UploadLicense } from '../public/application/sections/upload_license'; import { AppContextProvider } from '../public/application/app_context'; @@ -27,7 +24,6 @@ import { UPLOAD_LICENSE_SUCCESS, UPLOAD_LICENSE_TLS_NOT_ENABLED, UPLOAD_LICENSE_INVALID, - // @ts-ignore } from './api_responses'; let store: any = null; diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx b/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx index ff01d2ee7739..dfc33affa3b3 100644 --- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx +++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx @@ -28,7 +28,7 @@ import { EXTERNAL_LINKS } from '../../../../../common/constants'; import { AppContextConsumer, AppDependencies } from '../../../app_context'; import { TelemetryPluginStart, shouldShowTelemetryOptIn } from '../../../lib/telemetry'; -interface Props { +export interface Props { loadTrialStatus: () => void; startLicenseTrial: () => void; telemetry?: TelemetryPluginStart; diff --git a/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx b/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx index ef75f0e758a3..b94774da1892 100644 --- a/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx +++ b/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx @@ -13,11 +13,8 @@ import { i18n } from '@kbn/i18n'; import { ToastsStart } from '@kbn/core/public'; import { ManagementAppMountParams } from '@kbn/management-plugin/public'; -// @ts-expect-error import { PipelineEditor } from './components/pipeline_editor'; -// @ts-expect-error import { Pipeline } from '../models/pipeline'; -// @ts-expect-error import * as Breadcrumbs from './breadcrumbs'; const usePipeline = ( diff --git a/x-pack/plugins/logstash/public/models/pipeline/pipeline.js b/x-pack/plugins/logstash/public/models/pipeline/pipeline.js index 92fba509df86..0c7367d7a014 100755 --- a/x-pack/plugins/logstash/public/models/pipeline/pipeline.js +++ b/x-pack/plugins/logstash/public/models/pipeline/pipeline.js @@ -24,13 +24,9 @@ const settingsDefaults = { export class Pipeline { /** * Represents the pipeline for the client side editing/creating workflow - * @param {object} props An object used to instantiate a pipeline instance - * @param {string} props.id Named Id of the pipeline - * @param {string} props.description Optional description for the pipeline - * @param {object} props.pipeline The actual LS configuration as a string blob - * @param {string} props.username User who created or updated the pipeline + * @param {import('./props').Props} props} */ - constructor(props) { + constructor(props = undefined) { this.id = get(props, 'id'); this.description = get(props, 'description', ''); this.pipeline = get(props, 'pipeline', emptyPipeline); diff --git a/x-pack/plugins/logstash/public/models/pipeline/props.ts b/x-pack/plugins/logstash/public/models/pipeline/props.ts new file mode 100644 index 000000000000..3b590e50c8a3 --- /dev/null +++ b/x-pack/plugins/logstash/public/models/pipeline/props.ts @@ -0,0 +1,28 @@ +/* + * Copyright 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. + */ + +/** + * An object used to instantiate a pipeline instance + */ +export interface Props { + /** + * Named Id of the pipeline + */ + id: string; + /** + * Optional description for the pipeline + */ + description: string; + /** + * The actual LS configuration as a string blob + */ + pipeline: string; + /** + * User who created or updated the pipeline + */ + username: string; +} diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index fc8e57849719..f38cce537f26 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -4,6 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index 21897ae7ba4f..ff4bd0825cea 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -4,6 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index 7c63f49c6565..815e1762eba9 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -4,6 +4,11 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "common/**/*", diff --git a/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts b/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts index dd7b3ee109d5..495fc766cd62 100644 --- a/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts +++ b/x-pack/plugins/observability/public/utils/get_bucket_size/index.ts @@ -20,7 +20,7 @@ export function getBucketSize({ minInterval: string; }) { const duration = moment.duration(end - start, 'ms'); - const bucketSize = Math.max(calculateAuto.near(100, duration).asSeconds(), 1); + const bucketSize = Math.max(calculateAuto.near(100, duration)?.asSeconds() ?? 0, 1); const intervalString = `${bucketSize}s`; const matches = minInterval && minInterval.match(/^([\d]+)([shmdwMy]|ms)$/); const minBucketSize = matches ? Number(matches[1]) * unitToSeconds(matches[2]) : 0; diff --git a/x-pack/plugins/osquery/cypress/tsconfig.json b/x-pack/plugins/osquery/cypress/tsconfig.json index 1b8f31fd9b56..548ac5dc3eb1 100644 --- a/x-pack/plugins/osquery/cypress/tsconfig.json +++ b/x-pack/plugins/osquery/cypress/tsconfig.json @@ -8,7 +8,6 @@ "target/**/*" ], "compilerOptions": { - "allowJs": true, "outDir": "target/types", "types": [ "cypress", diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index 108eb636b9f5..9d1944afbafa 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -20,6 +20,7 @@ ], "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, // add references to other TypeScript projects the plugin depends on // requiredPlugins from ./kibana.json diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js index 3b2588b6d020..1a10c9e00b64 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js @@ -24,7 +24,7 @@ import { import { ConfirmDeleteModal } from './confirm_delete_modal'; import { flattenPanelTree } from '../../../services'; -class JobActionMenuUi extends Component { +export class JobActionMenuUi extends Component { static propTypes = { startJobs: PropTypes.func.isRequired, stopJobs: PropTypes.func.isRequired, diff --git a/x-pack/plugins/screenshotting/tsconfig.json b/x-pack/plugins/screenshotting/tsconfig.json index 6b9d6ffffb67..3d53836a4324 100644 --- a/x-pack/plugins/screenshotting/tsconfig.json +++ b/x-pack/plugins/screenshotting/tsconfig.json @@ -13,6 +13,7 @@ ], "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, { "path": "../../../src/plugins/expressions/tsconfig.json" }, { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, { "path": "../cloud/tsconfig.json" }, diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 9dd16bd332c1..65e831a8bfc1 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -17,6 +17,7 @@ ], "kbn_references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/setup_node_env/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, { "path": "../../../src/plugins/files/tsconfig.json"}, diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 664048f980dc..402b915247fc 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -5,7 +5,12 @@ "emitDeclarationOnly": true, "declaration": true, "declarationMap": true, - "types": ["node"] + "types": ["node"], + // there is still a decent amount of JS in this plugin and we are taking + // advantage of the fact that TS doesn't know the types of that code and + // gives us `any`. Once that code is converted to .ts we can remove this + // and allow TS to infer types from any JS file imported. + "allowJs": false }, "include": [ "**/*", From bbcdf5038619f995b0c271b0ee866581e080e622 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 1 Nov 2022 18:43:44 -0400 Subject: [PATCH 77/87] skip failing test suite (#131192) --- test/server_integration/http/ssl_redirect/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/server_integration/http/ssl_redirect/index.js b/test/server_integration/http/ssl_redirect/index.js index 7e0f78e8890c..07ae0eb4bb56 100644 --- a/test/server_integration/http/ssl_redirect/index.js +++ b/test/server_integration/http/ssl_redirect/index.js @@ -9,6 +9,7 @@ export default function ({ getService }) { const supertest = getService('supertest'); + // Failing: See https://github.com/elastic/kibana/issues/131192 // Failing: See https://github.com/elastic/kibana/issues/131192 describe.skip('kibana server with ssl', () => { it('redirects http requests at redirect port to https', async () => { From 10902ed9704f6394c4931f4b1bcebe42eabf0894 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 2 Nov 2022 02:07:10 +0000 Subject: [PATCH 78/87] chore(NA): update versions after v8.5.1 bump (#144330) * chore(NA): update versions after v8.5.1 bump * chore(NA): remove 8.4 branch from versions Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- versions.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/versions.json b/versions.json index 3265499716cd..36212abba6de 100644 --- a/versions.json +++ b/versions.json @@ -8,17 +8,11 @@ "currentMinor": true }, { - "version": "8.5.0", + "version": "8.5.1", "branch": "8.5", "currentMajor": true, "previousMinor": true }, - { - "version": "8.4.4", - "branch": "8.4", - "currentMajor": true, - "previousMinor": true - }, { "version": "7.17.8", "branch": "7.17", From cfb80060eed610dafd61495e4e311ff48a04b6a9 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 2 Nov 2022 00:45:07 -0400 Subject: [PATCH 79/87] [api-docs] Daily api_docs build (#144378) --- api_docs/actions.mdx | 2 +- api_docs/advanced_settings.mdx | 2 +- api_docs/aiops.mdx | 2 +- api_docs/alerting.mdx | 2 +- api_docs/apm.devdocs.json | 8 +- api_docs/apm.mdx | 2 +- api_docs/banners.mdx | 2 +- api_docs/bfetch.mdx | 2 +- api_docs/canvas.mdx | 2 +- api_docs/cases.mdx | 2 +- api_docs/charts.mdx | 2 +- api_docs/cloud.mdx | 2 +- api_docs/cloud_chat.mdx | 2 +- api_docs/cloud_experiments.mdx | 2 +- api_docs/cloud_security_posture.mdx | 2 +- api_docs/console.mdx | 2 +- api_docs/controls.mdx | 2 +- api_docs/core.devdocs.json | 20 + api_docs/core.mdx | 4 +- api_docs/custom_integrations.mdx | 2 +- api_docs/dashboard.mdx | 2 +- api_docs/dashboard_enhanced.mdx | 2 +- api_docs/data.devdocs.json | 155 ++++- api_docs/data.mdx | 4 +- api_docs/data_query.mdx | 4 +- api_docs/data_search.devdocs.json | 19 + api_docs/data_search.mdx | 4 +- api_docs/data_view_editor.mdx | 2 +- api_docs/data_view_field_editor.mdx | 2 +- api_docs/data_view_management.mdx | 2 +- api_docs/data_views.devdocs.json | 32 +- api_docs/data_views.mdx | 4 +- api_docs/data_visualizer.mdx | 2 +- api_docs/deprecations_by_api.mdx | 2 +- api_docs/deprecations_by_plugin.mdx | 2 +- api_docs/deprecations_by_team.mdx | 2 +- api_docs/dev_tools.mdx | 2 +- api_docs/discover.mdx | 2 +- api_docs/discover_enhanced.mdx | 2 +- api_docs/embeddable.mdx | 2 +- api_docs/embeddable_enhanced.mdx | 2 +- api_docs/encrypted_saved_objects.mdx | 2 +- api_docs/enterprise_search.devdocs.json | 4 +- api_docs/enterprise_search.mdx | 2 +- api_docs/es_ui_shared.mdx | 2 +- api_docs/event_annotation.mdx | 2 +- api_docs/event_log.mdx | 2 +- api_docs/expression_error.mdx | 2 +- api_docs/expression_gauge.mdx | 2 +- api_docs/expression_heatmap.mdx | 2 +- api_docs/expression_image.mdx | 2 +- api_docs/expression_legacy_metric_vis.mdx | 2 +- api_docs/expression_metric.mdx | 2 +- api_docs/expression_metric_vis.mdx | 2 +- api_docs/expression_partition_vis.mdx | 2 +- api_docs/expression_repeat_image.mdx | 2 +- api_docs/expression_reveal_image.mdx | 2 +- api_docs/expression_shape.mdx | 2 +- api_docs/expression_tagcloud.mdx | 2 +- api_docs/expression_x_y.mdx | 2 +- api_docs/expressions.mdx | 2 +- api_docs/features.mdx | 2 +- api_docs/field_formats.mdx | 2 +- api_docs/file_upload.mdx | 2 +- api_docs/files.mdx | 2 +- api_docs/fleet.mdx | 2 +- api_docs/global_search.mdx | 2 +- api_docs/guided_onboarding.mdx | 2 +- api_docs/home.mdx | 2 +- api_docs/index_lifecycle_management.mdx | 2 +- api_docs/index_management.mdx | 2 +- api_docs/infra.mdx | 2 +- api_docs/inspector.mdx | 2 +- api_docs/interactive_setup.mdx | 2 +- api_docs/kbn_ace.mdx | 2 +- api_docs/kbn_aiops_components.mdx | 2 +- api_docs/kbn_aiops_utils.mdx | 2 +- api_docs/kbn_alerts.mdx | 2 +- api_docs/kbn_analytics.mdx | 2 +- api_docs/kbn_analytics_client.mdx | 2 +- ..._analytics_shippers_elastic_v3_browser.mdx | 2 +- ...n_analytics_shippers_elastic_v3_common.mdx | 2 +- ...n_analytics_shippers_elastic_v3_server.mdx | 2 +- api_docs/kbn_analytics_shippers_fullstory.mdx | 2 +- api_docs/kbn_analytics_shippers_gainsight.mdx | 2 +- api_docs/kbn_apm_config_loader.mdx | 2 +- api_docs/kbn_apm_synthtrace.mdx | 2 +- api_docs/kbn_apm_utils.mdx | 2 +- api_docs/kbn_axe_config.mdx | 2 +- api_docs/kbn_cases_components.mdx | 2 +- api_docs/kbn_chart_icons.mdx | 2 +- api_docs/kbn_ci_stats_core.mdx | 2 +- api_docs/kbn_ci_stats_performance_metrics.mdx | 2 +- api_docs/kbn_ci_stats_reporter.mdx | 2 +- api_docs/kbn_cli_dev_mode.mdx | 2 +- api_docs/kbn_coloring.mdx | 2 +- api_docs/kbn_config.mdx | 2 +- api_docs/kbn_config_mocks.mdx | 2 +- api_docs/kbn_config_schema.mdx | 2 +- .../kbn_content_management_table_list.mdx | 2 +- api_docs/kbn_core_analytics_browser.mdx | 2 +- .../kbn_core_analytics_browser_internal.mdx | 2 +- api_docs/kbn_core_analytics_browser_mocks.mdx | 2 +- api_docs/kbn_core_analytics_server.mdx | 2 +- .../kbn_core_analytics_server_internal.mdx | 2 +- api_docs/kbn_core_analytics_server_mocks.mdx | 2 +- api_docs/kbn_core_application_browser.mdx | 2 +- .../kbn_core_application_browser_internal.mdx | 2 +- .../kbn_core_application_browser_mocks.mdx | 2 +- api_docs/kbn_core_application_common.mdx | 2 +- api_docs/kbn_core_apps_browser_internal.mdx | 2 +- api_docs/kbn_core_apps_browser_mocks.mdx | 2 +- api_docs/kbn_core_base_browser_mocks.mdx | 2 +- api_docs/kbn_core_base_common.mdx | 2 +- api_docs/kbn_core_base_server_internal.mdx | 2 +- api_docs/kbn_core_base_server_mocks.mdx | 2 +- .../kbn_core_capabilities_browser_mocks.mdx | 2 +- api_docs/kbn_core_capabilities_common.mdx | 2 +- api_docs/kbn_core_capabilities_server.mdx | 2 +- .../kbn_core_capabilities_server_mocks.mdx | 2 +- api_docs/kbn_core_chrome_browser.mdx | 2 +- api_docs/kbn_core_chrome_browser_mocks.mdx | 2 +- api_docs/kbn_core_config_server_internal.mdx | 2 +- api_docs/kbn_core_deprecations_browser.mdx | 2 +- ...kbn_core_deprecations_browser_internal.mdx | 2 +- .../kbn_core_deprecations_browser_mocks.mdx | 2 +- api_docs/kbn_core_deprecations_common.mdx | 2 +- api_docs/kbn_core_deprecations_server.mdx | 2 +- .../kbn_core_deprecations_server_internal.mdx | 2 +- .../kbn_core_deprecations_server_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_browser.mdx | 2 +- api_docs/kbn_core_doc_links_browser_mocks.mdx | 2 +- api_docs/kbn_core_doc_links_server.mdx | 2 +- api_docs/kbn_core_doc_links_server_mocks.mdx | 2 +- ...e_elasticsearch_client_server_internal.mdx | 2 +- ...core_elasticsearch_client_server_mocks.mdx | 2 +- api_docs/kbn_core_elasticsearch_server.mdx | 2 +- ...kbn_core_elasticsearch_server_internal.mdx | 2 +- .../kbn_core_elasticsearch_server_mocks.mdx | 2 +- .../kbn_core_environment_server_internal.mdx | 2 +- .../kbn_core_environment_server_mocks.mdx | 2 +- .../kbn_core_execution_context_browser.mdx | 2 +- ...ore_execution_context_browser_internal.mdx | 2 +- ...n_core_execution_context_browser_mocks.mdx | 2 +- .../kbn_core_execution_context_common.mdx | 2 +- .../kbn_core_execution_context_server.mdx | 2 +- ...core_execution_context_server_internal.mdx | 2 +- ...bn_core_execution_context_server_mocks.mdx | 2 +- api_docs/kbn_core_fatal_errors_browser.mdx | 2 +- .../kbn_core_fatal_errors_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_browser.mdx | 2 +- api_docs/kbn_core_http_browser_internal.mdx | 2 +- api_docs/kbn_core_http_browser_mocks.mdx | 2 +- api_docs/kbn_core_http_common.mdx | 2 +- .../kbn_core_http_context_server_mocks.mdx | 2 +- ...re_http_request_handler_context_server.mdx | 2 +- api_docs/kbn_core_http_resources_server.mdx | 2 +- ...bn_core_http_resources_server_internal.mdx | 2 +- .../kbn_core_http_resources_server_mocks.mdx | 2 +- .../kbn_core_http_router_server_internal.mdx | 2 +- .../kbn_core_http_router_server_mocks.mdx | 2 +- api_docs/kbn_core_http_server.mdx | 2 +- api_docs/kbn_core_http_server_internal.mdx | 2 +- api_docs/kbn_core_http_server_mocks.mdx | 2 +- api_docs/kbn_core_i18n_browser.mdx | 2 +- api_docs/kbn_core_i18n_browser_mocks.mdx | 2 +- api_docs/kbn_core_i18n_server.mdx | 2 +- api_docs/kbn_core_i18n_server_internal.mdx | 2 +- api_docs/kbn_core_i18n_server_mocks.mdx | 2 +- .../kbn_core_injected_metadata_browser.mdx | 2 +- ...n_core_injected_metadata_browser_mocks.mdx | 2 +- ...kbn_core_integrations_browser_internal.mdx | 2 +- .../kbn_core_integrations_browser_mocks.mdx | 2 +- api_docs/kbn_core_lifecycle_browser.mdx | 2 +- api_docs/kbn_core_lifecycle_browser_mocks.mdx | 2 +- api_docs/kbn_core_lifecycle_server.mdx | 2 +- api_docs/kbn_core_lifecycle_server_mocks.mdx | 2 +- ...bn_core_logging_browser_mocks.devdocs.json | 98 +++ api_docs/kbn_core_logging_browser_mocks.mdx | 30 + ..._core_logging_common_internal.devdocs.json | 637 ++++++++++++++++++ api_docs/kbn_core_logging_common_internal.mdx | 39 ++ api_docs/kbn_core_logging_server.mdx | 2 +- api_docs/kbn_core_logging_server_internal.mdx | 2 +- api_docs/kbn_core_logging_server_mocks.mdx | 2 +- ...ore_metrics_collectors_server_internal.mdx | 2 +- ...n_core_metrics_collectors_server_mocks.mdx | 2 +- api_docs/kbn_core_metrics_server.mdx | 2 +- api_docs/kbn_core_metrics_server_internal.mdx | 2 +- api_docs/kbn_core_metrics_server_mocks.mdx | 2 +- api_docs/kbn_core_mount_utils_browser.mdx | 2 +- api_docs/kbn_core_node_server.mdx | 2 +- api_docs/kbn_core_node_server_internal.mdx | 2 +- api_docs/kbn_core_node_server_mocks.mdx | 2 +- api_docs/kbn_core_notifications_browser.mdx | 2 +- ...bn_core_notifications_browser_internal.mdx | 2 +- .../kbn_core_notifications_browser_mocks.mdx | 2 +- api_docs/kbn_core_overlays_browser.mdx | 2 +- .../kbn_core_overlays_browser_internal.mdx | 2 +- api_docs/kbn_core_overlays_browser_mocks.mdx | 2 +- .../kbn_core_plugins_browser.devdocs.json | 20 + api_docs/kbn_core_plugins_browser.mdx | 4 +- api_docs/kbn_core_plugins_browser_mocks.mdx | 2 +- api_docs/kbn_core_plugins_server.mdx | 2 +- api_docs/kbn_core_plugins_server_mocks.mdx | 2 +- api_docs/kbn_core_preboot_server.mdx | 2 +- api_docs/kbn_core_preboot_server_mocks.mdx | 2 +- api_docs/kbn_core_rendering_browser_mocks.mdx | 2 +- .../kbn_core_rendering_server_internal.mdx | 2 +- api_docs/kbn_core_rendering_server_mocks.mdx | 2 +- .../kbn_core_saved_objects_api_browser.mdx | 2 +- .../kbn_core_saved_objects_api_server.mdx | 2 +- ...core_saved_objects_api_server_internal.mdx | 2 +- ...bn_core_saved_objects_api_server_mocks.mdx | 2 +- ...ore_saved_objects_base_server_internal.mdx | 2 +- ...n_core_saved_objects_base_server_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_browser.mdx | 2 +- ...bn_core_saved_objects_browser_internal.mdx | 2 +- .../kbn_core_saved_objects_browser_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_common.mdx | 2 +- ..._objects_import_export_server_internal.mdx | 2 +- ...ved_objects_import_export_server_mocks.mdx | 2 +- ...aved_objects_migration_server_internal.mdx | 2 +- ...e_saved_objects_migration_server_mocks.mdx | 2 +- api_docs/kbn_core_saved_objects_server.mdx | 2 +- ...kbn_core_saved_objects_server_internal.mdx | 2 +- .../kbn_core_saved_objects_server_mocks.mdx | 2 +- .../kbn_core_saved_objects_utils_server.mdx | 2 +- api_docs/kbn_core_status_common.mdx | 2 +- api_docs/kbn_core_status_common_internal.mdx | 2 +- api_docs/kbn_core_status_server.mdx | 2 +- api_docs/kbn_core_status_server_internal.mdx | 2 +- api_docs/kbn_core_status_server_mocks.mdx | 2 +- ...core_test_helpers_deprecations_getters.mdx | 2 +- ...n_core_test_helpers_http_setup_browser.mdx | 2 +- ...n_core_test_helpers_so_type_serializer.mdx | 2 +- api_docs/kbn_core_test_helpers_test_utils.mdx | 2 +- api_docs/kbn_core_theme_browser.mdx | 2 +- api_docs/kbn_core_theme_browser_internal.mdx | 2 +- api_docs/kbn_core_theme_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_browser.mdx | 2 +- .../kbn_core_ui_settings_browser_internal.mdx | 2 +- .../kbn_core_ui_settings_browser_mocks.mdx | 2 +- api_docs/kbn_core_ui_settings_common.mdx | 2 +- api_docs/kbn_core_ui_settings_server.mdx | 2 +- .../kbn_core_ui_settings_server_internal.mdx | 2 +- .../kbn_core_ui_settings_server_mocks.mdx | 2 +- api_docs/kbn_core_usage_data_server.mdx | 2 +- .../kbn_core_usage_data_server_internal.mdx | 2 +- api_docs/kbn_core_usage_data_server_mocks.mdx | 2 +- api_docs/kbn_crypto.mdx | 2 +- api_docs/kbn_crypto_browser.mdx | 2 +- api_docs/kbn_datemath.mdx | 2 +- api_docs/kbn_dev_cli_errors.mdx | 2 +- api_docs/kbn_dev_cli_runner.mdx | 2 +- api_docs/kbn_dev_proc_runner.mdx | 2 +- api_docs/kbn_dev_utils.mdx | 2 +- api_docs/kbn_doc_links.mdx | 2 +- api_docs/kbn_docs_utils.mdx | 2 +- api_docs/kbn_ebt_tools.mdx | 2 +- api_docs/kbn_es.mdx | 2 +- api_docs/kbn_es_archiver.mdx | 2 +- api_docs/kbn_es_errors.mdx | 2 +- api_docs/kbn_es_query.mdx | 2 +- api_docs/kbn_es_types.mdx | 2 +- api_docs/kbn_eslint_plugin_imports.mdx | 2 +- api_docs/kbn_field_types.mdx | 2 +- api_docs/kbn_find_used_node_modules.mdx | 2 +- .../kbn_ftr_common_functional_services.mdx | 2 +- api_docs/kbn_generate.mdx | 2 +- api_docs/kbn_get_repo_files.mdx | 2 +- api_docs/kbn_guided_onboarding.mdx | 2 +- api_docs/kbn_handlebars.mdx | 2 +- api_docs/kbn_hapi_mocks.mdx | 2 +- api_docs/kbn_home_sample_data_card.mdx | 2 +- api_docs/kbn_home_sample_data_tab.mdx | 2 +- api_docs/kbn_i18n.mdx | 2 +- api_docs/kbn_i18n_react.mdx | 2 +- api_docs/kbn_import_resolver.mdx | 2 +- api_docs/kbn_interpreter.mdx | 2 +- api_docs/kbn_io_ts_utils.mdx | 2 +- api_docs/kbn_jest_serializers.mdx | 2 +- api_docs/kbn_journeys.mdx | 2 +- api_docs/kbn_kibana_manifest_schema.mdx | 2 +- .../kbn_language_documentation_popover.mdx | 2 +- api_docs/kbn_logging.mdx | 2 +- api_docs/kbn_logging_mocks.mdx | 2 +- api_docs/kbn_managed_vscode_config.mdx | 2 +- api_docs/kbn_mapbox_gl.mdx | 2 +- api_docs/kbn_ml_agg_utils.mdx | 2 +- api_docs/kbn_ml_is_populated_object.mdx | 2 +- api_docs/kbn_ml_string_hash.mdx | 2 +- api_docs/kbn_monaco.mdx | 2 +- api_docs/kbn_optimizer.mdx | 2 +- api_docs/kbn_optimizer_webpack_helpers.mdx | 2 +- api_docs/kbn_osquery_io_ts_types.mdx | 2 +- ..._performance_testing_dataset_extractor.mdx | 2 +- api_docs/kbn_plugin_generator.mdx | 2 +- api_docs/kbn_plugin_helpers.mdx | 2 +- api_docs/kbn_react_field.mdx | 2 +- api_docs/kbn_repo_source_classifier.mdx | 2 +- api_docs/kbn_rule_data_utils.mdx | 2 +- .../kbn_securitysolution_autocomplete.mdx | 2 +- api_docs/kbn_securitysolution_es_utils.mdx | 2 +- ...ritysolution_exception_list_components.mdx | 2 +- api_docs/kbn_securitysolution_hook_utils.mdx | 2 +- ..._securitysolution_io_ts_alerting_types.mdx | 2 +- .../kbn_securitysolution_io_ts_list_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_types.mdx | 2 +- api_docs/kbn_securitysolution_io_ts_utils.mdx | 2 +- api_docs/kbn_securitysolution_list_api.mdx | 2 +- .../kbn_securitysolution_list_constants.mdx | 2 +- api_docs/kbn_securitysolution_list_hooks.mdx | 2 +- api_docs/kbn_securitysolution_list_utils.mdx | 2 +- api_docs/kbn_securitysolution_rules.mdx | 2 +- api_docs/kbn_securitysolution_t_grid.mdx | 2 +- api_docs/kbn_securitysolution_utils.mdx | 2 +- api_docs/kbn_server_http_tools.mdx | 2 +- api_docs/kbn_server_route_repository.mdx | 2 +- api_docs/kbn_shared_svg.mdx | 2 +- api_docs/kbn_shared_ux_avatar_solution.mdx | 2 +- ...ared_ux_avatar_user_profile_components.mdx | 2 +- .../kbn_shared_ux_button_exit_full_screen.mdx | 2 +- ...hared_ux_button_exit_full_screen_mocks.mdx | 2 +- api_docs/kbn_shared_ux_button_toolbar.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data.mdx | 2 +- api_docs/kbn_shared_ux_card_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_link_redirect_app.mdx | 2 +- .../kbn_shared_ux_link_redirect_app_mocks.mdx | 2 +- api_docs/kbn_shared_ux_markdown.mdx | 2 +- api_docs/kbn_shared_ux_markdown_mocks.mdx | 2 +- .../kbn_shared_ux_page_analytics_no_data.mdx | 2 +- ...shared_ux_page_analytics_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_no_data.mdx | 2 +- ...bn_shared_ux_page_kibana_no_data_mocks.mdx | 2 +- .../kbn_shared_ux_page_kibana_template.mdx | 2 +- ...n_shared_ux_page_kibana_template_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data.mdx | 2 +- .../kbn_shared_ux_page_no_data_config.mdx | 2 +- ...bn_shared_ux_page_no_data_config_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_no_data_mocks.mdx | 2 +- api_docs/kbn_shared_ux_page_solution_nav.mdx | 2 +- .../kbn_shared_ux_prompt_no_data_views.mdx | 2 +- ...n_shared_ux_prompt_no_data_views_mocks.mdx | 2 +- api_docs/kbn_shared_ux_router.mdx | 2 +- api_docs/kbn_shared_ux_router_mocks.mdx | 2 +- api_docs/kbn_shared_ux_storybook_config.mdx | 2 +- api_docs/kbn_shared_ux_storybook_mock.mdx | 2 +- api_docs/kbn_shared_ux_utility.mdx | 2 +- api_docs/kbn_some_dev_log.mdx | 2 +- api_docs/kbn_sort_package_json.mdx | 2 +- api_docs/kbn_std.mdx | 2 +- api_docs/kbn_stdio_dev_helpers.mdx | 2 +- api_docs/kbn_storybook.mdx | 2 +- api_docs/kbn_telemetry_tools.mdx | 2 +- api_docs/kbn_test.mdx | 2 +- api_docs/kbn_test_jest_helpers.mdx | 2 +- api_docs/kbn_test_subj_selector.mdx | 2 +- api_docs/kbn_tooling_log.mdx | 2 +- api_docs/kbn_type_summarizer.mdx | 2 +- api_docs/kbn_type_summarizer_core.mdx | 2 +- api_docs/kbn_typed_react_router_config.mdx | 2 +- api_docs/kbn_ui_shared_deps_src.mdx | 2 +- api_docs/kbn_ui_theme.mdx | 2 +- api_docs/kbn_user_profile_components.mdx | 2 +- api_docs/kbn_utility_types.mdx | 2 +- api_docs/kbn_utility_types_jest.mdx | 2 +- api_docs/kbn_utils.mdx | 2 +- api_docs/kbn_yarn_lock_validator.mdx | 2 +- api_docs/kibana_overview.mdx | 2 +- api_docs/kibana_react.mdx | 2 +- api_docs/kibana_utils.mdx | 2 +- api_docs/kubernetes_security.mdx | 2 +- api_docs/lens.mdx | 2 +- api_docs/license_api_guard.mdx | 2 +- api_docs/license_management.mdx | 2 +- api_docs/licensing.mdx | 2 +- api_docs/lists.mdx | 2 +- api_docs/management.mdx | 2 +- api_docs/maps.devdocs.json | 63 ++ api_docs/maps.mdx | 4 +- api_docs/maps_ems.mdx | 2 +- api_docs/ml.mdx | 2 +- api_docs/monitoring.mdx | 2 +- api_docs/monitoring_collection.mdx | 2 +- api_docs/navigation.mdx | 2 +- api_docs/newsfeed.mdx | 2 +- api_docs/observability.mdx | 2 +- api_docs/osquery.mdx | 2 +- api_docs/plugin_directory.mdx | 18 +- api_docs/presentation_util.mdx | 2 +- api_docs/profiling.mdx | 2 +- api_docs/remote_clusters.mdx | 2 +- api_docs/reporting.mdx | 2 +- api_docs/rollup.mdx | 2 +- api_docs/rule_registry.mdx | 2 +- api_docs/runtime_fields.mdx | 2 +- api_docs/saved_objects.mdx | 2 +- api_docs/saved_objects_finder.mdx | 2 +- api_docs/saved_objects_management.mdx | 2 +- api_docs/saved_objects_tagging.mdx | 2 +- api_docs/saved_objects_tagging_oss.mdx | 2 +- api_docs/saved_search.mdx | 2 +- api_docs/screenshot_mode.mdx | 2 +- api_docs/screenshotting.mdx | 2 +- api_docs/security.mdx | 2 +- api_docs/security_solution.mdx | 2 +- api_docs/session_view.mdx | 2 +- api_docs/share.mdx | 2 +- api_docs/snapshot_restore.mdx | 2 +- api_docs/spaces.mdx | 2 +- api_docs/stack_alerts.mdx | 2 +- api_docs/stack_connectors.mdx | 2 +- api_docs/task_manager.devdocs.json | 2 +- api_docs/task_manager.mdx | 2 +- api_docs/telemetry.mdx | 2 +- api_docs/telemetry_collection_manager.mdx | 2 +- api_docs/telemetry_collection_xpack.mdx | 2 +- api_docs/telemetry_management_section.mdx | 2 +- api_docs/threat_intelligence.mdx | 2 +- api_docs/timelines.mdx | 2 +- api_docs/transform.mdx | 2 +- api_docs/triggers_actions_ui.mdx | 2 +- api_docs/ui_actions.mdx | 2 +- api_docs/ui_actions_enhanced.mdx | 2 +- api_docs/unified_field_list.mdx | 2 +- api_docs/unified_histogram.mdx | 2 +- api_docs/unified_search.mdx | 2 +- api_docs/unified_search_autocomplete.mdx | 2 +- api_docs/url_forwarding.mdx | 2 +- api_docs/usage_collection.mdx | 2 +- api_docs/ux.mdx | 2 +- api_docs/vis_default_editor.mdx | 2 +- api_docs/vis_type_gauge.mdx | 2 +- api_docs/vis_type_heatmap.mdx | 2 +- api_docs/vis_type_pie.mdx | 2 +- api_docs/vis_type_table.mdx | 2 +- api_docs/vis_type_timelion.mdx | 2 +- api_docs/vis_type_timeseries.mdx | 2 +- api_docs/vis_type_vega.mdx | 2 +- api_docs/vis_type_vislib.mdx | 2 +- api_docs/vis_type_xy.mdx | 2 +- api_docs/visualizations.mdx | 2 +- 442 files changed, 1543 insertions(+), 472 deletions(-) create mode 100644 api_docs/kbn_core_logging_browser_mocks.devdocs.json create mode 100644 api_docs/kbn_core_logging_browser_mocks.mdx create mode 100644 api_docs/kbn_core_logging_common_internal.devdocs.json create mode 100644 api_docs/kbn_core_logging_common_internal.mdx diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 5ea65a4401bd..52942544eb15 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 5bf1f2193cca..b6f4e9b984a9 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index 92967fd705e0..54cbebe0b681 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 88823d4b8b0d..3715af8a1501 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.devdocs.json b/api_docs/apm.devdocs.json index 0f36183912e2..28b91d38809c 100644 --- a/api_docs/apm.devdocs.json +++ b/api_docs/apm.devdocs.json @@ -204,7 +204,7 @@ "Observable", "; autoCreateApmDataView: boolean; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>>; getApmIndices: () => Promise<", + "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; forceSyntheticSource: boolean; }>>; getApmIndices: () => Promise<", "ApmIndicesConfig", ">; createApmEventClient: ({ request, context, debug, }: { debug?: boolean | undefined; request: ", { @@ -435,7 +435,7 @@ "signature": [ "{ readonly indices: Readonly<{} & { metric: string; error: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly autoCreateApmDataView: boolean; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }" + "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; readonly forceSyntheticSource: boolean; }" ], "path": "x-pack/plugins/apm/server/routes/typings.ts", "deprecated": false, @@ -827,7 +827,7 @@ "signature": [ "{ readonly indices: Readonly<{} & { metric: string; error: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly autoCreateApmDataView: boolean; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }" + "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; readonly forceSyntheticSource: boolean; }" ], "path": "x-pack/plugins/apm/server/index.ts", "deprecated": false, @@ -7110,7 +7110,7 @@ "Observable", "; autoCreateApmDataView: boolean; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>>" + "; telemetryCollectionEnabled: boolean; metricsInterval: number; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; forceSyntheticSource: boolean; }>>" ], "path": "x-pack/plugins/apm/server/types.ts", "deprecated": false, diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index e2406aade357..d88beee3b29c 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index cbe86334af55..c420cb692a83 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 90f5ae36be4a..a4e00c6aa05f 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 9b721c3f2cb6..0509d1f1e15c 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 9951038b5d7e..3baa539c48ec 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 2557bd792262..96516fd25f46 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index c4c882be53a9..fbcab061d1c7 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_chat.mdx b/api_docs/cloud_chat.mdx index 2fe88b92fbf9..49c787bbf32f 100644 --- a/api_docs/cloud_chat.mdx +++ b/api_docs/cloud_chat.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudChat title: "cloudChat" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudChat plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudChat'] --- import cloudChatObj from './cloud_chat.devdocs.json'; diff --git a/api_docs/cloud_experiments.mdx b/api_docs/cloud_experiments.mdx index c9a49fc99206..152b4355f04d 100644 --- a/api_docs/cloud_experiments.mdx +++ b/api_docs/cloud_experiments.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudExperiments title: "cloudExperiments" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudExperiments plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudExperiments'] --- import cloudExperimentsObj from './cloud_experiments.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index 232caa7696bb..b9aa8c60aa4f 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 6e3f73aaee1c..17cd0e6d70f4 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 8c9da68b8553..32564a5ae676 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/core.devdocs.json b/api_docs/core.devdocs.json index 652098189b3a..a672cb981f7e 100644 --- a/api_docs/core.devdocs.json +++ b/api_docs/core.devdocs.json @@ -12310,6 +12310,26 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "core", + "id": "def-public.PluginInitializerContext.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } + ], + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "core", "id": "def-public.PluginInitializerContext.config", diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 79d390cf18f0..65a90ab56320 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github description: API docs for the core plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] --- import coreObj from './core.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2703 | 17 | 1201 | 0 | +| 2704 | 17 | 1202 | 0 | ## Client diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 33f7edb04777..97e124c1de8e 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 8a9641c1916e..6ba5323d1c41 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 9ec0ae390a91..d5ac616dc701 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.devdocs.json b/api_docs/data.devdocs.json index 172f176549f6..497266ba3188 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -5170,6 +5170,41 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureOpenModalButton", + "type": "Function", + "tags": [], + "label": "ShardFailureOpenModalButton", + "description": [], + "signature": [ + "(props: ", + "ShardFailureOpenModalButtonProps", + ") => JSX.Element" + ], + "path": "src/plugins/data/public/shard_failure_modal/index.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.ShardFailureOpenModalButton.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "ShardFailureOpenModalButtonProps" + ], + "path": "src/plugins/data/public/shard_failure_modal/index.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-public.tabifyAggResponse", @@ -9055,6 +9090,104 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest", + "type": "Interface", + "tags": [], + "label": "ShardFailureRequest", + "description": [], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.docvalue_fields", + "type": "Array", + "tags": [], + "label": "docvalue_fields", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest._source", + "type": "Unknown", + "tags": [], + "label": "_source", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.query", + "type": "Unknown", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.script_fields", + "type": "Unknown", + "tags": [], + "label": "script_fields", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.sort", + "type": "Unknown", + "tags": [], + "label": "sort", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "data", + "id": "def-public.ShardFailureRequest.stored_fields", + "type": "Array", + "tags": [], + "label": "stored_fields", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/public/shard_failure_modal/shard_failure_types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [ @@ -16317,10 +16450,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -16347,8 +16480,10 @@ "id": "def-server.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -24889,10 +25024,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -24919,8 +25054,10 @@ "id": "def-common.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -27291,7 +27428,7 @@ "section": "def-common.DataView", "text": "DataView" }, - ">; delete: (indexPatternId: string) => Promise<{}>; create: ({ id, name, title, ...restOfSpec }: ", + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { "pluginId": "dataViews", "scope": "common", diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 7983d8d6dede..629edd64e8eb 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3251 | 119 | 2546 | 24 | +| 3261 | 119 | 2553 | 27 | ## Client diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 13393a88c75e..71843dd2ac43 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3251 | 119 | 2546 | 24 | +| 3261 | 119 | 2553 | 27 | ## Client diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index 245b49ec877b..5374d3d4bf2a 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -1460,6 +1460,25 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchResponseWarning", + "type": "Type", + "tags": [], + "label": "SearchResponseWarning", + "description": [ + "\nA warning object for a search response with warnings" + ], + "signature": [ + "SearchResponseTimeoutWarning", + " | ", + "SearchResponseShardFailureWarning" + ], + "path": "src/plugins/data/public/search/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 572b86ac53c3..7c5131facfb0 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3251 | 119 | 2546 | 24 | +| 3261 | 119 | 2553 | 27 | ## Client diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 5a008e9f925f..827841baa8e2 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 2689ef981f89..2ae135c2ce21 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index 8219b5be1f3d..797103352dc5 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.devdocs.json b/api_docs/data_views.devdocs.json index 3dc670c3bcbc..70e6e1d21f6e 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -4908,10 +4908,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -4938,8 +4938,10 @@ "id": "def-public.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -12255,10 +12257,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -12285,8 +12287,10 @@ "id": "def-server.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -20235,10 +20239,10 @@ "tags": [], "label": "create", "description": [ - "\nCreate a new data view instance." + "\nCreate data view instance." ], "signature": [ - "({ id, name, title, ...restOfSpec }: ", + "(spec: ", { "pluginId": "dataViews", "scope": "common", @@ -20265,8 +20269,10 @@ "id": "def-common.DataViewsService.create.$1", "type": "Object", "tags": [], - "label": "{ id, name, title, ...restOfSpec }", - "description": [], + "label": "spec", + "description": [ + "data view spec" + ], "signature": [ { "pluginId": "dataViews", @@ -25377,7 +25383,7 @@ "section": "def-common.DataView", "text": "DataView" }, - ">; delete: (indexPatternId: string) => Promise<{}>; create: ({ id, name, title, ...restOfSpec }: ", + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { "pluginId": "dataViews", "scope": "common", diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index fef4a3d754bf..9448431955ff 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1021 | 0 | 231 | 2 | +| 1021 | 0 | 228 | 2 | ## Client diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index fdc12f066f7d..512739a20029 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 51d5e6f53e77..2d37c966c2be 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 6947908a0ebe..5d88e55e3d32 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index bc26e7084e61..dd241a8891f6 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 9643bc44af38..d94756c64301 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index de79f1c68c03..3c6ba7f1c5b5 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 79badb47fbab..5bb5cafd1278 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 3533bcb7b839..b3a02d8ef213 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 1c78dac6efe1..97393add31a5 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 4981b4744a2a..eb3082cec84f 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.devdocs.json b/api_docs/enterprise_search.devdocs.json index d0b72b833d85..0e47e5a6c851 100644 --- a/api_docs/enterprise_search.devdocs.json +++ b/api_docs/enterprise_search.devdocs.json @@ -92,12 +92,12 @@ { "parentPluginId": "enterpriseSearch", "id": "def-server.CONNECTORS_VERSION", - "type": "string", + "type": "number", "tags": [], "label": "CONNECTORS_VERSION", "description": [], "signature": [ - "\"1\"" + "1" ], "path": "x-pack/plugins/enterprise_search/server/index.ts", "deprecated": false, diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index 51b6fbd37810..16f606d78f62 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index a737c105f434..c0c8af71d6ed 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index 8a639ebf03d5..ea069faa0737 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 8bde9bb1f9a6..e86bd54cf544 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 466212be84fa..d1b60e3ad3e8 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 4f6213ab05df..75e9f903d313 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index 2791141c726d..e39189d92034 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 03111be9f88d..06888bb5990e 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index 9a54a8f38d4b..0b73ced82182 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index df40548c3479..4052bfcfe199 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 118c72b78bc4..2a00942f8da1 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index f7130076a7bb..0af56d686859 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 5c4e251c34a6..5822c959cc5b 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index 1f2ab7602dab..89f2a0ca0717 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index b117a80b23f9..6333d7795219 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index b4fc3c7e51ff..ba05fc5625d1 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 24f1634991a1..9571e8de7da6 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 899b1701c470..624e92d6930e 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 9f198fc261f7..638320aa814f 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 7f9ff54a7246..582e8bf22caa 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 66d4d6aa0c7b..462edf68d289 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 7fa464d93185..fc22a3542895 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 3035e0e0641d..7e448c72cf35 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index f394f8841812..bf4839a97190 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index 09a89d44f0f5..2ab4d7f8ee5e 100644 --- a/api_docs/guided_onboarding.mdx +++ b/api_docs/guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/guidedOnboarding title: "guidedOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the guidedOnboarding plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index c6842826a6b6..06136cd4365c 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index 81aa6e309245..c80f54dc77ab 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 222a8affc952..73d38e1f5ca8 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 520d78d49739..010c8c45f499 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 72a7c4beef39..0da9d4d1c34a 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 725b53c8d5e1..d83052d85bec 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index c883f27e694f..95952e9c2d3f 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index 59fe0acd596b..de14ba43d90a 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index c4bf8dcc5170..5ebf8344d0a7 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index e02a461e07a5..e5aed58ec14a 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] --- import kbnAlertsObj from './kbn_alerts.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 47ef34e7033d..7f792065ed03 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index 8481e92961ab..766880ee3d24 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index f11e6eaa6986..b40bf3cf2551 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index 7f6c81657e18..9165fe030a5b 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index a260493db0bb..5232acee8a74 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index 0603fd70a01a..4ce115a2b872 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_gainsight.mdx b/api_docs/kbn_analytics_shippers_gainsight.mdx index 5b3f6e7ebcc1..1945154b53c2 100644 --- a/api_docs/kbn_analytics_shippers_gainsight.mdx +++ b/api_docs/kbn_analytics_shippers_gainsight.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-gainsight title: "@kbn/analytics-shippers-gainsight" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-gainsight plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-gainsight'] --- import kbnAnalyticsShippersGainsightObj from './kbn_analytics_shippers_gainsight.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 0a1876b6dc72..167d2760e8d0 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index f2d158d806df..c0e119389b9b 100644 --- a/api_docs/kbn_apm_synthtrace.mdx +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace title: "@kbn/apm-synthtrace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index f9bda8cd345e..ffd42f570c8b 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index 7eed0bacca67..da7e8a6f0efc 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index 98f8a8e26d91..476f2aa86673 100644 --- a/api_docs/kbn_cases_components.mdx +++ b/api_docs/kbn_cases_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cases-components title: "@kbn/cases-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cases-components plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index 9e7dad9e5af4..2281bf38d2c7 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index f9f7fba403a8..4fe0139ffcef 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index 78416a96930b..6202bd18fa0f 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index e5069892fa2d..cda58f6984e3 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index 9288a8e83e9f..f5191dc11ca8 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index aad5db9fd347..b613b83babc3 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index c90c6ac5f0ac..d5200d17e5d9 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index 24b8a4d6f7d3..97390f677e9c 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index c5bfda8a108f..a509e6e43650 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list.mdx b/api_docs/kbn_content_management_table_list.mdx index 640644dd2553..d4e6c2f3bc48 100644 --- a/api_docs/kbn_content_management_table_list.mdx +++ b/api_docs/kbn_content_management_table_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list title: "@kbn/content-management-table-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list'] --- import kbnContentManagementTableListObj from './kbn_content_management_table_list.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 93ef2f659d64..296b12d13bf6 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 9710daec90e5..cef19c4700c6 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 2bf493eab65b..50520d77668d 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 88ff29aa1895..aac0cfb74f59 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index 8f2a8088cf00..505b59444fec 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 0a3b97751da0..4c392de1a5c3 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index 4bdbc3545664..fb9bae1b22c1 100644 --- a/api_docs/kbn_core_application_browser.mdx +++ b/api_docs/kbn_core_application_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser title: "@kbn/core-application-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser'] --- import kbnCoreApplicationBrowserObj from './kbn_core_application_browser.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index d301fea8b399..753937573ceb 100644 --- a/api_docs/kbn_core_application_browser_internal.mdx +++ b/api_docs/kbn_core_application_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-internal title: "@kbn/core-application-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index ee6e76a22809..457ed85ff463 100644 --- a/api_docs/kbn_core_application_browser_mocks.mdx +++ b/api_docs/kbn_core_application_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-mocks title: "@kbn/core-application-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-mocks'] --- import kbnCoreApplicationBrowserMocksObj from './kbn_core_application_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_common.mdx b/api_docs/kbn_core_application_common.mdx index 3a7a01aa3d73..9141e044c07e 100644 --- a/api_docs/kbn_core_application_common.mdx +++ b/api_docs/kbn_core_application_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-common title: "@kbn/core-application-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-common'] --- import kbnCoreApplicationCommonObj from './kbn_core_application_common.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index d396b616ce5a..92807451ddf2 100644 --- a/api_docs/kbn_core_apps_browser_internal.mdx +++ b/api_docs/kbn_core_apps_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-internal title: "@kbn/core-apps-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-internal'] --- import kbnCoreAppsBrowserInternalObj from './kbn_core_apps_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_mocks.mdx b/api_docs/kbn_core_apps_browser_mocks.mdx index 63df5fb47ddd..1225a4754126 100644 --- a/api_docs/kbn_core_apps_browser_mocks.mdx +++ b/api_docs/kbn_core_apps_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-mocks title: "@kbn/core-apps-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-mocks'] --- import kbnCoreAppsBrowserMocksObj from './kbn_core_apps_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index 21865790488c..70f1aab98ee1 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index 3f26cee3ef0b..8d20cf01e07c 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index 6062db7ca492..3c844d22be10 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index 41ac3508ac4e..e09c75f962d7 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index bd0456b73661..fdea8c4c3a09 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.mdx +++ b/api_docs/kbn_core_capabilities_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-browser-mocks title: "@kbn/core-capabilities-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-browser-mocks'] --- import kbnCoreCapabilitiesBrowserMocksObj from './kbn_core_capabilities_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index 70e1e52d9da5..37e09a46d51c 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index 65bb710cdd2f..2d7aeea5d9b3 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index 8ea8de936d8b..29b635d8f419 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index 1bbf3102194d..ca0d49898599 100644 --- a/api_docs/kbn_core_chrome_browser.mdx +++ b/api_docs/kbn_core_chrome_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser title: "@kbn/core-chrome-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index 63638e089206..271c9cf1cf23 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.mdx +++ b/api_docs/kbn_core_chrome_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser-mocks title: "@kbn/core-chrome-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser-mocks'] --- import kbnCoreChromeBrowserMocksObj from './kbn_core_chrome_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 74f2799d9a5e..3dbac556cc0f 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index dd3821da4205..9bd25df3c950 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index 41338f8efb4e..ac0ef00d5e17 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index 5b620ac4cd43..f3ee361b6a07 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index b84a28ba947c..04b8b09b91be 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index 199040ad6d5a..f1ecabdba0e8 100644 --- a/api_docs/kbn_core_deprecations_server.mdx +++ b/api_docs/kbn_core_deprecations_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server title: "@kbn/core-deprecations-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server'] --- import kbnCoreDeprecationsServerObj from './kbn_core_deprecations_server.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index 5d23f084abb3..9d1dae9d5dfa 100644 --- a/api_docs/kbn_core_deprecations_server_internal.mdx +++ b/api_docs/kbn_core_deprecations_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-internal title: "@kbn/core-deprecations-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-internal'] --- import kbnCoreDeprecationsServerInternalObj from './kbn_core_deprecations_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index 1d0c938d5172..e783e87e17eb 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.mdx +++ b/api_docs/kbn_core_deprecations_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-mocks title: "@kbn/core-deprecations-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-mocks'] --- import kbnCoreDeprecationsServerMocksObj from './kbn_core_deprecations_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 76bfb31e4ae2..7e1dfa6f526b 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index a6e0e3bcd018..a15285b952ae 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index 303a88b0c591..5dd7a404f129 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index 2a52e9295784..4ca8054da938 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index 3b66f6c09efc..4da3b5040bcf 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index 10120fdbabde..455acf405e72 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index d1070c300c6f..a36566ab8bf7 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index 279be99a4cd0..635d4084f0bf 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index 1b7ba38c4bc4..06e1df815b88 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index e1cb1def104b..d34c2e7c010d 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index 989fbedb5b96..a7115bc7d28f 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index de06605342fd..454483bfbcb5 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 2ccb36ae62dd..9f6aff27e2ca 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 15b2e254f046..6e1eeff6a50e 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index 17d3f25ce2b6..6fbaf2ea1d37 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index 0c4078c10155..7e8fc5a4a9b3 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index f14704772868..3db9406ef51a 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index 7e368e7d2ecd..2b9a091b73fb 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index dca1ed6dc358..5cd10e1427b3 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index 2628319ec297..acfd67fd663f 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index fb47a32dd758..9fab11d719d3 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index d368390b9ce6..795ac1c1cf61 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index 00b94f830d04..38a386f2d52e 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index dd6f30a295b9..ee9aa20c6090 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index e48df4f6f93e..8c2e78d8db52 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_request_handler_context_server.mdx b/api_docs/kbn_core_http_request_handler_context_server.mdx index c685ae7c4cfa..946fa06e34db 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.mdx +++ b/api_docs/kbn_core_http_request_handler_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-request-handler-context-server title: "@kbn/core-http-request-handler-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-request-handler-context-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-request-handler-context-server'] --- import kbnCoreHttpRequestHandlerContextServerObj from './kbn_core_http_request_handler_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index cfdaf1e19dff..252165678a06 100644 --- a/api_docs/kbn_core_http_resources_server.mdx +++ b/api_docs/kbn_core_http_resources_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server title: "@kbn/core-http-resources-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server'] --- import kbnCoreHttpResourcesServerObj from './kbn_core_http_resources_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index d9b4b9707437..ede57703e690 100644 --- a/api_docs/kbn_core_http_resources_server_internal.mdx +++ b/api_docs/kbn_core_http_resources_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-internal title: "@kbn/core-http-resources-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-internal'] --- import kbnCoreHttpResourcesServerInternalObj from './kbn_core_http_resources_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index 4893ebddee66..ee25e21b5970 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.mdx +++ b/api_docs/kbn_core_http_resources_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-mocks title: "@kbn/core-http-resources-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-mocks'] --- import kbnCoreHttpResourcesServerMocksObj from './kbn_core_http_resources_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index 4756727ff894..a8abbf3b0cb2 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index cdd177ceb0a5..5cd66509c067 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index e96d6cf9adbe..1fd9fd7a34ec 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 6c904369552a..e27c392179bf 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index bc1aad5a7887..327db7c08d54 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index dea993e2070b..7858aa69f33a 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index fd660520c718..75e8e212134f 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server.mdx b/api_docs/kbn_core_i18n_server.mdx index 95a321317d36..e2909cf12e7e 100644 --- a/api_docs/kbn_core_i18n_server.mdx +++ b/api_docs/kbn_core_i18n_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server title: "@kbn/core-i18n-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server'] --- import kbnCoreI18nServerObj from './kbn_core_i18n_server.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index 3fb2794d4112..b835eba9d7ae 100644 --- a/api_docs/kbn_core_i18n_server_internal.mdx +++ b/api_docs/kbn_core_i18n_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-internal title: "@kbn/core-i18n-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-internal'] --- import kbnCoreI18nServerInternalObj from './kbn_core_i18n_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index c346597846c2..91cd19ebdc90 100644 --- a/api_docs/kbn_core_i18n_server_mocks.mdx +++ b/api_docs/kbn_core_i18n_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-mocks title: "@kbn/core-i18n-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-mocks'] --- import kbnCoreI18nServerMocksObj from './kbn_core_i18n_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser.mdx b/api_docs/kbn_core_injected_metadata_browser.mdx index 2cc4d782a3ba..144177ad323a 100644 --- a/api_docs/kbn_core_injected_metadata_browser.mdx +++ b/api_docs/kbn_core_injected_metadata_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser title: "@kbn/core-injected-metadata-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser'] --- import kbnCoreInjectedMetadataBrowserObj from './kbn_core_injected_metadata_browser.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 882f9db70828..47219273472e 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index 510755ca28d2..ddbdad606df3 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index 986fcdf47388..904ee9393d59 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index 95a8b7713abe..b1b9f192d2fa 100644 --- a/api_docs/kbn_core_lifecycle_browser.mdx +++ b/api_docs/kbn_core_lifecycle_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser title: "@kbn/core-lifecycle-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser'] --- import kbnCoreLifecycleBrowserObj from './kbn_core_lifecycle_browser.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index bf829fe0c330..deca9bcb6dc8 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser-mocks title: "@kbn/core-lifecycle-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser-mocks'] --- import kbnCoreLifecycleBrowserMocksObj from './kbn_core_lifecycle_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx index 65a7d411ac12..64d68b923d0c 100644 --- a/api_docs/kbn_core_lifecycle_server.mdx +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server title: "@kbn/core-lifecycle-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] --- import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx index 80cf8f97ea3a..f4625c3dc74f 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server-mocks title: "@kbn/core-lifecycle-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] --- import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_browser_mocks.devdocs.json b/api_docs/kbn_core_logging_browser_mocks.devdocs.json new file mode 100644 index 000000000000..5c129ba055dc --- /dev/null +++ b/api_docs/kbn_core_logging_browser_mocks.devdocs.json @@ -0,0 +1,98 @@ +{ + "id": "@kbn/core-logging-browser-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [ + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock", + "type": "Object", + "tags": [], + "label": "loggingSystemMock", + "description": [], + "path": "packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "() => jest.Mocked<", + "IBrowserLoggingSystem", + ">" + ], + "path": "packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [] + }, + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock.createLogger", + "type": "Function", + "tags": [], + "label": "createLogger", + "description": [], + "signature": [ + "(context?: string[]) => ", + { + "pluginId": "@kbn/logging-mocks", + "scope": "server", + "docId": "kibKbnLoggingMocksPluginApi", + "section": "def-server.MockedLogger", + "text": "MockedLogger" + } + ], + "path": "packages/core/logging/core-logging-browser-mocks/src/logging_system.mock.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-logging-browser-mocks", + "id": "def-common.loggingSystemMock.createLogger.$1", + "type": "Array", + "tags": [], + "label": "context", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-logging-mocks/src/logger.mock.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_logging_browser_mocks.mdx b/api_docs/kbn_core_logging_browser_mocks.mdx new file mode 100644 index 000000000000..5c822bb58bd6 --- /dev/null +++ b/api_docs/kbn_core_logging_browser_mocks.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCoreLoggingBrowserMocksPluginApi +slug: /kibana-dev-docs/api/kbn-core-logging-browser-mocks +title: "@kbn/core-logging-browser-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-logging-browser-mocks plugin +date: 2022-11-02 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-browser-mocks'] +--- +import kbnCoreLoggingBrowserMocksObj from './kbn_core_logging_browser_mocks.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + +## Common + +### Objects + + diff --git a/api_docs/kbn_core_logging_common_internal.devdocs.json b/api_docs/kbn_core_logging_common_internal.devdocs.json new file mode 100644 index 000000000000..74dbf77a108b --- /dev/null +++ b/api_docs/kbn_core_logging_common_internal.devdocs.json @@ -0,0 +1,637 @@ +{ + "id": "@kbn/core-logging-common-internal", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getLoggerContext", + "type": "Function", + "tags": [], + "label": "getLoggerContext", + "description": [ + "\nHelper method that joins separate string context parts into single context string.\nIn case joined context is an empty string, `root` context name is returned." + ], + "signature": [ + "(contextParts: string[]) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getLoggerContext.$1", + "type": "Array", + "tags": [], + "label": "contextParts", + "description": [ + "List of the context parts (e.g. ['parent', 'child']." + ], + "signature": [ + "string[]" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [ + "Joined context string (e.g. 'parent.child')." + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getParentLoggerContext", + "type": "Function", + "tags": [], + "label": "getParentLoggerContext", + "description": [ + "\nHelper method that returns parent context for the specified one." + ], + "signature": [ + "(context: string) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.getParentLoggerContext.$1", + "type": "string", + "tags": [], + "label": "context", + "description": [ + "Context to find parent for." + ], + "signature": [ + "string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [ + "Name of the parent context or `root` if the context is the top level one." + ], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion", + "type": "Interface", + "tags": [], + "label": "Conversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ", highlight: boolean) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.convert.$2", + "type": "boolean", + "tags": [], + "label": "highlight", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [], + "signature": [ + "((input: string) => void) | undefined" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.Conversion.validate.$1", + "type": "string", + "tags": [], + "label": "input", + "description": [], + "signature": [ + "string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.CONTEXT_SEPARATOR", + "type": "string", + "tags": [], + "label": "CONTEXT_SEPARATOR", + "description": [ + "\nSeparator string that used within nested context name (eg. plugins.pid)." + ], + "signature": [ + "\".\"" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DEFAULT_APPENDER_NAME", + "type": "string", + "tags": [], + "label": "DEFAULT_APPENDER_NAME", + "description": [ + "\nName of the appender that is always presented and used by `root` logger by default." + ], + "signature": [ + "\"default\"" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.ROOT_CONTEXT_NAME", + "type": "string", + "tags": [], + "label": "ROOT_CONTEXT_NAME", + "description": [ + "\nName of the `root` context that always exists and sits at the top of logger hierarchy." + ], + "signature": [ + "\"root\"" + ], + "path": "packages/core/logging/core-logging-common-internal/src/logger_context.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion", + "type": "Object", + "tags": [], + "label": "DateConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ", highlight: boolean, ...matched: any[]) => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert.$2", + "type": "boolean", + "tags": [], + "label": "highlight", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.convert.$3", + "type": "Array", + "tags": [], + "label": "matched", + "description": [], + "signature": [ + "any[]" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [], + "signature": [ + "(rawString: string) => void" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.DateConversion.validate.$1", + "type": "string", + "tags": [], + "label": "rawString", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/date.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion", + "type": "Object", + "tags": [], + "label": "LevelConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LevelConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/level.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion", + "type": "Object", + "tags": [], + "label": "LoggerConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.LoggerConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/logger.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion", + "type": "Object", + "tags": [], + "label": "MessageConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MessageConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/message.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion", + "type": "Object", + "tags": [], + "label": "MetaConversion", + "description": [], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion.pattern", + "type": "Object", + "tags": [], + "label": "pattern", + "description": [], + "signature": [ + "RegExp" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion.convert", + "type": "Function", + "tags": [], + "label": "convert", + "description": [], + "signature": [ + "(record: ", + "LogRecord", + ") => string" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-logging-common-internal", + "id": "def-common.MetaConversion.convert.$1", + "type": "Object", + "tags": [], + "label": "record", + "description": [], + "signature": [ + "LogRecord" + ], + "path": "packages/core/logging/core-logging-common-internal/src/layouts/conversions/meta.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_core_logging_common_internal.mdx b/api_docs/kbn_core_logging_common_internal.mdx new file mode 100644 index 000000000000..5c219e5a6909 --- /dev/null +++ b/api_docs/kbn_core_logging_common_internal.mdx @@ -0,0 +1,39 @@ +--- +#### +#### 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: kibKbnCoreLoggingCommonInternalPluginApi +slug: /kibana-dev-docs/api/kbn-core-logging-common-internal +title: "@kbn/core-logging-common-internal" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/core-logging-common-internal plugin +date: 2022-11-02 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-common-internal'] +--- +import kbnCoreLoggingCommonInternalObj from './kbn_core_logging_common_internal.devdocs.json'; + + + +Contact Kibana Core for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 38 | 0 | 31 | 0 | + +## Common + +### Objects + + +### Functions + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index fccbf0e6858d..090b59a985f0 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 31758eb06d61..61ddd3725dbd 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 935f65eb6599..8e0f0242cbd7 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index 4e9d8a27288a..d41195027ff9 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index 7719f3f93c0e..2ef5b2e20909 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index 6267d8d22bda..85a6b8a02f7f 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index b40ce4535504..fa2ac048268b 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index 6424640974ff..5e1f7c8ac1fb 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index 8b22fc91b704..a3b9cb8ff40b 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index c05396dd7fa6..87b96e7fb595 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 5a7674ecc5f4..bdf111d7df11 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index 081ff2fedb3a..3c473f01e101 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index 07a20b39465f..f4c8bbd6e384 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index f930d676b1dc..90a223d1368c 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index 698ac134de04..ed2e67766b3c 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index 5acd7b7579a6..42832b342921 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index bb11d5056c99..c4845b99ae9a 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 5e6be0a952f7..46f0268668f7 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser.devdocs.json b/api_docs/kbn_core_plugins_browser.devdocs.json index 4d32b54c3a7a..1ce9836dbdde 100644 --- a/api_docs/kbn_core_plugins_browser.devdocs.json +++ b/api_docs/kbn_core_plugins_browser.devdocs.json @@ -254,6 +254,26 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/core-plugins-browser", + "id": "def-common.PluginInitializerContext.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.LoggerFactory", + "text": "LoggerFactory" + } + ], + "path": "packages/core/plugins/core-plugins-browser/src/plugin_initializer.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/core-plugins-browser", "id": "def-common.PluginInitializerContext.config", diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index 5091512c0d39..2ecce761680e 100644 --- a/api_docs/kbn_core_plugins_browser.mdx +++ b/api_docs/kbn_core_plugins_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser title: "@kbn/core-plugins-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; @@ -21,7 +21,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 14 | 0 | 10 | 0 | +| 15 | 0 | 11 | 0 | ## Common diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index 237e6f01fd5b..cdb0140f9350 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.mdx +++ b/api_docs/kbn_core_plugins_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser-mocks title: "@kbn/core-plugins-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index 746f29b9f1bd..57934b2ddb53 100644 --- a/api_docs/kbn_core_plugins_server.mdx +++ b/api_docs/kbn_core_plugins_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server title: "@kbn/core-plugins-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] --- import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx index 5d9fc816d454..f6d9f25eb1e4 100644 --- a/api_docs/kbn_core_plugins_server_mocks.mdx +++ b/api_docs/kbn_core_plugins_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server-mocks title: "@kbn/core-plugins-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] --- import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index af46d97cc824..7792f55cfda9 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 988075cfc75e..0357ed0242c1 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index 38e4214087f2..3268933adab7 100644 --- a/api_docs/kbn_core_rendering_browser_mocks.mdx +++ b/api_docs/kbn_core_rendering_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser-mocks title: "@kbn/core-rendering-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser-mocks'] --- import kbnCoreRenderingBrowserMocksObj from './kbn_core_rendering_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_internal.mdx b/api_docs/kbn_core_rendering_server_internal.mdx index 56d1065f9ede..895fd760bbd9 100644 --- a/api_docs/kbn_core_rendering_server_internal.mdx +++ b/api_docs/kbn_core_rendering_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-internal title: "@kbn/core-rendering-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index 0235e7722d26..165616c4502e 100644 --- a/api_docs/kbn_core_rendering_server_mocks.mdx +++ b/api_docs/kbn_core_rendering_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-mocks title: "@kbn/core-rendering-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-mocks'] --- import kbnCoreRenderingServerMocksObj from './kbn_core_rendering_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 750811c58c35..1f9adb63b578 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 1dbe14157b57..a623b48be84b 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_internal.mdx b/api_docs/kbn_core_saved_objects_api_server_internal.mdx index fd8ecde155ba..5cce42286ffc 100644 --- a/api_docs/kbn_core_saved_objects_api_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-internal title: "@kbn/core-saved-objects-api-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-internal'] --- import kbnCoreSavedObjectsApiServerInternalObj from './kbn_core_saved_objects_api_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx index 4da85bb93e95..a1f2405c7edf 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-mocks title: "@kbn/core-saved-objects-api-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-mocks'] --- import kbnCoreSavedObjectsApiServerMocksObj from './kbn_core_saved_objects_api_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_internal.mdx b/api_docs/kbn_core_saved_objects_base_server_internal.mdx index bc74494b9fdf..d61caa7e4e61 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-internal title: "@kbn/core-saved-objects-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx index a75fda08b608..60abd6ff785c 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-mocks title: "@kbn/core-saved-objects-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 09d1b3b77f81..1bca17afdaeb 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index 3ede5635adf7..9ca99660f01e 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index 1f8c4e62ef8b..9c9331d6e405 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index b869cf0aa850..3c2c7f24e4d9 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx index b8b4962112b8..a3cbb364cff4 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-internal title: "@kbn/core-saved-objects-import-export-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-internal'] --- import kbnCoreSavedObjectsImportExportServerInternalObj from './kbn_core_saved_objects_import_export_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx index b486d2184f7e..635cf9e2d7e0 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-mocks title: "@kbn/core-saved-objects-import-export-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index 178ec69d6237..35c88f23905c 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-internal title: "@kbn/core-saved-objects-migration-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx index 7a1b8ff360a4..8ca90c8ed4b3 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-mocks title: "@kbn/core-saved-objects-migration-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-mocks'] --- import kbnCoreSavedObjectsMigrationServerMocksObj from './kbn_core_saved_objects_migration_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index ff59a9038b3d..b4c8420dc58e 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index 561eb96e4194..83866f0569e4 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-internal title: "@kbn/core-saved-objects-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-internal'] --- import kbnCoreSavedObjectsServerInternalObj from './kbn_core_saved_objects_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index 8c6d05c218be..6c3b32b7c4ff 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-mocks title: "@kbn/core-saved-objects-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index 2c8953ac3f89..cbbbc65f3d57 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.mdx +++ b/api_docs/kbn_core_saved_objects_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-utils-server title: "@kbn/core-saved-objects-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-utils-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index 4014ca3a29da..2b7c3b0e2729 100644 --- a/api_docs/kbn_core_status_common.mdx +++ b/api_docs/kbn_core_status_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common title: "@kbn/core-status-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_common_internal.mdx b/api_docs/kbn_core_status_common_internal.mdx index e5a9a4d9ac9d..f3452e72880f 100644 --- a/api_docs/kbn_core_status_common_internal.mdx +++ b/api_docs/kbn_core_status_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common-internal title: "@kbn/core-status-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common-internal'] --- import kbnCoreStatusCommonInternalObj from './kbn_core_status_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index 61ce4f91860e..8c2456d7c679 100644 --- a/api_docs/kbn_core_status_server.mdx +++ b/api_docs/kbn_core_status_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server title: "@kbn/core-status-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index 85c001e2b45c..4c0c53706e32 100644 --- a/api_docs/kbn_core_status_server_internal.mdx +++ b/api_docs/kbn_core_status_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-internal title: "@kbn/core-status-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-internal'] --- import kbnCoreStatusServerInternalObj from './kbn_core_status_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index e2f043961dc9..7ccd7192c9fe 100644 --- a/api_docs/kbn_core_status_server_mocks.mdx +++ b/api_docs/kbn_core_status_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-mocks title: "@kbn/core-status-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-mocks'] --- import kbnCoreStatusServerMocksObj from './kbn_core_status_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index d5397782b246..f2fd45cb9b5b 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index ae398a2899f0..14a608f7996e 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx index d083d85e7d5c..d94ccebe2ba5 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-so-type-serializer title: "@kbn/core-test-helpers-so-type-serializer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-so-type-serializer plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-so-type-serializer'] --- import kbnCoreTestHelpersSoTypeSerializerObj from './kbn_core_test_helpers_so_type_serializer.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index c49b74c6696e..36a4bda87c8c 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.mdx +++ b/api_docs/kbn_core_test_helpers_test_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-test-utils title: "@kbn/core-test-helpers-test-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-test-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-test-utils'] --- import kbnCoreTestHelpersTestUtilsObj from './kbn_core_test_helpers_test_utils.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index 90ccd636e728..032e355ea64a 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index 12853ac70dc2..51c579e35515 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] --- import kbnCoreThemeBrowserInternalObj from './kbn_core_theme_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index 4fc36fc3f4aa..1ce0f05e6b33 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index c02ba9ebfb10..ca650cd0a879 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index 2f7f19fdb695..5adf0b86a9d4 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index 8732f477b966..2561eecfafd8 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index ab36862b2514..f3cedc0acc0d 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index 8e3cabf207ca..9e21d0b8ea1d 100644 --- a/api_docs/kbn_core_ui_settings_server.mdx +++ b/api_docs/kbn_core_ui_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server title: "@kbn/core-ui-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server'] --- import kbnCoreUiSettingsServerObj from './kbn_core_ui_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index 30dd4658f5f9..fed838781520 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.mdx +++ b/api_docs/kbn_core_ui_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-internal title: "@kbn/core-ui-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index b59d64ab8019..3d59f98d37ab 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-mocks title: "@kbn/core-ui-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index 0a30968bc426..b44d1cdc008a 100644 --- a/api_docs/kbn_core_usage_data_server.mdx +++ b/api_docs/kbn_core_usage_data_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server title: "@kbn/core-usage-data-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server'] --- import kbnCoreUsageDataServerObj from './kbn_core_usage_data_server.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index 8431d5e3f655..36f7e6bf90b5 100644 --- a/api_docs/kbn_core_usage_data_server_internal.mdx +++ b/api_docs/kbn_core_usage_data_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-internal title: "@kbn/core-usage-data-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-internal plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-internal'] --- import kbnCoreUsageDataServerInternalObj from './kbn_core_usage_data_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index ee8976702801..61c84ad936c4 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.mdx +++ b/api_docs/kbn_core_usage_data_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-mocks title: "@kbn/core-usage-data-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-mocks'] --- import kbnCoreUsageDataServerMocksObj from './kbn_core_usage_data_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 346b09e150c2..b802f33992bb 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 41012dcdd2c2..221307c83cb8 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index 8e7afe0ac51a..84025a50d1c7 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 099cbc79b200..c287908c3c90 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 212840ccd0b0..41f98c754b20 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index 3bfe294e508b..da5b0be2065d 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index ebc8aac9b617..0f60ff10b768 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 135b88699862..6ccf2090313f 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index 0bf5620ce54e..55e84ff674da 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 3dc15fd2849d..02f561f2d763 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index 252dc0b13ad8..a5b7da29069a 100644 --- a/api_docs/kbn_es.mdx +++ b/api_docs/kbn_es.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es title: "@kbn/es" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] --- import kbnEsObj from './kbn_es.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index 5cd8a40812df..00341a825dfa 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index 301e8cc59f6c..5f85c2565f7c 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index a5889ac2f1e7..2ace595cf94f 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index 1f619c69218c..0d864876ecc3 100644 --- a/api_docs/kbn_es_types.mdx +++ b/api_docs/kbn_es_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-types title: "@kbn/es-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-types plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index c33d35e0aaee..8b7473c67000 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 587f50507d58..37440ce4eec7 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index 05a1d2beefb1..4ec668bbf8d1 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index d4e811af15c0..b0dc5f6522a5 100644 --- a/api_docs/kbn_ftr_common_functional_services.mdx +++ b/api_docs/kbn_ftr_common_functional_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-services title: "@kbn/ftr-common-functional-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-services plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index b44a97cec869..5585017f12a9 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_get_repo_files.mdx b/api_docs/kbn_get_repo_files.mdx index 404db1cb0e1e..0603218f2a8b 100644 --- a/api_docs/kbn_get_repo_files.mdx +++ b/api_docs/kbn_get_repo_files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-get-repo-files title: "@kbn/get-repo-files" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/get-repo-files plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/get-repo-files'] --- import kbnGetRepoFilesObj from './kbn_get_repo_files.devdocs.json'; diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index d735da10c6ce..f2a22cdb44ab 100644 --- a/api_docs/kbn_guided_onboarding.mdx +++ b/api_docs/kbn_guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-guided-onboarding title: "@kbn/guided-onboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/guided-onboarding plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index eb427500f518..7ca6bb3f58f4 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index 72b5e358f77f..51b46ec8f1de 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index 401931f044fb..7e2d9a03595c 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index db210c5ffa92..111a7b659bf8 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index b565f85abd2e..13f62b0e7651 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx index 45f196144653..0f2778a82f01 100644 --- a/api_docs/kbn_i18n_react.mdx +++ b/api_docs/kbn_i18n_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n-react title: "@kbn/i18n-react" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n-react plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] --- import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 10a0f1bf5f44..e277b84e69f9 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index a0dd4b7ad069..33211d1739b1 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 47644e792668..8c47000eb3a8 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 8721f02edf8d..d1c2a25bacfd 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index 2292f6a6656f..46dd4b7056c8 100644 --- a/api_docs/kbn_journeys.mdx +++ b/api_docs/kbn_journeys.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-journeys title: "@kbn/journeys" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/journeys plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index 5557a32a35de..4880e0502419 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation_popover.mdx b/api_docs/kbn_language_documentation_popover.mdx index 8ad47524939f..ee284472abac 100644 --- a/api_docs/kbn_language_documentation_popover.mdx +++ b/api_docs/kbn_language_documentation_popover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation-popover title: "@kbn/language-documentation-popover" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation-popover plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation-popover'] --- import kbnLanguageDocumentationPopoverObj from './kbn_language_documentation_popover.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 8dd810ed7ec1..6065921d5a30 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index cacf11cf0e0f..e2eec4239383 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index 127c0b469692..74e4f15b9d05 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index bcf5bcd3809b..031b38efd6f7 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index faa2b8152987..3da3a8c938a7 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index ad095b32a12d..29677c17e3b2 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index 33a7ac169134..afe16255f91e 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index a836aea9a6c3..d85ec0b7d420 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 6ff23c6825e5..e4d8797ce82f 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index 698ce9b556e4..ac8467a850fa 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index f5a3b622d1da..9a7e5ea33e81 100644 --- a/api_docs/kbn_osquery_io_ts_types.mdx +++ b/api_docs/kbn_osquery_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-osquery-io-ts-types title: "@kbn/osquery-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/osquery-io-ts-types plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index e9d23683cabd..9e3d5150080d 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index fd990f870660..5bd8abb6f647 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index 922a6b1a87d9..4e8016f41e53 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index ff7cb8c6dcd1..9f3690ad29f2 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index 4667ce301e70..64cd086abca6 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index 723441004032..022c5ecfb17e 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index 4617117610ce..38d8ec0e01fe 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 8bc6a87d55be..65b8f48a21dd 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index 6a0db0065f5a..18ac96d992c1 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.mdx +++ b/api_docs/kbn_securitysolution_exception_list_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-exception-list-components title: "@kbn/securitysolution-exception-list-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-exception-list-components plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-exception-list-components'] --- import kbnSecuritysolutionExceptionListComponentsObj from './kbn_securitysolution_exception_list_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index feed204bb0bb..e02b0d0a67ca 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index eb1d7416ac8c..18de786c2031 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index a710c4a36478..3f2d31848d80 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 084e70906ff5..daffd458535f 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index d86079dc26a3..bb5524f52f1e 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index d527deb50804..b6d2b2ff5062 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 0fadb448e635..bd50d1bb08f2 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 89dcaf176aee..c2673ad1c20a 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index 1ea6e8198002..3754b02e09eb 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index ddc14cf7b423..e84ceba0c74e 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index 590994a51d2d..088be7f384a6 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index a81c7cf25267..87eda2aefa80 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index ad30c111ce29..949a80a1daf3 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 5ba79aba31ca..b24fa399ea03 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 721c1f9e0fcc..80ed4944edf9 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index da3b434ed058..616843e7fc73 100644 --- a/api_docs/kbn_shared_ux_avatar_solution.mdx +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-solution title: "@kbn/shared-ux-avatar-solution" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-solution plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] --- import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx index c68ac8d06200..7b5942840740 100644 --- a/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx +++ b/api_docs/kbn_shared_ux_avatar_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-user-profile-components title: "@kbn/shared-ux-avatar-user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-user-profile-components plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-user-profile-components'] --- import kbnSharedUxAvatarUserProfileComponentsObj from './kbn_shared_ux_avatar_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index 9944cb0a6ae2..d2e15a8f4d5d 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen title: "@kbn/shared-ux-button-exit-full-screen" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] --- import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx index 32587102b469..f72ed83bd350 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen-mocks title: "@kbn/shared-ux-button-exit-full-screen-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen-mocks'] --- import kbnSharedUxButtonExitFullScreenMocksObj from './kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index fa84048a0d2e..aee5367e1cb1 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index 4ba03026595f..11d36200d01a 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index 9cba99902f2c..d51956ad7bee 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx index 545a31e8a92a..78ed4841b4f7 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app title: "@kbn/shared-ux-link-redirect-app" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] --- import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index 90d1e90b26dc..57c4b6e4ae93 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown.mdx b/api_docs/kbn_shared_ux_markdown.mdx index b44927ed5718..10ec32d2099a 100644 --- a/api_docs/kbn_shared_ux_markdown.mdx +++ b/api_docs/kbn_shared_ux_markdown.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown title: "@kbn/shared-ux-markdown" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown'] --- import kbnSharedUxMarkdownObj from './kbn_shared_ux_markdown.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index d68e853db538..ed0d7e21980b 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.mdx +++ b/api_docs/kbn_shared_ux_markdown_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown-mocks title: "@kbn/shared-ux-markdown-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown-mocks'] --- import kbnSharedUxMarkdownMocksObj from './kbn_shared_ux_markdown_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index 8a707994ba47..98c783b4252e 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index 3ba2a29d2b3e..af6d0a52cc40 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index bdc14a6a7c09..6f463aa6d543 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index 5e08157603fc..e948b6be920c 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index 6c0617f983c8..69672643f308 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template title: "@kbn/shared-ux-page-kibana-template" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx index f28c917a23c9..cc8b75129677 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks title: "@kbn/shared-ux-page-kibana-template-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] --- import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index 944766e80215..c8f92d6a7803 100644 --- a/api_docs/kbn_shared_ux_page_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx index 418a923ea7cf..a742104eca3e 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx index cc8f0143857e..f778a95ade35 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks title: "@kbn/shared-ux-page-no-data-config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] --- import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx index 8739839369fb..07934b29c2ef 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks title: "@kbn/shared-ux-page-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] --- import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 106574c903bb..be6fa825778c 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index e43f46dd298d..d1bff331a6c5 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 6a3807968393..81c0603dbedf 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router.mdx b/api_docs/kbn_shared_ux_router.mdx index 202bec3b741b..c0f2e10672f0 100644 --- a/api_docs/kbn_shared_ux_router.mdx +++ b/api_docs/kbn_shared_ux_router.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router title: "@kbn/shared-ux-router" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router'] --- import kbnSharedUxRouterObj from './kbn_shared_ux_router.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router_mocks.mdx b/api_docs/kbn_shared_ux_router_mocks.mdx index 1aa25e970e8e..8098d1cb4781 100644 --- a/api_docs/kbn_shared_ux_router_mocks.mdx +++ b/api_docs/kbn_shared_ux_router_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router-mocks title: "@kbn/shared-ux-router-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router-mocks plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router-mocks'] --- import kbnSharedUxRouterMocksObj from './kbn_shared_ux_router_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_config.mdx b/api_docs/kbn_shared_ux_storybook_config.mdx index 9175bd7d3487..999f5e6729b8 100644 --- a/api_docs/kbn_shared_ux_storybook_config.mdx +++ b/api_docs/kbn_shared_ux_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-config title: "@kbn/shared-ux-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-config plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-config'] --- import kbnSharedUxStorybookConfigObj from './kbn_shared_ux_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index 8c199e7a47ee..12ca85a44743 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 31db6c95984b..2c42de415757 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index daa1e5abdf07..e06d59275a65 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_sort_package_json.mdx b/api_docs/kbn_sort_package_json.mdx index dac9486e5e29..9a61932038f5 100644 --- a/api_docs/kbn_sort_package_json.mdx +++ b/api_docs/kbn_sort_package_json.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-package-json title: "@kbn/sort-package-json" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-package-json plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-package-json'] --- import kbnSortPackageJsonObj from './kbn_sort_package_json.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index f9d7f2b4ea64..0526e7dc1e57 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index 920779144a8e..7c8a214d81c6 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 5bf82c0949bd..a42169ca4a8d 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 599a8fa05739..33fa4899c6c5 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 7c490b6e198f..07b2852efaea 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 9f8f7ea3bb61..40878db2b1ac 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_subj_selector.mdx b/api_docs/kbn_test_subj_selector.mdx index 94de51206988..b718ee2a0b11 100644 --- a/api_docs/kbn_test_subj_selector.mdx +++ b/api_docs/kbn_test_subj_selector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-subj-selector title: "@kbn/test-subj-selector" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-subj-selector plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 3641b8c885cc..788004d27bae 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer.mdx b/api_docs/kbn_type_summarizer.mdx index aace1473048a..7761b81bdf24 100644 --- a/api_docs/kbn_type_summarizer.mdx +++ b/api_docs/kbn_type_summarizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer title: "@kbn/type-summarizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer'] --- import kbnTypeSummarizerObj from './kbn_type_summarizer.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer_core.mdx b/api_docs/kbn_type_summarizer_core.mdx index 640c782e0473..a2c4bd2e7cd8 100644 --- a/api_docs/kbn_type_summarizer_core.mdx +++ b/api_docs/kbn_type_summarizer_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer-core title: "@kbn/type-summarizer-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer-core plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer-core'] --- import kbnTypeSummarizerCoreObj from './kbn_type_summarizer_core.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index 331ec9c440ae..c2786b0e9c71 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index da52a0ffb016..2ae7c6c2626d 100644 --- a/api_docs/kbn_ui_shared_deps_src.mdx +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-shared-deps-src title: "@kbn/ui-shared-deps-src" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-shared-deps-src plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 9c8c13d3462c..ba6993957e63 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 5355e2b5e475..27d13e7ecff2 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index a909c0c6acd5..d73762312d06 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index 849035953e8e..476c33f90849 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index f331c3fccf22..e4fe008027db 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 8f60e4659522..3641c2efc4fa 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index d39d05d25c7a..a8ef8e516c11 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 52cd3f372387..8aa83e00d9fb 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index aaa191874988..37b1b8820886 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index 7ee870166566..68aefc3e2495 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 956966f701bc..0efa5c24f2ab 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 023e15937b79..7a9fa00f72bd 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index ff75e31f4ec1..dcf5b6520a69 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index 6230823babf6..f317b23f3433 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 53200c1bf1d9..02101b2f7144 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 75c9a8405d00..9fbf4d558e24 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.devdocs.json b/api_docs/maps.devdocs.json index f60133d04b29..11393b4a0aeb 100644 --- a/api_docs/maps.devdocs.json +++ b/api_docs/maps.devdocs.json @@ -2393,6 +2393,69 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "maps", + "id": "def-public.IRasterSource.hasLegendDetails", + "type": "Function", + "tags": [], + "label": "hasLegendDetails", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/plugins/maps/public/classes/sources/raster_source/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "maps", + "id": "def-public.IRasterSource.renderLegendDetails", + "type": "Function", + "tags": [], + "label": "renderLegendDetails", + "description": [], + "signature": [ + "(dataRequest: ", + { + "pluginId": "maps", + "scope": "public", + "docId": "kibMapsPluginApi", + "section": "def-public.DataRequest", + "text": "DataRequest" + }, + " | undefined) => React.ReactElement> | null" + ], + "path": "x-pack/plugins/maps/public/classes/sources/raster_source/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "maps", + "id": "def-public.IRasterSource.renderLegendDetails.$1", + "type": "Object", + "tags": [], + "label": "dataRequest", + "description": [], + "signature": [ + { + "pluginId": "maps", + "scope": "public", + "docId": "kibMapsPluginApi", + "section": "def-public.DataRequest", + "text": "DataRequest" + }, + " | undefined" + ], + "path": "x-pack/plugins/maps/public/classes/sources/raster_source/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index c21b74e8b2cf..5273ea05ba70 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; @@ -21,7 +21,7 @@ Contact [GIS](https://github.com/orgs/elastic/teams/kibana-gis) for questions re | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 263 | 0 | 262 | 26 | +| 266 | 0 | 265 | 26 | ## Client diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 8aec70c22eca..8c7751618724 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 8ea284960ad4..8e79e9cf50f7 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 8d1e2fa705de..2cca54d39b84 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index 929a725d4f4b..8dbb31722774 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 5a49d5e62856..2e5a89083d1e 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 9bcb1145643f..26279c90ab3d 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index c42985a8a239..88b6f5e3c9a0 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index be92d574c9f6..8d8ef3664f84 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index ee80d5381276..ac8ddcce501f 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 503 | 422 | 38 | +| 506 | 424 | 38 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 33090 | 514 | 23436 | 1092 | +| 33147 | 514 | 23480 | 1096 | ## Plugin Directory @@ -46,16 +46,16 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Cloud Security Posture](https://github.com/orgs/elastic/teams/cloud-posture-security) | The cloud security posture plugin | 18 | 0 | 2 | 3 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 233 | 0 | 224 | 7 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2703 | 17 | 1201 | 0 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2704 | 17 | 1202 | 0 | | crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 107 | 0 | 88 | 1 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 121 | 0 | 114 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 52 | 0 | 51 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3251 | 119 | 2546 | 24 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3261 | 119 | 2553 | 27 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout inside Kibana apps | 16 | 0 | 7 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Reusable data view field editor across Kibana | 60 | 0 | 30 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data view management app | 2 | 0 | 2 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 1021 | 0 | 231 | 2 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 1021 | 0 | 228 | 2 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 28 | 3 | 24 | 1 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 97 | 0 | 80 | 4 | @@ -112,7 +112,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 204 | 0 | 92 | 50 | | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 41 | 0 | 41 | 6 | -| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 263 | 0 | 262 | 26 | +| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 266 | 0 | 265 | 26 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 67 | 0 | 67 | 0 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 254 | 9 | 78 | 39 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 15 | 3 | 13 | 1 | @@ -290,6 +290,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 5 | 0 | 5 | 0 | | | Kibana Core | - | 31 | 0 | 0 | 0 | | | Kibana Core | - | 9 | 0 | 9 | 0 | +| | Kibana Core | - | 4 | 0 | 4 | 0 | +| | Kibana Core | - | 38 | 0 | 31 | 0 | | | Kibana Core | - | 56 | 0 | 30 | 0 | | | Kibana Core | - | 9 | 0 | 5 | 2 | | | Kibana Core | - | 13 | 0 | 13 | 0 | @@ -308,7 +310,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 63 | 0 | 37 | 0 | | | Kibana Core | - | 1 | 0 | 1 | 1 | | | Kibana Core | - | 3 | 0 | 3 | 0 | -| | Kibana Core | - | 14 | 0 | 10 | 0 | +| | Kibana Core | - | 15 | 0 | 11 | 0 | | | Kibana Core | - | 6 | 0 | 6 | 0 | | | Kibana Core | - | 58 | 0 | 26 | 0 | | | Kibana Core | - | 5 | 0 | 5 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 834412d903f4..058a94c5a3f9 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index 1c6a8316b50e..298e722ccbe6 100644 --- a/api_docs/profiling.mdx +++ b/api_docs/profiling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profiling title: "profiling" image: https://source.unsplash.com/400x175/?github description: API docs for the profiling plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index fa81fafe3be7..0865ae33d330 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 0b3844a14e7c..76e7b560c9a9 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index 4159132bb0bf..db89e2660498 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index c485a74657dc..e5fe1948f482 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index e62fdb13b533..479bd3fce3ce 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 2cdb3842170e..c224ed4d9006 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index d3942c9bd1f3..48bde91f3822 100644 --- a/api_docs/saved_objects_finder.mdx +++ b/api_docs/saved_objects_finder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsFinder title: "savedObjectsFinder" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsFinder plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 7aca372c0de0..03713793cdf3 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 6b21819c9d05..44168f7c0c43 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 95d6c1876f64..2108d67e0f98 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 8f2558df2887..8ec1ea62bb80 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 2ee5af5f5590..8589ded53271 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index e40a161cab9d..ba55504bcc6d 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 1cd9e1917d2f..ced32610c26b 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index fc356d331efa..bd7e9e0b4fd8 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index a9a540693e03..e9ec0ef165f1 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 601c5a85029b..b5ddb63e4622 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index ff03dd109b86..7021d9bccf9b 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 958ac2c02de8..6b8e2801b2e2 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 446ce8f2ef53..438e34717e70 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/stack_connectors.mdx b/api_docs/stack_connectors.mdx index cf6538ca9011..928e3ee04199 100644 --- a/api_docs/stack_connectors.mdx +++ b/api_docs/stack_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackConnectors title: "stackConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the stackConnectors plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.devdocs.json b/api_docs/task_manager.devdocs.json index 03856c04b4d8..d9497789ba81 100644 --- a/api_docs/task_manager.devdocs.json +++ b/api_docs/task_manager.devdocs.json @@ -1542,7 +1542,7 @@ "section": "def-server.SavedObjectsBulkDeleteResponse", "text": "SavedObjectsBulkDeleteResponse" }, - " | undefined>; } & { supportsEphemeralTasks: () => boolean; }" + " | undefined>; } & { supportsEphemeralTasks: () => boolean; getRegisteredTypes: () => string[]; }" ], "path": "x-pack/plugins/task_manager/server/plugin.ts", "deprecated": false, diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index c9ea42abeabe..a4d1bbedffd5 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index b82a55fc67fe..64369e049dc7 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 1d3581a1377e..55f08585d969 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index cb55fb5dca9d..68091e39086a 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index a10b4eb42293..505ebfebf30b 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index ecc74b099500..c7eddbea50f9 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 705156c9237e..c6686cac360c 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index 85479a09c16b..f081b363ea8c 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index ab6d92541717..4837a3168eb8 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 3fa9fd4f16c9..dade66136c79 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 49f9aeb5e01e..b40cd03bb80b 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_field_list.mdx b/api_docs/unified_field_list.mdx index 749598b46787..b97e6416bdcd 100644 --- a/api_docs/unified_field_list.mdx +++ b/api_docs/unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedFieldList title: "unifiedFieldList" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedFieldList plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedFieldList'] --- import unifiedFieldListObj from './unified_field_list.devdocs.json'; diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index 6b484ff311cc..a62224baf6c2 100644 --- a/api_docs/unified_histogram.mdx +++ b/api_docs/unified_histogram.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedHistogram title: "unifiedHistogram" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedHistogram plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index db9143d35659..0e837f00498e 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 2d6f336b88fd..b06b94767e58 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 288e3537bf6c..14a726450eac 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 8f96f8151449..b2d4989832fa 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 582351fc5699..64953d2e5af9 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index b76f552f28ff..a091604ac718 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 538653fb0e66..41dd38651b23 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index e90bc3786feb..616061bf3fc8 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 9ab0f154bb46..19dbab0aab26 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 7ae0e3acdd24..717302623118 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index 7e1ecc59bbda..e85866399ac3 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 3535d667ce19..3ff5b5d63ad6 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index cfeffdc0255f..e2d574dc60cb 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 69a0288f5d2d..b6ef47d2cfc9 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index 0eb36d7a76f5..78c16f75d360 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index dc40695f4d72..0cd6f9f52f8e 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2022-11-01 +date: 2022-11-02 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; From bd6440cd7b0a9b4a9e94c162a0ee512dff92b917 Mon Sep 17 00:00:00 2001 From: Pierre Gayvallet Date: Wed, 2 Nov 2022 08:07:21 +0100 Subject: [PATCH 80/87] Fix some SO tagging flaky FTR tests (#144083) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../functional/tests/dashboard_integration.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts b/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts index 41b337ed6a8c..e0c1f162371c 100644 --- a/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts +++ b/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts @@ -69,9 +69,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await listingTable.expectItemsCount('dashboard', 2); const itemNames = await listingTable.getAllItemsNames(); - expect(itemNames).to.eql([ - 'dashboard 4 with real data (tag-1)', + expect(itemNames.sort()).to.eql([ 'dashboard 3 (tag-1 and tag-3)', + 'dashboard 4 with real data (tag-1)', ]); }); @@ -80,7 +80,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await listingTable.expectItemsCount('dashboard', 2); const itemNames = await listingTable.getAllItemsNames(); - expect(itemNames).to.eql(['dashboard 2 (tag-3)', 'dashboard 3 (tag-1 and tag-3)']); + expect(itemNames.sort()).to.eql(['dashboard 2 (tag-3)', 'dashboard 3 (tag-1 and tag-3)']); }); it('allows to filter by multiple tags', async () => { @@ -88,7 +88,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await listingTable.expectItemsCount('dashboard', 3); const itemNames = await listingTable.getAllItemsNames(); - expect(itemNames).to.eql([ + expect(itemNames.sort()).to.eql([ 'dashboard 1 (tag-2)', 'dashboard 2 (tag-3)', 'dashboard 3 (tag-1 and tag-3)', From 4811b97b37e205f5e3545eb247677ea376811424 Mon Sep 17 00:00:00 2001 From: Cindy Chang Date: Wed, 2 Nov 2022 08:47:08 +0100 Subject: [PATCH 81/87] [Guided Onboarding] Panel style modifications (#144164) * make panel height of content * fix responsive styles for panel and footer * add styling for step text * fix formatting * style modifications to panel Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../public/components/guide_panel.styles.ts | 10 ++++++---- .../public/components/guide_panel.tsx | 7 ++++++- .../public/components/guide_panel_step.styles.ts | 6 ++++++ .../public/components/guide_panel_step.tsx | 4 ++-- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts b/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts index 7e7f47670edf..f3c0d0545828 100644 --- a/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts +++ b/src/plugins/guided_onboarding/public/components/guide_panel.styles.ts @@ -27,15 +27,17 @@ export const getGuidePanelStyles = (euiTheme: EuiThemeComputed) => ({ height: auto; animation: euiModal 350ms cubic-bezier(0.34, 1.61, 0.7, 1); box-shadow: none; - "@media only screen and (max-width: 574px)": { - right: 25px; - width: 100%; - }, + @media (max-width: ${euiTheme.breakpoint.s}px) { + right: 25px !important; + } `, flyoutBody: css` .euiFlyoutBody__overflowContent { width: 480px; padding-top: 10px; + @media (max-width: ${euiTheme.breakpoint.s}px) { + width: 100%; + } } `, flyoutFooter: css` diff --git a/src/plugins/guided_onboarding/public/components/guide_panel.tsx b/src/plugins/guided_onboarding/public/components/guide_panel.tsx index def898cae8a6..759f4a83c685 100644 --- a/src/plugins/guided_onboarding/public/components/guide_panel.tsx +++ b/src/plugins/guided_onboarding/public/components/guide_panel.tsx @@ -289,7 +289,12 @@ export const GuidePanel = ({ api, application }: GuidePanelProps) => { - + {stepConfig.descriptionList.length === 1 ? ( -

{stepConfig.descriptionList[0]}

// If there is only one description, render it as a paragraph +

{stepConfig.descriptionList[0]}

// If there is only one description, render it as a paragraph ) : ( -
    +
      {stepConfig.descriptionList.map((description, index) => { return
    • {description}
    • ; })} From 8be27cbd06303d2494a8ff376bd67c8478ddcd9e Mon Sep 17 00:00:00 2001 From: Shahzad Date: Wed, 2 Nov 2022 09:07:59 +0100 Subject: [PATCH 82/87] [Synthetics] Add failed tests heatmap in errors page (#143628) --- .../configurations/constants/constants.ts | 3 + .../configurations/constants/labels.ts | 4 + .../configurations/lens_attributes.test.ts | 8 +- .../configurations/lens_attributes.ts | 57 +++++++---- .../lens_attributes/heatmap_attributes.ts | 96 +++++++++++++++++++ .../single_metric_attributes.test.ts | 13 ++- .../single_metric_attributes.ts | 80 +++++----------- .../synthetics/heatmap_config.ts | 50 ++++++++++ .../test_data/sample_attribute_cwv.ts | 2 +- .../test_formula_metric_attribute.ts | 2 +- .../embeddable/embeddable.tsx | 57 +++++++---- .../hooks/use_lens_attributes.ts | 15 ++- .../obsv_exploratory_view.tsx | 4 + .../shared/exploratory_view/types.ts | 1 + .../monitor_errors/failed_tests.tsx | 39 ++++++++ .../monitor_errors/monitor_errors.tsx | 9 +- 16 files changed, 329 insertions(+), 111 deletions(-) create mode 100644 x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts create mode 100644 x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts index 9f9664602a67..6a925c9b3d99 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/constants.ts @@ -59,6 +59,7 @@ import { EVENT_DATASET_LABEL, MESSAGE_LABEL, SINGLE_METRIC_LABEL, + HEATMAP_LABEL, } from './labels'; import { MONITOR_DURATION_US, @@ -167,6 +168,7 @@ export const DataViewLabels: Record = { 'core-web-vitals': CORE_WEB_VITALS_LABEL, 'device-data-distribution': DEVICE_DISTRIBUTION_LABEL, 'single-metric': SINGLE_METRIC_LABEL, + heatmap: HEATMAP_LABEL, }; export enum ReportTypes { @@ -175,6 +177,7 @@ export enum ReportTypes { CORE_WEB_VITAL = 'core-web-vitals', DEVICE_DISTRIBUTION = 'device-data-distribution', SINGLE_METRIC = 'single-metric', + HEATMAP = 'heatmap', } export enum DataTypes { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts index 83c7781f692a..c15880fb9e5d 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/constants/labels.ts @@ -242,6 +242,10 @@ export const SINGLE_METRIC_LABEL = i18n.translate( } ); +export const HEATMAP_LABEL = i18n.translate('xpack.observability.expView.fieldLabels.heatMap', { + defaultMessage: 'Heatmap', +}); + export const MOBILE_RESPONSE_LABEL = i18n.translate( 'xpack.observability.expView.fieldLabels.mobileResponse', { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts index ecc58776c07f..8837618d6c75 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts @@ -21,7 +21,7 @@ import { RECORDS_FIELD, REPORT_METRIC_FIELD, PERCENTILE_RANKS, ReportTypes } fro import { obsvReportConfigMap } from '../obsv_exploratory_view'; import { sampleAttributeWithReferenceLines } from './test_data/sample_attribute_with_reference_lines'; import { lensPluginMock } from '@kbn/lens-plugin/public/mocks'; -import { FormulaPublicApi } from '@kbn/lens-plugin/public'; +import { FormulaPublicApi, XYState } from '@kbn/lens-plugin/public'; describe('Lens Attribute', () => { mockAppDataView(); @@ -470,11 +470,9 @@ describe('Lens Attribute', () => { layerConfig: layerConfig1, sourceField: USER_AGENT_NAME, layerId: 'layer0', - indexPattern: mockDataView, - labels: layerConfig.seriesConfig.labels, }); - expect(lnsAttr.visualization?.layers).toEqual([ + expect((lnsAttr.visualization as XYState)?.layers).toEqual([ { accessors: ['y-axis-column-layer0-0'], layerId: 'layer0', @@ -501,7 +499,7 @@ describe('Lens Attribute', () => { 'breakdown-column-layer0': { dataType: 'string', isBucketed: true, - label: 'Top values of Browser family', + label: 'Browser family', operationType: 'terms', params: { missingBucket: false, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts index 9d39286f6899..fe45872bf5a8 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts @@ -34,6 +34,8 @@ import { XYCurveType, XYState, YAxisMode, + HeatmapVisualizationState, + MetricState, } from '@kbn/lens-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/common'; import { PersistableFilter } from '@kbn/lens-plugin/common'; @@ -58,6 +60,7 @@ import { ParamFilter, SeriesConfig, SupportedOperations, + TermColumnParamsOrderBy, UrlFilter, URLReportDefinition, } from '../types'; @@ -151,7 +154,7 @@ export interface LayerConfig { export class LensAttributes { layers: Record; - visualization?: XYState; + visualization?: XYState | HeatmapVisualizationState | MetricState; layerConfigs: LayerConfig[] = []; isMultiSeries?: boolean; seriesReferenceLines: Record< @@ -175,6 +178,7 @@ export class LensAttributes { this.seriesReferenceLines = {}; this.reportType = reportType; this.lensFormulaHelper = lensFormulaHelper; + this.isMultiSeries = layerConfigs.length > 1; layerConfigs.forEach(({ seriesConfig, operationType }) => { if (operationType && reportType !== ReportTypes.SINGLE_METRIC) { @@ -186,14 +190,13 @@ export class LensAttributes { }); } }); + this.layerConfigs = layerConfigs; + this.globalFilter = this.getGlobalFilter(this.isMultiSeries); if (reportType === ReportTypes.SINGLE_METRIC) { return; } - this.layerConfigs = layerConfigs; - this.isMultiSeries = layerConfigs.length > 1; - this.globalFilter = this.getGlobalFilter(this.isMultiSeries); this.layers = this.getLayers(); this.visualization = this.getXyState(); } @@ -217,34 +220,47 @@ export class LensAttributes { getBreakdownColumn({ sourceField, layerId, - labels, - indexPattern, layerConfig, + alphabeticOrder, + size = 10, }: { sourceField: string; layerId: string; - labels: Record; - indexPattern: DataView; layerConfig: LayerConfig; + alphabeticOrder?: boolean; + size?: number; }): TermsIndexPatternColumn { - const fieldMeta = indexPattern.getFieldByName(sourceField); + const { dataView, seriesConfig } = layerConfig; + + const fieldMeta = dataView.getFieldByName(sourceField); - const { sourceField: yAxisSourceField } = layerConfig.seriesConfig.yAxisColumns[0]; + const { sourceField: yAxisSourceField } = seriesConfig.yAxisColumns[0]; + + const labels = seriesConfig.labels ?? {}; const isFormulaColumn = yAxisSourceField === RECORDS_PERCENTAGE_FIELD; + let orderBy: TermColumnParamsOrderBy = { + type: 'column', + columnId: `y-axis-column-${layerId}-0`, + }; + + if (isFormulaColumn) { + orderBy = { type: 'custom' }; + } else if (alphabeticOrder) { + orderBy = { type: 'alphabetical', fallback: true }; + } + return { sourceField, - label: `Top values of ${labels[sourceField]}`, + label: labels[sourceField], dataType: fieldMeta?.type as DataType, operationType: 'terms', scale: 'ordinal', isBucketed: true, params: { - orderBy: isFormulaColumn - ? { type: 'custom' } - : { type: 'column', columnId: `y-axis-column-${layerId}-0` }, - size: 10, + orderBy, + size, orderDirection: 'desc', otherBucket: true, missingBucket: false, @@ -504,9 +520,7 @@ export class LensAttributes { return this.getBreakdownColumn({ layerId, layerConfig, - indexPattern: layerConfig.dataView, sourceField: layerConfig.breakdown || layerConfig.seriesConfig.breakdownFields[0], - labels: layerConfig.seriesConfig.labels, }); } @@ -1006,8 +1020,6 @@ export class LensAttributes { ? this.getBreakdownColumn({ layerId, sourceField: breakdown!, - indexPattern: layerConfig.dataView, - labels: layerConfig.seriesConfig.labels, layerConfig, }) : null; @@ -1230,7 +1242,10 @@ export class LensAttributes { return { internalReferences, adHocDataViews }; } - getJSON(lastRefresh?: number): TypedLensByValueInput['attributes'] { + getJSON( + visualizationType: 'lnsXY' | 'lnsLegacyMetric' | 'lnsHeatmap' = 'lnsXY', + lastRefresh?: number + ): TypedLensByValueInput['attributes'] { const query = this.globalFilter || this.layerConfigs[0].seriesConfig.query; const { internalReferences, adHocDataViews } = this.getReferences(); @@ -1238,7 +1253,7 @@ export class LensAttributes { return { title: 'Prefilled from exploratory view app', description: lastRefresh ? `Last refreshed at ${new Date(lastRefresh).toISOString()}` : '', - visualizationType: 'lnsXY', + visualizationType, references: [], state: { internalReferences, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts new file mode 100644 index 000000000000..d62bd8684b48 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts @@ -0,0 +1,96 @@ +/* + * Copyright 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 { FormulaPublicApi, HeatmapVisualizationState } from '@kbn/lens-plugin/public'; + +import { euiPaletteNegative } from '@elastic/eui'; +import { ColorStop } from '@kbn/coloring'; +import { LayerConfig } from '../lens_attributes'; +import { SingleMetricLensAttributes } from './single_metric_attributes'; + +export class HeatMapLensAttributes extends SingleMetricLensAttributes { + xColumnId: string; + layerId: string; + breakDownColumnId: string; + + constructor( + layerConfigs: LayerConfig[], + reportType: string, + lensFormulaHelper: FormulaPublicApi + ) { + super(layerConfigs, reportType, lensFormulaHelper); + + this.xColumnId = 'layer-0-column-x-1'; + this.breakDownColumnId = 'layer-0-breakdown-column'; + this.layerId = 'layer0'; + const layer0 = this.getSingleMetricLayer()!; + + layer0.columns[this.xColumnId] = this.getDateHistogramColumn('@timestamp'); + + let columnOrder = [this.xColumnId]; + const layerConfig = layerConfigs[0]; + + if (layerConfig.breakdown) { + columnOrder = [this.breakDownColumnId, ...columnOrder]; + layer0.columns[this.breakDownColumnId] = this.getBreakdownColumn({ + layerConfig, + sourceField: layerConfig.breakdown, + layerId: this.layerId, + alphabeticOrder: true, + }); + } + + layer0.columnOrder = [...columnOrder, ...layer0.columnOrder]; + + this.layers = { layer0 }; + + this.visualization = this.getHeatmapState(); + } + + getHeatmapState() { + const negativePalette = euiPaletteNegative(5); + const layerConfig = this.layerConfigs[0]; + + return { + shape: 'heatmap', + layerId: this.layerId, + layerType: 'data', + legend: { + isVisible: true, + position: 'right', + type: 'heatmap_legend', + }, + gridConfig: { + type: 'heatmap_grid', + isCellLabelVisible: false, + isYAxisLabelVisible: true, + isXAxisLabelVisible: true, + isYAxisTitleVisible: false, + isXAxisTitleVisible: false, + xTitle: '', + }, + valueAccessor: this.columnId, + xAccessor: this.xColumnId, + yAccessor: layerConfig.breakdown ? this.breakDownColumnId : undefined, + palette: { + type: 'palette', + name: 'negative', + params: { + name: 'negative', + continuity: 'above', + reverse: false, + stops: negativePalette.map((nColor, ind) => ({ + color: nColor, + stop: ind === 0 ? 1 : ind * 20, + })) as ColorStop[], + rangeMin: 0, + }, + accessor: this.columnId, + }, + } as HeatmapVisualizationState; + } +} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts index cec2617feacf..7897b691e6fc 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts @@ -57,9 +57,9 @@ describe('SingleMetricAttributes', () => { }); it('returns attributes as expected', () => { - const jsonAttr = lnsAttr.getJSON(); + const jsonAttr = lnsAttr.getJSON('lnsLegacyMetric'); expect(jsonAttr).toEqual({ - description: 'undefined', + description: '', references: [], state: { adHocDataViews: { [mockDataView.title]: mockDataView.toSpec(false) }, @@ -88,6 +88,9 @@ describe('SingleMetricAttributes', () => { operationType: 'median', scale: 'ratio', sourceField: 'transaction.duration.us', + params: { + emptyAsNull: true, + }, }, }, incompleteColumns: {}, @@ -121,9 +124,9 @@ describe('SingleMetricAttributes', () => { formulaHelper ); - const jsonAttr = lnsAttr.getJSON(); + const jsonAttr = lnsAttr.getJSON('lnsLegacyMetric'); expect(jsonAttr).toEqual({ - description: 'undefined', + description: '', references: [], state: { adHocDataViews: { [mockDataView.title]: mockDataView.toSpec(false) }, @@ -206,7 +209,7 @@ describe('SingleMetricAttributes', () => { formulaHelper ); - const jsonAttr = lnsAttr.getJSON(); + const jsonAttr = lnsAttr.getJSON('lnsLegacyMetric'); expect(jsonAttr).toEqual(sampleMetricFormulaAttribute); }); }); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts index 1a7fe32d6c40..b1bf0782e0d2 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts @@ -5,12 +5,7 @@ * 2.0. */ -import { - FormulaPublicApi, - MetricState, - OperationType, - TypedLensByValueInput, -} from '@kbn/lens-plugin/public'; +import { FormulaPublicApi, MetricState, OperationType } from '@kbn/lens-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/common'; @@ -44,7 +39,12 @@ export class SingleMetricLensAttributes extends LensAttributes { this.columnId = 'layer-0-column-1'; this.globalFilter = this.getGlobalFilter(this.isMultiSeries); - this.layers = this.getSingleMetricLayer()!; + const layer0 = this.getSingleMetricLayer()!; + + this.layers = { + layer0, + }; + this.visualization = this.getMetricState(); } getSingleMetricLayer() { @@ -100,18 +100,19 @@ export class SingleMetricLensAttributes extends LensAttributes { } return { - layer0: { - columns: { - [this.columnId]: { - ...buildNumberColumn(sourceField), - label: columnLabel ?? '', - operationType: sourceField === RECORDS_FIELD ? 'count' : operationType || 'median', - filter: columnFilter, + columns: { + [this.columnId]: { + ...buildNumberColumn(sourceField), + label: columnLabel ?? '', + operationType: sourceField === RECORDS_FIELD ? 'count' : operationType || 'median', + filter: columnFilter, + params: { + emptyAsNull: true, }, }, - columnOrder: [this.columnId], - incompleteColumns: {}, }, + columnOrder: [this.columnId], + incompleteColumns: {}, }; } } @@ -149,9 +150,7 @@ export class SingleMetricLensAttributes extends LensAttributes { dataView ); - return { - layer0: layer!, - }; + return layer!; } getPercentileLayer({ @@ -168,17 +167,15 @@ export class SingleMetricLensAttributes extends LensAttributes { columnFilter?: ColumnFilter; }) { return { - layer0: { - columns: { - [this.columnId]: { - ...this.getPercentileNumberColumn(sourceField, operationType!, seriesConfig), - label: columnLabel ?? '', - filter: columnFilter, - }, + columns: { + [this.columnId]: { + ...this.getPercentileNumberColumn(sourceField, operationType!, seriesConfig), + label: columnLabel ?? '', + filter: columnFilter, }, - columnOrder: [this.columnId], - incompleteColumns: {}, }, + columnOrder: [this.columnId], + incompleteColumns: {}, }; } @@ -191,31 +188,4 @@ export class SingleMetricLensAttributes extends LensAttributes { size: 's', }; } - - getJSON(refresh?: number): TypedLensByValueInput['attributes'] { - const query = this.globalFilter || this.layerConfigs[0].seriesConfig.query; - - const visualization = this.getMetricState(); - - const { internalReferences, adHocDataViews } = this.getReferences(); - - return { - title: 'Prefilled from exploratory view app', - description: String(refresh), - visualizationType: 'lnsLegacyMetric', - references: [], - state: { - internalReferences, - adHocDataViews, - visualization, - datasourceStates: { - formBased: { - layers: this.layers, - }, - }, - query: query || { query: '', language: 'kuery' }, - filters: [], - }, - }; - } } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts new file mode 100644 index 000000000000..1c41aaa8d4db --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ConfigProps, SeriesConfig } from '../../types'; +import { FieldLabels, RECORDS_FIELD, REPORT_METRIC_FIELD, ReportTypes } from '../constants'; +import { DOWN_LABEL, UP_LABEL } from '../constants/labels'; +import { SYNTHETICS_STEP_NAME } from '../constants/field_names/synthetics'; +import { buildExistsFilter } from '../utils'; + +const SUMMARY_UP = 'summary.up'; +const SUMMARY_DOWN = 'summary.down'; + +export function getSyntheticsHeatmapConfig({ dataView }: ConfigProps): SeriesConfig { + return { + reportType: ReportTypes.HEATMAP, + defaultSeriesType: 'bar_stacked', + seriesTypes: [], + xAxisColumn: { + sourceField: '@timestamp', + }, + yAxisColumns: [ + { + sourceField: REPORT_METRIC_FIELD, + operationType: 'median', + }, + ], + hasOperationType: false, + filterFields: ['observer.geo.name', 'monitor.type', 'tags', 'url.full'], + breakdownFields: ['observer.geo.name', 'monitor.type', 'monitor.name', SYNTHETICS_STEP_NAME], + baseFilters: [], + definitionFields: [ + { field: 'monitor.name' }, + { field: 'url.full', filters: buildExistsFilter('summary.up', dataView) }, + ], + metricOptions: [ + { + label: 'Failed tests', + id: 'failed_tests', + columnFilter: { language: 'kuery', query: 'summary.down > 0' }, + format: 'number', + field: RECORDS_FIELD, + }, + ], + labels: { ...FieldLabels, [SUMMARY_UP]: UP_LABEL, [SUMMARY_DOWN]: DOWN_LABEL }, + }; +} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts index d87517e76134..e012f04e28ad 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts @@ -38,7 +38,7 @@ export const sampleAttributeCoreWebVital = { 'x-axis-column-layer0': { dataType: 'string', isBucketed: true, - label: 'Top values of Operating system', + label: 'Operating system', operationType: 'terms', params: { missingBucket: false, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts index 1a3ef129fa94..d1f63100ecbe 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts @@ -8,7 +8,7 @@ import { mockDataView } from '../../rtl_helpers'; export const sampleMetricFormulaAttribute = { - description: 'undefined', + description: '', references: [], state: { adHocDataViews: { [mockDataView.title]: mockDataView.toSpec(false) }, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx index f4c438b693d4..04fec072229d 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx @@ -16,6 +16,7 @@ import { XYState, } from '@kbn/lens-plugin/public'; import { ViewMode } from '@kbn/embeddable-plugin/common'; +import { HeatMapLensAttributes } from '../configurations/lens_attributes/heatmap_attributes'; import { SingleMetricLensAttributes } from '../configurations/lens_attributes/single_metric_attributes'; import { AllSeries, ReportTypes, useTheme } from '../../../..'; import { LayerConfig, LensAttributes } from '../configurations/lens_attributes'; @@ -106,17 +107,44 @@ export default function Embeddable({ ); let lensAttributes; - try { - if (reportType === ReportTypes.SINGLE_METRIC) { - lensAttributes = new SingleMetricLensAttributes(layerConfigs, reportType, lensFormulaHelper!); - } else { - lensAttributes = new LensAttributes(layerConfigs, reportType, lensFormulaHelper); - } - // eslint-disable-next-line no-empty - } catch (error) {} + let attributesJSON = customLensAttrs; + if (!customLensAttrs) { + try { + if (reportType === ReportTypes.SINGLE_METRIC) { + lensAttributes = new SingleMetricLensAttributes( + layerConfigs, + reportType, + lensFormulaHelper! + ); + attributesJSON = lensAttributes?.getJSON('lnsLegacyMetric'); + } else if (reportType === ReportTypes.HEATMAP) { + lensAttributes = new HeatMapLensAttributes(layerConfigs, reportType, lensFormulaHelper!); + attributesJSON = lensAttributes?.getJSON('lnsHeatmap'); + } else { + lensAttributes = new LensAttributes(layerConfigs, reportType, lensFormulaHelper); + attributesJSON = lensAttributes?.getJSON(); + } + // eslint-disable-next-line no-empty + } catch (error) {} + } - const attributesJSON = customLensAttrs ?? lensAttributes?.getJSON(); const timeRange = customTimeRange ?? series?.time; + + const actions = useActions({ + withActions, + attributes, + reportType, + appId, + setIsSaveOpen, + setAddToCaseOpen, + lensAttributes: attributesJSON, + timeRange, + }); + + if (!attributesJSON) { + return null; + } + if (typeof axisTitlesVisibility !== 'undefined') { (attributesJSON.state.visualization as XYState).axisTitlesVisibilitySettings = axisTitlesVisibility; @@ -137,17 +165,6 @@ export default function Embeddable({ }; } - const actions = useActions({ - withActions, - attributes, - reportType, - appId, - setIsSaveOpen, - setAddToCaseOpen, - lensAttributes: attributesJSON, - timeRange, - }); - if (!attributesJSON && layerConfigs.length < 1) { return null; } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts index 1f1997d39484..e65da3849484 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts @@ -9,6 +9,7 @@ import { useMemo } from 'react'; import { isEmpty } from 'lodash'; import { TypedLensByValueInput } from '@kbn/lens-plugin/public'; import { EuiTheme } from '@kbn/kibana-react-plugin/common'; +import { HeatMapLensAttributes } from '../configurations/lens_attributes/heatmap_attributes'; import { useLensFormulaHelper } from './use_lens_formula_helper'; import { ALL_VALUES_SELECTED } from '../configurations/constants/url_constants'; import { LayerConfig, LensAttributes } from '../configurations/lens_attributes'; @@ -130,12 +131,22 @@ export const useLensAttributes = (): TypedLensByValueInput['attributes'] | null lensFormulaHelper ); - return lensAttributes.getJSON(lastRefresh); + return lensAttributes.getJSON('lnsLegacyMetric', lastRefresh); + } + + if (reportTypeT === 'heatmap') { + const lensAttributes = new HeatMapLensAttributes( + layerConfigs, + reportTypeT, + lensFormulaHelper + ); + + return lensAttributes.getJSON('lnsHeatmap', lastRefresh); } const lensAttributes = new LensAttributes(layerConfigs, reportTypeT, lensFormulaHelper); - return lensAttributes.getJSON(lastRefresh); + return lensAttributes.getJSON('lnsXY', lastRefresh); // we also want to check the state on allSeries changes // eslint-disable-next-line react-hooks/exhaustive-deps }, [dataViews, reportType, storage, theme, lastRefresh, allSeries, lensFormulaHelper]); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx index 14d5101a561f..77655518ac8c 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx @@ -8,6 +8,7 @@ import * as React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiErrorBoundary } from '@elastic/eui'; +import { getSyntheticsHeatmapConfig } from './configurations/synthetics/heatmap_config'; import { getSyntheticsSingleMetricConfig } from './configurations/synthetics/single_metric_config'; import { ExploratoryViewPage } from '.'; import { ExploratoryViewContextProvider } from './contexts/exploratory_view_config'; @@ -16,6 +17,7 @@ import { AppDataType, ReportViewType } from './types'; import { CORE_WEB_VITALS_LABEL, DEVICE_DISTRIBUTION_LABEL, + HEATMAP_LABEL, KPI_OVER_TIME_LABEL, PERF_DIST_LABEL, SINGLE_METRIC_LABEL, @@ -89,6 +91,7 @@ export const reportTypesList: Array<{ { reportType: 'core-web-vitals', label: CORE_WEB_VITALS_LABEL }, { reportType: 'device-data-distribution', label: DEVICE_DISTRIBUTION_LABEL }, { reportType: 'single-metric', label: SINGLE_METRIC_LABEL }, + { reportType: 'heatmap', label: HEATMAP_LABEL }, ]; export const obsvReportConfigMap = { @@ -102,6 +105,7 @@ export const obsvReportConfigMap = { getSyntheticsKPIConfig, getSyntheticsDistributionConfig, getSyntheticsSingleMetricConfig, + getSyntheticsHeatmapConfig, ], [DataTypes.MOBILE]: [ getMobileKPIConfig, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts index dc195fc08c01..5094088b436f 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts @@ -32,6 +32,7 @@ export const ReportViewTypes = { cwv: 'core-web-vitals', mdd: 'device-data-distribution', smt: 'single-metric', + htm: 'heatmap', } as const; type ValueOf = T[keyof T]; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx new file mode 100644 index 000000000000..8db063f50d63 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { useParams } from 'react-router-dom'; +import { ClientPluginsStart } from '../../../../../plugin'; + +export const MonitorFailedTests = ({ time }: { time: { to: string; from: string } }) => { + const { observability } = useKibana().services; + + const { ExploratoryViewEmbeddable } = observability; + + const { monitorId } = useParams<{ monitorId: string }>(); + + return ( + + ); +}; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx index fba0664f0ef0..f062a6ab7b10 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx @@ -12,19 +12,25 @@ import { EuiTitle, useEuiTheme, } from '@elastic/eui'; -import React from 'react'; +import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { FailedTestsCount } from './failed_tests_count'; import { useGetUrlParams } from '../../../hooks'; import { SyntheticsDatePicker } from '../../common/date_picker/synthetics_date_picker'; import { MonitorErrorsCount } from '../monitor_summary/monitor_errors_count'; import { ErrorsList } from './errors_list'; +import { MonitorFailedTests } from './failed_tests'; export const MonitorErrors = () => { const { euiTheme } = useEuiTheme(); const { dateRangeStart, dateRangeEnd } = useGetUrlParams(); + const time = useMemo( + () => ({ from: dateRangeStart, to: dateRangeEnd }), + [dateRangeEnd, dateRangeStart] + ); + return ( <> @@ -50,6 +56,7 @@ export const MonitorErrors = () => {

      {FAILED_TESTS_LABEL}

      + From 5431d1fb78011385813384ca57c5aebf124afaea Mon Sep 17 00:00:00 2001 From: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Date: Wed, 2 Nov 2022 09:48:22 +0100 Subject: [PATCH 83/87] Prerelease toggle (#143853) * WIP: prerelease toggle * changed styling * fixed switch * auto upgrade and hiding button on callout if no ga available * tweak prereleaseIntegrationsEnabled state to add undefined state in beginning * fixing types and tests * fixing types * removed dummy endpoint package * extracted hooks to avoid double loading of packages and categories * prevent double loading of package details * updated openapi * fixing tests * added try catch around loading settings in preconfig * error handling on integrations, fixing cypress test with that * reading prerelease from settings during package install * fix tests * fixing tests * added back experimental as deprecated, fix more tests * fixed issue in package details overview where nlatest version didnt show prerelease * changed getPackageInfo to load prerelease from settings if not provided * fixing tests, moved getSettings to bulk install fn * fixing cypress and endpoint tests * fix tests * fix tests * added back experimental flag in other plugins, as it is not exaclty the same as prerelease * reverted mappings change in api_integration * fixed prerelease condition, fix limited test, trying to fix field limit * removed experimental flag from epr api call * added unit test on version dropdown and prerelease callout, set field limit to 1500 * added UI package version check for prerelease disabled case * fixed synthetics test * extracted getSettings to a helper function * removed using prerease setting in auto upgrades and install * fixing tests, added back prerelease flag to install apis * fixing a bug with version and release badge of installed integrations * reload package in overview after loading prerelease setting, this is to show available upgrade if package is installed * fixing tests by passing prerelease flag on apis * fixing cypress test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../migrations/check_registered_types.test.ts | 2 +- .../plugins/fleet/common/openapi/bundled.json | 58 +++++++- .../plugins/fleet/common/openapi/bundled.yaml | 40 +++++ .../openapi/components/schemas/settings.yaml | 2 + .../common/openapi/paths/epm@categories.yaml | 19 +++ .../common/openapi/paths/epm@packages.yaml | 17 +++ .../fleet/common/types/models/settings.ts | 1 + .../fleet/common/types/rest_spec/epm.ts | 4 + .../fleet/cypress/e2e/install_assets.cy.ts | 2 +- .../fleet/cypress/e2e/integrations_mock.cy.ts | 6 +- .../fleet/cypress/e2e/integrations_real.cy.ts | 2 +- .../debug/components/integration_debugger.tsx | 2 +- .../applications/integrations/hooks/index.ts | 2 + .../integrations/hooks/use_categories.tsx | 55 +++++++ .../integrations/hooks/use_packages.tsx | 56 +++++++ .../integration_preference.stories.tsx | 8 +- .../epm/components/integration_preference.tsx | 67 ++++++++- .../epm/screens/detail/index.test.tsx | 75 +++++++++- .../sections/epm/screens/detail/index.tsx | 116 ++++++++++++++- .../epm/screens/detail/overview/overview.tsx | 140 ++++++++++++------ .../epm/screens/home/available_packages.tsx | 31 ++-- .../sections/epm/screens/home/index.tsx | 25 +++- .../hooks/use_package_installations.tsx | 2 +- .../fleet/public/hooks/use_request/epm.ts | 35 ++++- x-pack/plugins/fleet/public/services/index.ts | 1 + .../services/package_prerelease.test.ts | 34 +++++ .../public/services/package_prerelease.ts | 11 ++ .../install_all_packages.ts | 2 +- x-pack/plugins/fleet/server/plugin.ts | 2 +- .../fleet/server/routes/epm/handlers.ts | 22 ++- .../server/routes/package_policy/handlers.ts | 1 + .../fleet/server/saved_objects/index.ts | 1 + .../saved_objects/migrations/to_v8_6_0.ts | 2 + .../services/epm/package_service.test.ts | 2 +- .../server/services/epm/package_service.ts | 13 +- .../epm/packages/bulk_install_packages.ts | 4 +- .../server/services/epm/packages/get.test.ts | 7 + .../fleet/server/services/epm/packages/get.ts | 19 ++- .../epm/packages/get_prerelease_setting.ts | 25 ++++ .../server/services/epm/packages/install.ts | 4 +- .../server/services/epm/registry/index.ts | 28 +++- .../fleet/server/services/package_policy.ts | 6 + .../plugins/fleet/server/services/settings.ts | 2 +- .../fleet/server/types/rest_spec/epm.ts | 20 ++- .../fleet/server/types/rest_spec/settings.ts | 1 + .../apis/epm/bulk_upgrade.ts | 8 +- .../apis/epm/custom_ingest_pipeline.ts | 2 +- .../fleet_api_integration/apis/epm/delete.ts | 1 + .../apis/epm/final_pipeline.ts | 2 +- .../fleet_api_integration/apis/epm/get.ts | 9 +- .../apis/epm/install_by_upload.ts | 1 + .../apis/epm/install_error_rollback.ts | 5 +- .../apis/epm/install_overrides.ts | 1 + .../apis/epm/install_prerelease.ts | 1 + .../epm/install_remove_kbn_assets_in_space.ts | 1 + .../apis/epm/install_remove_multiple.ts | 1 + .../apis/epm/install_tag_assets.ts | 1 + .../apis/epm/install_update.ts | 1 + .../fleet_api_integration/apis/epm/list.ts | 1 + .../apis/epm/package_install_complete.ts | 1 + .../fleet_api_integration/apis/epm/setup.ts | 1 + .../fleet_api_integration/apis/fleet_setup.ts | 2 +- .../apis/package_policy/delete.ts | 1 + x-pack/test/fleet_api_integration/helpers.ts | 16 ++ .../maps/group4/geofile_wizard_auto_open.ts | 2 +- .../services/uptime/synthetics_package.ts | 2 +- 66 files changed, 886 insertions(+), 148 deletions(-) create mode 100644 x-pack/plugins/fleet/public/applications/integrations/hooks/use_categories.tsx create mode 100644 x-pack/plugins/fleet/public/applications/integrations/hooks/use_packages.tsx create mode 100644 x-pack/plugins/fleet/public/services/package_prerelease.test.ts create mode 100644 x-pack/plugins/fleet/public/services/package_prerelease.ts create mode 100644 x-pack/plugins/fleet/server/services/epm/packages/get_prerelease_setting.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts index b1aa1e5df923..af572532a13e 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts @@ -99,7 +99,7 @@ describe('checking migration metadata changes on all registered SO types', () => "ingest-download-sources": "1e69dabd6db5e320fe08c5bda8f35f29bafc6b54", "ingest-outputs": "29b867bf7bfd28b1e17c84697dce5c6d078f9705", "ingest-package-policies": "e8707a8c7821ea085e67c2d213e24efa56307393", - "ingest_manager_settings": "bb71f20e36a9ac3a2e46d9345e2caa96e7bf8c22", + "ingest_manager_settings": "6f36714825cc15ea8d7cda06fde7851611a532b4", "inventory-view": "bc2bd1e7ec7c186159447ab228d269f22bd39056", "kql-telemetry": "29544cd7d3b767c5399878efae6bd724d24c03fd", "legacy-url-alias": "7172dfd54f2e0c89fe263fd7095519b2d826a930", diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index b2ccff5e7188..ab8747170f76 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -247,7 +247,35 @@ } }, "operationId": "get-package-categories" - } + }, + "parameters": [ + { + "in": "query", + "name": "prerelease", + "schema": { + "type": "boolean", + "default": false + }, + "description": "Whether to include prerelease packages in categories count (e.g. beta, rc, preview) " + }, + { + "in": "query", + "name": "experimental", + "deprecated": true, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "in": "query", + "name": "include_policy_templates", + "schema": { + "type": "boolean", + "default": false + } + } + ] }, "/epm/packages/limited": { "get": { @@ -304,6 +332,31 @@ "default": false }, "description": "Whether to exclude the install status of each package. Enabling this option will opt in to caching for the response via `cache-control` headers. If you don't need up-to-date installation info for a package, and are querying for a list of available packages, providing this flag can improve performance substantially." + }, + { + "in": "query", + "name": "prerelease", + "schema": { + "type": "boolean", + "default": false + }, + "description": "Whether to return prerelease versions of packages (e.g. beta, rc, preview) " + }, + { + "in": "query", + "name": "experimental", + "deprecated": true, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "in": "query", + "name": "category", + "schema": { + "type": "string" + } } ] }, @@ -4206,6 +4259,9 @@ "items": { "type": "string" } + }, + "prerelease_integrations_enabled": { + "type": "boolean" } }, "required": [ diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index 139711f13b89..eca789024e4f 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -154,6 +154,26 @@ paths: schema: $ref: '#/components/schemas/get_categories_response' operationId: get-package-categories + parameters: + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to include prerelease packages in categories count (e.g. beta, + rc, preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: include_policy_templates + schema: + type: boolean + default: false /epm/packages/limited: get: summary: Packages - Get limited list @@ -196,6 +216,24 @@ paths: headers. If you don't need up-to-date installation info for a package, and are querying for a list of available packages, providing this flag can improve performance substantially. + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, + preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: category + schema: + type: string /epm/packages/_bulk: post: summary: Packages - Bulk install @@ -2617,6 +2655,8 @@ components: type: array items: type: string + prerelease_integrations_enabled: + type: boolean required: - fleet_server_hosts - id diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml index 280460771989..145b598267a0 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/settings.yaml @@ -9,6 +9,8 @@ properties: type: array items: type: string + prerelease_integrations_enabled: + type: boolean required: - fleet_server_hosts - id diff --git a/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml b/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml index 1f2c3930d6ba..9a69a930fa98 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/epm@categories.yaml @@ -9,3 +9,22 @@ get: schema: $ref: ../components/schemas/get_categories_response.yaml operationId: get-package-categories +parameters: + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to include prerelease packages in categories count (e.g. beta, rc, preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: include_policy_templates + schema: + type: boolean + default: false \ No newline at end of file diff --git a/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml b/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml index 9c29b9d18357..a6332360283b 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/epm@packages.yaml @@ -20,3 +20,20 @@ parameters: caching for the response via `cache-control` headers. If you don't need up-to-date installation info for a package, and are querying for a list of available packages, providing this flag can improve performance substantially. + - in: query + name: prerelease + schema: + type: boolean + default: false + description: >- + Whether to return prerelease versions of packages (e.g. beta, rc, preview) + - in: query + name: experimental + deprecated: true + schema: + type: boolean + default: false + - in: query + name: category + schema: + type: string diff --git a/x-pack/plugins/fleet/common/types/models/settings.ts b/x-pack/plugins/fleet/common/types/models/settings.ts index 5a33fea91044..c70fa944e6c2 100644 --- a/x-pack/plugins/fleet/common/types/models/settings.ts +++ b/x-pack/plugins/fleet/common/types/models/settings.ts @@ -10,6 +10,7 @@ import type { SavedObjectAttributes } from '@kbn/core/public'; export interface BaseSettings { has_seen_add_data_notice?: boolean; fleet_server_hosts?: string[]; + prerelease_integrations_enabled: boolean; } export interface Settings extends BaseSettings { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts index e12bdbb20232..105558e0d062 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts @@ -17,7 +17,9 @@ import type { export interface GetCategoriesRequest { query: { + // deprecated in 8.6 experimental?: boolean; + prerelease?: boolean; include_policy_templates?: boolean; }; } @@ -31,7 +33,9 @@ export interface GetCategoriesResponse { export interface GetPackagesRequest { query: { category?: string; + // deprecated in 8.6 experimental?: boolean; + prerelease?: boolean; excludeInstallStatus?: boolean; }; } diff --git a/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts b/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts index 81ef56a4b1f5..4234df15d861 100644 --- a/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts @@ -35,7 +35,7 @@ describe('Install unverified package assets', () => { }).as('installAssets'); // save mocking out the whole package response, but make it so that fleet server is always uninstalled - cy.intercept('GET', '/api/fleet/epm/packages/fleet_server', (req) => { + cy.intercept('GET', '/api/fleet/epm/packages/fleet_server*', (req) => { req.continue((res) => { if (res.body?.item?.savedObject) { delete res.body.item.savedObject; diff --git a/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts b/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts index ce207cd3598e..3095f628599d 100644 --- a/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/integrations_mock.cy.ts @@ -16,7 +16,7 @@ describe('Add Integration - Mock API', () => { const oldVersion = '0.3.3'; const newVersion = '1.3.4'; beforeEach(() => { - cy.intercept('/api/fleet/epm/packages?experimental=true', { + cy.intercept('/api/fleet/epm/packages?prerelease=true', { items: [ { name: 'apache', @@ -28,7 +28,7 @@ describe('Add Integration - Mock API', () => { ], }); - cy.intercept(`/api/fleet/epm/packages/apache/${oldVersion}`, { + cy.intercept(`/api/fleet/epm/packages/apache/${oldVersion}*`, { item: { name: 'apache', version: oldVersion, @@ -99,7 +99,7 @@ describe('Add Integration - Mock API', () => { cy.getBySel(INTEGRATION_POLICIES_UPGRADE_CHECKBOX).uncheck({ force: true }); - cy.intercept(`/api/fleet/epm/packages/apache/${newVersion}`, { + cy.intercept(`/api/fleet/epm/packages/apache/${newVersion}*`, { item: { name: 'apache', version: newVersion, diff --git a/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts b/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts index c3bee2d758df..3b7c29561bc9 100644 --- a/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/integrations_real.cy.ts @@ -174,7 +174,7 @@ describe('Add Integration - Real API', () => { setupIntegrations(); cy.getBySel(getIntegrationCategories('aws')).click(); cy.getBySel(INTEGRATIONS_SEARCHBAR.BADGE).contains('AWS').should('exist'); - cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 30); + cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 28); cy.getBySel(INTEGRATIONS_SEARCHBAR.INPUT).clear().type('Cloud'); cy.getBySel(INTEGRATION_LIST).find('.euiCard').should('have.length', 3); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx index 9c3fa21c752f..30fc1b84964f 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx @@ -39,7 +39,7 @@ import { queryClient } from '..'; import { pkgKeyFromPackageInfo } from '../../../services'; const fetchInstalledIntegrations = async () => { - const response = await sendGetPackages({ experimental: true }); + const response = await sendGetPackages({ prerelease: true }); if (response.error) { throw new Error(response.error.message); diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts b/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts index 5b6b19af169f..76b6b49c8c5c 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/index.ts @@ -14,3 +14,5 @@ export * from './use_agent_policy_context'; export * from './use_integrations_state'; export * from './use_confirm_force_install'; export * from './use_confirm_open_unverified'; +export * from './use_packages'; +export * from './use_categories'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_categories.tsx b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_categories.tsx new file mode 100644 index 000000000000..8b441a229e9b --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_categories.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEffect, useCallback, useState } from 'react'; + +import type { RequestError } from '../../fleet/hooks'; +import { sendGetCategories } from '../../fleet/hooks'; +import type { GetCategoriesResponse } from '../types'; + +export function useCategories(prerelease?: boolean) { + const [data, setData] = useState(); + const [error, setError] = useState(); + const [isLoading, setIsLoading] = useState(false); + const [isPrereleaseEnabled, setIsPrereleaseEnabled] = useState(prerelease); + + const fetchData = useCallback(async () => { + if (prerelease === undefined) { + return; + } + if (isPrereleaseEnabled === prerelease) { + return; + } + setIsPrereleaseEnabled(prerelease); + setIsLoading(true); + try { + const res = await sendGetCategories({ + include_policy_templates: true, + prerelease, + }); + if (res.error) { + throw res.error; + } + if (res.data) { + setData(res.data); + } + } catch (err) { + setError(err); + } + setIsLoading(false); + }, [prerelease, isPrereleaseEnabled]); + + useEffect(() => { + fetchData(); + }, [fetchData]); + + return { + data, + error, + isLoading, + }; +} diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_packages.tsx b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_packages.tsx new file mode 100644 index 000000000000..efb2f96ed57f --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_packages.tsx @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useEffect, useCallback, useState } from 'react'; + +import type { RequestError } from '../../fleet/hooks'; +import { sendGetPackages } from '../../fleet/hooks'; +import type { GetPackagesResponse } from '../types'; + +export function usePackages(prerelease?: boolean) { + const [data, setData] = useState(); + const [error, setError] = useState(); + const [isLoading, setIsLoading] = useState(false); + const [isPrereleaseEnabled, setIsPrereleaseEnabled] = useState(prerelease); + + const fetchData = useCallback(async () => { + if (prerelease === undefined) { + return; + } + if (isPrereleaseEnabled === prerelease) { + return; + } + setIsPrereleaseEnabled(prerelease); + setIsLoading(true); + try { + const res = await sendGetPackages({ + category: '', + excludeInstallStatus: true, + prerelease, + }); + if (res.error) { + throw res.error; + } + if (res.data) { + setData(res.data); + } + } catch (err) { + setError(err); + } + setIsLoading(false); + }, [prerelease, isPrereleaseEnabled]); + + useEffect(() => { + fetchData(); + }, [fetchData]); + + return { + data, + error, + isLoading, + }; +} diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx index 86b34f2415e2..ebc18d84487d 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.stories.tsx @@ -32,5 +32,11 @@ export default { } as Meta; export const IntegrationPreference = () => { - return ; + return ( + {}} + /> + ); }; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx index b99683adbf8f..4e4aafa271b3 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { useCallback, useEffect } from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; @@ -20,9 +20,10 @@ import { EuiIconTip, EuiFlexGroup, EuiFlexItem, + EuiSwitch, } from '@elastic/eui'; -import { useStartServices } from '../../../hooks'; +import { sendPutSettings, useGetSettings, useStartServices } from '../../../hooks'; export type IntegrationPreferenceType = 'recommended' | 'beats' | 'agent'; @@ -34,6 +35,7 @@ interface Option { export interface Props { initialType: IntegrationPreferenceType; onChange: (type: IntegrationPreferenceType) => void; + onPrereleaseEnabledChange: (prerelease: boolean) => void; } const recommendedTooltip = ( @@ -47,6 +49,10 @@ const Item = styled(EuiFlexItem)` padding-left: ${(props) => props.theme.eui.euiSizeXS}; `; +const EuiSwitchNoWrap = styled(EuiSwitch)` + white-space: nowrap; +`; + const options: Option[] = [ { type: 'recommended', @@ -77,11 +83,46 @@ const options: Option[] = [ }, ]; -export const IntegrationPreference = ({ initialType, onChange }: Props) => { +export const IntegrationPreference = ({ + initialType, + onChange, + onPrereleaseEnabledChange, +}: Props) => { const [idSelected, setIdSelected] = React.useState(initialType); const { docLinks } = useStartServices(); + const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState< + boolean | undefined + >(undefined); + + const { data: settings, error: settingsError } = useGetSettings(); + + useEffect(() => { + const isEnabled = Boolean(settings?.item.prerelease_integrations_enabled); + if (settings?.item) { + setPrereleaseIntegrationsEnabled(isEnabled); + } else if (settingsError) { + setPrereleaseIntegrationsEnabled(false); + } + }, [settings?.item, settingsError]); + + useEffect(() => { + if (prereleaseIntegrationsEnabled !== undefined) { + onPrereleaseEnabledChange(prereleaseIntegrationsEnabled); + } + }, [onPrereleaseEnabledChange, prereleaseIntegrationsEnabled]); + + const updateSettings = useCallback(async (prerelease: boolean) => { + const res = await sendPutSettings({ + prerelease_integrations_enabled: prerelease, + }); + + if (res.error) { + throw res.error; + } + }, []); + const link = ( { label: option.label, })); + const onPrereleaseSwitchChange = ( + event: React.BaseSyntheticEvent< + React.MouseEvent, + HTMLButtonElement, + EventTarget & { checked: boolean } + > + ) => { + const isChecked = event.target.checked; + setPrereleaseIntegrationsEnabled(isChecked); + updateSettings(isChecked); + }; + return ( + {prereleaseIntegrationsEnabled !== undefined && ( + + )} + {title} diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx index 49a8cbeb37d2..cb03f5321e57 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx @@ -17,6 +17,7 @@ import type { GetInfoResponse, GetPackagePoliciesResponse, GetStatsResponse, + GetSettingsResponse, } from '../../../../../../../common/types/rest_spec'; import type { DetailViewPanelName, @@ -79,11 +80,23 @@ describe('when on integration detail', () => { }); }); - describe('and the package is not installed', () => { + function mockGAAndPrereleaseVersions(pkgVersion: string) { + const unInstalledPackage = mockedApi.responseProvider.epmGetInfo('nginx'); + unInstalledPackage.item.status = 'not_installed'; + unInstalledPackage.item.version = pkgVersion; + mockedApi.responseProvider.epmGetInfo.mockImplementation((name, version, query) => { + if (query?.prerelease === false) { + const gaPackage = { item: { ...unInstalledPackage.item } }; + gaPackage.item.version = '1.0.0'; + return gaPackage; + } + return unInstalledPackage; + }); + } + + describe('and the package is not installed and prerelease enabled', () => { beforeEach(async () => { - const unInstalledPackage = mockedApi.responseProvider.epmGetInfo(); - unInstalledPackage.item.status = 'not_installed'; - mockedApi.responseProvider.epmGetInfo.mockReturnValue(unInstalledPackage); + mockGAAndPrereleaseVersions('1.0.0-beta'); await render(); }); @@ -96,6 +109,39 @@ describe('when on integration detail', () => { await mockedApi.waitForApi(); expect(renderResult.queryByTestId('tab-policies')).toBeNull(); }); + + it('should display version select if prerelease setting enabled and prererelase version available', async () => { + await mockedApi.waitForApi(); + const versionSelect = renderResult.queryByTestId('versionSelect'); + expect(versionSelect?.textContent).toEqual('1.0.0-beta1.0.0'); + expect((versionSelect as any)?.value).toEqual('1.0.0-beta'); + }); + + it('should display prerelease callout if prerelease setting enabled and prerelease version available', async () => { + await mockedApi.waitForApi(); + const calloutTitle = renderResult.getByTestId('prereleaseCallout'); + expect(calloutTitle).toBeInTheDocument(); + const calloutGABtn = renderResult.getByTestId('switchToGABtn'); + expect((calloutGABtn as any)?.href).toEqual( + 'http://localhost/mock/app/integrations/detail/nginx-1.0.0/overview' + ); + }); + }); + + describe('and the package is not installed and prerelease disabled', () => { + beforeEach(async () => { + mockGAAndPrereleaseVersions('1.0.0'); + mockedApi.responseProvider.getSettings.mockReturnValue({ + item: { prerelease_integrations_enabled: false, id: '', fleet_server_hosts: [] }, + }); + await render(); + }); + + it('should display version text and no callout if prerelease setting disabled', async () => { + await mockedApi.waitForApi(); + expect((renderResult.queryByTestId('versionText') as any)?.textContent).toEqual('1.0.0'); + expect(renderResult.queryByTestId('prereleaseCallout')).toBeNull(); + }); }); describe('and a custom UI extension is NOT registered', () => { @@ -267,13 +313,16 @@ interface MockedApi< } interface EpmPackageDetailsResponseProvidersMock { - epmGetInfo: jest.MockedFunction<() => GetInfoResponse>; + epmGetInfo: jest.MockedFunction< + (pkgName: string, pkgVersion?: string, options?: { prerelease?: boolean }) => GetInfoResponse + >; epmGetFile: jest.MockedFunction<() => string>; epmGetStats: jest.MockedFunction<() => GetStatsResponse>; fleetSetup: jest.MockedFunction<() => GetFleetStatusResponse>; packagePolicyList: jest.MockedFunction<() => GetPackagePoliciesResponse>; agentPolicyList: jest.MockedFunction<() => GetAgentPoliciesResponse>; appCheckPermissions: jest.MockedFunction<() => CheckPermissionsResponse>; + getSettings: jest.MockedFunction<() => GetSettingsResponse>; } const mockApiCalls = ( @@ -753,6 +802,8 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos success: true, }; + const getSettingsResponse = { item: { prerelease_integrations_enabled: true } }; + const mockedApiInterface: MockedApi = { waitForApi() { return new Promise((resolve) => { @@ -771,14 +822,19 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos packagePolicyList: jest.fn().mockReturnValue(packagePoliciesResponse), agentPolicyList: jest.fn().mockReturnValue(agentPoliciesResponse), appCheckPermissions: jest.fn().mockReturnValue(appCheckPermissionsResponse), + getSettings: jest.fn().mockReturnValue(getSettingsResponse), }, }; - http.get.mockImplementation(async (path: any) => { + http.get.mockImplementation((async (path: any, options: any) => { if (typeof path === 'string') { if (path === epmRouteService.getInfoPath(`nginx`, `0.3.7`)) { markApiCallAsHandled(); - return mockedApiInterface.responseProvider.epmGetInfo(); + return mockedApiInterface.responseProvider.epmGetInfo('nginx'); + } + if (path === epmRouteService.getInfoPath(`nginx`)) { + markApiCallAsHandled(); + return mockedApiInterface.responseProvider.epmGetInfo('nginx', undefined, options.query); } if (path === epmRouteService.getFilePath('/package/nginx/0.3.7/docs/README.md')) { @@ -820,13 +876,16 @@ On Windows, the module was tested with Nginx installed from the Chocolatey repos if (path === '/api/fleet/agents') { return Promise.resolve(); } + if (path === '/api/fleet/settings') { + return mockedApiInterface.responseProvider.getSettings(); + } const err = new Error(`API [GET ${path}] is not MOCKED!`); // eslint-disable-next-line no-console console.error(err); throw err; } - }); + }) as any); return mockedApiInterface; }; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx index d649bede3db4..42c5cc535d6b 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx @@ -17,6 +17,7 @@ import { EuiDescriptionListTitle, EuiFlexGroup, EuiFlexItem, + EuiSelect, EuiSpacer, EuiText, } from '@elastic/eui'; @@ -36,9 +37,10 @@ import { useAuthz, usePermissionCheck, useIntegrationsStateContext, + useGetSettings, } from '../../../../hooks'; import { INTEGRATIONS_ROUTING_PATHS } from '../../../../constants'; -import { ExperimentalFeaturesService } from '../../../../services'; +import { ExperimentalFeaturesService, isPackagePrerelease } from '../../../../services'; import { useGetPackageInfoByKey, useLink, @@ -107,7 +109,7 @@ export function Detail() { const { getId: getAgentPolicyId } = useAgentPolicyContext(); const { getFromIntegrations } = useIntegrationsStateContext(); const { pkgkey, panel } = useParams(); - const { getHref } = useLink(); + const { getHref, getPath } = useLink(); const canInstallPackages = useAuthz().integrations.installPackages; const canReadPackageSettings = useAuthz().integrations.readPackageSettings; const canReadIntegrationPolicies = useAuthz().integrations.readIntegrationPolicies; @@ -153,6 +155,17 @@ export function Detail() { packageInfo.savedObject && semverLt(packageInfo.savedObject.attributes.version, packageInfo.latestVersion); + const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState< + boolean | undefined + >(); + + const { data: settings } = useGetSettings(); + + useEffect(() => { + const isEnabled = Boolean(settings?.item.prerelease_integrations_enabled); + setPrereleaseIntegrationsEnabled(isEnabled); + }, [settings?.item.prerelease_integrations_enabled]); + const { pkgName, pkgVersion } = splitPkgKey(pkgkey); // Fetch package info const { @@ -161,7 +174,34 @@ export function Detail() { isLoading: packageInfoLoading, isInitialRequest: packageIsInitialRequest, resendRequest: refreshPackageInfo, - } = useGetPackageInfoByKey(pkgName, pkgVersion); + } = useGetPackageInfoByKey(pkgName, pkgVersion, { + prerelease: prereleaseIntegrationsEnabled, + }); + + const [latestGAVersion, setLatestGAVersion] = useState(); + const [latestPrereleaseVersion, setLatestPrereleaseVersion] = useState(); + + // fetch latest GA version (prerelease=false) + const { data: packageInfoLatestGAData } = useGetPackageInfoByKey(pkgName, '', { + prerelease: false, + }); + + useEffect(() => { + const pkg = packageInfoLatestGAData?.item; + const isGAVersion = pkg && !isPackagePrerelease(pkg.version); + if (isGAVersion) { + setLatestGAVersion(pkg.version); + } + }, [packageInfoLatestGAData?.item]); + + // fetch latest Prerelease version (prerelease=true) + const { data: packageInfoLatestPrereleaseData } = useGetPackageInfoByKey(pkgName, '', { + prerelease: true, + }); + + useEffect(() => { + setLatestPrereleaseVersion(packageInfoLatestPrereleaseData?.item.version); + }, [packageInfoLatestPrereleaseData?.item.version]); const { isFirstTimeAgentUser = false, isLoading: firstTimeUserLoading } = useIsFirstTimeAgentUser(); @@ -326,6 +366,46 @@ export function Detail() { ] ); + const showVersionSelect = useMemo( + () => + prereleaseIntegrationsEnabled && + latestGAVersion && + latestPrereleaseVersion && + latestGAVersion !== latestPrereleaseVersion && + (!packageInfo?.version || + packageInfo.version === latestGAVersion || + packageInfo.version === latestPrereleaseVersion), + [prereleaseIntegrationsEnabled, latestGAVersion, latestPrereleaseVersion, packageInfo?.version] + ); + + const versionOptions = useMemo( + () => [ + { + value: latestPrereleaseVersion, + text: latestPrereleaseVersion, + }, + { + value: latestGAVersion, + text: latestGAVersion, + }, + ], + [latestPrereleaseVersion, latestGAVersion] + ); + + const versionLabel = i18n.translate('xpack.fleet.epm.versionLabel', { + defaultMessage: 'Version', + }); + + const onVersionChange = useCallback( + (version: string, packageName: string) => { + const path = getPath('integration_details_overview', { + pkgkey: `${packageName}-${version}`, + }); + history.push(path); + }, + [getPath, history] + ); + const headerRightContent = useMemo( () => packageInfo ? ( @@ -334,12 +414,24 @@ export function Detail() { {[ { - label: i18n.translate('xpack.fleet.epm.versionLabel', { - defaultMessage: 'Version', - }), + label: showVersionSelect ? undefined : versionLabel, content: ( - {packageInfo.version} + + {showVersionSelect ? ( + + onVersionChange(event.target.value, packageInfo.name) + } + /> + ) : ( +
      {packageInfo.version}
      + )} +
      {updateAvailable ? ( @@ -416,6 +508,10 @@ export function Detail() { missingSecurityConfiguration, integrationInfo?.title, handleAddIntegrationPolicyClick, + onVersionChange, + showVersionSelect, + versionLabel, + versionOptions, ] ); @@ -605,7 +701,11 @@ export function Detail() { ) : ( - + diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx index 51991fb8aab3..21b3fd0f4f11 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx @@ -6,14 +6,14 @@ */ import React, { memo, useMemo } from 'react'; import styled from 'styled-components'; -import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiLink } from '@elastic/eui'; +import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiLink, EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { isIntegrationPolicyTemplate } from '../../../../../../../../common/services'; -import { useFleetStatus, useStartServices } from '../../../../../../../hooks'; -import { isPackageUnverified } from '../../../../../../../services'; +import { useFleetStatus, useLink, useStartServices } from '../../../../../../../hooks'; +import { isPackagePrerelease, isPackageUnverified } from '../../../../../../../services'; import type { PackageInfo, RegistryPolicyTemplate } from '../../../../../types'; import { Screenshots } from './screenshots'; @@ -23,6 +23,7 @@ import { Details } from './details'; interface Props { packageInfo: PackageInfo; integrationInfo?: RegistryPolicyTemplate; + latestGAVersion?: string; } const LeftColumn = styled(EuiFlexItem)` @@ -66,48 +67,97 @@ const UnverifiedCallout: React.FC = () => { ); }; -export const OverviewPage: React.FC = memo(({ packageInfo, integrationInfo }) => { - const screenshots = useMemo( - () => integrationInfo?.screenshots || packageInfo.screenshots || [], - [integrationInfo, packageInfo.screenshots] - ); - const { packageVerificationKeyId } = useFleetStatus(); - const isUnverified = isPackageUnverified(packageInfo, packageVerificationKeyId); +const PrereleaseCallout: React.FC<{ + packageName: string; + latestGAVersion?: string; + packageTitle: string; +}> = ({ packageName, packageTitle, latestGAVersion }) => { + const { getHref } = useLink(); + const overviewPathLatestGA = getHref('integration_details_overview', { + pkgkey: `${packageName}-${latestGAVersion}`, + }); + return ( - - - - {isUnverified && } - {packageInfo.readme ? ( - - ) : null} - - - - {screenshots.length ? ( - - + + {latestGAVersion && ( +

      + + - - ) : null} - -

      - - - - + +

      + )} + + + ); -}); +}; + +export const OverviewPage: React.FC = memo( + ({ packageInfo, integrationInfo, latestGAVersion }) => { + const screenshots = useMemo( + () => integrationInfo?.screenshots || packageInfo.screenshots || [], + [integrationInfo, packageInfo.screenshots] + ); + const { packageVerificationKeyId } = useFleetStatus(); + const isUnverified = isPackageUnverified(packageInfo, packageVerificationKeyId); + const isPrerelease = isPackagePrerelease(packageInfo.version); + return ( + + + + {isUnverified && } + {isPrerelease && ( + + )} + {packageInfo.readme ? ( + + ) : null} + + + + {screenshots.length ? ( + + + + ) : null} + +
      + + + + + ); + } +); diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx index 7f56592cdc84..a763d26e2821 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx @@ -20,19 +20,17 @@ import { isIntegrationPolicyTemplate, } from '../../../../../../../common/services'; -import { useStartServices } from '../../../../hooks'; +import { useCategories, usePackages, useStartServices } from '../../../../hooks'; import { pagePathGetters } from '../../../../constants'; import { - useGetCategories, - useGetPackages, useBreadcrumbs, useGetAppendCustomIntegrations, useGetReplacementCustomIntegrations, useLink, } from '../../../../hooks'; import { doesPackageHaveIntegrations } from '../../../../services'; -import type { GetPackagesResponse, PackageList } from '../../../../types'; +import type { PackageList } from '../../../../types'; import { PackageListGrid } from '../../components/package_list_grid'; import type { PackageListItem } from '../../../../types'; @@ -183,11 +181,11 @@ const packageListToIntegrationsList = (packages: PackageList): PackageList => { // TODO: clintandrewhall - this component is hard to test due to the hooks, particularly those that use `http` // or `location` to load data. Ideally, we'll split this into "connected" and "pure" components. -export const AvailablePackages: React.FC<{ - allPackages?: GetPackagesResponse | null; - isLoading: boolean; -}> = ({ allPackages, isLoading }) => { +export const AvailablePackages: React.FC<{}> = ({}) => { const [preference, setPreference] = useState('recommended'); + const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState< + boolean | undefined + >(undefined); useBreadcrumbs('integrations_all'); @@ -222,10 +220,7 @@ export const AvailablePackages: React.FC<{ data: eprPackages, isLoading: isLoadingAllPackages, error: eprPackageLoadingError, - } = useGetPackages({ - category: '', - excludeInstallStatus: true, - }); + } = usePackages(prereleaseIntegrationsEnabled); // Remove Kubernetes package granularity if (eprPackages?.items) { @@ -276,9 +271,7 @@ export const AvailablePackages: React.FC<{ data: eprCategories, isLoading: isLoadingCategories, error: eprCategoryLoadingError, - } = useGetCategories({ - include_policy_templates: true, - }); + } = useCategories(prereleaseIntegrationsEnabled); const categories: CategoryFacet[] = useMemo(() => { const eprAndCustomCategories: CategoryFacet[] = isLoadingCategories @@ -306,7 +299,13 @@ export const AvailablePackages: React.FC<{ let controls = [ - + { + setPrereleaseIntegrationsEnabled(isEnabled); + }} + /> , ]; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx index 18d96fbd6634..5b9227553c79 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/index.tsx @@ -15,7 +15,7 @@ import { installationStatuses } from '../../../../../../../common/constants'; import type { DynamicPage, DynamicPagePathValues, StaticPage } from '../../../../constants'; import { INTEGRATIONS_ROUTING_PATHS, INTEGRATIONS_SEARCH_QUERYPARAM } from '../../../../constants'; import { DefaultLayout } from '../../../../layouts'; -import { isPackageUnverified } from '../../../../services'; +import { isPackagePrerelease, isPackageUnverified } from '../../../../services'; import type { PackageListItem } from '../../../../types'; @@ -65,19 +65,24 @@ export const mapToCard = ({ let isUnverified = false; + let version = 'version' in item ? item.version || '' : ''; + if (item.type === 'ui_link') { uiInternalPathUrl = item.id.includes('language_client.') ? addBasePath(item.uiInternalPath) : item.uiExternalLink || getAbsolutePath(item.uiInternalPath); } else { - let urlVersion = item.version; - if ('savedObject' in item) { - urlVersion = item.savedObject.attributes.version || item.version; + // installed package + if ( + ['updates_available', 'installed'].includes(selectedCategory ?? '') && + 'savedObject' in item + ) { + version = item.savedObject.attributes.version || item.version; isUnverified = isPackageUnverified(item, packageVerificationKeyId); } const url = getHref('integration_details_overview', { - pkgkey: `${item.name}-${urlVersion}`, + pkgkey: `${item.name}-${version}`, ...(item.integration ? { integration: item.integration } : {}), }); @@ -90,6 +95,9 @@ export const mapToCard = ({ } else if ((item as CustomIntegration).isBeta === true) { release = 'beta'; } + if (!isPackagePrerelease(version)) { + release = 'ga'; + } return { id: `${item.type === 'ui_link' ? 'ui_link' : 'epr'}:${item.id}`, @@ -100,7 +108,7 @@ export const mapToCard = ({ fromIntegrations: selectedCategory, integration: 'integration' in item ? item.integration || '' : '', name: 'name' in item ? item.name : item.id, - version: 'version' in item ? item.version || '' : '', + version, release, categories: ((item.categories || []) as string[]).filter((c: string) => !!c), isUnverified, @@ -108,8 +116,9 @@ export const mapToCard = ({ }; export const EPMHomePage: React.FC = () => { + // loading packages to find installed ones const { data: allPackages, isLoading } = useGetPackages({ - experimental: true, + prerelease: true, }); const installedPackages = useMemo( @@ -132,7 +141,7 @@ export const EPMHomePage: React.FC = () => { - + diff --git a/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx b/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx index 5a0b6285c71d..e4dabcff4e8a 100644 --- a/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx +++ b/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx @@ -28,7 +28,7 @@ interface UpdatableIntegration { export const usePackageInstallations = () => { const { data: allPackages, isLoading: isLoadingPackages } = useGetPackages({ - experimental: true, + prerelease: true, }); const { data: agentPolicyData, isLoading: isLoadingPolicies } = useGetAgentPolicies({ diff --git a/x-pack/plugins/fleet/public/hooks/use_request/epm.ts b/x-pack/plugins/fleet/public/hooks/use_request/epm.ts index 3a0033435ed9..9c88cfae46c4 100644 --- a/x-pack/plugins/fleet/public/hooks/use_request/epm.ts +++ b/x-pack/plugins/fleet/public/hooks/use_request/epm.ts @@ -44,7 +44,15 @@ export const useGetCategories = (query: GetCategoriesRequest['query'] = {}) => { return useRequest({ path: epmRouteService.getCategoriesPath(), method: 'get', - query: { experimental: true, ...query }, + query, + }); +}; + +export const sendGetCategories = (query: GetCategoriesRequest['query'] = {}) => { + return sendRequest({ + path: epmRouteService.getCategoriesPath(), + method: 'get', + query, }); }; @@ -52,7 +60,7 @@ export const useGetPackages = (query: GetPackagesRequest['query'] = {}) => { return useRequest({ path: epmRouteService.getListPath(), method: 'get', - query: { experimental: true, ...query }, + query, }); }; @@ -60,7 +68,7 @@ export const sendGetPackages = (query: GetPackagesRequest['query'] = {}) => { return sendRequest({ path: epmRouteService.getListPath(), method: 'get', - query: { experimental: true, ...query }, + query, }); }; @@ -74,14 +82,22 @@ export const useGetLimitedPackages = () => { export const useGetPackageInfoByKey = ( pkgName: string, pkgVersion?: string, - ignoreUnverified: boolean = false + options?: { + ignoreUnverified?: boolean; + prerelease?: boolean; + } ) => { const confirmOpenUnverified = useConfirmOpenUnverified(); - const [ignoreUnverifiedQueryParam, setIgnoreUnverifiedQueryParam] = useState(ignoreUnverified); + const [ignoreUnverifiedQueryParam, setIgnoreUnverifiedQueryParam] = useState( + options?.ignoreUnverified + ); const res = useRequest({ path: epmRouteService.getInfoPath(pkgName, pkgVersion), method: 'get', - query: ignoreUnverifiedQueryParam ? { ignoreUnverified: ignoreUnverifiedQueryParam } : {}, + query: { + ...options, + ...(ignoreUnverifiedQueryParam ? { ignoreUnverified: ignoreUnverifiedQueryParam } : {}), + }, }); useEffect(() => { @@ -111,12 +127,15 @@ export const useGetPackageStats = (pkgName: string) => { export const sendGetPackageInfoByKey = ( pkgName: string, pkgVersion?: string, - ignoreUnverified?: boolean + options?: { + ignoreUnverified?: boolean; + prerelease?: boolean; + } ) => { return sendRequest({ path: epmRouteService.getInfoPath(pkgName, pkgVersion), method: 'get', - query: ignoreUnverified ? { ignoreUnverified } : {}, + query: options, }); }; diff --git a/x-pack/plugins/fleet/public/services/index.ts b/x-pack/plugins/fleet/public/services/index.ts index d6167b4548e6..9d6ef9b4563a 100644 --- a/x-pack/plugins/fleet/public/services/index.ts +++ b/x-pack/plugins/fleet/public/services/index.ts @@ -47,3 +47,4 @@ export { pkgKeyFromPackageInfo } from './pkg_key_from_package_info'; export { createExtensionRegistrationCallback } from './ui_extensions'; export { incrementPolicyName } from './increment_policy_name'; export { policyHasFleetServer } from './has_fleet_server'; +export { isPackagePrerelease } from './package_prerelease'; diff --git a/x-pack/plugins/fleet/public/services/package_prerelease.test.ts b/x-pack/plugins/fleet/public/services/package_prerelease.test.ts new file mode 100644 index 000000000000..c8843d304de5 --- /dev/null +++ b/x-pack/plugins/fleet/public/services/package_prerelease.test.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 { isPackagePrerelease } from './package_prerelease'; + +describe('isPackagePrerelease', () => { + it('should return prerelease true for 0.1.0', () => { + expect(isPackagePrerelease('0.1.0')).toBe(true); + }); + + it('should return prerelease false for 1.1.0', () => { + expect(isPackagePrerelease('1.1.0')).toBe(false); + }); + + it('should return prerelease true for 1.0.0-preview', () => { + expect(isPackagePrerelease('1.0.0-preview')).toBe(true); + }); + + it('should return prerelease true for 1.0.0-beta', () => { + expect(isPackagePrerelease('1.0.0-beta')).toBe(true); + }); + + it('should return prerelease true for 1.0.0-rc', () => { + expect(isPackagePrerelease('1.0.0-rc')).toBe(true); + }); + + it('should return prerelease true for 1.0.0-dev.0', () => { + expect(isPackagePrerelease('1.0.0-dev.0')).toBe(true); + }); +}); diff --git a/x-pack/plugins/fleet/public/services/package_prerelease.ts b/x-pack/plugins/fleet/public/services/package_prerelease.ts new file mode 100644 index 000000000000..0df6e0deee40 --- /dev/null +++ b/x-pack/plugins/fleet/public/services/package_prerelease.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export function isPackagePrerelease(version: string): boolean { + // derive from semver + return version.startsWith('0') || version.includes('-'); +} diff --git a/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts b/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts index e07ff9f5a180..4215a460a29c 100644 --- a/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts +++ b/x-pack/plugins/fleet/scripts/install_all_packages/install_all_packages.ts @@ -57,7 +57,7 @@ async function deletePackage(name: string, version: string) { async function getAllPackages() { const res = await fetch( - `${REGISTRY_URL}/search?experimental=true&kibana.version=${KIBANA_VERSION}`, + `${REGISTRY_URL}/search?prerelease=true&kibana.version=${KIBANA_VERSION}`, { headers: { accept: '*/*', diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 5d177641daee..ee69ae9fc8e6 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -572,7 +572,7 @@ export class FleetPlugin internalSoClient, this.getLogger() ); - return this.packageService; + return this.packageService!; } private getLogger(): Logger { diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts index 242e272cd184..5ef609fe9b6c 100644 --- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts @@ -37,6 +37,7 @@ import type { GetStatsRequestSchema, FleetRequestHandler, UpdatePackageRequestSchema, + GetLimitedPackagesRequestSchema, } from '../../types'; import { bulkInstallPackages, @@ -67,7 +68,9 @@ export const getCategoriesHandler: FleetRequestHandler< TypeOf > = async (context, request, response) => { try { - const res = await getCategories(request.query); + const res = await getCategories({ + ...request.query, + }); const body: GetCategoriesResponse = { items: res, response: res, @@ -103,10 +106,17 @@ export const getListHandler: FleetRequestHandler< } }; -export const getLimitedListHandler: FleetRequestHandler = async (context, request, response) => { +export const getLimitedListHandler: FleetRequestHandler< + undefined, + TypeOf, + undefined +> = async (context, request, response) => { try { const savedObjectsClient = (await context.fleet).epm.internalSoClient; - const res = await getLimitedPackages({ savedObjectsClient }); + const res = await getLimitedPackages({ + savedObjectsClient, + prerelease: request.query.prerelease, + }); const body: GetLimitedPackagesResponse = { items: res, response: res, @@ -200,7 +210,7 @@ export const getInfoHandler: FleetRequestHandler< try { const savedObjectsClient = (await context.fleet).epm.internalSoClient; const { pkgName, pkgVersion } = request.params; - const { ignoreUnverified = false } = request.query; + const { ignoreUnverified = false, prerelease } = request.query; if (pkgVersion && !semverValid(pkgVersion)) { throw new FleetError('Package version is not a valid semver'); } @@ -210,6 +220,7 @@ export const getInfoHandler: FleetRequestHandler< pkgVersion: pkgVersion || '', skipArchive: true, ignoreUnverified, + prerelease, }); const body: GetInfoResponse = { item: res, @@ -307,7 +318,7 @@ const bulkInstallServiceResponseToHttpEntry = ( export const bulkInstallPackagesFromRegistryHandler: FleetRequestHandler< undefined, - undefined, + TypeOf, TypeOf > = async (context, request, response) => { const coreContext = await context.core; @@ -320,6 +331,7 @@ export const bulkInstallPackagesFromRegistryHandler: FleetRequestHandler< esClient, packagesToInstall: request.body.packages, spaceId, + prerelease: request.query.prerelease, }); const payload = bulkInstalledResponses.map(bulkInstallServiceResponseToHttpEntry); const body: BulkInstallPackagesResponse = { diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts index d96d574f77be..ee9caa4def67 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts @@ -204,6 +204,7 @@ export const createPackagePolicyHandler: FleetRequestHandler< pkgName: pkg.name, pkgVersion: pkg.version, ignoreUnverified: force, + prerelease: true, }); newPackagePolicy = simplifiedPackagePolicytoNewPackagePolicy(newPolicy, pkgInfo, { experimental_data_stream_features: pkg.experimental_data_stream_features, diff --git a/x-pack/plugins/fleet/server/saved_objects/index.ts b/x-pack/plugins/fleet/server/saved_objects/index.ts index 4a943789cac6..5721d2e6b7ed 100644 --- a/x-pack/plugins/fleet/server/saved_objects/index.ts +++ b/x-pack/plugins/fleet/server/saved_objects/index.ts @@ -70,6 +70,7 @@ const getSavedObjectTypes = ( properties: { fleet_server_hosts: { type: 'keyword' }, has_seen_add_data_notice: { type: 'boolean', index: false }, + prerelease_integrations_enabled: { type: 'boolean' }, }, }, migrations: { diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts index 5134249ddd1e..e43406d85960 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts @@ -16,5 +16,7 @@ export const migrateSettingsToV860: SavedObjectMigrationFn = // @ts-expect-error has_seen_fleet_migration_notice property does not exists anymore delete settingsDoc.attributes.has_seen_fleet_migration_notice; + settingsDoc.attributes.prerelease_integrations_enabled = false; + return settingsDoc; }; diff --git a/x-pack/plugins/fleet/server/services/epm/package_service.test.ts b/x-pack/plugins/fleet/server/services/epm/package_service.test.ts index f4f853d77892..44d35f3e4c33 100644 --- a/x-pack/plugins/fleet/server/services/epm/package_service.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/package_service.test.ts @@ -92,7 +92,7 @@ function getTest( method: mocks.packageClient.fetchFindLatestPackage.bind(mocks.packageClient), args: ['package name'], spy: jest.spyOn(epmRegistry, 'fetchFindLatestPackageOrThrow'), - spyArgs: ['package name'], + spyArgs: ['package name', undefined], spyResponse: { name: 'fetchFindLatestPackage test' }, expectedReturnValue: { name: 'fetchFindLatestPackage test' }, }; diff --git a/x-pack/plugins/fleet/server/services/epm/package_service.ts b/x-pack/plugins/fleet/server/services/epm/package_service.ts index 45fb67377132..f3d82f13d96e 100644 --- a/x-pack/plugins/fleet/server/services/epm/package_service.ts +++ b/x-pack/plugins/fleet/server/services/epm/package_service.ts @@ -26,6 +26,7 @@ import { checkSuperuser } from '../../routes/security'; import { FleetUnauthorizedError } from '../../errors'; import { installTransforms, isTransform } from './elasticsearch/transform/install'; +import type { FetchFindLatestPackageOptions } from './registry'; import { fetchFindLatestPackageOrThrow, getPackage } from './registry'; import { ensureInstalledPackage, getInstallation } from './packages'; @@ -45,7 +46,10 @@ export interface PackageClient { spaceId?: string; }): Promise; - fetchFindLatestPackage(packageName: string): Promise; + fetchFindLatestPackage( + packageName: string, + options?: FetchFindLatestPackageOptions + ): Promise; getPackage( packageName: string, @@ -116,9 +120,12 @@ class PackageClientImpl implements PackageClient { }); } - public async fetchFindLatestPackage(packageName: string) { + public async fetchFindLatestPackage( + packageName: string, + options?: FetchFindLatestPackageOptions + ): Promise { await this.#runPreflight(); - return fetchFindLatestPackageOrThrow(packageName); + return fetchFindLatestPackageOrThrow(packageName, options); } public async getPackage( diff --git a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts index a9d027ce51c8..66b9323dd093 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/bulk_install_packages.ts @@ -22,6 +22,7 @@ interface BulkInstallPackagesParams { force?: boolean; spaceId: string; preferredSource?: 'registry' | 'bundled'; + prerelease?: boolean; } export async function bulkInstallPackages({ @@ -30,6 +31,7 @@ export async function bulkInstallPackages({ esClient, spaceId, force, + prerelease, }: BulkInstallPackagesParams): Promise { const logger = appContextService.getLogger(); @@ -39,7 +41,7 @@ export async function bulkInstallPackages({ return Promise.resolve(pkg); } - return Registry.fetchFindLatestPackageOrThrow(pkg); + return Registry.fetchFindLatestPackageOrThrow(pkg, { prerelease }); }) ); diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts index 20ed655d9717..19ced885822a 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts @@ -22,10 +22,17 @@ import { appContextService } from '../../app_context'; import { PackageNotFoundError } from '../../../errors'; +import { getSettings } from '../../settings'; + import { getPackageInfo, getPackageUsageStats } from './get'; const MockRegistry = Registry as jest.Mocked; +jest.mock('../../settings'); + +const mockGetSettings = getSettings as jest.Mock; +mockGetSettings.mockResolvedValue({ prerelease_integrations_enabled: true }); + describe('When using EPM `get` services', () => { describe('and invoking getPackageUsageStats()', () => { let soClient: jest.Mocked; diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.ts index b8b447a8de52..e8d1cd138030 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -49,8 +49,14 @@ export async function getPackages( excludeInstallStatus?: boolean; } & Registry.SearchParams ) { - const { savedObjectsClient, experimental, category, excludeInstallStatus = false } = options; - const registryItems = await Registry.fetchList({ category, experimental }).then((items) => { + const { + savedObjectsClient, + category, + excludeInstallStatus = false, + prerelease = false, + } = options; + + const registryItems = await Registry.fetchList({ category, prerelease }).then((items) => { return items.map((item) => Object.assign({}, item, { title: item.title || nameAsTitle(item.name) }, { id: item.name }) ); @@ -87,11 +93,12 @@ export async function getPackages( // Get package names for packages which cannot have more than one package policy on an agent policy export async function getLimitedPackages(options: { savedObjectsClient: SavedObjectsClientContract; + prerelease?: boolean; }): Promise { - const { savedObjectsClient } = options; + const { savedObjectsClient, prerelease } = options; const allPackages = await getPackages({ savedObjectsClient, - experimental: true, + prerelease, }); const installedPackages = allPackages.filter( (pkg) => pkg.status === installationStatuses.Installed @@ -126,6 +133,7 @@ export async function getPackageInfo({ pkgVersion, skipArchive = false, ignoreUnverified = false, + prerelease, }: { savedObjectsClient: SavedObjectsClientContract; pkgName: string; @@ -133,10 +141,11 @@ export async function getPackageInfo({ /** Avoid loading the registry archive into the cache (only use for performance reasons). Defaults to `false` */ skipArchive?: boolean; ignoreUnverified?: boolean; + prerelease?: boolean; }): Promise { const [savedObject, latestPackage] = await Promise.all([ getInstallationObject({ savedObjectsClient, pkgName }), - Registry.fetchFindLatestPackageOrUndefined(pkgName), + Registry.fetchFindLatestPackageOrUndefined(pkgName, { prerelease }), ]); if (!savedObject && !latestPackage) { diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get_prerelease_setting.ts b/x-pack/plugins/fleet/server/services/epm/packages/get_prerelease_setting.ts new file mode 100644 index 000000000000..df4b47d13ef2 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/packages/get_prerelease_setting.ts @@ -0,0 +1,25 @@ +/* + * Copyright 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 { SavedObjectsClientContract } from '@kbn/core/server'; + +import { appContextService } from '../../app_context'; +import { getSettings } from '../../settings'; + +export async function getPrereleaseFromSettings( + savedObjectsClient: SavedObjectsClientContract +): Promise { + let prerelease: boolean = false; + try { + ({ prerelease_integrations_enabled: prerelease } = await getSettings(savedObjectsClient)); + } catch (err) { + appContextService + .getLogger() + .warn('Error while trying to load prerelease flag from settings, defaulting to false', err); + } + return prerelease; +} diff --git a/x-pack/plugins/fleet/server/services/epm/packages/install.ts b/x-pack/plugins/fleet/server/services/epm/packages/install.ts index ebd0bde8b09b..d7f67ca1d2ae 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/install.ts @@ -113,7 +113,7 @@ export async function ensureInstalledPackage(options: { // If pkgVersion isn't specified, find the latest package version const pkgKeyProps = pkgVersion ? { name: pkgName, version: pkgVersion } - : await Registry.fetchFindLatestPackageOrThrow(pkgName); + : await Registry.fetchFindLatestPackageOrThrow(pkgName, { prerelease: true }); const installedPackageResult = await isPackageVersionOrLaterInstalled({ savedObjectsClient, @@ -234,6 +234,7 @@ interface InstallRegistryPackageParams { force?: boolean; neverIgnoreVerificationError?: boolean; ignoreConstraints?: boolean; + prerelease?: boolean; } interface InstallUploadedArchiveParams { savedObjectsClient: SavedObjectsClientContract; @@ -301,6 +302,7 @@ async function installPackageFromRegistry({ const [latestPackage, { paths, packageInfo, verificationResult }] = await Promise.all([ Registry.fetchFindLatestPackageOrThrow(pkgName, { ignoreConstraints, + prerelease: true, }), Registry.getPackage(pkgName, pkgVersion, { ignoreUnverified: force && !neverIgnoreVerificationError, diff --git a/x-pack/plugins/fleet/server/services/epm/registry/index.ts b/x-pack/plugins/fleet/server/services/epm/registry/index.ts index 4213a50ebf5b..a6259d1eb655 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/index.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/index.ts @@ -25,6 +25,7 @@ import type { GetCategoriesRequest, PackageVerificationResult, ArchivePackage, + BundledPackage, } from '../../../types'; import { getArchiveFilelist, @@ -55,6 +56,8 @@ import { getRegistryUrl } from './registry_url'; export interface SearchParams { category?: CategoryId; + prerelease?: boolean; + // deprecated experimental?: boolean; } @@ -70,8 +73,8 @@ export async function fetchList(params?: SearchParams): Promise { return withPackageSpan(`Find latest package ${packageName}`, async () => { const logger = appContextService.getLogger(); - const { ignoreConstraints = false } = options ?? {}; + const { ignoreConstraints = false, prerelease = false } = options ?? {}; const bundledPackage = await getBundledPackageByName(packageName); + // temporary workaround to allow synthetics package beta version until there is a GA available + // needed because synthetics is installed by default on kibana startup + const prereleaseAllowedExceptions = ['synthetics']; + + const prereleaseEnabled = prerelease || prereleaseAllowedExceptions.includes(packageName); + const registryUrl = getRegistryUrl(); - const url = new URL(`${registryUrl}/search?package=${packageName}&experimental=true`); + const url = new URL( + `${registryUrl}/search?package=${packageName}&prerelease=${prereleaseEnabled}` + ); if (!ignoreConstraints) { setKibanaVersion(url); @@ -224,8 +236,8 @@ export async function fetchCategories( const registryUrl = getRegistryUrl(); const url = new URL(`${registryUrl}/categories`); if (params) { - if (params.experimental) { - url.searchParams.set('experimental', params.experimental.toString()); + if (params.prerelease) { + url.searchParams.set('prerelease', params.prerelease.toString()); } if (params.include_policy_templates) { url.searchParams.set('include_policy_templates', params.include_policy_templates.toString()); diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index f52316dd4452..b4e78d2f4c2c 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -187,6 +187,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: packagePolicy.package.name, pkgVersion: packagePolicy.package.version, + prerelease: true, })); // Check if it is a limited package, and if so, check that the corresponding agent policy does not @@ -508,6 +509,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: packagePolicy.package.name, pkgVersion: packagePolicy.package.version, + prerelease: true, }); validatePackagePolicyOrThrow(packagePolicy, pkgInfo); @@ -801,6 +803,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: packagePolicy!.package!.name, pkgVersion: pkgVersion ?? '', + prerelease: !!pkgVersion, // using prerelease only if version is specified }); } @@ -1129,6 +1132,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { pkgName, pkgVersion, skipArchive: true, + prerelease: true, }); if (packageInfo) { return packageToPackagePolicy(packageInfo, ''); @@ -1146,6 +1150,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { savedObjectsClient: soClient, pkgName: pkgInstall.name, pkgVersion: pkgInstall.version, + prerelease: true, }); if (packageInfo) { @@ -1594,6 +1599,7 @@ async function getPackageInfoForPackagePolicies( savedObjectsClient: soClient, pkgName: pkgInfo.name, pkgVersion: pkgInfo.version, + prerelease: true, }); resultMap.set(pkgKey, pkgInfoData); diff --git a/x-pack/plugins/fleet/server/services/settings.ts b/x-pack/plugins/fleet/server/services/settings.ts index 5cde2dbf9981..e710251c39f9 100644 --- a/x-pack/plugins/fleet/server/services/settings.ts +++ b/x-pack/plugins/fleet/server/services/settings.ts @@ -99,5 +99,5 @@ function getConfigFleetServerHosts() { } export function createDefaultSettings(): BaseSettings { - return {}; + return { prerelease_integrations_enabled: false }; } diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index f69576a2a8b5..9e36413f8015 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -9,7 +9,8 @@ import { schema } from '@kbn/config-schema'; export const GetCategoriesRequestSchema = { query: schema.object({ - experimental: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), + experimental: schema.maybe(schema.boolean()), // deprecated include_policy_templates: schema.maybe(schema.boolean()), }), }; @@ -17,11 +18,18 @@ export const GetCategoriesRequestSchema = { export const GetPackagesRequestSchema = { query: schema.object({ category: schema.maybe(schema.string()), - experimental: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), + experimental: schema.maybe(schema.boolean()), // deprecated excludeInstallStatus: schema.maybe(schema.boolean({ defaultValue: false })), }), }; +export const GetLimitedPackagesRequestSchema = { + query: schema.object({ + prerelease: schema.maybe(schema.boolean()), + }), +}; + export const GetFileRequestSchema = { params: schema.object({ pkgName: schema.string(), @@ -37,6 +45,7 @@ export const GetInfoRequestSchema = { }), query: schema.object({ ignoreUnverified: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), }), }; @@ -44,6 +53,10 @@ export const GetInfoRequestSchemaDeprecated = { params: schema.object({ pkgkey: schema.string(), }), + query: schema.object({ + ignoreUnverified: schema.maybe(schema.boolean()), + prerelease: schema.maybe(schema.boolean()), + }), }; export const UpdatePackageRequestSchema = { @@ -96,6 +109,9 @@ export const InstallPackageFromRegistryRequestSchemaDeprecated = { }; export const BulkUpgradePackagesFromRegistryRequestSchema = { + query: schema.object({ + prerelease: schema.maybe(schema.boolean()), + }), body: schema.object({ packages: schema.arrayOf(schema.string(), { minSize: 1 }), }), diff --git a/x-pack/plugins/fleet/server/types/rest_spec/settings.ts b/x-pack/plugins/fleet/server/types/rest_spec/settings.ts index 4544b677cba8..4a1c2975c80e 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/settings.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/settings.ts @@ -35,5 +35,6 @@ export const PutSettingsRequestSchema = { }) ), kibana_ca_sha256: schema.maybe(schema.string()), + prerelease_integrations_enabled: schema.maybe(schema.boolean()), }), }; diff --git a/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts b/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts index 29110f5807ed..fe875fe4e256 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/bulk_upgrade.ts @@ -62,7 +62,7 @@ export default function (providerContext: FtrProviderContext) { }); it('should return 200 and an array for upgrading a package', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions'] }) .expect(200); @@ -73,7 +73,7 @@ export default function (providerContext: FtrProviderContext) { }); it('should return an error for packages that do not exist', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions', 'blahblah'] }) .expect(200); @@ -88,7 +88,7 @@ export default function (providerContext: FtrProviderContext) { }); it('should upgrade multiple packages', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions', 'overrides'] }) .expect(200); @@ -110,7 +110,7 @@ export default function (providerContext: FtrProviderContext) { it('should return 200 and an array for upgrading a package', async function () { const { body }: { body: BulkInstallPackagesResponse } = await supertest - .post(`/api/fleet/epm/packages/_bulk`) + .post(`/api/fleet/epm/packages/_bulk?prerelease=true`) .set('kbn-xsrf', 'xxxx') .send({ packages: ['multiple_versions'] }) .expect(200); diff --git a/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts b/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts index 0ef5f648ab36..8d7a6323d5f7 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/custom_ingest_pipeline.ts @@ -32,7 +32,7 @@ export default function (providerContext: FtrProviderContext) { // Use the custom log package to test the custom ingest pipeline before(async () => { const { body: getPackagesRes } = await supertest.get( - `/api/fleet/epm/packages?experimental=true` + `/api/fleet/epm/packages?prerelease=true` ); const logPackage = getPackagesRes.items.find((p: any) => p.name === 'log'); if (!logPackage) { diff --git a/x-pack/test/fleet_api_integration/apis/epm/delete.ts b/x-pack/test/fleet_api_integration/apis/epm/delete.ts index 076cc6bba4ef..9ec8b7318f6c 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/delete.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/delete.ts @@ -34,6 +34,7 @@ export default function (providerContext: FtrProviderContext) { describe('delete and force delete scenarios', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + before(async () => { await installPackage(requiredPackage, pkgVersion); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts b/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts index e705aa1734cb..5e677bd96d54 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts @@ -43,7 +43,7 @@ export default function (providerContext: FtrProviderContext) { // Use the custom log package to test the fleet final pipeline before(async () => { const { body: getPackagesRes } = await supertest.get( - `/api/fleet/epm/packages?experimental=true` + `/api/fleet/epm/packages?prerelease=true` ); const logPackage = getPackagesRes.items.find((p: any) => p.name === 'log'); if (!logPackage) { diff --git a/x-pack/test/fleet_api_integration/apis/epm/get.ts b/x-pack/test/fleet_api_integration/apis/epm/get.ts index 280922b2e4a3..17f83b0b3c53 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/get.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/get.ts @@ -40,6 +40,7 @@ export default function (providerContext: FtrProviderContext) { describe('EPM - get', () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + it('returns package info from the registry if it was installed from the registry', async function () { // this will install through the registry by default await installPackage(testPkgName, testPkgVersion); @@ -149,7 +150,7 @@ export default function (providerContext: FtrProviderContext) { // not from the package registry. This is because they contain a field the registry // does not support const res = await supertest - .get(`/api/fleet/epm/packages/integration_to_input/0.9.1`) + .get(`/api/fleet/epm/packages/integration_to_input/0.9.1?prerelease=true`) .expect(200); const packageInfo = res.body.item; @@ -158,14 +159,16 @@ export default function (providerContext: FtrProviderContext) { }); describe('Pkg verification', () => { it('should return validation error for unverified input only pkg', async function () { - const res = await supertest.get(`/api/fleet/epm/packages/input_only/0.1.0`).expect(400); + const res = await supertest + .get(`/api/fleet/epm/packages/input_only/0.1.0?prerelease=true`) + .expect(400); const error = res.body; expect(error?.attributes?.type).to.equal('verification_failed'); }); it('should not return validation error for unverified input only pkg if ignoreUnverified is true', async function () { await supertest - .get(`/api/fleet/epm/packages/input_only/0.1.0?ignoreUnverified=true`) + .get(`/api/fleet/epm/packages/input_only/0.1.0?ignoreUnverified=true&prerelease=true`) .expect(200); }); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts b/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts index e4fd8f11141a..d7c913fc8bc4 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_by_upload.ts @@ -60,6 +60,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs packages from direct upload', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + afterEach(async () => { if (server) { // remove the packages just in case it being installed will affect other tests diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts index fba01e840cfd..7649237f0ab4 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts @@ -30,12 +30,15 @@ export default function (providerContext: FtrProviderContext) { }; const getPackageInfo = async (pkg: string, version: string) => { - return await supertest.get(`/api/fleet/epm/packages/${pkg}/${version}`).set('kbn-xsrf', 'xxxx'); + return await supertest + .get(`/api/fleet/epm/packages/${pkg}/${version}?prerelease=true`) + .set('kbn-xsrf', 'xxxx'); }; describe('package installation error handling and rollback', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + beforeEach(async () => { await kibanaServer.savedObjects.cleanStandardList(); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts b/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts index d33f9b8a922d..b89c036e84a9 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_overrides.ts @@ -26,6 +26,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs packages that include settings and mappings overrides', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + after(async () => { if (server.enabled) { // remove the package just in case it being installed will affect other tests diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts b/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts index f375c9902317..86e91d6707c5 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts @@ -25,6 +25,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs package that has a prerelease version', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + after(async () => { if (server.enabled) { // remove the package just in case it being installed will affect other tests diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts b/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts index 9e364f28f8b3..08740ea5335b 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_remove_kbn_assets_in_space.ts @@ -50,6 +50,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs and uninstalls all assets (non default space)', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + before(async () => { await createSpace(testSpaceId); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts b/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts index 275a2abf744b..48071d15436f 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_remove_multiple.ts @@ -62,6 +62,7 @@ export default function (providerContext: FtrProviderContext) { describe('installs and uninstalls multiple packages side effects', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + before(async () => { if (!server.enabled) return; await installPackages([ diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_tag_assets.ts b/x-pack/test/fleet_api_integration/apis/epm/install_tag_assets.ts index 7458912207a3..aca56f5fce93 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_tag_assets.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_tag_assets.ts @@ -68,6 +68,7 @@ export default function (providerContext: FtrProviderContext) { describe('asset tagging', () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + before(async () => { await createSpace(testSpaceId); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_update.ts b/x-pack/test/fleet_api_integration/apis/epm/install_update.ts index 669166b18978..c36efd6066b6 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_update.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_update.ts @@ -26,6 +26,7 @@ export default function (providerContext: FtrProviderContext) { describe('installing and updating scenarios', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + after(async () => { await deletePackage('multiple_versions', '0.3.0'); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/list.ts b/x-pack/test/fleet_api_integration/apis/epm/list.ts index 51f003a7192d..5727f7130f56 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/list.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/list.ts @@ -23,6 +23,7 @@ export default function (providerContext: FtrProviderContext) { describe('EPM - list', async function () { skipIfNoDockerRegistry(providerContext); + before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts b/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts index fdf90c636885..f29e36daebdd 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/package_install_complete.ts @@ -26,6 +26,7 @@ export default function (providerContext: FtrProviderContext) { describe('setup checks packages completed install', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + describe('package install', async () => { before(async () => { if (!server.enabled) return; diff --git a/x-pack/test/fleet_api_integration/apis/epm/setup.ts b/x-pack/test/fleet_api_integration/apis/epm/setup.ts index 7720d915f6f1..f930166f4a74 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/setup.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/setup.ts @@ -21,6 +21,7 @@ export default function (providerContext: FtrProviderContext) { describe('setup api', async () => { skipIfNoDockerRegistry(providerContext); setupFleetAndAgents(providerContext); + // FLAKY: https://github.com/elastic/kibana/issues/118479 describe.skip('setup performs upgrades', async () => { const oldEndpointVersion = '0.13.0'; diff --git a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts index e1e1f90f57eb..3f76f4594592 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts @@ -69,7 +69,7 @@ export default function (providerContext: FtrProviderContext) { await supertest.post(`/api/fleet/setup`).set('kbn-xsrf', 'xxxx').expect(200); const { body: apiResponse } = await supertest - .get(`/api/fleet/epm/packages?experimental=true`) + .get(`/api/fleet/epm/packages?prerelease=true`) .expect(200); const installedPackages = apiResponse.response .filter((p: any) => p.status === 'installed') diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts b/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts index 383a92fa164e..b15b84dcfbee 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/delete.ts @@ -15,6 +15,7 @@ export default function (providerContext: FtrProviderContext) { describe('Package Policy - delete', () => { skipIfNoDockerRegistry(providerContext); + describe('Delete one', () => { let agentPolicy: any; let packagePolicy: any; diff --git a/x-pack/test/fleet_api_integration/helpers.ts b/x-pack/test/fleet_api_integration/helpers.ts index d3b623d0426f..c21a9e01b330 100644 --- a/x-pack/test/fleet_api_integration/helpers.ts +++ b/x-pack/test/fleet_api_integration/helpers.ts @@ -89,3 +89,19 @@ export async function generateAgent( refresh: 'wait_for', }); } + +export function setPrereleaseSetting(supertest: any) { + before(async () => { + await supertest + .put('/api/fleet/settings') + .set('kbn-xsrf', 'xxxx') + .send({ prerelease_integrations_enabled: true }); + }); + + after(async () => { + await supertest + .put('/api/fleet/settings') + .set('kbn-xsrf', 'xxxx') + .send({ prerelease_integrations_enabled: false }); + }); +} diff --git a/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts b/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts index ebe434b6afe6..d60d7b89a012 100644 --- a/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts +++ b/x-pack/test/functional/apps/maps/group4/geofile_wizard_auto_open.ts @@ -22,7 +22,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const geoFileCard = await find.byCssSelector( '[data-test-subj="integration-card:ui_link:ingest_geojson"]' ); - geoFileCard.click(); + await geoFileCard.click(); }); it('should navigate to maps app with url params', async () => { diff --git a/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts b/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts index 14c7abaa5734..5b9525bf2060 100644 --- a/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts +++ b/x-pack/test/functional_synthetics/services/uptime/synthetics_package.ts @@ -50,7 +50,7 @@ export function SyntheticsPackageProvider({ getService }: FtrProviderContext) { apiRequest = retry.try(() => { return supertest .get(INGEST_API_EPM_PACKAGES) - .query({ experimental: true }) + .query({ prerelease: true }) .set('kbn-xsrf', 'xxx') .expect(200) .catch((error) => { From c6a00589b09e8f220af0b6f4b888948be8d6c879 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Wed, 2 Nov 2022 09:11:25 +0000 Subject: [PATCH 84/87] [ML] Fix model test flyout reload (#144318) --- .../test_models/selected_model.tsx | 66 ++++++++----------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx index 35f067064600..6836321395d7 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/test_models/selected_model.tsx @@ -6,7 +6,7 @@ */ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import React, { FC } from 'react'; +import React, { FC, useMemo } from 'react'; import { NerInference } from './models/ner'; import { QuestionAnsweringInference } from './models/question_answering'; @@ -28,53 +28,41 @@ import { useMlApiContext } from '../../../contexts/kibana'; import { InferenceInputForm } from './models/inference_input_form'; interface Props { - model: estypes.MlTrainedModelConfig | null; + model: estypes.MlTrainedModelConfig; } export const SelectedModel: FC = ({ model }) => { const { trainedModels } = useMlApiContext(); - if (model === null) { - return null; - } - - if (model.model_type === TRAINED_MODEL_TYPE.PYTORCH) { - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.NER) { - const inferrer = new NerInference(trainedModels, model); - return ; - } - - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.TEXT_CLASSIFICATION) { - const inferrer = new TextClassificationInference(trainedModels, model); - return ; - } + const inferrer = useMemo(() => { + if (model.model_type === TRAINED_MODEL_TYPE.PYTORCH) { + const taskType = Object.keys(model.inference_config)[0]; - if ( - Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.ZERO_SHOT_CLASSIFICATION - ) { - const inferrer = new ZeroShotClassificationInference(trainedModels, model); - return ; - } - - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.TEXT_EMBEDDING) { - const inferrer = new TextEmbeddingInference(trainedModels, model); - return ; - } + switch (taskType) { + case SUPPORTED_PYTORCH_TASKS.NER: + return new NerInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.TEXT_CLASSIFICATION: + return new TextClassificationInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.ZERO_SHOT_CLASSIFICATION: + return new ZeroShotClassificationInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.TEXT_EMBEDDING: + return new TextEmbeddingInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.FILL_MASK: + return new FillMaskInference(trainedModels, model); + case SUPPORTED_PYTORCH_TASKS.QUESTION_ANSWERING: + return new QuestionAnsweringInference(trainedModels, model); - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.FILL_MASK) { - const inferrer = new FillMaskInference(trainedModels, model); - return ; + default: + break; + } + } else if (model.model_type === TRAINED_MODEL_TYPE.LANG_IDENT) { + return new LangIdentInference(trainedModels, model); } + }, [model, trainedModels]); - if (Object.keys(model.inference_config)[0] === SUPPORTED_PYTORCH_TASKS.QUESTION_ANSWERING) { - const inferrer = new QuestionAnsweringInference(trainedModels, model); - return ; - } - } - if (model.model_type === TRAINED_MODEL_TYPE.LANG_IDENT) { - const inferrer = new LangIdentInference(trainedModels, model); - return ; + if (inferrer === undefined) { + return null; } - return null; + return ; }; From 056413e8b4d6d0fac83d23e3aae39de133056cad Mon Sep 17 00:00:00 2001 From: Kerry Gallagher Date: Wed, 2 Nov 2022 09:58:29 +0000 Subject: [PATCH 85/87] [Logs UI] Support the Unified Search Bar for Query input (#143222) * Use Unified Search Bar for query input --- .../public/__stories__/search_bar.stories.tsx | 9 + .../public/search_bar/create_search_bar.tsx | 1 + .../public/search_bar/search_bar.test.tsx | 15 ++ .../public/search_bar/search_bar.tsx | 6 +- .../log_views/resolved_log_view.mock.ts | 12 ++ .../common/log_views/resolved_log_view.ts | 32 ++-- .../components/log_stream/log_stream.tsx | 2 +- .../containers/logs/log_filter/errors.ts | 21 +++ .../logs/log_filter/log_filter_state.ts | 170 +++++++++++------- .../log_filter/with_log_filter_url_state.tsx | 19 +- .../infra/public/hooks/use_log_view.mock.ts | 5 +- .../infra/public/hooks/use_log_view.ts | 19 +- .../pages/logs/stream/page_logs_content.tsx | 12 +- .../pages/logs/stream/page_providers.tsx | 2 +- .../public/pages/logs/stream/page_toolbar.tsx | 51 ++---- .../services/log_views/log_views_client.ts | 9 +- .../infra/public/services/log_views/types.ts | 2 +- .../plugins/infra/public/utils/url_state.tsx | 2 +- .../log_views/log_views_client.test.ts | 60 ++++++- .../services/log_views/log_views_client.ts | 9 +- .../infra/server/services/log_views/types.ts | 2 +- 21 files changed, 309 insertions(+), 151 deletions(-) create mode 100644 x-pack/plugins/infra/public/containers/logs/log_filter/errors.ts diff --git a/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx b/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx index 60e0659a6112..51cac48fbbbb 100644 --- a/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx +++ b/src/plugins/unified_search/public/__stories__/search_bar.stories.tsx @@ -298,6 +298,15 @@ storiesOf('SearchBar', module) query: { query: 'Test: miaou', language: 'kuery' }, } as unknown as SearchBarProps) ) + .add('with query menu off', () => + wrapSearchBarInContext({ + showDatePicker: false, + showFilterBar: false, + showQueryInput: true, + showQueryMenu: false, + query: { query: 'Test: miaou', language: 'kuery' }, + } as unknown as SearchBarProps) + ) .add('with only the filter bar and the date picker on', () => wrapSearchBarInContext({ showDatePicker: true, diff --git a/src/plugins/unified_search/public/search_bar/create_search_bar.tsx b/src/plugins/unified_search/public/search_bar/create_search_bar.tsx index 35555137f12b..0320626bb024 100644 --- a/src/plugins/unified_search/public/search_bar/create_search_bar.tsx +++ b/src/plugins/unified_search/public/search_bar/create_search_bar.tsx @@ -190,6 +190,7 @@ export function createSearchBar({ showAutoRefreshOnly={props.showAutoRefreshOnly} showDatePicker={props.showDatePicker} showFilterBar={props.showFilterBar} + showQueryMenu={props.showQueryMenu} showQueryInput={props.showQueryInput} showSaveQuery={props.showSaveQuery} showSubmitButton={props.showSubmitButton} diff --git a/src/plugins/unified_search/public/search_bar/search_bar.test.tsx b/src/plugins/unified_search/public/search_bar/search_bar.test.tsx index 0d0ff97ae4b0..0d17014e5203 100644 --- a/src/plugins/unified_search/public/search_bar/search_bar.test.tsx +++ b/src/plugins/unified_search/public/search_bar/search_bar.test.tsx @@ -138,6 +138,7 @@ describe('SearchBar', () => { const FILTER_BAR = '[data-test-subj="unifiedFilterBar"]'; const QUERY_BAR = '.kbnQueryBar'; const QUERY_INPUT = '[data-test-subj="unifiedQueryInput"]'; + const QUERY_MENU_BUTTON = '[data-test-subj="showQueryBarMenu"]'; const EDITOR = '[data-test-subj="unifiedTextLangEditor"]'; beforeEach(() => { @@ -220,6 +221,20 @@ describe('SearchBar', () => { expect(component.find(QUERY_INPUT).length).toBeFalsy(); }); + it('Should NOT render the query menu button, if disabled', () => { + const component = mount( + wrapSearchBarInContext({ + indexPatterns: [mockIndexPattern], + screenTitle: 'test screen', + onQuerySubmit: noop, + query: kqlQuery, + showQueryMenu: false, + }) + ); + + expect(component.find(QUERY_MENU_BUTTON).length).toBeFalsy(); + }); + it('Should render query bar and filter bar', () => { const component = mount( wrapSearchBarInContext({ diff --git a/src/plugins/unified_search/public/search_bar/search_bar.tsx b/src/plugins/unified_search/public/search_bar/search_bar.tsx index ebaa3a317c27..3b158fd20b9f 100644 --- a/src/plugins/unified_search/public/search_bar/search_bar.tsx +++ b/src/plugins/unified_search/public/search_bar/search_bar.tsx @@ -48,6 +48,7 @@ export interface SearchBarOwnProps { screenTitle?: string; dataTestSubj?: string; // Togglers + showQueryMenu?: boolean; showQueryInput?: boolean; showFilterBar?: boolean; showDatePicker?: boolean; @@ -121,6 +122,7 @@ class SearchBarUI extends C State > { public static defaultProps = { + showQueryMenu: true, showFilterBar: true, showDatePicker: true, showSubmitButton: true, @@ -448,7 +450,7 @@ class SearchBarUI extends C /> ); - const queryBarMenu = ( + const queryBarMenu = this.props.showQueryMenu ? ( extends C : undefined } /> - ); + ) : undefined; let filterBar; if (this.shouldRenderFilterBar()) { diff --git a/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts b/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts index 268b2f692f62..8c09f16e3b53 100644 --- a/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts +++ b/x-pack/plugins/infra/common/log_views/resolved_log_view.mock.ts @@ -10,6 +10,7 @@ import { createStubDataView } from '@kbn/data-views-plugin/common/stubs'; import { defaultLogViewsStaticConfig } from './defaults'; import { ResolvedLogView, resolveLogView } from './resolved_log_view'; import { LogViewAttributes } from './types'; +import { DataViewSpec } from '@kbn/data-views-plugin/common'; export const createResolvedLogViewMock = ( resolvedLogViewOverrides: Partial = {} @@ -41,15 +42,26 @@ export const createResolvedLogViewMock = ( messageColumn: { id: 'MESSAGE_COLUMN_ID' }, }, ], + dataViewReference: createStubDataView({ + spec: { + id: 'log-view-data-view-mock', + title: 'log-indices-*', + }, + }), ...resolvedLogViewOverrides, }); export const createResolvedLogViewMockFromAttributes = (logViewAttributes: LogViewAttributes) => resolveLogView( + 'log-view-id', logViewAttributes, { get: async () => createStubDataView({ spec: {} }), getFieldsForWildcard: async () => [], + create: async (spec: DataViewSpec) => + createStubDataView({ + spec, + }), } as unknown as DataViewsContract, defaultLogViewsStaticConfig ); diff --git a/x-pack/plugins/infra/common/log_views/resolved_log_view.ts b/x-pack/plugins/infra/common/log_views/resolved_log_view.ts index d7e155172a57..2fc2fd7aa237 100644 --- a/x-pack/plugins/infra/common/log_views/resolved_log_view.ts +++ b/x-pack/plugins/infra/common/log_views/resolved_log_view.ts @@ -23,21 +23,24 @@ export interface ResolvedLogView { fields: ResolvedLogViewField[]; runtimeMappings: estypes.MappingRuntimeFields; columns: LogViewColumnConfiguration[]; + dataViewReference: DataView; } export const resolveLogView = async ( + logViewId: string, logViewAttributes: LogViewAttributes, dataViewsService: DataViewsContract, config: LogViewsStaticConfig ): Promise => { if (logViewAttributes.logIndices.type === 'index_name') { - return await resolveLegacyReference(logViewAttributes, dataViewsService, config); + return await resolveLegacyReference(logViewId, logViewAttributes, dataViewsService, config); } else { return await resolveDataViewReference(logViewAttributes, dataViewsService); } }; const resolveLegacyReference = async ( + logViewId: string, logViewAttributes: LogViewAttributes, dataViewsService: DataViewsContract, config: LogViewsStaticConfig @@ -48,28 +51,32 @@ const resolveLegacyReference = async ( const indices = logViewAttributes.logIndices.indexName; - const fields = await dataViewsService - .getFieldsForWildcard({ - pattern: indices, - allowNoIndex: true, - }) + const dataViewReference = await dataViewsService + .create( + { + id: `log-view-${logViewId}`, + title: indices, + timeFieldName: TIMESTAMP_FIELD, + allowNoIndex: true, + }, + false, + false + ) .catch((error) => { - throw new ResolveLogViewError( - `Failed to fetch fields for indices "${indices}": ${error}`, - error - ); + throw new ResolveLogViewError(`Failed to create Data View reference: ${error}`, error); }); return { - indices: logViewAttributes.logIndices.indexName, + indices, timestampField: TIMESTAMP_FIELD, tiebreakerField: TIEBREAKER_FIELD, messageField: config.messageFields, - fields, + fields: dataViewReference.fields, runtimeMappings: {}, columns: logViewAttributes.logColumns, name: logViewAttributes.name, description: logViewAttributes.description, + dataViewReference, }; }; @@ -97,6 +104,7 @@ const resolveDataViewReference = async ( columns: logViewAttributes.logColumns, name: logViewAttributes.name, description: logViewAttributes.description, + dataViewReference: dataView, }; }; diff --git a/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx b/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx index 2913b2cbb5ec..e5aeefba983f 100644 --- a/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx +++ b/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx @@ -7,11 +7,11 @@ import { buildEsQuery, Filter, Query } from '@kbn/es-query'; import { JsonValue } from '@kbn/utility-types'; -import { noop } from 'lodash'; import React, { useCallback, useEffect, useMemo } from 'react'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { noop } from 'lodash'; import { LogEntryCursor } from '../../../common/log_entry'; import { defaultLogViewsStaticConfig } from '../../../common/log_views'; import { BuiltEsQuery, useLogStream } from '../../containers/logs/log_stream'; diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/errors.ts b/x-pack/plugins/infra/public/containers/logs/log_filter/errors.ts new file mode 100644 index 000000000000..09e3af3e241a --- /dev/null +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/errors.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/* eslint-disable max-classes-per-file */ +export class UnsupportedLanguageError extends Error { + constructor(message?: string) { + super(message); + Object.setPrototypeOf(this, new.target.prototype); + } +} + +export class QueryParsingError extends Error { + constructor(message?: string) { + super(message); + Object.setPrototypeOf(this, new.target.prototype); + } +} diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts index 70d72c25158d..4a2f6e280ebe 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts @@ -5,12 +5,16 @@ * 2.0. */ -import { buildEsQuery, DataViewBase, Query } from '@kbn/es-query'; +import { useMemo, useEffect, useCallback, useState } from 'react'; +import { merge, of } from 'rxjs'; +import { i18n } from '@kbn/i18n'; +import { buildEsQuery, DataViewBase, Query, AggregateQuery, isOfQueryType } from '@kbn/es-query'; import createContainer from 'constate'; -import { useCallback, useState } from 'react'; -import useDebounce from 'react-use/lib/useDebounce'; import { useKibanaQuerySettings } from '../../../utils/use_kibana_query_settings'; import { BuiltEsQuery } from '../log_stream'; +import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; +import { useSubscription } from '../../../utils/use_observable'; +import { UnsupportedLanguageError, QueryParsingError } from './errors'; interface ILogFilterState { filterQuery: { @@ -18,90 +22,126 @@ interface ILogFilterState { serializedQuery: string; originalQuery: Query; } | null; - filterQueryDraft: Query; - validationErrors: string[]; + queryStringQuery: Query | AggregateQuery | null; + validationError: Error | null; } -const initialLogFilterState: ILogFilterState = { +export const DEFAULT_QUERY = { + language: 'kuery', + query: '', +}; + +const INITIAL_LOG_FILTER_STATE = { filterQuery: null, - filterQueryDraft: { - language: 'kuery', - query: '', - }, - validationErrors: [], + queryStringQuery: null, + validationError: null, }; -const validationDebounceTimeout = 1000; // milliseconds +// Error toasts +export const errorToastTitle = i18n.translate( + 'xpack.infra.logsPage.toolbar.logFilterErrorToastTitle', + { + defaultMessage: 'Log filter error', + } +); + +const unsupportedLanguageError = i18n.translate( + 'xpack.infra.logsPage.toolbar.logFilterUnsupportedLanguageError', + { + defaultMessage: 'SQL is not supported', + } +); + +export const useLogFilterState = ({ dataView }: { dataView?: DataViewBase }) => { + const { + notifications: { toasts }, + data: { + query: { queryString }, + }, + } = useKibanaContextForPlugin().services; -export const useLogFilterState = ({ indexPattern }: { indexPattern: DataViewBase }) => { - const [logFilterState, setLogFilterState] = useState(initialLogFilterState); const kibanaQuerySettings = useKibanaQuerySettings(); + const [logFilterState, setLogFilterState] = useState(INITIAL_LOG_FILTER_STATE); + + useEffect(() => { + const handleValidationError = (error: Error) => { + if (error instanceof UnsupportedLanguageError) { + toasts.addError(error, { title: errorToastTitle }); + queryString.setQuery(DEFAULT_QUERY); + } else if (error instanceof QueryParsingError) { + toasts.addError(error, { title: errorToastTitle }); + } + }; + + if (logFilterState.validationError) { + handleValidationError(logFilterState.validationError); + } + }, [logFilterState.validationError, queryString, toasts]); + const parseQuery = useCallback( - (filterQuery: Query) => buildEsQuery(indexPattern, filterQuery, [], kibanaQuerySettings), - [indexPattern, kibanaQuerySettings] + (filterQuery: Query) => { + return buildEsQuery(dataView, filterQuery, [], kibanaQuerySettings); + }, + [dataView, kibanaQuerySettings] ); - const setLogFilterQueryDraft = useCallback((filterQueryDraft: Query) => { - setLogFilterState((previousLogFilterState) => ({ - ...previousLogFilterState, - filterQueryDraft, - validationErrors: [], - })); - }, []); - - const [, cancelPendingValidation] = useDebounce( - () => { - setLogFilterState((previousLogFilterState) => { + const getNewLogFilterState = useCallback( + (newQuery: Query | AggregateQuery) => + (previousLogFilterState: ILogFilterState): ILogFilterState => { try { - parseQuery(logFilterState.filterQueryDraft); - return { - ...previousLogFilterState, - validationErrors: [], - }; + if (!isOfQueryType(newQuery)) { + throw new UnsupportedLanguageError(unsupportedLanguageError); + } + try { + const parsedQuery = parseQuery(newQuery); + return { + filterQuery: { + parsedQuery, + serializedQuery: JSON.stringify(parsedQuery), + originalQuery: newQuery, + }, + queryStringQuery: newQuery, + validationError: null, + }; + } catch (error) { + throw new QueryParsingError(error); + } } catch (error) { return { ...previousLogFilterState, - validationErrors: [`${error}`], + queryStringQuery: newQuery, + validationError: error, }; } - }); - }, - validationDebounceTimeout, - [logFilterState.filterQueryDraft, parseQuery] + }, + [parseQuery] ); - const applyLogFilterQuery = useCallback( - (filterQuery: Query) => { - cancelPendingValidation(); - try { - const parsedQuery = parseQuery(filterQuery); - setLogFilterState((previousLogFilterState) => ({ - ...previousLogFilterState, - filterQuery: { - parsedQuery, - serializedQuery: JSON.stringify(parsedQuery), - originalQuery: filterQuery, - }, - filterQueryDraft: filterQuery, - validationErrors: [], - })); - } catch (error) { - setLogFilterState((previousLogFilterState) => ({ - ...previousLogFilterState, - validationErrors: [`${error}`], - })); - } - }, - [cancelPendingValidation, parseQuery] + useSubscription( + useMemo(() => { + return merge(of(undefined), queryString.getUpdates$()); // NOTE: getUpdates$ uses skip(1) so we do this to ensure an initial emit of a value. + }, [queryString]), + useMemo(() => { + return { + next: () => { + setLogFilterState(getNewLogFilterState(queryString.getQuery())); + }, + }; + }, [getNewLogFilterState, queryString]) ); + // NOTE: If the dataView changes the query will need to be reparsed and the filter regenerated. + useEffect(() => { + if (dataView) { + setLogFilterState(getNewLogFilterState(queryString.getQuery())); + } + }, [dataView, getNewLogFilterState, queryString]); + return { - filterQuery: logFilterState.filterQuery, - filterQueryDraft: logFilterState.filterQueryDraft, - isFilterQueryDraftValid: logFilterState.validationErrors.length === 0, - setLogFilterQueryDraft, - applyLogFilterQuery, + queryStringQuery: logFilterState.queryStringQuery, // NOTE: Query String Manager query. + filterQuery: logFilterState.filterQuery, // NOTE: Valid and syntactically correct query applied to requests etc. + validationError: logFilterState.validationError, }; }; diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx index 2a5970721f5e..a6f6166b7cf0 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx @@ -9,24 +9,33 @@ import * as rt from 'io-ts'; import React from 'react'; import { Query } from '@kbn/es-query'; import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; -import { useLogFilterStateContext } from './log_filter_state'; +import { useLogFilterStateContext, DEFAULT_QUERY } from './log_filter_state'; +import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; export const WithLogFilterUrlState: React.FC = () => { - const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); + const { + data: { + query: { queryString }, + }, + } = useKibanaContextForPlugin().services; + + const { queryStringQuery } = useLogFilterStateContext(); return ( { if (urlState) { - applyLogFilterQuery(urlState); + queryString.setQuery(urlState); } }} onInitialize={(urlState) => { if (urlState) { - applyLogFilterQuery(urlState); + queryString.setQuery(urlState); + } else { + queryString.setQuery(DEFAULT_QUERY); } }} /> diff --git a/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts b/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts index daebfb82b456..8bef101abe66 100644 --- a/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts +++ b/x-pack/plugins/infra/public/hooks/use_log_view.mock.ts @@ -17,10 +17,7 @@ const defaultLogViewId = 'default'; export const createUninitializedUseLogViewMock = (logViewId: string = defaultLogViewId) => (): IUseLogView => ({ - derivedDataView: { - fields: [], - title: 'unknown', - }, + derivedDataView: undefined, hasFailedLoading: false, hasFailedLoadingLogView: false, hasFailedLoadingLogViewStatus: false, diff --git a/x-pack/plugins/infra/public/hooks/use_log_view.ts b/x-pack/plugins/infra/public/hooks/use_log_view.ts index b1b8bb6e33cc..1781bc7346a2 100644 --- a/x-pack/plugins/infra/public/hooks/use_log_view.ts +++ b/x-pack/plugins/infra/public/hooks/use_log_view.ts @@ -6,7 +6,7 @@ */ import createContainer from 'constate'; -import { useCallback, useEffect, useMemo, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import type { HttpHandler } from '@kbn/core/public'; import { LogView, LogViewAttributes, LogViewStatus, ResolvedLogView } from '../../common/log_views'; import type { ILogViewsClient } from '../services/log_views'; @@ -63,14 +63,6 @@ export const useLogView = ({ [logViews] ); - const derivedDataView = useMemo( - () => ({ - fields: resolvedLogView?.fields ?? [], - title: resolvedLogView?.indices ?? 'unknown', - }), - [resolvedLogView] - ); - const isLoadingLogView = loadLogViewRequest.state === 'pending'; const isResolvingLogView = resolveLogViewRequest.state === 'pending'; const isLoadingLogViewStatus = loadLogViewStatusRequest.state === 'pending'; @@ -97,7 +89,7 @@ export const useLogView = ({ const load = useCallback(async () => { const loadedLogView = await loadLogView(logViewId); - const resolvedLoadedLogView = await resolveLogView(loadedLogView.attributes); + const resolvedLoadedLogView = await resolveLogView(loadedLogView.id, loadedLogView.attributes); const resolvedLogViewStatus = await loadLogViewStatus(resolvedLoadedLogView); return [loadedLogView, resolvedLoadedLogView, resolvedLogViewStatus]; @@ -106,7 +98,10 @@ export const useLogView = ({ const update = useCallback( async (logViewAttributes: Partial) => { const updatedLogView = await updateLogView(logViewId, logViewAttributes); - const resolvedUpdatedLogView = await resolveLogView(updatedLogView.attributes); + const resolvedUpdatedLogView = await resolveLogView( + updatedLogView.id, + updatedLogView.attributes + ); const resolvedLogViewStatus = await loadLogViewStatus(resolvedUpdatedLogView); return [updatedLogView, resolvedUpdatedLogView, resolvedLogViewStatus]; @@ -121,7 +116,7 @@ export const useLogView = ({ return { logViewId, isUninitialized, - derivedDataView, + derivedDataView: resolvedLogView?.dataViewReference, // Failure states hasFailedLoading, diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx index 18ac30bb35e1..3b5956240d0e 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx @@ -34,10 +34,16 @@ import { useLogViewContext } from '../../../hooks/use_log_view'; import { datemathToEpochMillis, isValidDatemath } from '../../../utils/datemath'; import { LogsToolbar } from './page_toolbar'; import { PageViewLogInContext } from './page_view_log_in_context'; +import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; const PAGE_THRESHOLD = 2; export const LogsPageLogsContent: React.FunctionComponent = () => { + const { + data: { + query: { queryString }, + }, + } = useKibanaContextForPlugin().services; const { resolvedLogView, logView, logViewId } = useLogViewContext(); const { textScale, textWrap } = useLogViewConfigurationContext(); const { @@ -65,7 +71,7 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { updateDateRange, lastCompleteDateRangeExpressionUpdate, } = useLogPositionStateContext(); - const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); + const { filterQuery } = useLogFilterStateContext(); const { isReloading, @@ -193,14 +199,14 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { const setFilter = useCallback( (filter: Query, flyoutItemId: string, timeKey: TimeKey | undefined | null) => { - applyLogFilterQuery(filter); + queryString.setQuery(filter); if (timeKey) { jumpToTargetPosition(timeKey); } setSurroundingLogsId(flyoutItemId); stopLiveStreaming(); }, - [applyLogFilterQuery, jumpToTargetPosition, setSurroundingLogsId, stopLiveStreaming] + [jumpToTargetPosition, queryString, setSurroundingLogsId, stopLiveStreaming] ); return ( diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx index ea2af542586a..026119ff5c74 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx @@ -27,7 +27,7 @@ const LogFilterState: React.FC = ({ children }) => { const { derivedDataView } = useLogViewContext(); return ( - + {children} diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx index 210def8f8844..cf30518f78ed 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx @@ -6,11 +6,8 @@ */ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { Query } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { QueryStringInput } from '@kbn/unified-search-plugin/public'; -import { DataView } from '@kbn/data-views-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { LogCustomizationMenu } from '../../../components/logging/log_customization_menu'; @@ -18,8 +15,6 @@ import { LogDatepicker } from '../../../components/logging/log_datepicker'; import { LogHighlightsMenu } from '../../../components/logging/log_highlights_menu'; import { LogTextScaleControls } from '../../../components/logging/log_text_scale_controls'; import { LogTextWrapControls } from '../../../components/logging/log_text_wrap_controls'; -import { useLogFilterStateContext } from '../../../containers/logs/log_filter'; -import { useLogEntryFlyoutContext } from '../../../containers/logs/log_flyout'; import { useLogHighlightsStateContext } from '../../../containers/logs/log_highlights/log_highlights'; import { useLogPositionStateContext } from '../../../containers/logs/log_position'; import { useLogViewConfigurationContext } from '../../../containers/logs/log_view_configuration'; @@ -29,11 +24,11 @@ export const LogsToolbar = () => { const { derivedDataView } = useLogViewContext(); const { availableTextScales, setTextScale, setTextWrap, textScale, textWrap } = useLogViewConfigurationContext(); - const { filterQueryDraft, isFilterQueryDraftValid, applyLogFilterQuery, setLogFilterQueryDraft } = - useLogFilterStateContext(); - const { setSurroundingLogsId } = useLogEntryFlyoutContext(); - const { http, notifications, docLinks, uiSettings, data, dataViews, storage, unifiedSearch } = - useKibanaContextForPlugin().services; + const { + unifiedSearch: { + ui: { SearchBar }, + }, + } = useKibanaContextForPlugin().services; const { setHighlightTerms, @@ -57,36 +52,20 @@ export const LogsToolbar = () => {
      - { - setSurroundingLogsId(null); - setLogFilterQueryDraft(query); - }} - onSubmit={(query: Query) => { - setSurroundingLogsId(null); - applyLogFilterQuery(query); - }} placeholder={i18n.translate('xpack.infra.logsPage.toolbar.kqlSearchFieldPlaceholder', { defaultMessage: 'Search for log entries… (e.g. host.name:host-1)', })} - query={filterQueryDraft} - appName={i18n.translate('xpack.infra.appName', { - defaultMessage: 'Infra logs', - })} - deps={{ - unifiedSearch, - notifications, - http, - docLinks, - uiSettings, - data, - dataViews, - storage, - }} + useDefaultBehaviors={true} + indexPatterns={derivedDataView ? [derivedDataView] : undefined} + showQueryInput={true} + showQueryMenu={false} + showFilterBar={false} + showDatePicker={false} /> diff --git a/x-pack/plugins/infra/public/services/log_views/log_views_client.ts b/x-pack/plugins/infra/public/services/log_views/log_views_client.ts index 0de44f87d719..65bb031d3407 100644 --- a/x-pack/plugins/infra/public/services/log_views/log_views_client.ts +++ b/x-pack/plugins/infra/public/services/log_views/log_views_client.ts @@ -53,7 +53,7 @@ export class LogViewsClient implements ILogViewsClient { public async getResolvedLogView(logViewId: string): Promise { const logView = await this.getLogView(logViewId); - const resolvedLogView = await this.resolveLogView(logView.attributes); + const resolvedLogView = await this.resolveLogView(logView.id, logView.attributes); return resolvedLogView; } @@ -118,8 +118,11 @@ export class LogViewsClient implements ILogViewsClient { return data; } - public async resolveLogView(logViewAttributes: LogViewAttributes): Promise { - return await resolveLogView(logViewAttributes, this.dataViews, this.config); + public async resolveLogView( + logViewId: string, + logViewAttributes: LogViewAttributes + ): Promise { + return await resolveLogView(logViewId, logViewAttributes, this.dataViews, this.config); } } diff --git a/x-pack/plugins/infra/public/services/log_views/types.ts b/x-pack/plugins/infra/public/services/log_views/types.ts index 20e176db4cab..9054ef79b4a4 100644 --- a/x-pack/plugins/infra/public/services/log_views/types.ts +++ b/x-pack/plugins/infra/public/services/log_views/types.ts @@ -32,5 +32,5 @@ export interface ILogViewsClient { getResolvedLogViewStatus(resolvedLogView: ResolvedLogView): Promise; getResolvedLogView(logViewId: string): Promise; putLogView(logViewId: string, logViewAttributes: Partial): Promise; - resolveLogView(logViewAttributes: LogViewAttributes): Promise; + resolveLogView(logViewId: string, logViewAttributes: LogViewAttributes): Promise; } diff --git a/x-pack/plugins/infra/public/utils/url_state.tsx b/x-pack/plugins/infra/public/utils/url_state.tsx index 77f04292cbde..c45b47074f8c 100644 --- a/x-pack/plugins/infra/public/utils/url_state.tsx +++ b/x-pack/plugins/infra/public/utils/url_state.tsx @@ -7,11 +7,11 @@ import { parse, stringify } from 'query-string'; import { History, Location } from 'history'; -import { throttle } from 'lodash'; import React from 'react'; import { Route, RouteProps } from 'react-router-dom'; import { decode, encode, RisonValue } from 'rison-node'; import { url } from '@kbn/kibana-utils-plugin/public'; +import { throttle } from 'lodash'; interface UrlStateContainerProps { urlState: UrlState | undefined; diff --git a/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts b/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts index 7b1debf981f8..e517ae8aef7f 100644 --- a/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts +++ b/x-pack/plugins/infra/server/services/log_views/log_views_client.test.ts @@ -239,7 +239,7 @@ describe('LogViewsClient class', () => { }) ); - const resolvedLogView = await logViewsClient.resolveLogView({ + const resolvedLogView = await logViewsClient.resolveLogView('log-view-id', { name: 'LOG VIEW', description: 'LOG VIEW DESCRIPTION', logIndices: { @@ -280,6 +280,64 @@ describe('LogViewsClient class', () => { }, }, ], + "dataViewReference": DataView { + "allowNoIndex": false, + "deleteFieldFormat": [Function], + "fieldAttrs": Object {}, + "fieldFormatMap": Object {}, + "fieldFormats": Object { + "deserialize": [MockFunction], + "getByFieldType": [MockFunction], + "getDefaultConfig": [MockFunction], + "getDefaultInstance": [MockFunction], + "getDefaultInstanceCacheResolver": [MockFunction], + "getDefaultInstancePlain": [MockFunction], + "getDefaultType": [MockFunction], + "getDefaultTypeName": [MockFunction], + "getInstance": [MockFunction], + "getType": [MockFunction], + "getTypeNameByEsTypes": [MockFunction], + "getTypeWithoutMetaParams": [MockFunction], + "has": [MockFunction], + "init": [MockFunction], + "parseDefaultTypeMap": [MockFunction], + "register": [MockFunction], + }, + "fields": FldList [], + "flattenHit": [Function], + "getFieldAttrs": [Function], + "getIndexPattern": [Function], + "getName": [Function], + "getOriginalSavedObjectBody": [Function], + "id": "LOG_DATA_VIEW", + "matchedIndices": Array [], + "metaFields": Array [ + "_id", + "_type", + "_source", + ], + "name": "", + "namespaces": Array [], + "originalSavedObjectBody": Object {}, + "resetOriginalSavedObjectBody": [Function], + "runtimeFieldMap": Object { + "runtime_field": Object { + "script": Object { + "source": "emit(\\"runtime value\\")", + }, + "type": "keyword", + }, + }, + "setFieldFormat": [Function], + "setIndexPattern": [Function], + "shortDotsEnable": false, + "sourceFilters": Array [], + "timeFieldName": "@timestamp", + "title": "log-indices-*", + "type": undefined, + "typeMeta": undefined, + "version": "1", + }, "description": "LOG VIEW DESCRIPTION", "fields": FldList [], "indices": "log-indices-*", diff --git a/x-pack/plugins/infra/server/services/log_views/log_views_client.ts b/x-pack/plugins/infra/server/services/log_views/log_views_client.ts index 57c90235452b..9f43cee871f7 100644 --- a/x-pack/plugins/infra/server/services/log_views/log_views_client.ts +++ b/x-pack/plugins/infra/server/services/log_views/log_views_client.ts @@ -67,7 +67,7 @@ export class LogViewsClient implements ILogViewsClient { public async getResolvedLogView(logViewId: string): Promise { const logView = await this.getLogView(logViewId); - const resolvedLogView = await this.resolveLogView(logView.attributes); + const resolvedLogView = await this.resolveLogView(logView.id, logView.attributes); return resolvedLogView; } @@ -98,8 +98,11 @@ export class LogViewsClient implements ILogViewsClient { return getLogViewFromSavedObject(savedObject); } - public async resolveLogView(logViewAttributes: LogViewAttributes): Promise { - return await resolveLogView(logViewAttributes, await this.dataViews, this.config); + public async resolveLogView( + logViewId: string, + logViewAttributes: LogViewAttributes + ): Promise { + return await resolveLogView(logViewId, logViewAttributes, await this.dataViews, this.config); } private async getSavedLogView(logViewId: string): Promise { diff --git a/x-pack/plugins/infra/server/services/log_views/types.ts b/x-pack/plugins/infra/server/services/log_views/types.ts index 4146b6e2fd7e..c10bd2002163 100644 --- a/x-pack/plugins/infra/server/services/log_views/types.ts +++ b/x-pack/plugins/infra/server/services/log_views/types.ts @@ -46,5 +46,5 @@ export interface ILogViewsClient { getLogView(logViewId: string): Promise; getResolvedLogView(logViewId: string): Promise; putLogView(logViewId: string, logViewAttributes: Partial): Promise; - resolveLogView(logViewAttributes: LogViewAttributes): Promise; + resolveLogView(logViewId: string, logViewAttributes: LogViewAttributes): Promise; } From 5c12624b307736da3ce09f343523164e5777802b Mon Sep 17 00:00:00 2001 From: Maryam Saeidi Date: Wed, 2 Nov 2022 11:06:10 +0100 Subject: [PATCH 86/87] [Actionable Observability] Refactor alert search bar (#143840) * Refactor alerts search bar and remove refresh now * Remove refreshNow from observability overview page * Fix alert status query * Remove relative time test * Change AnyQuery type to Query --- .../plugins/observability/common/typings.ts | 9 +- .../observability/public/application/types.ts | 3 + .../alerts/components/alerts_search_bar.tsx | 30 ++-- .../components/alerts_status_filter.tsx | 9 +- .../containers/alerts_page/alerts_page.tsx | 134 ++++++++---------- .../containers/alerts_page/constants.ts | 15 -- .../state_container/state_container.tsx | 6 + .../use_alerts_page_state_container.tsx | 9 +- .../overview_page/overview_page.tsx | 23 +-- x-pack/plugins/observability/public/plugin.ts | 2 + .../__snapshots__/build_es_query.test.ts.snap | 32 ----- .../build_es_query/build_es_query.test.ts | 7 - .../utils/build_es_query/build_es_query.ts | 11 +- .../alerts_table/alerts_table_state.test.tsx | 28 ---- .../alerts_table/alerts_table_state.tsx | 12 +- 15 files changed, 133 insertions(+), 197 deletions(-) diff --git a/x-pack/plugins/observability/common/typings.ts b/x-pack/plugins/observability/common/typings.ts index 9def2c23d0ea..5bf00746f494 100644 --- a/x-pack/plugins/observability/common/typings.ts +++ b/x-pack/plugins/observability/common/typings.ts @@ -26,12 +26,11 @@ export interface ApmIndicesConfig { apmAgentConfigurationIndex: string; apmCustomLinkIndex: string; } -export type AlertStatusFilterButton = - | typeof ALERT_STATUS_ACTIVE - | typeof ALERT_STATUS_RECOVERED - | ''; + +export type AlertStatus = typeof ALERT_STATUS_ACTIVE | typeof ALERT_STATUS_RECOVERED | ''; + export interface AlertStatusFilter { - status: AlertStatusFilterButton; + status: AlertStatus; query: string; label: string; } diff --git a/x-pack/plugins/observability/public/application/types.ts b/x-pack/plugins/observability/public/application/types.ts index 4707760c63e3..e0d12548a282 100644 --- a/x-pack/plugins/observability/public/application/types.ts +++ b/x-pack/plugins/observability/public/application/types.ts @@ -24,6 +24,8 @@ import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui-plugin/public'; import { CasesUiStart } from '@kbn/cases-plugin/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; + export interface ObservabilityAppServices { application: ApplicationStart; cases: CasesUiStart; @@ -42,5 +44,6 @@ export interface ObservabilityAppServices { theme: ThemeServiceStart; triggersActionsUi: TriggersAndActionsUIPublicPluginStart; uiSettings: IUiSettingsClient; + unifiedSearch: UnifiedSearchPublicPluginStart; isDev?: boolean; } diff --git a/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx index 2cc05ba47ec0..e1dd3743e387 100644 --- a/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx @@ -5,23 +5,27 @@ * 2.0. */ -import React, { useMemo, useState } from 'react'; -import { TimeHistory } from '@kbn/data-plugin/public'; -import { SearchBar } from '@kbn/unified-search-plugin/public'; -import { Storage } from '@kbn/kibana-utils-plugin/public'; +import React, { useState } from 'react'; +import { DataView } from '@kbn/data-views-plugin/common'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { ValidFeatureId } from '@kbn/rule-data-utils'; import { translations } from '../../../config'; +import { ObservabilityAppServices } from '../../../application/types'; import { useAlertDataView } from '../../../hooks/use_alert_data_view'; type QueryLanguageType = 'lucene' | 'kuery'; +const NO_INDEX_PATTERNS: DataView[] = []; + export function AlertsSearchBar({ + appName, featureIds, - onQueryChange, query, + onQueryChange, rangeFrom, rangeTo, }: { + appName: string; featureIds: ValidFeatureId[]; rangeFrom?: string; rangeTo?: string; @@ -31,20 +35,25 @@ export function AlertsSearchBar({ query?: string; }) => void; }) { - const timeHistory = useMemo(() => { - return new TimeHistory(new Storage(localStorage)); - }, []); + const { + unifiedSearch: { + ui: { SearchBar }, + }, + } = useKibana().services; + const [queryLanguage, setQueryLanguage] = useState('kuery'); const { value: dataView, loading, error } = useAlertDataView(featureIds); return ( { onQueryChange({ dateRange, @@ -52,7 +61,6 @@ export function AlertsSearchBar({ }); setQueryLanguage((nextQuery?.language ?? 'kuery') as QueryLanguageType); }} - displayStyle="inPage" /> ); } diff --git a/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx index 4b64a413b504..5ef1d98f133c 100644 --- a/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx @@ -9,11 +9,11 @@ import { EuiButtonGroup, EuiButtonGroupOptionProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED, ALERT_STATUS } from '@kbn/rule-data-utils'; -import { AlertStatusFilterButton } from '../../../../common/typings'; +import { AlertStatus } from '../../../../common/typings'; import { AlertStatusFilter } from '../../../../common/typings'; export interface AlertStatusFilterProps { - status: AlertStatusFilterButton; + status: AlertStatus; onChange: (id: string, value: string) => void; } @@ -41,6 +41,11 @@ export const RECOVERED_ALERTS: AlertStatusFilter = { }), }; +export const ALERT_STATUS_QUERY = { + [ACTIVE_ALERTS.status]: ACTIVE_ALERTS.query, + [RECOVERED_ALERTS.status]: RECOVERED_ALERTS.query, +}; + const options: EuiButtonGroupOptionProps[] = [ { id: ALL_ALERTS.status, diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx index 10b0f37a2a8d..f18b3741b33f 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx @@ -8,12 +8,13 @@ import { EuiFlexGroup, EuiFlexItem, EuiFlyoutSize } from '@elastic/eui'; import React, { useCallback, useEffect, useState } from 'react'; +import { Query, BoolQuery } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { loadRuleAggregations } from '@kbn/triggers-actions-ui-plugin/public'; -import { AlertConsumers, AlertStatus } from '@kbn/rule-data-utils'; +import { AlertConsumers } from '@kbn/rule-data-utils'; +import { AlertStatus } from '../../../../../common/typings'; import { observabilityAlertFeatureIds } from '../../../../config'; -import { AlertStatusFilterButton } from '../../../../../common/typings'; import { useGetUserCasesPermissions } from '../../../../hooks/use_get_user_cases_permissions'; import { observabilityFeatureId } from '../../../../../common'; import { useBreadcrumbs } from '../../../../hooks/use_breadcrumbs'; @@ -28,25 +29,18 @@ import { useAlertsPageStateContainer, } from '../state_container'; import './styles.scss'; -import { AlertsStatusFilter, AlertsSearchBar, ALL_ALERTS } from '../../components'; +import { AlertsStatusFilter, AlertsSearchBar, ALERT_STATUS_QUERY } from '../../components'; import { renderRuleStats } from '../../components/rule_stats'; import { ObservabilityAppServices } from '../../../../application/types'; -import { - ALERT_STATUS_REGEX, - ALERTS_PER_PAGE, - ALERTS_TABLE_ID, - BASE_ALERT_REGEX, -} from './constants'; +import { ALERTS_PER_PAGE, ALERTS_TABLE_ID } from './constants'; import { RuleStatsState } from './types'; +const getAlertStatusQuery = (status: string): Query[] => { + return status ? [{ query: ALERT_STATUS_QUERY[status], language: 'kuery' }] : []; +}; + function AlertsPage() { const { ObservabilityPageTemplate, observabilityRuleTypeRegistry } = usePluginContext(); - const [alertFilterStatus, setAlertFilterStatus] = useState( - ALL_ALERTS.query as AlertStatusFilterButton - ); - const [refreshNow, setRefreshNow] = useState(); - const { rangeFrom, setRangeFrom, rangeTo, setRangeTo, kuery, setKuery } = - useAlertsPageStateContainer(); const { cases, docLinks, @@ -59,7 +53,6 @@ function AlertsPage() { }, }, } = useKibana().services; - const [ruleStatsLoading, setRuleStatsLoading] = useState(false); const [ruleStats, setRuleStats] = useState({ total: 0, @@ -68,10 +61,19 @@ function AlertsPage() { error: 0, snoozed: 0, }); - - useEffect(() => { - syncAlertStatusFilterStatus(kuery as string); - }, [kuery]); + const { hasAnyData, isAllRequestsComplete } = useHasData(); + const { rangeFrom, setRangeFrom, rangeTo, setRangeTo, kuery, setKuery, status, setStatus } = + useAlertsPageStateContainer(); + const [esQuery, setEsQuery] = useState<{ bool: BoolQuery }>( + buildEsQuery( + { + to: rangeTo, + from: rangeFrom, + }, + kuery, + getAlertStatusQuery(status) + ) + ); useBreadcrumbs([ { @@ -123,57 +125,46 @@ function AlertsPage() { const manageRulesHref = http.basePath.prepend('/app/observability/alerts/rules'); - const onRefresh = () => { - setRefreshNow(new Date().getTime()); - }; + const onStatusChange = useCallback( + (alertStatus: AlertStatus) => { + setEsQuery( + buildEsQuery( + { + to: rangeTo, + from: rangeFrom, + }, + kuery, + getAlertStatusQuery(alertStatus) + ) + ); + }, + [kuery, rangeFrom, rangeTo] + ); + + useEffect(() => { + onStatusChange(status); + }, [onStatusChange, status]); - const onQueryChange = useCallback( + const onSearchBarParamsChange = useCallback( ({ dateRange, query }) => { - if (rangeFrom === dateRange.from && rangeTo === dateRange.to && kuery === (query ?? '')) { - return onRefresh(); - } timeFilterService.setTime(dateRange); setRangeFrom(dateRange.from); setRangeTo(dateRange.to); setKuery(query); - syncAlertStatusFilterStatus(query as string); - }, - [rangeFrom, setRangeFrom, rangeTo, setRangeTo, kuery, setKuery, timeFilterService] - ); - - const syncAlertStatusFilterStatus = (query: string) => { - const [, alertStatus] = BASE_ALERT_REGEX.exec(query) || []; - if (!alertStatus) { - setAlertFilterStatus(''); - return; - } - setAlertFilterStatus(alertStatus.toLowerCase() as AlertStatus); - }; - const setAlertStatusFilter = useCallback( - (id: string, query: string) => { - setAlertFilterStatus(id as AlertStatusFilterButton); - // Updating the KQL query bar alongside with user inputs is tricky. - // To avoid issue, this function always remove the AlertFilter and add it - // at the end of the query, each time the filter is added/updated/removed (Show All) - // NOTE: This (query appending) will be changed entirely: https://github.com/elastic/kibana/issues/116135 - let output; - if (kuery === '') { - output = query; - } else { - const queryWithoutAlertFilter = kuery.replace(ALERT_STATUS_REGEX, ''); - output = `${queryWithoutAlertFilter} and ${query}`; - } - onQueryChange({ - dateRange: { from: rangeFrom, to: rangeTo }, - // Clean up the kuery from unwanted trailing/ahead ANDs after appending and removing filters. - query: output.replace(/^\s*and\s*|\s*and\s*$/gm, ''), - }); + setEsQuery( + buildEsQuery( + { + to: rangeTo, + from: rangeFrom, + }, + query, + getAlertStatusQuery(status) + ) + ); }, - [kuery, onQueryChange, rangeFrom, rangeTo] + [rangeFrom, setRangeFrom, rangeTo, status, setRangeTo, setKuery, timeFilterService] ); - const { hasAnyData, isAllRequestsComplete } = useHasData(); - // If there is any data, set hasData to true otherwise we need to wait till all the data is loaded before setting hasData to true or false; undefined indicates the data is still loading. const hasData = hasAnyData === true || (isAllRequestsComplete === false ? undefined : false); @@ -205,18 +196,24 @@ function AlertsPage() { - + { + setStatus(id as AlertStatus); + }} + /> @@ -233,16 +230,9 @@ function AlertsPage() { id={ALERTS_TABLE_ID} flyoutSize={'s' as EuiFlyoutSize} featureIds={observabilityAlertFeatureIds} - query={buildEsQuery( - { - to: rangeTo, - from: rangeFrom, - }, - kuery - )} + query={esQuery} showExpandToDetails={false} pageSize={ALERTS_PER_PAGE} - refreshNow={refreshNow} /> diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts index 83b059b04f5e..47a6ef7f8752 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/constants.ts @@ -5,21 +5,6 @@ * 2.0. */ -import { DataViewBase } from '@kbn/es-query'; -import { ALERT_STATUS } from '@kbn/rule-data-utils'; - export const ALERTS_PAGE_ID = 'alerts-o11y'; export const ALERTS_PER_PAGE = 50; export const ALERTS_TABLE_ID = 'xpack.observability.alerts.alert.table'; - -const regExpEscape = (str: string) => str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -export const NO_INDEX_PATTERNS: DataViewBase[] = []; -export const BASE_ALERT_REGEX = new RegExp( - `\\s*${regExpEscape(ALERT_STATUS)}\\s*:\\s*"(.*?|\\*?)"` -); -export const ALERT_STATUS_REGEX = new RegExp( - `\\s*and\\s*${regExpEscape(ALERT_STATUS)}\\s*:\\s*(".+?"|\\*?)|${regExpEscape( - ALERT_STATUS - )}\\s*:\\s*(".+?"|\\*?)`, - 'gm' -); diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx index 392340fc80b2..1ddbd151a12e 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx @@ -9,11 +9,14 @@ import { createStateContainer, createStateContainerReactHelpers, } from '@kbn/kibana-utils-plugin/public'; +import { AlertStatus } from '../../../../../common/typings'; +import { ALL_ALERTS } from '../..'; interface AlertsPageContainerState { rangeFrom: string; rangeTo: string; kuery: string; + status: AlertStatus; } interface AlertsPageStateTransitions { @@ -22,18 +25,21 @@ interface AlertsPageStateTransitions { ) => (rangeFrom: string) => AlertsPageContainerState; setRangeTo: (state: AlertsPageContainerState) => (rangeTo: string) => AlertsPageContainerState; setKuery: (state: AlertsPageContainerState) => (kuery: string) => AlertsPageContainerState; + setStatus: (state: AlertsPageContainerState) => (status: AlertStatus) => AlertsPageContainerState; } const defaultState: AlertsPageContainerState = { rangeFrom: 'now-15m', rangeTo: 'now', kuery: '', + status: ALL_ALERTS.status as AlertStatus, }; const transitions: AlertsPageStateTransitions = { setRangeFrom: (state) => (rangeFrom) => ({ ...state, rangeFrom }), setRangeTo: (state) => (rangeTo) => ({ ...state, rangeTo }), setKuery: (state) => (kuery) => ({ ...state, kuery }), + setStatus: (state) => (status) => ({ ...state, status }), }; const alertsPageStateContainer = createStateContainer(defaultState, transitions); diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx index 0b9fb864b098..7a6f13be0e86 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx @@ -29,8 +29,11 @@ export function useAlertsPageStateContainer() { useUrlStateSyncEffect(stateContainer); - const { setRangeFrom, setRangeTo, setKuery } = stateContainer.transitions; - const { rangeFrom, rangeTo, kuery } = useContainerSelector(stateContainer, (state) => state); + const { setRangeFrom, setRangeTo, setKuery, setStatus } = stateContainer.transitions; + const { rangeFrom, rangeTo, kuery, status } = useContainerSelector( + stateContainer, + (state) => state + ); return { rangeFrom, @@ -39,6 +42,8 @@ export function useAlertsPageStateContainer() { setRangeTo, kuery, setKuery, + status, + setStatus, }; } diff --git a/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx b/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx index 16ccd0e1fdc0..d0420f07b573 100644 --- a/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx +++ b/x-pack/plugins/observability/public/pages/overview/containers/overview_page/overview_page.tsx @@ -20,6 +20,7 @@ import { EuiTitle, EuiTourStep, } from '@elastic/eui'; +import { BoolQuery } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; @@ -66,7 +67,6 @@ export function OverviewPage() { }, ]); const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); - const [refreshNow, setRefreshNow] = useState(); const { cases, @@ -77,6 +77,12 @@ export function OverviewPage() { const { ObservabilityPageTemplate } = usePluginContext(); const { relativeStart, relativeEnd, absoluteStart, absoluteEnd } = useDatePickerContext(); + const [esQuery, setEsQuery] = useState<{ bool: BoolQuery }>( + buildEsQuery({ + from: relativeStart, + to: relativeEnd, + }) + ); const { data: newsFeed } = useFetcher(() => getNewsFeed({ http }), [http]); @@ -105,9 +111,14 @@ export function OverviewPage() { }, [trackMetric, isGuidedSetupProgressDismissed, hideGuidedSetupTour]); const onTimeRangeRefresh = useCallback(() => { - setRefreshNow(new Date().getTime()); + setEsQuery( + buildEsQuery({ + from: relativeStart, + to: relativeEnd, + }) + ); return refetch.current && refetch.current(); - }, []); + }, [relativeEnd, relativeStart]); const CasesContext = cases.ui.getCasesContext(); const userCasesPermissions = useGetUserCasesPermissions(); @@ -183,13 +194,9 @@ export function OverviewPage() { AlertConsumers.LOGS, AlertConsumers.UPTIME, ]} - query={buildEsQuery({ - from: relativeStart, - to: relativeEnd, - })} + query={esQuery} showExpandToDetails={false} pageSize={ALERTS_PER_PAGE} - refreshNow={refreshNow} /> diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index c5152104e3bc..ec08bbb7bd0d 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -38,6 +38,7 @@ import { } from '@kbn/triggers-actions-ui-plugin/public'; import { SecurityPluginStart } from '@kbn/security-plugin/public'; import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; +import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { observabilityAppId, observabilityFeatureId, casesPath } from '../common'; import { createLazyObservabilityPageTemplate } from './components/shared'; import { registerDataHandler } from './data_handler'; @@ -94,6 +95,7 @@ export interface ObservabilityPublicPluginsStart { actionTypeRegistry: ActionTypeRegistryContract; security: SecurityPluginStart; guidedOnboarding: GuidedOnboardingPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; } export type ObservabilityPublicStart = ReturnType; diff --git a/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap b/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap index 8e6559830cd9..118435d5c696 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap +++ b/x-pack/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap @@ -167,35 +167,3 @@ Object { } `; -exports[`buildEsQuery should generate correct es query for {"timeRange":{"from":"now-15min","to":"now"},"kuery":"kibana.alert.status: \\"recovered\\""} 1`] = ` -Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match_phrase": Object { - "kibana.alert.status": "recovered", - }, - }, - ], - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "strict_date_optional_time", - "gte": "now-15min", - "lte": "now", - }, - }, - }, - ], - "must": Array [], - "must_not": Array [], - "should": Array [], - }, -} -`; diff --git a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts index 39029a03bb26..4bbacaa7bb1a 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts +++ b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.test.ts @@ -34,13 +34,6 @@ describe('buildEsQuery', () => { timeRange: defaultTimeRange, kuery: 'kibana.alert.status: "recovered" and kibana.alert.duration.us >= 120', }, - { - timeRange: { - from: 'now-15min', - to: 'now', - }, - kuery: 'kibana.alert.status: "recovered"', - }, ]; test.each(testData)('should generate correct es query for %j', ({ kuery, timeRange }) => { diff --git a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts index 12711c54f978..f3f195e0df9b 100644 --- a/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts +++ b/x-pack/plugins/observability/public/utils/build_es_query/build_es_query.ts @@ -5,18 +5,19 @@ * 2.0. */ -import { buildEsQuery as kbnBuildEsQuery, TimeRange } from '@kbn/es-query'; +import { buildEsQuery as kbnBuildEsQuery, TimeRange, Query } from '@kbn/es-query'; import { TIMESTAMP } from '@kbn/rule-data-utils'; -import { getRelativeTime } from '@kbn/data-plugin/common'; +import { getTime } from '@kbn/data-plugin/common'; -export function buildEsQuery(timeRange: TimeRange, kuery?: string) { +export function buildEsQuery(timeRange: TimeRange, kuery?: string, queries: Query[] = []) { const timeFilter = timeRange && - getRelativeTime(undefined, timeRange, { + getTime(undefined, timeRange, { fieldName: TIMESTAMP, }); const filtersToUse = timeFilter ? [timeFilter] : []; - const queryToUse = kuery ? { query: kuery, language: 'kuery' } : []; + const kueryFilter = kuery ? [{ query: kuery, language: 'kuery' }] : []; + const queryToUse = [...kueryFilter, ...queries]; return kbnBuildEsQuery(undefined, queryToUse, filtersToUse); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx index fbe2b25437d8..107f92434704 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.test.tsx @@ -363,32 +363,4 @@ describe('AlertsTableState', () => { expect(result.getByTestId('alertsStateTableEmptyState')).toBeTruthy(); }); }); - - describe('refresh alerts', () => { - beforeEach(() => { - refecthMock.mockClear(); - hookUseFetchAlerts.mockClear(); - hookUseFetchAlerts.mockImplementation(() => [ - false, - { - alerts: [], - isInitializing: false, - getInspectQuery: jest.fn(), - refetch: refecthMock, - totalAlerts: 0, - }, - ]); - }); - - it('should NOT refetch the alert at initialization', async () => { - render(); - expect(refecthMock).toBeCalledTimes(0); - }); - it('should refetch the alert when refreshNow is updated', async () => { - const result = render(); - const props = { ...tableProps, refreshNow: 123456789 }; - result.rerender(); - expect(refecthMock).toBeCalledTimes(1); - }); - }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx index b99568cfb6bc..f75aee03afcf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx @@ -4,7 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useState, useCallback, useRef, useMemo, useReducer, useEffect } from 'react'; + +import React, { useState, useCallback, useRef, useMemo, useReducer } from 'react'; import { isEmpty } from 'lodash'; import { EuiDataGridColumn, @@ -56,7 +57,6 @@ export interface AlertsTableStateProps { flyoutSize?: EuiFlyoutSize; query: Pick; pageSize?: number; - refreshNow?: number; showExpandToDetails: boolean; } @@ -104,7 +104,6 @@ const AlertsTableState = ({ flyoutSize, query, pageSize, - refreshNow, showExpandToDetails, }: AlertsTableStateProps) => { const { cases } = useKibana<{ cases: CaseUi }>().services; @@ -287,13 +286,6 @@ const AlertsTableState = ({ const CasesContext = cases?.ui.getCasesContext(); const userCasesPermissions = useGetUserCasesPermissions(alertsTableConfiguration.casesFeatureId); - useEffect(() => { - if (!isLoading && refreshNow) { - refresh(); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [refreshNow]); - return hasAlertsTableConfiguration ? ( <> {!isLoading && alertsCount === 0 && } From 3f620428b3a81b2eaaef2a0374dd9e0e4da815a9 Mon Sep 17 00:00:00 2001 From: Yaroslav Kuznietsov Date: Wed, 2 Nov 2022 12:39:30 +0200 Subject: [PATCH 87/87] [Lens] Heatmap expression types improvement. (#144174) * Added expression function builder for heatmap * Fixed heatmap preview. * Fixed tests. Co-authored-by: Stratoula Kalafateli --- .../expression_functions/heatmap_legend.ts | 10 +- .../expression_heatmap/common/index.ts | 3 + .../common/types/expression_functions.ts | 14 ++ .../heatmap/visualization.test.ts | 11 +- .../visualizations/heatmap/visualization.tsx | 229 +++++++----------- 5 files changed, 114 insertions(+), 153 deletions(-) diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts index 79a356ddad93..9aa489a031ee 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_legend.ts @@ -7,17 +7,11 @@ */ import { Position } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; -import type { ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; import { DEFAULT_LEGEND_SIZE, LegendSize } from '@kbn/visualizations-plugin/common/constants'; import { EXPRESSION_HEATMAP_LEGEND_NAME } from '../constants'; -import { HeatmapLegendConfig, HeatmapLegendConfigResult } from '../types'; +import { HeatmapLegendExpressionFunctionDefinition } from '../types'; -export const heatmapLegendConfig: ExpressionFunctionDefinition< - typeof EXPRESSION_HEATMAP_LEGEND_NAME, - null, - HeatmapLegendConfig, - HeatmapLegendConfigResult -> = { +export const heatmapLegendConfig: HeatmapLegendExpressionFunctionDefinition = { name: EXPRESSION_HEATMAP_LEGEND_NAME, aliases: [], type: EXPRESSION_HEATMAP_LEGEND_NAME, diff --git a/src/plugins/chart_expressions/expression_heatmap/common/index.ts b/src/plugins/chart_expressions/expression_heatmap/common/index.ts index 484dee11c300..1fa096cc6fe8 100755 --- a/src/plugins/chart_expressions/expression_heatmap/common/index.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/index.ts @@ -18,6 +18,9 @@ export type { HeatmapLegendConfigResult, HeatmapGridConfigResult, HeatmapArguments, + HeatmapExpressionFunctionDefinition, + HeatmapLegendExpressionFunctionDefinition, + HeatmapGridExpressionFunctionDefinition, } from './types'; export { heatmapFunction, heatmapLegendConfig, heatmapGridConfig } from './expression_functions'; diff --git a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts index 1bf5fe3bbb36..2537d4c7f510 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts @@ -109,3 +109,17 @@ export type HeatmapExpressionFunctionDefinition = ExpressionFunctionDefinition< HeatmapArguments, ExpressionValueRender >; + +export type HeatmapLegendExpressionFunctionDefinition = ExpressionFunctionDefinition< + typeof EXPRESSION_HEATMAP_LEGEND_NAME, + null, + HeatmapLegendConfig, + HeatmapLegendConfigResult +>; + +export type HeatmapGridExpressionFunctionDefinition = ExpressionFunctionDefinition< + typeof EXPRESSION_HEATMAP_GRID_NAME, + null, + HeatmapGridConfig, + HeatmapGridConfigResult +>; diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts index 8f958b8fa75c..bbebf37ff4b5 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.test.ts @@ -427,7 +427,6 @@ describe('heatmap', () => { arguments: { isVisible: [true], position: [Position.Right], - legendSize: [], }, }, ], @@ -441,11 +440,6 @@ describe('heatmap', () => { type: 'function', function: HEATMAP_GRID_FUNCTION, arguments: { - // grid - strokeWidth: [], - strokeColor: [], - xTitle: [], - yTitle: [], // cells isCellLabelVisible: [false], // Y-axis @@ -505,6 +499,7 @@ describe('heatmap', () => { ...exampleState(), layerId: 'first', xAccessor: 'x-accessor', + valueAccessor: 'value-accessor', }; expect( @@ -521,7 +516,7 @@ describe('heatmap', () => { arguments: { xAccessor: ['x-accessor'], yAccessor: [''], - valueAccessor: [''], + valueAccessor: ['value-accessor'], palette: [ { type: 'expression', @@ -545,7 +540,7 @@ describe('heatmap', () => { function: LEGEND_FUNCTION, arguments: { isVisible: [false], - position: [], + position: ['right'], }, }, ], diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx index fc8ef976548b..dfa37ba75f38 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx @@ -18,6 +18,12 @@ import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import { HeatmapConfiguration } from '@kbn/visualizations-plugin/common'; +import { + HeatmapExpressionFunctionDefinition, + HeatmapGridExpressionFunctionDefinition, + HeatmapLegendExpressionFunctionDefinition, +} from '@kbn/expression-heatmap-plugin/common'; +import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; import type { OperationMetadata, Suggestion, Visualization } from '../../types'; import type { HeatmapVisualizationState } from './types'; import { getSuggestions } from './suggestions'; @@ -25,7 +31,6 @@ import { CHART_NAMES, CHART_SHAPES, DEFAULT_PALETTE_NAME, - FUNCTION_NAME, GROUP_ID, HEATMAP_GRID_FUNCTION, LEGEND_FUNCTION, @@ -321,82 +326,53 @@ export const getHeatmapVisualization = ({ return null; } + const legendFn = buildExpressionFunction( + 'heatmap_legend', + { + isVisible: state.legend.isVisible, + position: state.legend.position, + legendSize: state.legend.legendSize, + } + ); + + const gridConfigFn = buildExpressionFunction( + 'heatmap_grid', + { + // grid + strokeWidth: state.gridConfig.strokeWidth, + strokeColor: state.gridConfig.strokeColor, + // cells + isCellLabelVisible: state.gridConfig.isCellLabelVisible, + // Y-axis + isYAxisLabelVisible: state.gridConfig.isYAxisLabelVisible, + isYAxisTitleVisible: state.gridConfig.isYAxisTitleVisible ?? false, + yTitle: state.gridConfig.yTitle, + // X-axis + isXAxisLabelVisible: state.gridConfig.isXAxisLabelVisible, + isXAxisTitleVisible: state.gridConfig.isXAxisTitleVisible ?? false, + xTitle: state.gridConfig.xTitle, + } + ); + + const heatmapFn = buildExpressionFunction('heatmap', { + xAccessor: state.xAccessor ?? '', + yAccessor: state.yAccessor ?? '', + valueAccessor: state.valueAccessor ?? '', + lastRangeIsRightOpen: state.palette?.params?.continuity + ? ['above', 'all'].includes(state.palette.params.continuity) + : true, + palette: state.palette?.params + ? paletteService + .get(CUSTOM_PALETTE) + .toExpression(computePaletteParams(state.palette?.params)) + : paletteService.get(DEFAULT_PALETTE_NAME).toExpression(), + legend: buildExpression([legendFn]), + gridConfig: buildExpression([gridConfigFn]), + }); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - { - type: 'function', - function: FUNCTION_NAME, - arguments: { - xAccessor: [state.xAccessor ?? ''], - yAccessor: [state.yAccessor ?? ''], - valueAccessor: [state.valueAccessor ?? ''], - lastRangeIsRightOpen: [ - state.palette?.params?.continuity - ? ['above', 'all'].includes(state.palette.params.continuity) - : true, - ], - palette: state.palette?.params - ? [ - paletteService - .get(CUSTOM_PALETTE) - .toExpression( - computePaletteParams((state.palette?.params || {}) as CustomPaletteParams) - ), - ] - : [paletteService.get(DEFAULT_PALETTE_NAME).toExpression()], - legend: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: LEGEND_FUNCTION, - arguments: { - isVisible: [state.legend.isVisible], - position: [state.legend.position], - legendSize: state.legend.legendSize ? [state.legend.legendSize] : [], - }, - }, - ], - }, - ], - gridConfig: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: HEATMAP_GRID_FUNCTION, - arguments: { - // grid - strokeWidth: state.gridConfig.strokeWidth - ? [state.gridConfig.strokeWidth] - : [], - strokeColor: state.gridConfig.strokeColor - ? [state.gridConfig.strokeColor] - : [], - // cells - isCellLabelVisible: [state.gridConfig.isCellLabelVisible], - // Y-axis - isYAxisLabelVisible: [state.gridConfig.isYAxisLabelVisible], - isYAxisTitleVisible: [state.gridConfig.isYAxisTitleVisible ?? false], - yTitle: state.gridConfig.yTitle ? [state.gridConfig.yTitle] : [], - // X-axis - isXAxisLabelVisible: state.gridConfig.isXAxisLabelVisible - ? [state.gridConfig.isXAxisLabelVisible] - : [], - isXAxisTitleVisible: [state.gridConfig.isXAxisTitleVisible ?? false], - xTitle: state.gridConfig.xTitle ? [state.gridConfig.xTitle] : [], - }, - }, - ], - }, - ], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), heatmapFn.toAst()], }; }, @@ -407,73 +383,52 @@ export const getHeatmapVisualization = ({ const originalOrder = datasource?.getTableSpec().map(({ columnId }) => columnId); // When we add a column it could be empty, and therefore have no order - if (!originalOrder) { + if (!originalOrder || !state.valueAccessor) { return null; } + const legendFn = buildExpressionFunction( + 'heatmap_legend', + { + isVisible: false, + position: 'right', + } + ); + + const gridConfigFn = buildExpressionFunction( + 'heatmap_grid', + { + // grid + strokeWidth: 1, + // cells + isCellLabelVisible: false, + // Y-axis + isYAxisLabelVisible: false, + isYAxisTitleVisible: state.gridConfig.isYAxisTitleVisible, + yTitle: state.gridConfig.yTitle ?? '', + // X-axis + isXAxisLabelVisible: false, + isXAxisTitleVisible: state.gridConfig.isXAxisTitleVisible, + xTitle: state.gridConfig.xTitle ?? '', + } + ); + + const heatmapFn = buildExpressionFunction('heatmap', { + xAccessor: state.xAccessor ?? '', + yAccessor: state.yAccessor ?? '', + valueAccessor: state.valueAccessor ?? '', + legend: buildExpression([legendFn]), + gridConfig: buildExpression([gridConfigFn]), + palette: state.palette?.params + ? paletteService + .get(CUSTOM_PALETTE) + .toExpression(computePaletteParams(state.palette?.params)) + : paletteService.get(DEFAULT_PALETTE_NAME).toExpression(), + }); + return { type: 'expression', - chain: [ - ...(datasourceExpression?.chain ?? []), - { - type: 'function', - function: FUNCTION_NAME, - arguments: { - xAccessor: [state.xAccessor ?? ''], - yAccessor: [state.yAccessor ?? ''], - valueAccessor: [state.valueAccessor ?? ''], - legend: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: LEGEND_FUNCTION, - arguments: { - isVisible: [false], - position: [], - }, - }, - ], - }, - ], - palette: state.palette?.params - ? [ - paletteService - .get(CUSTOM_PALETTE) - .toExpression( - computePaletteParams((state.palette?.params || {}) as CustomPaletteParams) - ), - ] - : [paletteService.get(DEFAULT_PALETTE_NAME).toExpression()], - gridConfig: [ - { - type: 'expression', - chain: [ - { - type: 'function', - function: HEATMAP_GRID_FUNCTION, - arguments: { - // grid - strokeWidth: [1], - // cells - isCellLabelVisible: [false], - // Y-axis - isYAxisLabelVisible: [false], - isYAxisTitleVisible: [state.gridConfig.isYAxisTitleVisible], - yTitle: [state.gridConfig.yTitle ?? ''], - // X-axis - isXAxisLabelVisible: [false], - isXAxisTitleVisible: [state.gridConfig.isXAxisTitleVisible], - xTitle: [state.gridConfig.xTitle ?? ''], - }, - }, - ], - }, - ], - }, - }, - ], + chain: [...(datasourceExpression?.chain ?? []), heatmapFn.toAst()], }; },