import { first } from 'rxjs/operators' ; import type { RouteDefinitionParams } from '.' ; export function defineStatusRoute ( { router , elasticsearch , preboot } ) { router . get ( { path : '/internal/interactive_setup/status' , validate : false , options : { authRequired : false } , } , async ( context , request , response ) => { const connectionStatus = await elasticsearch . connectionStatus$ . pipe ( first ( ) ) . toPromise ( ) ; return response . ok ( { body : { connectionStatus , isSetupOnHold : preboot . isSetupOnHold ( ) , } , } ) ; } ) ; }