@tcds-io/http-client 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @tcds-io/http-client
2
2
 
3
- A JSON `fetch` client for partner APIs, with a test double. It throws [`@tcds-io/errors`](../errors) errors that carry the partner, the status and a redacted excerpt, and tells a request that will never pass (4xx) from one worth retrying (5xx, 429, timeout).
3
+ A JSON `fetch` client for partner APIs, with a test double. It throws [`@tcds-io/domain`](../domain) errors that carry the partner, the status and a redacted excerpt, and tells a request that will never pass (4xx) from one worth retrying (5xx, 429, timeout).
4
4
 
5
5
  ```ts
6
6
  import { JsonHttpClient, multipart } from '@tcds-io/http-client';
@@ -39,4 +39,4 @@ It runs the real client over a fake `fetch`, so a stubbed `429` or `400` becomes
39
39
 
40
40
  ## Peers
41
41
 
42
- `@tcds-io/errors` and `@tcds-io/redact` are peer dependencies: install them yourself so `instanceof` and `Secret` work across the app (ADR-0070).
42
+ `@tcds-io/domain` and `@tcds-io/redact` are peer dependencies: install them yourself so `instanceof` and `Secret` work across the app (ADR-0070).
@@ -1,4 +1,4 @@
1
- import { AppError } from '@tcds-io/errors';
1
+ import { AppError } from '@tcds-io/domain';
2
2
  import { Secret, type Redactor } from '@tcds-io/redact';
3
3
  import type { HttpClient, HttpRequest, HttpResponse } from './types.js';
4
4
  export type JsonHttpClientOptions = {
@@ -1,4 +1,4 @@
1
- import { AppError, ExternalPartyError, RateLimitedError, RefusedByExternalPartyError } from '@tcds-io/errors';
1
+ import { AppError, ExternalPartyError, RateLimitedError, RefusedByExternalPartyError } from '@tcds-io/domain';
2
2
  import { createRedactor, redactHeaders, Secret } from '@tcds-io/redact';
3
3
  import { MultipartBody } from './multipart.js';
4
4
  import { revealDeep } from './reveal.js';
package/dist/types.d.ts CHANGED
@@ -19,7 +19,7 @@ export type HttpResponse<T = unknown> = {
19
19
  readonly body: T;
20
20
  };
21
21
  export interface HttpClient {
22
- /** Resolves on a 2xx. Anything else throws an `@tcds-io/errors` error carrying the status and a redacted excerpt. */
22
+ /** Resolves on a 2xx. Anything else throws an `@tcds-io/domain` error carrying the status and a redacted excerpt. */
23
23
  request<T = unknown>(request: HttpRequest): Promise<HttpResponse<T>>;
24
24
  }
25
25
  export type { MultipartBody };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tcds-io/http-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "JSON fetch client that throws external-party errors, with a recording test double that redacts secrets.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -31,18 +31,18 @@
31
31
  "@types/node": "^22.10.2",
32
32
  "typescript": "^5.7.2",
33
33
  "vitest": "^2.1.8",
34
- "@tcds-io/errors": "^0.1.0",
34
+ "@tcds-io/domain": "^0.1.0",
35
35
  "@tcds-io/redact": "^0.1.0"
36
36
  },
37
37
  "engines": {
38
38
  "node": ">=22"
39
39
  },
40
40
  "peerDependencies": {
41
- "@tcds-io/errors": "~0.1.0",
41
+ "@tcds-io/domain": "~0.1.0",
42
42
  "@tcds-io/redact": "~0.1.0"
43
43
  },
44
44
  "scripts": {
45
- "build": "tsc -p tsconfig.build.json",
45
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
46
46
  "check:types": "tsc --noEmit -p .",
47
47
  "test": "vitest run"
48
48
  }