Skip to content

New Components - waboxapp #16715

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

Merged
merged 1 commit into from
May 20, 2025
Merged

New Components - waboxapp #16715

merged 1 commit into from
May 20, 2025

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented May 19, 2025

Resolves #15131

Summary by CodeRabbit

  • New Features
    • Added ability to send text messages, images, links (with preview), and media files via WhatsApp to specified phone numbers using the Waboxapp integration.
  • Chores
    • Updated the Waboxapp integration version to 0.7.0.

Copy link

vercel bot commented May 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) May 19, 2025 8:47pm
pipedream-docs ⬜️ Ignored (Inspect) May 19, 2025 8:47pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) May 19, 2025 8:47pm

Copy link
Contributor

coderabbitai bot commented May 19, 2025

Walkthrough

This update introduces four new action modules for the waboxapp integration: sending text messages, images, links, and media files via WhatsApp. It also adds comprehensive property definitions and API methods to the waboxapp app module, centralizing HTTP request handling and supporting the new actions. The package version is incremented.

Changes

File(s) Change Summary
components/waboxapp/actions/send-text-message/send-text-message.mjs Added new action: send WhatsApp text message to a specified phone number with required and optional parameters.
components/waboxapp/actions/send-image/send-image.mjs Added new action: send an image via WhatsApp to a specified phone number, supporting optional caption and description.
components/waboxapp/actions/send-link/send-link.mjs Added new action: send a link with preview via WhatsApp, supporting optional caption, description, and thumbnail.
components/waboxapp/actions/send-media/send-media.mjs Added new action: send any file via WhatsApp, supporting optional caption, description, and thumbnail.
components/waboxapp/waboxapp.app.mjs Added axios import, defined propDefinitions for all action parameters, implemented methods for sending messages, images, links, and media, and centralized request logic with authentication.
components/waboxapp/package.json Incremented package version from 0.6.0 to 0.7.0.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ActionModule
    participant WaboxappApp
    participant WaboxappAPI

    User->>ActionModule: Trigger action (e.g., send image)
    ActionModule->>WaboxappApp: Call sendX method with parameters
    WaboxappApp->>WaboxappAPI: POST request to /api/sendX endpoint
    WaboxappAPI-->>WaboxappApp: API response
    WaboxappApp-->>ActionModule: Return response
    ActionModule-->>User: Export summary and result
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement send-text-message action with uid, to, custom_uid, and text (#15131)
Implement send-image action with uid, to, custom_uid, url, optional caption, description (#15131)
Implement send-link action with uid, to, custom_uid, url, optional caption, description, url_thumb (#15131)
Implement send-media action with uid, to, custom_uid, url, optional caption, description, url_thumb (#15131)

Poem

A rabbit hops with code anew,
Sending files and links right through,
Images, texts, and media too—
WhatsApp messages, just for you!
With every hop, the actions grow,
Waboxapp’s magic starts to show.
🐇✨

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/waboxapp/actions/send-image/send-image.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:163:49)

components/waboxapp/actions/send-link/send-link.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:163:49)

components/waboxapp/actions/send-media/send-media.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:163:49)

  • 2 others

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

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

🧹 Nitpick comments (3)
components/waboxapp/actions/send-media/send-media.mjs (1)

29-36: Consider adding URL validation

The URL property should be validated to ensure it's a valid file URL before making the API request.

url: {
  propDefinition: [
    waboxapp,
    "url",
  ],
  label: "File URL",
  description: "URL of the file to send",
+  validate: (value) => {
+    try {
+      new URL(value);
+      return true;
+    } catch (error) {
+      return "Please enter a valid URL";
+    }
+  },
},
components/waboxapp/waboxapp.app.mjs (2)

65-92: API methods look good, consider adding input validation

The API methods are well-structured for sending different types of WhatsApp messages. Consider validating input parameters before making API requests.

For example, for the sendMedia method:

sendMedia(opts = {}) {
+  const { data } = opts;
+  
+  // Validate required fields
+  if (data) {
+    if (!data.uid) throw new Error("UID is required");
+    if (!data.to) throw new Error("Recipient number is required");
+    if (!data.url) throw new Error("File URL is required");
+    
+    // Validate URL format
+    try {
+      new URL(data.url);
+      if (data.url_thumb) new URL(data.url_thumb);
+    } catch (error) {
+      throw new Error("Invalid URL format");
+    }
+  }
+  
  return this._makeRequest({
    method: "POST",
    path: "/send/media",
    ...opts,
  });
},

22-26: Add URL validation to the url definition

Since this property is used for URL values, consider adding a regex pattern to validate that it's a properly formatted URL.

url: {
  type: "string",
  label: "URL",
  description: "URL of the content to send",
+  pattern: "^https?://.*$",
+  patternError: "Please enter a valid URL starting with http:// or https://",
},
📜 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 cb64910 and d40cc61.

📒 Files selected for processing (6)
  • components/waboxapp/actions/send-image/send-image.mjs (1 hunks)
  • components/waboxapp/actions/send-link/send-link.mjs (1 hunks)
  • components/waboxapp/actions/send-media/send-media.mjs (1 hunks)
  • components/waboxapp/actions/send-text-message/send-text-message.mjs (1 hunks)
  • components/waboxapp/package.json (1 hunks)
  • components/waboxapp/waboxapp.app.mjs (1 hunks)
⏰ 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 (9)
components/waboxapp/package.json (1)

3-3: Version bump accurately reflects new functionality

The version increment from 0.6.0 to 0.7.0 follows semantic versioning principles correctly for the addition of new messaging action components.

components/waboxapp/actions/send-text-message/send-text-message.mjs (2)

3-49: Component structure looks good

The component definition, props, and documentation link are well organized. The component reuses prop definitions from the waboxapp app module which promotes consistency.


35-48: Implementation looks correct

The run method correctly passes all the necessary parameters to the waboxapp app's sendMessage method and provides a clear success message.

components/waboxapp/actions/send-image/send-image.mjs (2)

3-49: Component definition and props are well-structured

The component follows the established pattern with appropriate properties for sending an image, including URL, caption, and description options.


50-65: Implementation correctly handles image sending

The run method properly constructs the request payload and calls the sendImage method with all required parameters. The success message is clear and helpful.

components/waboxapp/actions/send-link/send-link.mjs (2)

3-55: Component structure and properties are appropriate

The component definition includes all necessary properties for sending a link with preview capabilities, including the thumbnail URL option.


56-72: Implementation properly handles link sending with preview

The run method correctly transforms component properties to the API's expected format, particularly handling the thumbnail URL property conversion to url_thumb parameter.

components/waboxapp/actions/send-media/send-media.mjs (1)

3-73: Well-structured component with good documentation

The Send Media action is implemented following Pipedream's component structure best practices with clear property definitions and documentation links.

components/waboxapp/waboxapp.app.mjs (1)

6-45: Well-structured property definitions

The property definitions are comprehensive with clear labels, descriptions, and type information. Good job marking optional properties appropriately.

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @michelle0927 lgtm! Ready for QA!

@michelle0927 michelle0927 merged commit ab2aa4f into master May 20, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-15131 branch May 20, 2025 14:45
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] waboxapp
2 participants