mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Fix typo in ESQLSearchResponse type (#184861)
Fixes a small typo in the `ESQLSearchResponse` (formerly known as `ESQLSearchReponse`). Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
This commit is contained in:
parent
bff17fe57f
commit
95604815e0
12 changed files with 23 additions and 23 deletions
|
@ -20,7 +20,7 @@ export type {
|
|||
MaybeReadonlyArray,
|
||||
ESQLColumn,
|
||||
ESQLRow,
|
||||
ESQLSearchReponse,
|
||||
ESQLSearchResponse,
|
||||
ESQLSearchParams,
|
||||
SearchField,
|
||||
} from './src';
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
SearchHit,
|
||||
ESQLColumn,
|
||||
ESQLRow,
|
||||
ESQLSearchReponse,
|
||||
ESQLSearchResponse,
|
||||
ESQLSearchParams,
|
||||
ChangePointType,
|
||||
} from './search';
|
||||
|
@ -53,7 +53,7 @@ export type {
|
|||
SearchHit,
|
||||
ESQLColumn,
|
||||
ESQLRow,
|
||||
ESQLSearchReponse,
|
||||
ESQLSearchResponse,
|
||||
ESQLSearchParams,
|
||||
ChangePointType,
|
||||
};
|
||||
|
|
|
@ -673,7 +673,7 @@ export interface ESQLColumn {
|
|||
|
||||
export type ESQLRow = unknown[];
|
||||
|
||||
export interface ESQLSearchReponse {
|
||||
export interface ESQLSearchResponse {
|
||||
columns: ESQLColumn[];
|
||||
// In case of ?drop_null_columns in the query, then
|
||||
// all_columns will have available and empty fields
|
||||
|
|
|
@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import type { DatatableColumn } from '@kbn/expressions-plugin/common';
|
||||
import type { ISearchGeneric } from '@kbn/search-types';
|
||||
import { esFieldTypeToKibanaFieldType } from '@kbn/field-types';
|
||||
import type { ESQLColumn, ESQLSearchReponse, ESQLSearchParams } from '@kbn/es-types';
|
||||
import type { ESQLColumn, ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
|
||||
export function formatESQLColumns(columns: ESQLColumn[]): DatatableColumn[] {
|
||||
|
@ -49,7 +49,7 @@ export async function getESQLQueryColumnsRaw({
|
|||
)
|
||||
);
|
||||
|
||||
return (response.rawResponse as unknown as ESQLSearchReponse).columns ?? [];
|
||||
return (response.rawResponse as unknown as ESQLSearchResponse).columns ?? [];
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
i18n.translate('esqlUtils.columnsErrorMsg', {
|
||||
|
@ -100,7 +100,7 @@ export async function getESQLResults({
|
|||
filter?: unknown;
|
||||
dropNullColumns?: boolean;
|
||||
}): Promise<{
|
||||
response: ESQLSearchReponse;
|
||||
response: ESQLSearchResponse;
|
||||
params: ESQLSearchParams;
|
||||
}> {
|
||||
const result = await lastValueFrom(
|
||||
|
@ -119,7 +119,7 @@ export async function getESQLResults({
|
|||
)
|
||||
);
|
||||
return {
|
||||
response: result.rawResponse as unknown as ESQLSearchReponse,
|
||||
response: result.rawResponse as unknown as ESQLSearchResponse,
|
||||
params: result.requestParams as unknown as ESQLSearchParams,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import { IScopedSearchClient } from '@kbn/data-plugin/server';
|
|||
import { dataPluginMock } from '@kbn/data-plugin/server/mocks';
|
||||
import { CancellationToken } from '@kbn/reporting-common';
|
||||
import type { ReportingConfigType } from '@kbn/reporting-server';
|
||||
import type { ESQLSearchReponse as ESQLSearchResponse } from '@kbn/es-types';
|
||||
import type { ESQLSearchResponse } from '@kbn/es-types';
|
||||
import {
|
||||
UI_SETTINGS_CSV_QUOTE_VALUES,
|
||||
UI_SETTINGS_CSV_SEPARATOR,
|
||||
|
|
|
@ -14,7 +14,7 @@ import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-ty
|
|||
import { ESQL_SEARCH_STRATEGY, cellHasFormulas, getEsQueryConfig } from '@kbn/data-plugin/common';
|
||||
import type { IScopedSearchClient } from '@kbn/data-plugin/server';
|
||||
import { type Filter, buildEsQuery } from '@kbn/es-query';
|
||||
import type { ESQLSearchParams, ESQLSearchReponse } from '@kbn/es-types';
|
||||
import type { ESQLSearchParams, ESQLSearchResponse } from '@kbn/es-types';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import {
|
||||
AuthenticationExpiredError,
|
||||
|
@ -103,7 +103,7 @@ export class CsvESQLGenerator {
|
|||
const { rawResponse, warning } = await lastValueFrom(
|
||||
this.clients.data.search<
|
||||
IKibanaSearchRequest<ESQLSearchParams>,
|
||||
IKibanaSearchResponse<ESQLSearchReponse>
|
||||
IKibanaSearchResponse<ESQLSearchResponse>
|
||||
>(searchParams, {
|
||||
strategy: ESQL_SEARCH_STRATEGY,
|
||||
abortSignal: abortController.signal,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { ESQLSearchReponse } from '@kbn/es-types';
|
||||
import type { ESQLSearchResponse } from '@kbn/es-types';
|
||||
import { appendToESQLQuery } from '@kbn/esql-utils';
|
||||
import type { DataViewField } from '@kbn/data-views-plugin/common';
|
||||
import type { FieldStatsResponse } from '../../types';
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
} from '../../utils/can_provide_stats';
|
||||
import { getFieldExampleBuckets } from '../field_examples_calculator';
|
||||
|
||||
export type SearchHandlerTextBased = ({ query }: { query: string }) => Promise<ESQLSearchReponse>;
|
||||
export type SearchHandlerTextBased = ({ query }: { query: string }) => Promise<ESQLSearchResponse>;
|
||||
|
||||
export function buildSearchFilter({
|
||||
timeFieldName,
|
||||
|
|
|
@ -18,7 +18,7 @@ import { Observable, defer, throwError } from 'rxjs';
|
|||
import { catchError, map, switchMap, tap } from 'rxjs';
|
||||
import { buildEsQuery } from '@kbn/es-query';
|
||||
import type { ISearchGeneric } from '@kbn/search-types';
|
||||
import type { ESQLSearchReponse, ESQLSearchParams } from '@kbn/es-types';
|
||||
import type { ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types';
|
||||
import { getEsQueryConfig } from '../../es_query';
|
||||
import { getTime } from '../../query';
|
||||
import { ESQL_ASYNC_SEARCH_STRATEGY, KibanaContext, ESQL_TABLE_TYPE } from '..';
|
||||
|
@ -194,7 +194,7 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => {
|
|||
|
||||
return search<
|
||||
IKibanaSearchRequest<ESQLSearchParams>,
|
||||
IKibanaSearchResponse<ESQLSearchReponse>
|
||||
IKibanaSearchResponse<ESQLSearchResponse>
|
||||
>(
|
||||
{ params: { ...params, dropNullColumns: true } },
|
||||
{ abortSignal, strategy: ESQL_ASYNC_SEARCH_STRATEGY }
|
||||
|
|
|
@ -8,7 +8,7 @@ import { ESQL_ASYNC_SEARCH_STRATEGY } from '@kbn/data-plugin/common';
|
|||
import pLimit from 'p-limit';
|
||||
import { chunk } from 'lodash';
|
||||
import { isDefined } from '@kbn/ml-is-defined';
|
||||
import type { ESQLSearchReponse } from '@kbn/es-types';
|
||||
import type { ESQLSearchResponse } from '@kbn/es-types';
|
||||
import { appendToESQLQuery } from '@kbn/esql-utils';
|
||||
import type { UseCancellableSearch } from '@kbn/ml-cancellable-search';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
|
@ -111,7 +111,7 @@ const getESQLOverallStatsInChunk = async ({
|
|||
if (!esqlResults) {
|
||||
return;
|
||||
}
|
||||
const esqlResultsResp = esqlResults.rawResponse as unknown as ESQLSearchReponse;
|
||||
const esqlResultsResp = esqlResults.rawResponse as unknown as ESQLSearchResponse;
|
||||
|
||||
const sampleCount = !isDefined(limitSize) ? totalCount : limitSize;
|
||||
fieldsToFetch.forEach((field, idx) => {
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
// @ts-ignore
|
||||
import { parse } from 'wellknown';
|
||||
import { Feature, FeatureCollection, GeoJsonProperties } from 'geojson';
|
||||
import type { ESQLSearchReponse } from '@kbn/es-types';
|
||||
import type { ESQLSearchResponse } from '@kbn/es-types';
|
||||
import { EMPTY_FEATURE_COLLECTION } from '../../../../common/constants';
|
||||
import { isGeometryColumn } from './esql_utils';
|
||||
|
||||
export function convertToGeoJson(resp: ESQLSearchReponse): FeatureCollection {
|
||||
export function convertToGeoJson(resp: ESQLSearchResponse): FeatureCollection {
|
||||
const geometryColumnIndex = resp.columns.findIndex(isGeometryColumn);
|
||||
if (geometryColumnIndex === -1) {
|
||||
return EMPTY_FEATURE_COLLECTION;
|
||||
|
|
|
@ -14,7 +14,7 @@ import { Adapters } from '@kbn/inspector-plugin/common/adapters';
|
|||
import { getIndexPatternFromESQLQuery, getLimitFromESQLQuery } from '@kbn/esql-utils';
|
||||
import { buildEsQuery } from '@kbn/es-query';
|
||||
import type { Filter, Query } from '@kbn/es-query';
|
||||
import type { ESQLSearchParams, ESQLSearchReponse } from '@kbn/es-types';
|
||||
import type { ESQLSearchParams, ESQLSearchResponse } from '@kbn/es-types';
|
||||
import { getEsQueryConfig } from '@kbn/data-service/src/es_query';
|
||||
import { getTime } from '@kbn/data-plugin/public';
|
||||
import { FIELD_ORIGIN, SOURCE_TYPES, VECTOR_SHAPE_TYPE } from '../../../../common/constants';
|
||||
|
@ -238,7 +238,7 @@ export class ESQLSource
|
|||
|
||||
requestResponder.ok({ json: rawResponse, requestParams });
|
||||
|
||||
const esqlSearchResponse = rawResponse as unknown as ESQLSearchReponse;
|
||||
const esqlSearchResponse = rawResponse as unknown as ESQLSearchResponse;
|
||||
const resultsCount = esqlSearchResponse.values.length;
|
||||
return {
|
||||
data: convertToGeoJson(esqlSearchResponse),
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { validateQuery } from '@kbn/esql-validation-autocomplete';
|
||||
import { getAstAndSyntaxErrors } from '@kbn/esql-ast';
|
||||
import type { ElasticsearchClient } from '@kbn/core/server';
|
||||
import { ESQLSearchReponse, ESQLRow } from '@kbn/es-types';
|
||||
import { ESQLSearchResponse, ESQLRow } from '@kbn/es-types';
|
||||
import { esFieldTypeToKibanaFieldType, type KBN_FIELD_TYPES } from '@kbn/field-types';
|
||||
import { splitIntoCommands } from './correct_common_esql_mistakes';
|
||||
|
||||
|
@ -57,7 +57,7 @@ export async function runAndValidateEsqlQuery({
|
|||
},
|
||||
})
|
||||
.then((res) => {
|
||||
const esqlResponse = res as ESQLSearchReponse;
|
||||
const esqlResponse = res as ESQLSearchResponse;
|
||||
|
||||
const columns =
|
||||
esqlResponse.columns?.map(({ name, type }) => ({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue