nest-ratelimit-pro 1.0.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.
- package/LICENSE +21 -0
- package/README.md +359 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.js +17 -0
- package/dist/constants.js.map +1 -0
- package/dist/decorators/rate-limit.decorator.d.ts +3 -0
- package/dist/decorators/rate-limit.decorator.js +14 -0
- package/dist/decorators/rate-limit.decorator.js.map +1 -0
- package/dist/exceptions/rate-limit.exception.d.ts +5 -0
- package/dist/exceptions/rate-limit.exception.js +17 -0
- package/dist/exceptions/rate-limit.exception.js.map +1 -0
- package/dist/guards/rate-limit.guard.d.ts +12 -0
- package/dist/guards/rate-limit.guard.js +75 -0
- package/dist/guards/rate-limit.guard.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/rate-limit-options.interface.d.ts +45 -0
- package/dist/interfaces/rate-limit-options.interface.js +19 -0
- package/dist/interfaces/rate-limit-options.interface.js.map +1 -0
- package/dist/interfaces/rate-limit.interface.d.ts +20 -0
- package/dist/interfaces/rate-limit.interface.js +3 -0
- package/dist/interfaces/rate-limit.interface.js.map +1 -0
- package/dist/interfaces/storage.interface.d.ts +12 -0
- package/dist/interfaces/storage.interface.js +3 -0
- package/dist/interfaces/storage.interface.js.map +1 -0
- package/dist/rate-limit.module.d.ts +8 -0
- package/dist/rate-limit.module.js +76 -0
- package/dist/rate-limit.module.js.map +1 -0
- package/dist/services/rate-limit.service.d.ts +18 -0
- package/dist/services/rate-limit.service.js +164 -0
- package/dist/services/rate-limit.service.js.map +1 -0
- package/dist/storage/memory.storage.d.ts +19 -0
- package/dist/storage/memory.storage.js +124 -0
- package/dist/storage/memory.storage.js.map +1 -0
- package/dist/utils/key.utils.d.ts +5 -0
- package/dist/utils/key.utils.js +47 -0
- package/dist/utils/key.utils.js.map +1 -0
- package/dist/utils/time-utils.d.ts +4 -0
- package/dist/utils/time-utils.js +30 -0
- package/dist/utils/time-utils.js.map +1 -0
- package/package.json +91 -0
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nest-ratelimit-pro",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Advanced rate limiting and throttling middleware for NestJS with support for multiple algorithms, distributed systems, and flexible storage backends",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"build:watch": "tsc --watch",
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"test:watch": "jest --watch",
|
|
12
|
+
"test:cov": "jest --coverage",
|
|
13
|
+
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
14
|
+
"lint": "eslint \"{src,test}/**/*.ts\" --fix",
|
|
15
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
16
|
+
"prepublishOnly": "npm run build && npm test",
|
|
17
|
+
"prepare": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"nestjs",
|
|
21
|
+
"rate-limiting",
|
|
22
|
+
"throttling",
|
|
23
|
+
"rate-limiter",
|
|
24
|
+
"api-gateway",
|
|
25
|
+
"middleware",
|
|
26
|
+
"redis",
|
|
27
|
+
"distributed",
|
|
28
|
+
"token-bucket",
|
|
29
|
+
"leaky-bucket",
|
|
30
|
+
"sliding-window",
|
|
31
|
+
"ddos-protection",
|
|
32
|
+
"api-protection",
|
|
33
|
+
"typescript",
|
|
34
|
+
"guard"
|
|
35
|
+
],
|
|
36
|
+
"author": {
|
|
37
|
+
"name": "Alireza Aminzadeh",
|
|
38
|
+
"email": "syeedalireza@yahoo.com",
|
|
39
|
+
"url": "https://github.com/syeedalireza"
|
|
40
|
+
},
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "https://github.com/syeedalireza/nest-ratelimit-pro.git"
|
|
45
|
+
},
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/syeedalireza/nest-ratelimit-pro/issues"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/syeedalireza/nest-ratelimit-pro#readme",
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@nestjs/common": "^10.0.0",
|
|
52
|
+
"@nestjs/core": "^10.0.0",
|
|
53
|
+
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
54
|
+
"rxjs": "^7.8.0"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"ms": "^2.1.3"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@nestjs/common": "^10.3.0",
|
|
61
|
+
"@nestjs/core": "^10.3.0",
|
|
62
|
+
"@nestjs/platform-express": "^10.3.0",
|
|
63
|
+
"@nestjs/testing": "^10.3.0",
|
|
64
|
+
"@types/express": "^4.17.21",
|
|
65
|
+
"@types/jest": "^29.5.11",
|
|
66
|
+
"@types/ms": "^0.7.34",
|
|
67
|
+
"@types/node": "^20.11.0",
|
|
68
|
+
"@types/supertest": "^6.0.2",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
70
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
71
|
+
"eslint": "^8.56.0",
|
|
72
|
+
"eslint-config-prettier": "^9.1.0",
|
|
73
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
74
|
+
"ioredis": "^5.3.2",
|
|
75
|
+
"jest": "^29.7.0",
|
|
76
|
+
"prettier": "^3.1.1",
|
|
77
|
+
"reflect-metadata": "^0.2.1",
|
|
78
|
+
"rxjs": "^7.8.1",
|
|
79
|
+
"supertest": "^6.3.4",
|
|
80
|
+
"ts-jest": "^29.1.1",
|
|
81
|
+
"ts-node": "^10.9.2",
|
|
82
|
+
"typescript": "^5.3.3"
|
|
83
|
+
},
|
|
84
|
+
"optionalDependencies": {
|
|
85
|
+
"ioredis": "^5.3.2"
|
|
86
|
+
},
|
|
87
|
+
"engines": {
|
|
88
|
+
"node": ">=18.0.0",
|
|
89
|
+
"npm": ">=9.0.0"
|
|
90
|
+
}
|
|
91
|
+
}
|