Skip to content

Commit f1d9853

Browse files
afharoMadameSheema
authored andcommitted
Upgrade ES client to 9.0.0-alpha.3 (elastic#208776)
## Summary Updating the ES client to 9.0. Resolves elastic#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 (elastic/elasticsearch-js#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 [email protected] 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 [email protected] 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 <[email protected]>
1 parent 5cef32c commit f1d9853

File tree

1,907 files changed

+26727
-29371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,907 files changed

+26727
-29371
lines changed

examples/eso_model_version_example/server/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export class EsoModelVersionExample
330330
const objectsCreated = await Promise.all(
331331
documentVersionConstants.map(async (obj) => {
332332
const createdDoc: WriteResponseBase =
333-
await elasticsearch.client.asInternalUser.create(obj);
333+
await elasticsearch.client.asInternalUser.create<unknown>(obj);
334334
const parts = createdDoc._id.split(':', 2);
335335
return { type: parts[0], id: parts[1] };
336336
})

examples/search_examples/public/search/app.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,15 @@ export const SearchExamplesApp = ({
181181
const aggs = [{ type: metricAggType, params: { field: selectedNumericField!.name } }];
182182
const aggsDsl = data.search.aggs.createAggConfigs(dataView, aggs).toDsl();
183183

184+
const body = {
185+
aggs: aggsDsl,
186+
query,
187+
};
188+
184189
const req = {
185190
params: {
186191
index: dataView.title,
187-
body: {
188-
aggs: aggsDsl,
189-
query,
190-
},
192+
...body,
191193
},
192194
// Add a custom request parameter to be consumed by `MyStrategy`.
193195
...(strategy ? { get_cool: getCool } : {}),
@@ -197,7 +199,7 @@ export const SearchExamplesApp = ({
197199
setAbortController(abortController);
198200

199201
// Submit the search request using the `data.search` service.
200-
setRequest(req.params.body);
202+
setRequest(body);
201203
setRawResponse({});
202204
setWarningContents([]);
203205
setIsLoading(true);

examples/search_examples/public/search_sessions/app.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,8 @@ function doSearch(
707707
const req = {
708708
params: {
709709
index: dataView.title,
710-
body: {
711-
aggs: aggsDsl,
712-
query,
713-
},
710+
aggs: aggsDsl,
711+
query,
714712
},
715713
};
716714

examples/search_examples/server/routes/server_search_route.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ export function registerServerSearchRoute(router: IRouter<DataRequestHandlerCont
3939
{
4040
params: {
4141
index,
42-
body: {
43-
aggs: {
44-
'1': {
45-
avg: {
46-
field,
47-
},
42+
aggs: {
43+
'1': {
44+
avg: {
45+
field,
4846
},
4947
},
5048
},

examples/unified_doc_viewer/public/application.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ function UnifiedDocViewerExamplesApp({ data }: { data: DataPublicPluginStart })
4444
.search({
4545
params: {
4646
index: dataView?.getIndexPattern(),
47-
body: {
48-
fields: ['*'],
49-
_source: false,
50-
},
47+
fields: ['*'],
48+
_source: false,
5149
},
5250
})
5351
.toPromise();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"@elastic/datemath": "5.0.3",
116116
"@elastic/ebt": "^1.1.1",
117117
"@elastic/ecs": "^8.11.5",
118-
"@elastic/elasticsearch": "^8.17.0",
118+
"@elastic/elasticsearch": "9.0.0-alpha.3",
119119
"@elastic/ems-client": "8.6.3",
120120
"@elastic/eui": "99.2.0-borealis.0",
121121
"@elastic/eui-theme-borealis": "0.0.10",

packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export async function reportFailuresToEs(log: ToolingLog, failures: TestFailure[
3737
password: process.env.TEST_FAILURES_ES_PASSWORD,
3838
},
3939
Connection: HttpConnection,
40+
requestTimeout: 30_000,
4041
});
4142

4243
const body = failures.flatMap((failure) => [

packages/kbn-performance-testing-dataset-extractor/src/es_client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import { Client } from '@elastic/elasticsearch';
10+
import { Client, HttpConnection } from '@elastic/elasticsearch';
1111
import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
1212
import { SearchRequest, MsearchRequestItem } from '@elastic/elasticsearch/lib/api/types';
1313
import { ToolingLog } from '@kbn/tooling-log';
@@ -109,6 +109,8 @@ export class ESClient {
109109
username: options.username,
110110
password: options.password,
111111
},
112+
Connection: HttpConnection,
113+
requestTimeout: 30_000,
112114
});
113115
this.log = log;
114116
}

src/core/packages/elasticsearch/server-internal/src/elasticsearch_service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class ElasticsearchService
116116

117117
this.esNodesCompatibility$ = esNodesCompatibility$;
118118

119-
this.clusterInfo$ = getClusterInfo$(this.client.asInternalUser);
119+
this.clusterInfo$ = getClusterInfo$(this.client.asInternalUser).pipe(takeUntil(this.stop$));
120120
registerAnalyticsContextProvider(deps.analytics, this.clusterInfo$);
121121

122122
return {

src/core/packages/elasticsearch/server-internal/src/is_scripting_enabled.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import { isRetryableEsClientErrorMock } from './is_scripting_enabled.test.mocks';
11-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
11+
import type { estypes } from '@elastic/elasticsearch';
1212
import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks';
1313
import { isInlineScriptingEnabled } from './is_scripting_enabled';
1414

src/core/packages/saved-objects/api-server-internal/src/lib/apis/bulk_delete.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from '../repository.test.mock';
1919

2020
import type { Payload } from '@hapi/boom';
21-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
21+
import type { estypes } from '@elastic/elasticsearch';
2222

2323
import type {
2424
SavedObjectsBulkDeleteObject,

src/core/packages/saved-objects/api-server-internal/src/lib/apis/bulk_get.isolated.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
getSavedObjectFromSourceMock,
1212
rawDocExistsInNamespaceMock,
1313
} from './bulk_get.isolated.test.mocks';
14-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
14+
import type { estypes } from '@elastic/elasticsearch';
1515
import { SavedObject, CheckAuthorizationResult } from '@kbn/core-saved-objects-server';
1616
import { apiContextMock, ApiExecutionContextMock } from '../../mocks';
1717
import { performBulkGet } from './bulk_get';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/bulk_get.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
import type { ISavedObjectsSecurityExtension } from '@kbn/core-saved-objects-server';
1818

1919
import type { Payload } from '@hapi/boom';
20-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
20+
import type { estypes } from '@elastic/elasticsearch';
2121

2222
import type { SavedObjectsBulkGetObject } from '@kbn/core-saved-objects-api-server';
2323
import { type SavedObjectsRawDocSource, type SavedObject } from '@kbn/core-saved-objects-server';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/bulk_update.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from '../repository.test.mock';
1818

1919
import type { Payload } from '@hapi/boom';
20-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
20+
import type { estypes } from '@elastic/elasticsearch';
2121

2222
import type {
2323
SavedObjectsBulkUpdateObject,

src/core/packages/saved-objects/api-server-internal/src/lib/apis/check_conflicts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
mockGetSearchDsl,
1414
} from '../repository.test.mock';
1515

16-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
16+
import type { estypes } from '@elastic/elasticsearch';
1717

1818
import { ALL_NAMESPACES_STRING } from '@kbn/core-saved-objects-utils-server';
1919
import { SavedObjectsRepository } from '../repository';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/create.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
mockGetSearchDsl,
1717
} from '../repository.test.mock';
1818

19-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
19+
import type { estypes } from '@elastic/elasticsearch';
2020

2121
import type { SavedObjectsCreateOptions } from '@kbn/core-saved-objects-api-server';
2222
import {

src/core/packages/saved-objects/api-server-internal/src/lib/apis/delete.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
mockGetSearchDsl,
1717
} from '../repository.test.mock';
1818

19-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
19+
import type { estypes } from '@elastic/elasticsearch';
2020

2121
import type { SavedObjectsDeleteOptions } from '@kbn/core-saved-objects-api-server';
2222
import { ALL_NAMESPACES_STRING } from '@kbn/core-saved-objects-utils-server';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/find.isolated.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import { isSupportedEsServerMock } from './find.isolated.test.mocks';
11-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
11+
import type { estypes } from '@elastic/elasticsearch';
1212
import { SavedObject, AuthorizationTypeMap } from '@kbn/core-saved-objects-server';
1313
import { apiContextMock, ApiExecutionContextMock } from '../../mocks';
1414
import { performFind } from './find';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/find.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import Boom from '@hapi/boom';
11-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
11+
import type { estypes } from '@elastic/elasticsearch';
1212
import { isSupportedEsServer } from '@kbn/core-elasticsearch-server-internal';
1313
import {
1414
SavedObjectsErrorHelpers,

src/core/packages/saved-objects/api-server-internal/src/lib/apis/get.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
mockGetSearchDsl,
1616
} from '../repository.test.mock';
1717

18-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
18+
import type { estypes } from '@elastic/elasticsearch';
1919

2020
import type { SavedObjectsBaseOptions } from '@kbn/core-saved-objects-api-server';
2121
import { ALL_NAMESPACES_STRING } from '@kbn/core-saved-objects-utils-server';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/increment_counter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
mockGetSearchDsl,
1717
} from '../repository.test.mock';
1818

19-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
19+
import type { estypes } from '@elastic/elasticsearch';
2020

2121
import type {
2222
SavedObjectsIncrementCounterField,

src/core/packages/saved-objects/api-server-internal/src/lib/apis/internals/preflight_check_for_create.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ describe('preflightCheckForCreate', () => {
6565
docs: results.map(({ found, disabled }, i) => {
6666
return found
6767
? {
68-
// @ts-expect-error
6968
_id: params!.docs![i]._id, // needed for mockRawDocExistsInNamespaces mock implementation and existingDocument assertions
7069
_index: 'doesnt-matter',
7170
_source: {

src/core/packages/saved-objects/api-server-internal/src/lib/apis/internals/preflight_check_for_create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
10+
import type { estypes } from '@elastic/elasticsearch';
1111
import { isNotFoundFromUnsupportedServer } from '@kbn/core-elasticsearch-server-internal';
1212
import {
1313
type ISavedObjectTypeRegistry,

src/core/packages/saved-objects/api-server-internal/src/lib/apis/internals/update_objects_spaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import pMap from 'p-map';
11-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
11+
import type { estypes } from '@elastic/elasticsearch';
1212
import intersection from 'lodash/intersection';
1313

1414
import type { Logger } from '@kbn/logging';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/remove_references_to.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
mockGetSearchDsl,
1616
} from '../repository.test.mock';
1717

18-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
18+
import type { estypes } from '@elastic/elasticsearch';
1919

2020
import { SavedObjectsRepository } from '../repository';
2121
import { loggerMock } from '@kbn/logging-mocks';

src/core/packages/saved-objects/api-server-internal/src/lib/apis/update.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import { mockGetCurrentTime, mockPreflightCheckForCreate } from '../repository.test.mock';
1313

14-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
14+
import type { estypes } from '@elastic/elasticsearch';
1515
import {
1616
type SavedObjectUnsanitizedDoc,
1717
type SavedObjectReference,

src/core/packages/saved-objects/api-server-internal/src/lib/apis/utils/es_responses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
10+
import type { estypes } from '@elastic/elasticsearch';
1111

1212
/**
1313
* Type and type guard function for converting a possibly not existent doc to an existent doc.

src/core/packages/saved-objects/api-server-internal/src/lib/apis/utils/internal_utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
10+
import type { estypes } from '@elastic/elasticsearch';
1111
import type { Payload } from '@hapi/boom';
1212
import {
1313
SavedObjectsErrorHelpers,

src/core/packages/saved-objects/api-server-internal/src/lib/point_in_time_finder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
10+
import type { estypes } from '@elastic/elasticsearch';
1111
import type { Logger } from '@kbn/logging';
1212
import type {
1313
SavedObjectsFindOptions,

src/core/packages/saved-objects/api-server-internal/src/lib/repository.encryption_extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
mockGetSearchDsl,
1515
} from './repository.test.mock';
1616

17-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
17+
import type { estypes } from '@elastic/elasticsearch';
1818

1919
import { SavedObjectsRepository } from './repository';
2020
import { loggerMock } from '@kbn/logging-mocks';

src/core/packages/saved-objects/api-server-internal/src/lib/repository.security_extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717

1818
import { SavedObjectsRepository } from './repository';
1919
import { loggerMock } from '@kbn/logging-mocks';
20-
import { estypes } from '@elastic/elasticsearch';
20+
import type { estypes } from '@elastic/elasticsearch';
2121
import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks';
2222
import { SavedObjectsBulkUpdateObject } from '@kbn/core-saved-objects-api-server';
2323
import { SavedObjectsSerializer } from '@kbn/core-saved-objects-base-server-internal';

src/core/packages/saved-objects/api-server-internal/src/lib/repository.spaces_extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
mockDeleteLegacyUrlAliases,
1919
} from './repository.test.mock';
2020

21-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
21+
import type { estypes } from '@elastic/elasticsearch';
2222

2323
import { SavedObjectsRepository } from './repository';
2424
import { loggerMock } from '@kbn/logging-mocks';

src/core/packages/saved-objects/api-server-internal/src/lib/search/aggregations/validation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
10+
import type { estypes } from '@elastic/elasticsearch';
1111
import { validateAndConvertAggregations } from './validation';
1212

1313
type AggsMap = Record<string, estypes.AggregationsAggregationContainer>;

src/core/packages/saved-objects/api-server-internal/src/lib/search/aggregations/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
10+
import type { estypes } from '@elastic/elasticsearch';
1111
import { ObjectType } from '@kbn/config-schema';
1212
import { isPlainObject, isArray } from 'lodash';
1313

src/core/packages/saved-objects/api-server-internal/src/lib/search/search_dsl/search_dsl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import Boom from '@hapi/boom';
1111

12-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
12+
import type { estypes } from '@elastic/elasticsearch';
1313
import type { SavedObjectsPitParams } from '@kbn/core-saved-objects-api-server';
1414
import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server';
1515
import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal';

src/core/packages/saved-objects/api-server-internal/src/test_helpers/repository.test.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
10+
import type { estypes } from '@elastic/elasticsearch';
1111
import { schema } from '@kbn/config-schema';
1212
import { loggerMock } from '@kbn/logging-mocks';
1313
import type { Payload } from 'elastic-apm-node';

src/core/packages/saved-objects/migration-server-internal/src/actions/bulk_overwrite_transformed_documents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import * as Either from 'fp-ts/lib/Either';
1111
import * as TaskEither from 'fp-ts/lib/TaskEither';
12-
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
12+
import type { estypes } from '@elastic/elasticsearch';
1313
import { errors as esErrors } from '@elastic/elasticsearch';
1414
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
1515
import {

src/core/packages/saved-objects/migration-server-internal/src/actions/close_pit.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export const closePit =
2828
({ client, pitId }: ClosePitParams): TaskEither.TaskEither<RetryableEsClientError, {}> =>
2929
() => {
3030
return client
31-
.closePointInTime({
32-
body: { id: pitId },
33-
})
31+
.closePointInTime({ id: pitId })
3432
.then((response) => {
3533
if (!response.succeeded) {
3634
throw new Error(`Failed to close PointInTime with id: ${pitId}`);

src/core/packages/saved-objects/migration-server-internal/src/actions/create_index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import * as Either from 'fp-ts/lib/Either';
1111
import * as TaskEither from 'fp-ts/lib/TaskEither';
1212
import { pipe } from 'fp-ts/lib/function';
13-
import * as estypes from '@elastic/elasticsearch/lib/api/types';
13+
import type { estypes } from '@elastic/elasticsearch';
1414
import type {
1515
ElasticsearchClient,
1616
ElasticsearchCapabilities,

0 commit comments

Comments
 (0)