Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions components/espy/actions/email-lookup/email-lookup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import app from "../../espy.app.mjs";

export default {
key: "espy-email-lookup",
name: "Email Lookup",
description: "Request a lookup for the provided email. [See the documentation](https://api-docs.espysys.com/name-socialscan/headers-and-body-request-by-name-lookup)",
version: "0.0.1",
type: "action",
props: {
app,
value: {
propDefinition: [
app,
"value",
],
},
},

async run({ $ }) {
const response = await this.app.emailLookup({
$,
data: {
value: this.value,
lookupId: 67,
},
});
$.export("$summary", `Successfully sent request. Use the ID to get the results: '${response.id}'`);

return response;
},
};
39 changes: 39 additions & 0 deletions components/espy/actions/get-lookup-results/get-lookup-results.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import app from "../../espy.app.mjs";

export default {
key: "espy-get-lookup-results",
name: "Get Lookup Results",
description: "Get the results of the lookup with the provided ID. [See the documentation](https://api-docs.espysys.com/e-mail-lookup/get-get-lookup-data-for-a-request-by-e-mail-lookup)",
version: "0.0.1",
type: "action",
props: {
app,
value: {
propDefinition: [
app,
"value",
],
},
searchId: {
propDefinition: [
app,
"searchId",
],
},
},

async run({ $ }) {
const response = await this.app.getLookupResults({
$,
searchId: this.searchId,
data: {
value: this.value,
},
Comment on lines +29 to +31
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Likely incorrect: sending a body on a GET

Fetching results should not require data (and some HTTP clients drop GET bodies). Remove it.

Apply this diff:

-      data: {
-        value: this.value,
-      },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
data: {
value: this.value,
},
🤖 Prompt for AI Agents
In components/espy/actions/get-lookup-results/get-lookup-results.mjs around
lines 29-31, the GET request is including a request body (data: { value:
this.value }) which is incorrect and may be dropped by HTTP clients; remove the
data/body entirely and instead pass the value as a query parameter (e.g., use
params/query or append to the URL) so the GET carries the input via the URL
rather than a request body.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question here @luancazarine is the get method also accepting data payload?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

params: {
key: `${this.app.$auth.api_key}`,
},
});
$.export("$summary", `Successfully retrieved the details of the request with ID: '${this.searchId}'`);
return response;
},
};
30 changes: 30 additions & 0 deletions components/espy/actions/name-lookup/name-lookup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import app from "../../espy.app.mjs";

export default {
key: "espy-name-lookup",
name: "Name Lookup",
description: "Request a lookup for the provided name. [See the documentation](https://api-docs.espysys.com/name-socialscan/headers-and-body-request-by-name-lookup)",
version: "0.0.1",
type: "action",
props: {
app,
value: {
propDefinition: [
app,
"value",
],
},
},

async run({ $ }) {
const response = await this.app.nameLookup({
$,
data: {
value: this.value,
lookupId: 149,
},
});
$.export("$summary", `Successfully sent request. Use the ID to get the results: '${response.id}'`);
return response;
},
};
81 changes: 76 additions & 5 deletions components/espy/espy.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,82 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "espy",
propDefinitions: {},
propDefinitions: {
value: {
type: "string",
label: "Value",
description: "Value to lookup",
},
searchId: {
type: "string",
label: "Search ID",
description: "ID of the search",
async options() {
const response = await this.getSearchIds();
const searchIds = response.list;
return searchIds.map(({ id }) => ({
value: id,
}));
},
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://irbis.espysys.com/api";
},
async _makeRequest({
$ = this,
path,
headers,
data,
...otherOpts
} = {}) {
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
...headers,
"accept": "application/json",
"content-type": "application/json",
},
data: {
...data,
key: `${this.$auth.api_key}`,
},
});
},
async emailLookup(args = {}) {
return this._makeRequest({
path: "/developer/combined_email",
method: "post",
...args,
});
},
async nameLookup(args = {}) {
return this._makeRequest({
path: "/developer/combined_name",
method: "post",
...args,
});
},
async getLookupResults({
searchId, ...args
}) {
return this._makeRequest({
path: `/request-monitor/api-usage/${searchId}`,
...args,
});
},
async getSearchIds(args = {}) {
return this._makeRequest({
path: "/request-monitor/api-usage",
params: {
key: `${this.$auth.api_key}`,
},
...args,
});
},
},
};
};
7 changes: 5 additions & 2 deletions components/espy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/espy",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream ESPY Components",
"main": "espy.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.1.0"
}
}
}
Loading
Loading