@mondart/nestjs-common-module 1.1.61 → 1.1.62
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/dto/base/index.d.ts +1 -0
- package/dist/dto/base/index.js +17 -0
- package/dist/dto/index.d.ts +1 -0
- package/dist/dto/index.js +1 -0
- package/dist/dto/request/index.d.ts +1 -1
- package/dist/dto/request/index.js +1 -1
- package/dist/dto/request/kafka-request.dto.d.ts +5 -0
- package/dist/dto/request/kafka-request.dto.js +20 -0
- package/dist/dto/response/index.d.ts +0 -2
- package/dist/dto/response/index.js +0 -2
- package/dist/dto/response/kafka-failed-response.dto.d.ts +2 -2
- package/dist/dto/response/kafka-failed-response.dto.js +2 -2
- package/dist/dto/response/kafka-success-response.dto.d.ts +1 -1
- package/dist/dto/response/kafka-success-response.dto.js +2 -2
- package/dist/enums/shared-messages.enum.d.ts +1 -1
- package/dist/enums/shared-messages.enum.js +1 -1
- package/dist/filters/global-exception.filter.d.ts +2 -0
- package/dist/filters/global-exception.filter.js +25 -7
- package/dist/helpers/message-formatter.helper.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/validators/validation-options.js +1 -4
- package/package.json +1 -1
- package/dist/dto/request/event.dto.d.ts +0 -8
- package/dist/dto/request/event.dto.js +0 -44
- package/dist/dto/response/base-kafka-error-response.dto.d.ts +0 -10
- package/dist/dto/response/base-kafka-error-response.dto.js +0 -50
- /package/dist/dto/{response/base-kafka-response.dto.d.ts → base/base-kafka-event.dto.d.ts} +0 -0
- /package/dist/dto/{response/base-kafka-response.dto.js → base/base-kafka-event.dto.js} +0 -0
|
@@ -7,10 +7,7 @@ exports.validationOptions = {
|
|
|
7
7
|
transform: true,
|
|
8
8
|
whitelist: true,
|
|
9
9
|
errorHttpStatusCode: common_1.HttpStatus.UNPROCESSABLE_ENTITY,
|
|
10
|
-
exceptionFactory: (errors) => new common_1.UnprocessableEntityException({
|
|
11
|
-
status: common_1.HttpStatus.UNPROCESSABLE_ENTITY,
|
|
12
|
-
message: `Validation failed: ${errors.length} errors found`,
|
|
13
|
-
}, mapValidationErrors(errors)),
|
|
10
|
+
exceptionFactory: (errors) => new common_1.UnprocessableEntityException(`Validation failed: ${errors.length} errors found`, { cause: mapValidationErrors(errors) }),
|
|
14
11
|
};
|
|
15
12
|
function mapValidationErrors(errors) {
|
|
16
13
|
return errors.reduce((result, error) => {
|
package/package.json
CHANGED
|
@@ -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.EventDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class EventDto {
|
|
15
|
-
}
|
|
16
|
-
exports.EventDto = EventDto;
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, class_validator_1.IsString)(),
|
|
19
|
-
(0, class_validator_1.IsOptional)(),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], EventDto.prototype, "topic", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, class_validator_1.IsString)(),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], EventDto.prototype, "event_source", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, class_validator_1.IsString)(),
|
|
28
|
-
(0, class_validator_1.IsOptional)(),
|
|
29
|
-
__metadata("design:type", String)
|
|
30
|
-
], EventDto.prototype, "model", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, class_validator_1.IsString)(),
|
|
33
|
-
(0, class_validator_1.IsOptional)(),
|
|
34
|
-
__metadata("design:type", String)
|
|
35
|
-
], EventDto.prototype, "event_key", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, class_validator_1.IsOptional)(),
|
|
38
|
-
__metadata("design:type", Object)
|
|
39
|
-
], EventDto.prototype, "data", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, class_validator_1.IsNumber)(),
|
|
42
|
-
(0, class_validator_1.IsOptional)(),
|
|
43
|
-
__metadata("design:type", Number)
|
|
44
|
-
], EventDto.prototype, "partition", void 0);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseErrorResponse } from './error-response.dto';
|
|
2
|
-
export declare class BaseKafkaErrorResponseDto {
|
|
3
|
-
topic?: string;
|
|
4
|
-
event_source: string;
|
|
5
|
-
model?: string;
|
|
6
|
-
event_key?: string;
|
|
7
|
-
data?: BaseErrorResponse;
|
|
8
|
-
partition?: number;
|
|
9
|
-
status?: number;
|
|
10
|
-
}
|
|
@@ -1,50 +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.BaseKafkaErrorResponseDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const error_response_dto_1 = require("./error-response.dto");
|
|
15
|
-
class BaseKafkaErrorResponseDto {
|
|
16
|
-
}
|
|
17
|
-
exports.BaseKafkaErrorResponseDto = BaseKafkaErrorResponseDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsString)(),
|
|
20
|
-
(0, class_validator_1.IsOptional)(),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], BaseKafkaErrorResponseDto.prototype, "topic", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, class_validator_1.IsString)(),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], BaseKafkaErrorResponseDto.prototype, "event_source", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, class_validator_1.IsString)(),
|
|
29
|
-
(0, class_validator_1.IsOptional)(),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], BaseKafkaErrorResponseDto.prototype, "model", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, class_validator_1.IsString)(),
|
|
34
|
-
(0, class_validator_1.IsOptional)(),
|
|
35
|
-
__metadata("design:type", String)
|
|
36
|
-
], BaseKafkaErrorResponseDto.prototype, "event_key", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsOptional)(),
|
|
39
|
-
__metadata("design:type", error_response_dto_1.BaseErrorResponse)
|
|
40
|
-
], BaseKafkaErrorResponseDto.prototype, "data", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, class_validator_1.IsNumber)(),
|
|
43
|
-
(0, class_validator_1.IsOptional)(),
|
|
44
|
-
__metadata("design:type", Number)
|
|
45
|
-
], BaseKafkaErrorResponseDto.prototype, "partition", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, class_validator_1.IsNumber)(),
|
|
48
|
-
(0, class_validator_1.IsOptional)(),
|
|
49
|
-
__metadata("design:type", Number)
|
|
50
|
-
], BaseKafkaErrorResponseDto.prototype, "status", void 0);
|
|
File without changes
|
|
File without changes
|