@xapp/dynamo-service
Advanced tools
Comparing version 0.0.47 to 0.0.48
@@ -7,2 +7,5 @@ import { ConditionExpression, DynamoService, QueryParams, QueryResult, ScanParams, ScanResult, UpdateBody, UpdateReturnType } from "./DynamoService"; | ||
} | ||
export interface PutAllReturn<T> { | ||
unprocessed: T[]; | ||
} | ||
export declare class TableService<T extends object> { | ||
@@ -21,2 +24,3 @@ readonly tableName: string; | ||
put(obj: T, condition?: ConditionExpression): Promise<T>; | ||
putAll(obj: T[]): Promise<PutAllReturn<T>>; | ||
update(key: Partial<T>, obj: UpdateBody<T>): Promise<void>; | ||
@@ -39,3 +43,3 @@ update(key: Partial<T>, obj: UpdateBody<T>, conditionExpression: ConditionExpression): Promise<void>; | ||
scan<P extends keyof T>(params: ScanParams, projection: P | P[]): Promise<ScanResult<Pick<T, P>>>; | ||
delete(key: Partial<T>): Promise<void>; | ||
delete(key: Partial<T> | Partial<T>[]): Promise<void>; | ||
private convertObjFromDynamo(dynamoObj); | ||
@@ -42,0 +46,0 @@ private convertObjFromDynamo<P>(dynamoObj); |
@@ -70,2 +70,14 @@ "use strict"; | ||
} | ||
putAll(obj) { | ||
obj.forEach(o => Object_1.throwIfDoesNotContain(o, this.requiredKeys)); | ||
const putObjs = (this.props.trimUnknown) ? | ||
obj.map(o => Object_1.subset(o, this.knownKeys)) : | ||
obj; | ||
const converted = putObjs.map(p => this.convertObjToDynamo(p)); | ||
return this.db.put(this.tableName, converted).then(unprocessed => { | ||
return { | ||
unprocessed: unprocessed | ||
}; | ||
}); | ||
} | ||
update(key, obj, conditionExpression, returnType) { | ||
@@ -72,0 +84,0 @@ Object_1.throwIfDoesContain(obj.remove, this.constantKeys.concat(this.requiredKeys)); |
{ | ||
"name": "@xapp/dynamo-service", | ||
"version": "0.0.47", | ||
"version": "0.0.48", | ||
"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
128217
3478