Skip to content

Commit e7dbe43

Browse files
authored
[ES 9.0] Remove body workaround (@elastic/security-entity-analytics) (#217225)
## Summary Follow up to #213375: The latest version of the ES client fixed the issue elastic/elasticsearch-js#2584. We should be able to remove all usages of `// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584`.
1 parent 86fab6e commit e7dbe43

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/create_datastream.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ export const updateUnderlyingMapping = async ({ logger, esClient, index }: Updat
8989

9090
try {
9191
await retryTransientEsErrors(
92-
// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584
93-
() => esClient.indices.putMapping({ index, body: simulatedMapping }),
92+
() => esClient.indices.putMapping({ index, ...simulatedMapping }),
9493
{ logger }
9594
);
9695
logger.info(`Update mappings for ${index}`);

x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/create_or_update_index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ export const createOrUpdateIndex = async ({
4040
indices.map(async (index) => {
4141
try {
4242
await retryTransientEsErrors(
43-
// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584
44-
() => esClient.indices.putMapping({ index, body: options.mappings }),
43+
() => esClient.indices.putMapping({ index, ...options.mappings }),
4544
{ logger }
4645
);
4746
logger.info(`Update mappings for ${index}`);

0 commit comments

Comments
 (0)