import { Environment } from "@kumori/aurora-interfaces"; import { makeGlobalWebSocketRequest } from "../websocket-manager"; export const getReporting = async (env: Environment) => { try { const toDate = new Date(); const fromDate = new Date(); fromDate.setDate(fromDate.getDate() - 1); const from = fromDate.toISOString(); const to = toDate.toISOString(); const requestBody = { tenant: env.tenant, account: env.account, environment: env.name, type: 'historical', from: from, to: to }; const response = await makeGlobalWebSocketRequest( "reporting:get_reporting", requestBody, 30000, "GET", "REPORTING" ); return response.data; } catch (error) { console.error('Error obtaining the reporting data for ', env); throw error; } };