@middy/ssm 5.0.2 → 5.0.3

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 (2) hide show
  1. package/index.js +2 -5
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -34,14 +34,13 @@ const ssmMiddleware = (opts = {})=>{
34
34
  const fetchKeys = Object.values(options.fetchData);
35
35
  for (const internalKey of internalKeys){
36
36
  if (cachedValues[internalKey]) continue;
37
- if (options.fetchData[internalKey].substr(-1) === '/') continue; // Skip path passed in
37
+ if (options.fetchData[internalKey].substr(-1) === '/') continue;
38
38
  namedKeys.push(internalKey);
39
39
  }
40
40
  for (const [idx, internalKey] of namedKeys.entries()){
41
41
  const fetchKey = options.fetchData[internalKey];
42
42
  batchInternalKeys.push(internalKey);
43
43
  batchFetchKeys.push(fetchKey);
44
- // from the first to the batch size skip, unless it's the last entry
45
44
  if ((!idx || (idx + 1) % awsRequestLimit !== 0) && !(idx + 1 === namedKeys.length)) {
46
45
  continue;
47
46
  }
@@ -49,7 +48,6 @@ const ssmMiddleware = (opts = {})=>{
49
48
  Names: batchFetchKeys,
50
49
  WithDecryption: true
51
50
  })).then((resp)=>{
52
- // Don't sanitize key, mapped to set value in options
53
51
  return Object.assign(...(resp.InvalidParameters ?? []).map((fetchKey)=>{
54
52
  return {
55
53
  [fetchKey]: new Promise(()=>{
@@ -91,7 +89,7 @@ const ssmMiddleware = (opts = {})=>{
91
89
  for(const internalKey in options.fetchData){
92
90
  if (cachedValues[internalKey]) continue;
93
91
  const fetchKey = options.fetchData[internalKey];
94
- if (fetchKey.substr(-1) !== '/') continue; // Skip not path passed in
92
+ if (fetchKey.substr(-1) !== '/') continue;
95
93
  values[internalKey] = fetchPath(fetchKey).catch((e)=>{
96
94
  const value = getCache(options.cacheKey).value ?? {};
97
95
  value[internalKey] = undefined;
@@ -144,7 +142,6 @@ const ssmMiddleware = (opts = {})=>{
144
142
  };
145
143
  };
146
144
  export default ssmMiddleware;
147
- // used for TS type inference (see index.d.ts)
148
145
  export function ssmParam(name) {
149
146
  return name;
150
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/ssm",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "description": "SSM (EC2 Systems Manager) parameters middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -60,13 +60,13 @@
60
60
  "url": "https://github.com/sponsors/willfarrell"
61
61
  },
62
62
  "dependencies": {
63
- "@middy/util": "5.0.2"
63
+ "@middy/util": "5.0.3"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@aws-sdk/client-ssm": "^3.0.0",
67
- "@middy/core": "5.0.2",
67
+ "@middy/core": "5.0.3",
68
68
  "@types/aws-lambda": "^8.10.101",
69
69
  "aws-xray-sdk": "^3.3.3"
70
70
  },
71
- "gitHead": "6d17e155237022f2a0abd095ac7cd99ebfc7fc71"
71
+ "gitHead": "87660575a7ac2b52e4153c407a4c63c9449dcd0d"
72
72
  }