Remove deprecated es-query re-imports from data plugin (#134600)

This commit is contained in:
Anton Dosov 2022-06-21 13:09:44 +02:00 committed by GitHub
parent e0446dac82
commit a8095ce11a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
207 changed files with 296 additions and 959 deletions

View file

@ -34,6 +34,7 @@ import { lastValueFrom, of } from 'rxjs';
import { CoreStart } from '@kbn/core/public';
import { mountReactNode } from '@kbn/core/public/utils';
import type { TimeRange } from '@kbn/es-query';
import { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
import {
@ -45,7 +46,6 @@ import {
isErrorResponse,
QueryState,
SearchSessionState,
TimeRange,
} from '@kbn/data-plugin/public';
import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
import type { DataView, DataViewField } from '@kbn/data-views-plugin/public';

View file

@ -7,8 +7,7 @@
*/
import { SerializableRecord } from '@kbn/utility-types';
import { Filter, Query, isFilterPinned } from '@kbn/es-query';
import type { TimeRange } from '@kbn/data-plugin/public';
import { Filter, Query, isFilterPinned, TimeRange } from '@kbn/es-query';
import { getStatesFromKbnUrl, setStateToKbnUrl } from '@kbn/kibana-utils-plugin/public';
import { LocatorDefinition } from '@kbn/share-plugin/common';

View file

@ -18,14 +18,13 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import { Filter, FilterStateStore } from '@kbn/es-query';
import { Filter, FilterStateStore, Query } from '@kbn/es-query';
import { CoreStart } from '@kbn/core/public';
import { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
import {
connectToQueryState,
DataPublicPluginStart,
Query,
QueryState,
syncQueryStateWithUrl,
} from '@kbn/data-plugin/public';

View file

@ -6,8 +6,7 @@
* Side Public License, v 1.
*/
import { TimeRange } from '@kbn/data-plugin/common';
import { Filter, Query, BoolQuery } from '@kbn/es-query';
import type { Filter, Query, BoolQuery, TimeRange } from '@kbn/es-query';
import { FieldSpec, DataView, DataViewField } from '@kbn/data-views-plugin/common';
import { DataControlInput } from '../../types';

View file

@ -6,8 +6,7 @@
* Side Public License, v 1.
*/
import { Filter, Query } from '@kbn/es-query';
import { TimeRange } from '@kbn/data-plugin/common';
import type { Filter, Query, TimeRange } from '@kbn/es-query';
import { EmbeddableInput } from '@kbn/embeddable-plugin/common/types';
export type ControlWidth = 'small' | 'medium' | 'large';

View file

@ -9,8 +9,7 @@
import { memoize } from 'lodash';
import dateMath from '@kbn/datemath';
import { buildEsQuery } from '@kbn/es-query';
import { TimeRange } from '@kbn/data-plugin/public';
import { buildEsQuery, type TimeRange } from '@kbn/es-query';
import { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public';
import {

View file

@ -8,13 +8,8 @@
import type { SerializableRecord } from '@kbn/utility-types';
import { flow } from 'lodash';
import { type Filter } from '@kbn/es-query';
import type {
TimeRange,
Query,
GlobalQueryStateFromUrl,
RefreshInterval,
} from '@kbn/data-plugin/public';
import type { Filter, TimeRange, Query } from '@kbn/es-query';
import type { GlobalQueryStateFromUrl, RefreshInterval } from '@kbn/data-plugin/public';
import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public';
import { SerializableControlGroupInput } from '@kbn/controls-plugin/common';
import { setStateToKbnUrl } from '@kbn/kibana-utils-plugin/public';

View file

@ -6,4 +6,5 @@
* Side Public License, v 1.
*/
export type { Query, TimeRange, Filter } from '@kbn/es-query';
export * from '@kbn/data-plugin/public';

View file

@ -7,388 +7,3 @@
*/
export { getEsQueryConfig } from './get_es_query_config';
// NOTE: Trick to deprecate exports https://stackoverflow.com/a/49152018/372086
import {
enableFilter as oldEnableFilter,
pinFilter as oldPinFilter,
toggleFilterDisabled as oldToggleFilterDisabled,
isFilterDisabled as oldIsFilterDisabled,
disableFilter as oldDisableFilter,
fromKueryExpression as oldFromKueryExpression,
toElasticsearchQuery as oldToElasticsearchQuery,
buildEsQuery as oldBuildEsQuery,
buildQueryFromFilters as oldBuildQueryFromFilters,
luceneStringToDsl as oldLuceneStringToDsl,
decorateQuery as olddecorateQuery,
getPhraseFilterField as oldgetPhraseFilterField,
getPhraseFilterValue as oldgetPhraseFilterValue,
isFilterPinned as oldIsFilterPinned,
nodeBuilder as oldNodeBuilder,
isFilters as oldIsFilters,
isExistsFilter as oldIsExistsFilter,
isMatchAllFilter as oldIsMatchAllFilter,
isPhraseFilter as oldIsPhraseFilter,
isPhrasesFilter as oldIsPhrasesFilter,
isRangeFilter as oldIsRangeFilter,
isQueryStringFilter as oldIsQueryStringFilter,
buildQueryFilter as oldBuildQueryFilter,
buildPhrasesFilter as oldBuildPhrasesFilter,
buildPhraseFilter as oldBuildPhraseFilter,
buildRangeFilter as oldBuildRangeFilter,
buildCustomFilter as oldBuildCustomFilter,
buildFilter as oldBuildFilter,
buildEmptyFilter as oldBuildEmptyFilter,
buildExistsFilter as oldBuildExistsFilter,
toggleFilterNegated as oldtoggleFilterNegated,
Filter as oldFilter,
RangeFilterParams as oldRangeFilterParams,
ExistsFilter as oldExistsFilter,
PhraseFilter as oldPhraseFilter,
MatchAllFilter as oldMatchAllFilter,
RangeFilter as oldRangeFilter,
KueryNode as oldKueryNode,
TimeRange as oldTimeRange,
FilterMeta as oldFilterMeta,
FILTERS as oldFILTERS,
EsQueryConfig as oldEsQueryConfig,
compareFilters as oldCompareFilters,
COMPARE_ALL_OPTIONS as OLD_COMPARE_ALL_OPTIONS,
dedupFilters as oldDedupFilters,
onlyDisabledFiltersChanged as oldOnlyDisabledFiltersChanged,
uniqFilters as oldUniqFilters,
FilterStateStore,
} from '@kbn/es-query';
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isFilterDisabled = oldIsFilterDisabled;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const disableFilter = oldDisableFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const fromKueryExpression = oldFromKueryExpression;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const toElasticsearchQuery = oldToElasticsearchQuery;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildEsQuery = oldBuildEsQuery;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildQueryFromFilters = oldBuildQueryFromFilters;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const luceneStringToDsl = oldLuceneStringToDsl;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const decorateQuery = olddecorateQuery;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const getPhraseFilterField = oldgetPhraseFilterField;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const getPhraseFilterValue = oldgetPhraseFilterValue;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isFilterPinned = oldIsFilterPinned;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const nodeBuilder = oldNodeBuilder;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isFilters = oldIsFilters;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const uniqFilters = oldUniqFilters;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const onlyDisabledFiltersChanged = oldOnlyDisabledFiltersChanged;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isExistsFilter = oldIsExistsFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isMatchAllFilter = oldIsMatchAllFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isPhraseFilter = oldIsPhraseFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isPhrasesFilter = oldIsPhrasesFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isRangeFilter = oldIsRangeFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const isQueryStringFilter = oldIsQueryStringFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildQueryFilter = oldBuildQueryFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildPhrasesFilter = oldBuildPhrasesFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildPhraseFilter = oldBuildPhraseFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildRangeFilter = oldBuildRangeFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildCustomFilter = oldBuildCustomFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildFilter = oldBuildFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildEmptyFilter = oldBuildEmptyFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const buildExistsFilter = oldBuildExistsFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const toggleFilterNegated = oldtoggleFilterNegated;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const enableFilter = oldEnableFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const pinFilter = oldPinFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const toggleFilterDisabled = oldToggleFilterDisabled;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const compareFilters = oldCompareFilters;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const dedupFilters = oldDedupFilters;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const COMPARE_ALL_OPTIONS = OLD_COMPARE_ALL_OPTIONS;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
const FILTERS = oldFILTERS;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type Filter = oldFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type RangeFilterParams = oldRangeFilterParams;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type ExistsFilter = oldExistsFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type PhraseFilter = oldPhraseFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type MatchAllFilter = oldMatchAllFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type RangeFilter = oldRangeFilter;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type KueryNode = oldKueryNode;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type FilterMeta = oldFilterMeta;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
type EsQueryConfig = oldEsQueryConfig;
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
/**
* @deprecated Import from the "@kbn/es-query" package directly instead.
* @removeBy 8.3
*/
type TimeRange = oldTimeRange;
export type {
Filter,
RangeFilterParams,
ExistsFilter,
PhraseFilter,
MatchAllFilter,
RangeFilter,
KueryNode,
FilterMeta,
EsQueryConfig,
TimeRange,
};
export {
COMPARE_ALL_OPTIONS,
compareFilters,
enableFilter,
pinFilter,
toggleFilterDisabled,
disableFilter,
fromKueryExpression,
toElasticsearchQuery,
buildEsQuery,
buildQueryFromFilters,
luceneStringToDsl,
decorateQuery,
getPhraseFilterField,
getPhraseFilterValue,
isFilterPinned,
nodeBuilder,
isFilters,
isExistsFilter,
isMatchAllFilter,
isPhraseFilter,
isPhrasesFilter,
isRangeFilter,
isQueryStringFilter,
buildQueryFilter,
buildPhrasesFilter,
buildPhraseFilter,
buildRangeFilter,
buildCustomFilter,
buildFilter,
buildEmptyFilter,
buildExistsFilter,
toggleFilterNegated,
FILTERS,
isFilterDisabled,
dedupFilters,
onlyDisabledFiltersChanged,
uniqFilters,
FilterStateStore,
};

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { ExistsFilter, FilterStateStore } from '..';
import { ExistsFilter, FilterStateStore } from '@kbn/es-query';
export const existsFilter: ExistsFilter = {
meta: {

View file

@ -12,59 +12,7 @@
export { DEFAULT_QUERY_LANGUAGE, KIBANA_USER_QUERY_LANGUAGE_KEY, UI_SETTINGS } from './constants';
export type { ValueSuggestionsMethod } from './constants';
export { DatatableUtilitiesService } from './datatable_utilities';
export {
buildEmptyFilter,
buildCustomFilter,
buildExistsFilter,
buildPhraseFilter,
buildPhrasesFilter,
buildQueryFilter,
buildQueryFromFilters,
buildRangeFilter,
buildFilter,
buildEsQuery,
getPhraseFilterField,
getPhraseFilterValue,
isExistsFilter,
compareFilters,
dedupFilters,
disableFilter,
enableFilter,
isPhraseFilter,
isFilters,
isQueryStringFilter,
isRangeFilter,
isPhrasesFilter,
decorateQuery,
fromKueryExpression,
isFilterDisabled,
isFilterPinned,
isMatchAllFilter,
FilterStateStore,
COMPARE_ALL_OPTIONS,
FILTERS,
getEsQueryConfig,
luceneStringToDsl,
nodeBuilder,
onlyDisabledFiltersChanged,
pinFilter,
toElasticsearchQuery,
toggleFilterDisabled,
toggleFilterNegated,
uniqFilters,
} from './es_query';
export type {
ExistsFilter,
Filter,
MatchAllFilter,
FilterMeta,
PhraseFilter,
RangeFilter,
RangeFilterParams,
KueryNode,
EsQueryConfig,
TimeRange,
} from './es_query';
export { getEsQueryConfig } from './es_query';
export { KbnFieldType } from './kbn_field_types';
export {
calculateBounds,

View file

@ -9,10 +9,10 @@
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import dateMath from '@kbn/datemath';
import { omitBy } from 'lodash';
import { buildRangeFilter } from '@kbn/es-query';
import { buildRangeFilter, TimeRange, RangeFilterParams } from '@kbn/es-query';
import type { Moment } from 'moment';
import type { DataView } from '@kbn/data-views-plugin/common';
import type { TimeRange, TimeRangeBounds, RangeFilterParams } from '../..';
import type { TimeRangeBounds } from '../..';
export interface CalculateBoundsOptions {
forceNow?: Date;

View file

@ -10,7 +10,7 @@ import moment from 'moment-timezone';
import _, { cloneDeep } from 'lodash';
import { i18n } from '@kbn/i18n';
import type { Assign } from '@kbn/utility-types';
import { isRangeFilter } from '@kbn/es-query';
import { isRangeFilter, TimeRange, RangeFilter } from '@kbn/es-query';
import type { DataView } from '@kbn/data-views-plugin/common';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { IndexPatternLoadExpressionFunctionDefinition } from '@kbn/data-views-plugin/common';
@ -20,7 +20,6 @@ import type {
IEsSearchResponse,
ISearchOptions,
ISearchSource,
RangeFilter,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../public';
import type { EsaggsExpressionFunctionDefinition } from '../expressions';
@ -29,7 +28,7 @@ import type { IAggType } from './agg_type';
import type { AggTypesRegistryStart } from './agg_types_registry';
import { AggGroupNames } from './agg_groups';
import { AggTypesDependencies, GetConfigFn, getUserTimeZone } from '../..';
import { TimeRange, getTime, calculateBounds } from '../..';
import { getTime, calculateBounds } from '../..';
import type { IBucketAggConfig } from './buckets';
import { insertTimeShiftSplit, mergeTimeShifts } from './utils/time_splits';

View file

@ -9,15 +9,9 @@
import { get, noop, find, every, omitBy, isNil } from 'lodash';
import moment from 'moment-timezone';
import { i18n } from '@kbn/i18n';
import { DataViewFieldBase } from '@kbn/es-query';
import { DataViewFieldBase, TimeRange } from '@kbn/es-query';
import {
AggTypesDependencies,
KBN_FIELD_TYPES,
TimeRange,
TimeRangeBounds,
UI_SETTINGS,
} from '../../..';
import { AggTypesDependencies, KBN_FIELD_TYPES, TimeRangeBounds, UI_SETTINGS } from '../../..';
import { ExtendedBounds, extendedBoundsToAst, timerangeToAst } from '../../expressions';
import { intervalOptions, autoInterval, isAutoInterval } from './_interval_options';

View file

@ -7,7 +7,7 @@
*/
import dateMath from '@kbn/datemath';
import { TimeRange } from '../../../..';
import type { TimeRange } from '@kbn/es-query';
export function toAbsoluteDates(range: TimeRange) {
const fromDate = dateMath.parse(range.from);

View file

@ -7,7 +7,7 @@
*/
import { Datatable } from '@kbn/expressions-plugin/common';
import { Filter } from '../../../es_query';
import type { Filter } from '@kbn/es-query';
import { IAggConfig } from '../../aggs';
const getOtherBucketFilterTerms = (table: Datatable, columnIndex: number, rowIndex: number) => {

View file

@ -8,7 +8,7 @@
import { from } from 'rxjs';
import type { MockedKeys } from '@kbn/utility-types-jest';
import type { Filter } from '../../../es_query';
import type { Filter } from '@kbn/es-query';
import type { IAggConfigs } from '../../aggs';
import type { ISearchSource } from '../../search_source';
import { searchSourceCommonMock, searchSourceInstanceMock } from '../../search_source/mocks';

View file

@ -11,8 +11,9 @@ import { defer } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { Adapters } from '@kbn/inspector-plugin/common';
import type { DataView } from '@kbn/data-views-plugin/common';
import type { Filter, TimeRange } from '@kbn/es-query';
import { calculateBounds, Filter, Query, TimeRange } from '../../..';
import { calculateBounds, Query } from '../../..';
import { IAggConfigs } from '../../aggs';
import { ISearchStartSearchSource } from '../../search_source';

View file

@ -9,7 +9,7 @@
import { createSearchSource as createSearchSourceFactory } from './create_search_source';
import { SearchSourceDependencies } from './search_source';
import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/common';
import { Filter } from '../../es_query';
import type { Filter } from '@kbn/es-query';
describe('createSearchSource', () => {
const indexPatternMock: DataView = {} as DataView;

View file

@ -9,11 +9,11 @@
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SerializableRecord } from '@kbn/utility-types';
import { PersistableStateService } from '@kbn/kibana-utils-plugin/common';
import type { Filter } from '@kbn/es-query';
import type { DataView } from '@kbn/data-views-plugin/common';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { AggConfigSerialized, IAggConfigs } from '../../../public';
import { Query } from '../..';
import { Filter } from '../../es_query';
import type { SearchSource } from './search_source';
/**

View file

@ -9,10 +9,10 @@
import { last } from 'lodash';
import moment from 'moment';
import { Datatable } from '@kbn/expressions-plugin';
import { DataViewFieldBase } from '@kbn/es-query';
import { esFilters, RangeFilterParams } from '../..';
import { buildRangeFilter, DataViewFieldBase, RangeFilterParams } from '@kbn/es-query';
import { getIndexPatterns, getSearchService } from '../../services';
import { AggConfigSerialized } from '../../../common/search/aggs';
import { mapAndFlattenFilters } from '../../query';
interface RangeSelectDataContext {
table: Datatable;
@ -58,5 +58,5 @@ export async function createFiltersFromRangeSelectAction(event: RangeSelectDataC
range.format = 'strict_date_optional_time';
}
return esFilters.mapAndFlattenFilters([esFilters.buildRangeFilter(field, range, indexPattern)]);
return mapAndFlattenFilters([buildRangeFilter(field, range, indexPattern)]);
}

View file

@ -8,9 +8,10 @@
import _ from 'lodash';
import { Datatable } from '@kbn/expressions-plugin/public';
import { esFilters, Filter } from '../..';
import { compareFilters, COMPARE_ALL_OPTIONS, Filter, toggleFilterNegated } from '@kbn/es-query';
import { getIndexPatterns, getSearchService } from '../../services';
import { AggConfigSerialized } from '../../../common/search/aggs';
import { mapAndFlattenFilters } from '../../query';
interface ValueClickDataContext {
data: Array<{
@ -135,7 +136,7 @@ export const createFiltersFromValueClickAction = async ({
if (filter) {
filter.forEach((f) => {
if (negate) {
f = esFilters.toggleFilterNegated(f);
f = toggleFilterNegated(f);
}
filters.push(f);
});
@ -143,7 +144,7 @@ export const createFiltersFromValueClickAction = async ({
})
);
return _.uniqWith(esFilters.mapAndFlattenFilters(filters), (a, b) =>
esFilters.compareFilters(a, b, esFilters.COMPARE_ALL_OPTIONS)
return _.uniqWith(mapAndFlattenFilters(filters), (a, b) =>
compareFilters(a, b, COMPARE_ALL_OPTIONS)
);
};

View file

@ -1,140 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/*
* Filters:
*/
import {
getPhraseFilterField,
getPhraseFilterValue,
isExistsFilter,
isFilterPinned,
isMatchAllFilter,
isPhraseFilter,
isPhrasesFilter,
isQueryStringFilter,
isRangeFilter,
toggleFilterNegated,
buildEmptyFilter,
buildExistsFilter,
buildPhraseFilter,
buildPhrasesFilter,
buildQueryFilter,
buildRangeFilter,
disableFilter,
fromKueryExpression,
toElasticsearchQuery,
buildEsQuery,
buildQueryFromFilters,
luceneStringToDsl,
decorateQuery,
FILTERS,
isFilters,
KueryNode,
RangeFilter,
RangeFilterParams,
ExistsFilter,
PhraseFilter,
MatchAllFilter,
EsQueryConfig,
FilterStateStore,
compareFilters,
COMPARE_ALL_OPTIONS,
onlyDisabledFiltersChanged,
getEsQueryConfig,
TimeRange,
} from '../common';
import {
getDisplayValueFromFilter,
generateFilters,
mapAndFlattenFilters as oldMapAndFlattenFilters,
} from './query';
/**
* @deprecated This import will be removed.
* @removeBy 8.1
*/
const mapAndFlattenFilters = oldMapAndFlattenFilters;
/**
* Filter helpers namespace:
* @deprecated Import helpers from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
export const esFilters = {
FILTERS,
FilterStateStore,
buildEmptyFilter,
buildPhrasesFilter,
buildExistsFilter,
buildPhraseFilter,
buildQueryFilter,
buildRangeFilter,
isPhraseFilter,
isExistsFilter,
isPhrasesFilter,
isRangeFilter,
isMatchAllFilter,
isQueryStringFilter,
isFilterPinned,
toggleFilterNegated,
disableFilter,
getPhraseFilterField,
getPhraseFilterValue,
getDisplayValueFromFilter,
compareFilters,
COMPARE_ALL_OPTIONS,
generateFilters,
onlyDisabledFiltersChanged,
mapAndFlattenFilters,
};
/**
* Deprecated type exports
*/
export type {
KueryNode,
RangeFilter,
RangeFilterParams,
ExistsFilter,
PhraseFilter,
MatchAllFilter,
EsQueryConfig,
TimeRange,
};
export { isFilters };
/**
* @deprecated Import helpers from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
export const esKuery = {
fromKueryExpression,
toElasticsearchQuery,
};
/**
* @deprecated Import helpers from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
export const esQuery = {
buildEsQuery,
getEsQueryConfig,
buildQueryFromFilters,
luceneStringToDsl,
decorateQuery,
};
export type { Filter, Query } from '../common';

View file

@ -6,19 +6,14 @@
* Side Public License, v 1.
*/
// TODO: https://github.com/elastic/kibana/issues/109904
/* eslint-disable @kbn/eslint/no_export_all */
import { PluginInitializerContext } from '@kbn/core/public';
import { ConfigSchema } from '../config';
export * from './deprecated';
/*
* Filters:
*/
export { getEsQueryConfig, FilterStateStore } from '../common';
export { getEsQueryConfig } from '../common';
export {
getDisplayValueFromFilter,
getFieldDisplayValueFromFilter,
@ -236,7 +231,7 @@ export const search = {
* Types to be shared externally
* @public
*/
export type { RefreshInterval, TimeRange } from '../common';
export type { RefreshInterval } from '../common';
export {
createSavedQueryService,

View file

@ -8,12 +8,13 @@
import _ from 'lodash';
import sinon from 'sinon';
import { Filter, FilterStateStore } from '@kbn/es-query';
import { Subscription } from 'rxjs';
import { FilterManager } from './filter_manager';
import { getFilter } from './test_helpers/get_stub_filter';
import { getFiltersArray } from './test_helpers/get_filters_array';
import { Filter, FilterStateStore, UI_SETTINGS } from '../../../common';
import { UI_SETTINGS } from '../../../common';
import { coreMock } from '@kbn/core/public/mocks';
const setupMock = coreMock.createSetup();

View file

@ -10,6 +10,7 @@ import _ from 'lodash';
import { Subject } from 'rxjs';
import { IUiSettingsClient } from '@kbn/core/public';
import { FilterStateStore } from '@kbn/es-query';
import {
isFilterPinned,
@ -23,7 +24,7 @@ import { PersistableStateService } from '@kbn/kibana-utils-plugin/common/persist
import { sortFilters } from './lib/sort_filters';
import { mapAndFlattenFilters } from './lib/map_and_flatten_filters';
import { FilterStateStore, UI_SETTINGS } from '../../../common';
import { UI_SETTINGS } from '../../../common';
import {
getAllMigrations,
inject,

View file

@ -8,7 +8,7 @@
import sinon from 'sinon';
import { generateMappingChain } from './generate_mapping_chain';
import { buildEmptyFilter } from '../../../../common';
import { buildEmptyFilter } from '@kbn/es-query';
describe('filter manager utilities', () => {
let mapping: any;

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { Filter } from '../../../../common';
import { Filter } from '@kbn/es-query';
const noop = () => {
throw new Error('No mappings have been found for filter.');

View file

@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';
import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import { Filter } from '../../../../common';
import { Filter } from '@kbn/es-query';
import { getIndexPatternFromFilter } from './get_index_pattern_from_filter';
function getValueFormatter(indexPattern?: DataView, key?: string) {

View file

@ -7,7 +7,7 @@
*/
import { DataView } from '@kbn/data-views-plugin/public';
import { Filter } from '../../../../common';
import { Filter } from '@kbn/es-query';
export function getIndexPatternFromFilter(
filter: Filter,

View file

@ -7,7 +7,7 @@
*/
import { mapAndFlattenFilters } from './map_and_flatten_filters';
import { Filter } from '../../../../common';
import type { Filter } from '@kbn/es-query';
describe('filter manager utilities', () => {
describe('mapAndFlattenFilters()', () => {

View file

@ -7,7 +7,7 @@
*/
import { mapFilter } from './map_filter';
import { Filter } from '../../../../common';
import type { Filter } from '@kbn/es-query';
describe('filter manager utilities', () => {
function getDisplayName(filter: Filter) {

View file

@ -6,8 +6,8 @@
* Side Public License, v 1.
*/
import { buildQueryFilter, buildEmptyFilter } from '@kbn/es-query';
import { mapDefault } from './map_default';
import { buildQueryFilter, buildEmptyFilter } from '../../../../../common';
describe('filter manager utilities', () => {
describe('mapDefault()', () => {

View file

@ -6,10 +6,9 @@
* Side Public License, v 1.
*/
import { buildExistsFilter, buildEmptyFilter, DataViewFieldBase } from '@kbn/es-query';
import { mapExists } from './map_exists';
import { mapQueryString } from './map_query_string';
import { buildExistsFilter, buildEmptyFilter } from '../../../../../common';
import { DataViewFieldBase } from '@kbn/es-query';
import type { DataView } from '@kbn/data-views-plugin/common';
describe('filter manager utilities', () => {

View file

@ -7,7 +7,7 @@
*/
import { mapPhrase } from './map_phrase';
import { PhraseFilter, Filter } from '../../../../../common';
import type { PhraseFilter, Filter } from '@kbn/es-query';
describe('filter manager utilities', () => {
describe('mapPhrase()', () => {

View file

@ -7,7 +7,7 @@
*/
import { mapQueryString } from './map_query_string';
import { buildQueryFilter, buildEmptyFilter, Filter } from '../../../../../common';
import { buildQueryFilter, buildEmptyFilter, Filter } from '@kbn/es-query';
describe('filter manager utilities', () => {
describe('mapQueryString()', () => {

View file

@ -7,7 +7,7 @@
*/
import { mapRange } from './map_range';
import { FilterMeta, RangeFilter, Filter } from '../../../../../common';
import { FilterMeta, RangeFilter, Filter } from '@kbn/es-query';
describe('filter manager utilities', () => {
describe('mapRange()', () => {

View file

@ -7,7 +7,7 @@
*/
import { mapSpatialFilter } from './map_spatial_filter';
import { FilterMeta, Filter, FILTERS } from '../../../../../common';
import { FilterMeta, Filter, FILTERS } from '@kbn/es-query';
describe('mapSpatialFilter()', () => {
test('should return the key for matching multi polygon filter', async () => {

View file

@ -7,7 +7,7 @@
*/
import { sortFilters } from './sort_filters';
import { FilterStateStore, buildQueryFilter } from '../../../../common';
import { FilterStateStore, buildQueryFilter } from '@kbn/es-query';
describe('sortFilters', () => {
describe('sortFilters()', () => {

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { Filter, FilterStateStore } from '../../../../common';
import { Filter, FilterStateStore } from '@kbn/es-query';
/**
* Sort filters according to their store - global filters go first

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { Filter } from '../../../../common';
import type { Filter } from '@kbn/es-query';
export function getFiltersArray(): Filter[] {
return [

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { Filter, FilterStateStore } from '../../../../common';
import { Filter, FilterStateStore } from '@kbn/es-query';
export function getFilter(
store: FilterStateStore,

View file

@ -10,7 +10,7 @@ import { share } from 'rxjs/operators';
import { HttpStart, IUiSettingsClient } from '@kbn/core/public';
import { PersistableStateService, VersionedState } from '@kbn/kibana-utils-plugin/common';
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { buildEsQuery } from '@kbn/es-query';
import { buildEsQuery, TimeRange } from '@kbn/es-query';
import type { DataView } from '@kbn/data-views-plugin/common';
import { FilterManager } from './filter_manager';
import { createAddToQueryLog } from './lib';
@ -24,7 +24,7 @@ import {
import { getQueryState, QueryState } from './query_state';
import type { QueryStringContract } from './query_string';
import { QueryStringManager } from './query_string';
import { getEsQueryConfig, TimeRange } from '../../common';
import { getEsQueryConfig } from '../../common';
import { getUiSettings } from '../services';
import { NowProviderInternalContract } from '../now_provider';
import {

View file

@ -10,8 +10,9 @@ import { BehaviorSubject } from 'rxjs';
import { skip } from 'rxjs/operators';
import { PublicMethodsOf } from '@kbn/utility-types';
import { CoreStart } from '@kbn/core/public';
import type { Query } from '@kbn/es-query';
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { KIBANA_USER_QUERY_LANGUAGE_KEY, Query, UI_SETTINGS } from '../../../common';
import { KIBANA_USER_QUERY_LANGUAGE_KEY, UI_SETTINGS } from '../../../common';
export class QueryStringManager {
private query$: BehaviorSubject<Query>;

View file

@ -6,7 +6,8 @@
* Side Public License, v 1.
*/
import { RefreshInterval, TimeRange, Query, Filter } from '../..';
import type { TimeRange, Query, Filter } from '@kbn/es-query';
import { RefreshInterval } from '../..';
export type SavedQueryTimeFilter = TimeRange & {
refreshInterval: RefreshInterval;

View file

@ -9,12 +9,11 @@
import { Subscription } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import _ from 'lodash';
import { COMPARE_ALL_OPTIONS, compareFilters } from '@kbn/es-query';
import { COMPARE_ALL_OPTIONS, compareFilters, FilterStateStore } from '@kbn/es-query';
import { BaseStateContainer } from '@kbn/kibana-utils-plugin/public';
import { QuerySetup, QueryStart } from '../query_service';
import { QueryState } from '../query_state';
import { QueryStateChange } from './types';
import { FilterStateStore } from '../../../common';
import { validateTimeRange } from '../timefilter';
/**

View file

@ -8,9 +8,10 @@
import { Subscription } from 'rxjs';
import { createBrowserHistory, History } from 'history';
import { Filter, FilterStateStore } from '@kbn/es-query';
import { FilterManager } from '../filter_manager';
import { getFilter } from '../filter_manager/test_helpers/get_stub_filter';
import { Filter, FilterStateStore, UI_SETTINGS } from '../../../common';
import { UI_SETTINGS } from '../../../common';
import { coreMock } from '@kbn/core/public/mocks';
import {
createKbnUrlStateStorage,

View file

@ -11,9 +11,9 @@ import {
IKbnUrlStateStorage,
syncState,
} from '@kbn/kibana-utils-plugin/public';
import { FilterStateStore } from '@kbn/es-query';
import { QuerySetup, QueryStart } from '../query_service';
import { connectToQueryState } from './connect_to_query_state';
import { FilterStateStore } from '../../../common';
import { GlobalQueryStateFromUrl } from './types';
const GLOBAL_STATE_STORAGE_KEY = '_g';

View file

@ -7,7 +7,7 @@
*/
import dateMath from '@kbn/datemath';
import { TimeRange } from '../../../../common';
import { TimeRange } from '@kbn/es-query';
export function validateTimeRange(time?: TimeRange): boolean {
if (!time) return false;

View file

@ -9,8 +9,8 @@
import moment from 'moment';
import { PublicMethodsOf } from '@kbn/utility-types';
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { TimeRange } from '@kbn/es-query';
import { PersistedLog } from '../persisted_log';
import { TimeRange } from '../../../common';
export class TimeHistory {
private history: PersistedLog<TimeRange>;

View file

@ -10,9 +10,10 @@ jest.useFakeTimers();
import sinon from 'sinon';
import moment from 'moment';
import { TimeRange } from '@kbn/es-query';
import { AutoRefreshDoneFn, Timefilter } from './timefilter';
import { Subscription } from 'rxjs';
import { TimeRange, RefreshInterval } from '../../../common';
import { RefreshInterval } from '../../../common';
import { createNowProviderMock } from '../../now_provider/mocks';
import { timefilterServiceMock } from './timefilter_service.mock';

View file

@ -10,6 +10,7 @@ import _ from 'lodash';
import { Subject, BehaviorSubject } from 'rxjs';
import moment from 'moment';
import { PublicMethodsOf } from '@kbn/utility-types';
import { TimeRange } from '@kbn/es-query';
import type { DataView } from '@kbn/data-views-plugin/common';
import { areRefreshIntervalsDifferent, areTimeRangesDifferent } from './lib/diff_time_picker_vals';
import type { TimefilterConfig, InputTimeRange, TimeRangeBounds } from './types';
@ -20,7 +21,6 @@ import {
getTime,
getRelativeTime,
RefreshInterval,
TimeRange,
} from '../../../common';
import { TimeHistoryContract } from './time_history';
import { createAutoRefreshLoop, AutoRefreshDoneFn } from './lib/auto_refresh_loop';

View file

@ -7,9 +7,9 @@
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import type { TimeRange } from '@kbn/es-query';
import { TimefilterService, TimeHistoryContract, TimefilterContract } from '.';
import { Observable } from 'rxjs';
import { TimeRange } from '../../../common';
export type TimefilterServiceClientContract = PublicMethodsOf<TimefilterService>;

View file

@ -8,7 +8,8 @@
import { Moment } from 'moment';
import { TimeRange, RefreshInterval } from '../../../common';
import { TimeRange } from '@kbn/es-query';
import { RefreshInterval } from '../../../common';
export interface TimefilterConfig {
timeDefaults: TimeRange;

View file

@ -1,68 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import {
buildQueryFilter,
buildCustomFilter,
buildEmptyFilter,
buildExistsFilter,
buildFilter,
buildPhraseFilter,
buildPhrasesFilter,
buildRangeFilter,
isFilterDisabled,
fromKueryExpression,
toElasticsearchQuery,
buildEsQuery,
buildQueryFromFilters,
} from '../common';
/*
* Filter helper namespace:
* @deprecated Import helpers from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
export const esFilters = {
buildQueryFilter,
buildCustomFilter,
buildEmptyFilter,
buildExistsFilter,
buildFilter,
buildPhraseFilter,
buildPhrasesFilter,
buildRangeFilter,
isFilterDisabled,
};
/*
* esQuery and esKuery:
*/
import { getEsQueryConfig } from '../common';
/*
* Filter helper namespace
* @deprecated Import helpers from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
export const esKuery = {
fromKueryExpression,
toElasticsearchQuery,
};
/*
* Filter helper namespace
* @deprecated Import helpers from the "@kbn/es-query" package directly instead.
* @removeBy 8.1
*/
export const esQuery = {
buildQueryFromFilters,
getEsQueryConfig,
buildEsQuery,
};
export type { Filter, Query, EsQueryConfig, KueryNode } from '../common';

View file

@ -6,14 +6,10 @@
* Side Public License, v 1.
*/
// TODO: https://github.com/elastic/kibana/issues/109904
/* eslint-disable @kbn/eslint/no_export_all */
import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server';
import { ConfigSchema, configSchema } from '../config';
import { DataServerPlugin, DataPluginSetup, DataPluginStart } from './plugin';
export * from './deprecated';
export { getEsQueryConfig, DEFAULT_QUERY_LANGUAGE } from '../common';
export { getRequestAbortedSignal } from './lib';
@ -93,7 +89,6 @@ export const search = {
* @public
*/
export type { TimeRange } from '../common';
export { getTime, parseInterval } from '../common';
/**

View file

@ -7,7 +7,8 @@
*/
import { coreMock } from '@kbn/core/server/mocks';
import { DATA_VIEW_SAVED_OBJECT_TYPE, FilterStateStore } from '../../common';
import { FilterStateStore } from '@kbn/es-query';
import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../../common';
import type { SavedObject, SavedQueryAttributes } from '../../common';
import { registerSavedQueryRouteHandlerContext } from './route_handler_context';
import { SavedObjectsFindResponse, SavedObjectsUpdateResponse } from '@kbn/core/server';

View file

@ -10,13 +10,12 @@ import { SavedObjectsFindResult } from '@kbn/core/server';
import moment from 'moment';
import { EMPTY } from 'rxjs';
import { catchError, concatMap } from 'rxjs/operators';
import { nodeBuilder, KueryNode } from '@kbn/es-query';
import {
nodeBuilder,
ENHANCED_ES_SEARCH_STRATEGY,
SEARCH_SESSION_TYPE,
SearchSessionSavedObjectAttributes,
SearchSessionStatus,
KueryNode,
} from '../../../common';
import { checkSearchSessionsByPage, getSearchSessionsPage$ } from './get_search_session_page';
import { CheckSearchSessionsDeps, SearchStatus } from './types';

View file

@ -8,7 +8,8 @@
import { EMPTY, Observable } from 'rxjs';
import { catchError, concatMap } from 'rxjs/operators';
import { nodeBuilder, SEARCH_SESSION_TYPE, SearchSessionStatus, KueryNode } from '../../../common';
import { nodeBuilder, KueryNode } from '@kbn/es-query';
import { SEARCH_SESSION_TYPE, SearchSessionStatus } from '../../../common';
import { checkSearchSessionsByPage, getSearchSessionsPage$ } from './get_search_session_page';
import { CheckSearchSessionsDeps, SearchSessionsResponse } from './types';
import { bulkUpdateSessions, getAllSessionsStatusUpdates } from './update_session_status';

View file

@ -8,7 +8,8 @@
import { EMPTY, Observable } from 'rxjs';
import { catchError, concatMap } from 'rxjs/operators';
import { nodeBuilder, SEARCH_SESSION_TYPE, SearchSessionStatus, KueryNode } from '../../../common';
import { nodeBuilder, KueryNode } from '@kbn/es-query';
import { SEARCH_SESSION_TYPE, SearchSessionStatus } from '../../../common';
import { checkSearchSessionsByPage, getSearchSessionsPage$ } from './get_search_session_page';
import { CheckSearchSessionsDeps, SearchSessionsResponse } from './types';
import { bulkUpdateSessions, getAllSessionsStatusUpdates } from './update_session_status';

View file

@ -9,11 +9,8 @@
import { SavedObjectsClientContract, Logger } from '@kbn/core/server';
import { from, Observable, EMPTY } from 'rxjs';
import { concatMap } from 'rxjs/operators';
import {
SearchSessionSavedObjectAttributes,
SEARCH_SESSION_TYPE,
KueryNode,
} from '../../../common';
import type { KueryNode } from '@kbn/es-query';
import { SearchSessionSavedObjectAttributes, SEARCH_SESSION_TYPE } from '../../../common';
import { CheckSearchSessionsDeps, CheckSearchSessionsFn } from './types';
import { SearchSessionsConfigSchema } from '../../../config';

View file

@ -12,6 +12,7 @@ import {
SavedObjectsErrorHelpers,
} from '@kbn/core/server';
import { savedObjectsClientMock } from '@kbn/core/server/mocks';
import { nodeBuilder } from '@kbn/es-query';
import { SearchSessionService } from './session_service';
import { createRequestHash } from './utils';
import moment from 'moment';
@ -19,7 +20,7 @@ import { coreMock } from '@kbn/core/server/mocks';
import { ConfigSchema } from '../../../config';
import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks';
import type { AuthenticatedUser } from '@kbn/security-plugin/common/model';
import { nodeBuilder, SEARCH_SESSION_TYPE, SearchSessionStatus } from '../../../common';
import { SEARCH_SESSION_TYPE, SearchSessionStatus } from '../../../common';
import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server';
const MAX_UPDATE_RETRIES = 3;

View file

@ -22,7 +22,8 @@ import type {
TaskManagerSetupContract,
TaskManagerStartContract,
} from '@kbn/task-manager-plugin/server';
import { KueryNode, SearchSessionSavedObjectAttributes } from '../../../common';
import { KueryNode } from '@kbn/es-query';
import { SearchSessionSavedObjectAttributes } from '../../../common';
import { IKibanaSearchRequest, ISearchOptions } from '../../../common/search';
import { SearchSessionsConfigSchema, ConfigSchema } from '../../../config';

View file

@ -10,9 +10,10 @@ import moment from 'moment';
import { get, last } from 'lodash';
import type { DataView } from '@kbn/data-views-plugin/public';
import { SortDirection } from '@kbn/data-plugin/public';
import { Query } from '@kbn/es-query';
import { createContextSearchSourceStub } from './_stubs';
import { fetchSurroundingDocs, SurrDocType } from './context';
import { DataPublicPluginStart, Query } from '@kbn/data-plugin/public';
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { EsHitRecord, EsHitRecordList } from '../../types';
const MS_PER_DAY = 24 * 60 * 60 * 1000;

View file

@ -11,7 +11,8 @@ import { get, last } from 'lodash';
import { SortDirection } from '@kbn/data-plugin/public';
import type { DataView } from '@kbn/data-views-plugin/public';
import { createContextSearchSourceStub } from './_stubs';
import { DataPublicPluginStart, Query } from '@kbn/data-plugin/public';
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { Query } from '@kbn/es-query';
import { fetchSurroundingDocs, SurrDocType } from './context';
import { EsHitRecord, EsHitRecordList } from '../../types';

View file

@ -7,9 +7,8 @@
*/
import React, { useEffect, useMemo, useRef, useState } from 'react';
import type { Filter } from '@kbn/es-query';
import type { Filter, Query } from '@kbn/es-query';
import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics';
import type { Query } from '@kbn/data-plugin/public';
import type { DataViewField, DataView } from '@kbn/data-views-plugin/public';
import {
EmbeddableInput,

View file

@ -6,7 +6,8 @@
* Side Public License, v 1.
*/
import type { Query, TimeRange, SavedObject } from '@kbn/data-plugin/public';
import type { Query, TimeRange } from '@kbn/es-query';
import type { SavedObject } from '@kbn/data-plugin/public';
import type { DataView, DataViewAttributes } from '@kbn/data-views-plugin/public';
import { ISearchSource } from '@kbn/data-plugin/public';
import { RequestAdapter } from '@kbn/inspector-plugin';

View file

@ -12,7 +12,8 @@ import { indexPatternMock } from '../../../../__mocks__/index_pattern';
import { savedSearchMock } from '../../../../__mocks__/saved_search';
import { DiscoverTopNav, DiscoverTopNavProps } from './discover_topnav';
import { TopNavMenuData } from '@kbn/navigation-plugin/public';
import { ISearchSource, Query } from '@kbn/data-plugin/public';
import { ISearchSource } from '@kbn/data-plugin/public';
import { Query } from '@kbn/es-query';
import { GetStateReturn } from '../../services/discover_state';
import { setHeaderActionMenuMounter } from '../../../../kibana_services';
import { discoverServiceMock } from '../../../../__mocks__/services';

View file

@ -7,7 +7,7 @@
*/
import React, { useCallback, useMemo, useRef, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import { Query, TimeRange } from '@kbn/data-plugin/public';
import type { Query, TimeRange } from '@kbn/es-query';
import { DataViewType } from '@kbn/data-views-plugin/public';
import { useDiscoverServices } from '../../../../hooks/use_discover_services';
import { DiscoverLayoutProps } from '../layout/types';

View file

@ -10,7 +10,13 @@ import { isEqual, cloneDeep } from 'lodash';
import { i18n } from '@kbn/i18n';
import { History } from 'history';
import { NotificationsStart, IUiSettingsClient } from '@kbn/core/public';
import { Filter, FilterStateStore, compareFilters, COMPARE_ALL_OPTIONS } from '@kbn/es-query';
import {
Filter,
FilterStateStore,
compareFilters,
COMPARE_ALL_OPTIONS,
Query,
} from '@kbn/es-query';
import {
createKbnUrlStateStorage,
createStateContainer,
@ -24,7 +30,6 @@ import {
connectToQueryState,
DataPublicPluginStart,
FilterManager,
Query,
SearchSessionInfoProvider,
syncQueryStateWithUrl,
} from '@kbn/data-plugin/public';

View file

@ -12,7 +12,7 @@ import { sha256 } from 'js-sha256';
import type { Rule } from '@kbn/alerting-plugin/common';
import { getTime } from '@kbn/data-plugin/common';
import type { DataView } from '@kbn/data-views-plugin/public';
import type { Filter } from '@kbn/data-plugin/public';
import type { Filter } from '@kbn/es-query';
import { DiscoverAppLocatorParams } from '../../locator';
import { useDiscoverServices } from '../../hooks/use_discover_services';
import { getAlertUtils, QueryParams, SearchThresholdAlertParams } from './view_alert_utils';

View file

@ -7,7 +7,13 @@
*/
import { lastValueFrom, Subscription } from 'rxjs';
import { onlyDisabledFiltersChanged, Filter } from '@kbn/es-query';
import {
onlyDisabledFiltersChanged,
Filter,
Query,
TimeRange,
FilterStateStore,
} from '@kbn/es-query';
import React from 'react';
import ReactDOM from 'react-dom';
import { i18n } from '@kbn/i18n';
@ -17,7 +23,7 @@ import type { KibanaExecutionContext } from '@kbn/core/public';
import { Container, Embeddable } from '@kbn/embeddable-plugin/public';
import { Adapters, RequestAdapter } from '@kbn/inspector-plugin/common';
import { APPLY_FILTER_TRIGGER, FilterManager, generateFilters } from '@kbn/data-plugin/public';
import { ISearchSource, Query, TimeRange, FilterStateStore } from '@kbn/data-plugin/public';
import { ISearchSource } from '@kbn/data-plugin/public';
import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';

View file

@ -14,7 +14,7 @@ import {
ErrorEmbeddable,
} from '@kbn/embeddable-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { SearchInput, SearchOutput } from './types';
import { SEARCH_EMBEDDABLE_TYPE } from './constants';

View file

@ -12,9 +12,8 @@ import {
EmbeddableOutput,
IEmbeddable,
} from '@kbn/embeddable-plugin/public';
import type { Filter } from '@kbn/es-query';
import type { Filter, TimeRange, Query } from '@kbn/es-query';
import { DataView } from '@kbn/data-views-plugin/public';
import type { TimeRange, Query } from '@kbn/data-plugin/public';
import { SavedSearch } from '../services/saved_searches';
import { SortOrder } from '../components/doc_table/components/table_header/helpers';

View file

@ -8,7 +8,7 @@
import { hashedItemStore, getStatesFromKbnUrl } from '@kbn/kibana-utils-plugin/public';
import { mockStorage } from '@kbn/kibana-utils-plugin/public/storage/hashed_item_store/mock';
import { FilterStateStore } from '@kbn/data-plugin/public';
import { FilterStateStore } from '@kbn/es-query';
import { DiscoverAppLocatorDefinition } from './locator';
import { SerializableRecord } from '@kbn/utility-types';

View file

@ -7,13 +7,8 @@
*/
import type { SerializableRecord } from '@kbn/utility-types';
import type { Filter } from '@kbn/es-query';
import type {
TimeRange,
Query,
GlobalQueryStateFromUrl,
RefreshInterval,
} from '@kbn/data-plugin/public';
import type { Filter, TimeRange, Query } from '@kbn/es-query';
import type { GlobalQueryStateFromUrl, RefreshInterval } from '@kbn/data-plugin/public';
import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public';
import { setStateToKbnUrl } from '@kbn/kibana-utils-plugin/public';
import type { VIEW_MODE } from './components/view_mode_toggle';

View file

@ -7,7 +7,7 @@
*/
import { has } from 'lodash';
import { Query } from '@kbn/data-plugin/public';
import type { Query } from '@kbn/es-query';
/**
* Creates a standardized query object from old queries that were either strings or pure ES query DSL

View file

@ -7,7 +7,7 @@
*/
import { Embeddable, IContainer, ContainerInput } from '@kbn/embeddable-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { TimeRangeInput } from './custom_time_range_action';
interface ContainerTimeRangeInput extends ContainerInput<TimeRangeInput> {

View file

@ -14,8 +14,8 @@ import {
EmbeddableInput,
EmbeddableOutput,
} from '@kbn/embeddable-plugin/public';
import { TimeRange } from '@kbn/es-query';
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import { OpenModal, CommonlyUsedRange } from './types';
export const CUSTOM_TIME_RANGE = 'CUSTOM_TIME_RANGE';

View file

@ -11,7 +11,7 @@ import { renderToString } from 'react-dom/server';
import { PrettyDuration } from '@elastic/eui';
import { IEmbeddable, Embeddable, EmbeddableInput } from '@kbn/embeddable-plugin/public';
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { doesInheritTimeRange } from './does_inherit_time_range';
import { OpenModal, CommonlyUsedRange } from './types';

View file

@ -21,8 +21,8 @@ import {
EuiFlexItem,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import type { TimeRange } from '@kbn/es-query';
import { Embeddable, IContainer, ContainerInput } from '@kbn/embeddable-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import { TimeRangeInput } from './custom_time_range_action';
import { doesInheritTimeRange } from './does_inherit_time_range';
import { CommonlyUsedRange } from './types';

View file

@ -12,7 +12,7 @@ import {
ContainerOutput,
EmbeddableStart,
} from '@kbn/embeddable-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
/**
* interfaces are not allowed to specify a sub-set of the required types until

View file

@ -12,7 +12,7 @@ import {
EmbeddableInput,
IContainer,
} from '@kbn/embeddable-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
interface EmbeddableTimeRangeInput extends EmbeddableInput {
timeRange: TimeRange;

View file

@ -11,7 +11,7 @@ import {
IContainer,
EmbeddableFactoryDefinition,
} from '@kbn/embeddable-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { TIME_RANGE_EMBEDDABLE, TimeRangeEmbeddable } from './time_range_embeddable';
interface EmbeddableTimeRangeInput extends EmbeddableInput {

View file

@ -11,7 +11,7 @@ import classNames from 'classnames';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import deepEqual from 'fast-deep-equal';
import useObservable from 'react-use/lib/useObservable';
import type { Filter, TimeRange } from '@kbn/es-query';
import type { Filter, TimeRange, Query } from '@kbn/es-query';
import { EMPTY } from 'rxjs';
import { map } from 'rxjs/operators';
import {
@ -25,12 +25,7 @@ import {
useIsWithinBreakpoints,
EuiSuperUpdateButton,
} from '@elastic/eui';
import {
IDataPluginServices,
TimeHistoryContract,
Query,
getQueryLog,
} from '@kbn/data-plugin/public';
import { IDataPluginServices, TimeHistoryContract, getQueryLog } from '@kbn/data-plugin/public';
import { i18n } from '@kbn/i18n';
import { DataView } from '@kbn/data-views-plugin/public';
import type { PersistedLog } from '@kbn/data-plugin/public';

View file

@ -29,7 +29,8 @@ import {
import { FormattedMessage } from '@kbn/i18n-react';
import { compact, debounce, isEmpty, isEqual, isFunction } from 'lodash';
import { Toast } from '@kbn/core/public';
import { IDataPluginServices, Query, getQueryLog } from '@kbn/data-plugin/public';
import type { Query } from '@kbn/es-query';
import { IDataPluginServices, getQueryLog } from '@kbn/data-plugin/public';
import { DataView } from '@kbn/data-views-plugin/public';
import type { PersistedLog } from '@kbn/data-plugin/public';
import { getFieldSubtypeNested, KIBANA_USER_QUERY_LANGUAGE_KEY } from '@kbn/data-plugin/common';

View file

@ -12,7 +12,7 @@ import { CoreStart } from '@kbn/core/public';
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { QueryStart, SavedQuery, DataPublicPluginStart } from '@kbn/data-plugin/public';
import { Query } from '@kbn/data-plugin/common';
import type { Query } from '@kbn/es-query';
import type { Filter, TimeRange } from '@kbn/es-query';
import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
import { SearchBar } from '.';

View file

@ -10,7 +10,7 @@ import { populateStateFromSavedQuery } from './populate_state_from_saved_query';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
import { DataPublicPluginStart, SavedQuery } from '@kbn/data-plugin/public';
import { getFilter } from '../../test_helpers/get_stub_filter';
import { FilterStateStore } from '@kbn/data-plugin/common';
import { FilterStateStore } from '@kbn/es-query';
describe('populateStateFromSavedQuery', () => {
let dataMock: jest.Mocked<DataPublicPluginStart>;

View file

@ -8,7 +8,7 @@
import { useState, useEffect, useMemo } from 'react';
import { Subscription } from 'rxjs';
import { Query } from '@kbn/data-plugin/public';
import type { Query } from '@kbn/es-query';
import type { QueryStringContract } from '@kbn/data-plugin/public';
interface UseQueryStringProps {

View file

@ -6,8 +6,7 @@
* Side Public License, v 1.
*/
import { FilterStateStore } from '@kbn/data-plugin/public';
import type { Filter } from '@kbn/es-query';
import { type Filter, FilterStateStore } from '@kbn/es-query';
export function getFilter(
store: FilterStateStore,

View file

@ -16,7 +16,8 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { IAggConfig, TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { IAggConfig } from '@kbn/data-plugin/public';
import { DefaultEditorAggParams } from './agg_params';
import { DefaultEditorAggCommonProps } from './agg_common_props';
import { AGGS_ACTION_KEYS, AggsAction } from './agg_group_state';

View file

@ -19,7 +19,8 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { AggGroupNames, AggGroupLabels, IAggConfig, TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { AggGroupNames, AggGroupLabels, IAggConfig } from '@kbn/data-plugin/public';
import type { Schema } from '@kbn/visualizations-plugin/public';
import { DefaultEditorAgg } from './agg';
import { DefaultEditorAggAdd } from './agg_add';

View file

@ -10,7 +10,8 @@ import React, { useState } from 'react';
import { EuiForm, EuiButtonIcon, EuiFieldText, EuiFormRow, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { IAggConfig, Query, DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { Query } from '@kbn/es-query';
import { IAggConfig, DataPublicPluginStart } from '@kbn/data-plugin/public';
import { QueryStringInput } from '@kbn/unified-search-plugin/public';
import { useKibana } from '@kbn/kibana-react-plugin/public';

View file

@ -12,7 +12,8 @@ import { htmlIdGenerator, EuiButton, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import useMount from 'react-use/lib/useMount';
import { Query, DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { Query } from '@kbn/es-query';
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { IUiSettingsClient } from '@kbn/core/public';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { FilterRow } from './filter';

View file

@ -10,13 +10,8 @@ import React, { useMemo, useCallback } from 'react';
import { findLast } from 'lodash';
import { EuiSpacer } from '@elastic/eui';
import {
AggGroupNames,
IAggConfig,
IMetricAggType,
search,
TimeRange,
} from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { AggGroupNames, IAggConfig, IMetricAggType, search } from '@kbn/data-plugin/public';
import type { ISchemas } from '@kbn/visualizations-plugin/public';
import { DefaultEditorAggGroup } from '../agg_group';
import {

View file

@ -25,7 +25,7 @@ import {
VisualizeEmbeddableContract,
} from '@kbn/visualizations-plugin/public';
import type { Schema } from '@kbn/visualizations-plugin/public';
import { TimeRange } from '@kbn/data-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { SavedSearch } from '@kbn/discover-plugin/public';
import { DefaultEditorNavBar } from './navbar';
import { DefaultEditorControls } from './controls';

View file

@ -9,8 +9,8 @@
import { i18n } from '@kbn/i18n';
import type { KibanaExecutionContext } from '@kbn/core/public';
import { DataView } from '@kbn/data-plugin/common';
import { Filter, buildEsQuery } from '@kbn/es-query';
import { KibanaContext, TimeRange, Query, getEsQueryConfig } from '@kbn/data-plugin/public';
import { Filter, buildEsQuery, TimeRange, Query } from '@kbn/es-query';
import { KibanaContext, getEsQueryConfig } from '@kbn/data-plugin/public';
import { TimelionVisDependencies } from '../plugin';
import { getTimezone } from './get_timezone';
import { TimelionVisParams } from '../timelion_vis_fn';

View file

@ -8,9 +8,9 @@
import { get } from 'lodash';
import { i18n } from '@kbn/i18n';
import { Filter } from '@kbn/es-query';
import { Filter, Query, TimeRange } from '@kbn/es-query';
import { ExpressionFunctionDefinition, Render } from '@kbn/expressions-plugin/public';
import { KibanaContext, Query, TimeRange } from '@kbn/data-plugin/public';
import { KibanaContext } from '@kbn/data-plugin/public';
import { TimelionSuccessResponse } from './helpers/timelion_request_handler';
import { TIMELION_VIS_NAME } from './timelion_vis_type';
import { TimelionVisDependencies } from './plugin';

View file

@ -21,7 +21,8 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { KBN_FIELD_TYPES, Query } from '@kbn/data-plugin/public';
import type { Query } from '@kbn/es-query';
import { KBN_FIELD_TYPES } from '@kbn/data-plugin/public';
import { getDataViewsStart } from '../../services';
import { AddDeleteButtons } from './add_delete_buttons';

View file

@ -7,7 +7,7 @@
*/
import { DataView } from '@kbn/data-views-plugin/public';
import { DatatableRow, DatatableColumn, DatatableColumnType } from '@kbn/expressions-plugin/public';
import { Query } from '@kbn/data-plugin/common';
import type { Query } from '@kbn/es-query';
import { BUCKET_TYPES as DATA_PLUGIN_BUCKET_TYPES, MultiFieldKey } from '@kbn/data-plugin/common';
import { TimeseriesVisParams } from '../../../types';
import type { PanelData, Metric } from '../../../../common/types';

Some files were not shown because too many files have changed in this diff Show more