web: remove duplicated D3 block in client-api.ts
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 changed file +0 −26
modified
apps/web/src/lib/client-api.ts
+0 −26
@@ -72,29 +72,3 @@ export async function clientTry(path: string, signal?: AbortSignal): Promise<{ s | ||
| 72 | 72 | return { status: res.status, ms: Math.round(performance.now() - t0), body, headers }; |
| 73 | 73 | } |
| 74 | 74 | // ---- /D3 ---- |
| 75 | − | |
| 76 | −// ---- D3 (temporal/graph/admin) ---- | |
| 77 | −import type { GraphExploreMode, GraphExplorePayload } from './types'; | |
| 78 | −/** Graph explorer: root change and progressive neighbourhood expansion (merged client-side). */ | |
| 79 | −export function clientGraphExplore(node: string, mode: GraphExploreMode, depth: 1 | 2 = 1, limit = 150, signal?: AbortSignal): Promise<GraphExplorePayload> { | |
| 80 | − return get<GraphExplorePayload>(`/graph/explore?node=${enc(node)}&mode=${enc(mode)}&depth=${depth}&limit=${limit}`, signal); | |
| 81 | −} | |
| 82 | −/** Same-origin GET of any public route for the /developers request builder (returns status + parsed body or text). */ | |
| 83 | −export async function clientTry(path: string, signal?: AbortSignal): Promise<{ status: number; ms: number; body: unknown; headers: Record<string, string> }> { | |
| 84 | − const t0 = performance.now(); | |
| 85 | − const res = await fetch(`/api/v1${path}`, { headers: { accept: 'application/json' }, signal }); | |
| 86 | − const text = await res.text(); | |
| 87 | − let body: unknown = text; | |
| 88 | − try { | |
| 89 | − body = JSON.parse(text); | |
| 90 | − } catch { | |
| 91 | − /* keep text */ | |
| 92 | − } | |
| 93 | − const headers: Record<string, string> = {}; | |
| 94 | − for (const k of ['x-api-version', 'etag', 'cache-control', 'content-type']) { | |
| 95 | − const v = res.headers.get(k); | |
| 96 | − if (v) headers[k] = v; | |
| 97 | − } | |
| 98 | − return { status: res.status, ms: Math.round(performance.now() - t0), body, headers }; | |
| 99 | −} | |
| 100 | −// ---- /D3 ---- | |
| 101 | 75 | |