fastify-flux 2.19.7 → 2.20.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/dist/fastify.d.ts +13 -0
- package/dist/fastify.d.ts.map +1 -1
- package/dist/fastify.js +15 -4
- package/dist/fastify.js.map +1 -1
- package/package.json +2 -2
package/dist/fastify.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
export declare function getFastifyLoggerConfig(): {
|
|
3
|
+
transport: {
|
|
4
|
+
target: string;
|
|
5
|
+
options: {
|
|
6
|
+
colorize: boolean;
|
|
7
|
+
ignore: string;
|
|
8
|
+
singleLine: boolean;
|
|
9
|
+
sync: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
transport?: undefined;
|
|
14
|
+
};
|
|
2
15
|
export declare function createFastifyInstance(): import("fastify").FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<import("fastify").FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>>;
|
|
3
16
|
//# sourceMappingURL=fastify.d.ts.map
|
package/dist/fastify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":";AAYA,wBAAgB,sBAAsB;;;;;;;;;;;;EAiBrC;AAED,wBAAgB,qBAAqB,moBASpC"}
|
package/dist/fastify.js
CHANGED
|
@@ -3,10 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createFastifyInstance = void 0;
|
|
6
|
+
exports.createFastifyInstance = exports.getFastifyLoggerConfig = void 0;
|
|
7
7
|
const fastify_1 = __importDefault(require("fastify"));
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function isPinoPrettyInstalled() {
|
|
9
|
+
let installed = true;
|
|
10
|
+
try {
|
|
11
|
+
require('pino-pretty');
|
|
12
|
+
}
|
|
13
|
+
catch (_) {
|
|
14
|
+
installed = false;
|
|
15
|
+
}
|
|
16
|
+
return installed;
|
|
17
|
+
}
|
|
18
|
+
function getFastifyLoggerConfig() {
|
|
19
|
+
if (isPinoPrettyInstalled()) {
|
|
10
20
|
return {
|
|
11
21
|
transport: {
|
|
12
22
|
target: 'pino-pretty',
|
|
@@ -21,9 +31,10 @@ function getLoggerConfig() {
|
|
|
21
31
|
}
|
|
22
32
|
return {};
|
|
23
33
|
}
|
|
34
|
+
exports.getFastifyLoggerConfig = getFastifyLoggerConfig;
|
|
24
35
|
function createFastifyInstance() {
|
|
25
36
|
return (0, fastify_1.default)({
|
|
26
|
-
logger:
|
|
37
|
+
logger: getFastifyLoggerConfig(),
|
|
27
38
|
ajv: {
|
|
28
39
|
customOptions: {
|
|
29
40
|
removeAdditional: false, //throw error instead
|
package/dist/fastify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAE9B,SAAS,
|
|
1
|
+
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAE9B,SAAS,qBAAqB;IAC5B,IAAI,SAAS,GAAG,IAAI,CAAA;IACpB,IAAI;QACF,OAAO,CAAC,aAAa,CAAC,CAAA;KACvB;IAAC,OAAO,CAAC,EAAE;QACV,SAAS,GAAG,KAAK,CAAA;KAClB;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,sBAAsB;IACpC,IAAI,qBAAqB,EAAE,EAAE;QAC3B,OAAO;YACL,SAAS,EAAE;gBACT,MAAM,EAAE,aAAa;gBACrB,OAAO,EAAE;oBACP,QAAQ,EAAE,IAAI;oBACd,MAAM,EACJ,iEAAiE;oBACnE,UAAU,EAAE,IAAI;oBAChB,IAAI,EAAE,IAAI;iBACX;aACF;SACF,CAAC;KACH;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAjBD,wDAiBC;AAED,SAAgB,qBAAqB;IACnC,OAAO,IAAA,iBAAO,EAAC;QACb,MAAM,EAAE,sBAAsB,EAAE;QAChC,GAAG,EAAE;YACH,aAAa,EAAE;gBACb,gBAAgB,EAAE,KAAK,EAAE,qBAAqB;aAC/C;SACF;KACF,CAAC,CAAC;AACL,CAAC;AATD,sDASC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastify-flux",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@fastify/swagger": "8.x",
|
|
22
|
-
"@fastify/swagger-ui": "^1.",
|
|
22
|
+
"@fastify/swagger-ui": "^1.x",
|
|
23
23
|
"fastify": "4.x"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|