import { FetchDataParams , HasDataParams , UxFetchDataResponse , UXHasDataResponse , } from '../../../../../observability/public/' ; import { callApmApi } from '../../../services/rest/createCallApmApi' ; export { createCallApmApi } from '../../../services/rest/createCallApmApi' ; export const fetchUxOverviewDate = async ( { absoluteTime , relativeTime , serviceName , } ) : Promise < UxFetchDataResponse > => { const data = await callApmApi ( { endpoint : 'GET /internal/apm/ux/web-core-vitals' , signal : null , params : { query : { start : new Date ( absoluteTime . start ) . toISOString ( ) , end : new Date ( absoluteTime . end ) . toISOString ( ) , uiFilters : `{"serviceName":["${ serviceName }"]}` , } , } , } ) ; return { coreWebVitals : data , appLink : `/app/ux?rangeFrom=${ relativeTime . start }&rangeTo=${ relativeTime . end }` , } ; } ; export async function hasRumData ( params ) { return await callApmApi ( { endpoint : 'GET /api/apm/observability_overview/has_rum_data' , signal : null , params : { query : params ?. absoluteTime ? { start : new Date ( params . absoluteTime . start ) . toISOString ( ) , end : new Date ( params . absoluteTime . end ) . toISOString ( ) , uiFilters : '' , } : undefined , } , } ) ; }