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/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAuB,MAAM,cAAc,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAuB,MAAM,cAAc,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4B;IACxD,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAAoB;IAChD,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,IAAI,QAAwB,CAAC;QAC7B,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC,CAAC;QACF,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtC,IAAI,QAA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AAE,QAAQ,EAAE,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,GAAW,EAAE,OAAmD;IACzF,OAAO,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAkB;IAC9C,OAAO;QACL,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,cAAc,EAAE,GAAG,CAAC,cAAc;QAClC,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,YAAY,EAAE,GAAG,CAAC,YAAY;QAC9B,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS;QACxD,IAAI,EAAE,SAAS;KAChB,CAAC;AACJ,CAAC"}
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -1,167 +1,143 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Base error class for all NLcURL
|
|
3
|
-
*
|
|
4
|
-
* from native Node.js or third-party errors via `instanceof NLcURLError`.
|
|
2
|
+
* Base error class for all NLcURL errors, providing a machine-readable error code
|
|
3
|
+
* and structured JSON serialization.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* When wrapping a lower-level error, pass it as the `cause` parameter to
|
|
8
|
-
* preserve the full error chain for diagnostics.
|
|
5
|
+
* @class
|
|
9
6
|
*/
|
|
10
7
|
export declare class NLcURLError extends Error {
|
|
11
|
-
/** Machine-readable error code
|
|
8
|
+
/** Machine-readable error code (e.g. "ERR_TLS", "ERR_TIMEOUT"). */
|
|
12
9
|
readonly code: string;
|
|
13
10
|
/**
|
|
14
|
-
* Creates a new NLcURLError
|
|
11
|
+
* Creates a new NLcURLError.
|
|
15
12
|
*
|
|
16
|
-
* @param {string} message - Human-readable description
|
|
17
|
-
* @param {string} code
|
|
18
|
-
* @param {Error}
|
|
13
|
+
* @param {string} message - Human-readable error description.
|
|
14
|
+
* @param {string} code - Machine-readable error code.
|
|
15
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
19
16
|
*/
|
|
20
17
|
constructor(message: string, code: string, cause?: Error);
|
|
21
18
|
/**
|
|
22
|
-
* Serializes the error
|
|
23
|
-
* or JSON API responses. Recursively serializes the `cause` chain.
|
|
19
|
+
* Serializes the error to a plain object suitable for JSON output.
|
|
24
20
|
*
|
|
25
|
-
* @returns {
|
|
21
|
+
* @returns {Record<string, unknown>} A plain object representation of the error.
|
|
26
22
|
*/
|
|
27
23
|
toJSON(): Record<string, unknown>;
|
|
28
24
|
}
|
|
29
25
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
26
|
+
* Represents a TLS-level error, optionally including a TLS alert code.
|
|
27
|
+
*
|
|
28
|
+
* @class
|
|
32
29
|
*/
|
|
33
30
|
export declare class TLSError extends NLcURLError {
|
|
34
|
-
/** TLS alert description code
|
|
31
|
+
/** TLS alert description code, if available. */
|
|
35
32
|
readonly alertCode?: number;
|
|
36
33
|
/**
|
|
37
|
-
* Creates a new TLSError
|
|
34
|
+
* Creates a new TLSError.
|
|
38
35
|
*
|
|
39
|
-
* @param {string} message
|
|
40
|
-
* @param {number} [alertCode] -
|
|
41
|
-
* @param {Error}
|
|
36
|
+
* @param {string} message - Human-readable error description.
|
|
37
|
+
* @param {number} [alertCode] - The TLS alert code.
|
|
38
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
42
39
|
*/
|
|
43
40
|
constructor(message: string, alertCode?: number, cause?: Error);
|
|
44
|
-
/**
|
|
45
|
-
* Serializes the error including the TLS alert code.
|
|
46
|
-
*
|
|
47
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
48
|
-
*/
|
|
41
|
+
/** @inheritdoc */
|
|
49
42
|
toJSON(): Record<string, unknown>;
|
|
50
43
|
}
|
|
51
44
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
45
|
+
* Represents an HTTP-level error with a status code.
|
|
46
|
+
*
|
|
47
|
+
* @class
|
|
55
48
|
*/
|
|
56
49
|
export declare class HTTPError extends NLcURLError {
|
|
57
|
-
/** The HTTP status code
|
|
50
|
+
/** The HTTP response status code. */
|
|
58
51
|
readonly statusCode: number;
|
|
59
52
|
/**
|
|
60
|
-
* Creates a new HTTPError
|
|
53
|
+
* Creates a new HTTPError.
|
|
61
54
|
*
|
|
62
|
-
* @param {string} message
|
|
63
|
-
* @param {number} statusCode - The HTTP status code
|
|
64
|
-
* @param {Error}
|
|
55
|
+
* @param {string} message - Human-readable error description.
|
|
56
|
+
* @param {number} statusCode - The HTTP status code.
|
|
57
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
65
58
|
*/
|
|
66
59
|
constructor(message: string, statusCode: number, cause?: Error);
|
|
67
|
-
/**
|
|
68
|
-
* Serializes the error including the HTTP status code.
|
|
69
|
-
*
|
|
70
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
71
|
-
*/
|
|
60
|
+
/** @inheritdoc */
|
|
72
61
|
toJSON(): Record<string, unknown>;
|
|
73
62
|
}
|
|
74
63
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
64
|
+
* Represents a timeout error during a specific phase of the request lifecycle.
|
|
65
|
+
*
|
|
66
|
+
* @class
|
|
77
67
|
*/
|
|
78
68
|
export declare class TimeoutError extends NLcURLError {
|
|
79
|
-
/**
|
|
80
|
-
* The lifecycle phase in which the timeout occurred.
|
|
81
|
-
*
|
|
82
|
-
* - `"connect"` -- TCP connection establishment exceeded the limit.
|
|
83
|
-
* - `"tls"` -- TLS handshake exceeded the limit.
|
|
84
|
-
* - `"response"` -- Waiting for the first response byte exceeded the limit.
|
|
85
|
-
* - `"total"` -- The overall wall-clock duration exceeded the limit.
|
|
86
|
-
*/
|
|
69
|
+
/** The phase during which the timeout occurred. */
|
|
87
70
|
readonly phase: "connect" | "tls" | "response" | "total";
|
|
88
71
|
/**
|
|
89
|
-
* Creates a new TimeoutError
|
|
72
|
+
* Creates a new TimeoutError.
|
|
90
73
|
*
|
|
91
|
-
* @param {string}
|
|
92
|
-
* @param {
|
|
93
|
-
* @param {Error}
|
|
74
|
+
* @param {string} message - Human-readable error description.
|
|
75
|
+
* @param {"connect"|"tls"|"response"|"total"} phase - The request phase that timed out.
|
|
76
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
94
77
|
*/
|
|
95
78
|
constructor(message: string, phase: "connect" | "tls" | "response" | "total", cause?: Error);
|
|
96
|
-
/**
|
|
97
|
-
* Serializes the error including the timeout phase.
|
|
98
|
-
*
|
|
99
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
100
|
-
*/
|
|
79
|
+
/** @inheritdoc */
|
|
101
80
|
toJSON(): Record<string, unknown>;
|
|
102
81
|
}
|
|
103
82
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
83
|
+
* Represents an error originating from a proxy connection.
|
|
84
|
+
*
|
|
85
|
+
* @class
|
|
107
86
|
*/
|
|
108
87
|
export declare class ProxyError extends NLcURLError {
|
|
109
88
|
/**
|
|
110
|
-
* Creates a new ProxyError
|
|
89
|
+
* Creates a new ProxyError.
|
|
111
90
|
*
|
|
112
|
-
* @param {string} message - Human-readable description
|
|
113
|
-
* @param {Error}
|
|
91
|
+
* @param {string} message - Human-readable error description.
|
|
92
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
114
93
|
*/
|
|
115
94
|
constructor(message: string, cause?: Error);
|
|
116
95
|
}
|
|
117
96
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
97
|
+
* Represents a request that was intentionally aborted via an AbortSignal.
|
|
98
|
+
*
|
|
99
|
+
* @class
|
|
120
100
|
*/
|
|
121
101
|
export declare class AbortError extends NLcURLError {
|
|
122
102
|
/**
|
|
123
|
-
* Creates a new AbortError
|
|
103
|
+
* Creates a new AbortError.
|
|
124
104
|
*
|
|
125
|
-
* @param {string} [message=
|
|
126
|
-
* @param {Error}
|
|
105
|
+
* @param {string} [message="Request aborted"] - Human-readable error description.
|
|
106
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
127
107
|
*/
|
|
128
108
|
constructor(message?: string, cause?: Error);
|
|
129
109
|
}
|
|
130
110
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
111
|
+
* Represents a TCP or socket-level connection failure.
|
|
112
|
+
*
|
|
113
|
+
* @class
|
|
134
114
|
*/
|
|
135
115
|
export declare class ConnectionError extends NLcURLError {
|
|
136
116
|
/**
|
|
137
|
-
* Creates a new ConnectionError
|
|
117
|
+
* Creates a new ConnectionError.
|
|
138
118
|
*
|
|
139
|
-
* @param {string} message - Human-readable description
|
|
140
|
-
* @param {Error}
|
|
119
|
+
* @param {string} message - Human-readable error description.
|
|
120
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
141
121
|
*/
|
|
142
122
|
constructor(message: string, cause?: Error);
|
|
143
123
|
}
|
|
144
124
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
125
|
+
* Represents an HTTP protocol-level violation, optionally including an HTTP/2 error code.
|
|
126
|
+
*
|
|
127
|
+
* @class
|
|
148
128
|
*/
|
|
149
129
|
export declare class ProtocolError extends NLcURLError {
|
|
150
|
-
/**
|
|
130
|
+
/** HTTP/2 or HTTP/3 error code, if applicable. */
|
|
151
131
|
readonly errorCode?: number;
|
|
152
132
|
/**
|
|
153
|
-
* Creates a new ProtocolError
|
|
133
|
+
* Creates a new ProtocolError.
|
|
154
134
|
*
|
|
155
|
-
* @param {string} message
|
|
156
|
-
* @param {number} [errorCode] -
|
|
157
|
-
* @param {Error}
|
|
135
|
+
* @param {string} message - Human-readable error description.
|
|
136
|
+
* @param {number} [errorCode] - The protocol-level error code.
|
|
137
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
158
138
|
*/
|
|
159
139
|
constructor(message: string, errorCode?: number, cause?: Error);
|
|
160
|
-
/**
|
|
161
|
-
* Serializes the error including the protocol error code.
|
|
162
|
-
*
|
|
163
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
164
|
-
*/
|
|
140
|
+
/** @inheritdoc */
|
|
165
141
|
toJSON(): Record<string, unknown>;
|
|
166
142
|
}
|
|
167
143
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,mEAAmE;IACnE,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAOxD;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAclC;AAED;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC,gDAAgD;IAChD,SAAgB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAA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E,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;IAM9D,kBAAkB;IACT,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAO3C"}
|
package/dist/core/errors.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Base error class for all NLcURL
|
|
3
|
-
*
|
|
4
|
-
* from native Node.js or third-party errors via `instanceof NLcURLError`.
|
|
2
|
+
* Base error class for all NLcURL errors, providing a machine-readable error code
|
|
3
|
+
* and structured JSON serialization.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* When wrapping a lower-level error, pass it as the `cause` parameter to
|
|
8
|
-
* preserve the full error chain for diagnostics.
|
|
5
|
+
* @class
|
|
9
6
|
*/
|
|
10
7
|
export class NLcURLError extends Error {
|
|
11
|
-
/** Machine-readable error code
|
|
8
|
+
/** Machine-readable error code (e.g. "ERR_TLS", "ERR_TIMEOUT"). */
|
|
12
9
|
code;
|
|
13
10
|
/**
|
|
14
|
-
* Creates a new NLcURLError
|
|
11
|
+
* Creates a new NLcURLError.
|
|
15
12
|
*
|
|
16
|
-
* @param {string} message - Human-readable description
|
|
17
|
-
* @param {string} code
|
|
18
|
-
* @param {Error}
|
|
13
|
+
* @param {string} message - Human-readable error description.
|
|
14
|
+
* @param {string} code - Machine-readable error code.
|
|
15
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
19
16
|
*/
|
|
20
17
|
constructor(message, code, cause) {
|
|
21
18
|
super(message, cause ? { cause } : undefined);
|
|
@@ -24,10 +21,9 @@ export class NLcURLError extends Error {
|
|
|
24
21
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
25
22
|
}
|
|
26
23
|
/**
|
|
27
|
-
* Serializes the error
|
|
28
|
-
* or JSON API responses. Recursively serializes the `cause` chain.
|
|
24
|
+
* Serializes the error to a plain object suitable for JSON output.
|
|
29
25
|
*
|
|
30
|
-
* @returns {
|
|
26
|
+
* @returns {Record<string, unknown>} A plain object representation of the error.
|
|
31
27
|
*/
|
|
32
28
|
toJSON() {
|
|
33
29
|
const obj = {
|
|
@@ -45,29 +41,26 @@ export class NLcURLError extends Error {
|
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
44
|
+
* Represents a TLS-level error, optionally including a TLS alert code.
|
|
45
|
+
*
|
|
46
|
+
* @class
|
|
50
47
|
*/
|
|
51
48
|
export class TLSError extends NLcURLError {
|
|
52
|
-
/** TLS alert description code
|
|
49
|
+
/** TLS alert description code, if available. */
|
|
53
50
|
alertCode;
|
|
54
51
|
/**
|
|
55
|
-
* Creates a new TLSError
|
|
52
|
+
* Creates a new TLSError.
|
|
56
53
|
*
|
|
57
|
-
* @param {string} message
|
|
58
|
-
* @param {number} [alertCode] -
|
|
59
|
-
* @param {Error}
|
|
54
|
+
* @param {string} message - Human-readable error description.
|
|
55
|
+
* @param {number} [alertCode] - The TLS alert code.
|
|
56
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
60
57
|
*/
|
|
61
58
|
constructor(message, alertCode, cause) {
|
|
62
59
|
super(message, "ERR_TLS", cause);
|
|
63
60
|
this.name = "TLSError";
|
|
64
61
|
this.alertCode = alertCode;
|
|
65
62
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Serializes the error including the TLS alert code.
|
|
68
|
-
*
|
|
69
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
70
|
-
*/
|
|
63
|
+
/** @inheritdoc */
|
|
71
64
|
toJSON() {
|
|
72
65
|
const obj = super.toJSON();
|
|
73
66
|
if (this.alertCode !== undefined) {
|
|
@@ -77,30 +70,26 @@ export class TLSError extends NLcURLError {
|
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
72
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
73
|
+
* Represents an HTTP-level error with a status code.
|
|
74
|
+
*
|
|
75
|
+
* @class
|
|
83
76
|
*/
|
|
84
77
|
export class HTTPError extends NLcURLError {
|
|
85
|
-
/** The HTTP status code
|
|
78
|
+
/** The HTTP response status code. */
|
|
86
79
|
statusCode;
|
|
87
80
|
/**
|
|
88
|
-
* Creates a new HTTPError
|
|
81
|
+
* Creates a new HTTPError.
|
|
89
82
|
*
|
|
90
|
-
* @param {string} message
|
|
91
|
-
* @param {number} statusCode - The HTTP status code
|
|
92
|
-
* @param {Error}
|
|
83
|
+
* @param {string} message - Human-readable error description.
|
|
84
|
+
* @param {number} statusCode - The HTTP status code.
|
|
85
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
93
86
|
*/
|
|
94
87
|
constructor(message, statusCode, cause) {
|
|
95
88
|
super(message, "ERR_HTTP", cause);
|
|
96
89
|
this.name = "HTTPError";
|
|
97
90
|
this.statusCode = statusCode;
|
|
98
91
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Serializes the error including the HTTP status code.
|
|
101
|
-
*
|
|
102
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
103
|
-
*/
|
|
92
|
+
/** @inheritdoc */
|
|
104
93
|
toJSON() {
|
|
105
94
|
const obj = super.toJSON();
|
|
106
95
|
obj["statusCode"] = this.statusCode;
|
|
@@ -108,36 +97,26 @@ export class HTTPError extends NLcURLError {
|
|
|
108
97
|
}
|
|
109
98
|
}
|
|
110
99
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
100
|
+
* Represents a timeout error during a specific phase of the request lifecycle.
|
|
101
|
+
*
|
|
102
|
+
* @class
|
|
113
103
|
*/
|
|
114
104
|
export class TimeoutError extends NLcURLError {
|
|
115
|
-
/**
|
|
116
|
-
* The lifecycle phase in which the timeout occurred.
|
|
117
|
-
*
|
|
118
|
-
* - `"connect"` -- TCP connection establishment exceeded the limit.
|
|
119
|
-
* - `"tls"` -- TLS handshake exceeded the limit.
|
|
120
|
-
* - `"response"` -- Waiting for the first response byte exceeded the limit.
|
|
121
|
-
* - `"total"` -- The overall wall-clock duration exceeded the limit.
|
|
122
|
-
*/
|
|
105
|
+
/** The phase during which the timeout occurred. */
|
|
123
106
|
phase;
|
|
124
107
|
/**
|
|
125
|
-
* Creates a new TimeoutError
|
|
108
|
+
* Creates a new TimeoutError.
|
|
126
109
|
*
|
|
127
|
-
* @param {string}
|
|
128
|
-
* @param {
|
|
129
|
-
* @param {Error}
|
|
110
|
+
* @param {string} message - Human-readable error description.
|
|
111
|
+
* @param {"connect"|"tls"|"response"|"total"} phase - The request phase that timed out.
|
|
112
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
130
113
|
*/
|
|
131
114
|
constructor(message, phase, cause) {
|
|
132
115
|
super(message, "ERR_TIMEOUT", cause);
|
|
133
116
|
this.name = "TimeoutError";
|
|
134
117
|
this.phase = phase;
|
|
135
118
|
}
|
|
136
|
-
/**
|
|
137
|
-
* Serializes the error including the timeout phase.
|
|
138
|
-
*
|
|
139
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
140
|
-
*/
|
|
119
|
+
/** @inheritdoc */
|
|
141
120
|
toJSON() {
|
|
142
121
|
const obj = super.toJSON();
|
|
143
122
|
obj["phase"] = this.phase;
|
|
@@ -145,16 +124,16 @@ export class TimeoutError extends NLcURLError {
|
|
|
145
124
|
}
|
|
146
125
|
}
|
|
147
126
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
127
|
+
* Represents an error originating from a proxy connection.
|
|
128
|
+
*
|
|
129
|
+
* @class
|
|
151
130
|
*/
|
|
152
131
|
export class ProxyError extends NLcURLError {
|
|
153
132
|
/**
|
|
154
|
-
* Creates a new ProxyError
|
|
133
|
+
* Creates a new ProxyError.
|
|
155
134
|
*
|
|
156
|
-
* @param {string} message - Human-readable description
|
|
157
|
-
* @param {Error}
|
|
135
|
+
* @param {string} message - Human-readable error description.
|
|
136
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
158
137
|
*/
|
|
159
138
|
constructor(message, cause) {
|
|
160
139
|
super(message, "ERR_PROXY", cause);
|
|
@@ -162,15 +141,16 @@ export class ProxyError extends NLcURLError {
|
|
|
162
141
|
}
|
|
163
142
|
}
|
|
164
143
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
144
|
+
* Represents a request that was intentionally aborted via an AbortSignal.
|
|
145
|
+
*
|
|
146
|
+
* @class
|
|
167
147
|
*/
|
|
168
148
|
export class AbortError extends NLcURLError {
|
|
169
149
|
/**
|
|
170
|
-
* Creates a new AbortError
|
|
150
|
+
* Creates a new AbortError.
|
|
171
151
|
*
|
|
172
|
-
* @param {string} [message=
|
|
173
|
-
* @param {Error}
|
|
152
|
+
* @param {string} [message="Request aborted"] - Human-readable error description.
|
|
153
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
174
154
|
*/
|
|
175
155
|
constructor(message = "Request aborted", cause) {
|
|
176
156
|
super(message, "ERR_ABORTED", cause);
|
|
@@ -178,16 +158,16 @@ export class AbortError extends NLcURLError {
|
|
|
178
158
|
}
|
|
179
159
|
}
|
|
180
160
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
161
|
+
* Represents a TCP or socket-level connection failure.
|
|
162
|
+
*
|
|
163
|
+
* @class
|
|
184
164
|
*/
|
|
185
165
|
export class ConnectionError extends NLcURLError {
|
|
186
166
|
/**
|
|
187
|
-
* Creates a new ConnectionError
|
|
167
|
+
* Creates a new ConnectionError.
|
|
188
168
|
*
|
|
189
|
-
* @param {string} message - Human-readable description
|
|
190
|
-
* @param {Error}
|
|
169
|
+
* @param {string} message - Human-readable error description.
|
|
170
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
191
171
|
*/
|
|
192
172
|
constructor(message, cause) {
|
|
193
173
|
super(message, "ERR_CONNECTION", cause);
|
|
@@ -195,30 +175,26 @@ export class ConnectionError extends NLcURLError {
|
|
|
195
175
|
}
|
|
196
176
|
}
|
|
197
177
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
178
|
+
* Represents an HTTP protocol-level violation, optionally including an HTTP/2 error code.
|
|
179
|
+
*
|
|
180
|
+
* @class
|
|
201
181
|
*/
|
|
202
182
|
export class ProtocolError extends NLcURLError {
|
|
203
|
-
/**
|
|
183
|
+
/** HTTP/2 or HTTP/3 error code, if applicable. */
|
|
204
184
|
errorCode;
|
|
205
185
|
/**
|
|
206
|
-
* Creates a new ProtocolError
|
|
186
|
+
* Creates a new ProtocolError.
|
|
207
187
|
*
|
|
208
|
-
* @param {string} message
|
|
209
|
-
* @param {number} [errorCode] -
|
|
210
|
-
* @param {Error}
|
|
188
|
+
* @param {string} message - Human-readable error description.
|
|
189
|
+
* @param {number} [errorCode] - The protocol-level error code.
|
|
190
|
+
* @param {Error} [cause] - The underlying cause, if any.
|
|
211
191
|
*/
|
|
212
192
|
constructor(message, errorCode, cause) {
|
|
213
193
|
super(message, "ERR_PROTOCOL", cause);
|
|
214
194
|
this.name = "ProtocolError";
|
|
215
195
|
this.errorCode = errorCode;
|
|
216
196
|
}
|
|
217
|
-
/**
|
|
218
|
-
* Serializes the error including the protocol error code.
|
|
219
|
-
*
|
|
220
|
-
* @returns {Object} A JSON-safe representation of the error.
|
|
221
|
-
*/
|
|
197
|
+
/** @inheritdoc */
|
|
222
198
|
toJSON() {
|
|
223
199
|
const obj = super.toJSON();
|
|
224
200
|
if (this.errorCode !== undefined) {
|
package/dist/core/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,mEAAmE;IACnD,IAAI,CAAS;IAE7B;;;;;;OAMG;IACH,YAAY,OAAe,EAAE,IAAY,EAAE,KAAa;QACtD,KAAK,CAAC,OAAO,EAAE,KAA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