@middy/core 7.3.3 → 7.4.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.js +6 -3
- package/package.json +20 -2
package/index.js
CHANGED
|
@@ -4,13 +4,16 @@ import { setTimeout } from "node:timers";
|
|
|
4
4
|
import { validateOptions } from "@middy/util";
|
|
5
5
|
import { executionModeStandard } from "./executionModeStandard.js";
|
|
6
6
|
|
|
7
|
+
const name = "core";
|
|
8
|
+
const pkg = `@middy/${name}`;
|
|
9
|
+
|
|
7
10
|
const defaultLambdaHandler = () => {};
|
|
8
11
|
const noop = () => {};
|
|
9
12
|
const defaultPluginConfig = {
|
|
10
13
|
timeoutEarlyInMillis: 5,
|
|
11
14
|
timeoutEarlyResponse: () => {
|
|
12
15
|
const err = new Error("[AbortError]: The operation was aborted.", {
|
|
13
|
-
cause: { package:
|
|
16
|
+
cause: { package: pkg },
|
|
14
17
|
});
|
|
15
18
|
err.name = "TimeoutError";
|
|
16
19
|
throw err;
|
|
@@ -47,7 +50,7 @@ const optionSchema = {
|
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
export const middyValidateOptions = (options) =>
|
|
50
|
-
validateOptions(
|
|
53
|
+
validateOptions(pkg, optionSchema, options);
|
|
51
54
|
|
|
52
55
|
export const middy = (setupLambdaHandler, pluginConfig) => {
|
|
53
56
|
let lambdaHandler;
|
|
@@ -109,7 +112,7 @@ export const middy = (setupLambdaHandler, pluginConfig) => {
|
|
|
109
112
|
throw new Error(
|
|
110
113
|
'Middleware must be an object containing at least one key among "before", "after", "onError"',
|
|
111
114
|
{
|
|
112
|
-
cause: { package:
|
|
115
|
+
cause: { package: pkg },
|
|
113
116
|
},
|
|
114
117
|
);
|
|
115
118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (core package)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -25,17 +25,35 @@
|
|
|
25
25
|
"default": "./executionModeStandard.js"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
+
"./executionModeStandard": {
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./executionModeStandard.d.ts",
|
|
31
|
+
"default": "./executionModeStandard.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
28
34
|
"./DurableContext": {
|
|
29
35
|
"import": {
|
|
30
36
|
"types": "./executionModeDurableContext.d.ts",
|
|
31
37
|
"default": "./executionModeDurableContext.js"
|
|
32
38
|
}
|
|
33
39
|
},
|
|
40
|
+
"./executionModeDurableContext": {
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./executionModeDurableContext.d.ts",
|
|
43
|
+
"default": "./executionModeDurableContext.js"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
34
46
|
"./StreamifyResponse": {
|
|
35
47
|
"import": {
|
|
36
48
|
"types": "./executionModeStreamifyResponse.d.ts",
|
|
37
49
|
"default": "./executionModeStreamifyResponse.js"
|
|
38
50
|
}
|
|
51
|
+
},
|
|
52
|
+
"./executionModeStreamifyResponse": {
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./executionModeStreamifyResponse.d.ts",
|
|
55
|
+
"default": "./executionModeStreamifyResponse.js"
|
|
56
|
+
}
|
|
39
57
|
}
|
|
40
58
|
},
|
|
41
59
|
"types": "index.d.ts",
|
|
@@ -85,7 +103,7 @@
|
|
|
85
103
|
"url": "https://github.com/sponsors/willfarrell"
|
|
86
104
|
},
|
|
87
105
|
"dependencies": {
|
|
88
|
-
"@middy/util": "7.
|
|
106
|
+
"@middy/util": "7.4.0"
|
|
89
107
|
},
|
|
90
108
|
"peerDependencies": {
|
|
91
109
|
"@aws/durable-execution-sdk-js": "^1.0.0"
|