import { schema } from '@kbn/config-schema' ; import { skipBodyValidation } from '../../lib/route_config_helpers' ; import { RouteDependencies } from '../../plugin' ; export function registerSynonymsRoutes ( { router , enterpriseSearchRequestHandler , } ) { router . get ( { path : '/internal/app_search/engines/{engineName}/synonyms' , validate : { params : schema . object ( { engineName : schema . string ( ) , } ) , query : schema . object ( { 'page[current]' : schema . number ( ) , 'page[size]' : schema . number ( ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/synonyms/collection' , } ) ) ; router . post ( skipBodyValidation ( { path : '/internal/app_search/engines/{engineName}/synonyms' , validate : { params : schema . object ( { engineName : schema . string ( ) , } ) , } , } ) , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/synonyms/collection' , } ) ) ; router . put ( skipBodyValidation ( { path : '/internal/app_search/engines/{engineName}/synonyms/{synonymId}' , validate : { params : schema . object ( { engineName : schema . string ( ) , synonymId : schema . string ( ) , } ) , } , } ) , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/synonyms/:synonymId' , } ) ) ; router . delete ( { path : '/internal/app_search/engines/{engineName}/synonyms/{synonymId}' , validate : { params : schema . object ( { engineName : schema . string ( ) , synonymId : schema . string ( ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/synonyms/:synonymId' , } ) ) ; }