Skip to content

Trengo new components #17792

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Trengo new components #17792

wants to merge 6 commits into from

Conversation

GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented Jul 24, 2025

Closes #17434

Note: the majority of requested components in the original ticket do not make sense (likely AI-generated), I've searched considerably within the application and API, and added some components that make sense within the app's context.

Summary by CodeRabbit

  • New Features

    • Added an action to list articles from a selected help center with filtering options.
    • Introduced instant event triggers for when a ticket is closed or reopened in Trengo.
    • Enabled dynamic selection of tickets and help centers when configuring actions and triggers.
  • Chores

    • Updated the Trengo integration package version to 0.2.0.
    • Incremented version numbers for multiple Trengo actions and sources to improve stability and maintenance.
    • Corrected a typo in the WhatsApp message template action error message.

Copy link

vercel bot commented Jul 24, 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 Jul 24, 2025 10:13pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 24, 2025 10:13pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 24, 2025 10:13pm

Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

Walkthrough

This update introduces new Trengo integration features, including two instant event sources for ticket closure and reopening, and an action to list help center articles. The Trengo app module is extended with dynamic property loading and new API methods for tickets, help centers, and articles. The package version is incremented.

Changes

File(s) Change Summary
components/trengo/actions/list-articles/list-articles.mjs Added new "List Articles" action module for Trengo to fetch articles from a help center.
components/trengo/sources/ticket-closed/ticket-closed.mjs,
components/trengo/sources/ticket-reopened/ticket-reopened.mjs
Added two new instant event source modules for ticket closed and ticket reopened events in Trengo.
components/trengo/trengo.app.mjs Enhanced with dynamic ticket/help center selection, and new API methods for tickets, help centers, and articles.
components/trengo/package.json Updated package version from 0.1.0 to 0.2.0.
components/trengo/actions/create-contact/create-contact.mjs,
components/trengo/actions/find-contacts/find-contacts.mjs,
components/trengo/actions/log-a-voice-call/log-a-voice-call.mjs,
components/trengo/actions/send-a-message/send-a-message.mjs,
components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs,
components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs,
components/trengo/sources/new-inbound-message/new-inbound-message.mjs,
components/trengo/sources/new-internal-note/new-internal-note.mjs,
components/trengo/sources/new-outbound-message/new-outbound-message.mjs,
components/trengo/sources/phone-call-ended/phone-call-ended.mjs,
components/trengo/sources/phone-call-missed/phone-call-missed.mjs,
components/trengo/sources/phone-call-started/phone-call-started.mjs,
components/trengo/sources/ticket-label-added/ticket-label-added.mjs,
components/trengo/sources/voice-call-recorded/voice-call-recorded.mjs
Version increments only (mostly from 0.0.1/0.0.2 to 0.0.2/0.0.3) without functional changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ListArticlesAction
    participant TrengoApp
    participant TrengoAPI

    User->>ListArticlesAction: Trigger "List Articles" action
    ListArticlesAction->>TrengoApp: getArticles(helpCenterId, filters, etc.)
    TrengoApp->>TrengoAPI: GET /help_center/{helpCenterId}/articles
    TrengoAPI-->>TrengoApp: Return articles list
    TrengoApp-->>ListArticlesAction: Return articles
    ListArticlesAction-->>User: Return articles array
Loading
sequenceDiagram
    participant TrengoWebhook
    participant TicketClosedSource
    participant System

    TrengoWebhook->>TicketClosedSource: Ticket closed event payload
    TicketClosedSource->>System: Emit event with metadata (id, ts, summary)
Loading
sequenceDiagram
    participant TrengoWebhook
    participant TicketReopenedSource
    participant System

    TrengoWebhook->>TicketReopenedSource: Ticket reopened event payload
    TicketReopenedSource->>System: Emit event with metadata (id, ts, summary)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Suggested labels

User submitted

Poem

In burrows deep, new features grow,
Trengo’s tickets now come and go!
Articles listed with a hop and a skip,
Dynamic choices at your rabbit’s fingertip.
Version bumped, events anew—
A carrot’s cheer for all we do! 🥕

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/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.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:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 65de8ba and a59ff37.

📒 Files selected for processing (1)
  • components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.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). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 17434-trengo

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 generate unit tests to generate unit tests for 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: 0

