import { APIGatewayEvent } from 'aws-lambda'; /** * An HTTP request object. * * @export * @class Request */ export declare class Request { /** * The request identifier. * * @type {string} * @memberof Request */ id: string; /** * The decoded authorization JWT information. * * @type {*} * @memberof Request */ auth: any; /** * The Javascript representation of the request body. * * @type {*} * @memberof Request */ data: any; /** * The path requested. * * @type {string} * @memberof Request */ path: string; /** * The method or verb requested. * * @type {string} * @memberof Request */ method: string; /** * The body of the request. * * @type {(string | null)} * @memberof Request */ body: string | null; /** * The underlying serverless event object. * * @type {APIGatewayEvent} * @memberof Request */ event: APIGatewayEvent; /** * The request headers. * * @type {{ [name: string]: string }} * @memberof Request */ headers: { [name: string]: string; }; /** * The query parameters. * * @type {({ [name: string]: string } | null)} * @memberof Request */ query: { [name: string]: string; } | null; /** * The path parameters. * * @type {({ [name: string]: string } | null)} * @memberof Request */ params: { [name: string]: string; } | null; /** * Creates an instance of Request. * @param {APIGatewayEvent} event * @memberof Request */ constructor(event: APIGatewayEvent); /** * Parses the body of a request if the Content-Type header is * application/json. If parsing fails, a Bad Request is thrown. * * @private * @throws {BadRequest} * @memberof Request */ private parseBody(); }