@moicky/dynamodb 2.4.5 → 2.4.6
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UpdateItemCommandInput, UpdateItemCommandOutput } from "@aws-sdk/client-dynamodb";
|
|
1
|
+
import { ReturnValue, UpdateItemCommandInput, UpdateItemCommandOutput } from "@aws-sdk/client-dynamodb";
|
|
2
2
|
import { DynamoDBItem } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Updates an item in DynamoDB. All provided fields are overwritten.
|
|
@@ -32,10 +32,13 @@ import { DynamoDBItem } from "../types";
|
|
|
32
32
|
* console.log(newItem); // { "PK": "User/1", "SK": "Book/1", "released": 2000 }
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ReturnValues:
|
|
38
|
-
}
|
|
35
|
+
type UpdateInputWithoutReturn = Partial<Omit<UpdateItemCommandInput, "ReturnValue">>;
|
|
36
|
+
type UpdateInputWithReturn = UpdateInputWithoutReturn & {
|
|
37
|
+
ReturnValues: ReturnValue;
|
|
38
|
+
};
|
|
39
|
+
export declare function updateItem<T extends DynamoDBItem = DynamoDBItem, D extends Partial<T> = Partial<T>>(key: Partial<T>, data: D, args?: never): Promise<undefined>;
|
|
40
|
+
export declare function updateItem<T extends DynamoDBItem = DynamoDBItem, K extends UpdateInputWithReturn = UpdateInputWithReturn, D extends Partial<T> = Partial<T>>(key: Partial<T>, data: D, args: K): Promise<T>;
|
|
41
|
+
export declare function updateItem<T extends DynamoDBItem = DynamoDBItem, K extends UpdateInputWithoutReturn = UpdateInputWithoutReturn, D extends Partial<T> = Partial<T>>(key: Partial<T>, data: D, args: K): Promise<undefined>;
|
|
39
42
|
/**
|
|
40
43
|
* Removes specified attributes from an item in DynamoDB.
|
|
41
44
|
*
|
|
@@ -51,3 +54,4 @@ export declare function updateItem<T extends DynamoDBItem, K extends Partial<Upd
|
|
|
51
54
|
* ```
|
|
52
55
|
*/
|
|
53
56
|
export declare function removeAttributes<T extends DynamoDBItem = DynamoDBItem>(key: Partial<T>, attributes: Array<keyof T>, args?: Partial<UpdateItemCommandInput>): Promise<UpdateItemCommandOutput>;
|
|
57
|
+
export {};
|