nlcurl 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +149 -140
  2. package/dist/cache/groups.d.ts +75 -0
  3. package/dist/cache/groups.d.ts.map +1 -0
  4. package/dist/cache/groups.js +118 -0
  5. package/dist/cache/groups.js.map +1 -0
  6. package/dist/cache/no-vary-search.d.ts +33 -0
  7. package/dist/cache/no-vary-search.d.ts.map +1 -0
  8. package/dist/cache/no-vary-search.js +148 -0
  9. package/dist/cache/no-vary-search.js.map +1 -0
  10. package/dist/cache/range.d.ts +120 -0
  11. package/dist/cache/range.d.ts.map +1 -0
  12. package/dist/cache/range.js +193 -0
  13. package/dist/cache/range.js.map +1 -0
  14. package/dist/cache/store.d.ts +75 -37
  15. package/dist/cache/store.d.ts.map +1 -1
  16. package/dist/cache/store.js +217 -85
  17. package/dist/cache/store.js.map +1 -1
  18. package/dist/cache/types.d.ts +10 -39
  19. package/dist/cache/types.d.ts.map +1 -1
  20. package/dist/cli/args.d.ts +4 -37
  21. package/dist/cli/args.d.ts.map +1 -1
  22. package/dist/cli/args.js +3 -4
  23. package/dist/cli/args.js.map +1 -1
  24. package/dist/cli/index.d.ts +0 -5
  25. package/dist/cli/index.d.ts.map +1 -1
  26. package/dist/cli/index.js +1 -6
  27. package/dist/cli/index.js.map +1 -1
  28. package/dist/cli/output.d.ts +14 -20
  29. package/dist/cli/output.d.ts.map +1 -1
  30. package/dist/cli/output.js +14 -20
  31. package/dist/cli/output.js.map +1 -1
  32. package/dist/cookies/jar.d.ts +41 -40
  33. package/dist/cookies/jar.d.ts.map +1 -1
  34. package/dist/cookies/jar.js +65 -42
  35. package/dist/cookies/jar.js.map +1 -1
  36. package/dist/cookies/parser.d.ts +13 -17
  37. package/dist/cookies/parser.d.ts.map +1 -1
  38. package/dist/cookies/parser.js +23 -15
  39. package/dist/cookies/parser.js.map +1 -1
  40. package/dist/cookies/psl-data.d.ts +1 -1
  41. package/dist/cookies/psl-data.js +1 -1
  42. package/dist/cookies/public-suffix.d.ts +5 -27
  43. package/dist/cookies/public-suffix.d.ts.map +1 -1
  44. package/dist/cookies/public-suffix.js +5 -37
  45. package/dist/cookies/public-suffix.js.map +1 -1
  46. package/dist/core/auth.d.ts +61 -0
  47. package/dist/core/auth.d.ts.map +1 -0
  48. package/dist/core/auth.js +159 -0
  49. package/dist/core/auth.js.map +1 -0
  50. package/dist/core/client.d.ts +28 -40
  51. package/dist/core/client.d.ts.map +1 -1
  52. package/dist/core/client.js +31 -41
  53. package/dist/core/client.js.map +1 -1
  54. package/dist/core/errors.d.ts +64 -88
  55. package/dist/core/errors.d.ts.map +1 -1
  56. package/dist/core/errors.js +64 -88
  57. package/dist/core/errors.js.map +1 -1
  58. package/dist/core/request.d.ts +33 -113
  59. package/dist/core/request.d.ts.map +1 -1
  60. package/dist/core/response.d.ts +49 -66
  61. package/dist/core/response.d.ts.map +1 -1
  62. package/dist/core/response.js +45 -59
  63. package/dist/core/response.js.map +1 -1
  64. package/dist/core/session.d.ts +66 -78
  65. package/dist/core/session.d.ts.map +1 -1
  66. package/dist/core/session.js +136 -77
  67. package/dist/core/session.js.map +1 -1
  68. package/dist/core/validation.d.ts +58 -43
  69. package/dist/core/validation.d.ts.map +1 -1
  70. package/dist/core/validation.js +141 -56
  71. package/dist/core/validation.js.map +1 -1
  72. package/dist/dns/cache.d.ts +65 -0
  73. package/dist/dns/cache.d.ts.map +1 -0
  74. package/dist/dns/cache.js +119 -0
  75. package/dist/dns/cache.js.map +1 -0
  76. package/dist/dns/codec.d.ts +29 -19
  77. package/dist/dns/codec.d.ts.map +1 -1
  78. package/dist/dns/codec.js +73 -39
  79. package/dist/dns/codec.js.map +1 -1
  80. package/dist/dns/doh-resolver.d.ts +17 -31
  81. package/dist/dns/doh-resolver.d.ts.map +1 -1
  82. package/dist/dns/doh-resolver.js +47 -48
  83. package/dist/dns/doh-resolver.js.map +1 -1
  84. package/dist/dns/dot-resolver.d.ts +89 -0
  85. package/dist/dns/dot-resolver.d.ts.map +1 -0
  86. package/dist/dns/dot-resolver.js +166 -0
  87. package/dist/dns/dot-resolver.js.map +1 -0
  88. package/dist/dns/https-rr.d.ts +19 -30
  89. package/dist/dns/https-rr.d.ts.map +1 -1
  90. package/dist/dns/https-rr.js +22 -40
  91. package/dist/dns/https-rr.js.map +1 -1
  92. package/dist/dns/types.d.ts +31 -59
  93. package/dist/dns/types.d.ts.map +1 -1
  94. package/dist/dns/types.js +3 -14
  95. package/dist/dns/types.js.map +1 -1
  96. package/dist/fingerprints/akamai.d.ts +3 -11
  97. package/dist/fingerprints/akamai.d.ts.map +1 -1
  98. package/dist/fingerprints/akamai.js +3 -11
  99. package/dist/fingerprints/akamai.js.map +1 -1
  100. package/dist/fingerprints/database.d.ts +6 -14
  101. package/dist/fingerprints/database.d.ts.map +1 -1
  102. package/dist/fingerprints/database.js +6 -14
  103. package/dist/fingerprints/database.js.map +1 -1
  104. package/dist/fingerprints/extensions.d.ts +56 -71
  105. package/dist/fingerprints/extensions.d.ts.map +1 -1
  106. package/dist/fingerprints/extensions.js +58 -71
  107. package/dist/fingerprints/extensions.js.map +1 -1
  108. package/dist/fingerprints/ja3.d.ts +12 -30
  109. package/dist/fingerprints/ja3.d.ts.map +1 -1
  110. package/dist/fingerprints/ja3.js +12 -30
  111. package/dist/fingerprints/ja3.js.map +1 -1
  112. package/dist/fingerprints/ja4.d.ts +18 -0
  113. package/dist/fingerprints/ja4.d.ts.map +1 -0
  114. package/dist/fingerprints/ja4.js +81 -0
  115. package/dist/fingerprints/ja4.js.map +1 -0
  116. package/dist/fingerprints/profiles/chrome.d.ts +18 -21
  117. package/dist/fingerprints/profiles/chrome.d.ts.map +1 -1
  118. package/dist/fingerprints/profiles/chrome.js +35 -31
  119. package/dist/fingerprints/profiles/chrome.js.map +1 -1
  120. package/dist/fingerprints/profiles/edge.d.ts +7 -10
  121. package/dist/fingerprints/profiles/edge.d.ts.map +1 -1
  122. package/dist/fingerprints/profiles/edge.js +7 -10
  123. package/dist/fingerprints/profiles/edge.js.map +1 -1
  124. package/dist/fingerprints/profiles/firefox.d.ts +8 -11
  125. package/dist/fingerprints/profiles/firefox.d.ts.map +1 -1
  126. package/dist/fingerprints/profiles/firefox.js +8 -11
  127. package/dist/fingerprints/profiles/firefox.js.map +1 -1
  128. package/dist/fingerprints/profiles/safari.d.ts +11 -14
  129. package/dist/fingerprints/profiles/safari.d.ts.map +1 -1
  130. package/dist/fingerprints/profiles/safari.js +11 -14
  131. package/dist/fingerprints/profiles/safari.js.map +1 -1
  132. package/dist/fingerprints/profiles/tor.d.ts +5 -8
  133. package/dist/fingerprints/profiles/tor.d.ts.map +1 -1
  134. package/dist/fingerprints/profiles/tor.js +5 -8
  135. package/dist/fingerprints/profiles/tor.js.map +1 -1
  136. package/dist/fingerprints/types.d.ts +42 -73
  137. package/dist/fingerprints/types.d.ts.map +1 -1
  138. package/dist/hsts/store.d.ts +19 -21
  139. package/dist/hsts/store.d.ts.map +1 -1
  140. package/dist/hsts/store.js +20 -28
  141. package/dist/hsts/store.js.map +1 -1
  142. package/dist/hsts/types.d.ts +10 -14
  143. package/dist/hsts/types.d.ts.map +1 -1
  144. package/dist/http/alt-svc.d.ts +27 -52
  145. package/dist/http/alt-svc.d.ts.map +1 -1
  146. package/dist/http/alt-svc.js +17 -67
  147. package/dist/http/alt-svc.js.map +1 -1
  148. package/dist/http/early-hints.d.ts +23 -0
  149. package/dist/http/early-hints.d.ts.map +1 -0
  150. package/dist/http/early-hints.js +33 -0
  151. package/dist/http/early-hints.js.map +1 -0
  152. package/dist/http/form-data.d.ts +17 -35
  153. package/dist/http/form-data.d.ts.map +1 -1
  154. package/dist/http/form-data.js +12 -34
  155. package/dist/http/form-data.js.map +1 -1
  156. package/dist/http/h1/client.d.ts +14 -26
  157. package/dist/http/h1/client.d.ts.map +1 -1
  158. package/dist/http/h1/client.js +14 -23
  159. package/dist/http/h1/client.js.map +1 -1
  160. package/dist/http/h1/encoder.d.ts +21 -17
  161. package/dist/http/h1/encoder.d.ts.map +1 -1
  162. package/dist/http/h1/encoder.js +56 -20
  163. package/dist/http/h1/encoder.js.map +1 -1
  164. package/dist/http/h1/parser.d.ts +23 -59
  165. package/dist/http/h1/parser.d.ts.map +1 -1
  166. package/dist/http/h1/parser.js +61 -55
  167. package/dist/http/h1/parser.js.map +1 -1
  168. package/dist/http/h2/client.d.ts +23 -59
  169. package/dist/http/h2/client.d.ts.map +1 -1
  170. package/dist/http/h2/client.js +107 -64
  171. package/dist/http/h2/client.js.map +1 -1
  172. package/dist/http/h2/frames.d.ts +53 -84
  173. package/dist/http/h2/frames.d.ts.map +1 -1
  174. package/dist/http/h2/frames.js +48 -76
  175. package/dist/http/h2/frames.js.map +1 -1
  176. package/dist/http/h2/hpack.d.ts +20 -36
  177. package/dist/http/h2/hpack.d.ts.map +1 -1
  178. package/dist/http/h2/hpack.js +41 -36
  179. package/dist/http/h2/hpack.js.map +1 -1
  180. package/dist/http/negotiator.d.ts +25 -38
  181. package/dist/http/negotiator.d.ts.map +1 -1
  182. package/dist/http/negotiator.js +17 -38
  183. package/dist/http/negotiator.js.map +1 -1
  184. package/dist/http/pool.d.ts +34 -64
  185. package/dist/http/pool.d.ts.map +1 -1
  186. package/dist/http/pool.js +22 -41
  187. package/dist/http/pool.js.map +1 -1
  188. package/dist/http/resumable-upload.d.ts +76 -0
  189. package/dist/http/resumable-upload.d.ts.map +1 -0
  190. package/dist/http/resumable-upload.js +104 -0
  191. package/dist/http/resumable-upload.js.map +1 -0
  192. package/dist/http/trailers.d.ts +29 -0
  193. package/dist/http/trailers.d.ts.map +1 -0
  194. package/dist/http/trailers.js +57 -0
  195. package/dist/http/trailers.js.map +1 -0
  196. package/dist/index.d.ts +24 -9
  197. package/dist/index.d.ts.map +1 -1
  198. package/dist/index.js +24 -3
  199. package/dist/index.js.map +1 -1
  200. package/dist/middleware/circuit-breaker.d.ts +44 -0
  201. package/dist/middleware/circuit-breaker.d.ts.map +1 -0
  202. package/dist/middleware/circuit-breaker.js +96 -0
  203. package/dist/middleware/circuit-breaker.js.map +1 -0
  204. package/dist/middleware/interceptor.d.ts +13 -32
  205. package/dist/middleware/interceptor.d.ts.map +1 -1
  206. package/dist/middleware/interceptor.js +11 -16
  207. package/dist/middleware/interceptor.js.map +1 -1
  208. package/dist/middleware/rate-limiter.d.ts +8 -17
  209. package/dist/middleware/rate-limiter.d.ts.map +1 -1
  210. package/dist/middleware/rate-limiter.js +11 -12
  211. package/dist/middleware/rate-limiter.js.map +1 -1
  212. package/dist/middleware/retry-after.d.ts +15 -0
  213. package/dist/middleware/retry-after.d.ts.map +1 -0
  214. package/dist/middleware/retry-after.js +36 -0
  215. package/dist/middleware/retry-after.js.map +1 -0
  216. package/dist/middleware/retry.d.ts +9 -18
  217. package/dist/middleware/retry.d.ts.map +1 -1
  218. package/dist/middleware/retry.js +12 -9
  219. package/dist/middleware/retry.js.map +1 -1
  220. package/dist/proxy/auth.d.ts +73 -0
  221. package/dist/proxy/auth.d.ts.map +1 -0
  222. package/dist/proxy/auth.js +129 -0
  223. package/dist/proxy/auth.js.map +1 -0
  224. package/dist/proxy/env-proxy.d.ts +5 -15
  225. package/dist/proxy/env-proxy.d.ts.map +1 -1
  226. package/dist/proxy/env-proxy.js +5 -23
  227. package/dist/proxy/env-proxy.js.map +1 -1
  228. package/dist/proxy/http-proxy.d.ts +12 -19
  229. package/dist/proxy/http-proxy.d.ts.map +1 -1
  230. package/dist/proxy/http-proxy.js +5 -8
  231. package/dist/proxy/http-proxy.js.map +1 -1
  232. package/dist/proxy/socks.d.ts +13 -20
  233. package/dist/proxy/socks.d.ts.map +1 -1
  234. package/dist/proxy/socks.js +8 -10
  235. package/dist/proxy/socks.js.map +1 -1
  236. package/dist/sse/parser.d.ts +16 -37
  237. package/dist/sse/parser.d.ts.map +1 -1
  238. package/dist/sse/parser.js +31 -28
  239. package/dist/sse/parser.js.map +1 -1
  240. package/dist/tls/constants.d.ts +21 -72
  241. package/dist/tls/constants.d.ts.map +1 -1
  242. package/dist/tls/constants.js +21 -72
  243. package/dist/tls/constants.js.map +1 -1
  244. package/dist/tls/ct.d.ts +78 -0
  245. package/dist/tls/ct.d.ts.map +1 -0
  246. package/dist/tls/ct.js +175 -0
  247. package/dist/tls/ct.js.map +1 -0
  248. package/dist/tls/early-data.d.ts +45 -0
  249. package/dist/tls/early-data.d.ts.map +1 -0
  250. package/dist/tls/early-data.js +46 -0
  251. package/dist/tls/early-data.js.map +1 -0
  252. package/dist/tls/ech.d.ts +68 -85
  253. package/dist/tls/ech.d.ts.map +1 -1
  254. package/dist/tls/ech.js +54 -102
  255. package/dist/tls/ech.js.map +1 -1
  256. package/dist/tls/keylog.d.ts +34 -0
  257. package/dist/tls/keylog.d.ts.map +1 -0
  258. package/dist/tls/keylog.js +64 -0
  259. package/dist/tls/keylog.js.map +1 -0
  260. package/dist/tls/node-engine.d.ts +10 -17
  261. package/dist/tls/node-engine.d.ts.map +1 -1
  262. package/dist/tls/node-engine.js +41 -18
  263. package/dist/tls/node-engine.js.map +1 -1
  264. package/dist/tls/ocsp.d.ts +55 -0
  265. package/dist/tls/ocsp.d.ts.map +1 -0
  266. package/dist/tls/ocsp.js +131 -0
  267. package/dist/tls/ocsp.js.map +1 -0
  268. package/dist/tls/pin-verification.d.ts +5 -4
  269. package/dist/tls/pin-verification.d.ts.map +1 -1
  270. package/dist/tls/pin-verification.js +5 -11
  271. package/dist/tls/pin-verification.js.map +1 -1
  272. package/dist/tls/session-cache.d.ts +27 -39
  273. package/dist/tls/session-cache.d.ts.map +1 -1
  274. package/dist/tls/session-cache.js +20 -24
  275. package/dist/tls/session-cache.js.map +1 -1
  276. package/dist/tls/stealth/client-hello.d.ts +26 -45
  277. package/dist/tls/stealth/client-hello.d.ts.map +1 -1
  278. package/dist/tls/stealth/client-hello.js +15 -31
  279. package/dist/tls/stealth/client-hello.js.map +1 -1
  280. package/dist/tls/stealth/engine.d.ts +10 -15
  281. package/dist/tls/stealth/engine.d.ts.map +1 -1
  282. package/dist/tls/stealth/engine.js +98 -18
  283. package/dist/tls/stealth/engine.js.map +1 -1
  284. package/dist/tls/stealth/handshake.d.ts +32 -31
  285. package/dist/tls/stealth/handshake.d.ts.map +1 -1
  286. package/dist/tls/stealth/handshake.js +74 -47
  287. package/dist/tls/stealth/handshake.js.map +1 -1
  288. package/dist/tls/stealth/key-schedule.d.ts +81 -86
  289. package/dist/tls/stealth/key-schedule.d.ts.map +1 -1
  290. package/dist/tls/stealth/key-schedule.js +70 -58
  291. package/dist/tls/stealth/key-schedule.js.map +1 -1
  292. package/dist/tls/stealth/record-layer.d.ts +52 -75
  293. package/dist/tls/stealth/record-layer.d.ts.map +1 -1
  294. package/dist/tls/stealth/record-layer.js +47 -63
  295. package/dist/tls/stealth/record-layer.js.map +1 -1
  296. package/dist/tls/stealth/tls12-handshake.d.ts +16 -0
  297. package/dist/tls/stealth/tls12-handshake.d.ts.map +1 -1
  298. package/dist/tls/stealth/tls12-handshake.js +10 -2
  299. package/dist/tls/stealth/tls12-handshake.js.map +1 -1
  300. package/dist/tls/types.d.ts +46 -60
  301. package/dist/tls/types.d.ts.map +1 -1
  302. package/dist/utils/buffer-reader.d.ts +26 -81
  303. package/dist/utils/buffer-reader.d.ts.map +1 -1
  304. package/dist/utils/buffer-reader.js +26 -81
  305. package/dist/utils/buffer-reader.js.map +1 -1
  306. package/dist/utils/buffer-writer.d.ts +30 -66
  307. package/dist/utils/buffer-writer.d.ts.map +1 -1
  308. package/dist/utils/buffer-writer.js +30 -66
  309. package/dist/utils/buffer-writer.js.map +1 -1
  310. package/dist/utils/compression.d.ts +18 -0
  311. package/dist/utils/compression.d.ts.map +1 -0
  312. package/dist/utils/compression.js +34 -0
  313. package/dist/utils/compression.js.map +1 -0
  314. package/dist/utils/dictionary-transport.d.ts +97 -0
  315. package/dist/utils/dictionary-transport.d.ts.map +1 -0
  316. package/dist/utils/dictionary-transport.js +171 -0
  317. package/dist/utils/dictionary-transport.js.map +1 -0
  318. package/dist/utils/encoding.d.ts +12 -30
  319. package/dist/utils/encoding.d.ts.map +1 -1
  320. package/dist/utils/encoding.js +15 -46
  321. package/dist/utils/encoding.js.map +1 -1
  322. package/dist/utils/happy-eyeballs.d.ts +18 -8
  323. package/dist/utils/happy-eyeballs.d.ts.map +1 -1
  324. package/dist/utils/happy-eyeballs.js +19 -27
  325. package/dist/utils/happy-eyeballs.js.map +1 -1
  326. package/dist/utils/logger.d.ts +54 -81
  327. package/dist/utils/logger.d.ts.map +1 -1
  328. package/dist/utils/logger.js +92 -64
  329. package/dist/utils/logger.js.map +1 -1
  330. package/dist/utils/tcp-fast-open.d.ts +30 -0
  331. package/dist/utils/tcp-fast-open.d.ts.map +1 -0
  332. package/dist/utils/tcp-fast-open.js +36 -0
  333. package/dist/utils/tcp-fast-open.js.map +1 -0
  334. package/dist/utils/url.d.ts +18 -25
  335. package/dist/utils/url.d.ts.map +1 -1
  336. package/dist/utils/url.js +18 -25
  337. package/dist/utils/url.js.map +1 -1
  338. package/dist/ws/client.d.ts +35 -53
  339. package/dist/ws/client.d.ts.map +1 -1
  340. package/dist/ws/client.js +96 -38
  341. package/dist/ws/client.js.map +1 -1
  342. package/dist/ws/frame.d.ts +24 -41
  343. package/dist/ws/frame.d.ts.map +1 -1
  344. package/dist/ws/frame.js +26 -33
  345. package/dist/ws/frame.js.map +1 -1
  346. package/dist/ws/permessage-deflate.d.ts +23 -28
  347. package/dist/ws/permessage-deflate.d.ts.map +1 -1
  348. package/dist/ws/permessage-deflate.js +18 -26
  349. package/dist/ws/permessage-deflate.js.map +1 -1
  350. package/package.json +2 -2
  351. package/dist/http/h3/detection.d.ts +0 -17
  352. package/dist/http/h3/detection.d.ts.map +0 -1
  353. package/dist/http/h3/detection.js +0 -59
  354. package/dist/http/h3/detection.js.map +0 -1
