Skip to content

Conversation

@lcaresia
Copy link
Collaborator

@lcaresia lcaresia commented Aug 28, 2025

WHY

Summary by CodeRabbit

  • New Features

    • Added a Send Message action for SMS and WhatsApp with support for multiple recipients, templates, optional URL shortening, channel selection, and scheduling.
    • Exposed channel options (SMS, WhatsApp) and improved app-level message configuration and validation.
  • Chores

    • Bumped TopMessage package version to 0.1.0 and added platform dependency for improved request handling and authentication.

@lcaresia lcaresia self-assigned this Aug 28, 2025
@vercel
Copy link

vercel bot commented Aug 28, 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 Aug 29, 2025 0:02am
pipedream-docs-redirect-do-not-edit Ignored Ignored Aug 29, 2025 0:02am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Walkthrough

Adds a TopMessage "Send Message" action, new channel constants, expanded app prop definitions and an HTTP request layer with sendMessage, and bumps the component package version.

Changes

Cohort / File(s) Summary
Action: Send Message
components/topmessage/actions/send-message/send-message.mjs
New action module exporting metadata (key/name/description/version/type/props) and a run method that calls this.app.sendMessage(...), maps action props to the API payload, and exports a success summary.
App: Prop Definitions & HTTP Client
components/topmessage/topmessage.app.mjs
Replaces placeholder auth with real app propDefinitions (from, to, text, shortenURLs, templateId, channel, schedule), adds imports (axios, constants), implements _baseUrl(), _makeRequest(...) (adds x-topmessage-key header) and sendMessage(...) POST to /messages.
Common Constants
components/topmessage/common/constants.mjs
New module exporting default object with CHANNEL_OPTIONS: ["SMS", "WHATSAPP"].
Package Version
components/topmessage/package.json
Package version updated from 0.0.1 to 0.1.0; dependencies added (@pipedream/platform": "^3.1.0") and final newline added.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Send Message Action
  participant App as TopMessage App
  participant API as TopMessage API

  User->>Action: Provide config & props (from,to,text,shortenURLs,templateId,channel,schedule)
  Action->>App: this.app.sendMessage({ data: { from,to,text,shorten_URLs,template_id,channel,schedule } })
  App->>API: POST /v1/messages with header x-topmessage-key
  API-->>App: Response
  App-->>Action: Return response
  Action-->>User: $.export("$summary", "Successfully sent the message request")
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

I twitch my ears at message light,
Two channels ready for the night.
I pack the text, I send with glee—
SMS or WhatsApp, off to be.
A tiny hop, a happy cheer,
The message goes, the burrow's near. 🐇


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5e8e0c8 and 457ac74.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • components/topmessage/package.json (2 hunks)
  • components/topmessage/topmessage.app.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/topmessage/package.json
  • components/topmessage/topmessage.app.mjs
⏰ 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: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18099

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.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@lcaresia lcaresia linked an issue Aug 28, 2025 that may be closed by this pull request
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: 3

🧹 Nitpick comments (6)
components/topmessage/package.json (1)

3-3: Align action/package versions or document the rationale.

Package is 0.1.0 while the new action is 0.0.1. Either bump the action to 0.1.0 or note intentional divergence to avoid confusion in release tracking.

Apply this diff if you want them aligned:

-  "version": "0.1.0",
+  "version": "0.1.0",
components/topmessage/common/constants.mjs (1)

1-6: Use label/value options and fix WhatsApp casing for nicer UI.

Uppercased "WHATSAPP" will be shown to users as-is. Prefer label/value pairs so we can keep API values while showing proper casing.

-export default {
-  CHANNEL_OPTIONS: [
-    "SMS",
-    "WHATSAPP",
-  ],
-};
+export default {
+  CHANNEL_OPTIONS: [
+    { label: "SMS", value: "SMS" },
+    { label: "WhatsApp", value: "WHATSAPP" },
+  ],
+};
components/topmessage/actions/send-message/send-message.mjs (2)

7-7: Consider aligning action version with package.

If this is the first public release bundled as 0.1.0, bump the action version to match.

-  version: "0.0.1",
+  version: "0.1.0",

69-70: Enrich the summary with response details (id/status) if available.

This improves UX and run logs.

-    $.export("$summary", "Successfully sent the message request");
+    $.export(
+      "$summary",
+      `Message request sent${response?.id ? ` (id: ${response.id})` : ""}`
+    );
components/topmessage/topmessage.app.mjs (2)

35-41: Minor grammar fix and align displayed casing.

Also benefits from label/value options proposed in constants.

-      label: "Channel",
-      description: "The communication channel your message sent through",
+      label: "Channel",
+      description: "The communication channel your message is sent through",

14-17: E.164 hint for recipients (optional).

Adding an example reduces user errors.

-      description: "The recipient's mobile phone number(s) in international format",
+      description: "Recipient mobile phone number(s) in E.164 format (e.g. +14155550123).",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 24f033c and 5e8e0c8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • components/topmessage/actions/send-message/send-message.mjs (1 hunks)
  • components/topmessage/common/constants.mjs (1 hunks)
  • components/topmessage/package.json (2 hunks)
  • components/topmessage/topmessage.app.mjs (1 hunks)
⏰ 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 (3)
components/topmessage/package.json (1)

15-15: LGTM (formatting).

Trailing newline/formatting change is fine.

components/topmessage/actions/send-message/send-message.mjs (1)

6-6: Use correct brand casing for WhatsApp. Documentation URL https://topmessage.com/documentation-api/send-message is confirmed correct.

-  description: "Send messages via Whatsapp or SMS. [See the documentation](https://topmessage.com/documentation-api/send-message)",
+  description: "Send messages via WhatsApp or SMS. [See the documentation](https://topmessage.com/documentation-api/send-message)",
components/topmessage/topmessage.app.mjs (1)

64-65: Verify TopMessage auth schema and header
Ensure the TopMessage app’s authentication schema exposes an api_key field on $this.$auth (and not a differently named token), and confirm the external TopMessage API expects the x-topmessage-key header.

Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

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

LGTM

@vunguyenhung vunguyenhung merged commit e878c02 into master Aug 29, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the issue-18099 branch August 29, 2025 06:25
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] topmessage

4 participants