Skip to content

Commit 00b8f8f

Browse files
authored
Enhance Google Drive component with comment management features (#18307)
* Enhance Google Drive component with comment management features - Added actions for adding, deleting, and listing comments on files. - Introduced methods for creating and resolving comments. - Updated existing actions and incremented version numbers for several components. - Improved utility functions for better handling of comments and file interactions. * Increment version numbers for Google Drive component and New Spreadsheet source
1 parent d4a1acb commit 00b8f8f

File tree

42 files changed

+360
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+360
-47
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import googleDrive from "../../google_drive.app.mjs";
2+
3+
export default {
4+
key: "google_drive-add-comment",
5+
name: "Add Comment",
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.0.1",
8+
type: "action",
9+
props: {
10+
googleDrive,
11+
drive: {
12+
propDefinition: [
13+
googleDrive,
14+
"watchedDrive",
15+
],
16+
optional: false,
17+
},
18+
fileId: {
19+
propDefinition: [
20+
googleDrive,
21+
"fileId",
22+
(c) => ({
23+
drive: c.drive,
24+
}),
25+
],
26+
description: "The file to add a comment to.",
27+
},
28+
content: {
29+
type: "string",
30+
label: "Comment Content",
31+
description: "The text content of the comment to add",
32+
},
33+
},
34+
async run({ $ }) {
35+
const response = await this.googleDrive.createComment(
36+
this.content,
37+
this.fileId,
38+
);
39+
40+
$.export("$summary", `Successfully added comment with ID ${response.data.id}`);
41+
return response.data;
42+
},
43+
};

components/google_drive/actions/add-file-sharing-preference/add-file-sharing-preference.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
name: "Share File or Folder",
2121
description:
2222
"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.4",
23+
version: "0.2.5",
2424
type: "action",
2525
props: {
2626
googleDrive,

components/google_drive/actions/copy-file/copy-file.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_drive-copy-file",
55
name: "Copy File",
66
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.11",
7+
version: "0.1.12",
88
type: "action",
99
props: {
1010
googleDrive,

components/google_drive/actions/create-file-from-template/create-file-from-template.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import googleDrive from "../../google_drive.app.mjs";
21
import Mustaches from "google-docs-mustaches";
2+
import googleDrive from "../../google_drive.app.mjs";
33

44
const MODE_GOOGLE_DOC = "Google Doc";
55
const MODE_PDF = "Pdf";
@@ -8,7 +8,7 @@ export default {
88
key: "google_drive-create-file-from-template",
99
name: "Create New File From Template",
1010
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)",
11-
version: "0.1.11",
11+
version: "0.1.12",
1212
type: "action",
1313
props: {
1414
googleDrive,

components/google_drive/actions/create-file-from-text/create-file-from-text.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import googleDrive from "../../google_drive.app.mjs";
21
import { Readable } from "stream";
2+
import googleDrive from "../../google_drive.app.mjs";
33

44
export default {
55
key: "google_drive-create-file-from-text",
66
name: "Create New File From Text",
77
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.4",
8+
version: "0.2.5",
99
type: "action",
1010
props: {
1111
googleDrive,

components/google_drive/actions/create-folder/create-folder.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
key: "google_drive-create-folder",
1414
name: "Create Folder",
1515
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.12",
16+
version: "0.1.13",
1717
type: "action",
1818
props: {
1919
googleDrive,

components/google_drive/actions/create-shared-drive/create-shared-drive.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_drive-create-shared-drive",
55
name: "Create Shared Drive",
66
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.12",
7+
version: "0.1.13",
88
type: "action",
99
props: {
1010
googleDrive,
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import googleDrive from "../../google_drive.app.mjs";
2+
3+
export default {
4+
key: "google_drive-delete-comment",
5+
name: "Delete Comment",
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.1",
8+
type: "action",
9+
props: {
10+
googleDrive,
11+
drive: {
12+
propDefinition: [
13+
googleDrive,
14+
"watchedDrive",
15+
],
16+
optional: false,
17+
},
18+
fileId: {
19+
propDefinition: [
20+
googleDrive,
21+
"fileId",
22+
(c) => ({
23+
drive: c.drive,
24+
}),
25+
],
26+
description: "The file containing the comment to delete.",
27+
},
28+
commentId: {
29+
propDefinition: [
30+
googleDrive,
31+
"commentId",
32+
(c) => ({
33+
fileId: c.fileId,
34+
}),
35+
],
36+
},
37+
},
38+
async run({ $ }) {
39+
const response = await this.googleDrive.deleteComment(
40+
this.commentId,
41+
this.fileId,
42+
);
43+
44+
$.export("$summary", `Successfully deleted comment ${this.commentId} from file ${this.fileId}`);
45+
return response.data;
46+
},
47+
};

components/google_drive/actions/delete-file/delete-file.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Delete File",
66
description:
77
"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.12",
8+
version: "0.1.13",
99
type: "action",
1010
props: {
1111
googleDrive,

components/google_drive/actions/delete-shared-drive/delete-shared-drive.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_drive-delete-shared-drive",
55
name: "Delete Shared Drive",
66
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.11",
7+
version: "0.1.12",
88
type: "action",
99
props: {
1010
googleDrive,

0 commit comments

Comments
 (0)