nestjs-cluster-throttle
Version:
Enterprise-grade rate limiting module for NestJS with Redis support, multiple strategies, and cluster mode
25 lines • 788 B
TypeScript
import { GeoLocationOptions } from './geo-location.interface';
export interface RateLimitOptions {
windowMs: number;
max: number;
message?: string;
statusCode?: number;
skipSuccessfulRequests?: boolean;
keyGenerator?: (request: any) => string;
skip?: (request: any) => boolean;
handler?: (request: any, response: any) => void;
clusterMode?: boolean;
redisOptions?: {
host?: string;
port?: number;
password?: string;
db?: number;
keyPrefix?: string;
enableReadyCheck?: boolean;
};
strategy?: 'fixed-window' | 'token-bucket' | 'sliding-window';
burstCapacity?: number;
fillRate?: number;
geoLocation?: GeoLocationOptions;
}
//# sourceMappingURL=rate-limit-options.interface.d.ts.map