Skip to content

Commit

Permalink
[UnifiedFieldList] Move routes under internal
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta committed May 16, 2023
1 parent 16941fd commit f0660ee
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/plugins/unified_field_list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ const hasData = hasFieldData(currentDataViewId, fieldName) // returns a boolean

## Server APIs

* `/api/unified_field_list/field_stats` - returns the loaded field stats (except for Ad-hoc data views)
* `/internal/unified_field_list/field_stats` - returns the loaded field stats (except for Ad-hoc data views)

* `/api/unified_field_list/existing_fields/{dataViewId}` - returns the loaded existing fields (except for Ad-hoc data views)
* `/internal/unified_field_list/existing_fields/{dataViewId}` - returns the loaded existing fields (except for Ad-hoc data views)

## Development

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/unified_field_list/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* Side Public License, v 1.
*/

export const BASE_API_PATH = '/api/unified_field_list';
export const BASE_API_PATH = '/internal/unified_field_list';
export const FIELD_STATS_API_PATH = `${BASE_API_PATH}/field_stats`;
export const FIELD_EXISTING_API_PATH = `${BASE_API_PATH}/existing_fields/{dataViewId}`;
3 changes: 3 additions & 0 deletions src/plugins/unified_field_list/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import { PluginStart } from '../types';
import { existingFieldsRoute } from './existing_fields';
import { initFieldStatsRoute } from './field_stats';

// These routes are defined only for running integration tests under
// test/api_integration/apis/unified_field_list
// UnifiedFieldList does not call these API - it uses only the client code.
export function defineRoutes(setup: CoreSetup<PluginStart>, logger: Logger) {
initFieldStatsRoute(setup);
existingFieldsRoute(setup, logger);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default ({ getService }: FtrProviderContext) => {
const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer');
const dataViewId = 'existence_index';
const API_PATH = `/api/unified_field_list/existing_fields/${dataViewId}`;
const API_PATH = `/internal/unified_field_list/existing_fields/${dataViewId}`;

describe('existing_fields apis', () => {
before(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default ({ getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const supertest = getService('supertest');
const API_PATH = '/api/unified_field_list/field_stats';
const API_PATH = '/internal/unified_field_list/field_stats';

describe('field stats apis', () => {
before(async () => {
Expand Down

0 comments on commit f0660ee

Please sign in to comment.