-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Zoho desk comps #19486
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
Zoho desk comps #19486
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
|
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
WalkthroughAdds four Zoho Desk actions (get ticket/thread details, list ticket threads, list ticket attachments), exposes new app methods for ticket/thread retrieval, and bumps the Zoho Desk component package version. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (3 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. 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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
components/zoho_desk/actions/get-thread-details/get-thread-details.mjs(1 hunks)components/zoho_desk/actions/get-ticket-details/get-ticket-details.mjs(1 hunks)components/zoho_desk/actions/list-ticket-attachments/list-ticket-attachments.mjs(1 hunks)components/zoho_desk/actions/list-ticket-threads/list-ticket-threads.mjs(1 hunks)components/zoho_desk/package.json(1 hunks)components/zoho_desk/zoho_desk.app.mjs(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
components/zoho_desk/actions/get-ticket-details/get-ticket-details.mjs (1)
components/zoho_desk/actions/list-ticket-attachments/list-ticket-attachments.mjs (1)
response(38-44)
components/zoho_desk/actions/get-thread-details/get-thread-details.mjs (1)
components/zoho_desk/actions/list-ticket-threads/list-ticket-threads.mjs (1)
response(56-63)
components/zoho_desk/actions/list-ticket-threads/list-ticket-threads.mjs (1)
components/zoho_desk/zoho_desk.app.mjs (3)
from(606-606)from(869-869)threads(114-124)
components/zoho_desk/zoho_desk.app.mjs (2)
components/zoho_desk/actions/list-ticket-threads/list-ticket-threads.mjs (1)
threads(65-65)components/zoho_desk/actions/list-ticket-attachments/list-ticket-attachments.mjs (1)
attachments(46-46)
⏰ 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: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
🔇 Additional comments (8)
components/zoho_desk/package.json (1)
3-3: LGTM!The version bump appropriately reflects the addition of new Zoho Desk actions in this PR.
components/zoho_desk/actions/get-ticket-details/get-ticket-details.mjs (1)
1-51: LGTM!The action is well-structured and follows Pipedream conventions. The prop wiring correctly propagates
orgIdto theticketIdprop definition, and the run method properly extracts parameters and calls the underlying API method.components/zoho_desk/actions/list-ticket-attachments/list-ticket-attachments.mjs (1)
1-52: LGTM!The action follows the established pattern and correctly returns an array of attachments with an informative summary message.
components/zoho_desk/zoho_desk.app.mjs (3)
100-141: LGTM!The
threadIdpropDefinition is well-implemented with proper validation, pagination support, and option mapping. The early return whenticketIdis not provided prevents unnecessary API calls.
781-788: LGTM!The
getTicketDetailsmethod follows the established pattern and correctly constructs the API endpoint path.
797-804: LGTM!The
getThreadDetailsmethod is correctly implemented and follows the consistent pattern used throughout the app module.components/zoho_desk/actions/list-ticket-threads/list-ticket-threads.mjs (1)
1-70: LGTM!The action is well-implemented with optional pagination support. The conditional param building (lines 52-54) ensures clean API calls without undefined values.
components/zoho_desk/actions/get-thread-details/get-thread-details.mjs (1)
1-64: LGTM!The action correctly chains prop dependencies (orgId → ticketId → threadId) to ensure thread options are loaded with the appropriate context. The implementation is consistent with the other actions in this PR.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs (1)
26-54: Consider adding JSDoc documentation to methods.Per the Pipedream component development guidelines, methods should be documented with JSDoc comments. This would improve maintainability and provide clearer intent for each method.
Example JSDoc format:
methods: { ...common.methods, + /** + * Get the resource fetch function for polling tickets. + * @returns {Function} The searchTickets method + */ getResourceFn() { return this.zohoDesk.searchTickets; }, + /** + * Build arguments for the resource fetch function. + * @returns {Object} Headers and params for the search query + */ getResourceFnArgs() { return { headers: { orgId: this.orgId, }, params: { sortBy: "modifiedTime", status: this.status, }, }; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (30)
components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs(1 hunks)components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs(1 hunks)components/zoho_desk/actions/create-account/create-account.mjs(1 hunks)components/zoho_desk/actions/create-contact/create-contact.mjs(1 hunks)components/zoho_desk/actions/create-ticket/create-ticket.mjs(1 hunks)components/zoho_desk/actions/find-contact/find-contact.mjs(1 hunks)components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs(1 hunks)components/zoho_desk/actions/get-article/get-article.mjs(1 hunks)components/zoho_desk/actions/list-articles/list-articles.mjs(1 hunks)components/zoho_desk/actions/list-help-centers/list-help-centers.mjs(1 hunks)components/zoho_desk/actions/list-root-categories/list-root-categories.mjs(1 hunks)components/zoho_desk/actions/list-tickets/list-tickets.mjs(1 hunks)components/zoho_desk/actions/search-articles/search-articles.mjs(1 hunks)components/zoho_desk/actions/search-ticket/search-ticket.mjs(1 hunks)components/zoho_desk/actions/send-email-reply/send-email-reply.mjs(1 hunks)components/zoho_desk/actions/update-contact/update-contact.mjs(1 hunks)components/zoho_desk/actions/update-ticket/update-ticket.mjs(1 hunks)components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs(1 hunks)components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs(1 hunks)components/zoho_desk/sources/new-account/new-account.mjs(1 hunks)components/zoho_desk/sources/new-agent/new-agent.mjs(1 hunks)components/zoho_desk/sources/new-article-instant/new-article-instant.mjs(1 hunks)components/zoho_desk/sources/new-contact/new-contact.mjs(1 hunks)components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs(1 hunks)components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs(1 hunks)components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs(1 hunks)components/zoho_desk/sources/new-ticket/new-ticket.mjs(1 hunks)components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs(1 hunks)components/zoho_desk/sources/updated-ticket/updated-ticket.mjs(1 hunks)components/zoho_desk/zoho_desk.app.mjs(3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 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".
Applied to files:
components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjscomponents/zoho_desk/actions/create-contact/create-contact.mjscomponents/zoho_desk/actions/create-account/create-account.mjs
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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.
Applied to files:
components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs
📚 Learning: 2025-01-23T03:55:15.166Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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.
Applied to files:
components/zoho_desk/sources/updated-ticket/updated-ticket.mjs
🧬 Code graph analysis (1)
components/zoho_desk/zoho_desk.app.mjs (1)
components/zoho_desk/actions/list-ticket-threads/list-ticket-threads.mjs (1)
threads(65-65)
⏰ 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 (31)
components/zoho_desk/actions/list-help-centers/list-help-centers.mjs (1)
8-8: Version bump is appropriate.The metadata-only version change from 0.0.3 to 0.0.4 aligns with the release cycle for this Zoho Desk component update. No runtime behavior changes. Action structure follows Pipedream conventions: proper naming convention, app instance pattern, documentation link, appropriate annotation hints, and user-friendly summary generation.
components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs (1)
9-9: Version bump is appropriate.The version increment from 0.0.8 to 0.0.9 aligns with the package-level version bump to 0.3.4 and the addition of new Zoho Desk actions in this PR.
components/zoho_desk/sources/new-article-instant/new-article-instant.mjs (1)
10-10: LGTM!Version bump aligns with the package version update.
components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs (1)
10-10: LGTM!Version bump aligns with the package version update.
components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs (1)
10-10: Version bump is consistent with coordinated package release.The version bump to 0.0.5 aligns with the PR's overall strategy of version bumps across Zoho Desk sources and the package version update to 0.3.4 mentioned in the summary. This is standard practice for coordinated releases.
Please confirm that this version bump is justified by the package-level changes (new actions, API methods, etc.) and that all affected Zoho Desk sources have been updated consistently.
components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs (1)
44-44: No action needed. ThegetTicketThreadsmethod is properly defined incomponents/zoho_desk/zoho_desk.app.mjsat line 727, confirming the method reference on line 44 ofnew-ticket-message.mjsis valid.components/zoho_desk/actions/get-article/get-article.mjs (1)
8-8: Version bump is appropriate; verify alignment with PR scope.The version change from
0.0.4aligns with the package version bump (0.3.3 → 0.3.4) mentioned in the PR context. However, I can only review this single file, whereas the PR objectives indicate four new actions and app.mjs modifications were added.Please confirm that:
- All four new action files (
get-ticket-details,list-ticket-threads,list-ticket-attachments,get-thread-details) follow the same patterns as this file and adhere to the Pipedream component guidelines (JSDoc documentation, optional props with defaults, async options for user input, pagination handling where applicable).- The new methods (
getTicketDetails,getThreadDetails) inzoho_desk.app.mjsare properly documented with JSDoc and expose the correct API operations referenced in issue #19403.- All existing actions updated with version bumps (mentioned in the AI summary) have consistent versioning strategy.
components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs (1)
11-11: Version bump is consistent with package uplift.The version increment from 0.1.3 to 0.1.4 aligns with the broader Zoho Desk package version uplift (0.3.3 → 0.3.4) mentioned in the PR context. This is appropriate.
components/zoho_desk/actions/create-account/create-account.mjs (1)
8-8: Version bump to "0.0.8" is appropriate and consistent. The version aligns with other Zoho Desk actions that perform write/mutation operations (create-account, create-ticket, create-contact, update-contact, add-ticket-comment, search-ticket, send-email-reply, find-or-create-contact, find-contact, update-ticket), while read-only actions maintain lower versions (0.0.1–0.0.4).components/zoho_desk/actions/search-ticket/search-ticket.mjs (1)
8-8: Version bump to 0.0.8 is part of a coordinated release across Zoho Desk ticket operations.This version bump aligns with the repository's versioning conventions—multiple related Zoho Desk actions were incremented together in commit bc70790. No functional changes to this file.
components/zoho_desk/actions/search-articles/search-articles.mjs (1)
3-8: Version bump from 0.0.3 to 0.0.4 correctly follows Pipedream's semantic versioning guidelines.No behavioral changes in this update—only the
versionfield incremented on line 7. The PATCH-level bump (0.0.x) is the correct choice for backwards-compatible changes per Pipedream's official component versioning policy. Approved.components/zoho_desk/sources/updated-ticket/updated-ticket.mjs (1)
9-9: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs (1)
8-8: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/sources/new-ticket/new-ticket.mjs (1)
9-9: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs (1)
10-10: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/actions/list-tickets/list-tickets.mjs (1)
8-8: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/sources/new-agent/new-agent.mjs (1)
9-9: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/sources/new-account/new-account.mjs (1)
9-9: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/actions/find-contact/find-contact.mjs (1)
8-8: LGTM: Routine version bump.The version increment aligns with the package release that introduces new Zoho Desk actions.
components/zoho_desk/actions/update-contact/update-contact.mjs (1)
6-9: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs (1)
6-9: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/actions/list-articles/list-articles.mjs (1)
5-8: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/actions/update-ticket/update-ticket.mjs (1)
6-9: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/actions/send-email-reply/send-email-reply.mjs (1)
6-9: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/actions/create-ticket/create-ticket.mjs (1)
6-9: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/actions/create-contact/create-contact.mjs (1)
6-9: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/sources/new-contact/new-contact.mjs (1)
7-10: Version bump only — OK.
No behavioral changes observed; this looks like a metadata release increment.components/zoho_desk/actions/list-root-categories/list-root-categories.mjs (1)
7-7: Version bump only — looks consistent.
No functional changes; bumping the action version is fine.components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs (1)
9-9: Version bump only — LGTM.
No logic changes in the polling source.components/zoho_desk/zoho_desk.app.mjs (2)
719-726:getTicketDetailswrapper looks good.
Cleanly exposesGET /tickets/{ticketId}viamakeRequest, consistent with existing app methods.
735-742:getThreadDetailswrapper looks good.
Matches the expected/tickets/{ticketId}/threads/{threadId}shape and keeps the public surface minimal.
| threadId: { | ||
| type: "string", | ||
| label: "Thread ID", | ||
| description: "The ID of the thread", | ||
| async options({ | ||
| ticketId, orgId, prevContext, | ||
| }) { | ||
| if (!ticketId) { | ||
| return []; | ||
| } | ||
| const { from = 1 } = prevContext || {}; | ||
| if (from === null) { | ||
| return []; | ||
| } | ||
| const { data: threads = [] } = | ||
| await this.getTicketThreads({ | ||
| ticketId, | ||
| headers: { | ||
| orgId, | ||
| }, | ||
| params: { | ||
| from, | ||
| limit: constants.DEFAULT_LIMIT, | ||
| }, | ||
| }); | ||
| const currentLen = threads?.length; | ||
| const options = threads?.map(({ | ||
| id: value, summary: label, | ||
| }) => ({ | ||
| value, | ||
| label: label || value, | ||
| })); | ||
| return { | ||
| options: options || [], | ||
| context: { | ||
| from: currentLen | ||
| ? currentLen + from | ||
| : null, | ||
| }, | ||
| }; | ||
| }, | ||
| }, |
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.
🧩 Analysis chain
🏁 Script executed:
# First, let's find and examine the getTicketThreads method
rg -n "getTicketThreads" components/zoho_desk/zoho_desk.app.mjs -A 15Repository: PipedreamHQ/pipedream
Length of output: 989
🏁 Script executed:
# Search for other options methods to see how they handle orgId
rg -n "async options" components/zoho_desk/zoho_desk.app.mjs -B 2 -A 20Repository: PipedreamHQ/pipedream
Length of output: 8904
🏁 Script executed:
# Check if there are any comments about pagination in the file
rg -n "from|pagination|limit" components/zoho_desk/zoho_desk.app.mjs -B 2 -A 2Repository: PipedreamHQ/pipedream
Length of output: 3175
🏁 Script executed:
# Get the overall structure of the file to understand context
wc -l components/zoho_desk/zoho_desk.app.mjs
head -50 components/zoho_desk/zoho_desk.app.mjsRepository: PipedreamHQ/pipedream
Length of output: 1304
🏁 Script executed:
# Get the full getResourcesOptions method
sed -n '774,799p' components/zoho_desk/zoho_desk.app.mjsRepository: PipedreamHQ/pipedream
Length of output: 726
🏁 Script executed:
# Check the makeRequest method to understand how it handles undefined headers
rg -n "makeRequest" components/zoho_desk/zoho_desk.app.mjs -A 5 | head -40Repository: PipedreamHQ/pipedream
Length of output: 924
🏁 Script executed:
# Check how portalId and departmentId handle orgId vs how threadId uses it
sed -n '30,47p' components/zoho_desk/zoho_desk.app.mjs
sed -n '53,64p' components/zoho_desk/zoho_desk.app.mjs
sed -n '100,141p' components/zoho_desk/zoho_desk.app.mjsRepository: PipedreamHQ/pipedream
Length of output: 1783
🏁 Script executed:
# Check if orgId is a required prop elsewhere or if it can be undefined
rg -n "orgId" components/zoho_desk/zoho_desk.app.mjs | head -20Repository: PipedreamHQ/pipedream
Length of output: 327
🏁 Script executed:
# Check if there are any tests or error scenarios related to orgId
find . -name "*.test.*" -o -name "*.spec.*" | grep -i zoho_deskRepository: PipedreamHQ/pipedream
Length of output: 47
🏁 Script executed:
# Check the listHelpCenters method to see if it validates orgId
rg -n "listHelpCenters|getDepartments|getContacts" components/zoho_desk/zoho_desk.app.mjs -A 8Repository: PipedreamHQ/pipedream
Length of output: 1579
🏁 Script executed:
# Check if there's any documentation or comments about orgId requirement
rg -n "orgId" components/zoho_desk/ -B 2 -A 2 | head -60Repository: PipedreamHQ/pipedream
Length of output: 3745
🏁 Script executed:
# Check the constants to understand DEFAULT_LIMIT
cat components/zoho_desk/common/constants.mjsRepository: PipedreamHQ/pipedream
Length of output: 1135
Add orgId guard to threadId options.
Unlike portalId which checks if (!orgId) return [];, the threadId options method sends orgId in headers even when undefined, which can cause confusing auth errors during prop selection. The pagination logic (starting at from: 1 and incrementing by result count) is correct and consistent with other methods in the codebase.
async options({
ticketId, orgId, prevContext,
}) {
- if (!ticketId) {
+ if (!ticketId || !orgId) {
return [];
}🤖 Prompt for AI Agents
In components/zoho_desk/zoho_desk.app.mjs around lines 100 to 141, the threadId
async options sends orgId in headers even when undefined; add a guard like other
props to return [] immediately if orgId is falsy (and keep the existing ticketId
check), so the method exits early and does not include an undefined orgId header
when calling getTicketThreads.
lcaresia
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!
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
Resolves #19403
Creates actions:
get-ticket-details
list-ticket-threads
list-ticket-attachments
get-thread-details
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.