@tramvai/tokens-server-private 2.22.0 → 2.24.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.
package/lib/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import type { Server } from 'http';
3
3
  import type { FastifyError, FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
4
+ import type { Papi } from '@tramvai/papi';
4
5
  /**
5
6
  * @description
6
7
  * Creates new server instance
@@ -18,7 +19,7 @@ export declare const WEB_FASTIFY_APP_FACTORY_TOKEN: import("@tinkoff/dippy").Bas
18
19
  * Instance of the current fastify app that handles requests.
19
20
  * Can be used to setup custom request handler and add custom routes
20
21
  */
21
- export declare const WEB_FASTIFY_APP_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<FastifyInstance<Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify").FastifyLoggerInstance>>;
22
+ export declare const WEB_FASTIFY_APP_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyLoggerInstance>>;
22
23
  /**
23
24
  * @description
24
25
  * Subscription to before web-app initialization. It is called before any standard handlers.
@@ -65,11 +66,13 @@ export declare const WEB_FASTIFY_APP_AFTER_ERROR_TOKEN: import("@tinkoff/dippy")
65
66
  * @description
66
67
  * Http server for utility routes
67
68
  */
68
- export declare const UTILITY_SERVER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<Server>;
69
+ export declare const UTILITY_SERVER_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>>;
69
70
  /**
70
71
  * @description
71
72
  * Web app for utility routes
72
73
  */
73
- export declare const UTILITY_WEB_FASTIFY_APP_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<FastifyInstance<Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify").FastifyLoggerInstance>>;
74
+ export declare const UTILITY_WEB_FASTIFY_APP_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyLoggerInstance>>;
74
75
  export declare type FASTIFY_APP_INIT_HANDLER = (app: FastifyInstance) => Promise<void> | void;
75
76
  export declare type FASTIFY_APP_ERROR_HANDLER = (error: FastifyError, request: FastifyRequest, reply: FastifyReply) => Promise<string | undefined | void> | string | undefined | void;
77
+ export declare type PapiExecutor = <Result>(papi: Papi<Result>) => Result;
78
+ export declare const PAPI_EXECUTOR: import("@tinkoff/dippy").BaseTokenInterface<PapiExecutor>;
package/lib/index.es.js CHANGED
@@ -68,5 +68,6 @@ const UTILITY_SERVER_TOKEN = createToken('server utilityServer');
68
68
  * Web app for utility routes
69
69
  */
70
70
  const UTILITY_WEB_FASTIFY_APP_TOKEN = createToken('webApp utilityServer');
71
+ const PAPI_EXECUTOR = createToken('papi executor');
71
72
 
72
- export { SERVER_FACTORY_TOKEN, UTILITY_SERVER_TOKEN, UTILITY_WEB_FASTIFY_APP_TOKEN, WEB_FASTIFY_APP_AFTER_ERROR_TOKEN, WEB_FASTIFY_APP_AFTER_INIT_TOKEN, WEB_FASTIFY_APP_BEFORE_ERROR_TOKEN, WEB_FASTIFY_APP_BEFORE_INIT_TOKEN, WEB_FASTIFY_APP_FACTORY_TOKEN, WEB_FASTIFY_APP_INIT_TOKEN, WEB_FASTIFY_APP_LIMITER_TOKEN, WEB_FASTIFY_APP_METRICS_TOKEN, WEB_FASTIFY_APP_PROCESS_ERROR_TOKEN, WEB_FASTIFY_APP_TOKEN };
73
+ export { PAPI_EXECUTOR, SERVER_FACTORY_TOKEN, UTILITY_SERVER_TOKEN, UTILITY_WEB_FASTIFY_APP_TOKEN, WEB_FASTIFY_APP_AFTER_ERROR_TOKEN, WEB_FASTIFY_APP_AFTER_INIT_TOKEN, WEB_FASTIFY_APP_BEFORE_ERROR_TOKEN, WEB_FASTIFY_APP_BEFORE_INIT_TOKEN, WEB_FASTIFY_APP_FACTORY_TOKEN, WEB_FASTIFY_APP_INIT_TOKEN, WEB_FASTIFY_APP_LIMITER_TOKEN, WEB_FASTIFY_APP_METRICS_TOKEN, WEB_FASTIFY_APP_PROCESS_ERROR_TOKEN, WEB_FASTIFY_APP_TOKEN };
package/lib/index.js CHANGED
@@ -72,7 +72,9 @@ const UTILITY_SERVER_TOKEN = dippy.createToken('server utilityServer');
72
72
  * Web app for utility routes
73
73
  */
74
74
  const UTILITY_WEB_FASTIFY_APP_TOKEN = dippy.createToken('webApp utilityServer');
75
+ const PAPI_EXECUTOR = dippy.createToken('papi executor');
75
76
 
77
+ exports.PAPI_EXECUTOR = PAPI_EXECUTOR;
76
78
  exports.SERVER_FACTORY_TOKEN = SERVER_FACTORY_TOKEN;
77
79
  exports.UTILITY_SERVER_TOKEN = UTILITY_SERVER_TOKEN;
78
80
  exports.UTILITY_WEB_FASTIFY_APP_TOKEN = UTILITY_WEB_FASTIFY_APP_TOKEN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tokens-server-private",
3
- "version": "2.22.0",
3
+ "version": "2.24.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,9 +18,11 @@
18
18
  "watch": "tsc -w",
19
19
  "build-for-publish": "true"
20
20
  },
21
- "dependencies": {},
21
+ "dependencies": {
22
+ "@tramvai/papi": "2.24.3"
23
+ },
22
24
  "peerDependencies": {
23
- "@tinkoff/dippy": "0.8.2",
25
+ "@tinkoff/dippy": "0.8.3",
24
26
  "fastify": "^3.29.0",
25
27
  "tslib": "^2.0.3"
26
28
  },