import { IRouter } from '../../../http' ; import { catchAndReturnBoomErrors } from '../utils' ; import { deleteUnknownTypeObjects } from '../../deprecations' ; interface RouteDependencies { kibanaIndex : string ; kibanaVersion : string ; } export const registerDeleteUnknownTypesRoute = ( router , { kibanaIndex , kibanaVersion } ) => { router . post ( { path : '/deprecations/_delete_unknown_types' , validate : false , } , catchAndReturnBoomErrors ( async ( context , req , res ) => { await deleteUnknownTypeObjects ( { esClient : context . core . elasticsearch . client , typeRegistry : context . core . savedObjects . typeRegistry , kibanaIndex , kibanaVersion , } ) ; return res . ok ( { body : { success : true , } , } ) ; } ) ) ; } ;