@xapp/dynamo-service
Advanced tools
Comparing version 0.0.96 to 0.0.97
@@ -49,2 +49,3 @@ import { ConditionExpression, DynamoService, QueryParams, QueryResult, ScanParams, ScanResult, UpdateBody, UpdateReturnType } from "./DynamoService"; | ||
delete(key: Partial<T> | Partial<T>[]): Promise<void>; | ||
private getKey(obj); | ||
private cleanseObjectOfIgnoredGetItems(obj); | ||
@@ -51,0 +52,0 @@ private cleanseObjectOfIgnoredGetItems<P>(obj); |
@@ -131,3 +131,3 @@ "use strict"; | ||
ensureFormat(this.formattedKeys, set); | ||
const dynamoKey = this.convertObjToDynamo(key); | ||
const dynamoKey = this.getKey(key); | ||
return this.db | ||
@@ -143,4 +143,4 @@ .update(this.tableName, dynamoKey, { set, remove, append }, conditionExpression, returnType) | ||
const realKey = (Array.isArray(key)) ? | ||
key.map(key => this.convertObjToDynamo(key)) : | ||
this.convertObjToDynamo(key); | ||
key.map(key => this.getKey(key)) : | ||
this.getKey(key); | ||
return this.db.get(this.tableName, realKey, projection) | ||
@@ -162,5 +162,13 @@ .then(item => (Array.isArray(item)) ? item.map((item) => this.convertObjFromDynamo(item)) : this.convertObjFromDynamo(item)) | ||
delete(key) { | ||
const dynamoKey = Array.isArray(key) ? key.map(k => this.convertObjToDynamo(k)) : this.convertObjToDynamo(key); | ||
const dynamoKey = Array.isArray(key) ? key.map(k => this.getKey(k)) : this.getKey(key); | ||
return this.db.delete(this.tableName, dynamoKey); | ||
} | ||
getKey(obj) { | ||
const key = {}; | ||
key[this.primaryKey] = obj[this.primaryKey]; | ||
if (this.sortKey) { | ||
key[this.sortKey] = obj[this.sortKey]; | ||
} | ||
return this.convertObjToDynamo(key); | ||
} | ||
cleanseObjectOfIgnoredGetItems(obj) { | ||
@@ -167,0 +175,0 @@ if (!obj || !this.props.ignoreColumnsInGet) { |
{ | ||
"name": "@xapp/dynamo-service", | ||
"version": "0.0.96", | ||
"version": "0.0.97", | ||
"description": "A dynamo help class which will help maintain data integrity.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
146437
3913