rezo 1.0.18 → 1.0.20

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.
Files changed (38) hide show
  1. package/dist/adapters/curl.cjs +39 -34
  2. package/dist/adapters/curl.js +39 -34
  3. package/dist/adapters/entries/curl.d.ts +29 -17
  4. package/dist/adapters/entries/fetch.d.ts +29 -17
  5. package/dist/adapters/entries/http.d.ts +29 -17
  6. package/dist/adapters/entries/http2.d.ts +29 -17
  7. package/dist/adapters/entries/react-native.d.ts +29 -17
  8. package/dist/adapters/entries/xhr.d.ts +29 -17
  9. package/dist/adapters/fetch.cjs +42 -41
  10. package/dist/adapters/fetch.js +42 -41
  11. package/dist/adapters/http.cjs +184 -73
  12. package/dist/adapters/http.js +184 -73
  13. package/dist/adapters/http2.cjs +41 -36
  14. package/dist/adapters/http2.js +41 -36
  15. package/dist/adapters/index.cjs +6 -6
  16. package/dist/adapters/react-native.cjs +41 -27
  17. package/dist/adapters/react-native.js +41 -27
  18. package/dist/adapters/xhr.cjs +43 -38
  19. package/dist/adapters/xhr.js +43 -38
  20. package/dist/cache/index.cjs +13 -13
  21. package/dist/crawler.d.ts +29 -17
  22. package/dist/entries/crawler.cjs +5 -5
  23. package/dist/index.cjs +24 -24
  24. package/dist/index.d.ts +29 -17
  25. package/dist/platform/browser.d.ts +29 -17
  26. package/dist/platform/bun.d.ts +29 -17
  27. package/dist/platform/deno.d.ts +29 -17
  28. package/dist/platform/node.d.ts +29 -17
  29. package/dist/platform/react-native.d.ts +29 -17
  30. package/dist/platform/worker.d.ts +29 -17
  31. package/dist/plugin/index.cjs +36 -36
  32. package/dist/proxy/index.cjs +2 -2
  33. package/dist/queue/index.cjs +8 -8
  34. package/dist/utils/http-config.cjs +8 -4
  35. package/dist/utils/http-config.js +8 -4
  36. package/dist/utils/timing.cjs +90 -0
  37. package/dist/utils/timing.js +78 -0
  38. package/package.json +1 -1
@@ -34,6 +34,35 @@ function mergeRequestAndResponseCookies(requestCookies, responseCookies) {
34
34
  }
35
35
  return Array.from(cookieMap.values());
36
36
  }
37
+ function buildTimingFromCurlStats(stats, startTime) {
38
+ const timeNamelookup = parseFloat(stats["time_namelookup"]) * 1000 || 0;
39
+ const timeConnect = parseFloat(stats["time_connect"]) * 1000 || 0;
40
+ const timeAppconnect = parseFloat(stats["time_appconnect"]) * 1000 || 0;
41
+ const timeStarttransfer = parseFloat(stats["time_starttransfer"]) * 1000 || 0;
42
+ const timeTotal = parseFloat(stats["time_total"]) * 1000 || 0;
43
+ return {
44
+ startTime,
45
+ domainLookupStart: startTime,
46
+ domainLookupEnd: startTime + timeNamelookup,
47
+ connectStart: startTime + timeNamelookup,
48
+ secureConnectionStart: timeAppconnect > timeConnect ? startTime + timeConnect : 0,
49
+ connectEnd: startTime + (timeAppconnect > 0 ? timeAppconnect : timeConnect),
50
+ requestStart: startTime + (timeAppconnect > 0 ? timeAppconnect : timeConnect),
51
+ responseStart: startTime + timeStarttransfer,
52
+ responseEnd: startTime + timeTotal
53
+ };
54
+ }
55
+ function getTimingDurations(config) {
56
+ const t = config.timing;
57
+ return {
58
+ total: t.responseEnd - t.startTime,
59
+ dns: t.domainLookupEnd - t.domainLookupStart,
60
+ tcp: t.secureConnectionStart > 0 ? t.secureConnectionStart - t.connectStart : t.connectEnd - t.connectStart,
61
+ tls: t.secureConnectionStart > 0 ? t.connectEnd - t.secureConnectionStart : undefined,
62
+ firstByte: t.responseStart - t.startTime,
63
+ download: t.responseEnd - t.responseStart
64
+ };
65
+ }
37
66
 
