UNPKG

@bitblit/epsilon

Version:

Tiny adapter to simplify building API gateway Lambda APIS

27 lines (26 loc) 1.22 kB
import { EpsilonRouter } from './route/epsilon-router'; import { APIGatewayEvent, Context, ProxyResult } from 'aws-lambda'; import Route from 'route-parser'; import { RouteMapping } from './route/route-mapping'; import { ExtendedAPIGatewayEvent } from '../config/http/extended-api-gateway-event'; import { EpsilonLambdaEventHandler } from '../config/epsilon-lambda-event-handler'; /** * This class functions as the adapter from a default lambda function to the handlers exposed via Epsilon */ export declare class WebHandler implements EpsilonLambdaEventHandler<APIGatewayEvent> { private routerConfig; static readonly MAXIMUM_LAMBDA_BODY_SIZE_BYTES: number; constructor(routerConfig: EpsilonRouter); get router(): EpsilonRouter; extractLabel(evt: APIGatewayEvent, context: Context): string; handlesEvent(evt: any): boolean; processEvent(event: APIGatewayEvent, context: Context): Promise<ProxyResult>; openApiLambdaHandler(evt: ExtendedAPIGatewayEvent, context: Context): Promise<ProxyResult>; findBestMatchingRoute(event: APIGatewayEvent): RouteAndParse; private cleanPath; } export interface RouteAndParse { mapping: RouteMapping; route: Route; parsed: any; }