-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - helpdocs #17937
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
New Components - helpdocs #17937
Conversation
WalkthroughThis change introduces a new HelpDocs app integration, providing a comprehensive set of actions for interacting with the HelpDocs API. Actions include creating, retrieving, listing, searching, and deleting articles and categories, as well as generating a chatbot source page. The app module implements all required API methods and dynamic property definitions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action
participant HelpDocsApp
participant HelpDocsAPI
User->>Action: Provide input (e.g., create article)
Action->>HelpDocsApp: Call API method (e.g., createArticle)
HelpDocsApp->>HelpDocsAPI: Send HTTP request
HelpDocsAPI-->>HelpDocsApp: Return API response
HelpDocsApp-->>Action: Return processed response
Action-->>User: Export summary and result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Suggested labels
Suggested reviewers
Poem
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 as they are similar to previous 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. 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 ↗︎ |
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 (5)
components/helpdocs/actions/get-category/get-category.mjs (1)
24-24: Consider improving the summary message format.The current summary message uses the category ID, but based on retrieved learnings about summary message formatting, it would be more user-friendly to include the category name or title if available in the response.
Consider this improvement if the category object has a name/title property:
- $.export("$summary", `Retrieved category ${this.categoryId}`); + $.export("$summary", `Retrieved category "${category.name || this.categoryId}"`);components/helpdocs/actions/delete-article/delete-article.mjs (1)
24-24: Consider enhancing the summary message.Similar to other actions, the summary message could be more descriptive by including article details if available from the response or by fetching the article title before deletion.
Consider improving the user experience with a more descriptive message:
- $.export("$summary", `Deleted article ${this.articleId}`); + $.export("$summary", `Successfully deleted article ${this.articleId}`);components/helpdocs/actions/create-category/create-category.mjs (1)
32-32: Enhance summary message with category IDConsider including the category ID in the summary for better traceability.
- $.export("$summary", `Created category ${this.title}`); + $.export("$summary", `Created category "${this.title}" with ID: ${category.category_id || category.id}`);components/helpdocs/helpdocs.app.mjs (2)
152-152: Initialize variables properlyThe
totalvariable should be initialized to avoid potential undefined behavior.- let total, count = 0; + let total = 0, count = 0;
144-170: Consider adding error handling in paginate methodThe paginate method should handle API errors gracefully during iteration.
async *paginate({ fn, params = {}, resourceKey, max, }) { params = { ...params, limit: 100, skip: 0, }; - let total, count = 0; + let total = 0, count = 0; do { + try { const response = await fn({ params, }); const items = response[resourceKey]; total = items?.length; if (!total) { return; } for (const item of items) { yield item; if (max && ++count >= max) { return; } } params.skip += params.limit; + } catch (error) { + console.error(`Pagination error: ${error.message}`); + throw error; + } } while (total === params.limit); },
📜 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 (13)
components/helpdocs/actions/create-article/create-article.mjs(1 hunks)components/helpdocs/actions/create-category/create-category.mjs(1 hunks)components/helpdocs/actions/delete-article/delete-article.mjs(1 hunks)components/helpdocs/actions/delete-category/delete-category.mjs(1 hunks)components/helpdocs/actions/generate-chatbot-source-page/generate-chatbot-source-page.mjs(1 hunks)components/helpdocs/actions/get-article-versions/get-article-versions.mjs(1 hunks)components/helpdocs/actions/get-article/get-article.mjs(1 hunks)components/helpdocs/actions/get-category/get-category.mjs(1 hunks)components/helpdocs/actions/list-articles/list-articles.mjs(1 hunks)components/helpdocs/actions/list-categories/list-categories.mjs(1 hunks)components/helpdocs/actions/search-articles/search-articles.mjs(1 hunks)components/helpdocs/helpdocs.app.mjs(1 hunks)components/helpdocs/package.json(2 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: when developing pipedream components, do not add built-in node.js modules like `fs` to `package.json...
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.
Applied to files:
components/helpdocs/package.json
📚 Learning: "dir" props in pipedream components are hidden in the component form and not user-facing, so they do...
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.
Applied to files:
components/helpdocs/package.jsoncomponents/helpdocs/helpdocs.app.mjs
📚 Learning: in `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "c...
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".
Applied to files:
components/helpdocs/actions/create-article/create-article.mjscomponents/helpdocs/actions/create-category/create-category.mjs
📚 Learning: when exporting a summary message in the `run` method of an action, ensure the message is correctly f...
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`.
Applied to files:
components/helpdocs/actions/get-article/get-article.mjscomponents/helpdocs/actions/get-article-versions/get-article-versions.mjscomponents/helpdocs/actions/get-category/get-category.mjscomponents/helpdocs/actions/list-articles/list-articles.mjscomponents/helpdocs/actions/list-categories/list-categories.mjscomponents/helpdocs/actions/generate-chatbot-source-page/generate-chatbot-source-page.mjscomponents/helpdocs/actions/delete-article/delete-article.mjscomponents/helpdocs/actions/create-category/create-category.mjs
📚 Learning: in the salesloft api integration (components/salesloft/salesloft.app.mjs), the _makerequest method r...
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.
Applied to files:
components/helpdocs/helpdocs.app.mjs
🔇 Additional comments (17)
components/helpdocs/package.json (2)
3-3: LGTM! Version bump is appropriate.The version bump to "0.1.0" correctly reflects the addition of new functionality for the HelpDocs integration.
15-17: LGTM! Dependency addition is correct.The "@pipedream/platform" dependency is appropriate for Pipedream components and follows best practices by not including built-in Node.js modules.
components/helpdocs/actions/delete-category/delete-category.mjs (1)
1-27: LGTM! Well-structured action implementation.The action follows Pipedream best practices with:
- Proper metadata and documentation link
- Correct use of propDefinition for dynamic category selection
- Clear summary message export
- Appropriate API method delegation to the app client
components/helpdocs/actions/get-article/get-article.mjs (1)
1-27: LGTM! Clean action implementation.The action properly:
- Uses propDefinition for dynamic article selection
- Destructures the response to extract the article data
- Provides a clear summary message
- Returns clean article data to the user
components/helpdocs/actions/get-article-versions/get-article-versions.mjs (2)
17-22: LGTM! Well-defined optional parameter.The languageCode parameter is properly typed as optional with clear label and description, following Pipedream conventions.
24-36: LGTM! Correct parameter mapping and execution.The implementation correctly:
- Maps
languageCodetolanguage_codefor the API call- Provides a descriptive summary message
- Returns the full response containing version data
components/helpdocs/actions/list-categories/list-categories.mjs (1)
12-20: LGTM! Clean list action implementation.The action properly:
- Destructures the categories from the API response
- Uses array length in the summary message (following best practices from retrieved learnings)
- Returns clean category data to the user
components/helpdocs/actions/get-category/get-category.mjs (1)
1-27: LGTM! Well-structured action implementation.The action follows standard patterns with proper imports, metadata, propDefinitions, and API integration. The implementation is clean and consistent with other actions in the HelpDocs integration.
components/helpdocs/actions/search-articles/search-articles.mjs (3)
1-58: Excellent implementation with comprehensive search functionality.The action provides a well-structured search interface with appropriate parameter validation, proper camelCase-to-snake_case mapping for the API, and follows the correct summary message format as indicated in the retrieved learnings.
34-41: Good parameter validation for limit.The limit parameter correctly sets both a maximum value and default of 100, which aligns with API constraints and provides sensible defaults for users.
55-55: Perfect summary message format.The summary message
Found ${articles.length} articlesfollows the correct formatting pattern from the retrieved learnings, providing users with meaningful feedback about the operation results.components/helpdocs/actions/delete-article/delete-article.mjs (1)
1-27: Clean and consistent delete action implementation.The action follows the established patterns for HelpDocs integration with proper imports, metadata, and propDefinition usage. The implementation is straightforward and appropriate for a delete operation.
components/helpdocs/actions/create-article/create-article.mjs (2)
1-91: Well-structured article creation action with comprehensive properties.The action provides a thorough interface for creating articles with all necessary fields and proper validation. The implementation follows established patterns and includes appropriate parameter mapping.
88-88: Good summary message format.The summary message using the article title provides meaningful feedback to users about the created article, following best practices from the retrieved learnings.
components/helpdocs/actions/list-articles/list-articles.mjs (3)
1-120: Comprehensive article listing action with excellent filtering capabilities.The action provides extensive filtering options and proper pagination handling. The implementation demonstrates good understanding of the HelpDocs API capabilities and follows established patterns.
93-115: Well-implemented pagination with proper async iteration.The pagination logic correctly uses the paginate helper method and properly collects results through async iteration. The parameter mapping is comprehensive and the resource key specification ensures proper data extraction.
117-117: Perfect summary message format.The summary message
Found ${articles.length} articlesfollows the correct formatting pattern from retrieved learnings, providing users with clear feedback about the number of articles retrieved.
components/helpdocs/actions/generate-chatbot-source-page/generate-chatbot-source-page.mjs
Show resolved
Hide resolved
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!
Resolves #17715
Summary by CodeRabbit
New Features
Improvements
Chores