Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Sep 10, 2025

Resolves #18329

Summary by CodeRabbit

  • New Features
    • Added Email Lookup and Name Lookup actions to submit lookups.
    • Added Get Lookup Results action to retrieve results by Search ID.
    • Introduced inputs for Value and a selectable Search ID populated from recent searches.
  • Refactor
    • Improved ESPY integration with a unified request layer for more reliable calls and clearer run summaries.
  • Chores
    • Bumped package version to 0.1.0.
    • Added a new platform dependency to support HTTP requests.

- Added new props for value and searchId in espy.app.mjs to facilitate lookups.
- Implemented actions for email lookup, name lookup, and retrieving lookup results, each with corresponding methods for API interaction.
- Updated package version to 0.1.0 and added dependency on @pipedream/platform.
- Improved API request handling with a centralized method for making requests.
@luancazarine luancazarine linked an issue Sep 10, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Sep 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 10, 2025 7:04pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 10, 2025 7:04pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 10, 2025

Walkthrough

Adds three new ESPY actions (Email Lookup, Name Lookup, Get Lookup Results) and expands the ESPY app with an internal HTTP client, lookup methods, and prop definitions. Introduces axios via @pipedream/platform and updates package.json (version bump to 0.1.0, new dependency).

Changes

Cohort / File(s) Summary of Changes
ESPY actions added
components/espy/actions/email-lookup/email-lookup.mjs, components/espy/actions/name-lookup/name-lookup.mjs, components/espy/actions/get-lookup-results/get-lookup-results.mjs
New actions for email lookup (POST combined_email), name lookup (POST combined_name), and retrieving lookup results by searchId. Each defines metadata, props via app propDefinitions, and run methods calling app methods; success summaries exported.
App core: HTTP + props
components/espy/espy.app.mjs
Adds propDefinitions (value, searchId with async options from getSearchIds). Implements internal HTTP helper _makeRequest with base URL and API key injection. Adds methods: emailLookup, nameLookup, getLookupResults, getSearchIds. Removes authKeys. Imports axios from @pipedream/platform.
Package manifest
components/espy/package.json
Bumps version 0.0.1 → 0.1.0 and adds dependency "@pipedream/platform": "^3.1.0".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Email/Name Lookup Action
  participant App as ESPY App
  participant API as ESPY API

  User->>Action: Provide value
  Action->>App: emailLookup/nameLookup({ value, lookupId })
  App->>API: POST /developer/combined_email or /developer/combined_name
  API-->>App: { id, ... }
  App-->>Action: response
  Action-->>User: $summary with response.id
Loading
sequenceDiagram
  autonumber
  actor User
  participant Action as Get Lookup Results Action
  participant App as ESPY App
  participant API as ESPY API

  User->>Action: Provide searchId (+ optional value)
  Action->>App: getLookupResults({ searchId, data, params })
  App->>API: GET /request-monitor/api-usage/{searchId}
  API-->>App: results payload
  App-->>Action: response
  Action-->>User: $summary with searchId
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Pre-merge checks (2 passed, 2 warnings, 1 inconclusive)

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The current title “18329 components espy” simply echoes the issue number and app name without summarizing the core changes or functionality introduced by this pull request, so it does not clearly convey the main update being merged. Please update the title to a concise, descriptive sentence that highlights the primary change, for example “Add Email, Name, and Lookup Results Actions to Espy App” rather than including the issue number.
Description Check ⚠️ Warning The current description only contains “Resolves #18329” and does not follow the repository’s description template, which requires a “## WHY” section explaining the motivation and context for the migration. Please populate the description with the required “## WHY” section and provide details on the rationale for migrating the Espy components, summarizing what changes are included and why they are necessary.
Linked Issues Check ❓ Inconclusive Issue #18329 calls for migrating all Espy components into the new app, and this pull request implements the core HTTP layer and three lookup actions (email, name, and results), but without a definitive list of all legacy components it is unclear if the migration is fully complete. Please confirm that every component from the existing Espy app has been included or provide a complete list of migrated features so we can ensure the migration fully satisfies issue #18329.
✅ Passed checks (2 passed)
Check name Status Explanation
Out of Scope Changes Check ✅ Passed All of the code changes, including the addition of API wrappers, action modules, and dependency updates, appear directly aligned with migrating the Espy components and there are no unrelated or extraneous modifications in this pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I thump my paws—new actions hop in line,
Names and emails queue, results look fine.
A whisker-twitch, the HTTP burrow hums,
Keys in the satchel, axios softly drums.
Version bumped—carrot high, I cheer:
“Lookup complete!” in floppy-eared gear. 🥕🐇

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 18329-components-espy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (8)
components/espy/espy.app.mjs (3)

