Update dependency @elastic/elasticsearch to ^8.15.0 (main) (#190378)

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: Walter Rafelsberger <walter.rafelsberger@elastic.co>
This commit is contained in:
elastic-renovate-prod[bot] 2024-08-23 12:48:10 -05:00 committed by GitHub
parent 745ecfdd30
commit 68a924411b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 145 additions and 145 deletions

View file

@ -113,7 +113,7 @@
"@elastic/datemath": "5.0.3", "@elastic/datemath": "5.0.3",
"@elastic/ebt": "1.0.0", "@elastic/ebt": "1.0.0",
"@elastic/ecs": "^8.11.1", "@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "^8.14.0", "@elastic/elasticsearch": "^8.15.0",
"@elastic/ems-client": "8.5.3", "@elastic/ems-client": "8.5.3",
"@elastic/eui": "95.7.0", "@elastic/eui": "95.7.0",
"@elastic/filesaver": "1.1.2", "@elastic/filesaver": "1.1.2",

View file

@ -9,6 +9,7 @@
import type { import type {
PropertyName as EsPropertyName, PropertyName as EsPropertyName,
MappingProperty as EsMappingProperty, MappingProperty as EsMappingProperty,
MappingPropertyBase as EsMappingPropertyBase,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
/** /**
@ -64,19 +65,20 @@ export interface SavedObjectsMappingProperties {
* *
* @public * @public
*/ */
export type SavedObjectsFieldMapping = EsMappingProperty & { export type SavedObjectsFieldMapping = EsMappingProperty &
/** EsMappingPropertyBase & {
* The dynamic property of the mapping, either `false` or `'strict'`. If /**
* unspecified `dynamic: 'strict'` will be inherited from the top-level * The dynamic property of the mapping, either `false` or `'strict'`. If
* index mappings. * unspecified `dynamic: 'strict'` will be inherited from the top-level
* * index mappings.
* Note: To limit the number of mapping fields Saved Object types should *
* *never* use `dynamic: true`. * Note: To limit the number of mapping fields Saved Object types should
*/ * *never* use `dynamic: true`.
dynamic?: false | 'strict'; */
/** dynamic?: false | 'strict';
* Some mapping types do not accept the `properties` attributes. Explicitly adding it as optional to our type /**
* to avoid type failures on all code using accessing them via `SavedObjectsFieldMapping.properties`. * Some mapping types do not accept the `properties` attributes. Explicitly adding it as optional to our type
*/ * to avoid type failures on all code using accessing them via `SavedObjectsFieldMapping.properties`.
properties?: Record<EsPropertyName, EsMappingProperty>; */
}; properties?: Record<EsPropertyName, EsMappingProperty>;
};

View file

@ -37,7 +37,7 @@ export type ScriptedPhraseFilter = Filter & {
meta: PhraseFilterMeta; meta: PhraseFilterMeta;
query: { query: {
script: { script: {
script: estypes.InlineScript; script: estypes.Script;
}; };
}; };
}; };
@ -134,7 +134,7 @@ export const getPhraseScript = (field: DataViewFieldBase, value: PhraseFilterVal
params: { params: {
value: convertedValue, value: convertedValue,
}, },
} as estypes.InlineScript, } as estypes.Script,
}; };
}; };

View file

