@recursyve/nestjs-data-filter 11.2.1 → 11.3.1

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.
@@ -91,7 +91,7 @@ function OpenApiDynamicFilterController(Base, options) {
91
91
  __metadata("design:returntype", Promise)
92
92
  ], _FilterController.prototype, "downloadData", null);
93
93
  __decorate([
94
- (0, common_1.Post)("filter/config"),
94
+ (0, common_1.Get)("filter/config"),
95
95
  (0, swagger_1.ApiOkResponse)({ type: () => __1.FilterConfigurationModel, isArray: true }),
96
96
  (0, swagger_1.ApiOperation)({ operationId: `get${Base.name}FilterConfig` }),
97
97
  __param(0, (0, common_1.Req)()),
@@ -100,7 +100,7 @@ function OpenApiDynamicFilterController(Base, options) {
100
100
  __metadata("design:returntype", Promise)
101
101
  ], _FilterController.prototype, "getFilterConfig", null);
102
102
  __decorate([
103
- (0, common_1.Post)("filter/config/id"),
103
+ (0, common_1.Get)("filter/config/id"),
104
104
  (0, swagger_1.ApiOkResponse)({ type: () => __1.SelectFilterValue }),
105
105
  (0, swagger_1.ApiOperation)({ operationId: `search${Base.name}FilterResourceValue` }),
106
106
  __param(0, (0, common_1.Query)()),
@@ -110,7 +110,7 @@ function OpenApiDynamicFilterController(Base, options) {
110
110
  __metadata("design:returntype", Promise)
111
111
  ], _FilterController.prototype, "searchFilterResourceValue", null);
112
112
  __decorate([
113
- (0, common_1.Post)("filter/config/value"),
113
+ (0, common_1.Get)("filter/config/value"),
114
114
  (0, swagger_1.ApiOkResponse)({ type: () => __1.SelectFilterValue, isArray: true }),
115
115
  (0, swagger_1.ApiOperation)({ operationId: `search${Base.name}FilterConfigValues` }),
116
116
  __param(0, (0, common_1.Query)()),
@@ -91,7 +91,7 @@ function OpenApiFilterController(Base) {
91
91
  __metadata("design:returntype", Promise)
92
92
  ], _FilterController.prototype, "downloadData", null);
93
93
  __decorate([
94
- (0, common_1.Post)("filter/config"),
94
+ (0, common_1.Get)("filter/config"),
95
95
  (0, swagger_1.ApiOkResponse)({ type: () => __1.FilterConfigurationModel, isArray: true }),
96
96
  (0, swagger_1.ApiOperation)({ operationId: `get${Base.name}FilterConfig` }),
97
97
  __param(0, (0, common_1.Req)()),
@@ -100,7 +100,7 @@ function OpenApiFilterController(Base) {
100
100
  __metadata("design:returntype", Promise)
101
101
  ], _FilterController.prototype, "getFilterConfig", null);
102
102
  __decorate([
103
- (0, common_1.Post)("filter/config/id"),
103
+ (0, common_1.Get)("filter/config/id"),
104
104
  (0, swagger_1.ApiOkResponse)({ type: () => __1.SelectFilterValue }),
105
105
  (0, swagger_1.ApiOperation)({ operationId: `search${Base.name}FilterResourceValue` }),
106
106
  __param(0, (0, common_1.Query)()),
@@ -110,7 +110,7 @@ function OpenApiFilterController(Base) {
110
110
  __metadata("design:returntype", Promise)
111
111
  ], _FilterController.prototype, "searchFilterResourceValue", null);
112
112
  __decorate([
113
- (0, common_1.Post)("filter/config/value"),
113
+ (0, common_1.Get)("filter/config/value"),
114
114
  (0, swagger_1.ApiOkResponse)({ type: () => __1.SelectFilterValue, isArray: true }),
115
115
  (0, swagger_1.ApiOperation)({ operationId: `search${Base.name}FilterConfigValues` }),
116
116
  __param(0, (0, common_1.Query)()),
@@ -10,28 +10,36 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.FilterConfigurationSearchModel = void 0;
13
+ const common_1 = require("@nestjs/common");
13
14
  const swagger_1 = require("@nestjs/swagger");
14
15
  const class_transformer_1 = require("class-transformer");
16
+ const class_validator_1 = require("class-validator");
15
17
  class FilterConfigurationSearchModel {
16
18
  }
17
19
  exports.FilterConfigurationSearchModel = FilterConfigurationSearchModel;
18
20
  __decorate([
19
- (0, class_transformer_1.Expose)(),
21
+ (0, class_validator_1.IsString)(),
22
+ (0, class_validator_1.IsDefined)(),
20
23
  (0, swagger_1.ApiProperty)({ type: () => String }),
21
24
  __metadata("design:type", String)
22
25
  ], FilterConfigurationSearchModel.prototype, "id", void 0);
23
26
  __decorate([
24
- (0, class_transformer_1.Expose)(),
25
- (0, swagger_1.ApiProperty)({ type: () => Object }),
27
+ (0, common_1.Optional)(),
28
+ (0, class_validator_1.IsString)(),
29
+ (0, swagger_1.ApiProperty)({ type: () => String }),
26
30
  __metadata("design:type", Object)
27
31
  ], FilterConfigurationSearchModel.prototype, "value", void 0);
28
32
  __decorate([
29
- (0, class_transformer_1.Expose)(),
33
+ (0, common_1.Optional)(),
34
+ (0, class_validator_1.IsInt)(),
30
35
  (0, swagger_1.ApiPropertyOptional)({ type: () => Number }),
36
+ (0, class_transformer_1.Transform)(({ value }) => typeof value === "string" ? parseInt(value) : value),
31
37
  __metadata("design:type", Number)
32
38
  ], FilterConfigurationSearchModel.prototype, "pageSize", void 0);
33
39
  __decorate([
34
- (0, class_transformer_1.Expose)(),
40
+ (0, common_1.Optional)(),
41
+ (0, class_validator_1.IsInt)(),
35
42
  (0, swagger_1.ApiPropertyOptional)({ type: () => Number }),
43
+ (0, class_transformer_1.Transform)(({ value }) => typeof value === "string" ? parseInt(value) : value),
36
44
  __metadata("design:type", Number)
37
45
  ], FilterConfigurationSearchModel.prototype, "page", void 0);
@@ -11,17 +11,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.FilterResourceValueModel = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
- const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
15
  class FilterResourceValueModel {
16
16
  }
17
17
  exports.FilterResourceValueModel = FilterResourceValueModel;
18
18
  __decorate([
19
- (0, class_transformer_1.Expose)(),
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.IsNotEmpty)(),
20
21
  (0, swagger_1.ApiProperty)({ type: () => String }),
21
22
  __metadata("design:type", String)
22
23
  ], FilterResourceValueModel.prototype, "id", void 0);
23
24
  __decorate([
24
- (0, class_transformer_1.Expose)(),
25
+ (0, class_validator_1.IsDefined)(),
25
26
  (0, swagger_1.ApiProperty)({ oneOf: [{ type: "string" }, { type: "number" }] }),
26
27
  __metadata("design:type", Object)
27
28
  ], FilterResourceValueModel.prototype, "resourceId", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nestjs-data-filter",
3
- "version": "11.2.1",
3
+ "version": "11.3.1",
4
4
  "description": "NestJs DataFilter library",
5
5
  "main": "index.js",
6
6
  "scripts": {