Skip to content

Commit b1f747a

Browse files
committed
Added actions
1 parent 25275d3 commit b1f747a

File tree

5 files changed

+858
-18
lines changed

5 files changed

+858
-18
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import app from "../../ipstack.app.mjs";
2+
3+
export default {
4+
key: "ipstack-ip-lookup",
5+
name: "IP Lookup",
6+
description: "Look up single IPv4 or IPv6 addresses. [See the documentation](https://ipstack.com/documentation#standard)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
ip: {
12+
propDefinition: [
13+
app,
14+
"ip",
15+
],
16+
},
17+
hostname: {
18+
propDefinition: [
19+
app,
20+
"hostname",
21+
],
22+
},
23+
security: {
24+
propDefinition: [
25+
app,
26+
"security",
27+
],
28+
},
29+
language: {
30+
propDefinition: [
31+
app,
32+
"language",
33+
],
34+
},
35+
},
36+
async run({ $ }) {
37+
const response = await this.app.ipLookup({
38+
$,
39+
ip: this.ip,
40+
params: {
41+
hostname: this.hostname
42+
? 1
43+
: 0,
44+
security: this.security
45+
? 1
46+
: 0,
47+
language: this.language,
48+
},
49+
});
50+
$.export("$summary", "Successfully retrieved data for the IP " + this.ip);
51+
return response;
52+
},
53+
};

0 commit comments

Comments
 (0)