rezo 1.0.23 → 1.0.25
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/dist/adapters/fetch.cjs +5 -1
- package/dist/adapters/fetch.js +5 -1
- package/dist/adapters/http.cjs +60 -10
- package/dist/adapters/http.js +60 -10
- package/dist/adapters/http2.cjs +5 -1
- package/dist/adapters/http2.js +5 -1
- package/dist/adapters/index.cjs +6 -6
- package/dist/cache/index.cjs +13 -13
- package/dist/entries/crawler.cjs +5 -5
- package/dist/index.cjs +24 -24
- package/dist/plugin/index.cjs +36 -36
- package/dist/proxy/index.cjs +2 -2
- package/dist/queue/index.cjs +8 -8
- package/dist/utils/http-config.cjs +0 -3
- package/dist/utils/http-config.js +0 -3
- package/package.json +1 -1
package/dist/adapters/fetch.cjs
CHANGED
|
@@ -642,7 +642,11 @@ async function executeSingleFetchRequest(config, fetchOptions, requestCount, tim
|
|
|
642
642
|
const isRedirect = status >= 300 && status < 400 && location;
|
|
643
643
|
if (isRedirect) {
|
|
644
644
|
_stats.statusOnNext = "redirect";
|
|
645
|
-
|
|
645
|
+
const redirectUrlObj = new URL(location, url);
|
|
646
|
+
if (!redirectUrlObj.hash && url.hash) {
|
|
647
|
+
redirectUrlObj.hash = url.hash;
|
|
648
|
+
}
|
|
649
|
+
_stats.redirectUrl = redirectUrlObj.href;
|
|
646
650
|
const partialResponse = {
|
|
647
651
|
data: "",
|
|
648
652
|
status,
|
package/dist/adapters/fetch.js
CHANGED
|
@@ -642,7 +642,11 @@ async function executeSingleFetchRequest(config, fetchOptions, requestCount, tim
|
|
|
642
642
|
const isRedirect = status >= 300 && status < 400 && location;
|
|
643
643
|
if (isRedirect) {
|
|
644
644
|
_stats.statusOnNext = "redirect";
|
|
645
|
-
|
|
645
|
+
const redirectUrlObj = new URL(location, url);
|
|
646
|
+
if (!redirectUrlObj.hash && url.hash) {
|
|
647
|
+
redirectUrlObj.hash = url.hash;
|
|
648
|
+
}
|
|
649
|
+
_stats.redirectUrl = redirectUrlObj.href;
|
|
646
650
|
const partialResponse = {
|
|
647
651
|
data: "",
|
|
648
652
|
status,
|
package/dist/adapters/http.cjs
CHANGED
|
@@ -290,10 +290,19 @@ async function executeRequest(options, defaultOptions, jar) {
|
|
|
290
290
|
try {
|
|
291
291
|
const res = executeHttp1Request(config.fetchOptions, mainConfig, config.options, perform, d_options.fs, streamResponse, downloadResponse, uploadResponse);
|
|
292
292
|
if (streamResponse) {
|
|
293
|
+
res.catch((err) => {
|
|
294
|
+
streamResponse.emit("error", err);
|
|
295
|
+
});
|
|
293
296
|
return streamResponse;
|
|
294
297
|
} else if (downloadResponse) {
|
|
298
|
+
res.catch((err) => {
|
|
299
|
+
downloadResponse.emit("error", err);
|
|
300
|
+
});
|
|
295
301
|
return downloadResponse;
|
|
296
302
|
} else if (uploadResponse) {
|
|
303
|
+
res.catch((err) => {
|
|
304
|
+
uploadResponse.emit("error", err);
|
|
305
|
+
});
|
|
297
306
|
return uploadResponse;
|
|
298
307
|
}
|
|
299
308
|
const response = await res;
|
|
@@ -416,17 +425,32 @@ async function executeHttp1Request(fetchOptions, config, options, perform, fs, s
|
|
|
416
425
|
const addedOptions = {};
|
|
417
426
|
const location = _stats.redirectUrl;
|
|
418
427
|
if (!location || !_stats.redirectUrl) {
|
|
419
|
-
|
|
428
|
+
const redirectError = builErrorFromResponse("Redirect location not found", response, config, fetchOptions);
|
|
429
|
+
_stats.statusOnNext = "error";
|
|
430
|
+
if (!config.errors)
|
|
431
|
+
config.errors = [];
|
|
432
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
433
|
+
throw redirectError;
|
|
420
434
|
}
|
|
421
435
|
if (config.maxRedirects === 0) {
|
|
422
436
|
config.maxRedirectsReached = true;
|
|
423
|
-
|
|
437
|
+
const redirectError = builErrorFromResponse(`Redirects are disabled (maxRedirects=0)`, response, config, fetchOptions);
|
|
438
|
+
_stats.statusOnNext = "error";
|
|
439
|
+
if (!config.errors)
|
|
440
|
+
config.errors = [];
|
|
441
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
442
|
+
throw redirectError;
|
|
424
443
|
}
|
|
425
444
|
const enableCycleDetection = config.enableRedirectCycleDetection === true;
|
|
426
445
|
if (enableCycleDetection) {
|
|
427
446
|
const normalizedRedirectUrl = _stats.redirectUrl.toLowerCase();
|
|
428
447
|
if (visitedUrls.has(normalizedRedirectUrl)) {
|
|
429
|
-
|
|
448
|
+
const redirectError = builErrorFromResponse(`Redirect cycle detected: attempting to revisit ${_stats.redirectUrl}`, response, config, fetchOptions);
|
|
449
|
+
_stats.statusOnNext = "error";
|
|
450
|
+
if (!config.errors)
|
|
451
|
+
config.errors = [];
|
|
452
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
453
|
+
throw redirectError;
|
|
430
454
|
}
|
|
431
455
|
visitedUrls.add(normalizedRedirectUrl);
|
|
432
456
|
}
|
|
@@ -443,15 +467,30 @@ async function executeHttp1Request(fetchOptions, config, options, perform, fs, s
|
|
|
443
467
|
if (typeof onRedirect !== "undefined") {
|
|
444
468
|
if (typeof onRedirect === "boolean") {
|
|
445
469
|
if (!onRedirect) {
|
|
446
|
-
|
|
470
|
+
const redirectError = builErrorFromResponse("Redirect denied by user", response, config, fetchOptions);
|
|
471
|
+
_stats.statusOnNext = "error";
|
|
472
|
+
if (!config.errors)
|
|
473
|
+
config.errors = [];
|
|
474
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
475
|
+
throw redirectError;
|
|
447
476
|
}
|
|
448
477
|
} else if (!onRedirect.redirect) {
|
|
449
|
-
|
|
478
|
+
const redirectError = builErrorFromResponse("Redirect denied by user", response, config, fetchOptions);
|
|
479
|
+
_stats.statusOnNext = "error";
|
|
480
|
+
if (!config.errors)
|
|
481
|
+
config.errors = [];
|
|
482
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
483
|
+
throw redirectError;
|
|
450
484
|
}
|
|
451
485
|
}
|
|
452
486
|
if (config.redirectCount >= config.maxRedirects && config.maxRedirects > 0) {
|
|
453
487
|
config.maxRedirectsReached = true;
|
|
454
|
-
|
|
488
|
+
const redirectError = builErrorFromResponse(`Max redirects (${config.maxRedirects}) reached`, response, config, fetchOptions);
|
|
489
|
+
_stats.statusOnNext = "error";
|
|
490
|
+
if (!config.errors)
|
|
491
|
+
config.errors = [];
|
|
492
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
493
|
+
throw redirectError;
|
|
455
494
|
}
|
|
456
495
|
config.redirectHistory.push({
|
|
457
496
|
url: fetchOptions.fullUrl,
|
|
@@ -646,7 +685,11 @@ async function request(config, fetchOptions, requestCount, timing, _stats, respo
|
|
|
646
685
|
if (isRedirected)
|
|
647
686
|
_stats.statusOnNext = "redirect";
|
|
648
687
|
if (isRedirected && location) {
|
|
649
|
-
|
|
688
|
+
const redirectUrlObj = new URL(location, url);
|
|
689
|
+
if (!redirectUrlObj.hash && url.hash) {
|
|
690
|
+
redirectUrlObj.hash = url.hash;
|
|
691
|
+
}
|
|
692
|
+
_stats.redirectUrl = redirectUrlObj.href;
|
|
650
693
|
if (config.redirectCount) {
|
|
651
694
|
config.redirectCount++;
|
|
652
695
|
} else {
|
|
@@ -876,10 +919,17 @@ async function request(config, fetchOptions, requestCount, timing, _stats, respo
|
|
|
876
919
|
});
|
|
877
920
|
}
|
|
878
921
|
});
|
|
922
|
+
req.on("error", (err) => {
|
|
923
|
+
_stats.statusOnNext = "error";
|
|
924
|
+
const error = buildSmartError(config, fetchOptions, err);
|
|
925
|
+
resolve(error);
|
|
926
|
+
});
|
|
879
927
|
req.on("socket", (socket) => {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
928
|
+
socket.on("error", (err) => {
|
|
929
|
+
_stats.statusOnNext = "error";
|
|
930
|
+
const error = buildSmartError(config, fetchOptions, err);
|
|
931
|
+
resolve(error);
|
|
932
|
+
});
|
|
883
933
|
timing.dnsStart = performance.now();
|
|
884
934
|
config.timing.domainLookupStart = timing.dnsStart;
|
|
885
935
|
socket.on("lookup", (err, address, family) => {
|
package/dist/adapters/http.js
CHANGED
|
@@ -290,10 +290,19 @@ export async function executeRequest(options, defaultOptions, jar) {
|
|
|
290
290
|
try {
|
|
291
291
|
const res = executeHttp1Request(config.fetchOptions, mainConfig, config.options, perform, d_options.fs, streamResponse, downloadResponse, uploadResponse);
|
|
292
292
|
if (streamResponse) {
|
|
293
|
+
res.catch((err) => {
|
|
294
|
+
streamResponse.emit("error", err);
|
|
295
|
+
});
|
|
293
296
|
return streamResponse;
|
|
294
297
|
} else if (downloadResponse) {
|
|
298
|
+
res.catch((err) => {
|
|
299
|
+
downloadResponse.emit("error", err);
|
|
300
|
+
});
|
|
295
301
|
return downloadResponse;
|
|
296
302
|
} else if (uploadResponse) {
|
|
303
|
+
res.catch((err) => {
|
|
304
|
+
uploadResponse.emit("error", err);
|
|
305
|
+
});
|
|
297
306
|
return uploadResponse;
|
|
298
307
|
}
|
|
299
308
|
const response = await res;
|
|
@@ -416,17 +425,32 @@ async function executeHttp1Request(fetchOptions, config, options, perform, fs, s
|
|
|
416
425
|
const addedOptions = {};
|
|
417
426
|
const location = _stats.redirectUrl;
|
|
418
427
|
if (!location || !_stats.redirectUrl) {
|
|
419
|
-
|
|
428
|
+
const redirectError = builErrorFromResponse("Redirect location not found", response, config, fetchOptions);
|
|
429
|
+
_stats.statusOnNext = "error";
|
|
430
|
+
if (!config.errors)
|
|
431
|
+
config.errors = [];
|
|
432
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
433
|
+
throw redirectError;
|
|
420
434
|
}
|
|
421
435
|
if (config.maxRedirects === 0) {
|
|
422
436
|
config.maxRedirectsReached = true;
|
|
423
|
-
|
|
437
|
+
const redirectError = builErrorFromResponse(`Redirects are disabled (maxRedirects=0)`, response, config, fetchOptions);
|
|
438
|
+
_stats.statusOnNext = "error";
|
|
439
|
+
if (!config.errors)
|
|
440
|
+
config.errors = [];
|
|
441
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
442
|
+
throw redirectError;
|
|
424
443
|
}
|
|
425
444
|
const enableCycleDetection = config.enableRedirectCycleDetection === true;
|
|
426
445
|
if (enableCycleDetection) {
|
|
427
446
|
const normalizedRedirectUrl = _stats.redirectUrl.toLowerCase();
|
|
428
447
|
if (visitedUrls.has(normalizedRedirectUrl)) {
|
|
429
|
-
|
|
448
|
+
const redirectError = builErrorFromResponse(`Redirect cycle detected: attempting to revisit ${_stats.redirectUrl}`, response, config, fetchOptions);
|
|
449
|
+
_stats.statusOnNext = "error";
|
|
450
|
+
if (!config.errors)
|
|
451
|
+
config.errors = [];
|
|
452
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
453
|
+
throw redirectError;
|
|
430
454
|
}
|
|
431
455
|
visitedUrls.add(normalizedRedirectUrl);
|
|
432
456
|
}
|
|
@@ -443,15 +467,30 @@ async function executeHttp1Request(fetchOptions, config, options, perform, fs, s
|
|
|
443
467
|
if (typeof onRedirect !== "undefined") {
|
|
444
468
|
if (typeof onRedirect === "boolean") {
|
|
445
469
|
if (!onRedirect) {
|
|
446
|
-
|
|
470
|
+
const redirectError = builErrorFromResponse("Redirect denied by user", response, config, fetchOptions);
|
|
471
|
+
_stats.statusOnNext = "error";
|
|
472
|
+
if (!config.errors)
|
|
473
|
+
config.errors = [];
|
|
474
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
475
|
+
throw redirectError;
|
|
447
476
|
}
|
|
448
477
|
} else if (!onRedirect.redirect) {
|
|
449
|
-
|
|
478
|
+
const redirectError = builErrorFromResponse("Redirect denied by user", response, config, fetchOptions);
|
|
479
|
+
_stats.statusOnNext = "error";
|
|
480
|
+
if (!config.errors)
|
|
481
|
+
config.errors = [];
|
|
482
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
483
|
+
throw redirectError;
|
|
450
484
|
}
|
|
451
485
|
}
|
|
452
486
|
if (config.redirectCount >= config.maxRedirects && config.maxRedirects > 0) {
|
|
453
487
|
config.maxRedirectsReached = true;
|
|
454
|
-
|
|
488
|
+
const redirectError = builErrorFromResponse(`Max redirects (${config.maxRedirects}) reached`, response, config, fetchOptions);
|
|
489
|
+
_stats.statusOnNext = "error";
|
|
490
|
+
if (!config.errors)
|
|
491
|
+
config.errors = [];
|
|
492
|
+
config.errors.push({ attempt: config.retryAttempts + 1, error: redirectError, duration: perform.now() });
|
|
493
|
+
throw redirectError;
|
|
455
494
|
}
|
|
456
495
|
config.redirectHistory.push({
|
|
457
496
|
url: fetchOptions.fullUrl,
|
|
@@ -646,7 +685,11 @@ async function request(config, fetchOptions, requestCount, timing, _stats, respo
|
|
|
646
685
|
if (isRedirected)
|
|
647
686
|
_stats.statusOnNext = "redirect";
|
|
648
687
|
if (isRedirected && location) {
|
|
649
|
-
|
|
688
|
+
const redirectUrlObj = new URL(location, url);
|
|
689
|
+
if (!redirectUrlObj.hash && url.hash) {
|
|
690
|
+
redirectUrlObj.hash = url.hash;
|
|
691
|
+
}
|
|
692
|
+
_stats.redirectUrl = redirectUrlObj.href;
|
|
650
693
|
if (config.redirectCount) {
|
|
651
694
|
config.redirectCount++;
|
|
652
695
|
} else {
|
|
@@ -876,10 +919,17 @@ async function request(config, fetchOptions, requestCount, timing, _stats, respo
|
|
|
876
919
|
});
|
|
877
920
|
}
|
|
878
921
|
});
|
|
922
|
+
req.on("error", (err) => {
|
|
923
|
+
_stats.statusOnNext = "error";
|
|
924
|
+
const error = buildSmartError(config, fetchOptions, err);
|
|
925
|
+
resolve(error);
|
|
926
|
+
});
|
|
879
927
|
req.on("socket", (socket) => {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
928
|
+
socket.on("error", (err) => {
|
|
929
|
+
_stats.statusOnNext = "error";
|
|
930
|
+
const error = buildSmartError(config, fetchOptions, err);
|
|
931
|
+
resolve(error);
|
|
932
|
+
});
|
|
883
933
|
timing.dnsStart = performance.now();
|
|
884
934
|
config.timing.domainLookupStart = timing.dnsStart;
|
|
885
935
|
socket.on("lookup", (err, address, family) => {
|
package/dist/adapters/http2.cjs
CHANGED
|
@@ -824,7 +824,11 @@ async function executeHttp2Stream(config, fetchOptions, requestCount, timing, _s
|
|
|
824
824
|
const isRedirect = status >= 300 && status < 400 && location;
|
|
825
825
|
if (isRedirect) {
|
|
826
826
|
_stats.statusOnNext = "redirect";
|
|
827
|
-
|
|
827
|
+
const redirectUrlObj = new URL(location, url);
|
|
828
|
+
if (!redirectUrlObj.hash && url.hash) {
|
|
829
|
+
redirectUrlObj.hash = url.hash;
|
|
830
|
+
}
|
|
831
|
+
_stats.redirectUrl = redirectUrlObj.href;
|
|
828
832
|
}
|
|
829
833
|
config.network.httpVersion = "h2";
|
|
830
834
|
(async () => {
|
package/dist/adapters/http2.js
CHANGED
|
@@ -824,7 +824,11 @@ async function executeHttp2Stream(config, fetchOptions, requestCount, timing, _s
|
|
|
824
824
|
const isRedirect = status >= 300 && status < 400 && location;
|
|
825
825
|
if (isRedirect) {
|
|
826
826
|
_stats.statusOnNext = "redirect";
|
|
827
|
-
|
|
827
|
+
const redirectUrlObj = new URL(location, url);
|
|
828
|
+
if (!redirectUrlObj.hash && url.hash) {
|
|
829
|
+
redirectUrlObj.hash = url.hash;
|
|
830
|
+
}
|
|
831
|
+
_stats.redirectUrl = redirectUrlObj.href;
|
|
828
832
|
}
|
|
829
833
|
config.network.httpVersion = "h2";
|
|
830
834
|
(async () => {
|
package/dist/adapters/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.detectRuntime =
|
|
3
|
-
exports.getAdapterCapabilities =
|
|
4
|
-
exports.buildAdapterContext =
|
|
5
|
-
exports.getAvailableAdapters =
|
|
6
|
-
exports.selectAdapter =
|
|
1
|
+
const _mod_8vsbsk = require('./picker.cjs');
|
|
2
|
+
exports.detectRuntime = _mod_8vsbsk.detectRuntime;
|
|
3
|
+
exports.getAdapterCapabilities = _mod_8vsbsk.getAdapterCapabilities;
|
|
4
|
+
exports.buildAdapterContext = _mod_8vsbsk.buildAdapterContext;
|
|
5
|
+
exports.getAvailableAdapters = _mod_8vsbsk.getAvailableAdapters;
|
|
6
|
+
exports.selectAdapter = _mod_8vsbsk.selectAdapter;;
|
package/dist/cache/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.LRUCache =
|
|
3
|
-
const
|
|
4
|
-
exports.DNSCache =
|
|
5
|
-
exports.getGlobalDNSCache =
|
|
6
|
-
exports.resetGlobalDNSCache =
|
|
7
|
-
const
|
|
8
|
-
exports.ResponseCache =
|
|
9
|
-
exports.normalizeResponseCacheConfig =
|
|
10
|
-
const
|
|
11
|
-
exports.FileCacher =
|
|
12
|
-
const
|
|
13
|
-
exports.UrlStore =
|
|
1
|
+
const _mod_3nlvak = require('./lru-cache.cjs');
|
|
2
|
+
exports.LRUCache = _mod_3nlvak.LRUCache;;
|
|
3
|
+
const _mod_jjdx5e = require('./dns-cache.cjs');
|
|
4
|
+
exports.DNSCache = _mod_jjdx5e.DNSCache;
|
|
5
|
+
exports.getGlobalDNSCache = _mod_jjdx5e.getGlobalDNSCache;
|
|
6
|
+
exports.resetGlobalDNSCache = _mod_jjdx5e.resetGlobalDNSCache;;
|
|
7
|
+
const _mod_6grfwd = require('./response-cache.cjs');
|
|
8
|
+
exports.ResponseCache = _mod_6grfwd.ResponseCache;
|
|
9
|
+
exports.normalizeResponseCacheConfig = _mod_6grfwd.normalizeResponseCacheConfig;;
|
|
10
|
+
const _mod_ietsvu = require('./file-cacher.cjs');
|
|
11
|
+
exports.FileCacher = _mod_ietsvu.FileCacher;;
|
|
12
|
+
const _mod_o14hsh = require('./url-store.cjs');
|
|
13
|
+
exports.UrlStore = _mod_o14hsh.UrlStore;;
|
package/dist/entries/crawler.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Crawler =
|
|
3
|
-
const
|
|
4
|
-
exports.CrawlerOptions =
|
|
5
|
-
exports.Domain =
|
|
1
|
+
const _mod_n2jqd1 = require('../plugin/crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_n2jqd1.Crawler;;
|
|
3
|
+
const _mod_wyfomf = require('../plugin/crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_wyfomf.CrawlerOptions;
|
|
5
|
+
exports.Domain = _mod_wyfomf.Domain;;
|
package/dist/index.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Rezo =
|
|
3
|
-
exports.createRezoInstance =
|
|
4
|
-
exports.createDefaultInstance =
|
|
5
|
-
const
|
|
6
|
-
exports.RezoError =
|
|
7
|
-
exports.RezoErrorCode =
|
|
8
|
-
const
|
|
9
|
-
exports.RezoHeaders =
|
|
10
|
-
const
|
|
11
|
-
exports.RezoFormData =
|
|
12
|
-
const
|
|
13
|
-
exports.RezoCookieJar =
|
|
14
|
-
exports.Cookie =
|
|
15
|
-
const
|
|
16
|
-
exports.createDefaultHooks =
|
|
17
|
-
exports.mergeHooks =
|
|
18
|
-
const
|
|
19
|
-
exports.ProxyManager =
|
|
20
|
-
const
|
|
21
|
-
exports.RezoQueue =
|
|
22
|
-
exports.HttpQueue =
|
|
23
|
-
exports.Priority =
|
|
24
|
-
exports.HttpMethodPriority =
|
|
1
|
+
const _mod_c5wnbk = require('./core/rezo.cjs');
|
|
2
|
+
exports.Rezo = _mod_c5wnbk.Rezo;
|
|
3
|
+
exports.createRezoInstance = _mod_c5wnbk.createRezoInstance;
|
|
4
|
+
exports.createDefaultInstance = _mod_c5wnbk.createDefaultInstance;;
|
|
5
|
+
const _mod_vk9phy = require('./errors/rezo-error.cjs');
|
|
6
|
+
exports.RezoError = _mod_vk9phy.RezoError;
|
|
7
|
+
exports.RezoErrorCode = _mod_vk9phy.RezoErrorCode;;
|
|
8
|
+
const _mod_smhm1d = require('./utils/headers.cjs');
|
|
9
|
+
exports.RezoHeaders = _mod_smhm1d.RezoHeaders;;
|
|
10
|
+
const _mod_umbtma = require('./utils/form-data.cjs');
|
|
11
|
+
exports.RezoFormData = _mod_umbtma.RezoFormData;;
|
|
12
|
+
const _mod_s4d2mf = require('./utils/cookies.cjs');
|
|
13
|
+
exports.RezoCookieJar = _mod_s4d2mf.RezoCookieJar;
|
|
14
|
+
exports.Cookie = _mod_s4d2mf.Cookie;;
|
|
15
|
+
const _mod_lqyqqc = require('./core/hooks.cjs');
|
|
16
|
+
exports.createDefaultHooks = _mod_lqyqqc.createDefaultHooks;
|
|
17
|
+
exports.mergeHooks = _mod_lqyqqc.mergeHooks;;
|
|
18
|
+
const _mod_9k2fte = require('./proxy/manager.cjs');
|
|
19
|
+
exports.ProxyManager = _mod_9k2fte.ProxyManager;;
|
|
20
|
+
const _mod_dw7oqs = require('./queue/index.cjs');
|
|
21
|
+
exports.RezoQueue = _mod_dw7oqs.RezoQueue;
|
|
22
|
+
exports.HttpQueue = _mod_dw7oqs.HttpQueue;
|
|
23
|
+
exports.Priority = _mod_dw7oqs.Priority;
|
|
24
|
+
exports.HttpMethodPriority = _mod_dw7oqs.HttpMethodPriority;;
|
|
25
25
|
const { RezoError } = require('./errors/rezo-error.cjs');
|
|
26
26
|
const isRezoError = exports.isRezoError = RezoError.isRezoError;
|
|
27
27
|
const Cancel = exports.Cancel = RezoError;
|
package/dist/plugin/index.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Crawler =
|
|
3
|
-
const
|
|
4
|
-
exports.CrawlerOptions =
|
|
5
|
-
const
|
|
6
|
-
exports.FileCacher =
|
|
7
|
-
const
|
|
8
|
-
exports.UrlStore =
|
|
9
|
-
const
|
|
10
|
-
exports.Oxylabs =
|
|
11
|
-
const
|
|
12
|
-
exports.OXYLABS_BROWSER_TYPES =
|
|
13
|
-
exports.OXYLABS_COMMON_LOCALES =
|
|
14
|
-
exports.OXYLABS_COMMON_GEO_LOCATIONS =
|
|
15
|
-
exports.OXYLABS_US_STATES =
|
|
16
|
-
exports.OXYLABS_EUROPEAN_COUNTRIES =
|
|
17
|
-
exports.OXYLABS_ASIAN_COUNTRIES =
|
|
18
|
-
exports.getRandomOxylabsBrowserType =
|
|
19
|
-
exports.getRandomOxylabsLocale =
|
|
20
|
-
exports.getRandomOxylabsGeoLocation =
|
|
21
|
-
const
|
|
22
|
-
exports.Decodo =
|
|
23
|
-
const
|
|
24
|
-
exports.DECODO_DEVICE_TYPES =
|
|
25
|
-
exports.DECODO_HEADLESS_MODES =
|
|
26
|
-
exports.DECODO_COMMON_LOCALES =
|
|
27
|
-
exports.DECODO_COMMON_COUNTRIES =
|
|
28
|
-
exports.DECODO_EUROPEAN_COUNTRIES =
|
|
29
|
-
exports.DECODO_ASIAN_COUNTRIES =
|
|
30
|
-
exports.DECODO_US_STATES =
|
|
31
|
-
exports.DECODO_COMMON_CITIES =
|
|
32
|
-
exports.getRandomDecodoDeviceType =
|
|
33
|
-
exports.getRandomDecodoLocale =
|
|
34
|
-
exports.getRandomDecodoCountry =
|
|
35
|
-
exports.getRandomDecodoCity =
|
|
36
|
-
exports.generateDecodoSessionId =
|
|
1
|
+
const _mod_nllk9k = require('./crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_nllk9k.Crawler;;
|
|
3
|
+
const _mod_qrdenz = require('./crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_qrdenz.CrawlerOptions;;
|
|
5
|
+
const _mod_zrawfy = require('../cache/file-cacher.cjs');
|
|
6
|
+
exports.FileCacher = _mod_zrawfy.FileCacher;;
|
|
7
|
+
const _mod_uvh0y9 = require('../cache/url-store.cjs');
|
|
8
|
+
exports.UrlStore = _mod_uvh0y9.UrlStore;;
|
|
9
|
+
const _mod_cg499j = require('./addon/oxylabs/index.cjs');
|
|
10
|
+
exports.Oxylabs = _mod_cg499j.Oxylabs;;
|
|
11
|
+
const _mod_vqortf = require('./addon/oxylabs/options.cjs');
|
|
12
|
+
exports.OXYLABS_BROWSER_TYPES = _mod_vqortf.OXYLABS_BROWSER_TYPES;
|
|
13
|
+
exports.OXYLABS_COMMON_LOCALES = _mod_vqortf.OXYLABS_COMMON_LOCALES;
|
|
14
|
+
exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_vqortf.OXYLABS_COMMON_GEO_LOCATIONS;
|
|
15
|
+
exports.OXYLABS_US_STATES = _mod_vqortf.OXYLABS_US_STATES;
|
|
16
|
+
exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_vqortf.OXYLABS_EUROPEAN_COUNTRIES;
|
|
17
|
+
exports.OXYLABS_ASIAN_COUNTRIES = _mod_vqortf.OXYLABS_ASIAN_COUNTRIES;
|
|
18
|
+
exports.getRandomOxylabsBrowserType = _mod_vqortf.getRandomBrowserType;
|
|
19
|
+
exports.getRandomOxylabsLocale = _mod_vqortf.getRandomLocale;
|
|
20
|
+
exports.getRandomOxylabsGeoLocation = _mod_vqortf.getRandomGeoLocation;;
|
|
21
|
+
const _mod_tmdzgo = require('./addon/decodo/index.cjs');
|
|
22
|
+
exports.Decodo = _mod_tmdzgo.Decodo;;
|
|
23
|
+
const _mod_lmu5vf = require('./addon/decodo/options.cjs');
|
|
24
|
+
exports.DECODO_DEVICE_TYPES = _mod_lmu5vf.DECODO_DEVICE_TYPES;
|
|
25
|
+
exports.DECODO_HEADLESS_MODES = _mod_lmu5vf.DECODO_HEADLESS_MODES;
|
|
26
|
+
exports.DECODO_COMMON_LOCALES = _mod_lmu5vf.DECODO_COMMON_LOCALES;
|
|
27
|
+
exports.DECODO_COMMON_COUNTRIES = _mod_lmu5vf.DECODO_COMMON_COUNTRIES;
|
|
28
|
+
exports.DECODO_EUROPEAN_COUNTRIES = _mod_lmu5vf.DECODO_EUROPEAN_COUNTRIES;
|
|
29
|
+
exports.DECODO_ASIAN_COUNTRIES = _mod_lmu5vf.DECODO_ASIAN_COUNTRIES;
|
|
30
|
+
exports.DECODO_US_STATES = _mod_lmu5vf.DECODO_US_STATES;
|
|
31
|
+
exports.DECODO_COMMON_CITIES = _mod_lmu5vf.DECODO_COMMON_CITIES;
|
|
32
|
+
exports.getRandomDecodoDeviceType = _mod_lmu5vf.getRandomDeviceType;
|
|
33
|
+
exports.getRandomDecodoLocale = _mod_lmu5vf.getRandomLocale;
|
|
34
|
+
exports.getRandomDecodoCountry = _mod_lmu5vf.getRandomCountry;
|
|
35
|
+
exports.getRandomDecodoCity = _mod_lmu5vf.getRandomCity;
|
|
36
|
+
exports.generateDecodoSessionId = _mod_lmu5vf.generateSessionId;;
|
package/dist/proxy/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { SocksProxyAgent: RezoSocksProxy } = require("socks-proxy-agent");
|
|
2
2
|
const { HttpsProxyAgent: RezoHttpsSocks } = require("https-proxy-agent");
|
|
3
3
|
const { HttpProxyAgent: RezoHttpSocks } = require("http-proxy-agent");
|
|
4
|
-
const
|
|
5
|
-
exports.ProxyManager =
|
|
4
|
+
const _mod_0qa1hk = require('./manager.cjs');
|
|
5
|
+
exports.ProxyManager = _mod_0qa1hk.ProxyManager;;
|
|
6
6
|
function createOptions(uri, opts) {
|
|
7
7
|
if (uri instanceof URL || typeof uri === "string") {
|
|
8
8
|
return {
|
package/dist/queue/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.RezoQueue =
|
|
3
|
-
const
|
|
4
|
-
exports.HttpQueue =
|
|
5
|
-
exports.extractDomain =
|
|
6
|
-
const
|
|
7
|
-
exports.Priority =
|
|
8
|
-
exports.HttpMethodPriority =
|
|
1
|
+
const _mod_0h7eic = require('./queue.cjs');
|
|
2
|
+
exports.RezoQueue = _mod_0h7eic.RezoQueue;;
|
|
3
|
+
const _mod_0yp12v = require('./http-queue.cjs');
|
|
4
|
+
exports.HttpQueue = _mod_0yp12v.HttpQueue;
|
|
5
|
+
exports.extractDomain = _mod_0yp12v.extractDomain;;
|
|
6
|
+
const _mod_a7m6vx = require('./types.cjs');
|
|
7
|
+
exports.Priority = _mod_a7m6vx.Priority;
|
|
8
|
+
exports.HttpMethodPriority = _mod_a7m6vx.HttpMethodPriority;;
|
|
@@ -171,9 +171,6 @@ function setSignal() {
|
|
|
171
171
|
if (this.timeout && typeof this.timeout === "number" && this.timeout > 100) {
|
|
172
172
|
const controller = new AbortController;
|
|
173
173
|
const timer = setTimeout(() => controller.abort(), this.timeout);
|
|
174
|
-
if (typeof timer === "object" && "unref" in timer) {
|
|
175
|
-
timer.unref();
|
|
176
|
-
}
|
|
177
174
|
this.timeoutClearInstanse = timer;
|
|
178
175
|
this.signal = controller.signal;
|
|
179
176
|
}
|
|
@@ -171,9 +171,6 @@ function setSignal() {
|
|
|
171
171
|
if (this.timeout && typeof this.timeout === "number" && this.timeout > 100) {
|
|
172
172
|
const controller = new AbortController;
|
|
173
173
|
const timer = setTimeout(() => controller.abort(), this.timeout);
|
|
174
|
-
if (typeof timer === "object" && "unref" in timer) {
|
|
175
|
-
timer.unref();
|
|
176
|
-
}
|
|
177
174
|
this.timeoutClearInstanse = timer;
|
|
178
175
|
this.signal = controller.signal;
|
|
179
176
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rezo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
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",
|