Skip to content

Conversation

luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Oct 13, 2025

Resolves #14336

Summary by CodeRabbit

  • New Features
    • Added Aweber “Create Broadcast” action with subject/body, tracking, list include/exclude, integrations, segment, archive, and notification options.
    • Introduced “New Broadcast Event” trigger with status filter (draft/scheduled/sent).
    • Dynamic pickers for lists, segments, and integrations when configuring.
  • Bug Fixes
    • Improved event deduplication by falling back to UUID when ID is missing.
  • Chores
    • Package and action version bumps across Aweber components.
  • Tests
    • Added sample payloads for broadcast and subscriber events.

- Added `createBroadcast` action to facilitate broadcast creation.
- Introduced `New Broadcast Event` source to emit events for new broadcasts.
- Updated existing actions to version 0.0.5 and adjusted descriptions for clarity.
- Added new properties for list and integration options in the Aweber app.
- Updated package version to 0.4.0 and dependencies to ensure compatibility.
@luancazarine luancazarine linked an issue Oct 13, 2025 that may be closed by this pull request
Copy link

vercel bot commented Oct 13, 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 Oct 13, 2025 6:11pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 13, 2025 6:11pm

Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

Walkthrough

Adds a Create Broadcast action and New Broadcast Event source; extends the Aweber app with propDefinitions and methods for broadcasts, segments, and integrations; introduces test fixtures and sampleEmit; updates request header handling and generateMeta id fallback; bumps package and several action/source versions.

Changes

