rezo 1.0.87 → 1.0.88

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.
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  /**
5068
5078
  * cURL Options Configuration
5069
5079
  *
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  /**
5068
5078
  * Type guard to check if an error is a RezoError instance.
5069
5079
  */
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -1,6 +1,6 @@
1
- const _mod_lnjmrl = require('./picker.cjs');
2
- exports.detectRuntime = _mod_lnjmrl.detectRuntime;
3
- exports.getAdapterCapabilities = _mod_lnjmrl.getAdapterCapabilities;
4
- exports.buildAdapterContext = _mod_lnjmrl.buildAdapterContext;
5
- exports.getAvailableAdapters = _mod_lnjmrl.getAvailableAdapters;
6
- exports.selectAdapter = _mod_lnjmrl.selectAdapter;;
1
+ const _mod_l4pi6n = require('./picker.cjs');
2
+ exports.detectRuntime = _mod_l4pi6n.detectRuntime;
3
+ exports.getAdapterCapabilities = _mod_l4pi6n.getAdapterCapabilities;
4
+ exports.buildAdapterContext = _mod_l4pi6n.buildAdapterContext;
5
+ exports.getAvailableAdapters = _mod_l4pi6n.getAvailableAdapters;
6
+ exports.selectAdapter = _mod_l4pi6n.selectAdapter;;
@@ -1,9 +1,9 @@
1
- const _mod_yxyjd1 = require('./lru-cache.cjs');
2
- exports.LRUCache = _mod_yxyjd1.LRUCache;;
3
- const _mod_mjqq7m = require('./dns-cache.cjs');
4
- exports.DNSCache = _mod_mjqq7m.DNSCache;
5
- exports.getGlobalDNSCache = _mod_mjqq7m.getGlobalDNSCache;
6
- exports.resetGlobalDNSCache = _mod_mjqq7m.resetGlobalDNSCache;;
7
- const _mod_kivn6x = require('./response-cache.cjs');
8
- exports.ResponseCache = _mod_kivn6x.ResponseCache;
9
- exports.normalizeResponseCacheConfig = _mod_kivn6x.normalizeResponseCacheConfig;;
1
+ const _mod_t6h2kn = require('./lru-cache.cjs');
2
+ exports.LRUCache = _mod_t6h2kn.LRUCache;;
3
+ const _mod_nl5s2c = require('./dns-cache.cjs');
4
+ exports.DNSCache = _mod_nl5s2c.DNSCache;
5
+ exports.getGlobalDNSCache = _mod_nl5s2c.getGlobalDNSCache;
6
+ exports.resetGlobalDNSCache = _mod_nl5s2c.resetGlobalDNSCache;;
7
+ const _mod_9alyql = require('./response-cache.cjs');
8
+ exports.ResponseCache = _mod_9alyql.ResponseCache;
9
+ exports.normalizeResponseCacheConfig = _mod_9alyql.normalizeResponseCacheConfig;;
@@ -1,42 +1,42 @@
1
- const _mod_jp0y3o = require('./crawler.cjs');
2
- exports.Crawler = _mod_jp0y3o.Crawler;;
3
- const _mod_wuds61 = require('./crawler-options.cjs');
4
- exports.CrawlerOptions = _mod_wuds61.CrawlerOptions;;
5
- const _mod_uyr8tn = require('./plugin/robots-txt.cjs');
6
- exports.RobotsTxt = _mod_uyr8tn.RobotsTxt;;
7
- const _mod_6ekwro = require('./plugin/file-cacher.cjs');
8
- exports.FileCacher = _mod_6ekwro.FileCacher;;
9
- const _mod_oid3vg = require('./plugin/url-store.cjs');
10
- exports.UrlStore = _mod_oid3vg.UrlStore;;
11
- const _mod_4ztn27 = require('./plugin/navigation-history.cjs');
12
- exports.NavigationHistory = _mod_4ztn27.NavigationHistory;;
13
- const _mod_xqhnix = require('./addon/oxylabs/index.cjs');
14
- exports.Oxylabs = _mod_xqhnix.Oxylabs;;
15
- const _mod_vbrdt8 = require('./addon/oxylabs/options.cjs');
16
- exports.OXYLABS_BROWSER_TYPES = _mod_vbrdt8.OXYLABS_BROWSER_TYPES;
17
- exports.OXYLABS_COMMON_LOCALES = _mod_vbrdt8.OXYLABS_COMMON_LOCALES;
18
- exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_vbrdt8.OXYLABS_COMMON_GEO_LOCATIONS;
19
- exports.OXYLABS_US_STATES = _mod_vbrdt8.OXYLABS_US_STATES;
20
- exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_vbrdt8.OXYLABS_EUROPEAN_COUNTRIES;
21
- exports.OXYLABS_ASIAN_COUNTRIES = _mod_vbrdt8.OXYLABS_ASIAN_COUNTRIES;
22
- exports.getRandomOxylabsBrowserType = _mod_vbrdt8.getRandomBrowserType;
23
- exports.getRandomOxylabsLocale = _mod_vbrdt8.getRandomLocale;
24
- exports.getRandomOxylabsGeoLocation = _mod_vbrdt8.getRandomGeoLocation;;
25
- const _mod_tsxq0y = require('./scraper.cjs');
26
- exports.isRestrictedDomain = _mod_tsxq0y.isRestrictedDomain;;
27
- const _mod_mkayne = require('./addon/decodo/index.cjs');
28
- exports.Decodo = _mod_mkayne.Decodo;;
29
- const _mod_d7gd2a = require('./addon/decodo/options.cjs');
30
- exports.DECODO_DEVICE_TYPES = _mod_d7gd2a.DECODO_DEVICE_TYPES;
31
- exports.DECODO_HEADLESS_MODES = _mod_d7gd2a.DECODO_HEADLESS_MODES;
32
- exports.DECODO_COMMON_LOCALES = _mod_d7gd2a.DECODO_COMMON_LOCALES;
33
- exports.DECODO_COMMON_COUNTRIES = _mod_d7gd2a.DECODO_COMMON_COUNTRIES;
34
- exports.DECODO_EUROPEAN_COUNTRIES = _mod_d7gd2a.DECODO_EUROPEAN_COUNTRIES;
35
- exports.DECODO_ASIAN_COUNTRIES = _mod_d7gd2a.DECODO_ASIAN_COUNTRIES;
36
- exports.DECODO_US_STATES = _mod_d7gd2a.DECODO_US_STATES;
37
- exports.DECODO_COMMON_CITIES = _mod_d7gd2a.DECODO_COMMON_CITIES;
38
- exports.getRandomDecodoDeviceType = _mod_d7gd2a.getRandomDeviceType;
39
- exports.getRandomDecodoLocale = _mod_d7gd2a.getRandomLocale;
40
- exports.getRandomDecodoCountry = _mod_d7gd2a.getRandomCountry;
41
- exports.getRandomDecodoCity = _mod_d7gd2a.getRandomCity;
42
- exports.generateDecodoSessionId = _mod_d7gd2a.generateSessionId;;
1
+ const _mod_8juo7r = require('./crawler.cjs');
2
+ exports.Crawler = _mod_8juo7r.Crawler;;
3
+ const _mod_sb4o46 = require('./crawler-options.cjs');
4
+ exports.CrawlerOptions = _mod_sb4o46.CrawlerOptions;;
5
+ const _mod_drcjjy = require('./plugin/robots-txt.cjs');
6
+ exports.RobotsTxt = _mod_drcjjy.RobotsTxt;;
7
+ const _mod_q1ga0s = require('./plugin/file-cacher.cjs');
8
+ exports.FileCacher = _mod_q1ga0s.FileCacher;;
9
+ const _mod_uvu7w6 = require('./plugin/url-store.cjs');
10
+ exports.UrlStore = _mod_uvu7w6.UrlStore;;
11
+ const _mod_qf2krg = require('./plugin/navigation-history.cjs');
12
+ exports.NavigationHistory = _mod_qf2krg.NavigationHistory;;
13
+ const _mod_eztyc3 = require('./addon/oxylabs/index.cjs');
14
+ exports.Oxylabs = _mod_eztyc3.Oxylabs;;
15
+ const _mod_w36i5v = require('./addon/oxylabs/options.cjs');
16
+ exports.OXYLABS_BROWSER_TYPES = _mod_w36i5v.OXYLABS_BROWSER_TYPES;
17
+ exports.OXYLABS_COMMON_LOCALES = _mod_w36i5v.OXYLABS_COMMON_LOCALES;
18
+ exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_w36i5v.OXYLABS_COMMON_GEO_LOCATIONS;
19
+ exports.OXYLABS_US_STATES = _mod_w36i5v.OXYLABS_US_STATES;
20
+ exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_w36i5v.OXYLABS_EUROPEAN_COUNTRIES;
21
+ exports.OXYLABS_ASIAN_COUNTRIES = _mod_w36i5v.OXYLABS_ASIAN_COUNTRIES;
22
+ exports.getRandomOxylabsBrowserType = _mod_w36i5v.getRandomBrowserType;
23
+ exports.getRandomOxylabsLocale = _mod_w36i5v.getRandomLocale;
24
+ exports.getRandomOxylabsGeoLocation = _mod_w36i5v.getRandomGeoLocation;;
25
+ const _mod_7a58s0 = require('./scraper.cjs');
26
+ exports.isRestrictedDomain = _mod_7a58s0.isRestrictedDomain;;
27
+ const _mod_b3mhqq = require('./addon/decodo/index.cjs');
28
+ exports.Decodo = _mod_b3mhqq.Decodo;;
29
+ const _mod_17ovrd = require('./addon/decodo/options.cjs');
30
+ exports.DECODO_DEVICE_TYPES = _mod_17ovrd.DECODO_DEVICE_TYPES;
31
+ exports.DECODO_HEADLESS_MODES = _mod_17ovrd.DECODO_HEADLESS_MODES;
32
+ exports.DECODO_COMMON_LOCALES = _mod_17ovrd.DECODO_COMMON_LOCALES;
33
+ exports.DECODO_COMMON_COUNTRIES = _mod_17ovrd.DECODO_COMMON_COUNTRIES;
34
+ exports.DECODO_EUROPEAN_COUNTRIES = _mod_17ovrd.DECODO_EUROPEAN_COUNTRIES;
35
+ exports.DECODO_ASIAN_COUNTRIES = _mod_17ovrd.DECODO_ASIAN_COUNTRIES;
36
+ exports.DECODO_US_STATES = _mod_17ovrd.DECODO_US_STATES;
37
+ exports.DECODO_COMMON_CITIES = _mod_17ovrd.DECODO_COMMON_CITIES;
38
+ exports.getRandomDecodoDeviceType = _mod_17ovrd.getRandomDeviceType;
39
+ exports.getRandomDecodoLocale = _mod_17ovrd.getRandomLocale;
40
+ exports.getRandomDecodoCountry = _mod_17ovrd.getRandomCountry;
41
+ exports.getRandomDecodoCity = _mod_17ovrd.getRandomCity;
42
+ exports.generateDecodoSessionId = _mod_17ovrd.generateSessionId;;
@@ -1 +1 @@
1
- var e=require("./file-cacher.cjs");exports.FileCacher=e.FileCacher;var r=require("./url-store.cjs");exports.UrlStore=r.UrlStore;var o=require("./result-stream.cjs");exports.ResultStream=o.ResultStream;var t=require("./memory-monitor.cjs");exports.MemoryMonitor=t.MemoryMonitor;var a=require("./health-metrics.cjs");exports.HealthMetrics=a.HealthMetrics;var m=require("./capped-map.cjs");exports.CappedMap=m.CappedMap;var c=require("./capped-array.cjs");exports.CappedArray=c.CappedArray;
1
+ var e=require("./file-cacher.cjs");exports.FileCacher=e.FileCacher;var r=require("./url-store.cjs");exports.UrlStore=r.UrlStore;var o=require("./result-stream.cjs");exports.ResultStream=o.ResultStream;var t=require("./memory-monitor.cjs");exports.MemoryMonitor=t.MemoryMonitor;var a=require("./health-metrics.cjs");exports.HealthMetrics=a.HealthMetrics;var i=require("./capped-map.cjs");exports.CappedMap=i.CappedMap;var s=require("./capped-array.cjs");exports.CappedArray=s.CappedArray;
package/dist/crawler.d.ts CHANGED
@@ -2301,9 +2301,19 @@ declare class RezoQueue<T = any> {
2301
2301
  */
2302
2302
  private insertByPriority;
2303
2303
  /**
2304
- * Try to run next task if capacity available
2304
+ * Try to run next task if capacity available.
2305
+ *
2306
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2307
+ * checks INSIDE itself — only after confirming there's nothing left to
2308
+ * dequeue. This prevents the false-idle race where idle fires while
2309
+ * tasks are still in the queue waiting to be shifted.
2305
2310
  */
2306
2311
  private tryRunNext;
2312
+ /**
2313
+ * Clear the interval timer (called when queue empties).
2314
+ * The interval will be re-created when new tasks are added.
2315
+ */
2316
+ private clearIntervalTimer;
2307
2317
  /**
2308
2318
  * Execute a task
2309
2319
  */
@@ -1,6 +1,6 @@
1
- const _mod_q0izw2 = require('../crawler/crawler.cjs');
2
- exports.Crawler = _mod_q0izw2.Crawler;;
3
- const _mod_jm14tg = require('../crawler/crawler-options.cjs');
4
- exports.CrawlerOptions = _mod_jm14tg.CrawlerOptions;;
5
- const _mod_5ljis4 = require('../crawler/scraper.cjs');
6
- exports.isRestrictedDomain = _mod_5ljis4.isRestrictedDomain;;
1
+ const _mod_k7gxej = require('../crawler/crawler.cjs');
2
+ exports.Crawler = _mod_k7gxej.Crawler;;
3
+ const _mod_psf4i0 = require('../crawler/crawler-options.cjs');
4
+ exports.CrawlerOptions = _mod_psf4i0.CrawlerOptions;;
5
+ const _mod_idgace = require('../crawler/scraper.cjs');
6
+ exports.isRestrictedDomain = _mod_idgace.isRestrictedDomain;;
package/dist/index.cjs CHANGED
@@ -1,31 +1,31 @@
1
- const _mod_h6tlc9 = require('./core/rezo.cjs');
2
- exports.Rezo = _mod_h6tlc9.Rezo;
3
- exports.createRezoInstance = _mod_h6tlc9.createRezoInstance;
4
- exports.createDefaultInstance = _mod_h6tlc9.createDefaultInstance;;
5
- const _mod_nuc5zt = require('./errors/rezo-error.cjs');
6
- exports.RezoError = _mod_nuc5zt.RezoError;
7
- exports.RezoErrorCode = _mod_nuc5zt.RezoErrorCode;;
8
- const _mod_61pwfg = require('./utils/headers.cjs');
9
- exports.RezoHeaders = _mod_61pwfg.RezoHeaders;;
10
- const _mod_71hpot = require('./utils/form-data.cjs');
11
- exports.RezoFormData = _mod_71hpot.RezoFormData;;
12
- const _mod_vcb5yw = require('./utils/cookies.cjs');
13
- exports.RezoCookieJar = _mod_vcb5yw.RezoCookieJar;
14
- exports.Cookie = _mod_vcb5yw.Cookie;;
15
- const _mod_wfw4c8 = require('./utils/curl.cjs');
16
- exports.toCurl = _mod_wfw4c8.toCurl;
17
- exports.fromCurl = _mod_wfw4c8.fromCurl;;
18
- const _mod_ptq2ft = require('./core/hooks.cjs');
19
- exports.createDefaultHooks = _mod_ptq2ft.createDefaultHooks;
20
- exports.mergeHooks = _mod_ptq2ft.mergeHooks;;
21
- const _mod_taedhh = require('./proxy/manager.cjs');
22
- exports.ProxyManager = _mod_taedhh.ProxyManager;;
23
- const _mod_ad4u7m = require('./queue/index.cjs');
24
- exports.RezoQueue = _mod_ad4u7m.RezoQueue;
25
- exports.HttpQueue = _mod_ad4u7m.HttpQueue;
26
- exports.RezoHttpQueue = _mod_ad4u7m.RezoHttpQueue;
27
- exports.Priority = _mod_ad4u7m.Priority;
28
- exports.HttpMethodPriority = _mod_ad4u7m.HttpMethodPriority;;
1
+ const _mod_sdntn0 = require('./core/rezo.cjs');
2
+ exports.Rezo = _mod_sdntn0.Rezo;
3
+ exports.createRezoInstance = _mod_sdntn0.createRezoInstance;
4
+ exports.createDefaultInstance = _mod_sdntn0.createDefaultInstance;;
5
+ const _mod_pdyuoe = require('./errors/rezo-error.cjs');
6
+ exports.RezoError = _mod_pdyuoe.RezoError;
7
+ exports.RezoErrorCode = _mod_pdyuoe.RezoErrorCode;;
8
+ const _mod_7sheyg = require('./utils/headers.cjs');
9
+ exports.RezoHeaders = _mod_7sheyg.RezoHeaders;;
10
+ const _mod_cd79xb = require('./utils/form-data.cjs');
11
+ exports.RezoFormData = _mod_cd79xb.RezoFormData;;
12
+ const _mod_ztcyti = require('./utils/cookies.cjs');
13
+ exports.RezoCookieJar = _mod_ztcyti.RezoCookieJar;
14
+ exports.Cookie = _mod_ztcyti.Cookie;;
15
+ const _mod_utfxtb = require('./utils/curl.cjs');
16
+ exports.toCurl = _mod_utfxtb.toCurl;
17
+ exports.fromCurl = _mod_utfxtb.fromCurl;;
18
+ const _mod_hesx76 = require('./core/hooks.cjs');
19
+ exports.createDefaultHooks = _mod_hesx76.createDefaultHooks;
20
+ exports.mergeHooks = _mod_hesx76.mergeHooks;;
21
+ const _mod_1xsh7m = require('./proxy/manager.cjs');
22
+ exports.ProxyManager = _mod_1xsh7m.ProxyManager;;
23
+ const _mod_h9ctoa = require('./queue/index.cjs');
24
+ exports.RezoQueue = _mod_h9ctoa.RezoQueue;
25
+ exports.HttpQueue = _mod_h9ctoa.HttpQueue;
26
+ exports.RezoHttpQueue = _mod_h9ctoa.RezoHttpQueue;
27
+ exports.Priority = _mod_h9ctoa.Priority;
28
+ exports.HttpMethodPriority = _mod_h9ctoa.HttpMethodPriority;;
29
29
  const { RezoError } = require('./errors/rezo-error.cjs');
30
30
  const isRezoError = exports.isRezoError = RezoError.isRezoError;
31
31
  const Cancel = exports.Cancel = RezoError;
@@ -35,9 +35,9 @@ const isCancel = exports.isCancel = (error) => {
35
35
  };
36
36
  const all = exports.all = Promise.all.bind(Promise);
37
37
  const spread = exports.spread = (callback) => (array) => callback(...array);
38
- const _mod_rioui9 = require('./version.cjs');
39
- exports.VERSION = _mod_rioui9.VERSION;
40
- exports.PACKAGE_NAME = _mod_rioui9.PACKAGE_NAME;;
38
+ const _mod_fwokhm = require('./version.cjs');
39
+ exports.VERSION = _mod_fwokhm.VERSION;
40
+ exports.PACKAGE_NAME = _mod_fwokhm.PACKAGE_NAME;;
41
41
  const { executeRequest } = require('./adapters/http.cjs');
42
42
  const { setGlobalAdapter, createRezoInstance } = require('./core/rezo.cjs');
43
43
  setGlobalAdapter(executeRequest);
package/dist/index.d.ts CHANGED
@@ -2244,9 +2244,19 @@ export declare class RezoQueue<T = any> {
2244
2244
  */
2245
2245
  private insertByPriority;
2246
2246
  /**
2247
- * Try to run next task if capacity available
2247
+ * Try to run next task if capacity available.
2248
+ *
2249
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2250
+ * checks INSIDE itself — only after confirming there's nothing left to
2251
+ * dequeue. This prevents the false-idle race where idle fires while
2252
+ * tasks are still in the queue waiting to be shifted.
2248
2253
  */
2249
2254
  private tryRunNext;
2255
+ /**
2256
+ * Clear the interval timer (called when queue empties).
2257
+ * The interval will be re-created when new tasks are added.
2258
+ */
2259
+ private clearIntervalTimer;
2250
2260
  /**
2251
2261
  * Execute a task
2252
2262
  */
@@ -5192,7 +5202,7 @@ export declare function createDefaultInstance(config?: RezoDefaultOptions): Rezo
5192
5202
  *
5193
5203
  * IMPORTANT: Update these values when bumping package version.
5194
5204
  */
5195
- export declare const VERSION = "1.0.87";
5205
+ export declare const VERSION = "1.0.88";
5196
5206
  export declare const PACKAGE_NAME = "rezo";
5197
5207
  export declare const isRezoError: typeof RezoError.isRezoError;
5198
5208
  export declare const Cancel: typeof RezoError;
@@ -1,14 +1,14 @@
1
- const _mod_82lmdz = require('./base.cjs');
2
- exports.Agent = _mod_82lmdz.Agent;;
3
- const _mod_a8m5lr = require('./http-proxy.cjs');
4
- exports.HttpProxyAgent = _mod_a8m5lr.HttpProxyAgent;;
5
- const _mod_3fqrdx = require('./https-proxy.cjs');
6
- exports.HttpsProxyAgent = _mod_3fqrdx.HttpsProxyAgent;;
7
- const _mod_4lxyh4 = require('./socks-proxy.cjs');
8
- exports.SocksProxyAgent = _mod_4lxyh4.SocksProxyAgent;;
9
- const _mod_ilx3g9 = require('./socks-client.cjs');
10
- exports.SocksClient = _mod_ilx3g9.SocksClient;;
11
- const _mod_tfvoyf = require('./bun-socks-http.cjs');
12
- exports.bunHttp = _mod_tfvoyf.bunHttp;
13
- exports.isBunRuntime = _mod_tfvoyf.isBunRuntime;
14
- exports.isBunSocksRequest = _mod_tfvoyf.isBunSocksRequest;;
1
+ const _mod_uxsy33 = require('./base.cjs');
2
+ exports.Agent = _mod_uxsy33.Agent;;
3
+ const _mod_5rtaqp = require('./http-proxy.cjs');
4
+ exports.HttpProxyAgent = _mod_5rtaqp.HttpProxyAgent;;
5
+ const _mod_c1o8pn = require('./https-proxy.cjs');
6
+ exports.HttpsProxyAgent = _mod_c1o8pn.HttpsProxyAgent;;
7
+ const _mod_1us0su = require('./socks-proxy.cjs');
8
+ exports.SocksProxyAgent = _mod_1us0su.SocksProxyAgent;;
9
+ const _mod_psmyux = require('./socks-client.cjs');
10
+ exports.SocksClient = _mod_psmyux.SocksClient;;
11
+ const _mod_kwf9cn = require('./bun-socks-http.cjs');
12
+ exports.bunHttp = _mod_kwf9cn.bunHttp;
13
+ exports.isBunRuntime = _mod_kwf9cn.isBunRuntime;
14
+ exports.isBunSocksRequest = _mod_kwf9cn.isBunSocksRequest;;
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -2182,9 +2182,19 @@ declare class RezoQueue<T = any> {
2182
2182
  */
2183
2183
  private insertByPriority;
2184
2184
  /**
2185
- * Try to run next task if capacity available
2185
+ * Try to run next task if capacity available.
2186
+ *
2187
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
2188
+ * checks INSIDE itself — only after confirming there's nothing left to
2189
+ * dequeue. This prevents the false-idle race where idle fires while
2190
+ * tasks are still in the queue waiting to be shifted.
2186
2191
  */
2187
2192
  private tryRunNext;
2193
+ /**
2194
+ * Clear the interval timer (called when queue empties).
2195
+ * The interval will be re-created when new tasks are added.
2196
+ */
2197
+ private clearIntervalTimer;
2188
2198
  /**
2189
2199
  * Execute a task
2190
2200
  */
@@ -5063,7 +5073,7 @@ export interface RezoInstance extends Rezo, RezoCallable {
5063
5073
  *
5064
5074
  * IMPORTANT: Update these values when bumping package version.
5065
5075
  */
5066
- export declare const VERSION = "1.0.87";
5076
+ export declare const VERSION = "1.0.88";
5067
5077
  export declare const isRezoError: typeof RezoError.isRezoError;
5068
5078
  export declare const Cancel: typeof RezoError;
5069
5079
  export declare const CancelToken: {
@@ -1,9 +1,9 @@
1
1
  const { Agent, HttpProxyAgent, HttpsProxyAgent, SocksProxyAgent } = require('../internal/agents/index.cjs');
2
2
  const { parseProxyString } = require('./parse.cjs');
3
- const _mod_gyrrrw = require('./manager.cjs');
4
- exports.ProxyManager = _mod_gyrrrw.ProxyManager;;
5
- const _mod_gv35rs = require('./parse.cjs');
6
- exports.parseProxyString = _mod_gv35rs.parseProxyString;;
3
+ const _mod_qvig2a = require('./manager.cjs');
4
+ exports.ProxyManager = _mod_qvig2a.ProxyManager;;
5
+ const _mod_bd1jr1 = require('./parse.cjs');
6
+ exports.parseProxyString = _mod_bd1jr1.parseProxyString;;
7
7
  function createOptions(uri, opts) {
8
8
  if (uri instanceof URL || typeof uri === "string") {
9
9
  return {
@@ -1,9 +1,9 @@
1
- const _mod_a5wg8o = require('./queue.cjs');
2
- exports.RezoQueue = _mod_a5wg8o.RezoQueue;;
3
- const _mod_3uzjnx = require('./http-queue.cjs');
4
- exports.HttpQueue = _mod_3uzjnx.HttpQueue;
5
- exports.RezoHttpQueue = _mod_3uzjnx.HttpQueue;
6
- exports.extractDomain = _mod_3uzjnx.extractDomain;;
7
- const _mod_3s9hif = require('./types.cjs');
8
- exports.Priority = _mod_3s9hif.Priority;
9
- exports.HttpMethodPriority = _mod_3s9hif.HttpMethodPriority;;
1
+ const _mod_khfbin = require('./queue.cjs');
2
+ exports.RezoQueue = _mod_khfbin.RezoQueue;;
3
+ const _mod_nsoyxx = require('./http-queue.cjs');
4
+ exports.HttpQueue = _mod_nsoyxx.HttpQueue;
5
+ exports.RezoHttpQueue = _mod_nsoyxx.HttpQueue;
6
+ exports.extractDomain = _mod_nsoyxx.extractDomain;;
7
+ const _mod_4vao4e = require('./types.cjs');
8
+ exports.Priority = _mod_4vao4e.Priority;
9
+ exports.HttpMethodPriority = _mod_4vao4e.HttpMethodPriority;;
@@ -103,6 +103,9 @@ class RezoQueue {
103
103
  this.statsData.added++;
104
104
  this.hasEverBeenActive = true;
105
105
  this.emit("add", { id: task.id, priority: task.priority });
106
+ if (this.config.interval > 0 && !this.intervalId) {
107
+ this.startInterval();
108
+ }
106
109
  if (this.config.autoStart && !this.isPausedFlag) {
107
110
  this.tryRunNext();
108
111
  }
@@ -136,7 +139,11 @@ class RezoQueue {
136
139
  this.statsData.cancelled++;
137
140
  this.emit("cancelled", { id: task.id });
138
141
  }
142
+ this.clearIntervalTimer();
139
143
  this.checkEmpty();
144
+ if (this.pendingCount === 0) {
145
+ this.checkIdle();
146
+ }
140
147
  }
141
148
  cancel(id) {
142
149
  const index = this.queue.findIndex((t) => t.id === id);
@@ -251,10 +258,7 @@ class RezoQueue {
251
258
  }
252
259
  destroy() {
253
260
  this.clear();
254
- if (this.intervalId) {
255
- clearInterval(this.intervalId);
256
- this.intervalId = undefined;
257
- }
261
+ this.clearIntervalTimer();
258
262
  this.eventHandlers.clear();
259
263
  }
260
264
  insertByPriority(task) {
@@ -269,19 +273,32 @@ class RezoQueue {
269
273
  }
270
274
  tryRunNext() {
271
275
  if (this.isPausedFlag)
272
- return;
273
- if (this.queue.length === 0)
274
- return;
276
+ return false;
277
+ if (this.queue.length === 0) {
278
+ this.clearIntervalTimer();
279
+ this.checkEmpty();
280
+ if (this.pendingCount === 0) {
281
+ this.checkIdle();
282
+ }
283
+ return false;
284
+ }
275
285
  if (this.pendingCount >= this.config.concurrency)
276
- return;
286
+ return false;
277
287
  if (this.config.interval > 0) {
278
288
  if (this.intervalCount >= this.config.intervalCap)
279
- return;
289
+ return false;
280
290
  this.intervalCount++;
281
291
  }
282
292
  const task = this.queue.shift();
283
293
  this.runTask(task);
284
294
  this.tryRunNext();
295
+ return true;
296
+ }
297
+ clearIntervalTimer() {
298
+ if (this.intervalId) {
299
+ clearInterval(this.intervalId);
300
+ this.intervalId = undefined;
301
+ }
285
302
  }
286
303
  async runTask(task) {
287
304
  this.pendingCount++;
@@ -291,7 +308,6 @@ class RezoQueue {
291
308
  this.emit("active", undefined);
292
309
  }
293
310
  this.emit("start", { id: task.id });
294
- this.emit("next", undefined);
295
311
  const startTime = Date.now();
296
312
  let timeoutId;
297
313
  try {
@@ -335,10 +351,11 @@ class RezoQueue {
335
351
  delete task._abortHandler;
336
352
  delete task._signal;
337
353
  }
338
- this.pendingCount--;
339
- this.checkEmpty();
340
- this.checkIdle();
341
- this.tryRunNext();
354
+ queueMicrotask(() => {
355
+ this.pendingCount--;
356
+ this.tryRunNext();
357
+ this.emit("next", undefined);
358
+ });
342
359
  }
343
360
  }
344
361
  recordDuration(duration) {
@@ -362,7 +379,6 @@ class RezoQueue {
362
379
  this.intervalStart = Date.now();
363
380
  this.tryRunNext();
364
381
  }, this.config.interval);
365
- this.intervalId.unref();
366
382
  }
367
383
  emit(event, data) {
368
384
  const handlers = this.eventHandlers.get(event);
@@ -103,6 +103,9 @@ export class RezoQueue {
103
103
  this.statsData.added++;
104
104
  this.hasEverBeenActive = true;
105
105
  this.emit("add", { id: task.id, priority: task.priority });
106
+ if (this.config.interval > 0 && !this.intervalId) {
107
+ this.startInterval();
108
+ }
106
109
  if (this.config.autoStart && !this.isPausedFlag) {
107
110
  this.tryRunNext();
108
111
  }
@@ -136,7 +139,11 @@ export class RezoQueue {
136
139
  this.statsData.cancelled++;
137
140
  this.emit("cancelled", { id: task.id });
138
141
  }
142
+ this.clearIntervalTimer();
139
143
  this.checkEmpty();
144
+ if (this.pendingCount === 0) {
145
+ this.checkIdle();
146
+ }
140
147
  }
141
148
  cancel(id) {
142
149
  const index = this.queue.findIndex((t) => t.id === id);
@@ -251,10 +258,7 @@ export class RezoQueue {
251
258
  }
252
259
  destroy() {
253
260
  this.clear();
254
- if (this.intervalId) {
255
- clearInterval(this.intervalId);
256
- this.intervalId = undefined;
257
- }
261
+ this.clearIntervalTimer();
258
262
  this.eventHandlers.clear();
259
263
  }
260
264
  insertByPriority(task) {
@@ -269,19 +273,32 @@ export class RezoQueue {
269
273
  }
270
274
  tryRunNext() {
271
275
  if (this.isPausedFlag)
272
- return;
273
- if (this.queue.length === 0)
274
- return;
276
+ return false;
277
+ if (this.queue.length === 0) {
278
+ this.clearIntervalTimer();
279
+ this.checkEmpty();
280
+ if (this.pendingCount === 0) {
281
+ this.checkIdle();
282
+ }
283
+ return false;
284
+ }
275
285
  if (this.pendingCount >= this.config.concurrency)
276
- return;
286
+ return false;
277
287
  if (this.config.interval > 0) {
278
288
  if (this.intervalCount >= this.config.intervalCap)
279
- return;
289
+ return false;
280
290
  this.intervalCount++;
281
291
  }
282
292
  const task = this.queue.shift();
283
293
  this.runTask(task);
284
294
  this.tryRunNext();
295
+ return true;
296
+ }
297
+ clearIntervalTimer() {
298
+ if (this.intervalId) {
299
+ clearInterval(this.intervalId);
300
+ this.intervalId = undefined;
301
+ }
285
302
  }
286
303
  async runTask(task) {
287
304
  this.pendingCount++;
@@ -291,7 +308,6 @@ export class RezoQueue {
291
308
  this.emit("active", undefined);
292
309
  }
293
310
  this.emit("start", { id: task.id });
294
- this.emit("next", undefined);
295
311
  const startTime = Date.now();
296
312
  let timeoutId;
297
313
  try {
@@ -335,10 +351,11 @@ export class RezoQueue {
335
351
  delete task._abortHandler;
336
352
  delete task._signal;
337
353
  }
338
- this.pendingCount--;
339
- this.checkEmpty();
340
- this.checkIdle();
341
- this.tryRunNext();
354
+ queueMicrotask(() => {
355
+ this.pendingCount--;
356
+ this.tryRunNext();
357
+ this.emit("next", undefined);
358
+ });
342
359
  }
343
360
  }
344
361
  recordDuration(duration) {
@@ -362,7 +379,6 @@ export class RezoQueue {
362
379
  this.intervalStart = Date.now();
363
380
  this.tryRunNext();
364
381
  }, this.config.interval);
365
- this.intervalId.unref();
366
382
  }
367
383
  emit(event, data) {
368
384
  const handlers = this.eventHandlers.get(event);
@@ -1,11 +1,11 @@
1
- const _mod_ci1eid = require('./event-emitter.cjs');
2
- exports.UniversalEventEmitter = _mod_ci1eid.UniversalEventEmitter;;
3
- const _mod_kzbboc = require('./stream.cjs');
4
- exports.UniversalStreamResponse = _mod_kzbboc.UniversalStreamResponse;
5
- exports.StreamResponse = _mod_kzbboc.StreamResponse;;
6
- const _mod_usmv75 = require('./download.cjs');
7
- exports.UniversalDownloadResponse = _mod_usmv75.UniversalDownloadResponse;
8
- exports.DownloadResponse = _mod_usmv75.DownloadResponse;;
9
- const _mod_gp36b6 = require('./upload.cjs');
10
- exports.UniversalUploadResponse = _mod_gp36b6.UniversalUploadResponse;
11
- exports.UploadResponse = _mod_gp36b6.UploadResponse;;
1
+ const _mod_pscfsi = require('./event-emitter.cjs');
2
+ exports.UniversalEventEmitter = _mod_pscfsi.UniversalEventEmitter;;
3
+ const _mod_711avn = require('./stream.cjs');
4
+ exports.UniversalStreamResponse = _mod_711avn.UniversalStreamResponse;
5
+ exports.StreamResponse = _mod_711avn.StreamResponse;;
6
+ const _mod_tf33hx = require('./download.cjs');
7
+ exports.UniversalDownloadResponse = _mod_tf33hx.UniversalDownloadResponse;
8
+ exports.DownloadResponse = _mod_tf33hx.DownloadResponse;;
9
+ const _mod_p3xuwv = require('./upload.cjs');
10
+ exports.UniversalUploadResponse = _mod_p3xuwv.UniversalUploadResponse;
11
+ exports.UploadResponse = _mod_p3xuwv.UploadResponse;;
package/dist/version.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const VERSION = exports.VERSION = "1.0.87";
1
+ const VERSION = exports.VERSION = "1.0.88";
2
2
  const PACKAGE_NAME = exports.PACKAGE_NAME = "rezo";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "1.0.87";
1
+ export const VERSION = "1.0.88";
2
2
  export const PACKAGE_NAME = "rezo";
@@ -1,54 +1,54 @@
1
- const _mod_un5ym7 = require('./types.cjs');
2
- exports.WgetError = _mod_un5ym7.WgetError;;
3
- const _mod_c2i6o6 = require('./asset-extractor.cjs');
4
- exports.AssetExtractor = _mod_c2i6o6.AssetExtractor;;
5
- const _mod_1t2zzq = require('./url-filter.cjs');
6
- exports.UrlFilter = _mod_1t2zzq.UrlFilter;;
7
- const _mod_x26gzn = require('./file-writer.cjs');
8
- exports.FileWriter = _mod_x26gzn.FileWriter;;
9
- const _mod_65zdc7 = require('./robots.cjs');
10
- exports.RobotsHandler = _mod_65zdc7.RobotsHandler;;
11
- const _mod_3fxwlf = require('./resume.cjs');
12
- exports.ResumeHandler = _mod_3fxwlf.ResumeHandler;;
13
- const _mod_v2os3g = require('./progress.cjs');
14
- exports.ProgressReporter = _mod_v2os3g.ProgressReporter;
15
- exports.ProgressTracker = _mod_v2os3g.ProgressTracker;
16
- exports.parseSize = _mod_v2os3g.parseSize;;
17
- const _mod_wcn4y0 = require('./link-converter.cjs');
18
- exports.LinkConverter = _mod_wcn4y0.LinkConverter;;
19
- const _mod_eq97ul = require('./style-extractor.cjs');
20
- exports.StyleExtractor = _mod_eq97ul.StyleExtractor;;
21
- const _mod_ak72dr = require('./downloader.cjs');
22
- exports.Downloader = _mod_ak72dr.Downloader;;
23
- const _mod_k1uk6x = require('./asset-organizer.cjs');
24
- exports.AssetOrganizer = _mod_k1uk6x.AssetOrganizer;
25
- exports.DEFAULT_ASSET_FOLDERS = _mod_k1uk6x.DEFAULT_ASSET_FOLDERS;;
26
- const _mod_g5aq7o = require('./download-cache.cjs');
27
- exports.DownloadCache = _mod_g5aq7o.DownloadCache;;
28
- const _mod_q9l6i9 = require('./filter-lists.cjs');
29
- exports.EXECUTABLE_EXTENSIONS = _mod_q9l6i9.EXECUTABLE_EXTENSIONS;
30
- exports.ARCHIVE_EXTENSIONS = _mod_q9l6i9.ARCHIVE_EXTENSIONS;
31
- exports.DOCUMENT_EXTENSIONS = _mod_q9l6i9.DOCUMENT_EXTENSIONS;
32
- exports.IMAGE_EXTENSIONS = _mod_q9l6i9.IMAGE_EXTENSIONS;
33
- exports.VIDEO_EXTENSIONS = _mod_q9l6i9.VIDEO_EXTENSIONS;
34
- exports.AUDIO_EXTENSIONS = _mod_q9l6i9.AUDIO_EXTENSIONS;
35
- exports.FONT_EXTENSIONS = _mod_q9l6i9.FONT_EXTENSIONS;
36
- exports.WEB_ASSET_EXTENSIONS = _mod_q9l6i9.WEB_ASSET_EXTENSIONS;
37
- exports.DATA_EXTENSIONS = _mod_q9l6i9.DATA_EXTENSIONS;
38
- exports.EXECUTABLE_MIME_TYPES = _mod_q9l6i9.EXECUTABLE_MIME_TYPES;
39
- exports.ARCHIVE_MIME_TYPES = _mod_q9l6i9.ARCHIVE_MIME_TYPES;
40
- exports.DOCUMENT_MIME_TYPES = _mod_q9l6i9.DOCUMENT_MIME_TYPES;
41
- exports.IMAGE_MIME_TYPES = _mod_q9l6i9.IMAGE_MIME_TYPES;
42
- exports.VIDEO_MIME_TYPES = _mod_q9l6i9.VIDEO_MIME_TYPES;
43
- exports.AUDIO_MIME_TYPES = _mod_q9l6i9.AUDIO_MIME_TYPES;
44
- exports.FONT_MIME_TYPES = _mod_q9l6i9.FONT_MIME_TYPES;
45
- exports.WEB_ASSET_MIME_TYPES = _mod_q9l6i9.WEB_ASSET_MIME_TYPES;
46
- exports.DATA_MIME_TYPES = _mod_q9l6i9.DATA_MIME_TYPES;
47
- exports.SAFE_WEB_PRESET = _mod_q9l6i9.SAFE_WEB_PRESET;
48
- exports.DOCUMENTS_ONLY_PRESET = _mod_q9l6i9.DOCUMENTS_ONLY_PRESET;
49
- exports.NO_MEDIA_PRESET = _mod_q9l6i9.NO_MEDIA_PRESET;
50
- exports.MINIMAL_MIRROR_PRESET = _mod_q9l6i9.MINIMAL_MIRROR_PRESET;
51
- exports.TEXT_ONLY_PRESET = _mod_q9l6i9.TEXT_ONLY_PRESET;;
1
+ const _mod_du3wv4 = require('./types.cjs');
2
+ exports.WgetError = _mod_du3wv4.WgetError;;
3
+ const _mod_wdsrvi = require('./asset-extractor.cjs');
4
+ exports.AssetExtractor = _mod_wdsrvi.AssetExtractor;;
5
+ const _mod_k27d36 = require('./url-filter.cjs');
6
+ exports.UrlFilter = _mod_k27d36.UrlFilter;;
7
+ const _mod_jus4vf = require('./file-writer.cjs');
8
+ exports.FileWriter = _mod_jus4vf.FileWriter;;
9
+ const _mod_4pd7n8 = require('./robots.cjs');
10
+ exports.RobotsHandler = _mod_4pd7n8.RobotsHandler;;
11
+ const _mod_afbhvt = require('./resume.cjs');
12
+ exports.ResumeHandler = _mod_afbhvt.ResumeHandler;;
13
+ const _mod_ryu9o1 = require('./progress.cjs');
14
+ exports.ProgressReporter = _mod_ryu9o1.ProgressReporter;
15
+ exports.ProgressTracker = _mod_ryu9o1.ProgressTracker;
16
+ exports.parseSize = _mod_ryu9o1.parseSize;;
17
+ const _mod_78ptbc = require('./link-converter.cjs');
18
+ exports.LinkConverter = _mod_78ptbc.LinkConverter;;
19
+ const _mod_mo74an = require('./style-extractor.cjs');
20
+ exports.StyleExtractor = _mod_mo74an.StyleExtractor;;
21
+ const _mod_l29yuo = require('./downloader.cjs');
22
+ exports.Downloader = _mod_l29yuo.Downloader;;
23
+ const _mod_59sixh = require('./asset-organizer.cjs');
24
+ exports.AssetOrganizer = _mod_59sixh.AssetOrganizer;
25
+ exports.DEFAULT_ASSET_FOLDERS = _mod_59sixh.DEFAULT_ASSET_FOLDERS;;
26
+ const _mod_a7qr6m = require('./download-cache.cjs');
27
+ exports.DownloadCache = _mod_a7qr6m.DownloadCache;;
28
+ const _mod_oi08ol = require('./filter-lists.cjs');
29
+ exports.EXECUTABLE_EXTENSIONS = _mod_oi08ol.EXECUTABLE_EXTENSIONS;
30
+ exports.ARCHIVE_EXTENSIONS = _mod_oi08ol.ARCHIVE_EXTENSIONS;
31
+ exports.DOCUMENT_EXTENSIONS = _mod_oi08ol.DOCUMENT_EXTENSIONS;
32
+ exports.IMAGE_EXTENSIONS = _mod_oi08ol.IMAGE_EXTENSIONS;
33
+ exports.VIDEO_EXTENSIONS = _mod_oi08ol.VIDEO_EXTENSIONS;
34
+ exports.AUDIO_EXTENSIONS = _mod_oi08ol.AUDIO_EXTENSIONS;
35
+ exports.FONT_EXTENSIONS = _mod_oi08ol.FONT_EXTENSIONS;
36
+ exports.WEB_ASSET_EXTENSIONS = _mod_oi08ol.WEB_ASSET_EXTENSIONS;
37
+ exports.DATA_EXTENSIONS = _mod_oi08ol.DATA_EXTENSIONS;
38
+ exports.EXECUTABLE_MIME_TYPES = _mod_oi08ol.EXECUTABLE_MIME_TYPES;
39
+ exports.ARCHIVE_MIME_TYPES = _mod_oi08ol.ARCHIVE_MIME_TYPES;
40
+ exports.DOCUMENT_MIME_TYPES = _mod_oi08ol.DOCUMENT_MIME_TYPES;
41
+ exports.IMAGE_MIME_TYPES = _mod_oi08ol.IMAGE_MIME_TYPES;
42
+ exports.VIDEO_MIME_TYPES = _mod_oi08ol.VIDEO_MIME_TYPES;
43
+ exports.AUDIO_MIME_TYPES = _mod_oi08ol.AUDIO_MIME_TYPES;
44
+ exports.FONT_MIME_TYPES = _mod_oi08ol.FONT_MIME_TYPES;
45
+ exports.WEB_ASSET_MIME_TYPES = _mod_oi08ol.WEB_ASSET_MIME_TYPES;
46
+ exports.DATA_MIME_TYPES = _mod_oi08ol.DATA_MIME_TYPES;
47
+ exports.SAFE_WEB_PRESET = _mod_oi08ol.SAFE_WEB_PRESET;
48
+ exports.DOCUMENTS_ONLY_PRESET = _mod_oi08ol.DOCUMENTS_ONLY_PRESET;
49
+ exports.NO_MEDIA_PRESET = _mod_oi08ol.NO_MEDIA_PRESET;
50
+ exports.MINIMAL_MIRROR_PRESET = _mod_oi08ol.MINIMAL_MIRROR_PRESET;
51
+ exports.TEXT_ONLY_PRESET = _mod_oi08ol.TEXT_ONLY_PRESET;;
52
52
  const { Downloader } = require('./downloader.cjs');
53
53
  const rezo = require('../index.cjs');
54
54
  const { promises: fs } = require("node:fs");
@@ -5079,9 +5079,19 @@ declare class RezoQueue<T = any> {
5079
5079
  */
5080
5080
  private insertByPriority;
5081
5081
  /**
5082
- * Try to run next task if capacity available
5082
+ * Try to run next task if capacity available.
5083
+ *
5084
+ * Like p-queue's #tryToStartAnother(), this method handles idle/empty
5085
+ * checks INSIDE itself — only after confirming there's nothing left to
5086
+ * dequeue. This prevents the false-idle race where idle fires while
5087
+ * tasks are still in the queue waiting to be shifted.
5083
5088
  */
5084
5089
  private tryRunNext;
5090
+ /**
5091
+ * Clear the interval timer (called when queue empties).
5092
+ * The interval will be re-created when new tasks are added.
5093
+ */
5094
+ private clearIntervalTimer;
5085
5095
  /**
5086
5096
  * Execute a task
5087
5097
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rezo",
3
- "version": "1.0.87",
3
+ "version": "1.0.88",
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",