import { schema } from '@kbn/config-schema' ; import { RouteDependencies } from '../../plugin' ; const querySchema = { start : schema . maybe ( schema . string ( ) ) , end : schema . maybe ( schema . string ( ) ) , tag : schema . maybe ( schema . string ( ) ) , } ; const queriesSchema = { ... querySchema , size : schema . maybe ( schema . number ( ) ) , } ; export function registerAnalyticsRoutes ( { router , enterpriseSearchRequestHandler , } ) { router . get ( { path : '/internal/app_search/engines/{engineName}/analytics/queries' , validate : { params : schema . object ( { engineName : schema . string ( ) , } ) , query : schema . object ( queriesSchema ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/analytics/queries' , } ) ) ; router . get ( { path : '/internal/app_search/engines/{engineName}/analytics/queries/{query}' , validate : { params : schema . object ( { engineName : schema . string ( ) , query : schema . string ( ) , } ) , query : schema . object ( querySchema ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/analytics/query/:query' , } ) ) ; }