@middy/secrets-manager 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 +12 -0
  3. package/package.json +3 -6
package/index.d.ts CHANGED
@@ -55,4 +55,8 @@ declare function secretsManager<
55
55
  Internal<TOptions>
56
56
  >;
57
57
 
58
+ export declare function secretsManagerValidateOptions(
59
+ options?: Record<string, unknown>,
60
+ ): void;
61
+
58
62
  export default secretsManager;
package/index.js CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  SecretsManagerClient,
7
7
  } from "@aws-sdk/client-secrets-manager";
8
8
  import {
9
+ awsClientOptionSchema,
9
10
  canPrefetch,
10
11
  catchInvalidSignatureException,
11
12
  createClient,
@@ -15,6 +16,7 @@ import {
15
16
  jsonSafeParse,
16
17
  modifyCache,
17
18
  processCache,
19
+ validateOptions,
18
20
  } from "@middy/util";
19
21
 
20
22
  const defaults = {
@@ -31,6 +33,16 @@ const defaults = {
31
33
  setToContext: false,
32
34
  };
33
35
 
36
+ const optionSchema = {
37
+ ...awsClientOptionSchema,
38
+ fetchRotationDate: (v) =>
39
+ typeof v === "boolean" ||
40
+ (v !== null && typeof v === "object" && !Array.isArray(v)),
41
+ };
42
+
43
+ export const secretsManagerValidateOptions = (options) =>
44
+ validateOptions("@middy/secrets-manager", optionSchema, options);
45
+
34
46
  const secretsManagerMiddleware = (opts = {}) => {
35
47
  const options = {
36
48
  ...defaults,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/secrets-manager",
3
- "version": "7.2.3",
3
+ "version": "7.3.0",
4
4
  "description": "Secrets Manager 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-secrets-manager": "^3.0.0"
@@ -75,7 +72,7 @@
75
72
  },
76
73
  "devDependencies": {
77
74
  "@aws-sdk/client-secrets-manager": "^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"