From 5323642d5fbbf1d5e5ea1db90a93b5fac10bb1ac Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 5 Apr 2026 13:40:26 -0400 Subject: [PATCH] chore(release): 5.13.0 --- CHANGELOG.md | 14 ++++++++++++++ package.json | 2 +- test/unit/http-request.test.mts | 5 ++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e43460f8..9b0e31feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.13.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.13.0) - 2026-04-05 + +### Added — http-request + +- `readIncomingResponse()` — reads and buffers a Node.js `IncomingResponse` into an `HttpResponse` (#143) + - Useful for converting raw responses from code that bypasses `httpRequest()` (e.g. multipart form-data uploads) into the standard `HttpResponse` interface +- `IncomingResponse` type alias — disambiguates `IncomingMessage` as a client-side response +- `IncomingRequest` type alias — disambiguates `IncomingMessage` as a server-side request + +### Changed — http-request + +- Internal `httpRequestAttempt` callbacks now use `IncomingResponse` type +- `HttpResponse.rawResponse` type narrowed from `IncomingMessage` to `IncomingResponse` + ## [5.12.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.12.0) - 2026-04-04 ### Added — http-request diff --git a/package.json b/package.json index da2e7fb1f..fe0142b45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@socketsecurity/lib", - "version": "5.12.0", + "version": "5.13.0", "packageManager": "pnpm@10.33.0", "license": "MIT", "description": "Core utilities and infrastructure for Socket.dev security tools", diff --git a/test/unit/http-request.test.mts b/test/unit/http-request.test.mts index d20ba9280..57d41e213 100644 --- a/test/unit/http-request.test.mts +++ b/test/unit/http-request.test.mts @@ -2149,7 +2149,10 @@ abc123def456789012345678901234567890123456789012345678901234abcd expect(response.ok).toBe(true) expect(response.status).toBe(200) expect(response.statusText).toBe('OK') - expect(response.json()).toEqual({ message: 'Hello, World!', status: 'success' }) + expect(response.json()).toEqual({ + message: 'Hello, World!', + status: 'success', + }) expect(response.headers['content-type']).toBe('application/json') expect(response.rawResponse).toBe(msg) })