@fluojs/throttler 1.0.0-beta.5 → 1.0.0-beta.6
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/dist/module.js +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +2 -0
- package/package.json +2 -2
package/dist/module.js
CHANGED
|
@@ -39,7 +39,7 @@ export class ThrottlerModule {
|
|
|
39
39
|
class ThrottlerRootModule extends ThrottlerModule {}
|
|
40
40
|
return defineModule(ThrottlerRootModule, {
|
|
41
41
|
exports: [ThrottlerGuard],
|
|
42
|
-
global: true,
|
|
42
|
+
global: options.global ?? true,
|
|
43
43
|
providers: createThrottlerProviders(options)
|
|
44
44
|
});
|
|
45
45
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export interface ThrottlerHandlerOptions {
|
|
|
32
32
|
* Public configuration options for `ThrottlerModule.forRoot(...)`.
|
|
33
33
|
*/
|
|
34
34
|
export interface ThrottlerModuleOptions {
|
|
35
|
+
/** Whether throttler providers should be visible globally. Defaults to `true`. */
|
|
36
|
+
global?: boolean;
|
|
35
37
|
/** Seconds in the rate-limit window (module-wide default). */
|
|
36
38
|
ttl: number;
|
|
37
39
|
/** Maximum number of requests allowed within the window (module-wide default). */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED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f;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,kFAAkF;IAClF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,MAAM,CAAC;IAClD,+DAA+D;IAC/D,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB"}
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAoBvG;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,uBAAuB,GAAG,uBAAuB,CAOjG;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,sBAAsB,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAoBvG;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,uBAAuB,GAAG,uBAAuB,CAOjG;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,sBAAsB,GAAG,sBAAsB,CAatG;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,mBAAmB,GAAG,mBAAmB,CAQ3F"}
|
package/dist/validation.js
CHANGED
|
@@ -37,8 +37,10 @@ export function validateThrottleOptions(options) {
|
|
|
37
37
|
*/
|
|
38
38
|
export function validateThrottlerModuleOptions(options) {
|
|
39
39
|
validateThrottleOptions(options);
|
|
40
|
+
assertOptionalBoolean(options.global, 'global');
|
|
40
41
|
assertOptionalBoolean(options.trustProxyHeaders, 'trustProxyHeaders');
|
|
41
42
|
return {
|
|
43
|
+
global: options.global,
|
|
42
44
|
keyGenerator: options.keyGenerator,
|
|
43
45
|
limit: options.limit,
|
|
44
46
|
store: options.store,
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"redis",
|
|
10
10
|
"decorator"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.0-beta.
|
|
12
|
+
"version": "1.0.0-beta.6",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"ioredis": "^5.0.0",
|
|
46
|
-
"@fluojs/redis": "^1.0.0-beta.
|
|
46
|
+
"@fluojs/redis": "^1.0.0-beta.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@fluojs/redis": {
|