@tsed/platform-log-middleware 6.95.9 → 6.96.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-log-middleware",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.96.2",
|
|
4
4
|
"description": "Log request middleware module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"tslib": "2.2.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tsed/core": "6.
|
|
26
|
-
"@tsed/di": "6.
|
|
27
|
-
"@tsed/platform-middlewares": "6.
|
|
28
|
-
"@tsed/platform-params": "6.
|
|
25
|
+
"@tsed/core": "6.96.2",
|
|
26
|
+
"@tsed/di": "6.96.2",
|
|
27
|
+
"@tsed/platform-middlewares": "6.96.2",
|
|
28
|
+
"@tsed/platform-params": "6.96.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@tsed/core": "^6.
|
|
32
|
-
"@tsed/di": "^6.
|
|
33
|
-
"@tsed/platform-middlewares": "^6.
|
|
34
|
-
"@tsed/platform-params": "^6.
|
|
31
|
+
"@tsed/core": "^6.96.2",
|
|
32
|
+
"@tsed/di": "^6.96.2",
|
|
33
|
+
"@tsed/platform-middlewares": "^6.96.2",
|
|
34
|
+
"@tsed/platform-params": "^6.96.2"
|
|
35
35
|
},
|
|
36
36
|
"repository": "https://github.com/tsedio/tsed",
|
|
37
37
|
"bugs": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare type LoggerRequestFields = ("reqId" | "method" | "url" | "headers" | "body" | "query" | "params" | "duration" | string)[];
|
|
2
|
-
export interface PlatformLogMiddlewareSettings {
|
|
3
|
-
/**
|
|
4
|
-
* Fields displayed when a request is logged. Possible values: `reqId`, `method`, `url`, `headers`, `body`, `query`,`params`, `duration`.
|
|
5
|
-
*/
|
|
6
|
-
requestFields?: LoggerRequestFields;
|
|
7
|
-
/**
|
|
8
|
-
* Log all incoming request. By default is true and print the configured `logger.requestFields`.
|
|
9
|
-
*/
|
|
10
|
-
logRequest?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Log start of all incoming request. By default is true
|
|
13
|
-
*/
|
|
14
|
-
logStart?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Log end of all incoming request. By default is true
|
|
17
|
-
*/
|
|
18
|
-
logEnd?: boolean;
|
|
19
|
-
}
|
|
20
|
-
declare global {
|
|
21
|
-
namespace TsED {
|
|
22
|
-
interface LoggerConfiguration extends Partial<PlatformLogMiddlewareSettings> {
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { MiddlewareMethods } from "@tsed/platform-middlewares";
|
|
2
|
-
import { Context } from "@tsed/platform-params";
|
|
3
|
-
import type { LoggerRequestFields } from "../domain/PlatformLogMiddlewareSettings";
|
|
4
|
-
/**
|
|
5
|
-
* @middleware
|
|
6
|
-
* @platform
|
|
7
|
-
*/
|
|
8
|
-
export declare class PlatformLogMiddleware implements MiddlewareMethods {
|
|
9
|
-
$onResponse: any;
|
|
10
|
-
protected requestFields: LoggerRequestFields;
|
|
11
|
-
protected logRequest: boolean;
|
|
12
|
-
protected logStart: boolean;
|
|
13
|
-
protected logEnd: boolean;
|
|
14
|
-
protected logLevel: string;
|
|
15
|
-
protected debug: boolean;
|
|
16
|
-
constructor();
|
|
17
|
-
get settings(): this;
|
|
18
|
-
/**
|
|
19
|
-
* Handle the request.
|
|
20
|
-
*/
|
|
21
|
-
use(ctx: Context): void;
|
|
22
|
-
/**
|
|
23
|
-
* The separate onLogStart() function will allow developer to overwrite the initial request log.
|
|
24
|
-
* @param ctx
|
|
25
|
-
*/
|
|
26
|
-
protected onLogStart(ctx: Context): void;
|
|
27
|
-
/**
|
|
28
|
-
* Called when the `$onResponse` is called by Ts.ED (through Express.end).
|
|
29
|
-
*/
|
|
30
|
-
protected onLogEnd(ctx: Context): void;
|
|
31
|
-
/**
|
|
32
|
-
* Attach all information that will be necessary to log the request. Attach a new `request.log` object.
|
|
33
|
-
*/
|
|
34
|
-
protected configureRequest(ctx: Context): void;
|
|
35
|
-
/**
|
|
36
|
-
* Return complete request info.
|
|
37
|
-
* @returns {Object}
|
|
38
|
-
* @param ctx
|
|
39
|
-
*/
|
|
40
|
-
protected requestToObject(ctx: Context): any;
|
|
41
|
-
/**
|
|
42
|
-
* Return a filtered request from global configuration.
|
|
43
|
-
* @returns {Object}
|
|
44
|
-
* @param ctx
|
|
45
|
-
*/
|
|
46
|
-
protected minimalRequestPicker(ctx: Context): any;
|
|
47
|
-
}
|