@recursyve/nestjs-data-filter 11.2.0 → 11.2.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.
@@ -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 declare function OpenApiDynamicFilterController<T extends Type, D>(Base: T): Type<DynamicFilterController<D>> & (abstract new (filterService: FilterService<D>) => DynamicFilterController<D>);
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: 'Returns file data as binary (Buffer) or as text (string) depending on the export type.',
72
+ description: "Returns file data as binary (Buffer) or as text (string) depending on the export type.",
73
73
  content: {
74
- 'application/octet-stream': {
74
+ "application/octet-stream": {
75
75
  schema: {
76
76
  oneOf: [
77
- { type: 'string', format: 'binary' },
78
- { type: 'string' }
77
+ { type: "string", format: "binary" },
78
+ { type: "string" }
79
79
  ]
80
80
  }
81
81
  }
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nestjs-data-filter",
3
- "version": "11.2.0",
3
+ "version": "11.2.1",
4
4
  "description": "NestJs DataFilter library",
5
5
  "main": "index.js",
6
6
  "scripts": {