| 1 | export const STATUS_BY_KIND: Record<string, number> = { |
| 2 | bad_request: 400, |
| 3 | not_found: 404, |
| 4 | conflict: 409, |
| 5 | busy: 429, |
| 6 | too_large: 413, |
| 7 | unsupported: 415, |
| 8 | engine_stopped: 502, |
| 9 | upstream: 502, |
| 10 | unauthorized: 401, |
| 11 | forbidden: 403, |
| 12 | store_in_use: 409, |
| 13 | key_backup_exists: 409 |
| 14 | }; |
| 15 | |
| 16 | export function statusForKind(kind: string): number { |
| 17 | return STATUS_BY_KIND[kind] ?? 502; |
| 18 | } |