| 317 | // Returns the raw Response for every status; the oRPC fetch wrapper (orpc.ts) inspects the |
| 318 | // status and raises classifyResponse for non-2xx, so error mapping stays in one place. |
| 319 | const requestFetch = (req: Request, init?: RequestInit): Promise<Response> => { |
| 320 | const method = req.method.toUpperCase() as HttpMethod |
| 321 | const resolved: ResolvedOptions = { |
| 322 | method, |
| 323 | headers: req.headers, |
| 324 | body: undefined, |
| 325 | timeoutMs: state.defaultTimeoutMs, |
| 326 | retryAttempts: state.defaultRetryAttempts, |
| 327 | throwOnError: false, |
| 328 | retryOnRateLimit: false, |
| 329 | } |
| 330 | const userSignal = init?.signal ?? req.signal |
| 331 | return execute(state, req, resolved, state.defaultTimeoutMs, userSignal) |
| 332 | } |
| 333 | |
| 334 | const extend = (overrides: Partial<ClientOptions>): HttpClient => createHttpClient({ ...state.originalOptions, ...overrides }) |
| 335 | |