rezo 1.0.19 → 1.0.21
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 +39 -34
- package/dist/adapters/curl.js +39 -34
- package/dist/adapters/entries/curl.d.ts +19 -18
- package/dist/adapters/entries/fetch.d.ts +19 -18
- package/dist/adapters/entries/http.d.ts +19 -18
- package/dist/adapters/entries/http2.d.ts +19 -18
- package/dist/adapters/entries/react-native.d.ts +19 -18
- package/dist/adapters/entries/xhr.d.ts +19 -18
- package/dist/adapters/fetch.cjs +42 -41
- package/dist/adapters/fetch.js +42 -41
- package/dist/adapters/http.cjs +65 -46
- package/dist/adapters/http.js +65 -46
- package/dist/adapters/http2.cjs +41 -36
- package/dist/adapters/http2.js +41 -36
- package/dist/adapters/index.cjs +6 -6
- package/dist/adapters/react-native.cjs +41 -27
- package/dist/adapters/react-native.js +41 -27
- package/dist/adapters/xhr.cjs +43 -38
- package/dist/adapters/xhr.js +43 -38
- package/dist/cache/index.cjs +13 -13
- package/dist/crawler.d.ts +19 -18
- package/dist/entries/crawler.cjs +5 -5
- package/dist/errors/rezo-error.cjs +139 -21
- package/dist/errors/rezo-error.js +138 -21
- package/dist/index.cjs +24 -24
- package/dist/index.d.ts +19 -18
- package/dist/platform/browser.d.ts +19 -18
- package/dist/platform/bun.d.ts +19 -18
- package/dist/platform/deno.d.ts +19 -18
- package/dist/platform/node.d.ts +19 -18
- package/dist/platform/react-native.d.ts +19 -18
- package/dist/platform/worker.d.ts +19 -18
- package/dist/plugin/index.cjs +36 -36
- package/dist/proxy/index.cjs +2 -2
- package/dist/queue/index.cjs +8 -8
- package/dist/utils/http-config.cjs +6 -3
- package/dist/utils/http-config.js +6 -3
- package/dist/utils/timing.cjs +90 -0
- package/dist/utils/timing.js +78 -0
- package/package.json +1 -1
package/dist/platform/bun.d.ts
CHANGED
|
@@ -1815,24 +1815,26 @@ export interface RezoConfig {
|
|
|
1815
1815
|
* - removeAllCookiesSync(): Clear all cookies
|
|
1816
1816
|
*/
|
|
1817
1817
|
cookieJar: RezoCookieJar;
|
|
1818
|
-
/** @description Comprehensive timing information */
|
|
1818
|
+
/** @description Comprehensive timing information (matches PerformanceResourceTiming API) */
|
|
1819
1819
|
timing: {
|
|
1820
|
-
/** @description Request start timestamp (
|
|
1821
|
-
|
|
1822
|
-
/** @description
|
|
1823
|
-
|
|
1824
|
-
/** @description DNS lookup
|
|
1825
|
-
|
|
1826
|
-
/** @description
|
|
1827
|
-
|
|
1828
|
-
/** @description TLS handshake
|
|
1829
|
-
|
|
1830
|
-
/** @description
|
|
1831
|
-
|
|
1832
|
-
/** @description
|
|
1833
|
-
|
|
1834
|
-
/** @description
|
|
1835
|
-
|
|
1820
|
+
/** @description Request start timestamp (performance.now() value when request began) */
|
|
1821
|
+
startTime: number;
|
|
1822
|
+
/** @description Timestamp when DNS lookup started */
|
|
1823
|
+
domainLookupStart: number;
|
|
1824
|
+
/** @description Timestamp when DNS lookup ended */
|
|
1825
|
+
domainLookupEnd: number;
|
|
1826
|
+
/** @description Timestamp when connection started */
|
|
1827
|
+
connectStart: number;
|
|
1828
|
+
/** @description Timestamp when TLS handshake started (0 for HTTP) */
|
|
1829
|
+
secureConnectionStart: number;
|
|
1830
|
+
/** @description Timestamp when connection completed */
|
|
1831
|
+
connectEnd: number;
|
|
1832
|
+
/** @description Timestamp when request was sent */
|
|
1833
|
+
requestStart: number;
|
|
1834
|
+
/** @description Timestamp when first byte of response received */
|
|
1835
|
+
responseStart: number;
|
|
1836
|
+
/** @description Timestamp when response completed */
|
|
1837
|
+
responseEnd: number;
|
|
1836
1838
|
};
|
|
1837
1839
|
/** @description Network connection information */
|
|
1838
1840
|
network: {
|
|
@@ -2012,7 +2014,6 @@ export declare class RezoError<T = any> extends Error {
|
|
|
2012
2014
|
readonly isSocksError: boolean;
|
|
2013
2015
|
readonly isTlsError: boolean;
|
|
2014
2016
|
readonly isRetryable: boolean;
|
|
2015
|
-
readonly details: string;
|
|
2016
2017
|
readonly suggestion: string;
|
|
2017
2018
|
constructor(message: string, config: RezoConfig, code?: string, request?: RezoHttpRequest, response?: RezoResponse<T>);
|
|
2018
2019
|
static isRezoError(error: unknown): error is RezoError;
|
package/dist/platform/deno.d.ts
CHANGED
|
@@ -1815,24 +1815,26 @@ export interface RezoConfig {
|
|
|
1815
1815
|
* - removeAllCookiesSync(): Clear all cookies
|
|
1816
1816
|
*/
|
|
1817
1817
|
cookieJar: RezoCookieJar;
|
|
1818
|
-
/** @description Comprehensive timing information */
|
|
1818
|
+
/** @description Comprehensive timing information (matches PerformanceResourceTiming API) */
|
|
1819
1819
|
timing: {
|
|
1820
|
-
/** @description Request start timestamp (
|
|
1821
|
-
|
|
1822
|
-
/** @description
|
|
1823
|
-
|
|
1824
|
-
/** @description DNS lookup
|
|
1825
|
-
|
|
1826
|
-
/** @description
|
|
1827
|
-
|
|
1828
|
-
/** @description TLS handshake
|
|
1829
|
-
|
|
1830
|
-
/** @description
|
|
1831
|
-
|
|
1832
|
-
/** @description
|
|
1833
|
-
|
|
1834
|
-
/** @description
|
|
1835
|
-
|
|
1820
|
+
/** @description Request start timestamp (performance.now() value when request began) */
|
|
1821
|
+
startTime: number;
|
|
1822
|
+
/** @description Timestamp when DNS lookup started */
|
|
1823
|
+
domainLookupStart: number;
|
|
1824
|
+
/** @description Timestamp when DNS lookup ended */
|
|
1825
|
+
domainLookupEnd: number;
|
|
1826
|
+
/** @description Timestamp when connection started */
|
|
1827
|
+
connectStart: number;
|
|
1828
|
+
/** @description Timestamp when TLS handshake started (0 for HTTP) */
|
|
1829
|
+
secureConnectionStart: number;
|
|
1830
|
+
/** @description Timestamp when connection completed */
|
|
1831
|
+
connectEnd: number;
|
|
1832
|
+
/** @description Timestamp when request was sent */
|
|
1833
|
+
requestStart: number;
|
|
1834
|
+
/** @description Timestamp when first byte of response received */
|
|
1835
|
+
responseStart: number;
|
|
1836
|
+
/** @description Timestamp when response completed */
|
|
1837
|
+
responseEnd: number;
|
|
1836
1838
|
};
|
|
1837
1839
|
/** @description Network connection information */
|
|
1838
1840
|
network: {
|
|
@@ -2012,7 +2014,6 @@ export declare class RezoError<T = any> extends Error {
|
|
|
2012
2014
|
readonly isSocksError: boolean;
|
|
2013
2015
|
readonly isTlsError: boolean;
|
|
2014
2016
|
readonly isRetryable: boolean;
|
|
2015
|
-
readonly details: string;
|
|
2016
2017
|
readonly suggestion: string;
|
|
2017
2018
|
constructor(message: string, config: RezoConfig, code?: string, request?: RezoHttpRequest, response?: RezoResponse<T>);
|
|
2018
2019
|
static isRezoError(error: unknown): error is RezoError;
|
package/dist/platform/node.d.ts
CHANGED
|
@@ -1815,24 +1815,26 @@ export interface RezoConfig {
|
|
|
1815
1815
|
* - removeAllCookiesSync(): Clear all cookies
|
|
1816
1816
|
*/
|
|
1817
1817
|
cookieJar: RezoCookieJar;
|
|
1818
|
-
/** @description Comprehensive timing information */
|
|
1818
|
+
/** @description Comprehensive timing information (matches PerformanceResourceTiming API) */
|
|
1819
1819
|
timing: {
|
|
1820
|
-
/** @description Request start timestamp (
|
|
1821
|
-
|
|
1822
|
-
/** @description
|
|
1823
|
-
|
|
1824
|
-
/** @description DNS lookup
|
|
1825
|
-
|
|
1826
|
-
/** @description
|
|
1827
|
-
|
|
1828
|
-
/** @description TLS handshake
|
|
1829
|
-
|
|
1830
|
-
/** @description
|
|
1831
|
-
|
|
1832
|
-
/** @description
|
|
1833
|
-
|
|
1834
|
-
/** @description
|
|
1835
|
-
|
|
1820
|
+
/** @description Request start timestamp (performance.now() value when request began) */
|
|
1821
|
+
startTime: number;
|
|
1822
|
+
/** @description Timestamp when DNS lookup started */
|
|
1823
|
+
domainLookupStart: number;
|
|
1824
|
+
/** @description Timestamp when DNS lookup ended */
|
|
1825
|
+
domainLookupEnd: number;
|
|
1826
|
+
/** @description Timestamp when connection started */
|
|
1827
|
+
connectStart: number;
|
|
1828
|
+
/** @description Timestamp when TLS handshake started (0 for HTTP) */
|
|
1829
|
+
secureConnectionStart: number;
|
|
1830
|
+
/** @description Timestamp when connection completed */
|
|
1831
|
+
connectEnd: number;
|
|
1832
|
+
/** @description Timestamp when request was sent */
|
|
1833
|
+
requestStart: number;
|
|
1834
|
+
/** @description Timestamp when first byte of response received */
|
|
1835
|
+
responseStart: number;
|
|
1836
|
+
/** @description Timestamp when response completed */
|
|
1837
|
+
responseEnd: number;
|
|
1836
1838
|
};
|
|
1837
1839
|
/** @description Network connection information */
|
|
1838
1840
|
network: {
|
|
@@ -2012,7 +2014,6 @@ export declare class RezoError<T = any> extends Error {
|
|
|
2012
2014
|
readonly isSocksError: boolean;
|
|
2013
2015
|
readonly isTlsError: boolean;
|
|
2014
2016
|
readonly isRetryable: boolean;
|
|
2015
|
-
readonly details: string;
|
|
2016
2017
|
readonly suggestion: string;
|
|
2017
2018
|
constructor(message: string, config: RezoConfig, code?: string, request?: RezoHttpRequest, response?: RezoResponse<T>);
|
|
2018
2019
|
static isRezoError(error: unknown): error is RezoError;
|
|
@@ -1815,24 +1815,26 @@ export interface RezoConfig {
|
|
|
1815
1815
|
* - removeAllCookiesSync(): Clear all cookies
|
|
1816
1816
|
*/
|
|
1817
1817
|
cookieJar: RezoCookieJar;
|
|
1818
|
-
/** @description Comprehensive timing information */
|
|
1818
|
+
/** @description Comprehensive timing information (matches PerformanceResourceTiming API) */
|
|
1819
1819
|
timing: {
|
|
1820
|
-
/** @description Request start timestamp (
|
|
1821
|
-
|
|
1822
|
-
/** @description
|
|
1823
|
-
|
|
1824
|
-
/** @description DNS lookup
|
|
1825
|
-
|
|
1826
|
-
/** @description
|
|
1827
|
-
|
|
1828
|
-
/** @description TLS handshake
|
|
1829
|
-
|
|
1830
|
-
/** @description
|
|
1831
|
-
|
|
1832
|
-
/** @description
|
|
1833
|
-
|
|
1834
|
-
/** @description
|
|
1835
|
-
|
|
1820
|
+
/** @description Request start timestamp (performance.now() value when request began) */
|
|
1821
|
+
startTime: number;
|
|
1822
|
+
/** @description Timestamp when DNS lookup started */
|
|
1823
|
+
domainLookupStart: number;
|
|
1824
|
+
/** @description Timestamp when DNS lookup ended */
|
|
1825
|
+
domainLookupEnd: number;
|
|
1826
|
+
/** @description Timestamp when connection started */
|
|
1827
|
+
connectStart: number;
|
|
1828
|
+
/** @description Timestamp when TLS handshake started (0 for HTTP) */
|
|
1829
|
+
secureConnectionStart: number;
|
|
1830
|
+
/** @description Timestamp when connection completed */
|
|
1831
|
+
connectEnd: number;
|
|
1832
|
+
/** @description Timestamp when request was sent */
|
|
1833
|
+
requestStart: number;
|
|
1834
|
+
/** @description Timestamp when first byte of response received */
|
|
1835
|
+
responseStart: number;
|
|
1836
|
+
/** @description Timestamp when response completed */
|
|
1837
|
+
responseEnd: number;
|
|
1836
1838
|
};
|
|
1837
1839
|
/** @description Network connection information */
|
|
1838
1840
|
network: {
|
|
@@ -2012,7 +2014,6 @@ export declare class RezoError<T = any> extends Error {
|
|
|
2012
2014
|
readonly isSocksError: boolean;
|
|
2013
2015
|
readonly isTlsError: boolean;
|
|
2014
2016
|
readonly isRetryable: boolean;
|
|
2015
|
-
readonly details: string;
|
|
2016
2017
|
readonly suggestion: string;
|
|
2017
2018
|
constructor(message: string, config: RezoConfig, code?: string, request?: RezoHttpRequest, response?: RezoResponse<T>);
|
|
2018
2019
|
static isRezoError(error: unknown): error is RezoError;
|
|
@@ -1815,24 +1815,26 @@ export interface RezoConfig {
|
|
|
1815
1815
|
* - removeAllCookiesSync(): Clear all cookies
|
|
1816
1816
|
*/
|
|
1817
1817
|
cookieJar: RezoCookieJar;
|
|
1818
|
-
/** @description Comprehensive timing information */
|
|
1818
|
+
/** @description Comprehensive timing information (matches PerformanceResourceTiming API) */
|
|
1819
1819
|
timing: {
|
|
1820
|
-
/** @description Request start timestamp (
|
|
1821
|
-
|
|
1822
|
-
/** @description
|
|
1823
|
-
|
|
1824
|
-
/** @description DNS lookup
|
|
1825
|
-
|
|
1826
|
-
/** @description
|
|
1827
|
-
|
|
1828
|
-
/** @description TLS handshake
|
|
1829
|
-
|
|
1830
|
-
/** @description
|
|
1831
|
-
|
|
1832
|
-
/** @description
|
|
1833
|
-
|
|
1834
|
-
/** @description
|
|
1835
|
-
|
|
1820
|
+
/** @description Request start timestamp (performance.now() value when request began) */
|
|
1821
|
+
startTime: number;
|
|
1822
|
+
/** @description Timestamp when DNS lookup started */
|
|
1823
|
+
domainLookupStart: number;
|
|
1824
|
+
/** @description Timestamp when DNS lookup ended */
|
|
1825
|
+
domainLookupEnd: number;
|
|
1826
|
+
/** @description Timestamp when connection started */
|
|
1827
|
+
connectStart: number;
|
|
1828
|
+
/** @description Timestamp when TLS handshake started (0 for HTTP) */
|
|
1829
|
+
secureConnectionStart: number;
|
|
1830
|
+
/** @description Timestamp when connection completed */
|
|
1831
|
+
connectEnd: number;
|
|
1832
|
+
/** @description Timestamp when request was sent */
|
|
1833
|
+
requestStart: number;
|
|
1834
|
+
/** @description Timestamp when first byte of response received */
|
|
1835
|
+
responseStart: number;
|
|
1836
|
+
/** @description Timestamp when response completed */
|
|
1837
|
+
responseEnd: number;
|
|
1836
1838
|
};
|
|
1837
1839
|
/** @description Network connection information */
|
|
1838
1840
|
network: {
|
|
@@ -2012,7 +2014,6 @@ export declare class RezoError<T = any> extends Error {
|
|
|
2012
2014
|
readonly isSocksError: boolean;
|
|
2013
2015
|
readonly isTlsError: boolean;
|
|
2014
2016
|
readonly isRetryable: boolean;
|
|
2015
|
-
readonly details: string;
|
|
2016
2017
|
readonly suggestion: string;
|
|
2017
2018
|
constructor(message: string, config: RezoConfig, code?: string, request?: RezoHttpRequest, response?: RezoResponse<T>);
|
|
2018
2019
|
static isRezoError(error: unknown): error is RezoError;
|
package/dist/plugin/index.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Crawler =
|
|
3
|
-
const
|
|
4
|
-
exports.CrawlerOptions =
|
|
5
|
-
const
|
|
6
|
-
exports.FileCacher =
|
|
7
|
-
const
|
|
8
|
-
exports.UrlStore =
|
|
9
|
-
const
|
|
10
|
-
exports.Oxylabs =
|
|
11
|
-
const
|
|
12
|
-
exports.OXYLABS_BROWSER_TYPES =
|
|
13
|
-
exports.OXYLABS_COMMON_LOCALES =
|
|
14
|
-
exports.OXYLABS_COMMON_GEO_LOCATIONS =
|
|
15
|
-
exports.OXYLABS_US_STATES =
|
|
16
|
-
exports.OXYLABS_EUROPEAN_COUNTRIES =
|
|
17
|
-
exports.OXYLABS_ASIAN_COUNTRIES =
|
|
18
|
-
exports.getRandomOxylabsBrowserType =
|
|
19
|
-
exports.getRandomOxylabsLocale =
|
|
20
|
-
exports.getRandomOxylabsGeoLocation =
|
|
21
|
-
const
|
|
22
|
-
exports.Decodo =
|
|
23
|
-
const
|
|
24
|
-
exports.DECODO_DEVICE_TYPES =
|
|
25
|
-
exports.DECODO_HEADLESS_MODES =
|
|
26
|
-
exports.DECODO_COMMON_LOCALES =
|
|
27
|
-
exports.DECODO_COMMON_COUNTRIES =
|
|
28
|
-
exports.DECODO_EUROPEAN_COUNTRIES =
|
|
29
|
-
exports.DECODO_ASIAN_COUNTRIES =
|
|
30
|
-
exports.DECODO_US_STATES =
|
|
31
|
-
exports.DECODO_COMMON_CITIES =
|
|
32
|
-
exports.getRandomDecodoDeviceType =
|
|
33
|
-
exports.getRandomDecodoLocale =
|
|
34
|
-
exports.getRandomDecodoCountry =
|
|
35
|
-
exports.getRandomDecodoCity =
|
|
36
|
-
exports.generateDecodoSessionId =
|
|
1
|
+
const _mod_biedh3 = require('./crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_biedh3.Crawler;;
|
|
3
|
+
const _mod_t5bcfi = require('./crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_t5bcfi.CrawlerOptions;;
|
|
5
|
+
const _mod_fhs26e = require('../cache/file-cacher.cjs');
|
|
6
|
+
exports.FileCacher = _mod_fhs26e.FileCacher;;
|
|
7
|
+
const _mod_nqlyec = require('../cache/url-store.cjs');
|
|
8
|
+
exports.UrlStore = _mod_nqlyec.UrlStore;;
|
|
9
|
+
const _mod_4hdlkj = require('./addon/oxylabs/index.cjs');
|
|
10
|
+
exports.Oxylabs = _mod_4hdlkj.Oxylabs;;
|
|
11
|
+
const _mod_jpwlfi = require('./addon/oxylabs/options.cjs');
|
|
12
|
+
exports.OXYLABS_BROWSER_TYPES = _mod_jpwlfi.OXYLABS_BROWSER_TYPES;
|
|
13
|
+
exports.OXYLABS_COMMON_LOCALES = _mod_jpwlfi.OXYLABS_COMMON_LOCALES;
|
|
14
|
+
exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_jpwlfi.OXYLABS_COMMON_GEO_LOCATIONS;
|
|
15
|
+
exports.OXYLABS_US_STATES = _mod_jpwlfi.OXYLABS_US_STATES;
|
|
16
|
+
exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_jpwlfi.OXYLABS_EUROPEAN_COUNTRIES;
|
|
17
|
+
exports.OXYLABS_ASIAN_COUNTRIES = _mod_jpwlfi.OXYLABS_ASIAN_COUNTRIES;
|
|
18
|
+
exports.getRandomOxylabsBrowserType = _mod_jpwlfi.getRandomBrowserType;
|
|
19
|
+
exports.getRandomOxylabsLocale = _mod_jpwlfi.getRandomLocale;
|
|
20
|
+
exports.getRandomOxylabsGeoLocation = _mod_jpwlfi.getRandomGeoLocation;;
|
|
21
|
+
const _mod_0sldke = require('./addon/decodo/index.cjs');
|
|
22
|
+
exports.Decodo = _mod_0sldke.Decodo;;
|
|
23
|
+
const _mod_sb934b = require('./addon/decodo/options.cjs');
|
|
24
|
+
exports.DECODO_DEVICE_TYPES = _mod_sb934b.DECODO_DEVICE_TYPES;
|
|
25
|
+
exports.DECODO_HEADLESS_MODES = _mod_sb934b.DECODO_HEADLESS_MODES;
|
|
26
|
+
exports.DECODO_COMMON_LOCALES = _mod_sb934b.DECODO_COMMON_LOCALES;
|
|
27
|
+
exports.DECODO_COMMON_COUNTRIES = _mod_sb934b.DECODO_COMMON_COUNTRIES;
|
|
28
|
+
exports.DECODO_EUROPEAN_COUNTRIES = _mod_sb934b.DECODO_EUROPEAN_COUNTRIES;
|
|
29
|
+
exports.DECODO_ASIAN_COUNTRIES = _mod_sb934b.DECODO_ASIAN_COUNTRIES;
|
|
30
|
+
exports.DECODO_US_STATES = _mod_sb934b.DECODO_US_STATES;
|
|
31
|
+
exports.DECODO_COMMON_CITIES = _mod_sb934b.DECODO_COMMON_CITIES;
|
|
32
|
+
exports.getRandomDecodoDeviceType = _mod_sb934b.getRandomDeviceType;
|
|
33
|
+
exports.getRandomDecodoLocale = _mod_sb934b.getRandomLocale;
|
|
34
|
+
exports.getRandomDecodoCountry = _mod_sb934b.getRandomCountry;
|
|
35
|
+
exports.getRandomDecodoCity = _mod_sb934b.getRandomCity;
|
|
36
|
+
exports.generateDecodoSessionId = _mod_sb934b.generateSessionId;;
|
package/dist/proxy/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { SocksProxyAgent: RezoSocksProxy } = require("socks-proxy-agent");
|
|
2
2
|
const { HttpsProxyAgent: RezoHttpsSocks } = require("https-proxy-agent");
|
|
3
3
|
const { HttpProxyAgent: RezoHttpSocks } = require("http-proxy-agent");
|
|
4
|
-
const
|
|
5
|
-
exports.ProxyManager =
|
|
4
|
+
const _mod_vkj5br = require('./manager.cjs');
|
|
5
|
+
exports.ProxyManager = _mod_vkj5br.ProxyManager;;
|
|
6
6
|
function createOptions(uri, opts) {
|
|
7
7
|
if (uri instanceof URL || typeof uri === "string") {
|
|
8
8
|
return {
|
package/dist/queue/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.RezoQueue =
|
|
3
|
-
const
|
|
4
|
-
exports.HttpQueue =
|
|
5
|
-
exports.extractDomain =
|
|
6
|
-
const
|
|
7
|
-
exports.Priority =
|
|
8
|
-
exports.HttpMethodPriority =
|
|
1
|
+
const _mod_bn1v0t = require('./queue.cjs');
|
|
2
|
+
exports.RezoQueue = _mod_bn1v0t.RezoQueue;;
|
|
3
|
+
const _mod_pkpo24 = require('./http-queue.cjs');
|
|
4
|
+
exports.HttpQueue = _mod_pkpo24.HttpQueue;
|
|
5
|
+
exports.extractDomain = _mod_pkpo24.extractDomain;;
|
|
6
|
+
const _mod_w6ii81 = require('./types.cjs');
|
|
7
|
+
exports.Priority = _mod_w6ii81.Priority;
|
|
8
|
+
exports.HttpMethodPriority = _mod_w6ii81.HttpMethodPriority;;
|
|
@@ -186,6 +186,7 @@ async function getDefaultConfig(config = {}, proxyManager) {
|
|
|
186
186
|
httpAgent: config.httpAgent,
|
|
187
187
|
httpsAgent: config.httpsAgent,
|
|
188
188
|
debug: config.debug === true,
|
|
189
|
+
trackUrl: config.trackUrl === true,
|
|
189
190
|
maxRedirects: config.maxRedirects,
|
|
190
191
|
retry: config.retry,
|
|
191
192
|
proxy: config.proxy,
|
|
@@ -269,10 +270,12 @@ function prepareHTTPOptions(options, jar, addedOptions, config) {
|
|
|
269
270
|
cookieJar.setCookiesSync(options.cookies, options.url instanceof URL ? options.url.href : options.url);
|
|
270
271
|
}
|
|
271
272
|
}
|
|
273
|
+
const resolvedUrl = fetchOptions.url || options.url;
|
|
274
|
+
const cookieUrl = resolvedUrl instanceof URL ? resolvedUrl.href : resolvedUrl;
|
|
272
275
|
let cookiesString = "";
|
|
273
276
|
if (config.useCookies) {
|
|
274
|
-
requestCookies = cookieJar.getCookiesSync(
|
|
275
|
-
cookiesString = cookieJar.getCookieStringSync(
|
|
277
|
+
requestCookies = cookieJar.getCookiesSync(cookieUrl).map((c) => new Cookie(c));
|
|
278
|
+
cookiesString = cookieJar.getCookieStringSync(cookieUrl);
|
|
276
279
|
}
|
|
277
280
|
if (options.xsrfCookieName && options.xsrfHeaderName && requestCookies.length > 0) {
|
|
278
281
|
const xsrfCookie = requestCookies.find((c) => c.key === options.xsrfCookieName);
|
|
@@ -285,7 +288,7 @@ function prepareHTTPOptions(options, jar, addedOptions, config) {
|
|
|
285
288
|
config.requestCookies = requestCookies;
|
|
286
289
|
} else {
|
|
287
290
|
for (const cookie of requestCookies) {
|
|
288
|
-
config.requestCookies = config.requestCookies.filter((c) => c.key
|
|
291
|
+
config.requestCookies = config.requestCookies.filter((c) => !(c.key === cookie.key && c.domain === cookie.domain));
|
|
289
292
|
config.requestCookies.push(cookie);
|
|
290
293
|
}
|
|
291
294
|
}
|
|
@@ -186,6 +186,7 @@ export async function getDefaultConfig(config = {}, proxyManager) {
|
|
|
186
186
|
httpAgent: config.httpAgent,
|
|
187
187
|
httpsAgent: config.httpsAgent,
|
|
188
188
|
debug: config.debug === true,
|
|
189
|
+
trackUrl: config.trackUrl === true,
|
|
189
190
|
maxRedirects: config.maxRedirects,
|
|
190
191
|
retry: config.retry,
|
|
191
192
|
proxy: config.proxy,
|
|
@@ -269,10 +270,12 @@ export function prepareHTTPOptions(options, jar, addedOptions, config) {
|
|
|
269
270
|
cookieJar.setCookiesSync(options.cookies, options.url instanceof URL ? options.url.href : options.url);
|
|
270
271
|
}
|
|
271
272
|
}
|
|
273
|
+
const resolvedUrl = fetchOptions.url || options.url;
|
|
274
|
+
const cookieUrl = resolvedUrl instanceof URL ? resolvedUrl.href : resolvedUrl;
|
|
272
275
|
let cookiesString = "";
|
|
273
276
|
if (config.useCookies) {
|
|
274
|
-
requestCookies = cookieJar.getCookiesSync(
|
|
275
|
-
cookiesString = cookieJar.getCookieStringSync(
|
|
277
|
+
requestCookies = cookieJar.getCookiesSync(cookieUrl).map((c) => new Cookie(c));
|
|
278
|
+
cookiesString = cookieJar.getCookieStringSync(cookieUrl);
|
|
276
279
|
}
|
|
277
280
|
if (options.xsrfCookieName && options.xsrfHeaderName && requestCookies.length > 0) {
|
|
278
281
|
const xsrfCookie = requestCookies.find((c) => c.key === options.xsrfCookieName);
|
|
@@ -285,7 +288,7 @@ export function prepareHTTPOptions(options, jar, addedOptions, config) {
|
|
|
285
288
|
config.requestCookies = requestCookies;
|
|
286
289
|
} else {
|
|
287
290
|
for (const cookie of requestCookies) {
|
|
288
|
-
config.requestCookies = config.requestCookies.filter((c) => c.key
|
|
291
|
+
config.requestCookies = config.requestCookies.filter((c) => !(c.key === cookie.key && c.domain === cookie.domain));
|
|
289
292
|
config.requestCookies.push(cookie);
|
|
290
293
|
}
|
|
291
294
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
function createTimingTracker() {
|
|
2
|
+
return {
|
|
3
|
+
startTime: performance.now()
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
function markDnsStart(tracker) {
|
|
7
|
+
if (!tracker.dnsStart) {
|
|
8
|
+
tracker.dnsStart = performance.now();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function markDnsEnd(tracker) {
|
|
12
|
+
if (!tracker.dnsEnd) {
|
|
13
|
+
tracker.dnsEnd = performance.now();
|
|
14
|
+
if (!tracker.tcpStart) {
|
|
15
|
+
tracker.tcpStart = tracker.dnsEnd;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function markConnectStart(tracker) {
|
|
20
|
+
if (!tracker.tcpStart) {
|
|
21
|
+
tracker.tcpStart = performance.now();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function markSecureConnectStart(tracker) {
|
|
25
|
+
if (!tracker.tlsStart) {
|
|
26
|
+
tracker.tlsStart = performance.now();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function markConnectEnd(tracker) {
|
|
30
|
+
const now = performance.now();
|
|
31
|
+
if (!tracker.tcpEnd) {
|
|
32
|
+
tracker.tcpEnd = now;
|
|
33
|
+
}
|
|
34
|
+
if (!tracker.tlsEnd && tracker.tlsStart) {
|
|
35
|
+
tracker.tlsEnd = now;
|
|
36
|
+
}
|
|
37
|
+
if (!tracker.requestStart) {
|
|
38
|
+
tracker.requestStart = now;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function markRequestStart(tracker) {
|
|
42
|
+
if (!tracker.requestStart) {
|
|
43
|
+
tracker.requestStart = performance.now();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function markResponseStart(tracker) {
|
|
47
|
+
if (!tracker.firstByteTime) {
|
|
48
|
+
tracker.firstByteTime = performance.now();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function markResponseEnd(tracker) {
|
|
52
|
+
tracker.responseEnd = performance.now();
|
|
53
|
+
}
|
|
54
|
+
function buildTimingMarks(tracker) {
|
|
55
|
+
const now = tracker.responseEnd || performance.now();
|
|
56
|
+
const start = tracker.startTime;
|
|
57
|
+
return {
|
|
58
|
+
startTime: start,
|
|
59
|
+
domainLookupStart: tracker.dnsStart ?? start,
|
|
60
|
+
domainLookupEnd: tracker.dnsEnd ?? tracker.dnsStart ?? start,
|
|
61
|
+
connectStart: tracker.tcpStart ?? tracker.dnsEnd ?? start,
|
|
62
|
+
secureConnectionStart: tracker.tlsStart ?? 0,
|
|
63
|
+
connectEnd: tracker.tcpEnd ?? tracker.tlsEnd ?? tracker.tcpStart ?? start,
|
|
64
|
+
requestStart: tracker.requestStart ?? tracker.tcpEnd ?? start,
|
|
65
|
+
responseStart: tracker.firstByteTime ?? tracker.requestStart ?? start,
|
|
66
|
+
responseEnd: now
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function getTimingDurations(marks) {
|
|
70
|
+
return {
|
|
71
|
+
dns: marks.domainLookupEnd - marks.domainLookupStart,
|
|
72
|
+
tcp: marks.secureConnectionStart > 0 ? marks.secureConnectionStart - marks.connectStart : marks.connectEnd - marks.connectStart,
|
|
73
|
+
tls: marks.secureConnectionStart > 0 ? marks.connectEnd - marks.secureConnectionStart : 0,
|
|
74
|
+
ttfb: marks.responseStart - marks.startTime,
|
|
75
|
+
transfer: marks.responseEnd - marks.responseStart,
|
|
76
|
+
total: marks.responseEnd - marks.startTime
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
exports.createTimingTracker = createTimingTracker;
|
|
81
|
+
exports.markDnsStart = markDnsStart;
|
|
82
|
+
exports.markDnsEnd = markDnsEnd;
|
|
83
|
+
exports.markConnectStart = markConnectStart;
|
|
84
|
+
exports.markSecureConnectStart = markSecureConnectStart;
|
|
85
|
+
exports.markConnectEnd = markConnectEnd;
|
|
86
|
+
exports.markRequestStart = markRequestStart;
|
|
87
|
+
exports.markResponseStart = markResponseStart;
|
|
88
|
+
exports.markResponseEnd = markResponseEnd;
|
|
89
|
+
exports.buildTimingMarks = buildTimingMarks;
|
|
90
|
+
exports.getTimingDurations = getTimingDurations;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export function createTimingTracker() {
|
|
2
|
+
return {
|
|
3
|
+
startTime: performance.now()
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
export function markDnsStart(tracker) {
|
|
7
|
+
if (!tracker.dnsStart) {
|
|
8
|
+
tracker.dnsStart = performance.now();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function markDnsEnd(tracker) {
|
|
12
|
+
if (!tracker.dnsEnd) {
|
|
13
|
+
tracker.dnsEnd = performance.now();
|
|
14
|
+
if (!tracker.tcpStart) {
|
|
15
|
+
tracker.tcpStart = tracker.dnsEnd;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function markConnectStart(tracker) {
|
|
20
|
+
if (!tracker.tcpStart) {
|
|
21
|
+
tracker.tcpStart = performance.now();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function markSecureConnectStart(tracker) {
|
|
25
|
+
if (!tracker.tlsStart) {
|
|
26
|
+
tracker.tlsStart = performance.now();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function markConnectEnd(tracker) {
|
|
30
|
+
const now = performance.now();
|
|
31
|
+
if (!tracker.tcpEnd) {
|
|
32
|
+
tracker.tcpEnd = now;
|
|
33
|
+
}
|
|
34
|
+
if (!tracker.tlsEnd && tracker.tlsStart) {
|
|
35
|
+
tracker.tlsEnd = now;
|
|
36
|
+
}
|
|
37
|
+
if (!tracker.requestStart) {
|
|
38
|
+
tracker.requestStart = now;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export function markRequestStart(tracker) {
|
|
42
|
+
if (!tracker.requestStart) {
|
|
43
|
+
tracker.requestStart = performance.now();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function markResponseStart(tracker) {
|
|
47
|
+
if (!tracker.firstByteTime) {
|
|
48
|
+
tracker.firstByteTime = performance.now();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function markResponseEnd(tracker) {
|
|
52
|
+
tracker.responseEnd = performance.now();
|
|
53
|
+
}
|
|
54
|
+
export function buildTimingMarks(tracker) {
|
|
55
|
+
const now = tracker.responseEnd || performance.now();
|
|
56
|
+
const start = tracker.startTime;
|
|
57
|
+
return {
|
|
58
|
+
startTime: start,
|
|
59
|
+
domainLookupStart: tracker.dnsStart ?? start,
|
|
60
|
+
domainLookupEnd: tracker.dnsEnd ?? tracker.dnsStart ?? start,
|
|
61
|
+
connectStart: tracker.tcpStart ?? tracker.dnsEnd ?? start,
|
|
62
|
+
secureConnectionStart: tracker.tlsStart ?? 0,
|
|
63
|
+
connectEnd: tracker.tcpEnd ?? tracker.tlsEnd ?? tracker.tcpStart ?? start,
|
|
64
|
+
requestStart: tracker.requestStart ?? tracker.tcpEnd ?? start,
|
|
65
|
+
responseStart: tracker.firstByteTime ?? tracker.requestStart ?? start,
|
|
66
|
+
responseEnd: now
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export function getTimingDurations(marks) {
|
|
70
|
+
return {
|
|
71
|
+
dns: marks.domainLookupEnd - marks.domainLookupStart,
|
|
72
|
+
tcp: marks.secureConnectionStart > 0 ? marks.secureConnectionStart - marks.connectStart : marks.connectEnd - marks.connectStart,
|
|
73
|
+
tls: marks.secureConnectionStart > 0 ? marks.connectEnd - marks.secureConnectionStart : 0,
|
|
74
|
+
ttfb: marks.responseStart - marks.startTime,
|
|
75
|
+
transfer: marks.responseEnd - marks.responseStart,
|
|
76
|
+
total: marks.responseEnd - marks.startTime
|
|
77
|
+
};
|
|
78
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rezo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Lightning-fast, enterprise-grade HTTP client for modern JavaScript. Full HTTP/2 support, intelligent cookie management, multiple adapters (HTTP, Fetch, cURL, XHR), streaming, proxy support (HTTP/HTTPS/SOCKS), and cross-environment compatibility.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|