Skip to content

Conversation

@sicarius97
Copy link

@sicarius97 sicarius97 commented Oct 28, 2025

WHY

This is an update that would fix various issues with the props associated with zoho desk and also expand on them. Here is a short summary of what I did:

  • Added a new list-tickets tool
  • Added more thorough props for configuration
  • Fixed non existent or incorrect props

This was completed in reference to issue #18798

Summary by CodeRabbit

  • New Features
    • Added a List Tickets action and streaming-based ticket search with pagination and max-results control.
    • Exposed many new ticket and contact fields (status, priority, assignee, channel, classification, category, subcategory, dueDate, product, account, title, description, etc.) across create/update actions and search.
  • Improvements
    • Introduced streaming helpers for ticket retrieval and search for more reliable large-result handling.
  • Chores
    • Incremented versions across multiple actions and sources.

sicarius97 and others added 3 commits October 24, 2025 15:11
…rops

This commit addresses issue PipedreamHQ#18798 by adding comprehensive prop definitions
to the Zoho Desk integration, enabling AI to properly configure ticket
search and listing with all available API parameters.

Changes:
- Added new propDefinitions to zoho_desk.app.mjs:
  * ticketPriority: Dynamic options from organization fields
  * assigneeId: Dynamic options from agents list
  * channel: Dynamic options from organization fields
  * ticketSortBy: Static sort options (createdTime, modifiedTime, dueDate, relevance)
  * from: Pagination offset parameter
  * limit: Results limit parameter (max 50)

- Added streaming methods for better pagination:
  * getTicketsStream(): Stream paginated ticket lists
  * searchTicketsStream(): Stream paginated search results

- Enhanced search-ticket action (v0.0.7):
  * Added departmentId filter
  * Added status filter
  * Added priority filter
  * Added assigneeId filter
  * Added channel filter
  * Added sortBy parameter
  * Added from/limit pagination
  * Added maxResults parameter
  * Implemented streaming for large result sets

- Created new list-tickets action (v0.0.1):
  * Full filtering by department, status, priority, assignee, channel, contact
  * Sorting options
  * Pagination support
  * Include parameter for related resources
  * Streaming support for large datasets

All changes verified against Zoho Desk API documentation:
- Search Tickets: https://desk.zoho.com/DeskAPIDocument#Search_SearchTickets
- List Tickets: https://desk.zoho.com/DeskAPIDocument#Tickets_Listalltickets

Fixes PipedreamHQ#18798

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Extended all Zoho Desk actions with complete prop definitions to enable
AI assistants and users to leverage the full capabilities of the Zoho Desk API.

App file (zoho_desk.app.mjs) enhancements:
- Added accountId propDefinition with dynamic options from accounts
- Added productId propDefinition for product association
- Added category propDefinition for ticket categorization
- Added subCategory propDefinition for sub-categorization
- Added classification propDefinition with dynamic options
- Added dueDate propDefinition for deadline management

Ticket actions enhancements:

create-ticket (v0.0.6 → v0.0.7):
- Added status, priority, assigneeId, channel props (using propDefinitions)
- Added classification, category, subCategory props
- Added dueDate for deadline tracking
- Added email and phone contact fields
- Added productId for product association
- Updated to conditionally include optional fields

update-ticket (v0.0.6 → v0.0.7):
- Made subject optional (was required)
- Added status, priority, assigneeId props
- Added departmentId, contactId, channel props
- Added classification, category, subCategory props
- Added dueDate and productId props
- Updated to conditionally include optional fields
- Now supports updating any ticket field

Contact actions enhancements:

create-contact (v0.0.6 → v0.0.7):
- Added accountId prop using dynamic propDefinition
- Added title prop for job title
- Added description prop for contact notes
- Updated to conditionally include optional fields

update-contact (v0.0.6 → v0.0.7):
- Made lastName optional (was required)
- Added accountId, title, description props
- Updated to conditionally include optional fields
- Now supports updating any contact field

Email reply action fix:

send-email-reply (v0.0.6 → v0.0.7):
- Replaced hardcoded static status options with dynamic ticketStatus propDefinition
- Renamed ticketStatus prop to status for consistency
- Updated to conditionally include optional fields
- Now uses organization-specific status values

