@middy/ssm 7.2.3 → 7.3.1
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 +29 -1
- package/package.json +3 -6
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
modifyCache,
|
|
17
17
|
processCache,
|
|
18
18
|
sanitizeKey,
|
|
19
|
+
validateOptions,
|
|
19
20
|
} from "@middy/util";
|
|
20
21
|
|
|
21
22
|
const defaults = {
|
|
@@ -32,6 +33,33 @@ const defaults = {
|
|
|
32
33
|
awsRequestLimit: 10,
|
|
33
34
|
};
|
|
34
35
|
|
|
36
|
+
const optionSchema = {
|
|
37
|
+
type: "object",
|
|
38
|
+
properties: {
|
|
39
|
+
AwsClient: { instanceof: "Function" },
|
|
40
|
+
awsClientOptions: { type: "object" },
|
|
41
|
+
awsClientAssumeRole: { type: "string" },
|
|
42
|
+
awsClientCapture: { instanceof: "Function" },
|
|
43
|
+
fetchData: {
|
|
44
|
+
type: "object",
|
|
45
|
+
additionalProperties: { type: "string" },
|
|
46
|
+
},
|
|
47
|
+
disablePrefetch: { type: "boolean" },
|
|
48
|
+
cacheKey: { type: "string" },
|
|
49
|
+
cacheKeyExpiry: {
|
|
50
|
+
type: "object",
|
|
51
|
+
additionalProperties: { type: "number", minimum: -1 },
|
|
52
|
+
},
|
|
53
|
+
cacheExpiry: { type: "number", minimum: -1 },
|
|
54
|
+
setToContext: { type: "boolean" },
|
|
55
|
+
awsRequestLimit: { type: "integer", minimum: 1, maximum: 10 },
|
|
56
|
+
},
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const ssmValidateOptions = (options) =>
|
|
61
|
+
validateOptions("@middy/ssm", optionSchema, options);
|
|
62
|
+
|
|
35
63
|
const ssmMiddleware = (opts = {}) => {
|
|
36
64
|
const options = { ...defaults, ...opts };
|
|
37
65
|
|
|
@@ -150,7 +178,7 @@ const ssmMiddleware = (opts = {}) => {
|
|
|
150
178
|
.send(command)
|
|
151
179
|
.catch((e) => catchInvalidSignatureException(e, client, command))
|
|
152
180
|
.then((resp) => {
|
|
153
|
-
for (const param of resp.Parameters) {
|
|
181
|
+
for (const param of resp.Parameters ?? []) {
|
|
154
182
|
values[sanitizeKey(param.Name.replace(path, ""))] = parseValue(param);
|
|
155
183
|
}
|
|
156
184
|
if (resp.NextToken) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/ssm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "SSM (EC2 Systems Manager) parameters 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
|
},
|
|
@@ -65,7 +62,7 @@
|
|
|
65
62
|
"url": "https://github.com/sponsors/willfarrell"
|
|
66
63
|
},
|
|
67
64
|
"dependencies": {
|
|
68
|
-
"@middy/util": "7.
|
|
65
|
+
"@middy/util": "7.3.1"
|
|
69
66
|
},
|
|
70
67
|
"peerDependencies": {
|
|
71
68
|
"@aws-sdk/client-ssm": "^3.0.0"
|
|
@@ -77,7 +74,7 @@
|
|
|
77
74
|
},
|
|
78
75
|
"devDependencies": {
|
|
79
76
|
"@aws-sdk/client-ssm": "^3.0.0",
|
|
80
|
-
"@middy/core": "7.
|
|
77
|
+
"@middy/core": "7.3.1",
|
|
81
78
|
"@types/aws-lambda": "^8.0.0",
|
|
82
79
|
"@types/node": "^22.0.0",
|
|
83
80
|
"aws-xray-sdk": "^3.3.3"
|