[ES 9.0] Remove body workaround (@elastic/security-entity-analytics) (#217225)

## Summary

Follow up to https://github.com/elastic/kibana/pull/213375: The latest
version of the ES client fixed the issue
https://github.com/elastic/elasticsearch-js/issues/2584.

We should be able to remove all usages of `// @ts-expect-error
elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`.
This commit is contained in:
Alejandro Fernández Haro 2025-04-08 11:10:46 +02:00 committed by GitHub
parent 86fab6e2b4
commit e7dbe43e28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View file

@ -89,8 +89,7 @@ export const updateUnderlyingMapping = async ({ logger, esClient, index }: Updat
try {
await retryTransientEsErrors(
// @ts-expect-error elasticsearch@9.0.0 https://github.com/elastic/elasticsearch-js/issues/2584
() => esClient.indices.putMapping({ index, body: simulatedMapping }),
() => esClient.indices.putMapping({ index, ...simulatedMapping }),
{ logger }
);
logger.info(`Update mappings for ${index}`);

View file

@ -40,8 +40,7 @@ export const createOrUpdateIndex = async ({
indices.map(async (index) => {
try {
await retryTransientEsErrors(
// @ts-expect-error elasticsearch@9.0.0 https://github.com/elastic/elasticsearch-js/issues/2584
() => esClient.indices.putMapping({ index, body: options.mappings }),
() => esClient.indices.putMapping({ index, ...options.mappings }),
{ logger }
);
logger.info(`Update mappings for ${index}`);