rezo 1.0.26 → 1.0.27

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.
@@ -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;
@@ -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;
@@ -183,7 +183,7 @@ async function parseCookiesFromHeaders(headers, url, config) {
183
183
  } else {
184
184
  acceptedCookies.push(...parsedCookies.array);
185
185
  }
186
- const acceptedCookieStrings = acceptedCookies.map((c) => c.cookieString());
186
+ const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
187
187
  const jar = new RezoCookieJar;
188
188
  jar.setCookiesSync(acceptedCookieStrings, url);
189
189
  if (config?.enableCookieJar && config?.cookieJar) {
@@ -183,7 +183,7 @@ async function parseCookiesFromHeaders(headers, url, config) {
183
183
  } else {
184
184
  acceptedCookies.push(...parsedCookies.array);
185
185
  }
186
- const acceptedCookieStrings = acceptedCookies.map((c) => c.cookieString());
186
+ const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
187
187
  const jar = new RezoCookieJar;
188
188
  jar.setCookiesSync(acceptedCookieStrings, url);
189
189
  if (config?.enableCookieJar && config?.cookieJar) {
@@ -1482,7 +1482,7 @@ async function updateCookies(config, headers, url) {
1482
1482
  } else {
1483
1483
  acceptedCookies.push(...parsedCookies.array);
1484
1484
  }
1485
- const acceptedCookieStrings = acceptedCookies.map((c) => c.cookieString());
1485
+ const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
1486
1486
  if (config.enableCookieJar && config.cookieJar) {
1487
1487
  config.cookieJar.setCookiesSync(acceptedCookieStrings, url);
1488
1488
  }
@@ -1482,7 +1482,7 @@ async function updateCookies(config, headers, url) {
1482
1482
  } else {
1483
1483
  acceptedCookies.push(...parsedCookies.array);
1484
1484
  }
1485
- const acceptedCookieStrings = acceptedCookies.map((c) => c.cookieString());
1485
+ const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
1486
1486
  if (config.enableCookieJar && config.cookieJar) {
1487
1487
  config.cookieJar.setCookiesSync(acceptedCookieStrings, url);
1488
1488
  }
@@ -341,7 +341,7 @@ async function updateCookies(config, headers, url) {
341
341
  } else {
342
342
  acceptedCookies.push(...parsedCookies.array);
343
343
  }
344
- const acceptedCookieStrings = acceptedCookies.map((c) => c.cookieString());
344
+ const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
345
345
  const jar = new RezoCookieJar;
346
346
  jar.setCookiesSync(acceptedCookieStrings, url);
347
347
  if (config.enableCookieJar && config.cookieJar) {
@@ -341,7 +341,7 @@ async function updateCookies(config, headers, url) {
341
341
  } else {
342
342
  acceptedCookies.push(...parsedCookies.array);
343
343
  }
344
- const acceptedCookieStrings = acceptedCookies.map((c) => c.cookieString());
344
+ const acceptedCookieStrings = acceptedCookies.map((c) => c.toSetCookieString());
345
345
  const jar = new RezoCookieJar;
346
346
  jar.setCookiesSync(acceptedCookieStrings, url);
347
347
  if (config.enableCookieJar && config.cookieJar) {
@@ -1,6 +1,6 @@
1
- const _mod_o7l274 = require('./picker.cjs');
2
- exports.detectRuntime = _mod_o7l274.detectRuntime;
3
- exports.getAdapterCapabilities = _mod_o7l274.getAdapterCapabilities;
4
- exports.buildAdapterContext = _mod_o7l274.buildAdapterContext;
5
- exports.getAvailableAdapters = _mod_o7l274.getAvailableAdapters;
6
- exports.selectAdapter = _mod_o7l274.selectAdapter;;
1
+ const _mod_c82agb = require('./picker.cjs');
2
+ exports.detectRuntime = _mod_c82agb.detectRuntime;
3
+ exports.getAdapterCapabilities = _mod_c82agb.getAdapterCapabilities;
4
+ exports.buildAdapterContext = _mod_c82agb.buildAdapterContext;
5
+ exports.getAvailableAdapters = _mod_c82agb.getAvailableAdapters;
6
+ exports.selectAdapter = _mod_c82agb.selectAdapter;;
@@ -1,13 +1,13 @@
1
- const _mod_5btjkv = require('./lru-cache.cjs');
2
- exports.LRUCache = _mod_5btjkv.LRUCache;;
3
- const _mod_mpluoa = require('./dns-cache.cjs');
4
- exports.DNSCache = _mod_mpluoa.DNSCache;
5
- exports.getGlobalDNSCache = _mod_mpluoa.getGlobalDNSCache;
6
- exports.resetGlobalDNSCache = _mod_mpluoa.resetGlobalDNSCache;;
7
- const _mod_j0a64m = require('./response-cache.cjs');
8
- exports.ResponseCache = _mod_j0a64m.ResponseCache;
9
- exports.normalizeResponseCacheConfig = _mod_j0a64m.normalizeResponseCacheConfig;;
10
- const _mod_rrkz86 = require('./file-cacher.cjs');
11
- exports.FileCacher = _mod_rrkz86.FileCacher;;
12
- const _mod_r38vpf = require('./url-store.cjs');
13
- exports.UrlStore = _mod_r38vpf.UrlStore;;
1
+ const _mod_wg0295 = require('./lru-cache.cjs');
2
+ exports.LRUCache = _mod_wg0295.LRUCache;;
3
+ const _mod_udgn2v = require('./dns-cache.cjs');
4
+ exports.DNSCache = _mod_udgn2v.DNSCache;
5
+ exports.getGlobalDNSCache = _mod_udgn2v.getGlobalDNSCache;
6
+ exports.resetGlobalDNSCache = _mod_udgn2v.resetGlobalDNSCache;;
7
+ const _mod_6kolan = require('./response-cache.cjs');
8
+ exports.ResponseCache = _mod_6kolan.ResponseCache;
9
+ exports.normalizeResponseCacheConfig = _mod_6kolan.normalizeResponseCacheConfig;;
10
+ const _mod_pl3tv0 = require('./file-cacher.cjs');
11
+ exports.FileCacher = _mod_pl3tv0.FileCacher;;
12
+ const _mod_zya6gr = require('./url-store.cjs');
13
+ exports.UrlStore = _mod_zya6gr.UrlStore;;
package/dist/crawler.d.ts CHANGED
@@ -428,6 +428,51 @@ declare class RezoCookieJar extends TouchCookieJar {
428
428
  toArray(): Cookie[];
429
429
  toSetCookies(): string[];
430
430
  toSerializedCookies(): SerializedCookie[];
431
+ /**
432
+ * Get cookies for a request URL with proper browser-like matching.
433
+ * This method properly handles:
434
+ * - Domain matching (exact or parent domain)
435
+ * - Path matching (cookie path must be prefix of request path)
436
+ * - Secure flag (secure cookies only over HTTPS)
437
+ * - Expiry (expired cookies not returned)
438
+ *
439
+ * @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
440
+ * @returns Array of Cookie objects that should be sent with the request
441
+ */
442
+ getCookiesForRequest(requestUrl: string | URL): Cookie[];
443
+ /**
444
+ * Get the Cookie header value for a request URL with proper browser-like matching.
445
+ * Returns cookies in the format: "key1=value1; key2=value2"
446
+ *
447
+ * This is the browser-accurate way to build the Cookie header, properly filtering
448
+ * cookies by domain, path, secure flag, and expiry.
449
+ *
450
+ * @param requestUrl - The full request URL including path (e.g., 'https://example.com/api/users')
451
+ * @returns Cookie header string in "key=value; key=value" format
452
+ */
453
+ getCookieHeader(requestUrl: string | URL): string;
454
+ /**
455
+ * Debug method to show which cookies would be sent for a given URL.
456
+ * Useful for troubleshooting cookie matching issues.
457
+ *
458
+ * @param requestUrl - The full request URL including path
459
+ * @returns Object with matching cookies and the Cookie header that would be sent
460
+ */
461
+ debugCookiesForRequest(requestUrl: string | URL): {
462
+ url: string;
463
+ matchingCookies: Array<{
464
+ key: string;
465
+ value: string;
466
+ domain: string;
467
+ path: string;
468
+ }>;
469
+ cookieHeader: string;
470
+ allCookies: Array<{
471
+ key: string;
472
+ domain: string;
473
+ path: string;
474
+ }>;
475
+ };
431
476
  setCookiesSync(setCookieArray: string[]): Cookies;
432
477
  setCookiesSync(setCookieArray: string[], url: string): Cookies;
433
478
  setCookiesSync(cookiesString: string): Cookies;
@@ -1,5 +1,5 @@
1
- const _mod_i5eyqo = require('../plugin/crawler.cjs');
2
- exports.Crawler = _mod_i5eyqo.Crawler;;
3
- const _mod_23z5l6 = require('../plugin/crawler-options.cjs');
4
- exports.CrawlerOptions = _mod_23z5l6.CrawlerOptions;
5
- exports.Domain = _mod_23z5l6.Domain;;
1
+ const _mod_lymkfq = require('../plugin/crawler.cjs');
2
+ exports.Crawler = _mod_lymkfq.Crawler;;
3
+ const _mod_kvs0ei = require('../plugin/crawler-options.cjs');
4
+ exports.CrawlerOptions = _mod_kvs0ei.CrawlerOptions;
5
+ exports.Domain = _mod_kvs0ei.Domain;;
package/dist/index.cjs CHANGED
@@ -1,27 +1,27 @@
1
- const _mod_8s1u6r = require('./core/rezo.cjs');
2
- exports.Rezo = _mod_8s1u6r.Rezo;
3
- exports.createRezoInstance = _mod_8s1u6r.createRezoInstance;
4
- exports.createDefaultInstance = _mod_8s1u6r.createDefaultInstance;;
5
- const _mod_5xnerq = require('./errors/rezo-error.cjs');
6
- exports.RezoError = _mod_5xnerq.RezoError;
7
- exports.RezoErrorCode = _mod_5xnerq.RezoErrorCode;;
8
- const _mod_u1yvbk = require('./utils/headers.cjs');
9
- exports.RezoHeaders = _mod_u1yvbk.RezoHeaders;;
10
- const _mod_74a3gc = require('./utils/form-data.cjs');
11
- exports.RezoFormData = _mod_74a3gc.RezoFormData;;
12
- const _mod_q9jplq = require('./utils/cookies.cjs');
13
- exports.RezoCookieJar = _mod_q9jplq.RezoCookieJar;
14
- exports.Cookie = _mod_q9jplq.Cookie;;
15
- const _mod_8lz5zg = require('./core/hooks.cjs');
16
- exports.createDefaultHooks = _mod_8lz5zg.createDefaultHooks;
17
- exports.mergeHooks = _mod_8lz5zg.mergeHooks;;
18
- const _mod_o4hztx = require('./proxy/manager.cjs');
19
- exports.ProxyManager = _mod_o4hztx.ProxyManager;;
20
- const _mod_2wo2pr = require('./queue/index.cjs');
21
- exports.RezoQueue = _mod_2wo2pr.RezoQueue;
22
- exports.HttpQueue = _mod_2wo2pr.HttpQueue;
23
- exports.Priority = _mod_2wo2pr.Priority;
24
- exports.HttpMethodPriority = _mod_2wo2pr.HttpMethodPriority;;
1
+ const _mod_lyypom = require('./core/rezo.cjs');
2
+ exports.Rezo = _mod_lyypom.Rezo;
3
+ exports.createRezoInstance = _mod_lyypom.createRezoInstance;
4
+ exports.createDefaultInstance = _mod_lyypom.createDefaultInstance;;
5
+ const _mod_z2q5wr = require('./errors/rezo-error.cjs');
6
+ exports.RezoError = _mod_z2q5wr.RezoError;
7
+ exports.RezoErrorCode = _mod_z2q5wr.RezoErrorCode;;
8
+ const _mod_qyu99x = require('./utils/headers.cjs');
9
+ exports.RezoHeaders = _mod_qyu99x.RezoHeaders;;
10
+ const _mod_z17ic3 = require('./utils/form-data.cjs');
11
+ exports.RezoFormData = _mod_z17ic3.RezoFormData;;
12
+ const _mod_2sml8j = require('./utils/cookies.cjs');
13
+ exports.RezoCookieJar = _mod_2sml8j.RezoCookieJar;
14
+ exports.Cookie = _mod_2sml8j.Cookie;;
15
+ const _mod_vuhwqj = require('./core/hooks.cjs');
16
+ exports.createDefaultHooks = _mod_vuhwqj.createDefaultHooks;
17
+ exports.mergeHooks = _mod_vuhwqj.mergeHooks;;
18
+ const _mod_srexi8 = require('./proxy/manager.cjs');
19
+ exports.ProxyManager = _mod_srexi8.ProxyManager;;
20
+ const _mod_p29w3c = require('./queue/index.cjs');
21
+ exports.RezoQueue = _mod_p29w3c.RezoQueue;
22
+ exports.HttpQueue = _mod_p29w3c.HttpQueue;
23
+ exports.Priority = _mod_p29w3c.Priority;
24
+ exports.HttpMethodPriority = _mod_p29w3c.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
@@ -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;
@@ -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;
@@ -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;
@@ -1,36 +1,36 @@
1
- const _mod_9ihf6y = require('./crawler.cjs');
2
- exports.Crawler = _mod_9ihf6y.Crawler;;
3
- const _mod_il96ln = require('./crawler-options.cjs');
4
- exports.CrawlerOptions = _mod_il96ln.CrawlerOptions;;
5
- const _mod_4jfja2 = require('../cache/file-cacher.cjs');
6
- exports.FileCacher = _mod_4jfja2.FileCacher;;
7
- const _mod_fjusao = require('../cache/url-store.cjs');
8
- exports.UrlStore = _mod_fjusao.UrlStore;;
9
- const _mod_8vdehu = require('./addon/oxylabs/index.cjs');
10
- exports.Oxylabs = _mod_8vdehu.Oxylabs;;
11
- const _mod_m21nvo = require('./addon/oxylabs/options.cjs');
12
- exports.OXYLABS_BROWSER_TYPES = _mod_m21nvo.OXYLABS_BROWSER_TYPES;
13
- exports.OXYLABS_COMMON_LOCALES = _mod_m21nvo.OXYLABS_COMMON_LOCALES;
14
- exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_m21nvo.OXYLABS_COMMON_GEO_LOCATIONS;
15
- exports.OXYLABS_US_STATES = _mod_m21nvo.OXYLABS_US_STATES;
16
- exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_m21nvo.OXYLABS_EUROPEAN_COUNTRIES;
17
- exports.OXYLABS_ASIAN_COUNTRIES = _mod_m21nvo.OXYLABS_ASIAN_COUNTRIES;
18
- exports.getRandomOxylabsBrowserType = _mod_m21nvo.getRandomBrowserType;
19
- exports.getRandomOxylabsLocale = _mod_m21nvo.getRandomLocale;
20
- exports.getRandomOxylabsGeoLocation = _mod_m21nvo.getRandomGeoLocation;;
21
- const _mod_lfchws = require('./addon/decodo/index.cjs');
22
- exports.Decodo = _mod_lfchws.Decodo;;
23
- const _mod_2fmvy3 = require('./addon/decodo/options.cjs');
24
- exports.DECODO_DEVICE_TYPES = _mod_2fmvy3.DECODO_DEVICE_TYPES;
25
- exports.DECODO_HEADLESS_MODES = _mod_2fmvy3.DECODO_HEADLESS_MODES;
26
- exports.DECODO_COMMON_LOCALES = _mod_2fmvy3.DECODO_COMMON_LOCALES;
27
- exports.DECODO_COMMON_COUNTRIES = _mod_2fmvy3.DECODO_COMMON_COUNTRIES;
28
- exports.DECODO_EUROPEAN_COUNTRIES = _mod_2fmvy3.DECODO_EUROPEAN_COUNTRIES;
29
- exports.DECODO_ASIAN_COUNTRIES = _mod_2fmvy3.DECODO_ASIAN_COUNTRIES;
30
- exports.DECODO_US_STATES = _mod_2fmvy3.DECODO_US_STATES;
31
- exports.DECODO_COMMON_CITIES = _mod_2fmvy3.DECODO_COMMON_CITIES;
32
- exports.getRandomDecodoDeviceType = _mod_2fmvy3.getRandomDeviceType;
33
- exports.getRandomDecodoLocale = _mod_2fmvy3.getRandomLocale;
34
- exports.getRandomDecodoCountry = _mod_2fmvy3.getRandomCountry;
35
- exports.getRandomDecodoCity = _mod_2fmvy3.getRandomCity;
36
- exports.generateDecodoSessionId = _mod_2fmvy3.generateSessionId;;
1
+ const _mod_5rfty9 = require('./crawler.cjs');
2
+ exports.Crawler = _mod_5rfty9.Crawler;;
3
+ const _mod_q2p8s0 = require('./crawler-options.cjs');
4
+ exports.CrawlerOptions = _mod_q2p8s0.CrawlerOptions;;
5
+ const _mod_7r8b7r = require('../cache/file-cacher.cjs');
6
+ exports.FileCacher = _mod_7r8b7r.FileCacher;;
7
+ const _mod_sftl5f = require('../cache/url-store.cjs');
8
+ exports.UrlStore = _mod_sftl5f.UrlStore;;
9
+ const _mod_unhfzc = require('./addon/oxylabs/index.cjs');
10
+ exports.Oxylabs = _mod_unhfzc.Oxylabs;;
11
+ const _mod_rvlmj1 = require('./addon/oxylabs/options.cjs');
12
+ exports.OXYLABS_BROWSER_TYPES = _mod_rvlmj1.OXYLABS_BROWSER_TYPES;
13
+ exports.OXYLABS_COMMON_LOCALES = _mod_rvlmj1.OXYLABS_COMMON_LOCALES;
14
+ exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_rvlmj1.OXYLABS_COMMON_GEO_LOCATIONS;
15
+ exports.OXYLABS_US_STATES = _mod_rvlmj1.OXYLABS_US_STATES;
16
+ exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_rvlmj1.OXYLABS_EUROPEAN_COUNTRIES;
17
+ exports.OXYLABS_ASIAN_COUNTRIES = _mod_rvlmj1.OXYLABS_ASIAN_COUNTRIES;
18
+ exports.getRandomOxylabsBrowserType = _mod_rvlmj1.getRandomBrowserType;
19
+ exports.getRandomOxylabsLocale = _mod_rvlmj1.getRandomLocale;
20
+ exports.getRandomOxylabsGeoLocation = _mod_rvlmj1.getRandomGeoLocation;;
21
+ const _mod_ue1bzq = require('./addon/decodo/index.cjs');
22
+ exports.Decodo = _mod_ue1bzq.Decodo;;
23
+ const _mod_897fd1 = require('./addon/decodo/options.cjs');
24
+ exports.DECODO_DEVICE_TYPES = _mod_897fd1.DECODO_DEVICE_TYPES;
25
+ exports.DECODO_HEADLESS_MODES = _mod_897fd1.DECODO_HEADLESS_MODES;
26
+ exports.DECODO_COMMON_LOCALES = _mod_897fd1.DECODO_COMMON_LOCALES;
27
+ exports.DECODO_COMMON_COUNTRIES = _mod_897fd1.DECODO_COMMON_COUNTRIES;
28
+ exports.DECODO_EUROPEAN_COUNTRIES = _mod_897fd1.DECODO_EUROPEAN_COUNTRIES;
29
+ exports.DECODO_ASIAN_COUNTRIES = _mod_897fd1.DECODO_ASIAN_COUNTRIES;
30
+ exports.DECODO_US_STATES = _mod_897fd1.DECODO_US_STATES;
31
+ exports.DECODO_COMMON_CITIES = _mod_897fd1.DECODO_COMMON_CITIES;
32
+ exports.getRandomDecodoDeviceType = _mod_897fd1.getRandomDeviceType;
33
+ exports.getRandomDecodoLocale = _mod_897fd1.getRandomLocale;
34
+ exports.getRandomDecodoCountry = _mod_897fd1.getRandomCountry;
35
+ exports.getRandomDecodoCity = _mod_897fd1.getRandomCity;
36
+ exports.generateDecodoSessionId = _mod_897fd1.generateSessionId;;
@@ -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 _mod_ocud4i = require('./manager.cjs');
5
- exports.ProxyManager = _mod_ocud4i.ProxyManager;;
4
+ const _mod_xspbrb = require('./manager.cjs');
5
+ exports.ProxyManager = _mod_xspbrb.ProxyManager;;
6
6
  function createOptions(uri, opts) {
7
7
  if (uri instanceof URL || typeof uri === "string") {
8
8
  return {
@@ -1,8 +1,8 @@
1
- const _mod_efs8gf = require('./queue.cjs');
2
- exports.RezoQueue = _mod_efs8gf.RezoQueue;;
3
- const _mod_jx0qzm = require('./http-queue.cjs');
4
- exports.HttpQueue = _mod_jx0qzm.HttpQueue;
5
- exports.extractDomain = _mod_jx0qzm.extractDomain;;
6
- const _mod_r67ygd = require('./types.cjs');
7
- exports.Priority = _mod_r67ygd.Priority;
8
- exports.HttpMethodPriority = _mod_r67ygd.HttpMethodPriority;;
1
+ const _mod_gkacib = require('./queue.cjs');
2
+ exports.RezoQueue = _mod_gkacib.RezoQueue;;
3
+ const _mod_3w4xq6 = require('./http-queue.cjs');
4
+ exports.HttpQueue = _mod_3w4xq6.HttpQueue;
5
+ exports.extractDomain = _mod_3w4xq6.extractDomain;;
6
+ const _mod_5dkbxw = require('./types.cjs');
7
+ exports.Priority = _mod_5dkbxw.Priority;
8
+ exports.HttpMethodPriority = _mod_5dkbxw.HttpMethodPriority;;
@@ -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)) {
@@ -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 { Cookie, RezoCookieJar } = require('./cookies.cjs');
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
- const cookieUrl = resolvedUrl instanceof URL ? resolvedUrl.href : resolvedUrl;
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.getCookiesSync(cookieUrl).map((c) => new Cookie(c));
275
- cookiesString = cookieJar.getCookieStringSync(cookieUrl);
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 { Cookie, RezoCookieJar } from './cookies.js';
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
- const cookieUrl = resolvedUrl instanceof URL ? resolvedUrl.href : resolvedUrl;
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.getCookiesSync(cookieUrl).map((c) => new Cookie(c));
275
- cookiesString = cookieJar.getCookieStringSync(cookieUrl);
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.26",
3
+ "version": "1.0.27",
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",