Clean up ui/courier exports. (#52037)

This commit is contained in:
Luke Elmers 2019-12-03 15:17:40 -07:00 committed by GitHub
parent 45ef370e84
commit d1de029b88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 11 deletions

View file

@ -40,11 +40,11 @@ export function getSearchParams(config: IUiSettingsClient, esShardTimeout: numbe
};
}
export function getIgnoreThrottled(config: IUiSettingsClient) {
function getIgnoreThrottled(config: IUiSettingsClient) {
return !config.get('search:includeFrozen');
}
export function getMaxConcurrentShardRequests(config: IUiSettingsClient) {
function getMaxConcurrentShardRequests(config: IUiSettingsClient) {
const maxConcurrentShardRequests = config.get('courier:maxConcurrentShardRequests');
return maxConcurrentShardRequests > 0 ? maxConcurrentShardRequests : undefined;
}

View file

@ -17,8 +17,31 @@
* under the License.
*/
export * from './fetch';
export * from './search_source';
export * from './search_strategy';
export * from './utils/courier_inspector_utils';
export * from './types';
export { SearchSource } from './search_source';
// TODO: Exporting this mock outside of jest tests causes errors because
// jest is undefined. Need to refactor the mock to be consistent with
// other NP-style mocks.
// export { searchSourceMock } from './search_source/mocks';
export {
addSearchStrategy, // used externally by Rollups
getSearchErrorType, // used externally by Rollups
hasSearchStategyForIndexPattern, // used externally by Discover
isDefaultTypeIndexPattern, // used externally by Discover
SearchError, // used externally by Visualizations & Rollups
} from './search_strategy';
export {
getRequestInspectorStats,
getResponseInspectorStats,
} from './utils/courier_inspector_utils';
// types
export { SearchSourceContract } from './search_source';
export {
EsQuerySortValue, // used externally by Discover
FetchOptions, // used externally by AggTypes
SortDirection, // used externally by Discover
} from './types';

View file

@ -28,7 +28,7 @@ import { i18n } from '@kbn/i18n';
import { SearchResponse } from 'elasticsearch';
import { SearchSourceContract, RequestInspectorStats } from '../types';
function getRequestInspectorStats(searchSource: SearchSourceContract) {
export function getRequestInspectorStats(searchSource: SearchSourceContract) {
const stats: RequestInspectorStats = {};
const index = searchSource.getField('index');
@ -56,7 +56,8 @@ function getRequestInspectorStats(searchSource: SearchSourceContract) {
return stats;
}
function getResponseInspectorStats(
export function getResponseInspectorStats(
searchSource: SearchSourceContract,
resp: SearchResponse<unknown>
) {
@ -121,5 +122,3 @@ function getResponseInspectorStats(
return stats;
}
export { getRequestInspectorStats, getResponseInspectorStats };