lambda-middlewares
Version:
Middlewares framework for AWS Lambda.
45 lines (44 loc) • 1.01 kB
TypeScript
declare type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
export interface Event {
resource: string;
path: string;
httpMethod: HttpMethod;
headers: {
[key: string]: string;
};
multiValueHeaders: {
[key: string]: string[];
};
queryStringParameters: {
[key: string]: string;
};
multiValueQueryStringParameters: {
[key: string]: string[];
};
pathParameters: {
[key: string]: string;
};
stageVariables: {
[key: string]: string;
};
requestContext: {
[key: string]: any;
};
body: string;
isBase64Encoded: boolean;
[key: string]: any;
}
export interface Response {
isBase64Encoded?: boolean;
statusCode?: number;
headers?: {
[key: string]: string;
};
multiValueHeaders?: {
[key: string]: string[];
};
body?: string;
[key: string]: any;
}
export declare type Handler = (event: Event) => Promise<Response>;
export {};