rezo 1.0.71 → 1.0.73

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 (60) hide show
  1. package/dist/adapters/entries/curl.d.ts +13 -2
  2. package/dist/adapters/entries/fetch.d.ts +13 -2
  3. package/dist/adapters/entries/http.d.ts +13 -2
  4. package/dist/adapters/entries/http2.d.ts +13 -2
  5. package/dist/adapters/entries/react-native.d.ts +13 -2
  6. package/dist/adapters/entries/xhr.d.ts +13 -2
  7. package/dist/adapters/index.cjs +6 -6
  8. package/dist/cache/index.cjs +9 -9
  9. package/dist/crawler/crawler-options.cjs +1 -1
  10. package/dist/crawler/crawler-options.js +1 -1
  11. package/dist/crawler/crawler.cjs +307 -86
  12. package/dist/crawler/crawler.js +307 -86
  13. package/dist/crawler/index.cjs +40 -40
  14. package/dist/crawler/plugin/capped-array.cjs +1 -0
  15. package/dist/crawler/plugin/capped-array.js +1 -0
  16. package/dist/crawler/plugin/capped-map.cjs +1 -0
  17. package/dist/crawler/plugin/capped-map.js +1 -0
  18. package/dist/crawler/plugin/file-cacher.cjs +20 -18
  19. package/dist/crawler/plugin/file-cacher.js +20 -18
  20. package/dist/crawler/plugin/health-metrics.cjs +2 -0
  21. package/dist/crawler/plugin/health-metrics.js +2 -0
  22. package/dist/crawler/plugin/index.cjs +1 -1
  23. package/dist/crawler/plugin/index.js +1 -1
  24. package/dist/crawler/plugin/memory-monitor.cjs +1 -0
  25. package/dist/crawler/plugin/memory-monitor.js +1 -0
  26. package/dist/crawler/plugin/navigation-history.cjs +5 -5
  27. package/dist/crawler/plugin/navigation-history.js +3 -3
  28. package/dist/crawler/plugin/result-stream.cjs +5 -0
  29. package/dist/crawler/plugin/result-stream.js +5 -0
  30. package/dist/crawler/plugin/sqlite-utils.cjs +1 -0
  31. package/dist/crawler/plugin/sqlite-utils.js +1 -0
  32. package/dist/crawler/plugin/url-store.cjs +5 -5
  33. package/dist/crawler/plugin/url-store.js +5 -5
  34. package/dist/crawler/scraper.cjs +1 -1
  35. package/dist/crawler/scraper.js +1 -1
  36. package/dist/crawler.d.ts +148 -25
  37. package/dist/entries/crawler.cjs +4 -4
  38. package/dist/index.cjs +30 -30
  39. package/dist/index.d.ts +13 -2
  40. package/dist/internal/agents/index.cjs +10 -10
  41. package/dist/platform/browser.d.ts +13 -2
  42. package/dist/platform/bun.d.ts +13 -2
  43. package/dist/platform/deno.d.ts +13 -2
  44. package/dist/platform/node.d.ts +13 -2
  45. package/dist/platform/react-native.d.ts +13 -2
  46. package/dist/platform/worker.d.ts +13 -2
  47. package/dist/proxy/index.cjs +4 -4
  48. package/dist/queue/index.cjs +8 -8
  49. package/dist/queue/queue.cjs +58 -13
  50. package/dist/queue/queue.js +58 -13
  51. package/dist/responses/universal/index.cjs +11 -11
  52. package/dist/utils/agent-pool.cjs +2 -0
  53. package/dist/utils/agent-pool.js +2 -0
  54. package/dist/utils/compression.cjs +6 -6
  55. package/dist/utils/compression.js +6 -6
  56. package/dist/version.cjs +1 -1
  57. package/dist/version.js +1 -1
  58. package/dist/wget/index.cjs +49 -49
  59. package/dist/wget/index.d.ts +12 -1
  60. package/package.json +1 -1
package/dist/crawler.d.ts CHANGED
@@ -11,8 +11,9 @@ import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions
11
11
  * Optimized specifically for crawler workloads with:
12
12
  * - WAL mode for high-throughput concurrent reads/writes
13
13
  * - Batch operations for efficient bulk storage
14
- * - Domain-based namespacing for organized cache management
14
+ * - Domain-based namespacing via column (single database)
15
15
  * - Optional zstd compression for storage efficiency
16
+ * - LRU eviction to prevent unbounded growth
16
17
  *
17
18
  * @module cache/file-cacher
18
19
  * @author Rezo HTTP Client Library
