kibana/packages/kbn-es-query/index.ts
Drew Tate 665093b3fb
[8.12] [Lens] unify expression search context type (#172738) (#173671)
# Backport

This will backport the following commits from `main` to `8.12`:
- [[Lens] unify expression search context type
(#172738)](https://github.com/elastic/kibana/pull/172738)

This is a prerequisite to backporting
https://github.com/elastic/kibana/pull/172710

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2023-12-11T14:08:00Z","message":"[Lens]
unify expression search context type (#172738)\n\n##
Summary\r\n\r\nWhile working on
https://github.com/elastic/kibana/pull/172710 I noticed\r\nhow loose our
search context types were. This leeway seems like overkill\r\ngiven how
we actually use the expressions
framework.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"570937ff19c500d0d54b605b0602b6ffb2a6fb10","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:ExpressionLanguage","Team:Visualizations","release_note:skip","backport:skip","v8.13.0"],"number":172738,"url":"https://github.com/elastic/kibana/pull/172738","mergeCommit":{"message":"[Lens]
unify expression search context type (#172738)\n\n##
Summary\r\n\r\nWhile working on
https://github.com/elastic/kibana/pull/172710 I noticed\r\nhow loose our
search context types were. This leeway seems like overkill\r\ngiven how
we actually use the expressions
framework.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"570937ff19c500d0d54b605b0602b6ffb2a6fb10"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172738","number":172738,"mergeCommit":{"message":"[Lens]
unify expression search context type (#172738)\n\n##
Summary\r\n\r\nWhile working on
https://github.com/elastic/kibana/pull/172710 I noticed\r\nhow loose our
search context types were. This leeway seems like overkill\r\ngiven how
we actually use the expressions
framework.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"570937ff19c500d0d54b605b0602b6ffb2a6fb10"}}]}]
BACKPORT-->

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-12-19 18:39:16 -07:00

132 lines
2.7 KiB
TypeScript

/*
* 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.
*/
export type {
BoolQuery,
DataViewBase,
DataViewFieldBase,
EsQueryConfig,
EsQueryFiltersConfig,
IFieldSubType,
IFieldSubTypeMulti,
IFieldSubTypeNested,
} from './src/es_query';
export type {
CustomFilter,
ExistsFilter,
FieldFilter,
Filter,
FilterCompareOptions,
FilterMeta,
LatLon,
MatchAllFilter,
PhraseFilter,
PhrasesFilter,
Query,
AggregateQuery,
QueryStringFilter,
RangeFilter,
RangeFilterMeta,
RangeFilterParams,
ScriptedPhraseFilter,
ScriptedRangeFilter,
TimeRange,
CombinedFilter,
} from './src/filters';
export type { DslQuery, KueryNode, KueryParseOptions, KueryQueryOptions } from './src/kuery';
export {
buildEsQuery,
buildQueryFromFilters,
filterToQueryDsl,
decorateQuery,
luceneStringToDsl,
migrateFilter,
fromCombinedFilter,
isOfQueryType,
isOfAggregateQueryType,
getAggregateQueryMode,
getIndexPatternFromSQLQuery,
getIndexPatternFromESQLQuery,
getLanguageDisplayName,
cleanupESQLQueryForLensSuggestions,
} from './src/es_query';
export {
COMPARE_ALL_OPTIONS,
FILTERS,
FilterStateStore,
buildCustomFilter,
buildEmptyFilter,
buildExistsFilter,
buildFilter,
buildCombinedFilter,
buildPhraseFilter,
buildPhrasesFilter,
buildQueryFilter,
buildRangeFilter,
cleanFilter,
compareFilters,
dedupFilters,
disableFilter,
enableFilter,
getConvertedValueForField,
getFilterField,
getFilterParams,
getPhraseFilterField,
getPhraseFilterValue,
getPhraseScript,
getRangeScript,
isExistsFilter,
isFilter,
isFilterDisabled,
isFilterPinned,
isFilters,
isMatchAllFilter,
isCombinedFilter,
isPhraseFilter,
isPhrasesFilter,
isQueryStringFilter,
isRangeFilter,
isScriptedPhraseFilter,
isScriptedRangeFilter,
onlyDisabledFiltersChanged,
pinFilter,
toggleFilterDisabled,
toggleFilterNegated,
toggleFilterPinned,
uniqFilters,
unpinFilter,
updateFilter,
extractTimeFilter,
extractTimeRange,
convertRangeFilterToTimeRange,
BooleanRelation,
} from './src/filters';
export {
KQLSyntaxError,
fromKueryExpression,
toKqlExpression,
nodeBuilder,
nodeTypes,
toElasticsearchQuery,
escapeKuery,
escapeQuotes,
} from './src/kuery';
export {
getDataViewFieldSubtypeMulti,
getDataViewFieldSubtypeNested,
isDataViewFieldSubtypeMulti,
isDataViewFieldSubtypeNested,
} from './src/utils';
export type { ExecutionContextSearch } from './src/expressions/types';