🧹 Nitpick comments (1)
components/trengo/actions/list-articles/list-articles.mjs (1)

25-34: Consider clarifying the filter options documentation.

The description mentions untranslated_<language_code> format but only shows untranslated_en as an option. Consider adding more examples or clarifying that users can specify other language codes manually.

-      description: "The article's filter. You can choose one of the available options, specify `untranslated_<language_code>` for other language codes, or leave empty for all articles",
+      description: "The article's filter. You can choose one of the available options, specify `untranslated_<language_code>` (e.g., untranslated_es, untranslated_fr) for other language codes, or leave empty for all articles",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d9ea0d2 and 387864b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • components/trengo/actions/list-articles/list-articles.mjs (1 hunks)
  • components/trengo/package.json (1 hunks)
  • components/trengo/sources/ticket-closed/ticket-closed.mjs (1 hunks)
  • components/trengo/sources/ticket-reopened/ticket-reopened.mjs (1 hunks)
  • components/trengo/trengo.app.mjs (3 hunks)
🧰 Additional context used
🧠 Learnings (4)
components/trengo/package.json (1)

Learnt from: jcortes
PR: #14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like fs to package.json dependencies, as they are native modules provided by the Node.js runtime.

components/trengo/sources/ticket-reopened/ticket-reopened.mjs (4)

Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs, when processing items in getAndProcessData, savedIds is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.

Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

components/trengo/actions/list-articles/list-articles.mjs (2)

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

components/trengo/sources/ticket-closed/ticket-closed.mjs (4)

Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs, when processing items in getAndProcessData, savedIds is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.

Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

🧬 Code Graph Analysis (2)
components/trengo/sources/ticket-reopened/ticket-reopened.mjs (1)
components/trengo/sources/ticket-closed/ticket-closed.mjs (3)
  • ts (14-14)
  • id (15-17)
  • summary (18-18)
components/trengo/sources/ticket-closed/ticket-closed.mjs (1)
components/trengo/sources/ticket-reopened/ticket-reopened.mjs (3)
  • ts (14-14)
  • id (15-17)
  • summary (18-18)
⏰ 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 (7)
components/trengo/package.json (1)

3-3: LGTM! Appropriate version bump for new features.

The version increment from 0.1.0 to 0.2.0 correctly follows semantic versioning for the addition of new source components and actions.

components/trengo/sources/ticket-closed/ticket-closed.mjs (1)

1-29: LGTM! Well-implemented instant source component.

The implementation follows Pipedream best practices:

  • Proper component metadata and structure
  • Correct use of optional chaining and fallback logic in getMeta
  • Appropriate event type constant in getEvent
  • Consistent with the complementary ticket-reopened source
  • Source name correctly omits "New" prefix since this emits state-change events rather than new item events
components/trengo/sources/ticket-reopened/ticket-reopened.mjs (1)

1-29: LGTM! Consistent implementation with ticket-closed source.

The implementation correctly mirrors the ticket-closed source with appropriate variations:

  • Proper component metadata for reopened events
  • Consistent getMeta logic with safe property access and fallbacks
  • Correct event type constant TICKET_REOPENED
  • Maintains same structure and error handling patterns
components/trengo/actions/list-articles/list-articles.mjs (1)

43-64: LGTM! Well-implemented action with proper pagination and summary.

The implementation follows best practices:

  • Correct use of streaming utility for pagination
  • Proper summary message formatting with singular/plural handling
  • Clean data collection and return structure
  • Good error handling through the streaming utility
components/trengo/trengo.app.mjs (3)

71-84: LGTM! Improved ticketId property with dynamic options.

The changes enhance the user experience:

  • Type change to integer is appropriate for ticket IDs
  • Dynamic options with descriptive labels (#ID - Subject)
  • Proper fallback handling for tickets without subjects
  • Consistent with other option-enabled properties in the app

160-175: LGTM! Well-implemented helpCenterId property.

The new property follows established patterns:

  • Consistent structure with other dynamic option properties
  • Good fallback logic using name or slug for labels
  • Proper integration with the new getHelpCenters method

271-290: LGTM! Clean API method implementations.

The new methods are well-structured:

  • Consistent with existing _makeRequest usage patterns
  • Proper parameter handling in getArticles with destructuring
  • REST-compliant endpoint paths
  • Good separation of concerns for different resource types

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.

Trengo
2 participants