Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Nov 10, 2025

Resolves #18892

Fixes eslint errors from #18912

Summary by CodeRabbit

Release Notes

  • New Features

    • Added ability to add notes and activities to leads
    • Added lead-to-campaign assignment functionality
    • Added lead status change capability
    • Added create or update lead operations
    • Enhanced lead management with comprehensive CRUD operations
  • Documentation

    • Added API documentation reference
    • Added real-time notification and performance analytics use case examples

@vercel
Copy link

vercel bot commented Nov 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 Nov 10, 2025 4:55pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 10, 2025 4:55pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

The Adversus component is enhanced with four new action modules for lead management operations (create/update, add notes/activities, change status, assign to campaign), the core app module is refactored with standardized API request handling via a centralized helper, CRUD and action methods are implemented, propDefinitions are added for reuse across actions, and the component version is bumped to 0.7.0.

Changes

Cohort / File(s) Summary
Documentation
components/adversus/README.md
Added API Documentation section linking to Adversus API docs; added two new use cases: Real-Time Notification for High-Value Deals (Slack/email alerts on deal closure) and Performance Analytics Reporting (periodic call logs/metrics export to Google Sheets or visualization tools).
Lead Management Actions
components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs, components/adversus/actions/add-note-activity/add-note-activity.mjs, components/adversus/actions/change-lead-status/change-lead-status.mjs, components/adversus/actions/assign-to-campaign/assign-to-campaign.mjs
Four new action modules introduced: (1) Create or update lead with optional fields (firstName, lastName, email, phone) or update existing via leadId; (2) Add note and/or activity to a lead with parallel execution; (3) Change lead status via statusId; (4) Assign lead to campaign. All export standard action metadata and use app module methods.
Core App Module
components/adversus/adversus.app.mjs
Refactored authentication (replaced authKeys() with _auth() method returning username/password); added propDefinitions for leadId, campaignId, statusId; introduced _baseUrl() for API base URL; added _makeRequest() utility for standardized HTTP requests with auth and base URL; implemented six API methods: createLead, updateLead, addNoteToLead, addActivityToLead, changeLeadStatus, assignLeadToCampaign.
Version
components/adversus/package.json
Version bumped from 0.6.0 to 0.7.0.

Sequence Diagram

sequenceDiagram
    participant Action as Lead Action
    participant App as adversus.app.mjs
    participant Axios as HTTP Client

    Action->>App: invoke method (e.g., createLead, changeLeadStatus)
    Note over Action,App: Methods receive leadId, campaignId,<br/>statusId, additional fields as needed
    
    App->>App: _auth() → extract username/password
    App->>App: _baseUrl() → retrieve API base URL
    
    App->>App: _makeRequest({ path, method, ... })
    Note over App: Build axios config with<br/>basicAuth and base URL
    
    App->>Axios: axios({ method, url, data, auth, ... })
    Axios-->>App: API response
    
    App-->>Action: return response
    Action->>Action: $.export("$summary", message)
    Action-->>User: return result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • App module refactoring: Review new _auth(), _baseUrl(), _makeRequest() implementation; verify axios configuration, auth headers, and base URL construction.
  • API method contracts: Validate all six API methods (createLead, updateLead, addNoteToLead, addActivityToLead, changeLeadStatus, assignLeadToCampaign) for correct HTTP verbs, paths, and payload structure.
  • Action implementations: Verify props, payload construction (spread operators), error handling (e.g., add-note-activity requires at least note or activity data).
  • Parallel execution: Check Promise.all() usage in add-note-activity for correct async handling.
  • PropDefinitions reuse: Ensure leadId, campaignId, statusId propDefinitions are correctly referenced across all action modules.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description references the linked issue but lacks context about WHY the changes are being made, which is required by the template. Expand the description to include a WHY section explaining the purpose and motivation for implementing these new Adversus components.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Adversus - new components' accurately summarizes the main objective of adding new Adversus app components/actions.
Linked Issues check ✅ Passed All four required actions (Create/Update Lead, Add Note/Activity, Change Lead Status, Assign to Campaign) are successfully implemented with proper API documentation references.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the four required Adversus actions and updating supporting infrastructure; no unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18892

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e5539b and aca1381.

📒 Files selected for processing (7)
  • components/adversus/README.md (1 hunks)
  • components/adversus/actions/add-note-activity/add-note-activity.mjs (1 hunks)
  • components/adversus/actions/assign-to-campaign/assign-to-campaign.mjs (1 hunks)
  • components/adversus/actions/change-lead-status/change-lead-status.mjs (1 hunks)
  • components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs (1 hunks)
  • components/adversus/adversus.app.mjs (1 hunks)
  • components/adversus/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-09-15T22:01:17.593Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/README.md:45-49
