@enter-at/lambda-handlers
Version:
An opinionated Typescript package that facilitates specifying AWS Lambda handlers including input validation, error handling and response formatting.
19 lines (18 loc) • 878 B
TypeScript
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";
import { CORSHeader } from "../header";
import { APIGatewayResponse } from "../response";
import { BaseHandler, BaseHandlerArguments } from "./BaseHandler";
export interface APIGatewayProxyHandlerArguments extends BaseHandlerArguments {
cors?: CORSHeader;
}
export declare class APIGatewayProxyHandler extends BaseHandler {
private static handleError;
private readonly corsHeader;
constructor(args?: APIGatewayProxyHandlerArguments);
protected after(result: APIGatewayResponse): APIGatewayProxyResult;
protected onException(exception: Error): APIGatewayProxyResult;
protected formatInput(event: APIGatewayProxyEvent): APIGatewayProxyEvent;
protected formatOutput(result: APIGatewayResponse): APIGatewayProxyResult;
private createResponse;
private createHeaders;
}