64-71: Explicitly use GET for results endpoint

Make the method explicit and rely on _makeRequest to place the key in params.

-    async getLookupResults({
-      searchId, ...args
-    }) {
-      return this._makeRequest({
-        path: `/request-monitor/api-usage/${searchId}`,
-        ...args,
-      });
-    },
+    async getLookupResults({ searchId, ...args }) {
+      return this._makeRequest({
+        path: `/request-monitor/api-usage/${searchId}`,
+        method: "get",
+        ...args,
+      });
+    },

72-79: Prefer centralizing auth for GET; avoid duplicating key in params here

If _makeRequest handles GET auth via params, you don’t need to set it per-call.

-    async getSearchIds(args = {}) {
-      return this._makeRequest({
-        path: "/request-monitor/api-usage",
-        params: {
-          key: `${this.$auth.api_key}`,
-        },
-        ...args,
-      });
-    },
+    async getSearchIds(args = {}) {
+      return this._makeRequest({
+        path: "/request-monitor/api-usage",
+        method: "get",
+        ...args,
+      });
+    },

16-23: Harden options() and improve UX with labels

Guard against missing fields and provide labels so users see meaningful choices.

-      async options() {
-        const response = await this.getSearchIds();
-        const searchIds = response.list;
-        return searchIds.map(({ id }) => ({
-          value: id,
-        }));
-      },
+      async options() {
+        const response = await this.getSearchIds();
+        const searchIds = Array.isArray(response?.list) ? response.list : [];
+        return searchIds.map(({ id }) => ({
+          label: String(id),
+          value: String(id),
+        }));
+      },
components/espy/actions/name-lookup/name-lookup.mjs (2)

23-25: Avoid magic number for lookupId

Centralize lookup IDs to prevent drift across actions and document their meaning.

Example (outside this file):

// components/espy/espy.constants.mjs
export const LOOKUP_IDS = { EMAIL_COMBINED: 67, NAME_COMBINED: 149 };

Then here:

-        lookupId: 149,
+        lookupId: LOOKUP_IDS.NAME_COMBINED,

And import the constant accordingly.


27-27: Tweak summary formatting

Drop the extra quotes around the ID.

-    $.export("$summary", `Successfully sent request. Use the ID to get the results: '${response.id}'`);
+    $.export("$summary", `Successfully sent request. Use the ID to get the results: ${response.id}`);
components/espy/actions/email-lookup/email-lookup.mjs (1)

23-25: Avoid magic number for lookupId (67)

Extract the constant and name it for clarity, or centralize in the app client.

Apply this diff to localize the constant:

@@
-import app from "../../espy.app.mjs";
-
+import app from "../../espy.app.mjs";
+const LOOKUP_ID_EMAIL = 67;
@@
-        lookupId: 67,
+        lookupId: LOOKUP_ID_EMAIL,

Follow-up (optional): Move lookupId handling into this.app.emailLookup() so actions don’t pass it at all.

components/espy/actions/get-lookup-results/get-lookup-results.mjs (2)

32-34: Centralize auth in the app client

Inline params.key duplicates responsibility and can drift from other actions.

If the app client already injects auth, remove this block from here. Otherwise, consider moving auth injection into _makeRequest() to keep actions clean.


