Skip to content

Commit

Permalink
refactor: switch to ALB types provided by @types/aws-lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
onebytegone committed Jun 20, 2024
1 parent 1e3d624 commit 64e527b
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/request-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import {
APIGatewayProxyEvent,
Context,
APIGatewayProxyResult,
ALBEvent,
ALBEventRequestContext,
} from 'aws-lambda';
import { StringMap, StringArrayOfStringsMap } from '@silvermine/toolbox';
import { StringArrayOfStringsMap } from '@silvermine/toolbox';

/* COMBO TYPES */

Expand Down Expand Up @@ -54,25 +56,14 @@ export interface APIGatewayRequestEvent extends APIGatewayProxyEvent {}
export interface APIGatewayEventRequestContext extends OrigAPIGatewayEventRequestContext {}


/* APPLICATION LOAD BALANCER TYPES (these are not yet included in aws-lambda) */
/* APPLICATION LOAD BALANCER TYPES (we export these with our own names to make it easier
to modify them if needed at a later time) */

export interface ApplicationLoadBalancerRequestEvent {
body: string | null;
httpMethod: string;
isBase64Encoded: boolean;
path: string;
headers?: StringMap;
multiValueHeaders?: StringArrayOfStringsMap;
queryStringParameters?: StringMap;
multiValueQueryStringParameters?: StringArrayOfStringsMap;
requestContext: ApplicationLoadBalancerEventRequestContext;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ApplicationLoadBalancerRequestEvent extends ALBEvent {}

export interface ApplicationLoadBalancerEventRequestContext {
elb: {
targetGroupArn: string;
};
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ApplicationLoadBalancerEventRequestContext extends ALBEventRequestContext {}


/* OTHER TYPES RELATED TO REQUESTS AND RESPONSES */
Expand Down

0 comments on commit 64e527b

Please sign in to comment.