diff --git a/components/google_drive/actions/add-comment/add-comment.mjs b/components/google_drive/actions/add-comment/add-comment.mjs index 6d1fc9852da10..d132631a541c7 100644 --- a/components/google_drive/actions/add-comment/add-comment.mjs +++ b/components/google_drive/actions/add-comment/add-comment.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-add-comment", name: "Add Comment", description: "Add an unanchored comment to a Google Doc (general feedback, no text highlighting). [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/create)", - version: "0.1.12", + version: "0.1.13", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs b/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs index 944be72ef4d41..b79444fd090e7 100644 --- a/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs +++ b/components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs @@ -20,7 +20,7 @@ export default { name: "Share File or Folder", description: "Add a [sharing permission](https://support.google.com/drive/answer/7166529) to the sharing preferences of a file or folder and provide a sharing URL. [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/create)", - version: "0.2.19", + version: "0.2.20", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/copy-file/copy-file.mjs b/components/google_drive/actions/copy-file/copy-file.mjs index a2fdb36a51b5b..26a979ef2a058 100644 --- a/components/google_drive/actions/copy-file/copy-file.mjs +++ b/components/google_drive/actions/copy-file/copy-file.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-copy-file", name: "Copy File", description: "Create a copy of the specified file. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/copy) for more information", - version: "0.1.27", + version: "0.1.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs b/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs index 9c8b3d4e9ec18..384da28e28ec5 100644 --- a/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs +++ b/components/google_drive/actions/create-file-from-template/create-file-from-template.mjs @@ -9,7 +9,7 @@ export default { key: "google_drive-create-file-from-template", name: "Create New File From Template", description: "Create a new Google Docs file from a template. Optionally include placeholders in the template document that will get replaced from this action. [See documentation](https://www.npmjs.com/package/google-docs-mustaches)", - version: "0.1.30", + version: "0.1.31", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs b/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs index e1357d2f39d73..07a8d0f4a6743 100644 --- a/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs +++ b/components/google_drive/actions/create-file-from-text/create-file-from-text.mjs @@ -5,7 +5,7 @@ export default { key: "google_drive-create-file-from-text", name: "Create New File From Text", description: "Create a new file from plain text. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information", - version: "0.2.20", + version: "0.2.21", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/create-folder/create-folder.mjs b/components/google_drive/actions/create-folder/create-folder.mjs index de8eb95a5c574..1a0ab0deafc9d 100644 --- a/components/google_drive/actions/create-folder/create-folder.mjs +++ b/components/google_drive/actions/create-folder/create-folder.mjs @@ -13,7 +13,7 @@ export default { key: "google_drive-create-folder", name: "Create Folder", description: "Create a new empty folder. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information", - version: "0.1.28", + version: "0.1.29", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs b/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs index 64b31b8c08dbd..f06a97fe0310f 100644 --- a/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs +++ b/components/google_drive/actions/create-shared-drive/create-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-create-shared-drive", name: "Create Shared Drive", description: "Create a new shared drive. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/create) for more information", - version: "0.1.28", + version: "0.1.29", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/create-text-file/create-text-file.mjs b/components/google_drive/actions/create-text-file/create-text-file.mjs index 8653f49393feb..8e6b44849bc33 100644 --- a/components/google_drive/actions/create-text-file/create-text-file.mjs +++ b/components/google_drive/actions/create-text-file/create-text-file.mjs @@ -12,7 +12,7 @@ export default { + " `mimeType = 'application/vnd.google-apps.folder'` to find the folder ID first." + " Supported content formats: plain text, Markdown, HTML, Rich Text, CSV." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/delete-comment/delete-comment.mjs b/components/google_drive/actions/delete-comment/delete-comment.mjs index f12a387b396db..efdfea04a66c7 100644 --- a/components/google_drive/actions/delete-comment/delete-comment.mjs +++ b/components/google_drive/actions/delete-comment/delete-comment.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-delete-comment", name: "Delete Comment", description: "Delete a specific comment (Requires ownership or permissions). [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/delete)", - version: "0.0.16", + version: "0.0.17", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/delete-file/delete-file.mjs b/components/google_drive/actions/delete-file/delete-file.mjs index 9e587fdd4b2e2..ad51eefbc66e9 100644 --- a/components/google_drive/actions/delete-file/delete-file.mjs +++ b/components/google_drive/actions/delete-file/delete-file.mjs @@ -5,7 +5,7 @@ export default { name: "Delete File", description: "Permanently delete a file or folder without moving it to the trash. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/delete) for more information", - version: "0.1.28", + version: "0.1.29", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/delete-reply/delete-reply.mjs b/components/google_drive/actions/delete-reply/delete-reply.mjs index 45ff22772e8af..6a7cfa39fadc8 100644 --- a/components/google_drive/actions/delete-reply/delete-reply.mjs +++ b/components/google_drive/actions/delete-reply/delete-reply.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-delete-reply", name: "Delete Reply", description: "Delete a reply on a specific comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/replies/delete) for more information", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs b/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs index ea50978583afc..878dcd29fbe1e 100644 --- a/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs +++ b/components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-delete-shared-drive", name: "Delete Shared Drive", description: "Delete a shared drive without any content. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/delete) for more information", - version: "0.1.27", + version: "0.1.28", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/download-file/download-file.mjs b/components/google_drive/actions/download-file/download-file.mjs index c44b5af9c82d2..9e3151cfcd0b0 100644 --- a/components/google_drive/actions/download-file/download-file.mjs +++ b/components/google_drive/actions/download-file/download-file.mjs @@ -35,7 +35,7 @@ export default { + " Pass `mimeType` to force a specific format. Shortcuts are resolved to their target automatically." + " Folders, Forms, and My Maps cannot be downloaded via this action." + " [See the documentation](https://developers.google.com/drive/api/v3/manage-downloads)", - version: "0.2.4", + version: "0.2.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/find-file/find-file.mjs b/components/google_drive/actions/find-file/find-file.mjs index ddf6585e92cdc..b30b933215d92 100644 --- a/components/google_drive/actions/find-file/find-file.mjs +++ b/components/google_drive/actions/find-file/find-file.mjs @@ -6,7 +6,7 @@ export default { key: "google_drive-find-file", name: "Find File", description: "Search for a specific file by name. The `Search Name` field uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like `&` or `'`. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.28", + version: "0.1.29", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/find-folder/find-folder.mjs b/components/google_drive/actions/find-folder/find-folder.mjs index 4e89e56fd34e4..02a1fdb90fe10 100644 --- a/components/google_drive/actions/find-folder/find-folder.mjs +++ b/components/google_drive/actions/find-folder/find-folder.mjs @@ -7,7 +7,7 @@ export default { key: "google_drive-find-folder", name: "Find Folder", description: "Search for a specific folder by name. The `Search Name` field uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like `&` or `'`. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.28", + version: "0.1.29", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/find-forms/find-forms.mjs b/components/google_drive/actions/find-forms/find-forms.mjs index 4342d0b0a76a8..ea55f96c215ba 100644 --- a/components/google_drive/actions/find-forms/find-forms.mjs +++ b/components/google_drive/actions/find-forms/find-forms.mjs @@ -6,7 +6,7 @@ export default { key: "google_drive-find-forms", name: "Find Forms", description: "List Google Form documents or search for a Form by name. The `Search Name` field uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like `&` or `'`. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.0.29", + version: "0.0.30", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs b/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs index 45eb4a4f9ff2f..12deff984bd48 100644 --- a/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs +++ b/components/google_drive/actions/find-spreadsheets/find-spreadsheets.mjs @@ -6,7 +6,7 @@ export default { key: "google_drive-find-spreadsheets", name: "Find Spreadsheets", description: "Search for a specific spreadsheet by name. The `Search Name` field uses Google Drive's tokenized full-text matching — pass a distinctive word or short phrase rather than the full title when the name contains special characters like `&` or `'`. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.28", + version: "0.1.29", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/get-comment/get-comment.mjs b/components/google_drive/actions/get-comment/get-comment.mjs index 8243c051198f2..c54b00c34d8fe 100644 --- a/components/google_drive/actions/get-comment/get-comment.mjs +++ b/components/google_drive/actions/get-comment/get-comment.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-get-comment", name: "Get Comment By ID", description: "Get comment by ID on a specific file. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/get) for more information", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/get-current-user/get-current-user.mjs b/components/google_drive/actions/get-current-user/get-current-user.mjs index ba1627c3e49bc..23ed87a9907a0 100644 --- a/components/google_drive/actions/get-current-user/get-current-user.mjs +++ b/components/google_drive/actions/get-current-user/get-current-user.mjs @@ -6,7 +6,7 @@ export default { key: "google_drive-get-current-user", name: "Get Current User", description: "Retrieve Google Drive account metadata for the authenticated user via `about.get`, including display name, email, permission ID, and storage quota. Useful when flows or agents need to confirm the active Google identity or understand available storage. [See the documentation](https://developers.google.com/drive/api/v3/reference/about/get).", - version: "0.0.14", + version: "0.0.15", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs b/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs index cc867cc2d5055..92091f45fda65 100644 --- a/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs +++ b/components/google_drive/actions/get-file-by-id/get-file-by-id.mjs @@ -5,7 +5,7 @@ export default { key: "google_drive-get-file-by-id", name: "Get File By ID", description: "Get info on a specific file. [See the documentation](https://developers.google.com/drive/api/reference/rest/v3/files/get) for more information", - version: "0.0.24", + version: "0.0.25", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/get-file/get-file.mjs b/components/google_drive/actions/get-file/get-file.mjs index f3e19e0c82b85..6df3b11b4b94d 100644 --- a/components/google_drive/actions/get-file/get-file.mjs +++ b/components/google_drive/actions/get-file/get-file.mjs @@ -11,7 +11,7 @@ export default { + "\n\nCommon fields: `id`, `name`, `mimeType`, `size`, `parents`, `webViewLink`, `webContentLink`," + " `createdTime`, `modifiedTime`, `owners`, `permissions`, `description`, `trashed`." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/get)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs b/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs index caad8b3ebc24f..ce1aa1927fb38 100644 --- a/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs +++ b/components/google_drive/actions/get-folder-id-for-path/get-folder-id-for-path.mjs @@ -12,7 +12,7 @@ export default { key: "google_drive-get-folder-id-for-path", name: "Get Folder ID for a Path", description: "Retrieve a folderId for a path. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information", - version: "0.1.29", + version: "0.1.30", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/get-reply/get-reply.mjs b/components/google_drive/actions/get-reply/get-reply.mjs index ac04813ee43ac..4eaab07c8d989 100644 --- a/components/google_drive/actions/get-reply/get-reply.mjs +++ b/components/google_drive/actions/get-reply/get-reply.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-get-reply", name: "Get Reply By ID", description: "Get reply by ID on a specific comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/replies/get) for more information", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs b/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs index f98a76eec2334..cd6c7ad0ac8da 100644 --- a/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs +++ b/components/google_drive/actions/get-shared-drive/get-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-get-shared-drive", name: "Get Shared Drive", description: "Get metadata for one or all shared drives. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/get) for more information", - version: "0.1.27", + version: "0.1.28", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/get-user-details/get-user-details.mjs b/components/google_drive/actions/get-user-details/get-user-details.mjs index 9185e4357e7db..483fbd7ebe713 100644 --- a/components/google_drive/actions/get-user-details/get-user-details.mjs +++ b/components/google_drive/actions/get-user-details/get-user-details.mjs @@ -10,7 +10,7 @@ export default { + " When the user says 'my files' or 'my documents', call this first to get the owner email," + " then pass it to **Search Files** with a query like `'user@example.com' in owners`." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/about/get)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/is-folder-ancestor/is-folder-ancestor.mjs b/components/google_drive/actions/is-folder-ancestor/is-folder-ancestor.mjs index a964011b8a327..317dbc32dbabc 100644 --- a/components/google_drive/actions/is-folder-ancestor/is-folder-ancestor.mjs +++ b/components/google_drive/actions/is-folder-ancestor/is-folder-ancestor.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-is-folder-ancestor", name: "Is Folder Ancestor", description: "Check if a specific folder is anywhere in the parent hierarchy of a file or folder. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get)", - version: "0.0.8", + version: "0.0.9", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs b/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs index 4c147ffd74de1..4af747e9eb107 100644 --- a/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs +++ b/components/google_drive/actions/list-access-proposals/list-access-proposals.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-list-access-proposals", name: "List Access Proposals", description: "List access proposals for a file or folder. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/accessproposals/list)", - version: "0.0.20", + version: "0.0.21", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/list-comments/list-comments.mjs b/components/google_drive/actions/list-comments/list-comments.mjs index bbeb1b322839d..200cc60dfcb51 100644 --- a/components/google_drive/actions/list-comments/list-comments.mjs +++ b/components/google_drive/actions/list-comments/list-comments.mjs @@ -8,7 +8,7 @@ export default { key: "google_drive-list-comments", name: "List Comments", description: "List the comments on a file, including each comment's author, plain text and HTML content, the file text it is anchored to, whether it is resolved, and its full reply thread. Use **Find File** first to resolve a file's name to its ID. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/list)", - version: "0.1.3", + version: "0.1.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/list-files/list-files.mjs b/components/google_drive/actions/list-files/list-files.mjs index a741cefe79491..07239ede50c6d 100644 --- a/components/google_drive/actions/list-files/list-files.mjs +++ b/components/google_drive/actions/list-files/list-files.mjs @@ -9,7 +9,7 @@ export default { key: "google_drive-list-files", name: "List Files", description: "List files from a specific folder. Set `Max Results` to cap how many files are returned per run, then pass the returned `nextPageToken` back in as `Page Token` on the next run to page through a large folder in fixed-size batches. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/list) for more information", - version: "1.0.4", + version: "1.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/list-mime-type-options/list-mime-type-options.mjs b/components/google_drive/actions/list-mime-type-options/list-mime-type-options.mjs index f04aff6987895..13b8eb172a89c 100644 --- a/components/google_drive/actions/list-mime-type-options/list-mime-type-options.mjs +++ b/components/google_drive/actions/list-mime-type-options/list-mime-type-options.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-list-mime-type-options", name: "List Mime Type Options", description: "Retrieves available options for the Mime Type field.", - version: "0.0.7", + version: "0.0.8", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/list-permissions/list-permissions.mjs b/components/google_drive/actions/list-permissions/list-permissions.mjs index 09e1b112e900c..5103a131372fc 100644 --- a/components/google_drive/actions/list-permissions/list-permissions.mjs +++ b/components/google_drive/actions/list-permissions/list-permissions.mjs @@ -10,7 +10,7 @@ export default { + " Use this tool when the user asks 'who has access to this file?' or needs to audit sharing." + " Pass permission IDs from this response to **Remove Sharing** to revoke access." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/list)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/list-replies/list-replies.mjs b/components/google_drive/actions/list-replies/list-replies.mjs index 0c83a7955d6b1..be3540d6c8020 100644 --- a/components/google_drive/actions/list-replies/list-replies.mjs +++ b/components/google_drive/actions/list-replies/list-replies.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-list-replies", name: "List Replies", description: "List replies to a specific comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/replies/list) for more information", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/list-shared-drives/list-shared-drives.mjs b/components/google_drive/actions/list-shared-drives/list-shared-drives.mjs index 0a929fb84f150..fc0047dc2eea6 100644 --- a/components/google_drive/actions/list-shared-drives/list-shared-drives.mjs +++ b/components/google_drive/actions/list-shared-drives/list-shared-drives.mjs @@ -10,7 +10,7 @@ export default { + " Pass a drive ID to **Search Files** `driveId` parameter to search within a specific shared drive." + " Optionally filter by name using the `query` parameter (e.g., `name contains 'Engineering'`)." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/list)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/list-theme-id-options/list-theme-id-options.mjs b/components/google_drive/actions/list-theme-id-options/list-theme-id-options.mjs index e7268a9f63f0b..2ed37aa7af0a8 100644 --- a/components/google_drive/actions/list-theme-id-options/list-theme-id-options.mjs +++ b/components/google_drive/actions/list-theme-id-options/list-theme-id-options.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-list-theme-id-options", name: "List Theme ID Options", description: "Retrieves available options for the Theme ID field.", - version: "0.0.7", + version: "0.0.8", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs b/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs index 4c2f4573b4df5..b8f55575391f8 100644 --- a/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs +++ b/components/google_drive/actions/move-file-to-trash/move-file-to-trash.mjs @@ -5,7 +5,7 @@ export default { key: "google_drive-move-file-to-trash", name: "Move File to Trash", description: "Move a file or folder to trash. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information", - version: "0.1.27", + version: "0.1.28", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/move-file/move-file.mjs b/components/google_drive/actions/move-file/move-file.mjs index fcd39d92e62d4..30812419b6db9 100644 --- a/components/google_drive/actions/move-file/move-file.mjs +++ b/components/google_drive/actions/move-file/move-file.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-move-file", name: "Move File", description: "Move a file from one folder to another. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information", - version: "0.1.27", + version: "0.1.28", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/remove-file-sharing-permission/remove-file-sharing-permission.mjs b/components/google_drive/actions/remove-file-sharing-permission/remove-file-sharing-permission.mjs index df0159f242895..86c4234d45943 100644 --- a/components/google_drive/actions/remove-file-sharing-permission/remove-file-sharing-permission.mjs +++ b/components/google_drive/actions/remove-file-sharing-permission/remove-file-sharing-permission.mjs @@ -6,7 +6,7 @@ export default { name: "Remove File Sharing Permission", description: "Remove a [sharing permission](https://support.google.com/drive/answer/7166529) from the sharing preferences of a file or folder. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/delete)", - version: "0.0.11", + version: "0.0.12", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/remove-sharing/remove-sharing.mjs b/components/google_drive/actions/remove-sharing/remove-sharing.mjs index c22490ea629bb..dfd50c117de42 100644 --- a/components/google_drive/actions/remove-sharing/remove-sharing.mjs +++ b/components/google_drive/actions/remove-sharing/remove-sharing.mjs @@ -10,7 +10,7 @@ export default { + " The owner permission cannot be removed." + " Use **Search Files** to find the file ID by name if needed." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/delete)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/reply-to-comment/reply-to-comment.mjs b/components/google_drive/actions/reply-to-comment/reply-to-comment.mjs index dc72f357cb369..a082cb2c32505 100644 --- a/components/google_drive/actions/reply-to-comment/reply-to-comment.mjs +++ b/components/google_drive/actions/reply-to-comment/reply-to-comment.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-reply-to-comment", name: "Reply to Comment", description: "Add a reply to an existing comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/replies/create)", - version: "0.0.16", + version: "0.0.17", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs b/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs index fd03b76381da5..653cb7cf28857 100644 --- a/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs +++ b/components/google_drive/actions/resolve-access-proposal/resolve-access-proposal.mjs @@ -5,7 +5,7 @@ export default { key: "google_drive-resolve-access-proposal", name: "Resolve Access Proposals", description: "Accept or deny a request for access to a file or folder in Google Drive. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/accessproposals/resolve)", - version: "0.0.20", + version: "0.0.21", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/resolve-comment/resolve-comment.mjs b/components/google_drive/actions/resolve-comment/resolve-comment.mjs index 204d20914d7ae..1ea511740669d 100644 --- a/components/google_drive/actions/resolve-comment/resolve-comment.mjs +++ b/components/google_drive/actions/resolve-comment/resolve-comment.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-resolve-comment", name: "Resolve Comment", description: "Mark a comment as resolved. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/update)", - version: "0.0.16", + version: "0.0.17", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/search-files/search-files.mjs b/components/google_drive/actions/search-files/search-files.mjs index 753ca75cd9d9c..eecfd543b521c 100644 --- a/components/google_drive/actions/search-files/search-files.mjs +++ b/components/google_drive/actions/search-files/search-files.mjs @@ -36,7 +36,7 @@ export default { + " missing and paging will not recover them — narrow the search with `driveId`." + " Prefer narrowing the `query` over paging through many batches." + " [See the documentation](https://developers.google.com/drive/api/v3/search-files)", - version: "1.0.1", + version: "1.0.2", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs b/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs index 9b21fcb3ac389..96aba64cadb61 100644 --- a/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs +++ b/components/google_drive/actions/search-shared-drives/search-shared-drives.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-search-shared-drives", name: "Search for Shared Drives", description: "Search for shared drives with query options. [See the documentation](https://developers.google.com/drive/api/v3/search-shareddrives) for more information", - version: "0.1.28", + version: "0.1.29", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/share-file/share-file.mjs b/components/google_drive/actions/share-file/share-file.mjs index 281ca548c1727..acfdbcdaba878 100644 --- a/components/google_drive/actions/share-file/share-file.mjs +++ b/components/google_drive/actions/share-file/share-file.mjs @@ -15,7 +15,7 @@ export default { + "\n\n**Roles:** `reader` (view only), `commenter` (can comment), `writer` (can edit)." + " Use **List Permissions** to see existing sharing on a file." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/create)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/trash-file/trash-file.mjs b/components/google_drive/actions/trash-file/trash-file.mjs index 58aca044ad7aa..2859802e3256c 100644 --- a/components/google_drive/actions/trash-file/trash-file.mjs +++ b/components/google_drive/actions/trash-file/trash-file.mjs @@ -10,7 +10,7 @@ export default { + " Use this instead of permanent deletion as the safer default." + " To find trashed files, use **Search Files** with `trashed = true`." + " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update)", - version: "0.0.6", + version: "0.0.7", type: "action", ai: "optimized", annotations: { diff --git a/components/google_drive/actions/update-comment/update-comment.mjs b/components/google_drive/actions/update-comment/update-comment.mjs index f6c4240c03e17..8c0eafaeab50a 100644 --- a/components/google_drive/actions/update-comment/update-comment.mjs +++ b/components/google_drive/actions/update-comment/update-comment.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-update-comment", name: "Update Comment", description: "Update the content of a specific comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/update) for more information", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/update-file/update-file.mjs b/components/google_drive/actions/update-file/update-file.mjs index f4acdc270cc24..3d41dc38c4e3a 100644 --- a/components/google_drive/actions/update-file/update-file.mjs +++ b/components/google_drive/actions/update-file/update-file.mjs @@ -6,7 +6,7 @@ export default { key: "google_drive-update-file", name: "Update File", description: "Update a file's metadata and/or content. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information", - version: "2.0.19", + version: "2.0.20", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/update-reply/update-reply.mjs b/components/google_drive/actions/update-reply/update-reply.mjs index 7da317b41bf1b..7c5021d95815b 100644 --- a/components/google_drive/actions/update-reply/update-reply.mjs +++ b/components/google_drive/actions/update-reply/update-reply.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-update-reply", name: "Update Reply", description: "Update a reply on a specific comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/replies/update) for more information", - version: "0.0.13", + version: "0.0.14", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs b/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs index 78d95944019e6..c7e6ea44d0a7f 100644 --- a/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs +++ b/components/google_drive/actions/update-shared-drive/update-shared-drive.mjs @@ -4,7 +4,7 @@ export default { key: "google_drive-update-shared-drive", name: "Update Shared Drive", description: "Update an existing shared drive. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/update) for more information", - version: "0.1.27", + version: "0.1.28", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/google_drive/actions/upload-file/upload-file.mjs b/components/google_drive/actions/upload-file/upload-file.mjs index 5578387b1df18..bc921703bfeb0 100644 --- a/components/google_drive/actions/upload-file/upload-file.mjs +++ b/components/google_drive/actions/upload-file/upload-file.mjs @@ -13,7 +13,7 @@ export default { key: "google_drive-upload-file", name: "Upload File", description: "Upload a file to Google Drive. [See the documentation](https://developers.google.com/drive/api/v3/manage-uploads) for more information", - version: "2.0.19", + version: "2.0.20", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/google_drive/common/constants.mjs b/components/google_drive/common/constants.mjs index 1bc2dd0efcb8d..aecc373a8b9d4 100644 --- a/components/google_drive/common/constants.mjs +++ b/components/google_drive/common/constants.mjs @@ -257,6 +257,30 @@ const FILES_MAX_PAGE_SIZE = 1000; */ const DEFAULT_SEARCH_FILES_LIMIT = 100; +const RETRYABLE_STATUS_CODES = [ + 422, + 429, + 500, + 502, + 503, + 504, +]; + +const RATE_LIMIT_ERROR_REASONS = [ + "rateLimitExceeded", + "userRateLimitExceeded", +]; + +const CHANGED_FILE_FIELDS = "kind,id,name,mimeType,parents,createdTime,modifiedTime,trashed,version,size,md5Checksum,webViewLink,lastModifyingUser"; + +/** Google Workspace types that `stashFile` can export to PDF. */ +const PDF_EXPORTABLE_MIME_TYPES = [ + "application/vnd.google-apps.document", + "application/vnd.google-apps.spreadsheet", + "application/vnd.google-apps.presentation", + "application/vnd.google-apps.drawing", +]; + export { GOOGLE_DRIVE_NOTIFICATION_SYNC, GOOGLE_DRIVE_NOTIFICATION_ADD, @@ -300,4 +324,9 @@ export { // Files FILES_MAX_PAGE_SIZE, DEFAULT_SEARCH_FILES_LIMIT, + // Webhooks + RETRYABLE_STATUS_CODES, + RATE_LIMIT_ERROR_REASONS, + CHANGED_FILE_FIELDS, + PDF_EXPORTABLE_MIME_TYPES, }; diff --git a/components/google_drive/google_drive.app.mjs b/components/google_drive/google_drive.app.mjs index 7998f07dd3a27..8417e905cb299 100644 --- a/components/google_drive/google_drive.app.mjs +++ b/components/google_drive/google_drive.app.mjs @@ -13,6 +13,8 @@ import { GOOGLE_DRIVE_UPDATE_TYPES, GOOGLE_DRIVE_UPLOAD_TYPE_OPTIONS, MY_DRIVE_VALUE, + RATE_LIMIT_ERROR_REASONS, + RETRYABLE_STATUS_CODES, WEBHOOK_SUBSCRIPTION_EXPIRATION_TIME_MILLISECONDS, } from "./common/constants.mjs"; @@ -445,15 +447,20 @@ export default { * returned * @param {number} [pageSize=1000] - the maximum number of changes to return * per page + * @param {string} [fileFields] - the file fields to return for each change, + * e.g. `id,name,parents`. Defaults to the API's minimal file fields * @yields * @type {ChangesPage} */ - async *listChanges(pageToken, driveId, pageSize = 1000) { + async *listChanges(pageToken, driveId, pageSize = 1000, fileFields) { const drive = this.drive(); let changeRequest = { pageToken, pageSize, }; + if (fileFields) { + changeRequest.fields = `nextPageToken,newStartPageToken,changes(file(${fileFields}))`; + } // As with many of the methods for Google Drive, we must // pass a request of a different shape when we're requesting @@ -468,7 +475,9 @@ export default { } while (true) { - const { data } = await drive.changes.list(changeRequest); + const { data } = await this.retryWithExponentialBackoff( + () => drive.changes.list(changeRequest), + ); const { changes = [], newStartPageToken, @@ -1693,6 +1702,14 @@ export default { const drive = this.drive(); return (await drive.accessproposals.resolve(opts)).data; }, + isRetryableError(error, statusCode) { + if (RETRYABLE_STATUS_CODES.includes(statusCode)) { + return true; + } + const errors = error.errors ?? error.response?.data?.error?.errors ?? []; + return statusCode === 403 + && errors.some(({ reason }) => RATE_LIMIT_ERROR_REASONS.includes(reason)); + }, retryWithExponentialBackoff(func, maxAttempts = 3, baseDelayS = 2) { let attempt = 0; @@ -1700,15 +1717,13 @@ export default { try { return await func(); } catch (error) { - // retry for error status 422 const statusCode = error.status || error.response?.status; - if (attempt >= maxAttempts || statusCode !== 422) { + if (attempt >= maxAttempts || !this.isRetryableError(error, statusCode)) { throw error; } - // display error message for 422 status const errorMessage = error.message || error.response?.data?.message || error.response?.statusText || "Unknown error"; - console.log(`Received 422 error: ${errorMessage}. Retrying attempt ${attempt + 1}/${maxAttempts}...`); + console.log(`Received ${statusCode} error: ${errorMessage}. Retrying attempt ${attempt + 1}/${maxAttempts}...`); const delayMs = Math.pow(baseDelayS, attempt) * 1000; await new Promise((resolve) => setTimeout(resolve, delayMs)); diff --git a/components/google_drive/package.json b/components/google_drive/package.json index 7eea5152ee439..66ee29a19f62b 100644 --- a/components/google_drive/package.json +++ b/components/google_drive/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/google_drive", - "version": "3.0.1", + "version": "4.0.0", "description": "Pipedream Google_drive Components", "main": "google_drive.app.mjs", "keywords": [ diff --git a/components/google_drive/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs b/components/google_drive/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs index 19c9049a0f3ff..47fee994a344b 100644 --- a/components/google_drive/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs +++ b/components/google_drive/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs @@ -14,7 +14,7 @@ export default { key: "google_drive-changes-to-files-in-drive", name: "Changes to Files in Drive", description: "Emit new event when a change is made to one of the specified files. [See the documentation](https://developers.google.com/drive/api/v3/reference/changes/watch)", - version: "0.0.15", + version: "0.0.16", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs b/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs index ac4f86f408a30..18351784d2d2b 100644 --- a/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +++ b/components/google_drive/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs @@ -29,7 +29,7 @@ export default { key: "google_drive-changes-to-specific-files-shared-drive", name: "Changes to Specific Files (Shared Drive)", description: "Watches for changes to specific files in a shared drive, emitting an event when a change is made to one of those files", - version: "0.3.15", + version: "0.3.16", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs b/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs index 1f100bd13a537..163d8400c4a56 100644 --- a/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs +++ b/components/google_drive/sources/changes-to-specific-files/changes-to-specific-files.mjs @@ -16,7 +16,7 @@ export default { key: "google_drive-changes-to-specific-files", name: "Changes to Specific Files", description: "Watches for changes to specific files, emitting an event when a change is made to one of those files. To watch for changes to [shared drive](https://support.google.com/a/users/answer/9310351) files, use the **Changes to Specific Files (Shared Drive)** source instead.", - version: "0.3.13", + version: "0.3.14", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/common-dedupe-changes.mjs b/components/google_drive/sources/common-dedupe-changes.mjs index 070589ccb6ade..ad56937b2af4e 100644 --- a/components/google_drive/sources/common-dedupe-changes.mjs +++ b/components/google_drive/sources/common-dedupe-changes.mjs @@ -24,29 +24,40 @@ You can change or disable this minimum interval using the prop \`Minimum Interva _setFileIntervals(value) { this.db.set("fileIntervals", value); }, - checkMinimumInterval(files) { + filterByMinimumInterval(files) { const interval = this.perFileInterval; - if (!interval) return files; + if (!interval) { + return files; + } - const now = Date.now(); - const minTimestamp = now - (interval * 1000 * 60); + const minTimestamp = Date.now() - (interval * 1000 * 60); + const savedData = this._getFileIntervals(); + return files.filter(({ id }) => !savedData[id] || savedData[id] < minTimestamp); + }, + recordFileEmits(fileIds) { + if (!this.perFileInterval || !fileIds.length) { + return; + } + const now = Date.now(); + const minTimestamp = now - (this.perFileInterval * 1000 * 60); const savedData = this._getFileIntervals(); Object.entries(savedData).forEach(([ key, value, ]) => { - if (value < minTimestamp) delete savedData[key]; - }); - - const filteredFiles = files.filter(({ id }) => { - const exists = !!savedData[id]; - if (!exists) { - savedData[id] = now; + if (value < minTimestamp) { + delete savedData[key]; } - return !exists; + }); + fileIds.forEach((id) => { + savedData[id] = now; }); this._setFileIntervals(savedData); + }, + checkMinimumInterval(files) { + const filteredFiles = this.filterByMinimumInterval(files); + this.recordFileEmits(filteredFiles.map(({ id }) => id)); return filteredFiles; }, }, diff --git a/components/google_drive/sources/common-webhook.mjs b/components/google_drive/sources/common-webhook.mjs index f827f127387f7..3c474fc119788 100644 --- a/components/google_drive/sources/common-webhook.mjs +++ b/components/google_drive/sources/common-webhook.mjs @@ -122,6 +122,12 @@ export default { getUpdateTypes() { return []; }, + /** + * File fields to request per change; `undefined` returns the API's minimal fields. + */ + getChangesFileFields() { + return undefined; + }, /** * This method is responsible for processing a list of changed files * according to the event source's purpose. As an abstract method, it must @@ -201,7 +207,12 @@ export default { const driveId = this.getDriveId(); const changedFilesStream = - this.googleDrive.listChanges(pageToken, driveId, this.changesPageSize); + this.googleDrive.listChanges( + pageToken, + driveId, + this.changesPageSize, + this.getChangesFileFields(), + ); for await (const changedFilesPage of changedFilesStream) { const { changedFiles, diff --git a/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs b/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs index a4d270bf264ce..ba0f60dc5326a 100644 --- a/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs +++ b/components/google_drive/sources/new-access-proposal/new-access-proposal.mjs @@ -6,7 +6,7 @@ export default { key: "google_drive-new-access-proposal", name: "New Access Proposal", description: "Emit new event when a new access proposal is requested in Google Drive", - version: "0.0.18", + version: "0.0.19", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs b/components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs index 32d447b0581ac..36911a293ba1a 100644 --- a/components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs +++ b/components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs @@ -8,7 +8,7 @@ export default { key: "google_drive-new-files-instant-polling", name: "New Files (Polling)", description: "Emit new event when a new file is added in your linked Google Drive", - version: "0.0.13", + version: "0.0.14", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-files-instant/new-files-instant.mjs b/components/google_drive/sources/new-files-instant/new-files-instant.mjs index 9704737e2ebb4..95b1f7c6e71b9 100644 --- a/components/google_drive/sources/new-files-instant/new-files-instant.mjs +++ b/components/google_drive/sources/new-files-instant/new-files-instant.mjs @@ -11,7 +11,7 @@ export default { key: "google_drive-new-files-instant", name: "New Files (Instant)", description: "Emit new event when a new file is added in your linked Google Drive", - version: "0.2.15", + version: "0.2.16", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs b/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs index 24e4a1e30de6d..60aa01735e757 100644 --- a/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs +++ b/components/google_drive/sources/new-files-shared-drive/new-files-shared-drive.mjs @@ -7,7 +7,7 @@ export default { key: "google_drive-new-files-shared-drive", name: "New Files (Shared Drive)", description: "Emit new event when a new file is added in your shared Google Drive", - version: "0.1.15", + version: "0.1.16", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs b/components/google_drive/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs index 3b9bba5693ecf..88072451d5220 100644 --- a/components/google_drive/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs +++ b/components/google_drive/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs @@ -7,7 +7,7 @@ export default { key: "google_drive-new-or-modified-comments-polling", name: "New or Modified Comments (Polling)", description: "Emit new event when a comment is created or modified in the selected file", - version: "0.0.13", + version: "0.0.14", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs b/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs index 6d6bdf9e82fb8..b8f9440363309 100644 --- a/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs +++ b/components/google_drive/sources/new-or-modified-comments/new-or-modified-comments.mjs @@ -18,7 +18,7 @@ export default { name: "New or Modified Comments (Instant)", description: "Emit new event when a comment is created or modified in the selected file", - version: "1.0.24", + version: "1.0.25", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs b/components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs index 78c1778a44e44..ad28d1ded3986 100644 --- a/components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs +++ b/components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs @@ -9,7 +9,7 @@ export default { key: "google_drive-new-or-modified-files-polling", name: "New or Modified Files (Polling)", description: "Emit new event when a file in the selected Drive is created, modified or trashed. [See the documentation](https://developers.google.com/drive/api/v3/reference/changes/list)", - version: "0.0.15", + version: "0.0.16", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs b/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs index 67a41e145feeb..4aadcfd3627c3 100644 --- a/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs +++ b/components/google_drive/sources/new-or-modified-files/new-or-modified-files.mjs @@ -9,15 +9,17 @@ // 2) A timer that runs on regular intervals, renewing the notification channel as needed import { + CHANGED_FILE_FIELDS, + GOOGLE_DRIVE_MIME_TYPE_PREFIX, GOOGLE_DRIVE_NOTIFICATION_ADD, GOOGLE_DRIVE_NOTIFICATION_CHANGE, GOOGLE_DRIVE_NOTIFICATION_UPDATE, + PDF_EXPORTABLE_MIME_TYPES, } from "../../common/constants.mjs"; import commonDedupeChanges from "../common-dedupe-changes.mjs"; import common from "../common-webhook.mjs"; import { stashFile } from "../../common/utils.mjs"; import sampleEmit from "./test-event.mjs"; -import md5 from "md5"; const { googleDrive } = common.props; @@ -26,10 +28,8 @@ export default { key: "google_drive-new-or-modified-files", name: "New or Modified Files (Instant)", description: "Emit new event when a file in the selected Drive is created, modified or trashed.", - version: "0.4.15", + version: "1.0.0", type: "source", - // Dedupe events based on the "x-goog-message-number" header for the target channel: - // https://developers.google.com/drive/api/v3/push#making-watch-requests dedupe: "unique", props: { ...common.props, @@ -66,7 +66,7 @@ export default { includeLink: { label: "Include Link", type: "boolean", - description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.", + description: "Upload file to your File Stash and emit temporary download link to the file. Google Workspace documents will be converted to PDF. Files that can't be downloaded emit `fileURLError` instead. See [the docs](https://pipedream.com/docs/connect/components/files) to learn more about working with files in Pipedream.", default: false, optional: true, }, @@ -113,31 +113,25 @@ export default { GOOGLE_DRIVE_NOTIFICATION_UPDATE, ]; }, - generateMeta(data, headers) { - const { - id: fileId, - name: summary, - modifiedTime: tsString, - } = data; - const ts = Date.parse(tsString); - const eventId = headers && headers["x-goog-message-number"]; - + getChangesFileFields() { + return CHANGED_FILE_FIELDS; + }, + generateMeta({ + id, name, modifiedTime, trashed, + }) { return { - id: md5(`${fileId}-${eventId || ts}`), - summary, - ts, + id: `${id}-${modifiedTime}-${trashed}`, + summary: name, + ts: Date.parse(modifiedTime), }; }, - async getChanges(headers) { + getChanges(headers) { if (!headers) { return { - change: { }, + change: {}, }; } - const resourceUri = headers["x-goog-resource-uri"]; - const metadata = await this.googleDrive.getFileMetadata(`${resourceUri}&fields=*`); return { - ...metadata, change: { state: headers["x-goog-resource-state"], resourceURI: headers["x-goog-resource-uri"], @@ -145,30 +139,53 @@ export default { }, }; }, + async getFileLink(file) { + const { mimeType } = file; + if (mimeType.startsWith(GOOGLE_DRIVE_MIME_TYPE_PREFIX) + && !PDF_EXPORTABLE_MIME_TYPES.includes(mimeType)) { + return { + fileURLError: `Files of type ${mimeType} can't be downloaded`, + }; + } + try { + return { + fileURL: await stashFile(file, this.googleDrive, this.dir), + }; + } catch (error) { + // Isolate per-file failures so one file can't block the page token; rate limits still retry + if (this.googleDrive.isRetryableError(error, error.status || error.response?.status)) { + throw error; + } + console.log(`Could not upload file ${file.name} to the File Stash: ${error.message}`); + return { + fileURLError: error.message, + }; + } + }, async processChanges(changedFiles, headers) { - const changes = await this.getChanges(headers); - - const filteredFiles = this.checkMinimumInterval(changedFiles); + const changes = this.getChanges(headers); + const filteredFiles = this.filterByMinimumInterval(changedFiles); + const emittedFileIds = []; - for (const file of filteredFiles) { - file.parents = (await this.googleDrive.getFile(file.id, { - fields: "parents", - })).parents; + try { + for (const file of filteredFiles) { + if (!this.shouldProcess(file)) { + console.log(`Skipping file ${file.name}`); + continue; + } - if (!this.shouldProcess(file)) { - console.log(`Skipping file ${file.name}`); - continue; - } - - const eventToEmit = { - file, - ...changes, - }; - if (this.includeLink) { - eventToEmit.fileURL = await stashFile(file, this.googleDrive, this.dir); + const eventToEmit = { + file, + ...changes, + }; + if (this.includeLink) { + Object.assign(eventToEmit, await this.getFileLink(file)); + } + this.$emit(eventToEmit, this.generateMeta(file)); + emittedFileIds.push(file.id); } - const meta = this.generateMeta(file, headers); - this.$emit(eventToEmit, meta); + } finally { + this.recordFileEmits(emittedFileIds); } }, }, diff --git a/components/google_drive/sources/new-or-modified-files/test-event.mjs b/components/google_drive/sources/new-or-modified-files/test-event.mjs index 711fc1c497b4e..87b3fe42a5f20 100644 --- a/components/google_drive/sources/new-or-modified-files/test-event.mjs +++ b/components/google_drive/sources/new-or-modified-files/test-event.mjs @@ -1 +1,30 @@ -export default JSON.parse("{\n \"file\": {\n \"kind\": \"drive#file\",\n \"copyRequiresWriterPermission\": false,\n \"writersCanShare\": true,\n \"viewedByMe\": true,\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\",\n \"exportLinks\": {\n \"application/x-vnd.oasis.opendocument.spreadsheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmw4&exportFormat=ods\",\n \"text/tab-separated-values\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXnViTOo&exportFormat=tsv\",\n \"application/pdf\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaBViTOo&exportFormat=pdf\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbOo&exportFormat=xlsx\",\n \"text/csv\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbBViTOo&exportFormat=csv\",\n \"application/zip\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-VbTmw4Pt2BViTOo&exportFormat=zip\",\n \"application/vnd.oasis.opendocument.spreadsheet\": \"https://docs.google.com/spreadsheets/export?id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbViTOo&exportFormat=ods\"\n },\n \"parents\": [\n \"0ANs73yKKVA\"\n ],\n \"thumbnailLink\": \"https://docs.google.com/feeds/vt?gd=true&id=1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmw4&v=12&s=AMedNnoAAAAAZKWjrEqscucFpYCyRCJqnd0wtBiDtXYh&sz=s220\",\n \"iconLink\": \"https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.google-apps.spreadsheet\",\n \"shared\": false,\n \"lastModifyingUser\": {\n \"displayName\": \"John Doe\",\n \"kind\": \"drive#user\",\n \"me\": true,\n \"permissionId\": \"077423361841532483\",\n \"emailAddress\": \"john@doe.com\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\"\n },\n \"owners\": [\n {\n \"displayName\": \"John Doe\",\n \"kind\": \"drive#user\",\n \"me\": true,\n \"permissionId\": \"07742336189483\",\n \"emailAddress\": \"john@doe.com\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\"\n }\n ],\n \"webViewLink\": \"https://docs.google.com/spreadsheets/d/1LmXTIQ0wqKP7T3-l9r127MaTXn3pVbTmwTOo/edit?usp=drivesdk\",\n \"size\": \"1024\",\n \"viewersCanCopyContent\": true,\n \"permissions\": [\n {\n \"id\": \"07742336184153259483\",\n \"displayName\": \"John Doe\",\n \"type\": \"user\",\n \"kind\": \"drive#permission\",\n \"photoLink\": \"https://lh3.googleusercontent.com/a/default-user=s64\",\n \"emailAddress\": \"john@doe.com\",\n \"role\": \"owner\",\n \"deleted\": false,\n \"pendingOwner\": false\n }\n ],\n \"hasThumbnail\": true,\n \"spaces\": [\n \"drive\"\n ],\n \"id\": \"1LmXTIQ0wqKP7T3-l9r127Maw4Pt2BViTOo\",\n \"name\": \"Pipedream 2213\",\n \"starred\": false,\n \"trashed\": false,\n \"explicitlyTrashed\": false,\n \"createdTime\": \"2023-02-06T15:13:33.023Z\",\n \"modifiedTime\": \"2023-06-28T12:52:54.570Z\",\n \"modifiedByMeTime\": \"2023-06-28T12:52:54.570Z\",\n \"viewedByMeTime\": \"2023-06-29T06:30:58.441Z\",\n \"quotaBytesUsed\": \"1024\",\n \"version\": \"53\",\n \"ownedByMe\": true,\n \"isAppAuthorized\": false,\n \"capabilities\": {\n \"canChangeViewersCanCopyContent\": true,\n \"canEdit\": true,\n \"canCopy\": true,\n \"canComment\": true,\n \"canAddChildren\": false,\n \"canDelete\": true,\n \"canDownload\": true,\n \"canListChildren\": false,\n \"canRemoveChildren\": false,\n \"canRename\": true,\n \"canTrash\": true,\n \"canReadRevisions\": true,\n \"canChangeCopyRequiresWriterPermission\": true,\n \"canMoveItemIntoTeamDrive\": true,\n \"canUntrash\": true,\n \"canModifyContent\": true,\n \"canMoveItemOutOfDrive\": true,\n \"canAddMyDriveParent\": false,\n \"canRemoveMyDriveParent\": true,\n \"canMoveItemWithinDrive\": true,\n \"canShare\": true,\n \"canMoveChildrenWithinDrive\": false,\n \"canModifyContentRestriction\": true,\n \"canChangeSecurityUpdateEnabled\": false,\n \"canAcceptOwnership\": false,\n \"canReadLabels\": true,\n \"canModifyLabels\": true\n },\n \"thumbnailVersion\": \"12\",\n \"modifiedByMe\": true,\n \"permissionIds\": [\n \"07742336184153259483\"\n ],\n \"linkShareMetadata\": {\n \"securityUpdateEligible\": false,\n \"securityUpdateEnabled\": true\n }\n }\n}"); +export default { + "file": { + "kind": "drive#file", + "id": "1eWLQU_76tvfXptBGkdnjmPbpwhrOtkYS", + "name": "Quarterly Report.csv", + "mimeType": "text/csv", + "parents": [ + "1jPHKePO9_B4jDvpBFyAs38Ji_tCDdjxI", + ], + "createdTime": "2026-09-28T17:51:38.475Z", + "modifiedTime": "2026-09-28T18:04:12.918Z", + "trashed": false, + "version": "4", + "size": "2048", + "md5Checksum": "5d41402abc4b2a76b9719d911017c592", + "webViewLink": "https://drive.google.com/file/d/1eWLQU_76tvfXptBGkdnjmPbpwhrOtkYS/view?usp=drivesdk", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "John Doe", + "me": true, + "permissionId": "07742336189483", + "emailAddress": "john@doe.com", + "photoLink": "https://lh3.googleusercontent.com/a/default-user=s64", + }, + }, + "change": { + "state": "change", + "resourceURI": "https://www.googleapis.com/drive/v3/changes?alt=json&pageToken=1794", + }, +}; diff --git a/components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs b/components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs index 8313cdce049a8..8149feedc88b3 100644 --- a/components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs +++ b/components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs @@ -12,7 +12,7 @@ export default { key: "google_drive-new-or-modified-folders-polling", name: "New or Modified Folders (Polling)", description: "Emit new event when a folder is created or modified in the selected Drive", - version: "0.0.14", + version: "0.0.15", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs b/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs index 4e1a6631e0e12..0fc38c3fc98df 100644 --- a/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs +++ b/components/google_drive/sources/new-or-modified-folders/new-or-modified-folders.mjs @@ -21,7 +21,7 @@ export default { key: "google_drive-new-or-modified-folders", name: "New or Modified Folders (Instant)", description: "Emit new event when a folder is created or modified in the selected Drive", - version: "0.2.18", + version: "0.2.19", type: "source", // Dedupe events based on the "x-goog-message-number" header for the target channel: // https://developers.google.com/drive/api/v3/push#making-watch-requests diff --git a/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs b/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs index a61f8f3ad5cda..414992334272a 100644 --- a/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs +++ b/components/google_drive/sources/new-shared-drive/new-shared-drive.mjs @@ -5,7 +5,7 @@ export default { key: "google_drive-new-shared-drive", name: "New Shared Drive", description: "Emits a new event any time a shared drive is created.", - version: "0.1.25", + version: "0.1.26", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs b/components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs index 5b07a3e17a71b..52470eaa7a483 100644 --- a/components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs +++ b/components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs @@ -8,7 +8,7 @@ export default { key: "google_drive-new-spreadsheet-polling", name: "New Spreadsheet (Polling)", description: "Emit new event when a new spreadsheet is created in a drive.", - version: "0.0.13", + version: "0.0.14", type: "source", dedupe: "unique", props: { diff --git a/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs b/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs index ef00931f3e9ff..38e71ba7e5f92 100644 --- a/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs +++ b/components/google_drive/sources/new-spreadsheet/new-spreadsheet.mjs @@ -6,7 +6,7 @@ export default { type: "source", name: "New Spreadsheet (Instant)", description: "Emit new event when a new spreadsheet is created in a drive.", - version: "0.1.28", + version: "0.1.29", props: { googleDrive: newFilesInstant.props.googleDrive, db: newFilesInstant.props.db,