-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Adversus - new components #18998
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
Adversus - new components #18998
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughThe 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
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this 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
📒 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. TheleadIddescription 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
leadIdpresence, 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
datafrom opts and mergesstatusIdinto 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 whereadditionalFieldsare passed as{ data: { ...additionalFields } }.
139-152: LGTM! Consistent data merging pattern.The method follows the same pattern as
changeLeadStatus, properly extracting and merging the requiredcampaignIdparameter 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}/notesPOST /leads/{leadId}/activitiesHowever, available resources in the SDK include
notes()andcallDetailRecords()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 /noteswith leadId in the request bodyPOST /callDetailRecords(or equivalent) with leadId in the request bodycomponents/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.
Resolves #18892
Fixes eslint errors from #18912
Summary by CodeRabbit
Release Notes
New Features
Documentation