All changes verified against Zoho Desk API documentation and tested for syntax errors.

Related to PipedreamHQ#18798

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Oct 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 29, 2025 2:26pm

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Oct 28, 2025
@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

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:

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Walkthrough

Adds new ticket/contact fields, streaming helpers, and a list-tickets action; refactors many actions to build conditional data objects for API calls; increments multiple component and source versions and updates package version.

Changes

Cohort / File(s) Summary
Contact Actions
components/zoho_desk/actions/create-contact/create-contact.mjs, components/zoho_desk/actions/update-contact/update-contact.mjs
Version → 0.0.7. Added accountId, title, description props; lastName made optional in update; refactored to build a data object and pass it to API calls.
Ticket Creation
components/zoho_desk/actions/create-ticket/create-ticket.mjs
Version → 0.0.7. Added props: status, priority, assigneeId, channel, classification, category, subCategory, dueDate, email, phone, productId. Constructs data object with conditional fields; returns API response.
Ticket Updates
components/zoho_desk/actions/update-ticket/update-ticket.mjs
Version → 0.0.7. subject optional; added many optional ticket props (status, priority, assigneeId, departmentId, contactId, channel, classification, category, subCategory, dueDate, productId). Builds data object and sends it to updateTicket; returns response.
Ticket Search & Listing
components/zoho_desk/actions/search-ticket/search-ticket.mjs, components/zoho_desk/actions/list-tickets/list-tickets.mjs
search-ticket version → 0.0.7: added filtering props, switched from single-call to streaming via searchTicketsStream and aggregates results with maxResults. list-tickets added: new action implementing ticket streaming with filtering, sorting, and aggregation.
Ticket Communication
components/zoho_desk/actions/send-email-reply/send-email-reply.mjs
Version → 0.0.7. Replaced ticketStatus prop with status. Constructs data object (fromEmailAddress, to, channel, isForward) and conditionally adds content, contentType, ticketStatus; passes data to zohoDesk.sendReply and returns response.
Streaming Helpers & PropDefinitions
components/zoho_desk/zoho_desk.app.mjs
Added propDefinitions: ticketPriority, assigneeId, channel, ticketSortBy, from, limit, accountId, productId, category, subCategory, classification, dueDate. Added generator methods getTicketsStream and searchTicketsStream for paginated streaming with max enforcement and error logging.
Minor Version Bumps (actions & sources)
components/zoho_desk/actions/*, components/zoho_desk/sources/*
Numerous actions and sources had version increments only (e.g., add-ticket-attachment, add-ticket-comment, create-account, find-contact, find-or-create-contact, get-article, list-articles, list-help-centers, list-root-categories, search-articles, many sources under components/zoho_desk/sources/*). No logic changes.
Package
components/zoho_desk/package.json
Package version bumped from 0.3.0 to 0.3.1.

Sequence Diagram(s)

sequenceDiagram
    participant Action as Action (create/update/search/list)
    participant App as ZohoDesk App
    participant API as Zoho API
    Note over Action: Data-object construction (create/update/send-reply)
    Action->>Action: destructure props\nbuild `data = {}`
    Action->>Action: if (field) data.field = field
    Action->>App: call method (createContact/createTicket/updateTicket/sendReply)(data)
    App->>API: POST/PUT request with data
    API-->>App: response
    App-->>Action: response returned
Loading
sequenceDiagram
    participant Action as Search/List Action
    participant App as ZohoDesk App (stream)
    participant API as Zoho API (paginated)
    Note over Action,API: Streaming retrieval (search/list)
    Action->>App: call searchTicketsStream(headers, params, max)
    activate App
    loop per page
        App->>API: GET tickets (from, limit)
        API-->>App: page of tickets
        App-->>Action: yield ticket (generator)
    end
    deactivate App
    Action->>Action: collect yielded tickets\n(enforce maxResults)
    Action->>Action: export summary & return results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus:
    • Consistency of conditional field inclusion across create/update/send actions.
    • Correct wiring of new propDefinitions (orgId propagation where required).
    • Pagination, error handling, and stop conditions in getTicketsStream / searchTicketsStream.
    • test/usage of new list-tickets and streaming in search to ensure maxResults is enforced and batching works.
    • Ensure version-only bumps did not unintentionally change exports or behavior.

Suggested reviewers

  • jcortes

Poem

🐰
I stitched new fields into each ticket and name,
Built tidy data bundles, neat as a frame,
Streams now trickle tickets, page by page,
We hop through updates — version turned a page.
A tiny rabbit cheers: code refined, onstage!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[components] zoho desk props fix" directly relates to the main changes in the pull request, which involve fixing and adding props to multiple Zoho Desk action files and the main app file. The title is clear and specific—a teammate reviewing the history would understand that this PR addresses prop issues and improvements for the Zoho Desk integration. The title accurately captures the primary focus without being overly broad or vague, and it reflects the substantive changes (prop refactoring, new prop definitions, and new properties) rather than just version bumps.
Description Check ✅ Passed The pull request description includes the required "WHY" section from the template and provides adequate context explaining the motivation for the changes. The author clearly states the purpose (fixing various issues with props and expanding them), summarizes the key changes (added list-tickets tool, added more thorough props for configuration, fixed non-existent or incorrect props), and references the related issue #18798. While the description is relatively brief, it fulfills the template requirement and gives sufficient information to understand the intent of the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sicarius97 sicarius97 changed the title Feature/zoho desk props fix [components] zoho desk props fix Oct 28, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
components/zoho_desk/zoho_desk.app.mjs (1)

493-534: Add JSDoc documentation for new streaming methods.

The new getTicketsStream and searchTicketsStream methods lack JSDoc comments. Per the coding guidelines, methods should be documented with JSDoc.

Add JSDoc for clarity:

+    /**
+     * Streams tickets with pagination support
+     * @param {object} options - Configuration options
+     * @param {object} options.params - Query parameters for filtering tickets
+     * @param {object} options.headers - Request headers (e.g., orgId)
+     * @param {number} options.max - Maximum number of tickets to retrieve
+     * @yields {object} Individual ticket objects
+     */
     async *getTicketsStream({
       params,
       headers,
       max = constants.MAX_RESOURCES,
     } = {}) {

Based on coding guidelines.

components/zoho_desk/actions/list-tickets/list-tickets.mjs (1)

114-126: Consider cleaner approach for building params object.

The conditional param building works but could be more concise using a utility function or object filtering approach, especially given the pattern repeats across multiple action files.

Example approach:

-    const params = {};
-
-    // Add optional filter parameters
-    if (departmentId) params.departmentId = departmentId;
-    if (status) params.status = status;
-    if (priority) params.priority = priority;
-    if (assigneeId) params.assignee = assigneeId;
-    if (channel) params.channel = channel;
-    if (contactId) params.contactId = contactId;
-    if (sortBy) params.sortBy = sortBy;
-    if (from) params.from = from;
-    if (limit) params.limit = limit;
-    if (include) params.include = include;
+    const params = {
+      ...departmentId && { departmentId },
+      ...status && { status },
+      ...priority && { priority },
+      ...assigneeId && { assignee: assigneeId },
+      ...channel && { channel },
+      ...contactId && { contactId },
+      ...sortBy && { sortBy },
+      ...from && { from },
+      ...limit && { limit },
+      ...include && { include },
+    };

Or extract to a helper utility that filters out undefined/null values from an object.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36a8917 and 5536ccc.

📒 Files selected for processing (8)
  • components/zoho_desk/actions/create-contact/create-contact.mjs (3 hunks)
  • components/zoho_desk/actions/create-ticket/create-ticket.mjs (3 hunks)
  • components/zoho_desk/actions/list-tickets/list-tickets.mjs (1 hunks)
  • components/zoho_desk/actions/search-ticket/search-ticket.mjs (2 hunks)
  • components/zoho_desk/actions/send-email-reply/send-email-reply.mjs (3 hunks)
  • components/zoho_desk/actions/update-contact/update-contact.mjs (4 hunks)
  • components/zoho_desk/actions/update-ticket/update-ticket.mjs (2 hunks)
  • components/zoho_desk/zoho_desk.app.mjs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (8)
components/zoho_desk/actions/create-contact/create-contact.mjs (4)
components/zoho_desk/actions/create-ticket/create-ticket.mjs (2)
  • data (141-145)
  • response (161-166)
components/zoho_desk/actions/update-contact/update-contact.mjs (2)
  • data (97-97)
  • response (109-115)
components/zoho_desk/actions/create-account/create-account.mjs (1)
  • response (55-65)
components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs (1)
  • response (67-76)
components/zoho_desk/actions/send-email-reply/send-email-reply.mjs (6)
components/zoho_desk/actions/create-contact/create-contact.mjs (2)
  • data (86-88)
  • response (99-104)
components/zoho_desk/actions/create-ticket/create-ticket.mjs (2)
  • data (141-145)
  • response (161-166)
components/zoho_desk/actions/update-ticket/update-ticket.mjs (2)
  • data (138-138)
  • response (155-161)
components/zoho_desk/actions/create-account/create-account.mjs (1)
  • response (55-65)
components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs (1)
  • response (63-73)
components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs (1)
  • response (67-76)
components/zoho_desk/actions/search-ticket/search-ticket.mjs (5)
components/zoho_desk/actions/list-tickets/list-tickets.mjs (3)
  • params (114-114)
  • tickets (128-128)
  • stream (129-135)
components/zoho_desk/actions/list-articles/list-articles.mjs (2)
  • params (75-80)
  • stream (83-86)
components/zoho_desk/actions/list-root-categories/list-root-categories.mjs (2)
  • params (84-91)
  • stream (93-96)
components/zoho_desk/actions/search-articles/search-articles.mjs (2)
  • params (89-95)
  • stream (97-100)
components/zoho_desk/zoho_desk.app.mjs (3)
  • from (498-498)
  • from (540-540)
  • from (763-763)
components/zoho_desk/actions/list-tickets/list-tickets.mjs (2)
components/zoho_desk/actions/search-ticket/search-ticket.mjs (3)
  • params (103-106)
  • tickets (117-117)
  • stream (118-124)
components/zoho_desk/zoho_desk.app.mjs (3)
  • from (498-498)
  • from (540-540)
  • from (763-763)
components/zoho_desk/zoho_desk.app.mjs (2)
components/zoho_desk/actions/list-tickets/list-tickets.mjs (1)
  • params (114-114)
components/zoho_desk/actions/search-ticket/search-ticket.mjs (1)
  • params (103-106)
components/zoho_desk/actions/create-ticket/create-ticket.mjs (6)
components/zoho_desk/actions/create-contact/create-contact.mjs (2)
  • data (86-88)
  • response (99-104)
components/zoho_desk/actions/update-ticket/update-ticket.mjs (2)
  • data (138-138)
  • response (155-161)
components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs (2)
  • data (59-59)
  • response (69-80)
components/zoho_desk/actions/create-account/create-account.mjs (1)
  • response (55-65)
components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs (1)
  • response (63-73)
components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs (1)
  • response (67-76)
components/zoho_desk/actions/update-contact/update-contact.mjs (3)
components/zoho_desk/actions/create-contact/create-contact.mjs (2)
  • data (86-88)
  • response (99-104)
components/zoho_desk/actions/update-ticket/update-ticket.mjs (2)
  • data (138-138)
  • response (155-161)
components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs (1)
  • response (67-76)
components/zoho_desk/actions/update-ticket/update-ticket.mjs (5)
components/zoho_desk/actions/create-contact/create-contact.mjs (2)
  • data (86-88)
  • response (99-104)
components/zoho_desk/actions/create-ticket/create-ticket.mjs (2)
  • data (141-145)
  • response (161-166)
components/zoho_desk/actions/update-contact/update-contact.mjs (2)
  • data (97-97)
  • response (109-115)
components/zoho_desk/actions/create-account/create-account.mjs (1)
  • response (55-65)
components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs (1)
  • response (63-73)
🔇 Additional comments (9)
components/zoho_desk/zoho_desk.app.mjs (2)

192-353: LGTM: Well-structured propDefinitions.

The new property definitions follow consistent patterns with existing props and include appropriate constraints (e.g., min: 1 for from, max: 50 for limit). The async options are properly configured to fetch dynamic values from the API.


514-516: Include the third streaming method in error handling review: getResourcesStream at lines 778-780.

The review comment correctly identifies a real issue with error handling in streaming methods. I found THREE streaming methods with identical patterns, not just two:

  • getTicketsStream (lines 514-516) ✓ mentioned
  • searchTicketsStream (lines 556-558) ✓ mentioned
  • getResourcesStream (lines 778-780) ✗ not mentioned

All three silently log and return on errors, which differs from the regular request handler (lines 394-396) that propagates errors via throw. This inconsistency means callers cannot distinguish between legitimate empty results and actual errors.

Verify whether this silent error handling is intentional for generator/streaming contexts or if errors should be propagated consistently across all streaming methods.

components/zoho_desk/actions/create-contact/create-contact.mjs (1)

51-97: LGTM: Enhanced contact creation with additional optional fields.

The addition of accountId, title, and description fields appropriately expands the contact creation capabilities. The conditional data object construction ensures only provided values are sent to the API.

components/zoho_desk/actions/update-contact/update-contact.mjs (1)

31-114: LGTM: Improved flexibility for contact updates.

Making lastName optional (line 35) is appropriate for an update operation, and the new fields (accountId, title, description) align well with the create-contact enhancements. The data object construction correctly includes only provided fields.

components/zoho_desk/actions/send-email-reply/send-email-reply.mjs (1)

76-112: LGTM: Cleaner prop naming and improved data structure.

The rename from ticketStatus to status improves clarity (line 76), and the code correctly maps it to the API field ticketStatus (line 105). The data object construction with base fields and conditional optional fields is well-structured.

components/zoho_desk/actions/update-ticket/update-ticket.mjs (1)

31-160: LGTM: Comprehensive ticket update capabilities.

The extensive additions (13 new optional fields) significantly enhance ticket update flexibility. Making subject optional (line 35) is appropriate for an update operation. All props are correctly wired using propDefinitions, and the data object construction pattern is consistent with other actions.

components/zoho_desk/actions/search-ticket/search-ticket.mjs (1)

27-128: LGTM: Enhanced search capabilities with streaming.

The addition of comprehensive filtering options (status, priority, assigneeId, channel, etc.) and the switch to streaming significantly improve the search functionality. The parameter name mapping at line 112 (params.assignee = assigneeId) should be verified to match the API specification, as noted in the list-tickets action.

components/zoho_desk/actions/create-ticket/create-ticket.mjs (1)

51-165: LGTM: Comprehensive ticket creation enhancements.

The addition of 11 optional fields (status, priority, assigneeId, channel, classification, category, subCategory, dueDate, email, phone, productId) provides comprehensive ticket creation capabilities. The data object construction correctly starts with required fields and conditionally adds optional ones.

components/zoho_desk/actions/list-tickets/list-tickets.mjs (1)

114-126: No issues found—code uses the correct API parameter name.

The Zoho Desk API uses the query parameter assignee, and line 120 correctly maps the assigneeId prop to params.assignee. The implementation is aligned with the API specification.

Comment on lines +493 to +576
async *getTicketsStream({
params,
headers,
max = constants.MAX_RESOURCES,
} = {}) {
let from = params?.from || 1;
let resourcesCount = 0;
let nextTickets;

while (true) {
try {
({ data: nextTickets = [] } =
await this.getTickets({
withRetries: false,
headers,
params: {
...params,
from,
limit: params?.limit || constants.DEFAULT_LIMIT,
},
}));
} catch (error) {
console.log("Stream error", error);
return;
}

if (nextTickets?.length < 1) {
return;
}

from += nextTickets?.length;

for (const ticket of nextTickets) {
resourcesCount += 1;
yield ticket;
}

if (max && resourcesCount >= max) {
return;
}
}
},
async *searchTicketsStream({
params,
headers,
max = constants.MAX_RESOURCES,
} = {}) {
let from = params?.from || 1;
let resourcesCount = 0;
let nextTickets;

while (true) {
try {
({ data: nextTickets = [] } =
await this.searchTickets({
withRetries: false,
headers,
params: {
...params,
from,
limit: params?.limit || constants.DEFAULT_LIMIT,
},
}));
} catch (error) {
console.log("Stream error", error);
return;
}

if (nextTickets?.length < 1) {
return;
}

from += nextTickets?.length;

for (const ticket of nextTickets) {
resourcesCount += 1;
yield ticket;
}

if (max && resourcesCount >= max) {
return;
}
}
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Extract common streaming logic to reduce duplication.

The getTicketsStream and searchTicketsStream methods contain ~80 lines of nearly identical code. The only difference is the underlying API method called (getTickets vs searchTickets).

Consider extracting the common streaming logic:

+    async *streamResources({
+      resourceFn,
+      params,
+      headers,
+      max = constants.MAX_RESOURCES,
+    } = {}) {
+      let from = params?.from || 1;
+      let resourcesCount = 0;
+      let nextResources;
+
+      while (true) {
+        try {
+          ({ data: nextResources = [] } =
+            await resourceFn({
+              withRetries: false,
+              headers,
+              params: {
+                ...params,
+                from,
+                limit: params?.limit || constants.DEFAULT_LIMIT,
+              },
+            }));
+        } catch (error) {
+          console.log("Stream error", error);
+          return;
+        }
+
+        if (nextResources?.length < 1) {
+          return;
+        }
+
+        from += nextResources?.length;
+
+        for (const resource of nextResources) {
+          resourcesCount += 1;
+          yield resource;
+        }
+
+        if (max && resourcesCount >= max) {
+          return;
+        }
+      }
+    },
     async *getTicketsStream({
       params,
       headers,
       max = constants.MAX_RESOURCES,
     } = {}) {
-      let from = params?.from || 1;
-      let resourcesCount = 0;
-      let nextTickets;
-
-      while (true) {
-        try {
-          ({ data: nextTickets = [] } =
-            await this.getTickets({
-              withRetries: false,
-              headers,
-              params: {
-                ...params,
-                from,
-                limit: params?.limit || constants.DEFAULT_LIMIT,
-              },
-            }));
-        } catch (error) {
-          console.log("Stream error", error);
-          return;
-        }
-
-        if (nextTickets?.length < 1) {
-          return;
-        }
-
-        from += nextTickets?.length;
-
-        for (const ticket of nextTickets) {
-          resourcesCount += 1;
-          yield ticket;
-        }
-
-        if (max && resourcesCount >= max) {
-          return;
-        }
-      }
+      yield* this.streamResources({
+        resourceFn: this.getTickets,
+        params,
+        headers,
+        max,
+      });
     },
     async *searchTicketsStream({
       params,
       headers,
       max = constants.MAX_RESOURCES,
     } = {}) {
-      let from = params?.from || 1;
-      let resourcesCount = 0;
-      let nextTickets;
-
-      while (true) {
-        try {
-          ({ data: nextTickets = [] } =
-            await this.searchTickets({
-              withRetries: false,
-              headers,
-              params: {
-                ...params,
-                from,
-                limit: params?.limit || constants.DEFAULT_LIMIT,
-              },
-            }));
-        } catch (error) {
-          console.log("Stream error", error);
-          return;
-        }
-
-        if (nextTickets?.length < 1) {
-          return;
-        }
-
-        from += nextTickets?.length;
-
-        for (const ticket of nextTickets) {
-          resourcesCount += 1;
-          yield ticket;
-        }
-
-        if (max && resourcesCount >= max) {
-          return;
-        }
-      }
+      yield* this.streamResources({
+        resourceFn: this.searchTickets,
+        params,
+        headers,
+        max,
+      });
     },

Committable suggestion skipped: line range outside the PR's diff.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Caution

Docstrings generation - FAILED

No docstrings were generated.

lcaresia
lcaresia previously approved these changes Oct 28, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs (1)

68-72: Consider conditionally building the data object for optional props.

The optional props (content, isPublic, contentType) are always included in the data object, even when undefined. Some APIs may not handle undefined values gracefully compared to omitting the keys entirely.

Apply this diff to conditionally include only defined values:

-    const response = await this.zohoDesk.createTicketComment({
-      ticketId,
-      headers: {
-        orgId,
-      },
-      data: {
-        content,
-        isPublic,
-        contentType,
-      },
-    });
+    const data = {};
+    if (content !== undefined) data.content = content;
+    if (isPublic !== undefined) data.isPublic = isPublic;
+    if (contentType !== undefined) data.contentType = contentType;
+
+    const response = await this.zohoDesk.createTicketComment({
+      ticketId,
+      headers: {
+        orgId,
+      },
+      data,
+    });

Alternatively, use object spread with conditionals for a more concise approach:

     const response = await this.zohoDesk.createTicketComment({
       ticketId,
       headers: {
         orgId,
       },
       data: {
-        content,
-        isPublic,
-        contentType,
+        ...(content !== undefined && { content }),
+        ...(isPublic !== undefined && { isPublic }),
+        ...(contentType !== undefined && { contentType }),
       },
     });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5536ccc and 6796fae.

📒 Files selected for processing (23)
  • 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/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/search-articles/search-articles.mjs (1 hunks)
  • components/zoho_desk/package.json (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)
✅ Files skipped from review due to trivial changes (15)
  • components/zoho_desk/sources/new-account/new-account.mjs
  • components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs
  • components/zoho_desk/actions/get-article/get-article.mjs
  • components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs
  • components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs
  • components/zoho_desk/sources/new-contact/new-contact.mjs
  • components/zoho_desk/actions/find-contact/find-contact.mjs
  • components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs
  • components/zoho_desk/actions/create-account/create-account.mjs
  • components/zoho_desk/actions/search-articles/search-articles.mjs
  • components/zoho_desk/sources/new-ticket/new-ticket.mjs
  • components/zoho_desk/package.json
  • components/zoho_desk/sources/updated-ticket/updated-ticket.mjs
  • components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs
  • components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs
⏰ 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: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs (1)

9-9: Verify the version bump is intentional.

The version was incremented from 0.0.7 to 0.0.8 without any functional changes in this file. This is typically appropriate when shared dependencies (like the common module) have been updated, but please confirm this version bump aligns with the changes made in this PR.

components/zoho_desk/sources/new-article-instant/new-article-instant.mjs (1)

10-10: Version bump is consistent with coordinated release.

The patch version increment aligns with the PR's coordinated updates across multiple Zoho Desk components, even though this specific file has no functional changes.

components/zoho_desk/actions/list-help-centers/list-help-centers.mjs (1)

8-8: LGTM! Version bump aligns with the PR release cycle.

The version increment is appropriate given the broader PR changes to Zoho Desk components. The existing implementation follows best practices with defensive destructuring, proper pluralization in the summary message, and correct component structure.

components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs (1)

9-9: LGTM! Version bump is consistent with PR scope.

The version increment from "0.0.7" to "0.0.8" aligns with the broader maintenance updates across Zoho Desk components in this PR.

components/zoho_desk/actions/list-root-categories/list-root-categories.mjs (1)

7-7: LGTM! Version bump is appropriate.

The version increment from 0.0.2 to 0.0.3 aligns with the broader updates across Zoho Desk components in this PR.

components/zoho_desk/actions/list-articles/list-articles.mjs (1)

7-7: LGTM! Version bump aligns with coordinated update.

The version increment is appropriate as part of the broader Zoho Desk module update.

components/zoho_desk/sources/new-agent/new-agent.mjs (1)

9-9: LGTM! Version bump is appropriate.

The version increment from 0.0.7 to 0.0.8 aligns with the broader updates to the Zoho Desk component suite in this PR.

components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs (1)

8-8: Version bump is appropriate as part of coordinated PR effort.

The diff confirms this file contains only a version bump (0.0.6 → 0.0.7) with no functional changes. Git history shows the previous commit added comprehensive props to Zoho Desk ticket actions, making this version bump a reasonable follow-up across the component family.

@michelle0927
Copy link
Collaborator

@sicarius97 Apologies, I'm not sure why this wasn't reviewed before sending to QA. I went ahead and updated the versions so that it passes Component Checks. Let me know if you'd like help implementing the suggestions from QA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User submitted Submitted by a user

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Zoho desk implementation does not properly pass props in config

5 participants