@h402/cli 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/dist/api.js +3 -3
- package/package.json +5 -5
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Agent } from "undici";
|
|
1
|
+
import { Agent, fetch, Headers as UndiciHeaders } from "undici";
|
|
2
2
|
import { CliError } from "./errors.js";
|
|
3
3
|
import { getVersion } from "./help.js";
|
|
4
4
|
import { isRecord } from "./utils.js";
|
|
@@ -22,7 +22,7 @@ function networkErrorMessage(error) {
|
|
|
22
22
|
return error instanceof Error ? error.message : String(error);
|
|
23
23
|
}
|
|
24
24
|
export async function requestJson(backendUrl, path, init = {}) {
|
|
25
|
-
const headers = new
|
|
25
|
+
const headers = new UndiciHeaders(init.headers);
|
|
26
26
|
headers.set("accept", "application/json");
|
|
27
27
|
if (!headers.has("user-agent")) {
|
|
28
28
|
headers.set("user-agent", `h402-cli/${getVersion()}`);
|
|
@@ -57,7 +57,7 @@ export async function requestJson(backendUrl, path, init = {}) {
|
|
|
57
57
|
// parse — keep the raw text so assertOk can surface it instead of throwing here.
|
|
58
58
|
body = text;
|
|
59
59
|
}
|
|
60
|
-
return { backendUrl, url, status: response.status, statusText: response.statusText, body, headers: response.headers };
|
|
60
|
+
return { backendUrl, url, status: response.status, statusText: response.statusText, body, headers: new Headers([...response.headers]) };
|
|
61
61
|
}
|
|
62
62
|
function responseContext(response) {
|
|
63
63
|
return { backendUrl: response.backendUrl, url: response.url };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h402/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Local, non-custodial CLI for h402 — browse the catalog and pay per call in Base USDC over x402 from a local wallet.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"cli"
|
|
35
35
|
],
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=22"
|
|
37
|
+
"node": ">=22.19.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsc",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@h402/core": "^0.1.0",
|
|
49
|
-
"@open-wallet-standard/core": "^1.
|
|
50
|
-
"fs-native-extensions": "^1.5.
|
|
51
|
-
"undici": "^
|
|
49
|
+
"@open-wallet-standard/core": "^1.4.2",
|
|
50
|
+
"fs-native-extensions": "^1.5.1",
|
|
51
|
+
"undici": "^8.10.2"
|
|
52
52
|
}
|
|
53
53
|
}
|