@pipedream/google_drive 1.10.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/actions/add-comment/add-comment.mjs +1 -1
  2. package/actions/add-file-sharing-preference/add-file-sharing-preference.mjs +1 -1
  3. package/actions/copy-file/copy-file.mjs +1 -1
  4. package/actions/create-file-from-template/create-file-from-template.mjs +1 -1
  5. package/actions/create-file-from-text/create-file-from-text.mjs +1 -1
  6. package/actions/create-folder/create-folder.mjs +1 -1
  7. package/actions/create-shared-drive/create-shared-drive.mjs +1 -1
  8. package/actions/create-text-file/create-text-file.mjs +102 -0
  9. package/actions/delete-comment/delete-comment.mjs +1 -1
  10. package/actions/delete-file/delete-file.mjs +1 -1
  11. package/actions/delete-reply/delete-reply.mjs +1 -1
  12. package/actions/delete-shared-drive/delete-shared-drive.mjs +1 -1
  13. package/actions/download-file/download-file.mjs +1 -1
  14. package/actions/find-file/find-file.mjs +1 -1
  15. package/actions/find-folder/find-folder.mjs +1 -1
  16. package/actions/find-forms/find-forms.mjs +1 -1
  17. package/actions/find-spreadsheets/find-spreadsheets.mjs +1 -1
  18. package/actions/get-comment/get-comment.mjs +1 -1
  19. package/actions/get-current-user/get-current-user.mjs +1 -1
  20. package/actions/get-file/get-file.mjs +48 -0
  21. package/actions/get-file-by-id/get-file-by-id.mjs +1 -1
  22. package/actions/get-folder-id-for-path/get-folder-id-for-path.mjs +1 -1
  23. package/actions/get-reply/get-reply.mjs +1 -1
  24. package/actions/get-shared-drive/get-shared-drive.mjs +1 -1
  25. package/actions/get-user-details/get-user-details.mjs +34 -0
  26. package/actions/is-folder-ancestor/is-folder-ancestor.mjs +1 -1
  27. package/actions/list-access-proposals/list-access-proposals.mjs +1 -1
  28. package/actions/list-comments/list-comments.mjs +1 -1
  29. package/actions/list-files/list-files.mjs +2 -6
  30. package/actions/list-mime-type-options/list-mime-type-options.mjs +1 -1
  31. package/actions/list-permissions/list-permissions.mjs +46 -0
  32. package/actions/list-replies/list-replies.mjs +1 -1
  33. package/actions/list-shared-drives/list-shared-drives.mjs +52 -0
  34. package/actions/list-theme-id-options/list-theme-id-options.mjs +1 -1
  35. package/actions/move-file/move-file.mjs +1 -1
  36. package/actions/move-file-to-trash/move-file-to-trash.mjs +1 -1
  37. package/actions/remove-file-sharing-permission/remove-file-sharing-permission.mjs +1 -1
  38. package/actions/remove-sharing/remove-sharing.mjs +50 -0
  39. package/actions/reply-to-comment/reply-to-comment.mjs +1 -1
  40. package/actions/resolve-access-proposal/resolve-access-proposal.mjs +1 -1
  41. package/actions/resolve-comment/resolve-comment.mjs +1 -1
  42. package/actions/search-files/search-files.mjs +82 -0
  43. package/actions/search-shared-drives/search-shared-drives.mjs +1 -1
  44. package/actions/share-file/share-file.mjs +86 -0
  45. package/actions/trash-file/trash-file.mjs +41 -0
  46. package/actions/update-comment/update-comment.mjs +1 -1
  47. package/actions/update-file/update-file.mjs +1 -1
  48. package/actions/update-reply/update-reply.mjs +1 -1
  49. package/actions/update-shared-drive/update-shared-drive.mjs +1 -1
  50. package/actions/upload-file/upload-file.mjs +1 -1
  51. package/common/utils.mjs +30 -7
  52. package/google_drive.app.mjs +1 -2
  53. package/package.json +1 -1
  54. package/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs +1 -1
  55. package/sources/changes-to-specific-files/changes-to-specific-files.mjs +1 -1
  56. package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +1 -1
  57. package/sources/common-webhook.mjs +1 -1
  58. package/sources/new-access-proposal/new-access-proposal.mjs +1 -1
  59. package/sources/new-files-instant/new-files-instant.mjs +1 -1
  60. package/sources/new-files-instant-polling/new-files-instant-polling.mjs +1 -1
  61. package/sources/new-files-shared-drive/new-files-shared-drive.mjs +1 -1
  62. package/sources/new-or-modified-comments/new-or-modified-comments.mjs +1 -1
  63. package/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs +1 -1
  64. package/sources/new-or-modified-files/new-or-modified-files.mjs +1 -1
  65. package/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs +1 -1
  66. package/sources/new-or-modified-folders/new-or-modified-folders.mjs +1 -1
  67. package/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs +1 -1
  68. package/sources/new-shared-drive/new-shared-drive.mjs +1 -1
  69. package/sources/new-spreadsheet/new-spreadsheet.mjs +1 -1
  70. package/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs +1 -1
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-add-comment",
5
5
  name: "Add Comment",
