rezo 1.0.9 → 1.0.11

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.
@@ -4104,6 +4104,7 @@ export declare class Rezo {
4104
4104
  private __create;
4105
4105
  /** Get the cookie jar for this instance */
4106
4106
  get cookieJar(): RezoCookieJar;
4107
+ set cookieJar(jar: RezoCookieJar);
4107
4108
  /**
4108
4109
  * Save cookies to file (if cookieFile is configured).
4109
4110
  * Can also specify a different path to save to.
@@ -4219,48 +4220,101 @@ export declare class Rezo {
4219
4220
  setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
4220
4221
  setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
4221
4222
  /**
4222
- * Get all cookies from the cookie jar.
4223
+ * Get all cookies from the cookie jar in multiple convenient formats.
4223
4224
  *
4224
- * Returns a `Cookies` object where keys are domain names and values are
4225
- * arrays of Cookie objects for that domain. This provides easy access to
4226
- * all stored cookies for inspection, serialization, or manual manipulation.
4225
+ * Returns a `Cookies` object containing all stored cookies in various formats
4226
+ * for different use cases. This provides flexible access to cookies for
4227
+ * HTTP headers, file storage, serialization, or programmatic manipulation.
4227
4228
  *
4228
- * @returns A Cookies object mapping domains to their Cookie arrays
4229
+ * The returned `Cookies` object contains:
4230
+ * - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
4231
+ * - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
4232
+ * - **netscape**: `string` - Netscape cookie file format for file-based storage
4233
+ * - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
4234
+ * - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
4235
+ *
4236
+ * @returns A Cookies object with cookies in multiple formats
4229
4237
  *
4230
4238
  * @example
4231
4239
  * ```typescript
4232
- * // Get all cookies
4233
4240
  * const cookies = rezo.getCookies();
4234
4241
  *
4235
- * // Access cookies for a specific domain
4236
- * const exampleCookies = cookies['example.com'];
4237
- * if (exampleCookies) {
4238
- * for (const cookie of exampleCookies) {
4239
- * console.log(`${cookie.key}=${cookie.value}`);
4240
- * }
4242
+ * // Access as Cookie instances for programmatic use
4243
+ * for (const cookie of cookies.array) {
4244
+ * console.log(`${cookie.key}=${cookie.value} (expires: ${cookie.expires})`);
4241
4245
  * }
4242
4246
  *
4243
- * // List all domains with cookies
4244
- * const domains = Object.keys(cookies);
4245
- * console.log('Cookies stored for:', domains);
4247
+ * // Get cookie header string for manual HTTP requests
4248
+ * console.log(cookies.string); // "session=abc123; user=john"
4249
+ *
4250
+ * // Save to Netscape cookie file
4251
+ * fs.writeFileSync('cookies.txt', cookies.netscape);
4246
4252
  *
4247
- * // Count total cookies
4248
- * const totalCookies = Object.values(cookies)
4249
- * .reduce((sum, arr) => sum + arr.length, 0);
4250
- * console.log(`Total cookies: ${totalCookies}`);
4253
+ * // Serialize to JSON for storage
4254
+ * const json = JSON.stringify(cookies.serialized);
4255
+ * localStorage.setItem('cookies', json);
4256
+ *
4257
+ * // Get Set-Cookie headers (useful for proxying responses)
4258
+ * for (const setCookie of cookies.setCookiesString) {
4259
+ * console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
4260
+ * }
4251
4261
  *
4252
- * // Serialize all cookies to JSON
4253
- * const serialized = JSON.stringify(cookies);
4262
+ * // Check cookie count
4263
+ * console.log(`Total cookies: ${cookies.array.length}`);
4254
4264
  *
4255
- * // Check if a specific cookie exists
4256
- * const hasSession = cookies['example.com']
4257
- * ?.some(c => c.key === 'session');
4265
+ * // Find specific cookie
4266
+ * const sessionCookie = cookies.array.find(c => c.key === 'session');
4258
4267
  * ```
4259
4268
  *
4260
4269
  * @see {@link setCookies} - Set cookies in the jar
4270
+ * @see {@link clearCookies} - Remove all cookies from the jar
4261
4271
  * @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
4262
4272
  */
4263
4273
  getCookies(): Cookies;
4274
+ /**
4275
+ * Remove all cookies from the cookie jar.
4276
+ *
4277
+ * This method synchronously clears the entire cookie store, removing all
4278
+ * cookies regardless of domain, path, or expiration. Useful for:
4279
+ * - Logging out users and clearing session state
4280
+ * - Resetting the client to a clean state between test runs
4281
+ * - Implementing "clear cookies" functionality in applications
4282
+ * - Starting fresh before authenticating with different credentials
4283
+ *
4284
+ * This operation is immediate and cannot be undone. If you need to preserve
4285
+ * certain cookies, use {@link getCookies} to save them before clearing,
4286
+ * then restore specific ones with {@link setCookies}.
4287
+ *
4288
+ * @example
4289
+ * ```typescript
4290
+ * // Simple logout - clear all cookies
4291
+ * rezo.clearCookies();
4292
+ *
4293
+ * // Save cookies before clearing (if needed)
4294
+ * const savedCookies = rezo.getCookies();
4295
+ * rezo.clearCookies();
4296
+ * // Later, restore specific cookies if needed
4297
+ * const importantCookies = savedCookies.array.filter(c => c.key === 'preferences');
4298
+ * rezo.setCookies(importantCookies);
4299
+ *
4300
+ * // Clear and re-authenticate
4301
+ * rezo.clearCookies();
4302
+ * await rezo.post('https://api.example.com/login', {
4303
+ * username: 'newuser',
4304
+ * password: 'newpass'
4305
+ * });
4306
+ *
4307
+ * // Use in test teardown
4308
+ * afterEach(() => {
4309
+ * rezo.clearCookies(); // Clean state for next test
4310
+ * });
4311
+ * ```
4312
+ *
4313
+ * @see {@link getCookies} - Get all cookies before clearing
4314
+ * @see {@link setCookies} - Restore or set new cookies after clearing
4315
+ * @see {@link cookieJar} - Access the underlying RezoCookieJar for more control
4316
+ */
4317
+ clearCookies(): void;
4264
4318
  }