Cohort / File(s) Summary
New Action: Create Broadcast
components/aweber/actions/create-broadcast/create-broadcast.mjs
New default-export action that maps props to API fields and calls aweberApp.createBroadcast; sends Content-Type application/x-www-form-urlencoded, returns API response and summary with created broadcast UUID.
AWeber App Enhancements
components/aweber/aweber.app.mjs
Added propDefinitions (listSelfLink, integrations, segmentSelfLink) with async options; added methods getBroadcasts, getSegments, getIntegrations, createBroadcast; makeRequest now accepts headers param.
New Source: New Broadcast Event
components/aweber/sources/new-broadcast-event/new-broadcast-event.mjs, components/aweber/sources/new-broadcast-event/test-event.mjs
New polling source for broadcasts using getBroadcasts; supports status filter; emits summary from resource.subject; includes test-event fixture.
Source Utility Update
components/aweber/sources/common.mjs
Moved import placement; generateMeta(resource) now uses `resource.id
Subscriber Added: sampleEmit + fixture
components/aweber/sources/subscriber-added/subscriber-added.mjs, components/aweber/sources/subscriber-added/test-event.mjs
Added sampleEmit import/property to subscriber-added source and static subscriber test-event fixture; bumped source version to 0.0.5.
Version Bumps: Actions
components/aweber/actions/add-subscriber/add-subscriber.mjs, components/aweber/actions/create-or-update-subscriber/create-or-update-subscriber.mjs, components/aweber/actions/get-accounts/get-accounts.mjs, components/aweber/actions/get-lists/get-lists.mjs, components/aweber/actions/get-subscribers/get-subscribers.mjs, components/aweber/actions/update-subscriber/update-subscriber.mjs
Incremented version fields in multiple action modules (no behavior changes).
Package Metadata
components/aweber/package.json
Bumped package version 0.3.70.4.0; updated dependency @pipedream/platform from ^1.2.0^3.1.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Create Broadcast Action
  participant App as aweber.app
  participant API as AWeber API

  User->>Action: Execute with props (accountId, listId, subject, body, ...)
  Action->>App: createBroadcast(accountId, listId, data, { headers })
  App->>API: POST /accounts/{accountId}/lists/{listId}/broadcasts
  Note right of API: Content-Type: application/x-www-form-urlencoded
  API-->>App: 201 Created (broadcast payload with uuid)
  App-->>Action: Broadcast response
  Action-->>User: Summary: Created broadcast {uuid}
Loading
sequenceDiagram
  autonumber
  participant Source as New Broadcast Event Source
  participant App as aweber.app
  participant API as AWeber API
  participant PD as Pipedream Runtime

  loop Poll interval
    Source->>App: getBroadcasts(accountId, listId, { status })
    App->>API: GET /accounts/{accountId}/lists/{listId}/broadcasts?status=...
    API-->>App: List of broadcasts
    App-->>Source: Broadcast list
    Source->>Source: generateMeta(resource.id || resource.uuid)
    alt New resource
      Source->>PD: $emit(resource, {summary: "New broadcast event {subject}"})
    else Already seen
      Source->>Source: Skip
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

I twitch my whiskers at a broadcast new,
Drafts and subjects bathed in dew—
Segs and lists and integrations too,
I hop and queue the send for you. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The pull request includes version bumps for multiple existing actions, a dependency upgrade in package.json, and unrelated modifications in common.mjs that were not part of the original issue’s objectives to implement the Create Broadcast action. Please remove or justify the version increments and dependency updates unrelated to the Create Broadcast feature, or split them into a separate housekeeping pull request.
Description Check ⚠️ Warning The description only states “Resolves #14336” and does not follow the repository’s description template by omitting the required WHY section and any explanation of the change’s purpose or context. Please expand the description to include the WHY section as per the template, explaining why this integration is needed and how the new Create Broadcast action and sources address the objectives.
Title Check ❓ Inconclusive The title “14336 aweber” is vague and does not summarize the main changes such as adding the Create Broadcast action or Aweber integration features, instead simply repeating the issue number and app name without highlighting the functionality implemented. Please update the title to a concise sentence that clearly describes the primary change, for example “Add Aweber Create Broadcast action and integration methods.”
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The changes implement the requested Aweber integration by defining the Create Broadcast action, adding necessary app methods and propDefinitions for broadcasts, segments, and integrations, and introducing corresponding sources to support triggers, thereby fulfilling the coding objectives from issue #14336.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 14336-aweber

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

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

🧹 Nitpick comments (1)
components/aweber/sources/new-broadcast-event/new-broadcast-event.mjs (1)

23-32: Consider enhancing the status field description.

The current description "The status of the broadcast event" is brief. Consider clarifying that this field filters which broadcast events are emitted based on their status.

Apply this diff to improve clarity:

     status: {
       type: "string",
       label: "Status",
-      description: "The status of the broadcast event.",
+      description: "Filter broadcast events by status. Only events matching this status will be emitted.",
       options: [
         "draft",
         "scheduled",
         "sent",
       ],
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f84b6d and 76006bd.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • components/aweber/actions/add-subscriber/add-subscriber.mjs (1 hunks)
  • components/aweber/actions/create-broadcast/create-broadcast.mjs (1 hunks)
  • components/aweber/actions/create-or-update-subscriber/create-or-update-subscriber.mjs (1 hunks)
  • components/aweber/actions/get-accounts/get-accounts.mjs (1 hunks)
  • components/aweber/actions/get-lists/get-lists.mjs (1 hunks)
  • components/aweber/actions/get-subscribers/get-subscribers.mjs (1 hunks)
  • components/aweber/actions/update-subscriber/update-subscriber.mjs (1 hunks)
  • components/aweber/aweber.app.mjs (5 hunks)
  • components/aweber/package.json (2 hunks)
  • components/aweber/sources/common.mjs (2 hunks)
  • components/aweber/sources/new-broadcast-event/new-broadcast-event.mjs (1 hunks)
  • components/aweber/sources/new-broadcast-event/test-event.mjs (1 hunks)
  • components/aweber/sources/subscriber-added/subscriber-added.mjs (2 hunks)
  • components/aweber/sources/subscriber-added/test-event.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/aweber/actions/create-broadcast/create-broadcast.mjs (2)
components/aweber/actions/create-or-update-subscriber/create-or-update-subscriber.mjs (1)
  • response (87-98)
components/aweber/actions/update-subscriber/update-subscriber.mjs (1)
  • response (74-87)
⏰ 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: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (12)
components/aweber/actions/update-subscriber/update-subscriber.mjs (1)

9-9: LGTM!

Version bump is consistent with the broader package updates in this PR.

components/aweber/sources/common.mjs (2)

1-1: LGTM!

Import organization improvement.


67-67: Good defensive fallback for broadcast events.

The fallback to resource.uuid accommodates broadcast resources that use uuid as their primary identifier instead of id. This aligns with the test fixture in new-broadcast-event/test-event.mjs which uses uuid.

components/aweber/package.json (2)

3-3: LGTM!

Version bump aligns with the new features and updates in this PR.


13-13: Resolve — @pipedream/platform 3.1.0 verified for this component.
Aweber imports axios, ConfigurationError and DEFAULT_POLLING_SOURCE_TIMER_INTERVAL (components/aweber/aweber.app.mjs, common/utils.mjs, sources/common.mjs); platform v3.1.0 (platform/dist/index.js and .d.ts) exports these symbols. No changes required.

components/aweber/sources/subscriber-added/subscriber-added.mjs (2)

3-3: LGTM!

Good pattern for wiring test fixtures to the source component. The sampleEmit field provides clear example payloads for testing and documentation.

Also applies to: 31-31


11-11: LGTM!

Version bump is consistent with the addition of the sampleEmit field.

components/aweber/sources/new-broadcast-event/test-event.mjs (1)

1-9: LGTM!

The broadcast event test fixture provides a comprehensive sample payload with all relevant fields (uuid, broadcast_id, timestamps, status, subject).

components/aweber/sources/new-broadcast-event/new-broadcast-event.mjs (1)

1-11: LGTM!

The source implementation follows the established pattern from other Aweber sources. The structure is clean, methods are well-defined, and the resource fetching logic is appropriate.

Also applies to: 34-54

components/aweber/aweber.app.mjs (3)

110-217: LGTM!

The three new propDefinitions (listSelfLink, integrations, segmentSelfLink) follow consistent patterns with existing prop definitions. They provide async options fetching with pagination support and clear labeling. The segmentSelfLink description is particularly helpful in explaining the optional nature and default behavior.


270-275: LGTM!

Cleaner headers handling by accepting headers as an explicit parameter rather than extracting from otherArgs. This improves the method signature clarity.


304-361: LGTM!

The four new methods (getBroadcasts, getSegments, getIntegrations, createBroadcast) follow the established patterns in the codebase. They correctly construct API paths and propagate arguments.

- Corrected "HMTL" to "HTML" in the `bodyText` description for clarity.
- Fixed the spelling of `clickTrackingEnabeld` to `clickTrackingEnabled` in the properties.
- Changed readOnlyHint from true to false in the Aweber create-broadcast action to enable editing capabilities.
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

♻️ Duplicate comments (1)
components/aweber/actions/create-broadcast/create-broadcast.mjs (1)

155-157: Content-Type header should be application/json.

The header is still set to "application/x-www-form-urlencoded" but the payload is a JavaScript object that axios serializes as JSON. This issue was previously flagged and remains unresolved.

Apply this diff to fix the Content-Type header:

       headers: {
-        "Content-Type": "application/x-www-form-urlencoded",
+        "Content-Type": "application/json",
       },

Alternatively, remove the explicit Content-Type header and let axios set it automatically based on the request body type.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44b6eb2 and 68a4918.

📒 Files selected for processing (1)
  • components/aweber/actions/create-broadcast/create-broadcast.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/aweber/actions/create-broadcast/create-broadcast.mjs (2)
components/aweber/actions/create-or-update-subscriber/create-or-update-subscriber.mjs (1)
  • response (87-98)
components/aweber/actions/update-subscriber/update-subscriber.mjs (1)
  • response (74-87)
⏰ 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: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components

Comment on lines +31 to +40
bodyHTML: {
type: "string",
label: "Body HTML",
description: "The content of the message in HTML format. If `Body Text` is not provided, it will be auto-generated. If `Body Text` is not provided, `Body HTML` must be provided.",
},
bodyText: {
type: "string",
label: "Body Text",
description: "The content of the message in plain text, used when HTML is not supported. If `Body HTML` is not provided, the broadcast will be sent using only the `Body Text`. If `Body Text` is not provided, `Body HTML` must be provided.",
},
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Prop requirements contradict descriptions.

Both bodyHTML and bodyText are required fields (no optional: true), but their descriptions indicate that at least one should be provided, not both. This prevents users from creating HTML-only or text-only broadcasts as described in the prop documentation.

Apply this diff to make both props optional while enforcing that at least one must be provided:

     bodyHTML: {
       type: "string",
       label: "Body HTML",
       description: "The content of the message in HTML format. If `Body Text` is not provided, it will be auto-generated. If `Body Text` is not provided, `Body HTML` must be provided.",
+      optional: true,
     },
     bodyText: {
       type: "string",
       label: "Body Text",
       description: "The content of the message in plain text, used when HTML is not supported. If `Body HTML` is not provided, the broadcast will be sent using only the `Body Text`. If `Body Text` is not provided, `Body HTML` must be provided.",
+      optional: true,
     },

Then add validation in the run method before the API call:

   async run({ $ }) {
+    if (!this.bodyHTML && !this.bodyText) {
+      throw new Error("At least one of 'Body HTML' or 'Body Text' must be provided.");
+    }
+
     const response = await this.aweberApp.createBroadcast({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
bodyHTML: {
type: "string",
label: "Body HTML",
description: "The content of the message in HTML format. If `Body Text` is not provided, it will be auto-generated. If `Body Text` is not provided, `Body HTML` must be provided.",
},
bodyText: {
type: "string",
label: "Body Text",
description: "The content of the message in plain text, used when HTML is not supported. If `Body HTML` is not provided, the broadcast will be sent using only the `Body Text`. If `Body Text` is not provided, `Body HTML` must be provided.",
},
// In the props definitions (around lines 31–40):
bodyHTML: {
type: "string",
label: "Body HTML",
description: "The content of the message in HTML format. If `Body Text` is not provided, it will be auto-generated. If `Body Text` is not provided, `Body HTML` must be provided.",
optional: true,
},
bodyText: {
type: "string",
label: "Body Text",
description: "The content of the message in plain text, used when HTML is not supported. If `Body HTML` is not provided, the broadcast will be sent using only the `Body Text`. If `Body Text` is not provided, `Body HTML` must be provided.",
optional: true,
},
// In the run method (before the API call):
async run({ $ }) {
if (!this.bodyHTML && !this.bodyText) {
throw new Error("At least one of 'Body HTML' or 'Body Text' must be provided.");
}
const response = await this.aweberApp.createBroadcast({
// …rest of the parameters
});
// …
}
🤖 Prompt for AI Agents
In components/aweber/actions/create-broadcast/create-broadcast.mjs around lines
31-40, change both bodyHTML and bodyText prop definitions to include optional:
true (making them optional), and in the run method add a pre-API-call validation
that reads the input props and throws a clear error if neither bodyHTML nor
bodyText is provided (e.g., if (!bodyHTML && !bodyText) throw new Error("Provide
at least one of bodyHTML or bodyText")). Ensure the validation runs before
constructing the request so HTML-only or text-only broadcasts are allowed but
both being empty is rejected.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeRabbit's comment makes sense here. bodyHTML and bodyText are both required, but their descriptions somewhat contradict this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GTFalcao, thank you for confirming! Yes, the current implementation creates a conflict between the required fields and their descriptions. Making both bodyHTML and bodyText optional while adding runtime validation to ensure at least one is provided is the correct approach. This will allow users to create:

  • HTML-only broadcasts (with auto-generated plain text)
  • Text-only broadcasts
  • Mixed HTML and text broadcasts

while preventing the error case where neither is provided. The suggested fix aligns with the AWeber API behavior described in the prop documentation.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment about the Body HTML and Body Text properties - I think this needs to be revised before moving forward

Comment on lines +31 to +40
bodyHTML: {
type: "string",
label: "Body HTML",
description: "The content of the message in HTML format. If `Body Text` is not provided, it will be auto-generated. If `Body Text` is not provided, `Body HTML` must be provided.",
},
bodyText: {
type: "string",
label: "Body Text",
description: "The content of the message in plain text, used when HTML is not supported. If `Body HTML` is not provided, the broadcast will be sent using only the `Body Text`. If `Body Text` is not provided, `Body HTML` must be provided.",
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeRabbit's comment makes sense here. bodyHTML and bodyText are both required, but their descriptions somewhat contradict this.

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.

Aweber

2 participants