rezo 1.0.133 → 1.0.135
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 +18 -7
- package/dist/adapters/curl.js +18 -7
- package/dist/adapters/entries/curl.cjs +4 -1
- package/dist/adapters/entries/curl.d.ts +6475 -5999
- package/dist/adapters/entries/curl.js +2 -1
- package/dist/adapters/entries/fetch.d.ts +103 -70
- package/dist/adapters/entries/http.cjs +2 -0
- package/dist/adapters/entries/http.d.ts +178 -70
- package/dist/adapters/entries/http.js +2 -0
- package/dist/adapters/entries/http2.cjs +2 -1
- package/dist/adapters/entries/http2.d.ts +129 -70
- package/dist/adapters/entries/http2.js +2 -1
- package/dist/adapters/entries/react-native.cjs +6 -6
- package/dist/adapters/entries/react-native.d.ts +103 -70
- package/dist/adapters/entries/xhr.d.ts +103 -70
- package/dist/adapters/fetch.cjs +21 -9
- package/dist/adapters/fetch.js +21 -9
- package/dist/adapters/http.cjs +23 -12
- package/dist/adapters/http.js +23 -12
- package/dist/adapters/http2.cjs +21 -10
- package/dist/adapters/http2.js +21 -10
- package/dist/adapters/index.cjs +10 -6
- package/dist/adapters/index.d.ts +4548 -0
- package/dist/adapters/index.js +5 -1
- package/dist/adapters/react-native.cjs +24 -12
- package/dist/adapters/react-native.js +24 -12
- package/dist/adapters/xhr.cjs +2 -1
- package/dist/adapters/xhr.js +2 -1
- package/dist/cache/index.cjs +9 -9
- package/dist/cookies/cookie-jar.cjs +13 -7
- package/dist/cookies/cookie-jar.js +9 -3
- package/dist/cookies/cookie.cjs +1 -1
- package/dist/cookies/cookie.js +1 -1
- package/dist/cookies/file-store.cjs +4 -1
- package/dist/cookies/file-store.js +4 -1
- package/dist/cookies/index.cjs +10 -10
- package/dist/crawler/addon/decodo/options.cjs +1 -1
- package/dist/crawler/addon/decodo/options.js +1 -1
- package/dist/crawler/addon/oxylabs/index.cjs +1 -1
- package/dist/crawler/addon/oxylabs/options.cjs +1 -1
- package/dist/crawler/addon/oxylabs/options.js +1 -1
- package/dist/crawler/index.cjs +42 -42
- package/dist/crawler/plugin/index.cjs +1 -1
- package/dist/crawler.d.ts +1042 -98
- package/dist/entries/crawler.cjs +24 -6
- package/dist/entries/crawler.js +9 -0
- package/dist/index.cjs +58 -48
- package/dist/index.d.ts +124 -78
- package/dist/index.js +15 -1
- package/dist/internal/agents/index.cjs +14 -14
- package/dist/platform/browser.d.ts +103 -70
- package/dist/platform/bun.d.ts +103 -70
- package/dist/platform/deno.d.ts +103 -70
- package/dist/platform/node.d.ts +103 -70
- package/dist/platform/react-native.cjs +6 -6
- package/dist/platform/react-native.d.ts +103 -70
- package/dist/platform/worker.d.ts +103 -70
- package/dist/proxy/index.cjs +4 -4
- package/dist/queue/index.cjs +8 -8
- package/dist/responses/universal/index.cjs +11 -11
- package/dist/stealth/index.cjs +17 -17
- package/dist/stealth/index.d.ts +288 -0
- package/dist/stealth/profiles/index.cjs +10 -10
- package/dist/utils/curl.cjs +4 -2
- package/dist/utils/curl.js +4 -2
- package/dist/utils/http-config.cjs +6 -0
- package/dist/utils/http-config.js +6 -0
- package/dist/utils/staged-timeout.cjs +8 -0
- package/dist/utils/staged-timeout.js +7 -0
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/wget/downloader.cjs +1 -1
- package/dist/wget/downloader.js +1 -1
- package/dist/wget/index.cjs +51 -51
- package/dist/wget/index.d.ts +179 -92
- package/package.json +17 -1
package/dist/adapters/curl.cjs
CHANGED
|
@@ -199,13 +199,21 @@ function buildUrlTree(config, finalUrl) {
|
|
|
199
199
|
async function _updateCookies(config, cookieStrings, url, rootJar) {
|
|
200
200
|
if (!cookieStrings || cookieStrings.length === 0)
|
|
201
201
|
return;
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
const pairs = [];
|
|
203
|
+
for (const raw of cookieStrings) {
|
|
204
|
+
const singleJar = new RezoCookieJar;
|
|
205
|
+
try {
|
|
206
|
+
singleJar.setCookiesSync([raw], url);
|
|
207
|
+
const parsed = singleJar.cookies().array[0];
|
|
208
|
+
if (parsed)
|
|
209
|
+
pairs.push({ raw, cookie: parsed });
|
|
210
|
+
} catch {}
|
|
211
|
+
}
|
|
205
212
|
const acceptedCookies = [];
|
|
213
|
+
const acceptedRaw = [];
|
|
206
214
|
let hookError = null;
|
|
207
215
|
if (config.hooks?.beforeCookie && config.hooks.beforeCookie.length > 0) {
|
|
208
|
-
for (const cookie of
|
|
216
|
+
for (const { raw, cookie } of pairs) {
|
|
209
217
|
let shouldAccept = true;
|
|
210
218
|
for (const hook of config.hooks.beforeCookie) {
|
|
211
219
|
try {
|
|
@@ -228,15 +236,18 @@ async function _updateCookies(config, cookieStrings, url, rootJar) {
|
|
|
228
236
|
}
|
|
229
237
|
if (shouldAccept) {
|
|
230
238
|
acceptedCookies.push(cookie);
|
|
239
|
+
acceptedRaw.push(raw);
|
|
231
240
|
}
|
|
232
241
|
}
|
|
233
242
|
} else {
|
|
234
|
-
|
|
243
|
+
for (const { raw, cookie } of pairs) {
|
|
244
|
+
acceptedCookies.push(cookie);
|
|
245
|
+
acceptedRaw.push(raw);
|
|
246
|
+
}
|
|
235
247
|
}
|
|
236
|
-
const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
|
|
237
248
|
const jarToUpdate = rootJar || config.jar;
|
|
238
249
|
if (!config.disableJar && jarToUpdate) {
|
|
239
|
-
jarToUpdate.setCookiesSync(
|
|
250
|
+
jarToUpdate.setCookiesSync(acceptedRaw, url);
|
|
240
251
|
}
|
|
241
252
|
if (config.useCookies) {
|
|
242
253
|
const existingArray = config.responseCookies?.array || [];
|
package/dist/adapters/curl.js
CHANGED
|
@@ -199,13 +199,21 @@ function buildUrlTree(config, finalUrl) {
|
|
|
199
199
|
async function _updateCookies(config, cookieStrings, url, rootJar) {
|
|
200
200
|
if (!cookieStrings || cookieStrings.length === 0)
|
|
201
201
|
return;
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
const pairs = [];
|
|
203
|
+
for (const raw of cookieStrings) {
|
|
204
|
+
const singleJar = new RezoCookieJar;
|
|
205
|
+
try {
|
|
206
|
+
singleJar.setCookiesSync([raw], url);
|
|
207
|
+
const parsed = singleJar.cookies().array[0];
|
|
208
|
+
if (parsed)
|
|
209
|
+
pairs.push({ raw, cookie: parsed });
|
|
210
|
+
} catch {}
|
|
211
|
+
}
|
|
205
212
|
const acceptedCookies = [];
|
|
213
|
+
const acceptedRaw = [];
|
|
206
214
|
let hookError = null;
|
|
207
215
|
if (config.hooks?.beforeCookie && config.hooks.beforeCookie.length > 0) {
|
|
208
|
-
for (const cookie of
|
|
216
|
+
for (const { raw, cookie } of pairs) {
|
|
209
217
|
let shouldAccept = true;
|
|
210
218
|
for (const hook of config.hooks.beforeCookie) {
|
|
211
219
|
try {
|
|
@@ -228,15 +236,18 @@ async function _updateCookies(config, cookieStrings, url, rootJar) {
|
|
|
228
236
|
}
|
|
229
237
|
if (shouldAccept) {
|
|
230
238
|
acceptedCookies.push(cookie);
|
|
239
|
+
acceptedRaw.push(raw);
|
|
231
240
|
}
|
|
232
241
|
}
|
|
233
242
|
} else {
|
|
234
|
-
|
|
243
|
+
for (const { raw, cookie } of pairs) {
|
|
244
|
+
acceptedCookies.push(cookie);
|
|
245
|
+
acceptedRaw.push(raw);
|
|
246
|
+
}
|
|
235
247
|
}
|
|
236
|
-
const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
|
|
237
248
|
const jarToUpdate = rootJar || config.jar;
|
|
238
249
|
if (!config.disableJar && jarToUpdate) {
|
|
239
|
-
jarToUpdate.setCookiesSync(
|
|
250
|
+
jarToUpdate.setCookiesSync(acceptedRaw, url);
|
|
240
251
|
}
|
|
241
252
|
if (config.useCookies) {
|
|
242
253
|
const existingArray = config.responseCookies?.array || [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { executeRequest } = require('../curl.cjs');
|
|
1
|
+
const { executeRequest, CurlCapabilities, CurlCommandBuilder, CurlExecutor } = require('../curl.cjs');
|
|
2
2
|
const { setGlobalAdapter, createRezoInstance, Rezo } = require('../../core/rezo.cjs');
|
|
3
3
|
const { RezoError, RezoErrorCode } = require('../../errors/rezo-error.cjs');
|
|
4
4
|
const { RezoHeaders } = require('../../utils/headers.cjs');
|
|
@@ -16,6 +16,9 @@ exports.RezoCookieJar = RezoCookieJar;
|
|
|
16
16
|
exports.Cookie = Cookie;
|
|
17
17
|
exports.createDefaultHooks = createDefaultHooks;
|
|
18
18
|
exports.mergeHooks = mergeHooks;
|
|
19
|
+
exports.CurlCapabilities = CurlCapabilities;
|
|
20
|
+
exports.CurlCommandBuilder = CurlCommandBuilder;
|
|
21
|
+
exports.CurlExecutor = CurlExecutor;
|
|
19
22
|
const isRezoError = exports.isRezoError = RezoError.isRezoError;
|
|
20
23
|
const Cancel = exports.Cancel = RezoError;
|
|
21
24
|
const CancelToken = exports.CancelToken = AbortController;
|