mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
# Conflicts: # src/plugins/data/common/search/search_source/types.ts
This commit is contained in:
parent
bc5533b022
commit
688001bb95
70 changed files with 96 additions and 127 deletions
|
@ -57,7 +57,7 @@ const result = await executionContract.getData();
|
|||
```
|
||||
|
||||
<DocCallOut>
|
||||
Check the full spec of execute function [here](https://github.com/elastic/kibana/blob/main/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.execution.md)
|
||||
Check the full spec of execute function <DocLink id="kibExpressionsPluginApi" section="def-common.ExpressionsService.execute" text="here" />
|
||||
</DocCallOut>
|
||||
|
||||
In addition, on the browser side, there are two additional ways to run expressions and render the results.
|
||||
|
@ -71,7 +71,7 @@ This is the easiest way to get expressions rendered inside your application.
|
|||
```
|
||||
|
||||
<DocCallOut>
|
||||
Check the full spec of ReactExpressionRenderer component props [here](https://github.com/elastic/kibana/blob/main/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.reactexpressionrendererprops.md)
|
||||
Check the full spec of ReactExpressionRenderer component props <DocLink id="kibExpressionsPluginApi" section="def-public.ReactExpressionRendererProps" text="here" />
|
||||
</DocCallOut>
|
||||
|
||||
#### Expression loader
|
||||
|
@ -83,7 +83,7 @@ const handler = loader(domElement, expression, params);
|
|||
```
|
||||
|
||||
<DocCallOut>
|
||||
Check the full spec of expression loader params [here](https://github.com/elastic/kibana/blob/main/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.iexpressionloaderparams.md)
|
||||
Check the full spec of expression loader params <DocLink id="kibExpressionsPluginApi" section="def-public.IExpressionLoaderParams" text="here" />
|
||||
</DocCallOut>
|
||||
|
||||
### Creating new expression functions
|
||||
|
@ -106,7 +106,7 @@ expressions.registerFunction(functionDefinition);
|
|||
```
|
||||
|
||||
<DocCallOut>
|
||||
Check the full interface of ExpressionFuntionDefinition [here](https://github.com/elastic/kibana/blob/main/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionfunctiondefinition.md)
|
||||
Check the full interface of ExpressionFuntionDefinition <DocLink id="kibExpressionsPluginApi" section="def-common.ExpressionFunctionDefinition" text="here" />
|
||||
</DocCallOut>
|
||||
|
||||
### Creating new expression renderers
|
||||
|
@ -128,5 +128,5 @@ expressions.registerRenderer(rendererDefinition);
|
|||
```
|
||||
|
||||
<DocCallOut>
|
||||
Check the full interface of ExpressionRendererDefinition [here](https://github.com/elastic/kibana/blob/main/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionrenderdefinition.md)
|
||||
Check the full interface of ExpressionRendererDefinition <DocLink id="kibExpressionsPluginApi" section="def-common.ExpressionRenderDefinition" text="here" />
|
||||
</DocCallOut>
|
||||
|
|
|
@ -14,7 +14,6 @@ import * as metrics from './metrics';
|
|||
import { BUCKET_TYPES, CalculateBoundsFn } from './buckets';
|
||||
import { METRIC_TYPES } from './metrics';
|
||||
|
||||
/** @internal */
|
||||
export interface AggTypesDependencies {
|
||||
calculateBounds: CalculateBoundsFn;
|
||||
getConfig: <T = any>(key: string) => T;
|
||||
|
|
|
@ -16,8 +16,6 @@ export type AggTypesRegistrySetup = ReturnType<AggTypesRegistry['setup']>;
|
|||
* real start contract we will need to return the initialized versions.
|
||||
* So we need to provide the correct typings so they can be overwritten
|
||||
* on client/server.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export interface AggTypesRegistryStart {
|
||||
get: (id: string) => BucketAggType<any> | MetricAggType<any>;
|
||||
|
|
|
@ -32,12 +32,10 @@ export const aggsRequiredUiSettings = [
|
|||
UI_SETTINGS.COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX,
|
||||
];
|
||||
|
||||
/** @internal */
|
||||
export interface AggsCommonSetupDependencies {
|
||||
registerFunction: ExpressionsServiceSetup['registerFunction'];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface AggsCommonStartDependencies {
|
||||
getConfig: GetConfigFn;
|
||||
getIndexPattern(id: string): Promise<IndexPattern>;
|
||||
|
|
|
@ -13,7 +13,8 @@ import { AggTypesDependencies } from '../agg_types';
|
|||
import { BaseAggParams } from '../types';
|
||||
|
||||
import { MetricAggType } from './metric_agg_type';
|
||||
import { getResponseAggConfigClass, IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { getResponseAggConfigClass } from './lib/get_response_agg_config_class';
|
||||
import type { IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { aggPercentileRanksFnName } from './percentile_ranks_fn';
|
||||
import { getPercentileValue } from './percentiles_get_value';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { IPercentileAggConfig, getPercentilesMetricAgg } from './percentiles';
|
|||
import { AggConfigs, IAggConfigs } from '../agg_configs';
|
||||
import { mockAggTypesRegistry } from '../test_helpers';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import type { IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
|
||||
describe('AggTypesMetricsPercentilesProvider class', () => {
|
||||
let aggConfigs: IAggConfigs;
|
||||
|
|
|
@ -10,7 +10,8 @@ import { i18n } from '@kbn/i18n';
|
|||
import { MetricAggType } from './metric_agg_type';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { KBN_FIELD_TYPES } from '../../../../common';
|
||||
import { getResponseAggConfigClass, IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { getResponseAggConfigClass } from './lib/get_response_agg_config_class';
|
||||
import type { IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { aggPercentilesFnName } from './percentiles_fn';
|
||||
import { getPercentileValue } from './percentiles_get_value';
|
||||
import { ordinalSuffix } from './lib/ordinal_suffix';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { find } from 'lodash';
|
||||
import { IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import type { IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
|
||||
export const getPercentileValue = <TAggConfig extends IResponseAggConfig>(
|
||||
agg: TAggConfig,
|
||||
|
|
|
@ -11,7 +11,8 @@ import { i18n } from '@kbn/i18n';
|
|||
import { MetricAggType } from './metric_agg_type';
|
||||
import { aggStdDeviationFnName } from './std_deviation_fn';
|
||||
import { METRIC_TYPES } from './metric_agg_types';
|
||||
import { getResponseAggConfigClass, IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { getResponseAggConfigClass } from './lib/get_response_agg_config_class';
|
||||
import type { IResponseAggConfig } from './lib/get_response_agg_config_class';
|
||||
import { KBN_FIELD_TYPES } from '../../../../common';
|
||||
import { BaseAggParams } from '../types';
|
||||
|
||||
|
|
|
@ -98,12 +98,10 @@ export type { IMetricAggType } from './metrics/metric_agg_type';
|
|||
export type { IpRangeKey } from './buckets/lib/ip_range';
|
||||
export type { OptionedValueProp } from './param_types/optioned';
|
||||
|
||||
/** @internal */
|
||||
export interface AggsCommonSetup {
|
||||
types: AggTypesRegistrySetup;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface AggsCommonStart {
|
||||
calculateAutoTimeExpression: ReturnType<typeof getCalculateAutoTimeExpression>;
|
||||
datatableUtilities: {
|
||||
|
@ -127,14 +125,12 @@ export interface AggsCommonStart {
|
|||
*/
|
||||
export type AggsStart = Assign<AggsCommonStart, { types: AggTypesRegistryStart }>;
|
||||
|
||||
/** @internal */
|
||||
export interface BaseAggParams {
|
||||
json?: string;
|
||||
customLabel?: string;
|
||||
timeShift?: string;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface AggExpressionType {
|
||||
type: 'agg_type';
|
||||
value: AggConfigSerialized;
|
||||
|
|
|
@ -14,7 +14,7 @@ import type { IAggConfigs } from '../../aggs';
|
|||
import type { ISearchSource } from '../../search_source';
|
||||
import { searchSourceCommonMock, searchSourceInstanceMock } from '../../search_source/mocks';
|
||||
|
||||
import { handleRequest, RequestHandlerParams } from './request_handler';
|
||||
import { handleRequest } from './request_handler';
|
||||
|
||||
jest.mock('../../tabify', () => ({
|
||||
tabifyAggResponse: jest.fn(),
|
||||
|
@ -25,7 +25,7 @@ import { of } from 'rxjs';
|
|||
import { toArray } from 'rxjs/operators';
|
||||
|
||||
describe('esaggs expression function - public', () => {
|
||||
let mockParams: MockedKeys<RequestHandlerParams>;
|
||||
let mockParams: MockedKeys<Parameters<typeof handleRequest>[0]>;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
|
|
|
@ -17,8 +17,7 @@ import { IAggConfigs } from '../../aggs';
|
|||
import { ISearchStartSearchSource } from '../../search_source';
|
||||
import { tabifyAggResponse } from '../../tabify';
|
||||
|
||||
/** @internal */
|
||||
export interface RequestHandlerParams {
|
||||
interface RequestHandlerParams {
|
||||
abortSignal?: AbortSignal;
|
||||
aggs: IAggConfigs;
|
||||
filters?: Filter[];
|
||||
|
|
|
@ -34,8 +34,7 @@ export type EsdslExpressionFunctionDefinition = ExpressionFunctionDefinition<
|
|||
Output
|
||||
>;
|
||||
|
||||
/** @internal */
|
||||
export interface EsdslStartDependencies {
|
||||
interface EsdslStartDependencies {
|
||||
search: ISearchGeneric;
|
||||
uiSettingsClient: UiSettingsCommon;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import { KibanaTimerangeOutput } from './timerange';
|
|||
import { SavedObjectReference } from '../../../../../core/types';
|
||||
import { SavedObjectsClientCommon } from '../..';
|
||||
|
||||
/** @internal */
|
||||
export interface KibanaContextStartDependencies {
|
||||
savedObjectsClient: SavedObjectsClientCommon;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { UI_SETTINGS } from '../../../constants';
|
||||
import { GetConfigFn } from '../../../types';
|
||||
import { ISearchRequestParams } from '../../index';
|
||||
import { SearchRequest } from './types';
|
||||
import type { SearchRequest } from './types';
|
||||
|
||||
const sessionId = Date.now();
|
||||
|
||||
|
|
|
@ -89,7 +89,8 @@ import type {
|
|||
SearchSourceFields,
|
||||
SearchSourceOptions,
|
||||
} from './types';
|
||||
import { FetchHandlers, getSearchParamsFromRequest, RequestFailure, SearchRequest } from './fetch';
|
||||
import { getSearchParamsFromRequest, RequestFailure } from './fetch';
|
||||
import type { FetchHandlers, SearchRequest } from './fetch';
|
||||
import { getRequestInspectorStats, getResponseInspectorStats } from './inspect';
|
||||
|
||||
import {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { IAggConfigs } from 'src/plugins/data/public';
|
|||
import { Query } from '../..';
|
||||
import { Filter } from '../../es_query';
|
||||
import { IndexPattern } from '../..';
|
||||
import { SearchSource } from './search_source';
|
||||
import type { SearchSource } from './search_source';
|
||||
|
||||
/**
|
||||
* search source interface
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { tabifyGetColumns } from './get_columns';
|
||||
import { TabbedAggColumn } from './types';
|
||||
import type { TabbedAggColumn } from './types';
|
||||
import { AggConfigs } from '../aggs';
|
||||
import { mockAggTypesRegistry } from '../aggs/test_helpers';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { groupBy } from 'lodash';
|
||||
import { IAggConfig } from '../aggs';
|
||||
import { TabbedAggColumn } from './types';
|
||||
import type { TabbedAggColumn } from './types';
|
||||
|
||||
const getColumn = (agg: IAggConfig, i: number): TabbedAggColumn => {
|
||||
let name = '';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { TabbedAggResponseWriter } from './response_writer';
|
||||
import { AggConfigs, BUCKET_TYPES, METRIC_TYPES } from '../aggs';
|
||||
import { mockAggTypesRegistry } from '../aggs/test_helpers';
|
||||
import { TabbedResponseWriterOptions } from './types';
|
||||
import type { TabbedResponseWriterOptions } from './types';
|
||||
|
||||
describe('TabbedAggResponseWriter class', () => {
|
||||
let responseWriter: TabbedAggResponseWriter;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { get } from 'lodash';
|
||||
import { TabbedAggResponseWriter } from './response_writer';
|
||||
import { TabifyBuckets } from './buckets';
|
||||
import { TabbedResponseWriterOptions } from './types';
|
||||
import type { TabbedResponseWriterOptions } from './types';
|
||||
import { AggResponseBucket } from './types';
|
||||
import { AggGroupNames, IAggConfigs } from '../aggs';
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ function isValidMetaFieldName(field: string): field is ValidMetaFieldNames {
|
|||
return (VALID_META_FIELD_NAMES as string[]).includes(field);
|
||||
}
|
||||
|
||||
export interface TabifyDocsOptions {
|
||||
interface TabifyDocsOptions {
|
||||
shallow?: boolean;
|
||||
/**
|
||||
* If set to `false` the _source of the document, if requested, won't be
|
||||
|
|
|
@ -22,7 +22,6 @@ export interface TimeRangeInformation {
|
|||
timeFields: string[];
|
||||
}
|
||||
|
||||
/** @internal **/
|
||||
export interface TabbedResponseWriterOptions {
|
||||
metricsAtAllLevels: boolean;
|
||||
partialRows: boolean;
|
||||
|
|
|
@ -13,8 +13,7 @@ import { esFilters, IFieldType, RangeFilterParams } from '../../../public';
|
|||
import { getIndexPatterns, getSearchService } from '../../../public/services';
|
||||
import { AggConfigSerialized } from '../../../common/search/aggs';
|
||||
|
||||
/** @internal */
|
||||
export interface RangeSelectDataContext {
|
||||
interface RangeSelectDataContext {
|
||||
table: Datatable;
|
||||
column: number;
|
||||
range: number[];
|
||||
|
|
|
@ -9,10 +9,7 @@
|
|||
import { IndexPatternsContract } from '../../../public';
|
||||
import { dataPluginMock } from '../../../public/mocks';
|
||||
import { setIndexPatterns, setSearchService } from '../../../public/services';
|
||||
import {
|
||||
createFiltersFromValueClickAction,
|
||||
ValueClickDataContext,
|
||||
} from './create_filters_from_value_click';
|
||||
import { createFiltersFromValueClickAction } from './create_filters_from_value_click';
|
||||
import { FieldFormatsGetConfigFn, BytesFormat } from '../../../../field_formats/common';
|
||||
import { RangeFilter } from '@kbn/es-query';
|
||||
|
||||
|
@ -22,7 +19,7 @@ const mockField = {
|
|||
};
|
||||
|
||||
describe('createFiltersFromValueClick', () => {
|
||||
let dataPoints: ValueClickDataContext['data'];
|
||||
let dataPoints: Parameters<typeof createFiltersFromValueClickAction>[0]['data'];
|
||||
|
||||
beforeEach(() => {
|
||||
dataPoints = [
|
||||
|
|
|
@ -12,8 +12,7 @@ import { esFilters, Filter } from '../../../public';
|
|||
import { getIndexPatterns, getSearchService } from '../../../public/services';
|
||||
import { AggConfigSerialized } from '../../../common/search/aggs';
|
||||
|
||||
/** @internal */
|
||||
export interface ValueClickDataContext {
|
||||
interface ValueClickDataContext {
|
||||
data: Array<{
|
||||
table: Pick<Datatable, 'rows' | 'columns'>;
|
||||
column: number;
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
import { CoreSetup, PluginInitializerContext } from 'src/core/public';
|
||||
import moment from 'moment';
|
||||
import { TimefilterSetup } from '../query';
|
||||
import type { TimefilterSetup } from '../query';
|
||||
import { QuerySuggestionGetFn } from './providers/query_suggestion_provider';
|
||||
import {
|
||||
getEmptyValueSuggestions,
|
||||
setupValueSuggestionProvider,
|
||||
ValueSuggestionsGetFn,
|
||||
} from './providers/value_suggestion_provider';
|
||||
import type { ValueSuggestionsGetFn } from './providers/value_suggestion_provider';
|
||||
|
||||
import { ConfigSchema } from '../../config';
|
||||
import { UsageCollectionSetup } from '../../../usage_collection/public';
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
*/
|
||||
|
||||
import { stubIndexPattern, stubFields } from '../../stubs';
|
||||
import { TimefilterSetup } from '../../query';
|
||||
import { setupValueSuggestionProvider, ValueSuggestionsGetFn } from './value_suggestion_provider';
|
||||
import type { TimefilterSetup } from '../../query';
|
||||
import { setupValueSuggestionProvider } from './value_suggestion_provider';
|
||||
import type { ValueSuggestionsGetFn } from './value_suggestion_provider';
|
||||
import { IUiSettingsClient, CoreSetup } from 'kibana/public';
|
||||
import { UI_SETTINGS } from '../../../common';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { buildQueryFromFilters } from '@kbn/es-query';
|
|||
import { memoize } from 'lodash';
|
||||
import { CoreSetup } from 'src/core/public';
|
||||
import { IIndexPattern, IFieldType, UI_SETTINGS, ValueSuggestionsMethod } from '../../../common';
|
||||
import { TimefilterSetup } from '../../query';
|
||||
import type { TimefilterSetup } from '../../query';
|
||||
import { AutocompleteUsageCollector } from '../collectors';
|
||||
|
||||
export type ValueSuggestionsGetFn = (args: ValueSuggestionsGetFnArgs) => Promise<any[]>;
|
||||
|
|
|
@ -11,7 +11,7 @@ import './index.scss';
|
|||
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public';
|
||||
import { ConfigSchema } from '../config';
|
||||
import { Storage, IStorageWrapper, createStartServicesGetter } from '../../kibana_utils/public';
|
||||
import {
|
||||
import type {
|
||||
DataPublicPluginSetup,
|
||||
DataPublicPluginStart,
|
||||
DataSetupDependencies,
|
||||
|
|
|
@ -14,7 +14,6 @@ import { IUiSettingsClient } from 'src/core/public';
|
|||
import { isFilterPinned, onlyDisabledFiltersChanged, Filter } from '@kbn/es-query';
|
||||
import { sortFilters } from './lib/sort_filters';
|
||||
import { mapAndFlattenFilters } from './lib/map_and_flatten_filters';
|
||||
import { PartitionedFilters } from './types';
|
||||
|
||||
import {
|
||||
FilterStateStore,
|
||||
|
@ -31,6 +30,11 @@ import {
|
|||
telemetry,
|
||||
} from '../../../common/query/persistable_state';
|
||||
|
||||
interface PartitionedFilters {
|
||||
globalFilters: Filter[];
|
||||
appFilters: Filter[];
|
||||
}
|
||||
|
||||
export class FilterManager implements PersistableStateService<Filter[]> {
|
||||
private filters: Filter[] = [];
|
||||
private updated$: Subject<void> = new Subject();
|
||||
|
|
|
@ -1,14 +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 { Filter } from '../../../common';
|
||||
|
||||
export interface PartitionedFilters {
|
||||
globalFilters: Filter[];
|
||||
appFilters: Filter[];
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export type QueryLanguage = 'kuery' | 'lucene';
|
||||
type QueryLanguage = 'kuery' | 'lucene';
|
||||
|
||||
export function getDefaultQuery(language: QueryLanguage = 'kuery') {
|
||||
return {
|
||||
|
|
|
@ -12,10 +12,12 @@ import { IStorageWrapper } from 'src/plugins/kibana_utils/public';
|
|||
import { buildEsQuery } from '@kbn/es-query';
|
||||
import { FilterManager } from './filter_manager';
|
||||
import { createAddToQueryLog } from './lib';
|
||||
import { TimefilterService, TimefilterSetup } from './timefilter';
|
||||
import { TimefilterService } from './timefilter';
|
||||
import type { TimefilterSetup } from './timefilter';
|
||||
import { createSavedQueryService } from './saved_query/saved_query_service';
|
||||
import { createQueryStateObservable } from './state_sync/create_global_query_observable';
|
||||
import { QueryStringContract, QueryStringManager } from './query_string';
|
||||
import type { QueryStringContract } from './query_string';
|
||||
import { QueryStringManager } from './query_string';
|
||||
import { getEsQueryConfig, TimeRange } from '../../common';
|
||||
import { getUiSettings } from '../services';
|
||||
import { NowProviderInternalContract } from '../now_provider';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { QueryStringContract } from '.';
|
||||
import type { QueryStringContract } from '.';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
const createSetupContractMock = () => {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { createSavedQueryService } from './saved_query_service';
|
||||
import { httpServiceMock } from '../../../../../core/public/mocks';
|
||||
import { SavedQueryAttributes } from '../../../common';
|
||||
import type { SavedQueryAttributes } from '../../../common';
|
||||
|
||||
const http = httpServiceMock.createStartContract();
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { HttpStart } from 'src/core/public';
|
||||
import { SavedQuery } from './types';
|
||||
import { SavedQueryAttributes } from '../../../common';
|
||||
import type { SavedQueryAttributes } from '../../../common';
|
||||
|
||||
export const createSavedQueryService = (http: HttpStart) => {
|
||||
const createQuery = async (attributes: SavedQueryAttributes, { overwrite = false } = {}) => {
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
import { Observable, Subscription } from 'rxjs';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
import { isFilterPinned } from '@kbn/es-query';
|
||||
import { TimefilterSetup } from '../timefilter';
|
||||
import type { TimefilterSetup } from '../timefilter';
|
||||
import { FilterManager } from '../filter_manager';
|
||||
import { QueryState, QueryStateChange } from './index';
|
||||
import { createStateContainer } from '../../../../kibana_utils/public';
|
||||
import { compareFilters, COMPARE_ALL_OPTIONS } from '../../../common';
|
||||
import { QueryStringContract } from '../query_string';
|
||||
import type { QueryStringContract } from '../query_string';
|
||||
|
||||
export function createQueryStateObservable({
|
||||
timefilter: { timefilter },
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
import { RefreshInterval } from '../../../../common';
|
||||
import { InputTimeRange } from '../types';
|
||||
import type { InputTimeRange } from '../types';
|
||||
|
||||
const valueOf = function (o: any) {
|
||||
if (o) return o.valueOf();
|
||||
|
|
|
@ -11,7 +11,7 @@ import { Subject, BehaviorSubject } from 'rxjs';
|
|||
import moment from 'moment';
|
||||
import { PublicMethodsOf } from '@kbn/utility-types';
|
||||
import { areRefreshIntervalsDifferent, areTimeRangesDifferent } from './lib/diff_time_picker_vals';
|
||||
import { TimefilterConfig, InputTimeRange, TimeRangeBounds } from './types';
|
||||
import type { TimefilterConfig, InputTimeRange, TimeRangeBounds } from './types';
|
||||
import { NowProviderInternalContract } from '../../now_provider';
|
||||
import {
|
||||
calculateBounds,
|
||||
|
|
|
@ -68,9 +68,6 @@ export enum SEARCH_EVENT_TYPE {
|
|||
SESSIONS_LIST_LOADED = 'sessionsListLoaded',
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface SearchUsageCollector {
|
||||
trackQueryTimedOut: () => Promise<void>;
|
||||
trackSessionIndicatorTourLoading: () => Promise<void>;
|
||||
|
|
|
@ -32,7 +32,7 @@ export interface Reason {
|
|||
};
|
||||
}
|
||||
|
||||
export interface IEsErrorAttributes {
|
||||
interface IEsErrorAttributes {
|
||||
type: string;
|
||||
reason: string;
|
||||
root_cause?: Reason[];
|
||||
|
|
|
@ -13,7 +13,7 @@ import { IKibanaSearchResponse } from 'src/plugins/data/common';
|
|||
import { ShardFailureOpenModalButton } from '../../ui/shard_failure_modal';
|
||||
import { toMountPoint } from '../../../../kibana_react/public';
|
||||
import { getNotifications } from '../../services';
|
||||
import { SearchRequest } from '..';
|
||||
import type { SearchRequest } from '..';
|
||||
|
||||
export function handleResponse(request: SearchRequest, response: IKibanaSearchResponse) {
|
||||
const { rawResponse } = response;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { searchAggsSetupMock, searchAggsStartMock } from './aggs/mocks';
|
||||
import { searchSourceMock } from './search_source/mocks';
|
||||
import { ISearchSetup, ISearchStart } from './types';
|
||||
import type { ISearchSetup, ISearchStart } from './types';
|
||||
import { getSessionsClientMock, getSessionServiceMock } from './session/mocks';
|
||||
import { createSearchUsageCollectorMock } from './collectors/mocks';
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
} from 'src/core/public';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { BfetchPublicSetup } from 'src/plugins/bfetch/public';
|
||||
import { ISearchSetup, ISearchStart } from './types';
|
||||
import type { ISearchSetup, ISearchStart } from './types';
|
||||
|
||||
import { handleResponse } from './fetch';
|
||||
import {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { searchSourceCommonMock } from '../../../common/search/search_source/mocks';
|
||||
import { ISearchStart } from '../types';
|
||||
import type { ISearchStart } from '../types';
|
||||
|
||||
function createStartContract(): jest.Mocked<ISearchStart['searchSource']> {
|
||||
return searchSourceCommonMock;
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
import { BehaviorSubject } from 'rxjs';
|
||||
import { ISessionsClient } from './sessions_client';
|
||||
import { ISessionService } from './session_service';
|
||||
import { SearchSessionState, SessionMeta } from './search_session_state';
|
||||
import { SearchSessionState } from './search_session_state';
|
||||
import type { SessionMeta } from './search_session_state';
|
||||
|
||||
export function getSessionsClientMock(): jest.Mocked<ISessionsClient> {
|
||||
return {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import { createSessionStateContainer, SearchSessionState } from './search_session_state';
|
||||
import { SearchSessionSavedObject } from './sessions_client';
|
||||
import type { SearchSessionSavedObject } from './sessions_client';
|
||||
import { SearchSessionStatus } from '../../../common';
|
||||
|
||||
const mockSavedObject: SearchSessionSavedObject = {
|
||||
|
|
|
@ -11,7 +11,7 @@ import deepEqual from 'fast-deep-equal';
|
|||
import { Observable } from 'rxjs';
|
||||
import { distinctUntilChanged, map, shareReplay } from 'rxjs/operators';
|
||||
import { createStateContainer, StateContainer } from '../../../../kibana_utils/public';
|
||||
import { SearchSessionSavedObject } from './sessions_client';
|
||||
import type { SearchSessionSavedObject } from './sessions_client';
|
||||
|
||||
/**
|
||||
* Possible state that current session can be in
|
||||
|
|
|
@ -15,7 +15,7 @@ import { SearchSessionState } from './search_session_state';
|
|||
import { createNowProviderMock } from '../../now_provider/mocks';
|
||||
import { NowProviderInternalContract } from '../../now_provider';
|
||||
import { SEARCH_SESSIONS_MANAGEMENT_ID } from './constants';
|
||||
import { SearchSessionSavedObject, ISessionsClient } from './sessions_client';
|
||||
import type { SearchSessionSavedObject, ISessionsClient } from './sessions_client';
|
||||
import { SearchSessionStatus } from '../../../common';
|
||||
import { CoreStart } from 'kibana/public';
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ import {
|
|||
} from 'kibana/public';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { ConfigSchema } from '../../../config';
|
||||
import {
|
||||
createSessionStateContainer,
|
||||
import { createSessionStateContainer } from './search_session_state';
|
||||
import type {
|
||||
SearchSessionState,
|
||||
SessionMeta,
|
||||
SessionStateContainer,
|
||||
|
@ -31,7 +31,7 @@ import { formatSessionName } from './lib/session_name_formatter';
|
|||
|
||||
export type ISessionService = PublicContract<SessionService>;
|
||||
|
||||
export interface TrackSearchDescriptor {
|
||||
interface TrackSearchDescriptor {
|
||||
abort: () => void;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ export interface SearchSessionInfoProvider<P extends SerializableRecord = Serial
|
|||
/**
|
||||
* Configure a "Search session indicator" UI
|
||||
*/
|
||||
export interface SearchSessionIndicatorUiConfig {
|
||||
interface SearchSessionIndicatorUiConfig {
|
||||
/**
|
||||
* App controls if "Search session indicator" UI should be disabled.
|
||||
* reasonText will appear in a tooltip.
|
||||
|
|
|
@ -16,7 +16,7 @@ import { UiActionsSetup, UiActionsStart } from 'src/plugins/ui_actions/public';
|
|||
import { FieldFormatsSetup, FieldFormatsStart } from 'src/plugins/field_formats/public';
|
||||
import { AutocompleteSetup, AutocompleteStart } from './autocomplete';
|
||||
import { createFiltersFromRangeSelectAction, createFiltersFromValueClickAction } from './actions';
|
||||
import { ISearchSetup, ISearchStart } from './search';
|
||||
import type { ISearchSetup, ISearchStart } from './search';
|
||||
import { QuerySetup, QueryStart } from './query';
|
||||
import { DataViewsContract } from './data_views';
|
||||
import { IndexPatternSelectProps, StatefulSearchBarProps } from './ui';
|
||||
|
|
|
@ -13,7 +13,6 @@ import { existsOperator, isOneOfOperator } from './filter_operators';
|
|||
import { Filter, FILTERS } from '../../../../../common';
|
||||
import type { FilterLabelStatus } from '../../filter_item';
|
||||
|
||||
// @internal
|
||||
export interface FilterLabelProps {
|
||||
filter: Filter;
|
||||
valueLabel?: string;
|
||||
|
|
|
@ -7,21 +7,18 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import type { FilterLabelProps } from './filter_editor/lib/filter_label';
|
||||
|
||||
const Fallback = () => <div />;
|
||||
|
||||
const LazyFilterLabel = React.lazy(() => import('./filter_editor/lib/filter_label'));
|
||||
export const FilterLabel = (props: FilterLabelProps) => (
|
||||
export const FilterLabel = (props: React.ComponentProps<typeof LazyFilterLabel>) => (
|
||||
<React.Suspense fallback={<Fallback />}>
|
||||
<LazyFilterLabel {...props} />
|
||||
</React.Suspense>
|
||||
);
|
||||
|
||||
import type { FilterItemProps } from './filter_item';
|
||||
|
||||
const LazyFilterItem = React.lazy(() => import('./filter_item'));
|
||||
export const FilterItem = (props: FilterItemProps) => (
|
||||
export const FilterItem = (props: React.ComponentProps<typeof LazyFilterItem>) => (
|
||||
<React.Suspense fallback={<Fallback />}>
|
||||
<LazyFilterItem {...props} />
|
||||
</React.Suspense>
|
||||
|
|
|
@ -24,7 +24,8 @@ import { IDataPluginServices, IIndexPattern, TimeRange, TimeHistoryContract, Que
|
|||
import { useKibana, withKibana } from '../../../../kibana_react/public';
|
||||
import QueryStringInputUI from './query_string_input';
|
||||
import { UI_SETTINGS } from '../../../common';
|
||||
import { PersistedLog, getQueryLog } from '../../query';
|
||||
import { getQueryLog } from '../../query';
|
||||
import type { PersistedLog } from '../../query';
|
||||
import { NoDataPopover } from './no_data_popover';
|
||||
import { AutocompleteFtuePopover } from './autocomplete_ftue_popover';
|
||||
|
||||
|
|
|
@ -34,8 +34,9 @@ import { QuerySuggestion, QuerySuggestionTypes } from '../../autocomplete';
|
|||
import { KibanaReactContextValue, toMountPoint } from '../../../../kibana_react/public';
|
||||
import { fetchIndexPatterns } from './fetch_index_patterns';
|
||||
import { QueryLanguageSwitcher } from './language_switcher';
|
||||
import { PersistedLog, getQueryLog, matchPairs, toUser, fromUser } from '../../query';
|
||||
import { SuggestionsListSize } from '../typeahead/suggestions_component';
|
||||
import { getQueryLog, matchPairs, toUser, fromUser } from '../../query';
|
||||
import type { PersistedLog } from '../../query';
|
||||
import type { SuggestionsListSize } from '../typeahead/suggestions_component';
|
||||
import { SuggestionsComponent } from '..';
|
||||
import { KIBANA_USER_QUERY_LANGUAGE_KEY, getFieldSubtypeNested } from '../../../common';
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@ import { CoreStart } from 'src/core/public';
|
|||
import { IStorageWrapper } from 'src/plugins/kibana_utils/public';
|
||||
import { KibanaContextProvider } from '../../../../kibana_react/public';
|
||||
import { QueryStart, SavedQuery } from '../../query';
|
||||
import { SearchBar, SearchBarOwnProps } from './';
|
||||
import { SearchBar } from '.';
|
||||
import type { SearchBarOwnProps } from '.';
|
||||
import { useFilterManager } from './lib/use_filter_manager';
|
||||
import { useTimefilter } from './lib/use_timefilter';
|
||||
import { useSavedQuery } from './lib/use_saved_query';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Query } from '../../..';
|
||||
import { QueryStringContract } from '../../../query/query_string';
|
||||
import type { QueryStringContract } from '../../../query/query_string';
|
||||
|
||||
interface UseQueryStringProps {
|
||||
query?: Query;
|
||||
|
|
|
@ -18,7 +18,7 @@ import { Query, Filter } from '@kbn/es-query';
|
|||
import { withKibana, KibanaReactContextValue } from '../../../../kibana_react/public';
|
||||
|
||||
import QueryBarTopRow from '../query_string_input/query_bar_top_row';
|
||||
import { SavedQueryAttributes, TimeHistoryContract, SavedQuery } from '../../query';
|
||||
import type { SavedQueryAttributes, TimeHistoryContract, SavedQuery } from '../../query';
|
||||
import { IDataPluginServices } from '../../types';
|
||||
import { TimeRange, IIndexPattern } from '../../../common';
|
||||
import { FilterBar } from '../filter_bar/filter_bar';
|
||||
|
|
|
@ -7,12 +7,13 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import type { SuggestionsComponentProps } from './suggestions_component';
|
||||
|
||||
const Fallback = () => <div />;
|
||||
|
||||
const LazySuggestionsComponent = React.lazy(() => import('./suggestions_component'));
|
||||
export const SuggestionsComponent = (props: SuggestionsComponentProps) => (
|
||||
export const SuggestionsComponent = (
|
||||
props: React.ComponentProps<typeof LazySuggestionsComponent>
|
||||
) => (
|
||||
<React.Suspense fallback={<Fallback />}>
|
||||
<LazySuggestionsComponent {...props} />
|
||||
</React.Suspense>
|
||||
|
|
|
@ -19,8 +19,7 @@ import {
|
|||
} from './constants';
|
||||
import { SuggestionOnClick } from './types';
|
||||
|
||||
// @internal
|
||||
export interface SuggestionsComponentProps {
|
||||
interface SuggestionsComponentProps {
|
||||
index: number | null;
|
||||
onClick: SuggestionOnClick;
|
||||
onMouseEnter: (index: number) => void;
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ExpressionsServerSetup } from 'src/plugins/expressions/server';
|
|||
import { BfetchServerSetup } from 'src/plugins/bfetch/server';
|
||||
import { PluginStart as DataViewsServerPluginStart } from 'src/plugins/data_views/server';
|
||||
import { ConfigSchema } from '../config';
|
||||
import { ISearchSetup, ISearchStart, SearchEnhancements } from './search';
|
||||
import type { ISearchSetup, ISearchStart, SearchEnhancements } from './search';
|
||||
import { SearchService } from './search/search_service';
|
||||
import { QueryService } from './query/query_service';
|
||||
import { ScriptsService } from './scripts';
|
||||
|
@ -21,7 +21,7 @@ import { AutocompleteService } from './autocomplete';
|
|||
import { FieldFormatsSetup, FieldFormatsStart } from '../../field_formats/server';
|
||||
import { getUiSettings } from './ui_settings';
|
||||
|
||||
export interface DataEnhancements {
|
||||
interface DataEnhancements {
|
||||
search: SearchEnhancements;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,12 +7,8 @@
|
|||
*/
|
||||
|
||||
import { coreMock } from '../../../../core/server/mocks';
|
||||
import {
|
||||
DATA_VIEW_SAVED_OBJECT_TYPE,
|
||||
FilterStateStore,
|
||||
SavedObject,
|
||||
SavedQueryAttributes,
|
||||
} from '../../common';
|
||||
import { DATA_VIEW_SAVED_OBJECT_TYPE, FilterStateStore } from '../../common';
|
||||
import type { SavedObject, SavedQueryAttributes } from '../../common';
|
||||
import { registerSavedQueryRouteHandlerContext } from './route_handler_context';
|
||||
import { SavedObjectsFindResponse, SavedObjectsUpdateResponse } from 'kibana/server';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { ISearchSetup, ISearchStart } from './types';
|
||||
import type { ISearchSetup, ISearchStart } from './types';
|
||||
import { searchAggsSetupMock, searchAggsStartMock } from './aggs/mocks';
|
||||
import { searchSourceMock } from './search_source/mocks';
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
IKibanaSearchResponse,
|
||||
ISearchOptionsSerializable,
|
||||
} from '../../../common/search';
|
||||
import { ISearchStart } from '../types';
|
||||
import type { ISearchStart } from '../types';
|
||||
|
||||
export function registerBsearchRoute(
|
||||
bfetch: BfetchServerSetup,
|
||||
|
|
|
@ -17,7 +17,7 @@ import { createIndexPatternsStartMock } from '../data_views/mocks';
|
|||
import { SearchService, SearchServiceSetupDependencies } from './search_service';
|
||||
import { bfetchPluginMock } from '../../../bfetch/server/mocks';
|
||||
import { of } from 'rxjs';
|
||||
import {
|
||||
import type {
|
||||
IEsSearchRequest,
|
||||
IEsSearchResponse,
|
||||
IScopedSearchClient,
|
||||
|
@ -25,8 +25,8 @@ import {
|
|||
ISearchSessionService,
|
||||
ISearchStart,
|
||||
ISearchStrategy,
|
||||
NoSearchIdInSessionError,
|
||||
} from '.';
|
||||
import { NoSearchIdInSessionError } from '.';
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { expressionsPluginMock } from '../../../expressions/public/mocks';
|
||||
import { createSearchSessionsClientMock } from './mocks';
|
||||
|
|
|
@ -10,7 +10,7 @@ import type { MockedKeys } from '@kbn/utility-types/jest';
|
|||
import { KibanaRequest } from 'src/core/server';
|
||||
|
||||
import { searchSourceCommonMock } from '../../../common/search/search_source/mocks';
|
||||
import { ISearchStart } from '../types';
|
||||
import type { ISearchStart } from '../types';
|
||||
|
||||
function createStartContract(): MockedKeys<ISearchStart['searchSource']> {
|
||||
return {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import moment from 'moment';
|
||||
import { IScopedSearchSessionsClient } from './types';
|
||||
import type { IScopedSearchSessionsClient } from './types';
|
||||
import { SearchSessionsConfigSchema } from '../../../config';
|
||||
|
||||
export function createSearchSessionsClientMock<T = unknown>(): jest.Mocked<
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { AsyncSearchResponse } from './types';
|
||||
import type { AsyncSearchResponse } from './types';
|
||||
import { getTotalLoaded } from '../es_search';
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,7 +26,7 @@ import {
|
|||
} from '../../common/search';
|
||||
import { AggsSetup, AggsStart } from './aggs';
|
||||
import { SearchUsage } from './collectors';
|
||||
import { IScopedSearchSessionsClient, ISearchSessionService } from './session';
|
||||
import type { IScopedSearchSessionsClient, ISearchSessionService } from './session';
|
||||
|
||||
export interface SearchEnhancements {
|
||||
sessionService: ISearchSessionService;
|
||||
|
@ -123,9 +123,6 @@ export interface ISearchStart<
|
|||
|
||||
export type SearchRequestHandlerContext = IScopedSearchClient;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface DataRequestHandlerContext extends RequestHandlerContext {
|
||||
search: SearchRequestHandlerContext;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue