-
Notifications
You must be signed in to change notification settings - Fork 5.6k
ipgeolocation_io: add app file and 12 actions #20190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
michelle0927
merged 28 commits into
PipedreamHQ:master
from
mateen993:add/ipgeolocation-io-app
Mar 6, 2026
+1,091
−12
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
052081d
ipgeolocation_io: add app file and 12 actions
mateen993 320e362
Update components/ipgeolocation_io/actions/get-abuse-contact/get-abus…
mateen993 bf8c7e7
Update components/ipgeolocation_io/actions/get-asn/get-asn.mjs
mateen993 7d0d7aa
Update components/ipgeolocation_io/actions/get-bulk-geolocation/get-b…
mateen993 d582959
Update components/ipgeolocation_io/actions/get-ip-security/get-ip-sec…
mateen993 9eeddd9
Update components/ipgeolocation_io/actions/parse-bulk-user-agents/par…
mateen993 85365d4
Update components/ipgeolocation_io/ipgeolocation_io.app.mjs
mateen993 8766743
Update components/ipgeolocation_io/README.md
mateen993 74d49a8
Update components/ipgeolocation_io/README.md
mateen993 8193837
Update components/ipgeolocation_io/actions/parse-user-agent/parse-use…
mateen993 fa46560
ipgeolocation_io: fix files path
mateen993 3cbbb19
ipgeolocation_io: fix: import + add: validation (convert-timezone)
mateen993 cee55de
ipgeolocation_io: add - validation (astronomy-time-series)
mateen993 9161dd3
ipgeolocation_io: fix: apiKey input as props add
mateen993 7b6c981
Update components/ipgeolocation_io/package.json
mateen993 fd049ed
ipgeolocation_io: fix: auth + get-timezone
mateen993 8d99b72
ipgeolocation_io: fix summary
mateen993 29c8ec2
ipgeolocation_io: add $ context
mateen993 c51580b
Update components/ipgeolocation_io/actions/get-astronomy/get-astronom…
mateen993 0dca4f8
Update components/ipgeolocation_io/actions/get-astronomy-time-series/…
mateen993 be480a2
Merge remote-tracking branch 'upstream/master' into add/ipgeolocation…
michelle0927 43ed1e5
move ipgeolocation_io to ipgeolocation
michelle0927 4bb8505
move api call methods to app file
michelle0927 915da98
create common file for languages
michelle0927 e00020a
update props to camelCase
michelle0927 2183463
pnpm-lock.yaml
michelle0927 d7df96e
fix key
michelle0927 b87bc66
update api key
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
192 changes: 192 additions & 0 deletions
192
components/ipgeolocation/actions/convert-timezone/convert-timezone.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,192 @@ | ||
| import ipgeolocation from "../../ipgeolocation.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "ipgeolocation-convert-timezone", | ||
| name: "Convert Timezone", | ||
| description: | ||
| "Convert a time between two timezones using timezone names, coordinates, city, IATA, ICAO, or UN/LOCODE. [See the documentation](https://ipgeolocation.io/documentation/timezone-api.html)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| ipgeolocation, | ||
| tzFrom: { | ||
| type: "string", | ||
| label: "From Timezone", | ||
| description: "Source timezone name (e.g. `America/New_York`). Must be used with `To Timezone`", | ||
| optional: true, | ||
| }, | ||
| tzTo: { | ||
| type: "string", | ||
| label: "To Timezone", | ||
| description: "Target timezone name (e.g. `Asia/Tokyo`). Must be used with `From Timezone`", | ||
| optional: true, | ||
| }, | ||
| latFrom: { | ||
| type: "string", | ||
| label: "From Latitude", | ||
| description: "Source latitude coordinate. Must be used with From Longitude", | ||
| optional: true, | ||
| }, | ||
| longFrom: { | ||
| type: "string", | ||
| label: "From Longitude", | ||
| description: "Source longitude coordinate. Must be used with From Latitude", | ||
| optional: true, | ||
| }, | ||
| latTo: { | ||
| type: "string", | ||
| label: "To Latitude", | ||
| description: "Target latitude coordinate. Must be used with To Longitude", | ||
| optional: true, | ||
| }, | ||
| longTo: { | ||
| type: "string", | ||
| label: "To Longitude", | ||
| description: "Target longitude coordinate. Must be used with To Latitude", | ||
| optional: true, | ||
| }, | ||
| locationFrom: { | ||
| type: "string", | ||
| label: "From Location", | ||
| description: "Source city or address (e.g. `New York, USA`). Must be used with To Location", | ||
| optional: true, | ||
| }, | ||
| locationTo: { | ||
| type: "string", | ||
| label: "To Location", | ||
| description: "Target city or address (e.g. `London, UK`). Must be used with From Location", | ||
| optional: true, | ||
| }, | ||
| iataFrom: { | ||
| type: "string", | ||
| label: "From IATA Code", | ||
| description: "Source airport IATA code (e.g. `JFK`). Must be used with To IATA Code", | ||
| optional: true, | ||
| }, | ||
| iataTo: { | ||
| type: "string", | ||
| label: "To IATA Code", | ||
| description: "Target airport IATA code (e.g. `LHR`). Must be used with From IATA Code", | ||
| optional: true, | ||
| }, | ||
| icaoFrom: { | ||
| type: "string", | ||
| label: "From ICAO Code", | ||
| description: "Source airport ICAO code (e.g. `KJFK`). Must be used with To ICAO Code", | ||
| optional: true, | ||
| }, | ||
| icaoTo: { | ||
| type: "string", | ||
| label: "To ICAO Code", | ||
| description: "Target airport ICAO code (e.g. `EGLL`). Must be used with From ICAO Code", | ||
| optional: true, | ||
| }, | ||
| locodeFrom: { | ||
| type: "string", | ||
| label: "From UN/LOCODE", | ||
| description: "Source UN/LOCODE (e.g. `USNYC`). Must be used with To UN/LOCODE", | ||
| optional: true, | ||
| }, | ||
| locodeTo: { | ||
| type: "string", | ||
| label: "To UN/LOCODE", | ||
| description: "Target UN/LOCODE (e.g. `GBLON`). Must be used with From UN/LOCODE", | ||
| optional: true, | ||
| }, | ||
| time: { | ||
| type: "string", | ||
| label: "Time to Convert", | ||
| description: "Time to convert in format `YYYY-MM-DD HH:mm` or `YYYY-MM-DD HH:mm:ss`. Leave blank to convert current time", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const hasValue = (value) => value !== undefined && value !== null && value !== ""; | ||
| const hasPair = (from, to) => hasValue(from) && hasValue(to); | ||
| const hasAnyCoord = [ | ||
| this.latFrom, | ||
| this.longFrom, | ||
| this.latTo, | ||
| this.longTo, | ||
| ].some(hasValue); | ||
| const hasFullCoordSet = [ | ||
| this.latFrom, | ||
| this.longFrom, | ||
| this.latTo, | ||
| this.longTo, | ||
| ].every(hasValue); | ||
|
|
||
| if ( | ||
| (hasValue(this.tzFrom) !== hasValue(this.tzTo)) | ||
| || (hasValue(this.locationFrom) !== hasValue(this.locationTo)) | ||
| || (hasValue(this.iataFrom) !== hasValue(this.iataTo)) | ||
| || (hasValue(this.icaoFrom) !== hasValue(this.icaoTo)) | ||
| || (hasValue(this.locodeFrom) !== hasValue(this.locodeTo)) | ||
| || (hasAnyCoord && !hasFullCoordSet) | ||
| ) { | ||
| throw new Error("Provide complete source and target values for the selected conversion mode."); | ||
| } | ||
|
|
||
| if (!( | ||
| hasPair(this.tzFrom, this.tzTo) | ||
| || hasPair(this.locationFrom, this.locationTo) | ||
| || hasPair(this.iataFrom, this.iataTo) | ||
| || hasPair(this.icaoFrom, this.icaoTo) | ||
| || hasPair(this.locodeFrom, this.locodeTo) | ||
| || hasFullCoordSet | ||
| )) { | ||
| throw new Error("Provide a valid source and target using timezone names, coordinates, locations, IATA, ICAO, or UN/LOCODE."); | ||
| } | ||
|
|
||
| const response = await this.ipgeolocation.convertTimezone({ | ||
| $, | ||
| params: { | ||
| tz_from: this.tzFrom, | ||
| tz_to: this.tzTo, | ||
| time: this.time, | ||
| lat_from: this.latFrom, | ||
| long_from: this.longFrom, | ||
| lat_to: this.latTo, | ||
| long_to: this.longTo, | ||
| location_from: this.locationFrom, | ||
| location_to: this.locationTo, | ||
| iata_from: this.iataFrom, | ||
| iata_to: this.iataTo, | ||
| icao_from: this.icaoFrom, | ||
| icao_to: this.icaoTo, | ||
| locode_from: this.locodeFrom, | ||
| locode_to: this.locodeTo, | ||
| }, | ||
mateen993 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| let from, to; | ||
|
|
||
| if (hasPair(this.tzFrom, this.tzTo)) { | ||
| from = this.tzFrom; | ||
| to = this.tzTo; | ||
| } else if (hasFullCoordSet) { | ||
| from = `${this.latFrom},${this.longFrom}`; | ||
| to = `${this.latTo},${this.longTo}`; | ||
| } else if (hasPair(this.locationFrom, this.locationTo)) { | ||
| from = this.locationFrom; | ||
| to = this.locationTo; | ||
| } else if (hasPair(this.iataFrom, this.iataTo)) { | ||
| from = this.iataFrom; | ||
| to = this.iataTo; | ||
| } else if (hasPair(this.icaoFrom, this.icaoTo)) { | ||
| from = this.icaoFrom; | ||
| to = this.icaoTo; | ||
| } else { | ||
| from = this.locodeFrom; | ||
| to = this.locodeTo; | ||
| } | ||
|
|
||
| $.export("$summary", `Successfully converted time from ${from} to ${to}`); | ||
| return response; | ||
| }, | ||
| }; | ||
48 changes: 48 additions & 0 deletions
48
components/ipgeolocation/actions/get-abuse-contact/get-abuse-contact.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import ipgeolocation from "../../ipgeolocation.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "ipgeolocation-get-abuse-contact", | ||
| name: "Get Abuse Contact", | ||
| description: | ||
| "Retrieve abuse contact information for an IPv4 or IPv6 address, including abuse emails, phone numbers, organization, and network route. Only available on paid plans. [See the documentation](https://ipgeolocation.io/documentation/ip-abuse-contact-api.html)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| ipgeolocation, | ||
| ip: { | ||
| type: "string", | ||
| label: "IP Address", | ||
| description: "The IPv4 or IPv6 address to retrieve abuse contact information for. Leave blank to retrieve abuse contact information for the caller's IP address", | ||
| optional: true, | ||
| }, | ||
mateen993 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| fields: { | ||
| type: "string", | ||
| label: "Fields", | ||
| description: "Comma-separated list of fields to return (e.g. `abuse.emails,abuse.organization`). Reduces response size", | ||
| optional: true, | ||
| }, | ||
| excludes: { | ||
| type: "string", | ||
| label: "Exclude Fields", | ||
| description: "Comma-separated list of fields to exclude from the response. The `ip` field is always returned", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.ipgeolocation.getAbuseContact({ | ||
| $, | ||
| params: { | ||
| ip: this.ip, | ||
| fields: this.fields, | ||
| excludes: this.excludes, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved abuse contact for ${this.ip || `caller's IP: ${response.ip}`}`); | ||
| return response; | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import ipgeolocation from "../../ipgeolocation.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "ipgeolocation-get-asn", | ||
| name: "Get ASN Details", | ||
| description: | ||
| "Retrieve detailed ASN information including peers, upstreams, downstreams, routes, and WHOIS data for an ASN number or IP address. Only available on paid plans. [See the documentation](https://ipgeolocation.io/documentation/asn-api.html)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| ipgeolocation, | ||
| ip: { | ||
| type: "string", | ||
| label: "IP Address", | ||
| description: "The IPv4/IPv6 address to look up. Leave blank to lookup ASN data for the caller's IP address", | ||
| optional: true, | ||
| }, | ||
| asn: { | ||
| type: "string", | ||
| label: "ASN", | ||
| description: "The ASN number (e.g. `AS15169`). If both `ip` and `asn` are provided, `asn` will be used", | ||
| optional: true, | ||
| }, | ||
mateen993 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| include: { | ||
| type: "string", | ||
| label: "Include Additional Data", | ||
| description: "Comma-separated list of extra modules to include in the response. Available values: `routes`, `peers`, `upstreams`, `downstreams`, `whois_response`. Use `*` to include all.", | ||
| optional: true, | ||
| }, | ||
| fields: { | ||
| type: "string", | ||
| label: "Fields", | ||
| description: "Comma-separated list of fields to return (e.g. `asn.organization,asn.routes`). Reduces response size", | ||
| optional: true, | ||
| }, | ||
| excludes: { | ||
| type: "string", | ||
| label: "Exclude Fields", | ||
| description: "Comma-separated list of fields to exclude from the response. The `ip` field is always returned if querying by IP address", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.ipgeolocation.getAsn({ | ||
| $, | ||
| params: { | ||
| asn: this.asn, | ||
| ip: this.ip, | ||
| include: this.include, | ||
| fields: this.fields, | ||
| excludes: this.excludes, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved ASN details for ${this.asn || this.ip || `caller's IP: ${response.ip}`}`); | ||
| return response; | ||
| }, | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.