Skip to content

Commit 66b0e43

Browse files
committed
actions
1 parent c5969a4 commit 66b0e43

File tree

14 files changed

+1056
-104
lines changed

14 files changed

+1056
-104
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import addToCalendarPro from "../../add_to_calendar_pro.app.mjs";
2+
3+
export default {
4+
key: "add_to_calendar_pro-create-event-group",
5+
name: "Create Event Group",
6+
description: "Create an event group. [See the documentation](https://docs.add-to-calendar-pro.com/api/groups#add-a-group)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
addToCalendarPro,
11+
eventGroupName: {
12+
propDefinition: [
13+
addToCalendarPro,
14+
"eventGroupName",
15+
],
16+
},
17+
internalNote: {
18+
propDefinition: [
19+
addToCalendarPro,
20+
"internalNote",
21+
],
22+
},
23+
subscriptionCallUrl: {
24+
propDefinition: [
25+
addToCalendarPro,
26+
"subscriptionCallUrl",
27+
],
28+
},
29+
cta: {
30+
propDefinition: [
31+
addToCalendarPro,
32+
"cta",
33+
],
34+
},
35+
styleId: {
36+
propDefinition: [
37+
addToCalendarPro,
38+
"styleId",
39+
],
40+
},
41+
landingPageTemplateId: {
42+
propDefinition: [
43+
addToCalendarPro,
44+
"landingPageTemplateId",
45+
],
46+
optional: true,
47+
},
48+
},
49+
async run({ $ }) {
50+
const response = await this.addToCalendarPro.createGroup({
51+
$,
52+
data: {
53+
name: this.eventGroupName,
54+
internal_note: this.internalNote,
55+
subscription: this.subscriptionCallUrl
56+
? "external"
57+
: "no",
58+
subscription_call_url: this.subscriptionCallUrl,
59+
cta: this.cta,
60+
layout: this.styleId,
61+
landingpage: this.landingPageTemplateId,
62+
},
63+
});
64+
$.export("$summary", "Successfully created event group.");
65+
return response;
66+
},
67+
};

