Skip to content

Commit d66263d

Browse files
authored
Merging pull request #18131
* new components * pnpm-lock.yaml
1 parent dfb1dee commit d66263d

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import gmail from "../../gmail.app.mjs";
2+
import constants from "../../common/constants.mjs";
3+
4+
export default {
5+
key: "gmail-get-send-as-alias",
6+
name: "Get Send As Alias",
7+
description: "Get a send as alias for the authenticated user. [See the documentation](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.settings.sendAs/get)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
gmail,
12+
sendAsEmail: {
13+
type: "string",
14+
label: "Send As Email",
15+
description: "The email address of the send as alias to get",
16+
async options() {
17+
const { sendAs } = await this.gmail.listSignatures();
18+
return sendAs.map(({ sendAsEmail }) => sendAsEmail);
19+
},
20+
},
21+
},
22+
async run({ $ }) {
23+
const { data } = await this.gmail._client().users.settings.sendAs.get({
24+
userId: constants.USER_ID,
25+
sendAsEmail: this.sendAsEmail,
26+
});
27+
28+
$.export("$summary", "Successfully retrieved send as alias");
29+
30+
return data;
31+
},
32+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import gmail from "../../gmail.app.mjs";
2+
3+
export default {
4+
key: "gmail-list-send-as-aliases",
5+
name: "List Send As Aliases",
6+
description: "List all send as aliases for the authenticated user. [See the documentation](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.settings.sendAs/list)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
gmail,
11+
},
12+
async run({ $ }) {
13+
const response = await this.gmail.listSignatures({
14+
$,
15+
});
16+
17+
$.export("$summary", `Successfully retrieved ${response.sendAs?.length} send as aliases`);
18+
19+
return response;
20+
},
21+
};

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.2.0",
3+
"version": "1.3.0",
44
"description": "Pipedream Gmail Components",
55
"main": "gmail.app.mjs",
66
"keywords": [

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)