Skip to content

Commit

Permalink
[Move @kbn/config-schema to server] unified_search (elastic#191773)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Aug 30, 2024
1 parent e433dc2 commit 232d7cf
Show file tree
Hide file tree
Showing 22 changed files with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from './providers/value_suggestion_provider';
import type { ValueSuggestionsGetFn } from './providers/value_suggestion_provider';

import { ConfigSchema } from '../../config';
import type { ConfigSchema } from '../../server/config';
import { createUsageCollector } from './collectors';
import {
KUERY_LANGUAGE_NAME,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/unified_search/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { PluginInitializerContext } from '@kbn/core/public';
import { ConfigSchema } from '../config';
import type { ConfigSchema } from '../server/config';
export type { IndexPatternSelectProps } from './index_pattern_select';
export type { QueryStringInputProps } from './query_string_input';
export { QueryStringInput } from './query_string_input';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/unified_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
import { APPLY_FILTER_TRIGGER } from '@kbn/data-plugin/public';
import { createQueryStringInput } from './query_string_input/get_query_string_input';
import { UPDATE_FILTER_REFERENCES_TRIGGER, updateFilterReferencesTrigger } from './triggers';
import { ConfigSchema } from '../config';
import type { ConfigSchema } from '../server/config';
import { setIndexPatterns, setTheme, setOverlays, setAnalytics, setI18n } from './services';
import { AutocompleteService } from './autocomplete/autocomplete_service';
import { createSearchBar } from './search_bar/create_search_bar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import moment from 'moment';
import { clone } from 'lodash';
import { CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/server';
import { registerRoutes } from './routes';
import { ConfigSchema } from '../../config';
import { ConfigSchema } from '../config';

export class AutocompleteService implements Plugin<void> {
private valueSuggestionsEnabled: boolean = true;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/unified_search/server/autocomplete/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { Observable } from 'rxjs';
import { CoreSetup } from '@kbn/core/server';
import { registerValueSuggestionsRoute } from './value_suggestions_route';
import { ConfigSchema } from '../../config';
import { ConfigSchema } from '../config';

export function registerRoutes({ http }: CoreSetup, config$: Observable<ConfigSchema>): void {
const router = http.createRouter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { coreMock } from '@kbn/core/server/mocks';
import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server';
import { ConfigSchema } from '../../config';
import { ConfigSchema } from '../config';
import type { DeeplyMockedKeys } from '@kbn/utility-types-jest';
import type { DataViewField, FieldSpec } from '@kbn/data-views-plugin/common';
import { termsAggSuggestions } from './terms_agg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/serve
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { getFieldSubtypeNested } from '@kbn/data-plugin/common';
import type { FieldSpec } from '@kbn/data-views-plugin/common';
import { ConfigSchema } from '../../config';
import { ConfigSchema } from '../config';
import { findIndexPatternById, getFieldByName } from '../data_views';

export async function termsAggSuggestions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { termsEnumSuggestions } from './terms_enum';
import { coreMock } from '@kbn/core/server/mocks';
import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server';
import { ConfigSchema } from '../../config';
import { ConfigSchema } from '../config';
import type { DeeplyMockedKeys } from '@kbn/utility-types-jest';
import { TermsEnumResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { DataViewField } from '@kbn/data-views-plugin/common';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/serve
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { FieldSpec } from '@kbn/data-views-plugin/common';
import { findIndexPatternById, getFieldByName } from '../data_views';
import { ConfigSchema } from '../../config';
import { ConfigSchema } from '../config';

export async function termsEnumSuggestions(
config: ConfigSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { IRouter } from '@kbn/core/server';
import { firstValueFrom, Observable } from 'rxjs';
import { getRequestAbortedSignal } from '@kbn/data-plugin/server';
import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server';
import type { ConfigSchema } from '../../config';
import type { ConfigSchema } from '../config';
import { termsEnumSuggestions } from './terms_enum';
import { termsAggSuggestions } from './terms_agg';

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/plugins/unified_search/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server';
import { ConfigSchema, configSchema } from '../config';
import { ConfigSchema, configSchema } from './config';
import type {
UnifiedSearchServerPlugin,
UnifiedSearchServerPluginSetup,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/unified_search/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import moment from 'moment';
import { Observable } from 'rxjs';
import { ConfigSchema } from '../config';
import { ConfigSchema } from './config';
import { AutocompleteSetup } from './autocomplete';

const autocompleteSetupMock: jest.Mocked<AutocompleteSetup> = {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/unified_search/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server';
import { ConfigSchema } from '../config';
import { ConfigSchema } from './config';
import { AutocompleteService } from './autocomplete';
import { AutocompleteSetup } from './autocomplete/autocomplete_service';

Expand Down
2 changes: 0 additions & 2 deletions src/plugins/unified_search/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
},
"include": [
"public/**/*",
"config.ts",
"public/**/*.json",
"server/**/*",
"config.ts",
],
"kbn_references": [
"@kbn/core",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { IRouter } from '@kbn/core/server';
import { UsageCounter } from '@kbn/usage-collection-plugin/server';
import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server';
import type { ConfigSchema } from '@kbn/unified-search-plugin/config';
import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config';
import { Observable } from 'rxjs';
import { GetAlertIndicesAlias, ILicenseState } from '../lib';
import { defineLegacyRoutes } from './legacy';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks';
import type { ConfigSchema } from '@kbn/unified-search-plugin/config';
import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config';
import { dataPluginMock } from '@kbn/unified-search-plugin/server/mocks';
import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg';
import { Observable } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IRouter } from '@kbn/core/server';
import { firstValueFrom, Observable } from 'rxjs';
import { getRequestAbortedSignal } from '@kbn/data-plugin/server';
import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg';
import type { ConfigSchema } from '@kbn/unified-search-plugin/config';
import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config';
import { UsageCounter } from '@kbn/usage-collection-plugin/server';
import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks';
import type { ConfigSchema } from '@kbn/unified-search-plugin/config';
import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config';
import { dataPluginMock } from '@kbn/unified-search-plugin/server/mocks';
import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg';
import { Observable } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IRouter } from '@kbn/core/server';
import { firstValueFrom, Observable } from 'rxjs';
import { getRequestAbortedSignal } from '@kbn/data-plugin/server';
import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg';
import type { ConfigSchema } from '@kbn/unified-search-plugin/config';
import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config';
import { UsageCounter } from '@kbn/usage-collection-plugin/server';
import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server';
import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server/src/saved_objects_index_pattern';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
RequestHandlerContext,
SavedObjectsClientContract,
} from '@kbn/core/server';
import type { ConfigSchema } from '@kbn/unified-search-plugin/config';
import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config';
import type { Observable } from 'rxjs';
import { dataPluginMock } from '@kbn/unified-search-plugin/server/mocks';
import { termsEnumSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_enum';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { firstValueFrom } from 'rxjs';
import type { RequestHandler, Logger } from '@kbn/core/server';
import type { TypeOf } from '@kbn/config-schema';
import { getRequestAbortedSignal } from '@kbn/data-plugin/server';
import type { ConfigSchema } from '@kbn/unified-search-plugin/config';
import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config';
import { termsEnumSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_enum';
import {
type EndpointSuggestionsBody,
Expand Down

0 comments on commit 232d7cf

Please sign in to comment.