Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented May 16, 2025

Resolves #16657.

Summary by CodeRabbit

  • New Features

    • Introduced Selzy integration with actions to create email campaigns and email messages, supporting detailed configuration, validation, and optional Google Analytics tracking.
    • Added instant and polling event sources to detect new campaigns, campaign status changes, and new subscribers in real-time or on a schedule.
    • Provided sample event data for easier testing and setup.
  • Improvements

    • Enhanced user experience with dynamic property visibility and input validation for campaign and message creation.
    • Added utility functions and constants to streamline message formatting and data handling.
    • Expanded Selzy app integration with comprehensive API methods, async pagination, and property definitions for seamless data retrieval.
    • Implemented webhook management and event processing lifecycle for reliable event emission.
  • Chores

    • Updated package metadata and dependencies for improved compatibility and versioning.

@luancazarine luancazarine added the ai-assisted Content generated by AI, with human refinement and modification label May 16, 2025
@vercel
Copy link

vercel bot commented May 16, 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) Visit Preview May 27, 2025 0:27am
pipedream-docs ⬜️ Ignored (Inspect) May 27, 2025 0:27am
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) May 27, 2025 0:27am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 16, 2025

Walkthrough

This update introduces a comprehensive Selzy integration, adding action components for creating email messages and campaigns, utility and constants modules, and several event source components for real-time and polling-based monitoring of campaigns and subscribers. The Selzy app interface is fully implemented with API methods, pagination, and prop definitions. Supporting test events and base classes for sources are also included.

Changes

File(s) Change Summary
components/selzy/actions/create-campaign/create-campaign.mjs
components/selzy/actions/create-email-message/create-email-message.mjs
New action components: "Create Campaign" and "Create Email Message" for Selzy API, with input validation, API calls, and result handling.
components/selzy/common/constants.mjs
components/selzy/common/utils.mjs
New modules exporting constants for message formats and wrap types, plus utility functions for object parsing and cleaning.
components/selzy/package.json Version bumped to 0.1.0; added dependency on @pipedream/platform.
components/selzy/selzy.app.mjs Full Selzy app implementation: prop definitions, API methods, pagination, and resource management.
components/selzy/sources/common/base.mjs New common base for Selzy sources: webhook creation/deletion, event emission, and HTTP request handling.
components/selzy/sources/new-campaign-status-instant/new-campaign-status-instant.mjs
components/selzy/sources/new-campaign-status-instant/test-event.mjs
New instant source for campaign status changes and its test event.
components/selzy/sources/new-campaign/new-campaign.mjs
components/selzy/sources/new-campaign/test-event.mjs
New polling source for new campaign creation and its test event.
components/selzy/sources/new-subscriber-instant/new-subscriber-instant.mjs
components/selzy/sources/new-subscriber-instant/test-event.mjs
New instant source for new subscriber events and its test event.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ActionComponent
    participant SelzyApp
    participant SelzyAPI

    User->>ActionComponent: Provide action input (e.g., create campaign)
    ActionComponent->>SelzyApp: Call API method with parameters
    SelzyApp->>SelzyAPI: Make HTTP request to Selzy endpoint
    SelzyAPI-->>SelzyApp: Return API response
    SelzyApp-->>ActionComponent: Return processed response
    ActionComponent-->>User: Output result/summary
