kibana/test/api_integration/apis
Alejandro Fernández Haro 52ab19db2d
Upgrade ES client to 9.0.0-alpha.3 (#208776)
## Summary

Updating the ES client to 9.0. 

Resolves #116102

## What changes?

**Breaking change**: `body` has been removed.

Most of the changes are about bringing all the content inside the body
as a root attribute to the API params:

```diff
const response = await client.search({
  index: 'test',
-  body: {
    query: {
      match_all: {}
    }
-  }
})
```

For this reason, enabling the "Hide whitespace changes" option when
reviewing is recommended.

Some exceptions to this rule:

* Bulk APIs replace the `body` array with `operations` array (direct
replacement)
* Index Put Settings API replace `body` array with `settings` (direct
replacement)
* Msearch replaces the `body` array with `searches` array (direct
replacement)
* Document Index API replaces `body` with `document` (direct
replacement)
* Create Repository replaces `body` with `repository` (direct
replacement)

Because of a known issue in the client
(https://github.com/elastic/elasticsearch-js/issues/2584), there's still
an escape hatch to send data in the body in case the specific use case
requires it via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`, but it
shouldn't be abused because we lose types. In this PR we've used it in
those scenarios where we reuse the response of a GET as the body of a
PUT/POST.

### Other changes

* `estypes` can be imported from the root of the library as `import type
{ estypes } from '@elastic/elasticsearch';`
* `estypesWithBody` have been removed
* `requestTimeout`'s 30s default has been removed in the client. This PR
explicitly adds the setting in all client usages.


### Identify risks

- [x] The client places unknown properties as querystring, risking body
params leaking there, and causing 400 errors from ES => Solved by
forcing `body` usage there via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`. The next
version of the client will address this.
- [x] We need to run the MKI tests to make sure that we're not breaking
anything there =>
https://elastic.slack.com/archives/C04HT4P1YS3/p1739528112482629?thread_ts=1739480136.231439&cid=C04HT4P1YS3

---------

Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
2025-02-25 14:37:23 +00:00
..
console [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
core [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
custom_integration [Search] Remove calls to enterprise search config (#206971) 2025-01-24 12:41:21 -06:00
dashboards [Dashboard] Public CRUD API MVP (#193067) 2024-11-08 11:35:13 -05:00
data_view_field_editor Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
data_views Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
esql Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
event_annotations [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
general Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
guided_onboarding [Search] Remove calls to enterprise search config (#206971) 2025-01-24 12:41:21 -06:00
home Remove dependency date-fns !! (#209539) 2025-02-05 17:34:16 +01:00
kql_telemetry Update dependency @types/lodash to ^4.17.10 (main) (#194739) 2024-10-15 08:21:03 +02:00
saved_objects Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
saved_objects_management [Saved Queries] Rework saved query privileges (#202863) 2025-01-29 17:34:58 -04:00
saved_queries [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
scripts [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
search Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
short_url Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
stats Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
status Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
suggestions [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
telemetry Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
ui_counters [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
ui_metric [http] api_integration tests handle internal route restriction (#192407) 2024-09-12 09:23:10 +02:00
index.ts [Dashboard] Public CRUD API MVP (#193067) 2024-11-08 11:35:13 -05:00