@icd-iot-aicf/nestjs-logger 2.3.0 → 3.0.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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/logger/aicf/middleware/aicf.middleware.d.ts +3 -8
- package/dist/logger/aicf/middleware/aicf.middleware.js +37 -93
- package/dist/logger/aicf/middleware/aicf.middleware.js.map +1 -1
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.js +4 -0
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.js.map +1 -1
- package/dist/logger/cloudron/middleware/cloudron.middleware.d.ts +5 -8
- package/dist/logger/cloudron/middleware/cloudron.middleware.js +18 -72
- package/dist/logger/cloudron/middleware/cloudron.middleware.js.map +1 -1
- package/dist/logger/core/middleware/base-http.middleware.d.ts +33 -0
- package/dist/logger/core/middleware/base-http.middleware.js +104 -0
- package/dist/logger/core/middleware/base-http.middleware.js.map +1 -0
- package/dist/logger/core/middleware/http-logs-middleware.service.js +1 -1
- package/dist/logger/core/middleware/http-logs-middleware.service.js.map +1 -1
- package/dist/logger/logger.module.js +1 -2
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,3 +21,4 @@ export * from './logger/core/services/summary-flush.service';
|
|
|
21
21
|
export * from './logger/core/database/hook-ingress.database';
|
|
22
22
|
export * from './logger/aicf/dtos/aicf.dto';
|
|
23
23
|
export * from './logger/core/pipes/index';
|
|
24
|
+
export * from './logger/core/middleware/base-http.middleware';
|
package/dist/index.js
CHANGED
|
@@ -37,4 +37,5 @@ __exportStar(require("./logger/core/services/summary-flush.service"), exports);
|
|
|
37
37
|
__exportStar(require("./logger/core/database/hook-ingress.database"), exports);
|
|
38
38
|
__exportStar(require("./logger/aicf/dtos/aicf.dto"), exports);
|
|
39
39
|
__exportStar(require("./logger/core/pipes/index"), exports);
|
|
40
|
+
__exportStar(require("./logger/core/middleware/base-http.middleware"), exports);
|
|
40
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,+DAA6C;AAC7C,mEAAiD;AACjD,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,iEAA+C;AAC/C,0DAAwC;AACxC,qEAAmD;AACnD,4EAA0D;AAC1D,8DAA4C;AAC5C,wFAAsE;AACtE,0EAAwD;AACxD,yCAAuB;AACvB,wEAAsD;AACtD,0DAAwC;AACxC,0EAAwD;AACxD,2DAAyC;AACzC,+EAA6D;AAC7D,+EAA6D;AAC7D,8DAA4C;AAC5C,4DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,4DAA0C;AAC1C,+DAA6C;AAC7C,mEAAiD;AACjD,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,iEAA+C;AAC/C,0DAAwC;AACxC,qEAAmD;AACnD,4EAA0D;AAC1D,8DAA4C;AAC5C,wFAAsE;AACtE,0EAAwD;AACxD,yCAAuB;AACvB,wEAAsD;AACtD,0DAAwC;AACxC,0EAAwD;AACxD,2DAAyC;AACzC,+EAA6D;AAC7D,+EAA6D;AAC7D,8DAA4C;AAC5C,4DAA0C;AAC1C,gFAA8D"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { NestMiddleware } from '@nestjs/common';
|
|
2
1
|
import { CustomLoggerService } from '../../logger.service';
|
|
3
|
-
import { NextFunction, Request, Response } from 'express';
|
|
4
2
|
import { LoggerDebugLibService } from '../../../common/service/logger-debug/logger-debug-lib.service';
|
|
5
3
|
import { ToolsService } from '../../../common/helper/tools.service';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
private readonly loggerDebug;
|
|
9
|
-
private toolsService;
|
|
10
|
-
appLogConfig: import("../../..").AppLogConfig;
|
|
4
|
+
import { BaseHttpMiddleware, FinishContext } from '../../core/middleware/base-http.middleware';
|
|
5
|
+
export declare class AicfMiddleware extends BaseHttpMiddleware {
|
|
11
6
|
constructor(logger: CustomLoggerService, loggerDebug: LoggerDebugLibService, toolsService: ToolsService);
|
|
12
|
-
|
|
7
|
+
protected onFinish(ctx: FinishContext): void;
|
|
13
8
|
}
|
|
@@ -8,111 +8,55 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.AicfMiddleware = void 0;
|
|
16
13
|
const common_1 = require("@nestjs/common");
|
|
17
|
-
const microtime_1 = __importDefault(require("microtime"));
|
|
18
14
|
const aicf_dto_1 = require("../dtos/aicf.dto");
|
|
19
15
|
const logger_service_1 = require("../../logger.service");
|
|
20
16
|
const tools_1 = require("../../../utils/tools");
|
|
21
|
-
const global_function_1 = require("../../core/functions/global-function");
|
|
22
17
|
const logger_debug_lib_service_1 = require("../../../common/service/logger-debug/logger-debug-lib.service");
|
|
23
|
-
const tools_2 = require("../../../common/helper/tools");
|
|
24
|
-
const app_log_config_service_1 = require("../../../config/app-log-config.service");
|
|
25
18
|
const tools_service_1 = require("../../../common/helper/tools.service");
|
|
26
|
-
|
|
19
|
+
const base_http_middleware_1 = require("../../core/middleware/base-http.middleware");
|
|
20
|
+
let AicfMiddleware = class AicfMiddleware extends base_http_middleware_1.BaseHttpMiddleware {
|
|
27
21
|
constructor(logger, loggerDebug, toolsService) {
|
|
28
|
-
|
|
29
|
-
this.loggerDebug = loggerDebug;
|
|
30
|
-
this.toolsService = toolsService;
|
|
31
|
-
this.appLogConfig = app_log_config_service_1.AppLogConfigService.getConfig();
|
|
22
|
+
super(logger, loggerDebug, toolsService);
|
|
32
23
|
}
|
|
33
|
-
|
|
34
|
-
const startTime =
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
res.write = (...args) => {
|
|
41
|
-
chunks.push(Buffer.from(args[0]));
|
|
42
|
-
return originalWrite.apply(res, args);
|
|
43
|
-
};
|
|
44
|
-
res.end = (...args) => {
|
|
45
|
-
const endTime = microtime_1.default.now();
|
|
46
|
-
if (args[0]) {
|
|
47
|
-
chunks.push(Buffer.from(args[0]));
|
|
48
|
-
}
|
|
49
|
-
this.loggerDebug.debug(`chunks: `, chunks);
|
|
50
|
-
const buffer = Buffer.concat(chunks).toString('utf8');
|
|
51
|
-
this.loggerDebug.debug(`buffer: `, buffer);
|
|
52
|
-
res.on('finish', () => {
|
|
53
|
-
const transactionReference = (0, global_function_1.GetTransactionReference)();
|
|
54
|
-
const recordName = transactionReference.recordName;
|
|
55
|
-
const requestFormat = (0, aicf_dto_1.MapRequestFormat)(req, req.headers.host);
|
|
56
|
-
if (transactionReference.requestObject.body) {
|
|
57
|
-
requestFormat.payload = transactionReference.requestObject.body;
|
|
58
|
-
}
|
|
59
|
-
const respData = (transactionReference.responseObject || buffer);
|
|
60
|
-
const response = {
|
|
61
|
-
status: res.status,
|
|
62
|
-
headers: res.getHeaders(),
|
|
63
|
-
body: typeof buffer == 'string' ? JSON.parse(buffer) : respData,
|
|
64
|
-
};
|
|
65
|
-
const responseFormat = (0, aicf_dto_1.MapResponseFormat)(response);
|
|
66
|
-
if (transactionReference.maskingLogData) {
|
|
67
|
-
requestFormat.payload = (0, tools_1.maskingData)(requestFormat.payload, transactionReference.specificKeyMasking);
|
|
68
|
-
responseFormat.payload = (0, tools_1.maskingData)(responseFormat.payload, transactionReference.specificKeyMasking);
|
|
69
|
-
}
|
|
70
|
-
let resultFormat = {};
|
|
71
|
-
if (this.appLogConfig.structureResponse) {
|
|
72
|
-
resultFormat = (0, tools_2.serializedFormatCommonOperationStatus)(responseFormat, this.appLogConfig.structureResponse);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
resultFormat = this.toolsService.mapResultCodeResponse(responseFormat, res.statusCode);
|
|
76
|
-
}
|
|
77
|
-
this.logger.log(new aicf_dto_1.CAICFDetail({
|
|
78
|
-
resultCode: resultFormat.resultCode || '',
|
|
79
|
-
resultMessage: resultFormat.resultDescription || '',
|
|
80
|
-
action: aicf_dto_1.ACTION_TYPE.HTTP,
|
|
81
|
-
endTime: endTime,
|
|
82
|
-
logLevel: aicf_dto_1.LOG_LEVEL.INFO,
|
|
83
|
-
request: requestFormat,
|
|
84
|
-
response: responseFormat,
|
|
85
|
-
startTime: startTime,
|
|
86
|
-
sessionId: sessionId,
|
|
87
|
-
recordName: recordName,
|
|
88
|
-
subAction: req.method.toUpperCase(),
|
|
89
|
-
}));
|
|
90
|
-
this.logger.log(new aicf_dto_1.CAICFSummary({
|
|
91
|
-
resultCode: resultFormat.resultCode || '',
|
|
92
|
-
resultMessage: resultFormat.resultDescription || '',
|
|
93
|
-
endTime: endTime,
|
|
94
|
-
logLevel: aicf_dto_1.LOG_LEVEL.INFO,
|
|
95
|
-
request: requestFormat,
|
|
96
|
-
response: responseFormat,
|
|
97
|
-
startTime: startTime,
|
|
98
|
-
sessionId: sessionId,
|
|
99
|
-
recordName: recordName,
|
|
100
|
-
}));
|
|
101
|
-
});
|
|
102
|
-
res.on('error', (err) => {
|
|
103
|
-
this.loggerDebug.debug('Error in aicf middleware: ', err);
|
|
104
|
-
});
|
|
105
|
-
return originalEnd.apply(res, args);
|
|
24
|
+
onFinish(ctx) {
|
|
25
|
+
const { req, res, startTime, endTime, sessionId, buffer, transactionReference, requestFormat, resultFormat, respData, } = ctx;
|
|
26
|
+
const parsedBody = this.safeJsonParse(buffer, respData);
|
|
27
|
+
const response = {
|
|
28
|
+
status: res.status,
|
|
29
|
+
headers: res.getHeaders(),
|
|
30
|
+
body: parsedBody,
|
|
106
31
|
};
|
|
107
|
-
(0,
|
|
108
|
-
|
|
109
|
-
|
|
32
|
+
const responseFormat = (0, aicf_dto_1.MapResponseFormat)(response);
|
|
33
|
+
if (transactionReference.maskingLogData) {
|
|
34
|
+
responseFormat.payload = (0, tools_1.maskingData)(responseFormat.payload, transactionReference.specificKeyMasking);
|
|
35
|
+
}
|
|
36
|
+
this.logger.log(new aicf_dto_1.CAICFDetail({
|
|
37
|
+
resultCode: resultFormat.resultCode || '',
|
|
38
|
+
resultMessage: resultFormat.resultDescription || '',
|
|
110
39
|
action: aicf_dto_1.ACTION_TYPE.HTTP,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
40
|
+
endTime,
|
|
41
|
+
logLevel: aicf_dto_1.LOG_LEVEL.INFO,
|
|
42
|
+
request: requestFormat,
|
|
43
|
+
response: responseFormat,
|
|
44
|
+
startTime,
|
|
45
|
+
sessionId,
|
|
46
|
+
recordName: transactionReference.recordName,
|
|
47
|
+
subAction: req.method.toUpperCase(),
|
|
48
|
+
}));
|
|
49
|
+
this.logger.log(new aicf_dto_1.CAICFSummary({
|
|
50
|
+
resultCode: resultFormat.resultCode || '',
|
|
51
|
+
resultMessage: resultFormat.resultDescription || '',
|
|
52
|
+
endTime,
|
|
53
|
+
logLevel: aicf_dto_1.LOG_LEVEL.INFO,
|
|
54
|
+
request: requestFormat,
|
|
55
|
+
response: responseFormat,
|
|
56
|
+
startTime,
|
|
57
|
+
sessionId,
|
|
58
|
+
recordName: transactionReference.recordName,
|
|
59
|
+
}));
|
|
116
60
|
}
|
|
117
61
|
};
|
|
118
62
|
exports.AicfMiddleware = AicfMiddleware;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aicf.middleware.js","sourceRoot":"","sources":["../../../../src/logger/aicf/middleware/aicf.middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aicf.middleware.js","sourceRoot":"","sources":["../../../../src/logger/aicf/middleware/aicf.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAM0B;AAC1B,yDAA2D;AAC3D,gDAAmD;AACnD,4GAAsG;AACtG,wEAAoE;AACpE,qFAGoD;AAG7C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,yCAAkB;IACpD,YACE,MAA2B,EAC3B,WAAkC,EAClC,YAA0B;QAE1B,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAC3C,CAAC;IAES,QAAQ,CAAC,GAAkB;QACnC,MAAM,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,OAAO,EACP,SAAS,EACT,MAAM,EACN,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,QAAQ,GACT,GAAG,GAAG,CAAC;QAGR,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAExD,MAAM,QAAQ,GAAG;YACf,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,OAAO,EAAE,GAAG,CAAC,UAAU,EAAE;YACzB,IAAI,EAAE,UAAU;SACjB,CAAC;QAEF,MAAM,cAAc,GAAG,IAAA,4BAAiB,EAAC,QAAQ,CAAC,CAAC;QAGnD,IAAI,oBAAoB,CAAC,cAAc,EAAE,CAAC;YACxC,cAAc,CAAC,OAAO,GAAG,IAAA,mBAAW,EAClC,cAAc,CAAC,OAAO,EACtB,oBAAoB,CAAC,kBAAkB,CACxC,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,IAAI,sBAAW,CAAC;YACd,UAAU,EAAE,YAAY,CAAC,UAAU,IAAI,EAAE;YACzC,aAAa,EAAE,YAAY,CAAC,iBAAiB,IAAI,EAAE;YACnD,MAAM,EAAE,sBAAW,CAAC,IAAI;YACxB,OAAO;YACP,QAAQ,EAAE,oBAAS,CAAC,IAAI;YACxB,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,cAAc;YACxB,SAAS;YACT,SAAS;YACT,UAAU,EAAE,oBAAoB,CAAC,UAAU;YAC3C,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE;SACpC,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,IAAI,uBAAY,CAAC;YACf,UAAU,EAAE,YAAY,CAAC,UAAU,IAAI,EAAE;YACzC,aAAa,EAAE,YAAY,CAAC,iBAAiB,IAAI,EAAE;YACnD,OAAO;YACP,QAAQ,EAAE,oBAAS,CAAC,IAAI;YACxB,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,cAAc;YACxB,SAAS;YACT,SAAS;YACT,UAAU,EAAE,oBAAoB,CAAC,UAAU;SAC5C,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AAxEY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAGD,oCAAmB;QACd,gDAAqB;QACpB,4BAAY;GAJjB,cAAc,CAwE1B"}
|
|
@@ -22,6 +22,10 @@ class CDetailManaulLogWithPushSummary {
|
|
|
22
22
|
const transactionRefInfo = (0, global_function_1.GetTransactionReference)();
|
|
23
23
|
const startTime = data.startTime || microtime_1.default.now();
|
|
24
24
|
const endTime = data.endTime || microtime_1.default.now();
|
|
25
|
+
if (transactionRefInfo.maskingLogData) {
|
|
26
|
+
data.message.requestObject = (0, tools_1.maskingData)(data.message.requestObject, transactionRefInfo.specificKeyMasking);
|
|
27
|
+
data.message.responseObject = (0, tools_1.maskingData)(data.message.responseObject, transactionRefInfo.specificKeyMasking);
|
|
28
|
+
}
|
|
25
29
|
this.systemTimestamp = `${(0, main_1.dayJs)().format('DD/MM/YYYY HH:mm:ss.SSS')}`;
|
|
26
30
|
this.logType = cauldron_dto_1.LogType.DETAIL;
|
|
27
31
|
this.logLevel = cauldron_dto_1.LogLevel.INFO;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cauldron-manual.dto.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/dtos/cauldron-manual.dto.ts"],"names":[],"mappings":";;;;;;AAAA,mFAA6E;AAI7E,0DAAkC;AAClC,wCAAsC;AACtC,4CAAoB;AACpB,0EAI8C;AAC9C,6FAAqF;AACrF,iDAWwB;AAIxB,gDAG8B;AAoC9B,MAAa,+BAA+B;IAY1C,YAAY,IAAS;QACnB,IAAI,CAAC,OAAO,KAAK;YACf,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;YACvC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,EAAE;SAC1C,CAAC;
|
|
1
|
+
{"version":3,"file":"cauldron-manual.dto.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/dtos/cauldron-manual.dto.ts"],"names":[],"mappings":";;;;;;AAAA,mFAA6E;AAI7E,0DAAkC;AAClC,wCAAsC;AACtC,4CAAoB;AACpB,0EAI8C;AAC9C,6FAAqF;AACrF,iDAWwB;AAIxB,gDAG8B;AAoC9B,MAAa,+BAA+B;IAY1C,YAAY,IAAS;QACnB,IAAI,CAAC,OAAO,KAAK;YACf,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;YACvC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,EAAE;SAC1C,CAAC;QAEF,MAAM,SAAS,GAAG,4CAAmB,CAAC,SAAS,EAAE,CAAC;QAClD,MAAM,kBAAkB,GAAG,IAAA,yCAAuB,GAAE,CAAC;QACrD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,mBAAS,CAAC,GAAG,EAAE,CAAC;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,mBAAS,C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AAC,IAAI,IAAI,MAAM,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAnBD,8BAmBC"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { NestMiddleware } from '@nestjs/common';
|
|
2
1
|
import { CustomLoggerService } from '../../logger.service';
|
|
3
2
|
import { CloudronSummaryLogsService } from '../services/cloudron-summary-logs.service';
|
|
4
|
-
import { NextFunction
|
|
3
|
+
import { NextFunction } from 'express';
|
|
5
4
|
import { ToolsService } from '../../../common/helper/tools.service';
|
|
6
5
|
import { LoggerDebugLibService } from '../../../common/service/logger-debug/logger-debug-lib.service';
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { BaseHttpMiddleware, FinishContext } from '../../core/middleware/base-http.middleware';
|
|
7
|
+
export declare class CloudronMiddleware extends BaseHttpMiddleware {
|
|
9
8
|
private readonly externalSummaryService;
|
|
10
|
-
private readonly toolsService;
|
|
11
|
-
private readonly loggerDebug;
|
|
12
|
-
appLogConfig: import("../../..").AppLogConfig;
|
|
13
9
|
constructor(logger: CustomLoggerService, externalSummaryService: CloudronSummaryLogsService, toolsService: ToolsService, loggerDebug: LoggerDebugLibService);
|
|
14
|
-
|
|
10
|
+
protected onFinish(ctx: FinishContext): void;
|
|
11
|
+
protected wrapNext(next: NextFunction): void;
|
|
15
12
|
}
|
|
@@ -8,9 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.CloudronMiddleware = void 0;
|
|
16
13
|
const common_1 = require("@nestjs/common");
|
|
@@ -18,81 +15,30 @@ const logger_service_1 = require("../../logger.service");
|
|
|
18
15
|
const cloudron_summary_logs_service_1 = require("../services/cloudron-summary-logs.service");
|
|
19
16
|
const tools_1 = require("../../../utils/tools");
|
|
20
17
|
const cauldron_dto_1 = require("../dtos/cauldron.dto");
|
|
21
|
-
const microtime_1 = __importDefault(require("microtime"));
|
|
22
|
-
const global_function_1 = require("../../core/functions/global-function");
|
|
23
|
-
const aicf_dto_1 = require("../../aicf/dtos/aicf.dto");
|
|
24
18
|
const summaryEndpoint_info_1 = require("../../../common/async-storage/summaryEndpoint-info");
|
|
25
19
|
const tools_service_1 = require("../../../common/helper/tools.service");
|
|
26
20
|
const logger_debug_lib_service_1 = require("../../../common/service/logger-debug/logger-debug-lib.service");
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
let CloudronMiddleware = class CloudronMiddleware {
|
|
21
|
+
const base_http_middleware_1 = require("../../core/middleware/base-http.middleware");
|
|
22
|
+
let CloudronMiddleware = class CloudronMiddleware extends base_http_middleware_1.BaseHttpMiddleware {
|
|
30
23
|
constructor(logger, externalSummaryService, toolsService, loggerDebug) {
|
|
31
|
-
|
|
24
|
+
super(logger, loggerDebug, toolsService);
|
|
32
25
|
this.externalSummaryService = externalSummaryService;
|
|
33
|
-
this.toolsService = toolsService;
|
|
34
|
-
this.loggerDebug = loggerDebug;
|
|
35
|
-
this.appLogConfig = app_log_config_service_1.AppLogConfigService.getConfig();
|
|
36
26
|
}
|
|
37
|
-
|
|
38
|
-
const startTime =
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this.loggerDebug.debug(`res.end: `, args);
|
|
53
|
-
if (args[0]) {
|
|
54
|
-
chunks.push(Buffer.from(args[0]));
|
|
55
|
-
}
|
|
56
|
-
this.loggerDebug.debug(`chunks: `, chunks);
|
|
57
|
-
buffer = Buffer.concat(chunks).toString('utf8');
|
|
58
|
-
this.loggerDebug.debug(`buffer: `, buffer);
|
|
59
|
-
return originalEnd.apply(res, args);
|
|
60
|
-
};
|
|
61
|
-
res.on('finish', () => {
|
|
62
|
-
this.loggerDebug.debug(`res.finish: `, res.statusCode);
|
|
63
|
-
const transactionReference = (0, global_function_1.GetTransactionReference)();
|
|
64
|
-
const endTime = microtime_1.default.now();
|
|
65
|
-
const activityData = {
|
|
66
|
-
startTime,
|
|
67
|
-
endTime,
|
|
68
|
-
};
|
|
69
|
-
const requestFormat = (0, aicf_dto_1.MapRequestFormat)(req, req.headers.host);
|
|
70
|
-
const respLogs = transactionReference.responseObject || buffer;
|
|
71
|
-
let resultFormat;
|
|
72
|
-
if (this.appLogConfig.structureResponse) {
|
|
73
|
-
resultFormat = (0, tools_2.serializedFormatCommonOperationStatus)(respLogs, this.appLogConfig.structureResponse);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
resultFormat = this.toolsService.mapResultCodeResponse(respLogs, res.statusCode);
|
|
77
|
-
}
|
|
78
|
-
if (transactionReference.maskingLogData) {
|
|
79
|
-
requestFormat.payload = (0, tools_1.maskingData)(requestFormat.payload, transactionReference.specificKeyMasking);
|
|
80
|
-
resultFormat.payload = (0, tools_1.maskingData)(resultFormat.payload, transactionReference.specificKeyMasking);
|
|
81
|
-
}
|
|
82
|
-
const summary = new cauldron_dto_1.CSummaryLog(requestFormat, resultFormat, activityData);
|
|
83
|
-
summary.custom = this.externalSummaryService.getCustomSummaryCloudron();
|
|
84
|
-
this.logger.log(summary);
|
|
85
|
-
this.logger.log(new cauldron_dto_1.CDetailLog(requestFormat, respLogs, activityData));
|
|
86
|
-
});
|
|
87
|
-
(0, global_function_1.SetTransactionReference)({
|
|
88
|
-
transactionId: req.headers['x-ais-orderref'],
|
|
89
|
-
sessionId: sessionId,
|
|
90
|
-
action: aicf_dto_1.ACTION_TYPE.HTTP,
|
|
91
|
-
originSession: req.headers['x-origin-session'],
|
|
92
|
-
serviceStartTime: startTime,
|
|
93
|
-
}, () => {
|
|
94
|
-
return summaryEndpoint_info_1.summaryInfoLocal.run([], () => next());
|
|
95
|
-
});
|
|
27
|
+
onFinish(ctx) {
|
|
28
|
+
const { startTime, endTime, transactionReference, requestFormat, resultFormat, respData, } = ctx;
|
|
29
|
+
const activityData = { startTime, endTime };
|
|
30
|
+
let maskedRespLogs = respData;
|
|
31
|
+
if (transactionReference.maskingLogData) {
|
|
32
|
+
maskedRespLogs = (0, tools_1.maskingData)(respData, transactionReference.specificKeyMasking);
|
|
33
|
+
}
|
|
34
|
+
const summary = new cauldron_dto_1.CSummaryLog(requestFormat, resultFormat, activityData);
|
|
35
|
+
summary.custom =
|
|
36
|
+
this.externalSummaryService.getCustomSummaryCloudron();
|
|
37
|
+
this.logger.log(summary);
|
|
38
|
+
this.logger.log(new cauldron_dto_1.CDetailLog(requestFormat, maskedRespLogs, activityData));
|
|
39
|
+
}
|
|
40
|
+
wrapNext(next) {
|
|
41
|
+
summaryEndpoint_info_1.summaryInfoLocal.run([], () => next());
|
|
96
42
|
}
|
|
97
43
|
};
|
|
98
44
|
exports.CloudronMiddleware = CloudronMiddleware;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudron.middleware.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/middleware/cloudron.middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cloudron.middleware.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/middleware/cloudron.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yDAA2D;AAC3D,6FAAuF;AAEvF,gDAAmD;AACnD,uDAA6E;AAC7E,6FAAsF;AACtF,wEAAoE;AACpE,4GAAsG;AACtG,qFAGoD;AAI7C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,yCAAkB;IACxD,YACE,MAA2B,EACV,sBAAkD,EACnE,YAA0B,EA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
import { TransactionReferenceInfo } from '../functions/global-function';
|
|
4
|
+
import { MapRequestFormat } from '../../aicf/dtos/aicf.dto';
|
|
5
|
+
import { CustomLoggerService } from '../../logger.service';
|
|
6
|
+
import { LoggerDebugLibService } from '../../../common/service/logger-debug/logger-debug-lib.service';
|
|
7
|
+
import { ToolsService } from '../../../common/helper/tools.service';
|
|
8
|
+
import { AppLogConfig } from '../../../config/configurations';
|
|
9
|
+
import { CommonOperationStatus } from '../../../common/dto/result.dto';
|
|
10
|
+
export interface FinishContext {
|
|
11
|
+
req: Request;
|
|
12
|
+
res: Response;
|
|
13
|
+
startTime: number;
|
|
14
|
+
endTime: number;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
buffer: string;
|
|
17
|
+
transactionReference: TransactionReferenceInfo;
|
|
18
|
+
requestFormat: ReturnType<typeof MapRequestFormat>;
|
|
19
|
+
resultFormat: Partial<CommonOperationStatus>;
|
|
20
|
+
respData: any;
|
|
21
|
+
}
|
|
22
|
+
export declare abstract class BaseHttpMiddleware implements NestMiddleware {
|
|
23
|
+
protected readonly logger: CustomLoggerService;
|
|
24
|
+
protected readonly loggerDebug: LoggerDebugLibService;
|
|
25
|
+
protected readonly toolsService: ToolsService;
|
|
26
|
+
protected readonly appLogConfig: AppLogConfig;
|
|
27
|
+
protected constructor(logger: CustomLoggerService, loggerDebug: LoggerDebugLibService, toolsService: ToolsService);
|
|
28
|
+
use(req: Request, res: Response, next: NextFunction): void;
|
|
29
|
+
protected resolveResultFormat(respData: any, statusCode: number): Partial<CommonOperationStatus>;
|
|
30
|
+
protected safeJsonParse(raw: string, fallback: any): any;
|
|
31
|
+
protected abstract onFinish(ctx: FinishContext): void;
|
|
32
|
+
protected wrapNext(next: NextFunction): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BaseHttpMiddleware = void 0;
|
|
7
|
+
const microtime_1 = __importDefault(require("microtime"));
|
|
8
|
+
const tools_1 = require("../../../utils/tools");
|
|
9
|
+
const global_function_1 = require("../functions/global-function");
|
|
10
|
+
const aicf_dto_1 = require("../../aicf/dtos/aicf.dto");
|
|
11
|
+
const app_log_config_service_1 = require("../../../config/app-log-config.service");
|
|
12
|
+
const tools_2 = require("../../../common/helper/tools");
|
|
13
|
+
class BaseHttpMiddleware {
|
|
14
|
+
constructor(logger, loggerDebug, toolsService) {
|
|
15
|
+
this.logger = logger;
|
|
16
|
+
this.loggerDebug = loggerDebug;
|
|
17
|
+
this.toolsService = toolsService;
|
|
18
|
+
this.appLogConfig = app_log_config_service_1.AppLogConfigService.getConfig();
|
|
19
|
+
}
|
|
20
|
+
use(req, res, next) {
|
|
21
|
+
const startTime = microtime_1.default.now();
|
|
22
|
+
const sessionId = startTime.toString();
|
|
23
|
+
const chunks = [];
|
|
24
|
+
const originalWrite = res.write;
|
|
25
|
+
const originalEnd = res.end;
|
|
26
|
+
let buffer = '';
|
|
27
|
+
let endTime;
|
|
28
|
+
req.headers['x-ais-orderref'] ??= (0, tools_1.generateTID)();
|
|
29
|
+
res.write = (...args) => {
|
|
30
|
+
chunks.push(Buffer.from(args[0]));
|
|
31
|
+
return originalWrite.apply(res, args);
|
|
32
|
+
};
|
|
33
|
+
res.end = (...args) => {
|
|
34
|
+
endTime = microtime_1.default.now();
|
|
35
|
+
if (args[0]) {
|
|
36
|
+
chunks.push(Buffer.from(args[0]));
|
|
37
|
+
}
|
|
38
|
+
buffer = Buffer.concat(chunks).toString('utf8');
|
|
39
|
+
this.loggerDebug.debug('buffer: ', buffer);
|
|
40
|
+
return originalEnd.apply(res, args);
|
|
41
|
+
};
|
|
42
|
+
res.on('finish', () => {
|
|
43
|
+
try {
|
|
44
|
+
const transactionReference = (0, global_function_1.GetTransactionReference)();
|
|
45
|
+
const requestFormat = (0, aicf_dto_1.MapRequestFormat)(req, req.headers.host);
|
|
46
|
+
if (transactionReference.requestObject?.body) {
|
|
47
|
+
requestFormat.payload = transactionReference.requestObject.body;
|
|
48
|
+
}
|
|
49
|
+
const rawResp = transactionReference.responseObject || buffer;
|
|
50
|
+
const respData = typeof rawResp === 'string'
|
|
51
|
+
? this.safeJsonParse(rawResp, rawResp)
|
|
52
|
+
: rawResp;
|
|
53
|
+
const resultFormat = this.resolveResultFormat(respData, res.statusCode);
|
|
54
|
+
if (transactionReference.maskingLogData) {
|
|
55
|
+
requestFormat.payload = (0, tools_1.maskingData)(requestFormat.payload, transactionReference.specificKeyMasking);
|
|
56
|
+
}
|
|
57
|
+
this.onFinish({
|
|
58
|
+
req,
|
|
59
|
+
res,
|
|
60
|
+
startTime,
|
|
61
|
+
endTime,
|
|
62
|
+
sessionId,
|
|
63
|
+
buffer,
|
|
64
|
+
transactionReference,
|
|
65
|
+
requestFormat,
|
|
66
|
+
resultFormat,
|
|
67
|
+
respData,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
this.loggerDebug.debug('Error in http middleware finish handler: ', err);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
res.on('error', (err) => {
|
|
75
|
+
this.loggerDebug.debug('Error in http middleware: ', err);
|
|
76
|
+
});
|
|
77
|
+
(0, global_function_1.SetTransactionReference)({
|
|
78
|
+
transactionId: req.headers['x-ais-orderref'],
|
|
79
|
+
sessionId,
|
|
80
|
+
action: aicf_dto_1.ACTION_TYPE.HTTP,
|
|
81
|
+
originSession: req.headers['x-origin-session'],
|
|
82
|
+
serviceStartTime: startTime,
|
|
83
|
+
}, () => this.wrapNext(next));
|
|
84
|
+
}
|
|
85
|
+
resolveResultFormat(respData, statusCode) {
|
|
86
|
+
if (this.appLogConfig.structureResponse) {
|
|
87
|
+
return (0, tools_2.serializedFormatCommonOperationStatus)(respData, this.appLogConfig.structureResponse);
|
|
88
|
+
}
|
|
89
|
+
return this.toolsService.mapResultCodeResponse(respData, statusCode);
|
|
90
|
+
}
|
|
91
|
+
safeJsonParse(raw, fallback) {
|
|
92
|
+
try {
|
|
93
|
+
return raw.length > 0 ? JSON.parse(raw) : fallback;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return fallback;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
wrapNext(next) {
|
|
100
|
+
next();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.BaseHttpMiddleware = BaseHttpMiddleware;
|
|
104
|
+
//# sourceMappingURL=base-http.middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-http.middleware.js","sourceRoot":"","sources":["../../../../src/logger/core/middleware/base-http.middleware.ts"],"names":[],"mappings":";;;;;;AACA,0DAAkC;AAElC,gDAAgE;AAChE,kEAIsC;AACtC,uDAAyE;AAKzE,mFAA6E;AAC7E,wDAAqF;AAqCrF,MAAsB,kBAAkB;IAGtC,YACqB,MAA2B,EAC3B,WAAkC,EAClC,YAA0B;QAF1B,WAAM,GAAN,MAAM,CAAqB;QAC3B,gBAAW,GAAX,WAAW,CAAuB;QAClC,iBAAY,GAAZ,YAAY,CAAc;QAE7C,IAAI,CAAC,YAAY,GAAG,4CAAmB,CAAC,SAAS,EAAE,CAAC;IACtD,CAAC;IAED,GAAG,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;QACjD,MAAM,SAAS,GAAG,mBAAS,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC;QAChC,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CAAC;QAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,OAAe,CAAC;QAEpB,GAAG,CAA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C;IAQS,mBAAmB,CAC3B,QAAa,EACb,UAAkB;QAElB,IAAI,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC;YACxC,OAAO,IAAA,6CAAqC,EAC1C,QAAQ,EACR,IAAI,CAAC,YAAY,CAAC,iBAAiB,CACpC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;IAKS,aAAa,CAAC,GAAW,EAAE,QAAa;QAChD,IAAI,CAAC;YACH,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAQS,QAAQ,CAAC,IAAkB;QACnC,IAAI,EAAE,CAAC;IACT,CAAC;CACF;AAnJD,gDAmJC"}
|
|
@@ -40,7 +40,7 @@ let HTTPLogsMiddleware = class HTTPLogsMiddleware {
|
|
|
40
40
|
this.coreMiddleware = new esb_middleware_1.EsbMiddleware(this.logger, this.contextService);
|
|
41
41
|
break;
|
|
42
42
|
default:
|
|
43
|
-
|
|
43
|
+
throw new Error(`[HTTPLogsMiddleware] Unsupported FORMAT_TYPE: "${this.format}". Expected one of: aicf, cloudron, esb.`);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
use(req, res, next) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-logs-middleware.service.js","sourceRoot":"","sources":["../../../../src/logger/core/middleware/http-logs-middleware.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4D;AAC5D,yDAA2D;AAC3D,oFAAgF;AAChF,mFAA6E;AAC7E,mEAA6D;AAE7D,2EAAuE;AACvE,uFAAmF;AACnF,yGAAmG;AACnG,wEAAoE;AACpE,wEAAoE;AACpE,4GAAsG;AAG/F,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAG7B,YACmB,MAA2B,EAC3B,cAA8B,EAC9B,sBAAkD,EAClD,YAA0B,EAC1B,WAAkC;QAJlC,WAAM,GAAN,MAAM,CAAqB;QAC3B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,2BAAsB,GAAtB,sBAAsB,CAA4B;QAClD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,gBAAW,GAAX,WAAW,CAAuB;QAEnD,IAAI,CAAC,MAAM,GAAG,4CAAmB,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;QACrD,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,4BAAW,CAAC,IAAI;gBACnB,IAAI,CAAC,cAAc,GAAG,IAAI,gCAAc,CACtC,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,YAAY,CAClB,CAAC;gBACF,MAAM;YACR,KAAK,4BAAW,CAAC,QAAQ;gBACvB,IAAI,CAAC,cAAc,GAAG,IAAI,wCAAkB,CAC1C,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,sBAAsB,EAC3B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,WAAW,CACjB,CAAC;gBACF,MAAM;YACR,KAAK,4BAAW,CAAC,GAAG;gBAClB,IAAI,CAAC,cAAc,GAAG,IAAI,8BAAa,CACrC,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,cAAc,CACpB,CAAC;gBACF,MAAM;YACR;gBACE,MAAM;
|
|
1
|
+
{"version":3,"file":"http-logs-middleware.service.js","sourceRoot":"","sources":["../../../../src/logger/core/middleware/http-logs-middleware.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4D;AAC5D,yDAA2D;AAC3D,oFAAgF;AAChF,mFAA6E;AAC7E,mEAA6D;AAE7D,2EAAuE;AACvE,uFAAmF;AACnF,yGAAmG;AACnG,wEAAoE;AACpE,wEAAoE;AAC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QAC1C,CAAC,EAAE,IAAI,GAAG,EAAe,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AA5CY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAKgB,oCAAmB;QACX,gCAAc;QACN,0DAA0B;QACpC,4BAAY;QACb,gDAAqB;GAR1C,kBAAkB,CA4C9B"}
|
|
@@ -27,7 +27,7 @@ exports.LoggerModule = LoggerModule;
|
|
|
27
27
|
exports.LoggerModule = LoggerModule = __decorate([
|
|
28
28
|
(0, common_1.Global)(),
|
|
29
29
|
(0, common_1.Module)({
|
|
30
|
-
imports: [
|
|
30
|
+
imports: [internal_logs_info_module_1.InternalLogsInfoModule],
|
|
31
31
|
providers: [
|
|
32
32
|
logger_service_1.CustomLoggerService,
|
|
33
33
|
{
|
|
@@ -40,7 +40,6 @@ exports.LoggerModule = LoggerModule = __decorate([
|
|
|
40
40
|
cloudron_interceptor_1.CloudronInterceptor,
|
|
41
41
|
esb_interceptor_1.EsbInterceptor,
|
|
42
42
|
external_logs_esb_service_1.ExternalLogsEsbService,
|
|
43
|
-
cloudron_details_logs_service_1.CloudronDetailsLogsService,
|
|
44
43
|
aicf_interceptor_1.AICFInterceptor,
|
|
45
44
|
aicf_endpoint_service_1.AicfEndpointService,
|
|
46
45
|
http_logs_middleware_service_1.HTTPLogsMiddleware,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../src/logger/logger.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,qDAAuD;AACvD,6CAAgD;AAChD,qGAA+F;AAC/F,qGAA+F;AAC/F,mFAA6E;AAC7E,qFAAgF;AAChF,uFAAmF;AACnF,wEAAoE;AACpE,wFAAkF;AAClF,2EAAuE;AACvE,iFAA4E;AAC5E,uEAAmE;AACnE,iGAAoF;
|
|
1
|
+
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../src/logger/logger.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,qDAAuD;AACvD,6CAAgD;AAChD,qGAA+F;AAC/F,qGAA+F;AAC/F,mFAA6E;AAC7E,qFAAgF;AAChF,uFAAmF;AACnF,wEAAoE;AACpE,wFAAkF;AAClF,2EAAuE;AACvE,iFAA4E;AAC5E,uEAAmE;AACnE,iGAAoF;AA+B7E,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IA7BxB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,kDAAsB,CAAC;QACjC,SAAS,EAAE;YACT,oCAAmB;YACnB;gBACE,OAAO,EAAE,+BAAiB;gBAC1B,QAAQ,EAAE,IAAI,+BAAiB,EAAE;aAClC;YACD,0DAA0B;YAC1B,0DAA0B;YAC1B,2CAAmB;YACnB,0CAAmB;YACnB,gCAAc;YACd,kDAAsB;YACtB,kCAAe;YACf,2CAAmB;YACnB,iDAAkB;YAClB,gCAAc;SACf;QACD,OAAO,EAAE;YACP,oCAAmB;YACnB,+BAAiB;YACjB,2CAAmB;YACnB,0DAA0B;YAC1B,kDAAsB;YACtB,iDAAkB;SACnB;KACF,CAAC;GACW,YAAY,CAAG"}
|