Skip to content

Commit 0f493fa

Browse files
authored
[data.search] Move SearchSource to common directory. (#77823)
1 parent bf26dff commit 0f493fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+206
-112
lines changed

src/plugins/data/common/search/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
export * from './aggs';
2121
export * from './es_search';
2222
export * from './expressions';
23+
export * from './search_source';
2324
export * from './tabify';
2425
export * from './types';
25-
export * from './es_search';

src/plugins/data/public/search/search_source/create_search_source.test.ts renamed to src/plugins/data/common/search/search_source/create_search_source.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
import { createSearchSource as createSearchSourceFactory } from './create_search_source';
2121
import { SearchSourceDependencies } from './search_source';
22-
import { IIndexPattern } from '../../../common/index_patterns';
22+
import { IIndexPattern } from '../../index_patterns';
2323
import { IndexPatternsContract } from '../../index_patterns/index_patterns';
24-
import { Filter } from '../../../common/es_query/filters';
24+
import { Filter } from '../../es_query/filters';
2525
import { BehaviorSubject } from 'rxjs';
2626

2727
describe('createSearchSource', () => {

src/plugins/data/public/search/search_source/extract_references.ts renamed to src/plugins/data/common/search/search_source/extract_references.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { SavedObjectReference } from '../../../../../core/types';
21-
import { Filter } from '../../../common/es_query/filters';
20+
import { SavedObjectReference } from 'src/core/types';
21+
import { Filter } from '../../es_query/filters';
2222
import { SearchSourceFields } from './types';
2323

2424
export const extractReferences = (

src/plugins/data/public/search/fetch/get_search_params.test.ts renamed to src/plugins/data/common/search/search_source/fetch/get_search_params.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
* under the License.
1818
*/
1919

20+
import { UI_SETTINGS } from '../../../constants';
21+
import { GetConfigFn } from '../../../types';
2022
import { getSearchParams } from './get_search_params';
21-
import { GetConfigFn, UI_SETTINGS } from '../../../common';
2223

2324
function getConfigStub(config: any = {}): GetConfigFn {
2425
return (key) => config[key];

src/plugins/data/public/search/fetch/get_search_params.ts renamed to src/plugins/data/common/search/search_source/fetch/get_search_params.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
* under the License.
1818
*/
1919

20-
import { UI_SETTINGS, ISearchRequestParams, GetConfigFn } from '../../../common';
20+
import { UI_SETTINGS } from '../../../constants';
21+
import { GetConfigFn } from '../../../types';
22+
import { ISearchRequestParams } from '../../index';
2123
import { SearchRequest } from './types';
2224

2325
const sessionId = Date.now();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export { getSearchParams, getSearchParamsFromRequest, getPreference } from './get_search_params';
21+
export { RequestFailure } from './request_error';
22+
export * from './types';

src/plugins/data/public/search/fetch/request_error.ts renamed to src/plugins/data/common/search/search_source/fetch/request_error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { SearchResponse } from 'elasticsearch';
21-
import { KbnError } from '../../../../kibana_utils/common';
21+
import { KbnError } from '../../../../../kibana_utils/common';
2222
import { SearchError } from './types';
2323

2424
/**

src/plugins/data/public/search/fetch/types.ts renamed to src/plugins/data/common/search/search_source/fetch/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919

2020
import { SearchResponse } from 'elasticsearch';
21-
import { GetConfigFn } from '../../../common';
2221
import { LegacyFetchHandlers } from '../legacy/types';
22+
import { GetConfigFn } from '../../../types';
2323

2424
/**
2525
* @internal

0 commit comments

Comments
 (0)