ayiin 2.0.47 → 2.0.49

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.
@@ -81,7 +81,9 @@ class Limiter extends tools_1.default {
81
81
  })
82
82
  : (options.messageFormat ??
83
83
  `[FloodWait] - Silakan coba lagi dalam ${this.formatRemainingTime(remainingMs)}.`);
84
- return res.status(429).json({ success: false, error: msg });
84
+ return res
85
+ .status(429)
86
+ .json({ success: false, error: msg, ms: remainingMs });
85
87
  }
86
88
  }
87
89
  // ambil level sekarang
@@ -136,7 +138,9 @@ class Limiter extends tools_1.default {
136
138
  })
137
139
  : (options.messageFormat ??
138
140
  `[FloodWait] - Terlalu banyak permintaan. Silakan coba lagi dalam ${this.formatRemainingTime(floodwaitMs)}.`);
139
- return res.status(429).json({ success: false, error: msg });
141
+ return res
142
+ .status(429)
143
+ .json({ success: false, error: msg, ms: floodwaitMs });
140
144
  }
141
145
  next();
142
146
  };
package/dist/types.d.ts CHANGED
@@ -14,7 +14,7 @@ export interface DurationInput {
14
14
  export interface RateLimiterOptions {
15
15
  keyPrefix: string;
16
16
  limit: number | readonly [number, ...number[]];
17
- windowMs: DurationInput;
17
+ windowMs: DurationInput | readonly [DurationInput, ...DurationInput[]];
18
18
  floodwaitMs: DurationInput | readonly [DurationInput, ...DurationInput[]];
19
19
  identifyUser?: (req: Request, res: Response) => string | Response<any, Record<string, any>>;
20
20
  store?: RateLimitStore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ayiin",
3
- "version": "2.0.47",
3
+ "version": "2.0.49",
4
4
  "author": {
5
5
  "name": "AyiinXd",
6
6
  "url": "https://github.com/AyiinXd"