@middy/dynamodb 5.2.0 → 5.2.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.
Files changed (2) hide show
  1. package/index.js +5 -2
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -5,7 +5,8 @@ import {
5
5
  getCache,
6
6
  getInternal,
7
7
  processCache,
8
- modifyCache
8
+ modifyCache,
9
+ catchInvalidSignatureException
9
10
  } from '@middy/util'
10
11
  import { DynamoDBClient, GetItemCommand } from '@aws-sdk/client-dynamodb'
11
12
  import { marshall, unmarshall } from '@aws-sdk/util-dynamodb'
@@ -40,8 +41,10 @@ const dynamodbMiddleware = (opts = {}) => {
40
41
  for (const internalKey in options.fetchData) {
41
42
  if (cachedValues[internalKey]) continue
42
43
  const inputParameters = options.fetchData[internalKey]
44
+ const command = new GetItemCommand(inputParameters)
43
45
  values[internalKey] = client
44
- .send(new GetItemCommand(inputParameters))
46
+ .send(command)
47
+ .catch((e) => catchInvalidSignatureException(e, client, command))
45
48
  .then((resp) => unmarshall(resp.Item))
46
49
  .catch((e) => {
47
50
  const value = getCache(options.cacheKey).value ?? {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/dynamodb",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "DynamoDB middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -58,14 +58,14 @@
58
58
  "url": "https://github.com/sponsors/willfarrell"
59
59
  },
60
60
  "dependencies": {
61
- "@middy/util": "5.2.0"
61
+ "@middy/util": "5.2.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@aws-sdk/client-dynamodb": "^3.245.0",
65
65
  "@aws-sdk/util-dynamodb": "^3.245.0",
66
- "@middy/core": "5.2.0",
66
+ "@middy/core": "5.2.1",
67
67
  "@types/aws-lambda": "^8.10.101",
68
68
  "aws-xray-sdk": "^3.3.3"
69
69
  },
70
- "gitHead": "2d9096a49cd8fb62359517be96d6c93609df41f0"
70
+ "gitHead": "4d55da221b9165b4b3e59a12632fd40a149a1e92"
71
71
  }