4265
4319
  /**
4266
4320
  * Extended Rezo instance with Axios-compatible static helpers.
@@ -4104,6 +4104,7 @@ export declare class Rezo {
4104
4104
  private __create;
4105
4105
  /** Get the cookie jar for this instance */
4106
4106
  get cookieJar(): RezoCookieJar;
4107
+ set cookieJar(jar: RezoCookieJar);
4107
4108
  /**
4108
4109
  * Save cookies to file (if cookieFile is configured).
4109
4110
  * Can also specify a different path to save to.
@@ -4219,48 +4220,101 @@ export declare class Rezo {
4219
4220
  setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
4220
4221
  setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
4221
4222
  /**
4222
- * Get all cookies from the cookie jar.
4223
+ * Get all cookies from the cookie jar in multiple convenient formats.
4223
4224
  *
4224
- * Returns a `Cookies` object where keys are domain names and values are
4225
- * arrays of Cookie objects for that domain. This provides easy access to
4226
- * all stored cookies for inspection, serialization, or manual manipulation.
4225
+ * Returns a `Cookies` object containing all stored cookies in various formats
4226
+ * for different use cases. This provides flexible access to cookies for
4227
+ * HTTP headers, file storage, serialization, or programmatic manipulation.
4227
4228
  *
4228
- * @returns A Cookies object mapping domains to their Cookie arrays
4229
+ * The returned `Cookies` object contains:
4230
+ * - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
4231
+ * - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
4232
+ * - **netscape**: `string` - Netscape cookie file format for file-based storage
4233
+ * - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
4234
+ * - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
4235
+ *
4236
+ * @returns A Cookies object with cookies in multiple formats
4229
4237
  *
4230
4238
  * @example
4231
4239
  * ```typescript
4232
- * // Get all cookies
4233
4240
  * const cookies = rezo.getCookies();
4234
4241
  *
4235
- * // Access cookies for a specific domain
4236
- * const exampleCookies = cookies['example.com'];
4237
- * if (exampleCookies) {
4238
- * for (const cookie of exampleCookies) {
4239
- * console.log(`${cookie.key}=${cookie.value}`);
4240
- * }
4242
+ * // Access as Cookie instances for programmatic use
4243
+ * for (const cookie of cookies.array) {
4244
+ * console.log(`${cookie.key}=${cookie.value} (expires: ${cookie.expires})`);
4241
4245
  * }
4242
4246
  *
4243
- * // List all domains with cookies
4244
- * const domains = Object.keys(cookies);
4245
- * console.log('Cookies stored for:', domains);
4247
+ * // Get cookie header string for manual HTTP requests
4248
+ * console.log(cookies.string); // "session=abc123; user=john"
4249
+ *
4250
+ * // Save to Netscape cookie file
4251
+ * fs.writeFileSync('cookies.txt', cookies.netscape);
4246
4252
  *
4247
- * // Count total cookies
4248
- * const totalCookies = Object.values(cookies)
4249
- * .reduce((sum, arr) => sum + arr.length, 0);
4250
- * console.log(`Total cookies: ${totalCookies}`);
4253
+ * // Serialize to JSON for storage
4254
+ * const json = JSON.stringify(cookies.serialized);
4255
+ * localStorage.setItem('cookies', json);
4256
+ *
4257
+ * // Get Set-Cookie headers (useful for proxying responses)
4258
+ * for (const setCookie of cookies.setCookiesString) {
4259
+ * console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
4260
+ * }
4251
4261
  *
4252
- * // Serialize all cookies to JSON
4253
- * const serialized = JSON.stringify(cookies);
4262
+ * // Check cookie count
4263
+ * console.log(`Total cookies: ${cookies.array.length}`);
4254
4264
  *
4255
- * // Check if a specific cookie exists
4256
- * const hasSession = cookies['example.com']
4257
- * ?.some(c => c.key === 'session');
4265
+ * // Find specific cookie
4266
+ * const sessionCookie = cookies.array.find(c => c.key === 'session');
4258
4267
  * ```
4259
4268
  *
4260
4269
  * @see {@link setCookies} - Set cookies in the jar
4270
+ * @see {@link clearCookies} - Remove all cookies from the jar
4261
4271
  * @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
4262
4272
  */
