Skip to content

Commit

Permalink
Revert "[7.x] [SEARCH] Cleanup fetch soon (elastic#63320) (elastic#63929
Browse files Browse the repository at this point in the history
)"

This reverts commit 6ee7111.
  • Loading branch information
spalger committed Apr 20, 2020
1 parent 486e9e1 commit 5498a23
Show file tree
Hide file tree
Showing 36 changed files with 322 additions and 276 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
| [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) | |
| [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) | |
| [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) | |
| [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) | |
| [TabbedAggColumn](./kibana-plugin-plugins-data-public.tabbedaggcolumn.md) | \* |
| [TabbedTable](./kibana-plugin-plugins-data-public.tabbedtable.md) | \* |
| [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) &gt; [id](./kibana-plugin-plugins-data-public.searchstrategyprovider.id.md)

## SearchStrategyProvider.id property

<b>Signature:</b>

```typescript
id: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) &gt; [isViable](./kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md)

## SearchStrategyProvider.isViable property

<b>Signature:</b>

```typescript
isViable: (indexPattern: IndexPattern) => boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md)

## SearchStrategyProvider interface

<b>Signature:</b>

```typescript
export interface SearchStrategyProvider
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [id](./kibana-plugin-plugins-data-public.searchstrategyprovider.id.md) | <code>string</code> | |
| [isViable](./kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md) | <code>(indexPattern: IndexPattern) =&gt; boolean</code> | |
| [search](./kibana-plugin-plugins-data-public.searchstrategyprovider.search.md) | <code>(params: SearchStrategySearchParams) =&gt; SearchStrategyResponse</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) &gt; [search](./kibana-plugin-plugins-data-public.searchstrategyprovider.search.md)

## SearchStrategyProvider.search property

<b>Signature:</b>

```typescript
search: (params: SearchStrategySearchParams) => SearchStrategyResponse;
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { getIndices } from './get_indices';
import { IndexPatternCreationConfig } from '../../../../../../../../../plugins/index_pattern_management/public';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { LegacyApiCaller } from '../../../../../../../../../plugins/data/public/search/legacy';
import { LegacyApiCaller } from '../../../../../../../../../plugins/data/public/search';

