@socketsecurity/lib 5.11.4 → 5.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.13.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.13.0) - 2026-04-05
9
+
10
+ ### Added — http-request
11
+
12
+ - `readIncomingResponse()` — reads and buffers a Node.js `IncomingResponse` into an `HttpResponse` (#143)
13
+ - Useful for converting raw responses from code that bypasses `httpRequest()` (e.g. multipart form-data uploads) into the standard `HttpResponse` interface
14
+ - `IncomingResponse` type alias — disambiguates `IncomingMessage` as a client-side response
15
+ - `IncomingRequest` type alias — disambiguates `IncomingMessage` as a server-side request
16
+
17
+ ### Changed — http-request
18
+
19
+ - Internal `httpRequestAttempt` callbacks now use `IncomingResponse` type
20
+ - `HttpResponse.rawResponse` type narrowed from `IncomingMessage` to `IncomingResponse`
21
+
22
+ ## [5.12.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.12.0) - 2026-04-04
23
+
24
+ ### Added — http-request
25
+
26
+ - Lifecycle hooks (`onRequest`/`onResponse`) on `HttpRequestOptions` (#133)
27
+ - Fire per-attempt — retries and redirects each trigger separate hook calls
28
+ - `HttpHooks`, `HttpHookRequestInfo`, `HttpHookResponseInfo` types exported
29
+ - `maxResponseSize` option to reject responses exceeding a byte limit
30
+ - Works through redirects, `httpJson`, and `httpText`
31
+ - `rawResponse` property on `HttpResponse` exposing the underlying `IncomingMessage`
32
+ - `enrichErrorMessage()` exported for reusable error enrichment
33
+
34
+ ### Changed — http-request
35
+
36
+ - Error messages now include HTTP method and URL for easier debugging
37
+ - `HttpResponse.headers` type changed from `Record<string, string | string[] | undefined>` to `IncomingHttpHeaders`
38
+
8
39
  ## [5.11.4](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.4) - 2026-03-28
9
40
 
10
41
  ### Changed