-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Freshdesk fixes and improvements #16051
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
|
WalkthroughThe changes introduce multiple updates across the Freshdesk integration. Version numbers have been incremented in several modules, and property descriptions have been refined. The Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant CT as CreateTicket Action
participant FA as Freshdesk App
participant API as Freshdesk API
U->>CT: Initiate Create Ticket action
CT->>FA: Call createTicket with data payload
FA->>API: Send payload via _makeRequest (includes companyId, descriptionText, subject)
API-->>FA: Return API response
FA-->>CT: Return success confirmation
sequenceDiagram
participant U as User
participant LT as ListTickets Action
participant FA as Freshdesk App
participant API as Freshdesk API
U->>LT: Request ticket list with filters
LT->>FA: Process request with sorting params (orderBy, orderType)
FA->>API: Query Freshdesk API with filters
API-->>FA: Return list of tickets
FA-->>LT: Provide summary with ticket count
Suggested labels
Suggested reviewers
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/freshdesk/freshdesk.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (20)
✨ Finishing Touches
🪧 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: 0
🧹 Nitpick comments (3)
components/freshdesk/sources/new-ticket/new-ticket.mjs (1)
40-50: Consider using optional chaining for null checks.The current pattern checks if
dataexists before calling methods on it. Modern JavaScript offers a more concise approach with optional chaining.- data && - data.reverse().forEach((ticket) => { + data?.reverse().forEach((ticket) => {This change maintains the same functionality while using a more modern JavaScript feature.
🧰 Tools
🪛 Biome (1.9.4)
[error] 40-50: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
components/freshdesk/freshdesk.app.mjs (2)
14-21: Consider adding a fallback for empty responses.If
responseis empty or unexpectedly shaped, the.map(...)call could throw errors or produce an empty result. You might add a quick check to avoid potential runtime issues ifthis.getCompanies()returns an unexpected result.
96-106: Consider adding retry or error-handling logic.Removing dedicated retry logic may cause immediate failures on transient network issues. Consider reintroducing or adding minimal error handling to
_makeRequestto gracefully handle API throttling or 5xx responses.
📜 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 (10)
components/freshdesk/actions/create-company/create-company.mjs(2 hunks)components/freshdesk/actions/create-contact/create-contact.mjs(3 hunks)components/freshdesk/actions/create-ticket/create-ticket.mjs(3 hunks)components/freshdesk/actions/get-ticket/get-ticket.mjs(1 hunks)components/freshdesk/actions/list-all-tickets/list-all-tickets.mjs(1 hunks)components/freshdesk/common/constants.mjs(0 hunks)components/freshdesk/freshdesk.app.mjs(5 hunks)components/freshdesk/package.json(2 hunks)components/freshdesk/sources/new-contact/new-contact.mjs(2 hunks)components/freshdesk/sources/new-ticket/new-ticket.mjs(2 hunks)
💤 Files with no reviewable changes (1)
- components/freshdesk/common/constants.mjs
🧰 Additional context used
🪛 Biome (1.9.4)
components/freshdesk/sources/new-ticket/new-ticket.mjs
[error] 40-50: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (45)
components/freshdesk/package.json (2)
3-3: Version update aligns with feature enhancements.The version bump from 0.0.4 to 0.1.0 follows semantic versioning and properly reflects the significant improvements made to the Freshdesk components.
16-16: Dependency update to latest platform version.Upgrading @pipedream/platform to the latest version (^3.0.3) ensures compatibility with new features and security fixes.
components/freshdesk/actions/get-ticket/get-ticket.mjs (4)
6-7: Improved documentation and version increment.The enhanced description with a documentation link provides better context for users, and the version increment to 0.1.0 properly reflects the significant changes to this component.
11-16: Improved property definition with propDefinition.Replacing the direct
idproperty with a structuredticketIdpropDefinition improves consistency and likely enhances the UI experience with proper field validation or dropdown options.
19-25: Cleaner code with property destructuring.The refactoring to use destructuring creates more readable and maintainable code. The parameter name change from
idtoticketIdalso improves consistency with the prop definition.
26-26: Clearer success message.The updated success message provides more precise feedback about the action performed.
components/freshdesk/sources/new-contact/new-contact.mjs (2)
7-9: Enhanced component metadata and documentation.The name change to "New Contact Created" is more descriptive, the added documentation link is helpful, and the version increment properly reflects these improvements.
43-43: Improved event summary formatting.The new format
New Contact: "${contact.name}"with added quotation marks improves readability when displayed in logs or notifications.components/freshdesk/sources/new-ticket/new-ticket.mjs (3)
7-9: Enhanced component metadata and documentation.The name change to "New Ticket Created" is more descriptive, the added documentation link is helpful, and the version increment properly reflects these improvements.
29-32: Improved code formatting for readability.Breaking the string manipulation operation into multiple lines improves code readability without changing functionality.
46-46: Improved event summary formatting.The new format
New Ticket (ID: ${ticket.id})is clearer and more consistent with other event summaries in the codebase.components/freshdesk/actions/create-ticket/create-ticket.mjs (4)
6-7: Documentation link and version bump look good.The updated documentation link properly points to the Freshdesk API documentation with a clearer description. The version increment from 0.0.2 to 0.1.0 appropriately reflects the feature additions in this update.
34-39: Good addition of the subject property.Adding the subject field is a valuable improvement since it's a standard field in ticketing systems. The property is properly defined with appropriate type, label, description, and correctly marked as optional.
43-44: Improved property descriptions.The description text improvements create better consistency by removing trailing periods and providing clearer explanations for each property.
Also applies to: 49-50, 55-56
68-78: Improved run method with destructuring.The refactored run method is more explicit and cleaner. Using destructuring to separate the freshdesk instance, companyId, and descriptionText from other data improves code clarity. The explicit property mapping for
company_id,description_textand converting companyId to a Number are good practices to ensure proper API interaction.components/freshdesk/actions/list-all-tickets/list-all-tickets.mjs (5)
1-1: Clean freshdesk import.The import statement has been updated to directly import the freshdesk app module, which is more consistent with the other files in the component.
5-8: Improved action name and description.The name change from "List All Tickets" to "List Tickets" better reflects what the action does, as it actually returns up to 100 tickets rather than literally all tickets. The updated description provides clearer information about the action's limitations and includes a proper documentation link.
11-11: Simplified freshdesk prop.The freshdesk property is now directly referenced without unnecessary nesting, which is more consistent with other Freshdesk components.
12-52: Great addition of sorting options.The new orderBy and orderType properties provide valuable sorting functionality for the ticket list. The implementation includes well-defined options with clear labels and descriptions, enhancing the component's usability.
54-68: Improved implementation with better API usage.The run method has been refactored to use the freshdesk.listTickets method instead of direct API calls, which promotes better code reuse. The success summary now correctly handles singular/plural forms based on the result count, providing a more polished user experience.
components/freshdesk/actions/create-company/create-company.mjs (4)
6-7: Documentation and version update.The description now provides a clearer reference to the documentation with a proper link. The version increment from 0.0.1 to 0.0.3 reflects the changes made to the component.
14-15: Improved property descriptions.The descriptions for name, description, note, and industry properties have been made more consistent by removing trailing periods, improving the overall documentation quality.
Also applies to: 19-20, 25-26, 31-32
42-48: Simplified run method with destructuring.The run method has been refactored to use destructuring, which removes the need for a separate helper function to filter out null entries. This approach is more concise and aligns with modern JavaScript practices.
49-49: Fixed typo in success message.The success message has been corrected from "sucessfully" to "successfully", fixing a minor spelling issue.
components/freshdesk/actions/create-contact/create-contact.mjs (3)
6-7: Documentation reference and version update.The description now includes a clearer reference to the documentation with a proper link. The version bump from 0.0.1 to 0.1.0 appropriately reflects the feature additions and improvements.
18-20: Improved labels and descriptions.The labels and descriptions for email, otherEmails, and phone properties have been updated with proper capitalization and clearer phrasing, making them more consistent and professional.
Also applies to: 24-26, 30-32
43-53: Improved run method with destructuring.The run method has been refactored to use destructuring to extract companyId and otherEmails, while collecting the rest of the properties in a data object. The data construction is now more explicit with proper property mappings for API fields. The conditional conversion of companyId to a number (
companyId && Number(companyId)) is a good practice to ensure proper type handling.components/freshdesk/freshdesk.app.mjs (18)
2-2: Looks good—importing axios is correct.
11-11: Clearer description.
22-37: Implementation for listing tickets looks appropriate.
43-43: Minor description change—no issues.
51-51: Minor description change—no issues.
59-70: Validate email availability when filtering contacts.If any contact lacks an
90-94: Check for missing or invalid domain in user auth.If the user forgets to provide a valid
domainin$auth, constructing the base URL might fail. Add a fallback or validation for$auth.domainto avoid runtime errors.
113-113: Optional chaining is a good defensive check.
131-131: Consistent defensive check for contact results—looks good.
144-148: Creating a company using _makeRequest is straightforward.
151-155: Retrieving companies with getCompanies is clear and consistent.
157-161: getContacts method is consistent with the overall request pattern.
163-168: createContact method is succinct and aligns with the new structure.
170-175: createTicket method follows the same streamlined approach—no issues.
178-184: getTicket method is well-structured—no concerns.
185-189: searchTickets method is consistent with the new request pattern.
191-195: searchContacts method aligns well—no issues.
197-201: listTickets method is good for enumerating tickets.
Note: the
_withRetriesmethod wasn't actually used anywhere, hence why it was removed.Summary by CodeRabbit