export const successfulResponse = {
hits: {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export {
SearchRequest,
SearchResponse,
SearchError,
SearchStrategyProvider,
ISearchSource,
SearchSource,
createSearchSource,
Expand Down
45 changes: 30 additions & 15 deletions src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,21 @@ export interface SearchSourceFields {
version?: boolean;
}

// Warning: (ae-missing-release-tag) "SearchStrategyProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface SearchStrategyProvider {
// (undocumented)
id: string;
// (undocumented)
isViable: (indexPattern: IndexPattern) => boolean;
// Warning: (ae-forgotten-export) The symbol "SearchStrategySearchParams" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "SearchStrategyResponse" needs to be exported by the entry point index.d.ts
//
// (undocumented)
search: (params: SearchStrategySearchParams) => SearchStrategyResponse;
}

// Warning: (ae-missing-release-tag) "SortDirection" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand Down Expand Up @@ -1886,21 +1901,21 @@ export type TSearchStrategyProvider<T extends TStrategyTypes> = (context: ISearc
// src/plugins/data/public/index.ts:234:27 - (ae-forgotten-export) The symbol "flattenHitWrapper" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:234:27 - (ae-forgotten-export) The symbol "getRoutes" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:234:27 - (ae-forgotten-export) The symbol "formatHitProvider" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:387:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:388:1 - (ae-forgotten-export) The symbol "convertDateRangeToString" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:390:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:399:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:401:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:404:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:405:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:408:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:409:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:412:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:388:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "convertDateRangeToString" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:391:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:401:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:402:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:405:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:406:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:409:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:410:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:413:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:33:33 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/query/state_sync/connect_to_query_state.ts:37:1 - (ae-forgotten-export) The symbol "QueryStateChange" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/types.ts:52:5 - (ae-forgotten-export) The symbol "createFiltersFromEvent" needs to be exported by the entry point index.d.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { coreMock } from '../../../../../../core/public/mocks';
import { dataPluginMock } from '../../../mocks';
import { coreMock } from '../../../../../../../src/core/public/mocks';
import { dataPluginMock } from '../../../../public/mocks';
import {
setFieldFormats,
setIndexPatterns,
Expand All @@ -29,7 +29,7 @@ import {
setQueryService,
setSearchService,
setUiSettings,
} from '../../../services';
} from '../../../../public/services';

/**
* Testing helper which calls all of the service setters used in the
Expand All @@ -49,9 +49,4 @@ export function mockDataServices() {
setQueryService(data.query);
setSearchService(data.search);
setUiSettings(core.uiSettings);

return {
core,
data,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
*/

export { getEsClient } from './get_es_client';
export { LegacyApiCaller } from './types';
export { SearchRequest, SearchResponse, LegacyApiCaller } from './types';
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
* under the License.
*/

import { SearchRequest, SearchResponse } from '../../fetch';
export type SearchRequest = any;
export type SearchResponse = any;

export interface LegacyApiCaller {
search: (searchRequest: SearchRequest) => LegacyApiCallerResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
*/

import { callClient } from './call_client';
import { SearchStrategySearchParams } from './types';
import { defaultSearchStrategy } from './default_search_strategy';
import { FetchHandlers } from '../fetch';
import { handleResponse } from '../fetch/handle_response';
import { handleResponse } from './handle_response';
import { FetchHandlers } from './types';
import { SearchStrategySearchParams, defaultSearchStrategy } from '../search_strategy';

const mockAbortFn = jest.fn();
jest.mock('../fetch/handle_response', () => ({
jest.mock('./handle_response', () => ({
handleResponse: jest.fn((request, response) => response),
}));

jest.mock('./default_search_strategy', () => {
jest.mock('../search_strategy', () => {
return {
defaultSearchStrategy: {
search: jest.fn(({ searchRequests }: SearchStrategySearchParams) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
* under the License.
*/

import { FetchOptions, FetchHandlers, handleResponse } from '../fetch';
import { defaultSearchStrategy } from './default_search_strategy';
import { SearchRequest } from '../index';
import { handleResponse } from './handle_response';
import { FetchOptions, FetchHandlers } from './types';
import { defaultSearchStrategy } from '../search_strategy';
import { SearchRequest } from '..';

export function callClient(
searchRequests: SearchRequest[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import { fetchSoon } from './fetch_soon';
import { callClient } from './call_client';
import { IUiSettingsClient } from 'kibana/public';
import { FetchHandlers, FetchOptions } from '../fetch/types';
import { SearchRequest, SearchResponse } from '../index';
import { IUiSettingsClient } from '../../../../../core/public';
import { FetchHandlers, FetchOptions } from './types';
import { SearchRequest, SearchResponse } from '..';

function getConfigStub(config: any = {}) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

import { callClient } from './call_client';
import { FetchHandlers, FetchOptions } from '../fetch/types';
import { SearchRequest, SearchResponse } from '../index';
import { FetchHandlers, FetchOptions } from './types';
import { SearchRequest, SearchResponse } from '..';

/**
* This function introduces a slight delay in the request process to allow multiple requests to queue
Expand Down
70 changes: 0 additions & 70 deletions src/plugins/data/public/search/fetch/get_search_params.test.ts

This file was deleted.

13 changes: 2 additions & 11 deletions src/plugins/data/public/search/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,5 @@
*/

export * from './types';
export {
getSearchParams,
getPreference,
getTimeout,
getIgnoreThrottled,
getMaxConcurrentShardRequests,
} from './get_search_params';

export { SearchError, getSearchErrorType } from './search_error';
export { RequestFailure } from './request_error';
export { handleResponse } from './handle_response';
export { fetchSoon } from './fetch_soon';
export { RequestFailure } from './errors';
3 changes: 0 additions & 3 deletions src/plugins/data/public/search/fetch/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
import { IUiSettingsClient } from '../../../../../core/public';
import { ISearchStart } from '../types';

export type SearchRequest = any;
export type SearchResponse = any;

export interface FetchOptions {
abortSignal?: AbortSignal;
searchStrategyId?: string;
Expand Down
12 changes: 5 additions & 7 deletions src/plugins/data/public/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,9 @@ export { esSearchStrategyProvider, getEsPreference } from './es_search';

export { IKibanaSearchResponse, IKibanaSearchRequest } from '../../common/search';

export {
SearchError,
FetchOptions,
SearchRequest,
SearchResponse,
getSearchErrorType,
} from './fetch';
export { LegacyApiCaller, SearchRequest, SearchResponse } from './es_client';

export { SearchError, SearchStrategyProvider, getSearchErrorType } from './search_strategy';

export {
ISearchSource,
Expand All @@ -63,3 +59,5 @@ export {

export { SearchInterceptor } from './search_interceptor';
export { RequestTimeoutError } from './request_timeout_error';

export { FetchOptions } from './fetch';
29 changes: 0 additions & 29 deletions src/plugins/data/public/search/legacy/get_msearch_params.ts

This file was deleted.

0 comments on commit 5498a23

Please sign in to comment.