Skip to content

Commit

Permalink
moving visualizations team owned paths to /internal (#157984)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar authored May 29, 2023
1 parent f28b694 commit fb4946d
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ function TimelionExpressionInput({ value, setValue }: TimelionExpressionInputPro
const abortController = new AbortController();
if (kibana.services.http) {
kibana.services.http
.get<ITimelionFunction[]>('../api/timelion/functions', { signal: abortController.signal })
.get<ITimelionFunction[]>('../internal/timelion/functions', {
signal: abortController.signal,
})
.then((data) => {
functionList.current = data;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function getTimelionRequestHandler({
const doSearch = async (
searchOptions: ReturnType<typeof dataSearch.session.getSearchOptions>
): Promise<TimelionSuccessResponse> => {
return await http.post('/api/timelion/run', {
return await http.post('/internal/timelion/run', {
body: JSON.stringify({
sheet: [expression],
extended: {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_types/timelion/server/routes/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_types/timelion/server/routes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/functions/timelion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/graph/public/helpers/use_graph_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/graph/public/services/fetch_top_nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/graph/server/routes/explore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function registerExploreRoute({
}) {
router.post(
{
path: '/api/graph/graphExplore',
path: '/internal/graph/graphExplore',
validate: {
body: schema.object({
index: schema.string(),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/graph/server/routes/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function registerSearchRoute({
}) {
router.post(
{
path: '/api/graph/searchProxy',
path: '/internal/graph/searchProxy',
validate: {
body: schema.object({
index: schema.string(),
Expand Down

0 comments on commit fb4946d

Please sign in to comment.