diff --git a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.ts b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.ts index 02404ddec6213..5cf5955586910 100644 --- a/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.ts +++ b/x-pack/platform/packages/shared/index-management/index_management_shared_types/src/types.ts @@ -10,7 +10,7 @@ import { HealthStatus, IndicesStatsIndexMetadataState, Uuid, -} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +} from '@elastic/elasticsearch/lib/api/types'; import type { ScopedHistory } from '@kbn/core-application-browser'; import type { SerializableRecord } from '@kbn/utility-types'; import type { LocatorPublic } from '@kbn/share-plugin/public'; diff --git a/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/policy.ts b/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/policy.ts index 0630aede316bb..32cd1ca548da4 100644 --- a/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/policy.ts +++ b/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/policy.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { schema, TypeOf } from '@kbn/config-schema'; import { SlmPolicyEs, PolicyIndicesResponse } from '../../../common/types'; @@ -47,7 +46,7 @@ export function registerPolicyRoutes({ body: { policies: Object.entries(policiesByName).map(([name, policy]) => { // TODO: Figure out why our {@link SlmPolicyEs} is not compatible with: - // import type { SnapshotLifecyclePolicyMetadata } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + // import type { SnapshotLifecyclePolicyMetadata } from '@elastic/elasticsearch/lib/api/types'; return deserializePolicy(name, policy as SlmPolicyEs, managedPolicies); }), }, @@ -119,9 +118,9 @@ export function registerPolicyRoutes({ try { // Otherwise create new policy const response = await clusterClient.asCurrentUser.slm.putLifecycle({ + // TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest} + ...serializePolicy(policy), policy_id: name, - // TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest['body']} - body: serializePolicy(policy) as unknown as estypes.SlmPutLifecycleRequest['body'], }); return res.ok({ body: response }); @@ -149,9 +148,9 @@ export function registerPolicyRoutes({ // Otherwise update policy const response = await clusterClient.asCurrentUser.slm.putLifecycle({ + // TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest} + ...serializePolicy(policy), policy_id: name, - // TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest['body']} - body: serializePolicy(policy) as unknown as estypes.SlmPutLifecycleRequest['body'], }); return res.ok({ body: response }); diff --git a/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/repositories.ts b/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/repositories.ts index 39f9366f30a8e..f131ad34bb100 100644 --- a/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/repositories.ts +++ b/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/repositories.ts @@ -9,7 +9,7 @@ import { TypeOf } from '@kbn/config-schema'; import type { SnapshotGetRepositoryResponse, PluginStats, -} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +} from '@elastic/elasticsearch/lib/api/types'; import { ON_PREM_REPOSITORY_TYPES, diff --git a/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/restore.ts b/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/restore.ts index ea89298ee2163..1b5326e2ce925 100644 --- a/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/restore.ts +++ b/x-pack/platform/plugins/private/snapshot_restore/server/routes/api/restore.ts @@ -6,7 +6,6 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { SnapshotRestore, SnapshotRestoreShardEs } from '../../../common/types'; import { serializeRestoreSettings } from '../../../common/lib'; @@ -114,10 +113,10 @@ export function registerRestoreRoutes({ try { const response = await clusterClient.asCurrentUser.snapshot.restore({ + // TODO: Bring {@link RestoreSettingsEs} in line with {@link RestoreRequest} + ...serializeRestoreSettings(restoreSettings), repository, snapshot, - // TODO: Bring {@link RestoreSettingsEs} in line with {@link RestoreRequest['body']} - body: serializeRestoreSettings(restoreSettings) as estypes.SnapshotRestoreRequest['body'], }); return res.ok({ body: response }); diff --git a/x-pack/platform/plugins/private/upgrade_assistant/common/types.ts b/x-pack/platform/plugins/private/upgrade_assistant/common/types.ts index 477e6d443bf89..8e484a047c7b1 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/common/types.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/common/types.ts @@ -6,7 +6,7 @@ */ import { HealthReportImpact } from '@elastic/elasticsearch/lib/api/types'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { SavedObject } from '@kbn/core/types'; export type DeprecationSource = 'Kibana' | 'Elasticsearch'; diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/__fixtures__/health_indicators.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/__fixtures__/health_indicators.ts index cad6e73a092a1..e62f8cbb43852 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/__fixtures__/health_indicators.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/__fixtures__/health_indicators.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; export const diskIndicatorGreen: estypes.HealthReportDiskIndicator = { status: 'green', diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/health_indicators.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/health_indicators.ts index 372582220659a..915ccc3ecbb42 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/health_indicators.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/health_indicators.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { IScopedClusterClient } from '@kbn/core/server'; import { EnrichedDeprecationInfo } from '../../../common/types'; diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/index.test.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/index.test.ts index c7a8c13993099..dc1e4f48bc3ef 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/index.test.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/index.test.ts @@ -7,7 +7,7 @@ import _ from 'lodash'; import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import fakeDeprecations from '../__fixtures__/fake_deprecations.json'; import * as healthIndicatorsMock from '../__fixtures__/health_indicators'; diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts index 39d9984a64aa1..c4c764eaf0f45 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/es_deprecations_status/migrations.ts @@ -8,7 +8,7 @@ import type { MigrationDeprecationsResponse, MigrationDeprecationsDeprecation, -} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +} from '@elastic/elasticsearch/lib/api/types'; import { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; import _ from 'lodash'; import { EnrichedDeprecationInfo } from '../../../common/types'; diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/types.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/types.ts index 09449413dabc1..d046fa5f22f92 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/types.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/lib/reindexing/types.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; interface Mapping { type?: string; diff --git a/x-pack/platform/plugins/private/upgrade_assistant/server/routes/node_disk_space.ts b/x-pack/platform/plugins/private/upgrade_assistant/server/routes/node_disk_space.ts index 77d8de08eb86c..2d22fa8442835 100644 --- a/x-pack/platform/plugins/private/upgrade_assistant/server/routes/node_disk_space.ts +++ b/x-pack/platform/plugins/private/upgrade_assistant/server/routes/node_disk_space.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ClusterGetSettingsResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { ClusterGetSettingsResponse } from '@elastic/elasticsearch/lib/api/types'; import { ByteSizeValue } from '@kbn/config-schema'; import { API_BASE_PATH } from '../../common/constants'; import { versionCheckHandlerWrapper } from '../lib/es_version_precheck'; diff --git a/x-pack/platform/plugins/private/watcher/common/types/status_types.ts b/x-pack/platform/plugins/private/watcher/common/types/status_types.ts index 9b83bf29174f9..b5dc2542820da 100644 --- a/x-pack/platform/plugins/private/watcher/common/types/status_types.ts +++ b/x-pack/platform/plugins/private/watcher/common/types/status_types.ts @@ -6,7 +6,7 @@ */ import type { Moment } from 'moment'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { ACTION_STATES, WATCH_STATES, WATCH_STATE_COMMENTS } from '../constants'; diff --git a/x-pack/platform/plugins/private/watcher/server/lib/fetch_all_from_scroll/fetch_all_from_scroll.ts b/x-pack/platform/plugins/private/watcher/server/lib/fetch_all_from_scroll/fetch_all_from_scroll.ts index eddc924c4c7c3..ce0883940d0b2 100644 --- a/x-pack/platform/plugins/private/watcher/server/lib/fetch_all_from_scroll/fetch_all_from_scroll.ts +++ b/x-pack/platform/plugins/private/watcher/server/lib/fetch_all_from_scroll/fetch_all_from_scroll.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { IScopedClusterClient } from '@kbn/core/server'; import { get } from 'lodash'; import { ES_SCROLL_SETTINGS } from '../../../common/constants'; diff --git a/x-pack/platform/plugins/private/watcher/server/routes/api/indices/register_get_route.ts b/x-pack/platform/plugins/private/watcher/server/routes/api/indices/register_get_route.ts index bda36d04d5c3c..5736af1eb4228 100644 --- a/x-pack/platform/plugins/private/watcher/server/routes/api/indices/register_get_route.ts +++ b/x-pack/platform/plugins/private/watcher/server/routes/api/indices/register_get_route.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { schema } from '@kbn/config-schema'; import { IScopedClusterClient } from '@kbn/core/server'; import { reduce, size } from 'lodash'; diff --git a/x-pack/platform/plugins/private/watcher/server/routes/api/watches/register_delete_route.ts b/x-pack/platform/plugins/private/watcher/server/routes/api/watches/register_delete_route.ts index 7cfe3e51b6915..b34a1cd75fa35 100644 --- a/x-pack/platform/plugins/private/watcher/server/routes/api/watches/register_delete_route.ts +++ b/x-pack/platform/plugins/private/watcher/server/routes/api/watches/register_delete_route.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { schema } from '@kbn/config-schema'; import { IScopedClusterClient } from '@kbn/core/server'; import { RouteDependencies } from '../../../types'; diff --git a/x-pack/platform/plugins/shared/index_management/public/application/components/mappings_editor/lib/utils.ts b/x-pack/platform/plugins/shared/index_management/public/application/components/mappings_editor/lib/utils.ts index 71231c89b673c..e6e9ac54d3eb3 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/components/mappings_editor/lib/utils.ts +++ b/x-pack/platform/plugins/shared/index_management/public/application/components/mappings_editor/lib/utils.ts @@ -8,7 +8,7 @@ import { v4 as uuidv4 } from 'uuid'; import { cloneDeep } from 'lodash'; -import { InferenceServiceSettings } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { InferenceServiceSettings } from '@elastic/elasticsearch/lib/api/types'; import { LocalInferenceServiceSettings } from '@kbn/ml-trained-models-utils/src/constants/trained_models'; import { ChildFieldName, diff --git a/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts b/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts index 78f8942ba72fa..8fb3524a65a0f 100644 --- a/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts +++ b/x-pack/platform/plugins/shared/index_management/public/application/services/api.ts @@ -9,7 +9,7 @@ import { METRIC_TYPE } from '@kbn/analytics'; import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types'; import { IndicesStatsResponse } from '@elastic/elasticsearch/lib/api/types'; import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; -import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/types'; import { API_BASE_PATH, INTERNAL_API_BASE_PATH, diff --git a/x-pack/platform/plugins/shared/index_management/server/routes/api/component_templates/register_update_route.ts b/x-pack/platform/plugins/shared/index_management/server/routes/api/component_templates/register_update_route.ts index d93950e0df4ca..87ff780a5686a 100644 --- a/x-pack/platform/plugins/shared/index_management/server/routes/api/component_templates/register_update_route.ts +++ b/x-pack/platform/plugins/shared/index_management/server/routes/api/component_templates/register_update_route.ts @@ -6,7 +6,7 @@ */ import { schema } from '@kbn/config-schema'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { RouteDependencies } from '../../../types'; import { addBasePath } from '..'; diff --git a/x-pack/platform/plugins/shared/index_management/server/routes/api/enrich_policies/helpers.ts b/x-pack/platform/plugins/shared/index_management/server/routes/api/enrich_policies/helpers.ts index 32b7d0b64718c..534b0afd8e642 100644 --- a/x-pack/platform/plugins/shared/index_management/server/routes/api/enrich_policies/helpers.ts +++ b/x-pack/platform/plugins/shared/index_management/server/routes/api/enrich_policies/helpers.ts @@ -9,7 +9,7 @@ import { forEach, keys, sortBy, reduce, size } from 'lodash'; import { flatMap, flow, groupBy, values as valuesFP, map, pickBy } from 'lodash/fp'; import type { IScopedClusterClient } from '@kbn/core/server'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import type { FieldCapsResponse } from '@elastic/elasticsearch/lib/api/types'; export type FieldCapsList = FieldCapsResponse['fields']; diff --git a/x-pack/platform/plugins/shared/index_management/server/routes/api/stats/register_stats_route.ts b/x-pack/platform/plugins/shared/index_management/server/routes/api/stats/register_stats_route.ts index 79f947a4cec96..a24f9ec3f4f15 100644 --- a/x-pack/platform/plugins/shared/index_management/server/routes/api/stats/register_stats_route.ts +++ b/x-pack/platform/plugins/shared/index_management/server/routes/api/stats/register_stats_route.ts @@ -6,7 +6,7 @@ */ import { schema } from '@kbn/config-schema'; -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { RouteDependencies } from '../../../types'; import { addBasePath } from '..'; diff --git a/x-pack/platform/plugins/shared/index_management/server/routes/api/templates/register_simulate_route.ts b/x-pack/platform/plugins/shared/index_management/server/routes/api/templates/register_simulate_route.ts index 193962d34284a..ef19d2a3de8b8 100644 --- a/x-pack/platform/plugins/shared/index_management/server/routes/api/templates/register_simulate_route.ts +++ b/x-pack/platform/plugins/shared/index_management/server/routes/api/templates/register_simulate_route.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { schema, TypeOf } from '@kbn/config-schema'; import { RouteDependencies } from '../../../types'; @@ -40,15 +40,11 @@ export function registerSimulateRoute({ router, lib: { handleEsError } }: RouteD const params: estypes.IndicesSimulateTemplateRequest = templateName ? { name: templateName, - body: { - index_patterns, - }, + index_patterns, } : { - body: { - ...template, - index_patterns, - }, + ...template, + index_patterns, }; try { diff --git a/x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.ts b/x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.ts index d56a3105bea84..cec58c103bacd 100644 --- a/x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.ts +++ b/x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { Pipeline, Processor } from '../types'; export function deserializePipelines(pipelinesByName: { diff --git a/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/simulate.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/simulate.ts index 276cd29e03b39..1b598f9f17fcc 100644 --- a/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/simulate.ts +++ b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/simulate.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type * as estypes from '@elastic/elasticsearch/lib/api/types'; import { schema } from '@kbn/config-schema'; import { API_BASE_PATH } from '../../../common/constants';