@tramvai/tokens-server-private 5.17.0 → 5.18.3

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.
Files changed (2) hide show
  1. package/lib/index.d.ts +30 -8
  2. package/package.json +4 -3
package/lib/index.d.ts CHANGED
@@ -1,19 +1,42 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import type { Server } from 'http';
4
- import type { FastifyError, FastifyInstance, FastifyReply, FastifyRequest as OriginalFastifyRequest } from 'fastify';
4
+ import type { FastifyError, FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
5
5
  import type { Papi } from '@tramvai/papi';
6
6
  import type { Duplex } from 'stream';
7
- type FastifyRequest = OriginalFastifyRequest & {
8
- cookies: Record<string, string>;
9
- };
7
+ declare module 'fastify' {
8
+ interface FastifyInstance {
9
+ /**
10
+ * Manual cookie parsing method
11
+ * @docs https://github.com/fastify/fastify-cookie#manual-cookie-parsing
12
+ * @param cookieHeader Raw cookie header value
13
+ */
14
+ parseCookie(cookieHeader: string): {
15
+ [key: string]: string;
16
+ };
17
+ }
18
+ interface FastifyRequest {
19
+ /**
20
+ * Request cookies
21
+ */
22
+ cookies: {
23
+ [cookieName: string]: string | undefined;
24
+ };
25
+ }
26
+ interface FastifyReply {
27
+ /**
28
+ * Request cookies
29
+ */
30
+ cookies: {
31
+ [cookieName: string]: string | undefined;
32
+ };
33
+ }
34
+ }
10
35
  /**
11
36
  * @description
12
37
  * Direct reference to request object
13
38
  */
14
- export declare const FASTIFY_REQUEST: OriginalFastifyRequest<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown, import("fastify").FastifyBaseLogger, import("fastify/types/type-provider").ResolveFastifyRequestType<import("fastify").FastifyTypeProviderDefault, import("fastify").FastifySchema, import("fastify").RouteGenericInterface>> & {
15
- cookies: Record<string, string>;
16
- } & {
39
+ export declare const FASTIFY_REQUEST: FastifyRequest<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown, import("fastify").FastifyBaseLogger, import("fastify/types/type-provider").ResolveFastifyRequestType<import("fastify").FastifyTypeProviderDefault, import("fastify").FastifySchema, import("fastify").RouteGenericInterface>> & {
17
40
  __type?: "base token" | undefined;
18
41
  };
19
42
  /**
@@ -158,5 +181,4 @@ export interface EarlyHintsManager {
158
181
  export declare const PAPI_FASTIFY_INIT_TOKEN: FASTIFY_APP_INIT_HANDLER & {
159
182
  __type?: "multi token" | undefined;
160
183
  };
161
- export {};
162
184
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-server-private",
3
- "version": "5.17.0",
3
+ "version": "5.18.3",
4
4
  "description": "Tramvai private tokens for @tramvai/module-server",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.es.js",
@@ -18,11 +18,12 @@
18
18
  "watch": "tsc -w"
19
19
  },
20
20
  "dependencies": {
21
- "@tramvai/papi": "5.17.0"
21
+ "@tramvai/papi": "5.18.3"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@tinkoff/dippy": "0.11.3",
25
- "fastify": "^4.6.0",
25
+ "fastify": "^4.14.1",
26
+ "@fastify/cookie": "^8.3.0",
26
27
  "tslib": "^2.4.0"
27
28
  },
28
29
  "devDependencies": {},