@middy/ssm 2.5.3 → 2.5.7

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 +2 -13
  2. package/index.js +9 -2
  3. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -1,19 +1,8 @@
1
1
  import { SSM } from 'aws-sdk'
2
- import { captureAWSClient } from 'aws-xray-sdk'
2
+ import { Options as MiddyOptions } from '@middy/util'
3
3
  import middy from '@middy/core'
4
4
 
5
- interface Options<S = SSM> {
6
- AwsClient?: new() => S
7
- awsClientOptions?: Partial<SSM.Types.ClientConfiguration>
8
- awsClientAssumeRole?: string
9
- awsClientCapture?: typeof captureAWSClient
10
- fetchData?: { [key: string]: string }
11
- disablePrefetch?: boolean
12
- cacheKey?: string
13
- cacheExpiry?: number
14
- setToEnv?: boolean
15
- setToContext?: boolean
16
- }
5
+ interface Options<S = SSM> extends MiddyOptions<S, SSM.Types.ClientConfiguration> {}
17
6
 
18
7
  declare function ssm (options?: Options): middy.MiddlewareObj
19
8
 
package/index.js CHANGED
@@ -88,6 +88,13 @@ const ssmMiddleware = (opts = {}) => {
88
88
  [param.Name]: parseValue(param)
89
89
  };
90
90
  }));
91
+ }).catch(e => {
92
+ var _getCache$value2;
93
+
94
+ const value = (_getCache$value2 = getCache(options.cacheKey).value) !== null && _getCache$value2 !== void 0 ? _getCache$value2 : {};
95
+ value[internalKey] = undefined;
96
+ modifyCache(options.cacheKey, value);
97
+ throw e;
91
98
  });
92
99
 
93
100
  for (const internalKey of batchInternalKeys) {
@@ -113,9 +120,9 @@ const ssmMiddleware = (opts = {}) => {
113
120
  if (fetchKey.substr(-1) !== '/') continue; // Skip not path passed in
114
121
 
115
122
  values[internalKey] = fetchPath(fetchKey).catch(e => {
116
- var _getCache$value2, _getCache2;
123
+ var _getCache$value3, _getCache2;
117
124
 
118
- const value = (_getCache$value2 = (_getCache2 = getCache(options.cacheKey)) === null || _getCache2 === void 0 ? void 0 : _getCache2.value) !== null && _getCache$value2 !== void 0 ? _getCache$value2 : {};
125
+ const value = (_getCache$value3 = (_getCache2 = getCache(options.cacheKey)) === null || _getCache2 === void 0 ? void 0 : _getCache2.value) !== null && _getCache$value3 !== void 0 ? _getCache$value3 : {};
119
126
  value[internalKey] = undefined;
120
127
  modifyCache(options.cacheKey, value);
121
128
  throw e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/ssm",
3
- "version": "2.5.3",
3
+ "version": "2.5.7",
4
4
  "description": "SSM (EC2 Systems Manager) parameters middleware for the middy framework",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -46,12 +46,12 @@
46
46
  },
47
47
  "homepage": "https://github.com/middyjs/middy#readme",
48
48
  "dependencies": {
49
- "@middy/util": "^2.5.3"
49
+ "@middy/util": "^2.5.7"
50
50
  },
51
51
  "devDependencies": {
52
- "@middy/core": "^2.5.3",
52
+ "@middy/core": "^2.5.7",
53
53
  "aws-sdk": "^2.939.0",
54
54
  "aws-xray-sdk": "^3.3.3"
55
55
  },
56
- "gitHead": "690884d43b9cd632aeca9a5eba1612160b987cd4"
56
+ "gitHead": "3983c4b138e1a4d7fcb3ed805d3b8832fff06fc1"
57
57
  }