4263
4273
  getCookies(): Cookies;
4274
+ /**
4275
+ * Remove all cookies from the cookie jar.
4276
+ *
4277
+ * This method synchronously clears the entire cookie store, removing all
4278
+ * cookies regardless of domain, path, or expiration. Useful for:
4279
+ * - Logging out users and clearing session state
4280
+ * - Resetting the client to a clean state between test runs
4281
+ * - Implementing "clear cookies" functionality in applications
4282
+ * - Starting fresh before authenticating with different credentials
4283
+ *
4284
+ * This operation is immediate and cannot be undone. If you need to preserve
4285
+ * certain cookies, use {@link getCookies} to save them before clearing,
4286
+ * then restore specific ones with {@link setCookies}.
4287
+ *
4288
+ * @example
4289
+ * ```typescript
4290
+ * // Simple logout - clear all cookies
4291
+ * rezo.clearCookies();
4292
+ *
4293
+ * // Save cookies before clearing (if needed)
4294
+ * const savedCookies = rezo.getCookies();
4295
+ * rezo.clearCookies();
4296
+ * // Later, restore specific cookies if needed
4297
+ * const importantCookies = savedCookies.array.filter(c => c.key === 'preferences');
4298
+ * rezo.setCookies(importantCookies);
4299
+ *
4300
+ * // Clear and re-authenticate
4301
+ * rezo.clearCookies();
4302
+ * await rezo.post('https://api.example.com/login', {
4303
+ * username: 'newuser',
4304
+ * password: 'newpass'
4305
+ * });
4306
+ *
4307
+ * // Use in test teardown
4308
+ * afterEach(() => {
4309
+ * rezo.clearCookies(); // Clean state for next test
4310
+ * });
4311
+ * ```
4312
+ *
4313
+ * @see {@link getCookies} - Get all cookies before clearing
4314
+ * @see {@link setCookies} - Restore or set new cookies after clearing
4315
+ * @see {@link cookieJar} - Access the underlying RezoCookieJar for more control
4316
+ */
4317
+ clearCookies(): void;
4264
4318
  }
