Skip to content

Commit 46ae2e0

Browse files
authored
17406 components indiefunnels (#17619)
* [Components] indiefunnels #17406 Sources - New Booking Session (Instant) - New Form Submission (Instant) - New Order (Instant) - Contact Updated (Instant) Actions - Create Contact - Update Contact - Create Member - Update Member * pnpm update * Fix typos in descriptions and improve webhook ID handling in indiefunnels component * Add common methods to indiefunnels sources for consistency * pnpm update
1 parent 79f5d7f commit 46ae2e0

File tree

20 files changed

+1430
-11
lines changed

20 files changed

+1430
-11
lines changed

components/alt_text_lab/alt_text_lab.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: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
import { parseObject } from "../../common/utils.mjs";
2+
import indiefunnels from "../../indiefunnels.app.mjs";
3+
4+
export default {
5+
key: "indiefunnels-create-contact",
6+
name: "Create Contact",
7+
description: "Creates a new Contact on your IndieFunnel website. [See the documentation](https://websitebuilder.docs.apiary.io/#reference/contacts/list-and-create/create-new-contact)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
indiefunnels,
12+
name: {
13+
propDefinition: [
14+
indiefunnels,
15+
"name",
16+
],
17+
optional: true,
18+
},
19+
email: {
20+
propDefinition: [
21+
indiefunnels,
22+
"email",
23+
],
24+
},
25+
phone: {
26+
propDefinition: [
27+
indiefunnels,
28+
"phone",
29+
],
30+
optional: true,
31+
},
32+
note: {
33+
propDefinition: [
34+
indiefunnels,
35+
"note",
36+
],
37+
optional: true,
38+
},
39+
address: {
40+
propDefinition: [
41+
indiefunnels,
42+
"address",
43+
],
44+
optional: true,
45+
},
46+
city: {
47+
propDefinition: [
48+
indiefunnels,
49+
"city",
50+
],
51+
optional: true,
52+
},
53+
state: {
54+
propDefinition: [
55+
indiefunnels,
56+
"state",
57+
],
58+
optional: true,
59+
},
60+
zip: {
61+
propDefinition: [
62+
indiefunnels,
63+
"zip",
64+
],
65+
optional: true,
66+
},
67+
country: {
68+
propDefinition: [
69+
indiefunnels,
70+
"country",
71+
],
72+
optional: true,
73+
},
74+
companyName: {
75+
propDefinition: [
76+
indiefunnels,
77+
"companyName",
78+
],
79+
optional: true,
80+
},
81+
properties: {
82+
propDefinition: [
83+
indiefunnels,
84+
"properties",
85+
],
86+
optional: true,
87+
},
88+
tags: {
89+
propDefinition: [
90+
indiefunnels,
91+
"tags",
92+
],
93+
optional: true,
94+
},
95+
subscribed: {
96+
propDefinition: [
97+
indiefunnels,
98+
"subscribed",
99+
],
100+
optional: true,
101+
},
102+
subscriberLists: {
103+
propDefinition: [
104+
indiefunnels,
105+
"subscriberLists",
106+
],
107+
optional: true,
108+
},
109+
},
110+
async run({ $ }) {
111+
const {
112+
indiefunnels,
113+
properties,
114+
tags,
115+
subscriberLists,
116+
...data
117+
} = this;
118+
119+
const response = await indiefunnels.createContact({
120+
$,
121+
data: {
122+
properties: Object.entries(parseObject(properties) || {})?.map(([
123+
key,
124+
value,
125+
]) => ({
126+
name: key,
127+
value,
128+
})),
129+
tags: parseObject(tags),
130+
subscriberLists: parseObject(subscriberLists),
131+
...data,
132+
},
133+
});
134+
135+
$.export("$summary", `Successfully created contact with ID: ${response.id}`);
136+
return response;
137+
},
138+
};
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
import { cleanObj } from "../../common/utils.mjs";
2+
import indiefunnels from "../../indiefunnels.app.mjs";
3+
4+
export default {
5+
key: "indiefunnels-create-member",
6+
name: "Create Member",
7+
description: "Creates a new Member on your IndieFunnel website. [See the documentation](https://websitebuilder.docs.apiary.io/#reference/members/list-and-create/create-new-member)",
8+
version: "0.0.1",
9+
type: "action",
10+
props: {
11+
indiefunnels,
12+
name: {
13+
propDefinition: [
14+
indiefunnels,
15+
"name",
16+
],
17+
description: "The name of the member",
18+
},
19+
email: {
20+
propDefinition: [
21+
indiefunnels,
22+
"email",
23+
],
24+
description: "The email address of the member",
25+
},
26+
groups: {
27+
propDefinition: [
28+
indiefunnels,
29+
"groups",
30+
],
31+
optional: true,
32+
},
33+
approved: {
34+
propDefinition: [
35+
indiefunnels,
36+
"approved",
37+
],
38+
optional: true,
39+
},
40+
contactId: {
41+
propDefinition: [
42+
indiefunnels,
43+
"contactId",
44+
],
45+
optional: true,
46+
},
47+
billingPhone: {
48+
propDefinition: [
49+
indiefunnels,
50+
"billingPhone",
51+
],
52+
optional: true,
53+
},
54+
billingCompanyName: {
55+
propDefinition: [
56+
indiefunnels,
57+
"billingCompanyName",
58+
],
59+
optional: true,
60+
},
61+
billingCompanyId: {
62+
propDefinition: [
63+
indiefunnels,
64+
"billingCompanyId",
65+
],
66+
optional: true,
67+
},
68+
billingCountry: {
69+
propDefinition: [
70+
indiefunnels,
71+
"billingCountry",
72+
],
73+
optional: true,
74+
},
75+
billingState: {
76+
propDefinition: [
77+
indiefunnels,
78+
"billingState",
79+
],
80+
optional: true,
81+
},
82+
billingCity: {
83+
propDefinition: [
84+
indiefunnels,
85+
"billingCity",
86+
],
87+
optional: true,
88+
},
89+
billingZipCode: {
90+
propDefinition: [
91+
indiefunnels,
92+
"billingZipCode",
93+
],
94+
optional: true,
95+
},
96+
billingAddress: {
97+
propDefinition: [
98+
indiefunnels,
99+
"billingAddress",
100+
],
101+
optional: true,
102+
},
103+
billingAddress2: {
104+
propDefinition: [
105+
indiefunnels,
106+
"billingAddress2",
107+
],
108+
optional: true,
109+
},
110+
shippingPhone: {
111+
propDefinition: [
112+
indiefunnels,
113+
"shippingPhone",
114+
],
115+
optional: true,
116+
},
117+
shippingCompanyName: {
118+
propDefinition: [
119+
indiefunnels,
120+
"shippingCompanyName",
121+
],
122+
optional: true,
123+
},
124+
shippingCompanyId: {
125+
propDefinition: [
126+
indiefunnels,
127+
"shippingCompanyId",
128+
],
129+
optional: true,
130+
},
131+
shippingCountry: {
132+
propDefinition: [
133+
indiefunnels,
134+
"shippingCountry",
135+
],
136+
optional: true,
137+
},
138+
shippingState: {
139+
propDefinition: [
140+
indiefunnels,
141+
"shippingState",
142+
],
143+
optional: true,
144+
},
145+
shippingCity: {
146+
propDefinition: [
147+
indiefunnels,
148+
"shippingCity",
149+
],
150+
optional: true,
151+
},
152+
shippingZipCode: {
153+
propDefinition: [
154+
indiefunnels,
155+
"shippingZipCode",
156+
],
157+
optional: true,
158+
},
159+
shippingAddress: {
160+
propDefinition: [
161+
indiefunnels,
162+
"shippingAddress",
163+
],
164+
optional: true,
165+
},
166+
shippingAddress2: {
167+
propDefinition: [
168+
indiefunnels,
169+
"shippingAddress2",
170+
],
171+
optional: true,
172+
},
173+
},
174+
async run({ $ }) {
175+
const response = await this.indiefunnels.createMember({
176+
$,
177+
data: cleanObj({
178+
name: this.name,
179+
email: this.email,
180+
groups: this.groups,
181+
approved: this.approved,
182+
contactId: this.contactId,
183+
billingAddress: {
184+
phone: this.billingPhone,
185+
companyName: this.billingCompanyName,
186+
companyId: this.billingCompanyId,
187+
country: this.billingCountry,
188+
state: this.billingState,
189+
city: this.billingCity,
190+
zipCode: this.billingZipCode,
191+
address: this.billingAddress,
192+
address2: this.billingAddress2,
193+
},
194+
shippingAddress: {
195+
phone: this.shippingPhone,
196+
companyName: this.shippingCompanyName,
197+
companyId: this.shippingCompanyId,
198+
country: this.shippingCountry,
199+
state: this.shippingState,
200+
city: this.shippingCity,
201+
zipCode: this.shippingZipCode,
202+
address: this.shippingAddress,
203+
address2: this.shippingAddress2,
204+
},
205+
}),
206+
});
207+
208+
$.export("$summary", `Successfully created member with ID: ${response.id}`);
209+
return response;
210+
},
211+
};

0 commit comments

Comments
 (0)