@tramvai/tokens-common 1.84.0 → 1.89.1

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.es.js CHANGED
@@ -133,10 +133,16 @@ const LOGGER_TOKEN = createToken('logger');
133
133
  const LOGGER_INIT_HOOK = createToken('loggerHook');
134
134
 
135
135
  /**
136
+ * @deprecated use FASTIFY_REQUEST
136
137
  * @description
137
138
  * Direct reference to request object
138
139
  */
139
140
  const REQUEST = createToken('request');
141
+ /**
142
+ * @description
143
+ * Direct reference to request object
144
+ */
145
+ const FASTIFY_REQUEST = createToken('fastify request');
140
146
  /**
141
147
  * @description
142
148
  * Instance for managing client requests (request headers, query-parameters, cookies etc).
@@ -145,10 +151,12 @@ const REQUEST = createToken('request');
145
151
  const REQUEST_MANAGER_TOKEN = createToken('requestManager');
146
152
 
147
153
  /**
154
+ * @deprecated Use FASTIFY_RESPONSE
148
155
  * @description
149
156
  * Direct reference to Response instance
150
157
  */
151
158
  const RESPONSE = createToken('response');
159
+ const FASTIFY_RESPONSE = createToken('fastify response');
152
160
  /**
153
161
  * @description
154
162
  * Instance for managing client response (response headers, cookies, response body).
@@ -163,4 +171,4 @@ const RESPONSE_MANAGER_TOKEN = createToken('responseManager');
163
171
  const ENV_MANAGER_TOKEN = createToken('environmentManager');
164
172
  const ENV_USED_TOKEN = createToken('envUsed', { multi: true });
165
173
 
166
- export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, ADDITIONAL_BUNDLE_TOKEN, BUNDLE_MANAGER_TOKEN, CLEAR_CACHE_TOKEN, COMBINE_REDUCERS, COMPONENT_REGISTRY_TOKEN, CONTEXT_TOKEN, CREATE_CACHE_TOKEN, DISPATCHER_CONTEXT_TOKEN, DISPATCHER_TOKEN, ENV_MANAGER_TOKEN, ENV_USED_TOKEN, HOOK_TOKEN, INITIAL_APP_STATE_TOKEN, LOGGER_INIT_HOOK, LOGGER_TOKEN, PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, REGISTER_CLEAR_CACHE_TOKEN, REQUEST, REQUEST_MANAGER_TOKEN, RESPONSE, RESPONSE_MANAGER_TOKEN, ROOT_PUBSUB_TOKEN, STORE_MIDDLEWARE, STORE_TOKEN };
174
+ export { ACTION_CONDITIONALS, ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, ACTION_REGISTRY_TOKEN, ADDITIONAL_BUNDLE_TOKEN, BUNDLE_MANAGER_TOKEN, CLEAR_CACHE_TOKEN, COMBINE_REDUCERS, COMPONENT_REGISTRY_TOKEN, CONTEXT_TOKEN, CREATE_CACHE_TOKEN, DISPATCHER_CONTEXT_TOKEN, DISPATCHER_TOKEN, ENV_MANAGER_TOKEN, ENV_USED_TOKEN, FASTIFY_REQUEST, FASTIFY_RESPONSE, HOOK_TOKEN, INITIAL_APP_STATE_TOKEN, LOGGER_INIT_HOOK, LOGGER_TOKEN, PUBSUB_FACTORY_TOKEN, PUBSUB_TOKEN, REGISTER_CLEAR_CACHE_TOKEN, REQUEST, REQUEST_MANAGER_TOKEN, RESPONSE, RESPONSE_MANAGER_TOKEN, ROOT_PUBSUB_TOKEN, STORE_MIDDLEWARE, STORE_TOKEN };
package/lib/index.js CHANGED
@@ -137,10 +137,16 @@ const LOGGER_TOKEN = dippy.createToken('logger');
137
137
  const LOGGER_INIT_HOOK = dippy.createToken('loggerHook');
138
138
 
139
139
  /**
140
+ * @deprecated use FASTIFY_REQUEST
140
141
  * @description
141
142
  * Direct reference to request object
142
143
  */
143
144
  const REQUEST = dippy.createToken('request');
