rezo 1.0.26 → 1.0.28
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 +45 -0
- package/dist/adapters/entries/fetch.d.ts +45 -0
- package/dist/adapters/entries/http.d.ts +45 -0
- package/dist/adapters/entries/http2.d.ts +45 -0
- package/dist/adapters/entries/react-native.d.ts +45 -0
- package/dist/adapters/entries/xhr.d.ts +45 -0
- package/dist/adapters/fetch.cjs +90 -1
- package/dist/adapters/fetch.js +90 -1
- package/dist/adapters/http.cjs +1 -1
- package/dist/adapters/http.js +1 -1
- package/dist/adapters/http2.cjs +1 -1
- package/dist/adapters/http2.js +1 -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 +45 -0
- package/dist/entries/crawler.cjs +5 -5
- package/dist/index.cjs +24 -24
- package/dist/index.d.ts +45 -0
- package/dist/platform/browser.d.ts +45 -0
- package/dist/platform/bun.d.ts +45 -0
- package/dist/platform/deno.d.ts +45 -0
- package/dist/platform/node.d.ts +45 -0
- package/dist/platform/react-native.d.ts +45 -0
- package/dist/platform/worker.d.ts +45 -0
- package/dist/plugin/index.cjs +36 -36
- package/dist/proxy/index.cjs +2 -2
- package/dist/queue/index.cjs +8 -8
- package/dist/utils/cookies.cjs +39 -0
- package/dist/utils/cookies.js +39 -0
- package/dist/utils/http-config.cjs +16 -4
- package/dist/utils/http-config.js +16 -4
- package/package.json +1 -1
|
@@ -205,6 +205,51 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
205
205
|
toArray(): Cookie[];
|
|
206
206
|
toSetCookies(): string[];
|
|
207
207
|
toSerializedCookies(): SerializedCookie[];
|
|
208
|
+
/**
|
|
209
|
+
* Get cookies for a request URL with proper browser-like matching.
|
|
210
|
+
* This method properly handles:
|
|
211
|
+
* - Domain matching (exact or parent domain)
|
|
212
|
+
* - Path matching (cookie path must be prefix of request path)
|
|
213
|
+
* - Secure flag (secure cookies only over HTTPS)
|
|
214
|
+
* - Expiry (expired cookies not returned)
|
|
215
|
+
*
|
|
216
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
217
|
+
* @returns Array of Cookie objects that should be sent with the request
|
|
218
|
+
*/
|
|
219
|
+
getCookiesForRequest(requestUrl: string | URL): Cookie[];
|
|
220
|
+
/**
|
|
221
|
+
* Get the Cookie header value for a request URL with proper browser-like matching.
|
|
222
|
+
* Returns cookies in the format: "key1=value1; key2=value2"
|
|
223
|
+
*
|
|
224
|
+
* This is the browser-accurate way to build the Cookie header, properly filtering
|
|
225
|
+
* cookies by domain, path, secure flag, and expiry.
|
|
226
|
+
*
|
|
227
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
228
|
+
* @returns Cookie header string in "key=value; key=value" format
|
|
229
|
+
*/
|
|
230
|
+
getCookieHeader(requestUrl: string | URL): string;
|
|
231
|
+
/**
|
|
232
|
+
* Debug method to show which cookies would be sent for a given URL.
|
|
233
|
+
* Useful for troubleshooting cookie matching issues.
|
|
234
|
+
*
|
|
235
|
+
* @param requestUrl - The full request URL including path
|
|
236
|
+
* @returns Object with matching cookies and the Cookie header that would be sent
|
|
237
|
+
*/
|
|
238
|
+
debugCookiesForRequest(requestUrl: string | URL): {
|
|
239
|
+
url: string;
|
|
240
|
+
matchingCookies: Array<{
|
|
241
|
+
key: string;
|
|
242
|
+
value: string;
|
|
243
|
+
domain: string;
|
|
244
|
+
path: string;
|
|
245
|
+
}>;
|
|
246
|
+
cookieHeader: string;
|
|
247
|
+
allCookies: Array<{
|
|
248
|
+
key: string;
|
|
249
|
+
domain: string;
|
|
250
|
+
path: string;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
208
253
|
setCookiesSync(setCookieArray: string[]): Cookies;
|
|
209
254
|
setCookiesSync(setCookieArray: string[], url: string): Cookies;
|
|
210
255
|
setCookiesSync(cookiesString: string): Cookies;
|
package/dist/platform/bun.d.ts
CHANGED
|
@@ -205,6 +205,51 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
205
205
|
toArray(): Cookie[];
|
|
206
206
|
toSetCookies(): string[];
|
|
207
207
|
toSerializedCookies(): SerializedCookie[];
|
|
208
|
+
/**
|
|
209
|
+
* Get cookies for a request URL with proper browser-like matching.
|
|
210
|
+
* This method properly handles:
|
|
211
|
+
* - Domain matching (exact or parent domain)
|
|
212
|
+
* - Path matching (cookie path must be prefix of request path)
|
|
213
|
+
* - Secure flag (secure cookies only over HTTPS)
|
|
214
|
+
* - Expiry (expired cookies not returned)
|
|
215
|
+
*
|
|
216
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
217
|
+
* @returns Array of Cookie objects that should be sent with the request
|
|
218
|
+
*/
|
|
219
|
+
getCookiesForRequest(requestUrl: string | URL): Cookie[];
|
|
220
|
+
/**
|
|
221
|
+
* Get the Cookie header value for a request URL with proper browser-like matching.
|
|
222
|
+
* Returns cookies in the format: "key1=value1; key2=value2"
|
|
223
|
+
*
|
|
224
|
+
* This is the browser-accurate way to build the Cookie header, properly filtering
|
|
225
|
+
* cookies by domain, path, secure flag, and expiry.
|
|
226
|
+
*
|
|
227
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
228
|
+
* @returns Cookie header string in "key=value; key=value" format
|
|
229
|
+
*/
|
|
230
|
+
getCookieHeader(requestUrl: string | URL): string;
|
|
231
|
+
/**
|
|
232
|
+
* Debug method to show which cookies would be sent for a given URL.
|
|
233
|
+
* Useful for troubleshooting cookie matching issues.
|
|
234
|
+
*
|
|
235
|
+
* @param requestUrl - The full request URL including path
|
|
236
|
+
* @returns Object with matching cookies and the Cookie header that would be sent
|
|
237
|
+
*/
|
|
238
|
+
debugCookiesForRequest(requestUrl: string | URL): {
|
|
239
|
+
url: string;
|
|
240
|
+
matchingCookies: Array<{
|
|
241
|
+
key: string;
|
|
242
|
+
value: string;
|
|
243
|
+
domain: string;
|
|
244
|
+
path: string;
|
|
245
|
+
}>;
|
|
246
|
+
cookieHeader: string;
|
|
247
|
+
allCookies: Array<{
|
|
248
|
+
key: string;
|
|
249
|
+
domain: string;
|
|
250
|
+
path: string;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
208
253
|
setCookiesSync(setCookieArray: string[]): Cookies;
|
|
209
254
|
setCookiesSync(setCookieArray: string[], url: string): Cookies;
|
|
210
255
|
setCookiesSync(cookiesString: string): Cookies;
|
package/dist/platform/deno.d.ts
CHANGED
|
@@ -205,6 +205,51 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
205
205
|
toArray(): Cookie[];
|
|
206
206
|
toSetCookies(): string[];
|
|
207
207
|
toSerializedCookies(): SerializedCookie[];
|
|
208
|
+
/**
|
|
209
|
+
* Get cookies for a request URL with proper browser-like matching.
|
|
210
|
+
* This method properly handles:
|
|
211
|
+
* - Domain matching (exact or parent domain)
|
|
212
|
+
* - Path matching (cookie path must be prefix of request path)
|
|
213
|
+
* - Secure flag (secure cookies only over HTTPS)
|
|
214
|
+
* - Expiry (expired cookies not returned)
|
|
215
|
+
*
|
|
216
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
217
|
+
* @returns Array of Cookie objects that should be sent with the request
|
|
218
|
+
*/
|
|
219
|
+
getCookiesForRequest(requestUrl: string | URL): Cookie[];
|
|
220
|
+
/**
|
|
221
|
+
* Get the Cookie header value for a request URL with proper browser-like matching.
|
|
222
|
+
* Returns cookies in the format: "key1=value1; key2=value2"
|
|
223
|
+
*
|
|
224
|
+
* This is the browser-accurate way to build the Cookie header, properly filtering
|
|
225
|
+
* cookies by domain, path, secure flag, and expiry.
|
|
226
|
+
*
|
|
227
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
228
|
+
* @returns Cookie header string in "key=value; key=value" format
|
|
229
|
+
*/
|
|
230
|
+
getCookieHeader(requestUrl: string | URL): string;
|
|
231
|
+
/**
|
|
232
|
+
* Debug method to show which cookies would be sent for a given URL.
|
|
233
|
+
* Useful for troubleshooting cookie matching issues.
|
|
234
|
+
*
|
|
235
|
+
* @param requestUrl - The full request URL including path
|
|
236
|
+
* @returns Object with matching cookies and the Cookie header that would be sent
|
|
237
|
+
*/
|
|
238
|
+
debugCookiesForRequest(requestUrl: string | URL): {
|
|
239
|
+
url: string;
|
|
240
|
+
matchingCookies: Array<{
|
|
241
|
+
key: string;
|
|
242
|
+
value: string;
|
|
243
|
+
domain: string;
|
|
244
|
+
path: string;
|
|
245
|
+
}>;
|
|
246
|
+
cookieHeader: string;
|
|
247
|
+
allCookies: Array<{
|
|
248
|
+
key: string;
|
|
249
|
+
domain: string;
|
|
250
|
+
path: string;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
208
253
|
setCookiesSync(setCookieArray: string[]): Cookies;
|
|
209
254
|
setCookiesSync(setCookieArray: string[], url: string): Cookies;
|
|
210
255
|
setCookiesSync(cookiesString: string): Cookies;
|
package/dist/platform/node.d.ts
CHANGED
|
@@ -205,6 +205,51 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
205
205
|
toArray(): Cookie[];
|
|
206
206
|
toSetCookies(): string[];
|
|
207
207
|
toSerializedCookies(): SerializedCookie[];
|
|
208
|
+
/**
|
|
209
|
+
* Get cookies for a request URL with proper browser-like matching.
|
|
210
|
+
* This method properly handles:
|
|
211
|
+
* - Domain matching (exact or parent domain)
|
|
212
|
+
* - Path matching (cookie path must be prefix of request path)
|
|
213
|
+
* - Secure flag (secure cookies only over HTTPS)
|
|
214
|
+
* - Expiry (expired cookies not returned)
|
|
215
|
+
*
|
|
216
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
217
|
+
* @returns Array of Cookie objects that should be sent with the request
|
|
218
|
+
*/
|
|
219
|
+
getCookiesForRequest(requestUrl: string | URL): Cookie[];
|
|
220
|
+
/**
|
|
221
|
+
* Get the Cookie header value for a request URL with proper browser-like matching.
|
|
222
|
+
* Returns cookies in the format: "key1=value1; key2=value2"
|
|
223
|
+
*
|
|
224
|
+
* This is the browser-accurate way to build the Cookie header, properly filtering
|
|
225
|
+
* cookies by domain, path, secure flag, and expiry.
|
|
226
|
+
*
|
|
227
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
228
|
+
* @returns Cookie header string in "key=value; key=value" format
|
|
229
|
+
*/
|
|
230
|
+
getCookieHeader(requestUrl: string | URL): string;
|
|
231
|
+
/**
|
|
232
|
+
* Debug method to show which cookies would be sent for a given URL.
|
|
233
|
+
* Useful for troubleshooting cookie matching issues.
|
|
234
|
+
*
|
|
235
|
+
* @param requestUrl - The full request URL including path
|
|
236
|
+
* @returns Object with matching cookies and the Cookie header that would be sent
|
|
237
|
+
*/
|
|
238
|
+
debugCookiesForRequest(requestUrl: string | URL): {
|
|
239
|
+
url: string;
|
|
240
|
+
matchingCookies: Array<{
|
|
241
|
+
key: string;
|
|
242
|
+
value: string;
|
|
243
|
+
domain: string;
|
|
244
|
+
path: string;
|
|
245
|
+
}>;
|
|
246
|
+
cookieHeader: string;
|
|
247
|
+
allCookies: Array<{
|
|
248
|
+
key: string;
|
|
249
|
+
domain: string;
|
|
250
|
+
path: string;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
208
253
|
setCookiesSync(setCookieArray: string[]): Cookies;
|
|
209
254
|
setCookiesSync(setCookieArray: string[], url: string): Cookies;
|
|
210
255
|
setCookiesSync(cookiesString: string): Cookies;
|
|
@@ -205,6 +205,51 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
205
205
|
toArray(): Cookie[];
|
|
206
206
|
toSetCookies(): string[];
|
|
207
207
|
toSerializedCookies(): SerializedCookie[];
|
|
208
|
+
/**
|
|
209
|
+
* Get cookies for a request URL with proper browser-like matching.
|
|
210
|
+
* This method properly handles:
|
|
211
|
+
* - Domain matching (exact or parent domain)
|
|
212
|
+
* - Path matching (cookie path must be prefix of request path)
|
|
213
|
+
* - Secure flag (secure cookies only over HTTPS)
|
|
214
|
+
* - Expiry (expired cookies not returned)
|
|
215
|
+
*
|
|
216
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
217
|
+
* @returns Array of Cookie objects that should be sent with the request
|
|
218
|
+
*/
|
|
219
|
+
getCookiesForRequest(requestUrl: string | URL): Cookie[];
|
|
220
|
+
/**
|
|
221
|
+
* Get the Cookie header value for a request URL with proper browser-like matching.
|
|
222
|
+
* Returns cookies in the format: "key1=value1; key2=value2"
|
|
223
|
+
*
|
|
224
|
+
* This is the browser-accurate way to build the Cookie header, properly filtering
|
|
225
|
+
* cookies by domain, path, secure flag, and expiry.
|
|
226
|
+
*
|
|
227
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
228
|
+
* @returns Cookie header string in "key=value; key=value" format
|
|
229
|
+
*/
|
|
230
|
+
getCookieHeader(requestUrl: string | URL): string;
|
|
231
|
+
/**
|
|
232
|
+
* Debug method to show which cookies would be sent for a given URL.
|
|
233
|
+
* Useful for troubleshooting cookie matching issues.
|
|
234
|
+
*
|
|
235
|
+
* @param requestUrl - The full request URL including path
|
|
236
|
+
* @returns Object with matching cookies and the Cookie header that would be sent
|
|
237
|
+
*/
|
|
238
|
+
debugCookiesForRequest(requestUrl: string | URL): {
|
|
239
|
+
url: string;
|
|
240
|
+
matchingCookies: Array<{
|
|
241
|
+
key: string;
|
|
242
|
+
value: string;
|
|
243
|
+
domain: string;
|
|
244
|
+
path: string;
|
|
245
|
+
}>;
|
|
246
|
+
cookieHeader: string;
|
|
247
|
+
allCookies: Array<{
|
|
248
|
+
key: string;
|
|
249
|
+
domain: string;
|
|
250
|
+
path: string;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
208
253
|
setCookiesSync(setCookieArray: string[]): Cookies;
|
|
209
254
|
setCookiesSync(setCookieArray: string[], url: string): Cookies;
|
|
210
255
|
setCookiesSync(cookiesString: string): Cookies;
|
|
@@ -205,6 +205,51 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
205
205
|
toArray(): Cookie[];
|
|
206
206
|
toSetCookies(): string[];
|
|
207
207
|
toSerializedCookies(): SerializedCookie[];
|
|
208
|
+
/**
|
|
209
|
+
* Get cookies for a request URL with proper browser-like matching.
|
|
210
|
+
* This method properly handles:
|
|
211
|
+
* - Domain matching (exact or parent domain)
|
|
212
|
+
* - Path matching (cookie path must be prefix of request path)
|
|
213
|
+
* - Secure flag (secure cookies only over HTTPS)
|
|
214
|
+
* - Expiry (expired cookies not returned)
|
|
215
|
+
*
|
|
216
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
217
|
+
* @returns Array of Cookie objects that should be sent with the request
|
|
218
|
+
*/
|
|
219
|
+
getCookiesForRequest(requestUrl: string | URL): Cookie[];
|
|
220
|
+
/**
|
|
221
|
+
* Get the Cookie header value for a request URL with proper browser-like matching.
|
|
222
|
+
* Returns cookies in the format: "key1=value1; key2=value2"
|
|
223
|
+
*
|
|
224
|
+
* This is the browser-accurate way to build the Cookie header, properly filtering
|
|
225
|
+
* cookies by domain, path, secure flag, and expiry.
|
|
226
|
+
*
|
|
227
|
+
* @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
|
|
228
|
+
* @returns Cookie header string in "key=value; key=value" format
|
|
229
|
+
*/
|
|
230
|
+
getCookieHeader(requestUrl: string | URL): string;
|
|
231
|
+
/**
|
|
232
|
+
* Debug method to show which cookies would be sent for a given URL.
|
|
233
|
+
* Useful for troubleshooting cookie matching issues.
|
|
234
|
+
*
|
|
235
|
+
* @param requestUrl - The full request URL including path
|
|
236
|
+
* @returns Object with matching cookies and the Cookie header that would be sent
|
|
237
|
+
*/
|
|
238
|
+
debugCookiesForRequest(requestUrl: string | URL): {
|
|
239
|
+
url: string;
|
|
240
|
+
matchingCookies: Array<{
|
|
241
|
+
key: string;
|
|
242
|
+
value: string;
|
|
243
|
+
domain: string;
|
|
244
|
+
path: string;
|
|
245
|
+
}>;
|
|
246
|
+
cookieHeader: string;
|
|
247
|
+
allCookies: Array<{
|
|
248
|
+
key: string;
|
|
249
|
+
domain: string;
|
|
250
|
+
path: string;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
208
253
|
setCookiesSync(setCookieArray: string[]): Cookies;
|
|
209
254
|
setCookiesSync(setCookieArray: string[], url: string): Cookies;
|
|
210
255
|
setCookiesSync(cookiesString: string): Cookies;
|
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_qsph8l = require('./crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_qsph8l.Crawler;;
|
|
3
|
+
const _mod_zftewn = require('./crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_zftewn.CrawlerOptions;;
|
|
5
|
+
const _mod_qxq0aw = require('../cache/file-cacher.cjs');
|
|
6
|
+
exports.FileCacher = _mod_qxq0aw.FileCacher;;
|
|
7
|
+
const _mod_pi4wi6 = require('../cache/url-store.cjs');
|
|
8
|
+
exports.UrlStore = _mod_pi4wi6.UrlStore;;
|
|
9
|
+
const _mod_4og52u = require('./addon/oxylabs/index.cjs');
|
|
10
|
+
exports.Oxylabs = _mod_4og52u.Oxylabs;;
|
|
11
|
+
const _mod_0yjqp6 = require('./addon/oxylabs/options.cjs');
|
|
12
|
+
exports.OXYLABS_BROWSER_TYPES = _mod_0yjqp6.OXYLABS_BROWSER_TYPES;
|
|
13
|
+
exports.OXYLABS_COMMON_LOCALES = _mod_0yjqp6.OXYLABS_COMMON_LOCALES;
|
|
14
|
+
exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_0yjqp6.OXYLABS_COMMON_GEO_LOCATIONS;
|
|
15
|
+
exports.OXYLABS_US_STATES = _mod_0yjqp6.OXYLABS_US_STATES;
|
|
16
|
+
exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_0yjqp6.OXYLABS_EUROPEAN_COUNTRIES;
|
|
17
|
+
exports.OXYLABS_ASIAN_COUNTRIES = _mod_0yjqp6.OXYLABS_ASIAN_COUNTRIES;
|
|
18
|
+
exports.getRandomOxylabsBrowserType = _mod_0yjqp6.getRandomBrowserType;
|
|
19
|
+
exports.getRandomOxylabsLocale = _mod_0yjqp6.getRandomLocale;
|
|
20
|
+
exports.getRandomOxylabsGeoLocation = _mod_0yjqp6.getRandomGeoLocation;;
|
|
21
|
+
const _mod_5tfgrz = require('./addon/decodo/index.cjs');
|
|
22
|
+
exports.Decodo = _mod_5tfgrz.Decodo;;
|
|
23
|
+
const _mod_elxsmt = require('./addon/decodo/options.cjs');
|
|
24
|
+
exports.DECODO_DEVICE_TYPES = _mod_elxsmt.DECODO_DEVICE_TYPES;
|
|
25
|
+
exports.DECODO_HEADLESS_MODES = _mod_elxsmt.DECODO_HEADLESS_MODES;
|
|
26
|
+
exports.DECODO_COMMON_LOCALES = _mod_elxsmt.DECODO_COMMON_LOCALES;
|
|
27
|
+
exports.DECODO_COMMON_COUNTRIES = _mod_elxsmt.DECODO_COMMON_COUNTRIES;
|
|
28
|
+
exports.DECODO_EUROPEAN_COUNTRIES = _mod_elxsmt.DECODO_EUROPEAN_COUNTRIES;
|
|
29
|
+
exports.DECODO_ASIAN_COUNTRIES = _mod_elxsmt.DECODO_ASIAN_COUNTRIES;
|
|
30
|
+
exports.DECODO_US_STATES = _mod_elxsmt.DECODO_US_STATES;
|
|
31
|
+
exports.DECODO_COMMON_CITIES = _mod_elxsmt.DECODO_COMMON_CITIES;
|
|
32
|
+
exports.getRandomDecodoDeviceType = _mod_elxsmt.getRandomDeviceType;
|
|
33
|
+
exports.getRandomDecodoLocale = _mod_elxsmt.getRandomLocale;
|
|
34
|
+
exports.getRandomDecodoCountry = _mod_elxsmt.getRandomCountry;
|
|
35
|
+
exports.getRandomDecodoCity = _mod_elxsmt.getRandomCity;
|
|
36
|
+
exports.generateDecodoSessionId = _mod_elxsmt.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_1bggjr = require('./manager.cjs');
|
|
5
|
+
exports.ProxyManager = _mod_1bggjr.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_efy9ln = require('./queue.cjs');
|
|
2
|
+
exports.RezoQueue = _mod_efy9ln.RezoQueue;;
|
|
3
|
+
const _mod_3tepao = require('./http-queue.cjs');
|
|
4
|
+
exports.HttpQueue = _mod_3tepao.HttpQueue;
|
|
5
|
+
exports.extractDomain = _mod_3tepao.extractDomain;;
|
|
6
|
+
const _mod_tgx0xy = require('./types.cjs');
|
|
7
|
+
exports.Priority = _mod_tgx0xy.Priority;
|
|
8
|
+
exports.HttpMethodPriority = _mod_tgx0xy.HttpMethodPriority;;
|
package/dist/utils/cookies.cjs
CHANGED
|
@@ -156,6 +156,45 @@ class RezoCookieJar extends TouchCookieJar {
|
|
|
156
156
|
toSerializedCookies() {
|
|
157
157
|
return this.cookies().serialized;
|
|
158
158
|
}
|
|
159
|
+
getCookiesForRequest(requestUrl) {
|
|
160
|
+
try {
|
|
161
|
+
const url = typeof requestUrl === "string" ? new URL(requestUrl) : requestUrl;
|
|
162
|
+
const fullUrl = url.href;
|
|
163
|
+
const cookies = this.getCookiesSync(fullUrl);
|
|
164
|
+
return cookies.map((c) => new Cookie(c));
|
|
165
|
+
} catch (e) {
|
|
166
|
+
return this.cookies().array;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
getCookieHeader(requestUrl) {
|
|
170
|
+
try {
|
|
171
|
+
const url = typeof requestUrl === "string" ? new URL(requestUrl) : requestUrl;
|
|
172
|
+
const fullUrl = url.href;
|
|
173
|
+
return this.getCookieStringSync(fullUrl);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
return "";
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
debugCookiesForRequest(requestUrl) {
|
|
179
|
+
const url = typeof requestUrl === "string" ? requestUrl : requestUrl.href;
|
|
180
|
+
const matching = this.getCookiesForRequest(requestUrl);
|
|
181
|
+
const all = this.cookies().array;
|
|
182
|
+
return {
|
|
183
|
+
url,
|
|
184
|
+
matchingCookies: matching.map((c) => ({
|
|
185
|
+
key: c.key,
|
|
186
|
+
value: c.value,
|
|
187
|
+
domain: c.domain || "",
|
|
188
|
+
path: c.path || "/"
|
|
189
|
+
})),
|
|
190
|
+
cookieHeader: this.getCookieHeader(requestUrl),
|
|
191
|
+
allCookies: all.map((c) => ({
|
|
192
|
+
key: c.key,
|
|
193
|
+
domain: c.domain || "",
|
|
194
|
+
path: c.path || "/"
|
|
195
|
+
}))
|
|
196
|
+
};
|
|
197
|
+
}
|
|
159
198
|
setCookiesSync(cookiesData, url) {
|
|
160
199
|
const cookies = [];
|
|
161
200
|
if (Array.isArray(cookiesData)) {
|
package/dist/utils/cookies.js
CHANGED
|
@@ -156,6 +156,45 @@ export class RezoCookieJar extends TouchCookieJar {
|
|
|
156
156
|
toSerializedCookies() {
|
|
157
157
|
return this.cookies().serialized;
|
|
158
158
|
}
|
|
159
|
+
getCookiesForRequest(requestUrl) {
|
|
160
|
+
try {
|
|
161
|
+
const url = typeof requestUrl === "string" ? new URL(requestUrl) : requestUrl;
|
|
162
|
+
const fullUrl = url.href;
|
|
163
|
+
const cookies = this.getCookiesSync(fullUrl);
|
|
164
|
+
return cookies.map((c) => new Cookie(c));
|
|
165
|
+
} catch (e) {
|
|
166
|
+
return this.cookies().array;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
getCookieHeader(requestUrl) {
|
|
170
|
+
try {
|
|
171
|
+
const url = typeof requestUrl === "string" ? new URL(requestUrl) : requestUrl;
|
|
172
|
+
const fullUrl = url.href;
|
|
173
|
+
return this.getCookieStringSync(fullUrl);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
return "";
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
debugCookiesForRequest(requestUrl) {
|
|
179
|
+
const url = typeof requestUrl === "string" ? requestUrl : requestUrl.href;
|
|
180
|
+
const matching = this.getCookiesForRequest(requestUrl);
|
|
181
|
+
const all = this.cookies().array;
|
|
182
|
+
return {
|
|
183
|
+
url,
|
|
184
|
+
matchingCookies: matching.map((c) => ({
|
|
185
|
+
key: c.key,
|
|
186
|
+
value: c.value,
|
|
187
|
+
domain: c.domain || "",
|
|
188
|
+
path: c.path || "/"
|
|
189
|
+
})),
|
|
190
|
+
cookieHeader: this.getCookieHeader(requestUrl),
|
|
191
|
+
allCookies: all.map((c) => ({
|
|
192
|
+
key: c.key,
|
|
193
|
+
domain: c.domain || "",
|
|
194
|
+
path: c.path || "/"
|
|
195
|
+
}))
|
|
196
|
+
};
|
|
197
|
+
}
|
|
159
198
|
setCookiesSync(cookiesData, url) {
|
|
160
199
|
const cookies = [];
|
|
161
200
|
if (Array.isArray(cookiesData)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { RezoCookieJar } = require('./cookies.cjs');
|
|
2
2
|
const RezoFormData = require('./form-data.cjs');
|
|
3
3
|
const { RezoHeaders } = require('./headers.cjs');
|
|
4
4
|
const { RezoURLSearchParams } = require('./data-operations.cjs');
|
|
@@ -268,11 +268,23 @@ function prepareHTTPOptions(options, jar, addedOptions, config) {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
const resolvedUrl = fetchOptions.url || options.url;
|
|
271
|
-
|
|
271
|
+
let cookieUrl;
|
|
272
|
+
if (resolvedUrl instanceof URL) {
|
|
273
|
+
cookieUrl = resolvedUrl.href;
|
|
274
|
+
} else if (typeof resolvedUrl === "string") {
|
|
275
|
+
try {
|
|
276
|
+
const parsed = new URL(resolvedUrl);
|
|
277
|
+
cookieUrl = parsed.href;
|
|
278
|
+
} catch {
|
|
279
|
+
cookieUrl = resolvedUrl;
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
cookieUrl = String(resolvedUrl);
|
|
283
|
+
}
|
|
272
284
|
let cookiesString = "";
|
|
273
285
|
if (config.useCookies) {
|
|
274
|
-
requestCookies = cookieJar.
|
|
275
|
-
cookiesString = cookieJar.
|
|
286
|
+
requestCookies = cookieJar.getCookiesForRequest(cookieUrl);
|
|
287
|
+
cookiesString = cookieJar.getCookieHeader(cookieUrl);
|
|
276
288
|
}
|
|
277
289
|
if (options.xsrfCookieName && options.xsrfHeaderName && requestCookies.length > 0) {
|
|
278
290
|
const xsrfCookie = requestCookies.find((c) => c.key === options.xsrfCookieName);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RezoCookieJar } from './cookies.js';
|
|
2
2
|
import RezoFormData from './form-data.js';
|
|
3
3
|
import { RezoHeaders } from './headers.js';
|
|
4
4
|
import { RezoURLSearchParams } from './data-operations.js';
|
|
@@ -268,11 +268,23 @@ export function prepareHTTPOptions(options, jar, addedOptions, config) {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
const resolvedUrl = fetchOptions.url || options.url;
|
|
271
|
-
|
|
271
|
+
let cookieUrl;
|
|
272
|
+
if (resolvedUrl instanceof URL) {
|
|
273
|
+
cookieUrl = resolvedUrl.href;
|
|
274
|
+
} else if (typeof resolvedUrl === "string") {
|
|
275
|
+
try {
|
|
276
|
+
const parsed = new URL(resolvedUrl);
|
|
277
|
+
cookieUrl = parsed.href;
|
|
278
|
+
} catch {
|
|
279
|
+
cookieUrl = resolvedUrl;
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
cookieUrl = String(resolvedUrl);
|
|
283
|
+
}
|
|
272
284
|
let cookiesString = "";
|
|
273
285
|
if (config.useCookies) {
|
|
274
|
-
requestCookies = cookieJar.
|
|
275
|
-
cookiesString = cookieJar.
|
|
286
|
+
requestCookies = cookieJar.getCookiesForRequest(cookieUrl);
|
|
287
|
+
cookiesString = cookieJar.getCookieHeader(cookieUrl);
|
|
276
288
|
}
|
|
277
289
|
if (options.xsrfCookieName && options.xsrfHeaderName && requestCookies.length > 0) {
|
|
278
290
|
const xsrfCookie = requestCookies.find((c) => c.key === options.xsrfCookieName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rezo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
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",
|