Skip to content

Commit 64e527b

Browse files
committed
refactor: switch to ALB types provided by @types/aws-lambda
1 parent 1e3d624 commit 64e527b

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/request-response-types.ts

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import {
55
APIGatewayProxyEvent,
66
Context,
77
APIGatewayProxyResult,
8+
ALBEvent,
9+
ALBEventRequestContext,
810
} from 'aws-lambda';
9-
import { StringMap, StringArrayOfStringsMap } from '@silvermine/toolbox';
11+
import { StringArrayOfStringsMap } from '@silvermine/toolbox';
1012

1113
/* COMBO TYPES */
1214

@@ -54,25 +56,14 @@ export interface APIGatewayRequestEvent extends APIGatewayProxyEvent {}
5456
export interface APIGatewayEventRequestContext extends OrigAPIGatewayEventRequestContext {}
5557

5658

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

59-
export interface ApplicationLoadBalancerRequestEvent {
60-
body: string | null;
61-
httpMethod: string;
62-
isBase64Encoded: boolean;
63-
path: string;
64-
headers?: StringMap;
65-
multiValueHeaders?: StringArrayOfStringsMap;
66-
queryStringParameters?: StringMap;
67-
multiValueQueryStringParameters?: StringArrayOfStringsMap;
68-
requestContext: ApplicationLoadBalancerEventRequestContext;
69-
}
62+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
63+
export interface ApplicationLoadBalancerRequestEvent extends ALBEvent {}
7064

71-
export interface ApplicationLoadBalancerEventRequestContext {
72-
elb: {
73-
targetGroupArn: string;
74-
};
75-
}
65+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
66+
export interface ApplicationLoadBalancerEventRequestContext extends ALBEventRequestContext {}
7667

7768

7869
/* OTHER TYPES RELATED TO REQUESTS AND RESPONSES */

0 commit comments

Comments
 (0)