import { schema } from '@kbn/config-schema' ; import { skipBodyValidation } from '../../lib/route_config_helpers' ; import { RouteDependencies } from '../../plugin' ; export function registerDocumentsRoutes ( { router , enterpriseSearchRequestHandler , } ) { router . post ( skipBodyValidation ( { path : '/internal/app_search/engines/{engineName}/documents' , validate : { params : schema . object ( { engineName : schema . string ( ) , } ) , } , } ) , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/documents/new' , } ) ) ; } export function registerDocumentRoutes ( { router , enterpriseSearchRequestHandler , } ) { router . get ( { path : '/internal/app_search/engines/{engineName}/documents/{documentId}' , validate : { params : schema . object ( { engineName : schema . string ( ) , documentId : schema . string ( ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/documents/:documentId' , } ) ) ; router . delete ( { path : '/internal/app_search/engines/{engineName}/documents/{documentId}' , validate : { params : schema . object ( { engineName : schema . string ( ) , documentId : schema . string ( ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/as/engines/:engineName/documents/:documentId' , } ) ) ; }