🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@voiceflow/backend-utils

Package Overview
Dependencies
Maintainers
18
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voiceflow/backend-utils - npm Package Compare versions

Comparing version
3.2.3
to
3.3.0
+3
-6
build/middlewares/rateLimit.d.ts
import { NextFunction, Request, Response } from 'express';
import type { RateLimitManager } from '../services/rateLimit';
import { AbstractMiddleware, RateLimitConfig } from '../types';
export declare class RateLimitMiddleware<C extends RateLimitConfig> extends AbstractMiddleware<{
rateLimit: RateLimitManager<C>;
}, C> {
export declare abstract class RateLimitMiddleware<S extends Record<string, any>, C extends RateLimitConfig> extends AbstractMiddleware<S, C> {
static throwAuthError(): never;
verify(req: Request<{}>, _res: Response, next: NextFunction): Promise<void>;
consume(req: Request<{}>, res: Response, next: NextFunction): Promise<void>;
abstract verify(req: Request<{}>, _res: Response, next: NextFunction): Promise<void>;
abstract consume(req: Request<{}>, res: Response, next: NextFunction): Promise<void>;
}

@@ -14,16 +14,4 @@ "use strict";

}
// eslint-disable-next-line @typescript-eslint/ban-types, class-methods-use-this
async verify(req, _res, next) {
if (!req.headers.authorization) {
RateLimitMiddleware.throwAuthError();
}
next();
}
// eslint-disable-next-line @typescript-eslint/ban-types
async consume(req, res, next) {
await this.services.rateLimit.consume(req, res);
return next();
}
}
exports.RateLimitMiddleware = RateLimitMiddleware;
//# sourceMappingURL=rateLimit.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"rateLimit.js","sourceRoot":"","sources":["../../src/middlewares/rateLimit.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAuC;AAIvC,oCAA+D;AAE/D,wDAAwD;AACxD,MAAa,mBAA+C,SAAQ,0BAAyD;IAC3H,MAAM,CAAC,cAAc;QACnB,MAAM,IAAI,gBAAM,CAAC,mBAAmB,EAAE,gBAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IACzE,CAAC;IAED,gFAAgF;IAChF,KAAK,CAAC,MAAM,CAAC,GAAgB,EAAE,IAAc,EAAE,IAAkB;QAC/D,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE;YAC9B,mBAAmB,CAAC,cAAc,EAAE,CAAC;SACtC;QAED,IAAI,EAAE,CAAC;IACT,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,OAAO,CAAC,GAAgB,EAAE,GAAa,EAAE,IAAkB;QAC/D,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAEhD,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;CACF;AApBD,kDAoBC"}
{"version":3,"file":"rateLimit.js","sourceRoot":"","sources":["../../src/middlewares/rateLimit.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAuC;AAGvC,oCAA+D;AAE/D,wDAAwD;AACxD,MAAsB,mBAA8E,SAAQ,0BAAwB;IAClI,MAAM,CAAC,cAAc;QACnB,MAAM,IAAI,gBAAM,CAAC,mBAAmB,EAAE,gBAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IACzE,CAAC;CAOF;AAVD,kDAUC"}
{
"name": "@voiceflow/backend-utils",
"description": "Junk drawer of utility functions",
"version": "3.2.3",
"version": "3.3.0",
"author": "Voiceflow",

@@ -6,0 +6,0 @@ "bugs": {