Spaces:
Sleeping
Sleeping
Download frontend/src/api/analysis.ts from DAG-UPB/HeatTransPlan: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/spaces/DAG-UPB/HeatTransPlan/resolve/main/frontend/src/api/analysis.ts
- Command line
-
hf download hf://spaces/DAG-UPB/HeatTransPlan/frontend/src/api/analysis.ts
-
curl -L -o analysis.ts https://huggingface.co/spaces/DAG-UPB/HeatTransPlan/resolve/main/frontend/src/api/analysis.ts
1.17 kB
| /** API client for analysis endpoints. */ | |
| import client from './client'; | |
| import type { | |
| PinchRequest, | |
| PinchResult, | |
| HPIRequest, | |
| HPIResult, | |
| StatusQuoRequest, | |
| StatusQuoResult, | |
| } from '../types/analysis'; | |
| export async function runPinch(req: PinchRequest): Promise<PinchResult> { | |
| const { data } = await client.post<PinchResult>('/api/analysis/pinch', req); | |
| return data; | |
| } | |
| export async function runHPI(req: HPIRequest): Promise<HPIResult> { | |
| const { data } = await client.post<HPIResult>('/api/analysis/hpi', req); | |
| return data; | |
| } | |
| export async function runStatusQuo(req: StatusQuoRequest): Promise<StatusQuoResult> { | |
| const { data } = await client.post<StatusQuoResult>('/api/analysis/status-quo', req); | |
| return data; | |
| } | |
| export async function generateReport(payload: Record<string, unknown>): Promise<Blob> { | |
| const { data } = await client.post('/api/analysis/report', payload, { | |
| responseType: 'blob', | |
| }); | |
| return data as Blob; | |
| } | |
| export async function getMapPreview(payload: Record<string, unknown>): Promise<{ map_b64: string }> { | |
| const { data } = await client.post<{ map_b64: string }>('/api/analysis/map-preview', payload); | |
| return data; | |
| } | |