inlaweb-lib-dynamodb 1.0.6 → 1.0.7

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.
Files changed (3) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +16 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export declare class DynamoLib {
13
13
  permission?: string;
14
14
  username?: string;
15
15
  }): Promise<T[]>;
16
+ deleteItem(tableName: string, key: KeyValue): Promise<void>;
16
17
  private buildQueryParams;
17
18
  private buildExpressions;
18
19
  private buildFilterExpression;
package/index.js CHANGED
@@ -84,6 +84,22 @@ class DynamoLib {
84
84
  throw error;
85
85
  }
86
86
  }
87
+ async deleteItem(tableName, key) {
88
+ try {
89
+ const params = {
90
+ TableName: tableName,
91
+ Key: key,
92
+ ReturnConsumedCapacity: "TOTAL",
93
+ };
94
+ this.logger.debug(`DeleteItem: ${JSON.stringify(params)}`);
95
+ const response = await this.docClient.send(new lib_dynamodb_1.DeleteCommand(params));
96
+ this.logger.debug(`DeleteItem Result: ${JSON.stringify(response)}`);
97
+ }
98
+ catch (error) {
99
+ this.logger.error(error.message);
100
+ throw error;
101
+ }
102
+ }
87
103
  buildQueryParams(params) {
88
104
  const projection = this.buildProjectionExpression(params.searchParameters.projectionExpression);
89
105
  const parameters = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inlaweb-lib-dynamodb",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/types/index.d.ts",
6
6
  "scripts": {