@moicky/dynamodb 2.5.1 → 2.5.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.
@@ -16,5 +16,5 @@ export declare class Transaction {
16
16
  delete(item: DynamoDBItemKey, args?: DeleteOperation["args"]): void;
17
17
  addConditionFor<T extends DynamoDBItemKey>(item: T, args?: Partial<ConditionOperation["args"]>): ConditionOperations<T>;
18
18
  private handleOperation;
19
- execute(args?: Partial<Omit<TransactWriteItemsCommandInput, "TransactItems">>): Promise<any>;
19
+ execute(args?: Partial<Omit<TransactWriteItemsCommandInput, "TransactItems">>): Promise<import("@aws-sdk/client-dynamodb").TransactWriteItemsCommandOutput>;
20
20
  }
@@ -131,9 +131,7 @@ class Transaction {
131
131
  TransactItems: operations,
132
132
  ...args,
133
133
  };
134
- return (0, __1.getClient)()
135
- .send(new client_dynamodb_1.TransactWriteItemsCommand(input))
136
- .catch((err) => ({ ...err, args: input }));
134
+ return (0, __1.getClient)().send(new client_dynamodb_1.TransactWriteItemsCommand(input));
137
135
  }
138
136
  }
139
137
  exports.Transaction = Transaction;
@@ -100,8 +100,10 @@ class UpdateOperations {
100
100
  this.operation.args = {
101
101
  ...this.operation.args,
102
102
  ConditionExpression: expression,
103
- ExpressionAttributeNames: (0, lib_1.getAttributeNames)(values),
104
- ExpressionAttributeValues: Object.keys(values).reduce((acc, keyName) => {
103
+ ExpressionAttributeNames: (0, lib_1.getAttributeNames)(values, {
104
+ attributesToGet: (0, lib_1.getAttributesFromExpression)(expression),
105
+ }),
106
+ ExpressionAttributeValues: (0, lib_1.getAttributesFromExpression)(expression, ":").reduce((acc, keyName) => {
105
107
  acc[`:${keyName}`] = values[keyName];
106
108
  return acc;
107
109
  }, {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moicky/dynamodb",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Contains a collection of convenience functions for working with AWS DynamoDB",