fastify-txstate 3.1.3 → 3.1.5
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.js +3 -2
- package/lib-esm/index.d.ts +3 -5
- package/lib-esm/index.js +1 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const http_1 = __importDefault(require("http"));
|
|
|
10
10
|
const http_status_codes_1 = require("http-status-codes");
|
|
11
11
|
exports.devLogger = {
|
|
12
12
|
level: 'info',
|
|
13
|
-
info: (msg) => console.info(msg.req ? `${msg.req.method} ${msg.req.url}` : msg.res ? `${msg.res.statusCode} - ${msg.responseTime}` : msg),
|
|
13
|
+
info: (msg) => { console.info(msg.req ? `${msg.req.method} ${msg.req.url}` : msg.res ? `${msg.res.statusCode} - ${msg.responseTime}` : msg); },
|
|
14
14
|
error: console.error,
|
|
15
15
|
debug: console.debug,
|
|
16
16
|
fatal: console.error,
|
|
@@ -35,6 +35,7 @@ exports.prodLogger = {
|
|
|
35
35
|
return {
|
|
36
36
|
statusCode: res.statusCode,
|
|
37
37
|
url: (_a = res.request) === null || _a === void 0 ? void 0 : _a.url,
|
|
38
|
+
length: res.getHeader('content-length'),
|
|
38
39
|
...res.extraLogInfo
|
|
39
40
|
};
|
|
40
41
|
}
|
|
@@ -171,7 +172,7 @@ class Server {
|
|
|
171
172
|
this.sigHandler = () => {
|
|
172
173
|
this.close().then(() => {
|
|
173
174
|
process.exit();
|
|
174
|
-
}).catch(e => console.error(e));
|
|
175
|
+
}).catch(e => { console.error(e); });
|
|
175
176
|
};
|
|
176
177
|
process.on('SIGTERM', this.sigHandler);
|
|
177
178
|
process.on('SIGINT', this.sigHandler);
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { FastifyInstance, FastifyRequest, FastifyReply, FastifyServerOptions, FastifyLoggerOptions } from 'fastify';
|
|
3
|
-
import http2 from 'http2';
|
|
2
|
+
import { type FastifyInstance, type FastifyRequest, type FastifyReply, type FastifyServerOptions, type FastifyLoggerOptions } from 'fastify';
|
|
3
|
+
import type http2 from 'http2';
|
|
4
4
|
type ErrorHandler = (error: Error, req: FastifyRequest, res: FastifyReply) => Promise<void>;
|
|
5
5
|
export interface FastifyTxStateOptions extends Partial<FastifyServerOptions> {
|
|
6
6
|
https?: http2.SecureServerOptions;
|
|
@@ -68,9 +68,7 @@ export declare class HttpError extends Error {
|
|
|
68
68
|
statusCode: number;
|
|
69
69
|
constructor(statusCode: number, message?: string);
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
[keys: string]: string[];
|
|
73
|
-
}
|
|
71
|
+
type ValidationErrors = Record<string, string[]>;
|
|
74
72
|
export declare class FailedValidationError extends HttpError {
|
|
75
73
|
errors: ValidationErrors;
|
|
76
74
|
constructor(errors: ValidationErrors);
|
package/lib-esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ftxst from '../lib/index.js'
|
|
2
2
|
|
|
3
3
|
export const devLogger = ftxst.devLogger
|
|
4
|
-
export const prodLogger =
|
|
4
|
+
export const prodLogger = ftxst.prodLogger
|
|
5
5
|
export const HttpError = ftxst.HttpError
|
|
6
6
|
export const FailedValidationError = ftxst.FailedValidationError
|
|
7
7
|
export default ftxst.default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastify-txstate",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "A small wrapper for fastify providing a set of common conventions & utility functions we use.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"types": "./lib-esm/index.d.ts",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"@types/node": "^16.7.2",
|
|
26
26
|
"axios": ">=0.20.0",
|
|
27
27
|
"chai": "^4.2.0",
|
|
28
|
-
"eslint-config-standard-with-typescript": "^
|
|
28
|
+
"eslint-config-standard-with-typescript": "^34.0.0",
|
|
29
29
|
"mocha": "^10.0.0",
|
|
30
30
|
"ts-node": "^10.2.1",
|
|
31
|
-
"typescript": "^
|
|
31
|
+
"typescript": "^5.0.4"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|