Timestamp: 2025-09-15T22:01:17.593Z
Learning: In Leonardo AI components (and likely other Pipedream components), prefer using info alert props on the component itself rather than detailed "Key Features" sections in README files for action documentation.

Applied to files:

  • components/adversus/README.md
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

Applied to files:

  • components/adversus/adversus.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/adversus/adversus.app.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs
🧬 Code graph analysis (3)
components/adversus/actions/change-lead-status/change-lead-status.mjs (2)
components/adversus/actions/assign-to-campaign/assign-to-campaign.mjs (1)
  • response (41-45)
components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs (1)
  • response (82-88)
components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs (2)
components/adversus/actions/assign-to-campaign/assign-to-campaign.mjs (1)
  • response (41-45)
components/adversus/actions/change-lead-status/change-lead-status.mjs (1)
  • response (41-45)
components/adversus/actions/assign-to-campaign/assign-to-campaign.mjs (2)
components/adversus/actions/change-lead-status/change-lead-status.mjs (1)
  • response (41-45)
components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs (1)
  • response (82-88)
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
🔇 Additional comments (13)
components/adversus/package.json (1)

3-3: LGTM! Appropriate version bump.

The minor version increment from 0.6.0 to 0.7.0 correctly reflects the addition of four new actions.

components/adversus/actions/add-note-activity/add-note-activity.mjs (2)

14-46: LGTM! Props are well-structured.

The prop definitions appropriately use propDefinitions for leadId and provide clear optional fields for note, activity details, and additional fields.


82-93: LGTM! Good validation and result handling.

The error check ensures at least one operation is provided, and the conditional return logic appropriately returns a single object or array based on the number of operations performed.

components/adversus/actions/assign-to-campaign/assign-to-campaign.mjs (1)

14-50: LGTM! Clean and consistent implementation.

The action follows the established pattern with proper use of propDefinitions, clear props, and appropriate API interaction.

components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs (3)

14-54: LGTM! Well-designed props for create-or-update pattern.

The props appropriately make all fields optional, allowing flexibility through individual fields or additionalFields. The leadId description clearly indicates its role in determining update vs. create behavior.


61-80: LGTM! Robust data construction and validation.

The conditional spreading pattern ensures only provided fields are included, and the validation at lines 78-80 provides a clear, helpful error message when no data is supplied.


82-95: LGTM! Clean create-or-update implementation.

The conditional logic correctly determines whether to create or update based on leadId presence, and the summary appropriately reflects the operation performed.

components/adversus/actions/change-lead-status/change-lead-status.mjs (1)

14-50: LGTM! Consistent and clean implementation.

The action follows the established pattern with proper prop usage and clear API interaction.

components/adversus/adversus.app.mjs (4)

28-59: LGTM! Well-structured API helpers.

The authentication, base URL, and request helper methods provide a clean, centralized pattern for API interactions with proper defaults and flexibility through spread options.


118-131: LGTM! Special data merging pattern is correct.

The method extracts data from opts and merges statusId into it, ensuring the required field is always included in the request body while preserving additional fields. This pattern correctly handles the action's calling convention where additionalFields are passed as { data: { ...additionalFields } }.


139-152: LGTM! Consistent data merging pattern.

The method follows the same pattern as changeLeadStatus, properly extracting and merging the required campaignId parameter with additional fields from the caller.


65-110: The web search results suggest potential discrepancies. Let me verify the specific endpoint structure for notes and activities:

Based on my verification of the Adversus API documentation and code examples, I've identified potential issues with the endpoint paths:

Verify and correct the Adversus API endpoint paths for notes and activities

The Adversus SDK shows resources are called as flat endpoints (e.g., $client->notes(), $client->callDetailRecords()), not nested under leads. The current implementation uses:

  • POST /leads/{leadId}/notes
  • POST /leads/{leadId}/activities

However, available resources in the SDK include notes() and callDetailRecords() as separate top-level resources, and call detail records are queried with filters like ['leadId' => ['$eq' => 652840661]], not via nested URL paths.

Verify against the official Adversus API documentation whether the nested path structure is correct or if these should be:

  • POST /notes with leadId in the request body
  • POST /callDetailRecords (or equivalent) with leadId in the request body
components/adversus/README.md (1)

5-15: LGTM! Helpful documentation additions.

The API documentation link provides users with a valuable reference, and the use case updates improve clarity and provide practical examples of the Adversus integration.

@jcortes jcortes self-requested a review November 10, 2025 17:18
@michelle0927 michelle0927 merged commit 9f32f21 into master Nov 10, 2025
10 checks passed
@michelle0927 michelle0927 deleted the issue-18892 branch November 10, 2025 17:19
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.

[APP] Adversus

3 participants