@@ -0,0 +1,159 @@
1
+ import { createHash, createHmac, randomBytes } from "node:crypto";
2
+ const digestNonceCounters = new Map();
3
+ /**
4
+ * Builds an HTTP Authorization header value from the given auth configuration.
5
+ *
6
+ * @param {AuthConfig} auth - The authentication configuration.
7
+ * @param {Object} [context] - Additional context for stateful schemes.
8
+ * @param {string} [context.method] - HTTP method for Digest/SigV4.
9
+ * @param {string} [context.url] - Request URL for Digest/SigV4.
10
+ * @param {string} [context.wwwAuthenticate] - WWW-Authenticate header for Digest.
11
+ * @param {Record<string, string>} [context.headers] - Request headers for SigV4.
12
+ * @param {Buffer} [context.body] - Request body for SigV4.
13
+ * @returns {string|undefined} The formatted Authorization header value, or `undefined` if credentials are incomplete.
14
+ */
15
+ export function buildAuthHeader(auth, context) {
16
+ switch (auth.type) {
17
+ case "basic": {
18
+ if (!auth.username)
19
+ return undefined;
20
+ const credentials = `${auth.username}:${auth.password ?? ""}`;
21
+ return `Basic ${Buffer.from(credentials, "utf-8").toString("base64")}`;
22
+ }
23
+ case "bearer": {
24
+ if (!auth.token)
25
+ return undefined;
26
+ return `Bearer ${auth.token}`;
27
+ }
28
+ case "digest": {
29
+ if (!auth.username || !context?.wwwAuthenticate || !context?.method || !context?.url)
30
+ return undefined;
31
+ const challenge = parseDigestChallenge(context.wwwAuthenticate);
32
+ if (!challenge)
33
+ return undefined;
34
+ return buildDigestAuthHeader(context.method, context.url, auth.username, auth.password ?? "", challenge);
35
+ }
36
+ case "aws-sigv4": {
37
+ if (!auth.awsAccessKeyId || !auth.awsSecretKey || !auth.awsRegion || !auth.awsService || !context?.method || !context?.url)
38
+ return undefined;
39
+ return buildAWSSigV4(context.method, context.url, context.headers ?? {}, context.body ?? Buffer.alloc(0), auth.awsAccessKeyId, auth.awsSecretKey, auth.awsRegion, auth.awsService, auth.awsSessionToken);
40
+ }
41
+ default:
42
+ return undefined;
43
+ }
44
+ }
45
+ /**
46
+ * Parse a Digest challenge from WWW-Authenticate header.
47
+ */
48
+ function parseDigestChallenge(header) {
49
+ const lower = header.toLowerCase().trim();
50
+ if (!lower.startsWith("digest "))
51
+ return null;
52
+ const challenge = header.substring(7);
53
+ const params = {};
54
+ const regex = /(\w+)=(?:"([^"]*)"|([\w.]+))/g;
55
+ let match;
56
+ while ((match = regex.exec(challenge)) !== null) {
57
+ params[match[1].toLowerCase()] = match[2] ?? match[3] ?? "";
58
+ }
59
+ if (!params["realm"] || !params["nonce"])
60
+ return null;
61
+ return {
62
+ realm: params["realm"],
63
+ nonce: params["nonce"],
64
+ qop: params["qop"],
65
+ opaque: params["opaque"],
66
+ algorithm: params["algorithm"],
67
+ stale: params["stale"]?.toLowerCase() === "true",
68
+ };
69
+ }
70
+ function md(algo, data) {
71
+ return createHash(algo).update(data).digest("hex");
72
+ }
73
+ /**
74
+ * Build a Digest Authorization header value (RFC 7616).
75
+ */
76
+ function buildDigestAuthHeader(method, uri, username, password, challenge) {
77
+ const algorithm = (challenge.algorithm ?? "MD5").toUpperCase();
78
+ const hashFn = algorithm === "SHA-256" || algorithm === "SHA-256-SESS" ? "sha256" : algorithm === "SHA-512-256" || algorithm === "SHA-512-256-SESS" ? "sha512-256" : "md5";
79
+ let ha1 = md(hashFn, `${username}:${challenge.realm}:${password}`);
80
+ const cnonce = randomBytes(16).toString("hex");
81
+ if (algorithm.endsWith("-SESS")) {
82
+ ha1 = md(hashFn, `${ha1}:${challenge.nonce}:${cnonce}`);
83
+ }
84
+ const parsedUrl = new URL(uri, "http://localhost");
85
+ const digestUri = parsedUrl.pathname + parsedUrl.search;
86
+ const ha2 = md(hashFn, `${method}:${digestUri}`);
87
+ const count = (digestNonceCounters.get(challenge.nonce) ?? 0) + 1;
88
+ digestNonceCounters.set(challenge.nonce, count);
89
+ const nc = count.toString(16).padStart(8, "0");
90
+ let response;
91
+ let headerStr;
92
+ if (challenge.qop) {
93
+ const qop = challenge.qop.includes("auth") ? "auth" : challenge.qop;
94
+ response = md(hashFn, `${ha1}:${challenge.nonce}:${nc}:${cnonce}:${qop}:${ha2}`);
95
+ headerStr = `Digest username="${username}", realm="${challenge.realm}", `;
96
+ headerStr += `nonce="${challenge.nonce}", uri="${digestUri}", `;
97
+ headerStr += `algorithm=${algorithm}, qop=${qop}, nc=${nc}, cnonce="${cnonce}", `;
98
+ headerStr += `response="${response}"`;
99
+ }
100
+ else {
101
+ response = md(hashFn, `${ha1}:${challenge.nonce}:${ha2}`);
102
+ headerStr = `Digest username="${username}", realm="${challenge.realm}", `;
103
+ headerStr += `nonce="${challenge.nonce}", uri="${digestUri}", `;
104
+ headerStr += `algorithm=${algorithm}, response="${response}"`;
105
+ }
106
+ if (challenge.opaque)
107
+ headerStr += `, opaque="${challenge.opaque}"`;
108
+ return headerStr;
109
+ }
110
+ /**
111
+ * AWS Signature Version 4 signing (simplified).
112
+ */
113
+ function buildAWSSigV4(method, url, headers, body, accessKeyId, secretKey, region, service, sessionToken) {
114
+ const parsed = new URL(url);
115
+ const now = new Date();
116
+ const dateStamp = now.toISOString().replace(/[-:T]/g, "").substring(0, 8);
117
+ const amzDate = now
118
+ .toISOString()
119
+ .replace(/[-:]/g, "")
120
+ .replace(/\.\d{3}/, "");
121
+ const signedHeaders = {};
122
+ signedHeaders["host"] = parsed.host;
123
+ for (const [k, v] of Object.entries(headers)) {
124
+ signedHeaders[k.toLowerCase().trim()] = v.trim();
125
+ }
126
+ signedHeaders["x-amz-date"] = amzDate;
127
+ if (sessionToken) {
128
+ signedHeaders["x-amz-security-token"] = sessionToken;
129
+ }
130
+ const sortedHeaderNames = Object.keys(signedHeaders).sort();
131
+ const canonicalHeaders = sortedHeaderNames.map((k) => `${k}:${signedHeaders[k]}`).join("\n") + "\n";
132
+ const signedHeadersList = sortedHeaderNames.join(";");
133
+ const payloadHash = createHash("sha256").update(body).digest("hex");
134
+ const canonicalUri = parsed.pathname || "/";
135
+ const canonicalQueryString = [...parsed.searchParams]
136
+ .sort((a, b) => a[0].localeCompare(b[0]))
137
+ .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
138
+ .join("&");
139
+ const canonicalRequest = [method.toUpperCase(), canonicalUri, canonicalQueryString, canonicalHeaders, signedHeadersList, payloadHash].join("\n");
140
+ const credentialScope = `${dateStamp}/${region}/${service}/aws4_request`;
141
+ const stringToSign = ["AWS4-HMAC-SHA256", amzDate, credentialScope, createHash("sha256").update(canonicalRequest).digest("hex")].join("\n");
142
+ const kDate = createHmac("sha256", `AWS4${secretKey}`).update(dateStamp).digest();
143
+ const kRegion = createHmac("sha256", kDate).update(region).digest();
144
+ const kService = createHmac("sha256", kRegion).update(service).digest();
145
+ const kSigning = createHmac("sha256", kService).update("aws4_request").digest();
146
+ const signature = createHmac("sha256", kSigning).update(stringToSign).digest("hex");
147
+ return `AWS4-HMAC-SHA256 Credential=${accessKeyId}/${credentialScope}, SignedHeaders=${signedHeadersList}, Signature=${signature}`;
148
+ }
149
+ /**
150
+ * Extracts the authentication scheme name from a WWW-Authenticate or Proxy-Authenticate header.
151
+ *
152
+ * @param {string} header - The raw authenticate header value.
153
+ * @returns {string|undefined} The lowercase scheme name (e.g. "basic", "bearer"), or `undefined` if not parseable.
154
+ */
155
+ export function parseAuthenticateScheme(header) {
156
+ const match = /^(\w+)\s/i.exec(header.trim());
157
+ return match ? match[1].toLowerCase() : undefined;
158
+ }
159
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/core/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAsClE,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAgB,EAChB,OAMC;IAED,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAAE,OAAO,SAAS,CAAC;YACrC,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ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EAAE,OAAO,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC;IAClF,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;IACpE,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IACxE,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC;IAChF,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpF,OAAO,+BAA+B,WAAW,IAAI,eAAe,mBAAmB,iBAAiB,eAAe,SAAS,EAAE,CAAC;AACrI,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC"}
@@ -2,92 +2,80 @@ import type { NLcURLRequest, NLcURLSessionConfig, RequestBody } from "./request.
2
2
  import { NLcURLResponse } from "./response.js";