38
67
  class CurlCapabilities {
39
68
  static instance;
@@ -1433,18 +1462,8 @@ class CurlResponseParser {
1433
1462
  } else {
1434
1463
  data = responseBody;
1435
1464
  }
1436
- const totalMs = parseFloat(stats["time_total"]) * 1000 || 0;
1437
- const timing = {
1438
- startTimestamp: config.timing?.startTimestamp || Date.now(),
1439
- endTimestamp: Date.now(),
1440
- dnsMs: parseFloat(stats["time_namelookup"]) * 1000 || 0,
1441
- tcpMs: (parseFloat(stats["time_connect"]) - parseFloat(stats["time_namelookup"])) * 1000 || 0,
1442
- tlsMs: (parseFloat(stats["time_appconnect"]) - parseFloat(stats["time_connect"])) * 1000 || 0,
1443
- ttfbMs: parseFloat(stats["time_starttransfer"]) * 1000 || 0,
1444
- transferMs: (parseFloat(stats["time_total"]) - parseFloat(stats["time_starttransfer"])) * 1000 || 0,
1445
- durationMs: totalMs
1446
- };
1447
- config.timing = timing;
1465
+ const startTime = config.timing?.startTime || performance.now();
1466
+ config.timing = buildTimingFromCurlStats(stats, startTime);
1448
1467
  config.status = status;
1449
1468
  config.statusText = statusText;
1450
1469
  const isSecure = config.url?.startsWith("https") || false;
@@ -1682,14 +1701,7 @@ class CurlExecutor {
1682
1701
  finalUrl: response.finalUrl,
1683
1702
  cookies: response.cookies,
1684
1703
  urls: response.urls,
1685
- timing: {
1686
- total: performance.now() - startTime,
1687
- firstByte: config.timing?.ttfbMs,
1688
- dns: config.timing?.dnsMs,
1689
- tcp: config.timing?.tcpMs,
1690
- tls: config.timing?.tlsMs,
1691
- download: config.timing?.transferMs
1692
- },
1704
+ timing: getTimingDurations(config),
1693
1705
  config
1694
1706
  };
1695
1707
  streamResult.emit("finish", finishEvent);
@@ -1712,14 +1724,10 @@ class CurlExecutor {
1712
1724
  fileName,
1713
1725
  fileSize,
1714
1726
  timing: {
1715
- total: performance.now() - startTime,
1716
- firstByte: config.timing?.ttfbMs,
1717
- dns: config.timing?.dnsMs,
1718
- tcp: config.timing?.tcpMs,
1719
- tls: config.timing?.tlsMs,
1720
- download: performance.now() - startTime
1727
+ ...getTimingDurations(config),
1728
+ download: getTimingDurations(config).download || 0
1721
1729
  },
1722
- averageSpeed: fileSize / ((performance.now() - startTime) / 1000),
1730
+ averageSpeed: getTimingDurations(config).download ? fileSize / getTimingDurations(config).download * 1000 : 0,
1723
1731
  config
1724
1732
  };
1725
1733
  downloadResult.emit("finish", finishEvent);
@@ -1742,14 +1750,11 @@ class CurlExecutor {
1742
1750
  urls: response.urls,
1743
1751
  uploadSize: config.transfer?.requestSize || 0,
1744
1752
  timing: {
1745
- total: performance.now() - startTime,
1746
- dns: config.timing?.dnsMs,
1747
- tcp: config.timing?.tcpMs,
1748
- tls: config.timing?.tlsMs,
1749
- upload: performance.now() - startTime,
1750
- waiting: 0
1753
+ ...getTimingDurations(config),
1754
+ upload: getTimingDurations(config).firstByte || 0,
1755
+ waiting: getTimingDurations(config).download > 0 && getTimingDurations(config).firstByte > 0 ? getTimingDurations(config).download - getTimingDurations(config).firstByte : 0
1751
1756
  },
1752
- averageUploadSpeed: (config.transfer?.requestSize || 0) / ((performance.now() - startTime) / 1000),
1757
+ averageUploadSpeed: getTimingDurations(config).firstByte && config.transfer?.requestSize ? config.transfer.requestSize / getTimingDurations(config).firstByte * 1000 : 0,
1753
1758
  config
1754
1759
  };
1755
1760
  uploadResult.emit("finish", finishEvent);
@@ -34,6 +34,35 @@ function mergeRequestAndResponseCookies(requestCookies, responseCookies) {
34
34
  }
35
35
  return Array.from(cookieMap.values());
36
36
  }
