rezo 1.0.13 → 1.0.15
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 +16 -12
- package/dist/adapters/curl.js +16 -12
- package/dist/adapters/entries/curl.d.ts +32 -4
- package/dist/adapters/entries/fetch.d.ts +32 -4
- package/dist/adapters/entries/http.d.ts +32 -4
- package/dist/adapters/entries/http2.d.ts +32 -4
- package/dist/adapters/entries/react-native.d.ts +32 -4
- package/dist/adapters/entries/xhr.d.ts +32 -4
- package/dist/adapters/fetch.cjs +24 -1
- package/dist/adapters/fetch.js +24 -1
- package/dist/adapters/http.cjs +23 -0
- package/dist/adapters/http.js +23 -0
- package/dist/adapters/http2.cjs +24 -1
- package/dist/adapters/http2.js +24 -1
- package/dist/adapters/index.cjs +6 -6
- package/dist/adapters/picker.cjs +1 -1
- package/dist/adapters/picker.js +1 -1
- package/dist/cache/index.cjs +13 -13
- package/dist/core/rezo.cjs +29 -8
- package/dist/core/rezo.js +29 -8
- package/dist/crawler.d.ts +32 -4
- package/dist/entries/crawler.cjs +5 -5
- package/dist/index.cjs +24 -24
- package/dist/index.d.ts +32 -4
- package/dist/platform/browser.d.ts +32 -4
- package/dist/platform/bun.d.ts +32 -4
- package/dist/platform/deno.d.ts +32 -4
- package/dist/platform/node.d.ts +32 -4
- package/dist/platform/react-native.d.ts +32 -4
- package/dist/platform/worker.d.ts +32 -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 +64 -7
- package/dist/utils/form-data.js +64 -7
- package/dist/utils/http-config.cjs +1 -1
- package/dist/utils/http-config.js +1 -1
- package/package.json +1 -1
package/dist/adapters/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.detectRuntime =
|
|
3
|
-
exports.getAdapterCapabilities =
|
|
4
|
-
exports.buildAdapterContext =
|
|
5
|
-
exports.getAvailableAdapters =
|
|
6
|
-
exports.selectAdapter =
|
|
1
|
+
const _mod_58re9h = require('./picker.cjs');
|
|
2
|
+
exports.detectRuntime = _mod_58re9h.detectRuntime;
|
|
3
|
+
exports.getAdapterCapabilities = _mod_58re9h.getAdapterCapabilities;
|
|
4
|
+
exports.buildAdapterContext = _mod_58re9h.buildAdapterContext;
|
|
5
|
+
exports.getAvailableAdapters = _mod_58re9h.getAvailableAdapters;
|
|
6
|
+
exports.selectAdapter = _mod_58re9h.selectAdapter;;
|
package/dist/adapters/picker.cjs
CHANGED
|
@@ -133,7 +133,7 @@ function getAdapterCapabilities(adapter) {
|
|
|
133
133
|
function buildAdapterContext(options, defaultOptions) {
|
|
134
134
|
const internal = options;
|
|
135
135
|
return {
|
|
136
|
-
needsCookies: !!(options.
|
|
136
|
+
needsCookies: !!(options.jar || defaultOptions.jar),
|
|
137
137
|
needsProxy: !!options.proxy,
|
|
138
138
|
needsStreaming: !!internal._isStream,
|
|
139
139
|
needsHttp2: false,
|
package/dist/adapters/picker.js
CHANGED
|
@@ -133,7 +133,7 @@ export function getAdapterCapabilities(adapter) {
|
|
|
133
133
|
export function buildAdapterContext(options, defaultOptions) {
|
|
134
134
|
const internal = options;
|
|
135
135
|
return {
|
|
136
|
-
needsCookies: !!(options.
|
|
136
|
+
needsCookies: !!(options.jar || defaultOptions.jar),
|
|
137
137
|
needsProxy: !!options.proxy,
|
|
138
138
|
needsStreaming: !!internal._isStream,
|
|
139
139
|
needsHttp2: false,
|
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_4clxtx = require('./lru-cache.cjs');
|
|
2
|
+
exports.LRUCache = _mod_4clxtx.LRUCache;;
|
|
3
|
+
const _mod_8thcxt = require('./dns-cache.cjs');
|
|
4
|
+
exports.DNSCache = _mod_8thcxt.DNSCache;
|
|
5
|
+
exports.getGlobalDNSCache = _mod_8thcxt.getGlobalDNSCache;
|
|
6
|
+
exports.resetGlobalDNSCache = _mod_8thcxt.resetGlobalDNSCache;;
|
|
7
|
+
const _mod_k4qt4t = require('./response-cache.cjs');
|
|
8
|
+
exports.ResponseCache = _mod_k4qt4t.ResponseCache;
|
|
9
|
+
exports.normalizeResponseCacheConfig = _mod_k4qt4t.normalizeResponseCacheConfig;;
|
|
10
|
+
const _mod_7l7g18 = require('./file-cacher.cjs');
|
|
11
|
+
exports.FileCacher = _mod_7l7g18.FileCacher;;
|
|
12
|
+
const _mod_x7x6qu = require('./url-store.cjs');
|
|
13
|
+
exports.UrlStore = _mod_x7x6qu.UrlStore;;
|
package/dist/core/rezo.cjs
CHANGED
|
@@ -49,8 +49,8 @@ class Rezo {
|
|
|
49
49
|
}
|
|
50
50
|
this.adapter = adapter || globalAdapter;
|
|
51
51
|
this.defaults = config || {};
|
|
52
|
-
if (config?.
|
|
53
|
-
this.jar = config.
|
|
52
|
+
if (config?.jar instanceof RezoCookieJar) {
|
|
53
|
+
this.jar = config.jar;
|
|
54
54
|
} else if (config?.cookieFile) {
|
|
55
55
|
this.jar = RezoCookieJar.fromFile(config.cookieFile);
|
|
56
56
|
} else {
|
|
@@ -176,11 +176,18 @@ class Rezo {
|
|
|
176
176
|
}, this.defaults, this.jar);
|
|
177
177
|
};
|
|
178
178
|
postMultipart = async (url, data, options = {}) => {
|
|
179
|
-
|
|
179
|
+
let formData;
|
|
180
|
+
if (data instanceof RezoFormData) {
|
|
181
|
+
formData = data;
|
|
182
|
+
} else if (data instanceof FormData) {
|
|
183
|
+
formData = await RezoFormData.fromNativeFormData(data);
|
|
184
|
+
} else {
|
|
185
|
+
formData = RezoFormData.fromObject(data);
|
|
186
|
+
}
|
|
180
187
|
return this.executeRequest({
|
|
181
188
|
...options,
|
|
182
189
|
url,
|
|
183
|
-
formData
|
|
190
|
+
formData,
|
|
184
191
|
method: "POST"
|
|
185
192
|
}, this.defaults, this.jar);
|
|
186
193
|
};
|
|
@@ -217,11 +224,18 @@ class Rezo {
|
|
|
217
224
|
}, this.defaults, this.jar);
|
|
218
225
|
};
|
|
219
226
|
putMultipart = async (url, data, options = {}) => {
|
|
220
|
-
|
|
227
|
+
let formData;
|
|
228
|
+
if (data instanceof RezoFormData) {
|
|
229
|
+
formData = data;
|
|
230
|
+
} else if (data instanceof FormData) {
|
|
231
|
+
formData = await RezoFormData.fromNativeFormData(data);
|
|
232
|
+
} else {
|
|
233
|
+
formData = RezoFormData.fromObject(data);
|
|
234
|
+
}
|
|
221
235
|
return this.executeRequest({
|
|
222
236
|
...options,
|
|
223
237
|
url,
|
|
224
|
-
formData
|
|
238
|
+
formData,
|
|
225
239
|
method: "PUT"
|
|
226
240
|
}, this.defaults, this.jar);
|
|
227
241
|
};
|
|
@@ -258,11 +272,18 @@ class Rezo {
|
|
|
258
272
|
}, this.defaults, this.jar);
|
|
259
273
|
};
|
|
260
274
|
patchMultipart = async (url, data, options = {}) => {
|
|
261
|
-
|
|
275
|
+
let formData;
|
|
276
|
+
if (data instanceof RezoFormData) {
|
|
277
|
+
formData = data;
|
|
278
|
+
} else if (data instanceof FormData) {
|
|
279
|
+
formData = await RezoFormData.fromNativeFormData(data);
|
|
280
|
+
} else {
|
|
281
|
+
formData = RezoFormData.fromObject(data);
|
|
282
|
+
}
|
|
262
283
|
return this.executeRequest({
|
|
263
284
|
...options,
|
|
264
285
|
url,
|
|
265
|
-
formData
|
|
286
|
+
formData,
|
|
266
287
|
method: "PATCH"
|
|
267
288
|
}, this.defaults, this.jar);
|
|
268
289
|
};
|
package/dist/core/rezo.js
CHANGED
|
@@ -49,8 +49,8 @@ export class Rezo {
|
|
|
49
49
|
}
|
|
50
50
|
this.adapter = adapter || globalAdapter;
|
|
51
51
|
this.defaults = config || {};
|
|
52
|
-
if (config?.
|
|
53
|
-
this.jar = config.
|
|
52
|
+
if (config?.jar instanceof RezoCookieJar) {
|
|
53
|
+
this.jar = config.jar;
|
|
54
54
|
} else if (config?.cookieFile) {
|
|
55
55
|
this.jar = RezoCookieJar.fromFile(config.cookieFile);
|
|
56
56
|
} else {
|
|
@@ -176,11 +176,18 @@ export class Rezo {
|
|
|
176
176
|
}, this.defaults, this.jar);
|
|
177
177
|
};
|
|
178
178
|
postMultipart = async (url, data, options = {}) => {
|
|
179
|
-
|
|
179
|
+
let formData;
|
|
180
|
+
if (data instanceof RezoFormData) {
|
|
181
|
+
formData = data;
|
|
182
|
+
} else if (data instanceof FormData) {
|
|
183
|
+
formData = await RezoFormData.fromNativeFormData(data);
|
|
184
|
+
} else {
|
|
185
|
+
formData = RezoFormData.fromObject(data);
|
|
186
|
+
}
|
|
180
187
|
return this.executeRequest({
|
|
181
188
|
...options,
|
|
182
189
|
url,
|
|
183
|
-
formData
|
|
190
|
+
formData,
|
|
184
191
|
method: "POST"
|
|
185
192
|
}, this.defaults, this.jar);
|
|
186
193
|
};
|
|
@@ -217,11 +224,18 @@ export class Rezo {
|
|
|
217
224
|
}, this.defaults, this.jar);
|
|
218
225
|
};
|
|
219
226
|
putMultipart = async (url, data, options = {}) => {
|
|
220
|
-
|
|
227
|
+
let formData;
|
|
228
|
+
if (data instanceof RezoFormData) {
|
|
229
|
+
formData = data;
|
|
230
|
+
} else if (data instanceof FormData) {
|
|
231
|
+
formData = await RezoFormData.fromNativeFormData(data);
|
|
232
|
+
} else {
|
|
233
|
+
formData = RezoFormData.fromObject(data);
|
|
234
|
+
}
|
|
221
235
|
return this.executeRequest({
|
|
222
236
|
...options,
|
|
223
237
|
url,
|
|
224
|
-
formData
|
|
238
|
+
formData,
|
|
225
239
|
method: "PUT"
|
|
226
240
|
}, this.defaults, this.jar);
|
|
227
241
|
};
|
|
@@ -258,11 +272,18 @@ export class Rezo {
|
|
|
258
272
|
}, this.defaults, this.jar);
|
|
259
273
|
};
|
|
260
274
|
patchMultipart = async (url, data, options = {}) => {
|
|
261
|
-
|
|
275
|
+
let formData;
|
|
276
|
+
if (data instanceof RezoFormData) {
|
|
277
|
+
formData = data;
|
|
278
|
+
} else if (data instanceof FormData) {
|
|
279
|
+
formData = await RezoFormData.fromNativeFormData(data);
|
|
280
|
+
} else {
|
|
281
|
+
formData = RezoFormData.fromObject(data);
|
|
282
|
+
}
|
|
262
283
|
return this.executeRequest({
|
|
263
284
|
...options,
|
|
264
285
|
url,
|
|
265
|
-
formData
|
|
286
|
+
formData,
|
|
266
287
|
method: "PATCH"
|
|
267
288
|
}, this.defaults, this.jar);
|
|
268
289
|
};
|
package/dist/crawler.d.ts
CHANGED
|
@@ -537,11 +537,19 @@ declare class RezoFormData extends NodeFormData {
|
|
|
537
537
|
toBuffer(): Buffer;
|
|
538
538
|
/**
|
|
539
539
|
* Create RezoFormData from object
|
|
540
|
+
* Properly handles nested objects by JSON.stringify-ing them
|
|
540
541
|
* @param {Record<string, any>} obj - Object to convert
|
|
541
542
|
* @param {Options} options - Optional RezoFormData options
|
|
542
543
|
* @returns {RezoFormData}
|
|
543
544
|
*/
|
|
544
545
|
static fromObject(obj: Record<string, any>, options?: Options): RezoFormData;
|
|
546
|
+
/**
|
|
547
|
+
* Helper to append a value to FormData with proper type handling
|
|
548
|
+
* @param {RezoFormData} formData - The form data to append to
|
|
549
|
+
* @param {string} key - The field name
|
|
550
|
+
* @param {any} value - The value to append
|
|
551
|
+
*/
|
|
552
|
+
private static appendValue;
|
|
545
553
|
/**
|
|
546
554
|
* Convert to URL query string
|
|
547
555
|
* Warning: File, Blob, and binary data will be omitted
|
|
@@ -2803,8 +2811,19 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2803
2811
|
useProxyManager?: boolean;
|
|
2804
2812
|
/** Whether to enable automatic cookie handling */
|
|
2805
2813
|
useCookies?: boolean;
|
|
2806
|
-
/**
|
|
2807
|
-
|
|
2814
|
+
/**
|
|
2815
|
+
* Custom cookie jar for managing cookies in this request.
|
|
2816
|
+
* Note: Passing jar per-request is supported but not recommended.
|
|
2817
|
+
* For better cookie management, pass the jar when creating the instance:
|
|
2818
|
+
* @example
|
|
2819
|
+
* ```typescript
|
|
2820
|
+
* const client = new Rezo({ jar: myJar });
|
|
2821
|
+
* // or
|
|
2822
|
+
* const client = rezo.create({ jar: myJar });
|
|
2823
|
+
* ```
|
|
2824
|
+
* If you need custom cookies for a single request, use the `cookies` option instead.
|
|
2825
|
+
*/
|
|
2826
|
+
jar?: RezoCookieJar;
|
|
2808
2827
|
/** Cookies to send with the request in various formats */
|
|
2809
2828
|
cookies?: Cookies["array"] | Cookies["netscape"] | Cookies["serialized"] | Cookies["setCookiesString"];
|
|
2810
2829
|
/** Callback for upload progress events */
|
|
@@ -3235,8 +3254,17 @@ export interface RezoDefaultOptions {
|
|
|
3235
3254
|
hooks?: Partial<RezoHooks>;
|
|
3236
3255
|
/** Whether to enable automatic cookie handling (default: true)*/
|
|
3237
3256
|
enableCookieJar?: boolean;
|
|
3238
|
-
/**
|
|
3239
|
-
|
|
3257
|
+
/**
|
|
3258
|
+
* Custom cookie jar for managing cookies.
|
|
3259
|
+
* The recommended way to manage cookies - pass the jar when creating the instance.
|
|
3260
|
+
* @example
|
|
3261
|
+
* ```typescript
|
|
3262
|
+
* const client = new Rezo({ jar: myJar });
|
|
3263
|
+
* // or
|
|
3264
|
+
* const client = rezo.create({ jar: myJar });
|
|
3265
|
+
* ```
|
|
3266
|
+
*/
|
|
3267
|
+
jar?: RezoHttpRequest["jar"];
|
|
3240
3268
|
/** Set default cookies to send with the requests in various formats */
|
|
3241
3269
|
cookies?: RezoHttpRequest["cookies"];
|
|
3242
3270
|
/**
|
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_sr4bcr = require('../plugin/crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_sr4bcr.Crawler;;
|
|
3
|
+
const _mod_fra6kj = require('../plugin/crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_fra6kj.CrawlerOptions;
|
|
5
|
+
exports.Domain = _mod_fra6kj.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_izj7ua = require('./core/rezo.cjs');
|
|
2
|
+
exports.Rezo = _mod_izj7ua.Rezo;
|
|
3
|
+
exports.createRezoInstance = _mod_izj7ua.createRezoInstance;
|
|
4
|
+
exports.createDefaultInstance = _mod_izj7ua.createDefaultInstance;;
|
|
5
|
+
const _mod_tgc1sb = require('./errors/rezo-error.cjs');
|
|
6
|
+
exports.RezoError = _mod_tgc1sb.RezoError;
|
|
7
|
+
exports.RezoErrorCode = _mod_tgc1sb.RezoErrorCode;;
|
|
8
|
+
const _mod_h7bez0 = require('./utils/headers.cjs');
|
|
9
|
+
exports.RezoHeaders = _mod_h7bez0.RezoHeaders;;
|
|
10
|
+
const _mod_ez8yvh = require('./utils/form-data.cjs');
|
|
11
|
+
exports.RezoFormData = _mod_ez8yvh.RezoFormData;;
|
|
12
|
+
const _mod_fqunh0 = require('./utils/cookies.cjs');
|
|
13
|
+
exports.RezoCookieJar = _mod_fqunh0.RezoCookieJar;
|
|
14
|
+
exports.Cookie = _mod_fqunh0.Cookie;;
|
|
15
|
+
const _mod_ydcmkw = require('./core/hooks.cjs');
|
|
16
|
+
exports.createDefaultHooks = _mod_ydcmkw.createDefaultHooks;
|
|
17
|
+
exports.mergeHooks = _mod_ydcmkw.mergeHooks;;
|
|
18
|
+
const _mod_3apyk1 = require('./proxy/manager.cjs');
|
|
19
|
+
exports.ProxyManager = _mod_3apyk1.ProxyManager;;
|
|
20
|
+
const _mod_ilywic = require('./queue/index.cjs');
|
|
21
|
+
exports.RezoQueue = _mod_ilywic.RezoQueue;
|
|
22
|
+
exports.HttpQueue = _mod_ilywic.HttpQueue;
|
|
23
|
+
exports.Priority = _mod_ilywic.Priority;
|
|
24
|
+
exports.HttpMethodPriority = _mod_ilywic.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
|
@@ -314,11 +314,19 @@ export declare class RezoFormData extends NodeFormData {
|
|
|
314
314
|
toBuffer(): Buffer;
|
|
315
315
|
/**
|
|
316
316
|
* Create RezoFormData from object
|
|
317
|
+
* Properly handles nested objects by JSON.stringify-ing them
|
|
317
318
|
* @param {Record<string, any>} obj - Object to convert
|
|
318
319
|
* @param {Options} options - Optional RezoFormData options
|
|
319
320
|
* @returns {RezoFormData}
|
|
320
321
|
*/
|
|
321
322
|
static fromObject(obj: Record<string, any>, options?: Options): RezoFormData;
|
|
323
|
+
/**
|
|
324
|
+
* Helper to append a value to FormData with proper type handling
|
|
325
|
+
* @param {RezoFormData} formData - The form data to append to
|
|
326
|
+
* @param {string} key - The field name
|
|
327
|
+
* @param {any} value - The value to append
|
|
328
|
+
*/
|
|
329
|
+
private static appendValue;
|
|
322
330
|
/**
|
|
323
331
|
* Convert to URL query string
|
|
324
332
|
* Warning: File, Blob, and binary data will be omitted
|
|
@@ -2811,8 +2819,19 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2811
2819
|
useProxyManager?: boolean;
|
|
2812
2820
|
/** Whether to enable automatic cookie handling */
|
|
2813
2821
|
useCookies?: boolean;
|
|
2814
|
-
/**
|
|
2815
|
-
|
|
2822
|
+
/**
|
|
2823
|
+
* Custom cookie jar for managing cookies in this request.
|
|
2824
|
+
* Note: Passing jar per-request is supported but not recommended.
|
|
2825
|
+
* For better cookie management, pass the jar when creating the instance:
|
|
2826
|
+
* @example
|
|
2827
|
+
* ```typescript
|
|
2828
|
+
* const client = new Rezo({ jar: myJar });
|
|
2829
|
+
* // or
|
|
2830
|
+
* const client = rezo.create({ jar: myJar });
|
|
2831
|
+
* ```
|
|
2832
|
+
* If you need custom cookies for a single request, use the `cookies` option instead.
|
|
2833
|
+
*/
|
|
2834
|
+
jar?: RezoCookieJar;
|
|
2816
2835
|
/** Cookies to send with the request in various formats */
|
|
2817
2836
|
cookies?: Cookies["array"] | Cookies["netscape"] | Cookies["serialized"] | Cookies["setCookiesString"];
|
|
2818
2837
|
/** Callback for upload progress events */
|
|
@@ -3262,8 +3281,17 @@ export interface RezoDefaultOptions {
|
|
|
3262
3281
|
hooks?: Partial<RezoHooks>;
|
|
3263
3282
|
/** Whether to enable automatic cookie handling (default: true)*/
|
|
3264
3283
|
enableCookieJar?: boolean;
|
|
3265
|
-
/**
|
|
3266
|
-
|
|
3284
|
+
/**
|
|
3285
|
+
* Custom cookie jar for managing cookies.
|
|
3286
|
+
* The recommended way to manage cookies - pass the jar when creating the instance.
|
|
3287
|
+
* @example
|
|
3288
|
+
* ```typescript
|
|
3289
|
+
* const client = new Rezo({ jar: myJar });
|
|
3290
|
+
* // or
|
|
3291
|
+
* const client = rezo.create({ jar: myJar });
|
|
3292
|
+
* ```
|
|
3293
|
+
*/
|
|
3294
|
+
jar?: RezoHttpRequest["jar"];
|
|
3267
3295
|
/** Set default cookies to send with the requests in various formats */
|
|
3268
3296
|
cookies?: RezoHttpRequest["cookies"];
|
|
3269
3297
|
/**
|
|
@@ -314,11 +314,19 @@ export declare class RezoFormData extends NodeFormData {
|
|
|
314
314
|
toBuffer(): Buffer;
|
|
315
315
|
/**
|
|
316
316
|
* Create RezoFormData from object
|
|
317
|
+
* Properly handles nested objects by JSON.stringify-ing them
|
|
317
318
|
* @param {Record<string, any>} obj - Object to convert
|
|
318
319
|
* @param {Options} options - Optional RezoFormData options
|
|
319
320
|
* @returns {RezoFormData}
|
|
320
321
|
*/
|
|
321
322
|
static fromObject(obj: Record<string, any>, options?: Options): RezoFormData;
|
|
323
|
+
/**
|
|
324
|
+
* Helper to append a value to FormData with proper type handling
|
|
325
|
+
* @param {RezoFormData} formData - The form data to append to
|
|
326
|
+
* @param {string} key - The field name
|
|
327
|
+
* @param {any} value - The value to append
|
|
328
|
+
*/
|
|
329
|
+
private static appendValue;
|
|
322
330
|
/**
|
|
323
331
|
* Convert to URL query string
|
|
324
332
|
* Warning: File, Blob, and binary data will be omitted
|
|
@@ -2685,8 +2693,19 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2685
2693
|
useProxyManager?: boolean;
|
|
2686
2694
|
/** Whether to enable automatic cookie handling */
|
|
2687
2695
|
useCookies?: boolean;
|
|
2688
|
-
/**
|
|
2689
|
-
|
|
2696
|
+
/**
|
|
2697
|
+
* Custom cookie jar for managing cookies in this request.
|
|
2698
|
+
* Note: Passing jar per-request is supported but not recommended.
|
|
2699
|
+
* For better cookie management, pass the jar when creating the instance:
|
|
2700
|
+
* @example
|
|
2701
|
+
* ```typescript
|
|
2702
|
+
* const client = new Rezo({ jar: myJar });
|
|
2703
|
+
* // or
|
|
2704
|
+
* const client = rezo.create({ jar: myJar });
|
|
2705
|
+
* ```
|
|
2706
|
+
* If you need custom cookies for a single request, use the `cookies` option instead.
|
|
2707
|
+
*/
|
|
2708
|
+
jar?: RezoCookieJar;
|
|
2690
2709
|
/** Cookies to send with the request in various formats */
|
|
2691
2710
|
cookies?: Cookies["array"] | Cookies["netscape"] | Cookies["serialized"] | Cookies["setCookiesString"];
|
|
2692
2711
|
/** Callback for upload progress events */
|
|
@@ -3117,8 +3136,17 @@ export interface RezoDefaultOptions {
|
|
|
3117
3136
|
hooks?: Partial<RezoHooks>;
|
|
3118
3137
|
/** Whether to enable automatic cookie handling (default: true)*/
|
|
3119
3138
|
enableCookieJar?: boolean;
|
|
3120
|
-
/**
|
|
3121
|
-
|
|
3139
|
+
/**
|
|
3140
|
+
* Custom cookie jar for managing cookies.
|
|
3141
|
+
* The recommended way to manage cookies - pass the jar when creating the instance.
|
|
3142
|
+
* @example
|
|
3143
|
+
* ```typescript
|
|
3144
|
+
* const client = new Rezo({ jar: myJar });
|
|
3145
|
+
* // or
|
|
3146
|
+
* const client = rezo.create({ jar: myJar });
|
|
3147
|
+
* ```
|
|
3148
|
+
*/
|
|
3149
|
+
jar?: RezoHttpRequest["jar"];
|
|
3122
3150
|
/** Set default cookies to send with the requests in various formats */
|
|
3123
3151
|
cookies?: RezoHttpRequest["cookies"];
|
|
3124
3152
|
/**
|
package/dist/platform/bun.d.ts
CHANGED
|
@@ -314,11 +314,19 @@ export declare class RezoFormData extends NodeFormData {
|
|
|
314
314
|
toBuffer(): Buffer;
|
|
315
315
|
/**
|
|
316
316
|
* Create RezoFormData from object
|
|
317
|
+
* Properly handles nested objects by JSON.stringify-ing them
|
|
317
318
|
* @param {Record<string, any>} obj - Object to convert
|
|
318
319
|
* @param {Options} options - Optional RezoFormData options
|
|
319
320
|
* @returns {RezoFormData}
|
|
320
321
|
*/
|
|
321
322
|
static fromObject(obj: Record<string, any>, options?: Options): RezoFormData;
|
|
323
|
+
/**
|
|
324
|
+
* Helper to append a value to FormData with proper type handling
|
|
325
|
+
* @param {RezoFormData} formData - The form data to append to
|
|
326
|
+
* @param {string} key - The field name
|
|
327
|
+
* @param {any} value - The value to append
|
|
328
|
+
*/
|
|
329
|
+
private static appendValue;
|
|
322
330
|
/**
|
|
323
331
|
* Convert to URL query string
|
|
324
332
|
* Warning: File, Blob, and binary data will be omitted
|
|
@@ -2685,8 +2693,19 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2685
2693
|
useProxyManager?: boolean;
|
|
2686
2694
|
/** Whether to enable automatic cookie handling */
|
|
2687
2695
|
useCookies?: boolean;
|
|
2688
|
-
/**
|
|
2689
|
-
|
|
2696
|
+
/**
|
|
2697
|
+
* Custom cookie jar for managing cookies in this request.
|
|
2698
|
+
* Note: Passing jar per-request is supported but not recommended.
|
|
2699
|
+
* For better cookie management, pass the jar when creating the instance:
|
|
2700
|
+
* @example
|
|
2701
|
+
* ```typescript
|
|
2702
|
+
* const client = new Rezo({ jar: myJar });
|
|
2703
|
+
* // or
|
|
2704
|
+
* const client = rezo.create({ jar: myJar });
|
|
2705
|
+
* ```
|
|
2706
|
+
* If you need custom cookies for a single request, use the `cookies` option instead.
|
|
2707
|
+
*/
|
|
2708
|
+
jar?: RezoCookieJar;
|
|
2690
2709
|
/** Cookies to send with the request in various formats */
|
|
2691
2710
|
cookies?: Cookies["array"] | Cookies["netscape"] | Cookies["serialized"] | Cookies["setCookiesString"];
|
|
2692
2711
|
/** Callback for upload progress events */
|
|
@@ -3117,8 +3136,17 @@ export interface RezoDefaultOptions {
|
|
|
3117
3136
|
hooks?: Partial<RezoHooks>;
|
|
3118
3137
|
/** Whether to enable automatic cookie handling (default: true)*/
|
|
3119
3138
|
enableCookieJar?: boolean;
|
|
3120
|
-
/**
|
|
3121
|
-
|
|
3139
|
+
/**
|
|
3140
|
+
* Custom cookie jar for managing cookies.
|
|
3141
|
+
* The recommended way to manage cookies - pass the jar when creating the instance.
|
|
3142
|
+
* @example
|
|
3143
|
+
* ```typescript
|
|
3144
|
+
* const client = new Rezo({ jar: myJar });
|
|
3145
|
+
* // or
|
|
3146
|
+
* const client = rezo.create({ jar: myJar });
|
|
3147
|
+
* ```
|
|
3148
|
+
*/
|
|
3149
|
+
jar?: RezoHttpRequest["jar"];
|
|
3122
3150
|
/** Set default cookies to send with the requests in various formats */
|
|
3123
3151
|
cookies?: RezoHttpRequest["cookies"];
|
|
3124
3152
|
/**
|
package/dist/platform/deno.d.ts
CHANGED
|
@@ -314,11 +314,19 @@ export declare class RezoFormData extends NodeFormData {
|
|
|
314
314
|
toBuffer(): Buffer;
|
|
315
315
|
/**
|
|
316
316
|
* Create RezoFormData from object
|
|
317
|
+
* Properly handles nested objects by JSON.stringify-ing them
|
|
317
318
|
* @param {Record<string, any>} obj - Object to convert
|
|
318
319
|
* @param {Options} options - Optional RezoFormData options
|
|
319
320
|
* @returns {RezoFormData}
|
|
320
321
|
*/
|
|
321
322
|
static fromObject(obj: Record<string, any>, options?: Options): RezoFormData;
|
|
323
|
+
/**
|
|
324
|
+
* Helper to append a value to FormData with proper type handling
|
|
325
|
+
* @param {RezoFormData} formData - The form data to append to
|
|
326
|
+
* @param {string} key - The field name
|
|
327
|
+
* @param {any} value - The value to append
|
|
328
|
+
*/
|
|
329
|
+
private static appendValue;
|
|
322
330
|
/**
|
|
323
331
|
* Convert to URL query string
|
|
324
332
|
* Warning: File, Blob, and binary data will be omitted
|
|
@@ -2685,8 +2693,19 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2685
2693
|
useProxyManager?: boolean;
|
|
2686
2694
|
/** Whether to enable automatic cookie handling */
|
|
2687
2695
|
useCookies?: boolean;
|
|
2688
|
-
/**
|
|
2689
|
-
|
|
2696
|
+
/**
|
|
2697
|
+
* Custom cookie jar for managing cookies in this request.
|
|
2698
|
+
* Note: Passing jar per-request is supported but not recommended.
|
|
2699
|
+
* For better cookie management, pass the jar when creating the instance:
|
|
2700
|
+
* @example
|
|
2701
|
+
* ```typescript
|
|
2702
|
+
* const client = new Rezo({ jar: myJar });
|
|
2703
|
+
* // or
|
|
2704
|
+
* const client = rezo.create({ jar: myJar });
|
|
2705
|
+
* ```
|
|
2706
|
+
* If you need custom cookies for a single request, use the `cookies` option instead.
|
|
2707
|
+
*/
|
|
2708
|
+
jar?: RezoCookieJar;
|
|
2690
2709
|
/** Cookies to send with the request in various formats */
|
|
2691
2710
|
cookies?: Cookies["array"] | Cookies["netscape"] | Cookies["serialized"] | Cookies["setCookiesString"];
|
|
2692
2711
|
/** Callback for upload progress events */
|
|
@@ -3117,8 +3136,17 @@ export interface RezoDefaultOptions {
|
|
|
3117
3136
|
hooks?: Partial<RezoHooks>;
|
|
3118
3137
|
/** Whether to enable automatic cookie handling (default: true)*/
|
|
3119
3138
|
enableCookieJar?: boolean;
|
|
3120
|
-
/**
|
|
3121
|
-
|
|
3139
|
+
/**
|
|
3140
|
+
* Custom cookie jar for managing cookies.
|
|
3141
|
+
* The recommended way to manage cookies - pass the jar when creating the instance.
|
|
3142
|
+
* @example
|
|
3143
|
+
* ```typescript
|
|
3144
|
+
* const client = new Rezo({ jar: myJar });
|
|
3145
|
+
* // or
|
|
3146
|
+
* const client = rezo.create({ jar: myJar });
|
|
3147
|
+
* ```
|
|
3148
|
+
*/
|
|
3149
|
+
jar?: RezoHttpRequest["jar"];
|
|
3122
3150
|
/** Set default cookies to send with the requests in various formats */
|
|
3123
3151
|
cookies?: RezoHttpRequest["cookies"];
|
|
3124
3152
|
/**
|
package/dist/platform/node.d.ts
CHANGED
|
@@ -314,11 +314,19 @@ export declare class RezoFormData extends NodeFormData {
|
|
|
314
314
|
toBuffer(): Buffer;
|
|
315
315
|
/**
|
|
316
316
|
* Create RezoFormData from object
|
|
317
|
+
* Properly handles nested objects by JSON.stringify-ing them
|
|
317
318
|
* @param {Record<string, any>} obj - Object to convert
|
|
318
319
|
* @param {Options} options - Optional RezoFormData options
|
|
319
320
|
* @returns {RezoFormData}
|
|
320
321
|
*/
|
|
321
322
|
static fromObject(obj: Record<string, any>, options?: Options): RezoFormData;
|
|
323
|
+
/**
|
|
324
|
+
* Helper to append a value to FormData with proper type handling
|
|
325
|
+
* @param {RezoFormData} formData - The form data to append to
|
|
326
|
+
* @param {string} key - The field name
|
|
327
|
+
* @param {any} value - The value to append
|
|
328
|
+
*/
|
|
329
|
+
private static appendValue;
|
|
322
330
|
/**
|
|
323
331
|
* Convert to URL query string
|
|
324
332
|
* Warning: File, Blob, and binary data will be omitted
|
|
@@ -2685,8 +2693,19 @@ export interface RezoRequestConfig<D = any> {
|
|
|
2685
2693
|
useProxyManager?: boolean;
|
|
2686
2694
|
/** Whether to enable automatic cookie handling */
|
|
2687
2695
|
useCookies?: boolean;
|
|
2688
|
-
/**
|
|
2689
|
-
|
|
2696
|
+
/**
|
|
2697
|
+
* Custom cookie jar for managing cookies in this request.
|
|
2698
|
+
* Note: Passing jar per-request is supported but not recommended.
|
|
2699
|
+
* For better cookie management, pass the jar when creating the instance:
|
|
2700
|
+
* @example
|
|
2701
|
+
* ```typescript
|
|
2702
|
+
* const client = new Rezo({ jar: myJar });
|
|
2703
|
+
* // or
|
|
2704
|
+
* const client = rezo.create({ jar: myJar });
|
|
2705
|
+
* ```
|
|
2706
|
+
* If you need custom cookies for a single request, use the `cookies` option instead.
|
|
2707
|
+
*/
|
|
2708
|
+
jar?: RezoCookieJar;
|
|
2690
2709
|
/** Cookies to send with the request in various formats */
|
|
2691
2710
|
cookies?: Cookies["array"] | Cookies["netscape"] | Cookies["serialized"] | Cookies["setCookiesString"];
|
|
2692
2711
|
/** Callback for upload progress events */
|
|
@@ -3117,8 +3136,17 @@ export interface RezoDefaultOptions {
|
|
|
3117
3136
|
hooks?: Partial<RezoHooks>;
|
|
3118
3137
|
/** Whether to enable automatic cookie handling (default: true)*/
|
|
3119
3138
|
enableCookieJar?: boolean;
|
|
3120
|
-
/**
|
|
3121
|
-
|
|
3139
|
+
/**
|
|
3140
|
+
* Custom cookie jar for managing cookies.
|
|
3141
|
+
* The recommended way to manage cookies - pass the jar when creating the instance.
|
|
3142
|
+
* @example
|
|
3143
|
+
* ```typescript
|
|
3144
|
+
* const client = new Rezo({ jar: myJar });
|
|
3145
|
+
* // or
|
|
3146
|
+
* const client = rezo.create({ jar: myJar });
|
|
3147
|
+
* ```
|
|
3148
|
+
*/
|
|
3149
|
+
jar?: RezoHttpRequest["jar"];
|
|
3122
3150
|
/** Set default cookies to send with the requests in various formats */
|
|
3123
3151
|
cookies?: RezoHttpRequest["cookies"];
|
|
3124
3152
|
/**
|