@openclaw/anthropic-vertex-provider 2026.9.1 → 2026.9.3
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/node_modules/@anthropic-ai/vertex-sdk/CHANGELOG.md +8 -0
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.d.mts +6 -0
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.d.ts +6 -0
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.js +7 -0
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.js.map +1 -1
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.mjs +6 -0
- package/node_modules/@anthropic-ai/vertex-sdk/internal/utils/values.mjs.map +1 -1
- package/node_modules/@anthropic-ai/vertex-sdk/package.json +1 -11
- package/node_modules/@anthropic-ai/vertex-sdk/src/internal/detect-platform.ts +1 -1
- package/node_modules/@anthropic-ai/vertex-sdk/src/internal/utils/values.ts +7 -0
- package/node_modules/undici/docs/docs/api/Client.md +4 -0
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
- package/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/undici/lib/handler/retry-handler.js +148 -30
- package/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/undici/lib/mock/mock-utils.js +11 -10
- package/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +10 -0
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici/types/mock-agent.d.ts +11 -10
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
- package/openclaw.plugin.json +10 -5
- package/package.json +6 -6
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.19.6 (2026-08-26)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [vertex-sdk-v0.19.5...vertex-sdk-v0.19.6](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.19.5...vertex-sdk-v0.19.6)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* **examples:** remove redundant main().catch boilerplate ([154ace7](https://github.com/anthropics/anthropic-sdk-typescript/commit/154ace7ea8ccd66d59b3a7d2ca61dcff82b39417))
|
|
10
|
+
|
|
3
11
|
## 0.19.5 (2026-08-19)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [vertex-sdk-v0.19.4...vertex-sdk-v0.19.5](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.19.4...vertex-sdk-v0.19.5)
|
|
@@ -16,4 +16,10 @@ export declare const maybeCoerceFloat: (value: unknown) => number | undefined;
|
|
|
16
16
|
export declare const maybeCoerceBoolean: (value: unknown) => boolean | undefined;
|
|
17
17
|
export declare const safeJSON: (text: string) => any;
|
|
18
18
|
export declare const pop: <T extends Record<string, any>, K extends string>(obj: T, key: K) => T[K];
|
|
19
|
+
/**
|
|
20
|
+
* Compile-time exhaustiveness check: passing a value here only type-checks once every
|
|
21
|
+
* member of its union has been handled. Does nothing at runtime, so unknown values from a
|
|
22
|
+
* newer API version fall through instead of throwing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function checkNever(_value: never): void;
|
|
19
25
|
//# sourceMappingURL=values.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.mts","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":"AAOA,e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AAI,OAAO,OAAO,KAAG,MAK5C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,OAI9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OAAO,GAAG,SAK7D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,QAMpC,CAAC;AAGF,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,KAAG,CAAC,CAAC,CAAC,CAIxF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAG"}
|
|
@@ -16,4 +16,10 @@ export declare const maybeCoerceFloat: (value: unknown) => number | undefined;
|
|
|
16
16
|
export declare const maybeCoerceBoolean: (value: unknown) => boolean | undefined;
|
|
17
17
|
export declare const safeJSON: (text: string) => any;
|
|
18
18
|
export declare const pop: <T extends Record<string, any>, K extends string>(obj: T, key: K) => T[K];
|
|
19
|
+
/**
|
|
20
|
+
* Compile-time exhaustiveness check: passing a value here only type-checks once every
|
|
21
|
+
* member of its union has been handled. Does nothing at runtime, so unknown values from a
|
|
22
|
+
* newer API version fall through instead of throwing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function checkNever(_value: never): void;
|
|
19
25
|
//# sourceMappingURL=values.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,OAE3C,CAAC;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aAAa,GAAI,OAAO,OAAO,KAAG,OAI9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAK1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OAAO,GAAG,SAK7D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,QAMpC,CAAC;AAGF,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,KAAG,CAAC,CAAC,CAAC,CAIxF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAG"}
|
|
@@ -6,6 +6,7 @@ exports.maybeObj = maybeObj;
|
|
|
6
6
|
exports.isEmptyObj = isEmptyObj;
|
|
7
7
|
exports.hasOwn = hasOwn;
|
|
8
8
|
exports.isObj = isObj;
|
|
9
|
+
exports.checkNever = checkNever;
|
|
9
10
|
const error_1 = require("../../core/error.js");
|
|
10
11
|
// https://url.spec.whatwg.org/#url-scheme-string
|
|
11
12
|
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
@@ -116,4 +117,10 @@ const pop = (obj, key) => {
|
|
|
116
117
|
return value;
|
|
117
118
|
};
|
|
118
119
|
exports.pop = pop;
|
|
120
|
+
/**
|
|
121
|
+
* Compile-time exhaustiveness check: passing a value here only type-checks once every
|
|
122
|
+
* member of its union has been handled. Does nothing at runtime, so unknown values from a
|
|
123
|
+
* newer API version fall through instead of throwing.
|
|
124
|
+
*/
|
|
125
|
+
function checkNever(_value) { }
|
|
119
126
|
//# sourceMappingURL=values.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAetF,4BAMC;AAGD,gCAIC;AAGD,wBAEC;AAED,sBAEC;
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAetF,4BAMC;AAGD,gCAIC;AAGD,wBAEC;AAED,sBAEC;AAiFD,gCAAkD;AApHlD,+CAAkD;AAElD,iDAAiD;AACjD,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAE/C,MAAM,aAAa,GAAG,CAAC,GAAW,EAAW,EAAE;IACpD,OAAO,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEK,IAAI,OAAO,GAAG,CAAC,GAAY,EAAoB,EAAE,CAAC,CAAC,CAAC,eAAO,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,IAAA,eAAO,EAAC,GAAG,CAAC,CAAC,CAAC;AAAxF,QAAA,OAAO,WAAiF;AACxF,QAAA,eAAe,GAAG,eAAsD,CAAC;AAEpF,oFAAoF;AACpF,SAAgB,QAAQ,CAAC,CAAU;IACjC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC;AAED,uCAAuC;AACvC,SAAgB,UAAU,CAAC,GAA8B;IACvD,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,KAAK,MAAM,EAAE,IAAI,GAAG;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,6DAA6D;AAC7D,SAAgB,MAAM,CAA4B,GAAM,EAAE,GAAgB;IACxE,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAA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EK,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB;AAEF,kGAAkG;AAC3F,MAAM,GAAG,GAAG,CAAkD,GAAM,EAAE,GAAM,EAAQ,EAAE;IAC3F,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAJW,QAAA,GAAG,OAId;AAEF;;;;GAIG;AACH,SAAgB,UAAU,CAAC,MAAa,IAAS,CAAC"}
|
|
@@ -97,4 +97,10 @@ export const pop = (obj, key) => {
|
|
|
97
97
|
delete obj[key];
|
|
98
98
|
return value;
|
|
99
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Compile-time exhaustiveness check: passing a value here only type-checks once every
|
|
102
|
+
* member of its union has been handled. Does nothing at runtime, so unknown values from a
|
|
103
|
+
* newer API version fall through instead of throwing.
|
|
104
|
+
*/
|
|
105
|
+
export function checkNever(_value) { }
|
|
100
106
|
//# sourceMappingURL=values.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.mjs","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,cAAc,EAAE,6BAAyB;AAElD,iDAAiD;AACjD,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAW,EAAW,EAAE;IACpD,OAAO,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,OAAO,GAA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
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthropic-ai/vertex-sdk",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.6",
|
|
4
4
|
"description": "The official TypeScript library for the Anthropic Vertex API",
|
|
5
5
|
"author": "Anthropic <support@anthropic.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -29,16 +29,6 @@
|
|
|
29
29
|
"types": "./index.d.mts",
|
|
30
30
|
"default": "./index.mjs"
|
|
31
31
|
},
|
|
32
|
-
"./.github/*.mjs": {
|
|
33
|
-
"default": "./.github/*.mjs"
|
|
34
|
-
},
|
|
35
|
-
"./.github/*.js": {
|
|
36
|
-
"default": "./.github/*.js"
|
|
37
|
-
},
|
|
38
|
-
"./.github/*": {
|
|
39
|
-
"import": "./.github/*.mjs",
|
|
40
|
-
"require": "./.github/*.js"
|
|
41
|
-
},
|
|
42
32
|
"./client": {
|
|
43
33
|
"import": "./client.mjs",
|
|
44
34
|
"require": "./client.js"
|
|
@@ -77,7 +77,7 @@ const getPlatformProperties = (): PlatformProperties => {
|
|
|
77
77
|
'X-Stainless-OS': 'Unknown',
|
|
78
78
|
'X-Stainless-Arch': `other:${EdgeRuntime}`,
|
|
79
79
|
'X-Stainless-Runtime': 'edge',
|
|
80
|
-
'X-Stainless-Runtime-Version': (globalThis as any).process
|
|
80
|
+
'X-Stainless-Runtime-Version': (globalThis as any).process?.version ?? 'unknown',
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
// Check if Node.js
|
|
@@ -110,3 +110,10 @@ export const pop = <T extends Record<string, any>, K extends string>(obj: T, key
|
|
|
110
110
|
delete obj[key];
|
|
111
111
|
return value;
|
|
112
112
|
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Compile-time exhaustiveness check: passing a value here only type-checks once every
|
|
116
|
+
* member of its union has been handled. Does nothing at runtime, so unknown values from a
|
|
117
|
+
* newer API version fall through instead of throwing.
|
|
118
|
+
*/
|
|
119
|
+
export function checkNever(_value: never): void {}
|
|
@@ -147,6 +147,10 @@ added: v1.0.0
|
|
|
147
147
|
WebSocket messages. Applied to uncompressed messages, compressed frame
|
|
148
148
|
payloads, and decompressed (`permessage-deflate`) messages. Set to `0` to
|
|
149
149
|
disable the limit. **Default:** `134217728`.
|
|
150
|
+
* `eventSource` {Object} (optional) EventSource-specific configuration.
|
|
151
|
+
* `maxEventSize` {number} The maximum allowed event size, in bytes, for
|
|
152
|
+
EventSource messages. Set to `0` to disable the limit.
|
|
153
|
+
**Default:** `buffer.kStringMaxLength`.
|
|
150
154
|
* Returns: {Client}
|
|
151
155
|
|
|
152
156
|
Instantiating a `Client` does not open a connection; the connection is
|
|
@@ -25,8 +25,9 @@ it is used only for HTTPS requests.
|
|
|
25
25
|
proxied. Each entry may include a leading dot or `*.` wildcard (for example
|
|
26
26
|
`.example.com`) to match subdomains, and an optional `:port` suffix to restrict
|
|
27
27
|
the match to a specific port. A request bypasses the proxy when its host equals
|
|
28
|
-
an entry or is a subdomain of one.
|
|
29
|
-
|
|
28
|
+
an entry or is a subdomain of one. A trailing dot is ignored on both sides, so
|
|
29
|
+
`example.com.` and `example.com` match each other. Setting `no_proxy` to `*`
|
|
30
|
+
bypasses the proxy for every request.
|
|
30
31
|
|
|
31
32
|
The uppercase variants `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are also
|
|
32
33
|
honored. When both the lowercase and uppercase forms of a variable are set, the
|
|
@@ -66,6 +66,9 @@ added: v6.5.0
|
|
|
66
66
|
wait before re-establishing a dropped connection. The server may override
|
|
67
67
|
this value with a `retry` field. **Default:** `3000`.
|
|
68
68
|
|
|
69
|
+
EventSource-specific limits can be configured on the dispatcher using the
|
|
70
|
+
`eventSource` option. See [`Client`][] for details.
|
|
71
|
+
|
|
69
72
|
Creates a new `EventSource` and immediately begins connecting to `url`. The
|
|
70
73
|
request is sent with the `Accept: text/event-stream` header, a cache mode of
|
|
71
74
|
`no-store`, and an initiator type of `other`.
|
|
@@ -349,6 +352,7 @@ eventSource.onerror = () => {
|
|
|
349
352
|
```
|
|
350
353
|
|
|
351
354
|
[WHATWG-conformant]: https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
|
|
355
|
+
[`Client`]: Client.md#new-clienturl-options
|
|
352
356
|
[`Dispatcher`]: Dispatcher.md#class-dispatcher
|
|
353
357
|
[`addEventListener()`]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
|
|
354
358
|
[server-sent events]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
|
|
@@ -101,8 +101,8 @@ body yourself.
|
|
|
101
101
|
|
|
102
102
|
* `opts` {Object} (optional)
|
|
103
103
|
* `maxSize` {number} Maximum number of bytes to read and discard. Responses
|
|
104
|
-
whose
|
|
105
|
-
`1_048_576` (1 MiB).
|
|
104
|
+
whose declared or received body size exceeds this value are aborted.
|
|
105
|
+
**Default:** `1_048_576` (1 MiB).
|
|
106
106
|
|
|
107
107
|
Per-request override: set `dumpMaxSize` on the dispatch options to override
|
|
108
108
|
the global `maxSize` for a specific request.
|
|
@@ -210,6 +210,9 @@ Automatically decompresses response bodies encoded with `gzip`, `x-gzip`,
|
|
|
210
210
|
skipped. **Default:** `[204, 304]`.
|
|
211
211
|
* `skipErrorResponses` {boolean} When `true`, responses with a status code
|
|
212
212
|
>= 400 are not decompressed. **Default:** `true`.
|
|
213
|
+
* `maxSize` {number} Maximum decompressed response size in bytes. The request
|
|
214
|
+
fails with a `ResponseExceededMaxSizeError` if the decoded body exceeds
|
|
215
|
+
this limit. **Default:** `67108864` (64 MiB).
|
|
213
216
|
|
|
214
217
|
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
|
|
215
218
|
|
|
@@ -221,7 +224,8 @@ import { Agent, interceptors } from 'undici'
|
|
|
221
224
|
const agent = new Agent().compose(
|
|
222
225
|
interceptors.decompress({
|
|
223
226
|
skipStatusCodes: [204, 304],
|
|
224
|
-
skipErrorResponses: false // decompress error bodies too
|
|
227
|
+
skipErrorResponses: false, // decompress error bodies too
|
|
228
|
+
maxSize: 16 * 1024 * 1024 // limit decoded bodies to 16 MiB
|
|
225
229
|
})
|
|
226
230
|
)
|
|
227
231
|
```
|
|
@@ -60,6 +60,11 @@ added: v7.23.0
|
|
|
60
60
|
a password embedded in `proxyUrl`. **Default:** the URL password, if any.
|
|
61
61
|
* `connect` {Function} Custom connector used to open the socket to the proxy.
|
|
62
62
|
**Default:** a connector built from `proxyTls`.
|
|
63
|
+
* `connectTimeout` {number} Maximum time in milliseconds for each proxy
|
|
64
|
+
connection, SOCKS5 negotiation, and target TLS negotiation stage. A value of
|
|
65
|
+
`0` disables these stage timeouts. `proxyTls.timeout` and
|
|
66
|
+
`requestTls.timeout` override it for their respective TLS stages.
|
|
67
|
+
**Default:** `5000`.
|
|
63
68
|
* `proxyTls` {BuildOptions} TLS options for the connection to the proxy itself
|
|
64
69
|
(SOCKS5 over TLS). When set, the proxy connection is established over TLS and
|
|
65
70
|
`servername` defaults to the proxy host name.
|
|
@@ -69,7 +74,8 @@ added: v7.23.0
|
|
|
69
74
|
host name.
|
|
70
75
|
|
|
71
76
|
Throws an `InvalidArgumentError` if `proxyUrl` is missing or does not use the
|
|
72
|
-
`socks5:` or `socks:` protocol.
|
|
77
|
+
`socks5:` or `socks:` protocol, or if `connectTimeout`, `proxyTls.timeout`, or
|
|
78
|
+
`requestTls.timeout` is not a finite, non-negative number.
|
|
73
79
|
|
|
74
80
|
```mjs
|
|
75
81
|
import { Socks5ProxyAgent } from 'undici'
|
|
@@ -87,7 +87,7 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* @param {import('../../types/cache-interceptor.d.ts').default.CacheKey}
|
|
90
|
+
* @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key
|
|
91
91
|
* @returns {import('../../types/cache-interceptor.d.ts').default.GetResult | undefined}
|
|
92
92
|
*/
|
|
93
93
|
get (key) {
|
|
@@ -179,7 +179,7 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
179
179
|
|
|
180
180
|
// Perform eviction
|
|
181
181
|
for (const [key, entries] of store.#entries) {
|
|
182
|
-
for (const entry of entries.splice(0, entries.length / 2)) {
|
|
182
|
+
for (const entry of entries.splice(0, Math.ceil(entries.length / 2))) {
|
|
183
183
|
store.#size -= entry.size
|
|
184
184
|
store.#count -= 1
|
|
185
185
|
}
|
|
@@ -5,6 +5,8 @@ module.exports = {
|
|
|
5
5
|
kDestroy: Symbol('destroy'),
|
|
6
6
|
kDispatch: Symbol('dispatch'),
|
|
7
7
|
kUrl: Symbol('url'),
|
|
8
|
+
kRequestOrigin: Symbol('request origin'),
|
|
9
|
+
kOriginless: Symbol('originless'),
|
|
8
10
|
kWriting: Symbol('writing'),
|
|
9
11
|
kResuming: Symbol('resuming'),
|
|
10
12
|
kQueue: Symbol('queue'),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { InvalidArgumentError, MaxOriginsReachedError } = require('../core/errors')
|
|
4
|
-
const { kBusy, kClients, kConnected, kRunning, kClose, kDestroy, kDispatch, kUrl } = require('../core/symbols')
|
|
4
|
+
const { kBusy, kClients, kConnected, kRunning, kPending, kClose, kDestroy, kDispatch, kUrl } = require('../core/symbols')
|
|
5
5
|
const DispatcherBase = require('./dispatcher-base')
|
|
6
6
|
const Pool = require('./pool')
|
|
7
7
|
const Client = require('./client')
|
|
@@ -97,7 +97,12 @@ class Agent extends DispatcherBase {
|
|
|
97
97
|
return
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
// A GOAWAY detaches the HTTP/2 session before requeued requests are
|
|
101
|
+
// dispatched on a replacement connection. At that point the pool has
|
|
102
|
+
// no connected clients and is not busy, but it still has pending work.
|
|
103
|
+
// Closing it here lets the replacement Client finish those requests
|
|
104
|
+
// and then destroys that new connection with ClientDestroyedError.
|
|
105
|
+
if (dispatcher[kConnected] > 0 || dispatcher[kBusy] || dispatcher[kPending] > 0) {
|
|
101
106
|
return
|
|
102
107
|
}
|
|
103
108
|
|
|
@@ -13,7 +13,7 @@ const {
|
|
|
13
13
|
kGetDispatcher
|
|
14
14
|
} = require('./pool-base')
|
|
15
15
|
const Pool = require('./pool')
|
|
16
|
-
const { kUrl } = require('../core/symbols')
|
|
16
|
+
const { kOriginless, kUrl } = require('../core/symbols')
|
|
17
17
|
const util = require('../core/util')
|
|
18
18
|
const kFactory = Symbol('factory')
|
|
19
19
|
|
|
@@ -49,14 +49,17 @@ function defaultFactory (origin, opts) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
class BalancedPool extends PoolBase {
|
|
52
|
-
constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
|
|
52
|
+
constructor (upstreams = [], { factory = defaultFactory, connect, tls, ...opts } = {}) {
|
|
53
53
|
if (typeof factory !== 'function') {
|
|
54
54
|
throw new InvalidArgumentError('factory must be a function.')
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
super()
|
|
57
|
+
super(opts)
|
|
58
58
|
|
|
59
|
-
this[
|
|
59
|
+
this[kOriginless] = true
|
|
60
|
+
if (connect && typeof connect !== 'function') connect = { ...connect }
|
|
61
|
+
if (tls && typeof tls !== 'function') tls = { ...tls }
|
|
62
|
+
this[kOptions] = { ...util.deepClone(opts), connect, tls }
|
|
60
63
|
this[kIndex] = -1
|
|
61
64
|
this[kCurrentWeight] = 0
|
|
62
65
|
|
|
@@ -1052,7 +1052,7 @@ function onSocketClose () {
|
|
|
1052
1052
|
|
|
1053
1053
|
function clearIdleSocketValidation (socket) {
|
|
1054
1054
|
if (socket[kIdleSocketValidationTimeout]) {
|
|
1055
|
-
|
|
1055
|
+
clearImmediate(socket[kIdleSocketValidationTimeout])
|
|
1056
1056
|
socket[kIdleSocketValidationTimeout] = null
|
|
1057
1057
|
}
|
|
1058
1058
|
|
|
@@ -1061,15 +1061,23 @@ function clearIdleSocketValidation (socket) {
|
|
|
1061
1061
|
|
|
1062
1062
|
function scheduleIdleSocketValidation (client, socket) {
|
|
1063
1063
|
socket[kIdleSocketValidation] = 1
|
|
1064
|
-
|
|
1064
|
+
// Yield to the check phase (after poll) so unsolicited bytes / FIN / RST
|
|
1065
|
+
// already pending on this idle keep-alive socket are processed before the
|
|
1066
|
+
// next request is written (GHSA-35p6-xmwp-9g52).
|
|
1067
|
+
//
|
|
1068
|
+
// setTimeout(0) pays Node's ~1ms timer floor on every sequential reuse
|
|
1069
|
+
// (#5493). setImmediate avoids that, but an *unref'd* Immediate lets poll
|
|
1070
|
+
// block for ~500ms when the event loop is otherwise idle (#5600 / #5606).
|
|
1071
|
+
// A ref'd Immediate both keeps the pending request alive and makes poll
|
|
1072
|
+
// return immediately — the hybrid those issues asked for.
|
|
1073
|
+
socket[kIdleSocketValidationTimeout] = setImmediate(() => {
|
|
1065
1074
|
socket[kIdleSocketValidationTimeout] = null
|
|
1066
1075
|
socket[kIdleSocketValidation] = 2
|
|
1067
1076
|
|
|
1068
1077
|
if (client[kSocket] === socket && !socket.destroyed) {
|
|
1069
1078
|
client[kResume]()
|
|
1070
1079
|
}
|
|
1071
|
-
}
|
|
1072
|
-
socket[kIdleSocketValidationTimeout].unref?.()
|
|
1080
|
+
})
|
|
1073
1081
|
}
|
|
1074
1082
|
|
|
1075
1083
|
/**
|
|
@@ -10,7 +10,8 @@ const {
|
|
|
10
10
|
InformationalError,
|
|
11
11
|
InvalidArgumentError,
|
|
12
12
|
HeadersTimeoutError,
|
|
13
|
-
BodyTimeoutError
|
|
13
|
+
BodyTimeoutError,
|
|
14
|
+
ResponseExceededMaxSizeError
|
|
14
15
|
} = require('../core/errors.js')
|
|
15
16
|
const {
|
|
16
17
|
kUrl,
|
|
@@ -39,7 +40,8 @@ const {
|
|
|
39
40
|
kRemoteSettings,
|
|
40
41
|
kHTTP2Stream,
|
|
41
42
|
kHTTP2SessionState,
|
|
42
|
-
kHTTP2Options
|
|
43
|
+
kHTTP2Options,
|
|
44
|
+
kMaxResponseSize
|
|
43
45
|
} = require('../core/symbols.js')
|
|
44
46
|
const { channels } = require('../core/diagnostics.js')
|
|
45
47
|
|
|
@@ -1022,9 +1024,11 @@ function writeH2 (client, request) {
|
|
|
1022
1024
|
const state = {
|
|
1023
1025
|
abort: null,
|
|
1024
1026
|
body: request.body,
|
|
1027
|
+
bytesRead: 0,
|
|
1025
1028
|
client,
|
|
1026
1029
|
contentLength: null,
|
|
1027
1030
|
expectsPayload: false,
|
|
1031
|
+
maxResponseSize: client[kMaxResponseSize],
|
|
1028
1032
|
request,
|
|
1029
1033
|
headersTimeout,
|
|
1030
1034
|
bodyTimeout,
|
|
@@ -1260,6 +1264,7 @@ function writeH2 (client, request) {
|
|
|
1260
1264
|
// become unreachable once the stream closes, so plain `on` avoids the
|
|
1261
1265
|
// per-listener `once` wrapper allocation.
|
|
1262
1266
|
stream.on('response', onResponse)
|
|
1267
|
+
stream.on('headers', onInterimResponse)
|
|
1263
1268
|
stream.on('end', onEnd)
|
|
1264
1269
|
stream.on('error', onError)
|
|
1265
1270
|
stream.on('frameError', onFrameError)
|
|
@@ -1280,6 +1285,7 @@ function removeRequestStreamListeners (stream) {
|
|
|
1280
1285
|
stream.off('error', noop)
|
|
1281
1286
|
stream.off('continue', writeBodyH2)
|
|
1282
1287
|
stream.off('response', onResponse)
|
|
1288
|
+
stream.off('headers', onInterimResponse)
|
|
1283
1289
|
stream.off('end', onEnd)
|
|
1284
1290
|
stream.off('error', onError)
|
|
1285
1291
|
stream.off('frameError', onFrameError)
|
|
@@ -1322,17 +1328,51 @@ function onData (chunk) {
|
|
|
1322
1328
|
return
|
|
1323
1329
|
}
|
|
1324
1330
|
|
|
1325
|
-
const { request } = state
|
|
1331
|
+
const { request, maxResponseSize } = state
|
|
1326
1332
|
|
|
1327
1333
|
if (request.aborted || request.completed) {
|
|
1328
1334
|
return
|
|
1329
1335
|
}
|
|
1330
1336
|
|
|
1337
|
+
if (maxResponseSize > -1 && state.bytesRead + chunk.length > maxResponseSize) {
|
|
1338
|
+
// Unlike HTTP/1.1, which destroys the socket because it cannot abandon one
|
|
1339
|
+
// response without losing framing, resetting the offending stream leaves
|
|
1340
|
+
// the session usable for its siblings.
|
|
1341
|
+
state.abort(new ResponseExceededMaxSizeError())
|
|
1342
|
+
return
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
state.bytesRead += chunk.length
|
|
1346
|
+
|
|
1331
1347
|
if (request.onResponseData(chunk) === false) {
|
|
1332
1348
|
stream.pause()
|
|
1333
1349
|
}
|
|
1334
1350
|
}
|
|
1335
1351
|
|
|
1352
|
+
function onInterimResponse (headers) {
|
|
1353
|
+
const stream = this
|
|
1354
|
+
const state = stream[kRequestStreamState]
|
|
1355
|
+
|
|
1356
|
+
if (state == null) {
|
|
1357
|
+
return
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
const { request } = state
|
|
1361
|
+
|
|
1362
|
+
if (request.aborted || request.completed) {
|
|
1363
|
+
return
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
// node http2 emits 'headers' for interim (1xx) informational responses,
|
|
1367
|
+
// while the final response arrives via 'response'. Forward these to the
|
|
1368
|
+
// handler so that onInfo is invoked, matching the HTTP/1 behaviour and the
|
|
1369
|
+
// documented onInfo contract.
|
|
1370
|
+
const statusCode = headers[HTTP2_HEADER_STATUS]
|
|
1371
|
+
delete headers[HTTP2_HEADER_STATUS]
|
|
1372
|
+
|
|
1373
|
+
request.onResponseStart(Number(statusCode), headers, noop, '')
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1336
1376
|
function onResponse (headers) {
|
|
1337
1377
|
const stream = this
|
|
1338
1378
|
const state = stream[kRequestStreamState]
|
|
@@ -137,7 +137,8 @@ class Client extends DispatcherBase {
|
|
|
137
137
|
connectionWindowSize,
|
|
138
138
|
pingInterval,
|
|
139
139
|
webSocket,
|
|
140
|
-
h2Options
|
|
140
|
+
h2Options,
|
|
141
|
+
eventSource
|
|
141
142
|
} = {}) {
|
|
142
143
|
if (keepAlive !== undefined) {
|
|
143
144
|
throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
|
|
@@ -276,7 +277,7 @@ class Client extends DispatcherBase {
|
|
|
276
277
|
}
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
super({ webSocket })
|
|
280
|
+
super({ webSocket, eventSource })
|
|
280
281
|
|
|
281
282
|
if (typeof connect !== 'function') {
|
|
282
283
|
connect = buildConnector({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const buffer = require('node:buffer')
|
|
3
4
|
const Dispatcher = require('./dispatcher')
|
|
4
5
|
const {
|
|
5
6
|
ClientDestroyedError,
|
|
@@ -11,6 +12,7 @@ const { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require('../core/sy
|
|
|
11
12
|
const kOnDestroyed = Symbol('onDestroyed')
|
|
12
13
|
const kOnClosed = Symbol('onClosed')
|
|
13
14
|
const kWebSocketOptions = Symbol('webSocketOptions')
|
|
15
|
+
const kEventSourceOptions = Symbol('eventSourceOptions')
|
|
14
16
|
|
|
15
17
|
class DispatcherBase extends Dispatcher {
|
|
16
18
|
/** @type {boolean} */
|
|
@@ -31,10 +33,11 @@ class DispatcherBase extends Dispatcher {
|
|
|
31
33
|
constructor (opts) {
|
|
32
34
|
super()
|
|
33
35
|
this[kWebSocketOptions] = opts?.webSocket ?? {}
|
|
36
|
+
this[kEventSourceOptions] = opts?.eventSource ?? {}
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
/**
|
|
37
|
-
* @returns {import('../../types/
|
|
40
|
+
* @returns {import('../../types/client').Client.WebSocketOptions}
|
|
38
41
|
*/
|
|
39
42
|
get webSocketOptions () {
|
|
40
43
|
return {
|
|
@@ -43,6 +46,15 @@ class DispatcherBase extends Dispatcher {
|
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
/**
|
|
50
|
+
* @returns {import('../../types/client').Client.EventSourceOptions}
|
|
51
|
+
*/
|
|
52
|
+
get eventSourceOptions () {
|
|
53
|
+
return {
|
|
54
|
+
maxEventSize: this[kEventSourceOptions].maxEventSize ?? buffer.kStringMaxLength
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
46
58
|
/** @returns {boolean} */
|
|
47
59
|
get destroyed () {
|
|
48
60
|
return this[kDestroyed]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
const EventEmitter = require('node:events')
|
|
3
|
+
const { kOriginless, kUrl } = require('../core/symbols')
|
|
3
4
|
|
|
4
5
|
class Dispatcher extends EventEmitter {
|
|
5
6
|
dispatch () {
|
|
@@ -17,6 +18,10 @@ class Dispatcher extends EventEmitter {
|
|
|
17
18
|
compose (...args) {
|
|
18
19
|
// So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...
|
|
19
20
|
const interceptors = Array.isArray(args[0]) ? args[0] : args
|
|
21
|
+
// null disables origin-dependent interceptors; undefined uses opts.origin.
|
|
22
|
+
const interceptorOrigin = this[kOriginless] === true
|
|
23
|
+
? null
|
|
24
|
+
: this[kUrl]?.origin
|
|
20
25
|
let dispatch = this.dispatch.bind(this)
|
|
21
26
|
|
|
22
27
|
for (const interceptor of interceptors) {
|
|
@@ -28,13 +33,22 @@ class Dispatcher extends EventEmitter {
|
|
|
28
33
|
throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`)
|
|
29
34
|
}
|
|
30
35
|
|
|
31
|
-
dispatch = interceptor(dispatch)
|
|
36
|
+
dispatch = interceptor(dispatch, interceptorOrigin)
|
|
32
37
|
|
|
33
38
|
if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) {
|
|
34
39
|
throw new TypeError('invalid interceptor')
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
|
|
43
|
+
const originalDispatch = dispatch
|
|
44
|
+
const self = this
|
|
45
|
+
dispatch = function (opts, handler) {
|
|
46
|
+
if (opts && typeof opts === 'object' && !opts.origin && self[kUrl]) {
|
|
47
|
+
opts = Object.assign({}, opts, { origin: self[kUrl].origin })
|
|
48
|
+
}
|
|
49
|
+
return originalDispatch(opts, handler)
|
|
50
|
+
}
|
|
51
|
+
|
|
38
52
|
return new Proxy(this, {
|
|
39
53
|
get: (target, key) => key === 'dispatch' ? dispatch : target[key]
|
|
40
54
|
})
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const Dispatcher = require('./dispatcher')
|
|
4
4
|
const { InvalidArgumentError } = require('../core/errors')
|
|
5
5
|
const { toRawHeaders } = require('../core/util')
|
|
6
|
+
const { kOriginless, kUrl } = require('../core/symbols')
|
|
6
7
|
|
|
7
8
|
class LegacyHandlerWrapper {
|
|
8
9
|
#handler
|
|
@@ -71,6 +72,8 @@ class Dispatcher1Wrapper extends Dispatcher {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
this.#dispatcher = dispatcher
|
|
75
|
+
this[kUrl] = dispatcher[kUrl]
|
|
76
|
+
this[kOriginless] = dispatcher[kOriginless]
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
static wrapHandler (handler) {
|