@middy/http-router 4.0.8 → 4.0.9
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/LICENSE +1 -1
- package/README.md +1 -1
- package/index.cjs +3 -2
- package/index.d.ts +5 -2
- package/index.js +3 -2
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
3
|
+
Copyright (c) 2017-2023 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell) and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
## License
|
|
40
40
|
|
|
41
|
-
Licensed under [MIT License](LICENSE). Copyright (c) 2017-
|
|
41
|
+
Licensed under [MIT License](LICENSE). Copyright (c) 2017-2023 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
|
|
42
42
|
|
|
43
43
|
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
|
|
44
44
|
<img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
|
package/index.cjs
CHANGED
|
@@ -37,8 +37,9 @@ const httpRouteHandler = (routes)=>{
|
|
|
37
37
|
for (const route of routesDynamic[method] ?? []){
|
|
38
38
|
const match = path.match(route.path);
|
|
39
39
|
if (match) {
|
|
40
|
-
event.pathParameters
|
|
41
|
-
...match.groups
|
|
40
|
+
event.pathParameters = {
|
|
41
|
+
...match.groups,
|
|
42
|
+
...event.pathParameters
|
|
42
43
|
};
|
|
43
44
|
return route.handler(event, context, abort);
|
|
44
45
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import middy from '@middy/core'
|
|
1
|
+
import middy, { MiddyfiedHandler } from '@middy/core'
|
|
2
2
|
import {
|
|
3
3
|
ALBEvent,
|
|
4
|
+
ALBResult,
|
|
4
5
|
APIGatewayProxyEvent,
|
|
5
6
|
APIGatewayProxyEventV2,
|
|
6
7
|
APIGatewayProxyResult,
|
|
@@ -17,10 +18,12 @@ export enum Method {
|
|
|
17
18
|
Any = 'ANY'
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
type TResult = ALBResult | APIGatewayProxyResult
|
|
22
|
+
|
|
20
23
|
export interface Route<TEvent> {
|
|
21
24
|
method: Method
|
|
22
25
|
path: string
|
|
23
|
-
handler: LambdaHandler<TEvent,
|
|
26
|
+
handler: LambdaHandler<TEvent, TResult> | MiddyfiedHandler<TEvent, TResult, any, any>
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
declare function httpRouterHandler<
|
package/index.js
CHANGED
|
@@ -29,8 +29,9 @@ const httpRouteHandler = (routes)=>{
|
|
|
29
29
|
for (const route of routesDynamic[method] ?? []){
|
|
30
30
|
const match = path.match(route.path);
|
|
31
31
|
if (match) {
|
|
32
|
-
event.pathParameters
|
|
33
|
-
...match.groups
|
|
32
|
+
event.pathParameters = {
|
|
33
|
+
...match.groups,
|
|
34
|
+
...event.pathParameters
|
|
34
35
|
};
|
|
35
36
|
return route.handler(event, context, abort);
|
|
36
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-router",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
4
4
|
"description": "HTTP event router for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://middy.js.org",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@middy/util": "4.0.
|
|
65
|
+
"@middy/util": "4.0.9"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@middy/core": "4.0.
|
|
68
|
+
"@middy/core": "4.0.9",
|
|
69
69
|
"@types/aws-lambda": "^8.10.97"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "02210765f9154584c242e4440d086abcf3321028"
|
|
72
72
|
}
|