dymo-api 1.0.3 → 1.0.4
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/lib/private-api.cjs +1 -18
- package/package.json +1 -1
package/lib/private-api.cjs
CHANGED
|
@@ -14,24 +14,7 @@ exports.isValidData = async (token, data) => {
|
|
|
14
14
|
if (!i) throw customError(1500, "You must provide at least one parameter.");
|
|
15
15
|
try {
|
|
16
16
|
const response = await axios.get(`https://api.tpeoficial.com/private/secure/verify`, { params: data, headers: { 'Authorization': token } });
|
|
17
|
-
|
|
18
|
-
"0000": "email",
|
|
19
|
-
"0001": "tel",
|
|
20
|
-
"0002": "domain",
|
|
21
|
-
"0003": "creditCard",
|
|
22
|
-
"0004": "ip"
|
|
23
|
-
}
|
|
24
|
-
const result = {};
|
|
25
|
-
response.data.forEach(obj => {
|
|
26
|
-
Object.keys(dicc).forEach(code => {
|
|
27
|
-
if (obj.hasOwnProperty('code') && obj.code === code) {
|
|
28
|
-
const type = dicc[code];
|
|
29
|
-
if (!result.hasOwnProperty(type)) result[type] = {};
|
|
30
|
-
result[type] = { ...result[type], ...obj };
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
return result;
|
|
17
|
+
return response.data;
|
|
35
18
|
} catch (error) {
|
|
36
19
|
throw customError(5000, error.message);
|
|
37
20
|
}
|