Skip to content

Commit 19102a1

Browse files
authored
Enhance Google Drive component with new comment and reply actions (#18959)
* Enhance Google Drive component with new comment and reply actions - Added new actions: Get Comment By ID, Get Reply By ID, List Replies, Update Comment, Update Reply, and Delete Reply. - Introduced methods for managing replies, including listing, fetching, updating, and deleting replies. - Updated existing methods to support new functionalities, including creating comments with optional anchor properties. - Bumped package version to 1.2.0 for Google Drive component and 0.1.0 for the Add Comment action. * Update Google Drive component versions for various actions and sources - Bumped version numbers for multiple Google Drive actions, including: - Add File Sharing Preference (0.2.7 to 0.2.8) - Copy File (0.1.14 to 0.1.15) - Create File From Template (0.1.15 to 0.1.16) - Create File From Text (0.2.7 to 0.2.8) - Create Folder (0.1.15 to 0.1.16) - Create Shared Drive (0.1.15 to 0.1.16) - Delete Comment (0.0.3 to 0.0.4) - Delete File (0.1.15 to 0.1.16) - Delete Shared Drive (0.1.14 to 0.1.15) - Download File (0.1.17 to 0.1.18) - Find File (0.1.14 to 0.1.15) - Find Folder (0.1.14 to 0.1.15) - Find Forms (0.0.15 to 0.0.16) - Find Spreadsheets (0.1.14 to 0.1.15) - Get Current User (0.0.1 to 0.0.2) - Get File By ID (0.0.11 to 0.0.12) - Get Folder ID for Path (0.1.16 to 0.1.17) - Get Shared Drive (0.1.14 to 0.1.15) - List Access Proposals (0.0.7 to 0.0.8) - List Comments (0.0.3 to 0.0.4) - List Files (0.1.18 to 0.1.19) - Move File (0.1.14 to 0.1.15) - Move File to Trash (0.1.14 to 0.1.15) - Reply to Comment (0.0.3 to 0.0.4) - Resolve Access Proposal (0.0.7 to 0.0.8) - Resolve Comment (0.0.3 to 0.0.4) - Search Shared Drives (0.1.15 to 0.1.16) - Update File (2.0.6 to 2.0.7) - Update Shared Drive (0.1.14 to 0.1.15) - Upload File (2.0.7 to 2.0.8) - Updated version numbers for various sources, including: - Changes to Files in Drive (0.0.1 to 0.0.2) - Changes to Specific Files (0.3.1 to 0.3.2) - Changes to Specific Files (Shared Drive) (0.3.1 to 0.3.2) - New Access Proposal (0.0.6 to 0.0.7) - New Files (Instant) (0.2.1 to 0.2.2) - New Files (Shared Drive) (0.1.1 to 0.1.2) - New or Modified Comments (1.0.10 to 1.0.11) - New or Modified Files (0.4.1 to 0.4.2) - New or Modified Folders (0.2.3 to 0.2.4) - New Shared Drive (0.1.13 to 0.1.14) - New Spreadsheet (0.1.16 to 0.1.17) This update ensures all components are aligned with the latest versioning standards. * Refactor Google Drive reply actions to improve functionality - Removed unused `driveId` parameter from the `options` method in the `google_drive.app.mjs` file. - Updated `destructiveHint` to `true` for the `delete-reply` action and set `readOnlyHint` to `false` for both `delete-reply` and `update-reply` actions, allowing for more accurate action descriptions and user interactions.
1 parent 9c78822 commit 19102a1

File tree

50 files changed

+559
-50
lines changed

Some content is hidden

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

50 files changed

+559
-50
lines changed

components/google_drive/actions/add-comment/add-comment.mjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "google_drive-add-comment",
55
name: "Add Comment",
66
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.3",
7+
version: "0.1.0",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
@@ -35,11 +35,20 @@ export default {
3535
label: "Comment Content",
3636
description: "The text content of the comment to add",
3737
},
38+
anchor: {
39+
type: "string",
40+
label: "Anchor",
41+
description: "A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Manage comments and replies](https://developers.google.com/workspace/drive/api/v3/manage-comments).",
42+
optional: true,
43+
},
3844
},
3945
async run({ $ }) {
4046
const response = await this.googleDrive.createComment(
41-
this.content,
4247
this.fileId,
48+
{
49+
content: this.content,
50+
anchor: this.anchor,
51+
},
4352
);
4453

4554
$.export("$summary", `Successfully added comment with ID ${response.data.id}`);

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.7",
23+
version: "0.2.8",
2424
annotations: {
2525
destructiveHint: false,
2626
openWorldHint: true,

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.14",
7+
version: "0.1.15",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.15",
11+
version: "0.1.16",
1212
annotations: {
1313
destructiveHint: true,
1414
openWorldHint: true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ 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.7",
8+
version: "0.2.8",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

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.15",
16+
version: "0.1.16",
1717
annotations: {
1818
destructiveHint: false,
1919
openWorldHint: true,

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.15",
7+
version: "0.1.16",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/google_drive/actions/delete-comment/delete-comment.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-comment",
55
name: "Delete Comment",
66
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.3",
7+
version: "0.0.4",
88
annotations: {
99
destructiveHint: true,
1010
openWorldHint: true,

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.15",
8+
version: "0.1.16",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import googleDrive from "../../google_drive.app.mjs";
2+
3+
export default {
4+
key: "google_drive-delete-reply",
5+
name: "Delete Reply",
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.1",
8+
annotations: {
9+
destructiveHint: true,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
googleDrive,
16+
drive: {
17+
propDefinition: [
18+
googleDrive,
19+
"watchedDrive",
20+
],
21+
optional: true,
22+
},
23+
fileIdTip: {
24+
type: "alert",
25+
alertType: "info",
26+
content: "You can use actions such as **Find File** or **List Files** to obtain a file ID, and use its value here.",
27+
},
28+
fileId: {
29+
propDefinition: [
30+
googleDrive,
31+
"fileId",
32+
(c) => ({
33+
drive: c.drive,
34+
}),
35+
],
36+
description: "The file to obtain info for. You can select a file or use a file ID from a previous step.",
37+
},
38+
commentId: {
39+
propDefinition: [
40+
googleDrive,
41+
"commentId",
42+
(c) => ({
43+
fileId: c.fileId,
44+
}),
45+
],
46+
description: "The comment to get info for. You can select a comment or use a comment ID from a previous step.",
47+
},
48+
replyId: {
49+
propDefinition: [
50+
googleDrive,
51+
"replyId",
52+
(c) => ({
53+
fileId: c.fileId,
54+
commentId: c.commentId,
55+
}),
56+
],
57+
description: "The reply to get info for. You can select a reply or use a reply ID from a previous step.",
58+
},
59+
},
60+
async run({ $ }) {
61+
const response = await this.googleDrive.deleteReply({
62+
replyId: this.replyId,
63+
fileId: this.fileId,
64+
commentId: this.commentId,
65+
});
66+
$.export("$summary", `Successfully deleted reply with ID ${this.replyId}`);
67+
return response;
68+
},
69+
};

0 commit comments

Comments
 (0)