@icd-iot-aicf/nestjs-logger 2.3.0 → 3.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/SNAPSHOT_GUIDE.md +154 -0
- package/migration/log-snapshot-v3.e2e-spec.ts +364 -0
- package/package.json +1 -1
- package/dist/app.module.d.ts +0 -2
- package/dist/app.module.js +0 -23
- package/dist/app.module.js.map +0 -1
- package/dist/app.service.d.ts +0 -3
- package/dist/app.service.js +0 -20
- package/dist/app.service.js.map +0 -1
- package/dist/common/async-storage/external-transaction-info.d.ts +0 -11
- package/dist/common/async-storage/external-transaction-info.js +0 -6
- package/dist/common/async-storage/external-transaction-info.js.map +0 -1
- package/dist/common/async-storage/summaryEndpoint-info.d.ts +0 -4
- package/dist/common/async-storage/summaryEndpoint-info.js +0 -10
- package/dist/common/async-storage/summaryEndpoint-info.js.map +0 -1
- package/dist/common/async-storage/tracnsaction-info.d.ts +0 -14
- package/dist/common/async-storage/tracnsaction-info.js +0 -6
- package/dist/common/async-storage/tracnsaction-info.js.map +0 -1
- package/dist/common/dto/result.dto.d.ts +0 -18
- package/dist/common/dto/result.dto.js +0 -12
- package/dist/common/dto/result.dto.js.map +0 -1
- package/dist/common/helper/error.d.ts +0 -4
- package/dist/common/helper/error.js +0 -15
- package/dist/common/helper/error.js.map +0 -1
- package/dist/common/helper/response.d.ts +0 -38
- package/dist/common/helper/response.js +0 -212
- package/dist/common/helper/response.js.map +0 -1
- package/dist/common/helper/tools.d.ts +0 -8
- package/dist/common/helper/tools.js +0 -98
- package/dist/common/helper/tools.js.map +0 -1
- package/dist/common/helper/tools.service.d.ts +0 -12
- package/dist/common/helper/tools.service.js +0 -148
- package/dist/common/helper/tools.service.js.map +0 -1
- package/dist/common/internal-logs-info.module.d.ts +0 -3
- package/dist/common/internal-logs-info.module.js +0 -29
- package/dist/common/internal-logs-info.module.js.map +0 -1
- package/dist/common/service/common/context.service.d.ts +0 -6
- package/dist/common/service/common/context.service.js +0 -34
- package/dist/common/service/common/context.service.js.map +0 -1
- package/dist/common/service/logger-debug/logger-debug-lib.service.d.ts +0 -6
- package/dist/common/service/logger-debug/logger-debug-lib.service.js +0 -35
- package/dist/common/service/logger-debug/logger-debug-lib.service.js.map +0 -1
- package/dist/config/app-log-config.module.d.ts +0 -5
- package/dist/config/app-log-config.module.js +0 -38
- package/dist/config/app-log-config.module.js.map +0 -1
- package/dist/config/app-log-config.service.d.ts +0 -6
- package/dist/config/app-log-config.service.js +0 -32
- package/dist/config/app-log-config.service.js.map +0 -1
- package/dist/config/configurations.d.ts +0 -23
- package/dist/config/configurations.js +0 -15
- package/dist/config/configurations.js.map +0 -1
- package/dist/index.d.ts +0 -23
- package/dist/index.js +0 -40
- package/dist/index.js.map +0 -1
- package/dist/logger/aicf/dtos/aicf-manual.dto.d.ts +0 -128
- package/dist/logger/aicf/dtos/aicf-manual.dto.js +0 -214
- package/dist/logger/aicf/dtos/aicf-manual.dto.js.map +0 -1
- package/dist/logger/aicf/dtos/aicf.dto.d.ts +0 -208
- package/dist/logger/aicf/dtos/aicf.dto.js +0 -177
- package/dist/logger/aicf/dtos/aicf.dto.js.map +0 -1
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.d.ts +0 -7
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.js +0 -78
- package/dist/logger/aicf/interceptors/aicf-amqp.interceptor.js.map +0 -1
- package/dist/logger/aicf/interceptors/aicf.interceptor.d.ts +0 -9
- package/dist/logger/aicf/interceptors/aicf.interceptor.js +0 -38
- package/dist/logger/aicf/interceptors/aicf.interceptor.js.map +0 -1
- package/dist/logger/aicf/middleware/aicf.middleware.d.ts +0 -13
- package/dist/logger/aicf/middleware/aicf.middleware.js +0 -125
- package/dist/logger/aicf/middleware/aicf.middleware.js.map +0 -1
- package/dist/logger/aicf/services/aicf-endpoint.service.d.ts +0 -13
- package/dist/logger/aicf/services/aicf-endpoint.service.js +0 -116
- package/dist/logger/aicf/services/aicf-endpoint.service.js.map +0 -1
- package/dist/logger/cloudron/decorators/cloudron.decorators.d.ts +0 -0
- package/dist/logger/cloudron/decorators/cloudron.decorators.js +0 -1
- package/dist/logger/cloudron/decorators/cloudron.decorators.js.map +0 -1
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.d.ts +0 -120
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.js +0 -179
- package/dist/logger/cloudron/dtos/cauldron-manual.dto.js.map +0 -1
- package/dist/logger/cloudron/dtos/cauldron.dto.d.ts +0 -182
- package/dist/logger/cloudron/dtos/cauldron.dto.js +0 -114
- package/dist/logger/cloudron/dtos/cauldron.dto.js.map +0 -1
- package/dist/logger/cloudron/global/cloudron.global.d.ts +0 -0
- package/dist/logger/cloudron/global/cloudron.global.js +0 -1
- package/dist/logger/cloudron/global/cloudron.global.js.map +0 -1
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.d.ts +0 -11
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.js +0 -41
- package/dist/logger/cloudron/intercepters/cloudron.interceptor.js.map +0 -1
- package/dist/logger/cloudron/middleware/cloudron.middleware.d.ts +0 -15
- package/dist/logger/cloudron/middleware/cloudron.middleware.js +0 -106
- package/dist/logger/cloudron/middleware/cloudron.middleware.js.map +0 -1
- package/dist/logger/cloudron/services/cloudron-details-logs.service.d.ts +0 -15
- package/dist/logger/cloudron/services/cloudron-details-logs.service.js +0 -127
- package/dist/logger/cloudron/services/cloudron-details-logs.service.js.map +0 -1
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.d.ts +0 -6
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js +0 -43
- package/dist/logger/cloudron/services/cloudron-summary-logs.service.js.map +0 -1
- package/dist/logger/core/database/hook-ingress.database.d.ts +0 -8
- package/dist/logger/core/database/hook-ingress.database.js +0 -215
- package/dist/logger/core/database/hook-ingress.database.js.map +0 -1
- package/dist/logger/core/decorators/customDecorators.d.ts +0 -20
- package/dist/logger/core/decorators/customDecorators.js +0 -92
- package/dist/logger/core/decorators/customDecorators.js.map +0 -1
- package/dist/logger/core/dtos/core.dto.d.ts +0 -86
- package/dist/logger/core/dtos/core.dto.js +0 -9
- package/dist/logger/core/dtos/core.dto.js.map +0 -1
- package/dist/logger/core/dtos/log-entry-class.d.ts +0 -11
- package/dist/logger/core/dtos/log-entry-class.js +0 -15
- package/dist/logger/core/dtos/log-entry-class.js.map +0 -1
- package/dist/logger/core/enum/enum.d.ts +0 -75
- package/dist/logger/core/enum/enum.js +0 -307
- package/dist/logger/core/enum/enum.js.map +0 -1
- package/dist/logger/core/functions/error-reponse.d.ts +0 -2
- package/dist/logger/core/functions/error-reponse.js +0 -26
- package/dist/logger/core/functions/error-reponse.js.map +0 -1
- package/dist/logger/core/functions/global-function.d.ts +0 -43
- package/dist/logger/core/functions/global-function.js +0 -180
- package/dist/logger/core/functions/global-function.js.map +0 -1
- package/dist/logger/core/guard/logger.guard.d.ts +0 -8
- package/dist/logger/core/guard/logger.guard.js +0 -44
- package/dist/logger/core/guard/logger.guard.js.map +0 -1
- package/dist/logger/core/interceptors/amqp.interceptor.d.ts +0 -6
- package/dist/logger/core/interceptors/amqp.interceptor.js +0 -46
- package/dist/logger/core/interceptors/amqp.interceptor.js.map +0 -1
- package/dist/logger/core/interceptors/core-logs.interceptor.d.ts +0 -18
- package/dist/logger/core/interceptors/core-logs.interceptor.js +0 -70
- package/dist/logger/core/interceptors/core-logs.interceptor.js.map +0 -1
- package/dist/logger/core/interceptors/http.interceptor.d.ts +0 -5
- package/dist/logger/core/interceptors/http.interceptor.js +0 -30
- package/dist/logger/core/interceptors/http.interceptor.js.map +0 -1
- package/dist/logger/core/interceptors/interceptors.d.ts +0 -3
- package/dist/logger/core/interceptors/interceptors.js +0 -20
- package/dist/logger/core/interceptors/interceptors.js.map +0 -1
- package/dist/logger/core/middleware/http-logs-middleware.service.d.ts +0 -19
- package/dist/logger/core/middleware/http-logs-middleware.service.js +0 -61
- package/dist/logger/core/middleware/http-logs-middleware.service.js.map +0 -1
- package/dist/logger/core/module/amqp/amqp.module.d.ts +0 -2
- package/dist/logger/core/module/amqp/amqp.module.js +0 -43
- package/dist/logger/core/module/amqp/amqp.module.js.map +0 -1
- package/dist/logger/core/pipes/index.d.ts +0 -1
- package/dist/logger/core/pipes/index.js +0 -18
- package/dist/logger/core/pipes/index.js.map +0 -1
- package/dist/logger/core/pipes/masking-logs/masking-logs.pipe.d.ts +0 -5
- package/dist/logger/core/pipes/masking-logs/masking-logs.pipe.js +0 -38
- package/dist/logger/core/pipes/masking-logs/masking-logs.pipe.js.map +0 -1
- package/dist/logger/core/services/summary-flush.service.d.ts +0 -8
- package/dist/logger/core/services/summary-flush.service.js +0 -31
- package/dist/logger/core/services/summary-flush.service.js.map +0 -1
- package/dist/logger/esb/dtos/logger.esb.dto.d.ts +0 -136
- package/dist/logger/esb/dtos/logger.esb.dto.js +0 -99
- package/dist/logger/esb/dtos/logger.esb.dto.js.map +0 -1
- package/dist/logger/esb/intercepters/esb.interceptor.d.ts +0 -9
- package/dist/logger/esb/intercepters/esb.interceptor.js +0 -36
- package/dist/logger/esb/intercepters/esb.interceptor.js.map +0 -1
- package/dist/logger/esb/middleware/esb.middleware.d.ts +0 -10
- package/dist/logger/esb/middleware/esb.middleware.js +0 -64
- package/dist/logger/esb/middleware/esb.middleware.js.map +0 -1
- package/dist/logger/esb/services/external-logs-esb.service.d.ts +0 -10
- package/dist/logger/esb/services/external-logs-esb.service.js +0 -98
- package/dist/logger/esb/services/external-logs-esb.service.js.map +0 -1
- package/dist/logger/logger.middleware.d.ts +0 -0
- package/dist/logger/logger.middleware.js +0 -1
- package/dist/logger/logger.middleware.js.map +0 -1
- package/dist/logger/logger.module.d.ts +0 -2
- package/dist/logger/logger.module.js +0 -59
- package/dist/logger/logger.module.js.map +0 -1
- package/dist/logger/logger.service.d.ts +0 -12
- package/dist/logger/logger.service.js +0 -129
- package/dist/logger/logger.service.js.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.js +0 -15
- package/dist/main.js.map +0 -1
- package/dist/metrics/metrics-manual.service.d.ts +0 -12
- package/dist/metrics/metrics-manual.service.js +0 -45
- package/dist/metrics/metrics-manual.service.js.map +0 -1
- package/dist/metrics/metrics.middleware.d.ts +0 -14
- package/dist/metrics/metrics.middleware.js +0 -74
- package/dist/metrics/metrics.middleware.js.map +0 -1
- package/dist/metrics/metrics.module.d.ts +0 -6
- package/dist/metrics/metrics.module.js +0 -42
- package/dist/metrics/metrics.module.js.map +0 -1
- package/dist/metrics/metrics.service.d.ts +0 -11
- package/dist/metrics/metrics.service.js +0 -112
- package/dist/metrics/metrics.service.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/utils/tools.d.ts +0 -50
- package/dist/utils/tools.js +0 -266
- package/dist/utils/tools.js.map +0 -1
|
@@ -1,307 +0,0 @@
|
|
|
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.SmtpAction = exports.ConnectionAction = exports.ExceptionAction = exports.LogicAction = exports.KafkaAction = exports.RabbitMQAction = exports.DBAction = exports.HttpAction = exports.CoreLogSummaryDto = void 0;
|
|
7
|
-
const app_log_config_service_1 = require("../../../config/app-log-config.service");
|
|
8
|
-
const configurations_1 = require("../../../config/configurations");
|
|
9
|
-
const aicf_dto_1 = require("../../aicf/dtos/aicf.dto");
|
|
10
|
-
const aicf_manual_dto_1 = require("../../aicf/dtos/aicf-manual.dto");
|
|
11
|
-
const cauldron_manual_dto_1 = require("../../cloudron/dtos/cauldron-manual.dto");
|
|
12
|
-
const microtime_1 = __importDefault(require("microtime"));
|
|
13
|
-
const response_1 = require("../../../common/helper/response");
|
|
14
|
-
const core_dto_1 = require("../dtos/core.dto");
|
|
15
|
-
const tracnsaction_info_1 = require("../../../common/async-storage/tracnsaction-info");
|
|
16
|
-
class CoreLogSummaryDto {
|
|
17
|
-
static getInstance(detailsFludService) {
|
|
18
|
-
try {
|
|
19
|
-
const config = app_log_config_service_1.AppLogConfigService.getConfig().format;
|
|
20
|
-
detailsFludService.resultCodeFormat ??= response_1.RESULTS.SUCCESS;
|
|
21
|
-
detailsFludService.serviceEndTime ??= microtime_1.default.now();
|
|
22
|
-
const transactionInfoStore = tracnsaction_info_1.transactionInfoLocalStorage.getStore();
|
|
23
|
-
detailsFludService.request ??= transactionInfoStore.requestObject;
|
|
24
|
-
switch (config) {
|
|
25
|
-
case configurations_1.FORMAT_TYPE.AICF:
|
|
26
|
-
const data = {
|
|
27
|
-
endTime: detailsFludService.serviceEndTime,
|
|
28
|
-
appResult: detailsFludService.resultCodeFormat.resultDescription,
|
|
29
|
-
appResultCode: detailsFludService.resultCodeFormat.resultCode,
|
|
30
|
-
action: aicf_dto_1.ACTION_TYPE.AMQP,
|
|
31
|
-
};
|
|
32
|
-
return {
|
|
33
|
-
detail: new aicf_manual_dto_1.AicfDetailSummaryManualDto(data, transactionInfoStore),
|
|
34
|
-
summary: new aicf_manual_dto_1.AicfSummaryManualDto(data, transactionInfoStore),
|
|
35
|
-
};
|
|
36
|
-
case configurations_1.FORMAT_TYPE.CLOUDRON:
|
|
37
|
-
return {
|
|
38
|
-
detail: new cauldron_manual_dto_1.CManualDetail(transactionInfoStore, detailsFludService),
|
|
39
|
-
summary: new cauldron_manual_dto_1.CManualSummary(transactionInfoStore, detailsFludService),
|
|
40
|
-
};
|
|
41
|
-
default:
|
|
42
|
-
return {};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.CoreLogSummaryDto = CoreLogSummaryDto;
|
|
50
|
-
class CoreLogDto {
|
|
51
|
-
static getInstance(detailLogs) {
|
|
52
|
-
const config = app_log_config_service_1.AppLogConfigService.getConfig().format;
|
|
53
|
-
switch (config) {
|
|
54
|
-
case configurations_1.FORMAT_TYPE.AICF:
|
|
55
|
-
return new aicf_manual_dto_1.AicfManualDto(detailLogs);
|
|
56
|
-
case configurations_1.FORMAT_TYPE.CLOUDRON:
|
|
57
|
-
return new cauldron_manual_dto_1.CDetailManaulLogWithPushSummary(detailLogs);
|
|
58
|
-
default:
|
|
59
|
-
return CoreLogDto;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
class CoreLogAMQPDto {
|
|
64
|
-
static getInstance(detailLogs) {
|
|
65
|
-
const config = app_log_config_service_1.AppLogConfigService.getConfig().format;
|
|
66
|
-
switch (config) {
|
|
67
|
-
case configurations_1.FORMAT_TYPE.AICF:
|
|
68
|
-
return new aicf_manual_dto_1.AicfManualDto(detailLogs);
|
|
69
|
-
case configurations_1.FORMAT_TYPE.CLOUDRON:
|
|
70
|
-
if (detailLogs.requestObject && detailLogs.responseObject) {
|
|
71
|
-
detailLogs.responseObject.acknowledge = (!!detailLogs.responseObject
|
|
72
|
-
.acknowledge).toString();
|
|
73
|
-
detailLogs.summaryInfoAdditional = {
|
|
74
|
-
url: detailLogs.requestObject.url,
|
|
75
|
-
statusCode: detailLogs.responseObject.acknowledge,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
return new cauldron_manual_dto_1.CDetailManaulLogWithPushSummary(detailLogs);
|
|
79
|
-
default:
|
|
80
|
-
return CoreLogDto;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
class ConnectionLogDto {
|
|
85
|
-
static getInstance(detailLogs) {
|
|
86
|
-
const config = app_log_config_service_1.AppLogConfigService.getConfig();
|
|
87
|
-
switch (config.format) {
|
|
88
|
-
case configurations_1.FORMAT_TYPE.AICF:
|
|
89
|
-
return new aicf_manual_dto_1.AicfConnectionManualDto(detailLogs, config);
|
|
90
|
-
case configurations_1.FORMAT_TYPE.CLOUDRON:
|
|
91
|
-
const connectionInfo = {
|
|
92
|
-
type: 'Connection',
|
|
93
|
-
message: detailLogs.message || '',
|
|
94
|
-
protocol: detailLogs.protocol || '',
|
|
95
|
-
source: detailLogs.source || '',
|
|
96
|
-
};
|
|
97
|
-
return new cauldron_manual_dto_1.CManualConnection(connectionInfo, config);
|
|
98
|
-
default:
|
|
99
|
-
return {};
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
class HttpAction {
|
|
104
|
-
static POST(detailLogs) {
|
|
105
|
-
return this.mapModel(aicf_dto_1.SUB_HTTP_ACTION.POST, detailLogs);
|
|
106
|
-
}
|
|
107
|
-
static GET(detailLogs) {
|
|
108
|
-
return this.mapModel(aicf_dto_1.SUB_HTTP_ACTION.GET, detailLogs);
|
|
109
|
-
}
|
|
110
|
-
static PUT(detailLogs) {
|
|
111
|
-
return this.mapModel(aicf_dto_1.SUB_HTTP_ACTION.PUT, detailLogs);
|
|
112
|
-
}
|
|
113
|
-
static PATCH(detailLogs) {
|
|
114
|
-
return this.mapModel(aicf_dto_1.SUB_HTTP_ACTION.PATCH, detailLogs);
|
|
115
|
-
}
|
|
116
|
-
static DELETE(detailLogs) {
|
|
117
|
-
return this.mapModel(aicf_dto_1.SUB_HTTP_ACTION.DELETE, detailLogs);
|
|
118
|
-
}
|
|
119
|
-
static mapModel(Method, detailLogs) {
|
|
120
|
-
try {
|
|
121
|
-
const detailLogsCustom = {
|
|
122
|
-
...detailLogs,
|
|
123
|
-
action: aicf_dto_1.ACTION_TYPE.HTTP,
|
|
124
|
-
subAction: Method,
|
|
125
|
-
summaryInfoAdditional: undefined,
|
|
126
|
-
};
|
|
127
|
-
if (detailLogs.requestObject && detailLogs.responseObject) {
|
|
128
|
-
detailLogsCustom.summaryInfoAdditional = {
|
|
129
|
-
url: detailLogs.requestObject.url,
|
|
130
|
-
statusCode: detailLogs.responseObject.httpStatusCode
|
|
131
|
-
.toString()
|
|
132
|
-
.padEnd(5, '0'),
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
return CoreLogDto.getInstance(detailLogsCustom);
|
|
136
|
-
}
|
|
137
|
-
catch (e) {
|
|
138
|
-
}
|
|
139
|
-
return {};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
exports.HttpAction = HttpAction;
|
|
143
|
-
class DBAction {
|
|
144
|
-
static CREATE(detailLogs) {
|
|
145
|
-
return this.mapModel(aicf_dto_1.SUB_DB_ACTION.CREATE, detailLogs);
|
|
146
|
-
}
|
|
147
|
-
static READ(detailLogs) {
|
|
148
|
-
return this.mapModel(aicf_dto_1.SUB_DB_ACTION.READE, detailLogs);
|
|
149
|
-
}
|
|
150
|
-
static UPDATE(detailLogs) {
|
|
151
|
-
return this.mapModel(aicf_dto_1.SUB_DB_ACTION.UPDATE, detailLogs);
|
|
152
|
-
}
|
|
153
|
-
static REMOVE(detailLogs) {
|
|
154
|
-
return this.mapModel(aicf_dto_1.SUB_DB_ACTION.REMOVE, detailLogs);
|
|
155
|
-
}
|
|
156
|
-
static mapModel(Method, detailLogs) {
|
|
157
|
-
try {
|
|
158
|
-
detailLogs.action = aicf_dto_1.ACTION_TYPE.DATABASE;
|
|
159
|
-
detailLogs.subAction = Method;
|
|
160
|
-
if (detailLogs.requestObject) {
|
|
161
|
-
detailLogs.summaryInfoAdditional = {
|
|
162
|
-
url: '',
|
|
163
|
-
statusCode: '20000:The requested operation was successfully.',
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
return CoreLogDto.getInstance(detailLogs);
|
|
167
|
-
}
|
|
168
|
-
catch (e) {
|
|
169
|
-
console.log(e);
|
|
170
|
-
}
|
|
171
|
-
return {};
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
exports.DBAction = DBAction;
|
|
175
|
-
class RabbitMQAction {
|
|
176
|
-
static PRODUCE(detailLogs) {
|
|
177
|
-
return this.mapModel(aicf_dto_1.SUB_AMQP_ACTION.PRODUCE, detailLogs);
|
|
178
|
-
}
|
|
179
|
-
static CONSUME(detailLogs) {
|
|
180
|
-
return this.mapModel(aicf_dto_1.SUB_AMQP_ACTION.CONSUME, detailLogs);
|
|
181
|
-
}
|
|
182
|
-
static mapModel(Method, detailLogs) {
|
|
183
|
-
try {
|
|
184
|
-
const detailLogsCustom = {
|
|
185
|
-
...detailLogs,
|
|
186
|
-
};
|
|
187
|
-
detailLogsCustom.action = aicf_dto_1.ACTION_TYPE.RABBITMQ;
|
|
188
|
-
detailLogsCustom.subAction = Method;
|
|
189
|
-
return CoreLogAMQPDto.getInstance(detailLogsCustom);
|
|
190
|
-
}
|
|
191
|
-
catch (e) {
|
|
192
|
-
}
|
|
193
|
-
return {};
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
exports.RabbitMQAction = RabbitMQAction;
|
|
197
|
-
class KafkaAction {
|
|
198
|
-
static PRODUCE(detailLogs) {
|
|
199
|
-
return this.mapModel(aicf_dto_1.SUB_AMQP_ACTION.PRODUCE, detailLogs);
|
|
200
|
-
}
|
|
201
|
-
static CONSUME(detailLogs) {
|
|
202
|
-
return this.mapModel(aicf_dto_1.SUB_AMQP_ACTION.CONSUME, detailLogs);
|
|
203
|
-
}
|
|
204
|
-
static mapModel(Method, detailLogs) {
|
|
205
|
-
try {
|
|
206
|
-
detailLogs.action = aicf_dto_1.ACTION_TYPE.KAFKA;
|
|
207
|
-
detailLogs.subAction = Method;
|
|
208
|
-
return CoreLogDto.getInstance(detailLogs);
|
|
209
|
-
}
|
|
210
|
-
catch (e) {
|
|
211
|
-
}
|
|
212
|
-
return {};
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
exports.KafkaAction = KafkaAction;
|
|
216
|
-
class LogicAction {
|
|
217
|
-
static FUNCTION(detailLogs) {
|
|
218
|
-
return this.mapModel(core_dto_1.LOGIC_TYPE.FUNCTION, detailLogs);
|
|
219
|
-
}
|
|
220
|
-
static CHECKPOINT(detailLogs) {
|
|
221
|
-
return this.mapModel(core_dto_1.LOGIC_TYPE.CHECKPOINT, detailLogs);
|
|
222
|
-
}
|
|
223
|
-
static mapModel(logicType, detailLogs) {
|
|
224
|
-
try {
|
|
225
|
-
detailLogs.recordSubType = aicf_dto_1.RECORD_SUB_TYPE.APP_LOGIC;
|
|
226
|
-
detailLogs.action = aicf_dto_1.ACTION_TYPE.APP_LOGIC;
|
|
227
|
-
detailLogs.subAction = logicType;
|
|
228
|
-
const config = app_log_config_service_1.AppLogConfigService.getConfig().format;
|
|
229
|
-
switch (config) {
|
|
230
|
-
case configurations_1.FORMAT_TYPE.AICF:
|
|
231
|
-
return new aicf_manual_dto_1.AicfLogicDto(detailLogs);
|
|
232
|
-
case configurations_1.FORMAT_TYPE.CLOUDRON:
|
|
233
|
-
return new cauldron_manual_dto_1.CDetailLogic(detailLogs);
|
|
234
|
-
default:
|
|
235
|
-
return undefined;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
catch (e) {
|
|
239
|
-
return undefined;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
exports.LogicAction = LogicAction;
|
|
244
|
-
class ExceptionAction {
|
|
245
|
-
static LOG(detailLogs) {
|
|
246
|
-
return this.mapModel(detailLogs);
|
|
247
|
-
}
|
|
248
|
-
static mapModel(detailLogs) {
|
|
249
|
-
try {
|
|
250
|
-
detailLogs.recordSubType = aicf_dto_1.RECORD_SUB_TYPE.EXCEPTION;
|
|
251
|
-
detailLogs.action = aicf_dto_1.ACTION_TYPE.EXCEPTION;
|
|
252
|
-
return CoreLogDto.getInstance(detailLogs);
|
|
253
|
-
}
|
|
254
|
-
catch (e) {
|
|
255
|
-
}
|
|
256
|
-
return {};
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
exports.ExceptionAction = ExceptionAction;
|
|
260
|
-
class ConnectionAction {
|
|
261
|
-
static CONNECTED(detailLogs) {
|
|
262
|
-
return this.mapModel('CONNECTED', detailLogs);
|
|
263
|
-
}
|
|
264
|
-
static DISCONNECTED(detailLogs) {
|
|
265
|
-
return this.mapModel('DISCONNECTED', detailLogs);
|
|
266
|
-
}
|
|
267
|
-
static mapModel(connectType, detailLogs) {
|
|
268
|
-
try {
|
|
269
|
-
detailLogs.recordSubType = connectType;
|
|
270
|
-
detailLogs.action = 'CONNECTION';
|
|
271
|
-
return ConnectionLogDto.getInstance(detailLogs);
|
|
272
|
-
}
|
|
273
|
-
catch (e) {
|
|
274
|
-
}
|
|
275
|
-
return {};
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
exports.ConnectionAction = ConnectionAction;
|
|
279
|
-
class SmtpAction {
|
|
280
|
-
static SEND(detailLogs) {
|
|
281
|
-
return this.mapModel(aicf_dto_1.SUB_SMTP_ACTION.SEND, detailLogs);
|
|
282
|
-
}
|
|
283
|
-
static mapModel(subAction, detailLogs) {
|
|
284
|
-
try {
|
|
285
|
-
detailLogs.recordSubType = aicf_dto_1.RECORD_SUB_TYPE.ENDPOINT;
|
|
286
|
-
const detailLogsCustom = {
|
|
287
|
-
...detailLogs,
|
|
288
|
-
action: aicf_dto_1.ACTION_TYPE.SMTP,
|
|
289
|
-
subAction: subAction,
|
|
290
|
-
summaryInfoAdditional: undefined,
|
|
291
|
-
};
|
|
292
|
-
if (detailLogs.requestObject && detailLogs.responseObject) {
|
|
293
|
-
detailLogsCustom.summaryInfoAdditional = {
|
|
294
|
-
url: detailLogs.requestObject.url,
|
|
295
|
-
statusCode: detailLogs.responseObject?.smtpCode ?? '500',
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
return CoreLogDto.getInstance(detailLogsCustom);
|
|
299
|
-
}
|
|
300
|
-
catch (e) {
|
|
301
|
-
console.log(e);
|
|
302
|
-
}
|
|
303
|
-
return {};
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
exports.SmtpAction = SmtpAction;
|
|
307
|
-
//# sourceMappingURL=enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../../src/logger/core/enum/enum.ts"],"names":[],"mappings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AAC;IACZ,CAAC;CACF;AAnBD,4CAmBC;AAED,MAAa,UAAU;IACrB,MAAM,CAAC,IAAI,CACT,UAAoE;QAEpE,OAAO,IAAI,CAAC,QAAQ,CAAC,0BAAe,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;IAEO,MAAM,CAAC,QAAQ,CAAC,SAAiB,EAAE,UAAe;QACxD,IAAI,CAAC;YACH,UAAU,CAAC,aAAa,GAAG,0BAAe,CAAC,QAAQ,CAAC;YACpD,MAAM,gBAAgB,GAAG;gBACvB,GAAG,UAAU;gBACb,MAAM,EAAE,sBAAW,CAAC,IAAI;gBACxB,SAAS,EAAE,SAAS;gBACpB,qBAAqB,EAAE,SAAS;aACjC,CAAC;YAEF,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,cAAc,EAAE,CAAC;gBAC1D,gBAAgB,CAAC,qBAAqB,GAAG;oBACvC,GAAG,EAAE,UAAU,CAAC,aAAa,CAAC,GAAG;oBACjC,UAAU,EAAE,UAAU,CAAC,cAAc,EAAE,QAAQ,IAAI,KAAK;iBACzD,CAAC;YACJ,CAAC;YAED,OAAO,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AA9BD,gCA8BC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapErrorResponseWithErrorCode = mapErrorResponseWithErrorCode;
|
|
4
|
-
const response_1 = require("../../../common/helper/response");
|
|
5
|
-
function mapErrorResponseWithErrorCode(errorCode = '', httpCode = 500) {
|
|
6
|
-
let errorFormat = response_1.RESULTS.INTERNAL_SERVER_ERROR;
|
|
7
|
-
switch (errorCode) {
|
|
8
|
-
case 'ECONNABORTED':
|
|
9
|
-
case 'ETIMEDOUT':
|
|
10
|
-
errorFormat = response_1.RESULTS.TIMEOUT;
|
|
11
|
-
break;
|
|
12
|
-
case 'ECONNREFUSED':
|
|
13
|
-
case 'ENOTFOUND':
|
|
14
|
-
case 'EAI_AGAIN':
|
|
15
|
-
case 'ECONNRESET':
|
|
16
|
-
case 'ERR_NETWORK':
|
|
17
|
-
case 'ENETUNREACH':
|
|
18
|
-
case 'EHOSTUNREACH':
|
|
19
|
-
errorFormat = response_1.RESULTS.EXTERNAL_SERVER_ERROR;
|
|
20
|
-
break;
|
|
21
|
-
default:
|
|
22
|
-
return (0, response_1.getStatusByHttpCode)(httpCode);
|
|
23
|
-
}
|
|
24
|
-
return errorFormat;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=error-reponse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-reponse.js","sourceRoot":"","sources":["../../../../src/logger/core/functions/error-reponse.ts"],"names":[],"mappings":";;AAGA,sEAwBC;AA1BD,8DAA+E;AAE/E,SAAgB,6BAA6B,CAC3C,SAAS,GAAG,EAAE,EACd,WAAmB,GAAG;IAEtB,IAAI,WAAW,GAAG,kBAAO,CAAC,qBAAqB,CAAC;IAChD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,cAAc,CAAC;QACpB,KAAK,WAAW;YACd,WAAW,GAAG,kBAAO,CAAC,OAAO,CAAC;YAC9B,MAAM;QACR,KAAK,cAAc,CAAC;QACpB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,YAAY,CAAC;QAClB,KAAK,aAAa,CAAC;QACnB,KAAK,aAAa,CAAC;QACnB,KAAK,cAAc;YACjB,WAAW,GAAG,kBAAO,CAAC,qBAAqB,CAAC;YAC5C,MAAM;QACR;YACE,OAAO,IAAA,8BAAmB,EAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ACTION_TYPE, LOG_LEVEL, RequestHTTPFormat } from '../../aicf/dtos/aicf.dto';
|
|
3
|
-
import { NextFunction } from 'express';
|
|
4
|
-
import { FORMAT_TYPE } from '../../../config/configurations';
|
|
5
|
-
export interface TransactionReferenceInfo {
|
|
6
|
-
transactionId?: string;
|
|
7
|
-
sessionId?: string;
|
|
8
|
-
originSession?: string;
|
|
9
|
-
recordName?: string;
|
|
10
|
-
serviceStartTime?: number;
|
|
11
|
-
requestObject?: Partial<RequestHTTPFormat> | any;
|
|
12
|
-
responseObject?: object;
|
|
13
|
-
action?: string;
|
|
14
|
-
maskingLogData?: boolean;
|
|
15
|
-
specificKeyMasking?: string[];
|
|
16
|
-
}
|
|
17
|
-
export interface ExternalTransactionInfo {
|
|
18
|
-
dependency: string;
|
|
19
|
-
action?: ACTION_TYPE | '';
|
|
20
|
-
subAction?: string;
|
|
21
|
-
subSessionId?: string;
|
|
22
|
-
serviceStartTime?: number;
|
|
23
|
-
}
|
|
24
|
-
export declare function GetTransactionReference(): TransactionReferenceInfo;
|
|
25
|
-
export declare function GetCurrentEndpointSummaryLocal(): {
|
|
26
|
-
endPointSummary: {
|
|
27
|
-
no: string;
|
|
28
|
-
endPointName: string;
|
|
29
|
-
endPointURL: string;
|
|
30
|
-
processTime: number;
|
|
31
|
-
responseStatus: string;
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
34
|
-
export declare function SetTransactionReferenceResponseObj(res: any): void;
|
|
35
|
-
export declare function SetTransactionReference(transactionReference: TransactionReferenceInfo, fn: () => any): Observable<any>;
|
|
36
|
-
export declare function SetTransactionReferentDecorator(transactionReference: TransactionReferenceInfo): MethodDecorator;
|
|
37
|
-
export declare function GetExternalTransactionInfo(): ExternalTransactionInfo;
|
|
38
|
-
export declare function ModHeaderForExternalTransaction(headers: Record<string, any> | any): any;
|
|
39
|
-
export declare function SetExternalTransactionInfo(externalTransactionInfo: ExternalTransactionInfo, fn: () => any): any;
|
|
40
|
-
export declare function SetRequestTransactionInfo(request: any): void;
|
|
41
|
-
export declare function SetIsUsedExternalInfo(fn: NextFunction): void;
|
|
42
|
-
export declare function returnLogLevel(level: string): LOG_LEVEL;
|
|
43
|
-
export declare function returnLogFormatType(formatType: string): FORMAT_TYPE;
|
|
@@ -1,180 +0,0 @@
|
|
|
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.GetTransactionReference = GetTransactionReference;
|
|
7
|
-
exports.GetCurrentEndpointSummaryLocal = GetCurrentEndpointSummaryLocal;
|
|
8
|
-
exports.SetTransactionReferenceResponseObj = SetTransactionReferenceResponseObj;
|
|
9
|
-
exports.SetTransactionReference = SetTransactionReference;
|
|
10
|
-
exports.SetTransactionReferentDecorator = SetTransactionReferentDecorator;
|
|
11
|
-
exports.GetExternalTransactionInfo = GetExternalTransactionInfo;
|
|
12
|
-
exports.ModHeaderForExternalTransaction = ModHeaderForExternalTransaction;
|
|
13
|
-
exports.SetExternalTransactionInfo = SetExternalTransactionInfo;
|
|
14
|
-
exports.SetRequestTransactionInfo = SetRequestTransactionInfo;
|
|
15
|
-
exports.SetIsUsedExternalInfo = SetIsUsedExternalInfo;
|
|
16
|
-
exports.returnLogLevel = returnLogLevel;
|
|
17
|
-
exports.returnLogFormatType = returnLogFormatType;
|
|
18
|
-
const tracnsaction_info_1 = require("../../../common/async-storage/tracnsaction-info");
|
|
19
|
-
const tools_1 = require("../../../utils/tools");
|
|
20
|
-
const microtime_1 = __importDefault(require("microtime"));
|
|
21
|
-
const aicf_dto_1 = require("../../aicf/dtos/aicf.dto");
|
|
22
|
-
const external_transaction_info_1 = require("../../../common/async-storage/external-transaction-info");
|
|
23
|
-
const configurations_1 = require("../../../config/configurations");
|
|
24
|
-
const summaryEndpoint_info_1 = require("../../../common/async-storage/summaryEndpoint-info");
|
|
25
|
-
function GetTransactionReference() {
|
|
26
|
-
let transactionInfo = tracnsaction_info_1.transactionInfoLocalStorage.getStore();
|
|
27
|
-
if (transactionInfo) {
|
|
28
|
-
transactionInfo.transactionId ??= '';
|
|
29
|
-
transactionInfo.sessionId ??= '';
|
|
30
|
-
transactionInfo.originSession ??= '';
|
|
31
|
-
transactionInfo.serviceStartTime ??= 0;
|
|
32
|
-
transactionInfo.recordName ??= 'undefined';
|
|
33
|
-
transactionInfo.maskingLogData ??= false;
|
|
34
|
-
transactionInfo.specificKeyMasking ??= [];
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
transactionInfo = {
|
|
38
|
-
action: '',
|
|
39
|
-
requestObject: {},
|
|
40
|
-
transactionId: '',
|
|
41
|
-
sessionId: '',
|
|
42
|
-
originSession: '',
|
|
43
|
-
serviceStartTime: 0,
|
|
44
|
-
recordName: 'undefined',
|
|
45
|
-
maskingLogData: false,
|
|
46
|
-
specificKeyMasking: [],
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
return transactionInfo;
|
|
50
|
-
}
|
|
51
|
-
function GetCurrentEndpointSummaryLocal() {
|
|
52
|
-
const currentSummary = summaryEndpoint_info_1.summaryInfoLocal.getStore() || [];
|
|
53
|
-
if (currentSummary.length) {
|
|
54
|
-
return {
|
|
55
|
-
endPointSummary: currentSummary.map((edrDetail, index) => {
|
|
56
|
-
return {
|
|
57
|
-
no: (index + 1).toString(),
|
|
58
|
-
endPointName: edrDetail.endPointName,
|
|
59
|
-
endPointURL: edrDetail.endPointURL,
|
|
60
|
-
processTime: edrDetail.processTime,
|
|
61
|
-
responseStatus: edrDetail.responseStatus,
|
|
62
|
-
};
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function SetTransactionReferenceResponseObj(res) {
|
|
68
|
-
tracnsaction_info_1.transactionInfoLocalStorage.getStore().responseObject = res;
|
|
69
|
-
}
|
|
70
|
-
function SetTransactionReference(transactionReference, fn) {
|
|
71
|
-
const startTime = microtime_1.default.now();
|
|
72
|
-
transactionReference.transactionId ??= (0, tools_1.generateTID)();
|
|
73
|
-
transactionReference.sessionId ??= startTime.toString();
|
|
74
|
-
transactionReference.serviceStartTime ??= startTime;
|
|
75
|
-
transactionReference.recordName ??= null;
|
|
76
|
-
transactionReference.originSession ??= null;
|
|
77
|
-
transactionReference.requestObject ??= {};
|
|
78
|
-
transactionReference.action ??= '';
|
|
79
|
-
const transactionInfo = {
|
|
80
|
-
transactionId: transactionReference.transactionId,
|
|
81
|
-
sessionId: transactionReference.sessionId,
|
|
82
|
-
serviceStartTime: transactionReference.serviceStartTime,
|
|
83
|
-
recordName: transactionReference.recordName,
|
|
84
|
-
originSession: transactionReference.originSession,
|
|
85
|
-
requestObject: transactionReference.requestObject,
|
|
86
|
-
action: transactionReference.action,
|
|
87
|
-
maskingLogData: false,
|
|
88
|
-
specificKeyMasking: [],
|
|
89
|
-
};
|
|
90
|
-
return tracnsaction_info_1.transactionInfoLocalStorage.run(transactionInfo, () => {
|
|
91
|
-
return summaryEndpoint_info_1.summaryInfoLocal.run([], () => fn());
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function SetTransactionReferentDecorator(transactionReference) {
|
|
95
|
-
return (target, propertyKey, descriptor) => {
|
|
96
|
-
const originalMethod = descriptor.value;
|
|
97
|
-
descriptor.value = async function (...args) {
|
|
98
|
-
const startTime = microtime_1.default.now();
|
|
99
|
-
transactionReference.serviceStartTime = startTime;
|
|
100
|
-
transactionReference.transactionId = (0, tools_1.generateTID)();
|
|
101
|
-
transactionReference.sessionId = startTime.toString();
|
|
102
|
-
return SetTransactionReference(transactionReference, () => originalMethod.apply(this, args));
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
function GetExternalTransactionInfo() {
|
|
107
|
-
const externalInfo = external_transaction_info_1.externalTransactionInfoLocal.getStore() ?? {};
|
|
108
|
-
externalInfo.action ??= '';
|
|
109
|
-
externalInfo.subAction ??= '';
|
|
110
|
-
externalInfo.subSessionId ??= '';
|
|
111
|
-
externalInfo.serviceStartTime ??= 0;
|
|
112
|
-
externalInfo.dependency ??= '';
|
|
113
|
-
return {
|
|
114
|
-
action: externalInfo.action,
|
|
115
|
-
dependency: externalInfo.dependency,
|
|
116
|
-
subAction: externalInfo.subAction,
|
|
117
|
-
subSessionId: externalInfo.subSessionId,
|
|
118
|
-
serviceStartTime: externalInfo.serviceStartTime,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function ModHeaderForExternalTransaction(headers) {
|
|
122
|
-
const transactionRef = GetTransactionReference();
|
|
123
|
-
const externalRef = external_transaction_info_1.externalTransactionInfoLocal.getStore();
|
|
124
|
-
return {
|
|
125
|
-
...headers,
|
|
126
|
-
'x-ais-orderref': transactionRef.transactionId || '',
|
|
127
|
-
'x-origin-session': `${transactionRef.sessionId}|${externalRef.subSessionId}`,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function SetExternalTransactionInfo(externalTransactionInfo, fn) {
|
|
131
|
-
externalTransactionInfo.serviceStartTime ??= microtime_1.default.now();
|
|
132
|
-
const store = {
|
|
133
|
-
dependency: externalTransactionInfo.dependency,
|
|
134
|
-
subSessionId: externalTransactionInfo.subSessionId ?? (0, tools_1.generateRandomString)(),
|
|
135
|
-
serviceStartTime: externalTransactionInfo.serviceStartTime,
|
|
136
|
-
action: externalTransactionInfo.action,
|
|
137
|
-
subAction: externalTransactionInfo.subAction,
|
|
138
|
-
isUsed: false,
|
|
139
|
-
};
|
|
140
|
-
return external_transaction_info_1.externalTransactionInfoLocal.run(store, () => {
|
|
141
|
-
return fn();
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function SetRequestTransactionInfo(request) {
|
|
145
|
-
tracnsaction_info_1.transactionInfoLocalStorage.getStore().requestObject = request;
|
|
146
|
-
}
|
|
147
|
-
function SetIsUsedExternalInfo(fn) {
|
|
148
|
-
const externalInfo = external_transaction_info_1.externalTransactionInfoLocal.getStore();
|
|
149
|
-
externalInfo.isUsed = true;
|
|
150
|
-
return external_transaction_info_1.externalTransactionInfoLocal.run(externalInfo, () => {
|
|
151
|
-
return fn();
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
function returnLogLevel(level) {
|
|
155
|
-
switch (level.toLowerCase()) {
|
|
156
|
-
case aicf_dto_1.LOG_LEVEL.INFO:
|
|
157
|
-
return aicf_dto_1.LOG_LEVEL.INFO;
|
|
158
|
-
case aicf_dto_1.LOG_LEVEL.DEBUG:
|
|
159
|
-
return aicf_dto_1.LOG_LEVEL.DEBUG;
|
|
160
|
-
case aicf_dto_1.LOG_LEVEL.WARNING:
|
|
161
|
-
return aicf_dto_1.LOG_LEVEL.WARNING;
|
|
162
|
-
case aicf_dto_1.LOG_LEVEL.ERROR:
|
|
163
|
-
return aicf_dto_1.LOG_LEVEL.ERROR;
|
|
164
|
-
default:
|
|
165
|
-
return aicf_dto_1.LOG_LEVEL.INFO;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function returnLogFormatType(formatType) {
|
|
169
|
-
switch (formatType.toLowerCase()) {
|
|
170
|
-
case configurations_1.FORMAT_TYPE.CLOUDRON:
|
|
171
|
-
return configurations_1.FORMAT_TYPE.CLOUDRON;
|
|
172
|
-
case configurations_1.FORMAT_TYPE.AICF:
|
|
173
|
-
return configurations_1.FORMAT_TYPE.AICF;
|
|
174
|
-
case configurations_1.FORMAT_TYPE.ESB:
|
|
175
|
-
return configurations_1.FORMAT_TYPE.ESB;
|
|
176
|
-
default:
|
|
177
|
-
return configurations_1.FORMAT_TYPE.AICF;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
//# sourceMappingURL=global-function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global-function.js","sourceRoot":"","sources":["../../../../src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EAAE,GAAG,EAAE;QACzD,OAAO,EAAE,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,KAAa;IAC1C,QAAQ,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QAC5B,KAAK,oBAAS,CAAC,IAAI;YACjB,OAAO,oBAAS,CAAC,IAAI,CAAC;QACxB,KAAK,oBAAS,CAAC,KAAK;YAClB,OAAO,oBAAS,CAAC,KAAK,CAAC;QACzB,KAAK,oBAAS,CAAC,OAAO;YACpB,OAAO,oBAAS,CAAC,OAAO,CAAC;QAC3B,KAAK,oBAAS,CAAC,KAAK;YAClB,OAAO,oBAAS,CAAC,KAAK,CAAC;QACzB;YACE,OAAO,oBAAS,CAAC,IAAI,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,SAAgB,mBAAmB,CAAC,UAAkB;IACpD,QAAQ,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;QACjC,KAAK,4BAAW,CAAC,QAAQ;YACvB,OAAO,4BAAW,CAAC,QAAQ,CAAC;QAC9B,KAAK,4BAAW,CAAC,IAAI;YACnB,OAAO,4BAAW,CAAC,IAAI,CAAC;QAC1B,KAAK,4BAAW,CAAC,GAAG;YAClB,OAAO,4BAAW,CAAC,GAAG,CAAC;QACzB;YACE,OAAO,4BAAW,CAAC,IAAI,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
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 recordName = this.reflector.get('recordName', context.getHandler());
|
|
22
|
-
const maskingLogData = this.reflector.get('maskingLogData', context.getHandler());
|
|
23
|
-
const store = tracnsaction_info_1.transactionInfoLocalStorage.getStore();
|
|
24
|
-
if (recordName && store) {
|
|
25
|
-
store.recordName = recordName;
|
|
26
|
-
if (maskingLogData) {
|
|
27
|
-
store.maskingLogData = true;
|
|
28
|
-
store.specificKeyMasking = maskingLogData;
|
|
29
|
-
}
|
|
30
|
-
return tracnsaction_info_1.transactionInfoLocalStorage.run(store, () => {
|
|
31
|
-
return true;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
exports.LoggerGuard = LoggerGuard;
|
|
40
|
-
exports.LoggerGuard = LoggerGuard = __decorate([
|
|
41
|
-
(0, common_1.Injectable)(),
|
|
42
|
-
__metadata("design:paramtypes", [core_1.Reflector])
|
|
43
|
-
], LoggerGuard);
|
|
44
|
-
//# sourceMappingURL=logger.guard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAC1E,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CACvC,gBAAgB,EAChB,OAAO,CAAC,UAAU,EAAE,CACrB,CAAC;QAEF,MAAM,KAAK,GAAG,+CAA2B,CAAC,QAAQ,EAAE,CAAC;QAErD,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;YACxB,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;YAC9B,IAAI,cAAc,EAAE,CAAC;gBACnB,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC5B,KAAK,CAAC,kBAAkB,GAAG,cAAc,CAAC;YAC5C,CAAC;YACD,OAAO,+CAA2B,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AA1BY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAE6B,gBAAS;GADtC,WAAW,CA0BvB"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
export declare class AmqpInterceptor implements NestInterceptor {
|
|
4
|
-
constructor();
|
|
5
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
|
6
|
-
}
|