import { HttpService } from '../http_service' ; import { ML_BASE_PATH } from '../../../../common/constants/app' ; import { MlAnomalyDetectionAlertParams , PreviewResponse } from '../../../../common/types/alerts' ; export type AlertingApiService = ReturnType < typeof alertingApiProvider > ; export const alertingApiProvider = ( httpService ) => { return { preview ( params ) { const body = JSON . stringify ( params ) ; return httpService . http < PreviewResponse > ( { path : `${ ML_BASE_PATH }/alerting/preview` , method : 'POST' , body , } ) ; } , } ; } ;