@moicky/dynamodb 2.4.0 → 2.4.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.
@@ -26,7 +26,7 @@ import { DynamoDBItem } from "../types";
26
26
  * );
27
27
  * ```
28
28
  */
29
- export declare function getItem<T extends DynamoDBItem = DynamoDBItem>(key: T, args?: Partial<GetItemCommandInput>): Promise<T | undefined>;
29
+ export declare function getItem<T extends DynamoDBItem = DynamoDBItem>(key: Partial<T>, args?: Partial<GetItemCommandInput>): Promise<T | undefined>;
30
30
  type GetItemsArgs = Partial<BatchGetItemCommandInput & {
31
31
  TableName?: string;
32
32
  }>;
@@ -59,7 +59,7 @@ type GetItemsArgs = Partial<BatchGetItemCommandInput & {
59
59
  * );
60
60
  * ```
61
61
  */
62
- export declare function getItems<T extends DynamoDBItem = DynamoDBItem>(keys: T[], args?: GetItemsArgs, retry?: number): Promise<Array<T | undefined>>;
62
+ export declare function getItems<T extends DynamoDBItem = DynamoDBItem>(keys: Partial<T>[], args?: GetItemsArgs, retry?: number): Promise<Array<T | undefined>>;
63
63
  /**
64
64
  * Retrieves all items from the DynamoDB table.
65
65
  * @param args - The additional arguments to override or specify for {@link ScanCommandInput}
@@ -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.0",
3
+ "version": "2.4.2",
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",