import { IMineMeldAPIService , IMineMeldAPIResource } from './minemeldapi' ; export interface IMinemeldSupervisorService { getStatus ( cancellable ? ) : angular . IPromise < any > ; startEngine ( ) : angular . IPromise < any > ; stopEngine ( ) : angular . IPromise < any > ; restartEngine ( ) : angular . IPromise < any > ; hupAPI ( ) : angular . IPromise < any > ; } export class MinemeldSupervisorService implements IMinemeldSupervisorService { $state : angular . ui . IStateService ; MineMeldAPIService : IMineMeldAPIService ; ngInject constructor ( $state , MineMeldAPIService ) { this . $state = $state ; this . MineMeldAPIService = MineMeldAPIService ; } public getStatus ( cancellable ? ) { var system ; if ( typeof cancellable === 'undefined' ) { cancellable = true ; } system = this . MineMeldAPIService . getAPIResource ( '/supervisor' , { } , { get : { method : 'GET' } } , cancellable ) ; return system . get ( ) . $promise . then ( ( result ) => { if ( 'result' in result ) { return result . result ; } return new Array ( ) ; } ) ; } public startEngine ( ) { var minemeld ; minemeld = this . MineMeldAPIService . getAPIResource ( '/supervisor/minemeld-engine/start' , { } , { get : { method : 'GET' } } , false ) ; return minemeld . get ( ) . $promise . then ( ( result ) => { if ( 'result' in result ) { return result . result ; } return new Array ( ) ; } ) ; } public stopEngine ( ) { var minemeld ; minemeld = this . MineMeldAPIService . getAPIResource ( '/supervisor/minemeld-engine/stop' , { } , { get : { method : 'GET' } } , false ) ; return minemeld . get ( ) . $promise . then ( ( result ) => { if ( 'result' in result ) { return result . result ; } return new Array ( ) ; } ) ; } public restartEngine ( ) { var minemeld ; minemeld = this . MineMeldAPIService . getAPIResource ( '/supervisor/minemeld-engine/restart' , { } , { get : { method : 'GET' } } , false ) ; return minemeld . get ( ) . $promise . then ( ( result ) => { if ( 'result' in result ) { return result . result ; } return new Array ( ) ; } ) ; } public hupAPI ( ) { var api ; api = this . MineMeldAPIService . getAPIResource ( '/supervisor/minemeld-web/hup' , { } , { get : { method : 'GET' } } , false ) ; return api . get ( ) . $promise . then ( ( result ) => { if ( result . result ) { return result . result ; } return undefined ; } ) ; } }