@middy/s3 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.
Files changed (3) hide show
  1. package/index.d.ts +4 -0
  2. package/index.js +7 -0
  3. package/package.json +3 -6
package/index.d.ts CHANGED
@@ -64,4 +64,8 @@ declare function s3Middleware<TOptions extends S3Options | undefined>(
64
64
  Internal<TOptions>
65
65
  >;
66
66
 
67
+ export declare function s3ValidateOptions(
68
+ options?: Record<string, unknown>,
69
+ ): void;
70
+
67
71
  export default s3Middleware;
package/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import { GetObjectCommand, S3Client } from "@aws-sdk/client-s3";
4
4
  import {
5
+ awsClientOptionSchema,
5
6
  canPrefetch,
6
7
  catchInvalidSignatureException,
7
8
  createClient,
@@ -12,6 +13,7 @@ import {
12
13
  jsonSafeParse,
13
14
  modifyCache,
14
15
  processCache,
16
+ validateOptions,
15
17
  } from "@middy/util";
16
18
 
17
19
  const defaults = {
@@ -26,6 +28,11 @@ const defaults = {
26
28
  cacheExpiry: -1,
27
29
  setToContext: false,
28
30
  };
31
+
32
+ const optionSchema = { ...awsClientOptionSchema };
33
+
34
+ export const s3ValidateOptions = (options) =>
35
+ validateOptions("@middy/s3", optionSchema, options);
29
36
  const s3Middleware = (opts = {}) => {
30
37
  const options = {
31
38
  ...defaults,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/s3",
3
- "version": "7.2.3",
3
+ "version": "7.3.0",
4
4
  "description": "S3 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
  },
@@ -63,7 +60,7 @@
63
60
  "url": "https://github.com/sponsors/willfarrell"
64
61
  },
65
62
  "dependencies": {
66
- "@middy/util": "7.2.3"
63
+ "@middy/util": "7.3.0"
67
64
  },
68
65
  "peerDependencies": {
69
66
  "@aws-sdk/client-s3": "^3.0.0"
@@ -75,7 +72,7 @@
75
72
  },
76
73
  "devDependencies": {
77
74
  "@aws-sdk/client-s3": "^3.0.0",
78
- "@middy/core": "7.2.3",
75
+ "@middy/core": "7.3.0",
79
76
  "@types/aws-lambda": "^8.0.0",
80
77
  "@types/node": "^22.0.0",
81
78
  "aws-xray-sdk": "^3.3.3"