Loading
sequenceDiagram
    participant SelzyWebhook
    participant SourceComponent
    participant User

    SelzyWebhook->>SourceComponent: Send webhook event (e.g., new subscriber)
    SourceComponent->>SourceComponent: Parse and deduplicate event
    SourceComponent-->>User: Emit event with summary and data
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement "New Subscriber (Instant)" webhook source (list selection, event emission) (#16657)
Implement "New Campaign Status (Instant)" webhook source (event emission, status updates) (#16657)
Implement "New Campaign Created" source (polling, emits on campaign creation) (#16657)
Implement "Create Email Message" action (all required fields, API call, validation) (#16657)
Implement "Create Campaign" action (all required fields, API call, validation) (#16657)

Suggested reviewers

  • GTFalcao

Poem

🐇✨
In Selzy fields, new features sprout,
Campaigns and messages, all mapped out.
Webhooks leap at every change,
Subscribers hop in—none too strange!
With code so fresh and actions bright,
This rabbit cheers the launch tonight!
🌱📧

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/selzy/actions/create-campaign/create-campaign.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:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

components/selzy/sources/new-campaign/new-campaign.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:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a90ec5 and 2689a54.

📒 Files selected for processing (2)
  • components/selzy/actions/create-campaign/create-campaign.mjs (1 hunks)
  • components/selzy/sources/new-campaign/new-campaign.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/selzy/actions/create-campaign/create-campaign.mjs
  • components/selzy/sources/new-campaign/new-campaign.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
✨ 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.

Sources
 - New Campaign
 - New Campaign Status (Instant)
 - New Subscriber (Instant)

Actions
 - Create Subscriber
 - Send Campaign
 - Create Campaign
@luancazarine luancazarine marked this pull request as ready for review May 19, 2025 13:10
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 (3)
components/selzy/common/utils.mjs (1)

26-38: Effective utility for cleaning objects

The clearEmpty function provides a straightforward way to remove empty, null, or undefined values from objects. This is particularly useful for API requests where empty parameters should be omitted rather than sent as empty values.

Consider adding support for handling nested objects and arrays to make this utility even more versatile:

export const clearEmpty = (obj) => {
  if (!obj) return undefined;

  const newObj = {
    ...obj,
  };
  Object.keys(newObj).forEach((key) => {
    if (newObj[key] === "" || newObj[key] === null || newObj[key] === undefined) {
      delete newObj[key];
+   } else if (typeof newObj[key] === 'object' && newObj[key] !== null) {
+     // Recursively clean nested objects and arrays
+     const cleaned = clearEmpty(newObj[key]);
+     if (Array.isArray(newObj[key]) && cleaned.length === 0) {
+       delete newObj[key]; // Remove empty arrays
+     } else if (!Array.isArray(newObj[key]) && Object.keys(cleaned).length === 0) {
+       delete newObj[key]; // Remove empty objects
+     } else {
+       newObj[key] = cleaned;
+     }
    }
  });
  return newObj;
};
components/selzy/actions/create-campaign/create-campaign.mjs (1)

95-104: additionalProps should return mutated props to persist UI changes

Returning {} may discard the visibility toggles you just set. Return the mutated object instead:

-    return {};
+    return props;

Without this, the GA fields can remain hidden in the UI even after the user checks Track GA.

components/selzy/sources/new-campaign/new-campaign.mjs (1)

61-66: Event timestamp should reflect campaign creation time

Date.parse(new Date()) merely returns now; using the campaign’s own timestamp is more valuable.

-          ts: Date.parse(new Date()),
+          ts: Date.parse(item.start_time),
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between ae1b6f8 and 97067f7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • components/selzy/actions/create-campaign/create-campaign.mjs (1 hunks)
  • components/selzy/actions/create-email-message/create-email-message.mjs (1 hunks)
  • components/selzy/common/constants.mjs (1 hunks)
  • components/selzy/common/utils.mjs (1 hunks)
  • components/selzy/package.json (2 hunks)
  • components/selzy/selzy.app.mjs (1 hunks)
  • components/selzy/sources/common/base.mjs (1 hunks)
  • components/selzy/sources/new-campaign-status-instant/new-campaign-status-instant.mjs (1 hunks)
  • components/selzy/sources/new-campaign-status-instant/test-event.mjs (1 hunks)
  • components/selzy/sources/new-campaign/new-campaign.mjs (1 hunks)
  • components/selzy/sources/new-campaign/test-event.mjs (1 hunks)
  • components/selzy/sources/new-subscriber-instant/new-subscriber-instant.mjs (1 hunks)
  • components/selzy/sources/new-subscriber-instant/test-event.mjs (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Pull Request Checks
components/selzy/actions/create-campaign/create-campaign.mjs

[error] 1-1: Component folder name, component file name without extension and component key without slug should be the same. See https://pipedream.com/docs/components/guidelines/#folder-structure

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (26)
components/selzy/package.json (2)

3-3: Version bump from 0.0.1 to 0.1.0 is appropriate

The version increment follows semantic versioning principles, indicating this is a minor release with new functionality but no breaking changes, which aligns with introducing new Selzy integration components.


14-16: Proper dependency configuration

Added the Pipedream platform dependency correctly with appropriate versioning using the caret notation to accept compatible updates. This ensures the Selzy components have access to the required platform functionality.

components/selzy/sources/new-campaign-status-instant/test-event.mjs (1)

1-13: Appropriate test event structure for webhook testing

This test event correctly models a campaign status webhook payload with all the necessary fields that would be expected from the Selzy API. The sample data includes authentication tokens, campaign identifiers, and status information that will be useful for development and testing.

Note that the event_time is set to a future date (2025-05-16). While this doesn't affect functionality, it's worth noting that using dates closer to the present might make the test data feel more realistic.

components/selzy/sources/new-campaign/test-event.mjs (1)

1-11: Well-structured test event for campaign polling

The test event provides a comprehensive sample of campaign data including ID, timing, status, and messaging details. This structure appears to match Selzy's API response format for campaigns.

Note that the start_time is set to a future date (2025-06-10). While this won't impact functionality, using dates closer to the present might make the test data feel more realistic during development and testing.

components/selzy/sources/new-subscriber-instant/test-event.mjs (1)

1-10: Complete test event for subscriber webhook testing

This test event provides all the necessary fields for testing the subscriber webhook integration, including authentication details, event metadata, and subscription information.

Note that the event_time is set to a future date (2025-05-16). While this doesn't affect functionality, using dates closer to the present might make the test data feel more realistic during development.

components/selzy/common/utils.mjs (1)

1-24: Robust object parsing utility with proper error handling

The parseObject function correctly handles multiple input types including arrays and strings, with appropriate error handling for JSON parsing. The function gracefully falls back to returning the original value when parsing fails, making it resilient against malformed inputs.

components/selzy/common/constants.mjs (3)

1-1: Well-defined pagination limit constant.

Setting a fixed pagination limit of 100 is a good practice to control API call data sizes.


3-16: Good organization of message format options.

The message format options are well-structured with clear labels and corresponding values. This makes it easy for users to understand the available choices when creating email messages.


18-35: Clear text alignment options with descriptive labels.

The wrap type options are well-defined with informative labels that include both the alignment name and a description of what it does, which improves the user experience.

components/selzy/sources/new-campaign-status-instant/new-campaign-status-instant.mjs (4)

1-3: Clean imports with good separation of concerns.

The module correctly imports the common base module and a sample event for testing purposes.


4-12: Well-structured component metadata.

The component is properly defined with appropriate metadata, including a descriptive name, clear description, semantic versioning, and suitable deduplication strategy.


13-22: Effective method implementations for webhook filtering and event summarization.

The getEventType method correctly specifies the wildcard filter for campaign status events, and the getSummary method provides a clear human-readable description of the event.


23-24: Good practice including sample event for testing.

Including the sample emit data makes testing and development easier.

components/selzy/sources/new-subscriber-instant/new-subscriber-instant.mjs (5)

1-3: Clean imports with good separation of concerns.

The module correctly imports the common base module and a sample event for testing purposes.


4-12: Well-structured component metadata.

The component is properly defined with appropriate metadata, including a descriptive name, clear description, semantic versioning, and suitable deduplication strategy.


12-22: Well-designed optional list filtering capability.

The listId property is properly defined as optional, allowing users to monitor all lists or a specific one. The description clearly explains the purpose of this property.


23-35: Effective event filtering and summary implementation.

The getEventType method properly handles both filtered and unfiltered list scenarios, and the getSummary method creates a clear description that includes the subscriber's email.


36-37: Good practice including sample event for testing.

Including the sample emit data makes testing and development easier.

components/selzy/sources/common/base.mjs (4)

1-11: Well-structured props with required dependencies.

The base component correctly imports the Selzy app and sets up necessary props for HTTP interface with custom response handling and database service.


12-31: Robust webhook lifecycle management.

The activate and deactivate hooks properly create and clean up webhooks, ensuring good resource management. The webhook configuration includes necessary parameters for JSON POST format and active status.


32-40: Appropriate handling of webhook verification.

The run method correctly responds to GET requests with a 200 status code, which is typically used for webhook verification by service providers.


42-48: Effective event emission with proper metadata.

The event emission includes a composite ID for deduplication (using campaign ID or email with timestamp), a human-readable summary, and the parsed timestamp for proper sorting and filtering in the Pipedream UI.

components/selzy/actions/create-email-message/create-email-message.mjs (1)

108-110: Good defensive validation of mutually-exclusive template fields
The early ConfigurationError prevents a hard-to-debug API error. 👍

components/selzy/actions/create-campaign/create-campaign.mjs (1)

112-125: Boolean → int cast is fine, but empty fields are already stripped

Because clearEmpty() will remove falsy values, the && +this.trackRead idiom works and keeps the payload minimal – nice touch.

components/selzy/selzy.app.mjs (2)

70-77: messageId option loader is returning templates, not messages

listTemplates(type: "system") is unlikely to list user-created messages.
If Selzy exposes a listMessages/getMessages endpoint, switch to that; otherwise users will pick the wrong IDs.


116-124: Robust request helper – good centralisation

Consolidating auth, base URL and axios call parameters here keeps every API wrapper consistent and DRY.

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

♻️ Duplicate comments (1)
components/selzy/actions/create-campaign/create-campaign.mjs (1)

8-13: Component key matches folder name correctly

The component key "selzy-create-campaign" now matches the folder/file name "create-campaign", which resolves the previous build error mentioned in past review comments.

🧹 Nitpick comments (4)
components/selzy/actions/create-campaign/create-campaign.mjs (4)

95-104: Refactor the additionalProps method to follow expected patterns

The additionalProps method directly modifies the props parameter and returns an empty object, which is not the conventional pattern for this method. Typically, this method should return properties to be added, not modify existing ones.

Consider refactoring to follow this pattern:

async additionalProps() {
  const gaAllowed = this.trackGa;
- props.gaMedium.hidden = !gaAllowed;
- props.gaSource.hidden = !gaAllowed;
- props.gaCampaign.hidden = !gaAllowed;
- props.gaContent.hidden = !gaAllowed;
- props.gaTerm.hidden = !gaAllowed;

- return {};
+ return {
+   gaMedium: {
+     hidden: !gaAllowed,
+   },
+   gaSource: {
+     hidden: !gaAllowed,
+   },
+   gaCampaign: {
+     hidden: !gaAllowed,
+   },
+   gaContent: {
+     hidden: !gaAllowed,
+   },
+   gaTerm: {
+     hidden: !gaAllowed,
+   },
+ };
}

115-124: Simplify boolean to numeric conversion

The current approach for converting boolean values to numbers is functional but could be simplified for better readability.

Consider using ternary operators or a utility function for consistent conversion:

- track_read: this.trackRead && +this.trackRead,
- track_links: this.trackLinks && +this.trackLinks,
- track_ga: this.trackGa && +this.trackGa,
+ track_read: this.trackRead ? 1 : 0,
+ track_links: this.trackLinks ? 1 : 0,
+ track_ga: this.trackGa ? 1 : 0,

Or create a utility function:

const boolToNum = (value) => value ? 1 : 0;

Then use it:

track_read: boolToNum(this.trackRead),

117-117: Consider adding fallback for empty arrays

The current implementation joins the array with a comma but doesn't handle empty arrays explicitly.

Consider adding a check to handle potential empty arrays:

- contacts: parseObject(this.contacts)?.join(","),
+ contacts: parseObject(this.contacts)?.length ? parseObject(this.contacts).join(",") : undefined,

130-130: Consider updating the summary message for consistency

The summary message specifies "email campaign" but the component name is more generically "Create Campaign".

Either update the summary message to be consistent with the component name or update the component name to specify "email campaign" if that's the specific focus:

- $.export("$summary", `Successfully created email campaign with ID: ${response.result.campaign_id}`);
+ $.export("$summary", `Successfully created campaign with ID: ${response.result.campaign_id}`);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 97067f7 and 9787c89.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • components/selzy/actions/create-campaign/create-campaign.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (2)
components/selzy/actions/create-campaign/create-campaign.mjs (2)

106-108: LGTM! Good validation check for mutually exclusive parameters

The validation check ensures that users cannot provide both contacts and contactsUrl simultaneously, which aligns with the API requirements.


1-7: LGTM! Appropriate imports and error handling

The imports are correct, and the code properly uses the ConfigurationError class from the Pipedream platform for error handling. The utility functions are imported correctly from the common folder.

lcaresia
lcaresia previously approved these changes May 21, 2025
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: 2

🧹 Nitpick comments (2)
components/selzy/actions/create-campaign/create-campaign.mjs (2)

109-115: Optimize Google Analytics parameter handling.

Currently, GA parameters are passed to the API even when trackGa is false. Consider only including them when GA tracking is enabled to reduce payload size and improve clarity.

       track_ga: this.trackGa && +this.trackGa,
-      ga_medium: this.gaMedium,
-      ga_source: this.gaSource,
-      ga_campaign: this.gaCampaign,
-      ga_content: this.gaContent,
-      ga_term: this.gaTerm,
+      ...(this.trackGa && {
+        ga_medium: this.gaMedium,
+        ga_source: this.gaSource,
+        ga_campaign: this.gaCampaign,
+        ga_content: this.gaContent,
+        ga_term: this.gaTerm,
+      }),

118-118: Enhance error handling with more context.

The current error handling only passes through the API error message. Consider providing more context about the operation that failed.

-   if (response.error) throw new ConfigurationError(response.error);
+   if (response.error) throw new ConfigurationError(`Failed to create campaign: ${response.error}`);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9787c89 and 3ff4db2.

📒 Files selected for processing (3)
  • components/selzy/actions/create-campaign/create-campaign.mjs (1 hunks)
  • components/selzy/actions/create-email-message/create-email-message.mjs (1 hunks)
  • components/selzy/sources/new-campaign/new-campaign.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/selzy/actions/create-email-message/create-email-message.mjs
  • components/selzy/sources/new-campaign/new-campaign.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/selzy/actions/create-campaign/create-campaign.mjs (1)

1-10: LGTM! Key/folder name mismatch resolved.

The component key now correctly matches the folder and file name, resolving the build issue mentioned in the previous review.

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ff4db2 and 6a90ec5.

📒 Files selected for processing (2)
  • components/selzy/actions/create-email-message/create-email-message.mjs (1 hunks)
  • components/selzy/sources/new-campaign/new-campaign.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/selzy/actions/create-email-message/create-email-message.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (4)
components/selzy/sources/new-campaign/new-campaign.mjs (4)

1-20: LGTM: Standard component setup

The component configuration follows Pipedream conventions correctly with appropriate props, dedupe strategy, and polling setup.


22-27: LGTM: Clean state management

The database methods for tracking the last processed campaign ID are simple and effective.


42-48: LGTM: Correct lastId tracking

The logic correctly sets the lastId to the newest campaign's ID before reversing the array for emission. The past review comment appears to be outdated or incorrect for this implementation.


59-67: LGTM: Proper deployment and run logic

The deploy hook appropriately limits initial events to 25, and the run method enables unlimited polling for ongoing monitoring.

luancazarine and others added 3 commits May 26, 2025 13:41
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@luancazarine luancazarine requested a review from lcaresia May 27, 2025 12:41
@luancazarine
Copy link
Collaborator Author

/approve

@luancazarine luancazarine merged commit 3465789 into master May 27, 2025
11 checks passed
@luancazarine luancazarine deleted the issue-16657 branch May 27, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Content generated by AI, with human refinement and modification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Components] selzy

3 participants