UNPKG

@geekbears/gb-nest-helpers

Version:
50 lines 1.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiStandardQuery = void 0; var common_1 = require("@nestjs/common"); var swagger_1 = require("@nestjs/swagger"); /** * Add geekbears standard query parameters * @description Swagger decorator. Adds all standard query parameters * @returns A method decorator wrapping calls to `@ApiQuery()` decorator */ var ApiStandardQuery = function () { return (0, common_1.applyDecorators)((0, swagger_1.ApiQuery)({ name: 'filter', description: 'A stringified filter JSON object', schema: { type: 'string' }, required: false, }), (0, swagger_1.ApiQuery)({ name: 'populate', description: 'A comma-separated list of virtual fields to populate', schema: { type: 'string' }, required: false, }), (0, swagger_1.ApiQuery)({ name: 'deepPopulate', description: 'A stringified populate JSON object', schema: { type: 'string' }, required: false, }), (0, swagger_1.ApiQuery)({ name: 'sort', description: 'The sorting configuration to apply to returned elements', schema: { type: 'string' }, required: false, }), (0, swagger_1.ApiQuery)({ name: 'limit', description: 'The max amount of records to return', schema: { type: 'string' }, required: false, }), (0, swagger_1.ApiQuery)({ name: 'select', description: 'A comma-separated list of fields to select', schema: { type: 'string' }, required: false, }), (0, swagger_1.ApiQuery)({ name: 'skip', description: 'The amount of records to skip before returning', schema: { type: 'string' }, required: false, })); }; exports.ApiStandardQuery = ApiStandardQuery; //# sourceMappingURL=api-standard-query.decorator.js.map