-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New Components - veedea #17188
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
base: master
Are you sure you want to change the base?
New Components - veedea #17188
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis update introduces a new Veedea integration, adding three polling sources for campaign creation, lead creation, and product purchases, as well as three actions for listing campaigns, leads, and product purchases. It also implements a reusable polling base, test event fixtures, and a comprehensive app module with API client methods and pagination support. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action/Source
participant VeedeaApp
participant VeedeaAPI
User->>Action/Source: Trigger action/source
Action/Source->>VeedeaApp: getToken()
VeedeaApp->>VeedeaAPI: Request token
VeedeaAPI-->>VeedeaApp: Return token
Action/Source->>VeedeaApp: Call list method (e.g., listCampaigns, listLeads, listProductPurchases)
VeedeaApp->>VeedeaAPI: Make API request(s) with token and params
VeedeaAPI-->>VeedeaApp: Return paginated data
VeedeaApp-->>Action/Source: Return data (campaigns, leads, or purchases)
Action/Source-->>User: Return or emit results
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/veedea/actions/list-campaigns/list-campaigns.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/veedea/actions/list-leads/list-leads.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/veedea/actions/list-product-purchases/list-product-purchases.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 6
♻️ Duplicate comments (1)
components/veedea/actions/list-product-purchases/list-product-purchases.mjs (1)
28-34
: Same parameter naming inconsistency as list-leads action.This action also uses
campaign_id
while source components usecampaignId
. Please ensure consistency across all components.
🧹 Nitpick comments (3)
components/veedea/sources/new-lead-created/test-event.mjs (1)
1-10
: Consider data type consistency and more realistic test data.The test event has some inconsistencies that might affect testing:
campid
is a string ("330") whileid
is a number (26) - consider consistent typing- Empty string fields (
source
,device
,region
) might be better with realistic sample values for more comprehensive testingConsider this improvement for more realistic test data:
export default { - campid: "330", + campid: 330, user_name: "John Doe", user_email: "[email protected]", - source: "", - device: "", - region: "", + source: "website", + device: "desktop", + region: "US", id: 26, registerDate: "2025-06-19T12:00:00Z", }components/veedea/sources/new-campaign-created/new-campaign-created.mjs (1)
12-24
: Consider implementing getTsField() for consistency.Unlike other sources in this PR, this component doesn't override
getTsField()
. If campaigns have a creation timestamp field, implementing this method would make the polling behavior more consistent and robust.methods: { ...common.methods, getResourceFn() { return this.veedea.listCampaigns; }, + getTsField() { + return "created_at"; // or appropriate timestamp field name + }, generateMeta(item) { return { id: item.id, summary: `New Campaign Created: ${item.camp_name}`, - ts: Date.now(), + ts: Date.parse(item[this.getTsField()]), }; }, },components/veedea/veedea.app.mjs (1)
102-109
: Consider adding error handling to getPaginatedResources.While the method is simple, it should handle potential errors from the pagination process.
async getPaginatedResources(opts) { const resources = []; + try { const results = this.paginate(opts); for await (const item of results) { resources.push(item); } + } catch (error) { + console.error("Error fetching paginated resources:", error); + throw error; + } return resources; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
components/veedea/actions/list-campaigns/list-campaigns.mjs
(1 hunks)components/veedea/actions/list-leads/list-leads.mjs
(1 hunks)components/veedea/actions/list-product-purchases/list-product-purchases.mjs
(1 hunks)components/veedea/package.json
(2 hunks)components/veedea/sources/common/base.mjs
(1 hunks)components/veedea/sources/new-campaign-created/new-campaign-created.mjs
(1 hunks)components/veedea/sources/new-campaign-created/test-event.mjs
(1 hunks)components/veedea/sources/new-lead-created/new-lead-created.mjs
(1 hunks)components/veedea/sources/new-lead-created/test-event.mjs
(1 hunks)components/veedea/sources/new-product-purchase-created/new-product-purchase-created.mjs
(1 hunks)components/veedea/sources/new-product-purchase-created/test-event.mjs
(1 hunks)components/veedea/veedea.app.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (13)
components/veedea/package.json (2)
3-3
: LGTM - Appropriate version bump for new features.The version increment to 0.1.0 correctly follows semantic versioning for the addition of new Veedea integration components.
15-17
: LGTM - Correct dependency addition.The addition of
@pipedream/platform
dependency is appropriate for the new integration components and follows Pipedream's platform requirements.components/veedea/sources/new-campaign-created/test-event.mjs (1)
1-4
: LGTM - Clean test event structure.The test event fixture is well-structured with consistent data types and appropriate sample data for campaign creation events.
components/veedea/sources/new-product-purchase-created/test-event.mjs (1)
1-11
: LGTM - Comprehensive and well-structured test event.The test event fixture demonstrates good practices:
- Currency stored as string to avoid floating-point precision issues
- ISO timestamp format for proper date handling
- Comprehensive sample data covering all relevant purchase fields
components/veedea/actions/list-campaigns/list-campaigns.mjs (1)
1-31
: LGTM - Well-structured Pipedream action following best practices.The action implementation demonstrates good practices:
- Proper async/await usage
- Correct Pipedream action structure and patterns
- Token-based authentication flow
- Pagination handling with configurable limits
- Appropriate summary export and data return
Verify that the referenced app methods exist and are properly implemented:
#!/bin/bash # Description: Verify the Veedea app methods referenced in this action # Check if the app file exists and contains the required methods if [ -f "components/veedea/veedea.app.mjs" ]; then echo "Checking for required methods in veedea.app.mjs:" # Check for getToken method rg -A 5 "getToken.*[{:]" components/veedea/veedea.app.mjs # Check for getPaginatedResources method rg -A 5 "getPaginatedResources.*[{:]" components/veedea/veedea.app.mjs # Check for listCampaigns method rg -A 5 "listCampaigns.*[{:]" components/veedea/veedea.app.mjs # Check for maxResults prop definition rg -A 3 "maxResults.*[{:]" components/veedea/veedea.app.mjs else echo "veedea.app.mjs file not found - may need to be created" ficomponents/veedea/sources/new-lead-created/new-lead-created.mjs (1)
1-45
: LGTM! Well-structured source component.The implementation follows consistent patterns for Pipedream source components, properly extends the common base, and includes all necessary method overrides for polling leads.
components/veedea/sources/new-product-purchase-created/new-product-purchase-created.mjs (1)
1-45
: LGTM! Consistent implementation pattern.The component follows the same well-structured pattern as the other source components, with appropriate method overrides for tracking product purchases.
components/veedea/actions/list-leads/list-leads.mjs (2)
24-39
: LGTM! Well-implemented action with proper error handling.The action properly implements token authentication, pagination, and result summarization following Pipedream conventions.
28-34
: ```shell
#!/bin/bashLocate listLeads method in veedea.app.mjs to inspect parameter naming in API call
rg -n "async listLeads" -A10 -B2 components/veedea/veedea.app.mjs
</details> <details> <summary>components/veedea/actions/list-product-purchases/list-product-purchases.mjs (1)</summary> `24-39`: **LGTM! Consistent action implementation.** The action follows the same solid pattern as list-leads with proper authentication, pagination, and result handling. </details> <details> <summary>components/veedea/sources/common/base.mjs (1)</summary> `30-44`: **LGTM on the pagination setup.** The pagination configuration correctly passes the token and arguments to the veedea app's paginate method. </details> <details> <summary>components/veedea/veedea.app.mjs (2)</summary> `38-50`: **LGTM on the HTTP request method.** The `_makeRequest` method properly handles API key injection and token authentication with a clean interface. --- `57-74`: **LGTM on the resource methods.** All resource methods (`listCampaigns`, `listLeads`, `listProductPurchases`) follow a consistent pattern and properly delegate to the base request method. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Resolves #16737
Summary by CodeRabbit
New Features
Chores