@vasrefil/api-toolkit 1.0.54 → 1.0.56
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/redis/redis.d.ts +5 -0
- package/dist/redis/redis.js +10 -0
- package/dist/utilities/log.util.js +1 -1
- package/package.json +1 -1
package/dist/redis/redis.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ declare class Redis_ {
|
|
|
7
7
|
key: string;
|
|
8
8
|
expireIn: number | string;
|
|
9
9
|
}) => Promise<number>;
|
|
10
|
+
hexpire: (payload: {
|
|
11
|
+
key: string;
|
|
12
|
+
field: string;
|
|
13
|
+
expireIn: number | string;
|
|
14
|
+
}) => Promise<unknown>;
|
|
10
15
|
set_multiple_hash: (key: string, pairs: any) => Promise<"OK">;
|
|
11
16
|
set_hash: (payload: {
|
|
12
17
|
key: string;
|
package/dist/redis/redis.js
CHANGED
|
@@ -36,6 +36,16 @@ class Redis_ {
|
|
|
36
36
|
throw error;
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
+
this.hexpire = async (payload) => {
|
|
40
|
+
try {
|
|
41
|
+
const { key, field, expireIn } = payload;
|
|
42
|
+
const resp = await this.client.call("HEXPIRE", key, expireIn, "FIELDS", 1, field);
|
|
43
|
+
return resp;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
39
49
|
this.set_multiple_hash = async (key, pairs) => {
|
|
40
50
|
try {
|
|
41
51
|
const resp = await this.client.hmset(key, pairs);
|
|
@@ -67,7 +67,7 @@ class LogUtil_ {
|
|
|
67
67
|
};
|
|
68
68
|
this.get_user = (serviceResponse) => {
|
|
69
69
|
const { req, actionType } = serviceResponse;
|
|
70
|
-
let distinct_id = req.user ? req.user.
|
|
70
|
+
let distinct_id = req.user ? req.user.email : (req.body.email || '--');
|
|
71
71
|
// if(this.cronjobs_events.includes(actionType)) {
|
|
72
72
|
// distinct_id = 'cron-job.org';
|
|
73
73
|
// }
|