3
3
  import { NLcURLSession, type RequestOptions } from "./session.js";
4
4
  /**
5
- * Creates a new {@link NLcURLSession} with the given configuration. Use a
6
- * session when you need to share cookies, connection pools, or interceptors
7
- * across multiple requests. Call {@link NLcURLSession.close} when finished.
5
+ * Creates a new session with optional configuration for connection reuse,
6
+ * cookie persistence, caching, and other session-level features.
8
7
  *
9
- * @param {NLcURLSessionConfig} [config] - Session-level defaults.
8
+ * @param {NLcURLSessionConfig} [config] - Session configuration options.
10
9
  * @returns {NLcURLSession} A new session instance.
11
- *
12
- * @example
13
- * const session = createSession({ impersonate: 'chrome136' });
14
- * const r = await session.get('https://example.com');
15
- * session.close();
16
10
  */
17
11
  export declare function createSession(config?: NLcURLSessionConfig): NLcURLSession;
18
12
  /**
19
- * Sends a one-shot HTTP request by creating a temporary session internally.
20
- * The session is closed automatically after the response is received.
21
- * For repeated requests to the same origin, prefer {@link createSession}.
13
+ * Sends a one-shot HTTP request using a temporary session. Supports streaming
14
+ * responses when `input.stream` is `true`.
22
15
  *
23
- * @param {NLcURLRequest} input - Complete request descriptor.
16
+ * @param {NLcURLRequest} input - The full request descriptor including URL, method, headers, and body.
24
17
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
25
- * @throws {AbortError} If the `signal` in `input` fires before completion.
26
- * @throws {TimeoutError} If any configured timeout is exceeded.
27
- * @throws {ConnectionError} If the TCP connection cannot be established.
28
- * @throws {TLSError} If the TLS handshake fails.
29
- * @throws {ProxyError} If the proxy tunnel cannot be established.
30
18
  */
