@pipedream/google_drive 1.6.1 → 1.6.3

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 (57) 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/common/google-workspace-default-export-formats.mjs +53 -0
  4. package/actions/copy-file/copy-file.mjs +1 -1
  5. package/actions/create-file-from-template/create-file-from-template.mjs +1 -1
  6. package/actions/create-file-from-text/create-file-from-text.mjs +1 -1
  7. package/actions/create-folder/create-folder.mjs +1 -1
  8. package/actions/create-shared-drive/create-shared-drive.mjs +1 -1
  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 +96 -32
  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-by-id/get-file-by-id.mjs +1 -1
  21. package/actions/get-folder-id-for-path/get-folder-id-for-path.mjs +1 -1
  22. package/actions/get-reply/get-reply.mjs +1 -1
  23. package/actions/get-shared-drive/get-shared-drive.mjs +1 -1
  24. package/actions/list-access-proposals/list-access-proposals.mjs +1 -1
  25. package/actions/list-comments/list-comments.mjs +1 -1
  26. package/actions/list-files/list-files.mjs +1 -1
  27. package/actions/list-replies/list-replies.mjs +1 -1
  28. package/actions/move-file/move-file.mjs +1 -1
  29. package/actions/move-file-to-trash/move-file-to-trash.mjs +1 -1
  30. package/actions/remove-file-sharing-permission/remove-file-sharing-permission.mjs +1 -1
  31. package/actions/reply-to-comment/reply-to-comment.mjs +1 -1
  32. package/actions/resolve-access-proposal/resolve-access-proposal.mjs +1 -1
  33. package/actions/resolve-comment/resolve-comment.mjs +1 -1
  34. package/actions/search-shared-drives/search-shared-drives.mjs +1 -1
  35. package/actions/update-comment/update-comment.mjs +1 -1
  36. package/actions/update-file/update-file.mjs +1 -1
  37. package/actions/update-reply/update-reply.mjs +1 -1
  38. package/actions/update-shared-drive/update-shared-drive.mjs +1 -1
  39. package/actions/upload-file/upload-file.mjs +1 -1
  40. package/common/utils.mjs +6 -2
  41. package/package.json +2 -2
  42. package/sources/changes-to-files-in-drive/changes-to-files-in-drive.mjs +1 -1
  43. package/sources/changes-to-specific-files/changes-to-specific-files.mjs +1 -1
  44. package/sources/changes-to-specific-files-shared-drive/changes-to-specific-files-shared-drive.mjs +1 -1
  45. package/sources/new-access-proposal/new-access-proposal.mjs +1 -1
  46. package/sources/new-files-instant/new-files-instant.mjs +1 -1
  47. package/sources/new-files-instant-polling/new-files-instant-polling.mjs +1 -1
  48. package/sources/new-files-shared-drive/new-files-shared-drive.mjs +1 -1
  49. package/sources/new-or-modified-comments/new-or-modified-comments.mjs +1 -1
  50. package/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs +1 -1
  51. package/sources/new-or-modified-files/new-or-modified-files.mjs +1 -1
  52. package/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs +1 -1
  53. package/sources/new-or-modified-folders/new-or-modified-folders.mjs +1 -1
  54. package/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs +1 -1
  55. package/sources/new-shared-drive/new-shared-drive.mjs +1 -1
  56. package/sources/new-spreadsheet/new-spreadsheet.mjs +1 -1
  57. 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.4",
