nlcurl 0.1.0 → 0.2.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 +5 -13
- package/dist/cli/args.d.ts +37 -5
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +6 -17
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +25 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +24 -7
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +24 -12
- package/dist/cli/output.js.map +1 -1
- package/dist/cookies/jar.d.ts +45 -13
- package/dist/cookies/jar.d.ts.map +1 -1
- package/dist/cookies/jar.js +88 -29
- package/dist/cookies/jar.js.map +1 -1
- package/dist/cookies/parser.d.ts +25 -3
- package/dist/cookies/parser.d.ts.map +1 -1
- package/dist/cookies/parser.js +12 -7
- package/dist/cookies/parser.js.map +1 -1
- package/dist/core/client.d.ts +49 -33
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +64 -38
- package/dist/core/client.js.map +1 -1
- package/dist/core/errors.d.ts +94 -6
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +95 -6
- package/dist/core/errors.js.map +1 -1
- package/dist/core/request.d.ts +96 -30
- package/dist/core/request.d.ts.map +1 -1
- package/dist/core/request.js +0 -3
- package/dist/core/request.js.map +1 -1
- package/dist/core/response.d.ts +92 -8
- package/dist/core/response.d.ts.map +1 -1
- package/dist/core/response.js +92 -7
- package/dist/core/response.js.map +1 -1
- package/dist/core/session.d.ts +109 -14
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +124 -46
- package/dist/core/session.js.map +1 -1
- package/dist/fingerprints/akamai.d.ts +11 -11
- package/dist/fingerprints/akamai.d.ts.map +1 -1
- package/dist/fingerprints/akamai.js +10 -14
- package/dist/fingerprints/akamai.js.map +1 -1
- package/dist/fingerprints/database.d.ts +14 -15
- package/dist/fingerprints/database.d.ts.map +1 -1
- package/dist/fingerprints/database.js +14 -19
- package/dist/fingerprints/database.js.map +1 -1
- package/dist/fingerprints/extensions.d.ts +121 -27
- package/dist/fingerprints/extensions.d.ts.map +1 -1
- package/dist/fingerprints/extensions.js +132 -49
- package/dist/fingerprints/extensions.js.map +1 -1
- package/dist/fingerprints/ja3.d.ts +34 -18
- package/dist/fingerprints/ja3.d.ts.map +1 -1
- package/dist/fingerprints/ja3.js +34 -18
- package/dist/fingerprints/ja3.js.map +1 -1
- package/dist/fingerprints/profiles/chrome.d.ts +21 -10
- package/dist/fingerprints/profiles/chrome.d.ts.map +1 -1
- package/dist/fingerprints/profiles/chrome.js +25 -22
- package/dist/fingerprints/profiles/chrome.js.map +1 -1
- package/dist/fingerprints/profiles/edge.d.ts +10 -7
- package/dist/fingerprints/profiles/edge.d.ts.map +1 -1
- package/dist/fingerprints/profiles/edge.js +10 -10
- package/dist/fingerprints/profiles/edge.js.map +1 -1
- package/dist/fingerprints/profiles/firefox.d.ts +11 -3
- package/dist/fingerprints/profiles/firefox.d.ts.map +1 -1
- package/dist/fingerprints/profiles/firefox.js +15 -14
- package/dist/fingerprints/profiles/firefox.js.map +1 -1
- package/dist/fingerprints/profiles/safari.d.ts +14 -3
- package/dist/fingerprints/profiles/safari.d.ts.map +1 -1
- package/dist/fingerprints/profiles/safari.js +16 -13
- package/dist/fingerprints/profiles/safari.js.map +1 -1
- package/dist/fingerprints/profiles/tor.d.ts +8 -7
- package/dist/fingerprints/profiles/tor.d.ts.map +1 -1
- package/dist/fingerprints/profiles/tor.js +8 -14
- package/dist/fingerprints/profiles/tor.js.map +1 -1
- package/dist/fingerprints/types.d.ts +70 -47
- package/dist/fingerprints/types.d.ts.map +1 -1
- package/dist/fingerprints/types.js +0 -7
- package/dist/fingerprints/types.js.map +1 -1
- package/dist/http/h1/client.d.ts +30 -9
- package/dist/http/h1/client.d.ts.map +1 -1
- package/dist/http/h1/client.js +152 -15
- package/dist/http/h1/client.js.map +1 -1
- package/dist/http/h1/encoder.d.ts +9 -6
- package/dist/http/h1/encoder.d.ts.map +1 -1
- package/dist/http/h1/encoder.js +8 -12
- package/dist/http/h1/encoder.js.map +1 -1
- package/dist/http/h1/parser.d.ts +68 -14
- package/dist/http/h1/parser.d.ts.map +1 -1
- package/dist/http/h1/parser.js +92 -37
- package/dist/http/h1/parser.js.map +1 -1
- package/dist/http/h2/client.d.ts +81 -14
- package/dist/http/h2/client.d.ts.map +1 -1
- package/dist/http/h2/client.js +465 -63
- package/dist/http/h2/client.js.map +1 -1
- package/dist/http/h2/frames.d.ts +103 -6
- package/dist/http/h2/frames.d.ts.map +1 -1
- package/dist/http/h2/frames.js +96 -17
- package/dist/http/h2/frames.js.map +1 -1
- package/dist/http/h2/hpack.d.ts +30 -5
- package/dist/http/h2/hpack.d.ts.map +1 -1
- package/dist/http/h2/hpack.js +39 -35
- package/dist/http/h2/hpack.js.map +1 -1
- package/dist/http/negotiator.d.ts +35 -12
- package/dist/http/negotiator.d.ts.map +1 -1
- package/dist/http/negotiator.js +89 -24
- package/dist/http/negotiator.js.map +1 -1
- package/dist/http/pool.d.ts +66 -17
- package/dist/http/pool.d.ts.map +1 -1
- package/dist/http/pool.js +47 -20
- package/dist/http/pool.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -13
- package/dist/index.js.map +1 -1
- package/dist/middleware/interceptor.d.ts +40 -8
- package/dist/middleware/interceptor.d.ts.map +1 -1
- package/dist/middleware/interceptor.js +28 -6
- package/dist/middleware/interceptor.js.map +1 -1
- package/dist/middleware/rate-limiter.d.ts +18 -5
- package/dist/middleware/rate-limiter.d.ts.map +1 -1
- package/dist/middleware/rate-limiter.js +12 -7
- package/dist/middleware/rate-limiter.js.map +1 -1
- package/dist/middleware/retry.d.ts +17 -5
- package/dist/middleware/retry.d.ts.map +1 -1
- package/dist/middleware/retry.js +13 -11
- package/dist/middleware/retry.js.map +1 -1
- package/dist/proxy/http-proxy.d.ts +17 -9
- package/dist/proxy/http-proxy.d.ts.map +1 -1
- package/dist/proxy/http-proxy.js +9 -13
- package/dist/proxy/http-proxy.js.map +1 -1
- package/dist/proxy/socks.d.ts +20 -9
- package/dist/proxy/socks.d.ts.map +1 -1
- package/dist/proxy/socks.js +20 -31
- package/dist/proxy/socks.js.map +1 -1
- package/dist/tls/constants.d.ts +74 -4
- package/dist/tls/constants.d.ts.map +1 -1
- package/dist/tls/constants.js +75 -21
- package/dist/tls/constants.js.map +1 -1
- package/dist/tls/node-engine.d.ts +17 -16
- package/dist/tls/node-engine.d.ts.map +1 -1
- package/dist/tls/node-engine.js +20 -27
- package/dist/tls/node-engine.js.map +1 -1
- package/dist/tls/stealth/client-hello.d.ts +32 -16
- package/dist/tls/stealth/client-hello.d.ts.map +1 -1
- package/dist/tls/stealth/client-hello.js +13 -37
- package/dist/tls/stealth/client-hello.js.map +1 -1
- package/dist/tls/stealth/engine.d.ts +18 -10
- package/dist/tls/stealth/engine.d.ts.map +1 -1
- package/dist/tls/stealth/engine.js +18 -24
- package/dist/tls/stealth/engine.js.map +1 -1
- package/dist/tls/stealth/handshake.d.ts +31 -17
- package/dist/tls/stealth/handshake.d.ts.map +1 -1
- package/dist/tls/stealth/handshake.js +173 -74
- package/dist/tls/stealth/handshake.js.map +1 -1
- package/dist/tls/stealth/key-schedule.d.ts +89 -32
- package/dist/tls/stealth/key-schedule.d.ts.map +1 -1
- package/dist/tls/stealth/key-schedule.js +62 -42
- package/dist/tls/stealth/key-schedule.js.map +1 -1
- package/dist/tls/stealth/record-layer.d.ts +76 -25
- package/dist/tls/stealth/record-layer.d.ts.map +1 -1
- package/dist/tls/stealth/record-layer.js +66 -36
- package/dist/tls/stealth/record-layer.js.map +1 -1
- package/dist/tls/types.d.ts +33 -25
- package/dist/tls/types.d.ts.map +1 -1
- package/dist/tls/types.js +0 -4
- package/dist/tls/types.js.map +1 -1
- package/dist/utils/buffer-reader.d.ts +99 -7
- package/dist/utils/buffer-reader.d.ts.map +1 -1
- package/dist/utils/buffer-reader.js +99 -7
- package/dist/utils/buffer-reader.js.map +1 -1
- package/dist/utils/buffer-writer.d.ts +99 -10
- package/dist/utils/buffer-writer.d.ts.map +1 -1
- package/dist/utils/buffer-writer.js +101 -12
- package/dist/utils/buffer-writer.js.map +1 -1
- package/dist/utils/encoding.d.ts +33 -8
- package/dist/utils/encoding.d.ts.map +1 -1
- package/dist/utils/encoding.js +58 -13
- package/dist/utils/encoding.js.map +1 -1
- package/dist/utils/logger.d.ts +61 -2
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +52 -4
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/url.d.ts +47 -7
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/url.js +47 -7
- package/dist/utils/url.js.map +1 -1
- package/dist/ws/client.d.ts +59 -15
- package/dist/ws/client.d.ts.map +1 -1
- package/dist/ws/client.js +34 -27
- package/dist/ws/client.js.map +1 -1
- package/dist/ws/frame.d.ts +43 -9
- package/dist/ws/frame.d.ts.map +1 -1
- package/dist/ws/frame.js +35 -19
- package/dist/ws/frame.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-reader.js","sourceRoot":"","sources":["../../src/utils/buffer-reader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer-reader.js","sourceRoot":"","sources":["../../src/utils/buffer-reader.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,YAAY;IACf,IAAI,CAAS;IACb,IAAI,CAAS;IAErB;;;;;OAKG;IACH,YAAY,GAAW,EAAE,SAAiB,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,CAAC;IAED,8CAA8C;IAC9C,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CA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AAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,MAAc;QACjB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,QAAgB;QACnB,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAChD,MAAM,IAAI,UAAU,CAAC,iBAAiB,QAAQ,sBAAsB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3F,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,CAAC;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAc;QACtB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7B,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC;QACpB,OAAO,GAAG,CAAC;IACb,CAAC;IAEO,eAAe,CAAC,CAAS;QAC/B,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,UAAU,CAClB,0BAA0B,CAAC,oBAAoB,IAAI,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,YAAY,CAC3G,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,34 +1,123 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Growable binary buffer writer that serializes typed values in big-endian byte
|
|
3
|
+
* order. The internal buffer doubles in capacity as needed. Call
|
|
4
|
+
* {@link BufferWriter.toBuffer} to obtain the written bytes as a new `Buffer`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const w = new BufferWriter();
|
|
8
|
+
* w.writeUInt8(0x16);
|
|
9
|
+
* w.writeUInt16(0x0303);
|
|
10
|
+
* w.writeVector16(data);
|
|
11
|
+
* return w.toBuffer();
|
|
5
12
|
*/
|
|
6
13
|
export declare class BufferWriter {
|
|
7
14
|
private _buf;
|
|
8
15
|
private _pos;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new BufferWriter with an optional initial capacity.
|
|
18
|
+
*
|
|
19
|
+
* @param {number} [capacity=1024] - Initial internal buffer capacity in bytes.
|
|
20
|
+
*/
|
|
9
21
|
constructor(capacity?: number);
|
|
22
|
+
/** Current write position (equals the number of bytes written so far). */
|
|
10
23
|
get position(): number;
|
|
24
|
+
/** Number of bytes that have been written (alias for {@link BufferWriter.position}). */
|
|
11
25
|
get length(): number;
|
|
12
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Returns a copy of the written bytes as a new `Buffer`. The returned buffer
|
|
28
|
+
* contains only the bytes that have been written, regardless of the internal
|
|
29
|
+
* capacity.
|
|
30
|
+
*
|
|
31
|
+
* @returns {Buffer} Copy of all written data.
|
|
32
|
+
*/
|
|
13
33
|
toBuffer(): Buffer;
|
|
34
|
+
/**
|
|
35
|
+
* Writes one unsigned byte and advances the write position by 1.
|
|
36
|
+
*
|
|
37
|
+
* @param {number} value - Byte value (only the lowest 8 bits are used).
|
|
38
|
+
* @returns {this} This instance for chaining.
|
|
39
|
+
*/
|
|
14
40
|
writeUInt8(value: number): this;
|
|
41
|
+
/**
|
|
42
|
+
* Writes one big-endian unsigned 16-bit integer and advances the write position by 2.
|
|
43
|
+
*
|
|
44
|
+
* @param {number} value - 16-bit value to write.
|
|
45
|
+
* @returns {this} This instance for chaining.
|
|
46
|
+
*/
|
|
15
47
|
writeUInt16(value: number): this;
|
|
48
|
+
/**
|
|
49
|
+
* Writes one big-endian unsigned 24-bit integer and advances the write position by 3.
|
|
50
|
+
*
|
|
51
|
+
* @param {number} value - 24-bit value to write.
|
|
52
|
+
* @returns {this} This instance for chaining.
|
|
53
|
+
*/
|
|
16
54
|
writeUInt24(value: number): this;
|
|
55
|
+
/**
|
|
56
|
+
* Writes one big-endian unsigned 32-bit integer and advances the write position by 4.
|
|
57
|
+
*
|
|
58
|
+
* @param {number} value - 32-bit value to write.
|
|
59
|
+
* @returns {this} This instance for chaining.
|
|
60
|
+
*/
|
|
17
61
|
writeUInt32(value: number): this;
|
|
62
|
+
/**
|
|
63
|
+
* Appends raw bytes from `data` and advances the write position accordingly.
|
|
64
|
+
*
|
|
65
|
+
* @param {Buffer | Uint8Array} data - Data to write.
|
|
66
|
+
* @returns {this} This instance for chaining.
|
|
67
|
+
*/
|
|
18
68
|
writeBytes(data: Buffer | Uint8Array): this;
|
|
19
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Writes a length-prefixed byte vector using an 8-bit length prefix.
|
|
71
|
+
* Equivalent to `writeUInt8(data.length)` followed by `writeBytes(data)`.
|
|
72
|
+
*
|
|
73
|
+
* @param {Buffer | Uint8Array} data - Data to write (must be ≤ 255 bytes).
|
|
74
|
+
* @returns {this} This instance for chaining.
|
|
75
|
+
* @throws {RangeError} If `data.length` exceeds 255.
|
|
76
|
+
*/
|
|
20
77
|
writeVector8(data: Buffer | Uint8Array): this;
|
|
21
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Writes a length-prefixed byte vector using a big-endian 16-bit length prefix.
|
|
80
|
+
* Equivalent to `writeUInt16(data.length)` followed by `writeBytes(data)`.
|
|
81
|
+
*
|
|
82
|
+
* @param {Buffer | Uint8Array} data - Data to write (must be ≤ 65 535 bytes).
|
|
83
|
+
* @returns {this} This instance for chaining.
|
|
84
|
+
* @throws {RangeError} If `data.length` exceeds 65 535.
|
|
85
|
+
*/
|
|
22
86
|
writeVector16(data: Buffer | Uint8Array): this;
|
|
23
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Writes a length-prefixed byte vector using a big-endian 24-bit length prefix.
|
|
89
|
+
* Equivalent to `writeUInt24(data.length)` followed by `writeBytes(data)`.
|
|
90
|
+
*
|
|
91
|
+
* @param {Buffer | Uint8Array} data - Data to write (must be ≤ 16 777 215 bytes).
|
|
92
|
+
* @returns {this} This instance for chaining.
|
|
93
|
+
* @throws {RangeError} If `data.length` exceeds 16 777 215.
|
|
94
|
+
*/
|
|
24
95
|
writeVector24(data: Buffer | Uint8Array): this;
|
|
25
96
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
97
|
+
* Reserves `size` bytes at the current position without writing any data,
|
|
98
|
+
* advances the cursor, and returns the byte offset of the reserved region.
|
|
99
|
+
* Use this to write a length prefix, then later patch it with
|
|
100
|
+
* {@link BufferWriter.patchUInt16} or {@link BufferWriter.patchUInt24}.
|
|
101
|
+
*
|
|
102
|
+
* @param {number} size - Number of bytes to reserve.
|
|
103
|
+
* @returns {number} Byte offset of the start of the reserved region.
|
|
28
104
|
*/
|
|
29
105
|
reserve(size: number): number;
|
|
30
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Overwrites a previously reserved 16-bit slot with `value` in big-endian byte order.
|
|
108
|
+
* Does not advance the write cursor.
|
|
109
|
+
*
|
|
110
|
+
* @param {number} offset - Byte offset returned by {@link BufferWriter.reserve}.
|
|
111
|
+
* @param {number} value - 16-bit value to patch in.
|
|
112
|
+
*/
|
|
31
113
|
patchUInt16(offset: number, value: number): void;
|
|
114
|
+
/**
|
|
115
|
+
* Overwrites a previously reserved 24-bit slot with `value` in big-endian byte order.
|
|
116
|
+
* Does not advance the write cursor.
|
|
117
|
+
*
|
|
118
|
+
* @param {number} offset - Byte offset returned by {@link BufferWriter.reserve}.
|
|
119
|
+
* @param {number} value - 24-bit value to patch in.
|
|
120
|
+
*/
|
|
32
121
|
patchUInt24(offset: number, value: number): void;
|
|
33
122
|
private ensureCapacity;
|
|
34
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-writer.d.ts","sourceRoot":"","sources":["../../src/utils/buffer-writer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer-writer.d.ts","sourceRoot":"","sources":["../../src/utils/buffer-writer.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAS;IAErB;;;;OAIG;gBACS,QAAQ,GAAE,MAAyB;IAK/C,0EAA0E;IAC1E,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,wFAAwF;IACxF,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;;OAMG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAO/B;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOhC;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAShC;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOhC;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAW3C;;;;;;;OAOG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAS7C;;;;;;;OAOG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAS9C;;;;;;;OAOG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAS9C;;;;;;;;OAQG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAO7B;;;;;;OAMG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhD;;;;;;OAMG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAMhD,OAAO,CAAC,cAAc;CAWvB"}
|
|
@@ -1,39 +1,77 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Binary writer for constructing TLS records, HTTP/2 frames, and other
|
|
3
|
-
* network protocol structures. All multi-byte integers are written in
|
|
4
|
-
* network byte order (big-endian) unless stated otherwise.
|
|
5
|
-
*/
|
|
6
1
|
const INITIAL_CAPACITY = 1024;
|
|
7
2
|
const GROWTH_FACTOR = 2;
|
|
3
|
+
/**
|
|
4
|
+
* Growable binary buffer writer that serializes typed values in big-endian byte
|
|
5
|
+
* order. The internal buffer doubles in capacity as needed. Call
|
|
6
|
+
* {@link BufferWriter.toBuffer} to obtain the written bytes as a new `Buffer`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const w = new BufferWriter();
|
|
10
|
+
* w.writeUInt8(0x16);
|
|
11
|
+
* w.writeUInt16(0x0303);
|
|
12
|
+
* w.writeVector16(data);
|
|
13
|
+
* return w.toBuffer();
|
|
14
|
+
*/
|
|
8
15
|
export class BufferWriter {
|
|
9
16
|
_buf;
|
|
10
17
|
_pos;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new BufferWriter with an optional initial capacity.
|
|
20
|
+
*
|
|
21
|
+
* @param {number} [capacity=1024] - Initial internal buffer capacity in bytes.
|
|
22
|
+
*/
|
|
11
23
|
constructor(capacity = INITIAL_CAPACITY) {
|
|
12
24
|
this._buf = Buffer.allocUnsafe(capacity);
|
|
13
25
|
this._pos = 0;
|
|
14
26
|
}
|
|
27
|
+
/** Current write position (equals the number of bytes written so far). */
|
|
15
28
|
get position() {
|
|
16
29
|
return this._pos;
|
|
17
30
|
}
|
|
31
|
+
/** Number of bytes that have been written (alias for {@link BufferWriter.position}). */
|
|
18
32
|
get length() {
|
|
19
33
|
return this._pos;
|
|
20
34
|
}
|
|
21
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Returns a copy of the written bytes as a new `Buffer`. The returned buffer
|
|
37
|
+
* contains only the bytes that have been written, regardless of the internal
|
|
38
|
+
* capacity.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Buffer} Copy of all written data.
|
|
41
|
+
*/
|
|
22
42
|
toBuffer() {
|
|
23
43
|
return Buffer.from(this._buf.subarray(0, this._pos));
|
|
24
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Writes one unsigned byte and advances the write position by 1.
|
|
47
|
+
*
|
|
48
|
+
* @param {number} value - Byte value (only the lowest 8 bits are used).
|
|
49
|
+
* @returns {this} This instance for chaining.
|
|
50
|
+
*/
|
|
25
51
|
writeUInt8(value) {
|
|
26
52
|
this.ensureCapacity(1);
|
|
27
53
|
this._buf[this._pos] = value & 0xff;
|
|
28
54
|
this._pos += 1;
|
|
29
55
|
return this;
|
|
30
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Writes one big-endian unsigned 16-bit integer and advances the write position by 2.
|
|
59
|
+
*
|
|
60
|
+
* @param {number} value - 16-bit value to write.
|
|
61
|
+
* @returns {this} This instance for chaining.
|
|
62
|
+
*/
|
|
31
63
|
writeUInt16(value) {
|
|
32
64
|
this.ensureCapacity(2);
|
|
33
65
|
this._buf.writeUInt16BE(value, this._pos);
|
|
34
66
|
this._pos += 2;
|
|
35
67
|
return this;
|
|
36
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Writes one big-endian unsigned 24-bit integer and advances the write position by 3.
|
|
71
|
+
*
|
|
72
|
+
* @param {number} value - 24-bit value to write.
|
|
73
|
+
* @returns {this} This instance for chaining.
|
|
74
|
+
*/
|
|
37
75
|
writeUInt24(value) {
|
|
38
76
|
this.ensureCapacity(3);
|
|
39
77
|
this._buf[this._pos] = (value >>> 16) & 0xff;
|
|
@@ -42,12 +80,24 @@ export class BufferWriter {
|
|
|
42
80
|
this._pos += 3;
|
|
43
81
|
return this;
|
|
44
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Writes one big-endian unsigned 32-bit integer and advances the write position by 4.
|
|
85
|
+
*
|
|
86
|
+
* @param {number} value - 32-bit value to write.
|
|
87
|
+
* @returns {this} This instance for chaining.
|
|
88
|
+
*/
|
|
45
89
|
writeUInt32(value) {
|
|
46
90
|
this.ensureCapacity(4);
|
|
47
91
|
this._buf.writeUInt32BE(value, this._pos);
|
|
48
92
|
this._pos += 4;
|
|
49
93
|
return this;
|
|
50
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Appends raw bytes from `data` and advances the write position accordingly.
|
|
97
|
+
*
|
|
98
|
+
* @param {Buffer | Uint8Array} data - Data to write.
|
|
99
|
+
* @returns {this} This instance for chaining.
|
|
100
|
+
*/
|
|
51
101
|
writeBytes(data) {
|
|
52
102
|
this.ensureCapacity(data.length);
|
|
53
103
|
if (data instanceof Buffer) {
|
|
@@ -59,7 +109,14 @@ export class BufferWriter {
|
|
|
59
109
|
this._pos += data.length;
|
|
60
110
|
return this;
|
|
61
111
|
}
|
|
62
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Writes a length-prefixed byte vector using an 8-bit length prefix.
|
|
114
|
+
* Equivalent to `writeUInt8(data.length)` followed by `writeBytes(data)`.
|
|
115
|
+
*
|
|
116
|
+
* @param {Buffer | Uint8Array} data - Data to write (must be ≤ 255 bytes).
|
|
117
|
+
* @returns {this} This instance for chaining.
|
|
118
|
+
* @throws {RangeError} If `data.length` exceeds 255.
|
|
119
|
+
*/
|
|
63
120
|
writeVector8(data) {
|
|
64
121
|
if (data.length > 0xff) {
|
|
65
122
|
throw new RangeError(`Vector8 overflow: ${data.length} > 255`);
|
|
@@ -68,7 +125,14 @@ export class BufferWriter {
|
|
|
68
125
|
this.writeBytes(data);
|
|
69
126
|
return this;
|
|
70
127
|
}
|
|
71
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* Writes a length-prefixed byte vector using a big-endian 16-bit length prefix.
|
|
130
|
+
* Equivalent to `writeUInt16(data.length)` followed by `writeBytes(data)`.
|
|
131
|
+
*
|
|
132
|
+
* @param {Buffer | Uint8Array} data - Data to write (must be ≤ 65 535 bytes).
|
|
133
|
+
* @returns {this} This instance for chaining.
|
|
134
|
+
* @throws {RangeError} If `data.length` exceeds 65 535.
|
|
135
|
+
*/
|
|
72
136
|
writeVector16(data) {
|
|
73
137
|
if (data.length > 0xffff) {
|
|
74
138
|
throw new RangeError(`Vector16 overflow: ${data.length} > 65535`);
|
|
@@ -77,7 +141,14 @@ export class BufferWriter {
|
|
|
77
141
|
this.writeBytes(data);
|
|
78
142
|
return this;
|
|
79
143
|
}
|
|
80
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* Writes a length-prefixed byte vector using a big-endian 24-bit length prefix.
|
|
146
|
+
* Equivalent to `writeUInt24(data.length)` followed by `writeBytes(data)`.
|
|
147
|
+
*
|
|
148
|
+
* @param {Buffer | Uint8Array} data - Data to write (must be ≤ 16 777 215 bytes).
|
|
149
|
+
* @returns {this} This instance for chaining.
|
|
150
|
+
* @throws {RangeError} If `data.length` exceeds 16 777 215.
|
|
151
|
+
*/
|
|
81
152
|
writeVector24(data) {
|
|
82
153
|
if (data.length > 0xffffff) {
|
|
83
154
|
throw new RangeError(`Vector24 overflow: ${data.length} > 16777215`);
|
|
@@ -87,8 +158,13 @@ export class BufferWriter {
|
|
|
87
158
|
return this;
|
|
88
159
|
}
|
|
89
160
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
161
|
+
* Reserves `size` bytes at the current position without writing any data,
|
|
162
|
+
* advances the cursor, and returns the byte offset of the reserved region.
|
|
163
|
+
* Use this to write a length prefix, then later patch it with
|
|
164
|
+
* {@link BufferWriter.patchUInt16} or {@link BufferWriter.patchUInt24}.
|
|
165
|
+
*
|
|
166
|
+
* @param {number} size - Number of bytes to reserve.
|
|
167
|
+
* @returns {number} Byte offset of the start of the reserved region.
|
|
92
168
|
*/
|
|
93
169
|
reserve(size) {
|
|
94
170
|
this.ensureCapacity(size);
|
|
@@ -96,10 +172,23 @@ export class BufferWriter {
|
|
|
96
172
|
this._pos += size;
|
|
97
173
|
return offset;
|
|
98
174
|
}
|
|
99
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* Overwrites a previously reserved 16-bit slot with `value` in big-endian byte order.
|
|
177
|
+
* Does not advance the write cursor.
|
|
178
|
+
*
|
|
179
|
+
* @param {number} offset - Byte offset returned by {@link BufferWriter.reserve}.
|
|
180
|
+
* @param {number} value - 16-bit value to patch in.
|
|
181
|
+
*/
|
|
100
182
|
patchUInt16(offset, value) {
|
|
101
183
|
this._buf.writeUInt16BE(value, offset);
|
|
102
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Overwrites a previously reserved 24-bit slot with `value` in big-endian byte order.
|
|
187
|
+
* Does not advance the write cursor.
|
|
188
|
+
*
|
|
189
|
+
* @param {number} offset - Byte offset returned by {@link BufferWriter.reserve}.
|
|
190
|
+
* @param {number} value - 24-bit value to patch in.
|
|
191
|
+
*/
|
|
103
192
|
patchUInt24(offset, value) {
|
|
104
193
|
this._buf[offset] = (value >>> 16) & 0xff;
|
|
105
194
|
this._buf[offset + 1] = (value >>> 8) & 0xff;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-writer.js","sourceRoot":"","sources":["../../src/utils/buffer-writer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer-writer.js","sourceRoot":"","sources":["../../src/utils/buffer-writer.ts"],"names":[],"mappings":"AACA,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAY;IACf,IAAI,CAAS;IACb,IAAI,CAAS;IAErB;;;;OAIG;IACH,YAAY,WAAmB,gBAAgB;QAC7C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAChB,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AC,MAAc;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;QACpC,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO;QACzC,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAC9B,OAAO,MAAM,GAAG,QAAQ,EAAE,CAAC;YACzB,MAAM,IAAI,aAAa,CAAC;QAC1B,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,CAAC;CACF"}
|
package/dist/utils/encoding.d.ts
CHANGED
|
@@ -1,19 +1,44 @@
|
|
|
1
|
+
import { Transform } from 'node:stream';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
3
|
+
* `true` when the current Node.js runtime provides native Zstandard
|
|
4
|
+
* decompression support (`zlib.zstdDecompress`). `false` on older Node.js
|
|
5
|
+
* versions that lack the API.
|
|
4
6
|
*/
|
|
5
|
-
/** Whether this Node.js runtime can decompress zstd content. */
|
|
6
7
|
export declare const supportsZstd: boolean;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Decompresses a response body buffer using the algorithm indicated by
|
|
10
|
+
* `contentEncoding`. Supports `gzip`, `x-gzip`, `deflate`, `br` (Brotli),
|
|
11
|
+
* `zstd` (when available), and `identity`. Unrecognized encodings are
|
|
12
|
+
* returned as-is.
|
|
13
|
+
*
|
|
14
|
+
* @param {Buffer} body - Raw compressed body bytes.
|
|
15
|
+
* @param {string | undefined} contentEncoding - Value of the `Content-Encoding` header.
|
|
16
|
+
* @returns {Promise<Buffer>} Decompressed body bytes.
|
|
10
17
|
*/
|
|
11
18
|
export declare function decompressBody(body: Buffer, contentEncoding: string | undefined): Promise<Buffer>;
|
|
12
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Creates a Node.js `Transform` stream that decompresses data on-the-fly
|
|
21
|
+
* using the algorithm indicated by `contentEncoding`. Returns `null` when
|
|
22
|
+
* no transform is needed (unknown or `identity` encoding).
|
|
23
|
+
*
|
|
24
|
+
* @param {string | undefined} contentEncoding - Value of the `Content-Encoding` header.
|
|
25
|
+
* @returns {Transform | null} Decompressor stream, or `null` if no decompression is required.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createDecompressStream(contentEncoding: string | undefined): Transform | null;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the default `Accept-Encoding` header value supported by this
|
|
30
|
+
* Node.js runtime. Includes `zstd` when Zstandard is available.
|
|
31
|
+
*
|
|
32
|
+
* @returns {string} E.g. `"gzip, deflate, br, zstd"` or `"gzip, deflate, br"`.
|
|
33
|
+
*/
|
|
13
34
|
export declare function defaultAcceptEncoding(): string;
|
|
14
35
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
36
|
+
* Filters `zstd` from a caller-supplied `Accept-Encoding` value when the
|
|
37
|
+
* current runtime does not support Zstandard decompression. Otherwise returns
|
|
38
|
+
* the value unchanged.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} value - Caller-supplied `Accept-Encoding` header value.
|
|
41
|
+
* @returns {string} Sanitized encoding list compatible with the runtime.
|
|
17
42
|
*/
|
|
18
43
|
export declare function sanitizeAcceptEncoding(value: string): string;
|
|
19
44
|
//# sourceMappingURL=encoding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../src/utils/encoding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../src/utils/encoding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAiB,MAAM,aAAa,CAAC;AAYvD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,OAAsC,CAAC;AAElE;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC,MAAM,CAAC,CA4BjB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,SAAS,GAAG,IAAI,CA8BlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO5D"}
|
package/dist/utils/encoding.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Content-Encoding decompression using only node:zlib.
|
|
3
|
-
* Supports gzip, deflate, brotli, and zstd (Node 22+).
|
|
4
|
-
*/
|
|
5
1
|
import * as zlib from 'node:zlib';
|
|
6
2
|
import { promisify } from 'node:util';
|
|
7
3
|
const gunzipAsync = promisify(zlib.gunzip);
|
|
8
4
|
const inflateAsync = promisify(zlib.inflate);
|
|
9
5
|
const brotliDecompressAsync = promisify(zlib.brotliDecompress);
|
|
10
|
-
// zstd is natively supported in Node 22+ via node:zlib
|
|
11
6
|
const _zstdFn = zlib['zstdDecompress'];
|
|
12
7
|
const zstdDecompressAsync = typeof _zstdFn === 'function'
|
|
13
8
|
? promisify(_zstdFn)
|
|
14
9
|
: null;
|
|
15
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* `true` when the current Node.js runtime provides native Zstandard
|
|
12
|
+
* decompression support (`zlib.zstdDecompress`). `false` on older Node.js
|
|
13
|
+
* versions that lack the API.
|
|
14
|
+
*/
|
|
16
15
|
export const supportsZstd = zstdDecompressAsync !== null;
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Decompresses a response body buffer using the algorithm indicated by
|
|
18
|
+
* `contentEncoding`. Supports `gzip`, `x-gzip`, `deflate`, `br` (Brotli),
|
|
19
|
+
* `zstd` (when available), and `identity`. Unrecognized encodings are
|
|
20
|
+
* returned as-is.
|
|
21
|
+
*
|
|
22
|
+
* @param {Buffer} body - Raw compressed body bytes.
|
|
23
|
+
* @param {string | undefined} contentEncoding - Value of the `Content-Encoding` header.
|
|
24
|
+
* @returns {Promise<Buffer>} Decompressed body bytes.
|
|
20
25
|
*/
|
|
21
26
|
export async function decompressBody(body, contentEncoding) {
|
|
22
27
|
if (!contentEncoding || body.length === 0)
|
|
@@ -34,22 +39,62 @@ export async function decompressBody(body, contentEncoding) {
|
|
|
34
39
|
if (zstdDecompressAsync) {
|
|
35
40
|
return zstdDecompressAsync(body);
|
|
36
41
|
}
|
|
37
|
-
// Node < 22: zstd not available natively, return raw bytes.
|
|
38
42
|
return body;
|
|
39
43
|
case 'identity':
|
|
40
44
|
return body;
|
|
41
45
|
default:
|
|
42
|
-
// Unknown encoding -- return as-is rather than throwing.
|
|
43
46
|
return body;
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Creates a Node.js `Transform` stream that decompresses data on-the-fly
|
|
51
|
+
* using the algorithm indicated by `contentEncoding`. Returns `null` when
|
|
52
|
+
* no transform is needed (unknown or `identity` encoding).
|
|
53
|
+
*
|
|
54
|
+
* @param {string | undefined} contentEncoding - Value of the `Content-Encoding` header.
|
|
55
|
+
* @returns {Transform | null} Decompressor stream, or `null` if no decompression is required.
|
|
56
|
+
*/
|
|
57
|
+
export function createDecompressStream(contentEncoding) {
|
|
58
|
+
if (!contentEncoding)
|
|
59
|
+
return null;
|
|
60
|
+
const encoding = contentEncoding.trim().toLowerCase();
|
|
61
|
+
switch (encoding) {
|
|
62
|
+
case 'gzip':
|
|
63
|
+
case 'x-gzip':
|
|
64
|
+
return zlib.createGunzip();
|
|
65
|
+
case 'deflate':
|
|
66
|
+
return zlib.createInflate();
|
|
67
|
+
case 'br':
|
|
68
|
+
return zlib.createBrotliDecompress();
|
|
69
|
+
case 'zstd': {
|
|
70
|
+
const factory = zlib['createZstdDecompress'];
|
|
71
|
+
if (typeof factory === 'function') {
|
|
72
|
+
return factory();
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
case 'identity':
|
|
77
|
+
return null;
|
|
78
|
+
default:
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns the default `Accept-Encoding` header value supported by this
|
|
84
|
+
* Node.js runtime. Includes `zstd` when Zstandard is available.
|
|
85
|
+
*
|
|
86
|
+
* @returns {string} E.g. `"gzip, deflate, br, zstd"` or `"gzip, deflate, br"`.
|
|
87
|
+
*/
|
|
47
88
|
export function defaultAcceptEncoding() {
|
|
48
89
|
return supportsZstd ? 'gzip, deflate, br, zstd' : 'gzip, deflate, br';
|
|
49
90
|
}
|
|
50
91
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
92
|
+
* Filters `zstd` from a caller-supplied `Accept-Encoding` value when the
|
|
93
|
+
* current runtime does not support Zstandard decompression. Otherwise returns
|
|
94
|
+
* the value unchanged.
|
|
95
|
+
*
|
|
96
|
+
* @param {string} value - Caller-supplied `Accept-Encoding` header value.
|
|
97
|
+
* @returns {string} Sanitized encoding list compatible with the runtime.
|
|
53
98
|
*/
|
|
54
99
|
export function sanitizeAcceptEncoding(value) {
|
|
55
100
|
if (supportsZstd)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.js","sourceRoot":"","sources":["../../src/utils/encoding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"encoding.js","sourceRoot":"","sources":["../../src/utils/encoding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,MA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
|
-
*
|
|
2
|
+
* Minimum severity level for log emission. Messages below this level are
|
|
3
|
+
* suppressed. `'silent'` disables all output.
|
|
4
|
+
*
|
|
5
|
+
* @typedef {'debug' | 'info' | 'warn' | 'error' | 'silent'} LogLevel
|
|
3
6
|
*/
|
|
4
7
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
8
|
+
/**
|
|
9
|
+
* Minimal logger interface consumed throughout the library. Implementations
|
|
10
|
+
* must provide four severity methods; all parameters follow `console.log`
|
|
11
|
+
* semantics (a primary message string followed by optional extra values).
|
|
12
|
+
*/
|
|
5
13
|
export interface Logger {
|
|
6
14
|
debug(message: string, ...args: unknown[]): void;
|
|
7
15
|
info(message: string, ...args: unknown[]): void;
|
|
8
16
|
warn(message: string, ...args: unknown[]): void;
|
|
9
17
|
error(message: string, ...args: unknown[]): void;
|
|
10
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Default {@link Logger} implementation that writes to `process.stderr`.
|
|
21
|
+
* Messages are prefixed with `[nlcurl:<level>]` and only emitted when the
|
|
22
|
+
* message severity meets or exceeds the configured `level`.
|
|
23
|
+
*/
|
|
11
24
|
export declare class ConsoleLogger implements Logger {
|
|
12
25
|
private level;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new ConsoleLogger.
|
|
28
|
+
*
|
|
29
|
+
* @param {LogLevel} [level='warn'] - Minimum severity level to emit.
|
|
30
|
+
*/
|
|
13
31
|
constructor(level?: LogLevel);
|
|
32
|
+
/**
|
|
33
|
+
* Emits a debug-level message to `stderr` — only written when the
|
|
34
|
+
* configured minimum level is `'debug'`.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} message - Primary log message.
|
|
37
|
+
* @param {...unknown} args - Additional values appended after the message.
|
|
38
|
+
*/
|
|
14
39
|
debug(message: string, ...args: unknown[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* Emits an info-level message to `stderr` — only written when the
|
|
42
|
+
* configured minimum level is `'debug'` or `'info'`.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} message - Primary log message.
|
|
45
|
+
* @param {...unknown} args - Additional values appended after the message.
|
|
46
|
+
*/
|
|
15
47
|
info(message: string, ...args: unknown[]): void;
|
|
48
|
+
/**
|
|
49
|
+
* Emits a warn-level message to `stderr` — only written when the
|
|
50
|
+
* configured minimum level is `'debug'`, `'info'`, or `'warn'`.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} message - Primary log message.
|
|
53
|
+
* @param {...unknown} args - Additional values appended after the message.
|
|
54
|
+
*/
|
|
16
55
|
warn(message: string, ...args: unknown[]): void;
|
|
56
|
+
/**
|
|
57
|
+
* Emits an error-level message to `stderr` — only written when the
|
|
58
|
+
* configured minimum level is not `'silent'`.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} message - Primary log message.
|
|
61
|
+
* @param {...unknown} args - Additional values appended after the message.
|
|
62
|
+
*/
|
|
17
63
|
error(message: string, ...args: unknown[]): void;
|
|
18
64
|
private formatArgs;
|
|
19
65
|
}
|
|
20
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* A no-op {@link Logger} that discards all messages. Assign this via
|
|
68
|
+
* {@link setDefaultLogger} to silence the library entirely.
|
|
69
|
+
*/
|
|
21
70
|
export declare const SILENT_LOGGER: Logger;
|
|
71
|
+
/**
|
|
72
|
+
* Replaces the process-wide default logger used by all NLcURL internals.
|
|
73
|
+
*
|
|
74
|
+
* @param {Logger} logger - New logger instance to install.
|
|
75
|
+
*/
|
|
22
76
|
export declare function setDefaultLogger(logger: Logger): void;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the currently active process-wide logger.
|
|
79
|
+
*
|
|
80
|
+
* @returns {Logger} The active logger instance.
|
|
81
|
+
*/
|
|
23
82
|
export declare function getDefaultLogger(): Logger;
|
|
24
83
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"
|
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