31
19
  export declare function request(input: NLcURLRequest): Promise<NLcURLResponse>;
32
20
  /**
33
- * Issues a one-shot `GET` request.
21
+ * Sends an HTTP GET request.
34
22
  *
35
- * @param {string} url - Absolute URL to request.
36
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
23
+ * @param {string} url - The target URL.
24
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
37
25
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
38
26
  */
39
27
  export declare function get(url: string, options?: RequestOptions & {
40
28
  impersonate?: string;
41
29
  }): Promise<NLcURLResponse>;
42
30
  /**
43
- * Issues a one-shot `POST` request.
31
+ * Sends an HTTP POST request.
44
32
  *
45
- * @param {string} url - Absolute URL to request.
46
- * @param {RequestBody} [body] - Request body payload.
47
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
33
+ * @param {string} url - The target URL.
34
+ * @param {RequestBody} [body] - The request body.
35
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
48
36
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
49
37
  */
50
38
  export declare function post(url: string, body?: RequestBody, options?: RequestOptions & {
51
39
  impersonate?: string;
52
40
  }): Promise<NLcURLResponse>;
53
41
  /**
54
- * Issues a one-shot `PUT` request.
42
+ * Sends an HTTP PUT request.
55
43
  *
56
- * @param {string} url - Absolute URL to request.
57
- * @param {RequestBody} [body] - Request body payload.
58
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
44
+ * @param {string} url - The target URL.
45
+ * @param {RequestBody} [body] - The request body.
46
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
59
47
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
60
48
  */
