@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adtrackify/at-service-common",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,12 +1,8 @@
1
-
2
-
3
- declare module 'axios/lib/adapters/http' {
4
- import { AxiosAdapter } from 'axios';
5
-
6
- const httpAdapter: AxiosAdapter;
7
- namespace httpAdapter { }
8
-
9
- export = httpAdapter;
10
- }
11
-
12
-
1
+ declare module 'axios/lib/adapters/http' {
2
+ import { AxiosAdapter } from 'axios';
3
+
4
+ const httpAdapter: AxiosAdapter;
5
+ namespace httpAdapter { }
6
+
7
+ export = httpAdapter;
8
+ }
@@ -34,6 +34,22 @@ export class DynamoDbClient {
34
34
  }
35
35
  };
36
36
 
37
+ static safeDelete = async (tableName: string, keyName: string, keyValue: any) => {
38
+ try {
39
+ const params = {
40
+ TableName: tableName,
41
+ Key: {
42
+ [ keyName ]: keyValue
43
+ }
44
+ };
45
+ const res = await client.delete(params).promise();
46
+ return res;
47
+ } catch (e: any) {
48
+ log.error(e, { message: 'Dynamo failed safeDelete' });
49
+ return null;
50
+ }
51
+ };
52
+
37
53
  static safeBatchGet = async (tableName: string, keys: any) => {
38
54
  try {
39
55
  const params: BatchGetItemInput = {