@tramvai/module-request-limiter 1.82.3 → 1.85.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/lib/browser.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './tokens';
1
2
  export declare class RequestLimiterModule {
2
3
  }
package/lib/browser.js CHANGED
@@ -1,5 +1,10 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import { Module } from '@tramvai/core';
3
+ import { createToken } from '@tinkoff/dippy';
4
+
5
+ const REQUESTS_LIMITER_TOKEN = createToken('requestsLimiterToken');
6
+ const REQUESTS_LIMITER_ACTIVATE_TOKEN = createToken('requestsLimiterActivateToken');
7
+ const REQUESTS_LIMITER_OPTIONS_TOKEN = createToken('requestsLimiterOptionsToken');
3
8
 
4
9
  let RequestLimiterModule = class RequestLimiterModule {
5
10
  };
@@ -9,4 +14,4 @@ RequestLimiterModule = __decorate([
9
14
  })
10
15
  ], RequestLimiterModule);
11
16
 
12
- export { RequestLimiterModule };
17
+ export { REQUESTS_LIMITER_ACTIVATE_TOKEN, REQUESTS_LIMITER_OPTIONS_TOKEN, REQUESTS_LIMITER_TOKEN, RequestLimiterModule };
package/lib/server.es.js CHANGED
@@ -149,7 +149,7 @@ RequestLimiterModule = __decorate([
149
149
  if (featureEnable !== true) {
150
150
  return;
151
151
  }
152
- return new RequestLimiter(options);
152
+ return new RequestLimiter(options !== null && options !== void 0 ? options : {});
153
153
  },
154
154
  deps: {
155
155
  options: { token: REQUESTS_LIMITER_OPTIONS_TOKEN, optional: true },
package/lib/server.js CHANGED
@@ -157,7 +157,7 @@ exports.RequestLimiterModule = tslib.__decorate([
157
157
  if (featureEnable !== true) {
158
158
  return;
159
159
  }
160
- return new RequestLimiter(options);
160
+ return new RequestLimiter(options !== null && options !== void 0 ? options : {});
161
161
  },
162
162
  deps: {
163
163
  options: { token: REQUESTS_LIMITER_OPTIONS_TOKEN, optional: true },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-request-limiter",
3
- "version": "1.82.3",
3
+ "version": "1.85.0",
4
4
  "description": "Enable different rendering modes for pages",
5
5
  "main": "lib/server.js",
6
6
  "module": "lib/server.es.js",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@tinkoff/dippy": "0.7.39",
35
- "@tramvai/core": "1.82.3",
36
- "@tramvai/tokens-server": "1.82.3",
35
+ "@tramvai/core": "1.85.0",
36
+ "@tramvai/tokens-server": "1.85.0",
37
37
  "express": "^4.17.1",
38
38
  "tslib": "^2.0.3"
39
39
  }