INNER CODE UNIT · TypeScript

body

tomascupr/sandstorm · clients/typescript/src/index.ts:53

      const body = await resp.text().catch(() => "");
      throw new Error(`POST /query failed: ${resp.status} ${resp.statusText} — ${body}`);
    }
    if (!resp.body) {
      throw new Error("POST /query returned no body");
    }
    yield* parseSSEStream(resp.body);
  }

  async health(): Promise<HealthResponse> {
    const resp = await this.fetchImpl(`${this.baseUrl}/health`);
    if (!resp.ok) {
      throw new Error(`GET /health failed: ${resp.status} ${resp.statusText}`);
    }
    return (await resp.json()) as HealthResponse;
  }

  async listRuns(limit = 50): Promise<Run[]> {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…