-
Notifications
You must be signed in to change notification settings - Fork 5.5k
17425 belco #17580
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
17425 belco #17580
Conversation
WalkthroughThis update introduces a new Belco integration, including comprehensive documentation, source polling for new conversations, and a suite of actions for conversation management (listing, creating, sending messages, retrieving, closing, reopening, replying, and adding notes). It also includes dynamic property definitions, constants for option lists, and package metadata adjustments. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BelcoApp
participant BelcoAPI
User->>BelcoApp: Trigger Action (e.g., Create Conversation)
BelcoApp->>BelcoAPI: API Request (e.g., POST /conversations)
BelcoAPI-->>BelcoApp: API Response (Conversation Data)
BelcoApp-->>User: Action Result (Summary, Data)
sequenceDiagram
participant Timer
participant NewConversationSource
participant BelcoAPI
Timer->>NewConversationSource: Poll Trigger
NewConversationSource->>BelcoAPI: GET /conversations (with pagination)
BelcoAPI-->>NewConversationSource: List of Conversations
NewConversationSource-->>Timer: Emit New Conversation Events
Assessment against linked issues
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/belco/actions/close-conversation/close-conversation.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/belco/actions/add-note-to-conversation/add-note-to-conversation.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/belco/actions/list-all-conversations/list-all-conversations.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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 (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
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 (4)
components/belco/sources/new-conversation/test-event.mjs (1)
2-39: Consider using diverse IDs for more realistic test data.All entities in this test event use the same ID value (
"6EwvPh2xajPmR2otP"). While this works for testing, using different IDs for different entities (conversation, messages, customer, shop, etc.) would make the test data more realistic and help catch potential ID-related bugs in the integration.Consider updating the test event with diverse IDs:
export default { - "_id": "6EwvPh2xajPmR2otP", + "_id": "conv_6EwvPh2xajPmR2otP", "createdAt": "2025-07-10T16:33:32.644Z", "lastItem": { "reference": { - "_id": "6EwvPh2xajPmR2otP", + "_id": "user_ABC123XYZ", "type": "user" }, - "_id": "6EwvPh2xajPmR2otP", + "_id": "msg_DEF456UVW", "type": "message", "body": "Body message", "via": "web" }, // ... similar updates for other entities - "customerId": "6EwvPh2xajPmR2otP", + "customerId": "cust_GHI789RST", // ... - "shopId": "6EwvPh2xajPmR2otP", + "shopId": "shop_JKL012MNO", // ... - "assignedTo": "6EwvPh2xajPmR2otP", + "assignedTo": "agent_PQR345STU",components/belco/actions/send-message/send-message.mjs (1)
92-92: Consider improving the summary message.The summary message could be more informative by including additional context about the message sent, such as the channel or recipient.
Consider enhancing the summary:
- $.export("$summary", `Sent message successfully: ${this.subject || "No subject"}`); + $.export("$summary", `Successfully sent message via ${this.channel}${this.subject ? `: ${this.subject}` : ""}`);components/belco/sources/new-conversation/new-conversation.mjs (1)
44-44: Remove debug console.log statement.The console.log statement appears to be debug code that should be removed before production deployment.
- console.log("responseArray: ", responseArray);components/belco/actions/add-note-to-conversation/add-note-to-conversation.mjs (1)
17-21: Enhance the body field description for better user guidance.Consider providing a more descriptive label and description to help users understand what kind of notes are appropriate.
body: { type: "string", label: "Body", - description: "The note body", + description: "The content of the note to add to the conversation. This is an internal note visible only to your team.", },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
components/belco/README.md(1 hunks)components/belco/actions/add-note-to-conversation/add-note-to-conversation.mjs(1 hunks)components/belco/actions/close-conversation/close-conversation.mjs(1 hunks)components/belco/actions/create-conversation/create-conversation.mjs(1 hunks)components/belco/actions/list-all-conversations/list-all-conversations.mjs(1 hunks)components/belco/actions/reopen-conversation/reopen-conversation.mjs(1 hunks)components/belco/actions/reply-to-conversation/reply-to-conversation.mjs(1 hunks)components/belco/actions/retrieve-conversation/retrieve-conversation.mjs(1 hunks)components/belco/actions/send-message/send-message.mjs(1 hunks)components/belco/belco.app.mjs(1 hunks)components/belco/common/constants.mjs(1 hunks)components/belco/package.json(2 hunks)components/belco/sources/new-conversation/new-conversation.mjs(1 hunks)components/belco/sources/new-conversation/test-event.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
components/belco/package.json (2)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#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.
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: "dir" props in Pipedream components are hidden in the component form and not user-facing, so they don't require labels or descriptions for user clarity.
components/belco/sources/new-conversation/test-event.mjs (1)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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.
components/belco/actions/list-all-conversations/list-all-conversations.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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/belco/actions/send-message/send-message.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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`.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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`.
components/belco/sources/new-conversation/new-conversation.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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.
components/belco/actions/reply-to-conversation/reply-to-conversation.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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/belco/actions/create-conversation/create-conversation.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
components/belco/belco.app.mjs (1)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
⏰ 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: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
🔇 Additional comments (12)
components/belco/package.json (2)
3-3: Semantic version bump looks goodThe move to
0.1.0is a sensible first-release increment and will publish without breaking any existing downstream references (none yet).
15-17: Double-check the@pipedream/platformrangeAdding the runtime dependency is required 👍.
Two minor points to verify before publishing:
^3.1.0will auto-upgrade to any future3.x. If a breaking change slips into3.y.z, all Belco components will pick it up automatically. Consider pinning to the exact patch or using~3.1.0to stay on the 3.1 line until you intentionally upgrade.- Confirm every new action/source actually imports
@pipedream/platform; otherwise the dependency is unnecessary bloat.No functional blockers, just a quick sanity check.
components/belco/actions/reopen-conversation/reopen-conversation.mjs (1)
1-32: Well-structured action implementation.The action follows Pipedream best practices with proper prop definitions, status filtering for closed conversations, and clear summary export. The implementation is clean and correct.
components/belco/README.md (1)
1-60: Comprehensive and well-structured documentation.The README provides excellent coverage of all integration components with clear descriptions, required/optional properties, and proper API documentation links. The documentation follows good practices and will be helpful for users.
components/belco/actions/list-all-conversations/list-all-conversations.mjs (1)
1-42: Well-implemented list action with proper pagination.The action follows best practices with proper parameter validation, sensible defaults, and correctly formatted summary export using the response data length. The implementation is clean and follows established patterns.
components/belco/common/constants.mjs (1)
1-50: Well-structured constants file with consistent naming conventions.The constants are well-organized with clear purposes. The option arrays follow a consistent structure with
labelandvalueproperties, and the kebab-case values are appropriate for API usage.components/belco/sources/new-conversation/new-conversation.mjs (1)
28-60: Well-implemented polling logic with proper state management.The emitEvent method correctly handles pagination, filtering, and state persistence. The approach of sorting conversations by creation date and emitting in reverse order ensures proper chronological event ordering.
components/belco/actions/close-conversation/close-conversation.mjs (1)
1-32: Clean action implementation with proper filtering.The action correctly excludes already closed conversations from the conversation ID dropdown, which provides a good user experience by preventing invalid operations.
components/belco/actions/retrieve-conversation/retrieve-conversation.mjs (1)
1-27: Straightforward implementation following standard patterns.The action correctly uses prop definitions and follows the expected structure for retrieve operations with proper summary messaging.
components/belco/actions/reply-to-conversation/reply-to-conversation.mjs (1)
1-35: Proper implementation of conversation reply functionality.The action correctly structures the request data and uses appropriate prop definitions. The body parameter is properly typed and the API call structure follows expected patterns.
components/belco/actions/create-conversation/create-conversation.mjs (1)
83-86: Verify the hardcoded recipient type.The
toobject has a hardcodedtype: "contact"while thefromobject uses a dynamic type. Please confirm if recipients are always contacts in the Belco system, or if this should be configurable.components/belco/belco.app.mjs (1)
142-150: Error handling is covered by the Pipedream axios wrapper—no changes neededThe
_makeRequestimplementation incomponents/belco/belco.app.mjsfollows the same pattern used by other components (e.g. pretix, xendit, timetonic), which also returnaxios($, …)directly. Errors thrown by the wrapper will bubble up into the Pipedream runtime and surface with meaningful messages.No additional
try/catchblocks are required here.
GTFalcao
left a comment
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! Although I don't think that README is supposed to be there
|
/approve |
Resolves #17425
Summary by CodeRabbit
New Features
Documentation
Chores