@apiverve/ipblacklistlookup 1.0.2 → 1.1.2
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/README.md +2 -2
- package/index.js +16 -7
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
IP Blacklist Lookup API
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
-
IP Blacklist Lookup is a simple tool for looking up if an IP address is in a blacklist. It returns the
|
|
4
|
+
IP Blacklist Lookup is a simple tool for looking up if an IP address is in a blacklist. It returns if the IP is found in a blacklist.
|
|
5
5
|
|
|
6
6
|

|
|
7
7
|

|
|
@@ -76,7 +76,7 @@ api.execute(query, function (error, data) {
|
|
|
76
76
|
"ipDetails": {
|
|
77
77
|
"range": [
|
|
78
78
|
3373776896,
|
|
79
|
-
|
|
79
|
+
3373785087
|
|
80
80
|
],
|
|
81
81
|
"country": "BR",
|
|
82
82
|
"region": "",
|
package/index.js
CHANGED
|
@@ -24,8 +24,13 @@ class ipblacklistlookupWrapper {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async execute(query, callback) {
|
|
27
|
-
if
|
|
28
|
-
|
|
27
|
+
if(arguments.length > 1) {
|
|
28
|
+
if (!query || typeof query !== 'object') {
|
|
29
|
+
throw new Error('Query parameters must be provided as an object.');
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
callback = query;
|
|
33
|
+
query = {};
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
var requiredParams = ["ip"];
|
|
@@ -68,11 +73,15 @@ class ipblacklistlookupWrapper {
|
|
|
68
73
|
|
|
69
74
|
constructURL(query) {
|
|
70
75
|
let url = this.baseURL;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
|
|
77
|
+
if(query && typeof query === 'object')
|
|
78
|
+
{
|
|
79
|
+
if (Object.keys(query).length > 0) {
|
|
80
|
+
const queryString = Object.keys(query)
|
|
81
|
+
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(query[key])}`)
|
|
82
|
+
.join('&');
|
|
83
|
+
url += `?${queryString}`;
|
|
84
|
+
}
|
|
76
85
|
}
|
|
77
86
|
return url;
|
|
78
87
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apiverve/ipblacklistlookup",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "IP Blacklist Lookup is a simple tool for looking up if an IP address is in a blacklist. It returns the
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "IP Blacklist Lookup is a simple tool for looking up if an IP address is in a blacklist. It returns if the IP is found in a blacklist.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "mocha"
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/apiverve/ipblacklistlookup-API",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"mocha": "^
|
|
24
|
-
"chai": "^
|
|
25
|
-
"dotenv": "^
|
|
23
|
+
"mocha": "^10.4.0",
|
|
24
|
+
"chai": "^5.1.1",
|
|
25
|
+
"dotenv": "^16.4.5"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"node-fetch": "3.3.2",
|
|
29
|
-
"promise": "^
|
|
30
|
-
"axios": "
|
|
29
|
+
"promise": "^8.3.0",
|
|
30
|
+
"axios": "1.6.8"
|
|
31
31
|
}
|
|
32
32
|
}
|