@nestjs/throttler 4.2.0 → 5.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/README.md +205 -178
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/throttler-module-options.interface.d.ts +11 -4
- package/dist/throttler-storage.interface.d.ts +0 -2
- package/dist/throttler-storage.interface.js.map +1 -1
- package/dist/throttler.decorator.d.ts +7 -2
- package/dist/throttler.decorator.js +16 -12
- package/dist/throttler.decorator.js.map +1 -1
- package/dist/throttler.guard.d.ts +11 -5
- package/dist/throttler.guard.interface.d.ts +7 -0
- package/dist/throttler.guard.interface.js +3 -0
- package/dist/throttler.guard.interface.js.map +1 -0
- package/dist/throttler.guard.js +74 -27
- package/dist/throttler.guard.js.map +1 -1
- package/dist/throttler.module.js +3 -2
- package/dist/throttler.module.js.map +1 -1
- package/dist/throttler.providers.d.ts +2 -1
- package/dist/throttler.providers.js +3 -1
- package/dist/throttler.providers.js.map +1 -1
- package/dist/throttler.service.js +3 -2
- package/dist/throttler.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities.d.ts +5 -0
- package/dist/utilities.js +14 -0
- package/dist/utilities.js.map +1 -0
- package/package.json +33 -32
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const seconds: (howMany: number) => number;
|
|
2
|
+
export declare const minutes: (howMany: number) => number;
|
|
3
|
+
export declare const hours: (howMany: number) => number;
|
|
4
|
+
export declare const days: (howMany: number) => number;
|
|
5
|
+
export declare const weeks: (howMany: number) => number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.weeks = exports.days = exports.hours = exports.minutes = exports.seconds = void 0;
|
|
4
|
+
const seconds = (howMany) => howMany * 1000;
|
|
5
|
+
exports.seconds = seconds;
|
|
6
|
+
const minutes = (howMany) => 60 * howMany * (0, exports.seconds)(1);
|
|
7
|
+
exports.minutes = minutes;
|
|
8
|
+
const hours = (howMany) => 60 * howMany * (0, exports.minutes)(1);
|
|
9
|
+
exports.hours = hours;
|
|
10
|
+
const days = (howMany) => 24 * howMany * (0, exports.hours)(1);
|
|
11
|
+
exports.days = days;
|
|
12
|
+
const weeks = (howMany) => 7 * howMany * (0, exports.days)(1);
|
|
13
|
+
exports.weeks = weeks;
|
|
14
|
+
//# sourceMappingURL=utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":";;;AAAO,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC;AAA9C,QAAA,OAAO,WAAuC;AACpD,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,EAAE,GAAG,OAAO,GAAG,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;AAAzD,QAAA,OAAO,WAAkD;AAC/D,MAAM,KAAK,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,EAAE,GAAG,OAAO,GAAG,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;AAAvD,QAAA,KAAK,SAAkD;AAC7D,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,EAAE,GAAG,OAAO,GAAG,IAAA,aAAK,EAAC,CAAC,CAAC,CAAC;AAApD,QAAA,IAAI,QAAgD;AAC1D,MAAM,KAAK,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC,GAAG,OAAO,GAAG,IAAA,YAAI,EAAC,CAAC,CAAC,CAAC;AAAnD,QAAA,KAAK,SAA8C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/throttler",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A Rate-Limiting module for NestJS to work on Express, Fastify, Websockets, Socket.IO, and GraphQL, all rolled up into a simple package.",
|
|
5
5
|
"author": "Jay McDoniel <me@jaymcdoniel.dev>",
|
|
6
6
|
"contributors": [],
|
|
@@ -28,54 +28,55 @@
|
|
|
28
28
|
"md5": "^2.2.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@apollo/server": "4.9.3",
|
|
31
32
|
"@changesets/cli": "2.26.2",
|
|
32
|
-
"@commitlint/cli": "17.
|
|
33
|
-
"@commitlint/config-angular": "17.
|
|
34
|
-
"@nestjs/cli": "10.1.
|
|
35
|
-
"@nestjs/common": "10.
|
|
36
|
-
"@nestjs/core": "10.
|
|
37
|
-
"@nestjs/graphql": "12.0.
|
|
38
|
-
"@nestjs/platform-express": "10.
|
|
39
|
-
"@nestjs/platform-fastify": "10.
|
|
40
|
-
"@nestjs/platform-socket.io": "10.
|
|
41
|
-
"@nestjs/platform-ws": "10.
|
|
42
|
-
"@nestjs/schematics": "10.0.
|
|
43
|
-
"@nestjs/testing": "10.
|
|
44
|
-
"@nestjs/websockets": "10.
|
|
33
|
+
"@commitlint/cli": "17.7.1",
|
|
34
|
+
"@commitlint/config-angular": "17.7.0",
|
|
35
|
+
"@nestjs/cli": "10.1.17",
|
|
36
|
+
"@nestjs/common": "10.2.4",
|
|
37
|
+
"@nestjs/core": "10.2.4",
|
|
38
|
+
"@nestjs/graphql": "12.0.8",
|
|
39
|
+
"@nestjs/platform-express": "10.2.4",
|
|
40
|
+
"@nestjs/platform-fastify": "10.2.4",
|
|
41
|
+
"@nestjs/platform-socket.io": "10.2.4",
|
|
42
|
+
"@nestjs/platform-ws": "10.2.4",
|
|
43
|
+
"@nestjs/schematics": "10.0.2",
|
|
44
|
+
"@nestjs/testing": "10.2.4",
|
|
45
|
+
"@nestjs/websockets": "10.2.4",
|
|
45
46
|
"@semantic-release/git": "10.0.1",
|
|
46
47
|
"@types/express": "4.17.17",
|
|
47
|
-
"@types/express-serve-static-core": "4.17.
|
|
48
|
-
"@types/jest": "29.5.
|
|
48
|
+
"@types/express-serve-static-core": "4.17.36",
|
|
49
|
+
"@types/jest": "29.5.4",
|
|
49
50
|
"@types/md5": "2.3.2",
|
|
50
|
-
"@types/node": "18.
|
|
51
|
+
"@types/node": "18.17.14",
|
|
51
52
|
"@types/supertest": "2.0.12",
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "
|
|
53
|
-
"@typescript-eslint/parser": "
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"conventional-changelog-cli": "3.0.0",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "6.6.0",
|
|
54
|
+
"@typescript-eslint/parser": "6.6.0",
|
|
55
|
+
"apollo-server-fastify": "3.12.1",
|
|
56
|
+
"conventional-changelog-cli": "4.0.0",
|
|
57
57
|
"cz-conventional-changelog": "3.3.0",
|
|
58
|
-
"eslint": "8.
|
|
59
|
-
"eslint-config-prettier": "
|
|
60
|
-
"eslint-plugin-import": "2.
|
|
61
|
-
"graphql": "16.
|
|
58
|
+
"eslint": "8.48.0",
|
|
59
|
+
"eslint-config-prettier": "9.0.0",
|
|
60
|
+
"eslint-plugin-import": "2.28.1",
|
|
61
|
+
"graphql": "16.8.0",
|
|
62
62
|
"graphql-tools": "9.0.0",
|
|
63
63
|
"husky": "8.0.3",
|
|
64
|
-
"jest": "29.6.
|
|
65
|
-
"lint-staged": "
|
|
66
|
-
"nodemon": "
|
|
64
|
+
"jest": "29.6.4",
|
|
65
|
+
"lint-staged": "14.0.1",
|
|
66
|
+
"nodemon": "3.0.1",
|
|
67
|
+
"pactum": "^3.4.1",
|
|
67
68
|
"pinst": "3.0.0",
|
|
68
|
-
"prettier": "3.0.
|
|
69
|
+
"prettier": "3.0.3",
|
|
69
70
|
"reflect-metadata": "0.1.13",
|
|
70
71
|
"rimraf": "5.0.1",
|
|
71
72
|
"rxjs": "7.8.1",
|
|
72
|
-
"socket.io": "4.7.
|
|
73
|
+
"socket.io": "4.7.2",
|
|
73
74
|
"supertest": "6.3.3",
|
|
74
75
|
"ts-jest": "29.1.1",
|
|
75
76
|
"ts-loader": "9.4.4",
|
|
76
77
|
"ts-node": "10.9.1",
|
|
77
78
|
"tsconfig-paths": "4.2.0",
|
|
78
|
-
"typescript": "5.
|
|
79
|
+
"typescript": "5.2.2",
|
|
79
80
|
"ws": "8.13.0"
|
|
80
81
|
},
|
|
81
82
|
"peerDependencies": {
|