Skip to content

Commit 32b1d60

Browse files
committed
wip
1 parent 857c7da commit 32b1d60

File tree

6 files changed

+450
-6
lines changed

6 files changed

+450
-6
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-create-event",
5+
name: "Create Event",
6+
description: "Create an event in a group. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#add-an-event)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
groupProKey: {
12+
propDefinition: [
13+
addToCalendarPro,
14+
"groupProKey",
15+
],
16+
},
17+
name: {
18+
type: "string",
19+
label: "Name",
20+
description: "The name of the event",
21+
},
22+
startDate: {
23+
type: "string",
24+
label: "Start Date",
25+
description: "The start date of the event in format YYYY-MM-DD",
26+
},
27+
startTime: {
28+
type: "string",
29+
label: "Start Time",
30+
description: "The start time of the event in format HH:MM",
31+
optional: true,
32+
},
33+
endDate: {
34+
type: "string",
35+
label: "End Date",
36+
description: "The end date of the event in format YYYY-MM-DD",
37+
optional: true,
38+
},
39+
endTime: {
40+
type: "string",
41+
label: "End Time",
42+
description: "The end time of the event in format HH:MM",
43+
optional: true,
44+
},
45+
timeZone: {
46+
type: "string",
47+
label: "Time Zone",
48+
description: "The timezone of the event. Example: `America/Los_Angeles`",
49+
optional: true,
50+
},
51+
description: {
52+
type: "string",
53+
label: "Description",
54+
description: "The description of the event",
55+
optional: true,
56+
},
57+
location: {
58+
type: "string",
59+
label: "Location",
60+
description: "The location of the event",
61+
optional: true,
62+
},
63+
rsvp: {
64+
type: "boolean",
65+
label: "RSVP",
66+
description: "Whether the event is an RSVP event",
67+
optional: true,
68+
},
69+
distribution: {
70+
type: "boolean",
71+
label: "Event Distribution",
72+
description: "Whether the event is distributed to all group members",
73+
optional: true,
74+
},
75+
hideButton: {
76+
type: "boolean",
77+
label: "Hide Button",
78+
description: "Whether the Add to Calendar button is hidden",
79+
optional: true,
80+
},
81+
cta: {
82+
type: "boolean",
83+
label: "Call to Action",
84+
description: "Whether the event has a call to action",
85+
optional: true,
86+
},
87+
styleId: {
88+
propDefinition: [
89+
addToCalendarPro,
90+
"styleId",
91+
],
92+
},
93+
landingPageTemplateId: {
94+
propDefinition: [
95+
addToCalendarPro,
96+
"landingPageTemplateId",
97+
],
98+
},
99+
},
100+
async run({ $ }) {
101+
const event = await this.addToCalendarPro.createEvent({
102+
$,
103+
data: {
104+
event_group: this.groupProKey,
105+
dates: [
106+
{
107+
name: this.name,
108+
startDate: this.startDate,
109+
startTime: this.startTime,
110+
endDate: this.endDate,
111+
endTime: this.endTime,
112+
timeZone: this.timeZone,
113+
description: this.description,
114+
location: this.location,
115+
},
116+
],
117+
rsvp: this.rsvp,
118+
distribution: this.distribution,
119+
hideButton: this.hideButton,
120+
cta: this.cta,
121+
layout: this.styleId,
122+
landingpage: this.landingPageTemplateId,
123+
},
124+
});
125+
$.export("$summary", "Successfully created event.");
126+
return event;
127+
},
128+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-delete-event",
5+
name: "Delete Event",
6+
description: "Delete an event. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#delete-an-event)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
eventProKey: {
12+
propDefinition: [
13+
addToCalendarPro,
14+
"eventProKey",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.addToCalendarPro.deleteEvent({
20+
$,
21+
eventProKey: this.eventProKey,
22+
});
23+
$.export("$summary", "Successfully deleted event.");
24+
return response;
25+
},
26+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-get-event-group",
5+
name: "Get Event Group",
6+
description: "Get an event group. [See the documentation](https://docs.add-to-calendar-pro.com/api/groups#get-one-group)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
groupProKey: {
12+
propDefinition: [
13+
addToCalendarPro,
14+
"groupProKey",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.addToCalendarPro.getGroup({
20+
$,
21+
groupProKey: this.groupProKey,
22+
});
23+
$.export("$summary", "Successfully retrieved event group.");
24+
return response;
25+
},
26+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-get-event",
5+
name: "Get Event",
6+
description: "Get an event. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#get-one-event)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
eventProKey: {
12+
propDefinition: [
13+
addToCalendarPro,
14+
"eventProKey",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.addToCalendarPro.getEvent({
20+
$,
21+
eventProKey: this.eventProKey,
22+
});
23+
$.export("$summary", "Successfully retrieved event.");
24+
return response;
25+
},
26+
};

0 commit comments

Comments
 (0)