@middy/http-event-normalizer 7.1.3 → 7.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -5
  2. package/index.d.ts +19 -10
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -49,8 +49,4 @@ Everyone is very welcome to contribute to this repository. Feel free to [raise i
49
49
 
50
50
  ## License
51
51
 
52
- Licensed under [MIT License](LICENSE). Copyright (c) 2017-2026 [will Farrell](https://github.com/willfarrell), [Luciano Mammino](https://github.com/lmammino), and [Middy contributors](https://github.com/middyjs/middy/graphs/contributors).
53
-
54
- <a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
55
- <img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
56
- </a>
52
+ Licensed under [MIT License](LICENSE). Copyright (c) 2017-2026 [will Farrell](https://github.com/willfarrell), [Luciano Mammino](https://github.com/lmammino), and [Middy contributors](https://github.com/middyjs/middy/graphs/contributors).
package/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import type {
6
6
  APIGatewayProxyEventMultiValueQueryStringParameters,
7
7
  APIGatewayProxyEventPathParameters,
8
8
  APIGatewayProxyEventQueryStringParameters,
9
+ APIGatewayProxyEventV2,
9
10
  } from "aws-lambda";
10
11
 
11
12
  // TODO: Import from 'aws-lambda' when @types/aws-lambda adds VPC Lattice types
@@ -22,16 +23,24 @@ export interface VPCLatticeEvent {
22
23
  queryStringParameters: APIGatewayProxyEventQueryStringParameters;
23
24
  }
24
25
 
25
- export type Event = APIGatewayEvent & {
26
- multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters;
27
- pathParameters: APIGatewayProxyEventPathParameters;
28
- queryStringParameters: APIGatewayProxyEventQueryStringParameters;
29
- };
26
+ export type RequestEvent = APIGatewayEvent | APIGatewayProxyEventV2;
27
+
28
+ export type Event<T extends RequestEvent = RequestEvent> =
29
+ T extends APIGatewayEvent
30
+ ? APIGatewayEvent & {
31
+ multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters;
32
+ pathParameters: APIGatewayProxyEventPathParameters;
33
+ queryStringParameters: APIGatewayProxyEventQueryStringParameters;
34
+ }
35
+ : T extends APIGatewayProxyEventV2
36
+ ? APIGatewayProxyEventV2 & {
37
+ pathParameters: Record<string, string>;
38
+ queryStringParameters: Record<string, string>;
39
+ }
40
+ : never;
30
41
 
31
- declare function httpEventNormalizer(): middy.MiddlewareObj<
32
- Event,
33
- unknown,
34
- Error
35
- >;
42
+ declare function httpEventNormalizer<
43
+ EventType extends RequestEvent = RequestEvent,
44
+ >(): middy.MiddlewareObj<Event<EventType>, unknown, Error>;
36
45
 
37
46
  export default httpEventNormalizer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-event-normalizer",
3
- "version": "7.1.3",
3
+ "version": "7.1.5",
4
4
  "description": "HTTP event normalizer middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -65,7 +65,7 @@
65
65
  "url": "https://github.com/sponsors/willfarrell"
66
66
  },
67
67
  "devDependencies": {
68
- "@middy/core": "7.1.3",
68
+ "@middy/core": "7.1.5",
69
69
  "@types/aws-lambda": "^8.0.0",
70
70
  "@types/node": "^22.0.0"
71
71
  }