@nestia/core
Version:
Super-fast validation decorators of NestJS
24 lines (23 loc) • 952 B
TypeScript
import { IRequestBodyValidator } from "../options/IRequestBodyValidator";
/**
* Encrypted body decorator.
*
* `EncryptedBody` is a decorator function getting `application/json` typed data
* from request body which has been encrypted by AES-128/256 algorithm. Also,
* `EncryptedBody` validates the request body data type through
* [typia](https://github.com/samchon/typia) ad the validation speed is maximum
* 15,000x times faster than `class-validator`.
*
* For reference, when the request body data is not following the promised type
* `T`, `BadRequestException` error (status code: 400) would be thrown. Also,
* `EncryptedRoute` decrypts request body using those options.
*
* - AES-128/256
* - CBC mode
* - PKCS #5 Padding
* - Base64 Encoding
*
* @author Jeongho Nam - https://github.com/samchon
* @returns Parameter decorator
*/
export declare function EncryptedBody<T>(validator?: IRequestBodyValidator<T>): ParameterDecorator;