components/add_to_calendar_pro/actions/create-event/create-event.mjs

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,74 +15,76 @@ export default {
1515
],
1616
},
1717
name: {
18-
type: "string",
19-
label: "Name",
20-
description: "The name of the event",
18+
propDefinition: [
19+
addToCalendarPro,
20+
"eventName",
21+
],
2122
},
2223
startDate: {
23-
type: "string",
24-
label: "Start Date",
25-
description: "The start date of the event in format YYYY-MM-DD",
24+
propDefinition: [
25+
addToCalendarPro,
26+
"startDate",
27+
],
2628
},
2729
startTime: {
28-
type: "string",
29-
label: "Start Time",
30-
description: "The start time of the event in format HH:MM",
31-
optional: true,
30+
propDefinition: [
31+
addToCalendarPro,
32+
"startTime",
33+
],
3234
},
3335
endDate: {
34-
type: "string",
35-
label: "End Date",
36-
description: "The end date of the event in format YYYY-MM-DD",
37-
optional: true,
36+
propDefinition: [
37+
addToCalendarPro,
38+
"endDate",
39+
],
3840
},
3941
endTime: {
40-
type: "string",
41-
label: "End Time",
42-
description: "The end time of the event in format HH:MM",
43-
optional: true,
42+
propDefinition: [
43+
addToCalendarPro,
44+
"endTime",
45+
],
4446
},
4547
timeZone: {
46-
type: "string",
47-
label: "Time Zone",
48-
description: "The timezone of the event. Example: `America/Los_Angeles`",
49-
optional: true,
48+
propDefinition: [
49+
addToCalendarPro,
50+
"timeZone",
51+
],
5052
},
5153
description: {
52-
type: "string",
53-
label: "Description",
54-
description: "The description of the event",
55-
optional: true,
54+
propDefinition: [
55+
addToCalendarPro,
56+
"description",
57+
],
5658
},
5759
location: {
58-
type: "string",
59-
label: "Location",
60-
description: "The location of the event",
61-
optional: true,
60+
propDefinition: [
61+
addToCalendarPro,
62+
"location",
63+
],
6264
},
6365
rsvp: {
64-
type: "boolean",
65-
label: "RSVP",
66-
description: "Whether the event is an RSVP event",
67-
optional: true,
66+
propDefinition: [
67+
addToCalendarPro,
68+
"rsvp",
69+
],
6870
},
6971
distribution: {
70-
type: "boolean",
71-
label: "Event Distribution",
72-
description: "Whether the event is distributed to all group members",
73-
optional: true,
72+
propDefinition: [
73+
addToCalendarPro,
74+
"distribution",
75+
],
7476
},
7577
hideButton: {
76-
type: "boolean",
77-
label: "Hide Button",
78-
description: "Whether the Add to Calendar button is hidden",
79-
optional: true,
78+
propDefinition: [
79+
addToCalendarPro,
80+
"hideButton",
81+
],
8082
},
8183
cta: {
82-
type: "boolean",
83-
label: "Call to Action",
84-
description: "Whether the event has a call to action",
85-
optional: true,
84+
propDefinition: [
85+
addToCalendarPro,
86+
"cta",
87+
],
8688
},
8789
styleId: {
8890
propDefinition: [

components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,88 +9,76 @@ export default {
99
props: {
1010
addToCalendarPro,
1111
name: {
12-
type: "string",
13-
label: "Name",
14-
description: "The name of the landing page template",
12+
propDefinition: [
13+
addToCalendarPro,
14+
"landingPageTemplateName",
15+
],
1516
},
1617
title: {
17-
type: "string",
18-
label: "Title",
19-
description: "The title of the landing page template",
20-
optional: true,
18+
propDefinition: [
19+
addToCalendarPro,
20+
"title",
21+
],
2122
},
2223
intro: {
23-
type: "string",
24-
label: "Intro",
25-
description: "The intro of the landing page template",
26-
optional: true,
24+
propDefinition: [
25+
addToCalendarPro,
26+
"intro",
27+
],
2728
},
2829
legal: {
29-
type: "string",
30-
label: "Legal",
31-
description: "The legal footer text; allows for HTML",
32-
optional: true,
30+
propDefinition: [
31+
addToCalendarPro,
32+
"legal",
33+
],
3334
},
3435
highlightColor: {
35-
type: "string",
36-
label: "Highlight Color",
37-
description: "Hex code; used for buttons and decorative elements",
38-
optional: true,
36+
propDefinition: [
37+
addToCalendarPro,
38+
"highlightColor",
39+
],
3940
},
4041
backgroundColor1: {
41-
type: "string",
42-
label: "Background Color 1",
43-
description: "Hex code; used for the background of the template",
44-
optional: true,
42+
propDefinition: [
43+
addToCalendarPro,
44+
"backgroundColor1",
45+
],
4546
},
4647
backgroundColor2: {
47-
type: "string",
48-
label: "Background Color 2",
49-
description: "Hex code; used for the background of the template",
50-
optional: true,
48+
propDefinition: [
49+
addToCalendarPro,
50+
"backgroundColor2",
51+
],
5152
},
5253
background: {
53-
type: "string",
54-
label: "Background",
55-
description: "Background of the template",
56-
options: [
57-
"solid",
58-
"gradient",
59-
"image",
60-
"preset",
54+
propDefinition: [
55+
addToCalendarPro,
56+
"background",
6157
],
62-
optional: true,
6358
},
6459
gradientDirection: {
65-
type: "string",
66-
label: "Gradient Direction",
67-
description: "The direction of the gradient. Only used if `background` is `gradient`.",
68-
options: [
69-
"linear-t",
70-
"linear-tr",
71-
"linear-r",
72-
"linear-br",
73-
"radial",
60+
propDefinition: [
61+
addToCalendarPro,
62+
"gradientDirection",
7463
],
75-
optional: true,
7664
},
7765
imageRepeat: {
78-
type: "boolean",
79-
label: "Image Repeat",
80-
description: "Whether to show the background image fullscreen or repeat it",
81-
optional: true,
66+
propDefinition: [
67+
addToCalendarPro,
68+
"imageRepeat",
69+
],
8270
},
8371
metaTitleOverride: {
84-
type: "string",
85-
label: "Meta Title Override",
86-
description: "Text that overrides the auto-generated meta title",
87-
optional: true,
72+
propDefinition: [
73+
addToCalendarPro,
74+
"metaTitleOverride",
75+
],
8876
},
8977
metaDescriptionOverride: {
90-
type: "string",
91-
label: "Meta Description Override",
92-
description: "Text that overrides the auto-generated meta description",
93-
optional: true,
78+
propDefinition: [
79+
addToCalendarPro,
80+
"metaDescriptionOverride",
81+
],
9482
},
9583
},
9684
async run({ $ }) {

0 commit comments

Comments
 (0)