Skip to content

Commit 3d6802e

Browse files
authored
Merge branch 'master' into master
2 parents 330430e + 56a1a2e commit 3d6802e

File tree

38 files changed

+1289
-34
lines changed

38 files changed

+1289
-34
lines changed
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: "icontact",
3+
app: "action1",
64
propDefinitions: {},
75
methods: {
86
// this.$auth contains connected account data
97
authKeys() {
108
console.log(Object.keys(this.$auth));
119
},
1210
},
13-
});
11+
};

components/action1/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/action1",
3+
"version": "0.0.1",
4+
"description": "Pipedream Action1 Components",
5+
"main": "action1.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"action1"
9+
],
10+
"homepage": "https://pipedream.com/apps/action1",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/buddy/buddy.app.mjs

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: "buddy",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/buddy/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/buddy",
3+
"version": "0.0.1",
4+
"description": "Pipedream Buddy Components",
5+
"main": "buddy.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"buddy"
9+
],
10+
"homepage": "https://pipedream.com/apps/buddy",
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: "guardrails",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/guardrails/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/guardrails",
3+
"version": "0.0.1",
4+
"description": "Pipedream Guardrails Components",
5+
"main": "guardrails.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"guardrails"
9+
],
10+
"homepage": "https://pipedream.com/apps/guardrails",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

