@middy/cloudformation-router 7.2.3 → 7.3.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.
- package/index.d.ts +4 -0
- package/index.js +10 -0
- package/package.json +2 -5
package/index.d.ts
CHANGED
|
@@ -24,4 +24,8 @@ declare function cloudformationRouterHandler(
|
|
|
24
24
|
options: Options | Route[],
|
|
25
25
|
): middy.MiddyfiedHandler<CloudFormationCustomResourceEvent, void>;
|
|
26
26
|
|
|
27
|
+
export declare function cloudformationRouterValidateOptions(
|
|
28
|
+
options?: Record<string, unknown>,
|
|
29
|
+
): void;
|
|
30
|
+
|
|
27
31
|
export default cloudformationRouterHandler;
|
package/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Copyright 2017 - 2026 will Farrell, Luciano Mammino, and Middy contributors.
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { validateOptions } from "@middy/util";
|
|
4
|
+
|
|
3
5
|
const defaults = {
|
|
4
6
|
routes: [],
|
|
5
7
|
notFoundResponse: ({ requestType }) => {
|
|
@@ -12,6 +14,14 @@ const defaults = {
|
|
|
12
14
|
throw err;
|
|
13
15
|
},
|
|
14
16
|
};
|
|
17
|
+
|
|
18
|
+
const optionSchema = {
|
|
19
|
+
routes: "array?",
|
|
20
|
+
notFoundResponse: "function?",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const cloudformationRouterValidateOptions = (options) =>
|
|
24
|
+
validateOptions("@middy/cloudformation-router", optionSchema, options);
|
|
15
25
|
const cloudformationCustomResourceRouteHandler = (opts = {}) => {
|
|
16
26
|
let options;
|
|
17
27
|
if (Array.isArray(opts)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/cloudformation-router",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "CloudFormation Custom Response event router for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -17,9 +17,6 @@
|
|
|
17
17
|
"import": {
|
|
18
18
|
"types": "./index.d.ts",
|
|
19
19
|
"default": "./index.js"
|
|
20
|
-
},
|
|
21
|
-
"require": {
|
|
22
|
-
"default": "./index.js"
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
},
|
|
@@ -65,7 +62,7 @@
|
|
|
65
62
|
"url": "https://github.com/sponsors/willfarrell"
|
|
66
63
|
},
|
|
67
64
|
"devDependencies": {
|
|
68
|
-
"@middy/core": "7.
|
|
65
|
+
"@middy/core": "7.3.0",
|
|
69
66
|
"@types/aws-lambda": "^8.0.0",
|
|
70
67
|
"@types/node": "^22.0.0"
|
|
71
68
|
}
|