MCPcopy Create free account
hub / github.com/QuantiaAI/helm-agents / apiGetText

Function apiGetText

apps/web/src/api/client.ts:126–135  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

124
125/** Fetch raw text (used for the docs markdown endpoint). Returns null on 404. */
126export async function apiGetText(path: string): Promise<string | null> {
127 const send = () => fetch(apiUrl(path), { headers: authHeaders() });
128 let res = await send();
129 if (res.status === 401 && (await tryRefresh())) {
130 res = await send();
131 }
132 if (res.status === 404) return null;
133 if (!res.ok) throw new Error(`HTTP ${res.status}`);
134 return res.text();
135}
136
137/**
138 * Stream a run's NDJSON events as an async generator (one RunEvent per line).

Callers 1

DocFunction · 0.90

Calls 2

sendFunction · 0.85
tryRefreshFunction · 0.85

Tested by

no test coverage detected