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

[data.search.SearchSource] Move some SearchSource dependencies to the server. #74607

Merged
merged 6 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
| [OptionedParamType](./kibana-plugin-plugins-data-public.optionedparamtype.md) | |
| [Plugin](./kibana-plugin-plugins-data-public.plugin.md) | |
| [RequestTimeoutError](./kibana-plugin-plugins-data-public.requesttimeouterror.md) | Class used to signify that a request timed out. Useful for applications to conditionally handle this type of error differently than other errors. |
| [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) | |
| [SearchInterceptor](./kibana-plugin-plugins-data-public.searchinterceptor.md) | |
| [TimeHistory](./kibana-plugin-plugins-data-public.timehistory.md) | |

Expand All @@ -39,7 +38,6 @@
| --- | --- |
| [getDefaultQuery(language)](./kibana-plugin-plugins-data-public.getdefaultquery.md) | |
| [getEsPreference(uiSettings, sessionId)](./kibana-plugin-plugins-data-public.getespreference.md) | |
| [getSearchErrorType({ message })](./kibana-plugin-plugins-data-public.getsearcherrortype.md) | |
| [getSearchParamsFromRequest(searchRequest, dependencies)](./kibana-plugin-plugins-data-public.getsearchparamsfromrequest.md) | |
| [getTime(indexPattern, timeRange, options)](./kibana-plugin-plugins-data-public.gettime.md) | |
| [plugin(initializerContext)](./kibana-plugin-plugins-data-public.plugin.md) | |
Expand Down Expand Up @@ -80,6 +78,7 @@
| [RefreshInterval](./kibana-plugin-plugins-data-public.refreshinterval.md) | |
| [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) | |
| [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) | |
| [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) | |
| [SearchInterceptorDeps](./kibana-plugin-plugins-data-public.searchinterceptordeps.md) | |
| [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) | |
| [TabbedAggColumn](./kibana-plugin-plugins-data-public.tabbedaggcolumn.md) | \* |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@

[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md)

## SearchError class
## SearchError interface

<b>Signature:</b>

```typescript
export declare class SearchError extends Error
export interface SearchError
```

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)({ status, title, message, path, type })](./kibana-plugin-plugins-data-public.searcherror._constructor_.md) | | Constructs a new instance of the <code>SearchError</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [message](./kibana-plugin-plugins-data-public.searcherror.message.md) | | <code>string</code> | |
| [name](./kibana-plugin-plugins-data-public.searcherror.name.md) | | <code>string</code> | |
| [path](./kibana-plugin-plugins-data-public.searcherror.path.md) | | <code>string</code> | |
| [status](./kibana-plugin-plugins-data-public.searcherror.status.md) | | <code>string</code> | |
| [title](./kibana-plugin-plugins-data-public.searcherror.title.md) | | <code>string</code> | |
| [type](./kibana-plugin-plugins-data-public.searcherror.type.md) | | <code>string</code> | |
| Property | Type | Description |
| --- | --- | --- |
| [message](./kibana-plugin-plugins-data-public.searcherror.message.md) | <code>string</code> | |
| [name](./kibana-plugin-plugins-data-public.searcherror.name.md) | <code>string</code> | |
| [path](./kibana-plugin-plugins-data-public.searcherror.path.md) | <code>string</code> | |
| [status](./kibana-plugin-plugins-data-public.searcherror.status.md) | <code>string</code> | |
| [title](./kibana-plugin-plugins-data-public.searcherror.title.md) | <code>string</code> | |
| [type](./kibana-plugin-plugins-data-public.searcherror.type.md) | <code>string</code> | |

