halt-rate 0.4.0 → 0.5.0

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.
@@ -47,6 +47,8 @@ interface Policy {
47
47
  keyStrategy?: KeyStrategy;
48
48
  /** Maximum burst size (for token bucket) */
49
49
  burst?: number;
50
+ /** Number of sub-windows for sliding window (higher = more accurate, more memory) */
51
+ slidingPrecision?: number;
50
52
  /** Cost per request (default: 1) */
51
53
  cost?: number;
52
54
  /** Duration to block after limit exceeded (seconds) */
@@ -47,6 +47,8 @@ interface Policy {
47
47
  keyStrategy?: KeyStrategy;
48
48
  /** Maximum burst size (for token bucket) */
49
49
  burst?: number;
50
+ /** Number of sub-windows for sliding window (higher = more accurate, more memory) */
51
+ slidingPrecision?: number;
50
52
  /** Cost per request (default: 1) */
51
53
  cost?: number;
52
54
  /** Duration to block after limit exceeded (seconds) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "halt-rate",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "SaaS-aware, cross-language rate limiting: per-user/API-key/plan limits, quotas, weighted endpoints, abuse controls, atomic Redis, and built-in observability",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",