4265
4319
  /**
4266
4320
  * Extended Rezo instance with Axios-compatible static helpers.
@@ -1,6 +1,6 @@
1
- const _mod_a49tp0 = require('./picker.cjs');
2
- exports.detectRuntime = _mod_a49tp0.detectRuntime;
3
- exports.getAdapterCapabilities = _mod_a49tp0.getAdapterCapabilities;
4
- exports.buildAdapterContext = _mod_a49tp0.buildAdapterContext;
5
- exports.getAvailableAdapters = _mod_a49tp0.getAvailableAdapters;
6
- exports.selectAdapter = _mod_a49tp0.selectAdapter;;
1
+ const _mod_2r8qwe = require('./picker.cjs');
2
+ exports.detectRuntime = _mod_2r8qwe.detectRuntime;
3
+ exports.getAdapterCapabilities = _mod_2r8qwe.getAdapterCapabilities;
4
+ exports.buildAdapterContext = _mod_2r8qwe.buildAdapterContext;
5
+ exports.getAvailableAdapters = _mod_2r8qwe.getAvailableAdapters;
6
+ exports.selectAdapter = _mod_2r8qwe.selectAdapter;;
@@ -1,13 +1,13 @@
1
- const _mod_jyz6s4 = require('./lru-cache.cjs');
2
- exports.LRUCache = _mod_jyz6s4.LRUCache;;
3
- const _mod_a0ftbg = require('./dns-cache.cjs');
4
- exports.DNSCache = _mod_a0ftbg.DNSCache;
5
- exports.getGlobalDNSCache = _mod_a0ftbg.getGlobalDNSCache;
6
- exports.resetGlobalDNSCache = _mod_a0ftbg.resetGlobalDNSCache;;
7
- const _mod_knf7z5 = require('./response-cache.cjs');
8
- exports.ResponseCache = _mod_knf7z5.ResponseCache;
9
- exports.normalizeResponseCacheConfig = _mod_knf7z5.normalizeResponseCacheConfig;;
10
- const _mod_a13exp = require('./file-cacher.cjs');
11
- exports.FileCacher = _mod_a13exp.FileCacher;;
12
- const _mod_6bj6sb = require('./url-store.cjs');
13
- exports.UrlStore = _mod_6bj6sb.UrlStore;;
1
+ const _mod_n1lpkm = require('./lru-cache.cjs');
2
+ exports.LRUCache = _mod_n1lpkm.LRUCache;;
3
+ const _mod_iq5ukf = require('./dns-cache.cjs');
4
+ exports.DNSCache = _mod_iq5ukf.DNSCache;
5
+ exports.getGlobalDNSCache = _mod_iq5ukf.getGlobalDNSCache;
6
+ exports.resetGlobalDNSCache = _mod_iq5ukf.resetGlobalDNSCache;;
7
+ const _mod_f96z7x = require('./response-cache.cjs');
8
+ exports.ResponseCache = _mod_f96z7x.ResponseCache;
9
+ exports.normalizeResponseCacheConfig = _mod_f96z7x.normalizeResponseCacheConfig;;
10
+ const _mod_j5l68j = require('./file-cacher.cjs');
11
+ exports.FileCacher = _mod_j5l68j.FileCacher;;
12
+ const _mod_2bqslo = require('./url-store.cjs');
13
+ exports.UrlStore = _mod_2bqslo.UrlStore;;
@@ -361,6 +361,9 @@ class Rezo {
361
361
  get cookieJar() {
362
362
  return this.jar;
363
363
  }
364
+ set cookieJar(jar) {
365
+ this.jar = jar;
366
+ }
364
367
  saveCookies(filePath) {
365
368
  if (filePath) {
366
369
  this.jar.saveToFile(filePath);
@@ -397,6 +400,8 @@ class Rezo {
397
400
  }, this.defaults, this.jar);
398
401
  }
399
402
  setCookies(cookies, url, startNew) {
403
+ if (!this.jar)
404
+ this.jar = new RezoCookieJar;
400
405
  if (startNew)
401
406
  this.jar.removeAllCookiesSync();
402
407
  this.jar.setCookiesSync(cookies, url);
@@ -404,6 +409,9 @@ class Rezo {
404
409
  getCookies() {
405
410
  return this.jar.cookies();
406
411
  }
412
+ clearCookies() {
413
+ this.jar?.removeAllCookiesSync();
414
+ }
407
415
  }
408
416
  const defaultTransforms = exports.defaultTransforms = {
409
417
  request: [
package/dist/core/rezo.js CHANGED
@@ -361,6 +361,9 @@ export class Rezo {
361
361
  get cookieJar() {
362
362
  return this.jar;
363
363
  }
364
+ set cookieJar(jar) {
365
+ this.jar = jar;
366
+ }
364
367
  saveCookies(filePath) {
365
368
  if (filePath) {
366
369
  this.jar.saveToFile(filePath);
@@ -397,6 +400,8 @@ export class Rezo {
397
400
  }, this.defaults, this.jar);
398
401
  }
399
402
  setCookies(cookies, url, startNew) {
403
+ if (!this.jar)
404
+ this.jar = new RezoCookieJar;
400
405
  if (startNew)
401
406
  this.jar.removeAllCookiesSync();
402
407
  this.jar.setCookiesSync(cookies, url);
@@ -404,6 +409,9 @@ export class Rezo {
404
409
  getCookies() {
405
410
  return this.jar.cookies();
406
411
  }
412
+ clearCookies() {
413
+ this.jar?.removeAllCookiesSync();
414
+ }
407
415
  }
408
416
  export const defaultTransforms = {
409
417
  request: [
package/dist/crawler.d.ts CHANGED
@@ -4219,6 +4219,7 @@ declare class Rezo {
4219
4219
  private __create;
4220
4220
  /** Get the cookie jar for this instance */
