@middy/http-router 6.1.3 → 6.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.
- package/index.d.ts +25 -3
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -9,14 +9,29 @@ import {
|
|
|
9
9
|
Handler as LambdaHandler
|
|
10
10
|
} from 'aws-lambda'
|
|
11
11
|
|
|
12
|
-
export type Method =
|
|
12
|
+
export type Method =
|
|
13
|
+
| 'GET'
|
|
14
|
+
| 'POST'
|
|
15
|
+
| 'PUT'
|
|
16
|
+
| 'PATCH'
|
|
17
|
+
| 'DELETE'
|
|
18
|
+
| 'OPTIONS'
|
|
19
|
+
| 'HEAD'
|
|
20
|
+
| 'ANY'
|
|
13
21
|
|
|
14
22
|
export interface Route<TEvent, TResult> {
|
|
15
23
|
method: Method
|
|
16
24
|
path: string
|
|
17
|
-
handler:
|
|
25
|
+
handler:
|
|
26
|
+
| LambdaHandler<TEvent, TResult>
|
|
27
|
+
| MiddyfiedHandler<TEvent, TResult, any, any>
|
|
18
28
|
}
|
|
19
29
|
|
|
30
|
+
export type RouteNotFoundResponseFn = (input: {
|
|
31
|
+
method: string
|
|
32
|
+
path: string
|
|
33
|
+
}) => never
|
|
34
|
+
|
|
20
35
|
declare function httpRouterHandler<
|
|
21
36
|
TEvent extends
|
|
22
37
|
| ALBEvent
|
|
@@ -26,6 +41,13 @@ declare function httpRouterHandler<
|
|
|
26
41
|
| ALBResult
|
|
27
42
|
| APIGatewayProxyResult
|
|
28
43
|
| APIGatewayProxyResultV2 = APIGatewayProxyResult
|
|
29
|
-
> (
|
|
44
|
+
> (
|
|
45
|
+
routes:
|
|
46
|
+
| Array<Route<TEvent, TResult>>
|
|
47
|
+
| {
|
|
48
|
+
routes: Array<Route<TEvent, TResult>>
|
|
49
|
+
notFoundResponse: RouteNotFoundResponseFn
|
|
50
|
+
}
|
|
51
|
+
): middy.MiddyfiedHandler<TEvent, TResult>
|
|
30
52
|
|
|
31
53
|
export default httpRouterHandler
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-router",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.5",
|
|
4
4
|
"description": "HTTP event router for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"url": "https://github.com/sponsors/willfarrell"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@middy/util": "6.1.
|
|
67
|
+
"@middy/util": "6.1.5"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@middy/core": "6.1.
|
|
70
|
+
"@middy/core": "6.1.5",
|
|
71
71
|
"@types/aws-lambda": "^8.10.97"
|
|
72
72
|
},
|
|
73
73
|
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
|