6
6
  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)",
7
- version: "0.1.6",
7
+ version: "0.1.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -20,7 +20,7 @@ export default {
20
20
  name: "Share File or Folder",
21
21
  description:
22
22
  "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)",
23
- version: "0.2.14",
23
+ version: "0.2.15",
24
24
  annotations: {
25
25
  destructiveHint: false,
26
26
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-copy-file",
5
5
  name: "Copy File",
6
6
  description: "Create a copy of the specified file. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/copy) for more information",
7
- version: "0.1.21",
7
+ version: "0.1.22",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -9,7 +9,7 @@ export default {
9
9
  key: "google_drive-create-file-from-template",
10
10
  name: "Create New File From Template",
11
11
  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)",
12
- version: "0.1.24",
12
+ version: "0.1.25",
13
13
  annotations: {
14
14
  destructiveHint: true,
15
15
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_drive-create-file-from-text",
6
6
  name: "Create New File From Text",
7
7
  description: "Create a new file from plain text. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information",
8
- version: "0.2.14",
8
+ version: "0.2.15",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -13,7 +13,7 @@ export default {
13
13
  key: "google_drive-create-folder",
14
14
  name: "Create Folder",
15
15
  description: "Create a new empty folder. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create) for more information",
16
- version: "0.1.22",
16
+ version: "0.1.23",
17
17
  annotations: {
18
18
  destructiveHint: false,
19
19
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-create-shared-drive",
5
5
  name: "Create Shared Drive",
6
6
  description: "Create a new shared drive. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/create) for more information",
7
- version: "0.1.22",
7
+ version: "0.1.23",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -0,0 +1,102 @@
1
+ import { Readable } from "stream";
2
+ import googleDrive from "../../google_drive.app.mjs";
3
+
4
+ export default {
5
+ key: "google_drive-create-text-file",
6
+ name: "Create Text File",
7
+ description:
8
+ "Create a new Google Doc from text content in Google Drive."
9
+ + " The file is created as a Google Docs document, which can be viewed and edited in the browser."
10
+ + " Use this when the user asks to create a document, write a file, or save text to Drive."
11
+ + " To place the file in a specific folder, pass the `parentId` — use **Search Files** with"
12
+ + " `mimeType = 'application/vnd.google-apps.folder'` to find the folder ID first."
13
+ + " Supported content formats: plain text, Markdown, HTML, Rich Text, CSV."
14
+ + " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create)",
15
+ version: "0.0.1",
16
+ type: "action",
17
+ annotations: {
18
+ destructiveHint: false,
19
+ openWorldHint: true,
20
+ readOnlyHint: false,
21
+ },
22
+ props: {
23
+ googleDrive,
24
+ name: {
25
+ type: "string",
26
+ label: "File Name",
27
+ description: "The name of the new file (e.g., 'Meeting Notes', 'Project Plan').",
28
+ },
29
+ content: {
30
+ type: "string",
31
+ label: "Content",
32
+ description: "The text content of the file.",
33
+ optional: true,
34
+ default: "",
35
+ },
36
+ mimeType: {
37
+ type: "string",
38
+ label: "Content Format",
39
+ description:
40
+ "The format of the content being provided. Defaults to plain text.",
41
+ optional: true,
42
+ default: "text/plain",
43
+ options: [
44
+ {
45
+ value: "text/plain",
46
+ label: "Plain Text",
47
+ },
48
+ {
49
+ value: "text/markdown",
50
+ label: "Markdown",
51
+ },
52
+ {
53
+ value: "text/html",
54
+ label: "HTML",
55
+ },
56
+ {
57
+ value: "application/rtf",
58
+ label: "Rich Text",
59
+ },
60
+ {
61
+ value: "text/csv",
62
+ label: "CSV",
63
+ },
64
+ ],
65
+ },
66
+ parentId: {
67
+ type: "string",
68
+ label: "Parent Folder ID",
69
+ description:
70
+ "The ID of the folder to create the file in."
71
+ + " Use **Search Files** with `mimeType = 'application/vnd.google-apps.folder'` to find folder IDs."
72
+ + " Omit to create in the root of My Drive.",
73
+ optional: true,
74
+ },
75
+ },
76
+ async run({ $ }) {
77
+ const file = Readable.from([
78
+ this.content,
79
+ ]);
80
+ const drive = this.googleDrive.drive();
81
+
82
+ const { data: resp } = await drive.files.create({
83
+ supportsAllDrives: true,
84
+ media: {
85
+ mimeType: this.mimeType,
86
+ body: file,
87
+ },
88
+ requestBody: {
89
+ name: this.name,
90
+ mimeType: "application/vnd.google-apps.document",
91
+ parents: this.parentId
92
+ ? [
93
+ this.parentId,
94
+ ]
95
+ : undefined,
96
+ },
97
+ });
98
+
99
+ $.export("$summary", `Created file: ${resp.name} (${resp.id})`);
100
+ return resp;
101
+ },
102
+ };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-delete-comment",
5
5
  name: "Delete Comment",
6
6
  description: "Delete a specific comment (Requires ownership or permissions). [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/delete)",
7
- version: "0.0.10",
7
+ version: "0.0.11",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Delete File",
6
6
  description:
7
7
  "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",
8
- version: "0.1.22",
8
+ version: "0.1.23",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-delete-reply",
5
5
  name: "Delete Reply",
6
6
  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",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-delete-shared-drive",
5
5
  name: "Delete Shared Drive",
6
6
  description: "Delete a shared drive without any content. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/delete) for more information",
7
- version: "0.1.21",
7
+ version: "0.1.22",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -31,7 +31,7 @@ export default {
31
31
  + " Pass `mimeType` to force a specific format. Shortcuts are resolved to their target automatically."
32
32
  + " Folders, Forms, and My Maps cannot be downloaded via this action."
33
33
  + " [See the documentation](https://developers.google.com/drive/api/v3/manage-downloads)",
34
- version: "0.1.25",
34
+ version: "0.1.26",
35
35
  annotations: {
36
36
  destructiveHint: false,
37
37
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "google_drive-find-file",
7
7
  name: "Find File",
8
8
  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",
9
- version: "0.1.22",
9
+ version: "0.1.23",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -7,7 +7,7 @@ export default {
7
7
  key: "google_drive-find-folder",
8
8
  name: "Find Folder",
9
9
  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",
10
- version: "0.1.22",
10
+ version: "0.1.23",
11
11
  annotations: {
12
12
  destructiveHint: false,
13
13
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "google_drive-find-forms",
7
7
  name: "Find Forms",
8
8
  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",
9
- version: "0.0.23",
9
+ version: "0.0.24",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "google_drive-find-spreadsheets",
7
7
  name: "Find Spreadsheets",
8
8
  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",
9
- version: "0.1.22",
9
+ version: "0.1.23",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-get-comment",
5
5
  name: "Get Comment By ID",
6
6
  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",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "google_drive-get-current-user",
7
7
  name: "Get Current User",
8
8
  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).",
9
- version: "0.0.8",
9
+ version: "0.0.9",
10
10
  type: "action",
11
11
  annotations: {
12
12
  destructiveHint: false,
@@ -0,0 +1,48 @@
1
+ import googleDrive from "../../google_drive.app.mjs";
2
+
3
+ export default {
4
+ key: "google_drive-get-file",
5
+ name: "Get File",
6
+ description:
7
+ "Get full metadata for a file or folder by its ID."
8
+ + " Returns name, MIME type, size, parent folders, sharing permissions, web links, creation/modification dates, and more."
9
+ + " Use **Search Files** first to find the file ID if you only have the file name."
10
+ + " By default returns all fields. Pass specific field names to `fields` to reduce the response size."
11
+ + "\n\nCommon fields: `id`, `name`, `mimeType`, `size`, `parents`, `webViewLink`, `webContentLink`,"
12
+ + " `createdTime`, `modifiedTime`, `owners`, `permissions`, `description`, `trashed`."
13
+ + " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/get)",
14
+ version: "0.0.1",
15
+ type: "action",
16
+ annotations: {
17
+ destructiveHint: false,
18
+ openWorldHint: true,
19
+ readOnlyHint: true,
20
+ },
21
+ props: {
22
+ googleDrive,
23
+ fileId: {
24
+ type: "string",
25
+ label: "File ID",
26
+ description:
27
+ "The ID of the file or folder to retrieve."
28
+ + " Use **Search Files** to find the file ID by name.",
29
+ },
30
+ fields: {
31
+ type: "string",
32
+ label: "Fields",
33
+ description:
34
+ "Comma-separated list of fields to include in the response."
35
+ + " Example: `id,name,mimeType,webViewLink,parents,permissions`."
36
+ + " Omit to return all fields.",
37
+ optional: true,
38
+ },
39
+ },
40
+ async run({ $ }) {
41
+ const response = await this.googleDrive.getFile(this.fileId, {
42
+ fields: this.fields || "*",
43
+ });
44
+
45
+ $.export("$summary", `Retrieved file: ${response.name}`);
46
+ return response;
47
+ },
48
+ };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_drive-get-file-by-id",
6
6
  name: "Get File By ID",
7
7
  description: "Get info on a specific file. [See the documentation](https://developers.google.com/drive/api/reference/rest/v3/files/get) for more information",
8
- version: "0.0.18",
8
+ version: "0.0.19",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -12,7 +12,7 @@ export default {
12
12
  key: "google_drive-get-folder-id-for-path",
13
13
  name: "Get Folder ID for a Path",
14
14
  description: "Retrieve a folderId for a path. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
15
- version: "0.1.23",
15
+ version: "0.1.24",
16
16
  annotations: {
17
17
  destructiveHint: false,
18
18
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-get-reply",
5
5
  name: "Get Reply By ID",
6
6
  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",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-get-shared-drive",
5
5
  name: "Get Shared Drive",
6
6
  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",
7
- version: "0.1.21",
7
+ version: "0.1.22",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -0,0 +1,34 @@
1
+ import googleDrive from "../../google_drive.app.mjs";
2
+
3
+ export default {
4
+ key: "google_drive-get-user-details",
5
+ name: "Get User Details",
6
+ description:
7
+ "Retrieve the authenticated user's Google Drive identity and storage quota."
8
+ + " Returns display name, email address, permission ID, and storage usage/limits."
9
+ + " Use this tool when the user asks 'who am I?' or needs their identity for owner-based queries."
10
+ + " When the user says 'my files' or 'my documents', call this first to get the owner email,"
11
+ + " then pass it to **Search Files** with a query like `'user@example.com' in owners`."
12
+ + " [See the documentation](https://developers.google.com/drive/api/v3/reference/about/get)",
13
+ version: "0.0.1",
14
+ type: "action",
15
+ annotations: {
16
+ destructiveHint: false,
17
+ openWorldHint: true,
18
+ readOnlyHint: true,
19
+ },
20
+ props: {
21
+ googleDrive,
22
+ },
23
+ async run({ $ }) {
24
+ const about = await this.googleDrive.getAbout("user,storageQuota");
25
+
26
+ const name =
27
+ about?.user?.displayName
28
+ || about?.user?.emailAddress
29
+ || about?.user?.permissionId;
30
+ $.export("$summary", `Retrieved Google Drive user: ${name}`);
31
+
32
+ return about;
33
+ },
34
+ };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-is-folder-ancestor",
5
5
  name: "Is Folder Ancestor",
6
6
  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)",
7
- version: "0.0.2",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-list-access-proposals",
5
5
  name: "List Access Proposals",
6
6
  description: "List access proposals for a file or folder. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/accessproposals/list)",
7
- version: "0.0.14",
7
+ version: "0.0.15",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-list-comments",
5
5
  name: "List Comments",
6
6
  description: "List all comments on a file. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/list)",
7
- version: "0.0.10",
7
+ version: "0.0.11",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -8,7 +8,7 @@ export default {
8
8
  key: "google_drive-list-files",
9
9
  name: "List Files",
10
10
  description: "List files from a specific folder. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/list) for more information",
11
- version: "0.2.3",
11
+ version: "0.3.0",
12
12
  annotations: {
13
13
  destructiveHint: false,
14
14
  openWorldHint: true,
@@ -85,11 +85,7 @@ export default {
85
85
  }
86
86
  const opts = getListFilesOpts(this.drive, {
87
87
  q: "",
88
- ...(this.limitToMyDrive
89
- ? {
90
- includeItemsFromAllDrives: false,
91
- }
92
- : {}),
88
+ limitToMyDrive: this.limitToMyDrive,
93
89
  });
94
90
  if (this.folderId) {
95
91
  opts.q = `"${this.folderId}" in parents`;
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-list-mime-type-options",
5
5
  name: "List Mime Type Options",
6
6
  description: "Retrieves available options for the Mime Type field.",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -0,0 +1,46 @@
1
+ import googleDrive from "../../google_drive.app.mjs";
2
+
3
+ export default {
4
+ key: "google_drive-list-permissions",
5
+ name: "List Permissions",
6
+ description:
7
+ "List sharing permissions on a file or folder in Google Drive."
8
+ + " Returns each permission's ID, type (user/group/domain/anyone), role (owner/writer/commenter/reader), and email address."
9
+ + " Use **Search Files** first to find the file ID by name."
10
+ + " Use this tool when the user asks 'who has access to this file?' or needs to audit sharing."
11
+ + " Pass permission IDs from this response to **Remove Sharing** to revoke access."
12
+ + " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/list)",
13
+ version: "0.0.1",
14
+ type: "action",
15
+ annotations: {
16
+ destructiveHint: false,
17
+ openWorldHint: true,
18
+ readOnlyHint: true,
19
+ },
20
+ props: {
21
+ googleDrive,
22
+ fileId: {
23
+ type: "string",
24
+ label: "File ID",
25
+ description:
26
+ "The ID of the file or folder to list permissions for."
27
+ + " Use **Search Files** to find the file ID by name.",
28
+ },
29
+ },
30
+ async run({ $ }) {
31
+ const allPermissions = [];
32
+ let pageToken;
33
+ do {
34
+ const {
35
+ permissions = [], nextPageToken,
36
+ } = await this.googleDrive.listPermissions(pageToken, this.fileId);
37
+ allPermissions.push(...permissions);
38
+ pageToken = nextPageToken;
39
+ } while (pageToken);
40
+
41
+ $.export("$summary", `Found ${allPermissions.length} permission${allPermissions.length === 1
42
+ ? ""
43
+ : "s"}`);
44
+ return allPermissions;
45
+ },
46
+ };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-list-replies",
5
5
  name: "List Replies",
6
6
  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",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -0,0 +1,52 @@
1
+ import googleDrive from "../../google_drive.app.mjs";
2
+
3
+ export default {
4
+ key: "google_drive-list-shared-drives",
5
+ name: "List Shared Drives",
6
+ description:
7
+ "List shared drives accessible to the authenticated user."
8
+ + " Returns drive IDs, names, and metadata for each shared drive."
9
+ + " Use this when the user asks about their shared drives or needs to scope a search to a specific drive."
10
+ + " Pass a drive ID to **Search Files** `driveId` parameter to search within a specific shared drive."
11
+ + " Optionally filter by name using the `query` parameter (e.g., `name contains 'Engineering'`)."
12
+ + " [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/list)",
13
+ version: "0.0.1",
14
+ type: "action",
15
+ annotations: {
16
+ destructiveHint: false,
17
+ openWorldHint: true,
18
+ readOnlyHint: true,
19
+ },
20
+ props: {
21
+ googleDrive,
22
+ query: {
23
+ type: "string",
24
+ label: "Query",
25
+ description:
26
+ "Optional. Filter shared drives by name."
27
+ + " Example: `name contains 'Marketing'`."
28
+ + " Omit to list all shared drives.",
29
+ optional: true,
30
+ },
31
+ },
32
+ async run({ $ }) {
33
+ const allDrives = [];
34
+ let pageToken;
35
+ do {
36
+ const {
37
+ drives = [], nextPageToken,
38
+ } = await this.googleDrive.searchDrives({
39
+ q: this.query,
40
+ pageToken,
41
+ pageSize: 100,
42
+ });
43
+ allDrives.push(...drives);
44
+ pageToken = nextPageToken;
45
+ } while (pageToken);
46
+
47
+ $.export("$summary", `Found ${allDrives.length} shared drive${allDrives.length === 1
48
+ ? ""
49
+ : "s"}`);
50
+ return allDrives;
51
+ },
52
+ };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-list-theme-id-options",
5
5
  name: "List Theme ID Options",
6
6
  description: "Retrieves available options for the Theme ID field.",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "google_drive-move-file",
5
5
  name: "Move File",
6
6
  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",
7
- version: "0.1.21",
7
+ version: "0.1.22",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_drive-move-file-to-trash",
6
6
  name: "Move File to Trash",
7
7
  description: "Move a file or folder to trash. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update) for more information",
8
- version: "0.1.21",
8
+ version: "0.1.22",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "Remove File Sharing Permission",
7
7
  description:
8
8
  "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)",
9
- version: "0.0.6",
9
+ version: "0.0.7",
10
10
  annotations: {
11
11
  destructiveHint: true,
12
12
  openWorldHint: true,