@ -65,7 +65,7 @@ export type ScriptedRangeFilter = Filter & {
meta: RangeFilterMeta; meta: RangeFilterMeta;
query: { query: {
script: { script: {
script: estypes.InlineScript; script: estypes.Script;
}; };
}; };
}; };
@ -189,7 +189,7 @@ export const buildRangeFilter = (
* @internal * @internal
*/ */
export const getRangeScript = (field: DataViewFieldBase, params: RangeFilterParams) => { export const getRangeScript = (field: DataViewFieldBase, params: RangeFilterParams) => {
const knownParams: estypes.InlineScript['params'] = mapValues( const knownParams: estypes.Script['params'] = mapValues(
pickBy(params, (val, key) => key in operators), pickBy(params, (val, key) => key in operators),
(value) => (field.type === 'number' && typeof value === 'string' ? parseFloat(value) : value) (value) => (field.type === 'number' && typeof value === 'string' ? parseFloat(value) : value)
); );

View file

@ -7,7 +7,7 @@
*/ */
import type { import type {
InlineScript, Script,
MappingRuntimeField, MappingRuntimeField,
MappingRuntimeFields, MappingRuntimeFields,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
@ -52,7 +52,7 @@ export interface MainAggregation extends NamedAggregation {
} }
export interface GroupingRuntimeField extends MappingRuntimeField { export interface GroupingRuntimeField extends MappingRuntimeField {
script: InlineScript & { script: Script & {
params: Record<string, any>; params: Record<string, any>;
}; };
} }

View file

@ -25,7 +25,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
import { cloneDeep } from 'lodash'; import { cloneDeep } from 'lodash';
import useDebounce from 'react-use/lib/useDebounce'; import useDebounce from 'react-use/lib/useDebounce';
import type { import type {
InferenceModelConfigContainer, InferenceInferenceEndpointInfo,
MappingTypeMapping, MappingTypeMapping,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { createSemanticTextCombinedField, getFieldNames, getNameCollisionMsg } from './utils'; import { createSemanticTextCombinedField, getFieldNames, getNameCollisionMsg } from './utils';
@ -61,14 +61,14 @@ export const SemanticTextForm: FC<Props> = ({ addCombinedField, hasNameCollision
useEffect(() => { useEffect(() => {
http http
.fetch<InferenceModelConfigContainer[]>('/internal/data_visualizer/inference_services', { .fetch<InferenceInferenceEndpointInfo[]>('/internal/data_visualizer/inference_services', {
method: 'GET', method: 'GET',
version: '1', version: '1',
}) })
.then((response) => { .then((response) => {
const inferenceServiceOptions = response.map((service) => ({ const inferenceServiceOptions = response.map((service) => ({
value: service.model_id, value: service.inference_id,
text: service.model_id, text: service.inference_id,
})); }));
setInferenceServices(inferenceServiceOptions); setInferenceServices(inferenceServiceOptions);
setSelectedInference(inferenceServiceOptions[0]?.value ?? undefined); setSelectedInference(inferenceServiceOptions[0]?.value ?? undefined);

View file

@ -304,10 +304,8 @@ const getDataComparisonQuery = ({
if (rangeFilter && isPopulatedObject<string, QueryDslBoolQuery>(query, ['bool'])) { if (rangeFilter && isPopulatedObject<string, QueryDslBoolQuery>(query, ['bool'])) {
if (Array.isArray(query.bool.filter)) { if (Array.isArray(query.bool.filter)) {
// @ts-expect-error gte and lte can be numeric
query.bool.filter.push(rangeFilter); query.bool.filter.push(rangeFilter);
} else { } else {
// @ts-expect-error gte and lte can be numeric
query.bool.filter = [rangeFilter]; query.bool.filter = [rangeFilter];
} }
} }

View file

@ -83,8 +83,7 @@ export function routes(coreSetup: CoreSetup<StartDeps, unknown>, logger: Logger)
async (context, request, response) => { async (context, request, response) => {
try { try {
const esClient = (await context.core).elasticsearch.client; const esClient = (await context.core).elasticsearch.client;
// @ts-expect-error types are wrong const { endpoints } = await esClient.asCurrentUser.inference.get({
const { endpoints } = await esClient.asCurrentUser.inference.getModel({
inference_id: '_all', inference_id: '_all',
}); });

View file

@ -50,7 +50,6 @@ const getSemanticTextFields = (
return Object.entries(fields).flatMap(([key, value]) => { return Object.entries(fields).flatMap(([key, value]) => {
const currentPath: string = path ? `${path}.${key}` : key; const currentPath: string = path ? `${path}.${key}` : key;
const currentField: Array<{ path: string; source: SemanticTextProperty }> = const currentField: Array<{ path: string; source: SemanticTextProperty }> =
// @ts-expect-error because semantic_text type isn't incorporated in API type yet
value.type === 'semantic_text' ? [{ path: currentPath, source: value }] : []; value.type === 'semantic_text' ? [{ path: currentPath, source: value }] : [];
if (hasProperties(value)) { if (hasProperties(value)) {
const childSemanticTextFields: Array<{ path: string; source: SemanticTextProperty }> = const childSemanticTextFields: Array<{ path: string; source: SemanticTextProperty }> =

View file

@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n';
import { EuiAccordion, EuiSpacer } from '@elastic/eui'; import { EuiAccordion, EuiSpacer } from '@elastic/eui';
import type { MlUrlConfig } from '@kbn/ml-anomaly-utils'; import type { MlUrlConfig } from '@kbn/ml-anomaly-utils';
import type { DataFrameAnalyticsConfig } from '@kbn/ml-data-frame-analytics-utils'; import type { DataFrameAnalyticsConfig } from '@kbn/ml-data-frame-analytics-utils';
import type { DeepPartial } from '../../../../../../../common/types/common'; import type { DeepPartial } from '@kbn/utility-types';
import { Description } from './description'; import { Description } from './description';
import { CustomUrlsWrapper } from '../../../../../components/custom_urls'; import { CustomUrlsWrapper } from '../../../../../components/custom_urls';
import { import {

View file

@ -16,7 +16,8 @@ import {
type DataFrameAnalysisConfigType, type DataFrameAnalysisConfigType,
type FeatureProcessor, type FeatureProcessor,
} from '@kbn/ml-data-frame-analytics-utils'; } from '@kbn/ml-data-frame-analytics-utils';
import type { DeepPartial, DeepReadonly } from '../../../../../../../common/types/common'; import type { DeepPartial } from '@kbn/utility-types';
import type { DeepReadonly } from '../../../../../../../common/types/common';
import { checkPermission } from '../../../../../capabilities/check_capabilities'; import { checkPermission } from '../../../../../capabilities/check_capabilities';
import { mlNodesAvailable } from '../../../../../ml_nodes_check'; import { mlNodesAvailable } from '../../../../../ml_nodes_check';

View file

@ -14,7 +14,7 @@ import { isEqual } from 'lodash';
import type { Observable } from 'rxjs'; import type { Observable } from 'rxjs';
import { from, isObservable, Subject } from 'rxjs'; import { from, isObservable, Subject } from 'rxjs';
import { distinctUntilChanged, flatMap, scan, shareReplay } from 'rxjs'; import { distinctUntilChanged, flatMap, scan, shareReplay } from 'rxjs';
import type { DeepPartial } from '../../../common/types/common'; import type { DeepPartial } from '@kbn/utility-types';
import { jobSelectionActionCreator } from './actions'; import { jobSelectionActionCreator } from './actions';
import { EXPLORER_ACTION } from './explorer_constants'; import { EXPLORER_ACTION } from './explorer_constants';
import type { ExplorerState } from './reducers'; import type { ExplorerState } from './reducers';

View file

@ -7,6 +7,7 @@
import { useMemo } from 'react'; import { useMemo } from 'react';
import type { DeepPartial } from '@kbn/utility-types';
import type { NewJobCapsResponse } from '@kbn/ml-anomaly-utils'; import type { NewJobCapsResponse } from '@kbn/ml-anomaly-utils';
import type { import type {
AnalyticsMapReturnType, AnalyticsMapReturnType,
@ -21,7 +22,6 @@ import type { HttpService } from '../http_service';
import { useMlKibana } from '../../contexts/kibana'; import { useMlKibana } from '../../contexts/kibana';
import type { ValidateAnalyticsJobResponse } from '../../../../common/constants/validation'; import type { ValidateAnalyticsJobResponse } from '../../../../common/constants/validation';
import type { DeepPartial } from '../../../../common/types/common';
import type { JobMessage } from '../../../../common/types/audit_message'; import type { JobMessage } from '../../../../common/types/audit_message';
import type { PutDataFrameAnalyticsResponseSchema } from '../../../../server/routes/schemas/data_frame_analytics_schema'; import type { PutDataFrameAnalyticsResponseSchema } from '../../../../server/routes/schemas/data_frame_analytics_schema';

View file

@ -11,11 +11,6 @@ import type { ModelConfig } from '@kbn/inference_integration_flyout/types';
import type { HttpService } from '../http_service'; import type { HttpService } from '../http_service';
import { ML_INTERNAL_BASE_PATH } from '../../../../common/constants/app'; import { ML_INTERNAL_BASE_PATH } from '../../../../common/constants/app';
// TODO remove inference_id when esType has been updated to include it
export interface GetInferenceEndpointsResponse extends estypes.InferenceModelConfigContainer {
inference_id: string;
}
export function inferenceModelsApiProvider(httpService: HttpService) { export function inferenceModelsApiProvider(httpService: HttpService) {
return { return {
/** /**
@ -29,7 +24,7 @@ export function inferenceModelsApiProvider(httpService: HttpService) {
taskType: InferenceTaskType, taskType: InferenceTaskType,
modelConfig: ModelConfig modelConfig: ModelConfig
) { ) {
const result = await httpService.http<estypes.InferencePutModelResponse>({ const result = await httpService.http<estypes.InferencePutResponse>({
path: `${ML_INTERNAL_BASE_PATH}/_inference/${taskType}/${inferenceId}`, path: `${ML_INTERNAL_BASE_PATH}/_inference/${taskType}/${inferenceId}`,
method: 'PUT', method: 'PUT',
body: JSON.stringify(modelConfig), body: JSON.stringify(modelConfig),
@ -41,9 +36,7 @@ export function inferenceModelsApiProvider(httpService: HttpService) {
* Gets all inference endpoints * Gets all inference endpoints
*/ */
async getAllInferenceEndpoints() { async getAllInferenceEndpoints() {
const result = await httpService.http<{ const result = await httpService.http<estypes.InferenceGetResponse>({
endpoints: GetInferenceEndpointsResponse[];
}>({
path: `${ML_INTERNAL_BASE_PATH}/_inference/all`, path: `${ML_INTERNAL_BASE_PATH}/_inference/all`,
method: 'GET', method: 'GET',
version: '1', version: '1',

View file

@ -9,12 +9,12 @@ import type { JobsHealthService } from './jobs_health_service';
import { jobsHealthServiceProvider } from './jobs_health_service'; import { jobsHealthServiceProvider } from './jobs_health_service';
import type { DatafeedsService } from '../../models/job_service/datafeeds'; import type { DatafeedsService } from '../../models/job_service/datafeeds';
import type { Logger } from '@kbn/core/server'; import type { Logger } from '@kbn/core/server';
import type { DeepPartial } from '@kbn/utility-types';
import type { MlClient } from '../ml_client'; import type { MlClient } from '../ml_client';
import type { MlJob, MlJobStats } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { MlJob, MlJobStats } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { AnnotationService } from '../../models/annotation_service/annotation'; import type { AnnotationService } from '../../models/annotation_service/annotation';
import type { JobsHealthExecutorOptions } from './register_jobs_monitoring_rule_type'; import type { JobsHealthExecutorOptions } from './register_jobs_monitoring_rule_type';
import type { JobAuditMessagesService } from '../../models/job_audit_messages/job_audit_messages'; import type { JobAuditMessagesService } from '../../models/job_audit_messages/job_audit_messages';
import type { DeepPartial } from '../../../common/types/common';
import type { FieldFormatsRegistryProvider } from '../../../common/types/kibana'; import type { FieldFormatsRegistryProvider } from '../../../common/types/kibana';
const MOCK_DATE_NOW = 1487076708000; const MOCK_DATE_NOW = 1487076708000;

View file

@ -10,7 +10,7 @@ import type { IScopedClusterClient } from '@kbn/core/server';
import { JOB_MAP_NODE_TYPES, type MapElements } from '@kbn/ml-data-frame-analytics-utils'; import { JOB_MAP_NODE_TYPES, type MapElements } from '@kbn/ml-data-frame-analytics-utils';
import { flatten } from 'lodash'; import { flatten } from 'lodash';
import type { import type {
InferenceModelConfig, InferenceInferenceEndpoint,
InferenceTaskType, InferenceTaskType,
TasksTaskInfo, TasksTaskInfo,
TransformGetTransformTransformSummary, TransformGetTransformTransformSummary,
@ -591,19 +591,19 @@ export class ModelsProvider {
* Puts the requested Inference endpoint id into elasticsearch, triggering elasticsearch to create the inference endpoint id * Puts the requested Inference endpoint id into elasticsearch, triggering elasticsearch to create the inference endpoint id
* @param inferenceId - Inference Endpoint Id * @param inferenceId - Inference Endpoint Id
* @param taskType - Inference Task type. Either sparse_embedding or text_embedding * @param taskType - Inference Task type. Either sparse_embedding or text_embedding
* @param modelConfig - Model configuration based on service type * @param inferenceConfig - Model configuration based on service type
*/ */
async createInferenceEndpoint( async createInferenceEndpoint(
inferenceId: string, inferenceId: string,
taskType: InferenceTaskType, taskType: InferenceTaskType,
modelConfig: InferenceModelConfig inferenceConfig: InferenceInferenceEndpoint
) { ) {
try { try {
const result = await this._client.asCurrentUser.inference.putModel( const result = await this._client.asCurrentUser.inference.put(
{ {
inference_id: inferenceId, inference_id: inferenceId,
task_type: taskType, task_type: taskType,
model_config: modelConfig, inference_config: inferenceConfig,
}, },
{ maxRetries: 0 } { maxRetries: 0 }
); );
@ -613,7 +613,7 @@ export class ModelsProvider {
// Erroring out is misleading in these cases, so we return the model_id and task_type // Erroring out is misleading in these cases, so we return the model_id and task_type
if (error.name === 'TimeoutError') { if (error.name === 'TimeoutError') {
return { return {
model_id: modelConfig.service, model_id: inferenceConfig.service,
task_type: taskType, task_type: taskType,
}; };
} else { } else {

View file

@ -6,7 +6,10 @@
*/ */
import type { CloudSetup } from '@kbn/cloud-plugin/server'; import type { CloudSetup } from '@kbn/cloud-plugin/server';
import { schema } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema';
import type { InferenceModelConfig, InferenceTaskType } from '@elastic/elasticsearch/lib/api/types'; import type {
InferenceInferenceEndpoint,
InferenceTaskType,
} from '@elastic/elasticsearch/lib/api/types';
import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils';
import type { RouteInitialization } from '../types'; import type { RouteInitialization } from '../types';
import { createInferenceSchema } from './schemas/inference_schema'; import { createInferenceSchema } from './schemas/inference_schema';
@ -46,7 +49,7 @@ export function inferenceModelRoutes(
const body = await modelsProvider(client, mlClient, cloud).createInferenceEndpoint( const body = await modelsProvider(client, mlClient, cloud).createInferenceEndpoint(
inferenceId, inferenceId,
taskType as InferenceTaskType, taskType as InferenceTaskType,
request.body as InferenceModelConfig request.body as InferenceInferenceEndpoint
); );
const { syncSavedObjects } = syncSavedObjectsFactory(client, mlSavedObjectService); const { syncSavedObjects } = syncSavedObjectsFactory(client, mlSavedObjectService);
await syncSavedObjects(false); await syncSavedObjects(false);

View file

@ -50,7 +50,6 @@ export const getPingHistogram: UMElasticsearchQueryFn<
body: { body: {
query: { query: {
bool: { bool: {
// @ts-expect-error upgrade typescript v5.1.6
filter: [...filter, SUMMARY_FILTER, EXCLUDE_RUN_ONCE_FILTER], filter: [...filter, SUMMARY_FILTER, EXCLUDE_RUN_ONCE_FILTER],
}, },
}, },
@ -81,7 +80,6 @@ export const getPingHistogram: UMElasticsearchQueryFn<
}); });
const { body: result } = await uptimeEsClient.search(params, 'getPingsOverTime'); const { body: result } = await uptimeEsClient.search(params, 'getPingsOverTime');
// @ts-expect-error upgrade typescript v5.1.6
const buckets = result?.aggregations?.timeseries?.buckets ?? []; const buckets = result?.aggregations?.timeseries?.buckets ?? [];
const histogram = buckets.map((bucket: Pick<(typeof buckets)[0], 'key' | 'down' | 'up'>) => { const histogram = buckets.map((bucket: Pick<(typeof buckets)[0], 'key' | 'down' | 'up'>) => {

View file

@ -367,7 +367,8 @@ const allowedFilterKeysSchema = t.union([
t.literal('range'), t.literal('range'),
t.literal('rank_feature'), t.literal('rank_feature'),
t.literal('regexp'), t.literal('regexp'),
t.literal('rule_query'), t.literal('rule'),
t.literal('semantic'),
t.literal('shape'), t.literal('shape'),
t.literal('simple_query_string'), t.literal('simple_query_string'),
t.literal('span_containing'), t.literal('span_containing'),

View file

@ -30,7 +30,6 @@ import {
AggregateName, AggregateName,
AggregationsAggregate, AggregationsAggregate,
AggregationsMultiBucketAggregateBase, AggregationsMultiBucketAggregateBase,
InlineScript,
MappingRuntimeFields, MappingRuntimeFields,
QueryDslQueryContainer, QueryDslQueryContainer,
SortCombinations, SortCombinations,
@ -826,18 +825,16 @@ export class AlertsClient {
const result = await this.esClient.updateByQuery({ const result = await this.esClient.updateByQuery({
index, index,
conflicts: 'proceed', conflicts: 'proceed',
body: { script: {
script: { source: `if (ctx._source['${ALERT_WORKFLOW_STATUS}'] != null) {
source: `if (ctx._source['${ALERT_WORKFLOW_STATUS}'] != null) {
ctx._source['${ALERT_WORKFLOW_STATUS}'] = '${status}' ctx._source['${ALERT_WORKFLOW_STATUS}'] = '${status}'
} }
if (ctx._source.signal != null && ctx._source.signal.status != null) { if (ctx._source.signal != null && ctx._source.signal.status != null) {
ctx._source.signal.status = '${status}' ctx._source.signal.status = '${status}'
}`, }`,
lang: 'painless', lang: 'painless',
} as InlineScript,
query: fetchAndAuditResponse.authorizedQuery as Omit<QueryDslQueryContainer, 'script'>,
}, },
query: fetchAndAuditResponse.authorizedQuery as Omit<QueryDslQueryContainer, 'script'>,
ignore_unavailable: true, ignore_unavailable: true,
}); });
return result; return result;
@ -965,14 +962,12 @@ export class AlertsClient {
await this.esClient.updateByQuery({ await this.esClient.updateByQuery({
index, index,
conflicts: 'proceed', conflicts: 'proceed',
body: { script: {
script: { source: painlessScript,
source: painlessScript, lang: 'painless',
lang: 'painless', params: { caseIds },
params: { caseIds },
} as InlineScript,
query: esQuery,
}, },
query: esQuery,
ignore_unavailable: true, ignore_unavailable: true,
}); });
} catch (err) { } catch (err) {

View file

@ -105,56 +105,58 @@ describe('remove cases from alerts', () => {
expect(esClientMock.updateByQuery.mock.calls[0][0]).toMatchInlineSnapshot(` expect(esClientMock.updateByQuery.mock.calls[0][0]).toMatchInlineSnapshot(`
Object { Object {
"body": Object { "conflicts": "proceed",
"query": Object { "ignore_unavailable": true,
"bool": Object { "index": "undefined-*",
"filter": Array [ "query": Object {
Object { "bool": Object {
"bool": Object { "filter": Array [
"minimum_should_match": 1, Object {
"should": Array [ "bool": Object {
Object { "minimum_should_match": 1,
"bool": Object { "should": Array [
"minimum_should_match": 1, Object {
"should": Array [ "bool": Object {
Object { "minimum_should_match": 1,
"match": Object { "should": Array [
"kibana.alert.case_ids": "test-case-1", Object {
}, "match": Object {
"kibana.alert.case_ids": "test-case-1",
}, },
], },
}, ],
}, },
Object { },
"bool": Object { Object {
"minimum_should_match": 1, "bool": Object {
"should": Array [ "minimum_should_match": 1,
Object { "should": Array [
"match": Object { Object {
"kibana.alert.case_ids": "test-case-2", "match": Object {
}, "kibana.alert.case_ids": "test-case-2",
}, },
], },
}, ],
}, },
], },
}, ],
}, },
], },
"must": Array [], ],
"must_not": Array [], "must": Array [],
"should": Array [], "must_not": Array [],
}, "should": Array [],
}, },
"script": Object { },
"lang": "painless", "script": Object {
"params": Object { "lang": "painless",
"caseIds": Array [ "params": Object {
"test-case-1", "caseIds": Array [
"test-case-2", "test-case-1",
], "test-case-2",
}, ],
"source": "if (ctx._source['kibana.alert.case_ids'] != null && ctx._source['kibana.alert.case_ids'].length > 0 && params['caseIds'] != null && params['caseIds'].length > 0) { },
"source": "if (ctx._source['kibana.alert.case_ids'] != null && ctx._source['kibana.alert.case_ids'].length > 0 && params['caseIds'] != null && params['caseIds'].length > 0) {
List storedCaseIds = ctx._source['kibana.alert.case_ids']; List storedCaseIds = ctx._source['kibana.alert.case_ids'];
List caseIdsToRemove = params['caseIds']; List caseIdsToRemove = params['caseIds'];
@ -165,11 +167,7 @@ describe('remove cases from alerts', () => {
} }
} }
}", }",
},
}, },
"conflicts": "proceed",
"ignore_unavailable": true,
"index": "undefined-*",
} }
`); `);
}); });

View file

@ -13,7 +13,7 @@ describe('deleteInferenceEndpoint', () => {
beforeEach(() => { beforeEach(() => {
mockClient = { mockClient = {
inference: { inference: {
deleteModel: jest.fn(), delete: jest.fn(),
}, },
}; };
}); });
@ -24,7 +24,7 @@ describe('deleteInferenceEndpoint', () => {
await deleteInferenceEndpoint(mockClient, type, id); await deleteInferenceEndpoint(mockClient, type, id);
expect(mockClient.inference.deleteModel).toHaveBeenCalledWith({ expect(mockClient.inference.delete).toHaveBeenCalledWith({
inference_id: id, inference_id: id,
task_type: type, task_type: type,
}); });

View file

@ -19,6 +19,6 @@ export const deleteInferenceEndpoint = async (
id: string id: string
) => { ) => {
if (isTaskType(type)) { if (isTaskType(type)) {
return await client.inference.deleteModel({ inference_id: id, task_type: type }); return await client.inference.delete({ inference_id: id, task_type: type });
} }
}; };

View file

@ -5,6 +5,8 @@
* 2.0. * 2.0.
*/ */
import type { EqlHitsSequence } from '@elastic/elasticsearch/lib/api/types';
/** /**
* Defines the search types you can have from Elasticsearch within a * Defines the search types you can have from Elasticsearch within a
* doc._source. It uses recursive types of "| SearchTypes[]" to designate * doc._source. It uses recursive types of "| SearchTypes[]" to designate
@ -32,10 +34,7 @@ export interface BaseHit<T> {
fields?: Record<string, SearchTypes[]>; fields?: Record<string, SearchTypes[]>;
} }
export interface EqlSequence<T> { export type EqlSequence<T> = EqlHitsSequence<T>;
join_keys: SearchTypes[];
events: Array<BaseHit<T>>;
}
export interface EqlSearchResponse<T> { export interface EqlSearchResponse<T> {
is_partial: boolean; is_partial: boolean;

View file

@ -1406,7 +1406,7 @@ describe('TaskStore', () => {
childEsClient.updateByQuery.mockResponse({ childEsClient.updateByQuery.mockResponse({
hits: { hits: [], total: 0, updated: 100, version_conflicts: 0 }, hits: { hits: [], total: 0, updated: 100, version_conflicts: 0 },
} as UpdateByQueryResponse); } as UpdateByQueryResponse);
await store.updateByQuery({ script: '' }, { max_docs: 10 }); await store.updateByQuery({ script: { source: '' } }, { max_docs: 10 });
expect(childEsClient.updateByQuery).toHaveBeenCalledWith(expect.any(Object), { expect(childEsClient.updateByQuery).toHaveBeenCalledWith(expect.any(Object), {
requestTimeout: 1000, requestTimeout: 1000,
}); });

View file

@ -28,6 +28,13 @@ import { TransformHealthColoredDot } from './transform_health_colored_dot';
import type { SectionConfig, SectionItem } from './expanded_row_column_view'; import type { SectionConfig, SectionItem } from './expanded_row_column_view';
import { ExpandedRowColumnView } from './expanded_row_column_view'; import { ExpandedRowColumnView } from './expanded_row_column_view';
const notAvailableMessage = i18n.translate(
'xpack.transform.transformList.transformDetails.notAvailable',
{
defaultMessage: 'n/a',
}
);
interface ExpandedRowDetailsPaneProps { interface ExpandedRowDetailsPaneProps {
item: TransformListRow; item: TransformListRow;
onAlertEdit: (alertRule: TransformHealthAlertRule) => void; onAlertEdit: (alertRule: TransformHealthAlertRule) => void;
@ -166,17 +173,23 @@ export const ExpandedRowDetailsPane: FC<ExpandedRowDetailsPaneProps> = ({ item,
if (displayStats.checkpointing.next.checkpoint_progress !== undefined) { if (displayStats.checkpointing.next.checkpoint_progress !== undefined) {
checkpointingItems.push({ checkpointingItems.push({
title: 'next.checkpoint_progress.total_docs', title: 'next.checkpoint_progress.total_docs',
description: displayStats.checkpointing.next.checkpoint_progress.total_docs, description:
displayStats.checkpointing.next.checkpoint_progress.total_docs ?? notAvailableMessage,
}); });
checkpointingItems.push({ checkpointingItems.push({
title: 'next.checkpoint_progress.docs_remaining', title: 'next.checkpoint_progress.docs_remaining',
description: displayStats.checkpointing.next.checkpoint_progress.docs_remaining, description:
displayStats.checkpointing.next.checkpoint_progress.docs_remaining ??
notAvailableMessage,
}); });
checkpointingItems.push({ checkpointingItems.push({
title: 'next.checkpoint_progress.percent_complete', title: 'next.checkpoint_progress.percent_complete',
description: `${Math.round( description:
displayStats.checkpointing.next.checkpoint_progress.percent_complete typeof displayStats.checkpointing.next.checkpoint_progress.percent_complete === 'number'
)}%`, ? `${Math.round(
displayStats.checkpointing.next.checkpoint_progress.percent_complete
)}%`
: notAvailableMessage,
}); });
} }
} }

View file

@ -1745,12 +1745,12 @@
"@elastic/transport" "^8.3.1" "@elastic/transport" "^8.3.1"
tslib "^2.4.0" tslib "^2.4.0"
"@elastic/elasticsearch@^8.14.0": "@elastic/elasticsearch@^8.15.0":
version "8.14.0" version "8.15.0"
resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-8.14.0.tgz#93b1f2a7cb6cc5cd1ceebf5060576bc690432e0a" resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-8.15.0.tgz#cb29b3ae33203c545d435cf3dc4b557c8b4961d5"
integrity sha512-MGrgCI4y+Ozssf5Q2IkVJlqt5bUMnKIICG2qxeOfrJNrVugMCBCAQypyesmSSocAtNm8IX3LxfJ3jQlFHmKe2w== integrity sha512-mG90EMdTDoT6GFSdqpUAhWK9LGuiJo6tOWqs0Usd/t15mPQDj7ZqHXfCBqNkASZpwPZpbAYVjd57S6nbUBINCg==
dependencies: dependencies:
"@elastic/transport" "^8.6.0" "@elastic/transport" "^8.7.0"
tslib "^2.4.0" tslib "^2.4.0"
"@elastic/ems-client@8.5.3": "@elastic/ems-client@8.5.3":
@ -1935,11 +1935,12 @@
undici "^5.21.2" undici "^5.21.2"
yaml "^2.2.2" yaml "^2.2.2"
"@elastic/transport@^8.3.1", "@elastic/transport@^8.6.0": "@elastic/transport@^8.3.1", "@elastic/transport@^8.7.0":
version "8.6.0" version "8.7.0"
resolved "https://registry.yarnpkg.com/@elastic/transport/-/transport-8.6.0.tgz#8de9794c87eb0fd2bdb2c6c1e32792aeb06b32bc" resolved "https://registry.yarnpkg.com/@elastic/transport/-/transport-8.7.0.tgz#006987fc5583f61c266e0b1003371e82efc7a6b5"
integrity sha512-/Ucpztrc+urZK8yCtFBUu2LePYJNnukgZSUUApUzGH/SxejqkH526Nph7aru8I0vZwdW5wqgCHSOIq3J7tIxGg== integrity sha512-IqXT7a8DZPJtqP2qmX1I2QKmxYyN27kvSW4g6pInESE1SuGwZDp2FxHJ6W2kwmYOJwQdAt+2aWwzXO5jHo9l4A==
dependencies: dependencies:
"@opentelemetry/api" "1.x"
debug "^4.3.4" debug "^4.3.4"
hpagent "^1.0.0" hpagent "^1.0.0"
ms "^2.1.3" ms "^2.1.3"
@ -7943,10 +7944,10 @@
dependencies: dependencies:
"@opentelemetry/api" "^1.0.0" "@opentelemetry/api" "^1.0.0"
"@opentelemetry/api@^1.0.0", "@opentelemetry/api@^1.1.0", "@opentelemetry/api@^1.4.1": "@opentelemetry/api@1.x", "@opentelemetry/api@^1.0.0", "@opentelemetry/api@^1.1.0", "@opentelemetry/api@^1.4.1":
version "1.8.0" version "1.9.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.8.0.tgz#5aa7abb48f23f693068ed2999ae627d2f7d902ec" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe"
integrity sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w== integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==
"@opentelemetry/core@1.15.0": "@opentelemetry/core@1.15.0":
version "1.15.0" version "1.15.0"