Spaces:
Sleeping
Sleeping
Download frontend/src/api/streams.ts from DAG-UPB/HeatTransPlan: direct link, hf CLI and curl.
- Browser
- Download file 971 Bytes
-
https://huggingface.co/spaces/DAG-UPB/HeatTransPlan/resolve/main/frontend/src/api/streams.ts
- Command line
-
hf download hf://spaces/DAG-UPB/HeatTransPlan/frontend/src/api/streams.ts
-
curl -L -o streams.ts https://huggingface.co/spaces/DAG-UPB/HeatTransPlan/resolve/main/frontend/src/api/streams.ts
971 Bytes
| import client from './client'; | |
| import type { Stream } from '../types/stream'; | |
| export async function addStream(projectId: string, procIdx: number, stream?: Stream) { | |
| const res = await client.post(`/api/procs/${projectId}/${procIdx}/streams`, stream ?? null); | |
| return res.data; | |
| } | |
| export async function updateStream(projectId: string, procIdx: number, streamIdx: number, stream: Stream) { | |
| const res = await client.put(`/api/streams/${projectId}/${procIdx}/${streamIdx}`, stream); | |
| return res.data; | |
| } | |
| export async function deleteStream(projectId: string, procIdx: number, streamIdx: number) { | |
| const res = await client.delete(`/api/streams/${projectId}/${procIdx}/${streamIdx}`); | |
| return res.data; | |
| } | |
| export async function addChildStream( | |
| projectId: string, procIdx: number, childIdx: number, stream?: Stream | |
| ) { | |
| const res = await client.post( | |
| `/api/procs/${projectId}/${procIdx}/children/${childIdx}/streams`, | |
| stream ?? null | |
| ); | |
| return res.data; | |
| } | |