diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getsearcherrortype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getsearcherrortype.md deleted file mode 100644 index b46728c093792..0000000000000 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.getsearcherrortype.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getSearchErrorType](./kibana-plugin-plugins-data-public.getsearcherrortype.md) - -## getSearchErrorType() function - -Signature: - -```typescript -export declare function getSearchErrorType({ message }: Pick): "UNSUPPORTED_QUERY" | undefined; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| { message } | Pick<SearchError, 'message'> | | - -Returns: - -`"UNSUPPORTED_QUERY" | undefined` - diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md index c8d45804a3729..53c30b52cb985 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md @@ -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) | | @@ -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) | | @@ -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) | \* | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror._constructor_.md deleted file mode 100644 index 4d7691d24a79d..0000000000000 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror._constructor_.md +++ /dev/null @@ -1,20 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) > [(constructor)](./kibana-plugin-plugins-data-public.searcherror._constructor_.md) - -## SearchError.(constructor) - -Constructs a new instance of the `SearchError` class - -Signature: - -```typescript -constructor({ status, title, message, path, type }: SearchErrorOptions); -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| { status, title, message, path, type } | SearchErrorOptions | | - diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.md index 06e60cadf4a85..65b46bf6cba4d 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searcherror.md @@ -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 Signature: ```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 SearchError class | - ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [message](./kibana-plugin-plugins-data-public.searcherror.message.md) | | string | | -| [name](./kibana-plugin-plugins-data-public.searcherror.name.md) | | string | | -| [path](./kibana-plugin-plugins-data-public.searcherror.path.md) | | string | | -| [status](./kibana-plugin-plugins-data-public.searcherror.status.md) | | string | | -| [title](./kibana-plugin-plugins-data-public.searcherror.title.md) | | string | | -| [type](./kibana-plugin-plugins-data-public.searcherror.type.md) | | string | | +| Property | Type | Description | +| --- | --- | --- | +| [message](./kibana-plugin-plugins-data-public.searcherror.message.md) | string | | +| [name](./kibana-plugin-plugins-data-public.searcherror.name.md) | string | | +| [path](./kibana-plugin-plugins-data-public.searcherror.path.md) | string | | +| [status](./kibana-plugin-plugins-data-public.searcherror.status.md) | string | | +| [title](./kibana-plugin-plugins-data-public.searcherror.title.md) | string | | +| [type](./kibana-plugin-plugins-data-public.searcherror.type.md) | string | | diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 5a9930d2b6b56..f036d5f30a0e2 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -337,7 +337,6 @@ export { // search ES_SEARCH_STRATEGY, getEsPreference, - getSearchErrorType, ISearch, ISearchOptions, ISearchGeneric, diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 76f88df4dd6fc..432b855a34326 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -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): "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) // @@ -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) @@ -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 diff --git a/src/plugins/data/public/search/fetch/index.ts b/src/plugins/data/public/search/fetch/index.ts index ab856d681ba12..79cdad1897f9c 100644 --- a/src/plugins/data/public/search/fetch/index.ts +++ b/src/plugins/data/public/search/fetch/index.ts @@ -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'; diff --git a/src/plugins/data/public/search/fetch/request_error.ts b/src/plugins/data/public/search/fetch/request_error.ts index e216d32e127cd..5e42a6fcf5b65 100644 --- a/src/plugins/data/public/search/fetch/request_error.ts +++ b/src/plugins/data/public/search/fetch/request_error.ts @@ -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 diff --git a/src/plugins/data/public/search/fetch/search_error.ts b/src/plugins/data/public/search/fetch/search_error.ts deleted file mode 100644 index d4042fb17499c..0000000000000 --- a/src/plugins/data/public/search/fetch/search_error.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -interface SearchErrorOptions { - status: string; - title: string; - message: string; - path: string; - type: string; -} - -export class SearchError extends Error { - public name: string; - public status: string; - public title: string; - public message: string; - public path: string; - public type: string; - - constructor({ status, title, message, path, type }: SearchErrorOptions) { - super(message); - this.name = 'SearchError'; - this.status = status; - this.title = title; - this.message = message; - this.path = path; - this.type = type; - - // captureStackTrace is only available in the V8 engine, so any browser using - // a different JS engine won't have access to this method. - if (Error.captureStackTrace) { - Error.captureStackTrace(this, SearchError); - } - - // Babel doesn't support traditional `extends` syntax for built-in classes. - // https://babeljs.io/docs/en/caveats/#classes - Object.setPrototypeOf(this, SearchError.prototype); - } -} - -export function getSearchErrorType({ message }: Pick) { - const msg = message.toLowerCase(); - if (msg.indexOf('unsupported query') > -1) { - return 'UNSUPPORTED_QUERY'; - } -} diff --git a/src/plugins/data/public/search/fetch/types.ts b/src/plugins/data/public/search/fetch/types.ts index 1aba4f66bb4d7..dda66d6b5238d 100644 --- a/src/plugins/data/public/search/fetch/types.ts +++ b/src/plugins/data/public/search/fetch/types.ts @@ -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; +} diff --git a/src/plugins/data/public/search/index.ts b/src/plugins/data/public/search/index.ts index 40d45ab88ea9f..96445e5367147 100644 --- a/src/plugins/data/public/search/index.ts +++ b/src/plugins/data/public/search/index.ts @@ -34,7 +34,6 @@ export { FetchOptions, SearchRequest, SearchResponse, - getSearchErrorType, getSearchParamsFromRequest, } from './fetch'; diff --git a/src/plugins/data/public/search/search_source/create_search_source.ts b/src/plugins/data/public/search/search_source/create_search_source.ts index 3466d60e5dd7e..4c44f4d62d469 100644 --- a/src/plugins/data/public/search/search_source/create_search_source.ts +++ b/src/plugins/data/public/search/search_source/create_search_source.ts @@ -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'; diff --git a/src/plugins/data/public/search/search_source/parse_json.ts b/src/plugins/data/public/search/search_source/parse_json.ts index f0eb377cedc77..8f46525311424 100644 --- a/src/plugins/data/public/search/search_source/parse_json.ts +++ b/src/plugins/data/public/search/search_source/parse_json.ts @@ -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 diff --git a/src/plugins/data/public/search/search_source/search_source.ts b/src/plugins/data/public/search/search_source/search_source.ts index c97a5d0638a6a..847dc8853d6ba 100644 --- a/src/plugins/data/public/search/search_source/search_source.ts +++ b/src/plugins/data/public/search/search_source/search_source.ts @@ -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'; diff --git a/src/plugins/kibana_utils/public/field_wildcard/index.ts b/src/plugins/kibana_legacy/common/index.ts similarity index 91% rename from src/plugins/kibana_utils/public/field_wildcard/index.ts rename to src/plugins/kibana_legacy/common/index.ts index db9f830e450b8..9c16d7b273862 100644 --- a/src/plugins/kibana_utils/public/field_wildcard/index.ts +++ b/src/plugins/kibana_legacy/common/index.ts @@ -17,4 +17,5 @@ * under the License. */ -export * from './field_wildcard'; +export * from './kbn_base_url'; +export * from './migrate_legacy_query'; diff --git a/src/plugins/kibana_legacy/public/utils/migrate_legacy_query.ts b/src/plugins/kibana_legacy/common/migrate_legacy_query.ts similarity index 100% rename from src/plugins/kibana_legacy/public/utils/migrate_legacy_query.ts rename to src/plugins/kibana_legacy/common/migrate_legacy_query.ts diff --git a/src/plugins/kibana_legacy/kibana.json b/src/plugins/kibana_legacy/kibana.json index 606acd8b88b05..79264d95dcc27 100644 --- a/src/plugins/kibana_legacy/kibana.json +++ b/src/plugins/kibana_legacy/kibana.json @@ -3,5 +3,5 @@ "version": "kibana", "server": true, "ui": true, - "extraPublicDirs": ["common/kbn_base_url"] + "extraPublicDirs": ["common", "common/kbn_base_url"] } diff --git a/src/plugins/kibana_legacy/public/index.ts b/src/plugins/kibana_legacy/public/index.ts index 75e81b0505747..27b940b0a456b 100644 --- a/src/plugins/kibana_legacy/public/index.ts +++ b/src/plugins/kibana_legacy/public/index.ts @@ -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'; diff --git a/src/plugins/kibana_legacy/public/utils/index.ts b/src/plugins/kibana_legacy/public/utils/index.ts index e7dd55ec5582b..a32cd5e40a047 100644 --- a/src/plugins/kibana_legacy/public/utils/index.ts +++ b/src/plugins/kibana_legacy/public/utils/index.ts @@ -17,7 +17,6 @@ * under the License. */ -export * from './migrate_legacy_query'; export * from './system_api'; export * from './normalize_path'; // @ts-ignore diff --git a/src/plugins/kibana_legacy/server/index.ts b/src/plugins/kibana_legacy/server/index.ts index 0188f9b1ec515..3ddcac1517f74 100644 --- a/src/plugins/kibana_legacy/server/index.ts +++ b/src/plugins/kibana_legacy/server/index.ts @@ -50,7 +50,7 @@ export const config: PluginConfigDescriptor = { ], }; -export { kbnBaseUrl } from '../common/kbn_base_url'; +export { kbnBaseUrl, migrateLegacyQuery } from '../common'; class Plugin { public setup(core: CoreSetup) {} diff --git a/src/plugins/kibana_utils/public/field_wildcard/field_wildcard.test.ts b/src/plugins/kibana_utils/common/field_wildcard.test.ts similarity index 100% rename from src/plugins/kibana_utils/public/field_wildcard/field_wildcard.test.ts rename to src/plugins/kibana_utils/common/field_wildcard.test.ts diff --git a/src/plugins/kibana_utils/public/field_wildcard/field_wildcard.ts b/src/plugins/kibana_utils/common/field_wildcard.ts similarity index 99% rename from src/plugins/kibana_utils/public/field_wildcard/field_wildcard.ts rename to src/plugins/kibana_utils/common/field_wildcard.ts index 2aa9a255bd5cf..bfe5a0f3a0a8e 100644 --- a/src/plugins/kibana_utils/public/field_wildcard/field_wildcard.ts +++ b/src/plugins/kibana_utils/common/field_wildcard.ts @@ -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}$`); diff --git a/src/plugins/kibana_utils/common/index.ts b/src/plugins/kibana_utils/common/index.ts index c94021872b4e1..1ec5737c5a38b 100644 --- a/src/plugins/kibana_utils/common/index.ts +++ b/src/plugins/kibana_utils/common/index.ts @@ -18,6 +18,7 @@ */ export * from './defer'; +export * from './field_wildcard'; export * from './of'; export * from './ui'; export * from './state_containers'; diff --git a/src/plugins/kibana_utils/public/index.ts b/src/plugins/kibana_utils/public/index.ts index d1c9eec0e9906..7edf62ce04e81 100644 --- a/src/plugins/kibana_utils/public/index.ts +++ b/src/plugins/kibana_utils/public/index.ts @@ -21,6 +21,8 @@ export { calculateObjectHash, defer, Defer, + fieldWildcardFilter, + fieldWildcardMatcher, Get, JsonArray, JsonObject, @@ -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'; diff --git a/src/plugins/kibana_utils/server/index.ts b/src/plugins/kibana_utils/server/index.ts index b8b768da0192e..bf3361d1e5369 100644 --- a/src/plugins/kibana_utils/server/index.ts +++ b/src/plugins/kibana_utils/server/index.ts @@ -17,4 +17,11 @@ * under the License. */ -export { Get, Set, createGetterSetter, url } from '../common'; +export { + createGetterSetter, + fieldWildcardFilter, + fieldWildcardMatcher, + Get, + Set, + url, +} from '../common';