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.
package/dist/index.d.ts CHANGED
@@ -4249,6 +4249,7 @@ export declare class Rezo {
4249
4249
  private __create;
4250
4250
  /** Get the cookie jar for this instance */
4251
4251
  get cookieJar(): RezoCookieJar;
4252
+ set cookieJar(jar: RezoCookieJar);
4252
4253
  /**
4253
4254
  * Save cookies to file (if cookieFile is configured).
4254
4255
  * Can also specify a different path to save to.
@@ -4364,48 +4365,101 @@ export declare class Rezo {
4364
4365
  setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
4365
4366
  setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
4366
4367
  /**
4367
- * Get all cookies from the cookie jar.
4368
+ * Get all cookies from the cookie jar in multiple convenient formats.
4368
4369
  *
4369
- * Returns a `Cookies` object where keys are domain names and values are
4370
- * arrays of Cookie objects for that domain. This provides easy access to
4371
- * all stored cookies for inspection, serialization, or manual manipulation.
4370
+ * Returns a `Cookies` object containing all stored cookies in various formats
4371
+ * for different use cases. This provides flexible access to cookies for
4372
+ * HTTP headers, file storage, serialization, or programmatic manipulation.
4372
4373
  *
4373
- * @returns A Cookies object mapping domains to their Cookie arrays
4374
+ * The returned `Cookies` object contains:
4375
+ * - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
4376
+ * - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
4377
+ * - **netscape**: `string` - Netscape cookie file format for file-based storage
4378
+ * - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
4379
+ * - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
4380
+ *
4381
+ * @returns A Cookies object with cookies in multiple formats
4374
4382
  *
4375
4383
  * @example
4376
4384
  * ```typescript
4377
- * // Get all cookies
4378
4385
  * const cookies = rezo.getCookies();
4379
4386
  *
4380
- * // Access cookies for a specific domain
4381
- * const exampleCookies = cookies['example.com'];
4382
- * if (exampleCookies) {
4383
- * for (const cookie of exampleCookies) {
4384
- * console.log(`${cookie.key}=${cookie.value}`);
4385
- * }
4387
+ * // Access as Cookie instances for programmatic use
4388
+ * for (const cookie of cookies.array) {
4389
+ * console.log(`${cookie.key}=${cookie.value} (expires: ${cookie.expires})`);
4386
4390
  * }
4387
4391
  *
4388
- * // List all domains with cookies
4389
- * const domains = Object.keys(cookies);
4390
- * console.log('Cookies stored for:', domains);
4392
+ * // Get cookie header string for manual HTTP requests
4393
+ * console.log(cookies.string); // "session=abc123; user=john"
4394
+ *
4395
+ * // Save to Netscape cookie file
4396
+ * fs.writeFileSync('cookies.txt', cookies.netscape);
4391
4397
  *
4392
- * // Count total cookies
4393
- * const totalCookies = Object.values(cookies)
4394
- * .reduce((sum, arr) => sum + arr.length, 0);
4395
- * console.log(`Total cookies: ${totalCookies}`);
4398
+ * // Serialize to JSON for storage
4399
+ * const json = JSON.stringify(cookies.serialized);
4400
+ * localStorage.setItem('cookies', json);
4401
+ *
4402
+ * // Get Set-Cookie headers (useful for proxying responses)
4403
+ * for (const setCookie of cookies.setCookiesString) {
4404
+ * console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
4405
+ * }
4396
4406
  *
4397
- * // Serialize all cookies to JSON
4398
- * const serialized = JSON.stringify(cookies);
4407
+ * // Check cookie count
4408
+ * console.log(`Total cookies: ${cookies.array.length}`);
4399
4409
  *
4400
- * // Check if a specific cookie exists
4401
- * const hasSession = cookies['example.com']
4402
- * ?.some(c => c.key === 'session');
4410
+ * // Find specific cookie
4411
+ * const sessionCookie = cookies.array.find(c => c.key === 'session');
4403
4412
  * ```
4404
4413
  *
4405
4414
  * @see {@link setCookies} - Set cookies in the jar
4415
+ * @see {@link clearCookies} - Remove all cookies from the jar
4406
4416
  * @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
4407
4417
  */
4408
4418
  getCookies(): Cookies;
4419
+ /**
4420
+ * Remove all cookies from the cookie jar.
4421
+ *
4422
+ * This method synchronously clears the entire cookie store, removing all
4423
+ * cookies regardless of domain, path, or expiration. Useful for:
4424
+ * - Logging out users and clearing session state
4425
+ * - Resetting the client to a clean state between test runs
4426
+ * - Implementing "clear cookies" functionality in applications
4427
+ * - Starting fresh before authenticating with different credentials
4428
+ *
4429
+ * This operation is immediate and cannot be undone. If you need to preserve
4430
+ * certain cookies, use {@link getCookies} to save them before clearing,
4431
+ * then restore specific ones with {@link setCookies}.
4432
+ *
4433
+ * @example
4434
+ * ```typescript
4435
+ * // Simple logout - clear all cookies
4436
+ * rezo.clearCookies();
4437
+ *
4438
+ * // Save cookies before clearing (if needed)
4439
+ * const savedCookies = rezo.getCookies();
4440
+ * rezo.clearCookies();
4441
+ * // Later, restore specific cookies if needed
4442
+ * const importantCookies = savedCookies.array.filter(c => c.key === 'preferences');
4443
+ * rezo.setCookies(importantCookies);
4444
+ *
4445
+ * // Clear and re-authenticate
4446
+ * rezo.clearCookies();
4447
+ * await rezo.post('https://api.example.com/login', {
4448
+ * username: 'newuser',
4449
+ * password: 'newpass'
4450
+ * });
4451
+ *
4452
+ * // Use in test teardown
4453
+ * afterEach(() => {
4454
+ * rezo.clearCookies(); // Clean state for next test
4455
+ * });
4456
+ * ```
4457
+ *
4458
+ * @see {@link getCookies} - Get all cookies before clearing
4459
+ * @see {@link setCookies} - Restore or set new cookies after clearing
4460
+ * @see {@link cookieJar} - Access the underlying RezoCookieJar for more control
4461
+ */
4462
+ clearCookies(): void;
4409
4463
  }
4410
4464
  /**
4411
4465
  * 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.
@@ -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.