|
| 1 | +## 1.1.0 — 2026-04-13 |
| 2 | + |
| 3 | +### Added |
| 4 | + |
| 5 | +**SSE (Server-Sent Events)** |
| 6 | + |
| 7 | +- `hurl.sse(url, options)` — fetch-based SSE client that works where native `EventSource` cannot: supports POST requests, custom headers, Bearer/Basic/API key auth, `baseUrl`, and query params |
| 8 | +- Parses the full `text/event-stream` wire format — `data`, `event`, `id`, and `retry` fields |
| 9 | +- Handles the `data: [DONE]` sentinel used by OpenAI, Anthropic, and other AI APIs — fires `onDone` and closes cleanly |
| 10 | +- Returns `{ close() }` synchronously so you can cancel the stream at any time |
| 11 | +- Respects an external `AbortSignal` passed via `options.signal` |
| 12 | +- `SSEOptions` and `SSEEvent` types are exported |
| 13 | + |
| 14 | +**Circuit Breaker** |
| 15 | + |
| 16 | +- `circuitBreaker` option on both per-request options and instance defaults |
| 17 | +- Three-state machine: CLOSED → OPEN → HALF_OPEN → CLOSED |
| 18 | +- `threshold` — number of consecutive failures before the circuit opens |
| 19 | +- `cooldown` — how long (ms) to wait before allowing a probe request through |
| 20 | +- `key` — optional custom key for the breaker; defaults to the URL origin so all requests to the same host share one breaker |
| 21 | +- `fallback` — optional function that returns a value to use when the circuit is open instead of throwing |
| 22 | +- When the circuit is open and no fallback is set, throws a `HurlError` with type `CIRCUIT_OPEN` |
| 23 | +- Aborted requests and circuit-open errors do not count as failures |
| 24 | +- `getCircuitStats(key)` exported from the main entry point for observability |
| 25 | +- `CIRCUIT_OPEN` added to the `HurlErrorType` union |
| 26 | + |
| 27 | + |
| 28 | +--- |
| 29 | + |
1 | 30 | ## 1.0.7 — 2026-03-07 |
2 | 31 |
|
3 | 32 | ### Fixed |
|
27 | 56 | ### Contributors |
28 | 57 | - HeavstalTech: signal fix, cache hardening, test suite |
29 | 58 |
|
30 | | - |
31 | | - |
32 | 59 | ## 1.0.4 |
33 | 60 |
|
34 | 61 | - Fixed stream buffering — response body no longer loaded into memory when `stream: true`, body is returned as raw `ReadableStream` for the caller to pipe directly to disk |
|
0 commit comments