61
49
  export declare function put(url: string, body?: RequestBody, options?: RequestOptions & {
62
50
  impersonate?: string;
63
51
  }): Promise<NLcURLResponse>;
64
52
  /**
65
- * Issues a one-shot `PATCH` request.
53
+ * Sends an HTTP PATCH request.
66
54
  *
67
- * @param {string} url - Absolute URL to request.
68
- * @param {RequestBody} [body] - Request body payload.
69
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
55
+ * @param {string} url - The target URL.
56
+ * @param {RequestBody} [body] - The request body.
57
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
70
58
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
71
59
  */
72
60
  export declare function patch(url: string, body?: RequestBody, options?: RequestOptions & {
73
61
  impersonate?: string;
74
62
  }): Promise<NLcURLResponse>;
75
63
  /**
76
- * Issues a one-shot `DELETE` request.
64
+ * Sends an HTTP DELETE request.
77
65
  *
78
- * @param {string} url - Absolute URL to request.
79
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
66
+ * @param {string} url - The target URL.
67
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
80
68
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
81
69
  */
82
70
  export declare function del(url: string, options?: RequestOptions & {
83
71
  impersonate?: string;
84
72
  }): Promise<NLcURLResponse>;
85
73
  /**
86
- * Issues a one-shot `HEAD` request. The response body will be empty.
74
+ * Sends an HTTP HEAD request.
87
75
  *
88
- * @param {string} url - Absolute URL to request.
89
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
90
- * @returns {Promise<NLcURLResponse>} Resolves with the response (headers only, no body).
76
+ * @param {string} url - The target URL.
77
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
78
+ * @returns {Promise<NLcURLResponse>} Resolves with the server response.
91
79
  */
