Skip to content

Commit 7c74563

Browse files
authored
Merging pull request #17953
* delete-email action * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml
1 parent 414b8ab commit 7c74563

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import gmail from "../../gmail.app.mjs";
2+
import constants from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "gmail-delete-email",
6+
name: "Delete Email",
7+
description: "Moves the specified message to the trash. [See the documentation](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/trash)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
gmail,
12+
messageId: {
13+
propDefinition: [
14+
gmail,
15+
"message",
16+
],
17+
label: "Message ID",
18+
description: "The ID of the message to delete",
19+
},
20+
},
21+
methods: {
22+
deleteEmail(opts = {}) {
23+
return this.gmail._client().users.messages.trash({
24+
userId: constants.USER_ID,
25+
...opts,
26+
});
27+
},
28+
},
29+
async run({ $ }) {
30+
const response = await this.deleteEmail({
31+
id: this.messageId,
32+
});
33+
$.export("$summary", `Deleted email (ID: ${this.messageId})`);
34+
return response;
35+
},
36+
};

components/gmail/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/gmail",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"description": "Pipedream Gmail Components",
55
"main": "gmail.app.mjs",
66
"keywords": [

pnpm-lock.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)