Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

New Components - veedea #17188

wants to merge 2 commits into from

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jun 19, 2025

Resolves #16737

Summary by CodeRabbit

  • New Features

    • Introduced actions to list campaigns, leads, and product purchases for Veedea integration.
    • Added triggers to emit events when new campaigns, leads, or product purchases are created.
    • Provided sample event data for easier setup and testing.
    • Enabled dynamic campaign selection and configurable result limits in actions and triggers.
  • Chores

    • Updated package version and added a new dependency for platform support.

Copy link

vercel bot commented Jun 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Jun 19, 2025 3:16pm
pipedream-docs ⬜️ Ignored (Inspect) Jun 19, 2025 3:16pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 19, 2025 3:16pm

Copy link
Contributor

coderabbitai bot commented Jun 19, 2025

Walkthrough

This 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

File(s) Change Summary
components/veedea/actions/list-campaigns/list-campaigns.mjs New action: Lists campaigns from Veedea API.
components/veedea/actions/list-leads/list-leads.mjs New action: Lists leads for a specified campaign.
components/veedea/actions/list-product-purchases/list-product-purchases.mjs New action: Lists product purchases for a specified campaign.
components/veedea/package.json Updated version to 0.1.0; added @pipedream/platform dependency.
components/veedea/sources/common/base.mjs New base polling source with timestamp-based incremental fetching and event emission.
components/veedea/sources/new-campaign-created/new-campaign-created.mjs New source: Emits event on new campaign creation.
components/veedea/sources/new-campaign-created/test-event.mjs New test event fixture for new campaign source.
components/veedea/sources/new-lead-created/new-lead-created.mjs New source: Emits event on new lead creation.
components/veedea/sources/new-lead-created/test-event.mjs New test event fixture for new lead source.
components/veedea/sources/new-product-purchase-created/new-product-purchase-created.mjs New source: Emits event on new product purchase.
components/veedea/sources/new-product-purchase-created/test-event.mjs New test event fixture for new product purchase source.
components/veedea/veedea.app.mjs New app module: Defines property definitions, API client methods, and pagination utilities for Veedea integration.

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
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement new-campaign-created polling source (#16737)
Implement new-lead-created polling source (#16737)
Implement new-product-purchase-created polling source (#16737)
Implement list-campaigns, list-leads, and list-product-purchases actions (#16737)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Poem

In burrows deep, a rabbit spies
New Veedea code, a sweet surprise!
Campaigns and leads, purchases too,
Hop through APIs, fresh and new.
With polling and lists, the work is done—
This bunny’s proud of what you’ve spun!
🐇✨

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/veedea/actions/list-campaigns/list-campaigns.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

components/veedea/actions/list-leads/list-leads.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

components/veedea/actions/list-product-purchases/list-product-purchases.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

  • 8 others
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 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 use campaignId. 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:

  1. campid is a string ("330") while id is a number (26) - consider consistent typing
  2. Empty string fields (source, device, region) might be better with realistic sample values for more comprehensive testing

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between d223e5f and 2e38416.

⛔ 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"
fi
components/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/bash

Locate 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 -->

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] veedea
2 participants