@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.
- package/actions/add-comment/add-comment.mjs +1 -1
- package/actions/add-file-sharing-preference/add-file-sharing-preference.mjs +1 -1
- package/actions/copy-file/copy-file.mjs +1 -1
- package/actions/create-file-from-template/create-file-from-template.mjs +1 -1
- package/actions/create-file-from-text/create-file-from-text.mjs +1 -1
- package/actions/create-folder/create-folder.mjs +1 -1
- package/actions/create-shared-drive/create-shared-drive.mjs +1 -1
- package/actions/create-text-file/create-text-file.mjs +102 -0
- package/actions/delete-comment/delete-comment.mjs +1 -1
- package/actions/delete-file/delete-file.mjs +1 -1
- package/actions/delete-reply/delete-reply.mjs +1 -1
- package/actions/delete-shared-drive/delete-shared-drive.mjs +1 -1
- package/actions/download-file/download-file.mjs +1 -1
- package/actions/find-file/find-file.mjs +1 -1
- package/actions/find-folder/find-folder.mjs +1 -1
- package/actions/find-forms/find-forms.mjs +1 -1
- package/actions/find-spreadsheets/find-spreadsheets.mjs +1 -1
- package/actions/get-comment/get-comment.mjs +1 -1
- package/actions/get-current-user/get-current-user.mjs +1 -1
- package/actions/get-file/get-file.mjs +48 -0
- package/actions/get-file-by-id/get-file-by-id.mjs +1 -1
- package/actions/get-folder-id-for-path/get-folder-id-for-path.mjs +1 -1
- package/actions/get-reply/get-reply.mjs +1 -1
- package/actions/get-shared-drive/get-shared-drive.mjs +1 -1
- package/actions/get-user-details/get-user-details.mjs +34 -0
- package/actions/is-folder-ancestor/is-folder-ancestor.mjs +1 -1
- package/actions/list-access-proposals/list-access-proposals.mjs +1 -1
- package/actions/list-comments/list-comments.mjs +1 -1
- package/actions/list-files/list-files.mjs +2 -6
- package/actions/list-mime-type-options/list-mime-type-options.mjs +1 -1
- package/actions/list-permissions/list-permissions.mjs +46 -0
- package/actions/list-replies/list-replies.mjs +1 -1
- package/actions/list-shared-drives/list-shared-drives.mjs +52 -0
- package/actions/list-theme-id-options/list-theme-id-options.mjs +1 -1
- package/actions/move-file/move-file.mjs +1 -1
- package/actions/move-file-to-trash/move-file-to-trash.mjs +1 -1
- package/actions/remove-file-sharing-permission/remove-file-sharing-permission.mjs +1 -1
- package/actions/remove-sharing/remove-sharing.mjs +50 -0
- package/actions/reply-to-comment/reply-to-comment.mjs +1 -1
- package/actions/resolve-access-proposal/resolve-access-proposal.mjs +1 -1
- package/actions/resolve-comment/resolve-comment.mjs +1 -1
- package/actions/search-files/search-files.mjs +82 -0
- package/actions/search-shared-drives/search-shared-drives.mjs +1 -1
- package/actions/share-file/share-file.mjs +86 -0
- package/actions/trash-file/trash-file.mjs +41 -0
- package/actions/update-comment/update-comment.mjs +1 -1
- package/actions/update-file/update-file.mjs +1 -1
- package/actions/update-reply/update-reply.mjs +1 -1
- package/actions/update-shared-drive/update-shared-drive.mjs +1 -1
- package/actions/upload-file/upload-file.mjs +1 -1
- package/common/utils.mjs +30 -7
- package/google_drive.app.mjs +1 -2
- package/package.json +1 -1
- package/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs +1 -1
- package/sources/changes-to-specific-files/changes-to-specific-files.mjs +1 -1
- package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +1 -1
- package/sources/common-webhook.mjs +1 -1
- package/sources/new-access-proposal/new-access-proposal.mjs +1 -1
- package/sources/new-files-instant/new-files-instant.mjs +1 -1
- package/sources/new-files-instant-polling/new-files-instant-polling.mjs +1 -1
- package/sources/new-files-shared-drive/new-files-shared-drive.mjs +1 -1
- package/sources/new-or-modified-comments/new-or-modified-comments.mjs +1 -1
- package/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs +1 -1
- package/sources/new-or-modified-files/new-or-modified-files.mjs +1 -1
- package/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs +1 -1
- package/sources/new-or-modified-folders/new-or-modified-folders.mjs +1 -1
- package/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs +1 -1
- package/sources/new-shared-drive/new-shared-drive.mjs +1 -1
- package/sources/new-spreadsheet/new-spreadsheet.mjs +1 -1
- package/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import googleDrive from "../../google_drive.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_drive-remove-sharing",
|
|
5
|
+
name: "Remove Sharing",
|
|
6
|
+
description:
|
|
7
|
+
"Remove a sharing permission from a file or folder in Google Drive."
|
|
8
|
+
+ " This revokes access for the specified permission."
|
|
9
|
+
+ " Use **List Permissions** first to find the permission ID to remove."
|
|
10
|
+
+ " The owner permission cannot be removed."
|
|
11
|
+
+ " Use **Search Files** to find the file ID by name if needed."
|
|
12
|
+
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/delete)",
|
|
13
|
+
version: "0.0.1",
|
|
14
|
+
type: "action",
|
|
15
|
+
annotations: {
|
|
16
|
+
destructiveHint: true,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: false,
|
|
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 remove the sharing permission from."
|
|
27
|
+
+ " Use **Search Files** to find the file ID by name.",
|
|
28
|
+
},
|
|
29
|
+
permissionId: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "Permission ID",
|
|
32
|
+
description:
|
|
33
|
+
"The ID of the permission to remove."
|
|
34
|
+
+ " Use **List Permissions** to find the permission ID.",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
async run({ $ }) {
|
|
38
|
+
await this.googleDrive.deletePermission({
|
|
39
|
+
fileId: this.fileId,
|
|
40
|
+
permissionId: this.permissionId,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
$.export("$summary", `Removed permission ${this.permissionId} from file ${this.fileId}`);
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
fileId: this.fileId,
|
|
47
|
+
permissionId: this.permissionId,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-reply-to-comment",
|
|
5
5
|
name: "Reply to Comment",
|
|
6
6
|
description: "Add a reply to an existing comment. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/replies/create)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_drive-resolve-access-proposal",
|
|
6
6
|
name: "Resolve Access Proposals",
|
|
7
7
|
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)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.15",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-resolve-comment",
|
|
5
5
|
name: "Resolve Comment",
|
|
6
6
|
description: "Mark a comment as resolved. [See the documentation](https://developers.google.com/workspace/drive/api/reference/rest/v3/comments/update)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { getListFilesOpts } from "../../common/utils.mjs";
|
|
2
|
+
import googleDrive from "../../google_drive.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "google_drive-search-files",
|
|
6
|
+
name: "Search Files",
|
|
7
|
+
description:
|
|
8
|
+
"Search for files and folders in Google Drive using the Drive query language."
|
|
9
|
+
+ " This is the primary tool for finding files, folders, spreadsheets, forms, and any other Drive item."
|
|
10
|
+
+ " Returns matching files with their IDs, names, MIME types, and parent folder IDs."
|
|
11
|
+
+ "\n\n**Query syntax** — pass a Drive search query string. Examples:"
|
|
12
|
+
+ "\n- Find by name: `name contains 'Budget'`"
|
|
13
|
+
+ "\n- Exact name match: `name = 'Q4 Report'`"
|
|
14
|
+
+ "\n- Folders only: `mimeType = 'application/vnd.google-apps.folder'`"
|
|
15
|
+
+ "\n- Google Docs: `mimeType = 'application/vnd.google-apps.document'`"
|
|
16
|
+
+ "\n- Spreadsheets: `mimeType = 'application/vnd.google-apps.spreadsheet'`"
|
|
17
|
+
+ "\n- Files in a folder: `'FOLDER_ID' in parents`"
|
|
18
|
+
+ "\n- Not trashed: `trashed = false`"
|
|
19
|
+
+ "\n- Modified after date: `modifiedTime > '2024-01-01T00:00:00'`"
|
|
20
|
+
+ "\n- Combine with AND: `name contains 'Report' and mimeType = 'application/vnd.google-apps.document'`"
|
|
21
|
+
+ "\n- Owner filter: `'user@example.com' in owners`"
|
|
22
|
+
+ "\n\nWhen the user says 'my files', use **Get User Details** first to get the owner email."
|
|
23
|
+
+ " To scope to a shared drive, pass the `driveId` from **List Shared Drives**."
|
|
24
|
+
+ " [See the documentation](https://developers.google.com/drive/api/v3/search-files)",
|
|
25
|
+
version: "0.0.1",
|
|
26
|
+
type: "action",
|
|
27
|
+
annotations: {
|
|
28
|
+
destructiveHint: false,
|
|
29
|
+
openWorldHint: true,
|
|
30
|
+
readOnlyHint: true,
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
googleDrive,
|
|
34
|
+
query: {
|
|
35
|
+
type: "string",
|
|
36
|
+
label: "Query",
|
|
37
|
+
description:
|
|
38
|
+
"A Drive search query string. See the tool description for syntax examples."
|
|
39
|
+
+ " Common queries: `name contains 'keyword'`, `mimeType = 'application/vnd.google-apps.folder'`,"
|
|
40
|
+
+ " `'FOLDER_ID' in parents`, `trashed = false`.",
|
|
41
|
+
},
|
|
42
|
+
driveId: {
|
|
43
|
+
type: "string",
|
|
44
|
+
label: "Drive ID",
|
|
45
|
+
description:
|
|
46
|
+
"Optional. Scope the search to a specific shared drive."
|
|
47
|
+
+ " Use **List Shared Drives** to find available drive IDs."
|
|
48
|
+
+ " Omit to search My Drive.",
|
|
49
|
+
optional: true,
|
|
50
|
+
},
|
|
51
|
+
includeItemsFromAllDrives: {
|
|
52
|
+
type: "boolean",
|
|
53
|
+
label: "Include Items From All Drives",
|
|
54
|
+
description:
|
|
55
|
+
"If true, include results from all drives (My Drive and shared drives)."
|
|
56
|
+
+ " Defaults to false.",
|
|
57
|
+
optional: true,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
async run({ $ }) {
|
|
62
|
+
const opts = getListFilesOpts(this.driveId, {
|
|
63
|
+
q: this.query,
|
|
64
|
+
includeItemsFromAllDrives: this.includeItemsFromAllDrives,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const allFiles = [];
|
|
68
|
+
let pageToken;
|
|
69
|
+
do {
|
|
70
|
+
const {
|
|
71
|
+
files, nextPageToken,
|
|
72
|
+
} = await this.googleDrive.listFilesInPage(pageToken, opts);
|
|
73
|
+
allFiles.push(...files);
|
|
74
|
+
pageToken = nextPageToken;
|
|
75
|
+
} while (pageToken);
|
|
76
|
+
|
|
77
|
+
$.export("$summary", `Found ${allFiles.length} file${allFiles.length === 1
|
|
78
|
+
? ""
|
|
79
|
+
: "s"} matching query "${this.query}"`);
|
|
80
|
+
return allFiles;
|
|
81
|
+
},
|
|
82
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-search-shared-drives",
|
|
5
5
|
name: "Search for Shared Drives",
|
|
6
6
|
description: "Search for shared drives with query options. [See the documentation](https://developers.google.com/drive/api/v3/search-shareddrives) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.23",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import googleDrive from "../../google_drive.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_drive-share-file",
|
|
5
|
+
name: "Share File",
|
|
6
|
+
description:
|
|
7
|
+
"Share a file or folder in Google Drive by creating a sharing permission."
|
|
8
|
+
+ " Supports sharing with a specific user, a group, an entire domain, or anyone with the link."
|
|
9
|
+
+ " Use **Search Files** first to find the file ID by name."
|
|
10
|
+
+ "\n\n**Sharing types:**"
|
|
11
|
+
+ "\n- `user` — share with a specific person (requires `emailAddress`)"
|
|
12
|
+
+ "\n- `group` — share with a Google Group (requires `emailAddress`)"
|
|
13
|
+
+ "\n- `domain` — share with everyone in a Google Workspace domain (requires `domain`)"
|
|
14
|
+
+ "\n- `anyone` — share with anyone who has the link (no email/domain needed)"
|
|
15
|
+
+ "\n\n**Roles:** `reader` (view only), `commenter` (can comment), `writer` (can edit)."
|
|
16
|
+
+ " Use **List Permissions** to see existing sharing on a file."
|
|
17
|
+
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/create)",
|
|
18
|
+
version: "0.0.1",
|
|
19
|
+
type: "action",
|
|
20
|
+
annotations: {
|
|
21
|
+
destructiveHint: false,
|
|
22
|
+
openWorldHint: true,
|
|
23
|
+
readOnlyHint: false,
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
googleDrive,
|
|
27
|
+
fileId: {
|
|
28
|
+
type: "string",
|
|
29
|
+
label: "File ID",
|
|
30
|
+
description:
|
|
31
|
+
"The ID of the file or folder to share."
|
|
32
|
+
+ " Use **Search Files** to find the file ID by name.",
|
|
33
|
+
},
|
|
34
|
+
type: {
|
|
35
|
+
type: "string",
|
|
36
|
+
label: "Type",
|
|
37
|
+
description:
|
|
38
|
+
"The type of grantee: `user`, `group`, `domain`, or `anyone`.",
|
|
39
|
+
options: [
|
|
40
|
+
"user",
|
|
41
|
+
"group",
|
|
42
|
+
"domain",
|
|
43
|
+
"anyone",
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
role: {
|
|
47
|
+
type: "string",
|
|
48
|
+
label: "Role",
|
|
49
|
+
description:
|
|
50
|
+
"The access level to grant: `reader` (view), `commenter` (comment), or `writer` (edit).",
|
|
51
|
+
options: [
|
|
52
|
+
"reader",
|
|
53
|
+
"commenter",
|
|
54
|
+
"writer",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
emailAddress: {
|
|
58
|
+
type: "string",
|
|
59
|
+
label: "Email Address",
|
|
60
|
+
description:
|
|
61
|
+
"The email address of the user or group to share with."
|
|
62
|
+
+ " Required when type is `user` or `group`. Ignored for `domain` and `anyone`.",
|
|
63
|
+
optional: true,
|
|
64
|
+
},
|
|
65
|
+
domain: {
|
|
66
|
+
type: "string",
|
|
67
|
+
label: "Domain",
|
|
68
|
+
description:
|
|
69
|
+
"The Google Workspace domain to share with (e.g., `example.com`)."
|
|
70
|
+
+ " Required when type is `domain`. Ignored for other types.",
|
|
71
|
+
optional: true,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
async run({ $ }) {
|
|
75
|
+
const resp = await this.googleDrive.createPermission(this.fileId, {
|
|
76
|
+
role: this.role,
|
|
77
|
+
type: this.type,
|
|
78
|
+
emailAddress: this.emailAddress,
|
|
79
|
+
domain: this.domain,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const target = this.emailAddress || this.domain || this.type;
|
|
83
|
+
$.export("$summary", `Shared file with ${target} as ${this.role}`);
|
|
84
|
+
return resp;
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import googleDrive from "../../google_drive.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "google_drive-trash-file",
|
|
5
|
+
name: "Trash File",
|
|
6
|
+
description:
|
|
7
|
+
"Move a file or folder to the trash in Google Drive."
|
|
8
|
+
+ " This is a reversible operation — the file can be restored from trash within 30 days."
|
|
9
|
+
+ " Use **Search Files** first to find the file ID by name."
|
|
10
|
+
+ " Use this instead of permanent deletion as the safer default."
|
|
11
|
+
+ " To find trashed files, use **Search Files** with `trashed = true`."
|
|
12
|
+
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update)",
|
|
13
|
+
version: "0.0.1",
|
|
14
|
+
type: "action",
|
|
15
|
+
annotations: {
|
|
16
|
+
destructiveHint: true,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: false,
|
|
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 move to trash."
|
|
27
|
+
+ " Use **Search Files** to find the file ID by name.",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
async run({ $ }) {
|
|
31
|
+
const resp = await this.googleDrive.updateFile(this.fileId, {
|
|
32
|
+
requestBody: {
|
|
33
|
+
trashed: true,
|
|
34
|
+
},
|
|
35
|
+
fields: "*",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
$.export("$summary", `Moved to trash: ${resp.name} (${resp.id})`);
|
|
39
|
+
return resp;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-update-comment",
|
|
5
5
|
name: "Update Comment",
|
|
6
6
|
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",
|
|
7
|
-
version: "0.0.
|
|
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-update-file",
|
|
7
7
|
name: "Update File",
|
|
8
8
|
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",
|
|
9
|
-
version: "2.0.
|
|
9
|
+
version: "2.0.14",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: true,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_drive-update-reply",
|
|
5
5
|
name: "Update Reply",
|
|
6
6
|
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",
|
|
7
|
-
version: "0.0.
|
|
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-update-shared-drive",
|
|
5
5
|
name: "Update Shared Drive",
|
|
6
6
|
description: "Update an existing shared drive. [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/update) for more information",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.22",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
key: "google_drive-upload-file",
|
|
14
14
|
name: "Upload File",
|
|
15
15
|
description: "Upload a file to Google Drive. [See the documentation](https://developers.google.com/drive/api/v3/manage-uploads) for more information",
|
|
16
|
-
version: "2.0.
|
|
16
|
+
version: "2.0.15",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
package/common/utils.mjs
CHANGED
|
@@ -48,23 +48,46 @@ function getListFilesOpts(drive, baseOpts = {}) {
|
|
|
48
48
|
// empty or is "My Drive". Otherwise, use the "drive" corpus and include
|
|
49
49
|
// `supportsAllDrives` param.
|
|
50
50
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const {
|
|
52
|
+
limitToMyDrive, ...rest
|
|
53
|
+
} = baseOpts;
|
|
54
|
+
|
|
55
|
+
if (drive && isMyDrive(drive)) {
|
|
56
|
+
return {
|
|
57
|
+
...rest,
|
|
58
|
+
corpora: "user",
|
|
54
59
|
supportsAllDrives: true,
|
|
55
|
-
}
|
|
56
|
-
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (drive && !isMyDrive(drive)) {
|
|
64
|
+
return {
|
|
57
65
|
// Google's `files.list` API requires `includeItemsFromAllDrives: true`
|
|
58
66
|
// whenever `driveId` is set or `corpora` is `drive`/`allDrives`.
|
|
59
67
|
// Placed before the spread so callers (e.g. list-files's
|
|
60
68
|
// `limitToMyDrive` toggle) can still override.
|
|
61
69
|
includeItemsFromAllDrives: true,
|
|
62
|
-
...
|
|
70
|
+
...rest,
|
|
63
71
|
corpora: "drive",
|
|
64
72
|
driveId: getDriveId(drive),
|
|
65
73
|
supportsAllDrives: true,
|
|
66
74
|
};
|
|
67
|
-
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (limitToMyDrive) {
|
|
78
|
+
return {
|
|
79
|
+
...rest,
|
|
80
|
+
supportsAllDrives: true,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// No specific drive selected — search across all drives by default.
|
|
85
|
+
return {
|
|
86
|
+
includeItemsFromAllDrives: true,
|
|
87
|
+
...rest,
|
|
88
|
+
corpora: "allDrives",
|
|
89
|
+
supportsAllDrives: true,
|
|
90
|
+
};
|
|
68
91
|
}
|
|
69
92
|
|
|
70
93
|
function streamToBuffer(stream) {
|
package/google_drive.app.mjs
CHANGED
|
@@ -32,9 +32,8 @@ export default {
|
|
|
32
32
|
watchedDrive: {
|
|
33
33
|
type: "string",
|
|
34
34
|
label: "Drive",
|
|
35
|
-
description: "Defaults to
|
|
35
|
+
description: "Select a specific drive to search. Defaults to **All Drives** (My Drive and all Shared Drives you have access to) when no selection is made. To limit to your personal drive or a [Shared Drive](https://support.google.com/a/users/answer/9310351), select it from this list.",
|
|
36
36
|
optional: true,
|
|
37
|
-
default: MY_DRIVE_VALUE,
|
|
38
37
|
async options({ prevContext }) {
|
|
39
38
|
const { nextPageToken } = prevContext;
|
|
40
39
|
return this._listDriveOptions(nextPageToken);
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ export default {
|
|
|
14
14
|
key: "google_drive-changes-to-files-in-drive",
|
|
15
15
|
name: "Changes to Files in Drive",
|
|
16
16
|
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)",
|
|
17
|
-
version: "0.0.
|
|
17
|
+
version: "0.0.10",
|
|
18
18
|
type: "source",
|
|
19
19
|
dedupe: "unique",
|
|
20
20
|
props: {
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
key: "google_drive-changes-to-specific-files",
|
|
17
17
|
name: "Changes to Specific Files",
|
|
18
18
|
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.",
|
|
19
|
-
version: "0.3.
|
|
19
|
+
version: "0.3.9",
|
|
20
20
|
type: "source",
|
|
21
21
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
22
22
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs
CHANGED
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
key: "google_drive-changes-to-specific-files-shared-drive",
|
|
30
30
|
name: "Changes to Specific Files (Shared Drive)",
|
|
31
31
|
description: "Watches for changes to specific files in a shared drive, emitting an event when a change is made to one of those files",
|
|
32
|
-
version: "0.3.
|
|
32
|
+
version: "0.3.10",
|
|
33
33
|
type: "source",
|
|
34
34
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
35
35
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
googleDrive,
|
|
20
20
|
"watchedDrive",
|
|
21
21
|
],
|
|
22
|
-
description: "Defaults to My Drive. To
|
|
22
|
+
description: "Defaults to **All Drives** (My Drive and all Shared Drives you have access to) when no selection is made. To limit to your personal drive or a [Shared Drive](https://support.google.com/a/users/answer/9310351), select it from this list.",
|
|
23
23
|
optional: false,
|
|
24
24
|
},
|
|
25
25
|
timer: {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_drive-new-access-proposal",
|
|
7
7
|
name: "New Access Proposal",
|
|
8
8
|
description: "Emit new event when a new access proposal is requested in Google Drive",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.14",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
key: "google_drive-new-files-instant",
|
|
12
12
|
name: "New Files (Instant)",
|
|
13
13
|
description: "Emit new event when a new file is added in your linked Google Drive",
|
|
14
|
-
version: "0.2.
|
|
14
|
+
version: "0.2.10",
|
|
15
15
|
type: "source",
|
|
16
16
|
dedupe: "unique",
|
|
17
17
|
props: {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "google_drive-new-files-instant-polling",
|
|
9
9
|
name: "New Files (Polling)",
|
|
10
10
|
description: "Emit new event when a new file is added in your linked Google Drive",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.8",
|
|
12
12
|
type: "source",
|
|
13
13
|
dedupe: "unique",
|
|
14
14
|
props: {
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "google_drive-new-files-shared-drive",
|
|
8
8
|
name: "New Files (Shared Drive)",
|
|
9
9
|
description: "Emit new event when a new file is added in your shared Google Drive",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.10",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
props: {
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
name: "New or Modified Comments (Instant)",
|
|
19
19
|
description:
|
|
20
20
|
"Emit new event when a comment is created or modified in the selected file",
|
|
21
|
-
version: "1.0.
|
|
21
|
+
version: "1.0.19",
|
|
22
22
|
type: "source",
|
|
23
23
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
24
24
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "google_drive-new-or-modified-comments-polling",
|
|
8
8
|
name: "New or Modified Comments (Polling)",
|
|
9
9
|
description: "Emit new event when a comment is created or modified in the selected file",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.9",
|
|
11
11
|
type: "source",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
props: {
|
|
@@ -26,7 +26,7 @@ export default {
|
|
|
26
26
|
key: "google_drive-new-or-modified-files",
|
|
27
27
|
name: "New or Modified Files (Instant)",
|
|
28
28
|
description: "Emit new event when a file in the selected Drive is created, modified or trashed.",
|
|
29
|
-
version: "0.4.
|
|
29
|
+
version: "0.4.10",
|
|
30
30
|
type: "source",
|
|
31
31
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
32
32
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
key: "google_drive-new-or-modified-files-polling",
|
|
10
10
|
name: "New or Modified Files (Polling)",
|
|
11
11
|
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)",
|
|
12
|
-
version: "0.0.
|
|
12
|
+
version: "0.0.10",
|
|
13
13
|
type: "source",
|
|
14
14
|
dedupe: "unique",
|
|
15
15
|
props: {
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
key: "google_drive-new-or-modified-folders",
|
|
22
22
|
name: "New or Modified Folders (Instant)",
|
|
23
23
|
description: "Emit new event when a folder is created or modified in the selected Drive",
|
|
24
|
-
version: "0.2.
|
|
24
|
+
version: "0.2.13",
|
|
25
25
|
type: "source",
|
|
26
26
|
// Dedupe events based on the "x-goog-message-number" header for the target channel:
|
|
27
27
|
// https://developers.google.com/drive/api/v3/push#making-watch-requests
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
key: "google_drive-new-or-modified-folders-polling",
|
|
13
13
|
name: "New or Modified Folders (Polling)",
|
|
14
14
|
description: "Emit new event when a folder is created or modified in the selected Drive",
|
|
15
|
-
version: "0.0.
|
|
15
|
+
version: "0.0.9",
|
|
16
16
|
type: "source",
|
|
17
17
|
dedupe: "unique",
|
|
18
18
|
props: {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
type: "source",
|
|
7
7
|
name: "New Spreadsheet (Instant)",
|
|
8
8
|
description: "Emit new event when a new spreadsheet is created in a drive.",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.24",
|
|
10
10
|
props: {
|
|
11
11
|
googleDrive: newFilesInstant.props.googleDrive,
|
|
12
12
|
db: newFilesInstant.props.db,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "google_drive-new-spreadsheet-polling",
|
|
9
9
|
name: "New Spreadsheet (Polling)",
|
|
10
10
|
description: "Emit new event when a new spreadsheet is created in a drive.",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.8",
|
|
12
12
|
type: "source",
|
|
13
13
|
dedupe: "unique",
|
|
14
14
|
props: {
|