@middy/http-multipart-body-parser 7.1.4 → 7.1.6

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 +0 -2
  2. package/index.d.ts +11 -5
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -24,8 +24,6 @@
24
24
  <a href="https://github.com/middyjs/middy/blob/main/package.json#L32">
25
25
  <img alt="code coverage" src="https://img.shields.io/badge/code%20coverage-95%25-brightgreen"></a>
26
26
  <br/>
27
- <a href="https://gitter.im/middyjs/Lobby"><img src="https://badges.gitter.im/gitterHQ/gitter.svg" alt="Chat on Gitter" style="max-width:100%;"></a>
28
- <a href="https://stackoverflow.com/questions/tagged/middy?sort=Newest&uqlId=35052"><img src="https://img.shields.io/badge/StackOverflow-[middy]-yellow" alt="Ask questions on StackOverflow" style="max-width:100%;"></a>
29
27
  </p>
30
28
  <p>You can read the documentation at: <a href="https://middy.js.org/docs/middlewares/http-multipart-body-parser">https://middy.js.org/docs/middlewares/http-multipart-body-parser</a></p>
31
29
  </div>
package/index.d.ts CHANGED
@@ -1,7 +1,11 @@
1
1
  // Copyright 2017 - 2026 will Farrell, Luciano Mammino, and Middy contributors.
2
2
  // SPDX-License-Identifier: MIT
3
3
  import type middy from "@middy/core";
4
- import type { APIGatewayEvent } from "aws-lambda";
4
+ import type {
5
+ ALBEvent,
6
+ APIGatewayEvent,
7
+ APIGatewayProxyEventV2,
8
+ } from "aws-lambda";
5
9
  import type { JsonValue } from "type-fest";
6
10
 
7
11
  export interface Options {
@@ -26,12 +30,14 @@ export interface Options {
26
30
  disableContentTypeError?: boolean;
27
31
  }
28
32
 
29
- export type Event = Omit<APIGatewayEvent, "body"> & {
33
+ export type RequestEvent = APIGatewayEvent | APIGatewayProxyEventV2 | ALBEvent;
34
+
35
+ export type Event<T extends RequestEvent = RequestEvent> = Omit<T, "body"> & {
30
36
  body: JsonValue;
31
37
  };
32
38
 
33
- declare function multipartBodyParser(
34
- options?: Options,
35
- ): middy.MiddlewareObj<Event, unknown, Error>;
39
+ declare function multipartBodyParser<
40
+ EventType extends RequestEvent = RequestEvent,
41
+ >(options?: Options): middy.MiddlewareObj<Event<EventType>, unknown, Error>;
36
42
 
37
43
  export default multipartBodyParser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-multipart-body-parser",
3
- "version": "7.1.4",
3
+ "version": "7.1.6",
4
4
  "description": "HTTP multipart body parser middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -66,10 +66,10 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@fastify/busboy": "3.2.0",
69
- "@middy/util": "7.1.4"
69
+ "@middy/util": "7.1.6"
70
70
  },
71
71
  "devDependencies": {
72
- "@middy/core": "7.1.4",
72
+ "@middy/core": "7.1.6",
73
73
  "@types/aws-lambda": "^8.0.0",
74
74
  "@types/node": "^22.0.0",
75
75
  "type-fest": "^5.0.0"