rezo 1.0.37 → 1.0.39
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/entries/curl.d.ts +30 -23
- package/dist/adapters/entries/fetch.d.ts +30 -23
- package/dist/adapters/entries/http.d.ts +30 -23
- package/dist/adapters/entries/http2.d.ts +30 -23
- package/dist/adapters/entries/react-native.d.ts +30 -23
- package/dist/adapters/entries/xhr.d.ts +30 -23
- package/dist/adapters/http.cjs +2 -0
- package/dist/adapters/http.js +2 -0
- package/dist/adapters/index.cjs +6 -6
- package/dist/cache/index.cjs +13 -13
- package/dist/core/rezo.cjs +2 -2
- package/dist/core/rezo.js +2 -2
- package/dist/crawler.d.ts +30 -23
- package/dist/entries/crawler.cjs +5 -5
- package/dist/index.cjs +24 -24
- package/dist/index.d.ts +30 -23
- package/dist/platform/browser.d.ts +30 -23
- package/dist/platform/bun.d.ts +30 -23
- package/dist/platform/deno.d.ts +30 -23
- package/dist/platform/node.d.ts +30 -23
- package/dist/platform/react-native.d.ts +30 -23
- package/dist/platform/worker.d.ts +30 -23
- package/dist/plugin/index.cjs +36 -36
- package/dist/proxy/index.cjs +4 -4
- package/dist/queue/index.cjs +8 -8
- package/dist/responses/universal/index.cjs +11 -11
- package/dist/utils/cookies.cjs +4 -3
- package/dist/utils/cookies.js +4 -3
- package/package.json +1 -1
|
@@ -192,7 +192,17 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
192
192
|
constructor(cookies: Cookie[]);
|
|
193
193
|
constructor(cookies: Cookie[], url: string);
|
|
194
194
|
private generateCookies;
|
|
195
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Get all cookies from the cookie jar.
|
|
197
|
+
*
|
|
198
|
+
* This method synchronously returns all cookies stored in the jar,
|
|
199
|
+
* including both regular and touch cookies.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Cookies} An object containing arrays of all cookies,
|
|
202
|
+
* serialized representations, Netscape format strings, and set-cookie strings
|
|
203
|
+
* @see {@link getCookiesForRequest} - Get cookies for a specific request URL
|
|
204
|
+
*/
|
|
205
|
+
cookies(url?: string): Cookies;
|
|
196
206
|
parseResponseCookies(cookies: Cookie[]): Cookies;
|
|
197
207
|
static toNetscapeCookie(cookies: Cookie[] | SerializedCookie[]): string;
|
|
198
208
|
static toCookieString(cookies: Cookie[] | SerializedCookie[]): string;
|
|
@@ -4253,12 +4263,16 @@ export declare class Rezo {
|
|
|
4253
4263
|
setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
|
|
4254
4264
|
setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
|
|
4255
4265
|
/**
|
|
4256
|
-
* Get
|
|
4266
|
+
* Get cookies from the cookie jar in multiple convenient formats.
|
|
4257
4267
|
*
|
|
4258
|
-
* Returns a `Cookies` object containing
|
|
4268
|
+
* Returns a `Cookies` object containing stored cookies in various formats
|
|
4259
4269
|
* for different use cases. This provides flexible access to cookies for
|
|
4260
4270
|
* HTTP headers, file storage, serialization, or programmatic manipulation.
|
|
4261
4271
|
*
|
|
4272
|
+
* If a `url` is provided, only cookies valid for that URL (matching domain, path,
|
|
4273
|
+
* expiration, etc.) are returned. If no `url` is provided, all cookies in the
|
|
4274
|
+
* jar are returned.
|
|
4275
|
+
*
|
|
4262
4276
|
* The returned `Cookies` object contains:
|
|
4263
4277
|
* - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
|
|
4264
4278
|
* - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
|
|
@@ -4266,37 +4280,29 @@ export declare class Rezo {
|
|
|
4266
4280
|
* - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
|
|
4267
4281
|
* - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
|
|
4268
4282
|
*
|
|
4283
|
+
* @param url - Optional URL to filter cookies. If provided, returns only cookies valid for this URL.
|
|
4269
4284
|
* @returns A Cookies object with cookies in multiple formats
|
|
4270
4285
|
*
|
|
4271
4286
|
* @example
|
|
4272
4287
|
* ```typescript
|
|
4273
|
-
*
|
|
4288
|
+
* // Get ALL cookies in the jar
|
|
4289
|
+
* const allCookies = rezo.getCookies();
|
|
4274
4290
|
*
|
|
4275
|
-
* //
|
|
4276
|
-
*
|
|
4277
|
-
*
|
|
4278
|
-
* }
|
|
4291
|
+
* // Get cookies valid for a specific URL
|
|
4292
|
+
* const googleCookies = rezo.getCookies('https://google.com');
|
|
4293
|
+
* console.log(googleCookies.string); // Only sends valid cookies for google.com
|
|
4279
4294
|
*
|
|
4280
|
-
* //
|
|
4281
|
-
*
|
|
4295
|
+
* // Access as Cookie instances
|
|
4296
|
+
* for (const cookie of allCookies.array) {
|
|
4297
|
+
* console.log(`${cookie.key}=${cookie.value}`);
|
|
4298
|
+
* }
|
|
4282
4299
|
*
|
|
4283
4300
|
* // Save to Netscape cookie file
|
|
4284
|
-
* fs.writeFileSync('cookies.txt',
|
|
4301
|
+
* fs.writeFileSync('cookies.txt', allCookies.netscape);
|
|
4285
4302
|
*
|
|
4286
4303
|
* // Serialize to JSON for storage
|
|
4287
|
-
* const json = JSON.stringify(
|
|
4304
|
+
* const json = JSON.stringify(allCookies.serialized);
|
|
4288
4305
|
* localStorage.setItem('cookies', json);
|
|
4289
|
-
*
|
|
4290
|
-
* // Get Set-Cookie headers (useful for proxying responses)
|
|
4291
|
-
* for (const setCookie of cookies.setCookiesString) {
|
|
4292
|
-
* console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
|
|
4293
|
-
* }
|
|
4294
|
-
*
|
|
4295
|
-
* // Check cookie count
|
|
4296
|
-
* console.log(`Total cookies: ${cookies.array.length}`);
|
|
4297
|
-
*
|
|
4298
|
-
* // Find specific cookie
|
|
4299
|
-
* const sessionCookie = cookies.array.find(c => c.key === 'session');
|
|
4300
4306
|
* ```
|
|
4301
4307
|
*
|
|
4302
4308
|
* @see {@link setCookies} - Set cookies in the jar
|
|
@@ -4304,6 +4310,7 @@ export declare class Rezo {
|
|
|
4304
4310
|
* @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
|
|
4305
4311
|
*/
|
|
4306
4312
|
getCookies(): Cookies;
|
|
4313
|
+
getCookies(url: string): Cookies;
|
|
4307
4314
|
/**
|
|
4308
4315
|
* Remove all cookies from the cookie jar.
|
|
4309
4316
|
*
|
|
@@ -192,7 +192,17 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
192
192
|
constructor(cookies: Cookie[]);
|
|
193
193
|
constructor(cookies: Cookie[], url: string);
|
|
194
194
|
private generateCookies;
|
|
195
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Get all cookies from the cookie jar.
|
|
197
|
+
*
|
|
198
|
+
* This method synchronously returns all cookies stored in the jar,
|
|
199
|
+
* including both regular and touch cookies.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Cookies} An object containing arrays of all cookies,
|
|
202
|
+
* serialized representations, Netscape format strings, and set-cookie strings
|
|
203
|
+
* @see {@link getCookiesForRequest} - Get cookies for a specific request URL
|
|
204
|
+
*/
|
|
205
|
+
cookies(url?: string): Cookies;
|
|
196
206
|
parseResponseCookies(cookies: Cookie[]): Cookies;
|
|
197
207
|
static toNetscapeCookie(cookies: Cookie[] | SerializedCookie[]): string;
|
|
198
208
|
static toCookieString(cookies: Cookie[] | SerializedCookie[]): string;
|
|
@@ -4253,12 +4263,16 @@ export declare class Rezo {
|
|
|
4253
4263
|
setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
|
|
4254
4264
|
setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
|
|
4255
4265
|
/**
|
|
4256
|
-
* Get
|
|
4266
|
+
* Get cookies from the cookie jar in multiple convenient formats.
|
|
4257
4267
|
*
|
|
4258
|
-
* Returns a `Cookies` object containing
|
|
4268
|
+
* Returns a `Cookies` object containing stored cookies in various formats
|
|
4259
4269
|
* for different use cases. This provides flexible access to cookies for
|
|
4260
4270
|
* HTTP headers, file storage, serialization, or programmatic manipulation.
|
|
4261
4271
|
*
|
|
4272
|
+
* If a `url` is provided, only cookies valid for that URL (matching domain, path,
|
|
4273
|
+
* expiration, etc.) are returned. If no `url` is provided, all cookies in the
|
|
4274
|
+
* jar are returned.
|
|
4275
|
+
*
|
|
4262
4276
|
* The returned `Cookies` object contains:
|
|
4263
4277
|
* - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
|
|
4264
4278
|
* - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
|
|
@@ -4266,37 +4280,29 @@ export declare class Rezo {
|
|
|
4266
4280
|
* - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
|
|
4267
4281
|
* - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
|
|
4268
4282
|
*
|
|
4283
|
+
* @param url - Optional URL to filter cookies. If provided, returns only cookies valid for this URL.
|
|
4269
4284
|
* @returns A Cookies object with cookies in multiple formats
|
|
4270
4285
|
*
|
|
4271
4286
|
* @example
|
|
4272
4287
|
* ```typescript
|
|
4273
|
-
*
|
|
4288
|
+
* // Get ALL cookies in the jar
|
|
4289
|
+
* const allCookies = rezo.getCookies();
|
|
4274
4290
|
*
|
|
4275
|
-
* //
|
|
4276
|
-
*
|
|
4277
|
-
*
|
|
4278
|
-
* }
|
|
4291
|
+
* // Get cookies valid for a specific URL
|
|
4292
|
+
* const googleCookies = rezo.getCookies('https://google.com');
|
|
4293
|
+
* console.log(googleCookies.string); // Only sends valid cookies for google.com
|
|
4279
4294
|
*
|
|
4280
|
-
* //
|
|
4281
|
-
*
|
|
4295
|
+
* // Access as Cookie instances
|
|
4296
|
+
* for (const cookie of allCookies.array) {
|
|
4297
|
+
* console.log(`${cookie.key}=${cookie.value}`);
|
|
4298
|
+
* }
|
|
4282
4299
|
*
|
|
4283
4300
|
* // Save to Netscape cookie file
|
|
4284
|
-
* fs.writeFileSync('cookies.txt',
|
|
4301
|
+
* fs.writeFileSync('cookies.txt', allCookies.netscape);
|
|
4285
4302
|
*
|
|
4286
4303
|
* // Serialize to JSON for storage
|
|
4287
|
-
* const json = JSON.stringify(
|
|
4304
|
+
* const json = JSON.stringify(allCookies.serialized);
|
|
4288
4305
|
* localStorage.setItem('cookies', json);
|
|
4289
|
-
*
|
|
4290
|
-
* // Get Set-Cookie headers (useful for proxying responses)
|
|
4291
|
-
* for (const setCookie of cookies.setCookiesString) {
|
|
4292
|
-
* console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
|
|
4293
|
-
* }
|
|
4294
|
-
*
|
|
4295
|
-
* // Check cookie count
|
|
4296
|
-
* console.log(`Total cookies: ${cookies.array.length}`);
|
|
4297
|
-
*
|
|
4298
|
-
* // Find specific cookie
|
|
4299
|
-
* const sessionCookie = cookies.array.find(c => c.key === 'session');
|
|
4300
4306
|
* ```
|
|
4301
4307
|
*
|
|
4302
4308
|
* @see {@link setCookies} - Set cookies in the jar
|
|
@@ -4304,6 +4310,7 @@ export declare class Rezo {
|
|
|
4304
4310
|
* @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
|
|
4305
4311
|
*/
|
|
4306
4312
|
getCookies(): Cookies;
|
|
4313
|
+
getCookies(url: string): Cookies;
|
|
4307
4314
|
/**
|
|
4308
4315
|
* Remove all cookies from the cookie jar.
|
|
4309
4316
|
*
|
|
@@ -192,7 +192,17 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
192
192
|
constructor(cookies: Cookie[]);
|
|
193
193
|
constructor(cookies: Cookie[], url: string);
|
|
194
194
|
private generateCookies;
|
|
195
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Get all cookies from the cookie jar.
|
|
197
|
+
*
|
|
198
|
+
* This method synchronously returns all cookies stored in the jar,
|
|
199
|
+
* including both regular and touch cookies.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Cookies} An object containing arrays of all cookies,
|
|
202
|
+
* serialized representations, Netscape format strings, and set-cookie strings
|
|
203
|
+
* @see {@link getCookiesForRequest} - Get cookies for a specific request URL
|
|
204
|
+
*/
|
|
205
|
+
cookies(url?: string): Cookies;
|
|
196
206
|
parseResponseCookies(cookies: Cookie[]): Cookies;
|
|
197
207
|
static toNetscapeCookie(cookies: Cookie[] | SerializedCookie[]): string;
|
|
198
208
|
static toCookieString(cookies: Cookie[] | SerializedCookie[]): string;
|
|
@@ -4253,12 +4263,16 @@ export declare class Rezo {
|
|
|
4253
4263
|
setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
|
|
4254
4264
|
setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
|
|
4255
4265
|
/**
|
|
4256
|
-
* Get
|
|
4266
|
+
* Get cookies from the cookie jar in multiple convenient formats.
|
|
4257
4267
|
*
|
|
4258
|
-
* Returns a `Cookies` object containing
|
|
4268
|
+
* Returns a `Cookies` object containing stored cookies in various formats
|
|
4259
4269
|
* for different use cases. This provides flexible access to cookies for
|
|
4260
4270
|
* HTTP headers, file storage, serialization, or programmatic manipulation.
|
|
4261
4271
|
*
|
|
4272
|
+
* If a `url` is provided, only cookies valid for that URL (matching domain, path,
|
|
4273
|
+
* expiration, etc.) are returned. If no `url` is provided, all cookies in the
|
|
4274
|
+
* jar are returned.
|
|
4275
|
+
*
|
|
4262
4276
|
* The returned `Cookies` object contains:
|
|
4263
4277
|
* - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
|
|
4264
4278
|
* - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
|
|
@@ -4266,37 +4280,29 @@ export declare class Rezo {
|
|
|
4266
4280
|
* - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
|
|
4267
4281
|
* - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
|
|
4268
4282
|
*
|
|
4283
|
+
* @param url - Optional URL to filter cookies. If provided, returns only cookies valid for this URL.
|
|
4269
4284
|
* @returns A Cookies object with cookies in multiple formats
|
|
4270
4285
|
*
|
|
4271
4286
|
* @example
|
|
4272
4287
|
* ```typescript
|
|
4273
|
-
*
|
|
4288
|
+
* // Get ALL cookies in the jar
|
|
4289
|
+
* const allCookies = rezo.getCookies();
|
|
4274
4290
|
*
|
|
4275
|
-
* //
|
|
4276
|
-
*
|
|
4277
|
-
*
|
|
4278
|
-
* }
|
|
4291
|
+
* // Get cookies valid for a specific URL
|
|
4292
|
+
* const googleCookies = rezo.getCookies('https://google.com');
|
|
4293
|
+
* console.log(googleCookies.string); // Only sends valid cookies for google.com
|
|
4279
4294
|
*
|
|
4280
|
-
* //
|
|
4281
|
-
*
|
|
4295
|
+
* // Access as Cookie instances
|
|
4296
|
+
* for (const cookie of allCookies.array) {
|
|
4297
|
+
* console.log(`${cookie.key}=${cookie.value}`);
|
|
4298
|
+
* }
|
|
4282
4299
|
*
|
|
4283
4300
|
* // Save to Netscape cookie file
|
|
4284
|
-
* fs.writeFileSync('cookies.txt',
|
|
4301
|
+
* fs.writeFileSync('cookies.txt', allCookies.netscape);
|
|
4285
4302
|
*
|
|
4286
4303
|
* // Serialize to JSON for storage
|
|
4287
|
-
* const json = JSON.stringify(
|
|
4304
|
+
* const json = JSON.stringify(allCookies.serialized);
|
|
4288
4305
|
* localStorage.setItem('cookies', json);
|
|
4289
|
-
*
|
|
4290
|
-
* // Get Set-Cookie headers (useful for proxying responses)
|
|
4291
|
-
* for (const setCookie of cookies.setCookiesString) {
|
|
4292
|
-
* console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
|
|
4293
|
-
* }
|
|
4294
|
-
*
|
|
4295
|
-
* // Check cookie count
|
|
4296
|
-
* console.log(`Total cookies: ${cookies.array.length}`);
|
|
4297
|
-
*
|
|
4298
|
-
* // Find specific cookie
|
|
4299
|
-
* const sessionCookie = cookies.array.find(c => c.key === 'session');
|
|
4300
4306
|
* ```
|
|
4301
4307
|
*
|
|
4302
4308
|
* @see {@link setCookies} - Set cookies in the jar
|
|
@@ -4304,6 +4310,7 @@ export declare class Rezo {
|
|
|
4304
4310
|
* @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
|
|
4305
4311
|
*/
|
|
4306
4312
|
getCookies(): Cookies;
|
|
4313
|
+
getCookies(url: string): Cookies;
|
|
4307
4314
|
/**
|
|
4308
4315
|
* Remove all cookies from the cookie jar.
|
|
4309
4316
|
*
|
|
@@ -192,7 +192,17 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
192
192
|
constructor(cookies: Cookie[]);
|
|
193
193
|
constructor(cookies: Cookie[], url: string);
|
|
194
194
|
private generateCookies;
|
|
195
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Get all cookies from the cookie jar.
|
|
197
|
+
*
|
|
198
|
+
* This method synchronously returns all cookies stored in the jar,
|
|
199
|
+
* including both regular and touch cookies.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Cookies} An object containing arrays of all cookies,
|
|
202
|
+
* serialized representations, Netscape format strings, and set-cookie strings
|
|
203
|
+
* @see {@link getCookiesForRequest} - Get cookies for a specific request URL
|
|
204
|
+
*/
|
|
205
|
+
cookies(url?: string): Cookies;
|
|
196
206
|
parseResponseCookies(cookies: Cookie[]): Cookies;
|
|
197
207
|
static toNetscapeCookie(cookies: Cookie[] | SerializedCookie[]): string;
|
|
198
208
|
static toCookieString(cookies: Cookie[] | SerializedCookie[]): string;
|
|
@@ -4253,12 +4263,16 @@ export declare class Rezo {
|
|
|
4253
4263
|
setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
|
|
4254
4264
|
setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
|
|
4255
4265
|
/**
|
|
4256
|
-
* Get
|
|
4266
|
+
* Get cookies from the cookie jar in multiple convenient formats.
|
|
4257
4267
|
*
|
|
4258
|
-
* Returns a `Cookies` object containing
|
|
4268
|
+
* Returns a `Cookies` object containing stored cookies in various formats
|
|
4259
4269
|
* for different use cases. This provides flexible access to cookies for
|
|
4260
4270
|
* HTTP headers, file storage, serialization, or programmatic manipulation.
|
|
4261
4271
|
*
|
|
4272
|
+
* If a `url` is provided, only cookies valid for that URL (matching domain, path,
|
|
4273
|
+
* expiration, etc.) are returned. If no `url` is provided, all cookies in the
|
|
4274
|
+
* jar are returned.
|
|
4275
|
+
*
|
|
4262
4276
|
* The returned `Cookies` object contains:
|
|
4263
4277
|
* - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
|
|
4264
4278
|
* - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
|
|
@@ -4266,37 +4280,29 @@ export declare class Rezo {
|
|
|
4266
4280
|
* - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
|
|
4267
4281
|
* - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
|
|
4268
4282
|
*
|
|
4283
|
+
* @param url - Optional URL to filter cookies. If provided, returns only cookies valid for this URL.
|
|
4269
4284
|
* @returns A Cookies object with cookies in multiple formats
|
|
4270
4285
|
*
|
|
4271
4286
|
* @example
|
|
4272
4287
|
* ```typescript
|
|
4273
|
-
*
|
|
4288
|
+
* // Get ALL cookies in the jar
|
|
4289
|
+
* const allCookies = rezo.getCookies();
|
|
4274
4290
|
*
|
|
4275
|
-
* //
|
|
4276
|
-
*
|
|
4277
|
-
*
|
|
4278
|
-
* }
|
|
4291
|
+
* // Get cookies valid for a specific URL
|
|
4292
|
+
* const googleCookies = rezo.getCookies('https://google.com');
|
|
4293
|
+
* console.log(googleCookies.string); // Only sends valid cookies for google.com
|
|
4279
4294
|
*
|
|
4280
|
-
* //
|
|
4281
|
-
*
|
|
4295
|
+
* // Access as Cookie instances
|
|
4296
|
+
* for (const cookie of allCookies.array) {
|
|
4297
|
+
* console.log(`${cookie.key}=${cookie.value}`);
|
|
4298
|
+
* }
|
|
4282
4299
|
*
|
|
4283
4300
|
* // Save to Netscape cookie file
|
|
4284
|
-
* fs.writeFileSync('cookies.txt',
|
|
4301
|
+
* fs.writeFileSync('cookies.txt', allCookies.netscape);
|
|
4285
4302
|
*
|
|
4286
4303
|
* // Serialize to JSON for storage
|
|
4287
|
-
* const json = JSON.stringify(
|
|
4304
|
+
* const json = JSON.stringify(allCookies.serialized);
|
|
4288
4305
|
* localStorage.setItem('cookies', json);
|
|
4289
|
-
*
|
|
4290
|
-
* // Get Set-Cookie headers (useful for proxying responses)
|
|
4291
|
-
* for (const setCookie of cookies.setCookiesString) {
|
|
4292
|
-
* console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
|
|
4293
|
-
* }
|
|
4294
|
-
*
|
|
4295
|
-
* // Check cookie count
|
|
4296
|
-
* console.log(`Total cookies: ${cookies.array.length}`);
|
|
4297
|
-
*
|
|
4298
|
-
* // Find specific cookie
|
|
4299
|
-
* const sessionCookie = cookies.array.find(c => c.key === 'session');
|
|
4300
4306
|
* ```
|
|
4301
4307
|
*
|
|
4302
4308
|
* @see {@link setCookies} - Set cookies in the jar
|
|
@@ -4304,6 +4310,7 @@ export declare class Rezo {
|
|
|
4304
4310
|
* @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
|
|
4305
4311
|
*/
|
|
4306
4312
|
getCookies(): Cookies;
|
|
4313
|
+
getCookies(url: string): Cookies;
|
|
4307
4314
|
/**
|
|
4308
4315
|
* Remove all cookies from the cookie jar.
|
|
4309
4316
|
*
|
|
@@ -192,7 +192,17 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
192
192
|
constructor(cookies: Cookie[]);
|
|
193
193
|
constructor(cookies: Cookie[], url: string);
|
|
194
194
|
private generateCookies;
|
|
195
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Get all cookies from the cookie jar.
|
|
197
|
+
*
|
|
198
|
+
* This method synchronously returns all cookies stored in the jar,
|
|
199
|
+
* including both regular and touch cookies.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Cookies} An object containing arrays of all cookies,
|
|
202
|
+
* serialized representations, Netscape format strings, and set-cookie strings
|
|
203
|
+
* @see {@link getCookiesForRequest} - Get cookies for a specific request URL
|
|
204
|
+
*/
|
|
205
|
+
cookies(url?: string): Cookies;
|
|
196
206
|
parseResponseCookies(cookies: Cookie[]): Cookies;
|
|
197
207
|
static toNetscapeCookie(cookies: Cookie[] | SerializedCookie[]): string;
|
|
198
208
|
static toCookieString(cookies: Cookie[] | SerializedCookie[]): string;
|
|
@@ -4253,12 +4263,16 @@ export declare class Rezo {
|
|
|
4253
4263
|
setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
|
|
4254
4264
|
setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
|
|
4255
4265
|
/**
|
|
4256
|
-
* Get
|
|
4266
|
+
* Get cookies from the cookie jar in multiple convenient formats.
|
|
4257
4267
|
*
|
|
4258
|
-
* Returns a `Cookies` object containing
|
|
4268
|
+
* Returns a `Cookies` object containing stored cookies in various formats
|
|
4259
4269
|
* for different use cases. This provides flexible access to cookies for
|
|
4260
4270
|
* HTTP headers, file storage, serialization, or programmatic manipulation.
|
|
4261
4271
|
*
|
|
4272
|
+
* If a `url` is provided, only cookies valid for that URL (matching domain, path,
|
|
4273
|
+
* expiration, etc.) are returned. If no `url` is provided, all cookies in the
|
|
4274
|
+
* jar are returned.
|
|
4275
|
+
*
|
|
4262
4276
|
* The returned `Cookies` object contains:
|
|
4263
4277
|
* - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
|
|
4264
4278
|
* - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
|
|
@@ -4266,37 +4280,29 @@ export declare class Rezo {
|
|
|
4266
4280
|
* - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
|
|
4267
4281
|
* - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
|
|
4268
4282
|
*
|
|
4283
|
+
* @param url - Optional URL to filter cookies. If provided, returns only cookies valid for this URL.
|
|
4269
4284
|
* @returns A Cookies object with cookies in multiple formats
|
|
4270
4285
|
*
|
|
4271
4286
|
* @example
|
|
4272
4287
|
* ```typescript
|
|
4273
|
-
*
|
|
4288
|
+
* // Get ALL cookies in the jar
|
|
4289
|
+
* const allCookies = rezo.getCookies();
|
|
4274
4290
|
*
|
|
4275
|
-
* //
|
|
4276
|
-
*
|
|
4277
|
-
*
|
|
4278
|
-
* }
|
|
4291
|
+
* // Get cookies valid for a specific URL
|
|
4292
|
+
* const googleCookies = rezo.getCookies('https://google.com');
|
|
4293
|
+
* console.log(googleCookies.string); // Only sends valid cookies for google.com
|
|
4279
4294
|
*
|
|
4280
|
-
* //
|
|
4281
|
-
*
|
|
4295
|
+
* // Access as Cookie instances
|
|
4296
|
+
* for (const cookie of allCookies.array) {
|
|
4297
|
+
* console.log(`${cookie.key}=${cookie.value}`);
|
|
4298
|
+
* }
|
|
4282
4299
|
*
|
|
4283
4300
|
* // Save to Netscape cookie file
|
|
4284
|
-
* fs.writeFileSync('cookies.txt',
|
|
4301
|
+
* fs.writeFileSync('cookies.txt', allCookies.netscape);
|
|
4285
4302
|
*
|
|
4286
4303
|
* // Serialize to JSON for storage
|
|
4287
|
-
* const json = JSON.stringify(
|
|
4304
|
+
* const json = JSON.stringify(allCookies.serialized);
|
|
4288
4305
|
* localStorage.setItem('cookies', json);
|
|
4289
|
-
*
|
|
4290
|
-
* // Get Set-Cookie headers (useful for proxying responses)
|
|
4291
|
-
* for (const setCookie of cookies.setCookiesString) {
|
|
4292
|
-
* console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
|
|
4293
|
-
* }
|
|
4294
|
-
*
|
|
4295
|
-
* // Check cookie count
|
|
4296
|
-
* console.log(`Total cookies: ${cookies.array.length}`);
|
|
4297
|
-
*
|
|
4298
|
-
* // Find specific cookie
|
|
4299
|
-
* const sessionCookie = cookies.array.find(c => c.key === 'session');
|
|
4300
4306
|
* ```
|
|
4301
4307
|
*
|
|
4302
4308
|
* @see {@link setCookies} - Set cookies in the jar
|
|
@@ -4304,6 +4310,7 @@ export declare class Rezo {
|
|
|
4304
4310
|
* @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
|
|
4305
4311
|
*/
|
|
4306
4312
|
getCookies(): Cookies;
|
|
4313
|
+
getCookies(url: string): Cookies;
|
|
4307
4314
|
/**
|
|
4308
4315
|
* Remove all cookies from the cookie jar.
|
|
4309
4316
|
*
|
|
@@ -192,7 +192,17 @@ export declare class RezoCookieJar extends TouchCookieJar {
|
|
|
192
192
|
constructor(cookies: Cookie[]);
|
|
193
193
|
constructor(cookies: Cookie[], url: string);
|
|
194
194
|
private generateCookies;
|
|
195
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Get all cookies from the cookie jar.
|
|
197
|
+
*
|
|
198
|
+
* This method synchronously returns all cookies stored in the jar,
|
|
199
|
+
* including both regular and touch cookies.
|
|
200
|
+
*
|
|
201
|
+
* @returns {Cookies} An object containing arrays of all cookies,
|
|
202
|
+
* serialized representations, Netscape format strings, and set-cookie strings
|
|
203
|
+
* @see {@link getCookiesForRequest} - Get cookies for a specific request URL
|
|
204
|
+
*/
|
|
205
|
+
cookies(url?: string): Cookies;
|
|
196
206
|
parseResponseCookies(cookies: Cookie[]): Cookies;
|
|
197
207
|
static toNetscapeCookie(cookies: Cookie[] | SerializedCookie[]): string;
|
|
198
208
|
static toCookieString(cookies: Cookie[] | SerializedCookie[]): string;
|
|
@@ -4253,12 +4263,16 @@ export declare class Rezo {
|
|
|
4253
4263
|
setCookies(setCookieArray: string[], url: string, startNew?: boolean): void;
|
|
4254
4264
|
setCookies(setCookieArray: string[], url: string | undefined, startNew: boolean): void;
|
|
4255
4265
|
/**
|
|
4256
|
-
* Get
|
|
4266
|
+
* Get cookies from the cookie jar in multiple convenient formats.
|
|
4257
4267
|
*
|
|
4258
|
-
* Returns a `Cookies` object containing
|
|
4268
|
+
* Returns a `Cookies` object containing stored cookies in various formats
|
|
4259
4269
|
* for different use cases. This provides flexible access to cookies for
|
|
4260
4270
|
* HTTP headers, file storage, serialization, or programmatic manipulation.
|
|
4261
4271
|
*
|
|
4272
|
+
* If a `url` is provided, only cookies valid for that URL (matching domain, path,
|
|
4273
|
+
* expiration, etc.) are returned. If no `url` is provided, all cookies in the
|
|
4274
|
+
* jar are returned.
|
|
4275
|
+
*
|
|
4262
4276
|
* The returned `Cookies` object contains:
|
|
4263
4277
|
* - **array**: `Cookie[]` - Array of Cookie class instances for programmatic access
|
|
4264
4278
|
* - **serialized**: `SerializedCookie[]` - Plain objects for JSON serialization/storage
|
|
@@ -4266,37 +4280,29 @@ export declare class Rezo {
|
|
|
4266
4280
|
* - **string**: `string` - Cookie header format (`key=value; key2=value2`) for HTTP requests
|
|
4267
4281
|
* - **setCookiesString**: `string[]` - Array of Set-Cookie header strings
|
|
4268
4282
|
*
|
|
4283
|
+
* @param url - Optional URL to filter cookies. If provided, returns only cookies valid for this URL.
|
|
4269
4284
|
* @returns A Cookies object with cookies in multiple formats
|
|
4270
4285
|
*
|
|
4271
4286
|
* @example
|
|
4272
4287
|
* ```typescript
|
|
4273
|
-
*
|
|
4288
|
+
* // Get ALL cookies in the jar
|
|
4289
|
+
* const allCookies = rezo.getCookies();
|
|
4274
4290
|
*
|
|
4275
|
-
* //
|
|
4276
|
-
*
|
|
4277
|
-
*
|
|
4278
|
-
* }
|
|
4291
|
+
* // Get cookies valid for a specific URL
|
|
4292
|
+
* const googleCookies = rezo.getCookies('https://google.com');
|
|
4293
|
+
* console.log(googleCookies.string); // Only sends valid cookies for google.com
|
|
4279
4294
|
*
|
|
4280
|
-
* //
|
|
4281
|
-
*
|
|
4295
|
+
* // Access as Cookie instances
|
|
4296
|
+
* for (const cookie of allCookies.array) {
|
|
4297
|
+
* console.log(`${cookie.key}=${cookie.value}`);
|
|
4298
|
+
* }
|
|
4282
4299
|
*
|
|
4283
4300
|
* // Save to Netscape cookie file
|
|
4284
|
-
* fs.writeFileSync('cookies.txt',
|
|
4301
|
+
* fs.writeFileSync('cookies.txt', allCookies.netscape);
|
|
4285
4302
|
*
|
|
4286
4303
|
* // Serialize to JSON for storage
|
|
4287
|
-
* const json = JSON.stringify(
|
|
4304
|
+
* const json = JSON.stringify(allCookies.serialized);
|
|
4288
4305
|
* localStorage.setItem('cookies', json);
|
|
4289
|
-
*
|
|
4290
|
-
* // Get Set-Cookie headers (useful for proxying responses)
|
|
4291
|
-
* for (const setCookie of cookies.setCookiesString) {
|
|
4292
|
-
* console.log(setCookie); // "session=abc123; Domain=example.com; Path=/; HttpOnly"
|
|
4293
|
-
* }
|
|
4294
|
-
*
|
|
4295
|
-
* // Check cookie count
|
|
4296
|
-
* console.log(`Total cookies: ${cookies.array.length}`);
|
|
4297
|
-
*
|
|
4298
|
-
* // Find specific cookie
|
|
4299
|
-
* const sessionCookie = cookies.array.find(c => c.key === 'session');
|
|
4300
4306
|
* ```
|
|
4301
4307
|
*
|
|
4302
4308
|
* @see {@link setCookies} - Set cookies in the jar
|
|
@@ -4304,6 +4310,7 @@ export declare class Rezo {
|
|
|
4304
4310
|
* @see {@link cookieJar} - Access the underlying RezoCookieJar for more methods
|
|
4305
4311
|
*/
|
|
4306
4312
|
getCookies(): Cookies;
|
|
4313
|
+
getCookies(url: string): Cookies;
|
|
4307
4314
|
/**
|
|
4308
4315
|
* Remove all cookies from the cookie jar.
|
|
4309
4316
|
*
|
package/dist/adapters/http.cjs
CHANGED
|
@@ -569,6 +569,8 @@ async function executeHttp1Request(fetchOptions, config, options, perform, fs, s
|
|
|
569
569
|
} else if (response.status === 301 || response.status === 302 || response.status === 303) {
|
|
570
570
|
debugLog.redirect(config, fromUrl, fetchOptions.fullUrl, redirectCode, "GET");
|
|
571
571
|
options.method = "GET";
|
|
572
|
+
fetchOptions.method = "GET";
|
|
573
|
+
config.method = "GET";
|
|
572
574
|
delete options.body;
|
|
573
575
|
delete fetchOptions.body;
|
|
574
576
|
if (fetchOptions.headers instanceof RezoHeaders) {
|
package/dist/adapters/http.js
CHANGED
|
@@ -569,6 +569,8 @@ async function executeHttp1Request(fetchOptions, config, options, perform, fs, s
|
|
|
569
569
|
} else if (response.status === 301 || response.status === 302 || response.status === 303) {
|
|
570
570
|
debugLog.redirect(config, fromUrl, fetchOptions.fullUrl, redirectCode, "GET");
|
|
571
571
|
options.method = "GET";
|
|
572
|
+
fetchOptions.method = "GET";
|
|
573
|
+
config.method = "GET";
|
|
572
574
|
delete options.body;
|
|
573
575
|
delete fetchOptions.body;
|
|
574
576
|
if (fetchOptions.headers instanceof RezoHeaders) {
|
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_gcypuc = require('./picker.cjs');
|
|
2
|
+
exports.detectRuntime = _mod_gcypuc.detectRuntime;
|
|
3
|
+
exports.getAdapterCapabilities = _mod_gcypuc.getAdapterCapabilities;
|
|
4
|
+
exports.buildAdapterContext = _mod_gcypuc.buildAdapterContext;
|
|
5
|
+
exports.getAvailableAdapters = _mod_gcypuc.getAvailableAdapters;
|
|
6
|
+
exports.selectAdapter = _mod_gcypuc.selectAdapter;;
|
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_m9um2p = require('./lru-cache.cjs');
|
|
2
|
+
exports.LRUCache = _mod_m9um2p.LRUCache;;
|
|
3
|
+
const _mod_tuxxot = require('./dns-cache.cjs');
|
|
4
|
+
exports.DNSCache = _mod_tuxxot.DNSCache;
|
|
5
|
+
exports.getGlobalDNSCache = _mod_tuxxot.getGlobalDNSCache;
|
|
6
|
+
exports.resetGlobalDNSCache = _mod_tuxxot.resetGlobalDNSCache;;
|
|
7
|
+
const _mod_9nb55u = require('./response-cache.cjs');
|
|
8
|
+
exports.ResponseCache = _mod_9nb55u.ResponseCache;
|
|
9
|
+
exports.normalizeResponseCacheConfig = _mod_9nb55u.normalizeResponseCacheConfig;;
|
|
10
|
+
const _mod_kpmhny = require('./file-cacher.cjs');
|
|
11
|
+
exports.FileCacher = _mod_kpmhny.FileCacher;;
|
|
12
|
+
const _mod_3ujd9n = require('./url-store.cjs');
|
|
13
|
+
exports.UrlStore = _mod_3ujd9n.UrlStore;;
|
package/dist/core/rezo.cjs
CHANGED
|
@@ -473,8 +473,8 @@ class Rezo {
|
|
|
473
473
|
this.jar.removeAllCookiesSync();
|
|
474
474
|
this.jar.setCookiesSync(cookies, url);
|
|
475
475
|
}
|
|
476
|
-
getCookies() {
|
|
477
|
-
return this.jar.cookies();
|
|
476
|
+
getCookies(url) {
|
|
477
|
+
return this.jar.cookies(url);
|
|
478
478
|
}
|
|
479
479
|
clearCookies() {
|
|
480
480
|
this.jar?.removeAllCookiesSync();
|