rezo 1.0.27 → 1.0.29
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/curl.cjs +4 -2
- package/dist/adapters/curl.js +4 -2
- package/dist/adapters/entries/curl.d.ts +3 -4
- package/dist/adapters/entries/fetch.d.ts +3 -4
- package/dist/adapters/entries/http.d.ts +3 -4
- package/dist/adapters/entries/http2.d.ts +3 -4
- package/dist/adapters/entries/react-native.d.ts +3 -4
- package/dist/adapters/entries/xhr.d.ts +3 -4
- package/dist/adapters/fetch.cjs +89 -1
- package/dist/adapters/fetch.js +89 -1
- package/dist/adapters/index.cjs +6 -6
- package/dist/adapters/react-native.cjs +162 -3
- package/dist/adapters/react-native.js +162 -3
- package/dist/cache/index.cjs +13 -13
- package/dist/crawler.d.ts +3 -4
- package/dist/entries/crawler.cjs +5 -5
- package/dist/index.cjs +24 -24
- package/dist/index.d.ts +3 -4
- package/dist/platform/browser.d.ts +3 -4
- package/dist/platform/bun.d.ts +3 -4
- package/dist/platform/deno.d.ts +3 -4
- package/dist/platform/node.d.ts +3 -4
- package/dist/platform/react-native.d.ts +3 -4
- package/dist/platform/worker.d.ts +3 -4
- package/dist/plugin/index.cjs +36 -36
- package/dist/proxy/index.cjs +2 -2
- package/dist/queue/index.cjs +8 -8
- package/dist/utils/form-data.cjs +7 -5
- package/dist/utils/form-data.js +7 -5
- package/dist/utils/headers.cjs +2 -4
- package/dist/utils/headers.js +2 -4
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RezoError } from '../errors/rezo-error.js';
|
|
2
2
|
import { buildSmartError, builErrorFromResponse } from '../responses/buildError.js';
|
|
3
|
+
import { RezoCookieJar } from '../utils/cookies.js';
|
|
3
4
|
import RezoFormData from '../utils/form-data.js';
|
|
4
5
|
import { getDefaultConfig, prepareHTTPOptions } from '../utils/http-config.js';
|
|
5
6
|
import { RezoHeaders } from '../utils/headers.js';
|
|
@@ -17,6 +18,85 @@ const Environment = {
|
|
|
17
18
|
hasFormData: typeof FormData !== "undefined",
|
|
18
19
|
hasAbortController: typeof AbortController !== "undefined"
|
|
19
20
|
};
|
|
21
|
+
const debugLog = {
|
|
22
|
+
requestStart: (config, url, method) => {
|
|
23
|
+
if (config.debug) {
|
|
24
|
+
console.log(`
|
|
25
|
+
[Rezo Debug] ─────────────────────────────────────`);
|
|
26
|
+
console.log(`[Rezo Debug] ${method} ${url}`);
|
|
27
|
+
console.log(`[Rezo Debug] Request ID: ${config.requestId}`);
|
|
28
|
+
console.log(`[Rezo Debug] Adapter: react-native`);
|
|
29
|
+
if (config.originalRequest?.headers) {
|
|
30
|
+
const headers = config.originalRequest.headers instanceof RezoHeaders ? config.originalRequest.headers.toObject() : config.originalRequest.headers;
|
|
31
|
+
console.log(`[Rezo Debug] Request Headers:`, JSON.stringify(headers, null, 2));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (config.trackUrl) {
|
|
35
|
+
console.log(`[Rezo Track] → ${method} ${url}`);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
retry: (config, attempt, maxRetries, statusCode, delay) => {
|
|
39
|
+
if (config.debug) {
|
|
40
|
+
console.log(`[Rezo Debug] Retry ${attempt}/${maxRetries} after status ${statusCode}${delay > 0 ? ` (waiting ${delay}ms)` : ""}`);
|
|
41
|
+
}
|
|
42
|
+
if (config.trackUrl) {
|
|
43
|
+
console.log(`[Rezo Track] ⟳ Retry ${attempt}/${maxRetries} (status ${statusCode})`);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
maxRetries: (config, maxRetries) => {
|
|
47
|
+
if (config.debug) {
|
|
48
|
+
console.log(`[Rezo Debug] Max retries (${maxRetries}) reached, throwing error`);
|
|
49
|
+
}
|
|
50
|
+
if (config.trackUrl) {
|
|
51
|
+
console.log(`[Rezo Track] ✗ Max retries reached`);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
response: (config, status, statusText, duration) => {
|
|
55
|
+
if (config.debug) {
|
|
56
|
+
console.log(`[Rezo Debug] Response: ${status} ${statusText} (${duration.toFixed(2)}ms)`);
|
|
57
|
+
}
|
|
58
|
+
if (config.trackUrl) {
|
|
59
|
+
console.log(`[Rezo Track] ✓ ${status} ${statusText}`);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
responseHeaders: (config, headers) => {
|
|
63
|
+
if (config.debug) {
|
|
64
|
+
console.log(`[Rezo Debug] Response Headers:`, JSON.stringify(headers, null, 2));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
cookies: (config, cookieCount) => {
|
|
68
|
+
if (config.debug && cookieCount > 0) {
|
|
69
|
+
console.log(`[Rezo Debug] Cookies received: ${cookieCount}`);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
timing: (config, timing) => {
|
|
73
|
+
if (config.debug) {
|
|
74
|
+
const parts = [];
|
|
75
|
+
if (timing.ttfb)
|
|
76
|
+
parts.push(`TTFB: ${timing.ttfb.toFixed(2)}ms`);
|
|
77
|
+
if (timing.total)
|
|
78
|
+
parts.push(`Total: ${timing.total.toFixed(2)}ms`);
|
|
79
|
+
if (parts.length > 0) {
|
|
80
|
+
console.log(`[Rezo Debug] Timing: ${parts.join(" | ")}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
complete: (config, url) => {
|
|
85
|
+
if (config.debug) {
|
|
86
|
+
console.log(`[Rezo Debug] Request complete: ${url}`);
|
|
87
|
+
console.log(`[Rezo Debug] ─────────────────────────────────────
|
|
88
|
+
`);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
error: (config, error) => {
|
|
92
|
+
if (config.debug) {
|
|
93
|
+
console.log(`[Rezo Debug] Error: ${error instanceof Error ? error.message : error}`);
|
|
94
|
+
}
|
|
95
|
+
if (config.trackUrl) {
|
|
96
|
+
console.log(`[Rezo Track] ✗ Error: ${error instanceof Error ? error.message : error}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
20
100
|
function updateTiming(config, timing, bodySize) {
|
|
21
101
|
const now = performance.now();
|
|
22
102
|
config.timing.domainLookupStart = config.timing.startTime;
|
|
@@ -291,11 +371,25 @@ async function executeFetchRequest(fetchOptions, config, options, perform, strea
|
|
|
291
371
|
throw response;
|
|
292
372
|
}
|
|
293
373
|
if (maxRetries <= retries) {
|
|
374
|
+
debugLog.maxRetries(config, maxRetries);
|
|
294
375
|
throw response;
|
|
295
376
|
}
|
|
296
377
|
retries++;
|
|
297
|
-
|
|
298
|
-
|
|
378
|
+
const currentDelay = incrementDelay ? retryDelay * retries : retryDelay;
|
|
379
|
+
debugLog.retry(config, retries, maxRetries, response.status || 0, currentDelay);
|
|
380
|
+
if (config.hooks?.beforeRetry && config.hooks.beforeRetry.length > 0) {
|
|
381
|
+
for (const hook of config.hooks.beforeRetry) {
|
|
382
|
+
try {
|
|
383
|
+
await hook(config, response, retries);
|
|
384
|
+
} catch (hookErr) {
|
|
385
|
+
if (config.debug) {
|
|
386
|
+
console.log("[Rezo Debug] beforeRetry hook error:", hookErr);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (currentDelay > 0) {
|
|
392
|
+
await new Promise((resolve) => setTimeout(resolve, currentDelay));
|
|
299
393
|
}
|
|
300
394
|
}
|
|
301
395
|
config.retryAttempts++;
|
|
@@ -319,6 +413,7 @@ async function executeSingleRequest(config, fetchOptions, timing, streamResult,
|
|
|
319
413
|
config.isSecure = isSecure;
|
|
320
414
|
config.finalUrl = url;
|
|
321
415
|
config.network.protocol = isSecure ? "https" : "http";
|
|
416
|
+
debugLog.requestStart(config, url, fetchOptions.method?.toUpperCase() || "GET");
|
|
322
417
|
const reqHeaders = fetchOptions.headers instanceof RezoHeaders ? fetchOptions.headers.toObject() : fetchOptions.headers || {};
|
|
323
418
|
const headers = toFetchHeaders(reqHeaders);
|
|
324
419
|
const eventEmitter = streamResult || downloadResult || uploadResult;
|
|
@@ -380,13 +475,68 @@ async function executeSingleRequest(config, fetchOptions, timing, streamResult,
|
|
|
380
475
|
const responseHeaders = fromFetchHeaders(response.headers);
|
|
381
476
|
const contentType = response.headers.get("content-type") || "";
|
|
382
477
|
const contentLength = response.headers.get("content-length");
|
|
383
|
-
|
|
478
|
+
let cookies = {
|
|
384
479
|
array: [],
|
|
385
480
|
serialized: [],
|
|
386
481
|
netscape: "",
|
|
387
482
|
string: "",
|
|
388
483
|
setCookiesString: []
|
|
389
484
|
};
|
|
485
|
+
const setCookieHeader = response.headers.get("set-cookie");
|
|
486
|
+
if (setCookieHeader && config.useCookies) {
|
|
487
|
+
const cookieStrings = setCookieHeader.split(/,(?=[^;]+=[^;]+)/).map((s) => s.trim());
|
|
488
|
+
const tempJar = new RezoCookieJar;
|
|
489
|
+
tempJar.setCookiesSync(cookieStrings, url);
|
|
490
|
+
const parsedCookies = tempJar.cookies();
|
|
491
|
+
const acceptedCookies = [];
|
|
492
|
+
let hookError = null;
|
|
493
|
+
if (config.hooks?.beforeCookie && config.hooks.beforeCookie.length > 0) {
|
|
494
|
+
for (const cookie of parsedCookies.array) {
|
|
495
|
+
let shouldAccept = true;
|
|
496
|
+
for (const hook of config.hooks.beforeCookie) {
|
|
497
|
+
try {
|
|
498
|
+
const result = await hook({
|
|
499
|
+
cookie,
|
|
500
|
+
source: "response",
|
|
501
|
+
url,
|
|
502
|
+
isValid: true
|
|
503
|
+
}, config);
|
|
504
|
+
if (result === false) {
|
|
505
|
+
shouldAccept = false;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
} catch (err) {
|
|
509
|
+
hookError = err;
|
|
510
|
+
if (config.debug) {
|
|
511
|
+
console.log("[Rezo Debug] beforeCookie hook error:", err);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
if (shouldAccept) {
|
|
516
|
+
acceptedCookies.push(cookie);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
} else {
|
|
520
|
+
acceptedCookies.push(...parsedCookies.array);
|
|
521
|
+
}
|
|
522
|
+
const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
|
|
523
|
+
if (config.enableCookieJar && config.cookieJar) {
|
|
524
|
+
config.cookieJar.setCookiesSync(acceptedCookieStrings, url);
|
|
525
|
+
}
|
|
526
|
+
const cookieJar = new RezoCookieJar(acceptedCookies, url);
|
|
527
|
+
cookies = cookieJar.cookies();
|
|
528
|
+
if (!hookError && config.hooks?.afterCookie && config.hooks.afterCookie.length > 0) {
|
|
529
|
+
for (const hook of config.hooks.afterCookie) {
|
|
530
|
+
try {
|
|
531
|
+
await hook(acceptedCookies, config);
|
|
532
|
+
} catch (err) {
|
|
533
|
+
if (config.debug) {
|
|
534
|
+
console.log("[Rezo Debug] afterCookie hook error:", err);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
390
540
|
config.responseCookies = cookies;
|
|
391
541
|
if (eventEmitter) {
|
|
392
542
|
const headersEvent = {
|
|
@@ -464,6 +614,14 @@ async function executeSingleRequest(config, fetchOptions, timing, streamResult,
|
|
|
464
614
|
eventEmitter.emit("error", error);
|
|
465
615
|
return error;
|
|
466
616
|
}
|
|
617
|
+
const duration = performance.now() - timing.startTime;
|
|
618
|
+
debugLog.response(config, status, statusText, duration);
|
|
619
|
+
debugLog.responseHeaders(config, responseHeaders.toObject());
|
|
620
|
+
debugLog.cookies(config, cookies.array.length);
|
|
621
|
+
debugLog.timing(config, {
|
|
622
|
+
ttfb: timing.firstByteTime ? timing.firstByteTime - timing.startTime : undefined,
|
|
623
|
+
total: duration
|
|
624
|
+
});
|
|
467
625
|
const finalResponse = {
|
|
468
626
|
data: responseData,
|
|
469
627
|
status,
|
|
@@ -476,6 +634,7 @@ async function executeSingleRequest(config, fetchOptions, timing, streamResult,
|
|
|
476
634
|
finalUrl: url,
|
|
477
635
|
urls: buildUrlTree(config, url)
|
|
478
636
|
};
|
|
637
|
+
debugLog.complete(config, url);
|
|
479
638
|
if (streamResult) {
|
|
480
639
|
const streamFinishEvent = {
|
|
481
640
|
status,
|
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_9ss1fi = require('./lru-cache.cjs');
|
|
2
|
+
exports.LRUCache = _mod_9ss1fi.LRUCache;;
|
|
3
|
+
const _mod_5jpjzg = require('./dns-cache.cjs');
|
|
4
|
+
exports.DNSCache = _mod_5jpjzg.DNSCache;
|
|
5
|
+
exports.getGlobalDNSCache = _mod_5jpjzg.getGlobalDNSCache;
|
|
6
|
+
exports.resetGlobalDNSCache = _mod_5jpjzg.resetGlobalDNSCache;;
|
|
7
|
+
const _mod_q250sz = require('./response-cache.cjs');
|
|
8
|
+
exports.ResponseCache = _mod_q250sz.ResponseCache;
|
|
9
|
+
exports.normalizeResponseCacheConfig = _mod_q250sz.normalizeResponseCacheConfig;;
|
|
10
|
+
const _mod_dri495 = require('./file-cacher.cjs');
|
|
11
|
+
exports.FileCacher = _mod_dri495.FileCacher;;
|
|
12
|
+
const _mod_2lvgyz = require('./url-store.cjs');
|
|
13
|
+
exports.UrlStore = _mod_2lvgyz.UrlStore;;
|
package/dist/crawler.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -363,7 +363,6 @@ declare class RezoHeaders extends Headers {
|
|
|
363
363
|
string,
|
|
364
364
|
string | string[]
|
|
365
365
|
]>;
|
|
366
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
367
366
|
get [Symbol.toStringTag](): string;
|
|
368
367
|
}
|
|
369
368
|
export interface SerializedCookie {
|
|
@@ -537,8 +536,8 @@ export interface ReadableOptions {
|
|
|
537
536
|
highWaterMark?: number;
|
|
538
537
|
encoding?: string;
|
|
539
538
|
objectMode?: boolean;
|
|
540
|
-
read?(this:
|
|
541
|
-
destroy?(this:
|
|
539
|
+
read?(this: ReadableType, size: number): void;
|
|
540
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
542
541
|
autoDestroy?: boolean;
|
|
543
542
|
}
|
|
544
543
|
export interface Options extends ReadableOptions {
|
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_0xllqe = require('../plugin/crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_0xllqe.Crawler;;
|
|
3
|
+
const _mod_txr5mp = require('../plugin/crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_txr5mp.CrawlerOptions;
|
|
5
|
+
exports.Domain = _mod_txr5mp.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_96xj9i = require('./core/rezo.cjs');
|
|
2
|
+
exports.Rezo = _mod_96xj9i.Rezo;
|
|
3
|
+
exports.createRezoInstance = _mod_96xj9i.createRezoInstance;
|
|
4
|
+
exports.createDefaultInstance = _mod_96xj9i.createDefaultInstance;;
|
|
5
|
+
const _mod_3lqd9a = require('./errors/rezo-error.cjs');
|
|
6
|
+
exports.RezoError = _mod_3lqd9a.RezoError;
|
|
7
|
+
exports.RezoErrorCode = _mod_3lqd9a.RezoErrorCode;;
|
|
8
|
+
const _mod_59zgej = require('./utils/headers.cjs');
|
|
9
|
+
exports.RezoHeaders = _mod_59zgej.RezoHeaders;;
|
|
10
|
+
const _mod_skmrv6 = require('./utils/form-data.cjs');
|
|
11
|
+
exports.RezoFormData = _mod_skmrv6.RezoFormData;;
|
|
12
|
+
const _mod_4gufqx = require('./utils/cookies.cjs');
|
|
13
|
+
exports.RezoCookieJar = _mod_4gufqx.RezoCookieJar;
|
|
14
|
+
exports.Cookie = _mod_4gufqx.Cookie;;
|
|
15
|
+
const _mod_mdhx7m = require('./core/hooks.cjs');
|
|
16
|
+
exports.createDefaultHooks = _mod_mdhx7m.createDefaultHooks;
|
|
17
|
+
exports.mergeHooks = _mod_mdhx7m.mergeHooks;;
|
|
18
|
+
const _mod_kl23ha = require('./proxy/manager.cjs');
|
|
19
|
+
exports.ProxyManager = _mod_kl23ha.ProxyManager;;
|
|
20
|
+
const _mod_og1k7b = require('./queue/index.cjs');
|
|
21
|
+
exports.RezoQueue = _mod_og1k7b.RezoQueue;
|
|
22
|
+
exports.HttpQueue = _mod_og1k7b.HttpQueue;
|
|
23
|
+
exports.Priority = _mod_og1k7b.Priority;
|
|
24
|
+
exports.HttpMethodPriority = _mod_og1k7b.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/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -140,7 +140,6 @@ export declare class RezoHeaders extends Headers {
|
|
|
140
140
|
string,
|
|
141
141
|
string | string[]
|
|
142
142
|
]>;
|
|
143
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
144
143
|
get [Symbol.toStringTag](): string;
|
|
145
144
|
}
|
|
146
145
|
export interface SerializedCookie {
|
|
@@ -314,8 +313,8 @@ export interface ReadableOptions {
|
|
|
314
313
|
highWaterMark?: number;
|
|
315
314
|
encoding?: string;
|
|
316
315
|
objectMode?: boolean;
|
|
317
|
-
read?(this:
|
|
318
|
-
destroy?(this:
|
|
316
|
+
read?(this: ReadableType, size: number): void;
|
|
317
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
319
318
|
autoDestroy?: boolean;
|
|
320
319
|
}
|
|
321
320
|
export interface Options extends ReadableOptions {
|
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -140,7 +140,6 @@ export declare class RezoHeaders extends Headers {
|
|
|
140
140
|
string,
|
|
141
141
|
string | string[]
|
|
142
142
|
]>;
|
|
143
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
144
143
|
get [Symbol.toStringTag](): string;
|
|
145
144
|
}
|
|
146
145
|
export interface SerializedCookie {
|
|
@@ -314,8 +313,8 @@ export interface ReadableOptions {
|
|
|
314
313
|
highWaterMark?: number;
|
|
315
314
|
encoding?: string;
|
|
316
315
|
objectMode?: boolean;
|
|
317
|
-
read?(this:
|
|
318
|
-
destroy?(this:
|
|
316
|
+
read?(this: ReadableType, size: number): void;
|
|
317
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
319
318
|
autoDestroy?: boolean;
|
|
320
319
|
}
|
|
321
320
|
export interface Options extends ReadableOptions {
|
package/dist/platform/bun.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -140,7 +140,6 @@ export declare class RezoHeaders extends Headers {
|
|
|
140
140
|
string,
|
|
141
141
|
string | string[]
|
|
142
142
|
]>;
|
|
143
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
144
143
|
get [Symbol.toStringTag](): string;
|
|
145
144
|
}
|
|
146
145
|
export interface SerializedCookie {
|
|
@@ -314,8 +313,8 @@ export interface ReadableOptions {
|
|
|
314
313
|
highWaterMark?: number;
|
|
315
314
|
encoding?: string;
|
|
316
315
|
objectMode?: boolean;
|
|
317
|
-
read?(this:
|
|
318
|
-
destroy?(this:
|
|
316
|
+
read?(this: ReadableType, size: number): void;
|
|
317
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
319
318
|
autoDestroy?: boolean;
|
|
320
319
|
}
|
|
321
320
|
export interface Options extends ReadableOptions {
|
package/dist/platform/deno.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -140,7 +140,6 @@ export declare class RezoHeaders extends Headers {
|
|
|
140
140
|
string,
|
|
141
141
|
string | string[]
|
|
142
142
|
]>;
|
|
143
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
144
143
|
get [Symbol.toStringTag](): string;
|
|
145
144
|
}
|
|
146
145
|
export interface SerializedCookie {
|
|
@@ -314,8 +313,8 @@ export interface ReadableOptions {
|
|
|
314
313
|
highWaterMark?: number;
|
|
315
314
|
encoding?: string;
|
|
316
315
|
objectMode?: boolean;
|
|
317
|
-
read?(this:
|
|
318
|
-
destroy?(this:
|
|
316
|
+
read?(this: ReadableType, size: number): void;
|
|
317
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
319
318
|
autoDestroy?: boolean;
|
|
320
319
|
}
|
|
321
320
|
export interface Options extends ReadableOptions {
|
package/dist/platform/node.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -140,7 +140,6 @@ export declare class RezoHeaders extends Headers {
|
|
|
140
140
|
string,
|
|
141
141
|
string | string[]
|
|
142
142
|
]>;
|
|
143
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
144
143
|
get [Symbol.toStringTag](): string;
|
|
145
144
|
}
|
|
146
145
|
export interface SerializedCookie {
|
|
@@ -314,8 +313,8 @@ export interface ReadableOptions {
|
|
|
314
313
|
highWaterMark?: number;
|
|
315
314
|
encoding?: string;
|
|
316
315
|
objectMode?: boolean;
|
|
317
|
-
read?(this:
|
|
318
|
-
destroy?(this:
|
|
316
|
+
read?(this: ReadableType, size: number): void;
|
|
317
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
319
318
|
autoDestroy?: boolean;
|
|
320
319
|
}
|
|
321
320
|
export interface Options extends ReadableOptions {
|
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -140,7 +140,6 @@ export declare class RezoHeaders extends Headers {
|
|
|
140
140
|
string,
|
|
141
141
|
string | string[]
|
|
142
142
|
]>;
|
|
143
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
144
143
|
get [Symbol.toStringTag](): string;
|
|
145
144
|
}
|
|
146
145
|
export interface SerializedCookie {
|
|
@@ -314,8 +313,8 @@ export interface ReadableOptions {
|
|
|
314
313
|
highWaterMark?: number;
|
|
315
314
|
encoding?: string;
|
|
316
315
|
objectMode?: boolean;
|
|
317
|
-
read?(this:
|
|
318
|
-
destroy?(this:
|
|
316
|
+
read?(this: ReadableType, size: number): void;
|
|
317
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
319
318
|
autoDestroy?: boolean;
|
|
320
319
|
}
|
|
321
320
|
export interface Options extends ReadableOptions {
|
|
@@ -4,7 +4,7 @@ import { EventEmitter } from 'node:events';
|
|
|
4
4
|
import { Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
5
5
|
import { Agent as HttpsAgent } from 'node:https';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
7
|
-
import { Readable, Writable, WritableOptions } from 'node:stream';
|
|
7
|
+
import { Readable, Readable as ReadableType, Writable, WritableOptions } from 'node:stream';
|
|
8
8
|
import { SecureContext, TLSSocket } from 'node:tls';
|
|
9
9
|
import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions } from 'tough-cookie';
|
|
10
10
|
|
|
@@ -140,7 +140,6 @@ export declare class RezoHeaders extends Headers {
|
|
|
140
140
|
string,
|
|
141
141
|
string | string[]
|
|
142
142
|
]>;
|
|
143
|
-
[util.inspect.custom](_depth: number, options: util.InspectOptionsStylized): string;
|
|
144
143
|
get [Symbol.toStringTag](): string;
|
|
145
144
|
}
|
|
146
145
|
export interface SerializedCookie {
|
|
@@ -314,8 +313,8 @@ export interface ReadableOptions {
|
|
|
314
313
|
highWaterMark?: number;
|
|
315
314
|
encoding?: string;
|
|
316
315
|
objectMode?: boolean;
|
|
317
|
-
read?(this:
|
|
318
|
-
destroy?(this:
|
|
316
|
+
read?(this: ReadableType, size: number): void;
|
|
317
|
+
destroy?(this: ReadableType, error: Error | null, callback: (error: Error | null) => void): void;
|
|
319
318
|
autoDestroy?: boolean;
|
|
320
319
|
}
|
|
321
320
|
export interface Options extends ReadableOptions {
|
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_rss0b2 = require('./crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_rss0b2.Crawler;;
|
|
3
|
+
const _mod_0ywu4a = require('./crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_0ywu4a.CrawlerOptions;;
|
|
5
|
+
const _mod_r6tzca = require('../cache/file-cacher.cjs');
|
|
6
|
+
exports.FileCacher = _mod_r6tzca.FileCacher;;
|
|
7
|
+
const _mod_aw0pxt = require('../cache/url-store.cjs');
|
|
8
|
+
exports.UrlStore = _mod_aw0pxt.UrlStore;;
|
|
9
|
+
const _mod_6rsznf = require('./addon/oxylabs/index.cjs');
|
|
10
|
+
exports.Oxylabs = _mod_6rsznf.Oxylabs;;
|
|
11
|
+
const _mod_kgy3pf = require('./addon/oxylabs/options.cjs');
|
|
12
|
+
exports.OXYLABS_BROWSER_TYPES = _mod_kgy3pf.OXYLABS_BROWSER_TYPES;
|
|
13
|
+
exports.OXYLABS_COMMON_LOCALES = _mod_kgy3pf.OXYLABS_COMMON_LOCALES;
|
|
14
|
+
exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_kgy3pf.OXYLABS_COMMON_GEO_LOCATIONS;
|
|
15
|
+
exports.OXYLABS_US_STATES = _mod_kgy3pf.OXYLABS_US_STATES;
|
|
16
|
+
exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_kgy3pf.OXYLABS_EUROPEAN_COUNTRIES;
|
|
17
|
+
exports.OXYLABS_ASIAN_COUNTRIES = _mod_kgy3pf.OXYLABS_ASIAN_COUNTRIES;
|
|
18
|
+
exports.getRandomOxylabsBrowserType = _mod_kgy3pf.getRandomBrowserType;
|
|
19
|
+
exports.getRandomOxylabsLocale = _mod_kgy3pf.getRandomLocale;
|
|
20
|
+
exports.getRandomOxylabsGeoLocation = _mod_kgy3pf.getRandomGeoLocation;;
|
|
21
|
+
const _mod_4335qv = require('./addon/decodo/index.cjs');
|
|
22
|
+
exports.Decodo = _mod_4335qv.Decodo;;
|
|
23
|
+
const _mod_0ry06s = require('./addon/decodo/options.cjs');
|
|
24
|
+
exports.DECODO_DEVICE_TYPES = _mod_0ry06s.DECODO_DEVICE_TYPES;
|
|
25
|
+
exports.DECODO_HEADLESS_MODES = _mod_0ry06s.DECODO_HEADLESS_MODES;
|
|
26
|
+
exports.DECODO_COMMON_LOCALES = _mod_0ry06s.DECODO_COMMON_LOCALES;
|
|
27
|
+
exports.DECODO_COMMON_COUNTRIES = _mod_0ry06s.DECODO_COMMON_COUNTRIES;
|
|
28
|
+
exports.DECODO_EUROPEAN_COUNTRIES = _mod_0ry06s.DECODO_EUROPEAN_COUNTRIES;
|
|
29
|
+
exports.DECODO_ASIAN_COUNTRIES = _mod_0ry06s.DECODO_ASIAN_COUNTRIES;
|
|
30
|
+
exports.DECODO_US_STATES = _mod_0ry06s.DECODO_US_STATES;
|
|
31
|
+
exports.DECODO_COMMON_CITIES = _mod_0ry06s.DECODO_COMMON_CITIES;
|
|
32
|
+
exports.getRandomDecodoDeviceType = _mod_0ry06s.getRandomDeviceType;
|
|
33
|
+
exports.getRandomDecodoLocale = _mod_0ry06s.getRandomLocale;
|
|
34
|
+
exports.getRandomDecodoCountry = _mod_0ry06s.getRandomCountry;
|
|
35
|
+
exports.getRandomDecodoCity = _mod_0ry06s.getRandomCity;
|
|
36
|
+
exports.generateDecodoSessionId = _mod_0ry06s.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_ejtoqv = require('./manager.cjs');
|
|
5
|
+
exports.ProxyManager = _mod_ejtoqv.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_12321u = require('./queue.cjs');
|
|
2
|
+
exports.RezoQueue = _mod_12321u.RezoQueue;;
|
|
3
|
+
const _mod_qrk8sw = require('./http-queue.cjs');
|
|
4
|
+
exports.HttpQueue = _mod_qrk8sw.HttpQueue;
|
|
5
|
+
exports.extractDomain = _mod_qrk8sw.extractDomain;;
|
|
6
|
+
const _mod_bamjlz = require('./types.cjs');
|
|
7
|
+
exports.Priority = _mod_bamjlz.Priority;
|
|
8
|
+
exports.HttpMethodPriority = _mod_bamjlz.HttpMethodPriority;;
|