@tramvai/tokens-common 2.21.1 → 2.24.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 +2 -0
- package/lib/index.js +2 -0
- package/lib/requestManager.d.ts +2 -0
- package/lib/responseManager.d.ts +3 -3
- package/package.json +5 -4
package/lib/index.es.js
CHANGED
|
@@ -144,6 +144,7 @@ const REQUEST = createToken('request');
|
|
|
144
144
|
* @description
|
|
145
145
|
* Direct reference to request object
|
|
146
146
|
*/
|
|
147
|
+
// TODO: move to tokens-server-private
|
|
147
148
|
const FASTIFY_REQUEST = createToken('fastify request');
|
|
148
149
|
/**
|
|
149
150
|
* @description
|
|
@@ -158,6 +159,7 @@ const REQUEST_MANAGER_TOKEN = createToken('requestManager');
|
|
|
158
159
|
* Direct reference to Response instance
|
|
159
160
|
*/
|
|
160
161
|
const RESPONSE = createToken('response');
|
|
162
|
+
// TODO: move to tokens-server-private
|
|
161
163
|
const FASTIFY_RESPONSE = createToken('fastify response');
|
|
162
164
|
/**
|
|
163
165
|
* @description
|
package/lib/index.js
CHANGED
|
@@ -148,6 +148,7 @@ const REQUEST = dippy.createToken('request');
|
|
|
148
148
|
* @description
|
|
149
149
|
* Direct reference to request object
|
|
150
150
|
*/
|
|
151
|
+
// TODO: move to tokens-server-private
|
|
151
152
|
const FASTIFY_REQUEST = dippy.createToken('fastify request');
|
|
152
153
|
/**
|
|
153
154
|
* @description
|
|
@@ -162,6 +163,7 @@ const REQUEST_MANAGER_TOKEN = dippy.createToken('requestManager');
|
|
|
162
163
|
* Direct reference to Response instance
|
|
163
164
|
*/
|
|
164
165
|
const RESPONSE = dippy.createToken('response');
|
|
166
|
+
// TODO: move to tokens-server-private
|
|
165
167
|
const FASTIFY_RESPONSE = dippy.createToken('fastify response');
|
|
166
168
|
/**
|
|
167
169
|
* @description
|
package/lib/requestManager.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Url } from '@tinkoff/url';
|
|
1
2
|
import type { Request } from 'express';
|
|
2
3
|
import type { FastifyRequest as OriginalFastifyRequest } from 'fastify';
|
|
3
4
|
declare type RequestExt = Request;
|
|
@@ -25,6 +26,7 @@ export declare const REQUEST_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenIn
|
|
|
25
26
|
export interface RequestManager {
|
|
26
27
|
getBody(): unknown;
|
|
27
28
|
getUrl(): string;
|
|
29
|
+
getParsedUrl(): Url;
|
|
28
30
|
getMethod(): string;
|
|
29
31
|
getCookie(key: string): string;
|
|
30
32
|
getCookies(): Record<string, string>;
|
package/lib/responseManager.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { FastifyReply } from 'fastify';
|
|
|
7
7
|
* Direct reference to Response instance
|
|
8
8
|
*/
|
|
9
9
|
export declare const RESPONSE: import("@tinkoff/dippy").BaseTokenInterface<Response<any, Record<string, any>>>;
|
|
10
|
-
export declare const FASTIFY_RESPONSE: import("@tinkoff/dippy").BaseTokenInterface<FastifyReply<import("
|
|
10
|
+
export declare const FASTIFY_RESPONSE: import("@tinkoff/dippy").BaseTokenInterface<FastifyReply<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify/types/route").RouteGenericInterface, unknown>>;
|
|
11
11
|
/**
|
|
12
12
|
* @description
|
|
13
13
|
* Instance for managing client response (response headers, cookies, response body).
|
|
@@ -15,8 +15,8 @@ export declare const FASTIFY_RESPONSE: import("@tinkoff/dippy").BaseTokenInterfa
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const RESPONSE_MANAGER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<ResponseManager>;
|
|
17
17
|
export interface ResponseManager {
|
|
18
|
-
getBody():
|
|
19
|
-
setBody(value:
|
|
18
|
+
getBody(): unknown;
|
|
19
|
+
setBody(value: unknown): void;
|
|
20
20
|
getHeader(key: string): string | string[];
|
|
21
21
|
getHeaders(): Record<string, string | string[]>;
|
|
22
22
|
setHeader(key: string, value: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tokens-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.1",
|
|
4
4
|
"description": "Tramvai tokens for @tramvai/module-common",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.es.js",
|
|
@@ -20,14 +20,15 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@tinkoff/lru-cache-nano": "^7.8.1",
|
|
23
|
-
"@
|
|
24
|
-
"@tramvai/
|
|
23
|
+
"@tinkoff/url": "0.8.2",
|
|
24
|
+
"@tramvai/react": "2.24.1",
|
|
25
|
+
"@tramvai/tokens-core": "2.24.1",
|
|
25
26
|
"@types/express": "^4.17.9"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"@tinkoff/dippy": "0.8.2",
|
|
29
30
|
"@tinkoff/logger": "0.10.51",
|
|
30
|
-
"@tramvai/types-actions-state-context": "2.
|
|
31
|
+
"@tramvai/types-actions-state-context": "2.24.1",
|
|
31
32
|
"express": "^4.17.1",
|
|
32
33
|
"fastify": "^3.29.0",
|
|
33
34
|
"react": ">=16.8",
|