4221
4221
  get cookieJar(): RezoCookieJar;
4222
+ set cookieJar(jar: RezoCookieJar);
4222
4223
  /**
4223
4224
  * Save cookies to file (if cookieFile is configured).
4224
4225
  * Can also specify a different path to save to.
@@ -4334,48 +4335,101 @@ declare class Rezo {
4334
4335
  setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
4335
4336
  setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
4336
4337
  /**
4337
- * Get all cookies from the cookie jar.
4338
+ * Get all cookies from the cookie jar in multiple convenient formats.
4338
4339
  *
4339
- * Returns a `Cookies` object where keys are domain names and values are
4340
- * arrays of Cookie objects for that domain. This provides easy access to
4341
- * all stored cookies for inspection, serialization, or manual manipulation.
4340
+ * Returns a `Cookies` object containing all stored cookies in various formats
4341
+ * for different use cases. This provides flexible access to cookies for
4342
+ * HTTP headers, file storage, serialization, or programmatic manipulation.
4342
4343
  *
4343
- * @returns A Cookies object mapping domains to their Cookie arrays
4344
+ * The returned `Cookies` object contains:
4345
+ * - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
4346
+ * - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
4347
+ * - **netscape**: `string` - Netscape cookie file format for file-based storage
4348
+ * - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
4349
+ * - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
4350
+ *
4351
+ * @returns A Cookies object with cookies in multiple formats
4344
4352
  *
4345
4353
  * @example
4346
4354
  * ```typescript
4347
- * // Get all cookies
4348
4355
  * const cookies = rezo.getCookies();
4349
4356
  *
4350
- * // Access cookies for a specific domain
4351
- * const exampleCookies = cookies['example.com'];
4352
- * if (exampleCookies) {
4353
- * for (const cookie of exampleCookies) {
4354
- * console.log(`${cookie.key}=${cookie.value}`);
4355
- * }
4357
+ * // Access as Cookie instances for programmatic use
4358
+ * for (const cookie of cookies.array) {
4359
+ * console.log(`${cookie.key}=${cookie.value} (expires: ${cookie.expires})`);
4356
4360
  * }
4357
4361
  *
4358
- * // List all domains with cookies
4359
- * const domains = Object.keys(cookies);
4360
- * console.log('Cookies stored for:', domains);
4362
+ * // Get cookie header string for manual HTTP requests
4363
+ * console.log(cookies.string); // "session=abc123; user=john"
4364
+ *
4365
+ * // Save to Netscape cookie file
4366
+ * fs.writeFileSync('cookies.txt', cookies.netscape);
4361
4367
  *
4362
- * // Count total cookies
4363
- * const totalCookies = Object.values(cookies)
4364
- * .reduce((sum, arr) => sum + arr.length, 0);
4365
- * console.log(`Total cookies: ${totalCookies}`);
4368
+ * // Serialize to JSON for storage
4369
+ * const json = JSON.stringify(cookies.serialized);
4370
+ * localStorage.setItem('cookies', json);
4371
+ *
4372
+ * // Get Set-Cookie headers (useful for proxying responses)
4373
+ * for (const setCookie of cookies.setCookiesString) {
4374
+ * console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
4375
+ * }
4366
4376
  *
4367
- * // Serialize all cookies to JSON
4368
- * const serialized = JSON.stringify(cookies);
4377
+ * // Check cookie count
4378
+ * console.log(`Total cookies: ${cookies.array.length}`);
4369
4379
  *
4370
- * // Check if a specific cookie exists
4371
- * const hasSession = cookies['example.com']
4372
- * ?.some(c => c.key === 'session');
4380
+ * // Find specific cookie
4381
+ * const sessionCookie = cookies.array.find(c => c.key === 'session');
4373
4382
  * ```
4374
4383
  *
4375
4384
  * @see {@link setCookies} - Set cookies in the jar
4385
+ * @see {@link clearCookies} - Remove all cookies from the jar
4376
4386
  * @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
4377
4387
  */
