-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] topmessage #18099 #18214
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds 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
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")
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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: 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.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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 URLhttps://topmessage.com/documentation-api/send-messageis 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.
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.
LGTM
WHY
Summary by CodeRabbit
New Features
Chores