Skip to content

Commit fa9706c

Browse files
Merge branch 'danny/authed-user-actions' of github.com:PipedreamHQ/pipedream into danny/authed-user-actions
2 parents 26d4070 + b77208e commit fa9706c

File tree

78 files changed

+4841
-63
lines changed

Some content is hidden

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

78 files changed

+4841
-63
lines changed

components/aweber/actions/add-subscriber/add-subscriber.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "Add Subscriber",
77
description: "Add subscribers to the specified account and list. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/post).",
88
type: "action",
9-
version: "0.0.4",
9+
version: "0.0.5",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
import aweberApp from "../../aweber.app.mjs";
2+
3+
export default {
4+
key: "aweber-create-broadcast",
5+
name: "Create Broadcast",
6+
description: "Create a broadcast under the specified account and list. [See the documentation](https://api.aweber.com/#tag/Broadcasts/paths/~1accounts~1%7BaccountId%7D~1lists~1%7BlistId%7D~1broadcasts/post).",
7+
type: "action",
8+
version: "0.0.1",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: false,
13+
},
14+
props: {
15+
aweberApp,
16+
accountId: {
17+
propDefinition: [
18+
aweberApp,
19+
"accountId",
20+
],
21+
},
22+
listId: {
23+
propDefinition: [
24+
aweberApp,
25+
"listId",
26+
({ accountId }) => ({
27+
accountId,
28+
}),
29+
],
30+
},
31+
bodyHTML: {
32+
type: "string",
33+
label: "Body HTML",
34+
description: "The content of the message in HTML format. If `Body Text` is not provided, it will be auto-generated. If `Body Text` is not provided, `Body HTML` must be provided.",
35+
optional: true,
36+
},
37+
bodyText: {
38+
type: "string",
39+
label: "Body Text",
40+
description: "The content of the message in plain text, used when HTML is not supported. If `Body HTML` is not provided, the broadcast will be sent using only the `Body Text`. If `Body Text` is not provided, `Body HTML` must be provided.",
41+
optional: true,
42+
},
43+
bodyAmp: {
44+
type: "string",
45+
label: "Body AMP",
46+
description: "The content of the message in AMP format. [Read Aweber KB article before using this field](https://help.aweber.com/hc/en-us/articles/360025741194)",
47+
optional: true,
48+
},
49+
clickTrackingEnabled: {
50+
type: "boolean",
51+
label: "Click Tracking Enabled",
52+
description: "Enables links in the email message to be tracked.",
53+
optional: true,
54+
},
55+
excludeLists: {
56+
propDefinition: [
57+
aweberApp,
58+
"listSelfLink",
59+
({ accountId }) => ({
60+
accountId,
61+
}),
62+
],
63+
type: "string[]",
64+
label: "Exclude Lists",
65+
description: "List of [Lists](https://api.aweber.com/#tag/Lists) URLs to exclude in the delivery of this broadcast. **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`**",
66+
optional: true,
67+
},
68+
includeLists: {
69+
propDefinition: [
70+
aweberApp,
71+
"listSelfLink",
72+
({ accountId }) => ({
73+
accountId,
74+
}),
75+
],
76+
type: "string[]",
77+
label: "Include Lists",
78+
description: "List of [Lists](https://api.aweber.com/#tag/Lists) URLs to include in the delivery of this broadcast. **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>`**",
79+
optional: true,
80+
},
81+
facebookIntegration: {
82+
propDefinition: [
83+
aweberApp,
84+
"integrations",
85+
({ accountId }) => ({
86+
accountId,
87+
serviceName: "facebook",
88+
}),
89+
],
90+
label: "Facebook Integration",
91+
description: "URL to the [Facebook broadcast integration](https://api.aweber.com/#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be posted to this Facebook integration - **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`**.",
92+
optional: true,
93+
},
94+
isArchived: {
95+
type: "boolean",
96+
label: "Is Archived",
97+
description: "Whether the broadcast enabled sharing via an archive URL.",
98+
optional: true,
99+
},
100+
notifyOnSend: {
101+
type: "boolean",
102+
label: "Notify on Send",
103+
description: "If true, notify when stats are available on a sent broadcast message.",
104+
optional: true,
105+
},
106+
segmentLink: {
107+
propDefinition: [
108+
aweberApp,
109+
"segmentSelfLink",
110+
({
111+
accountId, listId,
112+
}) => ({
113+
accountId,
114+
listId,
115+
}),
116+
],
117+
optional: true,
118+
},
119+
subject: {
120+
type: "string",
121+
label: "Subject",
122+
description: "The broadcast subject line. Subject must not be empty nor contain only whitespace.",
123+
},
124+
twitterIntegration: {
125+
propDefinition: [
126+
aweberApp,
127+
"integrations",
128+
({ accountId }) => ({
129+
accountId,
130+
serviceName: "twitter",
131+
}),
132+
],
133+
label: "Twitter Integration",
134+
description: "URL to the [Twitter broadcast integration](https://api.aweber.com/#tag/Integrations) to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be tweeted - **e.g. `https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>`**.",
135+
optional: true,
136+
},
137+
},
138+
async run({ $ }) {
139+
const response = await this.aweberApp.createBroadcast({
140+
$,
141+
accountId: this.accountId,
142+
listId: this.listId,
143+
data: {
144+
body_html: this.bodyHTML,
145+
body_text: this.bodyText,
146+
body_amp: this.bodyAmp,
147+
click_tracking_enabled: this.clickTrackingEnabled,
148+
exclude_lists: this.excludeLists,
149+
include_lists: this.includeLists,
150+
facebook_integration: this.facebookIntegration,
151+
is_archived: this.isArchived,
152+
notify_on_send: this.notifyOnSend,
153+
segment_link: this.segmentLink,
154+
subject: this.subject,
155+
twitter_integration: this.twitterIntegration,
156+
},
157+
headers: {
158+
"Content-Type": "application/x-www-form-urlencoded",
159+
},
160+
});
161+
162+
$.export("$summary", `Successfully created broadcast with **UUID: ${response.uuid}**.`);
163+
return response;
164+
},
165+
};

