@middy/http-router 3.0.4 → 3.1.0

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 +2 -2
  2. package/index.d.ts +3 -3
  3. package/package.json +13 -7
package/README.md CHANGED
@@ -63,7 +63,7 @@ import middy from '@middy/core'
63
63
  import validatorMiddleware from '@middy/validator'
64
64
 
65
65
  const getHandler = middy()
66
- .use(validatorMiddleware({inputSchema: {...} }))
66
+ .use(validatorMiddleware({eventSchema: {...} }))
67
67
  .handler((event, context) => {
68
68
  return {
69
69
  statusCode: 200,
@@ -72,7 +72,7 @@ const getHandler = middy()
72
72
  })
73
73
 
74
74
  const postHandler = middy()
75
- .use(validatorMiddleware({inputSchema: {...} }))
75
+ .use(validatorMiddleware({eventSchema: {...} }))
76
76
  .handler((event, context) => {
77
77
  return {
78
78
  statusCode: 200,
package/index.d.ts CHANGED
@@ -5,14 +5,14 @@ import {
5
5
  Handler as LambdaHandler
6
6
  } from 'aws-lambda'
7
7
 
8
- type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'ANY'
8
+ export type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'ANY'
9
9
 
10
- interface Route {
10
+ export interface Route {
11
11
  method: Method
12
12
  path: string
13
13
  handler: LambdaHandler<APIGatewayProxyEvent, APIGatewayProxyResult>
14
14
  }
15
15
 
16
- declare function httpRouterHandler (routes: Route[]): middy.MiddlewareObj
16
+ declare function httpRouterHandler (routes: Route[]): middy.MiddyfiedHandler
17
17
 
18
18
  export default httpRouterHandler
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-router",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
4
4
  "description": "HTTP event router for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -10,11 +10,17 @@
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
+ "main": "./index.cjs",
13
14
  "exports": {
14
15
  ".": {
15
- "import": "./index.js",
16
- "require": "./index.cjs",
17
- "types": "./index.d.ts"
16
+ "import": {
17
+ "types": "./index.d.ts",
18
+ "default": "./index.js"
19
+ },
20
+ "require": {
21
+ "types": "./index.d.ts",
22
+ "default": "./index.cjs"
23
+ }
18
24
  }
19
25
  },
20
26
  "types": "index.d.ts",
@@ -55,11 +61,11 @@
55
61
  },
56
62
  "homepage": "https://middy.js.org",
57
63
  "dependencies": {
58
- "@middy/util": "3.0.4"
64
+ "@middy/util": "3.1.0"
59
65
  },
60
66
  "devDependencies": {
61
- "@middy/core": "3.0.4",
67
+ "@middy/core": "3.1.0",
62
68
  "@types/aws-lambda": "^8.10.97"
63
69
  },
64
- "gitHead": "3e9bc83e791f943c71cd7003fc27f0a3692d83a1"
70
+ "gitHead": "d5284fd11c175516c189b6061fee7312106d9709"
65
71
  }