@shivaedev/http 0.9.0 → 0.9.2
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 +12 -0
- package/README.md +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.2 - 2026-11-20
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Update `@shivaedev/errors` from 0.14.0 to 0.14.1.
|
|
8
|
+
|
|
9
|
+
## 0.9.1 - 2026-11-20
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- the `bodyExcerpt` and `message` of a status failure mask secrets in JSON escaped inside the remote's error body, such as `{"error":"{\"access_token\":\"…\"}"}`, which they previously carried in plain text.
|
|
14
|
+
|
|
3
15
|
## 0.9.0 - 2026-11-20
|
|
4
16
|
|
|
5
17
|
### Added
|
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Failures are `ReadClientError` from `readClient.ts`, with the configured `source
|
|
|
61
61
|
|
|
62
62
|
`filterStatus(client)` passes 2xx responses through and fails other statuses with Schema tagged errors from `errors.ts`: `RemoteUnauthorized` (401), `RemoteNotFound` (404), `RemoteGone` (410), `RemoteRateLimited` (429, or 503 carrying `Retry-After`) and `RemoteHttpError` for other statuses. Errors carry the method, the URL without userinfo, query string or fragment, the status and an optional `bodyExcerpt`, without headers. Their `message` reads `HTTP 400: POST api.example/token: {"error":"invalid_grant"}`, ending with the excerpt when there is one.
|
|
63
63
|
|
|
64
|
-
The excerpt is the remote's own explanation, read from the error response only, never from a 2xx answer. At most the first 2048 bytes are read; reading stops there and releases the rest of the body, and a cut drops its last partial word and ends with `…`. Whitespace runs collapse to one space. The text then passes through `redactText` from `@shivaedev/errors/sensitive.ts` with its default sensitive keys, so secrets such as `"access_token":"…"` values and `Bearer` credentials read `<redacted>`. A body that is empty, not UTF-8 or contains control bytes has no excerpt. If the body fails, was already read, or has not ended or reached 2048 bytes within one second of Effect's clock, the status failure is reported without an excerpt. `RemoteRateLimited.retryAfter` is an optional UTC `DateTime`: delay-seconds use Effect's clock, and HTTP dates name the instant directly. Missing or invalid values leave it undefined; `parseRetryAfter(header, now)` exposes the same parsing.
|
|
64
|
+
The excerpt is the remote's own explanation, read from the error response only, never from a 2xx answer. At most the first 2048 bytes are read; reading stops there and releases the rest of the body, and a cut drops its last partial word and ends with `…`. Whitespace runs collapse to one space. The text then passes through `redactText` from `@shivaedev/errors/sensitive.ts` with its default sensitive keys, so secrets such as `"access_token":"…"` values, also when the JSON is escaped inside a string as `\"access_token\":\"…\"`, and `Bearer` credentials read `<redacted>`. A body that is empty, not UTF-8 or contains control bytes has no excerpt. If the body fails, was already read, or has not ended or reached 2048 bytes within one second of Effect's clock, the status failure is reported without an excerpt. `RemoteRateLimited.retryAfter` is an optional UTC `DateTime`: delay-seconds use Effect's clock, and HTTP dates name the instant directly. Missing or invalid values leave it undefined; `parseRetryAfter(header, now)` exposes the same parsing.
|
|
65
65
|
|
|
66
66
|
`checkStatus(response)` from `checkStatus.ts` applies the same status mapping to an existing native response. `filterStatus` delegates to it. Use `isRemoteStatusError(error)` from `errors.ts` to recognize any of these typed status failures.
|
|
67
67
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/http",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Bounded HTTP bodies, status failures and paginated clients over Effect HTTP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"effect"
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"README.md"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@shivaedev/errors": "0.
|
|
48
|
+
"@shivaedev/errors": "0.14.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@effect/platform-node": "4.1.4",
|
|
52
|
-
"@shivaedev/quality": "0.
|
|
53
|
-
"@shivaedev/test-story": "0.
|
|
52
|
+
"@shivaedev/quality": "0.81.1",
|
|
53
|
+
"@shivaedev/test-story": "0.50.2",
|
|
54
54
|
"@types/node": "24.19.2",
|
|
55
55
|
"effect": "4.1.4",
|
|
56
56
|
"typescript": "7.0.2",
|