@mountainpass/server-agnostic-functions-aws
Version:
Provides an interface for writing server-agnostic (serverless) functions.
14 lines (13 loc) • 808 B
TypeScript
import { AgnosticRouter, AgnosticRouterWrapperInterface, HttpRequest, HttpResponse } from '@mountainpass/server-agnostic-functions-core';
import { APIGatewayProxyResult } from 'aws-lambda';
import { AwsHandler, AwsRequest } from '../utils/RequestResponseMapping';
/**
* Maps the AWS event to a HttpRequest, handles the route, and maps the response to an AWS APIGatewayProxyResult.
* @param agnosticRouter
* @returns
*/
export declare class AwsWrapper extends AgnosticRouterWrapperInterface<AwsRequest, APIGatewayProxyResult, AwsHandler> {
mapRequest(from: AwsRequest, to?: HttpRequest<any>): Promise<HttpRequest<any>>;
mapResponse(from: HttpResponse<any>, to?: APIGatewayProxyResult): Promise<APIGatewayProxyResult>;
wrap(agnosticRouter: AgnosticRouter<any, any>): AwsHandler;
}