nlcurl 0.6.0 → 0.8.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 +143 -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 +111 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/store.js +414 -0
- package/dist/cache/store.js.map +1 -0
- package/dist/cache/types.d.ts +69 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +2 -0
- package/dist/cache/types.js.map +1 -0
- 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 +33 -31
- package/dist/cookies/jar.d.ts.map +1 -1
- package/dist/cookies/jar.js +69 -33
- package/dist/cookies/jar.js.map +1 -1
- package/dist/cookies/parser.d.ts +14 -16
- package/dist/cookies/parser.d.ts.map +1 -1
- package/dist/cookies/parser.js +30 -13
- 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 +30 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +34 -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 +34 -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 +63 -85
- package/dist/core/request.d.ts.map +1 -1
- package/dist/core/response.d.ts +64 -59
- package/dist/core/response.d.ts.map +1 -1
- package/dist/core/response.js +70 -52
- package/dist/core/response.js.map +1 -1
- package/dist/core/session.d.ts +81 -70
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +198 -71
- package/dist/core/session.js.map +1 -1
- package/dist/core/validation.d.ts +44 -42
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +47 -58
- package/dist/core/validation.js.map +1 -1
- package/dist/dns/cache.d.ts +59 -0
- package/dist/dns/cache.d.ts.map +1 -0
- package/dist/dns/cache.js +99 -0
- package/dist/dns/cache.js.map +1 -0
- package/dist/dns/codec.d.ts +39 -0
- package/dist/dns/codec.d.ts.map +1 -0
- package/dist/dns/codec.js +238 -0
- package/dist/dns/codec.js.map +1 -0
- package/dist/dns/doh-resolver.d.ts +38 -0
- package/dist/dns/doh-resolver.d.ts.map +1 -0
- package/dist/dns/doh-resolver.js +191 -0
- package/dist/dns/doh-resolver.js.map +1 -0
- 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 +158 -0
- package/dist/dns/dot-resolver.js.map +1 -0
- package/dist/dns/https-rr.d.ts +40 -0
- package/dist/dns/https-rr.d.ts.map +1 -0
- package/dist/dns/https-rr.js +109 -0
- package/dist/dns/https-rr.js.map +1 -0
- package/dist/dns/types.d.ts +82 -0
- package/dist/dns/types.d.ts.map +1 -0
- package/dist/dns/types.js +23 -0
- package/dist/dns/types.js.map +1 -0
- 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 +83 -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 +39 -0
- package/dist/hsts/store.d.ts.map +1 -0
- package/dist/hsts/store.js +163 -0
- package/dist/hsts/store.js.map +1 -0
- package/dist/hsts/types.d.ts +24 -0
- package/dist/hsts/types.d.ts.map +1 -0
- package/dist/hsts/types.js +2 -0
- package/dist/hsts/types.js.map +1 -0
- package/dist/http/alt-svc.d.ts +67 -0
- package/dist/http/alt-svc.d.ts.map +1 -0
- package/dist/http/alt-svc.js +186 -0
- package/dist/http/alt-svc.js.map +1 -0
- 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 +29 -22
- package/dist/http/h1/client.js.map +1 -1
- package/dist/http/h1/encoder.d.ts +10 -17
- package/dist/http/h1/encoder.d.ts.map +1 -1
- package/dist/http/h1/encoder.js +10 -17
- package/dist/http/h1/encoder.js.map +1 -1
- package/dist/http/h1/parser.d.ts +22 -59
- package/dist/http/h1/parser.d.ts.map +1 -1
- package/dist/http/h1/parser.js +15 -47
- package/dist/http/h1/parser.js.map +1 -1
- package/dist/http/h2/client.d.ts +18 -59
- package/dist/http/h2/client.d.ts.map +1 -1
- package/dist/http/h2/client.js +29 -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 +16 -35
- package/dist/http/h2/hpack.d.ts.map +1 -1
- package/dist/http/h2/hpack.js +16 -35
- package/dist/http/h2/hpack.js.map +1 -1
- package/dist/http/h3/detection.d.ts +15 -0
- package/dist/http/h3/detection.d.ts.map +1 -0
- package/dist/http/h3/detection.js +41 -0
- package/dist/http/h3/detection.js.map +1 -0
- package/dist/http/negotiator.d.ts +43 -33
- package/dist/http/negotiator.d.ts.map +1 -1
- package/dist/http/negotiator.js +99 -41
- 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 +36 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- 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 +15 -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 +128 -0
- package/dist/proxy/auth.js.map +1 -0
- package/dist/proxy/env-proxy.d.ts +11 -0
- package/dist/proxy/env-proxy.d.ts.map +1 -0
- package/dist/proxy/env-proxy.js +56 -0
- package/dist/proxy/env-proxy.js.map +1 -0
- package/dist/proxy/http-proxy.d.ts +13 -18
- package/dist/proxy/http-proxy.d.ts.map +1 -1
- package/dist/proxy/http-proxy.js +24 -14
- 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 +6 -9
- package/dist/proxy/socks.js.map +1 -1
- package/dist/sse/parser.d.ts +47 -0
- package/dist/sse/parser.d.ts.map +1 -0
- package/dist/sse/parser.js +139 -0
- package/dist/sse/parser.js.map +1 -0
- package/dist/tls/constants.d.ts +15 -74
- package/dist/tls/constants.d.ts.map +1 -1
- package/dist/tls/constants.js +15 -74
- 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 +130 -0
- package/dist/tls/ech.d.ts.map +1 -0
- package/dist/tls/ech.js +353 -0
- package/dist/tls/ech.js.map +1 -0
- 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 +15 -14
- package/dist/tls/node-engine.d.ts.map +1 -1
- package/dist/tls/node-engine.js +54 -14
- 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 +10 -0
- package/dist/tls/pin-verification.d.ts.map +1 -0
- package/dist/tls/pin-verification.js +28 -0
- package/dist/tls/pin-verification.js.map +1 -0
- package/dist/tls/session-cache.d.ts +58 -0
- package/dist/tls/session-cache.d.ts.map +1 -0
- package/dist/tls/session-cache.js +76 -0
- package/dist/tls/session-cache.js.map +1 -0
- package/dist/tls/stealth/client-hello.d.ts +34 -32
- package/dist/tls/stealth/client-hello.d.ts.map +1 -1
- package/dist/tls/stealth/client-hello.js +116 -11
- package/dist/tls/stealth/client-hello.js.map +1 -1
- package/dist/tls/stealth/engine.d.ts +5 -15
- package/dist/tls/stealth/engine.d.ts.map +1 -1
- package/dist/tls/stealth/engine.js +163 -47
- package/dist/tls/stealth/engine.js.map +1 -1
- package/dist/tls/stealth/handshake.d.ts +23 -32
- package/dist/tls/stealth/handshake.d.ts.map +1 -1
- package/dist/tls/stealth/handshake.js +112 -27
- package/dist/tls/stealth/handshake.js.map +1 -1
- package/dist/tls/stealth/key-schedule.d.ts +59 -86
- package/dist/tls/stealth/key-schedule.d.ts.map +1 -1
- package/dist/tls/stealth/key-schedule.js +46 -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 +30 -0
- package/dist/tls/stealth/tls12-handshake.d.ts.map +1 -0
- package/dist/tls/stealth/tls12-handshake.js +470 -0
- package/dist/tls/stealth/tls12-handshake.js.map +1 -0
- package/dist/tls/types.d.ts +46 -48
- 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 -28
- package/dist/utils/encoding.d.ts.map +1 -1
- package/dist/utils/encoding.js +77 -40
- package/dist/utils/encoding.js.map +1 -1
- package/dist/utils/happy-eyeballs.d.ts +20 -7
- package/dist/utils/happy-eyeballs.d.ts.map +1 -1
- package/dist/utils/happy-eyeballs.js +57 -25
- 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 -52
- package/dist/ws/client.d.ts.map +1 -1
- package/dist/ws/client.js +92 -37
- package/dist/ws/client.js.map +1 -1
- package/dist/ws/frame.d.ts +27 -42
- package/dist/ws/frame.d.ts.map +1 -1
- package/dist/ws/frame.js +25 -37
- package/dist/ws/frame.js.map +1 -1
- package/dist/ws/permessage-deflate.d.ts +53 -0
- package/dist/ws/permessage-deflate.d.ts.map +1 -0
- package/dist/ws/permessage-deflate.js +140 -0
- package/dist/ws/permessage-deflate.js.map +1 -0
- package/package.json +62 -62
package/dist/core/session.d.ts
CHANGED
|
@@ -3,22 +3,17 @@ import { NLcURLResponse } from "./response.js";
|
|
|
3
3
|
import { CookieJar } from "../cookies/jar.js";
|
|
4
4
|
import { type RequestInterceptor, type ResponseInterceptor } from "../middleware/interceptor.js";
|
|
5
5
|
import { type RateLimitConfig } from "../middleware/rate-limiter.js";
|
|
6
|
+
import { CacheStore } from "../cache/store.js";
|
|
7
|
+
import { HSTSStore } from "../hsts/store.js";
|
|
6
8
|
/**
|
|
7
|
-
* Request options
|
|
8
|
-
* fields from {@link NLcURLRequest} except `url`, `method`, and `body`.
|
|
9
|
-
*
|
|
10
|
-
* @typedef {Omit<NLcURLRequest, 'url'|'method'|'body'>} RequestOptions
|
|
9
|
+
* Request options excluding URL, method, and body — used for convenience method signatures.
|
|
11
10
|
*/
|
|
12
11
|
export type RequestOptions = Omit<NLcURLRequest, "url" | "method" | "body">;
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* 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.
|
|
17
15
|
*
|
|
18
|
-
* @
|
|
19
|
-
* const session = new NLcURLSession({ impersonate: 'chrome136' });
|
|
20
|
-
* const response = await session.get('https://example.com');
|
|
21
|
-
* session.close();
|
|
16
|
+
* @class
|
|
22
17
|
*/
|
|
23
18
|
export declare class NLcURLSession {
|
|
24
19
|
private readonly config;
|
|
@@ -27,126 +22,142 @@ export declare class NLcURLSession {
|
|
|
27
22
|
private readonly interceptors;
|
|
28
23
|
private readonly logger;
|
|
29
24
|
private rateLimiter;
|
|
25
|
+
private readonly cacheStore;
|
|
26
|
+
private readonly hstsStore;
|
|
30
27
|
private closed;
|
|
31
28
|
/**
|
|
32
|
-
* Creates a new
|
|
29
|
+
* Creates a new session with the given configuration.
|
|
33
30
|
*
|
|
34
|
-
* @param {NLcURLSessionConfig} [config={}] - Session-level defaults
|
|
31
|
+
* @param {NLcURLSessionConfig} [config={}] - Session-level defaults and feature toggles.
|
|
32
|
+
* @throws {NLcURLError} If configuration values are invalid.
|
|
35
33
|
*/
|
|
36
34
|
constructor(config?: NLcURLSessionConfig);
|
|
37
35
|
/**
|
|
38
|
-
* Registers a request interceptor
|
|
39
|
-
* before each request is dispatched. The interceptor may return a modified
|
|
40
|
-
* request object or a `Promise` that resolves to one.
|
|
36
|
+
* Registers a request interceptor invoked before each outgoing request.
|
|
41
37
|
*
|
|
42
|
-
* @param {RequestInterceptor} fn - The interceptor function
|
|
43
|
-
* @returns {this} The session instance
|
|
38
|
+
* @param {RequestInterceptor} fn - The interceptor function.
|
|
39
|
+
* @returns {this} The session instance for chaining.
|
|
44
40
|
*/
|
|
45
41
|
onRequest(fn: RequestInterceptor): this;
|
|
46
42
|
/**
|
|
47
|
-
* Registers a response interceptor
|
|
48
|
-
* after each response is received. The interceptor may return a modified
|
|
49
|
-
* response object or a `Promise` that resolves to one.
|
|
43
|
+
* Registers a response interceptor invoked after each incoming response.
|
|
50
44
|
*
|
|
51
|
-
* @param {ResponseInterceptor} fn - The interceptor function
|
|
52
|
-
* @returns {this} The session instance
|
|
45
|
+
* @param {ResponseInterceptor} fn - The interceptor function.
|
|
46
|
+
* @returns {this} The session instance for chaining.
|
|
53
47
|
*/
|
|
54
48
|
onResponse(fn: ResponseInterceptor): this;
|
|
55
49
|
/**
|
|
56
|
-
*
|
|
57
|
-
* Requests that exceed the configured rate will wait until a token becomes
|
|
58
|
-
* available before proceeding.
|
|
50
|
+
* Configures a token-bucket rate limiter for this session.
|
|
59
51
|
*
|
|
60
|
-
* @param {RateLimitConfig} config - Rate limit parameters
|
|
61
|
-
* @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.
|
|
62
55
|
*/
|
|
63
56
|
setRateLimit(config: RateLimitConfig): this;
|
|
64
57
|
/**
|
|
65
|
-
*
|
|
58
|
+
* Sends an HTTP GET request.
|
|
66
59
|
*
|
|
67
|
-
* @param {string}
|
|
68
|
-
* @param {RequestOptions}
|
|
60
|
+
* @param {string} url - The target URL.
|
|
61
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
69
62
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
70
63
|
*/
|
|
71
64
|
get(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
72
65
|
/**
|
|
73
|
-
*
|
|
66
|
+
* Sends an HTTP POST request.
|
|
74
67
|
*
|
|
75
|
-
* @param {string}
|
|
76
|
-
* @param {RequestBody}
|
|
77
|
-
* @param {RequestOptions} [options] -
|
|
68
|
+
* @param {string} url - The target URL.
|
|
69
|
+
* @param {RequestBody} [body] - The request body.
|
|
70
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
78
71
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
79
72
|
*/
|
|
80
73
|
post(url: string, body?: RequestBody, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
81
74
|
/**
|
|
82
|
-
*
|
|
75
|
+
* Sends an HTTP PUT request.
|
|
83
76
|
*
|
|
84
|
-
* @param {string}
|
|
85
|
-
* @param {RequestBody}
|
|
86
|
-
* @param {RequestOptions} [options] -
|
|
77
|
+
* @param {string} url - The target URL.
|
|
78
|
+
* @param {RequestBody} [body] - The request body.
|
|
79
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
87
80
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
88
81
|
*/
|
|
89
82
|
put(url: string, body?: RequestBody, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
90
83
|
/**
|
|
91
|
-
*
|
|
84
|
+
* Sends an HTTP PATCH request.
|
|
92
85
|
*
|
|
93
|
-
* @param {string}
|
|
94
|
-
* @param {RequestBody}
|
|
95
|
-
* @param {RequestOptions} [options] -
|
|
86
|
+
* @param {string} url - The target URL.
|
|
87
|
+
* @param {RequestBody} [body] - The request body.
|
|
88
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
96
89
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
97
90
|
*/
|
|
98
91
|
patch(url: string, body?: RequestBody, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
99
92
|
/**
|
|
100
|
-
*
|
|
93
|
+
* Sends an HTTP DELETE request.
|
|
101
94
|
*
|
|
102
|
-
* @param {string}
|
|
103
|
-
* @param {RequestOptions} [options] -
|
|
95
|
+
* @param {string} url - The target URL.
|
|
96
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
104
97
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
105
98
|
*/
|
|
106
99
|
delete(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
107
100
|
/**
|
|
108
|
-
*
|
|
101
|
+
* Sends an HTTP HEAD request.
|
|
109
102
|
*
|
|
110
|
-
* @param {string}
|
|
111
|
-
* @param {RequestOptions} [options] -
|
|
103
|
+
* @param {string} url - The target URL.
|
|
104
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
112
105
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
113
106
|
*/
|
|
114
107
|
head(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
115
108
|
/**
|
|
116
|
-
*
|
|
109
|
+
* Sends an HTTP OPTIONS request.
|
|
117
110
|
*
|
|
118
|
-
* @param {string}
|
|
119
|
-
* @param {RequestOptions} [options] -
|
|
111
|
+
* @param {string} url - The target URL.
|
|
112
|
+
* @param {RequestOptions} [options] - Additional request options.
|
|
120
113
|
* @returns {Promise<NLcURLResponse>} Resolves with the server response.
|
|
121
114
|
*/
|
|
122
115
|
options(url: string, options?: RequestOptions): Promise<NLcURLResponse>;
|
|
123
116
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
117
|
+
* Sends an HTTP QUERY request (RFC 9110).
|
|
118
|
+
*
|
|
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.
|
|
127
128
|
*
|
|
128
|
-
* @param {NLcURLRequest} input - The request descriptor.
|
|
129
|
-
* @returns {Promise<NLcURLResponse>} Resolves with the
|
|
130
|
-
* @throws {NLcURLError}
|
|
131
|
-
* @throws {
|
|
132
|
-
* @throws {TimeoutError} If any configured timeout is exceeded.
|
|
133
|
-
* @throws {ConnectionError} If a TCP connection cannot be established.
|
|
134
|
-
* @throws {TLSError} If the TLS handshake fails.
|
|
135
|
-
* @throws {ProxyError} If the proxy tunnel cannot be established.
|
|
136
|
-
* @throws {NLcURLError} If the maximum number of redirects is exceeded (`ERR_MAX_REDIRECTS`).
|
|
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.
|
|
137
133
|
*/
|
|
138
134
|
request(input: NLcURLRequest): Promise<NLcURLResponse>;
|
|
139
135
|
/**
|
|
140
|
-
* Returns the
|
|
141
|
-
* cookie management was disabled via `cookieJar: false`.
|
|
136
|
+
* Returns the session's cookie jar, or `null` if cookies are disabled.
|
|
142
137
|
*
|
|
143
|
-
* @returns {CookieJar|null} The
|
|
138
|
+
* @returns {CookieJar|null} The cookie jar instance.
|
|
144
139
|
*/
|
|
145
140
|
getCookies(): CookieJar | null;
|
|
146
141
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
142
|
+
* Returns the session's cache store, or `null` if caching is disabled.
|
|
143
|
+
*
|
|
144
|
+
* @returns {CacheStore|null} The cache store instance.
|
|
145
|
+
*/
|
|
146
|
+
getCache(): CacheStore | null;
|
|
147
|
+
/**
|
|
148
|
+
* Returns the session's HSTS store, or `null` if HSTS is disabled.
|
|
149
|
+
*
|
|
150
|
+
* @returns {HSTSStore|null} The HSTS store instance.
|
|
151
|
+
*/
|
|
152
|
+
getHSTS(): HSTSStore | null;
|
|
153
|
+
/**
|
|
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.
|
|
157
|
+
*/
|
|
158
|
+
getAltSvc(): import("../http/alt-svc.js").AltSvcStore;
|
|
159
|
+
/**
|
|
160
|
+
* Closes the session and releases all pooled connections.
|
|
150
161
|
*/
|
|
151
162
|
close(): void;
|
|
152
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,C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