37
+ function buildTimingFromCurlStats(stats, startTime) {
38
+ const timeNamelookup = parseFloat(stats["time_namelookup"]) * 1000 || 0;
39
+ const timeConnect = parseFloat(stats["time_connect"]) * 1000 || 0;
40
+ const timeAppconnect = parseFloat(stats["time_appconnect"]) * 1000 || 0;
41
+ const timeStarttransfer = parseFloat(stats["time_starttransfer"]) * 1000 || 0;
42
+ const timeTotal = parseFloat(stats["time_total"]) * 1000 || 0;
43
+ return {
44
+ startTime,
45
+ domainLookupStart: startTime,
46
+ domainLookupEnd: startTime + timeNamelookup,
47
+ connectStart: startTime + timeNamelookup,
48
+ secureConnectionStart: timeAppconnect > timeConnect ? startTime + timeConnect : 0,
49
+ connectEnd: startTime + (timeAppconnect > 0 ? timeAppconnect : timeConnect),
50
+ requestStart: startTime + (timeAppconnect > 0 ? timeAppconnect : timeConnect),
51
+ responseStart: startTime + timeStarttransfer,
52
+ responseEnd: startTime + timeTotal
53
+ };
54
+ }
55
+ function getTimingDurations(config) {
56
+ const t = config.timing;
57
+ return {
58
+ total: t.responseEnd - t.startTime,
59
+ dns: t.domainLookupEnd - t.domainLookupStart,
60
+ tcp: t.secureConnectionStart > 0 ? t.secureConnectionStart - t.connectStart : t.connectEnd - t.connectStart,
61
+ tls: t.secureConnectionStart > 0 ? t.connectEnd - t.secureConnectionStart : undefined,
62
+ firstByte: t.responseStart - t.startTime,
63
+ download: t.responseEnd - t.responseStart
64
+ };
65
+ }
37
66
 
