@mondart/nestjs-common-module 1.1.52 → 1.1.53
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/request/index.d.ts +1 -0
- package/dist/dto/request/index.js +1 -0
- package/dist/dto/request/uuid.dto.d.ts +3 -0
- package/dist/dto/request/uuid.dto.js +22 -0
- package/dist/dto/response/error-response.dto.d.ts +2 -2
- package/dist/dto/response/error-response.dto.js +3 -3
- package/dist/dto/response/validation.dto.d.ts +2 -2
- package/dist/dto/response/validation.dto.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
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.UUIDDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const decorators_1 = require("../../decorators");
|
|
15
|
+
class UUIDDto {
|
|
16
|
+
}
|
|
17
|
+
exports.UUIDDto = UUIDDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({ example: 'f5639d77-d001-40e7-b88b-4ea1e11cf907' }),
|
|
20
|
+
(0, decorators_1.IsUUID)(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], UUIDDto.prototype, "uuid", void 0);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare class BaseErrorResponse {
|
|
2
2
|
message: string;
|
|
3
|
-
|
|
3
|
+
status: number;
|
|
4
4
|
details: Record<string, any>;
|
|
5
5
|
}
|
|
6
6
|
export declare class ErrorResponse extends BaseErrorResponse {
|
|
7
|
-
constructor(message: string,
|
|
7
|
+
constructor(message: string, status: number, details?: any);
|
|
8
8
|
}
|
|
@@ -21,16 +21,16 @@ __decorate([
|
|
|
21
21
|
__decorate([
|
|
22
22
|
(0, swagger_1.ApiProperty)({ type: Number }),
|
|
23
23
|
__metadata("design:type", Number)
|
|
24
|
-
], BaseErrorResponse.prototype, "
|
|
24
|
+
], BaseErrorResponse.prototype, "status", void 0);
|
|
25
25
|
__decorate([
|
|
26
26
|
(0, swagger_1.ApiProperty)(),
|
|
27
27
|
__metadata("design:type", Object)
|
|
28
28
|
], BaseErrorResponse.prototype, "details", void 0);
|
|
29
29
|
class ErrorResponse extends BaseErrorResponse {
|
|
30
|
-
constructor(message,
|
|
30
|
+
constructor(message, status, details = {}) {
|
|
31
31
|
super();
|
|
32
32
|
this.message = message;
|
|
33
|
-
this.
|
|
33
|
+
this.status = status;
|
|
34
34
|
this.details = details;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -9,12 +9,12 @@ declare class ValidationMsg {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class ValidationErrorResponseType {
|
|
11
11
|
message: string;
|
|
12
|
-
|
|
12
|
+
status: string;
|
|
13
13
|
validationMsg: ValidationMsg;
|
|
14
14
|
}
|
|
15
15
|
export declare class ValidationErrorResponseDto {
|
|
16
16
|
message: string;
|
|
17
|
-
|
|
17
|
+
status: string;
|
|
18
18
|
validationMsg: object;
|
|
19
19
|
constructor(message: string, error: {
|
|
20
20
|
validationErrors?: Array<ValidationError>;
|
|
@@ -46,7 +46,7 @@ __decorate([
|
|
|
46
46
|
__decorate([
|
|
47
47
|
(0, swagger_1.ApiProperty)({ type: String }),
|
|
48
48
|
__metadata("design:type", String)
|
|
49
|
-
], ValidationErrorResponseType.prototype, "
|
|
49
|
+
], ValidationErrorResponseType.prototype, "status", void 0);
|
|
50
50
|
__decorate([
|
|
51
51
|
(0, swagger_1.ApiProperty)({ type: ValidationMsg }),
|
|
52
52
|
__metadata("design:type", ValidationMsg)
|
|
@@ -65,7 +65,7 @@ class ValidationErrorResponseDto {
|
|
|
65
65
|
});
|
|
66
66
|
validation = validation || error.errors;
|
|
67
67
|
this.message = message;
|
|
68
|
-
this.
|
|
68
|
+
this.status = String(common_1.HttpStatus.BAD_REQUEST);
|
|
69
69
|
this.validationMsg = {
|
|
70
70
|
errors: validation,
|
|
71
71
|
};
|