-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] intercom - new components #15292
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 Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request introduces enhancements to the Intercom component library by adding new actions and sources for managing contacts, conversations, messages, and tickets. It includes functionality for adding tags to contacts, sending messages, replying to conversations, and creating a new ticket source. The Intercom application module has been extended with new properties and methods to support these features, and the package version has been incremented to reflect these updates. Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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: 5
🧹 Nitpick comments (4)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs (1)
57-74
: Enhance response handling and add input validation.The success message could be more informative, and input validation should be added.
Consider these improvements:
async run({ $ }) { + if (!contactId?.match(/^[0-9a-fA-F]{24}$/)) { + throw new Error('Invalid contact ID format. Expected a 24-character hexadecimal string.'); + } const response = await addTagToContact({ $, contactId, data: { id: tagId, }, }); - $.export("$summary", `Successfully added tag to contact with ID \`${response.id}\`.`); + $.export("$summary", `Successfully added tag '${response.tag.name}' to contact '${response.contact.name}' (ID: ${response.id}).`); return response; },components/intercom/intercom.app.mjs (3)
32-45
: Consider adding error handling in the options method.The implementation looks good, but consider handling potential API errors to provide a better user experience.
async options() { + try { const { data: tags } = await this.listTags(); return tags.map(({ id: value, name: label, }) => ({ label, value, })); + } catch (error) { + console.error('Failed to fetch tags:', error); + return []; + } },
46-65
: Consider limiting the number of conversations returned.The implementation looks good, but fetching all conversations could be slow for accounts with many conversations. Consider adding a limit parameter.
async options({ data = { query: { field: "source.type", operator: "=", value: "conversation", }, + pagination: { + per_page: 50, // Adjust based on UI requirements + }, }, })
66-85
: Consider using a more maintainable approach for message types.While the implementation is correct, consider using a map object for better maintainability.
-options({ type = "user" }) { - if (type === "user") { - return [ - "comment", - ]; - } - - if (type === "admin") { - return [ - "comment", - "note", - ]; - } - return []; -}, +const MESSAGE_TYPES = { + user: ["comment"], + admin: ["comment", "note"], +}; +options({ type = "user" }) { + return MESSAGE_TYPES[type] || []; +},
📜 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 (6)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs
(1 hunks)components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
(1 hunks)components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
(1 hunks)components/intercom/intercom.app.mjs
(3 hunks)components/intercom/package.json
(1 hunks)components/intercom/sources/new-ticket/new-ticket.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- components/intercom/package.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (3)
components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs (1)
118-123
:⚠️ Potential issueFix incorrect API method name and add request validation.
The code uses
_makeRequest
(private) instead ofmakeRequest
(public) method.Apply this fix:
- return this.intercom._makeRequest({ + return this.intercom.makeRequest({ method: "POST", endpoint: `conversations/${conversationId}/parts`, ...args, });Likely invalid or redundant comment.
components/intercom/intercom.app.mjs (2)
11-19
: LGTM! Well-structured parameter handling.The modification to accept a parameter object with defaults improves flexibility while maintaining backward compatibility.
Line range hint
1-313
: Consider adding integration tests for the new functionality.The new features for managing tags, conversations, and tickets should be covered by integration tests to ensure reliability across Intercom API updates.
Would you like me to help create integration test examples for these new features?
components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
Outdated
Show resolved
Hide resolved
components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
Show resolved
Hide resolved
ea14eff
to
33e9ff4
Compare
33e9ff4
to
b1030aa
Compare
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: 1
🧹 Nitpick comments (3)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs (2)
9-45
: Add input validation for contactId.While the props are well-structured, consider adding validation to ensure the contactId format matches Intercom's expected pattern (e.g.,
63a07ddf05a32042dffac965
).contactId: { type: "string", label: "Contact ID", description: "The unique identifier for the contact which is given by Intercom. Eg. `63a07ddf05a32042dffac965`.", + validate: (value) => { + if (!/^[a-f0-9]{24}$/.test(value)) { + throw new Error("Contact ID must be a 24-character hexadecimal string"); + } + }, propDefinition: [ intercom, "userIds",
57-74
: Enhance success message with tag details.The success message could be more informative by including the tag name along with the ID.
- $.export("$summary", `Successfully added tag to contact with ID \`${response.id}\`.`); + const tag = await this.intercom.getTag(tagId); + $.export("$summary", `Successfully added tag "${tag.name}" to contact with ID \`${response.id}\`.`);components/intercom/intercom.app.mjs (1)
32-45
: Add caching for tag options.The tagId options method makes an API call on every invocation. Consider caching the results to improve performance.
tagId: { type: "string", label: "Tag ID", description: "The unique identifier for the tag which is given by Intercom. Eg. `7522907`.", + _cachedTags: null, + _cacheExpiry: null, async options() { + const CACHE_TTL = 5 * 60 * 1000; // 5 minutes + if (this._cachedTags && this._cacheExpiry > Date.now()) { + return this._cachedTags; + } const { data: tags } = await this.listTags(); - return tags.map(({ + this._cachedTags = tags.map(({ id: value, name: label, }) => ({ label, value, })); + this._cacheExpiry = Date.now() + CACHE_TTL; + return this._cachedTags; }, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs
(1 hunks)components/intercom/actions/create-note/create-note.mjs
(1 hunks)components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
(1 hunks)components/intercom/actions/send-incoming-message/send-incoming-message.mjs
(1 hunks)components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
(1 hunks)components/intercom/actions/upsert-contact/upsert-contact.mjs
(1 hunks)components/intercom/intercom.app.mjs
(3 hunks)components/intercom/package.json
(1 hunks)components/intercom/sources/conversation-closed/conversation-closed.mjs
(1 hunks)components/intercom/sources/lead-added-email/lead-added-email.mjs
(1 hunks)components/intercom/sources/new-admin-reply/new-admin-reply.mjs
(1 hunks)components/intercom/sources/new-company/new-company.mjs
(1 hunks)components/intercom/sources/new-conversation-rating-added/new-conversation-rating-added.mjs
(1 hunks)components/intercom/sources/new-conversation/new-conversation.mjs
(1 hunks)components/intercom/sources/new-event/new-event.mjs
(1 hunks)components/intercom/sources/new-lead/new-lead.mjs
(1 hunks)components/intercom/sources/new-ticket/new-ticket.mjs
(1 hunks)components/intercom/sources/new-topic/new-topic.mjs
(1 hunks)components/intercom/sources/new-unsubscription/new-unsubscription.mjs
(1 hunks)components/intercom/sources/new-user-reply/new-user-reply.mjs
(1 hunks)components/intercom/sources/new-user/new-user.mjs
(1 hunks)components/intercom/sources/tag-added-to-conversation/tag-added-to-conversation.mjs
(1 hunks)components/intercom/sources/tag-added-to-lead/tag-added-to-lead.mjs
(1 hunks)components/intercom/sources/tag-added-to-user/tag-added-to-user.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (18)
- components/intercom/sources/tag-added-to-lead/tag-added-to-lead.mjs
- components/intercom/sources/tag-added-to-conversation/tag-added-to-conversation.mjs
- components/intercom/sources/new-user/new-user.mjs
- components/intercom/actions/create-note/create-note.mjs
- components/intercom/sources/new-unsubscription/new-unsubscription.mjs
- components/intercom/sources/conversation-closed/conversation-closed.mjs
- components/intercom/sources/tag-added-to-user/tag-added-to-user.mjs
- components/intercom/sources/new-company/new-company.mjs
- components/intercom/sources/new-topic/new-topic.mjs
- components/intercom/sources/new-lead/new-lead.mjs
- components/intercom/sources/new-conversation/new-conversation.mjs
- components/intercom/sources/lead-added-email/lead-added-email.mjs
- components/intercom/actions/upsert-contact/upsert-contact.mjs
- components/intercom/sources/new-admin-reply/new-admin-reply.mjs
- components/intercom/sources/new-conversation-rating-added/new-conversation-rating-added.mjs
- components/intercom/sources/new-event/new-event.mjs
- components/intercom/actions/send-incoming-message/send-incoming-message.mjs
- components/intercom/sources/new-user-reply/new-user-reply.mjs
🚧 Files skipped from review as they are similar to previous changes (4)
- components/intercom/package.json
- components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
- components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
- components/intercom/sources/new-ticket/new-ticket.mjs
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (5)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs (1)
3-8
: LGTM! Well-structured component metadata.The component is properly defined with a clear name, description, and version. The documentation link is a nice touch for reference.
components/intercom/intercom.app.mjs (4)
11-19
: LGTM! Improved userIds options method.The options method now accepts a data parameter with query configuration, making it more flexible.
46-85
: LGTM! Well-structured conversation and message type props.The props are well-defined with clear labels, descriptions, and appropriate options.
304-308
: Add method documentation and explicit HTTP method.The implementation should include JSDoc documentation and explicitly specify the HTTP method.
309-311
: Add method documentation and data validation.The implementation should include JSDoc documentation and validate the search data parameter.
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!
ee6a169
to
3dc5f81
Compare
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: 2
🧹 Nitpick comments (4)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs (1)
18-36
: Simplify the contactId query structure.The current query structure can be simplified while maintaining the same functionality.
data: { query: { - operator: "OR", - value: [ - { - field: "role", - operator: "=", - value: "user", - }, - { - field: "role", - operator: "=", - value: "lead", - }, - ], + field: "role", + operator: "IN", + value: ["user", "lead"] }, },components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs (1)
54-113
: Extract constants and add ID validation.Consider extracting magic strings into constants and adding validation for the admin ID format.
+const REPLY_TYPES = { + ADMIN: "admin", + USER: "user", +}; + +const REPLY_ON_BEHALF_OF = { + INTERCOM_USER: "intercom_user_id", + EMAIL: "email", + USER_ID: "user_id", +}; + additionalProps() { const { replyType, replyOnBehalfOf, } = this; - if (replyType === "admin") { + if (replyType === REPLY_TYPES.ADMIN) { return { adminId: { type: "string", label: "Admin ID", description: "The id of the admin who is authoring the comment.", + validate: (value) => { + if (!/^\d+$/.test(value)) { + throw new Error("Admin ID must be a numeric string"); + } + }, }, }; }components/intercom/intercom.app.mjs (2)
11-19
: Add parameter documentation for options method.The options method would benefit from detailed parameter documentation.
+/** + * Get user options for dropdown + * @param {Object} params - The parameters object + * @param {Object} [params.data] - Query parameters for filtering users + * @param {Object} params.data.query - The query object + * @param {string} params.data.query.field - Field to filter on + * @param {string} params.data.query.operator - Comparison operator + * @param {string|string[]} params.data.query.value - Value to compare against + * @returns {Promise<Array<{label: string, value: string}>>} Array of options + */ async options({ data = { query: {
66-85
: Improve messageType options maintainability.Extract message types into constants and use a more maintainable structure.
+const MESSAGE_TYPES = { + USER: { + type: "user", + options: ["comment"], + }, + ADMIN: { + type: "admin", + options: ["comment", "note"], + }, +}; + messageType: { type: "string", label: "Message Type", description: "The kind of message being created.", options({ type = "user" }) { - if (type === "user") { - return [ - "comment", - ]; - } - - if (type === "admin") { - return [ - "comment", - "note", - ]; - } - return []; + return MESSAGE_TYPES[type.toUpperCase()]?.options ?? []; }, },
📜 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 (24)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs
(1 hunks)components/intercom/actions/create-note/create-note.mjs
(1 hunks)components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
(1 hunks)components/intercom/actions/send-incoming-message/send-incoming-message.mjs
(1 hunks)components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
(1 hunks)components/intercom/actions/upsert-contact/upsert-contact.mjs
(1 hunks)components/intercom/intercom.app.mjs
(4 hunks)components/intercom/package.json
(1 hunks)components/intercom/sources/conversation-closed/conversation-closed.mjs
(1 hunks)components/intercom/sources/lead-added-email/lead-added-email.mjs
(1 hunks)components/intercom/sources/new-admin-reply/new-admin-reply.mjs
(1 hunks)components/intercom/sources/new-company/new-company.mjs
(1 hunks)components/intercom/sources/new-conversation-rating-added/new-conversation-rating-added.mjs
(1 hunks)components/intercom/sources/new-conversation/new-conversation.mjs
(1 hunks)components/intercom/sources/new-event/new-event.mjs
(1 hunks)components/intercom/sources/new-lead/new-lead.mjs
(1 hunks)components/intercom/sources/new-ticket/new-ticket.mjs
(1 hunks)components/intercom/sources/new-topic/new-topic.mjs
(1 hunks)components/intercom/sources/new-unsubscription/new-unsubscription.mjs
(1 hunks)components/intercom/sources/new-user-reply/new-user-reply.mjs
(1 hunks)components/intercom/sources/new-user/new-user.mjs
(1 hunks)components/intercom/sources/tag-added-to-conversation/tag-added-to-conversation.mjs
(1 hunks)components/intercom/sources/tag-added-to-lead/tag-added-to-lead.mjs
(1 hunks)components/intercom/sources/tag-added-to-user/tag-added-to-user.mjs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (21)
- components/intercom/sources/tag-added-to-lead/tag-added-to-lead.mjs
- components/intercom/actions/upsert-contact/upsert-contact.mjs
- components/intercom/actions/send-incoming-message/send-incoming-message.mjs
- components/intercom/sources/new-user/new-user.mjs
- components/intercom/sources/tag-added-to-conversation/tag-added-to-conversation.mjs
- components/intercom/sources/new-topic/new-topic.mjs
- components/intercom/actions/create-note/create-note.mjs
- components/intercom/sources/new-conversation-rating-added/new-conversation-rating-added.mjs
- components/intercom/sources/lead-added-email/lead-added-email.mjs
- components/intercom/package.json
- components/intercom/sources/conversation-closed/conversation-closed.mjs
- components/intercom/sources/new-company/new-company.mjs
- components/intercom/sources/new-admin-reply/new-admin-reply.mjs
- components/intercom/sources/new-conversation/new-conversation.mjs
- components/intercom/sources/new-unsubscription/new-unsubscription.mjs
- components/intercom/sources/new-lead/new-lead.mjs
- components/intercom/sources/new-user-reply/new-user-reply.mjs
- components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
- components/intercom/sources/tag-added-to-user/tag-added-to-user.mjs
- components/intercom/sources/new-event/new-event.mjs
- components/intercom/sources/new-ticket/new-ticket.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs (1)
46-56
: Add error handling and method documentation.The
addTagToContact
method should include proper error handling, parameter validation, and documentation.methods: { + /** + * Adds a tag to a contact in Intercom + * @param {Object} params - The parameters object + * @param {string} params.contactId - The contact's ID + * @param {Object} params.args - Additional arguments for the request + * @throws {Error} If contactId is missing or invalid + * @returns {Promise<Object>} The API response + */ addTagToContact({ contactId, ...args } = {}) { + if (!contactId) { + throw new Error("Contact ID is required"); + } + + try { return this.intercom.makeRequest({ method: "POST", endpoint: `contacts/${contactId}/tags`, ...args, }); + } catch (error) { + throw new Error(`Failed to add tag to contact: ${error.message}`); + } }, },components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs (2)
139-152
: Clean up the request payload.Remove undefined values from the request payload.
const response = await replyToConversation({ $, conversationId, data: { body, - attachment_urls: attachmentUrls, - admin_id: adminId, - intercom_user_id: intercomUserId, - email, - user_id: userId, - message_type: messageType, type: replyType, + ...(attachmentUrls?.length && { attachment_urls: attachmentUrls }), + ...(adminId && { admin_id: adminId }), + ...(intercomUserId && { intercom_user_id: intercomUserId }), + ...(email && { email }), + ...(userId && { user_id: userId }), + ...(messageType && { message_type: messageType }), }, });
115-123
: 🛠️ Refactor suggestionUse consistent request method naming.
The method uses
_makeRequest
while other components usemakeRequest
. Maintain consistency across the codebase.replyToConversation({ conversationId, ...args } = {}) { - return this.intercom._makeRequest({ + return this.intercom.makeRequest({ method: "POST", endpoint: `conversations/${conversationId}/parts`, ...args, }); },Likely invalid or redundant comment.
components/intercom/intercom.app.mjs (2)
305-309
: Add method documentation and explicit HTTP method.The implementation should include JSDoc documentation and explicitly specify the HTTP method.
+/** + * Get a list of all tags + * @returns {Promise<Object>} Object containing an array of tags in the data property + */ listTags() { return this.makeRequest({ + method: "GET", endpoint: "tags", }); },
310-312
: Add method documentation and data validation.The implementation should include JSDoc documentation and validate the search data parameter.
+/** + * Search for tickets + * @param {Object} data - A query object used to search for tickets + * @returns {Promise<Array>} List of tickets matching search query + * @throws {Error} If data parameter is missing or invalid + */ async searchTickets(data) { + if (!data || typeof data !== 'object') { + throw new Error('Search data parameter is required and must be an object'); + } return this.paginate("tickets", "POST", data, true); },
components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
Show resolved
Hide resolved
3dc5f81
to
75e9bd8
Compare
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 (2)
components/intercom/intercom.app.mjs (2)
72-91
: Document the messageType options method parameters.The
messageType
options method accepts atype
parameter but lacks documentation about its purpose and allowed values. Additionally, the hardcoded options would benefit from explanatory comments.Apply this diff to improve documentation:
messageType: { type: "string", label: "Message Type", description: "The kind of message being created.", + /** + * Returns available message types based on the sender type + * @param {Object} opts - Options object + * @param {string} [opts.type="user"] - The sender type: "user" or "admin" + * @returns {string[]} Array of available message types + */ options({ type = "user" }) { if (type === "user") { return [ - "comment", + "comment", // Users can only create comments ]; } if (type === "admin") { return [ - "comment", - "note", + "comment", // Admins can create public comments + "note", // Admins can create private notes ]; } return []; }, },
333-338
: Add method documentation for listConversations.The method lacks documentation about its parameters and return value.
Apply this diff to add documentation:
+/** + * List conversations with pagination support + * @param {Object} [args={}] - Additional arguments for the request + * @param {Object} [args.params] - Query parameters + * @param {number} [args.params.per_page] - Number of results per page + * @param {string} [args.params.starting_after] - Cursor for pagination + * @returns {Promise<Object>} Object containing conversations array and pagination info + */ listConversations(args = {}) { return this.makeRequest({ endpoint: "conversations", ...args, }); },
📜 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 (24)
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs
(1 hunks)components/intercom/actions/create-note/create-note.mjs
(1 hunks)components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
(1 hunks)components/intercom/actions/send-incoming-message/send-incoming-message.mjs
(1 hunks)components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
(1 hunks)components/intercom/actions/upsert-contact/upsert-contact.mjs
(1 hunks)components/intercom/intercom.app.mjs
(4 hunks)components/intercom/package.json
(1 hunks)components/intercom/sources/conversation-closed/conversation-closed.mjs
(1 hunks)components/intercom/sources/lead-added-email/lead-added-email.mjs
(1 hunks)components/intercom/sources/new-admin-reply/new-admin-reply.mjs
(1 hunks)components/intercom/sources/new-company/new-company.mjs
(1 hunks)components/intercom/sources/new-conversation-rating-added/new-conversation-rating-added.mjs
(1 hunks)components/intercom/sources/new-conversation/new-conversation.mjs
(1 hunks)components/intercom/sources/new-event/new-event.mjs
(1 hunks)components/intercom/sources/new-lead/new-lead.mjs
(1 hunks)components/intercom/sources/new-ticket/new-ticket.mjs
(1 hunks)components/intercom/sources/new-topic/new-topic.mjs
(1 hunks)components/intercom/sources/new-unsubscription/new-unsubscription.mjs
(1 hunks)components/intercom/sources/new-user-reply/new-user-reply.mjs
(1 hunks)components/intercom/sources/new-user/new-user.mjs
(1 hunks)components/intercom/sources/tag-added-to-conversation/tag-added-to-conversation.mjs
(1 hunks)components/intercom/sources/tag-added-to-lead/tag-added-to-lead.mjs
(1 hunks)components/intercom/sources/tag-added-to-user/tag-added-to-user.mjs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (21)
- components/intercom/package.json
- components/intercom/actions/create-note/create-note.mjs
- components/intercom/sources/tag-added-to-conversation/tag-added-to-conversation.mjs
- components/intercom/sources/tag-added-to-user/tag-added-to-user.mjs
- components/intercom/actions/send-incoming-message/send-incoming-message.mjs
- components/intercom/sources/conversation-closed/conversation-closed.mjs
- components/intercom/sources/new-admin-reply/new-admin-reply.mjs
- components/intercom/sources/new-unsubscription/new-unsubscription.mjs
- components/intercom/sources/new-conversation/new-conversation.mjs
- components/intercom/sources/tag-added-to-lead/tag-added-to-lead.mjs
- components/intercom/sources/new-event/new-event.mjs
- components/intercom/sources/new-lead/new-lead.mjs
- components/intercom/sources/new-topic/new-topic.mjs
- components/intercom/sources/lead-added-email/lead-added-email.mjs
- components/intercom/sources/new-user-reply/new-user-reply.mjs
- components/intercom/sources/new-company/new-company.mjs
- components/intercom/sources/new-user/new-user.mjs
- components/intercom/sources/new-conversation-rating-added/new-conversation-rating-added.mjs
- components/intercom/actions/upsert-contact/upsert-contact.mjs
- components/intercom/actions/send-message-to-contact/send-message-to-contact.mjs
- components/intercom/actions/reply-to-conversation/reply-to-conversation.mjs
⏰ 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 (5)
components/intercom/sources/new-ticket/new-ticket.mjs (1)
23-48
: Add error handling and pagination support to therun
method.The current implementation has several potential issues:
- Missing try-catch block for error handling
- No pagination handling for the searchTickets API
- Potential race condition with lastTicketCreatedAt updates
components/intercom/actions/add-tag-to-contact/add-tag-to-contact.mjs (2)
46-56
: Add error handling and parameter validation.The
addTagToContact
method should include error handling and parameter validation.
57-74
: Add error handling in the run function.The run function should include try-catch block and provide more detailed success message.
components/intercom/intercom.app.mjs (2)
325-329
: Add method documentation and explicit HTTP method.The implementation should include JSDoc documentation and explicitly specify the HTTP method.
330-332
: Add method documentation and data validation.The implementation should include JSDoc documentation and validate the search data parameter.
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
Resolves #15250
Summary by CodeRabbit
New Features
Improvements
Technical Updates