From 32b1d602938e0b74b5a3a79b01d8b06111feb41d Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Thu, 26 Jun 2025 11:23:44 -0400 Subject: [PATCH 1/8] wip --- .../actions/create-event/create-event.mjs | 128 +++++++++ .../actions/delete-event/delete-event.mjs | 26 ++ .../get-event-group/get-event-group.mjs | 26 ++ .../actions/get-event/get-event.mjs | 26 ++ .../add_to_calendar_pro.app.mjs | 243 +++++++++++++++++- components/add_to_calendar_pro/package.json | 7 +- 6 files changed, 450 insertions(+), 6 deletions(-) create mode 100644 components/add_to_calendar_pro/actions/create-event/create-event.mjs create mode 100644 components/add_to_calendar_pro/actions/delete-event/delete-event.mjs create mode 100644 components/add_to_calendar_pro/actions/get-event-group/get-event-group.mjs create mode 100644 components/add_to_calendar_pro/actions/get-event/get-event.mjs diff --git a/components/add_to_calendar_pro/actions/create-event/create-event.mjs b/components/add_to_calendar_pro/actions/create-event/create-event.mjs new file mode 100644 index 0000000000000..363d93f146ef3 --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-event/create-event.mjs @@ -0,0 +1,128 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-create-event", + name: "Create Event", + description: "Create an event in a group. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#add-an-event)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + groupProKey: { + propDefinition: [ + addToCalendarPro, + "groupProKey", + ], + }, + name: { + type: "string", + label: "Name", + description: "The name of the event", + }, + startDate: { + type: "string", + label: "Start Date", + description: "The start date of the event in format YYYY-MM-DD", + }, + startTime: { + type: "string", + label: "Start Time", + description: "The start time of the event in format HH:MM", + optional: true, + }, + endDate: { + type: "string", + label: "End Date", + description: "The end date of the event in format YYYY-MM-DD", + optional: true, + }, + endTime: { + type: "string", + label: "End Time", + description: "The end time of the event in format HH:MM", + optional: true, + }, + timeZone: { + type: "string", + label: "Time Zone", + description: "The timezone of the event. Example: `America/Los_Angeles`", + optional: true, + }, + description: { + type: "string", + label: "Description", + description: "The description of the event", + optional: true, + }, + location: { + type: "string", + label: "Location", + description: "The location of the event", + optional: true, + }, + rsvp: { + type: "boolean", + label: "RSVP", + description: "Whether the event is an RSVP event", + optional: true, + }, + distribution: { + type: "boolean", + label: "Event Distribution", + description: "Whether the event is distributed to all group members", + optional: true, + }, + hideButton: { + type: "boolean", + label: "Hide Button", + description: "Whether the Add to Calendar button is hidden", + optional: true, + }, + cta: { + type: "boolean", + label: "Call to Action", + description: "Whether the event has a call to action", + optional: true, + }, + styleId: { + propDefinition: [ + addToCalendarPro, + "styleId", + ], + }, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + }, + }, + async run({ $ }) { + const event = await this.addToCalendarPro.createEvent({ + $, + data: { + event_group: this.groupProKey, + dates: [ + { + name: this.name, + startDate: this.startDate, + startTime: this.startTime, + endDate: this.endDate, + endTime: this.endTime, + timeZone: this.timeZone, + description: this.description, + location: this.location, + }, + ], + rsvp: this.rsvp, + distribution: this.distribution, + hideButton: this.hideButton, + cta: this.cta, + layout: this.styleId, + landingpage: this.landingPageTemplateId, + }, + }); + $.export("$summary", "Successfully created event."); + return event; + }, +}; diff --git a/components/add_to_calendar_pro/actions/delete-event/delete-event.mjs b/components/add_to_calendar_pro/actions/delete-event/delete-event.mjs new file mode 100644 index 0000000000000..45fc5e37dcd3e --- /dev/null +++ b/components/add_to_calendar_pro/actions/delete-event/delete-event.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-delete-event", + name: "Delete Event", + description: "Delete an event. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#delete-an-event)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + eventProKey: { + propDefinition: [ + addToCalendarPro, + "eventProKey", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.deleteEvent({ + $, + eventProKey: this.eventProKey, + }); + $.export("$summary", "Successfully deleted event."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/get-event-group/get-event-group.mjs b/components/add_to_calendar_pro/actions/get-event-group/get-event-group.mjs new file mode 100644 index 0000000000000..56a6f48c4691f --- /dev/null +++ b/components/add_to_calendar_pro/actions/get-event-group/get-event-group.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-get-event-group", + name: "Get Event Group", + description: "Get an event group. [See the documentation](https://docs.add-to-calendar-pro.com/api/groups#get-one-group)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + groupProKey: { + propDefinition: [ + addToCalendarPro, + "groupProKey", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.getGroup({ + $, + groupProKey: this.groupProKey, + }); + $.export("$summary", "Successfully retrieved event group."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/get-event/get-event.mjs b/components/add_to_calendar_pro/actions/get-event/get-event.mjs new file mode 100644 index 0000000000000..36645cdd6648c --- /dev/null +++ b/components/add_to_calendar_pro/actions/get-event/get-event.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-get-event", + name: "Get Event", + description: "Get an event. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#get-one-event)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + eventProKey: { + propDefinition: [ + addToCalendarPro, + "eventProKey", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.getEvent({ + $, + eventProKey: this.eventProKey, + }); + $.export("$summary", "Successfully retrieved event."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs index 98b59c7cbe899..d34fb1fdfa632 100644 --- a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs +++ b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs @@ -1,11 +1,246 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "add_to_calendar_pro", - propDefinitions: {}, + propDefinitions: { + groupProKey: { + type: "string", + label: "Group Pro Key", + description: "The pro key of a group", + async options() { + const groups = await this.listGroups(); + return groups?.map((group) => ({ + label: group.label, + value: group.prokey, + })) || []; + }, + }, + styleId: { + type: "string", + label: "Style ID", + description: "The ID of a style", + optional: true, + async options() { + const styles = await this.listStyles(); + return styles?.map((style) => ({ + label: style.name, + value: style.id, + })) || []; + }, + }, + landingPageTemplateId: { + type: "string", + label: "Landing Page Template ID", + description: "The ID of a landing page template", + optional: true, + async options() { + const templates = await this.listLandingPageTemplates(); + return templates?.map((template) => ({ + label: template.name, + value: template.id, + })) || []; + }, + }, + eventProKey: { + type: "string", + label: "Event Pro Key", + description: "The pro key of an event", + async options() { + const events = await this.listEvents(); + return events?.map((event) => ({ + label: event.label, + value: event.prokey, + })) || []; + }, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.add-to-calendar-pro.com/v1"; + }, + async _makeRequest({ + $ = this, path, ...opts + }) { + try { + return await axios($, { + url: `${this._baseUrl()}${path}`, + headers: { + Authorization: `${this.$auth.api_key}`, + }, + ...opts, + }); + } catch (error) { + if (error.status === 404 && JSON.parse(error.message)?.message?.includes("No entry found")) { + console.log("No entry found"); + } else { + throw error; + } + } + }, + getGroup({ + groupProKey, ...opts + }) { + return this._makeRequest({ + path: `/group/${groupProKey}`, + ...opts, + }); + }, + getEvent({ + eventProKey, ...opts + }) { + return this._makeRequest({ + path: `/event/${eventProKey}`, + ...opts, + }); + }, + getLandingPageTemplate({ + landingPageTemplateId, ...opts + }) { + return this._makeRequest({ + path: `/landingpage/${landingPageTemplateId}`, + ...opts, + }); + }, + getRsvpTemplate({ + rsvpTemplateId, ...opts + }) { + return this._makeRequest({ + path: `/rsvp-block/${rsvpTemplateId}`, + ...opts, + }); + }, + getIcsData({ + eventProKey, ...opts + }) { + return this._makeRequest({ + path: `/ics/${eventProKey}`, + ...opts, + }); + }, + listGroups(opts = {}) { + return this._makeRequest({ + path: "/group/all", + ...opts, + }); + }, + listStyles(opts = {}) { + return this._makeRequest({ + path: "/style/all", + ...opts, + }); + }, + listLandingPageTemplates(opts = {}) { + return this._makeRequest({ + path: "/landingpage/all", + ...opts, + }); + }, + listEvents(opts = {}) { + return this._makeRequest({ + path: "/event/all", + ...opts, + }); + }, + createGroup(opts = {}) { + return this._makeRequest({ + path: "/group", + method: "POST", + ...opts, + }); + }, + createEvent(opts = {}) { + return this._makeRequest({ + path: "/event", + method: "POST", + ...opts, + }); + }, + createLandingPageTemplate(opts = {}) { + return this._makeRequest({ + path: "/landingpage", + method: "POST", + ...opts, + }); + }, + createRsvpTemplate(opts = {}) { + return this._makeRequest({ + path: "/rsvp-block", + method: "POST", + ...opts, + }); + }, + updateGroup({ + groupProKey, ...opts + }) { + return this._makeRequest({ + path: `/group/${groupProKey}`, + method: "PATCH", + ...opts, + }); + }, + updateEvent({ + eventProKey, ...opts + }) { + return this._makeRequest({ + path: `/event/${eventProKey}`, + method: "PATCH", + ...opts, + }); + }, + updateLandingPageTemplate({ + landingPageTemplateId, ...opts + }) { + return this._makeRequest({ + path: `/landingpage/${landingPageTemplateId}`, + method: "PATCH", + ...opts, + }); + }, + updateRsvpTemplate({ + rsvpTemplateId, ...opts + }) { + return this._makeRequest({ + path: `/rsvp-block/${rsvpTemplateId}`, + method: "PATCH", + ...opts, + }); + }, + deleteGroup({ + groupProKey, ...opts + }) { + return this._makeRequest({ + path: `/group/${groupProKey}`, + method: "DELETE", + ...opts, + }); + }, + deleteEvent({ + eventProKey, ...opts + }) { + return this._makeRequest({ + path: `/event/${eventProKey}`, + method: "DELETE", + ...opts, + }); + }, + deleteLandingPageTemplate({ + landingPageTemplateId, ...opts + }) { + return this._makeRequest({ + path: `/landingpage/${landingPageTemplateId}`, + method: "DELETE", + ...opts, + }); + }, + deleteRsvpTemplate({ + rsvpTemplateId, ...opts + }) { + return this._makeRequest({ + path: `/rsvp-block/${rsvpTemplateId}`, + method: "DELETE", + ...opts, + }); }, }, }; diff --git a/components/add_to_calendar_pro/package.json b/components/add_to_calendar_pro/package.json index cdde748719184..7f3fe227d569a 100644 --- a/components/add_to_calendar_pro/package.json +++ b/components/add_to_calendar_pro/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/add_to_calendar_pro", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Add to Calendar PRO Components", "main": "add_to_calendar_pro.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } -} \ No newline at end of file +} From c5969a4d2c9d78efc57516012d87a7f59c80b13a Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Thu, 26 Jun 2025 12:37:41 -0400 Subject: [PATCH 2/8] wip --- .../actions/create-event/create-event.mjs | 1 + .../create-landing-page-template.mjs | 117 ++++++++++++++++++ .../delete-landing-page-template.mjs | 26 ++++ .../get-landing-page-template.mjs | 26 ++++ .../add_to_calendar_pro.app.mjs | 1 - 5 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs create mode 100644 components/add_to_calendar_pro/actions/delete-landing-page-template/delete-landing-page-template.mjs create mode 100644 components/add_to_calendar_pro/actions/get-landing-page-template/get-landing-page-template.mjs diff --git a/components/add_to_calendar_pro/actions/create-event/create-event.mjs b/components/add_to_calendar_pro/actions/create-event/create-event.mjs index 363d93f146ef3..3afed778f805c 100644 --- a/components/add_to_calendar_pro/actions/create-event/create-event.mjs +++ b/components/add_to_calendar_pro/actions/create-event/create-event.mjs @@ -95,6 +95,7 @@ export default { addToCalendarPro, "landingPageTemplateId", ], + optional: true, }, }, async run({ $ }) { diff --git a/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs b/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs new file mode 100644 index 0000000000000..b122c6318bff8 --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs @@ -0,0 +1,117 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-create-landing-page-template", + name: "Create Landing Page Template", + description: "Create a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#add-a-landing-page-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + name: { + type: "string", + label: "Name", + description: "The name of the landing page template", + }, + title: { + type: "string", + label: "Title", + description: "The title of the landing page template", + optional: true, + }, + intro: { + type: "string", + label: "Intro", + description: "The intro of the landing page template", + optional: true, + }, + legal: { + type: "string", + label: "Legal", + description: "The legal footer text; allows for HTML", + optional: true, + }, + highlightColor: { + type: "string", + label: "Highlight Color", + description: "Hex code; used for buttons and decorative elements", + optional: true, + }, + backgroundColor1: { + type: "string", + label: "Background Color 1", + description: "Hex code; used for the background of the template", + optional: true, + }, + backgroundColor2: { + type: "string", + label: "Background Color 2", + description: "Hex code; used for the background of the template", + optional: true, + }, + background: { + type: "string", + label: "Background", + description: "Background of the template", + options: [ + "solid", + "gradient", + "image", + "preset", + ], + optional: true, + }, + gradientDirection: { + type: "string", + label: "Gradient Direction", + description: "The direction of the gradient. Only used if `background` is `gradient`.", + options: [ + "linear-t", + "linear-tr", + "linear-r", + "linear-br", + "radial", + ], + optional: true, + }, + imageRepeat: { + type: "boolean", + label: "Image Repeat", + description: "Whether to show the background image fullscreen or repeat it", + optional: true, + }, + metaTitleOverride: { + type: "string", + label: "Meta Title Override", + description: "Text that overrides the auto-generated meta title", + optional: true, + }, + metaDescriptionOverride: { + type: "string", + label: "Meta Description Override", + description: "Text that overrides the auto-generated meta description", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.createLandingPageTemplate({ + $, + data: { + name: this.name, + title: this.title, + intro: this.intro, + legal: this.legal, + highlight_color: this.highlightColor, + background_color_1: this.backgroundColor1, + background_color_2: this.backgroundColor2, + background: this.background, + gradient_direction: this.gradientDirection, + image_repeat: this.imageRepeat, + meta_title_override: this.metaTitleOverride, + meta_description_override: this.metaDescriptionOverride, + }, + }); + $.export("$summary", "Successfully created landing page template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/delete-landing-page-template/delete-landing-page-template.mjs b/components/add_to_calendar_pro/actions/delete-landing-page-template/delete-landing-page-template.mjs new file mode 100644 index 0000000000000..e5eb25e2b07e9 --- /dev/null +++ b/components/add_to_calendar_pro/actions/delete-landing-page-template/delete-landing-page-template.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-delete-landing-page-template", + name: "Delete Landing Page Template", + description: "Delete a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#delete-a-landing-page-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.deleteLandingPageTemplate({ + $, + landingPageTemplateId: this.landingPageTemplateId, + }); + $.export("$summary", "Successfully deleted landing page template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/get-landing-page-template/get-landing-page-template.mjs b/components/add_to_calendar_pro/actions/get-landing-page-template/get-landing-page-template.mjs new file mode 100644 index 0000000000000..25107eb5e026b --- /dev/null +++ b/components/add_to_calendar_pro/actions/get-landing-page-template/get-landing-page-template.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-get-landing-page-template", + name: "Get Landing Page Template", + description: "Get a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#get-one-landing-page-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.getLandingPageTemplate({ + $, + landingPageTemplateId: this.landingPageTemplateId, + }); + $.export("$summary", "Successfully retrieved landing page template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs index d34fb1fdfa632..57b0c32a5ad83 100644 --- a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs +++ b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs @@ -33,7 +33,6 @@ export default { type: "string", label: "Landing Page Template ID", description: "The ID of a landing page template", - optional: true, async options() { const templates = await this.listLandingPageTemplates(); return templates?.map((template) => ({ From 66b0e43b2df65cb11a798d77b5ca14d2c56d3dfd Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Thu, 26 Jun 2025 14:16:53 -0400 Subject: [PATCH 3/8] actions --- .../create-event-group/create-event-group.mjs | 67 +++++ .../actions/create-event/create-event.mjs | 94 +++---- .../create-landing-page-template.mjs | 104 ++++---- .../create-rsvp-template.mjs | 92 +++++++ .../delete-event-group/delete-event-group.mjs | 26 ++ .../delete-rsvp-template.mjs | 26 ++ .../actions/get-ics-data/get-ics-data.mjs | 26 ++ .../get-rsvp-template/get-rsvp-template.mjs | 26 ++ .../update-event-group/update-event-group.mjs | 78 ++++++ .../actions/update-event/update-event.mjs | 133 ++++++++++ .../update-landing-page-template.mjs | 113 ++++++++ .../update-rsvp-template.mjs | 100 +++++++ .../add_to_calendar_pro.app.mjs | 248 ++++++++++++++++++ .../add_to_calendar_pro/common/utils.mjs | 27 ++ 14 files changed, 1056 insertions(+), 104 deletions(-) create mode 100644 components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs create mode 100644 components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs create mode 100644 components/add_to_calendar_pro/actions/delete-event-group/delete-event-group.mjs create mode 100644 components/add_to_calendar_pro/actions/delete-rsvp-template/delete-rsvp-template.mjs create mode 100644 components/add_to_calendar_pro/actions/get-ics-data/get-ics-data.mjs create mode 100644 components/add_to_calendar_pro/actions/get-rsvp-template/get-rsvp-template.mjs create mode 100644 components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs create mode 100644 components/add_to_calendar_pro/actions/update-event/update-event.mjs create mode 100644 components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs create mode 100644 components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs create mode 100644 components/add_to_calendar_pro/common/utils.mjs diff --git a/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs b/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs new file mode 100644 index 0000000000000..6bdee3f9677bd --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs @@ -0,0 +1,67 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-create-event-group", + name: "Create Event Group", + description: "Create an event group. [See the documentation](https://docs.add-to-calendar-pro.com/api/groups#add-a-group)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + eventGroupName: { + propDefinition: [ + addToCalendarPro, + "eventGroupName", + ], + }, + internalNote: { + propDefinition: [ + addToCalendarPro, + "internalNote", + ], + }, + subscriptionCallUrl: { + propDefinition: [ + addToCalendarPro, + "subscriptionCallUrl", + ], + }, + cta: { + propDefinition: [ + addToCalendarPro, + "cta", + ], + }, + styleId: { + propDefinition: [ + addToCalendarPro, + "styleId", + ], + }, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.createGroup({ + $, + data: { + name: this.eventGroupName, + internal_note: this.internalNote, + subscription: this.subscriptionCallUrl + ? "external" + : "no", + subscription_call_url: this.subscriptionCallUrl, + cta: this.cta, + layout: this.styleId, + landingpage: this.landingPageTemplateId, + }, + }); + $.export("$summary", "Successfully created event group."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/create-event/create-event.mjs b/components/add_to_calendar_pro/actions/create-event/create-event.mjs index 3afed778f805c..4276e2202f9b9 100644 --- a/components/add_to_calendar_pro/actions/create-event/create-event.mjs +++ b/components/add_to_calendar_pro/actions/create-event/create-event.mjs @@ -15,74 +15,76 @@ export default { ], }, name: { - type: "string", - label: "Name", - description: "The name of the event", + propDefinition: [ + addToCalendarPro, + "eventName", + ], }, startDate: { - type: "string", - label: "Start Date", - description: "The start date of the event in format YYYY-MM-DD", + propDefinition: [ + addToCalendarPro, + "startDate", + ], }, startTime: { - type: "string", - label: "Start Time", - description: "The start time of the event in format HH:MM", - optional: true, + propDefinition: [ + addToCalendarPro, + "startTime", + ], }, endDate: { - type: "string", - label: "End Date", - description: "The end date of the event in format YYYY-MM-DD", - optional: true, + propDefinition: [ + addToCalendarPro, + "endDate", + ], }, endTime: { - type: "string", - label: "End Time", - description: "The end time of the event in format HH:MM", - optional: true, + propDefinition: [ + addToCalendarPro, + "endTime", + ], }, timeZone: { - type: "string", - label: "Time Zone", - description: "The timezone of the event. Example: `America/Los_Angeles`", - optional: true, + propDefinition: [ + addToCalendarPro, + "timeZone", + ], }, description: { - type: "string", - label: "Description", - description: "The description of the event", - optional: true, + propDefinition: [ + addToCalendarPro, + "description", + ], }, location: { - type: "string", - label: "Location", - description: "The location of the event", - optional: true, + propDefinition: [ + addToCalendarPro, + "location", + ], }, rsvp: { - type: "boolean", - label: "RSVP", - description: "Whether the event is an RSVP event", - optional: true, + propDefinition: [ + addToCalendarPro, + "rsvp", + ], }, distribution: { - type: "boolean", - label: "Event Distribution", - description: "Whether the event is distributed to all group members", - optional: true, + propDefinition: [ + addToCalendarPro, + "distribution", + ], }, hideButton: { - type: "boolean", - label: "Hide Button", - description: "Whether the Add to Calendar button is hidden", - optional: true, + propDefinition: [ + addToCalendarPro, + "hideButton", + ], }, cta: { - type: "boolean", - label: "Call to Action", - description: "Whether the event has a call to action", - optional: true, + propDefinition: [ + addToCalendarPro, + "cta", + ], }, styleId: { propDefinition: [ diff --git a/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs b/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs index b122c6318bff8..69d920253f322 100644 --- a/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs +++ b/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs @@ -9,88 +9,76 @@ export default { props: { addToCalendarPro, name: { - type: "string", - label: "Name", - description: "The name of the landing page template", + propDefinition: [ + addToCalendarPro, + "landingPageTemplateName", + ], }, title: { - type: "string", - label: "Title", - description: "The title of the landing page template", - optional: true, + propDefinition: [ + addToCalendarPro, + "title", + ], }, intro: { - type: "string", - label: "Intro", - description: "The intro of the landing page template", - optional: true, + propDefinition: [ + addToCalendarPro, + "intro", + ], }, legal: { - type: "string", - label: "Legal", - description: "The legal footer text; allows for HTML", - optional: true, + propDefinition: [ + addToCalendarPro, + "legal", + ], }, highlightColor: { - type: "string", - label: "Highlight Color", - description: "Hex code; used for buttons and decorative elements", - optional: true, + propDefinition: [ + addToCalendarPro, + "highlightColor", + ], }, backgroundColor1: { - type: "string", - label: "Background Color 1", - description: "Hex code; used for the background of the template", - optional: true, + propDefinition: [ + addToCalendarPro, + "backgroundColor1", + ], }, backgroundColor2: { - type: "string", - label: "Background Color 2", - description: "Hex code; used for the background of the template", - optional: true, + propDefinition: [ + addToCalendarPro, + "backgroundColor2", + ], }, background: { - type: "string", - label: "Background", - description: "Background of the template", - options: [ - "solid", - "gradient", - "image", - "preset", + propDefinition: [ + addToCalendarPro, + "background", ], - optional: true, }, gradientDirection: { - type: "string", - label: "Gradient Direction", - description: "The direction of the gradient. Only used if `background` is `gradient`.", - options: [ - "linear-t", - "linear-tr", - "linear-r", - "linear-br", - "radial", + propDefinition: [ + addToCalendarPro, + "gradientDirection", ], - optional: true, }, imageRepeat: { - type: "boolean", - label: "Image Repeat", - description: "Whether to show the background image fullscreen or repeat it", - optional: true, + propDefinition: [ + addToCalendarPro, + "imageRepeat", + ], }, metaTitleOverride: { - type: "string", - label: "Meta Title Override", - description: "Text that overrides the auto-generated meta title", - optional: true, + propDefinition: [ + addToCalendarPro, + "metaTitleOverride", + ], }, metaDescriptionOverride: { - type: "string", - label: "Meta Description Override", - description: "Text that overrides the auto-generated meta description", - optional: true, + propDefinition: [ + addToCalendarPro, + "metaDescriptionOverride", + ], }, }, async run({ $ }) { diff --git a/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs b/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs new file mode 100644 index 0000000000000..6799d50760879 --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs @@ -0,0 +1,92 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; +import { parseObject } from "../../common/utils.mjs"; + +export default { + key: "add_to_calendar_pro-create-rsvp-template", + name: "Create RSVP Template", + description: "Create an RSVP template. [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#add-an-rsvp-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + rsvpTemplateName: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateName", + ], + }, + max: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateMax", + ], + }, + maxPP: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateMaxPP", + ], + }, + expires: { + propDefinition: [ + addToCalendarPro, + "expires", + ], + }, + maybeOption: { + propDefinition: [ + addToCalendarPro, + "maybeOption", + ], + }, + initialConfirmation: { + propDefinition: [ + addToCalendarPro, + "initialConfirmation", + ], + }, + doi: { + propDefinition: [ + addToCalendarPro, + "doi", + ], + }, + headline: { + propDefinition: [ + addToCalendarPro, + "headline", + ], + }, + text: { + propDefinition: [ + addToCalendarPro, + "text", + ], + }, + fields: { + propDefinition: [ + addToCalendarPro, + "fields", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.createRsvpTemplate({ + $, + data: { + name: this.rsvpTemplateName, + max: this.max, + maxpp: this.maxPP, + expires: this.expires, + maybe_option: this.maybeOption, + initial_confirmation: this.initialConfirmation, + doi: this.doi, + headline: this.headline, + text: this.text, + fields: parseObject(this.fields), + }, + }); + $.export("$summary", "Successfully created RSVP template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/delete-event-group/delete-event-group.mjs b/components/add_to_calendar_pro/actions/delete-event-group/delete-event-group.mjs new file mode 100644 index 0000000000000..5debbab0748cb --- /dev/null +++ b/components/add_to_calendar_pro/actions/delete-event-group/delete-event-group.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-delete-event-group", + name: "Delete Event Group", + description: "Delete an event group. [See the documentation](https://docs.add-to-calendar-pro.com/api/groups#delete-a-group)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + groupProKey: { + propDefinition: [ + addToCalendarPro, + "groupProKey", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.deleteGroup({ + $, + groupProKey: this.groupProKey, + }); + $.export("$summary", "Successfully deleted event group."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/delete-rsvp-template/delete-rsvp-template.mjs b/components/add_to_calendar_pro/actions/delete-rsvp-template/delete-rsvp-template.mjs new file mode 100644 index 0000000000000..11b4a4d604ad4 --- /dev/null +++ b/components/add_to_calendar_pro/actions/delete-rsvp-template/delete-rsvp-template.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-delete-rsvp-template", + name: "Delete RSVP Template", + description: "Delete an RSVP template. [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#delete-an-rsvp-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + rsvpTemplateId: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateId", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.deleteRsvpTemplate({ + $, + rsvpTemplateId: this.rsvpTemplateId, + }); + $.export("$summary", "Successfully deleted RSVP template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/get-ics-data/get-ics-data.mjs b/components/add_to_calendar_pro/actions/get-ics-data/get-ics-data.mjs new file mode 100644 index 0000000000000..d63ece0764ed4 --- /dev/null +++ b/components/add_to_calendar_pro/actions/get-ics-data/get-ics-data.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-get-ics-data", + name: "Get ICS Data", + description: "Retrieve the ics file for a provided event to be typically used as an attachment within an email. [See the documentation](https://docs.add-to-calendar-pro.com/api/miscellaneous#retrieve-ics-file-body)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + eventProKey: { + propDefinition: [ + addToCalendarPro, + "eventProKey", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.getIcsData({ + $, + eventProKey: this.eventProKey, + }); + $.export("$summary", "Successfully retrieved ICS data."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/get-rsvp-template/get-rsvp-template.mjs b/components/add_to_calendar_pro/actions/get-rsvp-template/get-rsvp-template.mjs new file mode 100644 index 0000000000000..b9ae050b1b318 --- /dev/null +++ b/components/add_to_calendar_pro/actions/get-rsvp-template/get-rsvp-template.mjs @@ -0,0 +1,26 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-get-rsvp-template", + name: "Get RSVP Template", + description: "Get an RSVP template. [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#get-one-rsvp-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + rsvpTemplateId: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateId", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.getRsvpTemplate({ + $, + rsvpTemplateId: this.rsvpTemplateId, + }); + $.export("$summary", "Successfully retrieved RSVP template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs b/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs new file mode 100644 index 0000000000000..685cd2b959519 --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs @@ -0,0 +1,78 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-update-event-group", + name: "Update Event Group", + description: "Update an event group. [See the documentation](https://docs.add-to-calendar-pro.com/api/groups#update-a-group)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + groupProKey: { + propDefinition: [ + addToCalendarPro, + "groupProKey", + ], + }, + eventGroupName: { + propDefinition: [ + addToCalendarPro, + "eventGroupName", + ], + optional: true, + }, + internalNote: { + propDefinition: [ + addToCalendarPro, + "internalNote", + ], + }, + subscriptionCallUrl: { + propDefinition: [ + addToCalendarPro, + "subscriptionCallUrl", + ], + description: "URL to an external calendar. Needs to start with \"http\"! Usually ends with \".ics\". Note: You can only change the subscription setting as long as there are no events linked to the group", + }, + cta: { + propDefinition: [ + addToCalendarPro, + "cta", + ], + }, + styleId: { + propDefinition: [ + addToCalendarPro, + "styleId", + ], + }, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.updateGroup({ + $, + groupProKey: this.groupProKey, + data: { + data: { + name: this.eventGroupName, + internal_note: this.internalNote, + subscription: this.subscriptionCallUrl + ? "external" + : "no", + subscription_call_url: this.subscriptionCallUrl, + cta: this.cta, + layout: this.styleId, + landingpage: this.landingPageTemplateId, + }, + }, + }); + $.export("$summary", "Successfully updated event group."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/update-event/update-event.mjs b/components/add_to_calendar_pro/actions/update-event/update-event.mjs new file mode 100644 index 0000000000000..ce132872512b0 --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-event/update-event.mjs @@ -0,0 +1,133 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-update-event", + name: "Update Event", + description: "Update an event in a group. [See the documentation](https://docs.add-to-calendar-pro.com/api/events#update-an-event)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + eventProKey: { + propDefinition: [ + addToCalendarPro, + "eventProKey", + ], + }, + name: { + propDefinition: [ + addToCalendarPro, + "eventName", + ], + optional: true, + }, + startDate: { + propDefinition: [ + addToCalendarPro, + "startDate", + ], + optional: true, + }, + startTime: { + propDefinition: [ + addToCalendarPro, + "startTime", + ], + }, + endDate: { + propDefinition: [ + addToCalendarPro, + "endDate", + ], + }, + endTime: { + propDefinition: [ + addToCalendarPro, + "endTime", + ], + }, + timeZone: { + propDefinition: [ + addToCalendarPro, + "timeZone", + ], + }, + description: { + propDefinition: [ + addToCalendarPro, + "description", + ], + }, + location: { + propDefinition: [ + addToCalendarPro, + "location", + ], + }, + rsvp: { + propDefinition: [ + addToCalendarPro, + "rsvp", + ], + }, + distribution: { + propDefinition: [ + addToCalendarPro, + "distribution", + ], + }, + hideButton: { + propDefinition: [ + addToCalendarPro, + "hideButton", + ], + }, + cta: { + propDefinition: [ + addToCalendarPro, + "cta", + ], + }, + styleId: { + propDefinition: [ + addToCalendarPro, + "styleId", + ], + }, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.updateEvent({ + $, + eventProKey: this.eventProKey, + data: { + dates: [ + { + name: this.name, + startDate: this.startDate, + startTime: this.startTime, + endDate: this.endDate, + endTime: this.endTime, + timeZone: this.timeZone, + description: this.description, + location: this.location, + }, + ], + rsvp: this.rsvp, + distribution: this.distribution, + hideButton: this.hideButton, + cta: this.cta, + layout: this.styleId, + landingpage: this.landingPageTemplateId, + }, + }); + $.export("$summary", "Successfully updated event."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs b/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs new file mode 100644 index 0000000000000..20934d1bf72d5 --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs @@ -0,0 +1,113 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; + +export default { + key: "add_to_calendar_pro-update-landing-page-template", + name: "Update Landing Page Template", + description: "Update a landing page template. [See the documentation](https://docs.add-to-calendar-pro.com/api/landingpages#update-a-landing-page-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + }, + name: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateName", + ], + optional: true, + }, + title: { + propDefinition: [ + addToCalendarPro, + "title", + ], + }, + intro: { + propDefinition: [ + addToCalendarPro, + "intro", + ], + }, + legal: { + propDefinition: [ + addToCalendarPro, + "legal", + ], + }, + highlightColor: { + propDefinition: [ + addToCalendarPro, + "highlightColor", + ], + }, + backgroundColor1: { + propDefinition: [ + addToCalendarPro, + "backgroundColor1", + ], + }, + backgroundColor2: { + propDefinition: [ + addToCalendarPro, + "backgroundColor2", + ], + }, + background: { + propDefinition: [ + addToCalendarPro, + "background", + ], + }, + gradientDirection: { + propDefinition: [ + addToCalendarPro, + "gradientDirection", + ], + }, + imageRepeat: { + propDefinition: [ + addToCalendarPro, + "imageRepeat", + ], + }, + metaTitleOverride: { + propDefinition: [ + addToCalendarPro, + "metaTitleOverride", + ], + }, + metaDescriptionOverride: { + propDefinition: [ + addToCalendarPro, + "metaDescriptionOverride", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.updateLandingPageTemplate({ + $, + landingPageTemplateId: this.landingPageTemplateId, + data: { + name: this.name, + title: this.title, + intro: this.intro, + legal: this.legal, + highlight_color: this.highlightColor, + background_color_1: this.backgroundColor1, + background_color_2: this.backgroundColor2, + background: this.background, + gradient_direction: this.gradientDirection, + image_repeat: this.imageRepeat, + meta_title_override: this.metaTitleOverride, + meta_description_override: this.metaDescriptionOverride, + }, + }); + $.export("$summary", "Successfully updated landing page template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs b/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs new file mode 100644 index 0000000000000..7c75e52995c30 --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs @@ -0,0 +1,100 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; +import { parseObject } from "../../common/utils.mjs"; + +export default { + key: "add_to_calendar_pro-update-rsvp-template", + name: "Update RSVP Template", + description: "Update an RSVP template. [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#update-an-rsvp-template)", + version: "0.0.1", + type: "action", + props: { + addToCalendarPro, + rsvpTemplateId: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateId", + ], + }, + rsvpTemplateName: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateName", + ], + optional: true, + }, + max: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateMax", + ], + }, + maxPP: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateMaxPP", + ], + }, + expires: { + propDefinition: [ + addToCalendarPro, + "expires", + ], + }, + maybeOption: { + propDefinition: [ + addToCalendarPro, + "maybeOption", + ], + }, + initialConfirmation: { + propDefinition: [ + addToCalendarPro, + "initialConfirmation", + ], + }, + doi: { + propDefinition: [ + addToCalendarPro, + "doi", + ], + }, + headline: { + propDefinition: [ + addToCalendarPro, + "headline", + ], + }, + text: { + propDefinition: [ + addToCalendarPro, + "text", + ], + }, + fields: { + propDefinition: [ + addToCalendarPro, + "fields", + ], + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.updateRsvpTemplate({ + $, + rsvpTemplateId: this.rsvpTemplateId, + data: { + name: this.rsvpTemplateName, + max: this.max, + maxpp: this.maxPP, + expires: this.expires, + maybe_option: this.maybeOption, + initial_confirmation: this.initialConfirmation, + doi: this.doi, + headline: this.headline, + text: this.text, + fields: parseObject(this.fields), + }, + }); + $.export("$summary", "Successfully updated RSVP template."); + return response; + }, +}; diff --git a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs index 57b0c32a5ad83..82008d9ce875f 100644 --- a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs +++ b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs @@ -41,6 +41,18 @@ export default { })) || []; }, }, + rsvpTemplateId: { + type: "string", + label: "RSVP Template ID", + description: "The ID of an RSVP template", + async options() { + const templates = await this.listRsvpTemplates(); + return templates?.map((template) => ({ + label: template.name, + value: template.id, + })) || []; + }, + }, eventProKey: { type: "string", label: "Event Pro Key", @@ -53,6 +65,236 @@ export default { })) || []; }, }, + eventName: { + type: "string", + label: "Name", + description: "The name of the event", + }, + startDate: { + type: "string", + label: "Start Date", + description: "The start date of the event in format YYYY-MM-DD", + }, + startTime: { + type: "string", + label: "Start Time", + description: "The start time of the event in format HH:MM", + optional: true, + }, + endDate: { + type: "string", + label: "End Date", + description: "The end date of the event in format YYYY-MM-DD", + optional: true, + }, + endTime: { + type: "string", + label: "End Time", + description: "The end time of the event in format HH:MM", + optional: true, + }, + timeZone: { + type: "string", + label: "Time Zone", + description: "The timezone of the event. Example: `America/Los_Angeles`", + optional: true, + }, + description: { + type: "string", + label: "Description", + description: "The description of the event", + optional: true, + }, + location: { + type: "string", + label: "Location", + description: "The location of the event", + optional: true, + }, + rsvp: { + type: "boolean", + label: "RSVP", + description: "Whether the event is an RSVP event", + optional: true, + }, + distribution: { + type: "boolean", + label: "Event Distribution", + description: "Whether the event is distributed to all group members", + optional: true, + }, + hideButton: { + type: "boolean", + label: "Hide Button", + description: "Whether the Add to Calendar button is hidden", + optional: true, + }, + cta: { + type: "boolean", + label: "Call to Action", + description: "Whether the event has a call to action", + optional: true, + }, + landingPageTemplateName: { + type: "string", + label: "Name", + description: "The name of the landing page template", + }, + title: { + type: "string", + label: "Title", + description: "The title of the landing page template", + optional: true, + }, + intro: { + type: "string", + label: "Intro", + description: "The intro of the landing page template", + optional: true, + }, + legal: { + type: "string", + label: "Legal", + description: "The legal footer text; allows for HTML", + optional: true, + }, + highlightColor: { + type: "string", + label: "Highlight Color", + description: "Hex code; used for buttons and decorative elements", + optional: true, + }, + backgroundColor1: { + type: "string", + label: "Background Color 1", + description: "Hex code; used for the background of the template", + optional: true, + }, + backgroundColor2: { + type: "string", + label: "Background Color 2", + description: "Hex code; used for the background of the template", + optional: true, + }, + background: { + type: "string", + label: "Background", + description: "Background of the template", + options: [ + "solid", + "gradient", + "image", + "preset", + ], + optional: true, + }, + gradientDirection: { + type: "string", + label: "Gradient Direction", + description: "The direction of the gradient. Only used if `background` is `gradient`.", + options: [ + "linear-t", + "linear-tr", + "linear-r", + "linear-br", + "radial", + ], + optional: true, + }, + imageRepeat: { + type: "boolean", + label: "Image Repeat", + description: "Whether to show the background image fullscreen or repeat it", + optional: true, + }, + metaTitleOverride: { + type: "string", + label: "Meta Title Override", + description: "Text that overrides the auto-generated meta title", + optional: true, + }, + metaDescriptionOverride: { + type: "string", + label: "Meta Description Override", + description: "Text that overrides the auto-generated meta description", + optional: true, + }, + eventGroupName: { + type: "string", + label: "Event Group Name", + description: "The name of the event group", + }, + internalNote: { + type: "string", + label: "Internal Note", + description: "Internal note for the event group", + optional: true, + }, + subscriptionCallUrl: { + type: "string", + label: "Subscription Call URL", + description: "URL to an external calendar. Needs to start with \"http\"! Usually ends with \".ics\"", + optional: true, + }, + rsvpTemplateName: { + type: "string", + label: "RSVP Template Name", + description: "The name of the RSVP template", + }, + rsvpTemplateMax: { + type: "integer", + label: "Max", + description: "Max amount of seats; defaults to unlimited", + optional: true, + }, + rsvpTemplateMaxPP: { + type: "integer", + label: "Max Per Person", + description: "Max seats per sign-up; defaults to 1", + optional: true, + }, + expires: { + type: "string", + label: "Expires", + description: "an optional expiration date as ISO 8601 UTC datetime", + optional: true, + }, + maybeOption: { + type: "boolean", + label: "Maybe Option", + description: "Whether to allow users to select a maybe option", + optional: true, + }, + initialConfirmation: { + type: "boolean", + label: "Initial Confirmation", + description: "If `true`, the initial sign-up will always be \"confirmed\"", + optional: true, + }, + doi: { + type: "boolean", + label: "DOI", + description: "If `true`, each user will need to confirm his email", + optional: true, + }, + headline: { + type: "string", + label: "Headline", + description: "The headline of the RSVP template", + optional: true, + }, + text: { + type: "string", + label: "Text", + description: "The text of the RSVP template", + optional: true, + }, + fields: { + type: "string[]", + label: "Fields", + description: "The fields of the RSVP template. Example: `[{ \"type\": \"text\", \"name\": \"additional_info\", \"label\": \"Additional note\", \"required\": false, \"placeholder\": \"Type here...\", \"default\": \"Call me maybe\" }] [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#add-an-rsvp-template) for more information.`", + optional: true, + }, }, methods: { _baseUrl() { @@ -135,6 +377,12 @@ export default { ...opts, }); }, + listRsvpTemplates(opts = {}) { + return this._makeRequest({ + path: "/rsvp-block/all", + ...opts, + }); + }, listEvents(opts = {}) { return this._makeRequest({ path: "/event/all", diff --git a/components/add_to_calendar_pro/common/utils.mjs b/components/add_to_calendar_pro/common/utils.mjs new file mode 100644 index 0000000000000..4dab12cb93153 --- /dev/null +++ b/components/add_to_calendar_pro/common/utils.mjs @@ -0,0 +1,27 @@ +export const parseObject = (obj) => { + if (!obj) { + return undefined; + } + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch (e) { + return obj; + } + } + if (Array.isArray(obj)) { + return obj.map(parseObject); + } + if (typeof obj === "object") { + return Object.fromEntries( + Object.entries(obj).map(([ + key, + value, + ]) => [ + key, + parseObject(value), + ]), + ); + } + return obj; +}; From 650e4bef29404fc98768de988cc576b8bb52dcbb Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Thu, 26 Jun 2025 15:32:14 -0400 Subject: [PATCH 4/8] sources --- .../add_to_calendar_pro.app.mjs | 16 +++++ .../sources/common/base.mjs | 62 +++++++++++++++++++ .../event-deleted-instant.mjs | 29 +++++++++ .../event-deleted-instant/test-event.mjs | 47 ++++++++++++++ .../event-group-deleted-instant.mjs | 29 +++++++++ .../test-event.mjs | 17 +++++ .../event-group-updated-instant.mjs | 30 +++++++++ .../test-event.mjs | 19 ++++++ .../event-updated-instant.mjs | 30 +++++++++ .../event-updated-instant/test-event.mjs | 47 ++++++++++++++ .../new-event-created-instant.mjs | 29 +++++++++ .../new-event-created-instant/test-event.mjs | 47 ++++++++++++++ .../new-event-group-created-instant.mjs | 29 +++++++++ .../test-event.mjs | 17 +++++ .../new-rsvp-answer-instant.mjs | 29 +++++++++ .../new-rsvp-answer-instant/test-event.mjs | 11 ++++ .../rsvp-answer-updated-instant.mjs | 30 +++++++++ .../test-event.mjs | 11 ++++ 18 files changed, 529 insertions(+) create mode 100644 components/add_to_calendar_pro/sources/common/base.mjs create mode 100644 components/add_to_calendar_pro/sources/event-deleted-instant/event-deleted-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/event-deleted-instant/test-event.mjs create mode 100644 components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/event-group-deleted-instant/test-event.mjs create mode 100644 components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/event-group-updated-instant/test-event.mjs create mode 100644 components/add_to_calendar_pro/sources/event-updated-instant/event-updated-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/event-updated-instant/test-event.mjs create mode 100644 components/add_to_calendar_pro/sources/new-event-created-instant/new-event-created-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/new-event-created-instant/test-event.mjs create mode 100644 components/add_to_calendar_pro/sources/new-event-group-created-instant/new-event-group-created-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/new-event-group-created-instant/test-event.mjs create mode 100644 components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/new-rsvp-answer-instant/test-event.mjs create mode 100644 components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/rsvp-answer-updated-instant.mjs create mode 100644 components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs diff --git a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs index 82008d9ce875f..d2da7a295803f 100644 --- a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs +++ b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs @@ -319,6 +319,22 @@ export default { } } }, + createWebhook(opts = {}) { + return this._makeRequest({ + path: "/webhook", + method: "POST", + ...opts, + }); + }, + deleteWebhook({ + hookId, ...opts + }) { + return this._makeRequest({ + path: `/webhook/${hookId}`, + method: "DELETE", + ...opts, + }); + }, getGroup({ groupProKey, ...opts }) { diff --git a/components/add_to_calendar_pro/sources/common/base.mjs b/components/add_to_calendar_pro/sources/common/base.mjs new file mode 100644 index 0000000000000..4c39c5e5efd31 --- /dev/null +++ b/components/add_to_calendar_pro/sources/common/base.mjs @@ -0,0 +1,62 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +export default { + props: { + addToCalendarPro, + db: "$.service.db", + http: "$.interface.http", + name: { + type: "string", + label: "Name", + description: "The name of the webhook", + }, + }, + hooks: { + async activate() { + const { id } = await this.addToCalendarPro.createWebhook({ + data: { + name: this.name, + active: true, + payload_url: this.http.endpoint, + trigger: this.getTrigger(), + trigger_element: this.getTriggerElement(), + }, + }); + this._setHookId(id); + }, + async deactivate() { + const hookId = this._getHookId(); + if (hookId) { + await this.addToCalendarPro.deleteWebhook({ + hookId, + }); + } + }, + }, + methods: { + _getHookId() { + return this.db.get("hookId"); + }, + _setHookId(hookId) { + this.db.set("hookId", hookId); + }, + getTrigger() { + throw new ConfigurationError("getTrigger must be implemented"); + }, + getTriggerElement() { + throw new ConfigurationError("getTriggerElement must be implemented"); + }, + generateMeta() { + throw new ConfigurationError("generateMeta must be implemented"); + }, + }, + async run(event) { + const { body } = event; + if (!body) { + return; + } + const meta = this.generateMeta(body); + this.$emit(body, meta); + }, +}; diff --git a/components/add_to_calendar_pro/sources/event-deleted-instant/event-deleted-instant.mjs b/components/add_to_calendar_pro/sources/event-deleted-instant/event-deleted-instant.mjs new file mode 100644 index 0000000000000..aca2b94f6f595 --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-deleted-instant/event-deleted-instant.mjs @@ -0,0 +1,29 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-event-deleted-instant", + name: "Event Deleted (Instant)", + description: "Emit new event when a new event is deleted in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "delete"; + }, + getTriggerElement() { + return "event"; + }, + generateMeta({ element_data: item }) { + return { + id: item.prokey, + summary: `Event Deleted with ProKey: ${item.prokey}`, + ts: Date.now(), + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/event-deleted-instant/test-event.mjs b/components/add_to_calendar_pro/sources/event-deleted-instant/test-event.mjs new file mode 100644 index 0000000000000..e402f0db25788 --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-deleted-instant/test-event.mjs @@ -0,0 +1,47 @@ +export default { + "element_data": { + "date_created": "2025-06-26T18:37:41.282Z", + "date_updated": "2025-06-26T18:37:41.425Z", + "iCalFileName": null, + "recurrence": null, + "recurrence_interval": 1, + "recurrence_count": null, + "recurrence_byDay": null, + "recurrence_byMonthDay": null, + "recurrence_byMonth": null, + "recurrence_weekstart": null, + "recurrence_simple_type": null, + "dates": [ + { + "name": "new event", + "description": null, + "startDate": "2025-06-27", + "endDate": null, + "startTime": null, + "endTime": null, + "timeZone": null, + "location": null, + "status": null, + "availability": null, + "organizer_name": null, + "organizer_email": null, + "attendee_name": null, + "attendee_email": null + } + ], + "title_event_series": null, + "rsvp_block": null, + "cta_block": null, + "rsvp": false, + "cta": false, + "layout": null, + "status": "published", + "hideButton": false, + "simplified_recurrence": false, + "sequence": "0", + "distribution": true, + "landingpage": null, + "prokey": "76026233-8475-4f88-882a-b234bc7d654e", + "event_group": "c020e405-e322-4c5c-8126-d3cf0411bac2" + } +} \ No newline at end of file diff --git a/components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs b/components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs new file mode 100644 index 0000000000000..6479dfe3982a6 --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs @@ -0,0 +1,29 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-event-group-deleted-instant", + name: "Event Group Deleted (Instant)", + description: "Emit new event when a new event is deleted in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "delete"; + }, + getTriggerElement() { + return "event_group"; + }, + generateMeta({ element_data: item }) { + return { + id: item.prokey, + summary: `Event Group Deleted with ProKey: ${item.prokey}`, + ts: Date.now(), + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/event-group-deleted-instant/test-event.mjs b/components/add_to_calendar_pro/sources/event-group-deleted-instant/test-event.mjs new file mode 100644 index 0000000000000..06d2c1902142f --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-group-deleted-instant/test-event.mjs @@ -0,0 +1,17 @@ +export default { + "element_data": { + "date_created": "2025-06-26T19:19:37.544Z", + "date_updated": "2025-06-26T19:19:37.629Z", + "name": "event group", + "subscription": "no", + "internal_note": null, + "subscription_cal_url": null, + "status": "published", + "cta": false, + "cta_block": null, + "layout": null, + "prokey": "0563721e-2885-4c69-a6a8-49123aab7294", + "landingpage": null, + "events": [] + } +} \ No newline at end of file diff --git a/components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs b/components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs new file mode 100644 index 0000000000000..984232b0bc25b --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs @@ -0,0 +1,30 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-event-group-updated-instant", + name: "Event Group Updated (Instant)", + description: "Emit new event when a new event is updated in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "update"; + }, + getTriggerElement() { + return "event_group"; + }, + generateMeta({ element_data: item }) { + const ts = Date.parse(item.date_updated); + return { + id: `${item.prokey}${ts}`, + summary: `Event Group Updated with ProKey: ${item.prokey}`, + ts, + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/event-group-updated-instant/test-event.mjs b/components/add_to_calendar_pro/sources/event-group-updated-instant/test-event.mjs new file mode 100644 index 0000000000000..3f29c9517716d --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-group-updated-instant/test-event.mjs @@ -0,0 +1,19 @@ +export default { + "element_data": { + "date_created": "2025-06-26T18:37:16.627Z", + "date_updated": "2025-06-26T19:10:00.280Z", + "name": "My Group", + "subscription": "no", + "internal_note": null, + "subscription_cal_url": null, + "status": "published", + "cta": false, + "cta_block": null, + "layout": null, + "prokey": "c020e405-e322-4c5c-8126-d3cf0411bac2", + "landingpage": null, + "events": [ + "c6510c06-a277-4e1c-9baf-deec9c5507c7" + ] + } +} \ No newline at end of file diff --git a/components/add_to_calendar_pro/sources/event-updated-instant/event-updated-instant.mjs b/components/add_to_calendar_pro/sources/event-updated-instant/event-updated-instant.mjs new file mode 100644 index 0000000000000..81ff3eb727454 --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-updated-instant/event-updated-instant.mjs @@ -0,0 +1,30 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-event-updated-instant", + name: "Event Updated (Instant)", + description: "Emit new event when a new event is updated in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "update"; + }, + getTriggerElement() { + return "event"; + }, + generateMeta({ element_data: item }) { + const ts = Date.parse(item.date_updated); + return { + id: `${item.prokey}${ts}`, + summary: `Event Updated with ProKey: ${item.prokey}`, + ts, + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/event-updated-instant/test-event.mjs b/components/add_to_calendar_pro/sources/event-updated-instant/test-event.mjs new file mode 100644 index 0000000000000..cb76382271980 --- /dev/null +++ b/components/add_to_calendar_pro/sources/event-updated-instant/test-event.mjs @@ -0,0 +1,47 @@ +export default { + "element_data": { + "date_created": "2025-06-26T18:59:06.830Z", + "date_updated": "2025-06-26T19:25:34.677Z", + "iCalFileName": null, + "recurrence": null, + "recurrence_interval": null, + "recurrence_count": null, + "recurrence_byDay": null, + "recurrence_byMonthDay": null, + "recurrence_byMonth": null, + "recurrence_weekstart": null, + "recurrence_simple_type": null, + "dates": [ + { + "name": "my event updated", + "description": null, + "startDate": "2025-07-03", + "endDate": null, + "startTime": null, + "endTime": null, + "timeZone": "Etc/GMT", + "location": null, + "status": null, + "availability": null, + "organizer_name": "", + "organizer_email": "", + "attendee_name": null, + "attendee_email": null + } + ], + "title_event_series": null, + "rsvp_block": 227, + "cta_block": null, + "rsvp": true, + "cta": false, + "layout": null, + "status": "published", + "hideButton": false, + "simplified_recurrence": true, + "sequence": "0", + "distribution": true, + "landingpage": null, + "prokey": "c6510c06-a277-4e1c-9baf-deec9c5507c7", + "event_group": "c020e405-e322-4c5c-8126-d3cf0411bac2" + } +} \ No newline at end of file diff --git a/components/add_to_calendar_pro/sources/new-event-created-instant/new-event-created-instant.mjs b/components/add_to_calendar_pro/sources/new-event-created-instant/new-event-created-instant.mjs new file mode 100644 index 0000000000000..f705d2465252c --- /dev/null +++ b/components/add_to_calendar_pro/sources/new-event-created-instant/new-event-created-instant.mjs @@ -0,0 +1,29 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-new-event-created-instant", + name: "New Event Created (Instant)", + description: "Emit new event when a new event is created in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "create"; + }, + getTriggerElement() { + return "event"; + }, + generateMeta({ element_data: item }) { + return { + id: item.prokey, + summary: `New Event Created with ProKey: ${item.prokey}`, + ts: Date.parse(item.date_created), + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/new-event-created-instant/test-event.mjs b/components/add_to_calendar_pro/sources/new-event-created-instant/test-event.mjs new file mode 100644 index 0000000000000..9d737a42e9033 --- /dev/null +++ b/components/add_to_calendar_pro/sources/new-event-created-instant/test-event.mjs @@ -0,0 +1,47 @@ +export default { + "element_data": { + "date_created": "2025-06-26T18:43:09.885Z", + "date_updated": null, + "iCalFileName": null, + "recurrence": null, + "recurrence_interval": 1, + "recurrence_count": null, + "recurrence_byDay": null, + "recurrence_byMonthDay": null, + "recurrence_byMonth": null, + "recurrence_weekstart": null, + "recurrence_simple_type": null, + "dates": [ + { + "name": "new event 2", + "description": null, + "startDate": "2025-06-27", + "endDate": null, + "startTime": null, + "endTime": null, + "timeZone": null, + "location": null, + "status": null, + "availability": null, + "organizer_name": null, + "organizer_email": null, + "attendee_name": null, + "attendee_email": null + } + ], + "title_event_series": null, + "rsvp_block": null, + "cta_block": null, + "rsvp": false, + "cta": false, + "layout": null, + "status": "published", + "hideButton": false, + "simplified_recurrence": false, + "sequence": "0", + "distribution": true, + "landingpage": null, + "prokey": "b1458c4e-13d7-492e-826d-dacb69822743", + "event_group": "c020e405-e322-4c5c-8126-d3cf0411bac2" + } +} \ No newline at end of file diff --git a/components/add_to_calendar_pro/sources/new-event-group-created-instant/new-event-group-created-instant.mjs b/components/add_to_calendar_pro/sources/new-event-group-created-instant/new-event-group-created-instant.mjs new file mode 100644 index 0000000000000..4e47968062e35 --- /dev/null +++ b/components/add_to_calendar_pro/sources/new-event-group-created-instant/new-event-group-created-instant.mjs @@ -0,0 +1,29 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-new-event-group-created-instant", + name: "New Event Group Created (Instant)", + description: "Emit new event when a new event group is created in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "create"; + }, + getTriggerElement() { + return "event_group"; + }, + generateMeta({ element_data: item }) { + return { + id: item.prokey, + summary: `New Event Group Created with ProKey: ${item.prokey}`, + ts: Date.parse(item.date_created), + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/new-event-group-created-instant/test-event.mjs b/components/add_to_calendar_pro/sources/new-event-group-created-instant/test-event.mjs new file mode 100644 index 0000000000000..40b9eb2de3ed8 --- /dev/null +++ b/components/add_to_calendar_pro/sources/new-event-group-created-instant/test-event.mjs @@ -0,0 +1,17 @@ +export default { + "element_data": { + "date_created": "2025-06-26T19:19:37.544Z", + "date_updated": null, + "name": "event group", + "subscription": "no", + "internal_note": null, + "subscription_cal_url": null, + "status": "published", + "cta": false, + "cta_block": null, + "layout": null, + "prokey": "0563721e-2885-4c69-a6a8-49123aab7294", + "landingpage": null, + "events": [] + } +} \ No newline at end of file diff --git a/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs b/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs new file mode 100644 index 0000000000000..ddb6fc2bc2d77 --- /dev/null +++ b/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs @@ -0,0 +1,29 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-new-rsvp-answer-instant", + name: "New RSVP Answer (Instant)", + description: "Emit new RSVP answer when a new RSVP answer is created in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "create"; + }, + getTriggerElement() { + return "rsvp_answer"; + }, + generateMeta({ element_data: item }) { + return { + id: item.prokey, + summary: `New RSVP Answer with ProKey: ${item.prokey}`, + ts: Date.parse(item.date_created), + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/test-event.mjs b/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/test-event.mjs new file mode 100644 index 0000000000000..de3356c3e45c5 --- /dev/null +++ b/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/test-event.mjs @@ -0,0 +1,11 @@ +export default { + "element_data": { + "status": "confirmed", + "date_created": "2025-06-26T19:04:30.237Z", + "date_updated": "2025-06-26T19:05:00.137Z", + "email": "", + "prokey": "c6510c06-a277-4e1c-9baf-deec9c5507c7", + "amount": 1, + "payload": {} + } +} \ No newline at end of file diff --git a/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/rsvp-answer-updated-instant.mjs b/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/rsvp-answer-updated-instant.mjs new file mode 100644 index 0000000000000..783fa633cfd38 --- /dev/null +++ b/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/rsvp-answer-updated-instant.mjs @@ -0,0 +1,30 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "add_to_calendar_pro-rsvp-answer-updated-instant", + name: "RSVP Answer Updated (Instant)", + description: "Emit new RSVP answer when a new RSVP answer is updated in the system", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getTrigger() { + return "update"; + }, + getTriggerElement() { + return "rsvp_answer"; + }, + generateMeta({ element_data: item }) { + const ts = Date.parse(item.date_updated); + return { + id: `${item.prokey}${ts}`, + summary: `RSVP Answer Updated with ProKey: ${item.prokey}`, + ts, + }; + }, + }, + sampleEmit, +}; diff --git a/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs b/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs new file mode 100644 index 0000000000000..da748dabd571b --- /dev/null +++ b/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs @@ -0,0 +1,11 @@ +export default { + "element_data": { + "status": "confirmed", + "date_created": "2025-06-26T19:04:30.237Z", + "date_updated": "2025-06-26T19:30:09.868Z", + "email": "michellelbergero@hotmail.com", + "prokey": "c6510c06-a277-4e1c-9baf-deec9c5507c7", + "amount": 2, + "payload": {} + } +} \ No newline at end of file From 0bd646145179d4ea1e1639d8d17d8c2240c16f0e Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Thu, 26 Jun 2025 15:33:00 -0400 Subject: [PATCH 5/8] pnpm-lock.yaml --- pnpm-lock.yaml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94a7424ab043b..9ff02131d25ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -313,7 +313,11 @@ importers: specifier: ^3.0.1 version: 3.0.3 - components/add_to_calendar_pro: {} + components/add_to_calendar_pro: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/addevent: dependencies: @@ -2355,8 +2359,7 @@ importers: components/chatsonic: {} - components/chattermill: - specifiers: {} + components/chattermill: {} components/chatwork: dependencies: @@ -5399,8 +5402,7 @@ importers: components/godial: {} - components/goformz: - specifiers: {} + components/goformz: {} components/gohighlevel: dependencies: @@ -7291,8 +7293,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/lark: - specifiers: {} + components/lark: {} components/lastpass: dependencies: @@ -8497,8 +8498,7 @@ importers: components/mollie: {} - components/momentum_ams: - specifiers: {} + components/momentum_ams: {} components/monday: dependencies: @@ -9481,8 +9481,7 @@ importers: components/order_sender: {} - components/orderspace: - specifiers: {} + components/orderspace: {} components/originality_ai: dependencies: @@ -11559,8 +11558,7 @@ importers: components/ryver: {} - components/sage_accounting: - specifiers: {} + components/sage_accounting: {} components/sage_intacct: {} @@ -12977,8 +12975,7 @@ importers: components/stealthseminar: {} - components/stiply: - specifiers: {} + components/stiply: {} components/storeganise: dependencies: From 3ab6ba11d046c22b8487f623b8ed3a94b0f771ba Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Thu, 26 Jun 2025 15:52:47 -0400 Subject: [PATCH 6/8] updates --- .../update-event-group/update-event-group.mjs | 20 +++++++++---------- .../add_to_calendar_pro.app.mjs | 3 ++- .../event-group-deleted-instant.mjs | 2 +- .../event-group-updated-instant.mjs | 2 +- .../test-event.mjs | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs b/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs index 685cd2b959519..7ef95cdfaef0a 100644 --- a/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs +++ b/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs @@ -59,17 +59,15 @@ export default { $, groupProKey: this.groupProKey, data: { - data: { - name: this.eventGroupName, - internal_note: this.internalNote, - subscription: this.subscriptionCallUrl - ? "external" - : "no", - subscription_call_url: this.subscriptionCallUrl, - cta: this.cta, - layout: this.styleId, - landingpage: this.landingPageTemplateId, - }, + name: this.eventGroupName, + internal_note: this.internalNote, + subscription: this.subscriptionCallUrl + ? "external" + : "no", + subscription_call_url: this.subscriptionCallUrl, + cta: this.cta, + layout: this.styleId, + landingpage: this.landingPageTemplateId, }, }); $.export("$summary", "Successfully updated event group."); diff --git a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs index d2da7a295803f..6b1645254ce89 100644 --- a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs +++ b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs @@ -292,7 +292,7 @@ export default { fields: { type: "string[]", label: "Fields", - description: "The fields of the RSVP template. Example: `[{ \"type\": \"text\", \"name\": \"additional_info\", \"label\": \"Additional note\", \"required\": false, \"placeholder\": \"Type here...\", \"default\": \"Call me maybe\" }] [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#add-an-rsvp-template) for more information.`", + description: "The fields of the RSVP template. Example: `[{ \"type\": \"text\", \"name\": \"additional_info\", \"label\": \"Additional note\", \"required\": false, \"placeholder\": \"Type here...\", \"default\": \"Call me maybe\" }]` [See the documentation](https://docs.add-to-calendar-pro.com/api/rsvp#add-an-rsvp-template) for more information.", optional: true, }, }, @@ -314,6 +314,7 @@ export default { } catch (error) { if (error.status === 404 && JSON.parse(error.message)?.message?.includes("No entry found")) { console.log("No entry found"); + return null; } else { throw error; } diff --git a/components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs b/components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs index 6479dfe3982a6..ced19907cd470 100644 --- a/components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs +++ b/components/add_to_calendar_pro/sources/event-group-deleted-instant/event-group-deleted-instant.mjs @@ -5,7 +5,7 @@ export default { ...common, key: "add_to_calendar_pro-event-group-deleted-instant", name: "Event Group Deleted (Instant)", - description: "Emit new event when a new event is deleted in the system", + description: "Emit new event when a new event group is deleted in the system", version: "0.0.1", type: "source", dedupe: "unique", diff --git a/components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs b/components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs index 984232b0bc25b..a430099cf3788 100644 --- a/components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs +++ b/components/add_to_calendar_pro/sources/event-group-updated-instant/event-group-updated-instant.mjs @@ -5,7 +5,7 @@ export default { ...common, key: "add_to_calendar_pro-event-group-updated-instant", name: "Event Group Updated (Instant)", - description: "Emit new event when a new event is updated in the system", + description: "Emit new event when a new event group is updated in the system", version: "0.0.1", type: "source", dedupe: "unique", diff --git a/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs b/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs index da748dabd571b..325597099c181 100644 --- a/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs +++ b/components/add_to_calendar_pro/sources/rsvp-answer-updated-instant/test-event.mjs @@ -3,7 +3,7 @@ export default { "status": "confirmed", "date_created": "2025-06-26T19:04:30.237Z", "date_updated": "2025-06-26T19:30:09.868Z", - "email": "michellelbergero@hotmail.com", + "email": "", "prokey": "c6510c06-a277-4e1c-9baf-deec9c5507c7", "amount": 2, "payload": {} From ef8a66bd8c89bd67b922794b1dc41ebabb091e38 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 30 Jun 2025 14:53:37 -0400 Subject: [PATCH 7/8] updates --- .../create-event-group/create-event-group.mjs | 16 +- .../actions/create-event/create-event.mjs | 219 +++++++++++++++--- .../create-landing-page-template.mjs | 15 ++ .../create-rsvp-template.mjs | 77 ++++++ .../actions/update-event/update-event.mjs | 206 +++++++++++++--- .../update-landing-page-template.mjs | 15 ++ .../update-rsvp-template.mjs | 77 ++++++ .../add_to_calendar_pro.app.mjs | 143 +++++++++--- .../new-rsvp-answer-instant.mjs | 2 +- 9 files changed, 681 insertions(+), 89 deletions(-) diff --git a/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs b/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs index 6bdee3f9677bd..3458765f7df8d 100644 --- a/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs +++ b/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs @@ -20,10 +20,10 @@ export default { "internalNote", ], }, - subscriptionCallUrl: { + subscriptionCalUrl: { propDefinition: [ addToCalendarPro, - "subscriptionCallUrl", + "subscriptionCalUrl", ], }, cta: { @@ -45,6 +45,13 @@ export default { ], optional: true, }, + ctaTemplateId: { + propDefinition: [ + addToCalendarPro, + "ctaTemplateId", + ], + optional: true, + }, }, async run({ $ }) { const response = await this.addToCalendarPro.createGroup({ @@ -52,13 +59,14 @@ export default { data: { name: this.eventGroupName, internal_note: this.internalNote, - subscription: this.subscriptionCallUrl + subscription: this.subscriptionCalUrl ? "external" : "no", - subscription_call_url: this.subscriptionCallUrl, + subscription_cal_url: this.subscriptionCalUrl, cta: this.cta, layout: this.styleId, landingpage: this.landingPageTemplateId, + cta_block: this.ctaTemplateId, }, }); $.export("$summary", "Successfully created event group."); diff --git a/components/add_to_calendar_pro/actions/create-event/create-event.mjs b/components/add_to_calendar_pro/actions/create-event/create-event.mjs index 4276e2202f9b9..77605d1d81afa 100644 --- a/components/add_to_calendar_pro/actions/create-event/create-event.mjs +++ b/components/add_to_calendar_pro/actions/create-event/create-event.mjs @@ -1,4 +1,5 @@ import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; export default { key: "add_to_calendar_pro-create-event", @@ -13,53 +14,79 @@ export default { addToCalendarPro, "groupProKey", ], + description: "The pro key of the group to add the event to. Either this or newEventGroupName is required.", + optional: true, + }, + newEventGroupName: { + type: "string", + label: "New Event Group Name", + description: "Create a new group for the event with the name provided. Either this or groupProKey is required.", + optional: true, + }, + titleEventSeries: { + propDefinition: [ + addToCalendarPro, + "titleEventSeries", + ], + }, + simplifiedRecurrence: { + propDefinition: [ + addToCalendarPro, + "simplifiedRecurrence", + ], + }, + recurrence: { + propDefinition: [ + addToCalendarPro, + "recurrence", + ], }, - name: { + recurrenceSimpleType: { propDefinition: [ addToCalendarPro, - "eventName", + "recurrenceSimpleType", ], }, - startDate: { + recurrenceInterval: { propDefinition: [ addToCalendarPro, - "startDate", + "recurrenceInterval", ], }, - startTime: { + recurrenceByDay: { propDefinition: [ addToCalendarPro, - "startTime", + "recurrenceByDay", ], }, - endDate: { + recurrenceByMonth: { propDefinition: [ addToCalendarPro, - "endDate", + "recurrenceByMonth", ], }, - endTime: { + recurrenceByMonthDay: { propDefinition: [ addToCalendarPro, - "endTime", + "recurrenceByMonthDay", ], }, - timeZone: { + recurrenceCount: { propDefinition: [ addToCalendarPro, - "timeZone", + "recurrenceCount", ], }, - description: { + recurrenceWeekStart: { propDefinition: [ addToCalendarPro, - "description", + "recurrenceWeekStart", ], }, - location: { + iCalFileName: { propDefinition: [ addToCalendarPro, - "location", + "iCalFileName", ], }, rsvp: { @@ -99,28 +126,164 @@ export default { ], optional: true, }, + rsvpTemplateId: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateId", + ], + optional: true, + }, + ctaTemplateId: { + propDefinition: [ + addToCalendarPro, + "ctaTemplateId", + ], + optional: true, + }, + numberOfDates: { + type: "integer", + label: "Number of Dates", + description: "The number of dates to create for the event", + reloadProps: true, + }, + }, + additionalProps() { + const props = {}; + if (!this.numberOfDates) { + return props; + } + for (let i = 0; i < this.numberOfDates; i++) { + props[`name${i}`] = { + type: "string", + label: `Title of Date ${i + 1}`, + description: `The title of Date ${i + 1}`, + }; + props[`startDate${i}`] = { + type: "string", + label: `Start Date of Date ${i + 1}`, + description: `The start date of Date ${i + 1} in format YYYY-MM-DD`, + }; + props[`startTime${i}`] = { + type: "string", + label: `Start Time of Date ${i + 1}`, + description: `The start time of Date ${i + 1} in format HH:MM`, + optional: true, + }; + props[`endDate${i}`] = { + type: "string", + label: `End Date of Date ${i + 1}`, + description: `The end date of Date ${i + 1} in format YYYY-MM-DD`, + optional: true, + }; + props[`endTime${i}`] = { + type: "string", + label: `End Time of Date ${i + 1}`, + description: `The end time of Date ${i + 1} in format HH:MM`, + optional: true, + }; + props[`timeZone${i}`] = { + type: "string", + label: `Time Zone of Date ${i + 1}`, + description: `The time zone of Date ${i + 1}. Example: "America/Los_Angeles"`, + optional: true, + }; + props[`description${i}`] = { + type: "string", + label: `Description of Date ${i + 1}`, + description: `The description of Date ${i + 1}`, + optional: true, + }; + props[`location${i}`] = { + type: "string", + label: `Location of Date ${i + 1}`, + description: `The location of Date ${i + 1}`, + optional: true, + }; + props[`availability${i}`] = { + type: "string", + label: `Availability of Date ${i + 1}`, + description: `The availability of Date ${i + 1}`, + options: [ + "free", + "busy", + ], + optional: true, + }; + props[`organizerName${i}`] = { + type: "string", + label: `Organizer Name of Date ${i + 1}`, + description: `The organizer name of Date ${i + 1}`, + optional: true, + }; + props[`organizerEmail${i}`] = { + type: "string", + label: `Organizer Email of Date ${i + 1}`, + description: `The organizer email of Date ${i + 1}`, + optional: true, + }; + props[`attendeeName${i}`] = { + type: "string", + label: `Attendee Name of Date ${i + 1}`, + description: `The attendee name of Date ${i + 1}`, + optional: true, + }; + props[`attendeeEmail${i}`] = { + type: "string", + label: `Attendee Email of Date ${i + 1}`, + description: `The attendee email of Date ${i + 1}`, + optional: true, + }; + } + return props; }, async run({ $ }) { + if (!this.groupProKey && !this.newEventGroupName) { + throw new ConfigurationError("Either `groupProKey` or `newEventGroupName` is required."); + } + if (this.groupProKey && this.newEventGroupName) { + throw new ConfigurationError("Only one of `groupProKey` or `newEventGroupName` can be provided."); + } + const dates = []; + for (let i = 0; i < this.numberOfDates; i++) { + dates.push({ + name: this[`name${i}`], + startDate: this[`startDate${i}`], + startTime: this[`startTime${i}`], + endDate: this[`endDate${i}`], + endTime: this[`endTime${i}`], + timeZone: this[`timeZone${i}`], + description: this[`description${i}`], + location: this[`location${i}`], + availability: this[`availability${i}`], + organizerName: this[`organizerName${i}`], + organizerEmail: this[`organizerEmail${i}`], + attendeeName: this[`attendeeName${i}`], + attendeeEmail: this[`attendeeEmail${i}`], + }); + } const event = await this.addToCalendarPro.createEvent({ $, data: { event_group: this.groupProKey, - dates: [ - { - name: this.name, - startDate: this.startDate, - startTime: this.startTime, - endDate: this.endDate, - endTime: this.endTime, - timeZone: this.timeZone, - description: this.description, - location: this.location, - }, - ], + new_event_group_name: this.newEventGroupName, + dates, + title_event_series: this.titleEventSeries, + simplified_recurrence: this.simplifiedRecurrence, + recurrence: this.recurrence, + recurrence_simple_type: this.recurrenceSimpleType, + recurrence_interval: this.recurrenceInterval, + recurrence_byDay: this.recurrenceByDay, + recurrence_byMonth: this.recurrenceByMonth, + recurrence_byMonthDay: this.recurrenceByMonthDay, + recurrence_count: this.recurrenceCount, + recurrence_weekstart: this.recurrenceWeekStart, + iCalFileName: this.iCalFileName, rsvp: this.rsvp, + rsvp_block: this.rsvpTemplateId, distribution: this.distribution, hideButton: this.hideButton, cta: this.cta, + cta_block: this.ctaTemplateId, layout: this.styleId, landingpage: this.landingPageTemplateId, }, diff --git a/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs b/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs index 69d920253f322..184947f2a7f84 100644 --- a/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs +++ b/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs @@ -80,6 +80,19 @@ export default { "metaDescriptionOverride", ], }, + metaRobotsOverride: { + propDefinition: [ + addToCalendarPro, + "metaRobotsOverride", + ], + }, + customDomainId: { + propDefinition: [ + addToCalendarPro, + "customDomainId", + ], + optional: true, + }, }, async run({ $ }) { const response = await this.addToCalendarPro.createLandingPageTemplate({ @@ -97,6 +110,8 @@ export default { image_repeat: this.imageRepeat, meta_title_override: this.metaTitleOverride, meta_description_override: this.metaDescriptionOverride, + meta_robots_override: this.metaRobotsOverride, + custom_domain: this.customDomainId, }, }); $.export("$summary", "Successfully created landing page template."); diff --git a/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs b/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs index 6799d50760879..482371fe83cf5 100644 --- a/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs +++ b/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs @@ -69,6 +69,76 @@ export default { "fields", ], }, + emailRsvpDoi: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_doi", + }), + ], + label: "Email Template: DOI", + }, + emailRsvpThankYou: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_thank_you", + }), + ], + label: "Email Template: Thank you", + }, + emailRsvpSignupConfirmation: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_signup_confirmation", + }), + ], + label: "Email Template: Sign-up Confirmation", + }, + emailRsvpChangeConfirmation: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_change_confirmation", + }), + ], + label: "Email Template: Change Confirmation", + }, + emailRsvpEventUpdate: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_event_update", + }), + ], + label: "Email Template: Event Update", + }, + emailRsvpMagicLink: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_magic_link", + }), + ], + label: "Email Template: Magic Link", + }, + emailRsvpSecondSignup: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_second_signup", + }), + ], + label: "Email Template: Second Sign-up", + }, }, async run({ $ }) { const response = await this.addToCalendarPro.createRsvpTemplate({ @@ -84,6 +154,13 @@ export default { headline: this.headline, text: this.text, fields: parseObject(this.fields), + email_rsvp_doi: this.emailRsvpDoi, + email_rsvp_thank_you: this.emailRsvpThankYou, + email_rsvp_signup_confirmation: this.emailRsvpSignupConfirmation, + email_rsvp_change_confirmation: this.emailRsvpChangeConfirmation, + email_rsvp_event_update: this.emailRsvpEventUpdate, + email_rsvp_magic_link: this.emailRsvpMagicLink, + email_rsvp_second_signup: this.emailRsvpSecondSignup, }, }); $.export("$summary", "Successfully created RSVP template."); diff --git a/components/add_to_calendar_pro/actions/update-event/update-event.mjs b/components/add_to_calendar_pro/actions/update-event/update-event.mjs index ce132872512b0..ddcae0c6f13e6 100644 --- a/components/add_to_calendar_pro/actions/update-event/update-event.mjs +++ b/components/add_to_calendar_pro/actions/update-event/update-event.mjs @@ -14,54 +14,70 @@ export default { "eventProKey", ], }, - name: { + titleEventSeries: { propDefinition: [ addToCalendarPro, - "eventName", + "titleEventSeries", ], - optional: true, }, - startDate: { + simplifiedRecurrence: { propDefinition: [ addToCalendarPro, - "startDate", + "simplifiedRecurrence", + ], + }, + recurrence: { + propDefinition: [ + addToCalendarPro, + "recurrence", ], - optional: true, }, - startTime: { + recurrenceSimpleType: { propDefinition: [ addToCalendarPro, - "startTime", + "recurrenceSimpleType", ], }, - endDate: { + recurrenceInterval: { propDefinition: [ addToCalendarPro, - "endDate", + "recurrenceInterval", ], }, - endTime: { + recurrenceByDay: { propDefinition: [ addToCalendarPro, - "endTime", + "recurrenceByDay", ], }, - timeZone: { + recurrenceByMonth: { propDefinition: [ addToCalendarPro, - "timeZone", + "recurrenceByMonth", ], }, - description: { + recurrenceByMonthDay: { propDefinition: [ addToCalendarPro, - "description", + "recurrenceByMonthDay", ], }, - location: { + recurrenceCount: { propDefinition: [ addToCalendarPro, - "location", + "recurrenceCount", + ], + }, + recurrenceWeekStart: { + propDefinition: [ + addToCalendarPro, + "recurrenceWeekStart", + ], + }, + iCalFileName: { + propDefinition: [ + addToCalendarPro, + "iCalFileName", ], }, rsvp: { @@ -101,28 +117,158 @@ export default { ], optional: true, }, + rsvpTemplateId: { + propDefinition: [ + addToCalendarPro, + "rsvpTemplateId", + ], + optional: true, + }, + ctaTemplateId: { + propDefinition: [ + addToCalendarPro, + "ctaTemplateId", + ], + optional: true, + }, + numberOfDates: { + type: "integer", + label: "Number of Dates", + description: "The number of dates to create for the event", + reloadProps: true, + }, + }, + additionalProps() { + const props = {}; + if (!this.numberOfDates) { + return props; + } + for (let i = 0; i < this.numberOfDates; i++) { + props[`name${i}`] = { + type: "string", + label: `Title of Date ${i + 1}`, + description: `The title of Date ${i + 1}`, + }; + props[`startDate${i}`] = { + type: "string", + label: `Start Date of Date ${i + 1}`, + description: `The start date of Date ${i + 1} in format YYYY-MM-DD`, + }; + props[`startTime${i}`] = { + type: "string", + label: `Start Time of Date ${i + 1}`, + description: `The start time of Date ${i + 1} in format HH:MM`, + optional: true, + }; + props[`endDate${i}`] = { + type: "string", + label: `End Date of Date ${i + 1}`, + description: `The end date of Date ${i + 1} in format YYYY-MM-DD`, + optional: true, + }; + props[`endTime${i}`] = { + type: "string", + label: `End Time of Date ${i + 1}`, + description: `The end time of Date ${i + 1} in format HH:MM`, + optional: true, + }; + props[`timeZone${i}`] = { + type: "string", + label: `Time Zone of Date ${i + 1}`, + description: `The time zone of Date ${i + 1}. Example: "America/Los_Angeles"`, + optional: true, + }; + props[`description${i}`] = { + type: "string", + label: `Description of Date ${i + 1}`, + description: `The description of Date ${i + 1}`, + optional: true, + }; + props[`location${i}`] = { + type: "string", + label: `Location of Date ${i + 1}`, + description: `The location of Date ${i + 1}`, + optional: true, + }; + props[`availability${i}`] = { + type: "string", + label: `Availability of Date ${i + 1}`, + description: `The availability of Date ${i + 1}`, + options: [ + "free", + "busy", + ], + optional: true, + }; + props[`organizerName${i}`] = { + type: "string", + label: `Organizer Name of Date ${i + 1}`, + description: `The organizer name of Date ${i + 1}`, + optional: true, + }; + props[`organizerEmail${i}`] = { + type: "string", + label: `Organizer Email of Date ${i + 1}`, + description: `The organizer email of Date ${i + 1}`, + optional: true, + }; + props[`attendeeName${i}`] = { + type: "string", + label: `Attendee Name of Date ${i + 1}`, + description: `The attendee name of Date ${i + 1}`, + optional: true, + }; + props[`attendeeEmail${i}`] = { + type: "string", + label: `Attendee Email of Date ${i + 1}`, + description: `The attendee email of Date ${i + 1}`, + optional: true, + }; + } + return props; }, async run({ $ }) { + const dates = []; + for (let i = 0; i < this.numberOfDates; i++) { + dates.push({ + name: this[`name${i}`], + startDate: this[`startDate${i}`], + startTime: this[`startTime${i}`], + endDate: this[`endDate${i}`], + endTime: this[`endTime${i}`], + timeZone: this[`timeZone${i}`], + description: this[`description${i}`], + location: this[`location${i}`], + availability: this[`availability${i}`], + organizerName: this[`organizerName${i}`], + organizerEmail: this[`organizerEmail${i}`], + attendeeName: this[`attendeeName${i}`], + attendeeEmail: this[`attendeeEmail${i}`], + }); + } + const response = await this.addToCalendarPro.updateEvent({ $, eventProKey: this.eventProKey, data: { - dates: [ - { - name: this.name, - startDate: this.startDate, - startTime: this.startTime, - endDate: this.endDate, - endTime: this.endTime, - timeZone: this.timeZone, - description: this.description, - location: this.location, - }, - ], + dates, + title_event_series: this.titleEventSeries, + simplified_recurrence: this.simplifiedRecurrence, + recurrence: this.recurrence, + recurrence_simple_type: this.recurrenceSimpleType, + recurrence_interval: this.recurrenceInterval, + recurrence_byDay: this.recurrenceByDay, + recurrence_byMonth: this.recurrenceByMonth, + recurrence_byMonthDay: this.recurrenceByMonthDay, + recurrence_count: this.recurrenceCount, + recurrence_weekstart: this.recurrenceWeekStart, + iCalFileName: this.iCalFileName, rsvp: this.rsvp, + rsvp_block: this.rsvpTemplateId, distribution: this.distribution, hideButton: this.hideButton, cta: this.cta, + cta_block: this.ctaTemplateId, layout: this.styleId, landingpage: this.landingPageTemplateId, }, diff --git a/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs b/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs index 20934d1bf72d5..a41fa9962db2f 100644 --- a/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs +++ b/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs @@ -87,6 +87,19 @@ export default { "metaDescriptionOverride", ], }, + metaRobotsOverride: { + propDefinition: [ + addToCalendarPro, + "metaRobotsOverride", + ], + }, + customDomainId: { + propDefinition: [ + addToCalendarPro, + "customDomainId", + ], + optional: true, + }, }, async run({ $ }) { const response = await this.addToCalendarPro.updateLandingPageTemplate({ @@ -105,6 +118,8 @@ export default { image_repeat: this.imageRepeat, meta_title_override: this.metaTitleOverride, meta_description_override: this.metaDescriptionOverride, + meta_robots_override: this.metaRobotsOverride, + custom_domain: this.customDomainId, }, }); $.export("$summary", "Successfully updated landing page template."); diff --git a/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs b/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs index 7c75e52995c30..0adf294b2c407 100644 --- a/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs +++ b/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs @@ -76,6 +76,76 @@ export default { "fields", ], }, + emailRsvpDoi: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_doi", + }), + ], + label: "Email Template: DOI", + }, + emailRsvpThankYou: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_thank_you", + }), + ], + label: "Email Template: Thank you", + }, + emailRsvpSignupConfirmation: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_signup_confirmation", + }), + ], + label: "Email Template: Sign-up Confirmation", + }, + emailRsvpChangeConfirmation: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_change_confirmation", + }), + ], + label: "Email Template: Change Confirmation", + }, + emailRsvpEventUpdate: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_event_update", + }), + ], + label: "Email Template: Event Update", + }, + emailRsvpMagicLink: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_magic_link", + }), + ], + label: "Email Template: Magic Link", + }, + emailRsvpSecondSignup: { + propDefinition: [ + addToCalendarPro, + "emailTemplateId", + () => ({ + type: "rsvp_second_signup", + }), + ], + label: "Email Template: Second Sign-up", + }, }, async run({ $ }) { const response = await this.addToCalendarPro.updateRsvpTemplate({ @@ -92,6 +162,13 @@ export default { headline: this.headline, text: this.text, fields: parseObject(this.fields), + email_rsvp_doi: this.emailRsvpDoi, + email_rsvp_thank_you: this.emailRsvpThankYou, + email_rsvp_signup_confirmation: this.emailRsvpSignupConfirmation, + email_rsvp_change_confirmation: this.emailRsvpChangeConfirmation, + email_rsvp_event_update: this.emailRsvpEventUpdate, + email_rsvp_magic_link: this.emailRsvpMagicLink, + email_rsvp_second_signup: this.emailRsvpSecondSignup, }, }); $.export("$summary", "Successfully updated RSVP template."); diff --git a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs index 6b1645254ce89..7ba087dc6ef45 100644 --- a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs +++ b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs @@ -53,6 +53,18 @@ export default { })) || []; }, }, + ctaTemplateId: { + type: "string", + label: "CTA Template ID", + description: "The ID of a Call to Action template", + async options() { + const templates = await this.listCtaTemplates(); + return templates?.map((template) => ({ + label: template.name, + value: template.id, + })) || []; + }, + }, eventProKey: { type: "string", label: "Event Pro Key", @@ -65,50 +77,103 @@ export default { })) || []; }, }, - eventName: { + customDomainId: { type: "string", - label: "Name", - description: "The name of the event", + label: "Custom Domain ID", + description: "The ID of a custom domain", + async options() { + const { available_custom_domains: domains } = await this.listCustomDomains(); + return domains?.map((domain) => ({ + label: domain.host, + value: domain.id, + })) || []; + }, + }, + emailTemplateId: { + type: "string", + label: "Email Template ID", + description: "The ID of an email template", + optional: true, + async options({ type }) { + const templates = await this.listEmailTemplates({ + type, + }); + return templates?.map((template) => ({ + label: template.name, + value: template.id, + })) || []; + }, }, - startDate: { + titleEventSeries: { type: "string", - label: "Start Date", - description: "The start date of the event in format YYYY-MM-DD", + label: "Title Event Series", + description: "The title of the event series", + optional: true, + }, + simplifiedRecurrence: { + type: "boolean", + label: "Simplified Recurrence", + description: "Set false, if you go for the \"recurrence\" field, which takes an RRULE; and true if you use the other recurrence fields", + optional: true, }, - startTime: { + recurrence: { type: "string", - label: "Start Time", - description: "The start time of the event in format HH:MM", + label: "Recurrence", + description: "The recurrence of the event", optional: true, }, - endDate: { + recurrenceSimpleType: { type: "string", - label: "End Date", - description: "The end date of the event in format YYYY-MM-DD", + label: "Recurrence Simple Type", + description: "The type of recurrence", + options: [ + "daily", + "weekly", + "monthly", + "yearly", + ], + optional: true, + }, + recurrenceInterval: { + type: "integer", + label: "Recurrence Interval", + description: "The interval of the recurrence", optional: true, }, - endTime: { + recurrenceByDay: { type: "string", - label: "End Time", - description: "The end time of the event in format HH:MM", + label: "Recurrence By Day", + description: "Example: `2MO,TU` for the second Monday and each Tuesday", optional: true, }, - timeZone: { + recurrenceByMonth: { type: "string", - label: "Time Zone", - description: "The timezone of the event. Example: `America/Los_Angeles`", + label: "Recurrence By Month", + description: "Example: `1,2,12` for Jan, Feb, and Dec", + optional: true, + }, + recurrenceByMonthDay: { + type: "integer", + label: "Recurrence By Month Day", + description: "Example: `3,23` for the 3rd and 23rd day of the month", optional: true, }, - description: { + recurrenceCount: { + type: "integer", + label: "Recurrence Count", + description: "The count of the recurrence", + optional: true, + }, + recurrenceWeekStart: { type: "string", - label: "Description", - description: "The description of the event", + label: "Recurrence Week Start", + description: "The week start of the recurrence. Example: `MO` for Monday", optional: true, }, - location: { + iCalFileName: { type: "string", - label: "Location", - description: "The location of the event", + label: "iCal File Name", + description: "Overriding the ics file name", optional: true, }, rsvp: { @@ -219,6 +284,12 @@ export default { description: "Text that overrides the auto-generated meta description", optional: true, }, + metaRobotsOverride: { + type: "string", + label: "Meta Robots Override", + description: "If true, Add to Calendar Pro will set \"norobots, noindex\"", + optional: true, + }, eventGroupName: { type: "string", label: "Event Group Name", @@ -230,9 +301,9 @@ export default { description: "Internal note for the event group", optional: true, }, - subscriptionCallUrl: { + subscriptionCalUrl: { type: "string", - label: "Subscription Call URL", + label: "Subscription Cal URL", description: "URL to an external calendar. Needs to start with \"http\"! Usually ends with \".ics\"", optional: true, }, @@ -400,6 +471,26 @@ export default { ...opts, }); }, + listCtaTemplates(opts = {}) { + return this._makeRequest({ + path: "/cta-block/all", + ...opts, + }); + }, + listCustomDomains(opts = {}) { + return this._makeRequest({ + path: "/custom-domains", + ...opts, + }); + }, + listEmailTemplates({ + type, ...opts + }) { + return this._makeRequest({ + path: `/email-template/${type}`, + ...opts, + }); + }, listEvents(opts = {}) { return this._makeRequest({ path: "/event/all", diff --git a/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs b/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs index ddb6fc2bc2d77..11abb5c32a5cb 100644 --- a/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs +++ b/components/add_to_calendar_pro/sources/new-rsvp-answer-instant/new-rsvp-answer-instant.mjs @@ -19,7 +19,7 @@ export default { }, generateMeta({ element_data: item }) { return { - id: item.prokey, + id: `${item.prokey}${item.email}`, summary: `New RSVP Answer with ProKey: ${item.prokey}`, ts: Date.parse(item.date_created), }; From e7c333e6465cae312879c91b06747794f39d6fb7 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 30 Jun 2025 15:07:25 -0400 Subject: [PATCH 8/8] fix prop --- components/add_to_calendar_pro/add_to_calendar_pro.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs index 7ba087dc6ef45..493ecea5de976 100644 --- a/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs +++ b/components/add_to_calendar_pro/add_to_calendar_pro.app.mjs @@ -153,7 +153,7 @@ export default { optional: true, }, recurrenceByMonthDay: { - type: "integer", + type: "string", label: "Recurrence By Month Day", description: "Example: `3,23` for the 3rd and 23rd day of the month", optional: true,