diff --git a/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx index 8d1d5285e29896..4dff27a1c061de 100644 --- a/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx +++ b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx @@ -86,7 +86,9 @@ function TimelionExpressionInput({ value, setValue }: TimelionExpressionInputPro const abortController = new AbortController(); if (kibana.services.http) { kibana.services.http - .get('../api/timelion/functions', { signal: abortController.signal }) + .get('../internal/timelion/functions', { + signal: abortController.signal, + }) .then((data) => { functionList.current = data; }); diff --git a/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts index a0885d792ad3fa..283998460111ff 100644 --- a/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts +++ b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts @@ -105,7 +105,7 @@ export function getTimelionRequestHandler({ const doSearch = async ( searchOptions: ReturnType ): Promise => { - return await http.post('/api/timelion/run', { + return await http.post('/internal/timelion/run', { body: JSON.stringify({ sheet: [expression], extended: { diff --git a/src/plugins/vis_types/timelion/server/routes/functions.ts b/src/plugins/vis_types/timelion/server/routes/functions.ts index 8fadb0d8345420..3023508884a1f7 100644 --- a/src/plugins/vis_types/timelion/server/routes/functions.ts +++ b/src/plugins/vis_types/timelion/server/routes/functions.ts @@ -13,7 +13,7 @@ import { LoadFunctions } from '../lib/load_functions'; export function functionsRoute(router: IRouter, { functions }: { functions: LoadFunctions }) { router.get( { - path: '/api/timelion/functions', + path: '/internal/timelion/functions', validate: false, }, async (context, request, response) => { diff --git a/src/plugins/vis_types/timelion/server/routes/run.ts b/src/plugins/vis_types/timelion/server/routes/run.ts index e136f1ab5a2419..9affe7cc64820e 100644 --- a/src/plugins/vis_types/timelion/server/routes/run.ts +++ b/src/plugins/vis_types/timelion/server/routes/run.ts @@ -37,7 +37,7 @@ export function runRoute( ) { router.post( { - path: '/api/timelion/run', + path: '/internal/timelion/run', validate: { body: schema.object({ sheet: schema.arrayOf(schema.string()), diff --git a/x-pack/plugins/canvas/public/functions/timelion.ts b/x-pack/plugins/canvas/public/functions/timelion.ts index ee3a9ca7c0351f..7ab272911389d8 100644 --- a/x-pack/plugins/canvas/public/functions/timelion.ts +++ b/x-pack/plugins/canvas/public/functions/timelion.ts @@ -132,7 +132,7 @@ export function timelionFunctionFactory(initialize: InitializeArguments): () => let result: any; try { - result = await fetch(initialize.prependBasePath(`/api/timelion/run`), { + result = await fetch(initialize.prependBasePath(`/internal/timelion/run`), { method: 'POST', responseType: 'json', data: body, diff --git a/x-pack/plugins/graph/public/helpers/use_graph_loader.ts b/x-pack/plugins/graph/public/helpers/use_graph_loader.ts index 0d50039ab97979..2b0b4b6d839e19 100644 --- a/x-pack/plugins/graph/public/helpers/use_graph_loader.ts +++ b/x-pack/plugins/graph/public/helpers/use_graph_loader.ts @@ -101,7 +101,7 @@ export const useGraphLoader = ({ toastNotifications, coreStart }: UseGraphLoader inspectRequest.json(dsl); return coreStart.http - .post<{ resp: estypes.GraphExploreResponse }>('../api/graph/graphExplore', request) + .post<{ resp: estypes.GraphExploreResponse }>('../internal/graph/graphExplore', request) .then(function (data) { const response = data.resp; @@ -136,7 +136,7 @@ export const useGraphLoader = ({ toastNotifications, coreStart }: UseGraphLoader inspectRequest.json(dsl); coreStart.http - .post<{ resp: estypes.GraphExploreResponse }>('../api/graph/searchProxy', request) + .post<{ resp: estypes.GraphExploreResponse }>('../internal/graph/searchProxy', request) .then(function (data) { const response = data.resp; inspectRequest.stats({}).ok({ json: response }); diff --git a/x-pack/plugins/graph/public/services/fetch_top_nodes.test.ts b/x-pack/plugins/graph/public/services/fetch_top_nodes.test.ts index 756ae270241183..700118a96011c4 100644 --- a/x-pack/plugins/graph/public/services/fetch_top_nodes.test.ts +++ b/x-pack/plugins/graph/public/services/fetch_top_nodes.test.ts @@ -33,7 +33,7 @@ describe('fetch_top_nodes', () => { aggregatable: true, }, ]); - expect(postMock).toHaveBeenCalledWith('../api/graph/searchProxy', { + expect(postMock).toHaveBeenCalledWith('../internal/graph/searchProxy', { body: JSON.stringify({ index: 'test', body: { diff --git a/x-pack/plugins/graph/public/services/fetch_top_nodes.ts b/x-pack/plugins/graph/public/services/fetch_top_nodes.ts index b0c6e09bbd9ff6..4b8496c62545ba 100644 --- a/x-pack/plugins/graph/public/services/fetch_top_nodes.ts +++ b/x-pack/plugins/graph/public/services/fetch_top_nodes.ts @@ -97,7 +97,7 @@ export async function fetchTopNodes( const body = createSamplerSearchBody(aggs); const response = ( - await post<{ resp: TopTermsAggResponse }>('../api/graph/searchProxy', { + await post<{ resp: TopTermsAggResponse }>('../internal/graph/searchProxy', { body: JSON.stringify({ index, body }), }) ).resp; diff --git a/x-pack/plugins/graph/server/routes/explore.ts b/x-pack/plugins/graph/server/routes/explore.ts index 6a6072e17274c4..b97f3fe882c356 100644 --- a/x-pack/plugins/graph/server/routes/explore.ts +++ b/x-pack/plugins/graph/server/routes/explore.ts @@ -26,7 +26,7 @@ export function registerExploreRoute({ }) { router.post( { - path: '/api/graph/graphExplore', + path: '/internal/graph/graphExplore', validate: { body: schema.object({ index: schema.string(), diff --git a/x-pack/plugins/graph/server/routes/search.ts b/x-pack/plugins/graph/server/routes/search.ts index 2bdb956196ed42..822b22648c7ccf 100644 --- a/x-pack/plugins/graph/server/routes/search.ts +++ b/x-pack/plugins/graph/server/routes/search.ts @@ -19,7 +19,7 @@ export function registerSearchRoute({ }) { router.post( { - path: '/api/graph/searchProxy', + path: '/internal/graph/searchProxy', validate: { body: schema.object({ index: schema.string(),