| 47 | }, |
| 48 | |
| 49 | async updateCredential(slug: string, input: { vendor: string; label?: string; wires: Partial<Record<WireShape, string>>; apiKey?: string; lastModel?: string }): Promise<void> { |
| 50 | const res = await fetch(`/api/config/credentials/${encodeURIComponent(slug)}`, { method: 'PUT', headers, body: JSON.stringify(input) }) |
| 51 | if (!res.ok) { |
| 52 | const err = await res.json().catch(() => ({ error: 'Failed to update credential' })) |
| 53 | throw new Error(err.error || 'Failed to update credential') |
| 54 | } |
| 55 | }, |
| 56 | |
| 57 | async deleteCredential(slug: string): Promise<void> { |
| 58 | const res = await fetch(`/api/config/credentials/${encodeURIComponent(slug)}`, { method: 'DELETE' }) |