@moicky/dynamodb 3.1.0 → 3.1.2
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/dist/operations/get.js +5 -0
- package/dist/transactions/index.js +4 -3
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/operations/get.js
CHANGED
|
@@ -31,6 +31,11 @@ const lib_1 = require("../lib");
|
|
|
31
31
|
*/
|
|
32
32
|
async function getItem(key, args = {}) {
|
|
33
33
|
args = (0, lib_1.withDefaults)(args, "getItem");
|
|
34
|
+
if (args?.ProjectionExpression && !args?.ExpressionAttributeNames) {
|
|
35
|
+
args.ExpressionAttributeNames = (0, lib_1.getAttributeNames)(key, {
|
|
36
|
+
attributesToGet: (0, lib_1.getAttributesFromExpression)(args?.ProjectionExpression),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
34
39
|
return (0, lib_1.getClient)()
|
|
35
40
|
.send(new client_dynamodb_1.GetItemCommand({
|
|
36
41
|
Key: (0, lib_1.stripKey)(key, args),
|
|
@@ -173,9 +173,10 @@ class Transaction {
|
|
|
173
173
|
}
|
|
174
174
|
this.hasBeenExecuted = true;
|
|
175
175
|
const operations = Object.values(this.operations);
|
|
176
|
-
if (operations.length === 0
|
|
177
|
-
(
|
|
178
|
-
|
|
176
|
+
if (operations.length === 0)
|
|
177
|
+
return resolve({});
|
|
178
|
+
if (operations.length > OPERATIONS_LIMIT &&
|
|
179
|
+
!this.shouldSplitTransactions) {
|
|
179
180
|
reject(new Error("[@moicky/dynamodb]: Invalid number of operations"));
|
|
180
181
|
}
|
|
181
182
|
const conditionCheckItems = operations
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @moicky/dynamodb
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|

|
|
5
5
|
|
|
6
6
|
## Description
|