components/icontact/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
import { STATUS_OPTIONS } from "../../common/constants.mjs";
2+
import { checkWarnings } from "../../common/utils.mjs";
3+
import icontact from "../../icontact.app.mjs";
4+
5+
export default {
6+
key: "icontact-create-contact",
7+
name: "Create Contact",
8+
description: "Creates a new contact within the iContact account. [See the documentation](https://help.icontact.com/customers/s/article/Contacts-iContact-API?r=153&ui-knowledge-components-aura-actions.KnowledgeArticleVersionCreateDraftFromOnlineAction.createDraftFromOnlineArticle=1)",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
icontact,
13+
email: {
14+
type: "string",
15+
label: "Email",
16+
description: "The contact's email address. **Note: The email address must be unique**.",
17+
},
18+
prefix: {
19+
type: "string",
20+
label: "Prefix",
21+
description: "The contact's salutation. **E.g. Miss**",
22+
optional: true,
23+
},
24+
firstName: {
25+
type: "string",
26+
label: "First Name",
27+
description: "The contact's first name.",
28+
optional: true,
29+
},
30+
lastName: {
31+
type: "string",
32+
label: "Last Name",
33+
description: "The contact's last name.",
34+
optional: true,
35+
},
36+
suffix: {
37+
type: "string",
38+
label: "Suffix",
39+
description: "The contact's name qualifications **E.g. III**.",
40+
optional: true,
41+
},
42+
street: {
43+
type: "string",
44+
label: "Street",
45+
description: "The contact's street address information.",
46+
optional: true,
47+
},
48+
street2: {
49+
type: "string",
50+
label: "Street 2",
51+
description: "The contact's line 2 information.",
52+
optional: true,
53+
},
54+
city: {
55+
type: "string",
56+
label: "City",
57+
description: "The contact's city information.",
58+
optional: true,
59+
},
60+
state: {
61+
type: "string",
62+
label: "State",
63+
description: "The contact's state information.",
64+
optional: true,
65+
},
66+
postalCode: {
67+
type: "string",
68+
label: "Postal Code",
69+
description: "The contact's postal code information.",
70+
optional: true,
71+
},
72+
phone: {
73+
type: "string",
74+
label: "Phone",
75+
description: "The contact's phone number.",
76+
optional: true,
77+
},
78+
fax: {
79+
type: "string",
80+
label: "Fax",
81+
description: "The contact's fax number.",
82+
optional: true,
83+
},
84+
business: {
85+
type: "string",
86+
label: "Business",
87+
description: "The contact's business phone number.",
88+
optional: true,
89+
},
90+
status: {
91+
type: "string",
92+
label: "Status",
93+
description: "The subscription status of the contact.",
94+
options: STATUS_OPTIONS,
95+
optional: true,
96+
},
97+
},
98+
async run({ $ }) {
99+
const {
100+
icontact,
101+
...contact
102+
} = this;
103+
104+
const { contacts } = await icontact.searchContact({
105+
params: {
106+
email: contact.email,
107+
},
108+
});
109+
110+
if (contacts.length) throw new Error("A contact with the provided email already exists.");
111+
112+
const response = await icontact.createContact({
113+
$,
114+
data: {
115+
contact,
116+
},
117+
});
118+
119+
checkWarnings(response);
120+
121+
$.export("$summary", `Successfully created contact with ID: ${response.contacts[0].contactId}`);
122+
return response.contacts[0];
123+
},
124+
};
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import { MESSAGE_TYPE_OPTIONS } from "../../common/constants.mjs";
2+
import { checkWarnings } from "../../common/utils.mjs";
3+
import icontact from "../../icontact.app.mjs";
4+
5+
export default {
6+
key: "icontact-create-message",
7+
name: "Create and Dispatch Message",
8+
description: "Creates and dispatches a new message using custom HTML. [See the documentation](https://help.icontact.com/customers/s/article/Messages-iContact-API?r=153&ui-knowledge-components-aura-actions.KnowledgeArticleVersionCreateDraftFromOnlineAction.createDraftFromOnlineArticle=1)",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
icontact,
13+
campaignId: {
14+
propDefinition: [
15+
icontact,
16+
"campaignId",
17+
],
18+
},
19+
messageType: {
20+
type: "string",
21+
label: "Message Type",
22+
description: "The kind of message being added.",
23+
options: MESSAGE_TYPE_OPTIONS,
24+
},
25+
subject: {
26+
type: "string",
27+
label: "Subject",
28+
description: "The subject line of the email.",
29+
},
30+
htmlBody: {
31+
type: "string",
32+
label: "HTML Body",
33+
description: "Contains the HTML version of the email message body.",
34+
optional: true,
35+
},
36+
textBody: {
37+
type: "string",
38+
label: "Text Body",
39+
description: "Contains the text version of the email message body.",
40+
optional: true,
41+
},
42+
messageName: {
43+
type: "string",
44+
label: "Message Name",
45+
description: "The reference name of the message. This is used for organizational purposes and will not be seen by your contacts.",
46+
optional: true,
47+
},
48+
previewText: {
49+
type: "string",
50+
label: "Preview Text",
51+
description: "Indicates the preview text that some email systems display before opening the email.",
52+
optional: true,
53+
},
54+
replyToCampaignId: {
55+
propDefinition: [
56+
icontact,
57+
"campaignId",
58+
],
59+
label: "Reply To Campaign Id",
60+
description: "Indicates the sender property where you want reply emails to be sent to.",
61+
optional: true,
62+
},
63+
},
64+
async run({ $ }) {
65+
const {
66+
icontact,
67+
...message
68+
} = this;
69+
70+
const response = await icontact.createMessage({
71+
$,
72+
data: {
73+
message,
74+
},
75+
});
76+
77+
checkWarnings(response);
78+
79+
$.export("$summary", `Successfully created message with ID: ${response.messages[0].messageId}`);
80+
return response.messages[0];
81+
},
82+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { checkWarnings } from "../../common/utils.mjs";
2+
import icontact from "../../icontact.app.mjs";
3+
4+
export default {
5+
key: "icontact-subscribe-contact-list",
6+
name: "Subscribe Contact to List",
7+
description: "Adds a contact to a specific list within iContact. [See the documentation](https://help.icontact.com/customers/s/article/Subscriptions-iContact-API?r=153&ui-knowledge-components-aura-actions.KnowledgeArticleVersionCreateDraftFromOnlineAction.createDraftFromOnlineArticle=1)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
icontact,
12+
contactId: {
13+
propDefinition: [
14+
icontact,
15+
"contactId",
16+
],
17+
},
18+
listId: {
19+
propDefinition: [
20+
icontact,
21+
"listId",
22+
],
23+
},
24+
},
25+
async run({ $ }) {
26+
const response = await this.icontact.subscribeContactToList({
27+
data: {
28+
subscription: {
29+
contactId: this.contactId,
30+
listId: this.listId,
31+
status: "normal",
32+
},
33+
},
34+
});
35+
36+
checkWarnings(response);
37+
38+
$.export("$summary", `Successfully created subscription with ID: ${response.subscriptions[0].subscriptionId}`);
39+
return response.subscriptions[0];
40+
},
41+
};

0 commit comments

Comments
 (0)