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..3458765f7df8d --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-event-group/create-event-group.mjs @@ -0,0 +1,75 @@ +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", + ], + }, + subscriptionCalUrl: { + propDefinition: [ + addToCalendarPro, + "subscriptionCalUrl", + ], + }, + cta: { + propDefinition: [ + addToCalendarPro, + "cta", + ], + }, + styleId: { + propDefinition: [ + addToCalendarPro, + "styleId", + ], + }, + landingPageTemplateId: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateId", + ], + optional: true, + }, + ctaTemplateId: { + propDefinition: [ + addToCalendarPro, + "ctaTemplateId", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.addToCalendarPro.createGroup({ + $, + data: { + name: this.eventGroupName, + internal_note: this.internalNote, + subscription: this.subscriptionCalUrl + ? "external" + : "no", + subscription_cal_url: this.subscriptionCalUrl, + cta: this.cta, + layout: this.styleId, + landingpage: this.landingPageTemplateId, + cta_block: this.ctaTemplateId, + }, + }); + $.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 new file mode 100644 index 0000000000000..77605d1d81afa --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-event/create-event.mjs @@ -0,0 +1,294 @@ +import addToCalendarPro from "../../add_to_calendar_pro.app.mjs"; +import { ConfigurationError } from "@pipedream/platform"; + +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", + ], + 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", + ], + }, + recurrenceSimpleType: { + propDefinition: [ + addToCalendarPro, + "recurrenceSimpleType", + ], + }, + recurrenceInterval: { + propDefinition: [ + addToCalendarPro, + "recurrenceInterval", + ], + }, + recurrenceByDay: { + propDefinition: [ + addToCalendarPro, + "recurrenceByDay", + ], + }, + recurrenceByMonth: { + propDefinition: [ + addToCalendarPro, + "recurrenceByMonth", + ], + }, + recurrenceByMonthDay: { + propDefinition: [ + addToCalendarPro, + "recurrenceByMonthDay", + ], + }, + recurrenceCount: { + propDefinition: [ + addToCalendarPro, + "recurrenceCount", + ], + }, + recurrenceWeekStart: { + propDefinition: [ + addToCalendarPro, + "recurrenceWeekStart", + ], + }, + iCalFileName: { + propDefinition: [ + addToCalendarPro, + "iCalFileName", + ], + }, + 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, + }, + 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, + 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, + }, + }); + $.export("$summary", "Successfully created event."); + return event; + }, +}; 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..184947f2a7f84 --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-landing-page-template/create-landing-page-template.mjs @@ -0,0 +1,120 @@ +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: { + propDefinition: [ + addToCalendarPro, + "landingPageTemplateName", + ], + }, + 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", + ], + }, + metaRobotsOverride: { + propDefinition: [ + addToCalendarPro, + "metaRobotsOverride", + ], + }, + customDomainId: { + propDefinition: [ + addToCalendarPro, + "customDomainId", + ], + 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, + meta_robots_override: this.metaRobotsOverride, + custom_domain: this.customDomainId, + }, + }); + $.export("$summary", "Successfully created landing page template."); + return response; + }, +}; 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..482371fe83cf5 --- /dev/null +++ b/components/add_to_calendar_pro/actions/create-rsvp-template/create-rsvp-template.mjs @@ -0,0 +1,169 @@ +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", + ], + }, + 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({ + $, + 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), + 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."); + 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-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/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/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-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/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-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/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..7ef95cdfaef0a --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-event-group/update-event-group.mjs @@ -0,0 +1,76 @@ +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: { + 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..ddcae0c6f13e6 --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-event/update-event.mjs @@ -0,0 +1,279 @@ +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", + ], + }, + titleEventSeries: { + propDefinition: [ + addToCalendarPro, + "titleEventSeries", + ], + }, + simplifiedRecurrence: { + propDefinition: [ + addToCalendarPro, + "simplifiedRecurrence", + ], + }, + recurrence: { + propDefinition: [ + addToCalendarPro, + "recurrence", + ], + }, + recurrenceSimpleType: { + propDefinition: [ + addToCalendarPro, + "recurrenceSimpleType", + ], + }, + recurrenceInterval: { + propDefinition: [ + addToCalendarPro, + "recurrenceInterval", + ], + }, + recurrenceByDay: { + propDefinition: [ + addToCalendarPro, + "recurrenceByDay", + ], + }, + recurrenceByMonth: { + propDefinition: [ + addToCalendarPro, + "recurrenceByMonth", + ], + }, + recurrenceByMonthDay: { + propDefinition: [ + addToCalendarPro, + "recurrenceByMonthDay", + ], + }, + recurrenceCount: { + propDefinition: [ + addToCalendarPro, + "recurrenceCount", + ], + }, + recurrenceWeekStart: { + propDefinition: [ + addToCalendarPro, + "recurrenceWeekStart", + ], + }, + iCalFileName: { + propDefinition: [ + addToCalendarPro, + "iCalFileName", + ], + }, + 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, + }, + 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, + 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, + }, + }); + $.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..a41fa9962db2f --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-landing-page-template/update-landing-page-template.mjs @@ -0,0 +1,128 @@ +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", + ], + }, + metaRobotsOverride: { + propDefinition: [ + addToCalendarPro, + "metaRobotsOverride", + ], + }, + customDomainId: { + propDefinition: [ + addToCalendarPro, + "customDomainId", + ], + optional: true, + }, + }, + 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, + meta_robots_override: this.metaRobotsOverride, + custom_domain: this.customDomainId, + }, + }); + $.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..0adf294b2c407 --- /dev/null +++ b/components/add_to_calendar_pro/actions/update-rsvp-template/update-rsvp-template.mjs @@ -0,0 +1,177 @@ +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", + ], + }, + 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({ + $, + 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), + 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."); + 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..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 @@ -1,11 +1,601 @@ +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", + async options() { + const templates = await this.listLandingPageTemplates(); + return templates?.map((template) => ({ + label: template.name, + value: template.id, + })) || []; + }, + }, + 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, + })) || []; + }, + }, + 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", + description: "The pro key of an event", + async options() { + const events = await this.listEvents(); + return events?.map((event) => ({ + label: event.label, + value: event.prokey, + })) || []; + }, + }, + customDomainId: { + type: "string", + 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, + })) || []; + }, + }, + titleEventSeries: { + type: "string", + 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, + }, + recurrence: { + type: "string", + label: "Recurrence", + description: "The recurrence of the event", + optional: true, + }, + recurrenceSimpleType: { + type: "string", + 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, + }, + recurrenceByDay: { + type: "string", + label: "Recurrence By Day", + description: "Example: `2MO,TU` for the second Monday and each Tuesday", + optional: true, + }, + recurrenceByMonth: { + type: "string", + label: "Recurrence By Month", + description: "Example: `1,2,12` for Jan, Feb, and Dec", + optional: true, + }, + recurrenceByMonthDay: { + type: "string", + label: "Recurrence By Month Day", + description: "Example: `3,23` for the 3rd and 23rd day of the month", + optional: true, + }, + recurrenceCount: { + type: "integer", + label: "Recurrence Count", + description: "The count of the recurrence", + optional: true, + }, + recurrenceWeekStart: { + type: "string", + label: "Recurrence Week Start", + description: "The week start of the recurrence. Example: `MO` for Monday", + optional: true, + }, + iCalFileName: { + type: "string", + label: "iCal File Name", + description: "Overriding the ics file name", + 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, + }, + 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", + description: "The name of the event group", + }, + internalNote: { + type: "string", + label: "Internal Note", + description: "Internal note for the event group", + optional: true, + }, + subscriptionCalUrl: { + type: "string", + label: "Subscription Cal 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: { - // 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"); + return null; + } else { + throw error; + } + } + }, + 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 + }) { + 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, + }); + }, + listRsvpTemplates(opts = {}) { + return this._makeRequest({ + path: "/rsvp-block/all", + ...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", + ...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/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; +}; 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 +} 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..ced19907cd470 --- /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 group 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..a430099cf3788 --- /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 group 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..11abb5c32a5cb --- /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}${item.email}`, + 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..325597099c181 --- /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": "", + "prokey": "c6510c06-a277-4e1c-9baf-deec9c5507c7", + "amount": 2, + "payload": {} + } +} \ No newline at end of file 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: