@middy/s3-object-response 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 +7 -0
- package/package.json +3 -6
package/index.d.ts
CHANGED
|
@@ -26,4 +26,8 @@ declare function s3ObjectResponse(
|
|
|
26
26
|
options?: S3ObjectResponseOptions,
|
|
27
27
|
): middy.MiddlewareObj<unknown, unknown, Error>;
|
|
28
28
|
|
|
29
|
+
export declare function s3ObjectResponseValidateOptions(
|
|
30
|
+
options?: Record<string, unknown>,
|
|
31
|
+
): void;
|
|
32
|
+
|
|
29
33
|
export default s3ObjectResponse;
|
package/index.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { S3Client, WriteGetObjectResponseCommand } from "@aws-sdk/client-s3";
|
|
4
4
|
import {
|
|
5
|
+
awsClientOptionSchema,
|
|
5
6
|
canPrefetch,
|
|
6
7
|
catchInvalidSignatureException,
|
|
7
8
|
createClient,
|
|
8
9
|
createPrefetchClient,
|
|
10
|
+
validateOptions,
|
|
9
11
|
} from "@middy/util";
|
|
10
12
|
|
|
11
13
|
const defaults = {
|
|
@@ -16,6 +18,11 @@ const defaults = {
|
|
|
16
18
|
disablePrefetch: false,
|
|
17
19
|
};
|
|
18
20
|
|
|
21
|
+
const optionSchema = { ...awsClientOptionSchema };
|
|
22
|
+
|
|
23
|
+
export const s3ObjectResponseValidateOptions = (options) =>
|
|
24
|
+
validateOptions("@middy/s3-object-response", optionSchema, options);
|
|
25
|
+
|
|
19
26
|
const s3ObjectResponseMiddleware = (opts = {}) => {
|
|
20
27
|
const options = { ...defaults, ...opts };
|
|
21
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/s3-object-response",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "S3 object response handling middleware 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
|
},
|
|
@@ -73,11 +70,11 @@
|
|
|
73
70
|
}
|
|
74
71
|
},
|
|
75
72
|
"dependencies": {
|
|
76
|
-
"@middy/util": "7.
|
|
73
|
+
"@middy/util": "7.3.0"
|
|
77
74
|
},
|
|
78
75
|
"devDependencies": {
|
|
79
76
|
"@aws-sdk/client-s3": "^3.0.0",
|
|
80
|
-
"@middy/core": "7.
|
|
77
|
+
"@middy/core": "7.3.0",
|
|
81
78
|
"@types/aws-lambda": "^8.0.0",
|
|
82
79
|
"@types/node": "^22.0.0",
|
|
83
80
|
"aws-xray-sdk": "^3.3.3"
|