7
+ version: "0.1.5",
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.12",
23
+ version: "0.2.13",
24
24
  annotations: {
25
25
  destructiveHint: false,
26
26
  openWorldHint: true,
@@ -0,0 +1,53 @@
1
+ // Per https://developers.google.com/workspace/drive/api/guides/ref-export-formats,
2
+ // only six Google Workspace types have documented export MIME mappings.
3
+ // The defaults below prefer Microsoft Office equivalents where one exists.
4
+ export const defaultExportMimeBySource = {
5
+ "application/vnd.google-apps.document":
6
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
7
+ "application/vnd.google-apps.spreadsheet":
8
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
9
+ "application/vnd.google-apps.presentation":
10
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation",
11
+ "application/vnd.google-apps.drawing": "image/png",
12
+ "application/vnd.google-apps.script":
13
+ "application/vnd.google-apps.script+json",
14
+ };
15
+
16
+ // Workspace types with no export path via `files.export`.
17
+ // Source: the absence of these types from
18
+ // https://developers.google.com/workspace/drive/api/guides/ref-export-formats.
19
+ export const unsupportedWorkspaceMimes = {
20
+ "application/vnd.google-apps.folder":
21
+ "Folders can't be downloaded as files. Use a folder-zip action or list the folder's contents instead.",
22
+ "application/vnd.google-apps.form":
23
+ "Google Forms can't be exported via the Drive API. Use the Google Forms API to fetch form content or responses.",
24
+ "application/vnd.google-apps.map":
25
+ "My Maps can't be exported via the Drive API. Export manually from the My Maps UI as KMZ if needed.",
26
+ };
27
+
28
+ // Used to append a file extension when deriving a default filePath from the
29
+ // file's name. Covers every MIME in google-workspace-export-formats.mjs plus
30
+ // the Office defaults above.
31
+ export const extensionByMime = {
32
+ "application/epub+zip": "epub",
33
+ "application/pdf": "pdf",
34
+ "application/rtf": "rtf",
35
+ "application/vnd.google-apps.script+json": "json",
36
+ "application/vnd.oasis.opendocument.presentation": "odp",
37
+ "application/vnd.oasis.opendocument.spreadsheet": "ods",
38
+ "application/vnd.oasis.opendocument.text": "odt",
39
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",
40
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
41
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
42
+ "application/x-vnd.oasis.opendocument.spreadsheet": "ods",
43
+ "application/zip": "zip",
44
+ "image/jpeg": "jpg",
45
+ "image/png": "png",
46
+ "image/svg+xml": "svg",
47
+ "text/csv": "csv",
48
+ "text/html": "html",
49
+ "text/markdown": "md",
50
+ "text/plain": "txt",
51
+ "text/tab-separated-values": "tsv",
52
+ "text/x-markdown": "md",
53
+ };
@@ -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.19",
7
+ version: "0.1.20",
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.22",
12
+ version: "0.1.23",
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.12",
8
+ version: "0.2.13",
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.20",
16
+ version: "0.1.21",
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.20",
7
+ version: "0.1.21",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -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.8",
7
+ version: "0.0.9",
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.20",
8
+ version: "0.1.21",
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.5",
7
+ version: "0.0.6",
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.19",
7
+ version: "0.1.20",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -5,6 +5,13 @@ import { GOOGLE_DRIVE_MIME_TYPE_PREFIX } from "../../common/constants.mjs";
5
5
  import { toSingleLineString } from "../../common/utils.mjs";
6
6
  import googleDrive from "../../google_drive.app.mjs";
7
7
  import googleWorkspaceExportFormats from "../common/google-workspace-export-formats.mjs";
8
+ import {
9
+ defaultExportMimeBySource,
10
+ extensionByMime,
11
+ unsupportedWorkspaceMimes,
12
+ } from "../common/google-workspace-default-export-formats.mjs";
13
+
14
+ const SHORTCUT_MIME_TYPE = "application/vnd.google-apps.shortcut";
8
15
 
9
16
  /**
10
17
  * Uses Google Drive API to download files to a `filePath` in the /tmp
@@ -17,8 +24,14 @@ import googleWorkspaceExportFormats from "../common/google-workspace-export-form
17
24
  export default {
18
25
  key: "google_drive-download-file",
19
26
  name: "Download File",
20
- description: "Download a file. [See the documentation](https://developers.google.com/drive/api/v3/manage-downloads) for more information",
21
- version: "0.1.22",
27
+ description: "Download a file from Google Drive to the `/tmp` directory or return its contents as a buffer."
28
+ + " 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
+ + " For Google Workspace files (Docs, Sheets, Slides, Drawings, Apps Script), exports to an Office-compatible format by default:"
30
+ + " Docs → `.docx`, Sheets → `.xlsx`, Slides → `.pptx`, Drawings → PNG, Apps Script → JSON."
31
+ + " Pass `mimeType` to force a specific format. Shortcuts are resolved to their target automatically."
32
+ + " Folders, Forms, and My Maps cannot be downloaded via this action."
33
+ + " [See the documentation](https://developers.google.com/drive/api/v3/manage-downloads)",
34
+ version: "0.1.24",
22
35
  annotations: {
23
36
  destructiveHint: false,
24
37
  openWorldHint: true,
@@ -32,6 +45,7 @@ export default {
32
45
  googleDrive,
33
46
  "watchedDrive",
34
47
  ],
48
+ description: "The shared drive the file is in, if any. Leave empty for files in My Drive.",
35
49
  optional: true,
36
50
  },
37
51
  fileId: {
@@ -42,7 +56,7 @@ export default {
42
56
  drive: c.drive,
43
57
  }),
44
58
  ],
45
- description: "The file to download",
59
+ description: "The Google Drive file to download. Accepts a file ID (opaque Drive identifier). If a shortcut is passed, the target file is resolved and downloaded automatically.",
46
60
  },
47
61
  filePath: {
48
62
  type: "string",
@@ -50,7 +64,10 @@ export default {
50
64
  description: toSingleLineString(`
51
65
  The destination file name or path [in the \`/tmp\`
52
66
  directory](https://pipedream.com/docs/workflows/steps/code/nodejs/working-with-files/#the-tmp-directory)
53
- (e.g., \`/tmp/myFile.csv\`)
67
+ (e.g., \`/tmp/myFile.csv\`). Defaults to \`/tmp/<file name>\` if omitted.
68
+ **Note:** if you set this for a Google Workspace file, the extension you
69
+ choose should match the Conversion Format; otherwise the file contents
70
+ may not match the extension.
54
71
  `),
55
72
  optional: true,
56
73
  },
@@ -59,7 +76,9 @@ export default {
59
76
  label: "Conversion Format",
60
77
  description: toSingleLineString(`
61
78
  The format to which to convert the downloaded file if it is a [Google Workspace
62
- document](https://developers.google.com/drive/api/v3/ref-export-formats)
79
+ document](https://developers.google.com/drive/api/v3/ref-export-formats).
80
+ If omitted, defaults per source type: Docs → \`.docx\`, Sheets → \`.xlsx\`,
81
+ Slides → \`.pptx\`, Drawings → PNG, Apps Script → JSON.
63
82
  `),
64
83
  optional: true,
65
84
  async options() {
@@ -98,47 +117,76 @@ export default {
98
117
  type: "dir",
99
118
  accessMode: "write",
100
119
  sync: true,
120
+ optional: true,
101
121
  },
102
122
  getBufferResponse: {
103
123
  type: "boolean",
104
124
  label: "Get Buffer Response",
105
- description: "Whether to return the file content as a buffer instead of writing to a file path",
125
+ description: "If true, returns the file content as a buffer in the output (useful for passing directly to another step) instead of writing it to `/tmp`. Defaults to false.",
106
126
  optional: true,
107
127
  },
108
128
  },
109
129
  async run({ $ }) {
110
- // Validate that filePath is provided when not getting raw response
111
- if (!this.getBufferResponse && !this.filePath) {
112
- throw new Error("File Path is required when not using Get Buffer Response");
130
+ let fileMetadata = await this.googleDrive.getFile(this.fileId, {
131
+ fields: "name,mimeType,shortcutDetails,webViewLink",
132
+ });
133
+
134
+ // Shortcuts point at a target file; resolve and download the target instead.
135
+ let downloadFileId = this.fileId;
136
+ let resolvedFromShortcut = false;
137
+ if (fileMetadata.mimeType === SHORTCUT_MIME_TYPE) {
138
+ const targetId = fileMetadata.shortcutDetails?.targetId;
139
+ if (!targetId) {
140
+ throw new Error(`Shortcut "${fileMetadata.name}" has no target file and cannot be downloaded.`);
141
+ }
142
+ downloadFileId = targetId;
143
+ resolvedFromShortcut = true;
144
+ fileMetadata = await this.googleDrive.getFile(targetId, {
145
+ fields: "name,mimeType,webViewLink",
146
+ });
113
147
  }
114
148
 
115
- // Get file metadata to get file's MIME type
116
- const fileMetadata = await this.googleDrive.getFile(this.fileId, {
117
- fields: "name,mimeType",
118
- });
119
- const mimeType = fileMetadata.mimeType;
149
+ const sourceMimeType = fileMetadata.mimeType;
150
+
151
+ if (unsupportedWorkspaceMimes[sourceMimeType]) {
152
+ throw new Error(
153
+ `Cannot download file of type "${sourceMimeType}": ${unsupportedWorkspaceMimes[sourceMimeType]}`,
154
+ );
155
+ }
120
156
 
121
- const isWorkspaceDocument = mimeType.includes(GOOGLE_DRIVE_MIME_TYPE_PREFIX);
122
- if (isWorkspaceDocument && !this.mimeType) {
123
- throw new Error("Conversion Format is required when File is a Google Workspace Document");
157
+ const isWorkspaceDocument = sourceMimeType.includes(GOOGLE_DRIVE_MIME_TYPE_PREFIX);
158
+
159
+ // Fallback: user value -> static default -> runtime getExportFormats().
160
+ let effectiveMimeType = this.mimeType;
161
+ if (isWorkspaceDocument && !effectiveMimeType) {
162
+ effectiveMimeType = defaultExportMimeBySource[sourceMimeType];
163
+ if (!effectiveMimeType) {
164
+ const exportFormats = await this.googleDrive.getExportFormats();
165
+ effectiveMimeType = exportFormats[sourceMimeType]?.[0];
166
+ }
167
+ if (!effectiveMimeType) {
168
+ throw new Error(
169
+ `No export format available for "${sourceMimeType}". Set Conversion Format explicitly.`,
170
+ );
171
+ }
124
172
  }
125
- // Download file
126
- // If `mimeType` is a Google MIME type, use `downloadWorkspaceFile`. Otherwise, use `getFile`.
127
- // See https://developers.google.com/drive/api/v3/mime-types for a list of Google MIME types.
128
- // Google Workspace format to MIME type map:
129
- // https://developers.google.com/drive/api/v3/ref-export-formats
173
+
174
+ // See https://developers.google.com/drive/api/v3/mime-types for Google MIME types.
130
175
  const file = isWorkspaceDocument
131
- ? await this.googleDrive.downloadWorkspaceFile(this.fileId, {
132
- mimeType: this.mimeType,
176
+ ? await this.googleDrive.downloadWorkspaceFile(downloadFileId, {
177
+ mimeType: effectiveMimeType,
133
178
  })
134
- : await this.googleDrive.getFile(this.fileId, {
179
+ : await this.googleDrive.getFile(downloadFileId, {
135
180
  alt: "media",
136
181
  });
137
182
 
183
+ const summaryPrefix = resolvedFromShortcut
184
+ ? "Resolved shortcut and downloaded"
185
+ : "Successfully downloaded";
186
+
138
187
  if (this.getBufferResponse) {
139
- $.export("$summary", `Successfully retrieved raw content for file "${fileMetadata.name}"`);
188
+ $.export("$summary", `${summaryPrefix} raw content for file "${fileMetadata.name}"`);
140
189
 
141
- // Convert stream to buffer
142
190
  const chunks = [];
143
191
  for await (const chunk of file) {
144
192
  chunks.push(chunk);
@@ -146,20 +194,36 @@ export default {
146
194
  const buffer = Buffer.concat(chunks);
147
195
 
148
196
  return {
197
+ fileId: this.fileId,
149
198
  fileMetadata,
199
+ webViewLink: fileMetadata.webViewLink,
150
200
  content: buffer,
151
201
  };
152
202
  }
153
203
 
154
- // Stream file to `filePath`
204
+ let filePath;
205
+ if (this.filePath) {
206
+ filePath = this.filePath.includes("tmp/")
207
+ ? this.filePath
208
+ : `/tmp/${this.filePath}`;
209
+ } else {
210
+ let defaultName = fileMetadata.name;
211
+ if (isWorkspaceDocument) {
212
+ const ext = extensionByMime[effectiveMimeType];
213
+ if (ext && !defaultName.toLowerCase().endsWith(`.${ext.toLowerCase()}`)) {
214
+ defaultName = `${defaultName}.${ext}`;
215
+ }
216
+ }
217
+ filePath = `/tmp/${defaultName}`;
218
+ }
219
+
155
220
  const pipeline = promisify(stream.pipeline);
156
- const filePath = this.filePath.includes("tmp/")
157
- ? this.filePath
158
- : `/tmp/${this.filePath}`;
159
221
  await pipeline(file, fs.createWriteStream(filePath));
160
- $.export("$summary", `Successfully downloaded the file, "${fileMetadata.name}"`);
222
+ $.export("$summary", `${summaryPrefix} the file, "${fileMetadata.name}"`);
161
223
  return {
224
+ fileId: this.fileId,
162
225
  fileMetadata,
226
+ webViewLink: fileMetadata.webViewLink,
163
227
  filePath,
164
228
  };
165
229
  },
@@ -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. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
9
- version: "0.1.19",
9
+ version: "0.1.20",
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. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
10
- version: "0.1.19",
10
+ version: "0.1.20",
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. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
9
- version: "0.0.20",
9
+ version: "0.0.21",
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. [See the documentation](https://developers.google.com/drive/api/v3/search-files) for more information",
9
- version: "0.1.19",
9
+ version: "0.1.20",
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.5",
7
+ version: "0.0.6",
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.6",
9
+ version: "0.0.7",
10
10
  type: "action",
11
11
  annotations: {
12
12
  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.16",
8
+ version: "0.0.17",
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.21",
15
+ version: "0.1.22",
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.5",
7
+ version: "0.0.6",
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.19",
7
+ version: "0.1.20",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -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.12",
7
+ version: "0.0.13",
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.8",
7
+ version: "0.0.9",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_drive-list-files",
6
6
  name: "List Files",
7
7
  description: "List files from a specific folder. [See the documentation](https://developers.google.com/drive/api/v3/reference/files/list) for more information",
8
- version: "0.2.1",
8
+ version: "0.2.2",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -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.5",
7
+ version: "0.0.6",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -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.19",
7
+ version: "0.1.20",
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.19",
8
+ version: "0.1.20",
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.4",
9
+ version: "0.0.5",
10
10
  annotations: {
11
11
  destructiveHint: true,
12
12
  openWorldHint: 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.8",
7
+ version: "0.0.9",
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.12",
8
+ version: "0.0.13",
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.8",
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-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.20",
7
+ version: "0.1.21",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: 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.5",
7
+ version: "0.0.6",
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.11",
9
+ version: "2.0.12",
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.5",
7
+ version: "0.0.6",
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.19",
7
+ version: "0.1.20",
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.12",
16
+ version: "2.0.13",
17
17
  annotations: {
18
18
  destructiveHint: false,
19
19
  openWorldHint: true,
package/common/utils.mjs CHANGED
@@ -302,8 +302,12 @@ async function stashFile(item, googleDrive, dir) {
302
302
  buffer.length,
303
303
  );
304
304
  // Return file details and temporary download link:
305
- // { path, get_url, s3Key, type }
306
- return await file.withoutPutUrl().withGetUrl();
305
+ // { fileId, path, get_url, s3Key, type }
306
+ const stashedFile = await file.withoutPutUrl().withGetUrl();
307
+ return {
308
+ fileId: item.id,
309
+ ...stashedFile,
310
+ };
307
311
  }
308
312
 
309
313
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_drive",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Pipedream Google_drive Components",
5
5
  "main": "google_drive.app.mjs",
6
6
  "keywords": [
@@ -15,7 +15,7 @@
15
15
  "cron-parser": "^4.9.0",
16
16
  "google-docs-mustaches": "^1.2.2",
17
17
  "got": "13.0.0",
18
- "lodash": "^4.17.23",
18
+ "lodash": "^4.18.1",
19
19
  "md5": "^2.3.0",
20
20
  "mime-db": "^1.51.0",
21
21
  "uuid": "^8.3.2"
@@ -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.7",
17
+ version: "0.0.8",
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.6",
19
+ version: "0.3.7",
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
@@ -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.7",
32
+ version: "0.3.8",
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.11",
9
+ version: "0.0.12",
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.7",
14
+ version: "0.2.8",
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.5",
11
+ version: "0.0.6",
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.7",
10
+ version: "0.1.8",
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.16",
21
+ version: "1.0.17",
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.6",
10
+ version: "0.0.7",
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.7",
29
+ version: "0.4.8",
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.7",
12
+ version: "0.0.8",
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.10",
24
+ version: "0.2.11",
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.6",
15
+ version: "0.0.7",
16
16
  type: "source",
17
17
  dedupe: "unique",
18
18
  props: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_drive-new-shared-drive",
6
6
  name: "New Shared Drive",
7
7
  description: "Emits a new event any time a shared drive is created.",
8
- version: "0.1.18",
8
+ version: "0.1.19",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  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.21",
9
+ version: "0.1.22",
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.5",
11
+ version: "0.0.6",
12
12
  type: "source",
13
13
  dedupe: "unique",
14
14
  props: {