145
+ /**
146
+ * @description
147
+ * Direct reference to request object
148
+ */
149
+ const FASTIFY_REQUEST = dippy.createToken('fastify request');
144
150
  /**
145
151
  * @description
146
152
  * Instance for managing client requests (request headers, query-parameters, cookies etc).
@@ -149,10 +155,12 @@ const REQUEST = dippy.createToken('request');
149
155
  const REQUEST_MANAGER_TOKEN = dippy.createToken('requestManager');
150
156
 
151
157
  /**
158
+ * @deprecated Use FASTIFY_RESPONSE
152
159
  * @description
153
160
  * Direct reference to Response instance
154
161
  */
155
162
  const RESPONSE = dippy.createToken('response');
163
+ const FASTIFY_RESPONSE = dippy.createToken('fastify response');
156
164
  /**
157
165
  * @description
158
166
  * Instance for managing client response (response headers, cookies, response body).
@@ -182,6 +190,8 @@ exports.DISPATCHER_CONTEXT_TOKEN = DISPATCHER_CONTEXT_TOKEN;
182
190
  exports.DISPATCHER_TOKEN = DISPATCHER_TOKEN;
183
191
  exports.ENV_MANAGER_TOKEN = ENV_MANAGER_TOKEN;
184
192
  exports.ENV_USED_TOKEN = ENV_USED_TOKEN;
193
+ exports.FASTIFY_REQUEST = FASTIFY_REQUEST;
194
+ exports.FASTIFY_RESPONSE = FASTIFY_RESPONSE;
185
195
  exports.HOOK_TOKEN = HOOK_TOKEN;
186
196
  exports.INITIAL_APP_STATE_TOKEN = INITIAL_APP_STATE_TOKEN;
187
197
  exports.LOGGER_INIT_HOOK = LOGGER_INIT_HOOK;
@@ -1,10 +1,21 @@
1
1
  import type { Request } from 'express';
2
+ import type { FastifyRequest as OriginalFastifyRequest } from 'fastify';
2
3
  declare type RequestExt = Request;
4
+ declare type FastifyRequest = OriginalFastifyRequest & {
5
+ cookies: Record<string, string>;
6
+ query: Record<string, string>;
7
+ };
3
8
  /**
9
+ * @deprecated use FASTIFY_REQUEST
4
10
  * @description
5
11
  * Direct reference to request object
6
12
  */
7
13
  export declare const REQUEST: RequestExt;
14
+ /**
15
+ * @description
16
+ * Direct reference to request object
17
+ */
18
+ export declare const FASTIFY_REQUEST: FastifyRequest;
8
19
  /**
9
20
  * @description
10
21
  * Instance for managing client requests (request headers, query-parameters, cookies etc).
@@ -1,9 +1,13 @@
1
+ /// <reference types="node" />
1
2
  import type { Response } from 'express';
3
+ import type { FastifyReply } from 'fastify';
2
4
  /**
5
+ * @deprecated Use FASTIFY_RESPONSE
3
6
  * @description
4
7
  * Direct reference to Response instance
5
8
  */
6
9
  export declare const RESPONSE: Response<any, Record<string, any>>;
10
+ export declare const FASTIFY_RESPONSE: FastifyReply<import("http").Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown>;
7
11
  /**
8
12
  * @description
9
13
  * Instance for managing client response (response headers, cookies, response body).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-common",
3
- "version": "1.84.0",
3
+ "version": "1.89.1",
4
4
  "description": "Tramvai tokens for @tramvai/module-common",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.es.js",
@@ -19,16 +19,17 @@
19
19
  "build-for-publish": "true"
20
20
  },
21
21
  "dependencies": {
22
- "@tramvai/tokens-core": "1.84.0",
22
+ "@tramvai/tokens-core": "1.89.1",
23
23
  "@types/express": "^4.17.9"
24
24
  },
25
25
  "peerDependencies": {
26
- "@tramvai/state": "1.84.0",
27
- "@tramvai/types-actions-state-context": "1.84.0",
26
+ "@tramvai/state": "1.89.1",
27
+ "@tramvai/types-actions-state-context": "1.89.1",
28
28
  "@tinkoff/logger": "0.10.14",
29
29
  "@tinkoff/dippy": "0.7.39",
30
30
  "express": "^4.17.1",
31
- "react": "^17.0.0",
31
+ "fastify": "^3.27.4",
32
+ "react": ">=16.8",
32
33
  "tslib": "^2.0.3"
33
34
  },
34
35
  "license": "Apache-2.0"