@golemio/core 1.2.22-dev.702987293 → 1.2.22-dev.703350617
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.
|
@@ -13,12 +13,12 @@ export declare const requestSerializer: (req: SerializedRequest & {
|
|
|
13
13
|
httpVersion: string;
|
|
14
14
|
method: string;
|
|
15
15
|
url: string;
|
|
16
|
-
userId: any;
|
|
17
16
|
remoteAddress: string;
|
|
18
17
|
userAgent: string;
|
|
19
18
|
};
|
|
20
19
|
export declare const responseSerializer: (res: SerializedResponse) => {
|
|
21
20
|
status: number;
|
|
22
21
|
contentLength: string | number | string[] | undefined;
|
|
22
|
+
readonly userId: any;
|
|
23
23
|
};
|
|
24
24
|
export declare const createRequestLogger: (nodeEnv: string, logger: ILogger, stream?: DestinationStream) => import("pino-http").HttpLogger;
|
|
@@ -5,21 +5,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createRequestLogger = exports.responseSerializer = exports.requestSerializer = void 0;
|
|
7
7
|
const pino_http_1 = __importDefault(require("pino-http"));
|
|
8
|
-
const requestSerializer = (req) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
remoteAddress: req.remoteAddress,
|
|
16
|
-
userAgent: req.headers["user-agent"],
|
|
17
|
-
});
|
|
18
|
-
};
|
|
8
|
+
const requestSerializer = (req) => ({
|
|
9
|
+
httpVersion: req.raw.httpVersion,
|
|
10
|
+
method: req.method,
|
|
11
|
+
url: req.url,
|
|
12
|
+
remoteAddress: req.remoteAddress,
|
|
13
|
+
userAgent: req.headers["user-agent"],
|
|
14
|
+
});
|
|
19
15
|
exports.requestSerializer = requestSerializer;
|
|
20
16
|
const responseSerializer = (res) => ({
|
|
21
17
|
status: res.statusCode,
|
|
22
18
|
contentLength: res.raw.getHeader("content-length"),
|
|
19
|
+
get userId() {
|
|
20
|
+
var _a;
|
|
21
|
+
return ((_a = res.raw.req.session) === null || _a === void 0 ? void 0 : _a.user) ? res.raw.req.session.user.id : null;
|
|
22
|
+
},
|
|
23
23
|
});
|
|
24
24
|
exports.responseSerializer = responseSerializer;
|
|
25
25
|
const createRequestLogger = (nodeEnv, logger, stream) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestLoggerProvider.js","sourceRoot":"","sources":["../../../src/helpers/logger/RequestLoggerProvider.ts"],"names":[],"mappings":";;;;;;AAEA,0DAAiC;AAU1B,MAAM,iBAAiB,GAAG,CAAC,GAAiD,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"RequestLoggerProvider.js","sourceRoot":"","sources":["../../../src/helpers/logger/RequestLoggerProvider.ts"],"names":[],"mappings":";;;;;;AAEA,0DAAiC;AAU1B,MAAM,iBAAiB,GAAG,CAAC,GAAiD,EAAE,EAAE,CAAC,CAAC;IACrF,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,WAAW;IAChC,MAAM,EAAE,GAAG,CAAC,MAAM;IAClB,GAAG,EAAE,GAAG,CAAC,GAAG;IACZ,aAAa,EAAE,GAAG,CAAC,aAAa;IAChC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC;CACvC,CAAC,CAAC;AANU,QAAA,iBAAiB,qBAM3B;AAEI,MAAM,kBAAkB,GAAG,CAAC,GAAuB,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,EAAE,GAAG,CAAC,UAAU;IACtB,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,gBAAgB,CAAC;IAClD,IAAI,MAAM;;QACN,OAAO,CAAA,MAAC,GAAG,CAAC,GAAG,CAAC,GAAuB,CAAC,OAAO,0CAAE,IAAI,EAAC,CAAC,CAAE,GAAG,CAAC,GAAG,CAAC,GAAuB,CAAC,OAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAA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