@tramvai/tokens-server-private 1.90.2 → 1.91.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 +14 -1
- package/lib/index.es.js +11 -1
- package/lib/index.js +12 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import type { Server } from 'http';
|
|
2
3
|
import type { FastifyError, FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* Creates new server instance
|
|
7
|
+
*/
|
|
8
|
+
export declare const SERVER_FACTORY_TOKEN: () => Server;
|
|
9
|
+
/**
|
|
10
|
+
* @description
|
|
11
|
+
* Creates web-app instance
|
|
12
|
+
*/
|
|
13
|
+
export declare const WEB_FASTIFY_APP_FACTORY_TOKEN: (options: {
|
|
14
|
+
server: Server;
|
|
15
|
+
}) => FastifyInstance;
|
|
3
16
|
/**
|
|
4
17
|
* @description
|
|
5
18
|
* Instance of the current fastify app that handles requests.
|
|
6
19
|
* Can be used to setup custom request handler and add custom routes
|
|
7
20
|
*/
|
|
8
|
-
export declare const WEB_FASTIFY_APP_TOKEN: FastifyInstance<
|
|
21
|
+
export declare const WEB_FASTIFY_APP_TOKEN: FastifyInstance<Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify").FastifyLoggerInstance>;
|
|
9
22
|
/**
|
|
10
23
|
* @description
|
|
11
24
|
* Subscription to before web-app initialization. It is called before any standard handlers.
|
package/lib/index.es.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { createToken } from '@tinkoff/dippy';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Creates new server instance
|
|
6
|
+
*/
|
|
7
|
+
const SERVER_FACTORY_TOKEN = createToken('server serverFactory');
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Creates web-app instance
|
|
11
|
+
*/
|
|
12
|
+
const WEB_FASTIFY_APP_FACTORY_TOKEN = createToken('webApp fastifyFactory');
|
|
3
13
|
/**
|
|
4
14
|
* @description
|
|
5
15
|
* Instance of the current fastify app that handles requests.
|
|
@@ -44,4 +54,4 @@ const WEB_FASTIFY_APP_PROCESS_ERROR_TOKEN = createToken('webApp fastify error',
|
|
|
44
54
|
*/
|
|
45
55
|
const WEB_FASTIFY_APP_AFTER_ERROR_TOKEN = createToken('webApp fastify afterError', { multi: true });
|
|
46
56
|
|
|
47
|
-
export { 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_INIT_TOKEN, WEB_FASTIFY_APP_LIMITER_TOKEN, WEB_FASTIFY_APP_PROCESS_ERROR_TOKEN, WEB_FASTIFY_APP_TOKEN };
|
|
57
|
+
export { SERVER_FACTORY_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_PROCESS_ERROR_TOKEN, WEB_FASTIFY_APP_TOKEN };
|
package/lib/index.js
CHANGED
|
@@ -4,6 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var dippy = require('@tinkoff/dippy');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Creates new server instance
|
|
10
|
+
*/
|
|
11
|
+
const SERVER_FACTORY_TOKEN = dippy.createToken('server serverFactory');
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* Creates web-app instance
|
|
15
|
+
*/
|
|
16
|
+
const WEB_FASTIFY_APP_FACTORY_TOKEN = dippy.createToken('webApp fastifyFactory');
|
|
7
17
|
/**
|
|
8
18
|
* @description
|
|
9
19
|
* Instance of the current fastify app that handles requests.
|
|
@@ -48,10 +58,12 @@ const WEB_FASTIFY_APP_PROCESS_ERROR_TOKEN = dippy.createToken('webApp fastify er
|
|
|
48
58
|
*/
|
|
49
59
|
const WEB_FASTIFY_APP_AFTER_ERROR_TOKEN = dippy.createToken('webApp fastify afterError', { multi: true });
|
|
50
60
|
|
|
61
|
+
exports.SERVER_FACTORY_TOKEN = SERVER_FACTORY_TOKEN;
|
|
51
62
|
exports.WEB_FASTIFY_APP_AFTER_ERROR_TOKEN = WEB_FASTIFY_APP_AFTER_ERROR_TOKEN;
|
|
52
63
|
exports.WEB_FASTIFY_APP_AFTER_INIT_TOKEN = WEB_FASTIFY_APP_AFTER_INIT_TOKEN;
|
|
53
64
|
exports.WEB_FASTIFY_APP_BEFORE_ERROR_TOKEN = WEB_FASTIFY_APP_BEFORE_ERROR_TOKEN;
|
|
54
65
|
exports.WEB_FASTIFY_APP_BEFORE_INIT_TOKEN = WEB_FASTIFY_APP_BEFORE_INIT_TOKEN;
|
|
66
|
+
exports.WEB_FASTIFY_APP_FACTORY_TOKEN = WEB_FASTIFY_APP_FACTORY_TOKEN;
|
|
55
67
|
exports.WEB_FASTIFY_APP_INIT_TOKEN = WEB_FASTIFY_APP_INIT_TOKEN;
|
|
56
68
|
exports.WEB_FASTIFY_APP_LIMITER_TOKEN = WEB_FASTIFY_APP_LIMITER_TOKEN;
|
|
57
69
|
exports.WEB_FASTIFY_APP_PROCESS_ERROR_TOKEN = WEB_FASTIFY_APP_PROCESS_ERROR_TOKEN;
|