From d88865232bae8c6395febe538f901230285c4fa5 Mon Sep 17 00:00:00 2001 From: "elastic-renovate-prod[bot]" <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Date: Wed, 21 May 2025 14:29:08 +0000 Subject: [PATCH 1/2] Update dependency @elastic/elasticsearch to v9.0.2 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a9f611187f378..36f24f937986f 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@elastic/datemath": "5.0.3", "@elastic/ebt": "^1.1.1", "@elastic/ecs": "^8.11.5", - "@elastic/elasticsearch": "9.0.1", + "@elastic/elasticsearch": "9.0.2", "@elastic/ems-client": "8.6.3", "@elastic/eui": "102.1.0", "@elastic/eui-theme-borealis": "1.0.0", diff --git a/yarn.lock b/yarn.lock index f32ae6cf51035..1912b4d9f0bab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2141,10 +2141,10 @@ "@elastic/transport" "^8.3.1" tslib "^2.4.0" -"@elastic/elasticsearch@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-9.0.1.tgz#366320bd71bc5f3af22601194ddd973da9bac92e" - integrity sha512-V/Hj/ePRiC6H8vOQF4GfOGIUFjYyA2C1Je6qKBD20AShmxqkaTRAQSvia4tvLobHqjrljUzb6khfhDuPrb6E8g== +"@elastic/elasticsearch@9.0.2": + version "9.0.2" + resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-9.0.2.tgz#66fb8465fdeabb0c1174d3c48c0a2d5ad5d177c4" + integrity sha512-uKA0PuPSND3OhHH9UFqnKZfxifAg/8mQW4VnrQ+sUtusTbPhGuErs5NeWCPyd/RLgruBWBmLSv1zzEv5GS+UnA== dependencies: "@elastic/transport" "^9.0.1" apache-arrow "18.x - 19.x" From a8d5e476309fe363aa2b4b7592f3884c2aa4bfba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Thu, 22 May 2025 01:48:47 +0200 Subject: [PATCH 2/2] Address type issues --- .../platform/plugins/shared/alerting/common/rule.ts | 6 +++++- .../server/lib/indices/text_analysis.ts | 4 ++-- .../streams/processing/simulation_handler.ts | 12 ++++++------ .../hooks/use_ingestion_rate.tsx | 2 +- .../server/lib/indices/text_analysis.ts | 4 ++-- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/x-pack/platform/plugins/shared/alerting/common/rule.ts b/x-pack/platform/plugins/shared/alerting/common/rule.ts index cbf11cfda1819..a83808f233d62 100644 --- a/x-pack/platform/plugins/shared/alerting/common/rule.ts +++ b/x-pack/platform/plugins/shared/alerting/common/rule.ts @@ -14,6 +14,7 @@ import type { RuleAction, RuleSystemAction, RuleActionParam, + AlertsFilter, } from '@kbn/alerting-types'; export type { @@ -70,7 +71,10 @@ export const RuleLastRunOutcomeOrderMap: Record = { export type RuleAlertingOutcome = 'failure' | 'success' | 'unknown' | 'warning'; -export type RuleActionAlertsFilterProperty = AlertsFilterTimeframe | RuleActionParam; +export type RuleActionAlertsFilterProperty = + | AlertsFilterTimeframe + | RuleActionParam + | AlertsFilter['query']; export type RuleActionKey = keyof RuleAction; export type RuleSystemActionKey = keyof RuleSystemAction; diff --git a/x-pack/platform/plugins/shared/content_connectors/server/lib/indices/text_analysis.ts b/x-pack/platform/plugins/shared/content_connectors/server/lib/indices/text_analysis.ts index 0885b00dd079e..4c585a9e7654d 100644 --- a/x-pack/platform/plugins/shared/content_connectors/server/lib/indices/text_analysis.ts +++ b/x-pack/platform/plugins/shared/content_connectors/server/lib/indices/text_analysis.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { AnalysisTokenFilter } from '@elastic/elasticsearch/lib/api/types'; +import type { AnalysisTokenFilter, AnalysisStopWords } from '@elastic/elasticsearch/lib/api/types'; interface LanguageDataEntry { custom_filter_definitions?: object; name: string; stemmer: string; - stop_words: string; + stop_words: AnalysisStopWords; postpended_filters?: string[]; prepended_filters?: string[]; } diff --git a/x-pack/platform/plugins/shared/streams/server/routes/internal/streams/processing/simulation_handler.ts b/x-pack/platform/plugins/shared/streams/server/routes/internal/streams/processing/simulation_handler.ts index cc028972e7f23..a9397ab91440c 100644 --- a/x-pack/platform/plugins/shared/streams/server/routes/internal/streams/processing/simulation_handler.ts +++ b/x-pack/platform/plugins/shared/streams/server/routes/internal/streams/processing/simulation_handler.ts @@ -12,7 +12,7 @@ import { IngestDocument, IngestProcessorContainer, IngestSimulateRequest, - IngestPipelineSimulation, + IngestPipelineProcessorResult, IngestSimulateDocumentResult, SimulateIngestRequest, IndicesIndexState, @@ -785,14 +785,14 @@ const computeMappingProperties = (detectedFields: NamedFieldDefinitionConfig[]) * Guard helpers */ const isSuccessfulProcessor = ( - processor: IngestPipelineSimulation -): processor is WithRequired => + processor: IngestPipelineProcessorResult +): processor is WithRequired => processor.status === 'success' && !!processor.tag; const isSkippedProcessor = ( - processor: IngestPipelineSimulation - // @ts-expect-error Looks like the IngestPipelineSimulation.status is not typed correctly and misses the 'skipped' status -): processor is WithRequired => processor.status === 'skipped'; + processor: IngestPipelineProcessorResult +): processor is WithRequired => + processor.status === 'skipped'; const isMappingFailure = (entry: SimulateIngestSimulateIngestDocumentResult) => entry.doc?.error?.type === 'document_parsing_exception'; diff --git a/x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_lifecycle/hooks/use_ingestion_rate.tsx b/x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_lifecycle/hooks/use_ingestion_rate.tsx index d188a04845210..9c68b760c0cba 100644 --- a/x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_lifecycle/hooks/use_ingestion_rate.tsx +++ b/x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_lifecycle/hooks/use_ingestion_rate.tsx @@ -271,7 +271,7 @@ export const useIngestionRatePerTier = ({ const countByTier = indices.buckets.reduce((tiers, index) => { const explain = ilmExplain.indices[index.key]; const tier = - explain.managed && explain.phase in ilmPhases + explain.managed && explain.phase && explain.phase in ilmPhases ? (explain.phase as PhaseNameWithoutDelete) : fallbackTier; tiers[tier] = (tiers[tier] ?? 0) + index.doc_count; diff --git a/x-pack/solutions/search/plugins/enterprise_search/server/lib/indices/text_analysis.ts b/x-pack/solutions/search/plugins/enterprise_search/server/lib/indices/text_analysis.ts index 0885b00dd079e..06ab83e0b2fdd 100644 --- a/x-pack/solutions/search/plugins/enterprise_search/server/lib/indices/text_analysis.ts +++ b/x-pack/solutions/search/plugins/enterprise_search/server/lib/indices/text_analysis.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { AnalysisTokenFilter } from '@elastic/elasticsearch/lib/api/types'; +import { AnalysisTokenFilter, AnalysisStopWords } from '@elastic/elasticsearch/lib/api/types'; interface LanguageDataEntry { custom_filter_definitions?: object; name: string; stemmer: string; - stop_words: string; + stop_words: AnalysisStopWords; postpended_filters?: string[]; prepended_filters?: string[]; }