38
67
  class CurlCapabilities {
39
68
  static instance;
@@ -1433,18 +1462,8 @@ class CurlResponseParser {
1433
1462
  } else {
1434
1463
  data = responseBody;
1435
1464
  }
1436
- const totalMs = parseFloat(stats["time_total"]) * 1000 || 0;
1437
- const timing = {
1438
- startTimestamp: config.timing?.startTimestamp || Date.now(),
1439
- endTimestamp: Date.now(),
1440
- dnsMs: parseFloat(stats["time_namelookup"]) * 1000 || 0,
1441
- tcpMs: (parseFloat(stats["time_connect"]) - parseFloat(stats["time_namelookup"])) * 1000 || 0,
1442
- tlsMs: (parseFloat(stats["time_appconnect"]) - parseFloat(stats["time_connect"])) * 1000 || 0,
1443
- ttfbMs: parseFloat(stats["time_starttransfer"]) * 1000 || 0,
1444
- transferMs: (parseFloat(stats["time_total"]) - parseFloat(stats["time_starttransfer"])) * 1000 || 0,
1445
- durationMs: totalMs
1446
- };
1447
- config.timing = timing;
1465
+ const startTime = config.timing?.startTime || performance.now();
1466
+ config.timing = buildTimingFromCurlStats(stats, startTime);
1448
1467
  config.status = status;
1449
1468
  config.statusText = statusText;
1450
1469
  const isSecure = config.url?.startsWith("https") || false;
@@ -1682,14 +1701,7 @@ class CurlExecutor {
1682
1701
  finalUrl: response.finalUrl,
1683
1702
  cookies: response.cookies,
1684
1703
  urls: response.urls,
1685
- timing: {
1686
- total: performance.now() - startTime,
1687
- firstByte: config.timing?.ttfbMs,
1688
- dns: config.timing?.dnsMs,
1689
- tcp: config.timing?.tcpMs,
1690
- tls: config.timing?.tlsMs,
1691
- download: config.timing?.transferMs
1692
- },
1704
+ timing: getTimingDurations(config),
1693
1705
  config
1694
1706
  };
1695
1707
  streamResult.emit("finish", finishEvent);
@@ -1712,14 +1724,10 @@ class CurlExecutor {
1712
1724
  fileName,
1713
1725
  fileSize,
1714
1726
  timing: {
1715
- total: performance.now() - startTime,
1716
- firstByte: config.timing?.ttfbMs,
1717
- dns: config.timing?.dnsMs,
1718
- tcp: config.timing?.tcpMs,
1719
- tls: config.timing?.tlsMs,
1720
- download: performance.now() - startTime
1727
+ ...getTimingDurations(config),
1728
+ download: getTimingDurations(config).download || 0
1721
1729
  },
1722
- averageSpeed: fileSize / ((performance.now() - startTime) / 1000),
1730
+ averageSpeed: getTimingDurations(config).download ? fileSize / getTimingDurations(config).download * 1000 : 0,
1723
1731
  config
1724
1732
  };
1725
1733
  downloadResult.emit("finish", finishEvent);
@@ -1742,14 +1750,11 @@ class CurlExecutor {
1742
1750
  urls: response.urls,
1743
1751
  uploadSize: config.transfer?.requestSize || 0,
1744
1752
  timing: {
1745
- total: performance.now() - startTime,
1746
- dns: config.timing?.dnsMs,
1747
- tcp: config.timing?.tcpMs,
1748
- tls: config.timing?.tlsMs,
1749
- upload: performance.now() - startTime,
1750
- waiting: 0
1753
+ ...getTimingDurations(config),
1754
+ upload: getTimingDurations(config).firstByte || 0,
1755
+ waiting: getTimingDurations(config).download > 0 && getTimingDurations(config).firstByte > 0 ? getTimingDurations(config).download - getTimingDurations(config).firstByte : 0
1751
1756
  },
1752
- averageUploadSpeed: (config.transfer?.requestSize || 0) / ((performance.now() - startTime) / 1000),
1757
+ averageUploadSpeed: getTimingDurations(config).firstByte && config.transfer?.requestSize ? config.transfer.requestSize / getTimingDurations(config).firstByte * 1000 : 0,
1753
1758
  config
1754
1759
  };
1755
1760
  uploadResult.emit("finish", finishEvent);
@@ -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 (absolute performance.now() value) */
1821
- startTimestamp: number;
1822
- /** @description Request end timestamp (absolute performance.now() value) */
1823
- endTimestamp: number;
1824
- /** @description DNS lookup duration in milliseconds */
1825
- dnsMs?: number;
1826
- /** @description TCP connection duration in milliseconds */
1827
- tcpMs?: number;
1828
- /** @description TLS handshake duration in milliseconds */
1829
- tlsMs?: number;
1830
- /** @description Time to first byte in milliseconds (from start to first response byte) */
1831
- ttfbMs?: number;
1832
- /** @description Content transfer duration in milliseconds */
1833
- transferMs?: number;
1834
- /** @description Total request duration in milliseconds (endTimestamp - startTimestamp) */
1835
- durationMs: number;
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: {
@@ -1894,6 +1896,8 @@ export interface RezoConfig {
1894
1896
  };
1895
1897
  /** @description Debug mode flag */
1896
1898
  debug?: boolean;
1899
+ /** @description URL tracking mode flag - logs redirect chain and retries */
1900
+ trackUrl?: boolean;
1897
1901
  /** @description Request tracking identifier */
1898
1902
  requestId: string;
1899
1903
  /** @description Session identifier */
@@ -2753,6 +2757,12 @@ export interface RezoRequestConfig<D = any> {
2753
2757
  debug?: boolean;
2754
2758
  /** Enable verbose logging with detailed information */
2755
2759
  verbose?: boolean;
2760
+ /**
2761
+ * Enable URL tracking to log the complete redirect chain with status codes.
2762
+ * When enabled, logs: initial URL -> redirect URL (status code) -> final URL
2763
+ * Also logs retry attempts with their status codes.
2764
+ */
2765
+ trackUrl?: boolean;
2756
2766
  /** Name of the cookie containing XSRF token */
2757
2767
  xsrfCookieName?: string;
2758
2768
  /** Name of the header to send XSRF token in */
@@ -3234,6 +3244,8 @@ export interface RezoDefaultOptions {
3234
3244
  debug?: RezoHttpRequest["debug"];
3235
3245
  /** Enable verbose logging with detailed information */
3236
3246
  verbose?: RezoHttpRequest["verbose"];
3247
+ /** Enable URL tracking to log redirect chain and retry attempts */
3248
+ trackUrl?: RezoHttpRequest["trackUrl"];
3237
3249
  /** HTTP agent for HTTP requests */
3238
3250
  httpAgent?: RezoHttpRequest["httpAgent"];
3239
3251
  /** HTTPS agent for HTTPS requests */
@@ -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 (absolute performance.now() value) */
1821
- startTimestamp: number;
1822
- /** @description Request end timestamp (absolute performance.now() value) */
1823
- endTimestamp: number;
1824
- /** @description DNS lookup duration in milliseconds */
1825
- dnsMs?: number;
1826
- /** @description TCP connection duration in milliseconds */
1827
- tcpMs?: number;
1828
- /** @description TLS handshake duration in milliseconds */
1829
- tlsMs?: number;
1830
- /** @description Time to first byte in milliseconds (from start to first response byte) */
1831
- ttfbMs?: number;
1832
- /** @description Content transfer duration in milliseconds */
1833
- transferMs?: number;
1834
- /** @description Total request duration in milliseconds (endTimestamp - startTimestamp) */
1835
- durationMs: number;
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: {
@@ -1894,6 +1896,8 @@ export interface RezoConfig {
1894
1896
  };
1895
1897
  /** @description Debug mode flag */
1896
1898
  debug?: boolean;
1899
+ /** @description URL tracking mode flag - logs redirect chain and retries */
1900
+ trackUrl?: boolean;
1897
1901
  /** @description Request tracking identifier */
1898
1902
  requestId: string;
1899
1903
  /** @description Session identifier */
@@ -2753,6 +2757,12 @@ export interface RezoRequestConfig<D = any> {
2753
2757
  debug?: boolean;
2754
2758
  /** Enable verbose logging with detailed information */
2755
2759
  verbose?: boolean;
2760
+ /**
2761
+ * Enable URL tracking to log the complete redirect chain with status codes.
2762
+ * When enabled, logs: initial URL -> redirect URL (status code) -> final URL
2763
+ * Also logs retry attempts with their status codes.
2764
+ */
2765
+ trackUrl?: boolean;
2756
2766
  /** Name of the cookie containing XSRF token */
2757
2767
  xsrfCookieName?: string;
2758
2768
  /** Name of the header to send XSRF token in */
@@ -3234,6 +3244,8 @@ export interface RezoDefaultOptions {
3234
3244
  debug?: RezoHttpRequest["debug"];
3235
3245
  /** Enable verbose logging with detailed information */
3236
3246
  verbose?: RezoHttpRequest["verbose"];
3247
+ /** Enable URL tracking to log redirect chain and retry attempts */
3248
+ trackUrl?: RezoHttpRequest["trackUrl"];
3237
3249
  /** HTTP agent for HTTP requests */
3238
3250
  httpAgent?: RezoHttpRequest["httpAgent"];
3239
3251
  /** HTTPS agent for HTTPS requests */
@@ -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 (absolute performance.now() value) */
1821
- startTimestamp: number;
1822
- /** @description Request end timestamp (absolute performance.now() value) */
1823
- endTimestamp: number;
1824
- /** @description DNS lookup duration in milliseconds */
1825
- dnsMs?: number;
1826
- /** @description TCP connection duration in milliseconds */
1827
- tcpMs?: number;
1828
- /** @description TLS handshake duration in milliseconds */
1829
- tlsMs?: number;
1830
- /** @description Time to first byte in milliseconds (from start to first response byte) */
1831
- ttfbMs?: number;
1832
- /** @description Content transfer duration in milliseconds */
1833
- transferMs?: number;
1834
- /** @description Total request duration in milliseconds (endTimestamp - startTimestamp) */
1835
- durationMs: number;
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: {
@@ -1894,6 +1896,8 @@ export interface RezoConfig {
1894
1896
  };
1895
1897
  /** @description Debug mode flag */
1896
1898
  debug?: boolean;
1899
+ /** @description URL tracking mode flag - logs redirect chain and retries */
1900
+ trackUrl?: boolean;
1897
1901
  /** @description Request tracking identifier */
1898
1902
  requestId: string;
1899
1903
  /** @description Session identifier */
@@ -2753,6 +2757,12 @@ export interface RezoRequestConfig<D = any> {
2753
2757
  debug?: boolean;
2754
2758
  /** Enable verbose logging with detailed information */
2755
2759
  verbose?: boolean;
2760
+ /**
2761
+ * Enable URL tracking to log the complete redirect chain with status codes.
2762
+ * When enabled, logs: initial URL -> redirect URL (status code) -> final URL
2763
+ * Also logs retry attempts with their status codes.
2764
+ */
2765
+ trackUrl?: boolean;
2756
2766
  /** Name of the cookie containing XSRF token */
2757
2767
  xsrfCookieName?: string;
2758
2768
  /** Name of the header to send XSRF token in */
@@ -3234,6 +3244,8 @@ export interface RezoDefaultOptions {
3234
3244
  debug?: RezoHttpRequest["debug"];
3235
3245
  /** Enable verbose logging with detailed information */
3236
3246
  verbose?: RezoHttpRequest["verbose"];
3247
+ /** Enable URL tracking to log redirect chain and retry attempts */
3248
+ trackUrl?: RezoHttpRequest["trackUrl"];
3237
3249
  /** HTTP agent for HTTP requests */
3238
3250
  httpAgent?: RezoHttpRequest["httpAgent"];
3239
3251
  /** HTTPS agent for HTTPS requests */
@@ -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 (absolute performance.now() value) */
1821
- startTimestamp: number;
1822
- /** @description Request end timestamp (absolute performance.now() value) */
1823
- endTimestamp: number;
1824
- /** @description DNS lookup duration in milliseconds */
1825
- dnsMs?: number;
1826
- /** @description TCP connection duration in milliseconds */
1827
- tcpMs?: number;
1828
- /** @description TLS handshake duration in milliseconds */
1829
- tlsMs?: number;
1830
- /** @description Time to first byte in milliseconds (from start to first response byte) */
1831
- ttfbMs?: number;
1832
- /** @description Content transfer duration in milliseconds */
1833
- transferMs?: number;
1834
- /** @description Total request duration in milliseconds (endTimestamp - startTimestamp) */
1835
- durationMs: number;
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: {
@@ -1894,6 +1896,8 @@ export interface RezoConfig {
1894
1896
  };
1895
1897
  /** @description Debug mode flag */
1896
1898
  debug?: boolean;
1899
+ /** @description URL tracking mode flag - logs redirect chain and retries */
1900
+ trackUrl?: boolean;
1897
1901
  /** @description Request tracking identifier */
1898
1902
  requestId: string;
1899
1903
  /** @description Session identifier */
@@ -2753,6 +2757,12 @@ export interface RezoRequestConfig<D = any> {
2753
2757
  debug?: boolean;
2754
2758
  /** Enable verbose logging with detailed information */
2755
2759
  verbose?: boolean;
2760
+ /**
2761
+ * Enable URL tracking to log the complete redirect chain with status codes.
2762
+ * When enabled, logs: initial URL -> redirect URL (status code) -> final URL
2763
+ * Also logs retry attempts with their status codes.
2764
+ */
2765
+ trackUrl?: boolean;
2756
2766
  /** Name of the cookie containing XSRF token */
2757
2767
  xsrfCookieName?: string;
2758
2768
  /** Name of the header to send XSRF token in */
@@ -3234,6 +3244,8 @@ export interface RezoDefaultOptions {
3234
3244
  debug?: RezoHttpRequest["debug"];
3235
3245
  /** Enable verbose logging with detailed information */
3236
3246
  verbose?: RezoHttpRequest["verbose"];
3247
+ /** Enable URL tracking to log redirect chain and retry attempts */
3248
+ trackUrl?: RezoHttpRequest["trackUrl"];
3237
3249
  /** HTTP agent for HTTP requests */
3238
3250
  httpAgent?: RezoHttpRequest["httpAgent"];
3239
3251
  /** HTTPS agent for HTTPS requests */
@@ -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 (absolute performance.now() value) */
1821
- startTimestamp: number;
1822
- /** @description Request end timestamp (absolute performance.now() value) */
1823
- endTimestamp: number;
1824
- /** @description DNS lookup duration in milliseconds */
1825
- dnsMs?: number;
1826
- /** @description TCP connection duration in milliseconds */
1827
- tcpMs?: number;
1828
- /** @description TLS handshake duration in milliseconds */
1829
- tlsMs?: number;
1830
- /** @description Time to first byte in milliseconds (from start to first response byte) */
1831
- ttfbMs?: number;
1832
- /** @description Content transfer duration in milliseconds */
1833
- transferMs?: number;
1834
- /** @description Total request duration in milliseconds (endTimestamp - startTimestamp) */
1835
- durationMs: number;
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: {
@@ -1894,6 +1896,8 @@ export interface RezoConfig {
1894
1896
  };
1895
1897
  /** @description Debug mode flag */
1896
1898
  debug?: boolean;
1899
+ /** @description URL tracking mode flag - logs redirect chain and retries */
1900
+ trackUrl?: boolean;
1897
1901
  /** @description Request tracking identifier */
1898
1902
  requestId: string;
1899
1903
  /** @description Session identifier */
@@ -2753,6 +2757,12 @@ export interface RezoRequestConfig<D = any> {
2753
2757
  debug?: boolean;
2754
2758
  /** Enable verbose logging with detailed information */
2755
2759
  verbose?: boolean;
2760
+ /**
2761
+ * Enable URL tracking to log the complete redirect chain with status codes.
2762
+ * When enabled, logs: initial URL -> redirect URL (status code) -> final URL
2763
+ * Also logs retry attempts with their status codes.
2764
+ */
2765
+ trackUrl?: boolean;
2756
2766
  /** Name of the cookie containing XSRF token */
2757
2767
  xsrfCookieName?: string;
2758
2768
  /** Name of the header to send XSRF token in */
@@ -3234,6 +3244,8 @@ export interface RezoDefaultOptions {
3234
3244
  debug?: RezoHttpRequest["debug"];
3235
3245
  /** Enable verbose logging with detailed information */
3236
3246
  verbose?: RezoHttpRequest["verbose"];
3247
+ /** Enable URL tracking to log redirect chain and retry attempts */
3248
+ trackUrl?: RezoHttpRequest["trackUrl"];
3237
3249
  /** HTTP agent for HTTP requests */
3238
3250
  httpAgent?: RezoHttpRequest["httpAgent"];
3239
3251
  /** HTTPS agent for HTTPS requests */