feat(indices): add authenticated OpenFIGI search

Add the bounded OpenFIGI v3 adapter, authenticated search route, and server-side configuration.

Refs #3

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 22:31:35 +01:00
parent 461f525f20
commit 5cb45138df
15 changed files with 741 additions and 16 deletions

View File

@ -1,5 +1,12 @@
const BASE = '/api'
export class ApiError extends Error {
constructor(message: string, public readonly status: number) {
super(message)
this.name = 'ApiError'
}
}
function getToken() {
return localStorage.getItem('token')
}
@ -22,7 +29,7 @@ async function request<T>(path: string, options: RequestInit = {}): Promise<T> {
}
if (!res.ok) {
const err = await res.json().catch(() => ({ error: res.statusText }))
throw new Error(err.error || res.statusText)
throw new ApiError(err.error || res.statusText, res.status)
}
if (res.status === 204) return undefined as T
const json = await res.json()