components/aweber/actions/create-or-update-subscriber/create-or-update-subscriber.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Create Or Update Subscriber",
66
description: "Create subscriber if the subscriber email is not existing or update the information for the specified subscriber by email. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/patch).",
77
type: "action",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,

components/aweber/actions/get-accounts/get-accounts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "Get Accounts",
88
description: "Get a paginated collection of accounts. [See the docs here](https://api.aweber.com/#tag/Accounts/paths/~1accounts/get).",
99
type: "action",
10-
version: "0.0.4",
10+
version: "0.0.5",
1111
annotations: {
1212
destructiveHint: false,
1313
openWorldHint: true,

components/aweber/actions/get-lists/get-lists.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "Get Lists",
88
description: "Get a paginated collection of subscriber lists. [See the docs here](https://api.aweber.com/#tag/Lists/paths/~1accounts~1{accountId}~1lists/get).",
99
type: "action",
10-
version: "0.0.4",
10+
version: "0.0.5",
1111
annotations: {
1212
destructiveHint: false,
1313
openWorldHint: true,

components/aweber/actions/get-subscribers/get-subscribers.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "Get Subscribers",
88
description: "Get a paginated collection of subscribers under the specified account and list. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/get).",
99
type: "action",
10-
version: "0.0.4",
10+
version: "0.0.5",
1111
annotations: {
1212
destructiveHint: false,
1313
openWorldHint: true,

components/aweber/actions/update-subscriber/update-subscriber.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "Update Subscriber",
77
description: "Update the information for the specified subscriber by email. [See the docs here](https://api.aweber.com/#tag/Subscribers/paths/~1accounts~1{accountId}~1lists~1{listId}~1subscribers/patch).",
88
type: "action",
9-
version: "0.0.3",
9+
version: "0.0.4",
1010
annotations: {
1111
destructiveHint: true,
1212
openWorldHint: true,

0 commit comments

Comments
 (0)