diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index ba6ebdc5ac..ad063c20b6 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -1,12 +1,14 @@ declare let str: string; declare let strOrNull: string | null; declare let strOrUndefined: string | undefined; +declare let strOrUndefinedOrNull: string | undefined | null; declare let date: Date; declare let anyObj: any; declare let num: number; declare let error: Error; declare let bool: boolean; declare let boolOrUndefined: boolean | undefined; +declare let numOrUndefined: number | undefined; declare let apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; declare let apiGwEvtReqCtxOpt: AWSLambda.APIGatewayEventRequestContext | null | undefined; declare let apiGwEvt: AWSLambda.APIGatewayEvent; @@ -80,6 +82,11 @@ declare const scheduledEvent: AWSLambda.ScheduledEvent; str = apiGwEvtReqCtx.accountId; str = apiGwEvtReqCtx.apiId; authResponseContextOpt = apiGwEvtReqCtx.authorizer; +numOrUndefined = apiGwEvtReqCtx.connectedAt; +strOrUndefined = apiGwEvtReqCtx.connectionId; +strOrUndefined = apiGwEvtReqCtx.domainName; +strOrUndefined = apiGwEvtReqCtx.eventType; +strOrUndefined = apiGwEvtReqCtx.extendedRequestId; str = apiGwEvtReqCtx.httpMethod; strOrNull = apiGwEvtReqCtx.identity.accessKey; strOrNull = apiGwEvtReqCtx.identity.accountId; @@ -94,11 +101,15 @@ str = apiGwEvtReqCtx.identity.sourceIp; strOrNull = apiGwEvtReqCtx.identity.user; strOrNull = apiGwEvtReqCtx.identity.userAgent; strOrNull = apiGwEvtReqCtx.identity.userArn; +strOrUndefined = apiGwEvtReqCtx.messageDirection; +strOrUndefinedOrNull = apiGwEvtReqCtx.messageId; str = apiGwEvtReqCtx.path; str = apiGwEvtReqCtx.stage; str = apiGwEvtReqCtx.requestId; +strOrUndefined = apiGwEvtReqCtx.requestTime; str = apiGwEvtReqCtx.resourceId; str = apiGwEvtReqCtx.resourcePath; +strOrUndefined = apiGwEvtReqCtx.routeKey; /* API Gateway Event */ strOrNull = apiGwEvt.body; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 52314529bc..3301feebb5 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -25,6 +25,7 @@ // Trevor Leach // James Gregory // Erik Dalén +// Loïk Gaonac'h // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -33,6 +34,11 @@ export interface APIGatewayEventRequestContext { accountId: string; apiId: string; authorizer?: AuthResponseContext | null; + connectedAt: number; + connectionId?: string; + domainName?: string; + eventType?: string; + extendedRequestId?: string; httpMethod: string; identity: { accessKey: string | null; @@ -49,12 +55,16 @@ export interface APIGatewayEventRequestContext { userAgent: string | null; userArn: string | null; }; + messageDirection?: string; + messageId?: string | null; path: string; stage: string; requestId: string; + requestTime?: string; requestTimeEpoch: number; resourceId: string; resourcePath: string; + routeKey?: string; } // API Gateway "event"