4378
4388
  getCookies(): Cookies;
4389
+ /**
4390
+ * Remove all cookies from the cookie jar.
4391
+ *
4392
+ * This method synchronously clears the entire cookie store, removing all
4393
+ * cookies regardless of domain, path, or expiration. Useful for:
4394
+ * - Logging out users and clearing session state
4395
+ * - Resetting the client to a clean state between test runs
4396
+ * - Implementing "clear cookies" functionality in applications
4397
+ * - Starting fresh before authenticating with different credentials
4398
+ *
4399
+ * This operation is immediate and cannot be undone. If you need to preserve
4400
+ * certain cookies, use {@link getCookies} to save them before clearing,
4401
+ * then restore specific ones with {@link setCookies}.
4402
+ *
4403
+ * @example
4404
+ * ```typescript
4405
+ * // Simple logout - clear all cookies
4406
+ * rezo.clearCookies();
4407
+ *
4408
+ * // Save cookies before clearing (if needed)
4409
+ * const savedCookies = rezo.getCookies();
4410
+ * rezo.clearCookies();
4411
+ * // Later, restore specific cookies if needed
4412
+ * const importantCookies = savedCookies.array.filter(c => c.key === 'preferences');
4413
+ * rezo.setCookies(importantCookies);
4414
+ *
4415
+ * // Clear and re-authenticate
4416
+ * rezo.clearCookies();
4417
+ * await rezo.post('https://api.example.com/login', {
4418
+ * username: 'newuser',
4419
+ * password: 'newpass'
4420
+ * });
4421
+ *
4422
+ * // Use in test teardown
4423
+ * afterEach(() => {
4424
+ * rezo.clearCookies(); // Clean state for next test
4425
+ * });
4426
+ * ```
4427
+ *
4428
+ * @see {@link getCookies} - Get all cookies before clearing
4429
+ * @see {@link setCookies} - Restore or set new cookies after clearing
4430
+ * @see {@link cookieJar} - Access the underlying RezoCookieJar for more control
4431
+ */
4432
+ clearCookies(): void;
4379
4433
  }
