Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescriptify search source #47644

Merged
merged 88 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
9aa6e48
Initial refactor of search source
lukasolson Sep 10, 2019
039c507
Add abort signal to search source fetch and remove cancel queued
lukasolson Sep 10, 2019
fb1f959
Remove usages of Angular Promises
lukasolson Sep 11, 2019
1a40af4
Remove usages of angular "sessionId" service
lukasolson Sep 11, 2019
6331629
Merge branch 'master' into refactorSearchSource
lukasolson Sep 13, 2019
8aa6496
Remove config as dependency
lukasolson Sep 13, 2019
027f6b6
Update deps on config and esShardTimeout
lukasolson Sep 23, 2019
ae21ec8
Remove remaining angular dependencies from SearchSource
lukasolson Sep 24, 2019
ac12f45
Merge branch 'master' into refactorSearchSource
lukasolson Sep 24, 2019
493f882
Fix Karma tests
lukasolson Sep 24, 2019
68e7529
Separate callClient and handleResponse and add tests for each
lukasolson Sep 25, 2019
dcbcded
Merge branch 'master' into refactorSearchSource
lukasolson Sep 25, 2019
ca27f89
Add tests for fetchSoon
lukasolson Sep 25, 2019
9ff10c4
Add back search source test and convert to jest
lukasolson Sep 25, 2019
fa1ad58
Create search strategy registry test
lukasolson Sep 25, 2019
aa87511
Revert empty test
lukasolson Sep 25, 2019
43305ec
Remove filter predicates from search source
lukasolson Sep 26, 2019
6240738
Merge branch 'master' into refactorSearchSource
lukasolson Sep 30, 2019
df0a353
Update typings and throw response errors
lukasolson Oct 2, 2019
5496403
Fix proxy to properly return response from ES
lukasolson Oct 2, 2019
2c23fe5
Merge branch 'master' into refactorSearchSource
lukasolson Oct 3, 2019
41567df
Update jest snapshots
lukasolson Oct 3, 2019
c1e1ddb
Remove unused translations
lukasolson Oct 3, 2019
b3e8d11
Don't pass search request to onRequestStart, create it afterwards
lukasolson Oct 3, 2019
649e6fa
Fix search source & get search params tests
lukasolson Oct 3, 2019
6fb788c
Merge branch 'master' into refactorSearchSource
lukasolson Oct 3, 2019
7c6b7b8
Merge branch 'master' into refactorSearchSource
lukasolson Oct 4, 2019
1a44042
Merge branch 'master' into refactorSearchSource
lukasolson Oct 7, 2019
cfbed7a
Fix issue with angular scope not firing after setting state on vis
lukasolson Oct 8, 2019
0d7c97d
Fix issue with angular scope not firing after setting state on vis
lukasolson Oct 8, 2019
7879866
Typescriptify courier/search source
lukasolson Oct 8, 2019
cb404a7
Fix references
lukasolson Oct 9, 2019
9b37ded
Fix types
lukasolson Oct 10, 2019
7f4d9de
Fix removal of underscores
lukasolson Oct 10, 2019
d511d6c
Fix fetching
lukasolson Oct 11, 2019
54f0a98
Merge branch 'master' into refactorSearchSource
lukasolson Oct 14, 2019
60122b4
Fix tag cloud vis
lukasolson Oct 14, 2019
eca50a9
Fix setting of visConfig to not happen async
lukasolson Oct 14, 2019
04a423c
Remove unused snapshots
lukasolson Oct 14, 2019
bd6a80b
Merge branch 'refactorSearchSource' into typescriptifySearchSource
lukasolson Oct 14, 2019
e1399bb
Merge branch 'master' into refactorSearchSource
lukasolson Oct 15, 2019
c87db4d
Merge branch 'refactorSearchSource' into typescriptifySearchSource
lukasolson Oct 15, 2019
daa038d
Remove courier and search poller
lukasolson Oct 15, 2019
e29142a
Merge branch 'master' into refactorSearchSource
lukasolson Oct 15, 2019
f8416d7
Merge branch 'refactorSearchSource' into typescriptifySearchSource
lukasolson Oct 15, 2019
2a6d8e3
Merge branch 'master' into refactorSearchSource
lukasolson Oct 16, 2019
302310f
Merge branch 'refactorSearchSource' into typescriptifySearchSource
lukasolson Oct 16, 2019
b4f04a4
Update types
lukasolson Oct 17, 2019
f5d8875
Merge branch 'master' into typescriptifySearchSource
lukasolson Oct 22, 2019
d6182a4
Fix issue with filters not applying
lukasolson Oct 22, 2019
cc40ce8
Fix issue with search embeddable time ranges
lukasolson Oct 22, 2019
5c96bfe
Remove deleted file again
lukasolson Oct 22, 2019
e6867df
Fix source includes
lukasolson Oct 23, 2019
7ae80e1
Fix searchsource constructor
lukasolson Oct 23, 2019
d9c15ea
Don't pass null as initial value for search source
lukasolson Oct 23, 2019
8e4e001
Fix inmemorytable type
lukasolson Oct 23, 2019
1a766d5
Merge branch 'master' into typescriptifySearchSource
lukasolson Oct 23, 2019
77249c3
Fix issue with filters aggregation
lukasolson Oct 23, 2019
d54e1e1
Fix tests
lukasolson Oct 24, 2019
2b1ab12
Mock new platform
lukasolson Oct 24, 2019
706cfe6
Fix agg filters
lukasolson Oct 24, 2019
8dcb0ac
Fix context app tests
lukasolson Oct 24, 2019
011e02d
Fix context tests (for real)
lukasolson Oct 24, 2019
001d449
Fix normalizeSortRequest for dateNanos
lukasolson Oct 24, 2019
c5c8faf
Merge branch 'master' into typescriptifySearchSource
lukasolson Oct 24, 2019
d242d08
Fix issue with multiple levels of Other buckets
lukasolson Oct 25, 2019
e6b1a8b
Merge branch 'master' into typescriptifySearchSource
lukasolson Oct 25, 2019
12b84db
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 13, 2019
b8ba4fc
Adding in last commit
lukasolson Nov 13, 2019
551892f
Review feedback
lukasolson Nov 14, 2019
9316e4a
Update references to ui/courier
lukasolson Nov 15, 2019
2ae37f6
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 15, 2019
c519d64
Fix eslint
lukasolson Nov 15, 2019
8c9e048
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 15, 2019
0dab564
Fix tests
lukasolson Nov 18, 2019
13e4fd8
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 18, 2019
efe3c7e
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 19, 2019
a54281e
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 19, 2019
75604ec
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 19, 2019
af3faa0
Fix filter matches index for filters with partial meta
lukasolson Nov 20, 2019
21d6cd3
Merge remote-tracking branch 'upstream/master'
lukasolson Nov 20, 2019
5bd959e
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 20, 2019
c0f95f4
Fix type errors
lukasolson Nov 20, 2019
d118abb
Merge remote-tracking branch 'upstream/master'
lukasolson Nov 25, 2019
13380ed
Merge branch 'master' into typescriptifySearchSource
lukasolson Nov 25, 2019
0dcc9c9
Fix references
lukasolson Nov 25, 2019
2d1da99
Address review feedback
lukasolson Nov 25, 2019
51c92b0
Fix failing test
lukasolson Nov 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/fixtures/stubbed_search_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ export default function stubSearchSource(Private, $q, Promise) {
onRequestStart(fn) {
this._requestStartHandlers.push(fn);
},
requestIsStarting(req) {
return Promise.map(this._requestStartHandlers, fn => fn(req));
},
requestIsStopped() {}
};