92
80
  export declare function head(url: string, options?: RequestOptions & {
93
81
  impersonate?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,aAAa,CAEzE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAoB3E;AAED;;;;;;GAMG;AACH,wBAAsB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAEnH;AAED;;;;;;;GAOG;AACH,wBAAsB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE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AAC,cAAc,CAAC,CAEpH"}
@@ -1,32 +1,20 @@
1
1
  import { NLcURLSession } from "./session.js";
2
2
  /**
3
- * Creates a new {@link NLcURLSession} with the given configuration. Use a
4
- * session when you need to share cookies, connection pools, or interceptors
5
- * across multiple requests. Call {@link NLcURLSession.close} when finished.
3
+ * Creates a new session with optional configuration for connection reuse,
4
+ * cookie persistence, caching, and other session-level features.
6
5
  *
7
- * @param {NLcURLSessionConfig} [config] - Session-level defaults.
6
+ * @param {NLcURLSessionConfig} [config] - Session configuration options.
8
7
  * @returns {NLcURLSession} A new session instance.
9
- *
10
- * @example
11
- * const session = createSession({ impersonate: 'chrome136' });
12
- * const r = await session.get('https://example.com');
13
- * session.close();
14
8
  */
15
9
  export function createSession(config) {
16
10
  return new NLcURLSession(config);
17
11
  }
18
12
  /**
19
- * Sends a one-shot HTTP request by creating a temporary session internally.
20
- * The session is closed automatically after the response is received.
21
- * For repeated requests to the same origin, prefer {@link createSession}.
13
+ * Sends a one-shot HTTP request using a temporary session. Supports streaming
14
+ * responses when `input.stream` is `true`.
22
15
  *
23
- * @param {NLcURLRequest} input - Complete request descriptor.
16
+ * @param {NLcURLRequest} input - The full request descriptor including URL, method, headers, and body.
24
17
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
25
- * @throws {AbortError} If the `signal` in `input` fires before completion.
26
- * @throws {TimeoutError} If any configured timeout is exceeded.
27
- * @throws {ConnectionError} If the TCP connection cannot be established.
28
- * @throws {TLSError} If the TLS handshake fails.
29
- * @throws {ProxyError} If the proxy tunnel cannot be established.
30
18
  */
31
19
  export async function request(input) {
32
20
  const session = new NLcURLSession(extractSessionConfig(input));
@@ -39,7 +27,9 @@ export async function request(input) {
39
27
  session.close();
40
28
  throw err;
41
29
  }
42
- const cleanup = () => session.close();
30
+ const cleanup = () => {
31
+ session.close();
32
+ };
43
33
  response.body?.once("close", cleanup);
44
34
  if (response.body === null)
45
35
  session.close();
@@ -53,64 +43,64 @@ export async function request(input) {
53
43
  }
54
44
  }
55
45
  /**
56
- * Issues a one-shot `GET` request.
46
+ * Sends an HTTP GET request.
57
47
  *
58
- * @param {string} url - Absolute URL to request.
59
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
48
+ * @param {string} url - The target URL.
49
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
60
50
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
61
51
  */
62
52
  export async function get(url, options) {
63
53
  return request({ ...options, url, method: "GET" });
64
54
  }
65
55
  /**
66
- * Issues a one-shot `POST` request.
56
+ * Sends an HTTP POST request.
67
57
  *
68
- * @param {string} url - Absolute URL to request.
69
- * @param {RequestBody} [body] - Request body payload.
70
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
58
+ * @param {string} url - The target URL.
59
+ * @param {RequestBody} [body] - The request body.
60
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
71
61
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
72
62
  */
73
63
  export async function post(url, body, options) {
74
64
  return request({ ...options, url, method: "POST", body });
75
65
  }
76
66
  /**
77
- * Issues a one-shot `PUT` request.
67
+ * Sends an HTTP PUT request.
78
68
  *
79
- * @param {string} url - Absolute URL to request.
80
- * @param {RequestBody} [body] - Request body payload.
81
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
69
+ * @param {string} url - The target URL.
70
+ * @param {RequestBody} [body] - The request body.
71
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
82
72
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
83
73
  */
84
74
  export async function put(url, body, options) {
85
75
  return request({ ...options, url, method: "PUT", body });
86
76
  }
87
77
  /**
88
- * Issues a one-shot `PATCH` request.
78
+ * Sends an HTTP PATCH request.
89
79
  *
90
- * @param {string} url - Absolute URL to request.
91
- * @param {RequestBody} [body] - Request body payload.
92
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
80
+ * @param {string} url - The target URL.
81
+ * @param {RequestBody} [body] - The request body.
82
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
93
83
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
94
84
  */
95
85
  export async function patch(url, body, options) {
96
86
  return request({ ...options, url, method: "PATCH", body });
97
87
  }
98
88
  /**
99
- * Issues a one-shot `DELETE` request.
89
+ * Sends an HTTP DELETE request.
100
90
  *
101
- * @param {string} url - Absolute URL to request.
102
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
91
+ * @param {string} url - The target URL.
92
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
103
93
  * @returns {Promise<NLcURLResponse>} Resolves with the server response.
104
94
  */
105
95
  export async function del(url, options) {
106
96
  return request({ ...options, url, method: "DELETE" });
107
97
  }
108
98
  /**
109
- * Issues a one-shot `HEAD` request. The response body will be empty.
99
+ * Sends an HTTP HEAD request.
110
100
  *
111
- * @param {string} url - Absolute URL to request.
112
- * @param {RequestOptions & { impersonate?: string }} [options] - Optional per-request settings.
113
- * @returns {Promise<NLcURLResponse>} Resolves with the response (headers only, no body).
101
+ * @param {string} url - The target URL.
102
+ * @param {RequestOptions & { impersonate?: string }} [options] - Optional request configuration.
103
+ * @returns {Promise<NLcURLResponse>} Resolves with the server response.
114
104
  */
115
105
  export async function head(url, options) {
116
106
  return request({ ...options, url, method: "HEAD" });
@@ -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;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4B;IACxD,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAAoB;IAChD,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,oBAAoB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