33-33: Nit: unnecessary template literal

Pass the API key directly.

Apply this diff:

-        key: `${this.app.$auth.api_key}`,
+        key: this.app.$auth.api_key,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43c37a6 and 842bbb5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • components/espy/actions/email-lookup/email-lookup.mjs (1 hunks)
  • components/espy/actions/get-lookup-results/get-lookup-results.mjs (1 hunks)
  • components/espy/actions/name-lookup/name-lookup.mjs (1 hunks)
  • components/espy/espy.app.mjs (1 hunks)
  • components/espy/package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/espy/package.json
🧬 Code graph analysis (4)
components/espy/actions/name-lookup/name-lookup.mjs (2)
components/espy/actions/email-lookup/email-lookup.mjs (1)
  • response (20-26)
components/espy/actions/get-lookup-results/get-lookup-results.mjs (1)
  • response (26-35)
components/espy/actions/email-lookup/email-lookup.mjs (2)
components/espy/actions/get-lookup-results/get-lookup-results.mjs (1)
  • response (26-35)
components/espy/actions/name-lookup/name-lookup.mjs (1)
  • response (20-26)
components/espy/actions/get-lookup-results/get-lookup-results.mjs (3)
components/espy/actions/email-lookup/email-lookup.mjs (1)
  • response (20-26)
components/espy/actions/name-lookup/name-lookup.mjs (1)
  • response (20-26)
components/espy/espy.app.mjs (1)
  • response (17-17)
components/espy/espy.app.mjs (3)
components/espy/actions/email-lookup/email-lookup.mjs (1)
  • response (20-26)
components/espy/actions/get-lookup-results/get-lookup-results.mjs (1)
  • response (26-35)
components/espy/actions/name-lookup/name-lookup.mjs (1)
  • response (20-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (9)
components/espy/package.json (2)

3-3: Version bump LGTM

Matches the scope of new app + actions.


15-17: @pipedream/platform version confirmed
^3.1.0 is the latest release, it exposes axios as a named export, and there have been no breaking changes since 3.1.0—no further pinning required.

components/espy/espy.app.mjs (1)

26-28: ESPY API base URL confirmed
The base URL https://irbis.espysys.com/api correctly matches the production endpoints for combined_email (POST /developer/combined_email), combined_name (POST /developer/combined_name), and request-monitor/api-usage (GET /request-monitor/api-usage and /request-monitor/api-usage/{id}).

components/espy/actions/name-lookup/name-lookup.mjs (2)

7-7: Action versioning check

Confirm 0.0.1 is intended for initial release under package 0.1.0; align with the other new actions for consistency.


6-6: Docs link correctly maps to combined_name endpoint
Confirmed that “Name SocialScan / Name WebScan (by name lookup)” in the docs refers to POST /api/developer/combined_name and that lookupId 149 is correct; no changes needed.

components/espy/actions/email-lookup/email-lookup.mjs (2)

20-26: Auth handling consistency

This action relies on this.app.emailLookup() to add auth, while get-lookup-results passes params.key explicitly. Please standardize via the app client to avoid drift and accidental 401s.

Would you confirm the app client always injects the API key for all endpoints? If yes, drop inline auth elsewhere; if not, add it here.


3-18: Action scaffold looks good

Key/name/version/props follow the Pipedream pattern and reuse prop definitions correctly.

components/espy/actions/get-lookup-results/get-lookup-results.mjs (2)

6-6: Verify docs URL

The slug includes “get-get”. If that’s not intentional, update the link.


3-9: LGTM on overall structure

Good reuse of prop definitions and clear summary.

Also applies to: 17-23, 36-38

Comment on lines +29 to +31
data: {
value: this.value,
},
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!

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @luancazarine Just had one question other than that lgtm! Ready for QA!

Comment on lines +29 to +31
data: {
value: this.value,
},
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?

@vunguyenhung vunguyenhung merged commit 136d163 into master Sep 12, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the 18329-components-espy branch September 12, 2025 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Components] espy

4 participants