hyperttp 0.1.5
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/LICENSE +21 -0
- package/README.md +92 -0
- package/dist/Hyperttp/Core/CacheManager.d.ts +65 -0
- package/dist/Hyperttp/Core/CacheManager.d.ts.map +1 -0
- package/dist/Hyperttp/Core/CacheManager.js +80 -0
- package/dist/Hyperttp/Core/CacheManager.js.map +1 -0
- package/dist/Hyperttp/Core/HttpClientImproved.d.ts +280 -0
- package/dist/Hyperttp/Core/HttpClientImproved.d.ts.map +1 -0
- package/dist/Hyperttp/Core/HttpClientImproved.js +611 -0
- package/dist/Hyperttp/Core/HttpClientImproved.js.map +1 -0
- package/dist/Hyperttp/Core/QueueManager.d.ts +49 -0
- package/dist/Hyperttp/Core/QueueManager.d.ts.map +1 -0
- package/dist/Hyperttp/Core/QueueManager.js +75 -0
- package/dist/Hyperttp/Core/QueueManager.js.map +1 -0
- package/dist/Hyperttp/Core/RateLimiter.d.ts +53 -0
- package/dist/Hyperttp/Core/RateLimiter.d.ts.map +1 -0
- package/dist/Hyperttp/Core/RateLimiter.js +70 -0
- package/dist/Hyperttp/Core/RateLimiter.js.map +1 -0
- package/dist/Hyperttp/Core/index.d.ts +22 -0
- package/dist/Hyperttp/Core/index.d.ts.map +1 -0
- package/dist/Hyperttp/Core/index.js +29 -0
- package/dist/Hyperttp/Core/index.js.map +1 -0
- package/dist/Hyperttp/Request.d.ts +78 -0
- package/dist/Hyperttp/Request.d.ts.map +1 -0
- package/dist/Hyperttp/Request.js +234 -0
- package/dist/Hyperttp/Request.js.map +1 -0
- package/dist/Hyperttp/UrlExtractor.d.ts +87 -0
- package/dist/Hyperttp/UrlExtractor.d.ts.map +1 -0
- package/dist/Hyperttp/UrlExtractor.js +127 -0
- package/dist/Hyperttp/UrlExtractor.js.map +1 -0
- package/dist/Hyperttp/index.d.ts +5 -0
- package/dist/Hyperttp/index.d.ts.map +1 -0
- package/dist/Hyperttp/index.js +18 -0
- package/dist/Hyperttp/index.js.map +1 -0
- package/dist/Types/index.d.ts +32 -0
- package/dist/Types/index.d.ts.map +1 -0
- package/dist/Types/index.js +18 -0
- package/dist/Types/index.js.map +1 -0
- package/dist/Types/request.d.ts +136 -0
- package/dist/Types/request.d.ts.map +1 -0
- package/dist/Types/request.js +3 -0
- package/dist/Types/request.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.RateLimitError = exports.TimeoutError = exports.HttpClientError = void 0;
|
|
37
|
+
const tough_cookie_1 = require("tough-cookie");
|
|
38
|
+
const undici_1 = require("undici");
|
|
39
|
+
const undici_2 = require("http-cookie-agent/undici");
|
|
40
|
+
const zlib = __importStar(require("zlib"));
|
|
41
|
+
const util_1 = require("util");
|
|
42
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
43
|
+
const querystring = __importStar(require("querystring"));
|
|
44
|
+
const CacheManager_1 = require("./CacheManager");
|
|
45
|
+
const QueueManager_1 = require("./QueueManager");
|
|
46
|
+
const RateLimiter_1 = require("./RateLimiter");
|
|
47
|
+
const gunzip = (0, util_1.promisify)(zlib.gunzip);
|
|
48
|
+
const inflate = (0, util_1.promisify)(zlib.inflate);
|
|
49
|
+
const brotliDecompress = (0, util_1.promisify)(zlib.brotliDecompress);
|
|
50
|
+
/**
|
|
51
|
+
* Custom error classes for better error handling
|
|
52
|
+
*/
|
|
53
|
+
class HttpClientError extends Error {
|
|
54
|
+
statusCode;
|
|
55
|
+
originalError;
|
|
56
|
+
url;
|
|
57
|
+
method;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new HttpClientError instance.
|
|
60
|
+
* @param message The error message
|
|
61
|
+
* @param statusCode Optional HTTP status code
|
|
62
|
+
* @param originalError Optional original error that caused this error
|
|
63
|
+
* @param url Optional request URL
|
|
64
|
+
* @param method Optional HTTP method
|
|
65
|
+
*/
|
|
66
|
+
constructor(message, statusCode, originalError, url, method) {
|
|
67
|
+
super(message);
|
|
68
|
+
this.statusCode = statusCode;
|
|
69
|
+
this.originalError = originalError;
|
|
70
|
+
this.url = url;
|
|
71
|
+
this.method = method;
|
|
72
|
+
this.name = "HttpClientError";
|
|
73
|
+
Object.setPrototypeOf(this, HttpClientError.prototype);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.HttpClientError = HttpClientError;
|
|
77
|
+
class TimeoutError extends HttpClientError {
|
|
78
|
+
/**
|
|
79
|
+
* Creates a new TimeoutError instance.
|
|
80
|
+
* @param url The request URL that timed out
|
|
81
|
+
* @param timeout The timeout duration in milliseconds
|
|
82
|
+
*/
|
|
83
|
+
constructor(url, timeout) {
|
|
84
|
+
super(`Request timeout after ${timeout}ms for ${url}`);
|
|
85
|
+
this.name = "TimeoutError";
|
|
86
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.TimeoutError = TimeoutError;
|
|
90
|
+
class RateLimitError extends HttpClientError {
|
|
91
|
+
retryAfter;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a new RateLimitError instance.
|
|
94
|
+
* @param url The request URL that was rate limited
|
|
95
|
+
* @param retryAfter Optional retry after duration in milliseconds
|
|
96
|
+
*/
|
|
97
|
+
constructor(url, retryAfter) {
|
|
98
|
+
super(`Rate limited for ${url}${retryAfter ? `, retry after ${retryAfter}ms` : ""}`);
|
|
99
|
+
this.retryAfter = retryAfter;
|
|
100
|
+
this.name = "RateLimitError";
|
|
101
|
+
Object.setPrototypeOf(this, RateLimitError.prototype);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.RateLimitError = RateLimitError;
|
|
105
|
+
/**
|
|
106
|
+
* Advanced HTTP client with built-in caching, rate limiting, request queuing,
|
|
107
|
+
* automatic retries, cookie management, and response decompression.
|
|
108
|
+
*/
|
|
109
|
+
class HttpClientImproved {
|
|
110
|
+
cookieJar = new tough_cookie_1.CookieJar();
|
|
111
|
+
agent;
|
|
112
|
+
cache;
|
|
113
|
+
queue;
|
|
114
|
+
limiter;
|
|
115
|
+
inflight = new Map();
|
|
116
|
+
retryOptions;
|
|
117
|
+
defaultHeaders = {};
|
|
118
|
+
options;
|
|
119
|
+
requestInterceptors = [];
|
|
120
|
+
responseInterceptors = [];
|
|
121
|
+
requestMetrics = new Map();
|
|
122
|
+
/**
|
|
123
|
+
* Creates a new instance of HttpClientImproved.
|
|
124
|
+
* @param options Optional configuration options for the HTTP client
|
|
125
|
+
*/
|
|
126
|
+
constructor(options) {
|
|
127
|
+
this.options = { followRedirects: true, maxRedirects: 5, ...options };
|
|
128
|
+
this.cache = new CacheManager_1.CacheManager({
|
|
129
|
+
cacheTTL: this.options.cacheTTL,
|
|
130
|
+
cacheMaxSize: this.options.cacheMaxSize,
|
|
131
|
+
});
|
|
132
|
+
this.queue = new QueueManager_1.QueueManager(this.options.maxConcurrent ?? 50);
|
|
133
|
+
this.limiter = new RateLimiter_1.RateLimiter(this.options.rateLimit);
|
|
134
|
+
this.retryOptions = {
|
|
135
|
+
maxRetries: this.options.maxRetries ?? 3,
|
|
136
|
+
baseDelay: this.options.retryOptions?.baseDelay ?? 1000,
|
|
137
|
+
maxDelay: this.options.retryOptions?.maxDelay ?? 30000,
|
|
138
|
+
retryStatusCodes: this.options.retryOptions?.retryStatusCodes ?? [
|
|
139
|
+
408, 429, 500, 502, 503, 504,
|
|
140
|
+
],
|
|
141
|
+
jitter: this.options.retryOptions?.jitter ?? true,
|
|
142
|
+
};
|
|
143
|
+
this.defaultHeaders = {
|
|
144
|
+
Accept: "application/json, text/plain, */*",
|
|
145
|
+
"Accept-Encoding": "gzip, deflate, br",
|
|
146
|
+
"User-Agent": this.options.userAgent ?? "Hyperttp/0.1.0 Node.js",
|
|
147
|
+
};
|
|
148
|
+
this.agent = new undici_1.Agent({
|
|
149
|
+
connections: 100,
|
|
150
|
+
pipelining: 10,
|
|
151
|
+
interceptors: {
|
|
152
|
+
Client: [(0, undici_2.cookie)({ jar: this.cookieJar })],
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Sets default headers that will be applied to all outgoing requests.
|
|
158
|
+
* @param headers An object containing header names and values
|
|
159
|
+
*/
|
|
160
|
+
setDefaultHeaders(headers) {
|
|
161
|
+
Object.assign(this.defaultHeaders, headers);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Returns the cookie jar used for managing HTTP cookies.
|
|
165
|
+
* @returns The CookieJar instance
|
|
166
|
+
*/
|
|
167
|
+
getCookieJar() {
|
|
168
|
+
return this.cookieJar;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Adds a request interceptor to modify requests before they are sent.
|
|
172
|
+
* @param interceptor The interceptor function to add
|
|
173
|
+
*/
|
|
174
|
+
addRequestInterceptor(interceptor) {
|
|
175
|
+
this.requestInterceptors.push(interceptor);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Adds a response interceptor to modify responses after they are received.
|
|
179
|
+
* @param interceptor The interceptor function to add
|
|
180
|
+
*/
|
|
181
|
+
addResponseInterceptor(interceptor) {
|
|
182
|
+
this.responseInterceptors.push(interceptor);
|
|
183
|
+
}
|
|
184
|
+
/** Closes the HTTP agent to properly terminate keep-alive connections. */
|
|
185
|
+
close() {
|
|
186
|
+
this.agent.close();
|
|
187
|
+
}
|
|
188
|
+
log(level, msg, meta) {
|
|
189
|
+
if (this.options.logger)
|
|
190
|
+
this.options.logger(level, msg, meta);
|
|
191
|
+
}
|
|
192
|
+
async decompress(buf, enc, charset = "utf-8") {
|
|
193
|
+
if (!enc)
|
|
194
|
+
return buf.toString(charset);
|
|
195
|
+
try {
|
|
196
|
+
switch (enc.toLowerCase()) {
|
|
197
|
+
case "gzip":
|
|
198
|
+
return (await gunzip(buf)).toString(charset);
|
|
199
|
+
case "deflate":
|
|
200
|
+
return (await inflate(buf)).toString(charset);
|
|
201
|
+
case "br":
|
|
202
|
+
return (await brotliDecompress(buf)).toString(charset);
|
|
203
|
+
default:
|
|
204
|
+
return buf.toString(charset);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
this.log("error", `Decompression failed for encoding ${enc}`, error);
|
|
209
|
+
return buf.toString(charset);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
calcDelay(attempt) {
|
|
213
|
+
const base = Math.min(this.retryOptions.baseDelay * 2 ** attempt, this.retryOptions.maxDelay);
|
|
214
|
+
return this.retryOptions.jitter
|
|
215
|
+
? base * (0.75 + Math.random() * 0.5)
|
|
216
|
+
: base;
|
|
217
|
+
}
|
|
218
|
+
sleep(ms) {
|
|
219
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
220
|
+
}
|
|
221
|
+
async applyRequestInterceptors(config) {
|
|
222
|
+
let result = config;
|
|
223
|
+
for (const interceptor of this.requestInterceptors)
|
|
224
|
+
result = await interceptor(result);
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
async applyResponseInterceptors(response) {
|
|
228
|
+
let result = response;
|
|
229
|
+
for (const interceptor of this.responseInterceptors)
|
|
230
|
+
result = await interceptor(result);
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
resolveRedirect(location, baseUrl) {
|
|
234
|
+
try {
|
|
235
|
+
return new URL(location, baseUrl).toString();
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
return location;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
parseRetryAfterMs(retryAfterHeader) {
|
|
242
|
+
if (!retryAfterHeader)
|
|
243
|
+
return undefined;
|
|
244
|
+
const raw = Array.isArray(retryAfterHeader)
|
|
245
|
+
? retryAfterHeader[0]
|
|
246
|
+
: String(retryAfterHeader);
|
|
247
|
+
const asSeconds = Number(raw);
|
|
248
|
+
if (Number.isFinite(asSeconds))
|
|
249
|
+
return Math.max(0, Math.floor(asSeconds * 1000));
|
|
250
|
+
const asDate = Date.parse(raw);
|
|
251
|
+
if (!Number.isNaN(asDate))
|
|
252
|
+
return Math.max(0, asDate - Date.now());
|
|
253
|
+
return undefined;
|
|
254
|
+
}
|
|
255
|
+
async readBodyWithLimit(body) {
|
|
256
|
+
const buf = Buffer.from(await body.arrayBuffer());
|
|
257
|
+
const limit = this.options.maxResponseBytes;
|
|
258
|
+
if (typeof limit === "number" && limit > 0 && buf.length > limit) {
|
|
259
|
+
throw new HttpClientError(`Response too large (${buf.length} bytes), limit is ${limit}`, 0);
|
|
260
|
+
}
|
|
261
|
+
return buf;
|
|
262
|
+
}
|
|
263
|
+
async sendWithRetry(method, url, headers, body, metrics, redirects = 0) {
|
|
264
|
+
let lastError;
|
|
265
|
+
for (let attempt = 0; attempt <= this.retryOptions.maxRetries; attempt++) {
|
|
266
|
+
try {
|
|
267
|
+
await this.limiter.wait();
|
|
268
|
+
const finalConfig = await this.applyRequestInterceptors({
|
|
269
|
+
url,
|
|
270
|
+
method,
|
|
271
|
+
headers,
|
|
272
|
+
body,
|
|
273
|
+
});
|
|
274
|
+
const controller = new AbortController();
|
|
275
|
+
const timeout = this.options.timeout ?? 15000;
|
|
276
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
277
|
+
try {
|
|
278
|
+
const res = await (0, undici_1.request)(finalConfig.url, {
|
|
279
|
+
method: finalConfig.method,
|
|
280
|
+
headers: finalConfig.headers,
|
|
281
|
+
body: finalConfig.body,
|
|
282
|
+
dispatcher: this.agent,
|
|
283
|
+
signal: controller.signal,
|
|
284
|
+
});
|
|
285
|
+
clearTimeout(timer);
|
|
286
|
+
const buf = await this.readBodyWithLimit(res.body);
|
|
287
|
+
let response = await this.applyResponseInterceptors({
|
|
288
|
+
status: res.statusCode,
|
|
289
|
+
headers: res.headers,
|
|
290
|
+
body: buf,
|
|
291
|
+
url: finalConfig.url,
|
|
292
|
+
});
|
|
293
|
+
// Redirects
|
|
294
|
+
if (this.options.followRedirects &&
|
|
295
|
+
[301, 302, 303, 307, 308].includes(response.status) &&
|
|
296
|
+
redirects < (this.options.maxRedirects ?? 5)) {
|
|
297
|
+
const location = response.headers.location;
|
|
298
|
+
if (location) {
|
|
299
|
+
const nextUrl = this.resolveRedirect(location, finalConfig.url);
|
|
300
|
+
const redirectMethod = response.status === 303 ? "GET" : method;
|
|
301
|
+
const nextHeaders = { ...headers };
|
|
302
|
+
let nextBody = body;
|
|
303
|
+
// If switching to GET, drop body-related headers.
|
|
304
|
+
if (redirectMethod === "GET") {
|
|
305
|
+
nextBody = undefined;
|
|
306
|
+
delete nextHeaders["content-type"];
|
|
307
|
+
delete nextHeaders["Content-Type"];
|
|
308
|
+
delete nextHeaders["content-length"];
|
|
309
|
+
delete nextHeaders["Content-Length"];
|
|
310
|
+
}
|
|
311
|
+
this.log("debug", `Redirecting to ${nextUrl}`, {
|
|
312
|
+
originalUrl: finalConfig.url,
|
|
313
|
+
status: response.status,
|
|
314
|
+
});
|
|
315
|
+
return this.sendWithRetry(redirectMethod, nextUrl, nextHeaders, nextBody, metrics, redirects + 1);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
// Retry by status
|
|
319
|
+
if (this.retryOptions.retryStatusCodes.includes(response.status)) {
|
|
320
|
+
metrics && (metrics.retries += 1);
|
|
321
|
+
if (response.status === 429) {
|
|
322
|
+
const ra = this.parseRetryAfterMs(response.headers["retry-after"]);
|
|
323
|
+
if (ra !== undefined) {
|
|
324
|
+
this.log("warn", `429 Rate limited, waiting Retry-After ${ra}ms`, { url: finalConfig.url });
|
|
325
|
+
if (attempt < this.retryOptions.maxRetries) {
|
|
326
|
+
await this.sleep(ra);
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
throw new RateLimitError(finalConfig.url, ra);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
this.log("warn", `Retrying ${method} ${finalConfig.url} due to status ${response.status}`, {
|
|
333
|
+
attempt: attempt + 1,
|
|
334
|
+
maxRetries: this.retryOptions.maxRetries,
|
|
335
|
+
});
|
|
336
|
+
if (attempt < this.retryOptions.maxRetries) {
|
|
337
|
+
await this.sleep(this.calcDelay(attempt));
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return response;
|
|
342
|
+
}
|
|
343
|
+
catch (timeoutErr) {
|
|
344
|
+
clearTimeout(timer);
|
|
345
|
+
if (timeoutErr?.name === "AbortError")
|
|
346
|
+
throw new TimeoutError(url, timeout);
|
|
347
|
+
throw timeoutErr;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
catch (err) {
|
|
351
|
+
lastError = err;
|
|
352
|
+
this.log("error", `Request error ${method} ${url}: ${err?.message ?? String(err)}`, {
|
|
353
|
+
attempt: attempt + 1,
|
|
354
|
+
error: err,
|
|
355
|
+
});
|
|
356
|
+
metrics && (metrics.retries += 1);
|
|
357
|
+
if (attempt < this.retryOptions.maxRetries) {
|
|
358
|
+
await this.sleep(this.calcDelay(attempt));
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (lastError instanceof HttpClientError)
|
|
364
|
+
throw lastError;
|
|
365
|
+
throw new HttpClientError(`Request failed after ${this.retryOptions.maxRetries + 1} attempts`, undefined, lastError instanceof Error ? lastError : undefined, url, method);
|
|
366
|
+
}
|
|
367
|
+
parseContentType(contentType) {
|
|
368
|
+
if (!contentType)
|
|
369
|
+
return { type: "text/plain", charset: "utf-8" };
|
|
370
|
+
const parts = contentType.split(";");
|
|
371
|
+
const type = parts[0].trim();
|
|
372
|
+
const rawCharset = parts
|
|
373
|
+
.map((p) => p.trim())
|
|
374
|
+
.find((p) => p.toLowerCase().startsWith("charset="))
|
|
375
|
+
?.split("=")[1]
|
|
376
|
+
?.trim() || "utf-8";
|
|
377
|
+
const normalized = rawCharset.toLowerCase();
|
|
378
|
+
const allowed = [
|
|
379
|
+
"utf8",
|
|
380
|
+
"utf-8",
|
|
381
|
+
"latin1",
|
|
382
|
+
"ucs2",
|
|
383
|
+
"ucs-2",
|
|
384
|
+
"utf16le",
|
|
385
|
+
"utf-16le",
|
|
386
|
+
"ascii",
|
|
387
|
+
"base64",
|
|
388
|
+
"hex",
|
|
389
|
+
];
|
|
390
|
+
const charset = (allowed.includes(normalized)
|
|
391
|
+
? normalized
|
|
392
|
+
: "utf-8");
|
|
393
|
+
return { type, charset };
|
|
394
|
+
}
|
|
395
|
+
async parseResponse(res, responseType) {
|
|
396
|
+
try {
|
|
397
|
+
const { type, charset } = this.parseContentType(res.headers["content-type"]);
|
|
398
|
+
const text = await this.decompress(res.body, res.headers["content-encoding"], charset);
|
|
399
|
+
const finalType = responseType ?? "json";
|
|
400
|
+
switch (finalType) {
|
|
401
|
+
case "json":
|
|
402
|
+
if (type.includes("json"))
|
|
403
|
+
return JSON.parse(text);
|
|
404
|
+
try {
|
|
405
|
+
return JSON.parse(text);
|
|
406
|
+
}
|
|
407
|
+
catch {
|
|
408
|
+
return text;
|
|
409
|
+
}
|
|
410
|
+
case "xml":
|
|
411
|
+
return new fast_xml_parser_1.XMLParser({ ignoreAttributes: false }).parse(text);
|
|
412
|
+
case "text":
|
|
413
|
+
return text;
|
|
414
|
+
case "buffer":
|
|
415
|
+
return res.body;
|
|
416
|
+
default:
|
|
417
|
+
return text;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
this.log("error", "Failed to parse response", {
|
|
422
|
+
error,
|
|
423
|
+
status: res.status,
|
|
424
|
+
});
|
|
425
|
+
throw new HttpClientError(`Response parsing failed: ${error instanceof Error ? error.message : String(error)}`, res.status);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
async requestInternal(method, req, useCache = true, responseType) {
|
|
429
|
+
const url = req.getURL();
|
|
430
|
+
const rawBody = req.getBodyData();
|
|
431
|
+
const headers = {
|
|
432
|
+
...this.defaultHeaders,
|
|
433
|
+
...req.getHeaders(),
|
|
434
|
+
};
|
|
435
|
+
const isBodyAllowed = ["POST", "PUT", "PATCH", "DELETE"].includes(method);
|
|
436
|
+
// Prepare request body + auto content-type for JSON
|
|
437
|
+
let body;
|
|
438
|
+
const contentType = headers["content-type"] || headers["Content-Type"] || "";
|
|
439
|
+
if (isBodyAllowed && rawBody !== undefined && rawBody !== null) {
|
|
440
|
+
if (Buffer.isBuffer(rawBody)) {
|
|
441
|
+
body = rawBody;
|
|
442
|
+
}
|
|
443
|
+
else if (typeof rawBody === "string") {
|
|
444
|
+
body = rawBody;
|
|
445
|
+
}
|
|
446
|
+
else if (contentType.includes("application/x-www-form-urlencoded")) {
|
|
447
|
+
body = querystring.stringify(rawBody);
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
// default JSON
|
|
451
|
+
body = JSON.stringify(rawBody);
|
|
452
|
+
if (!contentType)
|
|
453
|
+
headers["Content-Type"] = "application/json; charset=utf-8";
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
const key = `${method}:${url}:${body ?? ""}`;
|
|
457
|
+
if (method === "GET" && useCache) {
|
|
458
|
+
const cached = this.cache.get(key);
|
|
459
|
+
if (cached) {
|
|
460
|
+
this.log("debug", `Cache hit for ${url}`);
|
|
461
|
+
return cached;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
if (this.inflight.has(key)) {
|
|
465
|
+
this.log("debug", `Deduplicating request for ${url}`);
|
|
466
|
+
return this.inflight.get(key);
|
|
467
|
+
}
|
|
468
|
+
const promise = (async () => {
|
|
469
|
+
const metrics = {
|
|
470
|
+
startTime: Date.now(),
|
|
471
|
+
endTime: 0,
|
|
472
|
+
duration: 0,
|
|
473
|
+
bytesReceived: 0,
|
|
474
|
+
bytesSent: 0,
|
|
475
|
+
retries: 0,
|
|
476
|
+
cached: false,
|
|
477
|
+
url,
|
|
478
|
+
method,
|
|
479
|
+
};
|
|
480
|
+
try {
|
|
481
|
+
this.log("debug", `Starting request: ${method} ${url}`);
|
|
482
|
+
const result = await this.queue.enqueue(async () => {
|
|
483
|
+
const res = await this.sendWithRetry(method, url, headers, body, metrics);
|
|
484
|
+
metrics.statusCode = res.status;
|
|
485
|
+
metrics.bytesReceived = res.body.length;
|
|
486
|
+
metrics.bytesSent =
|
|
487
|
+
body instanceof Buffer
|
|
488
|
+
? body.length
|
|
489
|
+
: Buffer.byteLength(body || "");
|
|
490
|
+
const parsed = await this.parseResponse(res, responseType);
|
|
491
|
+
if (method === "GET" && useCache) {
|
|
492
|
+
this.cache.set(key, parsed);
|
|
493
|
+
metrics.cached = true;
|
|
494
|
+
}
|
|
495
|
+
return parsed;
|
|
496
|
+
});
|
|
497
|
+
metrics.endTime = Date.now();
|
|
498
|
+
metrics.duration = metrics.endTime - metrics.startTime;
|
|
499
|
+
this.requestMetrics.set(key, metrics);
|
|
500
|
+
this.log("info", `${method} ${url} completed in ${metrics.duration}ms`, metrics);
|
|
501
|
+
return result;
|
|
502
|
+
}
|
|
503
|
+
catch (error) {
|
|
504
|
+
metrics.endTime = Date.now();
|
|
505
|
+
metrics.duration = metrics.endTime - metrics.startTime;
|
|
506
|
+
this.requestMetrics.set(key, metrics);
|
|
507
|
+
throw error;
|
|
508
|
+
}
|
|
509
|
+
finally {
|
|
510
|
+
// ВАЖНО: только delete, без повторного set.
|
|
511
|
+
this.inflight.delete(key);
|
|
512
|
+
}
|
|
513
|
+
})();
|
|
514
|
+
this.inflight.set(key, promise);
|
|
515
|
+
return promise;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Performs an HTTP GET request.
|
|
519
|
+
* @param req The request object containing URL and headers
|
|
520
|
+
* @param responseType Optional response parsing type
|
|
521
|
+
* @returns A promise that resolves to the parsed response
|
|
522
|
+
* @template T The expected response type
|
|
523
|
+
*/
|
|
524
|
+
get(req, responseType) {
|
|
525
|
+
return this.requestInternal("GET", req, true, responseType);
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Performs an HTTP POST request.
|
|
529
|
+
* @param req The request object containing URL, body, and headers
|
|
530
|
+
* @param responseType Optional response parsing type
|
|
531
|
+
* @returns A promise that resolves to the parsed response
|
|
532
|
+
* @template T The expected response type
|
|
533
|
+
*/
|
|
534
|
+
post(req, responseType) {
|
|
535
|
+
return this.requestInternal("POST", req, false, responseType);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Performs an HTTP PUT request.
|
|
539
|
+
* @param req The request object containing URL, body, and headers
|
|
540
|
+
* @param responseType Optional response parsing type
|
|
541
|
+
* @returns A promise that resolves to the parsed response
|
|
542
|
+
* @template T The expected response type
|
|
543
|
+
*/
|
|
544
|
+
put(req, responseType) {
|
|
545
|
+
return this.requestInternal("PUT", req, false, responseType);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Performs an HTTP DELETE request.
|
|
549
|
+
* @param req The request object containing URL and headers
|
|
550
|
+
* @param responseType Optional response parsing type
|
|
551
|
+
* @returns A promise that resolves to the parsed response
|
|
552
|
+
* @template T The expected response type
|
|
553
|
+
*/
|
|
554
|
+
delete(req, responseType) {
|
|
555
|
+
return this.requestInternal("DELETE", req, false, responseType);
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Performs an HTTP PATCH request.
|
|
559
|
+
* @param req The request object containing URL, body, and headers
|
|
560
|
+
* @param responseType Optional response parsing type
|
|
561
|
+
* @returns A promise that resolves to the parsed response
|
|
562
|
+
* @template T The expected response type
|
|
563
|
+
*/
|
|
564
|
+
patch(req, responseType) {
|
|
565
|
+
return this.requestInternal("PATCH", req, false, responseType);
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Performs an HTTP HEAD request.
|
|
569
|
+
* @param req The request object containing URL and headers
|
|
570
|
+
* @returns A promise that resolves when the request completes
|
|
571
|
+
*/
|
|
572
|
+
head(req) {
|
|
573
|
+
return this.requestInternal("HEAD", req, false).then(() => undefined);
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Clears the request cache.
|
|
577
|
+
*/
|
|
578
|
+
clearCache() {
|
|
579
|
+
this.cache.clear();
|
|
580
|
+
this.log("info", "Cache cleared");
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Retrieves performance metrics for a specific request.
|
|
584
|
+
* @param url The request URL
|
|
585
|
+
* @param method The HTTP method
|
|
586
|
+
* @returns The request metrics if available, undefined otherwise
|
|
587
|
+
*/
|
|
588
|
+
getMetrics(url, method) {
|
|
589
|
+
const keyPrefix = `${method}:${url}`;
|
|
590
|
+
for (const [k, v] of this.requestMetrics.entries()) {
|
|
591
|
+
if (k.startsWith(keyPrefix))
|
|
592
|
+
return v;
|
|
593
|
+
}
|
|
594
|
+
return undefined;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Returns current statistics about the HTTP client's state.
|
|
598
|
+
* @returns An object containing cache size, request counts, and rate limit information
|
|
599
|
+
*/
|
|
600
|
+
getStats() {
|
|
601
|
+
return {
|
|
602
|
+
cacheSize: this.cache.size,
|
|
603
|
+
inflightRequests: this.inflight.size,
|
|
604
|
+
queuedRequests: this.queue.queuedCount,
|
|
605
|
+
activeRequests: this.queue.activeCount,
|
|
606
|
+
currentRateLimit: this.limiter.currentCount,
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
exports.default = HttpClientImproved;
|
|
611
|
+
//# sourceMappingURL=HttpClientImproved.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpClientImproved.js","sourceRoot":"","sources":["../../../src/Hyperttp/Core/HttpClientImproved.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,mCAAwC;AACxC,qDAAkD;AAClD,2CAA6B;AAC7B,+BAAiC;AACjC,qDAA4C;AAC5C,yDAA2C;AAE3C,iDAA8C;AAC9C,iDAA8C;AAC9C,+CAAoE;AAGpE,MAAM,MAAM,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,OAAO,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