@icd-iot-aicf/nestjs-logger 0.0.1
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/.babelrc +20 -0
- package/.env +0 -0
- package/README.md +85 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +23 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +3 -0
- package/dist/app.service.js +20 -0
- package/dist/app.service.js.map +1 -0
- package/dist/common/async-storage/external-transaction-info.d.ts +2 -0
- package/dist/common/async-storage/external-transaction-info.js +6 -0
- package/dist/common/async-storage/external-transaction-info.js.map +1 -0
- package/dist/common/async-storage/tracnsaction-info.d.ts +2 -0
- package/dist/common/async-storage/tracnsaction-info.js +6 -0
- package/dist/common/async-storage/tracnsaction-info.js.map +1 -0
- package/dist/common/dto/result.dto.d.ts +12 -0
- package/dist/common/dto/result.dto.js +12 -0
- package/dist/common/dto/result.dto.js.map +1 -0
- package/dist/common/helper/error.d.ts +4 -0
- package/dist/common/helper/error.js +15 -0
- package/dist/common/helper/error.js.map +1 -0
- package/dist/common/helper/response.d.ts +3 -0
- package/dist/common/helper/response.js +161 -0
- package/dist/common/helper/response.js.map +1 -0
- package/dist/common/internal-logs-info.module.d.ts +3 -0
- package/dist/common/internal-logs-info.module.js +27 -0
- package/dist/common/internal-logs-info.module.js.map +1 -0
- package/dist/common/service/common/context.service.d.ts +6 -0
- package/dist/common/service/common/context.service.js +34 -0
- package/dist/common/service/common/context.service.js.map +1 -0
- package/dist/config/app-log-config.module.d.ts +5 -0
- package/dist/config/app-log-config.module.js +32 -0
- package/dist/config/app-log-config.module.js.map +1 -0
- package/dist/config/app-log-config.service.d.ts +6 -0
- package/dist/config/app-log-config.service.js +30 -0
- package/dist/config/app-log-config.service.js.map +1 -0
- package/dist/config/configurations.d.ts +12 -0
- package/dist/config/configurations.js +10 -0
- package/dist/config/configurations.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/aicf/dtos/aicf-manual.dto.d.ts +95 -0
- package/dist/logger/aicf/dtos/aicf-manual.dto.js +177 -0
- package/dist/logger/aicf/dtos/aicf-manual.dto.js.map +1 -0
- package/dist/logger/aicf/dtos/aicf.dto.d.ts +189 -0
- package/dist/logger/aicf/dtos/aicf.dto.js +167 -0
- package/dist/logger/aicf/dtos/aicf.dto.js.map +1 -0
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.d.ts +7 -0
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.js +78 -0
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.js.map +1 -0
- package/dist/logger/aicf/interceptors/aicf.interceptor.d.ts +9 -0
- package/dist/logger/aicf/interceptors/aicf.interceptor.js +39 -0
- package/dist/logger/aicf/interceptors/aicf.interceptor.js.map +1 -0
- package/dist/logger/aicf/middleware/aicf.middleware.d.ts +8 -0
- package/dist/logger/aicf/middleware/aicf.middleware.js +99 -0
- package/dist/logger/aicf/middleware/aicf.middleware.js.map +1 -0
- package/dist/logger/aicf/services/aicf-endpoint.service.d.ts +12 -0
- package/dist/logger/aicf/services/aicf-endpoint.service.js +117 -0
- package/dist/logger/aicf/services/aicf-endpoint.service.js.map +1 -0
- package/dist/logger/cloudron/decorators/cloudron.decorators.d.ts +0 -0
- package/dist/logger/cloudron/decorators/cloudron.decorators.js +1 -0
- package/dist/logger/cloudron/decorators/cloudron.decorators.js.map +1 -0
- package/dist/logger/cloudron/dtos/logger.cauldron.dto.d.ts +184 -0
- package/dist/logger/cloudron/dtos/logger.cauldron.dto.js +123 -0
- package/dist/logger/cloudron/dtos/logger.cauldron.dto.js.map +1 -0
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.d.ts +9 -0
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.js +39 -0
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.js.map +1 -0
- package/dist/logger/cloudron/middleware/cloudron.middleware.d.ts +10 -0
- package/dist/logger/cloudron/middleware/cloudron.middleware.js +78 -0
- package/dist/logger/cloudron/middleware/cloudron.middleware.js.map +1 -0
- package/dist/logger/cloudron/services/cloudron-details-logs.service.d.ts +13 -0
- package/dist/logger/cloudron/services/cloudron-details-logs.service.js +79 -0
- package/dist/logger/cloudron/services/cloudron-details-logs.service.js.map +1 -0
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.d.ts +8 -0
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js +47 -0
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js.map +1 -0
- package/dist/logger/core/database/hook-ingress.database.d.ts +8 -0
- package/dist/logger/core/database/hook-ingress.database.js +212 -0
- package/dist/logger/core/database/hook-ingress.database.js.map +1 -0
- package/dist/logger/core/decorators/customDecorators.d.ts +24 -0
- package/dist/logger/core/decorators/customDecorators.js +113 -0
- package/dist/logger/core/decorators/customDecorators.js.map +1 -0
- package/dist/logger/core/dtos/core.dto.d.ts +6 -0
- package/dist/logger/core/dtos/core.dto.js +3 -0
- package/dist/logger/core/dtos/core.dto.js.map +1 -0
- package/dist/logger/core/dtos/log-entry-class.d.ts +11 -0
- package/dist/logger/core/dtos/log-entry-class.js +15 -0
- package/dist/logger/core/dtos/log-entry-class.js.map +1 -0
- package/dist/logger/core/enum/enum.d.ts +51 -0
- package/dist/logger/core/enum/enum.js +217 -0
- package/dist/logger/core/enum/enum.js.map +1 -0
- package/dist/logger/core/functions/error-reponse.d.ts +2 -0
- package/dist/logger/core/functions/error-reponse.js +18 -0
- package/dist/logger/core/functions/error-reponse.js.map +1 -0
- package/dist/logger/core/functions/global-function.d.ts +24 -0
- package/dist/logger/core/functions/global-function.js +79 -0
- package/dist/logger/core/functions/global-function.js.map +1 -0
- package/dist/logger/core/interceptors/amqp.interceptor.d.ts +6 -0
- package/dist/logger/core/interceptors/amqp.interceptor.js +45 -0
- package/dist/logger/core/interceptors/amqp.interceptor.js.map +1 -0
- package/dist/logger/core/interceptors/core-logs.interceptor.d.ts +18 -0
- package/dist/logger/core/interceptors/core-logs.interceptor.js +73 -0
- package/dist/logger/core/interceptors/core-logs.interceptor.js.map +1 -0
- package/dist/logger/core/interceptors/http.interceptor.d.ts +5 -0
- package/dist/logger/core/interceptors/http.interceptor.js +28 -0
- package/dist/logger/core/interceptors/http.interceptor.js.map +1 -0
- package/dist/logger/core/interceptors/interceptors.d.ts +3 -0
- package/dist/logger/core/interceptors/interceptors.js +20 -0
- package/dist/logger/core/interceptors/interceptors.js.map +1 -0
- package/dist/logger/core/middleware/http-logs-middleware.service.d.ts +15 -0
- package/dist/logger/core/middleware/http-logs-middleware.service.js +55 -0
- package/dist/logger/core/middleware/http-logs-middleware.service.js.map +1 -0
- package/dist/logger/core/module/amqp/amqp.module.d.ts +2 -0
- package/dist/logger/core/module/amqp/amqp.module.js +43 -0
- package/dist/logger/core/module/amqp/amqp.module.js.map +1 -0
- package/dist/logger/core/services/summary-flush.service.d.ts +7 -0
- package/dist/logger/core/services/summary-flush.service.js +31 -0
- package/dist/logger/core/services/summary-flush.service.js.map +1 -0
- package/dist/logger/esb/dtos/logger.esb.dto.d.ts +136 -0
- package/dist/logger/esb/dtos/logger.esb.dto.js +99 -0
- package/dist/logger/esb/dtos/logger.esb.dto.js.map +1 -0
- package/dist/logger/esb/intercepters/esb.interceptor.d.ts +9 -0
- package/dist/logger/esb/intercepters/esb.interceptor.js +36 -0
- package/dist/logger/esb/intercepters/esb.interceptor.js.map +1 -0
- package/dist/logger/esb/middleware/esb.middleware.d.ts +10 -0
- package/dist/logger/esb/middleware/esb.middleware.js +64 -0
- package/dist/logger/esb/middleware/esb.middleware.js.map +1 -0
- package/dist/logger/esb/services/external-logs-esb.service.d.ts +10 -0
- package/dist/logger/esb/services/external-logs-esb.service.js +98 -0
- package/dist/logger/esb/services/external-logs-esb.service.js.map +1 -0
- package/dist/logger/logger.middleware.d.ts +0 -0
- package/dist/logger/logger.middleware.js +1 -0
- package/dist/logger/logger.middleware.js.map +1 -0
- package/dist/logger/logger.module.d.ts +2 -0
- package/dist/logger/logger.module.js +58 -0
- package/dist/logger/logger.module.js.map +1 -0
- package/dist/logger/logger.service.d.ts +12 -0
- package/dist/logger/logger.service.js +119 -0
- package/dist/logger/logger.service.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +15 -0
- package/dist/main.js.map +1 -0
- package/dist/metrics/metrics.middleware.d.ts +16 -0
- package/dist/metrics/metrics.middleware.js +59 -0
- package/dist/metrics/metrics.middleware.js.map +1 -0
- package/dist/metrics/metrics.module.d.ts +5 -0
- package/dist/metrics/metrics.module.js +40 -0
- package/dist/metrics/metrics.module.js.map +1 -0
- package/dist/metrics/metrics.service.d.ts +11 -0
- package/dist/metrics/metrics.service.js +111 -0
- package/dist/metrics/metrics.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utils/tools.d.ts +6 -0
- package/dist/utils/tools.js +48 -0
- package/dist/utils/tools.js.map +1 -0
- package/package.json +92 -0
- package/tsconfig.build.json +4 -0
|
@@ -0,0 +1,212 @@
|
|
|
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.createIngressMongoAsync = createIngressMongoAsync;
|
|
7
|
+
const core_1 = require("@nestjs/core");
|
|
8
|
+
const microtime_1 = __importDefault(require("microtime"));
|
|
9
|
+
const logger_module_1 = require("../../logger.module");
|
|
10
|
+
const logger_service_1 = require("../../logger.service");
|
|
11
|
+
const enum_1 = require("../enum/enum");
|
|
12
|
+
function createIngressMongoAsync(name, schema) {
|
|
13
|
+
return {
|
|
14
|
+
name,
|
|
15
|
+
imports: [logger_module_1.LoggerModule],
|
|
16
|
+
useFactory: async (moduleRef) => {
|
|
17
|
+
const logger = moduleRef.get(logger_service_1.CustomLoggerService, { strict: false });
|
|
18
|
+
applyMongoIngressHooks(schema, logger);
|
|
19
|
+
return schema;
|
|
20
|
+
},
|
|
21
|
+
inject: [core_1.ModuleRef],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function applyMongoIngressHooks(schema, logger) {
|
|
25
|
+
MongoIngressHooks['logger'] = logger;
|
|
26
|
+
new MongoIngressHooks(schema);
|
|
27
|
+
}
|
|
28
|
+
class MongoIngressHooks {
|
|
29
|
+
constructor(schema) {
|
|
30
|
+
this.schema = schema;
|
|
31
|
+
this.applyHooks();
|
|
32
|
+
}
|
|
33
|
+
applyHooks() {
|
|
34
|
+
const preHooks = {
|
|
35
|
+
find: this.beforeFind,
|
|
36
|
+
save: this.beforeSave,
|
|
37
|
+
findOne: this.beforeFindOne,
|
|
38
|
+
findOneAndUpdate: this.beforeFindOneAndUpdate,
|
|
39
|
+
updateOne: this.beforeUpdateOne,
|
|
40
|
+
updateMany: this.beforeUpdateMany,
|
|
41
|
+
deleteOne: this.beforeDeleteOne,
|
|
42
|
+
deleteMany: this.beforeDeleteMany,
|
|
43
|
+
insertMany: this.beforeInsertMany,
|
|
44
|
+
insertOne: this.beforeSave,
|
|
45
|
+
};
|
|
46
|
+
const postHooks = {
|
|
47
|
+
find: this.afterFind,
|
|
48
|
+
save: this.afterSave,
|
|
49
|
+
findOne: this.afterFind,
|
|
50
|
+
findOneAndUpdate: this.afterFindOneAndUpdate,
|
|
51
|
+
updateOne: this.afterUpdateOne,
|
|
52
|
+
updateMany: this.afterUpdateMany,
|
|
53
|
+
deleteOne: this.afterDeleteOne,
|
|
54
|
+
deleteMany: this.afterDeleteMany,
|
|
55
|
+
insertOne: this.afterSave,
|
|
56
|
+
insertMany: this.afterInsertMany,
|
|
57
|
+
};
|
|
58
|
+
for (const [hook, method] of Object.entries(preHooks)) {
|
|
59
|
+
this.schema.pre(hook, function (next) {
|
|
60
|
+
this._startTime = microtime_1.default.now();
|
|
61
|
+
method.call(this, next);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
for (const [hook, method] of Object.entries(postHooks)) {
|
|
65
|
+
this.schema.post(hook, function (docs) {
|
|
66
|
+
method.call(this, docs, {
|
|
67
|
+
serviceStartTime: this._startTime,
|
|
68
|
+
collectionName: this.model.collection?.name || this['collection'].name,
|
|
69
|
+
hook: hook,
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
beforeInsertMany(next) {
|
|
75
|
+
next();
|
|
76
|
+
}
|
|
77
|
+
beforeFind(next) {
|
|
78
|
+
next();
|
|
79
|
+
}
|
|
80
|
+
beforeFindOne(next) {
|
|
81
|
+
next();
|
|
82
|
+
}
|
|
83
|
+
beforeFindOneAndUpdate(next) {
|
|
84
|
+
next();
|
|
85
|
+
}
|
|
86
|
+
beforeUpdateOne(next) {
|
|
87
|
+
next();
|
|
88
|
+
}
|
|
89
|
+
beforeUpdateMany(next) {
|
|
90
|
+
next();
|
|
91
|
+
}
|
|
92
|
+
beforeDeleteOne(next) {
|
|
93
|
+
next();
|
|
94
|
+
}
|
|
95
|
+
beforeDeleteMany(next) {
|
|
96
|
+
next();
|
|
97
|
+
}
|
|
98
|
+
beforeSave(next) {
|
|
99
|
+
next();
|
|
100
|
+
}
|
|
101
|
+
beforeInsertOne(next) {
|
|
102
|
+
next();
|
|
103
|
+
}
|
|
104
|
+
afterFind(info) {
|
|
105
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.READ({
|
|
106
|
+
startTime: info.serviceStartTime,
|
|
107
|
+
message: JSON.stringify({
|
|
108
|
+
requestObject: {
|
|
109
|
+
method: 'READ',
|
|
110
|
+
payload: {
|
|
111
|
+
query: this.getFilter(),
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
afterFindOneAndUpdate(doc, info) {
|
|
118
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.UPDATE({
|
|
119
|
+
startTime: info.serviceStartTime,
|
|
120
|
+
message: JSON.stringify({
|
|
121
|
+
requestObject: {
|
|
122
|
+
method: 'UPDATE',
|
|
123
|
+
payload: {
|
|
124
|
+
query: this.getFilter(),
|
|
125
|
+
document: this.getUpdate(),
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
afterUpdateOne(doc, info) {
|
|
132
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.UPDATE({
|
|
133
|
+
startTime: info.serviceStartTime,
|
|
134
|
+
message: JSON.stringify({
|
|
135
|
+
requestObject: {
|
|
136
|
+
method: 'UPDATE',
|
|
137
|
+
payload: {
|
|
138
|
+
query: this.getFilter(),
|
|
139
|
+
document: this.getUpdate(),
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
}),
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
afterUpdateMany(doc, info) {
|
|
146
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.UPDATE({
|
|
147
|
+
startTime: info.serviceStartTime,
|
|
148
|
+
message: JSON.stringify({
|
|
149
|
+
requestObject: {
|
|
150
|
+
method: 'UPDATE',
|
|
151
|
+
payload: {
|
|
152
|
+
query: this.getFilter(),
|
|
153
|
+
document: this.getUpdate(),
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
}),
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
afterDeleteOne(result, info) {
|
|
160
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.REMOVE({
|
|
161
|
+
startTime: info.serviceStartTime,
|
|
162
|
+
message: JSON.stringify({
|
|
163
|
+
requestObject: {
|
|
164
|
+
method: 'DELETE',
|
|
165
|
+
payload: {
|
|
166
|
+
query: this.getFilter(),
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
afterDeleteMany(result) {
|
|
173
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.REMOVE({
|
|
174
|
+
startTime: microtime_1.default.now(),
|
|
175
|
+
message: JSON.stringify({
|
|
176
|
+
requestObject: {
|
|
177
|
+
method: 'DELETE',
|
|
178
|
+
payload: {
|
|
179
|
+
query: this.getFilter(),
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
}),
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
afterSave(doc, info) {
|
|
186
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.CREATE({
|
|
187
|
+
startTime: info.serviceStartTime,
|
|
188
|
+
message: JSON.stringify({
|
|
189
|
+
requestObject: {
|
|
190
|
+
method: 'CREATE',
|
|
191
|
+
payload: {
|
|
192
|
+
document: this.toObject(),
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
}),
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
afterInsertMany(doc, info) {
|
|
199
|
+
MongoIngressHooks.logger.debug(enum_1.DBAction.CREATE({
|
|
200
|
+
startTime: info.serviceStartTime,
|
|
201
|
+
message: JSON.stringify({
|
|
202
|
+
requestObject: {
|
|
203
|
+
method: 'CREATE',
|
|
204
|
+
payload: {
|
|
205
|
+
document: this.doc,
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
}),
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=hook-ingress.database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-ingress.database.js","sourceRoot":"","sources":["../../../../src/logger/core/database/hook-ingress.database.ts"],"names":[],"mappings":";;;;;AAOA,0DAWC;AAjBD,uCAAyC;AACzC,0DAAkC;AAClC,uDAAmD;AACnD,yDAA2D;AAC3D,uCAAwC;AAExC,SAAgB,uBAAuB,CAAC,IAAY,EAAE,MAAW;IAC/D,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,CAAC,4BAAY,CAAC;QACvB,UAAU,EAAE,KAAK,EAAE,SA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,CAAC,SAAS,EAAE;qBACxB;iBACF;aACF,CAAC;SACH,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,SAAS,CAAY,GAAQ,EAAE,IAAS;QAC7C,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAQ,CAAC,MAAM,CAAC;YACd,SAAS,EAAE,IAAI,CAAC,gBAAgB;YAChC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;gBACtB,aAAa,EAAE;oBACb,MAAM,EAAE,QAAQ;oBAChB,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;qBAC1B;iBACF;aACF,CAAC;SACH,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,eAAe,CAAY,GAAQ,EAAE,IAAS;QACnD,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAQ,CAAC,MAAM,CAAC;YACd,SAAS,EAAE,IAAI,CAAC,gBAAgB;YAChC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;gBACtB,aAAa,EAAE;oBACb,MAAM,EAAE,QAAQ;oBAChB,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI,CAAC,GAAG;qBACnB;iBACF;aACF,CAAC;SACH,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExecutionContext, CallHandler, NestInterceptor } from '@nestjs/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { APICustomInfo } from '../dtos/core.dto';
|
|
4
|
+
export declare function RecordName(command: string): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
5
|
+
export declare function CommandInfo(commandInfo: ICommandInfo): <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
6
|
+
export declare class CommandInfoInterceptor implements NestInterceptor {
|
|
7
|
+
private commandName;
|
|
8
|
+
private description?;
|
|
9
|
+
constructor(commandName: string, description?: string);
|
|
10
|
+
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
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
|
+
export declare function EXTCMDName(apiCustomInfo?: APICustomInfo): MethodDecorator;
|
|
18
|
+
export declare function NodeName(nodeName: string): ClassDecorator;
|
|
19
|
+
export declare function RecordNameMethod(recordName: string): MethodDecorator;
|
|
20
|
+
interface ICommandInfo {
|
|
21
|
+
CommandName: string;
|
|
22
|
+
Description?: string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
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.RecordNameInterceptor = exports.CommandInfoInterceptor = void 0;
|
|
13
|
+
exports.RecordName = RecordName;
|
|
14
|
+
exports.CommandInfo = CommandInfo;
|
|
15
|
+
exports.EXTCMDName = EXTCMDName;
|
|
16
|
+
exports.NodeName = NodeName;
|
|
17
|
+
exports.RecordNameMethod = RecordNameMethod;
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const common_2 = require("@nestjs/common");
|
|
20
|
+
const operators_1 = require("rxjs/operators");
|
|
21
|
+
const tracnsaction_info_1 = require("../../../common/async-storage/tracnsaction-info");
|
|
22
|
+
const tools_1 = require("../../../utils/tools");
|
|
23
|
+
const global_function_1 = require("../functions/global-function");
|
|
24
|
+
function RecordName(command) {
|
|
25
|
+
return (0, common_2.applyDecorators)((0, common_2.SetMetadata)('commandName', command), (0, common_2.UseInterceptors)(new RecordNameInterceptor(command)));
|
|
26
|
+
}
|
|
27
|
+
function CommandInfo(commandInfo) {
|
|
28
|
+
return (0, common_2.applyDecorators)((0, common_2.SetMetadata)('commandName', commandInfo.CommandName), (0, common_2.SetMetadata)('description', commandInfo.Description), (0, common_2.UseInterceptors)(new CommandInfoInterceptor(commandInfo.CommandName, commandInfo.Description)));
|
|
29
|
+
}
|
|
30
|
+
let CommandInfoInterceptor = class CommandInfoInterceptor {
|
|
31
|
+
constructor(commandName, description) {
|
|
32
|
+
this.commandName = commandName;
|
|
33
|
+
this.description = description;
|
|
34
|
+
}
|
|
35
|
+
intercept(context, next) {
|
|
36
|
+
const request = context.switchToHttp().getRequest();
|
|
37
|
+
request['cmdName'] = this.commandName;
|
|
38
|
+
request['cmdDescription'] = this.description;
|
|
39
|
+
return next.handle().pipe((0, operators_1.tap)(() => {
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.CommandInfoInterceptor = CommandInfoInterceptor;
|
|
44
|
+
exports.CommandInfoInterceptor = CommandInfoInterceptor = __decorate([
|
|
45
|
+
(0, common_1.Injectable)(),
|
|
46
|
+
__metadata("design:paramtypes", [String, String])
|
|
47
|
+
], 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.set('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
|
+
function EXTCMDName(apiCustomInfo = {}) {
|
|
70
|
+
return (target, propertyKey, descriptor) => {
|
|
71
|
+
const originalMethod = descriptor.value;
|
|
72
|
+
descriptor.value = function (...args) {
|
|
73
|
+
const subSessionId = (0, tools_1.generateRandomString)();
|
|
74
|
+
if (this.logCustomInfo) {
|
|
75
|
+
this.logCustomInfo.subSessionId = subSessionId;
|
|
76
|
+
this.logCustomInfo.cmdName = apiCustomInfo.cmdName;
|
|
77
|
+
}
|
|
78
|
+
let extCommandName = this['nodeName'] ? `${this['nodeName']}|` : '';
|
|
79
|
+
extCommandName += apiCustomInfo.cmdName || propertyKey.toString();
|
|
80
|
+
const ExternalInfo = {
|
|
81
|
+
dependency: extCommandName,
|
|
82
|
+
subSessionId: subSessionId,
|
|
83
|
+
action: apiCustomInfo.action,
|
|
84
|
+
subAction: apiCustomInfo.subAction,
|
|
85
|
+
};
|
|
86
|
+
return (0, global_function_1.SetExternalTransactionInfo)(ExternalInfo, async () => {
|
|
87
|
+
return await originalMethod.apply(this, args);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function NodeName(nodeName) {
|
|
93
|
+
return (target) => {
|
|
94
|
+
target.prototype['nodeName'] = `${nodeName}`;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
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.set('recordName', recordName);
|
|
107
|
+
return tracnsaction_info_1.transactionInfoLocalStorage.run(store, async () => {
|
|
108
|
+
return await originalMethod.apply(this, args);
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=customDecorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customDecorators.js","sourceRoot":"","sources":["../../../../src/logger/core/decorators/customDecorators.ts"],"names":[],"mappings":";;;;;;;;;;;;AAmBA,gCAKC;AAED,kCAWC;AAuFD,gCA0BC;AAED,4BAIC;AAED,4CAeC;AA7KD,2CAKwB;AACxB,2CAA+E;AAE/E,8CAAqC;AACrC,uFAA8F;AAE9F,gDAA4D;AAE5D,kEAGsC;AAGtC,SAAgB,UAAU,CAAC,OAAe;IACxC,OAAO,IAAA,wBAAe,EACpB,IAAA,oBAAW,EAAC,aAAa,EAAE,OAAO,CAAC,EACnC,IAAA,wBAAe,EAAC,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAC,CACpD,CAAC;AACJ,CAAC;AAED,SAAgB,WAAW,CAAC,WAAyB;IACnD,OAAO,IAAA,wBAAe,EACpB,IAAA,oBAAW,EAAC,aAAa,EAAE,WAAW,CAAC,W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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;AAED,SAAgB,gBAAgB,CAAC,UAAkB;IACjD,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,UAA8B,EAAE,EAAE;QAC7D,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QACxC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;YACzC,MAAM,KAAK,GAAG,+CAA2B,CAAC,QAAQ,EAAE,CAAC;YACrD,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;gBACnD,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC1C,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YACpC,OAAO,+CAA2B,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE;gBACvD,OAAO,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.dto.js","sourceRoot":"","sources":["../../../../src/logger/core/dtos/core.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ACTION_TYPE } from '../../aicf/dtos/aicf.dto';
|
|
2
|
+
export declare abstract class LogEntryClass {
|
|
3
|
+
logCustomInfo: LogEntry;
|
|
4
|
+
getCustomData(): Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
export interface LogEntry {
|
|
7
|
+
cmdName: string;
|
|
8
|
+
action?: ACTION_TYPE;
|
|
9
|
+
subAction?: string;
|
|
10
|
+
subSessionId?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogEntryClass = void 0;
|
|
4
|
+
class LogEntryClass {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.logCustomInfo = {
|
|
7
|
+
cmdName: null,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
getCustomData() {
|
|
11
|
+
return this.logCustomInfo;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.LogEntryClass = LogEntryClass;
|
|
15
|
+
//# sourceMappingURL=log-entry-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-entry-class.js","sourceRoot":"","sources":["../../../../src/logger/core/dtos/log-entry-class.ts"],"names":[],"mappings":";;;AAEA,MAAsB,aAAa;IAAnC;QACE,kBAAa,GAAa;YACxB,OAAO,EAAE,IAAI;SACd,CAAC;IAIJ,CAAC;IAHC,aAAa;QACX,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CACF;AAPD,sCAOC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CommonOperationStatus } from '../../../common/dto/result.dto';
|
|
2
|
+
export interface basicInfoDebug {
|
|
3
|
+
message?: string;
|
|
4
|
+
startTime?: number;
|
|
5
|
+
endTime?: number;
|
|
6
|
+
additionalInfo?: any;
|
|
7
|
+
}
|
|
8
|
+
export declare class CoreLogSummaryDto {
|
|
9
|
+
static getInstance(commonOperationStatus?: CommonOperationStatus): {
|
|
10
|
+
detail?: any;
|
|
11
|
+
summary?: any;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare class HttpAction {
|
|
15
|
+
static POST(detailLogs: basicInfoDebug): any;
|
|
16
|
+
static GET(detailLogs: basicInfoDebug): any;
|
|
17
|
+
static PUT(detailLogs: basicInfoDebug): any;
|
|
18
|
+
static PATCH(detailLogs: basicInfoDebug): any;
|
|
19
|
+
static DELETE(detailLogs: basicInfoDebug): any;
|
|
20
|
+
private static mapModel;
|
|
21
|
+
}
|
|
22
|
+
export declare class DBAction {
|
|
23
|
+
static CREATE(detailLogs: basicInfoDebug): any;
|
|
24
|
+
static READ(detailLogs: basicInfoDebug): any;
|
|
25
|
+
static UPDATE(detailLogs: basicInfoDebug): any;
|
|
26
|
+
static REMOVE(detailLogs: basicInfoDebug): any;
|
|
27
|
+
private static mapModel;
|
|
28
|
+
}
|
|
29
|
+
export declare class RabbitMQAction {
|
|
30
|
+
static PRODUCE(detailLogs: basicInfoDebug): any;
|
|
31
|
+
static CONSUME(detailLogs: basicInfoDebug): any;
|
|
32
|
+
private static mapModel;
|
|
33
|
+
}
|
|
34
|
+
export declare class KafkaAction {
|
|
35
|
+
static PRODUCE(detailLogs: basicInfoDebug): any;
|
|
36
|
+
static CONSUME(detailLogs: basicInfoDebug): any;
|
|
37
|
+
private static mapModel;
|
|
38
|
+
}
|
|
39
|
+
export declare class LogicAction {
|
|
40
|
+
static LOG(detailLogs: basicInfoDebug): any;
|
|
41
|
+
private static mapModel;
|
|
42
|
+
}
|
|
43
|
+
export declare class ExceptionAction {
|
|
44
|
+
static LOG(detailLogs: basicInfoDebug): any;
|
|
45
|
+
private static mapModel;
|
|
46
|
+
}
|
|
47
|
+
export declare class ConnectionAction {
|
|
48
|
+
static CONNECTED(detailLogs: basicInfoDebug): any;
|
|
49
|
+
static DISCONNECTED(detailLogs: basicInfoDebug): any;
|
|
50
|
+
private static mapModel;
|
|
51
|
+
}
|