nlcurl 0.7.0 → 0.9.0
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 +149 -140
- package/dist/cache/groups.d.ts +75 -0
- package/dist/cache/groups.d.ts.map +1 -0
- package/dist/cache/groups.js +118 -0
- package/dist/cache/groups.js.map +1 -0
- package/dist/cache/no-vary-search.d.ts +33 -0
- package/dist/cache/no-vary-search.d.ts.map +1 -0
- package/dist/cache/no-vary-search.js +148 -0
- package/dist/cache/no-vary-search.js.map +1 -0
- package/dist/cache/range.d.ts +120 -0
- package/dist/cache/range.d.ts.map +1 -0
- package/dist/cache/range.js +193 -0
- package/dist/cache/range.js.map +1 -0
- package/dist/cache/store.d.ts +75 -37
- package/dist/cache/store.d.ts.map +1 -1
- package/dist/cache/store.js +217 -85
- package/dist/cache/store.js.map +1 -1
- package/dist/cache/types.d.ts +10 -39
- package/dist/cache/types.d.ts.map +1 -1
- package/dist/cli/args.d.ts +4 -37
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +3 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/index.d.ts +0 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +14 -20
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +14 -20
- package/dist/cli/output.js.map +1 -1
- package/dist/cookies/jar.d.ts +41 -40
- package/dist/cookies/jar.d.ts.map +1 -1
- package/dist/cookies/jar.js +65 -42
- package/dist/cookies/jar.js.map +1 -1
- package/dist/cookies/parser.d.ts +13 -17
- package/dist/cookies/parser.d.ts.map +1 -1
- package/dist/cookies/parser.js +23 -15
- package/dist/cookies/parser.js.map +1 -1
- package/dist/cookies/psl-data.d.ts +1 -1
- package/dist/cookies/psl-data.js +1 -1
- package/dist/cookies/public-suffix.d.ts +5 -27
- package/dist/cookies/public-suffix.d.ts.map +1 -1
- package/dist/cookies/public-suffix.js +5 -37
- package/dist/cookies/public-suffix.js.map +1 -1
- package/dist/core/auth.d.ts +61 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +159 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/client.d.ts +28 -40
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +31 -41
- package/dist/core/client.js.map +1 -1
- package/dist/core/errors.d.ts +64 -88
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +64 -88
- package/dist/core/errors.js.map +1 -1
- package/dist/core/request.d.ts +33 -113
- package/dist/core/request.d.ts.map +1 -1
- package/dist/core/response.d.ts +49 -66
- package/dist/core/response.d.ts.map +1 -1
- package/dist/core/response.js +45 -59
- package/dist/core/response.js.map +1 -1
- package/dist/core/session.d.ts +66 -78
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +136 -77
- package/dist/core/session.js.map +1 -1
- package/dist/core/validation.d.ts +58 -43
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +141 -56
- package/dist/core/validation.js.map +1 -1
- package/dist/dns/cache.d.ts +65 -0
- package/dist/dns/cache.d.ts.map +1 -0
- package/dist/dns/cache.js +119 -0
- package/dist/dns/cache.js.map +1 -0
- package/dist/dns/codec.d.ts +29 -19
- package/dist/dns/codec.d.ts.map +1 -1
- package/dist/dns/codec.js +73 -39
- package/dist/dns/codec.js.map +1 -1
- package/dist/dns/doh-resolver.d.ts +17 -31
- package/dist/dns/doh-resolver.d.ts.map +1 -1
- package/dist/dns/doh-resolver.js +47 -48
- package/dist/dns/doh-resolver.js.map +1 -1
- package/dist/dns/dot-resolver.d.ts +89 -0
- package/dist/dns/dot-resolver.d.ts.map +1 -0
- package/dist/dns/dot-resolver.js +166 -0
- package/dist/dns/dot-resolver.js.map +1 -0
- package/dist/dns/https-rr.d.ts +19 -30
- package/dist/dns/https-rr.d.ts.map +1 -1
- package/dist/dns/https-rr.js +22 -40
- package/dist/dns/https-rr.js.map +1 -1
- package/dist/dns/types.d.ts +31 -59
- package/dist/dns/types.d.ts.map +1 -1
- package/dist/dns/types.js +3 -14
- package/dist/dns/types.js.map +1 -1
- package/dist/fingerprints/akamai.d.ts +3 -11
- package/dist/fingerprints/akamai.d.ts.map +1 -1
- package/dist/fingerprints/akamai.js +3 -11
- package/dist/fingerprints/akamai.js.map +1 -1
- package/dist/fingerprints/database.d.ts +6 -14
- package/dist/fingerprints/database.d.ts.map +1 -1
- package/dist/fingerprints/database.js +6 -14
- package/dist/fingerprints/database.js.map +1 -1
- package/dist/fingerprints/extensions.d.ts +56 -71
- package/dist/fingerprints/extensions.d.ts.map +1 -1
- package/dist/fingerprints/extensions.js +58 -71
- package/dist/fingerprints/extensions.js.map +1 -1
- package/dist/fingerprints/ja3.d.ts +12 -30
- package/dist/fingerprints/ja3.d.ts.map +1 -1
- package/dist/fingerprints/ja3.js +12 -30
- package/dist/fingerprints/ja3.js.map +1 -1
- package/dist/fingerprints/ja4.d.ts +18 -0
- package/dist/fingerprints/ja4.d.ts.map +1 -0
- package/dist/fingerprints/ja4.js +81 -0
- package/dist/fingerprints/ja4.js.map +1 -0
- package/dist/fingerprints/profiles/chrome.d.ts +18 -21
- package/dist/fingerprints/profiles/chrome.d.ts.map +1 -1
- package/dist/fingerprints/profiles/chrome.js +35 -31
- package/dist/fingerprints/profiles/chrome.js.map +1 -1
- package/dist/fingerprints/profiles/edge.d.ts +7 -10
- package/dist/fingerprints/profiles/edge.d.ts.map +1 -1
- package/dist/fingerprints/profiles/edge.js +7 -10
- package/dist/fingerprints/profiles/edge.js.map +1 -1
- package/dist/fingerprints/profiles/firefox.d.ts +8 -11
- package/dist/fingerprints/profiles/firefox.d.ts.map +1 -1
- package/dist/fingerprints/profiles/firefox.js +8 -11
- package/dist/fingerprints/profiles/firefox.js.map +1 -1
- package/dist/fingerprints/profiles/safari.d.ts +11 -14
- package/dist/fingerprints/profiles/safari.d.ts.map +1 -1
- package/dist/fingerprints/profiles/safari.js +11 -14
- package/dist/fingerprints/profiles/safari.js.map +1 -1
- package/dist/fingerprints/profiles/tor.d.ts +5 -8
- package/dist/fingerprints/profiles/tor.d.ts.map +1 -1
- package/dist/fingerprints/profiles/tor.js +5 -8
- package/dist/fingerprints/profiles/tor.js.map +1 -1
- package/dist/fingerprints/types.d.ts +42 -73
- package/dist/fingerprints/types.d.ts.map +1 -1
- package/dist/hsts/store.d.ts +19 -21
- package/dist/hsts/store.d.ts.map +1 -1
- package/dist/hsts/store.js +20 -28
- package/dist/hsts/store.js.map +1 -1
- package/dist/hsts/types.d.ts +10 -14
- package/dist/hsts/types.d.ts.map +1 -1
- package/dist/http/alt-svc.d.ts +27 -52
- package/dist/http/alt-svc.d.ts.map +1 -1
- package/dist/http/alt-svc.js +17 -67
- package/dist/http/alt-svc.js.map +1 -1
- package/dist/http/early-hints.d.ts +23 -0
- package/dist/http/early-hints.d.ts.map +1 -0
- package/dist/http/early-hints.js +33 -0
- package/dist/http/early-hints.js.map +1 -0
- package/dist/http/form-data.d.ts +17 -35
- package/dist/http/form-data.d.ts.map +1 -1
- package/dist/http/form-data.js +12 -34
- package/dist/http/form-data.js.map +1 -1
- package/dist/http/h1/client.d.ts +14 -26
- package/dist/http/h1/client.d.ts.map +1 -1
- package/dist/http/h1/client.js +14 -23
- package/dist/http/h1/client.js.map +1 -1
- package/dist/http/h1/encoder.d.ts +21 -17
- package/dist/http/h1/encoder.d.ts.map +1 -1
- package/dist/http/h1/encoder.js +56 -20
- package/dist/http/h1/encoder.js.map +1 -1
- package/dist/http/h1/parser.d.ts +23 -59
- package/dist/http/h1/parser.d.ts.map +1 -1
- package/dist/http/h1/parser.js +61 -55
- package/dist/http/h1/parser.js.map +1 -1
- package/dist/http/h2/client.d.ts +23 -59
- package/dist/http/h2/client.d.ts.map +1 -1
- package/dist/http/h2/client.js +107 -64
- package/dist/http/h2/client.js.map +1 -1
- package/dist/http/h2/frames.d.ts +53 -84
- package/dist/http/h2/frames.d.ts.map +1 -1
- package/dist/http/h2/frames.js +48 -76
- package/dist/http/h2/frames.js.map +1 -1
- package/dist/http/h2/hpack.d.ts +20 -36
- package/dist/http/h2/hpack.d.ts.map +1 -1
- package/dist/http/h2/hpack.js +41 -36
- package/dist/http/h2/hpack.js.map +1 -1
- package/dist/http/negotiator.d.ts +25 -38
- package/dist/http/negotiator.d.ts.map +1 -1
- package/dist/http/negotiator.js +17 -38
- package/dist/http/negotiator.js.map +1 -1
- package/dist/http/pool.d.ts +34 -64
- package/dist/http/pool.d.ts.map +1 -1
- package/dist/http/pool.js +22 -41
- package/dist/http/pool.js.map +1 -1
- package/dist/http/resumable-upload.d.ts +76 -0
- package/dist/http/resumable-upload.d.ts.map +1 -0
- package/dist/http/resumable-upload.js +104 -0
- package/dist/http/resumable-upload.js.map +1 -0
- package/dist/http/trailers.d.ts +29 -0
- package/dist/http/trailers.d.ts.map +1 -0
- package/dist/http/trailers.js +57 -0
- package/dist/http/trailers.js.map +1 -0
- package/dist/index.d.ts +24 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/middleware/circuit-breaker.d.ts +44 -0
- package/dist/middleware/circuit-breaker.d.ts.map +1 -0
- package/dist/middleware/circuit-breaker.js +96 -0
- package/dist/middleware/circuit-breaker.js.map +1 -0
- package/dist/middleware/interceptor.d.ts +13 -32
- package/dist/middleware/interceptor.d.ts.map +1 -1
- package/dist/middleware/interceptor.js +11 -16
- package/dist/middleware/interceptor.js.map +1 -1
- package/dist/middleware/rate-limiter.d.ts +8 -17
- package/dist/middleware/rate-limiter.d.ts.map +1 -1
- package/dist/middleware/rate-limiter.js +11 -12
- package/dist/middleware/rate-limiter.js.map +1 -1
- package/dist/middleware/retry-after.d.ts +15 -0
- package/dist/middleware/retry-after.d.ts.map +1 -0
- package/dist/middleware/retry-after.js +36 -0
- package/dist/middleware/retry-after.js.map +1 -0
- package/dist/middleware/retry.d.ts +9 -18
- package/dist/middleware/retry.d.ts.map +1 -1
- package/dist/middleware/retry.js +12 -9
- package/dist/middleware/retry.js.map +1 -1
- package/dist/proxy/auth.d.ts +73 -0
- package/dist/proxy/auth.d.ts.map +1 -0
- package/dist/proxy/auth.js +129 -0
- package/dist/proxy/auth.js.map +1 -0
- package/dist/proxy/env-proxy.d.ts +5 -15
- package/dist/proxy/env-proxy.d.ts.map +1 -1
- package/dist/proxy/env-proxy.js +5 -23
- package/dist/proxy/env-proxy.js.map +1 -1
- package/dist/proxy/http-proxy.d.ts +12 -19
- package/dist/proxy/http-proxy.d.ts.map +1 -1
- package/dist/proxy/http-proxy.js +5 -8
- package/dist/proxy/http-proxy.js.map +1 -1
- package/dist/proxy/socks.d.ts +13 -20
- package/dist/proxy/socks.d.ts.map +1 -1
- package/dist/proxy/socks.js +8 -10
- package/dist/proxy/socks.js.map +1 -1
- package/dist/sse/parser.d.ts +16 -37
- package/dist/sse/parser.d.ts.map +1 -1
- package/dist/sse/parser.js +31 -28
- package/dist/sse/parser.js.map +1 -1
- package/dist/tls/constants.d.ts +21 -72
- package/dist/tls/constants.d.ts.map +1 -1
- package/dist/tls/constants.js +21 -72
- package/dist/tls/constants.js.map +1 -1
- package/dist/tls/ct.d.ts +78 -0
- package/dist/tls/ct.d.ts.map +1 -0
- package/dist/tls/ct.js +175 -0
- package/dist/tls/ct.js.map +1 -0
- package/dist/tls/early-data.d.ts +45 -0
- package/dist/tls/early-data.d.ts.map +1 -0
- package/dist/tls/early-data.js +46 -0
- package/dist/tls/early-data.js.map +1 -0
- package/dist/tls/ech.d.ts +68 -85
- package/dist/tls/ech.d.ts.map +1 -1
- package/dist/tls/ech.js +54 -102
- package/dist/tls/ech.js.map +1 -1
- package/dist/tls/keylog.d.ts +34 -0
- package/dist/tls/keylog.d.ts.map +1 -0
- package/dist/tls/keylog.js +64 -0
- package/dist/tls/keylog.js.map +1 -0
- package/dist/tls/node-engine.d.ts +10 -17
- package/dist/tls/node-engine.d.ts.map +1 -1
- package/dist/tls/node-engine.js +41 -18
- package/dist/tls/node-engine.js.map +1 -1
- package/dist/tls/ocsp.d.ts +55 -0
- package/dist/tls/ocsp.d.ts.map +1 -0
- package/dist/tls/ocsp.js +131 -0
- package/dist/tls/ocsp.js.map +1 -0
- package/dist/tls/pin-verification.d.ts +5 -4
- package/dist/tls/pin-verification.d.ts.map +1 -1
- package/dist/tls/pin-verification.js +5 -11
- package/dist/tls/pin-verification.js.map +1 -1
- package/dist/tls/session-cache.d.ts +27 -39
- package/dist/tls/session-cache.d.ts.map +1 -1
- package/dist/tls/session-cache.js +20 -24
- package/dist/tls/session-cache.js.map +1 -1
- package/dist/tls/stealth/client-hello.d.ts +26 -45
- package/dist/tls/stealth/client-hello.d.ts.map +1 -1
- package/dist/tls/stealth/client-hello.js +15 -31
- package/dist/tls/stealth/client-hello.js.map +1 -1
- package/dist/tls/stealth/engine.d.ts +10 -15
- package/dist/tls/stealth/engine.d.ts.map +1 -1
- package/dist/tls/stealth/engine.js +98 -18
- package/dist/tls/stealth/engine.js.map +1 -1
- package/dist/tls/stealth/handshake.d.ts +32 -31
- package/dist/tls/stealth/handshake.d.ts.map +1 -1
- package/dist/tls/stealth/handshake.js +74 -47
- package/dist/tls/stealth/handshake.js.map +1 -1
- package/dist/tls/stealth/key-schedule.d.ts +81 -86
- package/dist/tls/stealth/key-schedule.d.ts.map +1 -1
- package/dist/tls/stealth/key-schedule.js +70 -58
- package/dist/tls/stealth/key-schedule.js.map +1 -1
- package/dist/tls/stealth/record-layer.d.ts +52 -75
- package/dist/tls/stealth/record-layer.d.ts.map +1 -1
- package/dist/tls/stealth/record-layer.js +47 -63
- package/dist/tls/stealth/record-layer.js.map +1 -1
- package/dist/tls/stealth/tls12-handshake.d.ts +16 -0
- package/dist/tls/stealth/tls12-handshake.d.ts.map +1 -1
- package/dist/tls/stealth/tls12-handshake.js +10 -2
- package/dist/tls/stealth/tls12-handshake.js.map +1 -1
- package/dist/tls/types.d.ts +46 -60
- package/dist/tls/types.d.ts.map +1 -1
- package/dist/utils/buffer-reader.d.ts +26 -81
- package/dist/utils/buffer-reader.d.ts.map +1 -1
- package/dist/utils/buffer-reader.js +26 -81
- package/dist/utils/buffer-reader.js.map +1 -1
- package/dist/utils/buffer-writer.d.ts +30 -66
- package/dist/utils/buffer-writer.d.ts.map +1 -1
- package/dist/utils/buffer-writer.js +30 -66
- package/dist/utils/buffer-writer.js.map +1 -1
- package/dist/utils/compression.d.ts +18 -0
- package/dist/utils/compression.d.ts.map +1 -0
- package/dist/utils/compression.js +34 -0
- package/dist/utils/compression.js.map +1 -0
- package/dist/utils/dictionary-transport.d.ts +97 -0
- package/dist/utils/dictionary-transport.d.ts.map +1 -0
- package/dist/utils/dictionary-transport.js +171 -0
- package/dist/utils/dictionary-transport.js.map +1 -0
- package/dist/utils/encoding.d.ts +12 -30
- package/dist/utils/encoding.d.ts.map +1 -1
- package/dist/utils/encoding.js +15 -46
- package/dist/utils/encoding.js.map +1 -1
- package/dist/utils/happy-eyeballs.d.ts +18 -8
- package/dist/utils/happy-eyeballs.d.ts.map +1 -1
- package/dist/utils/happy-eyeballs.js +19 -27
- package/dist/utils/happy-eyeballs.js.map +1 -1
- package/dist/utils/logger.d.ts +54 -81
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +92 -64
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/tcp-fast-open.d.ts +30 -0
- package/dist/utils/tcp-fast-open.d.ts.map +1 -0
- package/dist/utils/tcp-fast-open.js +36 -0
- package/dist/utils/tcp-fast-open.js.map +1 -0
- package/dist/utils/url.d.ts +18 -25
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/url.js +18 -25
- package/dist/utils/url.js.map +1 -1
- package/dist/ws/client.d.ts +35 -53
- package/dist/ws/client.d.ts.map +1 -1
- package/dist/ws/client.js +96 -38
- package/dist/ws/client.js.map +1 -1
- package/dist/ws/frame.d.ts +24 -41
- package/dist/ws/frame.d.ts.map +1 -1
- package/dist/ws/frame.js +26 -33
- package/dist/ws/frame.js.map +1 -1
- package/dist/ws/permessage-deflate.d.ts +23 -28
- package/dist/ws/permessage-deflate.d.ts.map +1 -1
- package/dist/ws/permessage-deflate.js +18 -26
- package/dist/ws/permessage-deflate.js.map +1 -1
- package/package.json +2 -2
- package/dist/http/h3/detection.d.ts +0 -17
- package/dist/http/h3/detection.d.ts.map +0 -1
- package/dist/http/h3/detection.js +0 -59
- package/dist/http/h3/detection.js.map +0 -1
package/dist/core/response.js
CHANGED
|
@@ -1,50 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* convenience accessors for common
|
|
4
|
-
* header inspection.
|
|
2
|
+
* Encapsulates an HTTP response with status, headers, body, timing data,
|
|
3
|
+
* and convenience accessors for common header values and body parsing.
|
|
5
4
|
*
|
|
6
|
-
* @
|
|
5
|
+
* @class
|
|
6
|
+
* @template T - The expected JSON body type.
|
|
7
7
|
*/
|
|
8
8
|
export class NLcURLResponse {
|
|
9
|
-
/** HTTP status code
|
|
9
|
+
/** The HTTP status code. */
|
|
10
10
|
status;
|
|
11
|
-
/** HTTP
|
|
11
|
+
/** The HTTP reason phrase. */
|
|
12
12
|
statusText;
|
|
13
|
-
/**
|
|
13
|
+
/** Response headers as a case-insensitive key-value map. */
|
|
14
14
|
headers;
|
|
15
|
-
/**
|
|
15
|
+
/** Raw header pairs preserving original casing and duplicates. */
|
|
16
16
|
rawHeaders;
|
|
17
|
-
/**
|
|
17
|
+
/** The full response body as a Buffer. */
|
|
18
18
|
rawBody;
|
|
19
|
-
/**
|
|
19
|
+
/** A readable stream for streaming responses, or `null` for buffered responses. */
|
|
20
20
|
body;
|
|
21
|
-
/** HTTP
|
|
21
|
+
/** The negotiated HTTP version (e.g. "1.1", "2"). */
|
|
22
22
|
httpVersion;
|
|
23
|
-
/**
|
|
23
|
+
/** The final URL after any redirects. */
|
|
24
24
|
url;
|
|
25
|
-
/**
|
|
25
|
+
/** The number of redirects followed to reach this response. */
|
|
26
26
|
redirectCount;
|
|
27
|
-
/**
|
|
27
|
+
/** Timing measurements for each request phase. */
|
|
28
28
|
timings;
|
|
29
29
|
/** Metadata about the originating request. */
|
|
30
30
|
request;
|
|
31
31
|
_json;
|
|
32
32
|
_text;
|
|
33
33
|
/**
|
|
34
|
-
* Creates a new NLcURLResponse
|
|
34
|
+
* Creates a new NLcURLResponse from the provided initialization fields.
|
|
35
35
|
*
|
|
36
|
-
* @param {Object}
|
|
37
|
-
* @param {number} init.status - HTTP status code.
|
|
38
|
-
* @param {string} init.statusText - HTTP status text.
|
|
39
|
-
* @param {Record<string,string>} init.headers - Normalized response headers.
|
|
40
|
-
* @param {Array<[string,string]>} [init.rawHeaders] - Raw header pairs; defaults to entries of `headers`.
|
|
41
|
-
* @param {Buffer} init.rawBody - Fully buffered response body.
|
|
42
|
-
* @param {Readable|null} [init.body] - Streaming body, or `null`.
|
|
43
|
-
* @param {string} init.httpVersion - Protocol version string.
|
|
44
|
-
* @param {string} init.url - Final URL after redirects.
|
|
45
|
-
* @param {number} init.redirectCount - Number of redirects followed.
|
|
46
|
-
* @param {RequestTimings} init.timings - Lifecycle timing measurements.
|
|
47
|
-
* @param {ResponseMeta} init.request - Originating request metadata.
|
|
36
|
+
* @param {Object} init - Response initialization fields.
|
|
48
37
|
*/
|
|
49
38
|
constructor(init) {
|
|
50
39
|
this.status = init.status;
|
|
@@ -60,8 +49,7 @@ export class NLcURLResponse {
|
|
|
60
49
|
this.request = init.request;
|
|
61
50
|
}
|
|
62
51
|
/**
|
|
63
|
-
* Returns `true`
|
|
64
|
-
* range, `false` otherwise.
|
|
52
|
+
* Returns `true` if the response status is in the 2xx range.
|
|
65
53
|
*
|
|
66
54
|
* @returns {boolean} Whether the response indicates success.
|
|
67
55
|
*/
|
|
@@ -69,11 +57,10 @@ export class NLcURLResponse {
|
|
|
69
57
|
return this.status >= 200 && this.status < 300;
|
|
70
58
|
}
|
|
71
59
|
/**
|
|
72
|
-
* Decodes the raw body as a UTF-8 string
|
|
73
|
-
* memoized after the first call.
|
|
60
|
+
* Decodes the raw body as a UTF-8 string. Throws if the response is streaming.
|
|
74
61
|
*
|
|
75
|
-
* @returns {string} The response body
|
|
76
|
-
* @throws {Error} If the response
|
|
62
|
+
* @returns {string} The response body as text.
|
|
63
|
+
* @throws {Error} If the response is a streaming response.
|
|
77
64
|
*/
|
|
78
65
|
text() {
|
|
79
66
|
if (this.body) {
|
|
@@ -87,17 +74,12 @@ export class NLcURLResponse {
|
|
|
87
74
|
return cached;
|
|
88
75
|
}
|
|
89
76
|
/**
|
|
90
|
-
* Parses the
|
|
91
|
-
* memoized after the first call.
|
|
77
|
+
* Parses the response body as JSON. Throws if the response is streaming.
|
|
92
78
|
*
|
|
93
|
-
* @template R -
|
|
94
|
-
* @returns {R} The JSON
|
|
95
|
-
* @throws {Error} If the response
|
|
79
|
+
* @template R - The expected parsed type.
|
|
80
|
+
* @returns {R} The parsed JSON value.
|
|
81
|
+
* @throws {Error} If the response is a streaming response.
|
|
96
82
|
* @throws {SyntaxError} If the body is not valid JSON.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* const data = response.json<{ id: number; name: string }>();
|
|
100
|
-
* console.log(data.id);
|
|
101
83
|
*/
|
|
102
84
|
json() {
|
|
103
85
|
if (this.body) {
|
|
@@ -109,8 +91,7 @@ export class NLcURLResponse {
|
|
|
109
91
|
return this._json;
|
|
110
92
|
}
|
|
111
93
|
/**
|
|
112
|
-
* Returns the
|
|
113
|
-
* length when the header is absent or unparseable.
|
|
94
|
+
* Returns the Content-Length header value, or the raw body length as a fallback.
|
|
114
95
|
*
|
|
115
96
|
* @returns {number} The content length in bytes.
|
|
116
97
|
*/
|
|
@@ -124,53 +105,58 @@ export class NLcURLResponse {
|
|
|
124
105
|
return this.rawBody.length;
|
|
125
106
|
}
|
|
126
107
|
/**
|
|
127
|
-
* Returns the
|
|
128
|
-
* string when the header is absent.
|
|
108
|
+
* Returns the Content-Type header value.
|
|
129
109
|
*
|
|
130
|
-
* @returns {string} The
|
|
110
|
+
* @returns {string} The content type, or an empty string if absent.
|
|
131
111
|
*/
|
|
132
112
|
get contentType() {
|
|
133
113
|
return this.headers["content-type"] ?? "";
|
|
134
114
|
}
|
|
135
115
|
/**
|
|
136
|
-
* Returns the
|
|
116
|
+
* Returns the ETag header value, if present.
|
|
117
|
+
*
|
|
118
|
+
* @returns {string|undefined} The entity tag.
|
|
137
119
|
*/
|
|
138
120
|
get etag() {
|
|
139
121
|
return this.headers["etag"];
|
|
140
122
|
}
|
|
141
123
|
/**
|
|
142
|
-
* Returns the
|
|
124
|
+
* Returns the Last-Modified header value, if present.
|
|
125
|
+
*
|
|
126
|
+
* @returns {string|undefined} The last modified date string.
|
|
143
127
|
*/
|
|
144
128
|
get lastModified() {
|
|
145
129
|
return this.headers["last-modified"];
|
|
146
130
|
}
|
|
147
131
|
/**
|
|
148
|
-
* Returns the
|
|
132
|
+
* Returns the Cache-Control header value, if present.
|
|
133
|
+
*
|
|
134
|
+
* @returns {string|undefined} The cache control directive string.
|
|
149
135
|
*/
|
|
150
136
|
get cacheControl() {
|
|
151
137
|
return this.headers["cache-control"];
|
|
152
138
|
}
|
|
153
139
|
/**
|
|
154
|
-
* Returns the
|
|
155
|
-
*
|
|
140
|
+
* Returns the Content-Range header value, if present.
|
|
141
|
+
*
|
|
142
|
+
* @returns {string|undefined} The content range descriptor.
|
|
156
143
|
*/
|
|
157
144
|
get contentRange() {
|
|
158
145
|
return this.headers["content-range"];
|
|
159
146
|
}
|
|
160
147
|
/**
|
|
161
|
-
* Returns the
|
|
162
|
-
*
|
|
148
|
+
* Returns the Accept-Ranges header value, if present.
|
|
149
|
+
*
|
|
150
|
+
* @returns {string|undefined} The accepted range unit.
|
|
163
151
|
*/
|
|
164
152
|
get acceptRanges() {
|
|
165
153
|
return this.headers["accept-ranges"];
|
|
166
154
|
}
|
|
167
155
|
/**
|
|
168
|
-
*
|
|
169
|
-
* supporting multi-value headers such as `Set-Cookie` which are joined
|
|
170
|
-
* when accessed through `headers`.
|
|
156
|
+
* Retrieves all values for a given header name from the raw headers array.
|
|
171
157
|
*
|
|
172
|
-
* @param {string} name - The
|
|
173
|
-
* @returns {string[]} All
|
|
158
|
+
* @param {string} name - The header name (case-insensitive).
|
|
159
|
+
* @returns {string[]} All values for the specified header.
|
|
174
160
|
*/
|
|
175
161
|
getAll(name) {
|
|
176
162
|
const lower = name.toLowerCase();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/core/response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/core/response.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACzB,4BAA4B;IACZ,MAAM,CAAS;IAC/B,8BAA8B;IACd,UAAU,CAAS;IACnC,4DAA4D;IAC5C,OAAO,CAAyB;IAChD,kEAAkE;IAClD,UAAU,CAA0B;IACpD,0CAA0C;IAC1B,OAAO,CAAS;IAChC,mFAAmF;IACnE,IAAI,CAAkB;IACtC,qDAAqD;IACrC,WAAW,CAAS;IACpC,yCAAyC;IACzB,GAAG,CAAS;IAC5B,+DAA+D;IAC/C,aAAa,CAAS;IACtC,kDAAkD;IAClC,OAAO,CAAiB;IACxC,8CAA8C;IAC9B,OAAO,CAAe;IAE9B,KAAK,CAAgB;IACrB,KAAK,CAAqB;IAElC;;;;OAIG;IACH,YAAY,IAAqQ;QAC/Q,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B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;CACF"}
|
package/dist/core/session.d.ts
CHANGED
|
@@ -6,21 +6,14 @@ import { type RateLimitConfig } from "../middleware/rate-limiter.js";
|
|
|
6
6
|
import { CacheStore } from "../cache/store.js";
|
|
7
7
|
import { HSTSStore } from "../hsts/store.js";
|
|
8
8
|
/**
|
|
9
|
-
* Request options
|
|
10
|
-
* fields from {@link NLcURLRequest} except `url`, `method`, and `body`.
|
|
11
|
-
*
|
|
12
|
-
* @typedef {Omit<NLcURLRequest, 'url'|'method'|'body'>} RequestOptions
|
|
9
|
+
* Request options excluding URL, method, and body — used for convenience method signatures.
|
|
13
10
|
*/
|
|
14
11
|
export type RequestOptions = Omit<NLcURLRequest, "url" | "method" | "body">;
|
|
15
12
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* many requests to the same origin, or when you need shared cookie state.
|
|
13
|
+
* Manages a persistent HTTP session with connection pooling, cookie storage,
|
|
14
|
+
* caching, HSTS enforcement, interceptors, rate limiting, and retry logic.
|
|
19
15
|
*
|
|
20
|
-
* @
|
|
21
|
-
* const session = new NLcURLSession({ impersonate: 'chrome136' });
|
|
22
|
-
* const response = await session.get('https://example.com');
|
|
23
|
-
* session.close();
|
|
16
|
+
* @class
|
|
24
17
|
*/
|
|
25
18
|
export declare class NLcURLSession {
|
|
26
19
|
private readonly config;
|
|
@@ -33,143 +26,138 @@ export declare class NLcURLSession {
|
|
|
33
26
|
private readonly hstsStore;
|
|
34
27
|
private closed;
|
|
35
28
|
/**
|
|
36
|
-
* Creates a new
|
|
29
|
+
* Creates a new session with the given configuration.
|
|
37
30
|
*
|
|
38
|
-
* @param {NLcURLSessionConfig} [config={}] - Session-level defaults
|
|
31
|
+
* @param {NLcURLSessionConfig} [config={}] - Session-level defaults and feature toggles.
|
|
32
|
+
* @throws {NLcURLError} If configuration values are invalid.
|
|
39
33
|
*/
|
|
40
34
|
constructor(config?: NLcURLSessionConfig);
|
|
41
35
|
/**
|
|
42
|
-
* Registers a request interceptor
|
|
43
|
-
* before each request is dispatched. The interceptor may return a modified
|
|
44
|
-
* request object or a `Promise` that resolves to one.
|
|
36
|
+
* Registers a request interceptor invoked before each outgoing request.
|
|
45
37
|
*
|
|
46
|
-
* @param {RequestInterceptor} fn - The interceptor function
|
|
47
|
-
* @returns {this} The session instance
|
|
38
|
+
* @param {RequestInterceptor} fn - The interceptor function.
|
|
39
|
+
* @returns {this} The session instance for chaining.
|
|
48
40
|
*/
|
|
49
41
|
onRequest(fn: RequestInterceptor): this;
|
|
50
42
|
/**
|
|
51
|
-
* Registers a response interceptor
|
|
52
|
-
* after each response is received. The interceptor may return a modified
|
|
53
|
-
* response object or a `Promise` that resolves to one.
|
|
43
|
+
* Registers a response interceptor invoked after each incoming response.
|
|
54
44
|
*
|
|
55
|
-
* @param {ResponseInterceptor} fn - The interceptor function
|
|
56
|
-
* @returns {this} The session instance
|
|
45
|
+
* @param {ResponseInterceptor} fn - The interceptor function.
|
|
46
|
+
* @returns {this} The session instance for chaining.
|
|
57
47
|
*/
|
|
58
48
|
onResponse(fn: ResponseInterceptor): this;
|
|
59
49
|
/**
|
|
60
|
-
*
|
|
61
|
-
* Requests that exceed the configured rate will wait until a token becomes
|
|
62
|
-
* available before proceeding.
|
|
50
|
+
* Configures a token-bucket rate limiter for this session.
|
|
63
51
|
*
|
|
64
|
-
* @param {RateLimitConfig} config - Rate limit parameters
|
|
65
|
-
* @returns {this} The session instance
|
|
52
|
+
* @param {RateLimitConfig} config - Rate limit parameters.
|
|
53
|
+
* @returns {this} The session instance for chaining.
|
|
54
|
+
* @throws {NLcURLError} If the rate limit config is invalid.
|
|
66
55
|
*/
|
|
67
56
|
setRateLimit(config: RateLimitConfig): this;
|
|
68
57
|
/**
|
|
69
|
-
*
|
|
58
|
+
* Sends an HTTP GET request.
|
|
70
59
|
*
|
|
71
|
-
* @param {string}
|
|
72
|
-
* @param {RequestOptions}
|
|
60
|
+
* @param {string} url - The target URL.
|
|
61
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
73
62
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
74
63
|
*/
|
|
75
64
|
get(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
76
65
|
/**
|
|
77
|
-
*
|
|
66
|
+
* Sends an HTTP POST request.
|
|
78
67
|
*
|
|
79
|
-
* @param {string}
|
|
80
|
-
* @param {RequestBody}
|
|
81
|
-
* @param {RequestOptions} [options] -
|
|
68
|
+
* @param {string} url - The target URL.
|
|
69
|
+
* @param {RequestBody} [body] - The request body.
|
|
70
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
82
71
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
83
72
|
*/
|
|
84
73
|
post(url: string, body?: RequestBody, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
85
74
|
/**
|
|
86
|
-
*
|
|
75
|
+
* Sends an HTTP PUT request.
|
|
87
76
|
*
|
|
88
|
-
* @param {string}
|
|
89
|
-
* @param {RequestBody}
|
|
90
|
-
* @param {RequestOptions} [options] -
|
|
77
|
+
* @param {string} url - The target URL.
|
|
78
|
+
* @param {RequestBody} [body] - The request body.
|
|
79
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
91
80
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
92
81
|
*/
|
|
93
82
|
put(url: string, body?: RequestBody, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
94
83
|
/**
|
|
95
|
-
*
|
|
84
|
+
* Sends an HTTP PATCH request.
|
|
96
85
|
*
|
|
97
|
-
* @param {string}
|
|
98
|
-
* @param {RequestBody}
|
|
99
|
-
* @param {RequestOptions} [options] -
|
|
86
|
+
* @param {string} url - The target URL.
|
|
87
|
+
* @param {RequestBody} [body] - The request body.
|
|
88
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
100
89
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
101
90
|
*/
|
|
102
91
|
patch(url: string, body?: RequestBody, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
103
92
|
/**
|
|
104
|
-
*
|
|
93
|
+
* Sends an HTTP DELETE request.
|
|
105
94
|
*
|
|
106
|
-
* @param {string}
|
|
107
|
-
* @param {RequestOptions} [options] -
|
|
95
|
+
* @param {string} url - The target URL.
|
|
96
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
108
97
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
109
98
|
*/
|
|
110
99
|
delete(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
111
100
|
/**
|
|
112
|
-
*
|
|
101
|
+
* Sends an HTTP HEAD request.
|
|
113
102
|
*
|
|
114
|
-
* @param {string}
|
|
115
|
-
* @param {RequestOptions} [options] -
|
|
103
|
+
* @param {string} url - The target URL.
|
|
104
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
116
105
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
117
106
|
*/
|
|
118
107
|
head(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
119
108
|
/**
|
|
120
|
-
*
|
|
109
|
+
* Sends an HTTP OPTIONS request.
|
|
121
110
|
*
|
|
122
|
-
* @param {string}
|
|
123
|
-
* @param {RequestOptions} [options] -
|
|
111
|
+
* @param {string} url - The target URL.
|
|
112
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
124
113
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
125
114
|
*/
|
|
126
115
|
options(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
127
116
|
/**
|
|
128
|
-
*
|
|
129
|
-
* interceptors, redirect following, cookie management, and response
|
|
130
|
-
* interceptors in sequence.
|
|
117
|
+
* Sends an HTTP QUERY request (RFC 9110).
|
|
131
118
|
*
|
|
132
|
-
* @param {
|
|
133
|
-
* @
|
|
134
|
-
* @
|
|
135
|
-
* @
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
*
|
|
140
|
-
*
|
|
119
|
+
* @param {string} url - The target URL.
|
|
120
|
+
* @param {RequestBody} [body] - The query body.
|
|
121
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
122
|
+
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
123
|
+
*/
|
|
124
|
+
query(url: string, body?: RequestBody, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* Sends an HTTP request with full session features including caching,
|
|
127
|
+
* HSTS upgrade, cookie handling, compression, retry, and interceptors.
|
|
128
|
+
*
|
|
129
|
+
* @param {NLcURLRequest} input - The complete request descriptor.
|
|
130
|
+
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
131
|
+
* @throws {NLcURLError} If the session is closed.
|
|
132
|
+
* @throws {HTTPError} If `throwOnError` is enabled and the response is non-2xx.
|
|
141
133
|
*/
|
|
142
134
|
request(input: NLcURLRequest): Promise<NLcURLResponse>;
|
|
143
135
|
/**
|
|
144
|
-
* Returns the
|
|
145
|
-
* cookie management was disabled via `cookieJar: false`.
|
|
136
|
+
* Returns the session's cookie jar, or `null` if cookies are disabled.
|
|
146
137
|
*
|
|
147
|
-
* @returns {CookieJar|null} The
|
|
138
|
+
* @returns {CookieJar|null} The cookie jar instance.
|
|
148
139
|
*/
|
|
149
140
|
getCookies(): CookieJar | null;
|
|
150
141
|
/**
|
|
151
|
-
* Returns the
|
|
152
|
-
* caching was not enabled.
|
|
142
|
+
* Returns the session's cache store, or `null` if caching is disabled.
|
|
153
143
|
*
|
|
154
|
-
* @returns {CacheStore|null} The cache store
|
|
144
|
+
* @returns {CacheStore|null} The cache store instance.
|
|
155
145
|
*/
|
|
156
146
|
getCache(): CacheStore | null;
|
|
157
147
|
/**
|
|
158
|
-
* Returns the
|
|
159
|
-
* HSTS was not enabled.
|
|
148
|
+
* Returns the session's HSTS store, or `null` if HSTS is disabled.
|
|
160
149
|
*
|
|
161
|
-
* @returns {HSTSStore|null} The HSTS store
|
|
150
|
+
* @returns {HSTSStore|null} The HSTS store instance.
|
|
162
151
|
*/
|
|
163
152
|
getHSTS(): HSTSStore | null;
|
|
164
153
|
/**
|
|
165
|
-
* Returns the Alt-Svc store
|
|
166
|
-
*
|
|
154
|
+
* Returns the session's Alt-Svc store for HTTP alternative service lookups.
|
|
155
|
+
*
|
|
156
|
+
* @returns {import("../http/alt-svc.js").AltSvcStore} The Alt-Svc store instance.
|
|
167
157
|
*/
|
|
168
158
|
getAltSvc(): import("../http/alt-svc.js").AltSvcStore;
|
|
169
159
|
/**
|
|
170
|
-
* Closes the session
|
|
171
|
-
* method, issuing further requests will throw an `NLcURLError` with code
|
|
172
|
-
* `ERR_SESSION_CLOSED`. Subsequent calls are no-ops.
|
|
160
|
+
* Closes the session and releases all pooled connections.
|
|
173
161
|
*/
|
|
174
162
|
close(): void;
|
|
175
163
|
private mergeDefaults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAoB,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnH,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAOlF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAO7C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,QAAQ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