Skip to content

Commit 80ddaaf

Browse files
authored
Merge branch 'master' into issue-13410
2 parents 7bfead4 + 492fbe1 commit 80ddaaf

File tree

81 files changed

+1998
-131
lines changed

Some content is hidden

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

81 files changed

+1998
-131
lines changed

components/alibaba_cloud/alibaba_cloud.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { defineApp } from "@pipedream/types";
2-
3-
export default defineApp({
1+
export default {
42
type: "app",
5-
app: "elastic_email",
3+
app: "autotask_psa",
64
propDefinitions: {},
75
methods: {
86
// this.$auth contains connected account data
97
authKeys() {
108
console.log(Object.keys(this.$auth));
119
},
1210
},
13-
});
11+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/autotask_psa",
3+
"version": "0.0.1",
4+
"description": "Pipedream Autotask PSA Components",
5+
"main": "autotask_psa.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"autotask_psa"
9+
],
10+
"homepage": "https://pipedream.com/apps/autotask_psa",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "cloudflare_browser_rendering",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/cloudflare_browser_rendering",
3+
"version": "0.0.1",
4+
"description": "Pipedream Cloudflare Browser Rendering Components",
5+
"main": "cloudflare_browser_rendering.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"cloudflare_browser_rendering"
9+
],
10+
"homepage": "https://pipedream.com/apps/cloudflare_browser_rendering",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/egestor/egestor.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/elastic_email/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import {
3+
CONSENT_TRACKING_OPTIONS,
4+
STATUS_OPTIONS,
5+
} from "../../common/constants.mjs";
6+
import { parseObject } from "../../common/utils.mjs";
7+
import app from "../../elastic_email.app.mjs";
8+
9+
export default {
10+
key: "elastic_email-add-contact",
11+
name: "Add Contact to Mailing List",
12+
description: "Adds a new contact to a mailing list. [See the documentation](https://elasticemail.com/developers/api-documentation/rest-api#operation/contactsPost)",
13+
version: "0.0.1",
14+
type: "action",
15+
props: {
16+
app,
17+
email: {
18+
propDefinition: [
19+
app,
20+
"email",
21+
],
22+
},
23+
listNames: {
24+
propDefinition: [
25+
app,
26+
"listNames",
27+
],
28+
optional: true,
29+
},
30+
status: {
31+
type: "string",
32+
label: "Status",
33+
description: "The initial status of the contact.",
34+
options: STATUS_OPTIONS,
35+
optional: true,
36+
},
37+
firstName: {
38+
type: "string",
39+
label: "First Name",
40+
description: "The contact's first name.",
41+
optional: true,
42+
},
43+
lastName: {
44+
type: "string",
45+
label: "Last Name",
46+
description: "The contact's last name.",
47+
optional: true,
48+
},
49+
customFields: {
50+
type: "object",
51+
label: "Custom Fields",
52+
description: "A key-value collection of custom contact fields which can be used in the system. Only already existing custom fields will be saved.",
53+
optional: true,
54+
},
55+
consentIP: {
56+
type: "string",
57+
label: "Consent IP",
58+
description: "IP address of consent to send this contact(s) your email. If not provided your current public IP address is used for consent.",
59+
optional: true,
60+
},
61+
consentDate: {
62+
type: "string",
63+
label: "Consent Date",
64+
description: "Date of consent to send this contact(s) your email. If not provided current date is used for consent.",
65+
optional: true,
66+
},
67+
consentTracking: {
68+
type: "string",
69+
label: "Consent Tracking",
70+
description: "Tracking of consent to send this contact(s) your email. Defaults to \"Unknown\".",
71+
options: CONSENT_TRACKING_OPTIONS,
72+
optional: true,
73+
},
74+
},
75+
async run({ $ }) {
76+
const response = await this.app.addContact({
77+
$,
78+
params: {
79+
listnames: parseObject(this.listNames),
80+
},
81+
data: [
82+
{
83+
Email: this.email,
84+
Status: this.status,
85+
FirstName: this.firstName,
86+
LastName: this.lastName,
87+
CustomFields: parseObject(this.customFields),
88+
Consent: {
89+
ConsentIP: this.consentIP,
90+
ConsentDate: this.consentDate,
91+
ConsentTracking: this.consentTracking,
92+
},
93+
},
94+
],
95+
});
96+
97+
if (("success" in response) && response.success === "false") {
98+
throw new ConfigurationError(response.error);
99+
}
100+
101+
$.export("$summary", `Successfully added contact ${this.email} to the mailing list`);
102+
return response;
103+
},
104+
};
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
import {
2+
BODY_CONTENT_TYPE_OPTIONS,
3+
ENCODING_OPTIONS,
4+
} from "../../common/constants.mjs";
5+
import { parseObject } from "../../common/utils.mjs";
6+
import app from "../../elastic_email.app.mjs";
7+
8+
export default {
9+
key: "elastic_email-send-email",
10+
name: "Send Email",
11+
description: "Sends an email to one or more recipients. [See the documentation](https://elasticemail.com/developers/api-documentation/rest-api#operation/emailsPost)",
12+
version: "0.0.1",
13+
type: "action",
14+
props: {
15+
app,
16+
recipients: {
17+
type: "string[]",
18+
label: "Recipients",
19+
description: "List of recipients",
20+
},
21+
from: {
22+
type: "string",
23+
label: "From",
24+
description: "Your e-mail with an optional name (e.g.: [email protected])",
25+
},
26+
bodyContentType: {
27+
type: "string",
28+
label: "Body Content Type",
29+
description: "Type of body part",
30+
options: BODY_CONTENT_TYPE_OPTIONS,
31+
optional: true,
32+
},
33+
bodyContent: {
34+
type: "string",
35+
label: "Body Content",
36+
description: "Actual content of the body part",
37+
optional: true,
38+
},
39+
merge: {
40+
type: "object",
41+
label: "Merge",
42+
description: "A key-value collection of custom merge fields, shared between recipients. Should be used in e-mail body like so: {firstname}, {lastname} etc.",
43+
optional: true,
44+
},
45+
replyTo: {
46+
type: "string",
47+
label: "Reply To",
48+
description: "To what address should the recipients reply to (e.g. [email protected])",
49+
optional: true,
50+
},
51+
subject: {
52+
type: "string",
53+
label: "Subject",
54+
description: "Default subject of email.",
55+
optional: true,
56+
},
57+
templateName: {
58+
propDefinition: [
59+
app,
60+
"templateName",
61+
],
62+
optional: true,
63+
},
64+
timeOffset: {
65+
type: "integer",
66+
label: "Time Offset",
67+
description: "By how long should an e-mail be delayed (in minutes). Maximum is 35 days.",
68+
optional: true,
69+
},
70+
poolName: {
71+
type: "string",
72+
label: "Pool Name",
73+
description: "Name of your custom IP Pool to be used in the sending process",
74+
optional: true,
75+
},
76+
channelName: {
77+
type: "string",
78+
label: "Channel Name",
79+
description: "Name of selected channel.",
80+
optional: true,
81+
},
82+
encoding: {
83+
type: "string",
84+
label: "Encoding",
85+
description: "Encoding type for the email headers",
86+
options: ENCODING_OPTIONS,
87+
optional: true,
88+
},
89+
trackOpens: {
90+
type: "boolean",
91+
label: "Track Opens",
92+
description: "Should the opens be tracked? If no value has been provided, Account's default setting will be used.",
93+
optional: true,
94+
},
95+
trackClicks: {
96+
type: "boolean",
97+
label: "Track Clicks",
98+
description: "Should the clicks be tracked? If no value has been provided, Account's default setting will be used.",
99+
optional: true,
100+
},
101+
},
102+
async run({ $ }) {
103+
const response = await this.app.sendBulkEmails({
104+
$,
105+
data: {
106+
Recipients: parseObject(this.recipients)?.map((item) => ({
107+
Email: item,
108+
})),
109+
Content: {
110+
From: this.from,
111+
Body: [
112+
{
113+
ContentType: this.bodyContentType,
114+
Body: this.bodyContent,
115+
},
116+
],
117+
Merge: parseObject(this.merge),
118+
ReplyTo: this.replyTo,
119+
Subject: this.subject,
120+
TemplateName: this.templateName,
121+
},
122+
Options: {
123+
TimeOffset: this.timeOffset,
124+
PoolName: this.poolName,
125+
ChannelName: this.channelName,
126+
Encoding: this.encoding,
127+
TrackOpens: this.trackOpens,
128+
TrackClicks: this.trackClicks,
129+
},
130+
},
131+
});
132+
$.export("$summary", `Emails sent successfully to ${this.recipients.join(", ")}`);
133+
return response;
134+
},
135+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { parseObject } from "../../common/utils.mjs";
2+
import app from "../../elastic_email.app.mjs";
3+
4+
export default {
5+
key: "elastic_email-unsubscribe-contact",
6+
name: "Unsubscribe Contact",
7+
description: "Unsubscribes a contact from future emails. [See the documentation](https://elasticemail.com/developers/api-documentation/rest-api#operation/suppressionsUnsubscribesPost)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
app,
12+
unsubscribeEmails: {
13+
propDefinition: [
14+
app,
15+
"unsubscribeEmails",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const parsedEmails = parseObject(this.unsubscribeEmails);
21+
const response = await this.app.unsubscribeContact({
22+
$,
23+
data: parsedEmails,
24+
});
25+
$.export("$summary", `Unsubscribed ${parsedEmails.length} contact(s) successfully`);
26+
return response;
27+
},
28+
};

0 commit comments

Comments
 (0)