@middy/core 7.3.2 → 7.3.4
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 +6 -5
- package/index.js +6 -3
- package/package.json +20 -2
package/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Copyright 2017 - 2026 will Farrell, Luciano Mammino, and Middy contributors.
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { DurableContext as LambdaContextDurable } from "@aws/durable-execution-sdk-js";
|
|
3
5
|
import type {
|
|
4
6
|
Context as LambdaContext,
|
|
5
7
|
Handler as LambdaHandler,
|
|
6
8
|
} from "aws-lambda";
|
|
7
|
-
import type { DurableContext as LambdaContextDurable } from "@aws/durable-execution-sdk-js";
|
|
8
9
|
|
|
9
10
|
declare type PluginHook = () => void;
|
|
10
11
|
declare type PluginHookWithMiddlewareName = (middlewareName: string) => void;
|
|
@@ -221,13 +222,13 @@ declare function middy<
|
|
|
221
222
|
|
|
222
223
|
declare namespace middy {
|
|
223
224
|
export type {
|
|
224
|
-
Request,
|
|
225
|
-
PluginHook,
|
|
226
|
-
PluginHookWithMiddlewareName,
|
|
227
|
-
PluginObject,
|
|
228
225
|
MiddlewareFn,
|
|
229
226
|
MiddlewareObj,
|
|
230
227
|
MiddyfiedHandler,
|
|
228
|
+
PluginHook,
|
|
229
|
+
PluginHookWithMiddlewareName,
|
|
230
|
+
PluginObject,
|
|
231
|
+
Request,
|
|
231
232
|
};
|
|
232
233
|
}
|
|
233
234
|
|
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.
|
|
3
|
+
"version": "7.3.4",
|
|
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.3.
|
|
106
|
+
"@middy/util": "7.3.4"
|
|
89
107
|
},
|
|
90
108
|
"peerDependencies": {
|
|
91
109
|
"@aws/durable-execution-sdk-js": "^1.0.0"
|