import { ml } from '../services/ml_api_service' ; import { setUpgradeInProgress } from '../services/upgrade_service' ; import { MlCapabilitiesResponse } from '../../../common/types/capabilities' ; export function getCapabilities ( ) { return new Promise ( ( resolve , reject ) => { ml . checkMlCapabilities ( ) . then ( ( resp ) => { if ( resp . upgradeInProgress === true ) { setUpgradeInProgress ( true ) ; } resolve ( resp ) ; } ) . catch ( ( ) => { reject ( ) ; } ) ; } ) ; } export function getManageMlCapabilities ( ) { return new Promise ( ( resolve , reject ) => { ml . checkManageMLCapabilities ( ) . then ( ( resp ) => { if ( resp . upgradeInProgress === true ) { setUpgradeInProgress ( true ) ; } resolve ( resp ) ; } ) . catch ( ( ) => { reject ( ) ; } ) ; } ) ; }