@hyperttp/core 1.0.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/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/Core/HyperCore.d.ts +59 -0
- package/dist/Core/HyperCore.d.ts.map +1 -0
- package/dist/Core/HyperCore.js +162 -0
- package/dist/Core/HyperCore.js.map +1 -0
- package/dist/Core/RequestExecutor.d.ts +56 -0
- package/dist/Core/RequestExecutor.d.ts.map +1 -0
- package/dist/Core/RequestExecutor.js +194 -0
- package/dist/Core/RequestExecutor.js.map +1 -0
- package/dist/Core/index.d.ts +4 -0
- package/dist/Core/index.d.ts.map +1 -0
- package/dist/Core/index.js +3 -0
- package/dist/Core/index.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/types/errors.d.ts +15 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +28 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/http.d.ts +5 -0
- package/dist/types/http.d.ts.map +1 -0
- package/dist/types/http.js +2 -0
- package/dist/types/http.js.map +1 -0
- package/dist/types/metrics.d.ts +63 -0
- package/dist/types/metrics.d.ts.map +1 -0
- package/dist/types/metrics.js +2 -0
- package/dist/types/metrics.js.map +1 -0
- package/dist/types/network.d.ts +60 -0
- package/dist/types/network.d.ts.map +1 -0
- package/dist/types/network.js +2 -0
- package/dist/types/network.js.map +1 -0
- package/dist/types/options.d.ts +41 -0
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/options.js +2 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/request.d.ts +189 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +2 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/retry.d.ts +28 -0
- package/dist/types/retry.d.ts.map +1 -0
- package/dist/types/retry.js +2 -0
- package/dist/types/retry.js.map +1 -0
- package/dist/types/stream.d.ts +39 -0
- package/dist/types/stream.d.ts.map +1 -0
- package/dist/types/stream.js +2 -0
- package/dist/types/stream.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { request } from "undici";
|
|
2
|
+
import { HttpClientError, TimeoutError } from "../types/errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* @en Low-level request executor responsible for handling the actual HTTP lifecycle.
|
|
5
|
+
* @ru Низкоуровневый исполнитель запросов, отвечающий за полный цикл HTTP-жизни.
|
|
6
|
+
*/
|
|
7
|
+
export class RequestExecutor {
|
|
8
|
+
agent;
|
|
9
|
+
options;
|
|
10
|
+
redirectStatusCodes = new Set([301, 302, 303, 307, 308]);
|
|
11
|
+
constructor(agent, options) {
|
|
12
|
+
this.agent = agent;
|
|
13
|
+
this.options = options;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @en Executes a raw HTTP request.
|
|
17
|
+
* @ru Выполняет "сырой" HTTP-запрос.
|
|
18
|
+
*/
|
|
19
|
+
async execute(method, url, headers, body, signal, metrics, interceptors) {
|
|
20
|
+
return this.executeCore(method, url, headers, body, metrics, signal, async (res) => res.body, interceptors);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @en Calculates the delay for the next retry attempt using exponential backoff.
|
|
24
|
+
* @ru Вычисляет задержку для следующей попытки повтора.
|
|
25
|
+
*/
|
|
26
|
+
calcDelay(attempt) {
|
|
27
|
+
const { baseDelay = 1000, maxDelay = 10000, jitter = true, } = this.options.retryOptions;
|
|
28
|
+
const base = Math.min(baseDelay * Math.pow(2, attempt), maxDelay);
|
|
29
|
+
return jitter ? base * (0.75 + Math.random() * 0.5) : base;
|
|
30
|
+
}
|
|
31
|
+
sleep(ms) {
|
|
32
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @en Ensures that the response body stream is properly closed to prevent memory leaks.
|
|
36
|
+
* @ru Гарантирует, что поток тела ответа корректно закрыт.
|
|
37
|
+
*/
|
|
38
|
+
async drainBody(body) {
|
|
39
|
+
if (!body)
|
|
40
|
+
return;
|
|
41
|
+
try {
|
|
42
|
+
if (typeof body.dump === "function") {
|
|
43
|
+
await body.dump();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (typeof body.resume === "function") {
|
|
47
|
+
body.resume();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (typeof body.destroy === "function") {
|
|
51
|
+
body.destroy();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
/* ignore */
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @en Checks if the status code should trigger a retry attempt.
|
|
60
|
+
* @ru Проверяет, должен ли данный статус-код вызывать повтор запроса.
|
|
61
|
+
*/
|
|
62
|
+
shouldRetry(status) {
|
|
63
|
+
const codes = this.options.retryOptions.retryStatusCodes;
|
|
64
|
+
if (codes && codes.length > 0) {
|
|
65
|
+
return codes.includes(status);
|
|
66
|
+
}
|
|
67
|
+
return status === 429 || status >= 500;
|
|
68
|
+
}
|
|
69
|
+
async executeCore(method, url, headers, body, metrics, signal, parser, interceptors) {
|
|
70
|
+
let currentUrl = url;
|
|
71
|
+
let currentMethod = method;
|
|
72
|
+
let currentHeaders = headers;
|
|
73
|
+
let currentBody = body;
|
|
74
|
+
let redirects = 0;
|
|
75
|
+
let attempt = 0;
|
|
76
|
+
const manager = interceptors ?? {
|
|
77
|
+
applyRequest: async (c) => c,
|
|
78
|
+
applyResponse: async (r) => r,
|
|
79
|
+
};
|
|
80
|
+
const timeoutController = new AbortController();
|
|
81
|
+
const timer = setTimeout(() => timeoutController.abort(), this.options.timeout);
|
|
82
|
+
const abortHandler = () => timeoutController.abort();
|
|
83
|
+
if (signal) {
|
|
84
|
+
if (signal.aborted) {
|
|
85
|
+
clearTimeout(timer);
|
|
86
|
+
throw new HttpClientError("Request aborted by user", "ABORTED", 0, undefined, url, method);
|
|
87
|
+
}
|
|
88
|
+
signal.addEventListener("abort", abortHandler, { once: true });
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
while (true) {
|
|
92
|
+
try {
|
|
93
|
+
const config = await manager.applyRequest({
|
|
94
|
+
url: currentUrl,
|
|
95
|
+
method: currentMethod,
|
|
96
|
+
headers: currentHeaders,
|
|
97
|
+
body: currentBody,
|
|
98
|
+
});
|
|
99
|
+
const res = await request(config.url, {
|
|
100
|
+
method: config.method,
|
|
101
|
+
headers: config.headers,
|
|
102
|
+
body: config.body,
|
|
103
|
+
dispatcher: this.agent,
|
|
104
|
+
signal: timeoutController.signal,
|
|
105
|
+
});
|
|
106
|
+
const status = res.statusCode;
|
|
107
|
+
const resHeaders = res.headers;
|
|
108
|
+
if (this.options.followRedirects &&
|
|
109
|
+
this.redirectStatusCodes.has(status)) {
|
|
110
|
+
if (redirects >= this.options.maxRedirects) {
|
|
111
|
+
await this.drainBody(res.body);
|
|
112
|
+
throw new HttpClientError("Too many redirects", "TOO_MANY_REDIRECTS", status);
|
|
113
|
+
}
|
|
114
|
+
const location = resHeaders.location;
|
|
115
|
+
if (location) {
|
|
116
|
+
await this.drainBody(res.body);
|
|
117
|
+
const nextUrl = new URL(location, config.url).toString();
|
|
118
|
+
const nextMethod = status === 303 ? "GET" : currentMethod;
|
|
119
|
+
currentUrl = nextUrl;
|
|
120
|
+
currentMethod = nextMethod;
|
|
121
|
+
currentBody = nextMethod === "GET" ? undefined : currentBody;
|
|
122
|
+
if (nextMethod === "GET") {
|
|
123
|
+
if (currentHeaders["content-type"] ||
|
|
124
|
+
currentHeaders["Content-Type"] ||
|
|
125
|
+
currentHeaders["content-length"] ||
|
|
126
|
+
currentHeaders["Content-Length"]) {
|
|
127
|
+
const nextHeaders = { ...currentHeaders };
|
|
128
|
+
delete nextHeaders["content-type"];
|
|
129
|
+
delete nextHeaders["Content-Type"];
|
|
130
|
+
delete nextHeaders["content-length"];
|
|
131
|
+
delete nextHeaders["Content-Length"];
|
|
132
|
+
currentHeaders = nextHeaders;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
redirects++;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (this.shouldRetry(status)) {
|
|
140
|
+
if (attempt < this.options.maxRetries) {
|
|
141
|
+
if (metrics)
|
|
142
|
+
metrics.retries += 1;
|
|
143
|
+
await this.drainBody(res.body);
|
|
144
|
+
const delay = this.calcDelay(attempt);
|
|
145
|
+
if (delay > 0)
|
|
146
|
+
await this.sleep(delay);
|
|
147
|
+
attempt++;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
throw new HttpClientError(`HTTP ${status}`, "HTTP_ERROR", status, undefined, config.url, currentMethod);
|
|
151
|
+
}
|
|
152
|
+
const transformed = await manager.applyResponse({
|
|
153
|
+
status,
|
|
154
|
+
headers: resHeaders,
|
|
155
|
+
body: res.body,
|
|
156
|
+
url: config.url,
|
|
157
|
+
});
|
|
158
|
+
const parsed = await parser(transformed);
|
|
159
|
+
return {
|
|
160
|
+
status: transformed.status,
|
|
161
|
+
headers: transformed.headers,
|
|
162
|
+
body: parsed,
|
|
163
|
+
url: transformed.url,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
if (err?.name === "AbortError") {
|
|
168
|
+
if (signal?.aborted) {
|
|
169
|
+
throw new HttpClientError("Request aborted by user", "ABORTED", 0, err, url, method);
|
|
170
|
+
}
|
|
171
|
+
throw new TimeoutError(url, this.options.timeout);
|
|
172
|
+
}
|
|
173
|
+
if (attempt < this.options.maxRetries &&
|
|
174
|
+
(err?.code === "ECONNREFUSED" ||
|
|
175
|
+
err?.code === "ETIMEDOUT" ||
|
|
176
|
+
err?.code === "UND_ERR_SOCKET")) {
|
|
177
|
+
if (metrics)
|
|
178
|
+
metrics.retries += 1;
|
|
179
|
+
await this.sleep(this.calcDelay(attempt));
|
|
180
|
+
attempt++;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
throw err;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
finally {
|
|
188
|
+
clearTimeout(timer);
|
|
189
|
+
if (signal)
|
|
190
|
+
signal.removeEventListener("abort", abortHandler);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=RequestExecutor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestExecutor.js","sourceRoot":"","sources":["../../src/Core/RequestExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAcnE;;;GAGG;AACH,MAAM,OAAO,eAAe;IAIhB;IACA;IAJO,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAE1E,YACU,KAAY,EACZ,OAQP;QATO,UAAK,GAAL,KAAK,CAAO;QACZ,YAAO,GAAP,OAAO,CAQd;IACA,CAAC;IAEJ;;;OAGG;IACH,KAAK,CAAC,OAAO,CACX,MAAc,EACd,GAAW,EACX,OAA+B,EAC/B,IAAiC,EACjC,MAAoB,EACpB,OAAwB,EACxB,YAAuC;QAEvC,OAAO,IAAI,CAAC,WAAW,CACrB,MAAM,EACN,GAAG,EACH,OAAO,EACP,IAAI,EACJ,OAAO,EACP,MAAM,EACN,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EACvB,YAAY,CACb,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,SAAS,CAAC,OAAe;QAC/B,MAAM,EACJ,SAAS,GAAG,IAAI,EAChB,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,IAAI,GACd,G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C,OAAO,EAAE,CAAC;wBACV,SAAS;oBACX,CAAC;oBAED,MAAM,GAAG,CAAC;gBACZ,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,IAAI,MAAM;gBAAE,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { HyperCore } from "./Core/HyperCore.js";
|
|
2
|
+
export { RequestExecutor } from "./Core/RequestExecutor.js";
|
|
3
|
+
export type { InternalRequest, HttpResponse, HyperStats, } from "./Core/HyperCore.js";
|
|
4
|
+
export type * from "./types/http.js";
|
|
5
|
+
export type * from "./types/options.js";
|
|
6
|
+
export type * from "./types/request.js";
|
|
7
|
+
export type * from "./types/stream.js";
|
|
8
|
+
export type * from "./types/metrics.js";
|
|
9
|
+
export type * from "./types/errors.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,YAAY,EACV,eAAe,EACf,YAAY,EACZ,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class HttpClientError extends Error {
|
|
2
|
+
code: string;
|
|
3
|
+
statusCode?: number | undefined;
|
|
4
|
+
originalError?: Error | undefined;
|
|
5
|
+
url?: string | undefined;
|
|
6
|
+
method?: string | undefined;
|
|
7
|
+
constructor(message: string, code?: string, statusCode?: number | undefined, originalError?: Error | undefined, url?: string | undefined, method?: string | undefined);
|
|
8
|
+
}
|
|
9
|
+
export declare class TimeoutError extends HttpClientError {
|
|
10
|
+
constructor(url: string, timeout: number);
|
|
11
|
+
}
|
|
12
|
+
export declare class RateLimitError extends HttpClientError {
|
|
13
|
+
constructor(url: string, retryAfter?: number);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAgB,SAAQ,KAAK;IAG/B,IAAI,EAAE,MAAM;IACZ,UAAU,CAAC,EAAE,MAAM;IACnB,aAAa,CAAC,EAAE,KAAK;IACrB,GAAG,CAAC,EAAE,MAAM;IACZ,MAAM,CAAC,EAAE,MAAM;gBALtB,OAAO,EAAE,MAAM,EACR,IAAI,GAAE,MAAqB,EAC3B,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,aAAa,CAAC,EAAE,KAAK,YAAA,EACrB,GAAG,CAAC,EAAE,MAAM,YAAA,EACZ,MAAM,CAAC,EAAE,MAAM,YAAA;CAKzB;AAED,qBAAa,YAAa,SAAQ,eAAe;gBACnC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIzC;AAED,qBAAa,cAAe,SAAQ,eAAe;gBACrC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAS7C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class HttpClientError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
statusCode;
|
|
4
|
+
originalError;
|
|
5
|
+
url;
|
|
6
|
+
method;
|
|
7
|
+
constructor(message, code = "HTTP_ERROR", statusCode, originalError, url, method) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.statusCode = statusCode;
|
|
11
|
+
this.originalError = originalError;
|
|
12
|
+
this.url = url;
|
|
13
|
+
this.method = method;
|
|
14
|
+
this.name = "HttpClientError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class TimeoutError extends HttpClientError {
|
|
18
|
+
constructor(url, timeout) {
|
|
19
|
+
super(`Timeout after ${timeout}ms`, "TIMEOUT", 408, undefined, url);
|
|
20
|
+
this.name = "TimeoutError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class RateLimitError extends HttpClientError {
|
|
24
|
+
constructor(url, retryAfter) {
|
|
25
|
+
super(`Rate limited${retryAfter ? ` retry in ${retryAfter}ms` : ""}`, "RATE_LIMIT", 429, undefined, url);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAG/B;IACA;IACA;IACA;IACA;IANT,YACE,OAAe,EACR,OAAe,YAAY,EAC3B,UAAmB,EACnB,aAAqB,EACrB,GAAY,EACZ,MAAe;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QANR,SAAI,GAAJ,IAAI,CAAuB;QAC3B,eAAU,GAAV,UAAU,CAAS;QACnB,kBAAa,GAAb,aAAa,CAAQ;QACrB,QAAG,GAAH,GAAG,CAAS;QACZ,WAAM,GAAN,MAAM,CAAS;QAGtB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,eAAe;IAC/C,YAAY,GAAW,EAAE,OAAe;QACtC,KAAK,CAAC,iBAAiB,OAAO,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,eAAe;IACjD,YAAY,GAAW,EAAE,UAAmB;QAC1C,KAAK,CACH,eAAe,UAAU,CAAC,CAAC,CAAC,aAAa,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAC9D,YAAY,EACZ,GAAG,EACH,SAAS,EACT,GAAG,CACJ,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type LogLevel = "debug" | "info" | "warn" | "error";
|
|
2
|
+
export type Method = "GET" | "POST" | "PUT" | "PATCH" | "OPTIONS" | "DELETE" | "HEAD";
|
|
3
|
+
export type ResponseType = "auto" | "json" | "text" | "xml" | "html" | "buffer" | "stream";
|
|
4
|
+
export type SourceType = "json" | "xml" | "html" | "text" | "buffer";
|
|
5
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/types/http.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,MAAM,MAAM,GACd,KAAK,GACL,MAAM,GACN,KAAK,GACL,OAAO,GACP,SAAS,GACT,QAAQ,GACR,MAAM,CAAC;AAEX,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/types/http.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface RequestMetrics {
|
|
2
|
+
/**
|
|
3
|
+
* @ru Время начала запроса (timestamp)
|
|
4
|
+
* @en Request start time (timestamp)
|
|
5
|
+
*/
|
|
6
|
+
startTime: number;
|
|
7
|
+
/**
|
|
8
|
+
* @ru Время окончания запроса (timestamp)
|
|
9
|
+
* @en Request end time (timestamp)
|
|
10
|
+
*/
|
|
11
|
+
endTime: number;
|
|
12
|
+
/**
|
|
13
|
+
* @ru Длительность запроса (мс)
|
|
14
|
+
* @en Request duration (ms)
|
|
15
|
+
*/
|
|
16
|
+
duration: number;
|
|
17
|
+
/**
|
|
18
|
+
* @ru HTTP статус код ответа
|
|
19
|
+
* @en HTTP status code of response
|
|
20
|
+
*/
|
|
21
|
+
statusCode?: number;
|
|
22
|
+
/**
|
|
23
|
+
* @ru Количество полученных байт
|
|
24
|
+
* @en Bytes received
|
|
25
|
+
*/
|
|
26
|
+
bytesReceived: number;
|
|
27
|
+
/**
|
|
28
|
+
* @ru Количество отправленных байт
|
|
29
|
+
* @en Bytes sent
|
|
30
|
+
*/
|
|
31
|
+
bytesSent: number;
|
|
32
|
+
/**
|
|
33
|
+
* @ru Количество повторных попыток
|
|
34
|
+
* @en Number of retries performed
|
|
35
|
+
*/
|
|
36
|
+
retries: number;
|
|
37
|
+
/**
|
|
38
|
+
* @ru Ответ из кэша
|
|
39
|
+
* @en Response served from cache
|
|
40
|
+
*/
|
|
41
|
+
cached: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @ru URL запроса
|
|
44
|
+
* @en Request URL
|
|
45
|
+
*/
|
|
46
|
+
url: string;
|
|
47
|
+
/**
|
|
48
|
+
* @ru HTTP метод запроса
|
|
49
|
+
* @en HTTP method
|
|
50
|
+
*/
|
|
51
|
+
method: string;
|
|
52
|
+
/**
|
|
53
|
+
* @ru Хэш тела запроса (для кэширования)
|
|
54
|
+
* @en Request body hash (for caching)
|
|
55
|
+
*/
|
|
56
|
+
bodyHash?: string;
|
|
57
|
+
stages?: {
|
|
58
|
+
serializationMs?: number;
|
|
59
|
+
networkMs?: number;
|
|
60
|
+
parsingMs?: number;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/types/metrics.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,MAAM,CAAC,EAAE;QACP,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/types/metrics.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface NetworkOptions {
|
|
2
|
+
/**
|
|
3
|
+
* @ru Таймаут запроса (мс)
|
|
4
|
+
* @en Request timeout in milliseconds
|
|
5
|
+
*/
|
|
6
|
+
timeout?: number;
|
|
7
|
+
/**
|
|
8
|
+
* @ru Максимум одновременных запросов. 0 = без лимита
|
|
9
|
+
* @en Maximum concurrent requests. 0 = unlimited
|
|
10
|
+
*/
|
|
11
|
+
maxConcurrent?: number;
|
|
12
|
+
/**
|
|
13
|
+
* @ru Количество pipelined запросов на соединение
|
|
14
|
+
* @en Number of pipelined requests per connection
|
|
15
|
+
*/
|
|
16
|
+
pipelining?: number;
|
|
17
|
+
/**
|
|
18
|
+
* @ru Таймаут keep-alive соединения (мс)
|
|
19
|
+
* @en Keep-alive connection timeout in milliseconds
|
|
20
|
+
*/
|
|
21
|
+
keepAliveTimeout?: number;
|
|
22
|
+
/**
|
|
23
|
+
* @ru Отклонять недоверенные SSL сертификаты
|
|
24
|
+
* @en Reject unauthorized SSL certificates
|
|
25
|
+
*/
|
|
26
|
+
rejectUnauthorized?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @ru Следовать за редиректами
|
|
29
|
+
* @en Follow HTTP redirects
|
|
30
|
+
*/
|
|
31
|
+
followRedirects?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @ru Максимум редиректов
|
|
34
|
+
* @en Maximum number of redirects to follow
|
|
35
|
+
*/
|
|
36
|
+
maxRedirects?: number;
|
|
37
|
+
/**
|
|
38
|
+
* @ru Максимальный размер ответа (байты)
|
|
39
|
+
* @en Maximum response body size in bytes
|
|
40
|
+
*/
|
|
41
|
+
maxResponseBytes?: number;
|
|
42
|
+
/**
|
|
43
|
+
* @ru Переключение режима HTTP/2 и HTTP/1.1
|
|
44
|
+
* @en Switching between HTTP/2 and HTTP/1.1 modes
|
|
45
|
+
*/
|
|
46
|
+
allowHttp2?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* @ru User-Agent заголовок
|
|
49
|
+
* @en User-Agent header string
|
|
50
|
+
*/
|
|
51
|
+
userAgent?: string;
|
|
52
|
+
/**
|
|
53
|
+
* @ru Функция валидации HTTP статуса
|
|
54
|
+
* @en Function to validate HTTP status code
|
|
55
|
+
* @param status - HTTP status code
|
|
56
|
+
* @returns `true` if status is valid
|
|
57
|
+
*/
|
|
58
|
+
validateStatus?: (status: number) => boolean;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/types/network.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/types/network.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { LogLevel } from "./http.js";
|
|
2
|
+
import type { NetworkOptions } from "./network.js";
|
|
3
|
+
export interface HyperttpPluginsExtension {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @ru Базовые настройки HTTP-клиента, входящие в состав основного ядра.
|
|
7
|
+
* @en Core HTTP client configuration options always available in the engine.
|
|
8
|
+
*/
|
|
9
|
+
export interface BaseHttpClientOptions {
|
|
10
|
+
/**
|
|
11
|
+
* @ru Базовые настройки сети (таймауты, заголовки, keep-alive)
|
|
12
|
+
* @en Base network configuration (timeouts, headers, keep-alive)
|
|
13
|
+
*/
|
|
14
|
+
network?: Partial<NetworkOptions>;
|
|
15
|
+
/**
|
|
16
|
+
* @ru Кастомная функция логирования работы клиента
|
|
17
|
+
* @en Custom logging function for client operations
|
|
18
|
+
* @param level - @ru Уровень логирования @en Log level
|
|
19
|
+
* @param message - @ru Текст лога @en Log message
|
|
20
|
+
* @param meta - @ru Дополнительные метаданные @en Additional metadata
|
|
21
|
+
*/
|
|
22
|
+
logger?: (level: LogLevel, message: string, meta?: unknown) => void;
|
|
23
|
+
/**
|
|
24
|
+
* @ru Режим подробного (verbose) логирования в консоль
|
|
25
|
+
* @en Enable verbose logging output to the console
|
|
26
|
+
*/
|
|
27
|
+
verbose?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @ru Список путей к папкам для автоматического сканирования и ленивой загрузки локальных плагинов
|
|
30
|
+
* @en List of directory paths for automatic scanning and lazy loading of local plugins
|
|
31
|
+
*/
|
|
32
|
+
pluginDirs?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* @ru Список явно подключенных плагинов (готовые объекты или строки с именами npm-пакетов)
|
|
35
|
+
* @en List of explicitly registered plugins (direct objects or npm package name strings)
|
|
36
|
+
*/
|
|
37
|
+
plugins?: any[];
|
|
38
|
+
trackMetrics?: any;
|
|
39
|
+
}
|
|
40
|
+
export type HttpClientOptions = BaseHttpClientOptions & HyperttpPluginsExtension;
|
|
41
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,MAAM,WAAW,wBAAwB;CAAG;AAE5C;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEpE;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAEhB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GACnD,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":""}
|