@icd-iot-aicf/nestjs-logger 0.0.20 → 0.0.21
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/logger/aicf/middleware/aicf.middleware.js +0 -1
- package/dist/logger/aicf/middleware/aicf.middleware.js.map +1 -1
- package/dist/logger/cloudron/middleware/cloudron.middleware.js +0 -1
- package/dist/logger/cloudron/middleware/cloudron.middleware.js.map +1 -1
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.d.ts +0 -2
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js +1 -6
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js.map +1 -1
- package/dist/logger/core/decorators/customDecorators.d.ts +0 -6
- package/dist/logger/core/decorators/customDecorators.js +3 -42
- package/dist/logger/core/decorators/customDecorators.js.map +1 -1
- package/dist/logger/core/guard/logger.guard.d.ts +8 -0
- package/dist/logger/core/guard/logger.guard.js +33 -0
- package/dist/logger/core/guard/logger.guard.js.map +1 -0
- package/dist/logger/logger.module.js +6 -0
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,6 @@ let AicfMiddleware = class AicfMiddleware {
|
|
|
30
30
|
const originalWrite = res.write;
|
|
31
31
|
const originalEnd = res.end;
|
|
32
32
|
req.headers['x-ais-orderref'] ??= (0, tools_1.generateTID)();
|
|
33
|
-
res.header('x-ais-orderref', req.headers['x-ais-orderref']);
|
|
34
33
|
res.write = (...args) => {
|
|
35
34
|
chunks.push(Buffer.from(args[0]));
|
|
36
35
|
return originalWrite.apply(res, args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aicf.middleware.js","sourceRoot":"","sources":["../../../../src/logger/aicf/middleware/aicf.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,0DAAkC;AAClC,+CAO0B;AAC1B,yDAA2D;AAC3D,g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D7C,cAAc,CAiF1B"}
|
|
@@ -53,7 +53,6 @@ let CloudronMiddleware = class CloudronMiddleware {
|
|
|
53
53
|
summary.custom = this.externalSummaryService.getCustomSummaryCloudron();
|
|
54
54
|
this.logger.log(summary);
|
|
55
55
|
this.logger.log(new cauldron_dto_1.CDetailLog(req, buffer, activityData));
|
|
56
|
-
this.externalSummaryService.clearCustomSummary(sessionId);
|
|
57
56
|
});
|
|
58
57
|
return originalEnd.apply(res, args);
|
|
59
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudron.middleware.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/middleware/cloudron.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,yDAA2D;AAC3D,6FAAuF;AAEvF,gDAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"cloudron.middleware.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/middleware/cloudron.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,yDAA2D;AAC3D,6FAAuF;AAEvF,gDAAmD;AACnD,uDAA6E;AAC7E,0DAAkC;AAClC,0EAA+E;AAC/E,uDAAuD;AACvD,6FAAsF;AAG/E,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,MAA2B,EACpC,sBAAkD;QADzC,WAAM,GAAN,MAAM,CAAqB;QACpC,2BAAsB,GAAtB,sBAAsB,CAA4B;IACzD,CAAC;IAEJ,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,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAA,mBAAW,GAAE,CAAC;QAEhD,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,aAAa,GAAG,GA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AAI,CAAC,CAAC;QACtC,CAAC,CAAC;QAEF,IAAA,yCAAuB,EACrB;YACE,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAW;YACtD,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,sBAAW,CAAC,IAAI;YACxB,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAW;YACxD,gBAAgB,EAAE,SAAS;SAC5B,EACD,GAAG,EAAE;YACH,OAAO,uCAAgB,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC,CACF,CAAC;IACJ,CAAC;CACF,CAAA;AAxDY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAGgB,oCAAmB;QACZ,0DAA0B;GAHjD,kBAAkB,CAwD9B"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { EndpointDetail } from '../dtos/cauldron.dto';
|
|
2
2
|
export declare class CloudronSummaryLogsService {
|
|
3
|
-
globalSummary: Map<string, EndpointDetail[]>;
|
|
4
3
|
constructor();
|
|
5
4
|
getCustomSummaryCloudron(): any;
|
|
6
|
-
clearCustomSummary(sessionId: string): any;
|
|
7
5
|
pushEndpointSummary(sessionId: string, logDetail: EndpointDetail): any;
|
|
8
6
|
}
|
|
@@ -13,9 +13,7 @@ exports.CloudronSummaryLogsService = void 0;
|
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const summaryEndpoint_info_1 = require("../../../common/async-storage/summaryEndpoint-info");
|
|
15
15
|
let CloudronSummaryLogsService = class CloudronSummaryLogsService {
|
|
16
|
-
constructor() {
|
|
17
|
-
this.globalSummary = new Map();
|
|
18
|
-
}
|
|
16
|
+
constructor() { }
|
|
19
17
|
getCustomSummaryCloudron() {
|
|
20
18
|
const currentSummary = summaryEndpoint_info_1.summaryInfoLocal.getStore();
|
|
21
19
|
if (currentSummary.length) {
|
|
@@ -33,9 +31,6 @@ let CloudronSummaryLogsService = class CloudronSummaryLogsService {
|
|
|
33
31
|
}
|
|
34
32
|
return null;
|
|
35
33
|
}
|
|
36
|
-
clearCustomSummary(sessionId) {
|
|
37
|
-
delete this.globalSummary[sessionId];
|
|
38
|
-
}
|
|
39
34
|
pushEndpointSummary(sessionId, logDetail) {
|
|
40
35
|
(0, summaryEndpoint_info_1.pushSummaryInfo)(logDetail);
|
|
41
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudron-summary-logs.service.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/services/cloudron-summary-logs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"cloudron-summary-logs.service.js","sourceRoot":"","sources":["../../../../src/logger/cloudron/services/cloudron-summary-logs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,6FAG4D;AAGrD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,gBAAe,CAAC;IAChB,wBAAwB;QACtB,MAAM,cAAc,GAAqB,uCAAgB,CAAC,QAAQ,EAAE,CAAC;QACrE,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO;gBACL,eAAe,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;oBACvD,OAAO;wBACL,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE;wBAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;wBACpC,WAAW,EAAE,SAAS,CAAC,WAAW;wBAClC,WAAW,EAAE,SAAS,CAAC,WAAW;wBAClC,cAAc,EAAE,SAAS,CAAC,cAAc;qBACzC,CAAC;gBACJ,CAAC,CAAC;aACH,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mBAAmB,CAAC,SAAiB,EAAE,SAAyB;QAE9D,IAAA,sCAAe,EAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AAxBY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;;GACA,0BAA0B,CAwBtC"}
|
|
@@ -9,14 +9,8 @@ export declare class CommandInfoInterceptor implements NestInterceptor {
|
|
|
9
9
|
constructor(commandName: string, description?: string);
|
|
10
10
|
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
11
11
|
}
|
|
12
|
-
export declare class RecordNameInterceptor implements NestInterceptor {
|
|
13
|
-
private commandName;
|
|
14
|
-
constructor(commandName: string);
|
|
15
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
16
|
-
}
|
|
17
12
|
export declare function EXTCMDName(apiCustomInfo?: APICustomInfo): MethodDecorator;
|
|
18
13
|
export declare function NodeName(nodeName: string): ClassDecorator;
|
|
19
|
-
export declare function RecordNameMethod(recordName: string): MethodDecorator;
|
|
20
14
|
interface ICommandInfo {
|
|
21
15
|
CommandName: string;
|
|
22
16
|
Description?: string;
|
|
@@ -9,23 +9,21 @@ 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
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.CommandInfoInterceptor = void 0;
|
|
13
13
|
exports.RecordName = RecordName;
|
|
14
14
|
exports.CommandInfo = CommandInfo;
|
|
15
15
|
exports.EXTCMDName = EXTCMDName;
|
|
16
16
|
exports.NodeName = NodeName;
|
|
17
|
-
exports.RecordNameMethod = RecordNameMethod;
|
|
18
17
|
const common_1 = require("@nestjs/common");
|
|
19
18
|
const common_2 = require("@nestjs/common");
|
|
20
19
|
const operators_1 = require("rxjs/operators");
|
|
21
|
-
const tracnsaction_info_1 = require("../../../common/async-storage/tracnsaction-info");
|
|
22
20
|
const tools_1 = require("../../../utils/tools");
|
|
23
21
|
const global_function_1 = require("../functions/global-function");
|
|
24
22
|
function RecordName(command) {
|
|
25
|
-
return (0, common_2.applyDecorators)((0, common_2.SetMetadata)('
|
|
23
|
+
return (0, common_2.applyDecorators)((0, common_2.SetMetadata)('recordName', command));
|
|
26
24
|
}
|
|
27
25
|
function CommandInfo(commandInfo) {
|
|
28
|
-
return (0, common_2.applyDecorators)((0, common_2.SetMetadata)('
|
|
26
|
+
return (0, common_2.applyDecorators)((0, common_2.SetMetadata)('recordName', commandInfo.CommandName), (0, common_2.SetMetadata)('description', commandInfo.Description), (0, common_2.UseInterceptors)(new CommandInfoInterceptor(commandInfo.CommandName, commandInfo.Description)));
|
|
29
27
|
}
|
|
30
28
|
let CommandInfoInterceptor = class CommandInfoInterceptor {
|
|
31
29
|
constructor(commandName, description) {
|
|
@@ -45,27 +43,6 @@ exports.CommandInfoInterceptor = CommandInfoInterceptor = __decorate([
|
|
|
45
43
|
(0, common_1.Injectable)(),
|
|
46
44
|
__metadata("design:paramtypes", [String, String])
|
|
47
45
|
], CommandInfoInterceptor);
|
|
48
|
-
let RecordNameInterceptor = class RecordNameInterceptor {
|
|
49
|
-
constructor(commandName) {
|
|
50
|
-
this.commandName = commandName;
|
|
51
|
-
}
|
|
52
|
-
intercept(context, next) {
|
|
53
|
-
const store = tracnsaction_info_1.transactionInfoLocalStorage.getStore();
|
|
54
|
-
if (!store) {
|
|
55
|
-
console.warn('⚠️ transactionReferent is not set!');
|
|
56
|
-
return next.handle().pipe((0, operators_1.tap)(() => { }));
|
|
57
|
-
}
|
|
58
|
-
store.recordName = this.commandName;
|
|
59
|
-
return tracnsaction_info_1.transactionInfoLocalStorage.run(store, () => {
|
|
60
|
-
return next.handle().pipe((0, operators_1.tap)(() => { }));
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
exports.RecordNameInterceptor = RecordNameInterceptor;
|
|
65
|
-
exports.RecordNameInterceptor = RecordNameInterceptor = __decorate([
|
|
66
|
-
(0, common_1.Injectable)(),
|
|
67
|
-
__metadata("design:paramtypes", [String])
|
|
68
|
-
], RecordNameInterceptor);
|
|
69
46
|
function EXTCMDName(apiCustomInfo = {}) {
|
|
70
47
|
return (target, propertyKey, descriptor) => {
|
|
71
48
|
const originalMethod = descriptor.value;
|
|
@@ -94,20 +71,4 @@ function NodeName(nodeName) {
|
|
|
94
71
|
target.prototype['nodeName'] = `${nodeName}`;
|
|
95
72
|
};
|
|
96
73
|
}
|
|
97
|
-
function RecordNameMethod(recordName) {
|
|
98
|
-
return (target, propertyKey, descriptor) => {
|
|
99
|
-
const originalMethod = descriptor.value;
|
|
100
|
-
descriptor.value = function (...args) {
|
|
101
|
-
const store = tracnsaction_info_1.transactionInfoLocalStorage.getStore();
|
|
102
|
-
if (!store) {
|
|
103
|
-
console.warn('⚠️ transactionReferent is not set!');
|
|
104
|
-
return originalMethod.apply(this, args);
|
|
105
|
-
}
|
|
106
|
-
store.recordName = recordName;
|
|
107
|
-
return tracnsaction_info_1.transactionInfoLocalStorage.run(store, async () => {
|
|
108
|
-
return await originalMethod.apply(this, args);
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
74
|
//# sourceMappingURL=customDecorators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDecorators.js","sourceRoot":"","sources":["../../../../src/logger/core/decorators/customDecorators.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"customDecorators.js","sourceRoot":"","sources":["../../../../src/logger/core/decorators/customDecorators.ts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,gCAIC;AAED,kCAWC;AAuFD,gCA0BC;AAED,4BAIC;AAzJD,2CAKwB;AACxB,2CAA+E;AAE/E,8CAAqC;AACrC,gDAA4D;AAE5D,kEAGsC;AAGtC,SAAgB,UAAU,CAAC,OAAe;IACxC,OAAO,IAAA,wBAAe,EACpB,IAAA,oBAAW,EA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Aa,EAAE,CAAC;gBACvB,IAAI,CAAC,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC;gBAC/C,IAAI,CAAC,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;YACrD,CAAC;YACD,IAAI,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,cAAc,IAAI,aAAa,CAAC,OAAO,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;YAElE,MAAM,YAAY,GAA4B;gBAC5C,UAAU,EAAE,cAAc;gBAC1B,YAAY,EAAE,YAAY;gBAC1B,MAAM,EAAE,aAAa,CAAC,MAAM;gBAC5B,SAAS,EAAE,aAAa,CAAC,SAAS;aACnC,CAAC;YACF,OAAO,IAAA,4CAA0B,EAAC,YAAY,EAAE,KAAK,IAAI,EAAE;gBACzD,OAAO,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QAIL,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,QAAQ,CAAC,QAAgB;IACvC,OAAO,CAAC,MAAgB,EAAE,EAAE;QAC1B,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,GAAG,QAAQ,EAAE,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Reflector } from '@nestjs/core';
|
|
4
|
+
export declare class LoggerGuard implements CanActivate {
|
|
5
|
+
private readonly reflector;
|
|
6
|
+
constructor(reflector: Reflector);
|
|
7
|
+
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LoggerGuard = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@nestjs/core");
|
|
15
|
+
const tracnsaction_info_1 = require("../../../common/async-storage/tracnsaction-info");
|
|
16
|
+
let LoggerGuard = class LoggerGuard {
|
|
17
|
+
constructor(reflector) {
|
|
18
|
+
this.reflector = reflector;
|
|
19
|
+
}
|
|
20
|
+
canActivate(context) {
|
|
21
|
+
const store = tracnsaction_info_1.transactionInfoLocalStorage.getStore();
|
|
22
|
+
store.recordName = this.reflector.get('recordName', context.getHandler());
|
|
23
|
+
return tracnsaction_info_1.transactionInfoLocalStorage.run(store, () => {
|
|
24
|
+
return true;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.LoggerGuard = LoggerGuard;
|
|
29
|
+
exports.LoggerGuard = LoggerGuard = __decorate([
|
|
30
|
+
(0, common_1.Injectable)(),
|
|
31
|
+
__metadata("design:paramtypes", [core_1.Reflector])
|
|
32
|
+
], LoggerGuard);
|
|
33
|
+
//# sourceMappingURL=logger.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.guard.js","sourceRoot":"","sources":["../../../../src/logger/core/guard/logger.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAE3E,uCAAyC;AACzC,uFAA8F;AAGvF,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IACrD,WAAW,CACT,OAAyB;QAEzB,MAAM,KAAK,GAAG,+CAA2B,CAAC,QAAQ,EAAE,CAAC;QACrD,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAC1E,OAAO,+CAA2B,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE;YACjD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAXY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAE6B,gBAAS;GADtC,WAAW,CAWvB"}
|
|
@@ -21,6 +21,8 @@ const aicf_interceptor_1 = require("./aicf/interceptors/aicf.interceptor");
|
|
|
21
21
|
const aicf_endpoint_service_1 = require("./aicf/services/aicf-endpoint.service");
|
|
22
22
|
const aicf_middleware_1 = require("./aicf/middleware/aicf.middleware");
|
|
23
23
|
const http_logs_middleware_service_1 = require("./core/middleware/http-logs-middleware.service");
|
|
24
|
+
const core_1 = require("@nestjs/core");
|
|
25
|
+
const logger_guard_1 = require("./core/guard/logger.guard");
|
|
24
26
|
let LoggerModule = class LoggerModule {
|
|
25
27
|
};
|
|
26
28
|
exports.LoggerModule = LoggerModule;
|
|
@@ -44,6 +46,10 @@ exports.LoggerModule = LoggerModule = __decorate([
|
|
|
44
46
|
aicf_endpoint_service_1.AicfEndpointService,
|
|
45
47
|
http_logs_middleware_service_1.HTTPLogsMiddleware,
|
|
46
48
|
aicf_middleware_1.AicfMiddleware,
|
|
49
|
+
{
|
|
50
|
+
provide: core_1.APP_GUARD,
|
|
51
|
+
useValue: logger_guard_1.LoggerGuard,
|
|
52
|
+
},
|
|
47
53
|
],
|
|
48
54
|
exports: [
|
|
49
55
|
logger_service_1.CustomLoggerService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../src/logger/logger.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,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,2CAAwC;AACxC,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;AACpF,uCAAyC;AACzC,4DAAwD;AAmCjD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAjCxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,kDAAsB,CAAC;QAC/C,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,0DAA0B;YAC1B,kCAAe;YACf,2CAAmB;YACnB,iDAAkB;YAClB,gCAAc;YACd;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,0BAAW;aACtB;SACF;QACD,OAAO,EAAE;YACP,oCAAmB;YACnB,+BAAiB;YACjB,2CAAmB;YACnB,0DAA0B;YAC1B,kDAAsB;YACtB,iDAAkB;SACnB;KACF,CAAC;GACW,YAAY,CAAG"}
|