feat(AWS DynamoDB Node): Improve error handling + add optional GetAll Scan FilterExpression (#3318)

* FilterExpression, ExpressionAttributeValues optional

* Returns AWS JSON messages not in response body

* 🔨 fixed filterExpression missing in request body

*  linter fixes

* Reintroduced 'fix' block at :311 results in duplication

*  lock file fix

*  fix

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Bryce Sheehan
2022-07-10 17:10:50 +08:00
committed by GitHub
parent 82a254a8d9
commit 732c8fcf84
3 changed files with 15 additions and 8 deletions

View File

@@ -307,11 +307,13 @@ export class AwsDynamoDB implements INodeType {
const body: IRequestBody = {
TableName: this.getNodeParameter('tableName', i) as string,
ExpressionAttributeValues: adjustExpressionAttributeValues(eavUi),
};
if (scan === true) {
body['FilterExpression'] = this.getNodeParameter('filterExpression', i) as string;
const filterExpression = this.getNodeParameter('filterExpression', i) as string;
if (filterExpression) {
body['FilterExpression'] = filterExpression;
}
} else {
body['KeyConditionExpression'] = this.getNodeParameter('keyConditionExpression', i) as string;
}
@@ -332,6 +334,12 @@ export class AwsDynamoDB implements INodeType {
body.ExpressionAttributeNames = expressionAttributeName;
}
const expressionAttributeValues = adjustExpressionAttributeValues(eavUi);
if (Object.keys(expressionAttributeValues).length) {
body.ExpressionAttributeValues = expressionAttributeValues;
}
if (indexName) {
body.IndexName = indexName;
}