-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
71 lines (56 loc) · 1.84 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//Dependencies
const Axios = require("axios")
//Main
class EN {
constructor(api_key){
this.api_key = api_key
}
async request(request_to, parameters){
return new Promise((resolve)=>{
Axios.get(request_to, {
headers: {
"X-Api-Key": this.api_key
},
params: parameters
}).then(function(res){
resolve(res.data)
}).catch(function(err){
resolve(err)
})
})
}
async domain(domain = String = "example.com", parameters = String = { q: null }){
parameters.q = domain
return this.request("https://app.netlas.io/api/domain", parameters)
}
async domains(domain = String = "example.com"){
var parameters = {}
parameters.q = domain
return this.request("https://app.netlas.io/api/domains", parameters)
}
async responses_search(query = String = "example.com", indices = BigInt = 20, parameters = String = { q: null, indices: null }){
parameters.q = query
parameters.indices = indices
return this.request("https://app.netlas.io/api/responses/", parameters)
}
async certificates_search(query = String = null){
var parameters = {}
parameters.q = query
return this.request("https://app.netlas.io/api/certs/", parameters)
}
async certificates_counts(query = String = null){
var parameters = {}
parameters.q = query
return this.request("https://app.netlas.io/api/certs_count/", parameters)
}
async list_indices(){
return this.request("https://app.netlas.io/api/indices/", {})
}
async get_current_profile(){
return this.request("https://app.netlas.io/api/users/profile/", {})
}
}
//Exporter
module.exports = {
EN
}