@moicky/dynamodb 2.4.1 → 2.4.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.
@@ -27,7 +27,7 @@ import { DynamoDBItem } from "../types";
27
27
  * );
28
28
  * ```
29
29
  */
30
- export declare function deleteItem(key: DynamoDBItem, args?: Partial<DeleteItemCommandInput>): Promise<DeleteItemCommandOutput>;
30
+ export declare function deleteItem<T extends DynamoDBItem = DynamoDBItem>(key: Partial<T>, args?: Partial<DeleteItemCommandInput>): Promise<DeleteItemCommandOutput>;
31
31
  type DeleteItemsArgs = Partial<BatchWriteItemCommandInput & {
32
32
  TableName?: string;
33
33
  }>;
@@ -63,5 +63,5 @@ type DeleteItemsArgs = Partial<BatchWriteItemCommandInput & {
63
63
  * );
64
64
  * ```
65
65
  */
66
- export declare function deleteItems(keys: DynamoDBItem[], args?: DeleteItemsArgs, retry?: number): Promise<void>;
66
+ export declare function deleteItems<T extends DynamoDBItem = DynamoDBItem>(keys: Partial<T>[], args?: DeleteItemsArgs, retry?: number): Promise<void>;
67
67
  export {};
@@ -32,8 +32,8 @@ import { DynamoDBItem } from "../types";
32
32
  * console.log(newItem); // { "PK": "User/1", "SK": "Book/1", "released": 2000 }
33
33
  * ```
34
34
  */
35
- export declare function updateItem<T extends DynamoDBItem>(key: T, data: Partial<T>, args: Partial<UpdateItemCommandInput>): Promise<T>;
36
- export declare function updateItem<T extends DynamoDBItem, K extends Partial<UpdateItemCommandInput> = Partial<UpdateItemCommandInput>>(key: T, data: Partial<T>, args?: K): Promise<K extends {
35
+ export declare function updateItem<T extends DynamoDBItem>(key: Partial<T>, data: Partial<T>, args: Partial<UpdateItemCommandInput>): Promise<T>;
36
+ export declare function updateItem<T extends DynamoDBItem, K extends Partial<UpdateItemCommandInput> = Partial<UpdateItemCommandInput>>(key: Partial<T>, data: Partial<T>, args?: K): Promise<K extends {
37
37
  ReturnValues: string;
38
38
  } ? T : undefined>;
39
39
  /**
@@ -50,4 +50,4 @@ export declare function updateItem<T extends DynamoDBItem, K extends Partial<Upd
50
50
  * await removeAttributes({ PK: "User/1", SK: "Book/1" }, ["description"]);
51
51
  * ```
52
52
  */
53
- export declare function removeAttributes<T extends DynamoDBItem = DynamoDBItem>(key: T, attributes: Array<keyof T>, args?: Partial<UpdateItemCommandInput>): Promise<UpdateItemCommandOutput>;
53
+ export declare function removeAttributes<T extends DynamoDBItem = DynamoDBItem>(key: Partial<T>, attributes: Array<keyof T>, args?: Partial<UpdateItemCommandInput>): Promise<UpdateItemCommandOutput>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moicky/dynamodb",
3
- "version": "2.4.1",
3
+ "version": "2.4.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",