multi-valued headers and query string prarameters

This commit is contained in:
Trevor Leach
2018-10-20 15:00:00 -07:00
parent 769472a079
commit 4547dc6384
2 changed files with 14 additions and 4 deletions
+9 -4
View File
@@ -8,6 +8,7 @@ declare let error: Error;
declare let bool: boolean;
declare let boolOrUndefined: boolean | undefined;
declare let apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext;
declare let apiGwEvtReqCtxOpt: AWSLambda.APIGatewayEventRequestContext | null | undefined;
declare let apiGwEvt: AWSLambda.APIGatewayEvent;
declare let customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent;
declare let clientCtx: AWSLambda.ClientContext;
@@ -102,11 +103,13 @@ str = apiGwEvtReqCtx.resourcePath;
/* API Gateway Event */
strOrNull = apiGwEvt.body;
str = apiGwEvt.headers["example"];
str = apiGwEvt.multiValueHeaders["example"][0];
str = apiGwEvt.httpMethod;
bool = apiGwEvt.isBase64Encoded;
str = apiGwEvt.path;
str = apiGwEvt.pathParameters!["example"];
str = apiGwEvt.queryStringParameters!["example"];
str = apiGwEvt.multiValueQueryStringParameters!["example"][0];
str = apiGwEvt.stageVariables!["example"];
apiGwEvtReqCtx = apiGwEvt.requestContext;
str = apiGwEvt.resource;
@@ -115,10 +118,12 @@ str = apiGwEvt.resource;
str = customAuthorizerEvt.type;
str = customAuthorizerEvt.methodArn;
strOrUndefined = customAuthorizerEvt.authorizationToken;
str = apiGwEvt.pathParameters!["example"];
str = apiGwEvt.queryStringParameters!["example"];
str = apiGwEvt.stageVariables!["example"];
apiGwEvtReqCtx = apiGwEvt.requestContext;
str = customAuthorizerEvt.headers!["example"];
str = customAuthorizerEvt.multiValueHeaders!["example"][0];
str = customAuthorizerEvt.pathParameters!["example"];
str = customAuthorizerEvt.queryStringParameters!["example"];
str = customAuthorizerEvt.multiValueQueryStringParameters!["example"][0];
apiGwEvtReqCtxOpt = customAuthorizerEvt.requestContext;
/* DynamoDB Stream Event */
const dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = {
+5
View File
@@ -22,6 +22,7 @@
// Louis Larry <https://github.com/louislarry>
// Daniel Papukchiev <https://github.com/dpapukchiev>
// Oliver Hookins <https://github.com/ohookins>
// Trevor Leach <https://github.com/trevor-leach>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -58,11 +59,13 @@ export interface APIGatewayEventRequestContext {
export interface APIGatewayProxyEvent {
body: string | null;
headers: { [name: string]: string };
multiValueHeaders: { [name: string]: string };
httpMethod: string;
isBase64Encoded: boolean;
path: string;
pathParameters: { [name: string]: string } | null;
queryStringParameters: { [name: string]: string } | null;
multiValueQueryStringParameters: { [name: string]: string[] } | null;
stageVariables: { [name: string]: string } | null;
requestContext: APIGatewayEventRequestContext;
resource: string;
@@ -75,8 +78,10 @@ export interface CustomAuthorizerEvent {
methodArn: string;
authorizationToken?: string;
headers?: { [name: string]: string };
multiValueHeaders?: { [name: string]: string[] };
pathParameters?: { [name: string]: string } | null;
queryStringParameters?: { [name: string]: string } | null;
multiValueQueryStringParameters?: { [name: string]: string[] } | null;
requestContext?: APIGatewayEventRequestContext;
}