@pipedream/google_drive 1.12.1 → 2.0.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 +1 -1
- 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 +142 -80
- 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 +1 -1
- 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 +1 -1
- 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 +78 -27
- package/actions/list-mime-type-options/list-mime-type-options.mjs +1 -1
- package/actions/list-permissions/list-permissions.mjs +1 -1
- package/actions/list-replies/list-replies.mjs +1 -1
- package/actions/list-shared-drives/list-shared-drives.mjs +1 -1
- 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 +1 -1
- 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 +1 -1
- package/actions/search-shared-drives/search-shared-drives.mjs +1 -1
- package/actions/share-file/share-file.mjs +1 -1
- package/actions/trash-file/trash-file.mjs +1 -1
- 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/constants.mjs +9 -0
- 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/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
|
@@ -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.
|
|
7
|
+
version: "0.1.8",
|
|
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.
|
|
23
|
+
version: "0.2.16",
|
|
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.
|
|
7
|
+
version: "0.1.23",
|
|
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.
|
|
12
|
+
version: "0.1.26",
|
|
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.
|
|
8
|
+
version: "0.2.16",
|
|
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.
|
|
16
|
+
version: "0.1.24",
|
|
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.
|
|
7
|
+
version: "0.1.24",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
+ " `mimeType = 'application/vnd.google-apps.folder'` to find the folder ID first."
|
|
13
13
|
+ " Supported content formats: plain text, Markdown, HTML, Rich Text, CSV."
|
|
14
14
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/create)",
|
|
15
|
-
version: "0.0.
|
|
15
|
+
version: "0.0.2",
|
|
16
16
|
type: "action",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
@@ -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.
|
|
7
|
+
version: "0.0.12",
|
|
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.
|
|
8
|
+
version: "0.1.24",
|
|
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
|
+
version: "0.0.9",
|
|
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.
|
|
7
|
+
version: "0.1.23",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
1
2
|
import fs from "fs";
|
|
2
3
|
import stream from "stream";
|
|
3
4
|
import { promisify } from "util";
|
|
@@ -24,14 +25,15 @@ const SHORTCUT_MIME_TYPE = "application/vnd.google-apps.shortcut";
|
|
|
24
25
|
export default {
|
|
25
26
|
key: "google_drive-download-file",
|
|
26
27
|
name: "Download File",
|
|
27
|
-
description: "Download
|
|
28
|
+
description: "Download one or more files from Google Drive to the `/tmp` directory or return their contents as buffers."
|
|
29
|
+
+ " Select multiple files to download a batch in a single run."
|
|
28
30
|
+ " Use to fetch a file's contents for processing in downstream steps — e.g., parsing a CSV, extracting text from a PDF, or re-uploading to another service."
|
|
29
31
|
+ " For Google Workspace files (Docs, Sheets, Slides, Drawings, Apps Script), exports to an Office-compatible format by default:"
|
|
30
32
|
+ " Docs → `.docx`, Sheets → `.xlsx`, Slides → `.pptx`, Drawings → PNG, Apps Script → JSON."
|
|
31
33
|
+ " Pass `mimeType` to force a specific format. Shortcuts are resolved to their target automatically."
|
|
32
34
|
+ " Folders, Forms, and My Maps cannot be downloaded via this action."
|
|
33
35
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/manage-downloads)",
|
|
34
|
-
version: "0.
|
|
36
|
+
version: "0.2.0",
|
|
35
37
|
annotations: {
|
|
36
38
|
destructiveHint: false,
|
|
37
39
|
openWorldHint: true,
|
|
@@ -48,6 +50,19 @@ export default {
|
|
|
48
50
|
description: "The shared drive the file is in, if any. Leave empty for files in My Drive.",
|
|
49
51
|
optional: true,
|
|
50
52
|
},
|
|
53
|
+
fileIds: {
|
|
54
|
+
propDefinition: [
|
|
55
|
+
googleDrive,
|
|
56
|
+
"fileId",
|
|
57
|
+
(c) => ({
|
|
58
|
+
drive: c.drive,
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
type: "string[]",
|
|
62
|
+
label: "Files",
|
|
63
|
+
description: "The Google Drive file(s) to download. Select one or more files to download a batch in a single run. Accepts file IDs (opaque Drive identifiers). Shortcuts are resolved to their target automatically.",
|
|
64
|
+
optional: true,
|
|
65
|
+
},
|
|
51
66
|
fileId: {
|
|
52
67
|
propDefinition: [
|
|
53
68
|
googleDrive,
|
|
@@ -56,7 +71,8 @@ export default {
|
|
|
56
71
|
drive: c.drive,
|
|
57
72
|
}),
|
|
58
73
|
],
|
|
59
|
-
description: "
|
|
74
|
+
description: "A single Google Drive file to download. Kept for backwards compatibility — prefer `Files` for new configurations. If both are set, this file is included alongside the ones in `Files`.",
|
|
75
|
+
optional: true,
|
|
60
76
|
},
|
|
61
77
|
filePath: {
|
|
62
78
|
type: "string",
|
|
@@ -82,7 +98,7 @@ export default {
|
|
|
82
98
|
`),
|
|
83
99
|
optional: true,
|
|
84
100
|
async options() {
|
|
85
|
-
const fileId = this.fileId;
|
|
101
|
+
const fileId = this.fileId ?? this.fileIds?.[0];
|
|
86
102
|
if (!fileId) {
|
|
87
103
|
return googleWorkspaceExportFormats;
|
|
88
104
|
}
|
|
@@ -127,104 +143,150 @@ export default {
|
|
|
127
143
|
},
|
|
128
144
|
},
|
|
129
145
|
async run({ $ }) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
resolvedFromShortcut = true;
|
|
144
|
-
fileMetadata = await this.googleDrive.getFile(targetId, {
|
|
145
|
-
fields: "name,mimeType,webViewLink",
|
|
146
|
-
});
|
|
147
|
-
}
|
|
146
|
+
// Combine the batch input (`fileIds`) with the legacy single `fileId`, keeping
|
|
147
|
+
// order and dropping duplicates so the same file isn't downloaded twice.
|
|
148
|
+
const requestedIds = [
|
|
149
|
+
...(this.fileIds ?? []),
|
|
150
|
+
...(this.fileId
|
|
151
|
+
? [
|
|
152
|
+
this.fileId,
|
|
153
|
+
]
|
|
154
|
+
: []),
|
|
155
|
+
];
|
|
156
|
+
const fileIds = [
|
|
157
|
+
...new Set(requestedIds),
|
|
158
|
+
];
|
|
148
159
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
);
|
|
160
|
+
if (fileIds.length === 0) {
|
|
161
|
+
throw new ConfigurationError("Select at least one file to download (`Files` or `File`).");
|
|
162
|
+
}
|
|
163
|
+
if (fileIds.length > 1 && this.filePath) {
|
|
164
|
+
throw new ConfigurationError("`Destination File Path` can only be used when downloading a single file. Remove it to download multiple files (each saves to `/tmp/<file name>`).");
|
|
155
165
|
}
|
|
156
166
|
|
|
157
|
-
const
|
|
167
|
+
const pipeline = promisify(stream.pipeline);
|
|
168
|
+
|
|
169
|
+
// Downloads a single file (resolving shortcuts + Workspace export formats),
|
|
170
|
+
// either writing it to /tmp or returning its contents as a buffer.
|
|
171
|
+
const downloadOne = async (requestedFileId) => {
|
|
172
|
+
let fileMetadata = await this.googleDrive.getFile(requestedFileId, {
|
|
173
|
+
fields: "name,mimeType,shortcutDetails,webViewLink",
|
|
174
|
+
});
|
|
158
175
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
176
|
+
// Shortcuts point at a target file; resolve and download the target instead.
|
|
177
|
+
let downloadFileId = requestedFileId;
|
|
178
|
+
let resolvedFromShortcut = false;
|
|
179
|
+
if (fileMetadata.mimeType === SHORTCUT_MIME_TYPE) {
|
|
180
|
+
const targetId = fileMetadata.shortcutDetails?.targetId;
|
|
181
|
+
if (!targetId) {
|
|
182
|
+
throw new Error(`Shortcut "${fileMetadata.name}" has no target file and cannot be downloaded.`);
|
|
183
|
+
}
|
|
184
|
+
downloadFileId = targetId;
|
|
185
|
+
resolvedFromShortcut = true;
|
|
186
|
+
fileMetadata = await this.googleDrive.getFile(targetId, {
|
|
187
|
+
fields: "name,mimeType,webViewLink",
|
|
188
|
+
});
|
|
166
189
|
}
|
|
167
|
-
|
|
190
|
+
|
|
191
|
+
const sourceMimeType = fileMetadata.mimeType;
|
|
192
|
+
|
|
193
|
+
if (unsupportedWorkspaceMimes[sourceMimeType]) {
|
|
168
194
|
throw new Error(
|
|
169
|
-
`
|
|
195
|
+
`Cannot download file of type "${sourceMimeType}": ${unsupportedWorkspaceMimes[sourceMimeType]}`,
|
|
170
196
|
);
|
|
171
197
|
}
|
|
172
|
-
}
|
|
173
198
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
199
|
+
const isWorkspaceDocument = sourceMimeType.includes(GOOGLE_DRIVE_MIME_TYPE_PREFIX);
|
|
200
|
+
|
|
201
|
+
// Fallback: user value -> static default -> runtime getExportFormats().
|
|
202
|
+
let effectiveMimeType = this.mimeType;
|
|
203
|
+
if (isWorkspaceDocument && !effectiveMimeType) {
|
|
204
|
+
effectiveMimeType = defaultExportMimeBySource[sourceMimeType];
|
|
205
|
+
if (!effectiveMimeType) {
|
|
206
|
+
const exportFormats = await this.googleDrive.getExportFormats();
|
|
207
|
+
effectiveMimeType = exportFormats[sourceMimeType]?.[0];
|
|
208
|
+
}
|
|
209
|
+
if (!effectiveMimeType) {
|
|
210
|
+
throw new Error(
|
|
211
|
+
`No export format available for "${sourceMimeType}". Set Conversion Format explicitly.`,
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
182
215
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
216
|
+
// See https://developers.google.com/drive/api/v3/mime-types for Google MIME types.
|
|
217
|
+
const file = isWorkspaceDocument
|
|
218
|
+
? await this.googleDrive.downloadWorkspaceFile(downloadFileId, {
|
|
219
|
+
mimeType: effectiveMimeType,
|
|
220
|
+
})
|
|
221
|
+
: await this.googleDrive.getFile(downloadFileId, {
|
|
222
|
+
alt: "media",
|
|
223
|
+
});
|
|
186
224
|
|
|
187
|
-
|
|
188
|
-
|
|
225
|
+
if (this.getBufferResponse) {
|
|
226
|
+
const chunks = [];
|
|
227
|
+
for await (const chunk of file) {
|
|
228
|
+
chunks.push(chunk);
|
|
229
|
+
}
|
|
230
|
+
const buffer = Buffer.concat(chunks);
|
|
189
231
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
232
|
+
return {
|
|
233
|
+
fileId: requestedFileId,
|
|
234
|
+
fileMetadata,
|
|
235
|
+
webViewLink: fileMetadata.webViewLink,
|
|
236
|
+
content: buffer,
|
|
237
|
+
resolvedFromShortcut,
|
|
238
|
+
};
|
|
193
239
|
}
|
|
194
|
-
|
|
240
|
+
|
|
241
|
+
let filePath;
|
|
242
|
+
if (this.filePath) {
|
|
243
|
+
filePath = this.filePath.includes("tmp/")
|
|
244
|
+
? this.filePath
|
|
245
|
+
: `/tmp/${this.filePath}`;
|
|
246
|
+
} else {
|
|
247
|
+
let defaultName = fileMetadata.name;
|
|
248
|
+
if (isWorkspaceDocument) {
|
|
249
|
+
const ext = extensionByMime[effectiveMimeType];
|
|
250
|
+
if (ext && !defaultName.toLowerCase().endsWith(`.${ext.toLowerCase()}`)) {
|
|
251
|
+
defaultName = `${defaultName}.${ext}`;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
filePath = `/tmp/${defaultName}`;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
await pipeline(file, fs.createWriteStream(filePath));
|
|
195
258
|
|
|
196
259
|
return {
|
|
197
|
-
fileId:
|
|
260
|
+
fileId: requestedFileId,
|
|
198
261
|
fileMetadata,
|
|
199
262
|
webViewLink: fileMetadata.webViewLink,
|
|
200
|
-
|
|
263
|
+
filePath,
|
|
264
|
+
resolvedFromShortcut,
|
|
201
265
|
};
|
|
202
|
-
}
|
|
266
|
+
};
|
|
203
267
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
filePath = `/tmp/${defaultName}`;
|
|
268
|
+
// Single-file downloads keep the original (non-array) return shape for
|
|
269
|
+
// backwards compatibility; batches return an array of per-file results.
|
|
270
|
+
if (fileIds.length === 1) {
|
|
271
|
+
const result = await downloadOne(fileIds[0]);
|
|
272
|
+
const verb = result.resolvedFromShortcut
|
|
273
|
+
? "Resolved shortcut and downloaded"
|
|
274
|
+
: "Successfully downloaded";
|
|
275
|
+
const what = this.getBufferResponse
|
|
276
|
+
? `raw content for file "${result.fileMetadata.name}"`
|
|
277
|
+
: `the file, "${result.fileMetadata.name}"`;
|
|
278
|
+
$.export("$summary", `${verb} ${what}`);
|
|
279
|
+
return result;
|
|
218
280
|
}
|
|
219
281
|
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
282
|
+
const files = [];
|
|
283
|
+
for (const id of fileIds) {
|
|
284
|
+
files.push(await downloadOne(id));
|
|
285
|
+
}
|
|
286
|
+
$.export("$summary", `Successfully downloaded ${files.length} file(s).`);
|
|
223
287
|
return {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
webViewLink: fileMetadata.webViewLink,
|
|
227
|
-
filePath,
|
|
288
|
+
files,
|
|
289
|
+
count: files.length,
|
|
228
290
|
};
|
|
229
291
|
},
|
|
230
292
|
};
|
|
@@ -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.
|
|
9
|
+
version: "0.1.24",
|
|
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.
|
|
10
|
+
version: "0.1.24",
|
|
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.
|
|
9
|
+
version: "0.0.25",
|
|
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.
|
|
9
|
+
version: "0.1.24",
|
|
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
|
+
version: "0.0.9",
|
|
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.
|
|
9
|
+
version: "0.0.10",
|
|
10
10
|
type: "action",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: false,
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
+ "\n\nCommon fields: `id`, `name`, `mimeType`, `size`, `parents`, `webViewLink`, `webContentLink`,"
|
|
12
12
|
+ " `createdTime`, `modifiedTime`, `owners`, `permissions`, `description`, `trashed`."
|
|
13
13
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/get)",
|
|
14
|
-
version: "0.0.
|
|
14
|
+
version: "0.0.2",
|
|
15
15
|
type: "action",
|
|
16
16
|
annotations: {
|
|
17
17
|
destructiveHint: false,
|
|
@@ -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.
|
|
8
|
+
version: "0.0.20",
|
|
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.
|
|
15
|
+
version: "0.1.25",
|
|
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
|
+
version: "0.0.9",
|
|
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.
|
|
7
|
+
version: "0.1.23",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " When the user says 'my files' or 'my documents', call this first to get the owner email,"
|
|
11
11
|
+ " then pass it to **Search Files** with a query like `'user@example.com' in owners`."
|
|
12
12
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/about/get)",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.2",
|
|
14
14
|
type: "action",
|
|
15
15
|
annotations: {
|
|
16
16
|
destructiveHint: false,
|
|
@@ -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.
|
|
7
|
+
version: "0.0.4",
|
|
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.
|
|
7
|
+
version: "0.0.16",
|
|
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.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -3,12 +3,13 @@ import {
|
|
|
3
3
|
getListFilesOpts, isMyDrive,
|
|
4
4
|
} from "../../common/utils.mjs";
|
|
5
5
|
import googleDrive from "../../google_drive.app.mjs";
|
|
6
|
+
import { PAGINATION_TOKEN_FIELD } from "../../common/constants.mjs";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
key: "google_drive-list-files",
|
|
9
10
|
name: "List Files",
|
|
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.
|
|
11
|
+
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",
|
|
12
|
+
version: "1.0.0",
|
|
12
13
|
annotations: {
|
|
13
14
|
destructiveHint: false,
|
|
14
15
|
openWorldHint: true,
|
|
@@ -46,7 +47,7 @@ export default {
|
|
|
46
47
|
fields: {
|
|
47
48
|
type: "string",
|
|
48
49
|
label: "Fields",
|
|
49
|
-
description: "The fields you want included in the response [(see the documentation for available fields)](https://developers.google.com/drive/api/reference/rest/v3/files). If not specified, the response includes a default set of fields specific to this method. For development you can use the special value `*` to return all fields, but you'll achieve greater performance by only selecting the fields you need.\n\n**eg:** `files(id,mimeType,name,
|
|
50
|
+
description: "The fields you want included in the response [(see the documentation for available fields)](https://developers.google.com/drive/api/reference/rest/v3/files). If not specified, the response includes a default set of fields specific to this method. For development you can use the special value `*` to return all fields, but you'll achieve greater performance by only selecting the fields you need.\n\n**Important:** when supplying a custom mask scoped to `files(...)`, the top-level `nextPageToken` field must also be present (e.g. `nextPageToken,files(id,name)`) or pagination silently stops after the first page. This action automatically prepends `nextPageToken` to your mask when it is absent so all pages are returned.\n\n**eg:** `files(id,mimeType,name,createdTime,modifiedTime)`",
|
|
50
51
|
optional: true,
|
|
51
52
|
},
|
|
52
53
|
filterText: {
|
|
@@ -54,7 +55,17 @@ export default {
|
|
|
54
55
|
description: "Filter by file name that contains a specific text",
|
|
55
56
|
type: "string",
|
|
56
57
|
optional: true,
|
|
57
|
-
|
|
58
|
+
},
|
|
59
|
+
filterType: {
|
|
60
|
+
type: "string",
|
|
61
|
+
label: "Filter Type",
|
|
62
|
+
description: "Whether to return files with names containing the Filter Text or files with names that match the Filter Text exactly. Defaults to \"CONTAINS\". Not relevant unless `Filter Text` is entered.",
|
|
63
|
+
options: [
|
|
64
|
+
"CONTAINS",
|
|
65
|
+
"EXACT MATCH",
|
|
66
|
+
],
|
|
67
|
+
default: "CONTAINS",
|
|
68
|
+
optional: true,
|
|
58
69
|
},
|
|
59
70
|
trashed: {
|
|
60
71
|
label: "Trashed",
|
|
@@ -62,22 +73,19 @@ export default {
|
|
|
62
73
|
description: "If `true`, list **only** trashed files. If `false`, list **only** non-trashed files. Keep it empty to include both.",
|
|
63
74
|
optional: true,
|
|
64
75
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
return props;
|
|
76
|
+
maxResults: {
|
|
77
|
+
label: "Max Results",
|
|
78
|
+
type: "integer",
|
|
79
|
+
description: "The maximum number of files to return per run. Leave empty to return every file in the folder. Combine with `Page Token` to page through a large folder in fixed-size batches across multiple runs.",
|
|
80
|
+
optional: true,
|
|
81
|
+
min: 1,
|
|
82
|
+
},
|
|
83
|
+
pageToken: {
|
|
84
|
+
label: "Page Token",
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "A cursor for resuming a previous run. Pass the `nextPageToken` returned by an earlier run to continue listing from where it stopped instead of starting over. Leave empty to start from the beginning of the folder.",
|
|
87
|
+
optional: true,
|
|
88
|
+
},
|
|
81
89
|
},
|
|
82
90
|
async run({ $ }) {
|
|
83
91
|
if (this.limitToMyDrive && this.drive && !isMyDrive(this.drive)) {
|
|
@@ -103,18 +111,61 @@ export default {
|
|
|
103
111
|
: ""}trashed=${this.trashed}`;
|
|
104
112
|
}
|
|
105
113
|
if (this.fields) {
|
|
106
|
-
|
|
114
|
+
// Auto-append nextPageToken at the top level when the user's custom mask
|
|
115
|
+
// omits it; without it the do/while loop exits after the first page.
|
|
116
|
+
let fieldsValue = this.fields;
|
|
117
|
+
if (!fieldsValue.includes(PAGINATION_TOKEN_FIELD)) {
|
|
118
|
+
fieldsValue = `${PAGINATION_TOKEN_FIELD},${fieldsValue}`;
|
|
119
|
+
}
|
|
120
|
+
opts.fields = fieldsValue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const maxResults = this.maxResults === undefined
|
|
124
|
+
? undefined
|
|
125
|
+
: Number(this.maxResults);
|
|
126
|
+
if (maxResults !== undefined && (!Number.isInteger(maxResults) || maxResults < 1)) {
|
|
127
|
+
throw new ConfigurationError("`Max Results` must be a positive integer.");
|
|
107
128
|
}
|
|
129
|
+
|
|
130
|
+
const startToken = this.pageToken;
|
|
108
131
|
const allFiles = [];
|
|
109
|
-
let pageToken;
|
|
132
|
+
let pageToken = startToken;
|
|
110
133
|
do {
|
|
134
|
+
const pageOpts = {
|
|
135
|
+
...opts,
|
|
136
|
+
};
|
|
137
|
+
if (maxResults) {
|
|
138
|
+
// Request exactly as many as we still need (Drive caps pageSize at 1000).
|
|
139
|
+
// Aligning pageSize to the remaining count means the returned
|
|
140
|
+
// nextPageToken points right after the last file we keep, so no files
|
|
141
|
+
// are skipped when resuming — we never over-fetch and discard.
|
|
142
|
+
pageOpts.pageSize = Math.min(maxResults - allFiles.length, 1000);
|
|
143
|
+
}
|
|
111
144
|
const {
|
|
112
|
-
files, nextPageToken,
|
|
113
|
-
}
|
|
145
|
+
files = [], nextPageToken,
|
|
146
|
+
} = await this.googleDrive.listFilesInPage(pageToken, pageOpts);
|
|
114
147
|
allFiles.push(...files);
|
|
115
148
|
pageToken = nextPageToken;
|
|
116
|
-
} while (pageToken);
|
|
117
|
-
|
|
118
|
-
|
|
149
|
+
} while (pageToken && (!maxResults || allFiles.length < maxResults));
|
|
150
|
+
|
|
151
|
+
const isComplete = !pageToken;
|
|
152
|
+
const resumed = Boolean(startToken);
|
|
153
|
+
let summary = `${resumed
|
|
154
|
+
? "Resumed and returned"
|
|
155
|
+
: "Successfully found"} ${allFiles.length} file(s).`;
|
|
156
|
+
// Only surface batch state when the caller is actually paging.
|
|
157
|
+
if (maxResults || startToken || !isComplete) {
|
|
158
|
+
summary += isComplete
|
|
159
|
+
? " Reached the end of the folder."
|
|
160
|
+
: " More results remain — pass `nextPageToken` as `Page Token` on the next run to continue.";
|
|
161
|
+
}
|
|
162
|
+
$.export("$summary", summary);
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
files: allFiles,
|
|
166
|
+
count: allFiles.length,
|
|
167
|
+
nextPageToken: pageToken ?? null,
|
|
168
|
+
isComplete,
|
|
169
|
+
};
|
|
119
170
|
},
|
|
120
171
|
};
|
|
@@ -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.
|
|
7
|
+
version: "0.0.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " Use this tool when the user asks 'who has access to this file?' or needs to audit sharing."
|
|
11
11
|
+ " Pass permission IDs from this response to **Remove Sharing** to revoke access."
|
|
12
12
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/list)",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.2",
|
|
14
14
|
type: "action",
|
|
15
15
|
annotations: {
|
|
16
16
|
destructiveHint: false,
|
|
@@ -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
|
+
version: "0.0.9",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " Pass a drive ID to **Search Files** `driveId` parameter to search within a specific shared drive."
|
|
11
11
|
+ " Optionally filter by name using the `query` parameter (e.g., `name contains 'Engineering'`)."
|
|
12
12
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/drives/list)",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.2",
|
|
14
14
|
type: "action",
|
|
15
15
|
annotations: {
|
|
16
16
|
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.
|
|
7
|
+
version: "0.1.23",
|
|
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.
|
|
8
|
+
version: "0.1.23",
|
|
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.
|
|
9
|
+
version: "0.0.8",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: true,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " The owner permission cannot be removed."
|
|
11
11
|
+ " Use **Search Files** to find the file ID by name if needed."
|
|
12
12
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/delete)",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.2",
|
|
14
14
|
type: "action",
|
|
15
15
|
annotations: {
|
|
16
16
|
destructiveHint: true,
|
|
@@ -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.12",
|
|
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.16",
|
|
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.12",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
+ "\n\nWhen the user says 'my files', use **Get User Details** first to get the owner email."
|
|
23
23
|
+ " To scope to a shared drive, pass the `driveId` from **List Shared Drives**."
|
|
24
24
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/search-files)",
|
|
25
|
-
version: "0.0.
|
|
25
|
+
version: "0.0.2",
|
|
26
26
|
type: "action",
|
|
27
27
|
annotations: {
|
|
28
28
|
destructiveHint: false,
|
|
@@ -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.24",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
+ "\n\n**Roles:** `reader` (view only), `commenter` (can comment), `writer` (can edit)."
|
|
16
16
|
+ " Use **List Permissions** to see existing sharing on a file."
|
|
17
17
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/permissions/create)",
|
|
18
|
-
version: "0.0.
|
|
18
|
+
version: "0.0.2",
|
|
19
19
|
type: "action",
|
|
20
20
|
annotations: {
|
|
21
21
|
destructiveHint: false,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " Use this instead of permanent deletion as the safer default."
|
|
11
11
|
+ " To find trashed files, use **Search Files** with `trashed = true`."
|
|
12
12
|
+ " [See the documentation](https://developers.google.com/drive/api/v3/reference/files/update)",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.2",
|
|
14
14
|
type: "action",
|
|
15
15
|
annotations: {
|
|
16
16
|
destructiveHint: true,
|
|
@@ -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.9",
|
|
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.15",
|
|
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.9",
|
|
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.23",
|
|
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.16",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
package/common/constants.mjs
CHANGED
|
@@ -141,6 +141,14 @@ const WEBHOOK_SUBSCRIPTION_RENEWAL_SECONDS =
|
|
|
141
141
|
*/
|
|
142
142
|
const MAX_FILE_OPTION_PATH_SEGMENTS = 3;
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* The API response field name that carries the cursor to the next page of results in a
|
|
146
|
+
* `files.list` response. When a caller supplies a custom partial-response `fields` mask
|
|
147
|
+
* (e.g. `files(id,name)`) this field must also be present at the top level of the mask or
|
|
148
|
+
* the do/while pagination loop silently exits after the first page.
|
|
149
|
+
*/
|
|
150
|
+
const PAGINATION_TOKEN_FIELD = "nextPageToken";
|
|
151
|
+
|
|
144
152
|
/**
|
|
145
153
|
* The MIME type prefix of Google Drive MIME types as defined by the [Google
|
|
146
154
|
* Drive API docs](https://developers.google.com/drive/api/v3/mime-types)
|
|
@@ -241,6 +249,7 @@ export {
|
|
|
241
249
|
WEBHOOK_SUBSCRIPTION_EXPIRATION_TIME_MILLISECONDS,
|
|
242
250
|
WEBHOOK_SUBSCRIPTION_RENEWAL_SECONDS,
|
|
243
251
|
MAX_FILE_OPTION_PATH_SEGMENTS,
|
|
252
|
+
PAGINATION_TOKEN_FIELD,
|
|
244
253
|
GOOGLE_DRIVE_MIME_TYPE_PREFIX,
|
|
245
254
|
GOOGLE_DRIVE_FOLDER_MIME_TYPE,
|
|
246
255
|
GOOGLE_DRIVE_UPLOAD_TYPES,
|
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.12",
|
|
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.10",
|
|
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.12",
|
|
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
|
|
@@ -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.15",
|
|
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.12",
|
|
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.10",
|
|
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.12",
|
|
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.21",
|
|
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.10",
|
|
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.12",
|
|
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.12",
|
|
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.15",
|
|
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.11",
|
|
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.25",
|
|
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.10",
|
|
12
12
|
type: "source",
|
|
13
13
|
dedupe: "unique",
|
|
14
14
|
props: {
|