diff --git a/src/legacy/ui/public/courier/fetch/get_search_params.ts b/src/legacy/ui/public/courier/fetch/get_search_params.ts index 21cdbf97945c5..9fb8f2c728c6f 100644 --- a/src/legacy/ui/public/courier/fetch/get_search_params.ts +++ b/src/legacy/ui/public/courier/fetch/get_search_params.ts @@ -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; } diff --git a/src/legacy/ui/public/courier/index.ts b/src/legacy/ui/public/courier/index.ts index 3c16926d2aba7..c8a06ec2a5518 100644 --- a/src/legacy/ui/public/courier/index.ts +++ b/src/legacy/ui/public/courier/index.ts @@ -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'; diff --git a/src/legacy/ui/public/courier/utils/courier_inspector_utils.ts b/src/legacy/ui/public/courier/utils/courier_inspector_utils.ts index 2c47fae4cce37..b4d5d5537333e 100644 --- a/src/legacy/ui/public/courier/utils/courier_inspector_utils.ts +++ b/src/legacy/ui/public/courier/utils/courier_inspector_utils.ts @@ -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 ) { @@ -121,5 +122,3 @@ function getResponseInspectorStats( return stats; } - -export { getRequestInspectorStats, getResponseInspectorStats };