- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
Zoho Workdrive - optional folder id prop to bypass rate limiting #18456
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 Workdrive - optional folder id prop to bypass rate limiting #18456
Conversation
| The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
 | 
| WalkthroughVersion bumps across Zoho WorkDrive component and two sources. Both sources add an optional typedFolderId prop, make folderId optional, introduce runtime validation requiring at least one folder identifier, import ConfigurationError, and update logic to use folderId || typedFolderId when fetching/paginating. Changes
 Sequence Diagram(s)sequenceDiagram
  autonumber
  actor User as User
  participant Src as Source (startEvent)
  participant ZWD as Zoho WorkDrive API
  User->>Src: Configure props (folderId?, typedFolderId?)
  Src->>Src: Validate: require folderId OR typedFolderId
  alt Missing both
    Src-->>User: Throw ConfigurationError
  else Provided
    Src->>ZWD: paginate(folderId || typedFolderId)
    ZWD-->>Src: Files/Folders page(s)
    Src-->>User: Emit events
  end
  note over Src: Applied in both new-file-in-folder and new-folder sources
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
 Pre-merge checks and finishing touches❌ Failed checks (1 warning)
 ✅ Passed checks (2 passed)
 ✨ Finishing touches
 🧪 Generate unit tests
 Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs. 
 Please see the documentation for more information. Example: reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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 (4)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (2)
52-60: Good UX: optional Folder Id + new Typed Folder Id to bypass rate limits.Nice addition and clear descriptions.
Consider noting in one/both prop descriptions that only one should be set at a time to avoid ambiguity.
101-106: Enforce mutual exclusivity and avoid repeating the selection expression.Currently you only require at least one identifier. If users provide both, behavior may be ambiguous. Recommend enforcing exactly one and using a single effectiveFolderId.
Apply this diff:
} = this; - if (!folderId && !typedFolderId) { - throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id."); - } + const effectiveFolderId = folderId || typedFolderId; + if (!effectiveFolderId) { + throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id."); + } + if (folderId && typedFolderId) { + throw new ConfigurationError("Please provide only one of Folder Id or Typed Folder Id."); + } const lastDate = this._getLastDate(); let maxDate = lastDate; const items = app.paginate({ fn: app.listFiles, maxResults, filter: "allfiles", sort: "created_time", - folderId: folderId || typedFolderId, + folderId: effectiveFolderId, });Also applies to: 115-116
components/zoho_workdrive/sources/new-folder/new-folder.mjs (2)
48-51: Make description consistent with the “select vs type” guidance.For parity with the other source, consider: “Select the unique ID of the folder.”
Apply this diff:
label: "Folder Id", - description: "The unique ID of the folder.", + description: "Select the unique ID of the folder.", optional: true,
70-75: Enforce exactly one folder identifier and centralize the value.Mirror the recommendation from the other source to avoid ambiguity when both props are set.
Apply this diff:
} = this; - if (!folderId && !typedFolderId) { - throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id."); - } + const effectiveFolderId = folderId || typedFolderId; + if (!effectiveFolderId) { + throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id."); + } + if (folderId && typedFolderId) { + throw new ConfigurationError("Please provide only one of Folder Id or Typed Folder Id."); + } const lastDate = this._getLastDate(); let maxDate = lastDate; const items = app.paginate({ fn: app.listFiles, maxResults, filter: "folder", sort: "created_time", - folderId: folderId || typedFolderId, + folderId: effectiveFolderId, });Also applies to: 84-85
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
- components/zoho_workdrive/package.json(1 hunks)
- components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs(4 hunks)
- components/zoho_workdrive/sources/new-folder/new-folder.mjs(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/zoho_workdrive/sources/new-folder/new-folder.mjs (1)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (3)
lastDate(108-108)
maxDate(109-109)
items(110-116)
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (1)
components/zoho_workdrive/sources/new-folder/new-folder.mjs (3)
lastDate(77-77)
maxDate(78-78)
items(79-85)
🔇 Additional comments (4)
components/zoho_workdrive/package.json (1)
3-3: Version bump looks good.Matches the source-level version bumps; no concerns.
components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs (1)
1-4: Importing ConfigurationError is appropriate for runtime config validation.Assuming @pipedream/platform@^3.1.0 exports ConfigurationError, this is fine.
Please confirm ConfigurationError is available in ^3.1.0 in your publish environment.
components/zoho_workdrive/sources/new-folder/new-folder.mjs (2)
10-10: Version bump acknowledged.Aligned with package bump and prop changes.
52-57: Typed Folder Id prop addition is clear and useful.Good guidance to use this when hitting rate limits.
WHY
Summary by CodeRabbit
New Features
Chores