moving visualizations team owned paths to /internal (#157984)

This commit is contained in:
Peter Pisljar 2023-05-29 16:58:41 +02:00 committed by GitHub
parent f28b694e5a
commit fb4946d0a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 11 deletions

View file

@ -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;
});

View file

@ -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: {

View file

@ -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) => {

View file

@ -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()),

View file

@ -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,

View file

@ -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 });

View file

@ -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: {

View file

@ -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;

View file

@ -26,7 +26,7 @@ export function registerExploreRoute({
}) {
router.post(
{
path: '/api/graph/graphExplore',
path: '/internal/graph/graphExplore',
validate: {
body: schema.object({
index: schema.string(),

View file

@ -19,7 +19,7 @@ export function registerSearchRoute({
}) {
router.post(
{
path: '/api/graph/searchProxy',
path: '/internal/graph/searchProxy',
validate: {
body: schema.object({
index: schema.string(),