@tramvai/tokens-server 1.74.0 → 1.76.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/index.d.ts CHANGED
@@ -105,21 +105,37 @@ export declare const WEB_APP_BEFORE_INIT_TOKEN: APP_INIT_HANDLER;
105
105
  ```
106
106
  */
107
107
  export declare const WEB_APP_INIT_TOKEN: APP_INIT_HANDLER;
108
+ /**
109
+ * @description
110
+ * You can limit requests of application.
111
+ *
112
+ * @example
113
+ ```tsx
114
+ {
115
+ provide: WEB_APP_LIMITER_TOKEN,
116
+ multi: true,
117
+ useValue: (app) => {
118
+ app.use(logMiddleware())
119
+ }
120
+ }
121
+ ```
122
+ */
123
+ export declare const WEB_APP_LIMITER_TOKEN: APP_INIT_HANDLER;
108
124
  /**
109
125
  * @description
110
126
  * Subscription to after web-app initialization.
111
127
  * It is called after any other handlers
112
128
  *
113
129
  * @example
114
- ```tsx
115
- {
130
+ ```tsx
131
+ {
116
132
  provide: WEB_APP_AFTER_INIT_TOKEN,
117
133
  multi: true,
118
134
  useValue: (app) => {
119
135
  app.use(logMiddleware())
120
136
  }
121
137
  }
122
- ```
138
+ ```
123
139
  */
124
140
  export declare const WEB_APP_AFTER_INIT_TOKEN: APP_INIT_HANDLER;
125
141
  /**
package/lib/index.es.js CHANGED
@@ -109,21 +109,39 @@ const WEB_APP_BEFORE_INIT_TOKEN = createToken('webAppBeforeInit', {
109
109
  ```
110
110
  */
111
111
  const WEB_APP_INIT_TOKEN = createToken('webAppInit', { multi: true });
112
+ /**
113
+ * @description
114
+ * You can limit requests of application.
115
+ *
116
+ * @example
117
+ ```tsx
118
+ {
119
+ provide: WEB_APP_LIMITER_TOKEN,
120
+ multi: true,
121
+ useValue: (app) => {
122
+ app.use(logMiddleware())
123
+ }
124
+ }
125
+ ```
126
+ */
127
+ const WEB_APP_LIMITER_TOKEN = createToken('webAppLimitter', {
128
+ multi: true,
129
+ });
112
130
  /**
113
131
  * @description
114
132
  * Subscription to after web-app initialization.
115
133
  * It is called after any other handlers
116
134
  *
117
135
  * @example
118
- ```tsx
119
- {
136
+ ```tsx
137
+ {
120
138
  provide: WEB_APP_AFTER_INIT_TOKEN,
121
139
  multi: true,
122
140
  useValue: (app) => {
123
141
  app.use(logMiddleware())
124
142
  }
125
143
  }
126
- ```
144
+ ```
127
145
  */
128
146
  const WEB_APP_AFTER_INIT_TOKEN = createToken('webAppAfterInit', {
129
147
  multi: true,
@@ -159,4 +177,4 @@ const READINESS_PROBE_TOKEN = createToken('readiness-probe-fn');
159
177
  */
160
178
  const LIVENESS_PROBE_TOKEN = createToken('liveness-probe-fn');
161
179
 
162
- export { DEPENDENCIES_VERSION_FILTER_TOKEN, LIVENESS_PROBE_TOKEN, PROXY_CONFIG_TOKEN, READINESS_PROBE_TOKEN, SERVER_MODULE_PAPI_PRIVATE_ROUTE, SERVER_MODULE_PAPI_PRIVATE_URL, SERVER_MODULE_PAPI_PUBLIC_ROUTE, SERVER_MODULE_PAPI_PUBLIC_URL, SERVER_MODULE_STATICS_OPTIONS, SERVER_TOKEN, SPECIAL_SERVER_PATHS, WEB_APP_AFTER_INIT_TOKEN, WEB_APP_BEFORE_INIT_TOKEN, WEB_APP_INIT_TOKEN, WEB_APP_TOKEN };
180
+ export { DEPENDENCIES_VERSION_FILTER_TOKEN, LIVENESS_PROBE_TOKEN, PROXY_CONFIG_TOKEN, READINESS_PROBE_TOKEN, SERVER_MODULE_PAPI_PRIVATE_ROUTE, SERVER_MODULE_PAPI_PRIVATE_URL, SERVER_MODULE_PAPI_PUBLIC_ROUTE, SERVER_MODULE_PAPI_PUBLIC_URL, SERVER_MODULE_STATICS_OPTIONS, SERVER_TOKEN, SPECIAL_SERVER_PATHS, WEB_APP_AFTER_INIT_TOKEN, WEB_APP_BEFORE_INIT_TOKEN, WEB_APP_INIT_TOKEN, WEB_APP_LIMITER_TOKEN, WEB_APP_TOKEN };
package/lib/index.js CHANGED
@@ -113,21 +113,39 @@ const WEB_APP_BEFORE_INIT_TOKEN = dippy.createToken('webAppBeforeInit', {
113
113
  ```
114
114
  */
115
115
  const WEB_APP_INIT_TOKEN = dippy.createToken('webAppInit', { multi: true });
116
+ /**
117
+ * @description
118
+ * You can limit requests of application.
119
+ *
120
+ * @example
121
+ ```tsx
122
+ {
123
+ provide: WEB_APP_LIMITER_TOKEN,
124
+ multi: true,
125
+ useValue: (app) => {
126
+ app.use(logMiddleware())
127
+ }
128
+ }
129
+ ```
130
+ */
131
+ const WEB_APP_LIMITER_TOKEN = dippy.createToken('webAppLimitter', {
132
+ multi: true,
133
+ });
116
134
  /**
117
135
  * @description
118
136
  * Subscription to after web-app initialization.
119
137
  * It is called after any other handlers
120
138
  *
121
139
  * @example
122
- ```tsx
123
- {
140
+ ```tsx
141
+ {
124
142
  provide: WEB_APP_AFTER_INIT_TOKEN,
125
143
  multi: true,
126
144
  useValue: (app) => {
127
145
  app.use(logMiddleware())
128
146
  }
129
147
  }
130
- ```
148
+ ```
131
149
  */
132
150
  const WEB_APP_AFTER_INIT_TOKEN = dippy.createToken('webAppAfterInit', {
133
151
  multi: true,
@@ -177,4 +195,5 @@ exports.SPECIAL_SERVER_PATHS = SPECIAL_SERVER_PATHS;
177
195
  exports.WEB_APP_AFTER_INIT_TOKEN = WEB_APP_AFTER_INIT_TOKEN;
178
196
  exports.WEB_APP_BEFORE_INIT_TOKEN = WEB_APP_BEFORE_INIT_TOKEN;
179
197
  exports.WEB_APP_INIT_TOKEN = WEB_APP_INIT_TOKEN;
198
+ exports.WEB_APP_LIMITER_TOKEN = WEB_APP_LIMITER_TOKEN;
180
199
  exports.WEB_APP_TOKEN = WEB_APP_TOKEN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-server",
3
- "version": "1.74.0",
3
+ "version": "1.76.0",
4
4
  "description": "Tramvai tokens for @tramvai/module-server",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.es.js",
@@ -19,7 +19,7 @@
19
19
  "build-for-publish": "true"
20
20
  },
21
21
  "dependencies": {
22
- "@tramvai/papi": "1.74.0"
22
+ "@tramvai/papi": "1.76.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@tinkoff/dippy": "0.7.38",