Merge pull request #32855 from loikg/master

[@types/aws-lambda] Add WebSocket integration props to APIGatewayEventRequestContext
This commit is contained in:
Armando Aguirre
2019-02-07 12:45:13 -08:00
committed by GitHub
2 changed files with 21 additions and 0 deletions
+11
View File
@@ -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;
+10
View File
@@ -25,6 +25,7 @@
// Trevor Leach <https://github.com/trevor-leach>
// James Gregory <https://github.com/jagregory>
// Erik Dalén <https://github.com/dalen>
// Loïk Gaonac'h <https://github.com/loikg>
// 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"