@mondart/nestjs-common-module 1.1.51 → 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/enums/shared-messages.enum.d.ts +6 -5
- package/dist/enums/shared-messages.enum.js +6 -5
- 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
|
};
|
|
@@ -3,15 +3,16 @@ export declare enum SharedMessages {
|
|
|
3
3
|
NOT_IMPLEMENTED = "This feature has not been implemented yet.",
|
|
4
4
|
RECURSIVE_CHILD = "Some children IDs are invalid, the parent product can not be used in children, it is recursive.",
|
|
5
5
|
SUCCESSFUL = "Operation completed successfully.",
|
|
6
|
-
|
|
6
|
+
IS_UNIQUE = "Field must be unique.",
|
|
7
|
+
FIELD_REQUIRE = "Field {0} is Required",
|
|
8
|
+
OPERATION_FIELD = "This operation can not be completed! {0}",
|
|
9
|
+
DUPLICATED_FIELD = "The {0} is reserved.",
|
|
10
|
+
INVALID_ITEMS = "{0} items are invalid.",
|
|
7
11
|
CREATE_FAILED = "Failed to create: {0}.",
|
|
8
12
|
CREATE_DENIED = "Permission denied to create: {0}.",
|
|
9
13
|
FETCH_FAILED = "Failed to fetch: {0}.",
|
|
10
14
|
RESOURCE_NOT_FOUND = "The requested {0} was not found.",
|
|
11
|
-
|
|
12
|
-
DUPLICATED_CODE = "The Code is reserved.",
|
|
13
|
-
INVALID_COMPOSITE_SUB_ITEMS = "Composite sub items are invalid.",
|
|
14
|
-
INVALID_GROUPED_SUB_ITEMS = "Sub items are invalid.",
|
|
15
|
+
RESOURCE_ALREADY_EXISTS = "The Requested {0} is already exists!.",
|
|
15
16
|
UPDATE_FAILED = "Failed to update: {0}.",
|
|
16
17
|
UPDATE_DENIED = "Permission denied to update: {0}.",
|
|
17
18
|
UPSERT_FAILED = "Failed to upsert: {0}.",
|
|
@@ -7,15 +7,16 @@ var SharedMessages;
|
|
|
7
7
|
SharedMessages["NOT_IMPLEMENTED"] = "This feature has not been implemented yet.";
|
|
8
8
|
SharedMessages["RECURSIVE_CHILD"] = "Some children IDs are invalid, the parent product can not be used in children, it is recursive.";
|
|
9
9
|
SharedMessages["SUCCESSFUL"] = "Operation completed successfully.";
|
|
10
|
-
SharedMessages["
|
|
10
|
+
SharedMessages["IS_UNIQUE"] = "Field must be unique.";
|
|
11
|
+
SharedMessages["FIELD_REQUIRE"] = "Field {0} is Required";
|
|
12
|
+
SharedMessages["OPERATION_FIELD"] = "This operation can not be completed! {0}";
|
|
13
|
+
SharedMessages["DUPLICATED_FIELD"] = "The {0} is reserved.";
|
|
14
|
+
SharedMessages["INVALID_ITEMS"] = "{0} items are invalid.";
|
|
11
15
|
SharedMessages["CREATE_FAILED"] = "Failed to create: {0}.";
|
|
12
16
|
SharedMessages["CREATE_DENIED"] = "Permission denied to create: {0}.";
|
|
13
17
|
SharedMessages["FETCH_FAILED"] = "Failed to fetch: {0}.";
|
|
14
18
|
SharedMessages["RESOURCE_NOT_FOUND"] = "The requested {0} was not found.";
|
|
15
|
-
SharedMessages["
|
|
16
|
-
SharedMessages["DUPLICATED_CODE"] = "The Code is reserved.";
|
|
17
|
-
SharedMessages["INVALID_COMPOSITE_SUB_ITEMS"] = "Composite sub items are invalid.";
|
|
18
|
-
SharedMessages["INVALID_GROUPED_SUB_ITEMS"] = "Sub items are invalid.";
|
|
19
|
+
SharedMessages["RESOURCE_ALREADY_EXISTS"] = "The Requested {0} is already exists!.";
|
|
19
20
|
SharedMessages["UPDATE_FAILED"] = "Failed to update: {0}.";
|
|
20
21
|
SharedMessages["UPDATE_DENIED"] = "Permission denied to update: {0}.";
|
|
21
22
|
SharedMessages["UPSERT_FAILED"] = "Failed to upsert: {0}.";
|