1 change: 0 additions & 1 deletion src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ export {
// search
ES_SEARCH_STRATEGY,
getEsPreference,
getSearchErrorType,
ISearch,
ISearchOptions,
ISearchGeneric,
Expand Down
39 changes: 16 additions & 23 deletions src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,6 @@ export function getEsPreference(uiSettings: IUiSettingsClient_2, sessionId?: str
// @public
export const getKbnTypeNames: () => string[];

// Warning: (ae-missing-release-tag) "getSearchErrorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function getSearchErrorType({ message }: Pick<SearchError, 'message'>): "UNSUPPORTED_QUERY" | undefined;

// Warning: (ae-forgotten-export) The symbol "ISearchRequestParams" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "getSearchParamsFromRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
Expand Down Expand Up @@ -1692,9 +1687,7 @@ export type SearchBarProps = SearchBarOwnProps & SearchBarInjectedDeps;
// Warning: (ae-missing-release-tag) "SearchError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export class SearchError extends Error {
// Warning: (ae-forgotten-export) The symbol "SearchErrorOptions" needs to be exported by the entry point index.d.ts
constructor({ status, title, message, path, type }: SearchErrorOptions);
export interface SearchError {
// (undocumented)
message: string;
// (undocumented)
Expand Down Expand Up @@ -1964,21 +1957,21 @@ export const UI_SETTINGS: {
// src/plugins/data/public/index.ts:234:27 - (ae-forgotten-export) The symbol "getFromSavedObject" needs to be exported by the entry point index.d.ts
// 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 "formatHitProvider" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:370:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:370:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:370:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:370:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:372:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:373:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:382:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:383:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:384:1 - (ae-forgotten-export) The symbol "Ipv4Address" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:385:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:390:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:393:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:394:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:397:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:369:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:369:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:369:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:369:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:371:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:372:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:381:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:382:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:383:1 - (ae-forgotten-export) The symbol "Ipv4Address" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:384:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:388:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:392:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:393:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/index.ts:396: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:45:5 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/types.ts:54:5 - (ae-forgotten-export) The symbol "createFiltersFromValueClickAction" needs to be exported by the entry point index.d.ts
// src/plugins/data/public/types.ts:55:5 - (ae-forgotten-export) The symbol "createFiltersFromRangeSelectAction" needs to be exported by the entry point index.d.ts
Expand Down
1 change: 0 additions & 1 deletion src/plugins/data/public/search/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ export {
getMaxConcurrentShardRequests,
} from './get_search_params';

export { SearchError, getSearchErrorType } from './search_error';
export { RequestFailure } from './request_error';
export { handleResponse } from './handle_response';
4 changes: 2 additions & 2 deletions src/plugins/data/public/search/fetch/request_error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import { KbnError } from '../../../../kibana_utils/public';
import { SearchResponse, SearchError } from '..';
import { KbnError } from '../../../../kibana_utils/common';
import { SearchError, SearchResponse } from './types';

/**
* Request Failure - When an entire multi request fails
Expand Down
62 changes: 0 additions & 62 deletions src/plugins/data/public/search/fetch/search_error.ts

This file was deleted.

9 changes: 9 additions & 0 deletions src/plugins/data/public/search/fetch/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@ export interface FetchHandlers {
config: IUiSettingsClient;
esShardTimeout: number;
}

export interface SearchError {
name: string;
status: string;
title: string;
message: string;
path: string;
type: string;
}
1 change: 0 additions & 1 deletion src/plugins/data/public/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export {
FetchOptions,
SearchRequest,
SearchResponse,
getSearchErrorType,
getSearchParamsFromRequest,
} from './fetch';

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 { migrateLegacyQuery } from '../../../../kibana_legacy/public';
import { migrateLegacyQuery } from '../../../../kibana_legacy/common';
import { SearchSource, SearchSourceDependencies } from './search_source';
import { IndexPatternsContract } from '../../index_patterns/index_patterns';
import { SearchSourceFields } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/public/search/search_source/parse_json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { SearchSourceFields } from './types';
import { InvalidJSONProperty } from '../../../../kibana_utils/public';
import { InvalidJSONProperty } from '../../../../kibana_utils/common';

export const parseSearchSourceJSON = (searchSourceJSON: string) => {
// if we have a searchSource, set its values based on the searchSourceJson field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import { map } from 'rxjs/operators';
import { CoreStart } from 'kibana/public';
import { normalizeSortRequest } from './normalize_sort_request';
import { filterDocvalueFields } from './filter_docvalue_fields';
import { fieldWildcardFilter } from '../../../../kibana_utils/public';
import { fieldWildcardFilter } from '../../../../kibana_utils/common';
import { IIndexPattern, ISearchGeneric, SearchRequest } from '../..';
import { SearchSourceOptions, SearchSourceFields } from './types';
import { FetchOptions, RequestFailure, handleResponse, getSearchParamsFromRequest } from '../fetch';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
* under the License.
*/

export * from './field_wildcard';
export * from './kbn_base_url';
export * from './migrate_legacy_query';
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"version": "kibana",
"server": true,
"ui": true,
"extraPublicDirs": ["common/kbn_base_url"]
"extraPublicDirs": ["common", "common/kbn_base_url"]
}
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const plugin = (initializerContext: PluginInitializerContext) =>
new KibanaLegacyPlugin(initializerContext);

export * from './plugin';
export { kbnBaseUrl } from '../common/kbn_base_url';
export { kbnBaseUrl, migrateLegacyQuery } from '../common';

export { initAngularBootstrap } from './angular_bootstrap';
export { PaginateDirectiveProvider, PaginateControlsDirectiveProvider } from './paginate/paginate';
Expand Down
1 change: 0 additions & 1 deletion src/plugins/kibana_legacy/public/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

export * from './migrate_legacy_query';
export * from './system_api';
export * from './normalize_path';
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const config: PluginConfigDescriptor<ConfigSchema> = {
],
};

export { kbnBaseUrl } from '../common/kbn_base_url';
export { kbnBaseUrl, migrateLegacyQuery } from '../common';

class Plugin {
public setup(core: CoreSetup) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import { escapeRegExp, memoize } from 'lodash';

// @internal
export const makeRegEx = memoize(function makeRegEx(glob: string) {
const globRegex = glob.split('*').map(escapeRegExp).join('.*');
return new RegExp(`^${globRegex}$`);
Expand Down
1 change: 1 addition & 0 deletions src/plugins/kibana_utils/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

export * from './defer';
export * from './field_wildcard';
export * from './of';
export * from './ui';
export * from './state_containers';
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/kibana_utils/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export {
calculateObjectHash,
defer,
Defer,
fieldWildcardFilter,
fieldWildcardMatcher,
Get,
JsonArray,
JsonObject,
Expand All @@ -34,7 +36,6 @@ export {
} from '../common';
export * from './core';
export * from '../common/errors';
export * from './field_wildcard';
export * from './render_complete';
export * from './resize_checker';
export * from '../common/state_containers';
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/kibana_utils/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@
* under the License.
*/

export { Get, Set, createGetterSetter, url } from '../common';
export {
createGetterSetter,
fieldWildcardFilter,
fieldWildcardMatcher,
Get,
Set,
url,
} from '../common';