rezo 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +352 -9
- package/dist/adapters/curl.cjs +796 -0
- package/dist/adapters/curl.js +796 -0
- package/dist/adapters/entries/curl.d.ts +2332 -20
- package/dist/adapters/entries/fetch.d.ts +289 -20
- package/dist/adapters/entries/http.d.ts +289 -20
- package/dist/adapters/entries/http2.d.ts +289 -20
- package/dist/adapters/entries/react-native.d.ts +289 -20
- package/dist/adapters/entries/xhr.d.ts +289 -20
- package/dist/adapters/index.cjs +6 -6
- package/dist/adapters/picker.cjs +2 -2
- package/dist/adapters/picker.js +2 -2
- package/dist/cache/index.cjs +13 -13
- package/dist/core/rezo.cjs +2 -2
- package/dist/core/rezo.js +2 -2
- package/dist/crawler.d.ts +291 -22
- package/dist/entries/crawler.cjs +5 -5
- package/dist/index.cjs +23 -18
- package/dist/index.d.ts +556 -20
- package/dist/index.js +1 -0
- package/dist/platform/browser.d.ts +289 -20
- package/dist/platform/bun.d.ts +289 -20
- package/dist/platform/deno.d.ts +289 -20
- package/dist/platform/node.d.ts +289 -20
- package/dist/platform/react-native.d.ts +289 -20
- package/dist/platform/worker.d.ts +289 -20
- package/dist/plugin/crawler-options.cjs +1 -1
- package/dist/plugin/crawler-options.js +1 -1
- package/dist/plugin/crawler.cjs +2 -2
- package/dist/plugin/crawler.js +2 -2
- package/dist/plugin/index.cjs +36 -36
- package/dist/proxy/index.cjs +2 -2
- package/dist/proxy/manager.cjs +14 -1
- package/dist/proxy/manager.js +14 -1
- package/dist/queue/http-queue.cjs +313 -0
- package/dist/queue/http-queue.js +312 -0
- package/dist/queue/index.cjs +8 -0
- package/dist/queue/index.js +6 -0
- package/dist/queue/queue.cjs +346 -0
- package/dist/queue/queue.js +344 -0
- package/dist/queue/types.cjs +17 -0
- package/dist/queue/types.js +17 -0
- package/dist/types/curl-options.cjs +25 -0
- package/dist/types/curl-options.js +25 -0
- package/dist/utils/http-config.cjs +0 -15
- package/dist/utils/http-config.js +0 -15
- package/package.json +1 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const CURL_OPTION_DEFAULTS = exports.CURL_OPTION_DEFAULTS = {
|
|
2
|
+
tcpFastOpen: false,
|
|
3
|
+
tcpNodelay: false,
|
|
4
|
+
noKeepalive: false,
|
|
5
|
+
pathAsIs: false,
|
|
6
|
+
globOff: false,
|
|
7
|
+
certStatus: false,
|
|
8
|
+
noAlpn: false,
|
|
9
|
+
sessionId: true,
|
|
10
|
+
locationTrusted: false,
|
|
11
|
+
junkSessionCookies: false,
|
|
12
|
+
fail: false,
|
|
13
|
+
verbose: false,
|
|
14
|
+
traceTime: false,
|
|
15
|
+
raw: false,
|
|
16
|
+
noCompressed: false,
|
|
17
|
+
noAltSvc: false,
|
|
18
|
+
negotiate: false,
|
|
19
|
+
saslIr: false,
|
|
20
|
+
compressedSsh: false,
|
|
21
|
+
insecure: false,
|
|
22
|
+
maxRedirs: 50,
|
|
23
|
+
happyEyeballsTimeout: 200
|
|
24
|
+
};
|
|
25
|
+
const CURL_OPTIONS_COUNT = exports.CURL_OPTIONS_COUNT = 120;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const CURL_OPTION_DEFAULTS = {
|
|
2
|
+
tcpFastOpen: false,
|
|
3
|
+
tcpNodelay: false,
|
|
4
|
+
noKeepalive: false,
|
|
5
|
+
pathAsIs: false,
|
|
6
|
+
globOff: false,
|
|
7
|
+
certStatus: false,
|
|
8
|
+
noAlpn: false,
|
|
9
|
+
sessionId: true,
|
|
10
|
+
locationTrusted: false,
|
|
11
|
+
junkSessionCookies: false,
|
|
12
|
+
fail: false,
|
|
13
|
+
verbose: false,
|
|
14
|
+
traceTime: false,
|
|
15
|
+
raw: false,
|
|
16
|
+
noCompressed: false,
|
|
17
|
+
noAltSvc: false,
|
|
18
|
+
negotiate: false,
|
|
19
|
+
saslIr: false,
|
|
20
|
+
compressedSsh: false,
|
|
21
|
+
insecure: false,
|
|
22
|
+
maxRedirs: 50,
|
|
23
|
+
happyEyeballsTimeout: 200
|
|
24
|
+
};
|
|
25
|
+
export const CURL_OPTIONS_COUNT = 120;
|
|
@@ -175,10 +175,7 @@ function setSignal() {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
async function getDefaultConfig(config = {}, proxyManager) {
|
|
178
|
-
const curl = await checkCurl();
|
|
179
178
|
return {
|
|
180
|
-
useCurl: config.curl === true,
|
|
181
|
-
isCurl: curl.status || false,
|
|
182
179
|
baseURL: config.baseURL,
|
|
183
180
|
headers: config.headers,
|
|
184
181
|
rejectUnauthorized: config.rejectUnauthorized,
|
|
@@ -192,7 +189,6 @@ async function getDefaultConfig(config = {}, proxyManager) {
|
|
|
192
189
|
useCookies: config.enableCookieJar,
|
|
193
190
|
fs: await getFS(),
|
|
194
191
|
timeout: config.timeout ?? config.requestTimeout,
|
|
195
|
-
http2: config.http2 === true,
|
|
196
192
|
hooks: config.hooks,
|
|
197
193
|
cookieFile: config.cookieFile,
|
|
198
194
|
encoding: config.encoding,
|
|
@@ -523,8 +519,6 @@ As a workaround, process.env.NODE_TLS_REJECT_UNAUTHORIZED is being set to '0'.
|
|
|
523
519
|
headers: requestOptions.headers,
|
|
524
520
|
maxRedirects,
|
|
525
521
|
retryAttempts: 0,
|
|
526
|
-
http2: requestOptions.http2 === true,
|
|
527
|
-
curl: requestOptions.curl === true,
|
|
528
522
|
timeout: typeof requestOptions.timeout === "number" ? requestOptions.timeout : null,
|
|
529
523
|
enableCookieJar: typeof defaultOptions.enableCookieJar === "boolean" ? defaultOptions.enableCookieJar : true,
|
|
530
524
|
useCookies: typeof requestOptions.useCookies === "boolean" ? requestOptions.useCookies : true,
|
|
@@ -583,15 +577,6 @@ As a workaround, process.env.NODE_TLS_REJECT_UNAUTHORIZED is being set to '0'.
|
|
|
583
577
|
config.httpsAgent = options.httpsAgent;
|
|
584
578
|
}
|
|
585
579
|
const isSupportedRuntime = type === "node" || type === "bun" || type === "deno";
|
|
586
|
-
if (requestOptions.curl && !defaultOptions.isCurl && debug) {
|
|
587
|
-
const recommendations = isSupportedRuntime ? `Recommendations:
|
|
588
|
-
` + `• Only enable 'curl' mode when absolutely necessary
|
|
589
|
-
` + `• Verify curl is installed and up-to-date on your system
|
|
590
|
-
` + `• For enhanced security, consider using native Rezo HTTP clients instead` : "";
|
|
591
|
-
console.warn(`⚠️ [WARNING]: ${isSupportedRuntime ? `Curl binary not detected in your environment while 'curl' mode is enabled` : `'curl' mode is not supported in '${type}' environment`}
|
|
592
|
-
|
|
593
|
-
` + recommendations);
|
|
594
|
-
}
|
|
595
580
|
if (saveTo) {
|
|
596
581
|
if (!isSupportedRuntime) {
|
|
597
582
|
throw new Error(`You can only use this feature in Node.js, Deno or Bun and not available in Edge or Browser.`);
|
|
@@ -175,10 +175,7 @@ function setSignal() {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
export async function getDefaultConfig(config = {}, proxyManager) {
|
|
178
|
-
const curl = await checkCurl();
|
|
179
178
|
return {
|
|
180
|
-
useCurl: config.curl === true,
|
|
181
|
-
isCurl: curl.status || false,
|
|
182
179
|
baseURL: config.baseURL,
|
|
183
180
|
headers: config.headers,
|
|
184
181
|
rejectUnauthorized: config.rejectUnauthorized,
|
|
@@ -192,7 +189,6 @@ export async function getDefaultConfig(config = {}, proxyManager) {
|
|
|
192
189
|
useCookies: config.enableCookieJar,
|
|
193
190
|
fs: await getFS(),
|
|
194
191
|
timeout: config.timeout ?? config.requestTimeout,
|
|
195
|
-
http2: config.http2 === true,
|
|
196
192
|
hooks: config.hooks,
|
|
197
193
|
cookieFile: config.cookieFile,
|
|
198
194
|
encoding: config.encoding,
|
|
@@ -523,8 +519,6 @@ As a workaround, process.env.NODE_TLS_REJECT_UNAUTHORIZED is being set to '0'.
|
|
|
523
519
|
headers: requestOptions.headers,
|
|
524
520
|
maxRedirects,
|
|
525
521
|
retryAttempts: 0,
|
|
526
|
-
http2: requestOptions.http2 === true,
|
|
527
|
-
curl: requestOptions.curl === true,
|
|
528
522
|
timeout: typeof requestOptions.timeout === "number" ? requestOptions.timeout : null,
|
|
529
523
|
enableCookieJar: typeof defaultOptions.enableCookieJar === "boolean" ? defaultOptions.enableCookieJar : true,
|
|
530
524
|
useCookies: typeof requestOptions.useCookies === "boolean" ? requestOptions.useCookies : true,
|
|
@@ -583,15 +577,6 @@ As a workaround, process.env.NODE_TLS_REJECT_UNAUTHORIZED is being set to '0'.
|
|
|
583
577
|
config.httpsAgent = options.httpsAgent;
|
|
584
578
|
}
|
|
585
579
|
const isSupportedRuntime = type === "node" || type === "bun" || type === "deno";
|
|
586
|
-
if (requestOptions.curl && !defaultOptions.isCurl && debug) {
|
|
587
|
-
const recommendations = isSupportedRuntime ? `Recommendations:
|
|
588
|
-
` + `• Only enable 'curl' mode when absolutely necessary
|
|
589
|
-
` + `• Verify curl is installed and up-to-date on your system
|
|
590
|
-
` + `• For enhanced security, consider using native Rezo HTTP clients instead` : "";
|
|
591
|
-
console.warn(`⚠️ [WARNING]: ${isSupportedRuntime ? `Curl binary not detected in your environment while 'curl' mode is enabled` : `'curl' mode is not supported in '${type}' environment`}
|
|
592
|
-
|
|
593
|
-
` + recommendations);
|
|
594
|
-
}
|
|
595
580
|
if (saveTo) {
|
|
596
581
|
if (!isSupportedRuntime) {
|
|
597
582
|
throw new Error(`You can only use this feature in Node.js, Deno or Bun and not available in Edge or Browser.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rezo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Lightning-fast, enterprise-grade HTTP client for modern JavaScript. Full HTTP/2 support, intelligent cookie management, multiple adapters (HTTP, Fetch, cURL, XHR), streaming, proxy support (HTTP/HTTPS/SOCKS), and cross-environment compatibility.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"http-proxy-agent": "^7.0.2",
|
|
67
67
|
"https-proxy-agent": "^7.0.6",
|
|
68
68
|
"socks-proxy-agent": "^8.0.5",
|
|
69
|
-
"p-queue": "^8.1.0",
|
|
70
69
|
"linkedom": "^0.18.11",
|
|
71
70
|
"agent-base": "^7.1.4"
|
|
72
71
|
},
|