@adtrackify/at-service-common 1.0.15 → 1.0.16

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.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ declare module '@adtrackify/at-service-common/clients/dynamodb-client' {
3
3
  export class DynamoDbClient {
4
4
  static safeGet: (tableName: string, keyName: string, keyValue: any) => Promise<AWS.DynamoDB.DocumentClient.AttributeMap | null>;
5
5
  static safePut: (tableName: string, data: any) => Promise<import("aws-sdk/lib/request").PromiseResult<AWS.DynamoDB.DocumentClient.PutItemOutput, AWS.AWSError> | null>;
6
+ static safeDelete: (tableName: string, keyName: string, keyValue: any) => Promise<import("aws-sdk/lib/request").PromiseResult<AWS.DynamoDB.DocumentClient.DeleteItemOutput, AWS.AWSError> | null>;
6
7
  static safeBatchGet: (tableName: string, keys: any) => Promise<AWS.DynamoDB.DocumentClient.ItemList>;
7
8
  static queryAll: (params: any) => Promise<any[] | null>;
8
9
  static batchGet: (params: any) => Promise<import("aws-sdk/lib/request").PromiseResult<AWS.DynamoDB.DocumentClient.BatchGetItemOutput, AWS.AWSError>>;
package/dist/index.js CHANGED
@@ -627966,6 +627966,21 @@ __publicField(DynamoDbClient, "safePut", async (tableName, data) => {
627966
627966
  return null;
627967
627967
  }
627968
627968
  });
627969
+ __publicField(DynamoDbClient, "safeDelete", async (tableName, keyName, keyValue) => {
627970
+ try {
627971
+ const params = {
627972
+ TableName: tableName,
627973
+ Key: {
627974
+ [keyName]: keyValue
627975
+ }
627976
+ };
627977
+ const res = await client.delete(params).promise();
627978
+ return res;
627979
+ } catch (e) {
627980
+ log.error(e, { message: "Dynamo failed safeDelete" });
627981
+ return null;
627982
+ }
627983
+ });
627969
627984
  __publicField(DynamoDbClient, "safeBatchGet", async (tableName, keys) => {
627970
627985
  try {
627971
627986
  const params = {