@eventista/ticketing-common 1.0.10 → 1.0.12
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/exception/exception.filter.d.ts +5 -1
- package/dist/exception/exception.filter.js +61 -6
- package/dist/exception/exception.filter.js.map +1 -1
- package/dist/pipes/custom-validation.pipe.d.ts +2 -0
- package/dist/pipes/custom-validation.pipe.js +53 -9
- package/dist/pipes/custom-validation.pipe.js.map +1 -1
- package/dist/shared.module.js +8 -0
- package/dist/shared.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
|
|
2
|
+
import { CustomLogger } from '../logger/custom.logger';
|
|
2
3
|
export declare class GlobalExceptionFilter implements ExceptionFilter {
|
|
3
|
-
|
|
4
|
+
private readonly logger;
|
|
5
|
+
constructor(logger: CustomLogger);
|
|
6
|
+
catch(exception: any, host: ArgumentsHost): any;
|
|
7
|
+
private logError;
|
|
4
8
|
}
|
|
@@ -5,10 +5,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
8
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
15
|
exports.GlobalExceptionFilter = void 0;
|
|
10
16
|
const common_1 = require("@nestjs/common");
|
|
17
|
+
const custom_logger_1 = require("../logger/custom.logger");
|
|
11
18
|
let GlobalExceptionFilter = class GlobalExceptionFilter {
|
|
19
|
+
constructor(logger) {
|
|
20
|
+
this.logger = logger;
|
|
21
|
+
this.logger = new custom_logger_1.CustomLogger('GlobalExceptionFilter');
|
|
22
|
+
}
|
|
12
23
|
catch(exception, host) {
|
|
13
24
|
const ctx = host.switchToHttp();
|
|
14
25
|
const response = ctx.getResponse();
|
|
@@ -16,20 +27,64 @@ let GlobalExceptionFilter = class GlobalExceptionFilter {
|
|
|
16
27
|
const status = exception instanceof common_1.HttpException
|
|
17
28
|
? exception.getStatus()
|
|
18
29
|
: common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
30
|
+
if (status === common_1.HttpStatus.BAD_REQUEST && exception instanceof common_1.HttpException) {
|
|
31
|
+
const exceptionResponse = exception.getResponse();
|
|
32
|
+
if (exceptionResponse.message === 'Validation failed' && exceptionResponse.errors) {
|
|
33
|
+
const errorResponse = {
|
|
34
|
+
statusCode: status,
|
|
35
|
+
message: exceptionResponse.message,
|
|
36
|
+
errors: exceptionResponse.errors,
|
|
37
|
+
path: request.url,
|
|
38
|
+
timestamp: new Date().toISOString(),
|
|
39
|
+
};
|
|
40
|
+
return response.status(status).send(errorResponse);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (exception instanceof common_1.HttpException) {
|
|
44
|
+
const exceptionResponse = exception.getResponse();
|
|
45
|
+
const errorResponse = {
|
|
46
|
+
statusCode: status,
|
|
47
|
+
errorCode: exceptionResponse.code || status,
|
|
48
|
+
message: exception.message,
|
|
49
|
+
path: request.url,
|
|
50
|
+
timestamp: new Date().toISOString(),
|
|
51
|
+
};
|
|
52
|
+
return response.status(status).send(errorResponse);
|
|
53
|
+
}
|
|
19
54
|
const errorResponse = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
message: exception.message || 'Internal Server Error',
|
|
24
|
-
data: exception instanceof common_1.HttpException ? exception.getResponse()['data'] : null,
|
|
55
|
+
statusCode: status,
|
|
56
|
+
errorCode: status,
|
|
57
|
+
message: 'Internal Server Error',
|
|
25
58
|
path: request.url,
|
|
26
59
|
timestamp: new Date().toISOString(),
|
|
27
60
|
};
|
|
61
|
+
this.logError(exception, request);
|
|
28
62
|
response.status(status).send(errorResponse);
|
|
29
63
|
}
|
|
64
|
+
logError(exception, request) {
|
|
65
|
+
const status = exception instanceof common_1.HttpException
|
|
66
|
+
? exception.getStatus()
|
|
67
|
+
: common_1.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
68
|
+
this.logger.error(`[${request.method}] ${request.url} - Status: ${status}`, {
|
|
69
|
+
exception: {
|
|
70
|
+
name: exception.name,
|
|
71
|
+
message: exception.message,
|
|
72
|
+
stack: exception.stack,
|
|
73
|
+
},
|
|
74
|
+
request: {
|
|
75
|
+
headers: request.headers,
|
|
76
|
+
query: request.query,
|
|
77
|
+
body: request.body,
|
|
78
|
+
params: request.params,
|
|
79
|
+
},
|
|
80
|
+
timestamp: new Date().toISOString(),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
30
83
|
};
|
|
31
84
|
exports.GlobalExceptionFilter = GlobalExceptionFilter;
|
|
32
85
|
exports.GlobalExceptionFilter = GlobalExceptionFilter = __decorate([
|
|
33
|
-
(0, common_1.Catch)()
|
|
86
|
+
(0, common_1.Catch)(),
|
|
87
|
+
__param(0, (0, common_1.Inject)('Logger')),
|
|
88
|
+
__metadata("design:paramtypes", [custom_logger_1.CustomLogger])
|
|
34
89
|
], GlobalExceptionFilter);
|
|
35
90
|
//# sourceMappingURL=exception.filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.filter.js","sourceRoot":"","sources":["../../src/exception/exception.filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exception.filter.js","sourceRoot":"","sources":["../../src/exception/exception.filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;A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AAC,MAAM;aACvB;YACD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CACF,CAAC;IACJ,CAAC;CACF,CAAA;AA9FY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,cAAK,GAAE;IAGH,WAAA,IAAA,eAAM,EAAC,QAAQ,CAAC,CAAA;qCACQ,4BAAY;GAH5B,qBAAqB,CA8FjC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ArgumentMetadata, ValidationPipe, ValidationPipeOptions } from '@nestjs/common';
|
|
2
2
|
export declare class CustomValidationPipe extends ValidationPipe {
|
|
3
|
+
private readonly logger;
|
|
3
4
|
constructor(options?: ValidationPipeOptions);
|
|
4
5
|
transform(value: any, metadata: ArgumentMetadata): Promise<any>;
|
|
5
6
|
getConstraints(err: any): any;
|
|
6
7
|
deepReduce(array: any): any;
|
|
8
|
+
formatChildren(children: any): any;
|
|
7
9
|
}
|
|
@@ -8,16 +8,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var CustomValidationPipe_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.CustomValidationPipe = void 0;
|
|
13
14
|
const common_1 = require("@nestjs/common");
|
|
14
|
-
let CustomValidationPipe = class CustomValidationPipe extends common_1.ValidationPipe {
|
|
15
|
+
let CustomValidationPipe = CustomValidationPipe_1 = class CustomValidationPipe extends common_1.ValidationPipe {
|
|
15
16
|
constructor(options) {
|
|
16
17
|
super({
|
|
17
18
|
whitelist: true,
|
|
18
19
|
transform: true,
|
|
20
|
+
forbidNonWhitelisted: true,
|
|
21
|
+
validationError: { target: false, value: false },
|
|
19
22
|
...options,
|
|
20
23
|
});
|
|
24
|
+
this.logger = new common_1.Logger(CustomValidationPipe_1.name);
|
|
21
25
|
}
|
|
22
26
|
async transform(value, metadata) {
|
|
23
27
|
try {
|
|
@@ -25,19 +29,38 @@ let CustomValidationPipe = class CustomValidationPipe extends common_1.Validatio
|
|
|
25
29
|
}
|
|
26
30
|
catch (e) {
|
|
27
31
|
if (e instanceof common_1.BadRequestException) {
|
|
32
|
+
const response = e.getResponse();
|
|
28
33
|
const errors = [];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
const messages = Array.isArray(response['message'])
|
|
35
|
+
? response['message']
|
|
36
|
+
: [response['message']];
|
|
37
|
+
for (const err of messages) {
|
|
38
|
+
if (typeof err === 'string') {
|
|
39
|
+
errors.push({
|
|
40
|
+
field: 'unknown',
|
|
41
|
+
message: err,
|
|
42
|
+
constraints: { error: err }
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const constraintMessages = err.constraints
|
|
47
|
+
? Object.values(err.constraints)
|
|
48
|
+
: [`Validation failed for '${err.property}'`];
|
|
49
|
+
errors.push({
|
|
50
|
+
field: err.property,
|
|
51
|
+
message: constraintMessages[0],
|
|
52
|
+
constraints: this.getConstraints(err),
|
|
53
|
+
children: err.children?.length ? this.formatChildren(err.children) : undefined
|
|
54
|
+
});
|
|
55
|
+
}
|
|
34
56
|
}
|
|
35
57
|
throw new common_1.BadRequestException({
|
|
36
|
-
|
|
58
|
+
statusCode: 400,
|
|
37
59
|
message: 'Validation failed',
|
|
38
60
|
errors,
|
|
39
61
|
});
|
|
40
62
|
}
|
|
63
|
+
throw e;
|
|
41
64
|
}
|
|
42
65
|
}
|
|
43
66
|
getConstraints(err) {
|
|
@@ -47,9 +70,11 @@ let CustomValidationPipe = class CustomValidationPipe extends common_1.Validatio
|
|
|
47
70
|
if (typeof err == 'object' && err.constraints) {
|
|
48
71
|
return err.constraints;
|
|
49
72
|
}
|
|
50
|
-
return this.deepReduce(err.children);
|
|
73
|
+
return this.deepReduce(err.children || []);
|
|
51
74
|
}
|
|
52
75
|
deepReduce(array) {
|
|
76
|
+
if (!array || !array.length)
|
|
77
|
+
return {};
|
|
53
78
|
return array.reduce((accumulator, currentValue) => {
|
|
54
79
|
if (currentValue.children && currentValue.children.length > 0) {
|
|
55
80
|
return this.deepReduce(currentValue.children);
|
|
@@ -60,9 +85,28 @@ let CustomValidationPipe = class CustomValidationPipe extends common_1.Validatio
|
|
|
60
85
|
return accumulator;
|
|
61
86
|
}, {});
|
|
62
87
|
}
|
|
88
|
+
formatChildren(children) {
|
|
89
|
+
if (!children || !children.length)
|
|
90
|
+
return [];
|
|
91
|
+
return children.map(child => {
|
|
92
|
+
const result = {
|
|
93
|
+
field: child.property,
|
|
94
|
+
message: child.constraints
|
|
95
|
+
? Object.values(child.constraints)[0]
|
|
96
|
+
: `Validation failed for '${child.property}'`,
|
|
97
|
+
};
|
|
98
|
+
if (child.constraints) {
|
|
99
|
+
result.constraints = child.constraints;
|
|
100
|
+
}
|
|
101
|
+
if (child.children?.length) {
|
|
102
|
+
result.children = this.formatChildren(child.children);
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
63
107
|
};
|
|
64
108
|
exports.CustomValidationPipe = CustomValidationPipe;
|
|
65
|
-
exports.CustomValidationPipe = CustomValidationPipe = __decorate([
|
|
109
|
+
exports.CustomValidationPipe = CustomValidationPipe = CustomValidationPipe_1 = __decorate([
|
|
66
110
|
(0, common_1.Injectable)(),
|
|
67
111
|
__metadata("design:paramtypes", [Object])
|
|
68
112
|
], CustomValidationPipe);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-validation.pipe.js","sourceRoot":"","sources":["../../src/pipes/custom-validation.pipe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom-validation.pipe.js","sourceRoot":"","sources":["../../src/pipes/custom-validation.pipe.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAOwB;AAGj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AI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAChD,CAAC;YACD,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC7B,OAAO,YAAY,CAAC,WAAW,CAAC;YAClC,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAGD,cAAc,CAAC,QAAQ;QACrB,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAE7C,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC1B,MAAM,MAAM,GAAQ;gBAClB,KAAK,EAAE,KAAK,CAAC,QAAQ;gBACrB,OAAO,EAAE,KAAK,CAAC,WAAW;oBACxB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;oBACrC,CAAC,CAAC,0BAA0B,KAAK,CAAC,QAAQ,GAAG;aAChD,CAAC;YAEF,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;gBACtB,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;YACzC,CAAC;YAED,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;gBAC3B,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACxD,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA1GY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;;GACA,oBAAoB,CA0GhC"}
|
package/dist/shared.module.js
CHANGED
|
@@ -9,10 +9,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.SharedModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const config_1 = require("@nestjs/config");
|
|
12
|
+
const core_1 = require("@nestjs/core");
|
|
12
13
|
const logger_module_1 = require("./logger/logger.module");
|
|
13
14
|
const mongodb_module_1 = require("./database/mongodb/mongodb.module");
|
|
14
15
|
const cluster_module_1 = require("./cluster/modules/cluster.module");
|
|
15
16
|
const redis_module_1 = require("./database/redis/redis.module");
|
|
17
|
+
const exception_filter_1 = require("./exception/exception.filter");
|
|
16
18
|
let SharedModule = class SharedModule {
|
|
17
19
|
};
|
|
18
20
|
exports.SharedModule = SharedModule;
|
|
@@ -29,6 +31,12 @@ exports.SharedModule = SharedModule = __decorate([
|
|
|
29
31
|
cluster_module_1.ClusterModule,
|
|
30
32
|
redis_module_1.RedisModule,
|
|
31
33
|
],
|
|
34
|
+
providers: [
|
|
35
|
+
{
|
|
36
|
+
provide: core_1.APP_FILTER,
|
|
37
|
+
useClass: exception_filter_1.GlobalExceptionFilter,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
32
40
|
exports: [
|
|
33
41
|
config_1.ConfigModule,
|
|
34
42
|
mongodb_module_1.MongodbModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.module.js","sourceRoot":"","sources":["../src/shared.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,2CAA8C;AAC9C,0DAAsD;AACtD,sEAAkE;AAClE,qEAAiE;AACjE,gEAA4D;
|
|
1
|
+
{"version":3,"file":"shared.module.js","sourceRoot":"","sources":["../src/shared.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,2CAA8C;AAC9C,uCAA0C;AAC1C,0DAAsD;AACtD,sEAAkE;AAClE,qEAAiE;AACjE,gEAA4D;AAC5D,mEAAqE;AA6B9D,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IA3BxB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC;gBACnB,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC;aACrD,CAAC;YAEF,8BAAa;YACb,4BAAY;YACZ,8BAAa;YACb,0BAAW;SACZ;QACD,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,iBAAU;gBACnB,QAAQ,EAAE,wCAAqB;aAChC;SACF;QACD,OAAO,EAAE;YACP,qBAAY;YACZ,8BAAa;YACb,4BAAY;YACZ,8BAAa;YACb,0BAAW;SACZ;KACF,CAAC;GACW,YAAY,CAAG"}
|