import { toQueryString } from "../../utils" ; import { SdkClient } from "../common/sdk-client" ; import { KPICalculationModels } from "./kpi-models" ; see https export class extends SdkClient export class KPICalculationClient extends SdkClient { private _baseUrl : string = "/api/kpicalculation/v3" ; param { KPICalculationModels . Timeseries } timeseries param { { from : Date ; to : Date ; variableName : string ; initialState : string ; * } } params param params . from param params . to param params . variableName param params . initialState see https returns { Promise < KPICalculationModels . KpiSet > } memberOf async ComputeKPI ( timeseries , params ) { return ( await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/computekpi?${ toQueryString ( params ) }` , body : timeseries , } ) ) as KPICalculationModels . KpiSet ; } see https param { KPICalculationModels . RequestParametersBundle } requestParametersBundle param { { from : Date ; to : Date ; variableName : string ; initialState : string ; defaultState : string ; threshold : number ; shutdownCorrelationThreshold : number ; * } } params param params . from param params . to param params . variableName param params . initialState param params . defaultState param params . threshold param params . shutdownCorrelationThreshold returns { Promise < KPICalculationModels . KpiStateIndicationSet > } memberOf async CaclulateKpiStates ( requestParametersBundle , params ) { return ( await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/calculatekpistates?${ toQueryString ( params ) }` , body : requestParametersBundle , } ) ) as KPICalculationModels . KpiStateIndicationSet ; } see https param { KPICalculationModels . RequestParametersBundle } requestParametersBundle param { { from : Date ; to : Date ; assetId : string ; aspectName : string ; variableName : string ; initialState : string ; defaultState : string ; threshold : number ; shutdownCorrelationThreshold : number ; * } } params param params . from param params . to param params . assetId param params . aspectName param params . variableName param params . initialState param params . defaultState param params . threshold param params . shutdownCorrelationThreshold returns { Promise < KPICalculationModels . KpiStateIndicationSet > } memberOf async CalculateKpiStatesDirect ( requestParametersBundle , params ) { return ( await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/calculatekpistatesDirect?${ toQueryString ( params ) }` , body : requestParametersBundle , } ) ) as KPICalculationModels . KpiStateIndicationSet ; } }