@squiz/db-lib 1.70.0 → 1.71.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.71.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c1cb4d9: ignore non-existent items in delete db transaction
8
+
3
9
  ## 1.70.0
4
10
 
5
11
  ### Minor Changes
package/lib/index.js CHANGED
@@ -57765,6 +57765,9 @@ var DynamoDbManager = class {
57765
57765
  if (this.transactionItems[transactionId] === void 0) {
57766
57766
  throw new TransactionError(`No items in transaction '${transactionId}' to execute`);
57767
57767
  }
57768
+ if (!this.transactionItems[transactionId].length) {
57769
+ return;
57770
+ }
57768
57771
  return tracer.startActiveSpan(
57769
57772
  "executeTransaction",
57770
57773
  {
@@ -58018,6 +58021,7 @@ var AbstractDynamoDbRepository = class {
58018
58021
  ConditionExpression: `attribute_exists(${this.keys.pk.attributeName})`
58019
58022
  };
58020
58023
  if ((_a = transaction.id) == null ? void 0 : _a.length) {
58024
+ delete deleteCommandInput.ConditionExpression;
58021
58025
  this.dbManager.addWriteTransactionItem(transaction.id, {
58022
58026
  Delete: deleteCommandInput
58023
58027
  });