@maioradv/nestjs-core 1.0.4 → 1.0.5
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@nestjs/common";
|
|
2
2
|
import { ApiResponseOptions } from "@nestjs/swagger";
|
|
3
|
-
import { RelationDefs } from "
|
|
3
|
+
import { RelationDefs } from "../../decorators";
|
|
4
4
|
declare const ApiPaginatedResponse: <TModel extends Type<any>>(model: TModel, relations?: RelationDefs, options?: ApiResponseOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
5
5
|
export default ApiPaginatedResponse;
|
|
@@ -7,7 +7,7 @@ const common_1 = require("@nestjs/common");
|
|
|
7
7
|
const swagger_1 = require("@nestjs/swagger");
|
|
8
8
|
const paginated_meta_dto_1 = __importDefault(require("./paginated-meta.dto"));
|
|
9
9
|
const paginated_dto_1 = __importDefault(require("./paginated.dto"));
|
|
10
|
-
const decorators_1 = require("
|
|
10
|
+
const decorators_1 = require("../../decorators");
|
|
11
11
|
const ApiPaginatedResponse = (model, relations, options) => {
|
|
12
12
|
const { properties, extraModels } = relations ? (0, decorators_1.handleRelationsForSwagger)(relations) : { properties: undefined, extraModels: [] };
|
|
13
13
|
return (0, common_1.applyDecorators)((0, swagger_1.ApiExtraModels)(paginated_meta_dto_1.default, paginated_dto_1.default, model, ...extraModels), (0, swagger_1.ApiOkResponse)({
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SortingDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
const
|
|
14
|
+
const enums_1 = require("./enums");
|
|
15
15
|
const swagger_1 = require("@nestjs/swagger");
|
|
16
16
|
class SortingDto {
|
|
17
17
|
get orderBy() {
|
|
@@ -27,20 +27,20 @@ class SortingDto {
|
|
|
27
27
|
}
|
|
28
28
|
exports.SortingDto = SortingDto;
|
|
29
29
|
__decorate([
|
|
30
|
-
(0, swagger_1.ApiPropertyOptional)({ enum:
|
|
31
|
-
(0, class_validator_1.IsEnum)(
|
|
30
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: enums_1.Sorting }),
|
|
31
|
+
(0, class_validator_1.IsEnum)(enums_1.Sorting),
|
|
32
32
|
(0, class_validator_1.IsOptional)(),
|
|
33
33
|
__metadata("design:type", String)
|
|
34
34
|
], SortingDto.prototype, "id", void 0);
|
|
35
35
|
__decorate([
|
|
36
|
-
(0, swagger_1.ApiPropertyOptional)({ enum:
|
|
37
|
-
(0, class_validator_1.IsEnum)(
|
|
36
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: enums_1.Sorting }),
|
|
37
|
+
(0, class_validator_1.IsEnum)(enums_1.Sorting),
|
|
38
38
|
(0, class_validator_1.IsOptional)(),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], SortingDto.prototype, "createdAt", void 0);
|
|
41
41
|
__decorate([
|
|
42
|
-
(0, swagger_1.ApiPropertyOptional)({ enum:
|
|
43
|
-
(0, class_validator_1.IsEnum)(
|
|
42
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: enums_1.Sorting }),
|
|
43
|
+
(0, class_validator_1.IsEnum)(enums_1.Sorting),
|
|
44
44
|
(0, class_validator_1.IsOptional)(),
|
|
45
45
|
__metadata("design:type", String)
|
|
46
46
|
], SortingDto.prototype, "updatedAt", void 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maioradv/nestjs-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "NestJS helpers by MaiorADV",
|
|
5
5
|
"repository": "https://github.com/maioradv/nestjs-core.git",
|
|
6
6
|
"author": "Maior ADV Srl",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"/dist"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"publish:npm": "npm publish --access public"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"@nestjs/common": "^10.3.8",
|