-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Zoho Desk - new help center actions #18708
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?
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 Zoho Desk Help Center and Knowledge Base actions (list help centers, list articles, get article, search articles, list root categories). Extends the Zoho Desk app with portal/article propDefinitions, request/stream helpers for KB endpoints, replaces VERSION_PATH with CORE_API_PATH, adds PORTAL_API_PATH, and bumps package version. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Action as Zoho Desk Action
participant App as zoho_desk.app
participant API as Zoho Desk API
User->>Action: Configure orgId, portalId, params
Action->>App: invoke list/search/get/root-category method
App->>API: HTTP request(s) to portal/KB endpoints (using CORE_API_PATH / PORTAL_API_PATH)
API-->>App: Page(s) of data or single item
alt Streaming (list/search/root-categories)
loop until no more pages or maxResults reached
App-->>Action: yield item(s)
Action->>Action: accumulate, enforce maxResults
end
else Single fetch (get-article)
App-->>Action: return entity
end
Action->>Action: export $summary
Action-->>User: return collected data
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 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: 0
🧹 Nitpick comments (2)
components/zoho_desk/zoho_desk.app.mjs (2)
24-46
: Consider adding error handling in the async options.The
portalId
prop's async options function callslistHelpCenters
without error handling. If the API call fails, the error could bubble up and cause issues for users trying to configure the component.Consider wrapping the API call in a try-catch block:
async options({ orgId }) { if (!orgId) { return []; } + try { const { data: helpCenters = [] } = await this.listHelpCenters({ params: { orgId, }, }); return helpCenters.map(({ portalId: value, name: label, }) => ({ value, label: label || value, })); + } catch (error) { + console.error("Error fetching help centers:", error); + return []; + } },
126-130
: Consider enhancing articleId with async options.While the simple string approach works, adding async options (similar to
contactId
andticketId
props) would improve user experience by allowing users to select from available articles rather than manually entering IDs.This would require additional context (e.g.,
orgId
andportalId
) to fetch available articles, so it can be implemented as a future enhancement if needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/zoho_desk/common/constants.mjs
(2 hunks)components/zoho_desk/zoho_desk.app.mjs
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- components/zoho_desk/common/constants.mjs
🧰 Additional context used
🧬 Code graph analysis (1)
components/zoho_desk/zoho_desk.app.mjs (1)
components/zoho_desk/actions/list-help-centers/list-help-centers.mjs (1)
helpCenters
(26-31)
⏰ 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: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/zoho_desk/zoho_desk.app.mjs (2)
295-368
: LGTM! Well-structured knowledge base methods.The new help center and knowledge base methods are well-implemented:
- Consistent use of
makeRequest
withapiPrefix: constants.PORTAL_API_PATH
for portal API endpoints- Proper async generator patterns for streaming methods using
yield*
andgetResourcesStream
- Clear, RESTful path conventions (
/helpCenters
,/kbArticles
,/kbArticles/search
,/kbRootCategories
)- Correct parameter handling and destructuring in stream methods
- Implementation aligns with how they're consumed in the action files
The code follows the established patterns in the codebase and integrates cleanly with the existing infrastructure.
133-136
: Constants definitions verified. CORE_API_PATH and PORTAL_API_PATH are defined in components/zoho_desk/common/constants.mjs with the expected values.
Closes #18644
The order is list-help-centers.mjs → list-root-categories.mjs → list-articles.mjs or search-articles.mjs → get-article.mjs
A nuance in testing this, when publishing a help article you need to set its visibility to something other than private, otherwise you will not see it in the API.
Summary by CodeRabbit