import { IRouter } from '../../http' ; import { IOpenSearchDashboardsMigrator } from '../migrations' ; export const registerMigrateRoute = ( router , migratorPromise ) => { router . post ( { path : '/_migrate' , validate : false , options : { tags : [ 'access:migrateSavedObjects' ] , } , } , router . handleLegacyErrors ( async ( context , req , res ) => { const migrator = await migratorPromise ; await migrator . runMigrations ( { rerun : true } ) ; return res . ok ( { body : { success : true , } , } ) ; } ) ) ; } ;