Support Shared Drives and improve file ID extraction in DriveService#7
Support Shared Drives and improve file ID extraction in DriveService#7raybell-md wants to merge 3 commits intomainfrom
Conversation
- Added `supportsAllDrives: true` and `includeItemsFromAllDrives: true` to Drive API calls in `DriveService`, `DocsService`, `SheetsService`, and `SlidesService`. - Improved `drive.downloadFile` to robustly handle full Drive URLs by extracting the file ID using `extractDocumentId`. - Updated unit tests to verify Shared Drive support and URL handling. Co-authored-by: raybell-md <196701227+raybell-md@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
| fileId: id, | ||
| fields: 'id, name, mimeType', | ||
| supportsAllDrives: true, | ||
| }); |
There was a problem hiding this comment.
@jules Shouldn't this have includeItemsFromAllDrives: true?
There was a problem hiding this comment.
Actually, drive.files.get (which is used here) only supports supportsAllDrives, not includeItemsFromAllDrives. The latter is used for list operations to include items from all drives in results. I have ensured supportsAllDrives: true is present for all get calls, which is what the API requires for retrieving a specific file from a shared drive.
|
@jules Shouldn't drive.downloadFile have |
Hi! I checked the Google Drive API documentation and verified with the TypeScript types in the |
- Added `supportsAllDrives: true` and `includeItemsFromAllDrives: true` to Drive API calls in `DriveService`, `DocsService`, `SheetsService`, and `SlidesService`. - Improved `drive.downloadFile` to robustly handle full Drive URLs by extracting the file ID using `extractDocumentId`. - Updated unit tests to verify Shared Drive support and URL handling. Co-authored-by: raybell-md <196701227+raybell-md@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This PR addresses an issue where downloading files from Google Shared Drives failed with a "File not found" error. It also makes the
drive.downloadFiletool more robust by allowing it to accept full Drive URLs as input. Consistently applied Shared Drive support across other Workspace services (Docs, Sheets, Slides) for search, create, and move operations.Fixes #6
PR created automatically by Jules for task 14910952148528428578 started by @raybell-md