4380
4434
  /**
4381
4435
  * Rezo HTTP Client - Core Types
@@ -1,5 +1,5 @@
1
- const _mod_ap8v7n = require('../plugin/crawler.cjs');
2
- exports.Crawler = _mod_ap8v7n.Crawler;;
3
- const _mod_ldttq4 = require('../plugin/crawler-options.cjs');
4
- exports.CrawlerOptions = _mod_ldttq4.CrawlerOptions;
5
- exports.Domain = _mod_ldttq4.Domain;;
1
+ const _mod_260i4j = require('../plugin/crawler.cjs');
2
+ exports.Crawler = _mod_260i4j.Crawler;;
3
+ const _mod_laig8l = require('../plugin/crawler-options.cjs');
4
+ exports.CrawlerOptions = _mod_laig8l.CrawlerOptions;
5
+ exports.Domain = _mod_laig8l.Domain;;
package/dist/index.cjs CHANGED
@@ -1,27 +1,27 @@
1
- const _mod_7p8ab6 = require('./core/rezo.cjs');
2
- exports.Rezo = _mod_7p8ab6.Rezo;
3
- exports.createRezoInstance = _mod_7p8ab6.createRezoInstance;
4
- exports.createDefaultInstance = _mod_7p8ab6.createDefaultInstance;;
5
- const _mod_gwad13 = require('./errors/rezo-error.cjs');
6
- exports.RezoError = _mod_gwad13.RezoError;
7
- exports.RezoErrorCode = _mod_gwad13.RezoErrorCode;;
8
- const _mod_0u5sf4 = require('./utils/headers.cjs');
9
- exports.RezoHeaders = _mod_0u5sf4.RezoHeaders;;
10
- const _mod_y55mzr = require('./utils/form-data.cjs');
11
- exports.RezoFormData = _mod_y55mzr.RezoFormData;;
12
- const _mod_8ixff7 = require('./utils/cookies.cjs');
13
- exports.RezoCookieJar = _mod_8ixff7.RezoCookieJar;
14
- exports.Cookie = _mod_8ixff7.Cookie;;
15
- const _mod_6glzgm = require('./core/hooks.cjs');
16
- exports.createDefaultHooks = _mod_6glzgm.createDefaultHooks;
17
- exports.mergeHooks = _mod_6glzgm.mergeHooks;;
18
- const _mod_k6rnmv = require('./proxy/manager.cjs');
19
- exports.ProxyManager = _mod_k6rnmv.ProxyManager;;
20
- const _mod_mjbdct = require('./queue/index.cjs');
21
- exports.RezoQueue = _mod_mjbdct.RezoQueue;
22
- exports.HttpQueue = _mod_mjbdct.HttpQueue;
23
- exports.Priority = _mod_mjbdct.Priority;
24
- exports.HttpMethodPriority = _mod_mjbdct.HttpMethodPriority;;
1
+ const _mod_ivdy34 = require('./core/rezo.cjs');
2
+ exports.Rezo = _mod_ivdy34.Rezo;
3
+ exports.createRezoInstance = _mod_ivdy34.createRezoInstance;
4
+ exports.createDefaultInstance = _mod_ivdy34.createDefaultInstance;;
5
+ const _mod_eleqc6 = require('./errors/rezo-error.cjs');
6
+ exports.RezoError = _mod_eleqc6.RezoError;
7
+ exports.RezoErrorCode = _mod_eleqc6.RezoErrorCode;;
8
+ const _mod_s3mojl = require('./utils/headers.cjs');
9
+ exports.RezoHeaders = _mod_s3mojl.RezoHeaders;;
10
+ const _mod_ltzvhk = require('./utils/form-data.cjs');
11
+ exports.RezoFormData = _mod_ltzvhk.RezoFormData;;
12
+ const _mod_9b4i5y = require('./utils/cookies.cjs');
13
+ exports.RezoCookieJar = _mod_9b4i5y.RezoCookieJar;
14
+ exports.Cookie = _mod_9b4i5y.Cookie;;
15
+ const _mod_ip126y = require('./core/hooks.cjs');
16
+ exports.createDefaultHooks = _mod_ip126y.createDefaultHooks;
17
+ exports.mergeHooks = _mod_ip126y.mergeHooks;;
18
+ const _mod_zptoz7 = require('./proxy/manager.cjs');
19
+ exports.ProxyManager = _mod_zptoz7.ProxyManager;;
20
+ const _mod_qvzoi6 = require('./queue/index.cjs');
21
+ exports.RezoQueue = _mod_qvzoi6.RezoQueue;
22
+ exports.HttpQueue = _mod_qvzoi6.HttpQueue;
23
+ exports.Priority = _mod_qvzoi6.Priority;
24
+ exports.HttpMethodPriority = _mod_qvzoi6.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;