-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
base: master
Are you sure you want to change the base?
Trengo new components #17792
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis 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
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
sequenceDiagram
participant TrengoWebhook
participant TicketClosedSource
participant System
TrengoWebhook->>TicketClosedSource: Ticket closed event payload
TicketClosedSource->>System: Emit event with metadata (id, ts, summary)
sequenceDiagram
participant TrengoWebhook
participant TicketReopenedSource
participant System
TrengoWebhook->>TicketReopenedSource: Ticket reopened event payload
TicketReopenedSource->>System: Emit event with metadata (id, ts, summary)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Suggested labels
Poem
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
components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ 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)
✨ 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. 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)
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: 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 showsuntranslated_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
⛔ 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
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
Chores