@@ -22,10 +23,15 @@ import { Cookie as TouchCookie, CookieJar as TouchCookieJar, CreateCookieOptions
22
23
  */
23
24
  export interface FileCacherOptions {
24
25
  /**
25
- * Directory path for storing cache databases
26
+ * Directory path for storing the cache database
26
27
  * @default '/tmp/rezo-crawler/cache'
27
28
  */
28
29
  cacheDir?: string;
30
+ /**
31
+ * Database filename
32
+ * @default 'cache.db'
33
+ */
34
+ dbFileName?: string;
29
35
  /**
30
36
  * Default time-to-live in milliseconds
31
37
  * @default 604800000 (7 days)
@@ -38,30 +44,33 @@ export interface FileCacherOptions {
38
44
  */
39
45
  compression?: boolean;
40
46
  /**
41
- * Hash namespace names for privacy
42
- * @default false
43
- */
44
- encryptNamespace?: boolean;
45
- /**
46
- * Maximum entries per namespace (0 = unlimited)
47
- * @default 0
47
+ * Maximum total entries (0 = unlimited, recommended: 100000)
48
+ * Uses LRU eviction when limit is reached
49
+ * @default 100000
48
50
  */
49
51
  maxEntries?: number;
50
52
  }
51
53
  declare class FileCacher {
52
- private databases;
54
+ private db;
53
55
  private readonly options;
54
56
  private readonly cacheDir;
57
+ private readonly dbPath;
55
58
  private closed;
59
+ private initPromise;
60
+ private evictionInProgress;
56
61
  private constructor();
57
62
  /**
58
63
  * Create a new FileCacher instance
59
64
  */
60
65
  static create(options?: FileCacherOptions): Promise<FileCacher>;
61
66
  /**
62
- * Get or create optimized database for a namespace (domain)
67
+ * Initialize the single database with optimized settings
63
68
  */
64
- private getDatabase;
69
+ private initialize;
70
+ /**
71
+ * Ensure database is initialized
72
+ */
73
+ private ensureDb;
65
74
  /**
66
75
  * Store a response in the cache
67
76
  */
@@ -74,6 +83,11 @@ declare class FileCacher {
74
83
  value: T;
75
84
  ttl?: number;
76
85
  }>, namespace?: string): Promise<void>;
86
+ /**
87
+ * LRU eviction - removes oldest entries when limit exceeded
88
+ * Runs asynchronously to not block writes
89
+ */
90
+ private maybeEvict;
77
91
  /**
78
92
  * Retrieve a cached response
79
93
  */
@@ -95,22 +109,24 @@ declare class FileCacher {
95
109
  */
96
110
  clear(namespace?: string): Promise<void>;
97
111
  /**
98
- * Remove all expired entries
112
+ * Remove all expired entries across all namespaces
99
113
  */
100
- cleanup(namespace?: string): Promise<number>;
114
+ cleanup(): Promise<number>;
101
115
  /**
102
- * Get cache statistics for a namespace
116
+ * Get cache statistics
103
117
  */
104
118
  stats(namespace?: string): Promise<{
105
119
  count: number;
106
120
  expired: number;
121
+ namespaces: number;
107
122
  }>;
108
123
  /**
109
- * Close all database connections
124
+ * Close the database connection
110
125
  */
111
126
  close(): Promise<void>;
112
127
  get isClosed(): boolean;
113
128
  get directory(): string;
129
+ get databasePath(): string;
114
130
  }
115
131
  export interface CrawlSession {
116
132
  sessionId: string;
@@ -2063,6 +2079,13 @@ export interface QueueConfig {
2063
2079
  intervalCap?: number;
2064
2080
  /** Carry over unused interval capacity to next interval */
2065
2081
  carryoverConcurrencyCount?: boolean;
2082
+ /**
2083
+ * Reject the task promise when an error occurs (default: false)
2084
+ * When false, errors are swallowed and task.resolve(undefined) is called.
2085
+ * This prevents unhandled promise rejections but makes error handling harder.
2086
+ * When true, task.reject(error) is called, allowing proper try/catch handling.
2087
+ */
2088
+ rejectOnError?: boolean;
2066
2089
  }
2067
2090
  /**
2068
2091
  * Task options when adding to queue
@@ -2268,8 +2291,12 @@ declare class RezoQueue<T = any> {
2268
2291
  /**
2269
2292
  * Wait for queue size to be less than limit
2270
2293
  * @param limit - Size threshold
2294
+ * @param timeoutMs - Optional timeout in milliseconds (default: 0 = no timeout)
2295
+ * If timeout occurs, promise resolves (not rejects) to prevent blocking
2271
2296
  */
2272
- onSizeLessThan(limit: number): Promise<void>;
2297
+ onSizeLessThan(limit: number, timeoutMs?: number): Promise<void>;
2298
+ /** Maximum recommended handlers per event before warning */
2299
+ private static readonly MAX_HANDLERS_WARNING;
2273
2300
  /**
2274
2301
  * Register an event handler
2275
2302
  * @param event - Event name
@@ -6477,6 +6504,10 @@ export interface ICrawlerOptions {
6477
6504
  } | {
6478
6505
  enable: false;
6479
6506
  } | undefined | false;
6507
+ /** Maximum concurrent requests for crawler (default: 100) */
6508
+ concurrency?: number;
6509
+ /** Maximum concurrent requests for scraper - separate queue (default: same as concurrency) */
6510
+ scraperConcurrency?: number;
6480
6511
  /** Maximum crawl depth from start URL (0 = unlimited, default: 0) */
6481
6512
  maxDepth?: number;
6482
6513
  /** Maximum total URLs to crawl (0 = unlimited, default: 0) */
@@ -6575,6 +6606,10 @@ export declare class CrawlerOptions {
6575
6606
  throwFatalError?: boolean;
6576
6607
  /** Enable debug logging */
6577
6608
  debug?: boolean;
6609
+ /** Maximum concurrent requests for crawler (default: 100) */
6610
+ concurrency: number;
6611
+ /** Maximum concurrent requests for scraper (default: same as concurrency) */
6612
+ scraperConcurrency: number;
6578
6613
  /** Maximum crawl depth from start URL (0 = unlimited) */
6579
6614
  maxDepth: number;
6580
6615
  /** Maximum total URLs to crawl (0 = unlimited) */
@@ -6991,6 +7026,32 @@ export interface EmailDiscoveryEvent<T = Record<string, any>> {
6991
7026
  timestamp: Date;
6992
7027
  metadata: T;
6993
7028
  }
7029
+ export interface HealthSnapshot {
7030
+ /** Timestamp of snapshot */
7031
+ timestamp: number;
7032
+ /** Requests per second (rolling average) */
7033
+ requestsPerSecond: number;
7034
+ /** Success rate percentage (0-100) */
7035
+ successRate: number;
7036
+ /** Failure rate percentage (0-100) */
7037
+ failureRate: number;
7038
+ /** Average response time in ms */
7039
+ avgResponseTime: number;
7040
+ /** 95th percentile response time in ms */
7041
+ p95ResponseTime: number;
7042
+ /** Current queue depth */
7043
+ queueDepth: number;
7044
+ /** Active concurrent requests */
7045
+ activeRequests: number;
7046
+ /** Total requests processed */
7047
+ totalRequests: number;
7048
+ /** Total successful requests */
7049
+ totalSuccesses: number;
7050
+ /** Total failed requests */
7051
+ totalFailures: number;
7052
+ /** Uptime in milliseconds */
7053
+ uptimeMs: number;
7054
+ }
6994
7055
  interface RedirectEvent$1 {
6995
7056
  originalUrl: string;
6996
7057
  finalUrl: string;
@@ -7070,6 +7131,7 @@ export declare class Crawler {
7070
7131
  */
7071
7132
  cacher: FileCacher;
7072
7133
  private queue;
7134
+ private scraperQueue;
7073
7135
  private readonly isCacheEnabled;
7074
7136
  readonly config: CrawlerOptions;
7075
7137
  private urlStorage;
@@ -7085,15 +7147,10 @@ export declare class Crawler {
7085
7147
  /** Adapter-specific request executor */
7086
7148
  private adapterExecutor;
7087
7149
  private adapterType;
7088
- /** Track pending execute() calls for proper done() behavior */
7089
- private pendingExecutions;
7090
- /**
7091
- * Track pending visits that haven't yet added to the queue.
7092
- * This prevents waitForAll() from exiting when execute() is still in its async preamble.
7093
- */
7094
- private pendingVisitCount;
7095
7150
  /** Track if the crawler has been destroyed */
7096
7151
  private isDestroyed;
7152
+ /** Track if graceful shutdown has been requested */
7153
+ private shutdownRequested;
7097
7154
  /** Original queue options for restoration */
7098
7155
  private readonly queueOptions;
7099
7156
  /** robots.txt parser and validator */
@@ -7105,14 +7162,30 @@ export declare class Crawler {
7105
7162
  private crawlStats;
7106
7163
  /** URL depth tracking for maxDepth limit */
7107
7164
  private urlDepthMap;
7165
+ /** Periodic cleanup interval for memory management */
7166
+ private cleanupInterval?;
7167
+ /** Auto-checkpoint interval for session persistence */
7168
+ private checkpointInterval?;
7169
+ /** Last checkpoint timestamp */
7170
+ private lastCheckpointTime;
7171
+ /** Memory monitor for auto-throttling */
7172
+ private memoryMonitor;
7173
+ /** Health metrics for monitoring */
7174
+ private healthMetrics;
7175
+ /** Original concurrency for restoration after memory pressure */
7176
+ private originalConcurrency;
7177
+ /** Shutdown handler reference for cleanup */
7178
+ private shutdownHandler;
7108
7179
  /** Lifecycle event handlers */
7109
7180
  private startHandlers;
7110
7181
  private finishHandlers;
7111
7182
  private redirectHandlers;
7112
- /** Data collection for export */
7183
+ /** Data collection for export - bounded to prevent memory issues */
7113
7184
  private collectedData;
7114
7185
  /** Flag to track if crawl has started */
7115
7186
  private crawlStarted;
7187
+ /** Promise lock for triggerStartHandlers to prevent race condition */
7188
+ private startHandlersPromise;
7116
7189
  /**
7117
7190
  * Creates a new Crawler instance with the specified configuration.
7118
7191
  *
@@ -7144,6 +7217,18 @@ export declare class Crawler {
7144
7217
  * ```
7145
7218
  */
7146
7219
  constructor(crawlerOptions: ICrawlerOptions, http?: Rezo);
7220
+ /**
7221
+ * Register process signal handlers for graceful shutdown
7222
+ */
7223
+ private registerShutdownHandlers;
7224
+ /**
7225
+ * Remove process signal handlers
7226
+ */
7227
+ private removeShutdownHandlers;
7228
+ /**
7229
+ * Graceful shutdown - finish current tasks and save state
7230
+ */
7231
+ gracefulShutdown(): Promise<void>;
7147
7232
  /**
7148
7233
  * Initialize the HTTP adapter based on configuration
7149
7234
  */
@@ -7212,8 +7297,30 @@ export declare class Crawler {
7212
7297
  */
7213
7298
  setAdapter(adapter: CrawlerAdapterType): Promise<void>;
7214
7299
  private rawResponseHandler;
7300
+ /**
7301
+ * Wait for cache to be ready with timeout (non-recursive)
7302
+ * @param timeoutMs - Maximum time to wait in milliseconds (default: 30s)
7303
+ */
7215
7304
  private waitForCache;
7305
+ /**
7306
+ * Wait for storage to be ready with timeout (non-recursive)
7307
+ * @param timeoutMs - Maximum time to wait in milliseconds (default: 30s)
7308
+ */
7216
7309
  private waitForStorage;
7310
+ /**
7311
+ * Start periodic cleanup to prevent unbounded memory growth
7312
+ * Trims urlDepthMap and domainResponseTimes to reasonable sizes
7313
+ * Also monitors memory and auto-throttles if needed
7314
+ */
7315
+ private startPeriodicCleanup;
7316
+ /**
7317
+ * Start auto-checkpointing to save session progress every 5 minutes
7318
+ */
7319
+ private startAutoCheckpoint;
7320
+ /**
7321
+ * Save current crawl progress to navigation history
7322
+ */
7323
+ saveCheckpoint(): Promise<void>;
7217
7324
  private saveUrl;
7218
7325
  private hasUrlInCache;
7219
7326
  private saveCache;
@@ -7621,8 +7728,24 @@ export declare class Crawler {
7621
7728
  * Get current crawl statistics
7622
7729
  */
7623
7730
  getStats(): CrawlStats;
7731
+ /**
7732
+ * Get health metrics snapshot for monitoring
7733
+ */
7734
+ getHealthSnapshot(): HealthSnapshot;
7735
+ /**
7736
+ * Check if crawler is healthy based on thresholds
7737
+ */
7738
+ isHealthy(options?: {
7739
+ minSuccessRate?: number;
7740
+ maxAvgResponseTime?: number;
7741
+ }): boolean;
7742
+ /**
7743
+ * Get Prometheus-formatted metrics for monitoring systems
7744
+ */
7745
+ getPrometheusMetrics(prefix?: string): string;
7624
7746
  /**
7625
7747
  * Trigger onStart handlers (called once on first visit)
7748
+ * Uses promise lock to prevent race condition with concurrent visits
7626
7749
  */
7627
7750
  private triggerStartHandlers;
7628
7751
  /**
@@ -1,4 +1,4 @@
1
- const _mod_g4a877 = require('../crawler/crawler.cjs');
2
- exports.Crawler = _mod_g4a877.Crawler;;
3
- const _mod_6xerar = require('../crawler/crawler-options.cjs');
4
- exports.CrawlerOptions = _mod_6xerar.CrawlerOptions;;
1
+ const _mod_lzlskh = require('../crawler/crawler.cjs');
2
+ exports.Crawler = _mod_lzlskh.Crawler;;
3
+ const _mod_vbox0l = require('../crawler/crawler-options.cjs');
4
+ exports.CrawlerOptions = _mod_vbox0l.CrawlerOptions;;
package/dist/index.cjs CHANGED
@@ -1,30 +1,30 @@
1
- const _mod_vvm9wl = require('./core/rezo.cjs');
2
- exports.Rezo = _mod_vvm9wl.Rezo;
3
- exports.createRezoInstance = _mod_vvm9wl.createRezoInstance;
4
- exports.createDefaultInstance = _mod_vvm9wl.createDefaultInstance;;
5
- const _mod_17ffv0 = require('./errors/rezo-error.cjs');
6
- exports.RezoError = _mod_17ffv0.RezoError;
7
- exports.RezoErrorCode = _mod_17ffv0.RezoErrorCode;;
8
- const _mod_5w9162 = require('./utils/headers.cjs');
9
- exports.RezoHeaders = _mod_5w9162.RezoHeaders;;
10
- const _mod_20lu6e = require('./utils/form-data.cjs');
11
- exports.RezoFormData = _mod_20lu6e.RezoFormData;;
12
- const _mod_7vu526 = require('./utils/cookies.cjs');
13
- exports.RezoCookieJar = _mod_7vu526.RezoCookieJar;
14
- exports.Cookie = _mod_7vu526.Cookie;;
15
- const _mod_f9hxhz = require('./utils/curl.cjs');
16
- exports.toCurl = _mod_f9hxhz.toCurl;
17
- exports.fromCurl = _mod_f9hxhz.fromCurl;;
18
- const _mod_i6ylu6 = require('./core/hooks.cjs');
19
- exports.createDefaultHooks = _mod_i6ylu6.createDefaultHooks;
20
- exports.mergeHooks = _mod_i6ylu6.mergeHooks;;
21
- const _mod_o7hxgi = require('./proxy/manager.cjs');
22
- exports.ProxyManager = _mod_o7hxgi.ProxyManager;;
23
- const _mod_gzy9ii = require('./queue/index.cjs');
24
- exports.RezoQueue = _mod_gzy9ii.RezoQueue;
25
- exports.HttpQueue = _mod_gzy9ii.HttpQueue;
26
- exports.Priority = _mod_gzy9ii.Priority;
27
- exports.HttpMethodPriority = _mod_gzy9ii.HttpMethodPriority;;
1
+ const _mod_nof5gk = require('./core/rezo.cjs');
2
+ exports.Rezo = _mod_nof5gk.Rezo;
3
+ exports.createRezoInstance = _mod_nof5gk.createRezoInstance;
4
+ exports.createDefaultInstance = _mod_nof5gk.createDefaultInstance;;
5
+ const _mod_4m1kqu = require('./errors/rezo-error.cjs');
6
+ exports.RezoError = _mod_4m1kqu.RezoError;
7
+ exports.RezoErrorCode = _mod_4m1kqu.RezoErrorCode;;
8
+ const _mod_p9wchx = require('./utils/headers.cjs');
9
+ exports.RezoHeaders = _mod_p9wchx.RezoHeaders;;
10
+ const _mod_ib1mep = require('./utils/form-data.cjs');
11
+ exports.RezoFormData = _mod_ib1mep.RezoFormData;;
12
+ const _mod_fkghv0 = require('./utils/cookies.cjs');
13
+ exports.RezoCookieJar = _mod_fkghv0.RezoCookieJar;
14
+ exports.Cookie = _mod_fkghv0.Cookie;;
15
+ const _mod_qucbgi = require('./utils/curl.cjs');
16
+ exports.toCurl = _mod_qucbgi.toCurl;
17
+ exports.fromCurl = _mod_qucbgi.fromCurl;;
18
+ const _mod_6whv41 = require('./core/hooks.cjs');
19
+ exports.createDefaultHooks = _mod_6whv41.createDefaultHooks;
20
+ exports.mergeHooks = _mod_6whv41.mergeHooks;;
21
+ const _mod_urv2c9 = require('./proxy/manager.cjs');
22
+ exports.ProxyManager = _mod_urv2c9.ProxyManager;;
23
+ const _mod_hfcxva = require('./queue/index.cjs');
24
+ exports.RezoQueue = _mod_hfcxva.RezoQueue;
25
+ exports.HttpQueue = _mod_hfcxva.HttpQueue;
26
+ exports.Priority = _mod_hfcxva.Priority;
27
+ exports.HttpMethodPriority = _mod_hfcxva.HttpMethodPriority;;
28
28
  const { RezoError } = require('./errors/rezo-error.cjs');
29
29
  const isRezoError = exports.isRezoError = RezoError.isRezoError;
30
30
  const Cancel = exports.Cancel = RezoError;
@@ -34,9 +34,9 @@ const isCancel = exports.isCancel = (error) => {
34
34
  };
35
35
  const all = exports.all = Promise.all.bind(Promise);
36
36
  const spread = exports.spread = (callback) => (array) => callback(...array);
37
- const _mod_wopl2b = require('./version.cjs');
38
- exports.VERSION = _mod_wopl2b.VERSION;
39
- exports.PACKAGE_NAME = _mod_wopl2b.PACKAGE_NAME;;
37
+ const _mod_wqlmnp = require('./version.cjs');
38
+ exports.VERSION = _mod_wqlmnp.VERSION;
39
+ exports.PACKAGE_NAME = _mod_wqlmnp.PACKAGE_NAME;;
40
40
  const { executeRequest } = require('./adapters/http.cjs');
41
41
  const { setGlobalAdapter, createRezoInstance } = require('./core/rezo.cjs');
42
42
  setGlobalAdapter(executeRequest);
package/dist/index.d.ts CHANGED
@@ -2030,6 +2030,13 @@ export interface QueueConfig {
2030
2030
  intervalCap?: number;
2031
2031
  /** Carry over unused interval capacity to next interval */
2032
2032
  carryoverConcurrencyCount?: boolean;
2033
+ /**
2034
+ * Reject the task promise when an error occurs (default: false)
2035
+ * When false, errors are swallowed and task.resolve(undefined) is called.
2036
+ * This prevents unhandled promise rejections but makes error handling harder.
2037
+ * When true, task.reject(error) is called, allowing proper try/catch handling.
2038
+ */
2039
+ rejectOnError?: boolean;
2033
2040
  }
2034
2041
  /**
2035
2042
  * HTTP-specific queue configuration
@@ -2342,8 +2349,12 @@ export declare class RezoQueue<T = any> {
2342
2349
  /**
2343
2350
  * Wait for queue size to be less than limit
2344
2351
  * @param limit - Size threshold
2352
+ * @param timeoutMs - Optional timeout in milliseconds (default: 0 = no timeout)
2353
+ * If timeout occurs, promise resolves (not rejects) to prevent blocking
2345
2354
  */
2346
- onSizeLessThan(limit: number): Promise<void>;
2355
+ onSizeLessThan(limit: number, timeoutMs?: number): Promise<void>;
2356
+ /** Maximum recommended handlers per event before warning */
2357
+ private static readonly MAX_HANDLERS_WARNING;
2347
2358
  /**
2348
2359
  * Register an event handler
2349
2360
  * @param event - Event name
@@ -4872,7 +4883,7 @@ export declare class HttpQueue extends RezoQueue<any> {
4872
4883
  *
4873
4884
  * IMPORTANT: Update these values when bumping package version.
4874
4885
  */
4875
- export declare const VERSION = "1.0.71";
4886
+ export declare const VERSION = "1.0.73";
4876
4887
  export declare const PACKAGE_NAME = "rezo";
4877
4888
  export declare const isRezoError: typeof RezoError.isRezoError;
4878
4889
  export declare const Cancel: typeof RezoError;
@@ -1,10 +1,10 @@
1
- const _mod_ciibkn = require('./base.cjs');
2
- exports.Agent = _mod_ciibkn.Agent;;
3
- const _mod_xw7r94 = require('./http-proxy.cjs');
4
- exports.HttpProxyAgent = _mod_xw7r94.HttpProxyAgent;;
5
- const _mod_tsiao5 = require('./https-proxy.cjs');
6
- exports.HttpsProxyAgent = _mod_tsiao5.HttpsProxyAgent;;
7
- const _mod_7qzeg0 = require('./socks-proxy.cjs');
8
- exports.SocksProxyAgent = _mod_7qzeg0.SocksProxyAgent;;
9
- const _mod_6f9tgw = require('./socks-client.cjs');
10
- exports.SocksClient = _mod_6f9tgw.SocksClient;;
1
+ const _mod_z9dkod = require('./base.cjs');
2
+ exports.Agent = _mod_z9dkod.Agent;;
3
+ const _mod_sd66wk = require('./http-proxy.cjs');
4
+ exports.HttpProxyAgent = _mod_sd66wk.HttpProxyAgent;;
5
+ const _mod_pwlo59 = require('./https-proxy.cjs');
6
+ exports.HttpsProxyAgent = _mod_pwlo59.HttpsProxyAgent;;
7
+ const _mod_a4lzyf = require('./socks-proxy.cjs');
8
+ exports.SocksProxyAgent = _mod_a4lzyf.SocksProxyAgent;;
9
+ const _mod_6yne7d = require('./socks-client.cjs');
10
+ exports.SocksClient = _mod_6yne7d.SocksClient;;
@@ -2011,6 +2011,13 @@ export interface QueueConfig {
2011
2011
  intervalCap?: number;
2012
2012
  /** Carry over unused interval capacity to next interval */
2013
2013
  carryoverConcurrencyCount?: boolean;
2014
+ /**
2015
+ * Reject the task promise when an error occurs (default: false)
2016
+ * When false, errors are swallowed and task.resolve(undefined) is called.
2017
+ * This prevents unhandled promise rejections but makes error handling harder.
2018
+ * When true, task.reject(error) is called, allowing proper try/catch handling.
2019
+ */
2020
+ rejectOnError?: boolean;
2014
2021
  }
2015
2022
  /**
2016
2023
  * Task options when adding to queue
@@ -2216,8 +2223,12 @@ declare class RezoQueue<T = any> {
2216
2223
  /**
2217
2224
  * Wait for queue size to be less than limit
2218
2225
  * @param limit - Size threshold
2226
+ * @param timeoutMs - Optional timeout in milliseconds (default: 0 = no timeout)
2227
+ * If timeout occurs, promise resolves (not rejects) to prevent blocking
2219
2228
  */
2220
- onSizeLessThan(limit: number): Promise<void>;
2229
+ onSizeLessThan(limit: number, timeoutMs?: number): Promise<void>;
2230
+ /** Maximum recommended handlers per event before warning */
2231
+ private static readonly MAX_HANDLERS_WARNING;
2221
2232
  /**
2222
2233
  * Register an event handler
2223
2234
  * @param event - Event name
@@ -4568,7 +4579,7 @@ export interface RezoInstance extends Rezo {
4568
4579
  *
4569
4580
  * IMPORTANT: Update these values when bumping package version.
4570
4581
  */
4571
- export declare const VERSION = "1.0.71";
4582
+ export declare const VERSION = "1.0.73";
4572
4583
  export declare const isRezoError: typeof RezoError.isRezoError;
4573
4584
  export declare const Cancel: typeof RezoError;
4574
4585
  export declare const CancelToken: {
@@ -2011,6 +2011,13 @@ export interface QueueConfig {
2011
2011
  intervalCap?: number;
2012
2012
  /** Carry over unused interval capacity to next interval */
2013
2013
  carryoverConcurrencyCount?: boolean;
2014
+ /**
2015
+ * Reject the task promise when an error occurs (default: false)
2016
+ * When false, errors are swallowed and task.resolve(undefined) is called.
2017
+ * This prevents unhandled promise rejections but makes error handling harder.
2018
+ * When true, task.reject(error) is called, allowing proper try/catch handling.
2019
+ */
2020
+ rejectOnError?: boolean;
2014
2021
  }
2015
2022
  /**
2016
2023
  * Task options when adding to queue
@@ -2216,8 +2223,12 @@ declare class RezoQueue<T = any> {
2216
2223
  /**
2217
2224
  * Wait for queue size to be less than limit
2218
2225
  * @param limit - Size threshold
2226
+ * @param timeoutMs - Optional timeout in milliseconds (default: 0 = no timeout)
2227
+ * If timeout occurs, promise resolves (not rejects) to prevent blocking
2219
2228
  */
2220
- onSizeLessThan(limit: number): Promise<void>;
2229
+ onSizeLessThan(limit: number, timeoutMs?: number): Promise<void>;
2230
+ /** Maximum recommended handlers per event before warning */
2231
+ private static readonly MAX_HANDLERS_WARNING;
2221
2232
  /**
2222
2233
  * Register an event handler
2223
2234
  * @param event - Event name
@@ -4568,7 +4579,7 @@ export interface RezoInstance extends Rezo {
4568
4579
  *
4569
4580
  * IMPORTANT: Update these values when bumping package version.
4570
4581
  */
4571
- export declare const VERSION = "1.0.71";
4582
+ export declare const VERSION = "1.0.73";
4572
4583
  export declare const isRezoError: typeof RezoError.isRezoError;
4573
4584
  export declare const Cancel: typeof RezoError;
4574
4585
  export declare const CancelToken: {
@@ -2011,6 +2011,13 @@ export interface QueueConfig {
2011
2011
  intervalCap?: number;
2012
2012
  /** Carry over unused interval capacity to next interval */
2013
2013
  carryoverConcurrencyCount?: boolean;
2014
+ /**
2015
+ * Reject the task promise when an error occurs (default: false)
2016
+ * When false, errors are swallowed and task.resolve(undefined) is called.
2017
+ * This prevents unhandled promise rejections but makes error handling harder.
2018
+ * When true, task.reject(error) is called, allowing proper try/catch handling.
2019
+ */
2020
+ rejectOnError?: boolean;
2014
2021
  }
2015
2022
  /**
2016
2023
  * Task options when adding to queue
@@ -2216,8 +2223,12 @@ declare class RezoQueue<T = any> {
2216
2223
  /**
2217
2224
  * Wait for queue size to be less than limit
2218
2225
  * @param limit - Size threshold
2226
+ * @param timeoutMs - Optional timeout in milliseconds (default: 0 = no timeout)
2227
+ * If timeout occurs, promise resolves (not rejects) to prevent blocking
2219
2228
  */
2220
- onSizeLessThan(limit: number): Promise<void>;
2229
+ onSizeLessThan(limit: number, timeoutMs?: number): Promise<void>;
2230
+ /** Maximum recommended handlers per event before warning */
2231
+ private static readonly MAX_HANDLERS_WARNING;
2221
2232
  /**
2222
2233
  * Register an event handler
2223
2234
  * @param event - Event name
@@ -4568,7 +4579,7 @@ export interface RezoInstance extends Rezo {
4568
4579
  *
4569
4580
  * IMPORTANT: Update these values when bumping package version.
4570
4581
  */
4571
- export declare const VERSION = "1.0.71";
4582
+ export declare const VERSION = "1.0.73";
4572
4583
  export declare const isRezoError: typeof RezoError.isRezoError;
4573
4584
  export declare const Cancel: typeof RezoError;
4574
4585
  export declare const CancelToken: {
@@ -2011,6 +2011,13 @@ export interface QueueConfig {
2011
2011
  intervalCap?: number;
2012
2012
  /** Carry over unused interval capacity to next interval */
2013
2013
  carryoverConcurrencyCount?: boolean;
2014
+ /**
2015
+ * Reject the task promise when an error occurs (default: false)
2016
+ * When false, errors are swallowed and task.resolve(undefined) is called.
2017
+ * This prevents unhandled promise rejections but makes error handling harder.
2018
+ * When true, task.reject(error) is called, allowing proper try/catch handling.
2019
+ */
2020
+ rejectOnError?: boolean;
2014
2021
  }
2015
2022
  /**
2016
2023
  * Task options when adding to queue
@@ -2216,8 +2223,12 @@ declare class RezoQueue<T = any> {
2216
2223
  /**
2217
2224
  * Wait for queue size to be less than limit
2218
2225
  * @param limit - Size threshold
2226
+ * @param timeoutMs - Optional timeout in milliseconds (default: 0 = no timeout)
2227
+ * If timeout occurs, promise resolves (not rejects) to prevent blocking
2219
2228
  */
2220
- onSizeLessThan(limit: number): Promise<void>;
2229
+ onSizeLessThan(limit: number, timeoutMs?: number): Promise<void>;
2230
+ /** Maximum recommended handlers per event before warning */
2231
+ private static readonly MAX_HANDLERS_WARNING;
2221
2232
  /**
2222
2233
  * Register an event handler
2223
2234
  * @param event - Event name
@@ -4568,7 +4579,7 @@ export interface RezoInstance extends Rezo {
4568
4579
  *
4569
4580
  * IMPORTANT: Update these values when bumping package version.
4570
4581
  */
4571
- export declare const VERSION = "1.0.71";
4582
+ export declare const VERSION = "1.0.73";
4572
4583
  export declare const isRezoError: typeof RezoError.isRezoError;
4573
4584
  export declare const Cancel: typeof RezoError;
4574
4585
  export declare const CancelToken: {
@@ -2011,6 +2011,13 @@ export interface QueueConfig {
2011
2011
  intervalCap?: number;
2012
2012
  /** Carry over unused interval capacity to next interval */
2013
2013
  carryoverConcurrencyCount?: boolean;
2014
+ /**
2015
+ * Reject the task promise when an error occurs (default: false)
2016
+ * When false, errors are swallowed and task.resolve(undefined) is called.
2017
+ * This prevents unhandled promise rejections but makes error handling harder.
2018
+ * When true, task.reject(error) is called, allowing proper try/catch handling.
2019
+ */
2020
+ rejectOnError?: boolean;
2014
2021
  }
2015
2022
  /**
2016
2023
  * Task options when adding to queue
@@ -2216,8 +2223,12 @@ declare class RezoQueue<T = any> {
2216
2223
  /**
2217
2224
  * Wait for queue size to be less than limit
2218
2225
  * @param limit - Size threshold
2226
+ * @param timeoutMs - Optional timeout in milliseconds (default: 0 = no timeout)
2227
+ * If timeout occurs, promise resolves (not rejects) to prevent blocking
2219
2228
  */
2220
- onSizeLessThan(limit: number): Promise<void>;
2229
+ onSizeLessThan(limit: number, timeoutMs?: number): Promise<void>;
2230
+ /** Maximum recommended handlers per event before warning */
2231
+ private static readonly MAX_HANDLERS_WARNING;
2221
2232
  /**
2222
2233
  * Register an event handler
2223
2234
  * @param event - Event name
@@ -4568,7 +4579,7 @@ export interface RezoInstance extends Rezo {
4568
4579
  *
4569
4580
  * IMPORTANT: Update these values when bumping package version.
4570
4581
  */
4571
- export declare const VERSION = "1.0.71";
4582
+ export declare const VERSION = "1.0.73";
4572
4583
  export declare const isRezoError: typeof RezoError.isRezoError;
4573
4584
  export declare const Cancel: typeof RezoError;
4574
4585
  export declare const CancelToken: {