Skip to content

Commit

Permalink
[8.x] [ES `body` removal] `@elastic/search-kibana` (
Browse files Browse the repository at this point in the history
#204876) (#206294)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES `body` removal] `@elastic/search-kibana`
(#204876)](#204876)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alejandro Fernández
Haro","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-10T14:54:23Z","message":"[ES
`body` removal] `@elastic/search-kibana`
(#204876)","sha":"d0abdbdb7e6800dd01845f776f813122b53ed6dd","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"title":"[ES
`body` removal]
`@elastic/search-kibana`","number":204876,"url":"https://github.com/elastic/kibana/pull/204876","mergeCommit":{"message":"[ES
`body` removal] `@elastic/search-kibana`
(#204876)","sha":"d0abdbdb7e6800dd01845f776f813122b53ed6dd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204876","number":204876,"mergeCommit":{"message":"[ES
`body` removal] `@elastic/search-kibana`
(#204876)","sha":"d0abdbdb7e6800dd01845f776f813122b53ed6dd"}}]}]
BACKPORT-->

Co-authored-by: Alejandro Fernández Haro <[email protected]>
  • Loading branch information
kibanamachine and afharo authored Jan 13, 2025
1 parent 0e120ac commit 408c761
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import { ApiKeyFlyout, ApiKeyFlyoutProps } from '@kbn/security-api-key-management';
import type { SecurityCreateApiKeyResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { SecurityCreateApiKeyResponse } from '@elastic/elasticsearch/lib/api/types';

const API_KEY_NAME = 'Unrestricted API Key';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { IngestSimulateResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { IngestSimulateResponse } from '@elastic/elasticsearch/lib/api/types';

import { createApiLogic } from '../../../shared/api_logic/create_api_logic';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { IngestSimulateResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { IngestSimulateResponse } from '@elastic/elasticsearch/lib/api/types';

import type { MlInferencePipeline } from '../../../../../common/types/pipelines';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { kea, MakeLogicType } from 'kea';

import { IngestSimulateResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { IngestSimulateResponse } from '@elastic/elasticsearch/lib/api/types';

import { Status, HttpError } from '../../../../../../../common/types/api';
import { MlInferencePipeline } from '../../../../../../../common/types/pipelines';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
IndicesGetResponse,
SecurityHasPrivilegesPrivileges,
IndicesStatsIndicesStats,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
} from '@elastic/elasticsearch/lib/api/types';
import { IScopedClusterClient } from '@kbn/core/server';

import { AlwaysShowPattern, ElasticsearchIndexWithPrivileges } from '../../../common/types/indices';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import {
AggregationsMultiBucketAggregateBase,
AggregationsStringRareTermsBucketKeys,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
} from '@elastic/elasticsearch/lib/api/types';

import { ElasticsearchClient } from '@kbn/core/server';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { SecurityHasPrivilegesPrivileges } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SecurityHasPrivilegesPrivileges } from '@elastic/elasticsearch/lib/api/types';
import { ElasticsearchIndex } from '@kbn/search-connectors';

import { expandAliases, getAlwaysShowAliases } from './extract_always_show_indices';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { SecurityHasPrivilegesPrivileges } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SecurityHasPrivilegesPrivileges } from '@elastic/elasticsearch/lib/api/types';
import { ElasticsearchIndex } from '@kbn/search-connectors';

import { AlwaysShowPattern } from '../../../../common/types/indices';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import {
MlGetTrainedModelsStatsRequest,
MlGetTrainedModelsRequest,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
} from '@elastic/elasticsearch/lib/api/types';
import { MlTrainedModels } from '@kbn/ml-plugin/server';

import { MlModelDeploymentStatus, MlModelDeploymentState } from '../../../common/types/ml';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { MlStartTrainedModelDeploymentRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { MlStartTrainedModelDeploymentRequest } from '@elastic/elasticsearch/lib/api/types';

import { MlTrainedModels } from '@kbn/ml-plugin/server';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { MlPutTrainedModelRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { MlPutTrainedModelRequest } from '@elastic/elasticsearch/lib/api/types';
import { MlTrainedModels } from '@kbn/ml-plugin/server';

import { MlModelDeploymentState, MlModelDeploymentStatus } from '../../../common/types/ml';
Expand Down Expand Up @@ -43,10 +43,8 @@ export const startMlModelDownload = async (

// we're not downloaded yet - let's initiate that...
const putRequest: MlPutTrainedModelRequest = {
body: {
input: {
field_names: ['text_field'],
},
input: {
field_names: ['text_field'],
},
model_id: modelName,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* 2.0.
*/

import type {
MappingProperty,
MappingPropertyBase,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { MappingProperty, MappingPropertyBase } from '@elastic/elasticsearch/lib/api/types';
import type { Mappings } from '../../types';

interface VectorFieldTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { AcknowledgedResponseBase } from '@elastic/elasticsearch/lib/api/types';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { SearchHit } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SearchHit } from '@elastic/elasticsearch/lib/api/types';
import { MutationKeys, QueryKeys } from '../../constants';
import { useKibana } from '../use_kibana';
import { INDEX_SEARCH_POLLING, IndexDocuments } from './use_document_search';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import type {
UsageCollectionSetup,
UsageCollectionStart,
} from '@kbn/usage-collection-plugin/public';
import type {
MappingProperty,
MappingPropertyBase,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { MappingProperty, MappingPropertyBase } from '@elastic/elasticsearch/lib/api/types';
import type {
IndexManagementPluginSetup,
IndexManagementPluginStart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import type { IndicesIndexState } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { IndicesIndexState } from '@elastic/elasticsearch/lib/api/types';

export function isHidden(index: IndicesIndexState): boolean {
return index.settings?.index?.hidden === true || index.settings?.index?.hidden === 'true';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { useQuery } from '@tanstack/react-query';
import { IndexName } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { IndexName } from '@elastic/elasticsearch/lib/api/types';
import { useKibana } from './use_kibana';
import { APIRoutes } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
IndexName,
IndicesStatsIndexMetadataState,
Uuid,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
} from '@elastic/elasticsearch/lib/api/types';
import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
import React, { ComponentType } from 'react';
import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { RetrieverContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { RetrieverContainer } from '@elastic/elasticsearch/lib/api/types';
import { IndicesQuerySourceFields, QuerySourceFields } from '../types';

export type IndexFields = Record<string, string[]>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
AggregationsAggregate,
SearchHit,
SearchResponse,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
} from '@elastic/elasticsearch/lib/api/types';
import { getValueForSelectedField } from '../utils/get_value_for_selected_field';

export interface ElasticsearchRetrieverInput extends BaseRetrieverInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { IndicesStatsIndicesStats } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { IndicesStatsIndicesStats } from '@elastic/elasticsearch/lib/api/types';
import { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import { isNotNullish } from '../../../common/utils/is_not_nullish';
import { isHidden, isClosed } from '../../utils/index_utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { IndicesIndexState } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { IndicesIndexState } from '@elastic/elasticsearch/lib/api/types';

export function isHidden(index: IndicesIndexState): boolean {
return index.settings?.index?.hidden === true || index.settings?.index?.hidden === 'true';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { testHasEmbeddedConsole } from './embedded_console';

Expand Down

0 comments on commit 408c761

Please sign in to comment.