rate-limiter-flexible
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -59,3 +59,3 @@ const RateLimiterStoreAbstract = require('./RateLimiterStoreAbstract'); | ||
name: 'rlflx-clear-expired', | ||
text: `DELETE FROM ${this.tableName} WHERE expire < $1`, | ||
text: `DELETE FROM "${this.tableName}" WHERE expire < $1`, | ||
values: [expire], | ||
@@ -154,3 +154,3 @@ }; | ||
_getCreateTableStmt() { | ||
return `CREATE TABLE IF NOT EXISTS ${this.tableName} ( | ||
return `CREATE TABLE IF NOT EXISTS "${this.tableName}" ( | ||
key varchar(255) PRIMARY KEY, | ||
@@ -257,4 +257,4 @@ points integer NOT NULL DEFAULT 0, | ||
: ` CASE | ||
WHEN ${this.tableName}.expire <= $4 THEN $3 | ||
ELSE ${this.tableName}.expire | ||
WHEN "${this.tableName}".expire <= $4 THEN $3 | ||
ELSE "${this.tableName}".expire | ||
END `; | ||
@@ -265,7 +265,7 @@ | ||
text: ` | ||
INSERT INTO ${this.tableName} VALUES ($1, $2, $3) | ||
INSERT INTO "${this.tableName}" VALUES ($1, $2, $3) | ||
ON CONFLICT(key) DO UPDATE SET | ||
points = CASE | ||
WHEN (${this.tableName}.expire <= $4 OR 1=${forceExpire ? 1 : 0}) THEN $2 | ||
ELSE ${this.tableName}.points + ($2) | ||
WHEN ("${this.tableName}".expire <= $4 OR 1=${forceExpire ? 1 : 0}) THEN $2 | ||
ELSE "${this.tableName}".points + ($2) | ||
END, | ||
@@ -287,3 +287,3 @@ expire = ${expireQ} | ||
text: ` | ||
SELECT points, expire FROM ${this.tableName} WHERE key = $1 AND (expire > $2 OR expire IS NULL);`, | ||
SELECT points, expire FROM "${this.tableName}" WHERE key = $1 AND (expire > $2 OR expire IS NULL);`, | ||
values: [rlKey, Date.now()], | ||
@@ -310,3 +310,3 @@ }) | ||
name: 'rlflx-delete', | ||
text: `DELETE FROM ${this.tableName} WHERE key = $1`, | ||
text: `DELETE FROM "${this.tableName}" WHERE key = $1`, | ||
values: [rlKey], | ||
@@ -313,0 +313,0 @@ }) |
{ | ||
"name": "rate-limiter-flexible", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, PostgreSQL, Cluster or PM", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123465