Expand Down
15 changes: 8 additions & 7 deletions src/legacy/core_plugins/data/public/search/expressions/esaggs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ import {
ExpressionFunction,
KibanaDatatableColumn,
} from 'src/plugins/expressions/public';
import { SearchSource } from '../../../../../ui/public/courier/search_source';
import {
SearchSource,
SearchSourceContract,
getRequestInspectorStats,
getResponseInspectorStats,
} from '../../../../../ui/public/courier';
// @ts-ignore
import {
FilterBarQueryFilterProvider,
QueryFilter,
} from '../../../../../ui/public/filter_manager/query_filter';

import { buildTabularInspectorData } from '../../../../../ui/public/inspector/build_tabular_inspector_data';
import {
getRequestInspectorStats,
getResponseInspectorStats,
} from '../../../../../ui/public/courier/utils/courier_inspector_utils';
import { calculateObjectHash } from '../../../../../ui/public/vis/lib/calculate_object_hash';
import { getTime } from '../../../../../ui/public/timefilter';
// @ts-ignore
Expand All @@ -50,7 +51,7 @@ import { PersistedState } from '../../../../../ui/public/persisted_state';
import { Adapters } from '../../../../../../plugins/inspector/public';

export interface RequestHandlerParams {
searchSource: SearchSource;
searchSource: SearchSourceContract;
aggs: AggConfigs;
timeRange?: TimeRange;
query?: Query;
Expand Down Expand Up @@ -119,7 +120,7 @@ const handleCourierRequest = async ({
return aggs.toDsl(metricsAtAllLevels);
});

requestSearchSource.onRequestStart((paramSearchSource: SearchSource, options: any) => {
requestSearchSource.onRequestStart((paramSearchSource, options) => {
return aggs.onSearchRequestStart(paramSearchSource, options);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import { timefilter } from 'ui/timefilter';

export function createSearchSource(SearchSource, initialState, indexPattern, aggs, useTimeFilter, filters = []) {
const searchSource = new SearchSource(initialState);
const searchSource = initialState ? new SearchSource(initialState) : new SearchSource();
// Do not not inherit from rootSearchSource to avoid picking up time and globals
searchSource.setParent(false);
searchSource.setParent(undefined);
searchSource.setField('filter', () => {
const activeFilters = [...filters];
if (useTimeFilter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import { SearchSource } from 'ui/courier';
import { SavedObject } from 'ui/saved_objects/saved_object';
import { SearchSourceContract } from '../../../../../ui/public/courier';
import { esFilters, Query, RefreshInterval } from '../../../../../../plugins/data/public';

export interface SavedObjectDashboard extends SavedObject {
Expand All @@ -34,7 +34,7 @@ export interface SavedObjectDashboard extends SavedObject {
// TODO: write a migration to rid of this, it's only around for bwc.
uiStateJSON?: string;
lastSavedTitle: string;
searchSource: SearchSource;
searchSource: SearchSourceContract;
destroy: () => void;
refreshInterval?: RefreshInterval;
getQuery(): Query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('context app', function () {
.then(() => {
const setParentSpy = searchSourceStub.setParent;
expect(setParentSpy.calledOnce).to.be(true);
expect(setParentSpy.firstCall.args[0]).to.eql(false);
expect(setParentSpy.firstCall.args[0]).to.be(undefined);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('context app', function () {
)
.then(() => {
const setParentSpy = searchSourceStub.setParent;
expect(setParentSpy.alwaysCalledWith(false)).to.be(true);
expect(setParentSpy.alwaysCalledWith(undefined)).to.be(true);
expect(setParentSpy.called).to.be(true);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('context app', function () {
)
.then(() => {
const setParentSpy = searchSourceStub.setParent;
expect(setParentSpy.alwaysCalledWith(false)).to.be(true);
expect(setParentSpy.alwaysCalledWith(undefined)).to.be(true);
expect(setParentSpy.called).to.be(true);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function fetchAnchorProvider(indexPatterns) {
) {
const indexPattern = await indexPatterns.get(indexPatternId);
const searchSource = new SearchSource()
.setParent(false)
.setParent(undefined)
.setField('index', indexPattern)
.setField('version', true)
.setField('size', 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* under the License.
*/

import { SortDirection } from '../../../../../../../ui/public/courier';
import { IndexPatterns, IndexPattern, getServices } from '../../../kibana_services';
import { reverseSortDir, SortDirection } from './utils/sorting';
import { reverseSortDir } from './utils/sorting';
import { extractNanos, convertIsoToMillis } from './utils/date_conversion';
import { fetchHitsInInterval } from './utils/fetch_hits_in_interval';
import { generateIntervals } from './utils/generate_intervals';
Expand Down Expand Up @@ -114,7 +115,7 @@ function fetchContextProvider(indexPatterns: IndexPatterns) {

async function createSearchSource(indexPattern: IndexPattern, filters: esFilters.Filter[]) {
return new SearchSource()
.setParent(false)
.setParent(undefined)
.setField('index', indexPattern)
.setField('filter', filters);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
import { reverseSortDir, SortDirection } from '../sorting';
import { reverseSortDir } from '../sorting';
import { SortDirection } from '../../../../../../../../../ui/public/courier';

jest.mock('ui/new_platform');

describe('function reverseSortDir', function() {
test('reverse a given sort direction', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
import { SearchSource } from '../../../../kibana_services';
import {
EsQuerySortValue,
SortDirection,
SearchSourceContract,
} from '../../../../../../../../ui/public/courier';
import { convertTimeValueToIso } from './date_conversion';
import { SortDirection } from './sorting';
import { EsHitRecordList } from '../context';
import { IntervalValue } from './generate_intervals';
import { EsQuerySort } from './get_es_query_sort';
import { EsQuerySearchAfter } from './get_es_query_search_after';

interface RangeQuery {
Expand All @@ -38,9 +40,9 @@ interface RangeQuery {
* and filters set.
*/
export async function fetchHitsInInterval(
searchSource: SearchSource,
searchSource: SearchSourceContract,
timeField: string,
sort: EsQuerySort,
sort: [EsQuerySortValue, EsQuerySortValue],
sortDir: SortDirection,
interval: IntervalValue[],
searchAfter: EsQuerySearchAfter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { SortDirection } from './sorting';
import { SortDirection } from '../../../../../../../../ui/public/courier';

export type IntervalValue = number | null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { SortDirection } from './sorting';

type EsQuerySortValue = Record<string, SortDirection>;

export type EsQuerySort = [EsQuerySortValue, EsQuerySortValue];
import { EsQuerySortValue, SortDirection } from '../../../../../../../../ui/public/courier/types';

/**
* Returns `EsQuerySort` which is used to sort records in the ES query
Expand All @@ -33,6 +30,6 @@ export function getEsQuerySort(
timeField: string,
tieBreakerField: string,
sortDir: SortDirection
): EsQuerySort {
): [EsQuerySortValue, EsQuerySortValue] {
return [{ [timeField]: sortDir }, { [tieBreakerField]: sortDir }];
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
* under the License.
*/

import { SortDirection } from '../../../../../../../../ui/public/courier';
import { IndexPattern } from '../../../../kibana_services';

export enum SortDirection {
asc = 'asc',
desc = 'desc',
}

/**
* The list of field names that are allowed for sorting, but not included in
* index pattern fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Subscription } from 'rxjs';
import { i18n } from '@kbn/i18n';
import { TExecuteTriggerActions } from 'src/plugins/ui_actions/public';
import { npStart } from 'ui/new_platform';
import { SearchSourceContract } from '../../../../../ui/public/courier';
import {
esFilters,
TimeRange,
Expand Down Expand Up @@ -51,7 +52,6 @@ import {
getServices,
IndexPattern,
RequestAdapter,
SearchSource,
} from '../kibana_services';
import { SEARCH_EMBEDDABLE_TYPE } from './constants';

Expand Down Expand Up @@ -92,7 +92,7 @@ export class SearchEmbeddable extends Embeddable<SearchInput, SearchOutput>
private inspectorAdaptors: Adapters;
private searchScope?: SearchScope;
private panelTitle: string = '';
private filtersSearchSource?: SearchSource;
private filtersSearchSource?: SearchSourceContract;
private searchInstance?: JQLite;
private autoRefreshFetchSubscription?: Subscription;
private subscription?: Subscription;
Expand Down Expand Up @@ -194,18 +194,16 @@ export class SearchEmbeddable extends Embeddable<SearchInput, SearchOutput>
searchScope.inspectorAdapters = this.inspectorAdaptors;

const { searchSource } = this.savedSearch;
const indexPattern = (searchScope.indexPattern = searchSource.getField('index'));
const indexPattern = (searchScope.indexPattern = searchSource.getField('index'))!;

const timeRangeSearchSource = searchSource.create();
timeRangeSearchSource.setField('filter', () => {
if (!this.searchScope || !this.input.timeRange) {
return;
}
if (!this.searchScope || !this.input.timeRange) return;
return getTime(indexPattern, this.input.timeRange);
});

this.filtersSearchSource = searchSource.create();
this.filtersSearchSource.setParent(timeRangeSearchSource);
this.filtersSearchSource = searchSource.create()!;
this.filtersSearchSource!.setParent(timeRangeSearchSource);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tsc will still work without the ! on these two lines


searchSource.setParent(this.filtersSearchSource);

Expand Down Expand Up @@ -241,7 +239,7 @@ export class SearchEmbeddable extends Embeddable<SearchInput, SearchOutput>
};

searchScope.filter = async (field, value, operator) => {
let filters = generateFilters(this.filterManager, field, value, operator, indexPattern.id);
let filters = generateFilters(this.filterManager, field, value, operator, indexPattern.id!);
filters = filters.map(filter => ({
...filter,
$state: { store: esFilters.FilterStateStore.APP_STATE },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class SearchEmbeddableFactory extends EmbeddableFactory<
const queryFilter = Private(getServices().FilterBarQueryFilterProvider);
try {
const savedObject = await searchLoader.get(savedObjectId);
const indexPattern = savedObject.searchSource.getField('index');
return new SearchEmbeddable(
{
savedSearch: savedObject,
Expand All @@ -92,7 +93,7 @@ export class SearchEmbeddableFactory extends EmbeddableFactory<
editUrl,
queryFilter,
editable: getServices().capabilities.discover.save as boolean,
indexPatterns: _.compact([savedObject.searchSource.getField('index')]),
indexPatterns: indexPattern ? [indexPattern] : [],
},
input,
this.executeTriggerActions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import angular from 'angular'; // just used in embeddables and discover controll
import uiRoutes from 'ui/routes';
// @ts-ignore
import { uiModules } from 'ui/modules';
import { SearchSource } from 'ui/courier';
// @ts-ignore
import { StateProvider } from 'ui/state_management/state';
// @ts-ignore
Expand All @@ -43,6 +42,7 @@ import { wrapInI18nContext } from 'ui/i18n';
import { docTitle } from 'ui/doc_title';
// @ts-ignore
import * as docViewsRegistry from 'ui/registry/doc_views';
import { SearchSource } from '../../../../ui/public/courier';

const services = {
// new plattform
Expand Down Expand Up @@ -87,9 +87,10 @@ export { callAfterBindingsWorkaround } from 'ui/compat';
export {
getRequestInspectorStats,
getResponseInspectorStats,
} from 'ui/courier/utils/courier_inspector_utils';
// @ts-ignore
export { hasSearchStategyForIndexPattern, isDefaultTypeIndexPattern } from 'ui/courier';
hasSearchStategyForIndexPattern,
isDefaultTypeIndexPattern,
SearchSource,
} from '../../../../ui/public/courier';
// @ts-ignore
export { intervalOptions } from 'ui/agg_types/buckets/_interval_options';
// @ts-ignore
Expand All @@ -115,7 +116,6 @@ export { unhashUrl } from 'ui/state_management/state_hashing';
// EXPORT types
export { Vis } from 'ui/vis';
export { StaticIndexPattern, IndexPatterns, IndexPattern, FieldType } from 'ui/index_patterns';
export { SearchSource } from 'ui/courier';
export { ElasticSearchHit } from 'ui/registry/doc_views_types';
export { DocViewRenderProps, DocViewRenderFn } from 'ui/registry/doc_views';
export { Adapters } from 'ui/inspector/types';
5 changes: 3 additions & 2 deletions src/legacy/core_plugins/kibana/public/discover/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
* under the License.
*/

import { SearchSource } from './kibana_services';
import { SearchSourceContract } from '../../../../ui/public/courier';
import { SortOrder } from './angular/doc_table/components/table_header/helpers';
export { SortOrder } from './angular/doc_table/components/table_header/helpers';

export interface SavedSearch {
readonly id: string;
title: string;
searchSource: SearchSource;
searchSource: SearchSourceContract;
description?: string;
columns: string[];
sort: SortOrder[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import * as Rx from 'rxjs';
import { buildPipeline } from 'ui/visualize/loader/pipeline_helpers';
import { SavedObject } from 'ui/saved_objects/saved_object';
import { Vis } from 'ui/vis';
import { SearchSource } from 'ui/courier';
import { queryGeohashBounds } from 'ui/visualize/loader/utils';
import { getTableAggs } from 'ui/visualize/loader/pipeline_helpers/utilities';
import { AppState } from 'ui/state_management/app_state';
import { npStart } from 'ui/new_platform';
import { IExpressionLoaderParams } from 'src/plugins/expressions/public';
import { SearchSourceContract } from '../../../../../ui/public/courier';
import { VISUALIZE_EMBEDDABLE_TYPE } from './constants';
import {
TimeRange,
Expand All @@ -53,7 +53,7 @@ const getKeys = <T extends {}>(o: T): Array<keyof T> => Object.keys(o) as Array<
export interface VisSavedObject extends SavedObject {
vis: Vis;
description?: string;
searchSource: SearchSource;
searchSource: SearchSourceContract;
title: string;
uiStateJSON?: string;
destroy: () => void;
Expand Down
5 changes: 3 additions & 2 deletions src/legacy/ui/public/agg_types/agg_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { npStart } from 'ui/new_platform';
import { SearchSourceContract, FetchOptions } from '../courier/types';
import { AggType } from './agg_type';
import { FieldParamType } from './param_types/field';
import { AggGroupNames } from '../vis/editors/default/agg_groups';
Expand Down Expand Up @@ -233,10 +234,10 @@ export class AggConfig {
/**
* Hook for pre-flight logic, see AggType#onSearchRequestStart
* @param {Courier.SearchSource} searchSource
* @param {Courier.SearchRequest} searchRequest
* @param {Courier.FetchOptions} options
* @return {Promise<undefined>}
*/
onSearchRequestStart(searchSource: any, options: any) {
onSearchRequestStart(searchSource: SearchSourceContract, options?: FetchOptions) {
if (!this.type) {
return Promise.resolve();
}
Expand Down
Loading