@recursyve/nestjs-data-filter 11.2.0 → 11.3.0
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,4 +1,8 @@
|
|
|
1
1
|
import { Type } from "@nestjs/common";
|
|
2
|
+
import { ApiParamOptions } from "@nestjs/swagger/dist/decorators/api-param.decorator";
|
|
2
3
|
import { DynamicFilterController } from "../..";
|
|
3
4
|
import { FilterService } from "../filter.service";
|
|
4
|
-
export
|
|
5
|
+
export type OpenApiDynamicFilterControllerOptions = {
|
|
6
|
+
param?: ApiParamOptions;
|
|
7
|
+
};
|
|
8
|
+
export declare function OpenApiDynamicFilterController<T extends Type, D>(Base: T, options?: OpenApiDynamicFilterControllerOptions): Type<DynamicFilterController<D>> & (abstract new (filterService: FilterService<D>) => DynamicFilterController<D>);
|
|
@@ -19,7 +19,7 @@ const __1 = require("../..");
|
|
|
19
19
|
const filter_query_guard_1 = require("../guards/filter-query.guard");
|
|
20
20
|
const data_file_download_interceptor_1 = require("../interceptors/data-file-download.interceptor");
|
|
21
21
|
const filter_resource_value_model_1 = require("../models/filter-resource-value.model");
|
|
22
|
-
function OpenApiDynamicFilterController(Base) {
|
|
22
|
+
function OpenApiDynamicFilterController(Base, options) {
|
|
23
23
|
const _FilterResultModel = (0, __1.FilterResultModelMixin)(Base);
|
|
24
24
|
class _FilterController extends __1.DynamicFilterController {
|
|
25
25
|
async filter(query, req) {
|
|
@@ -69,13 +69,13 @@ function OpenApiDynamicFilterController(Base) {
|
|
|
69
69
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
70
70
|
(0, common_1.UseInterceptors)(data_file_download_interceptor_1.DataFileDownloadInterceptor),
|
|
71
71
|
(0, swagger_1.ApiOkResponse)({
|
|
72
|
-
description:
|
|
72
|
+
description: "Returns file data as binary (Buffer) or as text (string) depending on the export type.",
|
|
73
73
|
content: {
|
|
74
|
-
|
|
74
|
+
"application/octet-stream": {
|
|
75
75
|
schema: {
|
|
76
76
|
oneOf: [
|
|
77
|
-
{ type:
|
|
78
|
-
{ type:
|
|
77
|
+
{ type: "string", format: "binary" },
|
|
78
|
+
{ type: "string" }
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -91,7 +91,7 @@ function OpenApiDynamicFilterController(Base) {
|
|
|
91
91
|
__metadata("design:returntype", Promise)
|
|
92
92
|
], _FilterController.prototype, "downloadData", null);
|
|
93
93
|
__decorate([
|
|
94
|
-
(0, common_1.
|
|
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) {
|
|
|
100
100
|
__metadata("design:returntype", Promise)
|
|
101
101
|
], _FilterController.prototype, "getFilterConfig", null);
|
|
102
102
|
__decorate([
|
|
103
|
-
(0, common_1.
|
|
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) {
|
|
|
110
110
|
__metadata("design:returntype", Promise)
|
|
111
111
|
], _FilterController.prototype, "searchFilterResourceValue", null);
|
|
112
112
|
__decorate([
|
|
113
|
-
(0, common_1.
|
|
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)()),
|
|
@@ -119,6 +119,9 @@ function OpenApiDynamicFilterController(Base) {
|
|
|
119
119
|
__metadata("design:paramtypes", [__1.FilterConfigurationSearchModel, Object]),
|
|
120
120
|
__metadata("design:returntype", Promise)
|
|
121
121
|
], _FilterController.prototype, "searchFilterConfigValues", null);
|
|
122
|
+
if (options === null || options === void 0 ? void 0 : options.param) {
|
|
123
|
+
(0, common_1.applyDecorators)((0, swagger_1.ApiParam)(options.param))(_FilterController);
|
|
124
|
+
}
|
|
122
125
|
// @ts-ignore
|
|
123
126
|
return _FilterController;
|
|
124
127
|
}
|
|
@@ -14,10 +14,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.OpenApiFilterController = OpenApiFilterController;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
17
18
|
const __1 = require("../..");
|
|
18
19
|
const filter_query_guard_1 = require("../guards/filter-query.guard");
|
|
19
20
|
const data_file_download_interceptor_1 = require("../interceptors/data-file-download.interceptor");
|
|
20
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
21
21
|
const filter_resource_value_model_1 = require("../models/filter-resource-value.model");
|
|
22
22
|
function OpenApiFilterController(Base) {
|
|
23
23
|
const _FilterResultModel = (0, __1.FilterResultModelMixin)(Base);
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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)()),
|