Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(google-calendar): improve the step forms (#15406)

Talal Jaber09109000cc07
diff --git a/bun.lock b/bun.lock
index 951b4d452a9..a2a316aac04 100644
--- a/bun.lock
+++ b/bun.lock
@@ -3766,7 +3766,7 @@
},
"packages/pieces/community/google-calendar": {
"name": "@activepieces/piece-google-calendar",
- "version": "0.11.1",
+ "version": "0.12.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/google-calendar/package.json b/packages/pieces/community/google-calendar/package.json
index 9f414bcea87..7294d26bb5d 100644
--- a/packages/pieces/community/google-calendar/package.json
+++ b/packages/pieces/community/google-calendar/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-google-calendar",
- "version": "0.11.1",
+ "version": "0.12.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/community/google-calendar/src/i18n/translation.json b/packages/pieces/community/google-calendar/src/i18n/translation.json
index 5208d1b0b0a..2ff6c6eae57 100644
--- a/packages/pieces/community/google-calendar/src/i18n/translation.json
+++ b/packages/pieces/community/google-calendar/src/i18n/translation.json
@@ -3,7 +3,7 @@
"Add Attendees to Event": "Add Attendees to Event",
"Create Quick Event": "Create Quick Event",
"Create Event": "Create Event",
- "Get all Events": "Get all Events",
+ "Get Events": "Get Events",
"Update Event": "Update Event",
"Delete Event": "Delete Event",
"Find Busy/Free Periods in Calendar": "Find Busy/Free Periods in Calendar",
@@ -22,13 +22,13 @@
"Get Colors": "Get Colors",
"List Settings": "List Settings",
"Custom API Call": "Custom API Call",
- "Add one or more person to existing event.": "Add one or more person to existing event.",
- "Add Quick Calendar Event": "Add Quick Calendar Event",
- "Add Event": "Add Event",
- "Get Events": "Get Events",
- "Updates an event in Google Calendar.": "Updates an event in Google Calendar.",
+ "Adds guests to an existing event.": "Adds guests to an existing event.",
+ "Creates an event from a plain-language phrase.": "Creates an event from a plain-language phrase.",
+ "Creates an event with a title, time, guests and options.": "Creates an event with a title, time, guests and options.",
+ "Lists events in a calendar, with optional filters.": "Lists events in a calendar, with optional filters.",
+ "Updates an existing event; empty fields keep their value.": "Updates an existing event; empty fields keep their value.",
"Deletes an event from Google Calendar.": "Deletes an event from Google Calendar.",
- "Finds free/busy calendar details from Google Calendar.": "Finds free/busy calendar details from Google Calendar.",
+ "Finds busy periods across calendars in a time range.": "Finds busy periods across calendars in a time range.",
"Fetch event details by its unique ID from Google Calendar.": "Fetch event details by its unique ID from Google Calendar.",
"Searches every calendar the account can access for events matching a keyword within a required time window.": "Searches every calendar the account can access for events matching a keyword within a required time window.",
"Computes open time slots shared across one or more calendars within a window, by inverting their busy blocks.": "Computes open time slots shared across one or more calendars within a window, by inverting their busy blocks.",
@@ -50,27 +50,24 @@
"Calendar": "Calendar",
"Event ID": "Event ID",
"Attendees": "Attendees",
- "Summary": "Summary",
+ "Event Text": "Event Text",
"Send Updates": "Send Updates",
- "Title of the event": "Title of the event",
- "Start date time of the event": "Start date time of the event",
- "End date time of the event": "End date time of the event",
+ "Title": "Title",
+ "Start Time": "Start Time",
+ "End Time": "End Time",
"Location": "Location",
"Description": "Description",
"Color": "Color",
- "Guests can modify": "Guests can modify",
- "Guests can invite others": "Guests can invite others",
- "Guests can see other guests": "Guests can see other guests",
+ "Guests Can Modify": "Guests Can Modify",
+ "Guests Can Invite Others": "Guests Can Invite Others",
+ "Guests Can See Other Guests": "Guests Can See Other Guests",
"Send Notifications": "Send Notifications",
"Create Google Meet Link": "Create Google Meet Link",
- "Event types": "Event types",
+ "Event Types": "Event Types",
"Search Term": "Search Term",
- "Date from": "Date from",
- "Date to": "Date to",
- "Expand Recurring Event?": "Expand Recurring Event?",
+ "Expand Recurring Events": "Expand Recurring Events",
+ "Markdown": "Markdown",
"Calendars": "Calendars",
- "Start Time": "Start Time",
- "End Time": "End Time",
"Max Attendees": "Max Attendees",
"Time Zone": "Time Zone",
"Expand Recurring Events?": "Expand Recurring Events?",
@@ -83,32 +80,40 @@
"Include Cancelled Instances": "Include Cancelled Instances",
"Max Results": "Max Results",
"Destination Calendar": "Destination Calendar",
+ "Guests can modify": "Guests can modify",
+ "Guests can invite others": "Guests can invite others",
+ "Guests can see other guests": "Guests can see other guests",
"Attendee Email": "Attendee Email",
"iCal UID": "iCal UID",
- "Title": "Title",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body Type": "Body Type",
"Body": "Body",
- "Response is Binary ?": "Response is Binary ?",
- "No Error on Failure": "No Error on Failure",
- "Timeout (in seconds)": "Timeout (in seconds)",
+ "Response is Binary": "Response is Binary",
+ "Return Error as Output": "Return Error as Output",
+ "Timeout": "Timeout",
"Follow redirects": "Follow redirects",
- "Emails of the attendees (guests)": "Emails of the attendees (guests)",
- "The text describing the event to be created": "The text describing the event to be created",
- "Guests who should receive notifications about the creation of the new event.": "Guests who should receive notifications about the creation of the new event.",
- "By default it'll be 30 min post start time": "By default it'll be 30 min post start time",
- "Description of the event. You can use HTML tags here.": "Description of the event. You can use HTML tags here.",
- "Automatically create a Google Meet video conference link for this event": "Automatically create a Google Meet video conference link for this event",
- "Select event types": "Select event types",
- "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves.": "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves.",
- "Select the calendars to check for busy periods.": "Select the calendars to check for busy periods.",
+ "Paste the ID from the event URL or a previous step.": "Paste the ID from the event URL or a previous step.",
+ "One guest email per item.": "One guest email per item.",
+ "e.g. \"Lunch with Sam tomorrow at 1pm\".": "e.g. \"Lunch with Sam tomorrow at 1pm\".",
+ "Who gets an email invitation for the new event.": "Who gets an email invitation for the new event.",
+ "Defaults to 30 minutes after the start.": "Defaults to 30 minutes after the start.",
+ "HTML tags are allowed.": "HTML tags are allowed.",
+ "Leave empty for the calendar default.": "Leave empty for the calendar default.",
+ "Adds a Google Meet link to the event.": "Adds a Google Meet link to the event.",
+ "Only events of these types are returned.": "Only events of these types are returned.",
+ "Exact phrase matched against title, description, location and guests.": "Exact phrase matched against title, description, location and guests.",
+ "Only events that end after this time.": "Only events that end after this time.",
+ "Only events starting before this. Requires Start Time.": "Only events starting before this. Requires Start Time.",
+ "Returns each occurrence of a recurring event separately.": "Returns each occurrence of a recurring event separately.",
+ "Empty fields keep their current value.": "Empty fields keep their current value.",
+ "Replaces the current guest list. One email per item.": "Replaces the current guest list. One email per item.",
+ "Calendars to check.": "Calendars to check.",
"The start of the time range to check.": "The start of the time range to check.",
"The end of the time range to check.": "The end of the time range to check.",
- "The unique ID of the event (e.g., \"abc123def456\"). You can find this in the event URL or from other calendar actions.": "The unique ID of the event (e.g., \"abc123def456\"). You can find this in the event URL or from other calendar actions.",
- "Maximum number of attendees to include in the response. If there are more attendees, only the participant is returned.": "Maximum number of attendees to include in the response. If there are more attendees, only the participant is returned.",
- "Time zone for the response (e.g., \"America/New_York\", \"Europe/London\"). Defaults to the calendar's time zone if not specified.": "Time zone for the response (e.g., \"America/New_York\", \"Europe/London\"). Defaults to the calendar's time zone if not specified.",
+ "Above this count, only you are returned.": "Above this count, only you are returned.",
+ "IANA name, e.g. America/New_York. Defaults to the calendar zone.": "IANA name, e.g. America/New_York. Defaults to the calendar zone.",
"Free-text query matched against event fields (summary, description, location, attendee names/emails) using Google's native search. Example: \"budget review\".": "Free-text query matched against event fields (summary, description, location, attendee names/emails) using Google's native search. Example: \"budget review\".",
"Lower bound (inclusive) for an event's end time, as an ISO 8601 timestamp (e.g. \"2026-06-01T00:00:00Z\"). Required to bound the cross-calendar scan.": "Lower bound (inclusive) for an event's end time, as an ISO 8601 timestamp (e.g. \"2026-06-01T00:00:00Z\"). Required to bound the cross-calendar scan.",
"Upper bound (exclusive) for an event's start time, as an ISO 8601 timestamp (e.g. \"2026-06-30T23:59:59Z\"). Required to bound the cross-calendar scan.": "Upper bound (exclusive) for an event's start time, as an ISO 8601 timestamp (e.g. \"2026-06-30T23:59:59Z\"). Required to bound the cross-calendar scan.",
@@ -137,20 +142,25 @@
"Title (summary) of the imported event.": "Title (summary) of the imported event.",
"Event start as an ISO 8601 timestamp (e.g. \"2026-06-01T09:00:00Z\").": "Event start as an ISO 8601 timestamp (e.g. \"2026-06-01T09:00:00Z\").",
"Event end as an ISO 8601 timestamp (e.g. \"2026-06-01T10:00:00Z\").": "Event end as an ISO 8601 timestamp (e.g. \"2026-06-01T10:00:00Z\").",
+ "Description of the event. You can use HTML tags here.": "Description of the event. You can use HTML tags here.",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
+ "Appended to the URL as ?key=value.": "Appended to the URL as ?key=value.",
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
- "All": "All",
- "External Only": "External Only",
- "none": "none",
- "Yes, to everyone": "Yes, to everyone",
- "To non-Google Calendar guests only": "To non-Google Calendar guests only",
- "To no one": "To no one",
+ "On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.",
+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconds to wait for a response. Empty: up to the flow limit (10 min).",
+ "Follow 3xx redirects instead of returning them as the response.": "Follow 3xx redirects instead of returning them as the response.",
+ "All guests": "All guests",
+ "External guests only": "External guests only",
+ "No one": "No one",
"Default": "Default",
- "Out Of Office": "Out Of Office",
+ "Out of Office": "Out of Office",
"Focus Time": "Focus Time",
"Working Location": "Working Location",
+ "Yes": "Yes",
+ "No": "No",
"To everyone": "To everyone",
"To external guests only": "To external guests only",
+ "To no one": "To no one",
"True": "True",
"False": "False",
"GET": "GET",
@@ -177,35 +187,32 @@
"Fires when a new event is created that matches a specified search term.": "Fires when a new event is created that matches a specified search term.",
"Fires when an event is canceled or deleted.": "Fires when an event is canceled or deleted.",
"Fires when a new calendar is created or becomes accessible.": "Fires when a new calendar is created or becomes accessible.",
- "Event Types to Monitor": "Event Types to Monitor",
"Search Filter": "Search Filter",
"Exclude All-Day Events": "Exclude All-Day Events",
"Target Specific Event": "Target Specific Event",
"Event": "Event",
"Time Before": "Time Before",
"Time Unit": "Time Unit",
- "Event Types": "Event Types",
- "Search In Fields": "Search In Fields",
+ "Search In": "Search In",
"Cancellation Reasons": "Cancellation Reasons",
"Access Role Filter": "Access Role Filter",
"Calendar Name Filter": "Calendar Name Filter",
"Exclude Shared Calendars": "Exclude Shared Calendars",
- "If true, the trigger will activate for every occurrence of a recurring event.": "If true, the trigger will activate for every occurrence of a recurring event.",
- "Filter by specific event types (leave empty to monitor all event types)": "Filter by specific event types (leave empty to monitor all event types)",
- "Only trigger for events containing this text in title, description, or location (optional)": "Only trigger for events containing this text in title, description, or location (optional)",
- "Skip triggering for all-day events": "Skip triggering for all-day events",
- "Enable to monitor a specific event instead of all events in the calendar.": "Enable to monitor a specific event instead of all events in the calendar.",
- "The amount of time before the event starts.": "The amount of time before the event starts.",
- "The keyword(s) to search for in new events (searches across title, description, location, and attendees by default).": "The keyword(s) to search for in new events (searches across title, description, location, and attendees by default).",
- "Filter by specific event types (optional)": "Filter by specific event types (optional)",
- "Specify which fields to search in (leave empty to use Google's default search across all fields)": "Specify which fields to search in (leave empty to use Google's default search across all fields)",
- "Filter by specific types of cancellations (optional)": "Filter by specific types of cancellations (optional)",
- "Only trigger for calendars with specific access roles (optional)": "Only trigger for calendars with specific access roles (optional)",
- "Only trigger for calendars containing this text in name or description (optional)": "Only trigger for calendars containing this text in name or description (optional)",
- "Only trigger for calendars you own, not shared calendars": "Only trigger for calendars you own, not shared calendars",
- "Default Events": "Default Events",
- "Birthday Events": "Birthday Events",
- "Out of Office": "Out of Office",
+ "Fires once per occurrence of a recurring event.": "Fires once per occurrence of a recurring event.",
+ "Leave empty to include every type.": "Leave empty to include every type.",
+ "Only events whose title, description or location contain this.": "Only events whose title, description or location contain this.",
+ "Skips all-day events.": "Skips all-day events.",
+ "Watch one event instead of the whole calendar.": "Watch one event instead of the whole calendar.",
+ "Upcoming events in the selected calendar.": "Upcoming events in the selected calendar.",
+ "How long before the event starts to fire.": "How long before the event starts to fire.",
+ "Unit for Time Before.": "Unit for Time Before.",
+ "Matched against title, description, location and guests.": "Matched against title, description, location and guests.",
+ "Leave empty to search every field.": "Leave empty to search every field.",
+ "Leave empty to fire on every cancellation.": "Leave empty to fire on every cancellation.",
+ "Leave empty to fire for every access role.": "Leave empty to fire for every access role.",
+ "Only calendars whose name or description contain this.": "Only calendars whose name or description contain this.",
+ "Fires only for calendars you own.": "Fires only for calendars you own.",
+ "Birthday": "Birthday",
"From Gmail": "From Gmail",
"Minutes": "Minutes",
"Hours": "Hours",
diff --git a/packages/pieces/community/google-calendar/src/index.ts b/packages/pieces/community/google-calendar/src/index.ts
index 56eed21a8aa..44b30d4c424 100644
--- a/packages/pieces/community/google-calendar/src/index.ts
+++ b/packages/pieces/community/google-calendar/src/index.ts
@@ -39,7 +39,7 @@ import { newCalendar } from './lib/triggers/new-calendar';
export { googleCalendarAuth, getAccessToken, GoogleCalendarAuthValue, createGoogleClient } from './lib/common';
export const googleCalendar = createPiece({
- minimumSupportedRelease: '0.86.4',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/google-calendar.png',
categories: [PieceCategory.PRODUCTIVITY],
displayName: 'Google Calendar',
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/add-attendees.action.ts b/packages/pieces/community/google-calendar/src/lib/actions/add-attendees.action.ts
index 1b855665e44..be1f4ee53f1 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/add-attendees.action.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/add-attendees.action.ts
@@ -8,18 +8,19 @@ export const addAttendeesToEventAction = createAction({
name: 'google-calendar-add-attendees',
classification: 'WRITE',
displayName: 'Add Attendees to Event',
- description: 'Add one or more person to existing event.',
+ description: 'Adds guests to an existing event.',
audience: 'both',
aiMetadata: { description: 'Adds one or more guests (by email) to an existing Google Calendar event, identified by calendar and event ID, preserving the current attendee list. Use to invite people to an event that already exists rather than recreating it. Not idempotent: re-running appends the same emails again, producing duplicate attendee entries.', idempotent: false },
props: {
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
eventId: Property.ShortText({
displayName: 'Event ID',
+ description: 'Paste the ID from the event URL or a previous step.',
required: true,
}),
attendees: Property.Array({
displayName: 'Attendees',
- description: 'Emails of the attendees (guests)',
+ description: 'One guest email per item.',
required: true,
}),
},
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/ai-update-event.ts b/packages/pieces/community/google-calendar/src/lib/actions/ai-update-event.ts
index 0f07bba5983..73c2d0d60bd 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/ai-update-event.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/ai-update-event.ts
@@ -6,6 +6,7 @@ import { eventOutputSchema } from '../output-schemas';
const {
eventId: _omitEventId,
calendar_id: _omitCalendarId,
+ hint: _omitHint,
guests_can_modify: _omitGuestsCanModify,
guests_can_invite_others: _omitGuestsCanInviteOthers,
guests_can_see_other_guests: _omitGuestsCanSeeOtherGuests,
@@ -66,6 +67,7 @@ export const aiUpdateEvent = createAction({
...context,
propsValue: {
...context.propsValue,
+ hint: undefined,
eventId: context.propsValue.event_id,
guests_can_modify: toOptionalBoolean(
context.propsValue.guests_can_modify
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/create-event.ts b/packages/pieces/community/google-calendar/src/lib/actions/create-event.ts
index 8fab99899bf..0ac12949181 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/create-event.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/create-event.ts
@@ -8,16 +8,16 @@ import { eventOutputSchema } from '../output-schemas';
export const createEventProps = {
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
title: Property.ShortText({
- displayName: 'Title of the event',
+ displayName: 'Title',
required: true,
}),
start_date_time: Property.DateTime({
- displayName: 'Start date time of the event',
+ displayName: 'Start Time',
required: true,
}),
end_date_time: Property.DateTime({
- displayName: 'End date time of the event',
- description: "By default it'll be 30 min post start time",
+ displayName: 'End Time',
+ description: 'Defaults to 30 minutes after the start.',
required: false,
}),
location: Property.ShortText({
@@ -31,48 +31,52 @@ export const createEventProps = {
}),*/
description: Property.LongText({
displayName: 'Description',
- description: 'Description of the event. You can use HTML tags here.',
+ description: 'HTML tags are allowed.',
required: false,
}),
- colorId: googleCalendarCommon.colorId,
+ colorId: googleCalendarCommon.colorId('Leave empty for the calendar default.'),
attendees: Property.Array({
displayName: 'Attendees',
- description: 'Emails of the attendees (guests)',
+ description: 'One guest email per item.',
required: false,
}),
guests_can_modify: Property.Checkbox({
- displayName: 'Guests can modify',
+ displayName: 'Guests Can Modify',
defaultValue: false,
required: false,
+ advanced: true,
}),
guests_can_invite_others: Property.Checkbox({
- displayName: 'Guests can invite others',
+ displayName: 'Guests Can Invite Others',
defaultValue: false,
required: false,
+ advanced: true,
}),
guests_can_see_other_guests: Property.Checkbox({
- displayName: 'Guests can see other guests',
+ displayName: 'Guests Can See Other Guests',
defaultValue: false,
required: false,
+ advanced: true,
}),
send_notifications: Property.StaticDropdown({
displayName: 'Send Notifications',
+ description: 'Who gets an email invitation for the new event.',
defaultValue: 'all',
options: {
options: [
- { label: 'Yes, to everyone', value: 'all' },
+ { label: 'All guests', value: 'all' },
{
- label: 'To non-Google Calendar guests only',
+ label: 'External guests only',
value: 'externalOnly',
},
- { label: 'To no one', value: 'none' },
+ { label: 'No one', value: 'none' },
],
},
required: true,
}),
create_meet_link: Property.Checkbox({
displayName: 'Create Google Meet Link',
- description: 'Automatically create a Google Meet video conference link for this event',
+ description: 'Adds a Google Meet link to the event.',
defaultValue: false,
required: false,
}),
@@ -164,7 +168,7 @@ export const createEvent = createAction({
auth: googleCalendarAuth,
name: 'create_google_calendar_event',
classification: 'WRITE',
- description: 'Add Event',
+ description: 'Creates an event with a title, time, guests and options.',
audience: 'human',
aiMetadata: { description: 'Creates a Google Calendar event with structured fields (title, start/end times, location, description, attendees, color, guest permissions) and can optionally attach a Google Meet link. Use this when you have explicit event details; choose Create Quick Event instead when working from a single natural-language phrase. Requires a title and start time (end defaults to 30 minutes after start). Not idempotent: each call creates a new event.', idempotent: false },
displayName: 'Create Event',
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/create-quick-event.ts b/packages/pieces/community/google-calendar/src/lib/actions/create-quick-event.ts
index 22bdc184bf6..020a4e92e26 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/create-quick-event.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/create-quick-event.ts
@@ -12,35 +12,35 @@ export const createQuickCalendarEvent = createAction({
auth: googleCalendarAuth,
name: 'create_quick_event',
classification: 'WRITE',
- description: 'Add Quick Calendar Event',
+ description: 'Creates an event from a plain-language phrase.',
audience: 'both',
aiMetadata: { description: 'Creates a calendar event from a single natural-language phrase (e.g. "Lunch with Sam tomorrow at 1pm") via Google\'s quickAdd parsing, letting Google infer the time, title, and date. Use when you have free-form text rather than structured fields; prefer Create Event when you have explicit start/end times or attendees. Not idempotent: each call creates a new event.', idempotent: false },
displayName: 'Create Quick Event',
props: {
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
text: Property.LongText({
- displayName: 'Summary',
- description: 'The text describing the event to be created',
+ displayName: 'Event Text',
+ description: 'e.g. "Lunch with Sam tomorrow at 1pm".',
required: true,
}),
send_updates: Property.StaticDropdown<string>({
displayName: 'Send Updates',
- description:
- 'Guests who should receive notifications about the creation of the new event.',
+ description: 'Who gets an email invitation for the new event.',
required: false,
+ defaultValue: 'none',
options: {
disabled: false,
options: [
{
- label: 'All',
+ label: 'All guests',
value: 'all',
},
{
- label: 'External Only',
+ label: 'External guests only',
value: 'externalOnly',
},
{
- label: 'none',
+ label: 'No one',
value: 'none',
},
],
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/delete-event.action.ts b/packages/pieces/community/google-calendar/src/lib/actions/delete-event.action.ts
index f2ffe5ecb28..ffaa7b50222 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/delete-event.action.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/delete-event.action.ts
@@ -6,6 +6,7 @@ export const deleteEventProps = {
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
eventId: Property.ShortText({
displayName: 'Event ID',
+ description: 'Paste the ID from the event URL or a previous step.',
required: true,
}),
};
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/find-busy-free-periods.ts b/packages/pieces/community/google-calendar/src/lib/actions/find-busy-free-periods.ts
index e147787794b..1702ee9c4bc 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/find-busy-free-periods.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/find-busy-free-periods.ts
@@ -28,14 +28,14 @@ export const findFreeBusyProps = {
calendar_ids: Property.MultiSelectDropdown({
auth: googleCalendarAuth,
displayName: 'Calendars',
- description: 'Select the calendars to check for busy periods.',
+ description: 'Calendars to check.',
required: true,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
- placeholder: 'Connect your account first',
+ placeholder: 'Connect your Google account first',
options: [],
};
}
@@ -96,7 +96,7 @@ export const findFreeBusy = createAction({
name: 'google_calendar_find_busy_free_periods',
classification: 'SEARCH',
displayName: 'Find Busy/Free Periods in Calendar',
- description: 'Finds free/busy calendar details from Google Calendar.',
+ description: 'Finds busy periods across calendars in a time range.',
audience: 'human',
aiMetadata: { description: 'Queries one or more calendars for their busy time blocks within a given start/end window, without exposing event details. Use to check availability or find open slots before scheduling a meeting. Requires the calendars to check and a time range. Read-only and idempotent.', idempotent: true },
props: findFreeBusyProps,
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/get-event-by-id.ts b/packages/pieces/community/google-calendar/src/lib/actions/get-event-by-id.ts
index 6fed8a20bc1..df976a42292 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/get-event-by-id.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/get-event-by-id.ts
@@ -13,21 +13,20 @@ export const getEventByIdProps = {
calendar_id: googleCalendarCommon.calendarDropdown(),
event_id: Property.ShortText({
displayName: 'Event ID',
- description:
- 'The unique ID of the event (e.g., "abc123def456"). You can find this in the event URL or from other calendar actions.',
+ description: 'Paste the ID from the event URL or a previous step.',
required: true,
}),
max_attendees: Property.Number({
displayName: 'Max Attendees',
- description:
- 'Maximum number of attendees to include in the response. If there are more attendees, only the participant is returned.',
+ description: 'Above this count, only you are returned.',
required: false,
+ advanced: true,
}),
time_zone: Property.ShortText({
displayName: 'Time Zone',
- description:
- 'Time zone for the response (e.g., "America/New_York", "Europe/London"). Defaults to the calendar\'s time zone if not specified.',
+ description: 'IANA name, e.g. America/New_York. Defaults to the calendar zone.',
required: false,
+ advanced: true,
}),
};
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/get-events.ts b/packages/pieces/community/google-calendar/src/lib/actions/get-events.ts
index 891f31876ec..38049e87636 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/get-events.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/get-events.ts
@@ -12,8 +12,8 @@ import { getEventsActionOutputSchema } from '../output-schemas';
export const getEventsProps = {
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
event_types: Property.StaticMultiSelectDropdown({
- displayName: 'Event types',
- description: 'Select event types',
+ displayName: 'Event Types',
+ description: 'Only events of these types are returned.',
required: true,
defaultValue: ['default', 'focusTime', 'outOfOffice'],
options: {
@@ -23,7 +23,7 @@ export const getEventsProps = {
value: 'default',
},
{
- label: 'Out Of Office',
+ label: 'Out of Office',
value: 'outOfOffice',
},
{
@@ -39,21 +39,23 @@ export const getEventsProps = {
}),
search: Property.ShortText({
displayName: 'Search Term',
+ description: 'Exact phrase matched against title, description, location and guests.',
required: false,
}),
start_date: Property.DateTime({
- displayName: 'Date from',
+ displayName: 'Start Time',
+ description: 'Only events that end after this time.',
required: false,
}),
end_date: Property.DateTime({
- displayName: 'Date to',
+ displayName: 'End Time',
+ description: 'Only events starting before this. Requires Start Time.',
required: false,
}),
singleEvents: Property.Checkbox({
- displayName: 'Expand Recurring Event?',
- description:
- 'Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves.',
- required: true,
+ displayName: 'Expand Recurring Events',
+ description: 'Returns each occurrence of a recurring event separately.',
+ required: false,
defaultValue: false,
}),
};
@@ -113,11 +115,12 @@ export const getEvents = createAction({
auth: googleCalendarAuth,
name: 'google_calendar_get_events',
classification: 'SEARCH',
- description: 'Get Events',
+ description: 'Lists events in a calendar, with optional filters.',
audience: 'human',
aiMetadata: { description: 'Lists events from a Google Calendar, optionally filtered by a date range, search term, and event types, and can expand recurring events into individual instances. Use to look up or browse multiple events when you do not already have a specific event ID; use Get Event by ID for a single known event. Read-only and idempotent.', idempotent: true },
- displayName: 'Get all Events',
+ displayName: 'Get Events',
props: getEventsProps,
outputSchema: getEventsActionOutputSchema,
run: runGetEvents,
});
+
diff --git a/packages/pieces/community/google-calendar/src/lib/actions/update-event.action.ts b/packages/pieces/community/google-calendar/src/lib/actions/update-event.action.ts
index 970d87804a1..10de8273c91 100644
--- a/packages/pieces/community/google-calendar/src/lib/actions/update-event.action.ts
+++ b/packages/pieces/community/google-calendar/src/lib/actions/update-event.action.ts
@@ -1,4 +1,4 @@
-import { ActionContext, Property, createAction } from '@activepieces/pieces-framework';
+import { ActionContext, MarkdownVariant, Property, createAction } from '@activepieces/pieces-framework';
import { calendar as googleCalendar, calendar_v3 } from '@googleapis/calendar';
import { googleCalendarCommon, googleCalendarAuth, createGoogleClient } from '../common';
import dayjs from 'dayjs';
@@ -8,18 +8,23 @@ export const updateEventProps = {
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
eventId: Property.ShortText({
displayName: 'Event ID',
+ description: 'Paste the ID from the event URL or a previous step.',
required: true,
}),
+ hint: Property.MarkDown({
+ value: 'Empty fields keep their current value.',
+ variant: MarkdownVariant.INFO,
+ }),
title: Property.ShortText({
- displayName: 'Title of the event',
+ displayName: 'Title',
required: false,
}),
start_date_time: Property.DateTime({
- displayName: 'Start date time of the event',
+ displayName: 'Start Time',
required: false,
}),
end_date_time: Property.DateTime({
- displayName: 'End date time of the event',
+ displayName: 'End Time',
required: false,
}),
location: Property.ShortText({
@@ -28,30 +33,18 @@ export const updateEventProps = {
}),
description: Property.LongText({
displayName: 'Description',
- description: 'Description of the event. You can use HTML tags here.',
+ description: 'HTML tags are allowed.',
required: false,
}),
- colorId: googleCalendarCommon.colorId,
+ colorId: googleCalendarCommon.colorId(),
attendees: Property.Array({
displayName: 'Attendees',
- description: 'Emails of the attendees (guests)',
- required: false,
- }),
- guests_can_modify: Property.Checkbox({
- displayName: 'Guests can modify',
- defaultValue: false,
- required: false,
- }),
- guests_can_invite_others: Property.Checkbox({
- displayName: 'Guests can invite others',
- defaultValue: false,
- required: false,
- }),
- guests_can_see_other_guests: Property.Checkbox({
- displayName: 'Guests can see other guests',
- defaultValue: false,
+ description: 'Replaces the current guest list. One email per item.',
required: false,
}),
+ guests_can_modify: guestPermission('Guests Can Modify'),
+ guests_can_invite_others: guestPermission('Guests Can Invite Others'),
+ guests_can_see_other_guests: guestPermission('Guests Can See Other Guests'),
};
export async function runUpdateEvent(
@@ -83,42 +76,39 @@ export async function runUpdateEvent(
eventId: eventId,
});
- let attendeeFormattedList: calendar_v3.Schema$EventAttendee[] = [];
- if (Array.isArray(attendees) && attendees.length > 0) {
- attendeeFormattedList = attendees.map((email) => ({ email }));
- } else if (
- currentEvent.data.attendees &&
- Array.isArray(currentEvent.data.attendees)
- ) {
- attendeeFormattedList = currentEvent.data.attendees;
- }
+ const overrides: calendar_v3.Schema$Event = {
+ ...(title !== undefined && { summary: title }),
+ ...(description !== undefined && { description }),
+ ...(location !== undefined && { location }),
+ ...(colorId !== undefined && { colorId }),
+ ...(Array.isArray(attendees) &&
+ attendees.length > 0 && {
+ attendees: attendees.map((email) => ({ email })),
+ }),
+ ...(start_date_time !== undefined && {
+ start: toEventDateTime({ value: start_date_time, current: currentEvent.data.start }),
+ }),
+ ...(end_date_time !== undefined && {
+ end: toEventDateTime({ value: end_date_time, current: currentEvent.data.end }),
+ }),
+ ...(typeof guests_can_invite_others === 'boolean' && {
+ guestsCanInviteOthers: guests_can_invite_others,
+ }),
+ ...(typeof guests_can_modify === 'boolean' && {
+ guestsCanModify: guests_can_modify,
+ }),
+ ...(typeof guests_can_see_other_guests === 'boolean' && {
+ guestsCanSeeOtherGuests: guests_can_see_other_guests,
+ }),
+ };
const response = await calendar.events.update({
calendarId: calendar_id,
eventId: eventId,
+ conferenceDataVersion: 1,
requestBody: {
- summary: title ?? currentEvent.data.summary,
- attendees: attendeeFormattedList,
- description: description ?? currentEvent.data.description,
- colorId: colorId,
- location: location ?? currentEvent.data.location,
- start: start_date_time
- ? {
- dateTime: dayjs(start_date_time).format(
- 'YYYY-MM-DDTHH:mm:ss.sssZ'
- ),
- }
- : currentEvent.data.start,
- end: end_date_time
- ? {
- dateTime: dayjs(end_date_time).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
- }
- : currentEvent.data.end,
- guestsCanInviteOthers:
- guests_can_invite_others ?? currentEvent.data.guestsCanInviteOthers,
- guestsCanModify: guests_can_modify ?? currentEvent.data.guestsCanModify,
- guestsCanSeeOtherGuests:
- guests_can_see_other_guests ?? currentEvent.data.guestsCanSeeOtherGuests,
+ ...currentEvent.data,
+ ...overrides,
},
});
@@ -130,10 +120,38 @@ export const updateEventAction = createAction({
auth: googleCalendarAuth,
name: 'update_event',
classification: 'WRITE',
- description: 'Updates an event in Google Calendar.',
+ description: 'Updates an existing event; empty fields keep their value.',
audience: 'human',
aiMetadata: { description: 'Updates the fields of an existing Google Calendar event identified by calendar and event ID (title, times, location, description, color, attendees, guest permissions); unset fields retain their current values. Use to modify or reschedule an event that already exists rather than creating a new one. Requires the event ID. Idempotent: applying the same field values repeatedly leaves the event in the same state.', idempotent: true },
props: updateEventProps,
outputSchema: eventOutputSchema,
run: runUpdateEvent,
});
+
+function guestPermission(displayName: string) {
+ return Property.StaticDropdown<boolean>({
+ displayName,
+ required: false,
+ options: {
+ disabled: false,
+ placeholder: 'Keep current setting',
+ options: [
+ { label: 'Yes', value: true },
+ { label: 'No', value: false },
+ ],
+ },
+ });
+}
+
+function toEventDateTime({
+ value,
+ current,
+}: {
+ value: string;
+ current: calendar_v3.Schema$EventDateTime | undefined;
+}): calendar_v3.Schema$EventDateTime {
+ return {
+ dateTime: dayjs(value).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
+ ...(current?.timeZone && { timeZone: current.timeZone }),
+ };
+}
diff --git a/packages/pieces/community/google-calendar/src/lib/auth.ts b/packages/pieces/community/google-calendar/src/lib/auth.ts
index 78b8e8a4716..4b2a3a4fbf5 100644
--- a/packages/pieces/community/google-calendar/src/lib/auth.ts
+++ b/packages/pieces/community/google-calendar/src/lib/auth.ts
@@ -19,17 +19,18 @@ export const googleCalendarAuth = [PieceAuth.OAuth2({
scope: googleCalendarScopes,
}), PieceAuth.CustomAuth({
displayName: 'Service Account (Advanced)',
- description: 'Authenticate via service account from https://console.cloud.google.com/ > IAM & Admin > Service Accounts > Create Service Account > Keys > Add key. <br> <br> You can optionally use domain-wide delegation (https://support.google.com/a/answer/162106?hl=en#zippy=%2Cset-up-domain-wide-delegation-for-a-client) to access calendars without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to calendars you explicitly share with it.',
+ description: 'Create a key under [Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts): **Keys** > **Add key** > **JSON**.\n\nShare each calendar with the service account email, or set up [domain-wide delegation](https://support.google.com/a/answer/162106) and fill **User Email** to act as that user.',
required: true,
props: {
- serviceAccount: Property.ShortText({
+ serviceAccount: Property.LongText({
displayName: 'Service Account JSON Key',
+ description: 'Paste the whole JSON key file.',
required: true,
}),
userEmail: Property.ShortText({
displayName: 'User Email',
required: false,
- description: 'Email address of the user to impersonate for domain-wide delegation.',
+ description: 'Needed only with domain-wide delegation.',
}),
},
validate: async ({ auth }) => {
diff --git a/packages/pieces/community/google-calendar/src/lib/common/helper.ts b/packages/pieces/community/google-calendar/src/lib/common/helper.ts
index 5906509bd91..a1bc4ae0cbc 100644
--- a/packages/pieces/community/google-calendar/src/lib/common/helper.ts
+++ b/packages/pieces/community/google-calendar/src/lib/common/helper.ts
@@ -243,10 +243,9 @@ export async function getEvents(
export async function getLatestEvent(
calendarId: string,
authProp: GoogleCalendarAuthValue
-): Promise<GoogleCalendarEvent> {
+): Promise<GoogleCalendarEvent | null> {
const eventList = await getEvents(calendarId, false, authProp);
- const lastUpdatedEvent = eventList.pop()!; // You can retrieve the last updated event.
- return lastUpdatedEvent;
+ return eventList.length > 0 ? eventList[eventList.length - 1] : null;
}
export async function getEventsForDropdown(
diff --git a/packages/pieces/community/google-calendar/src/lib/common/index.ts b/packages/pieces/community/google-calendar/src/lib/common/index.ts
index abc7fed4dce..5c8ac37c435 100644
--- a/packages/pieces/community/google-calendar/src/lib/common/index.ts
+++ b/packages/pieces/community/google-calendar/src/lib/common/index.ts
@@ -16,7 +16,7 @@ export const googleCalendarCommon = {
if (!auth) {
return {
disabled: true,
- placeholder: 'Please connect your account first',
+ placeholder: 'Connect your Google account first',
options: [],
};
}
@@ -37,6 +37,7 @@ export const googleCalendarCommon = {
eventDropdown: (required = false) => {
return Property.Dropdown<string,boolean,typeof googleCalendarAuth>({
displayName: 'Event',
+ description: 'Upcoming events in the selected calendar.',
refreshers: ['calendar_id'],
required: required,
auth: googleCalendarAuth,
@@ -44,14 +45,14 @@ export const googleCalendarCommon = {
if (!auth) {
return {
disabled: true,
- placeholder: 'Please connect your account first',
+ placeholder: 'Connect your Google account first',
options: [],
};
}
if (!calendar_id) {
return {
disabled: true,
- placeholder: 'Please select a calendar first',
+ placeholder: 'Select a calendar first',
options: [],
};
}
@@ -67,29 +68,31 @@ export const googleCalendarCommon = {
},
});
},
- colorId: Property.Dropdown({
- auth: googleCalendarAuth,
- displayName: 'Color',
- refreshers: [],
- required: false,
- options: async ({ auth }) => {
- if (!auth) {
- return {
- disabled: true,
- placeholder: 'Please connect your account first',
- options: [],
- };
- }
- const response = await getColors(auth as GoogleCalendarAuthValue);
- return {
- disabled: false,
- options: Object.entries(response.event).map(([key, value]) => {
+ colorId: (description?: string) =>
+ Property.Dropdown({
+ auth: googleCalendarAuth,
+ displayName: 'Color',
+ description,
+ refreshers: [],
+ required: false,
+ options: async ({ auth }) => {
+ if (!auth) {
return {
- label: value.background,
- value: key,
+ disabled: true,
+ placeholder: 'Connect your Google account first',
+ options: [],
};
- }),
- };
- },
- }),
+ }
+ const response = await getColors(auth as GoogleCalendarAuthValue);
+ return {
+ disabled: false,
+ options: Object.entries(response.event).map(([key, value]) => {
+ return {
+ label: value.background,
+ value: key,
+ };
+ }),
+ };
+ },
+ }),
};
diff --git a/packages/pieces/community/google-calendar/src/lib/triggers/calendar-event.ts b/packages/pieces/community/google-calendar/src/lib/triggers/calendar-event.ts
index 3bc1def15d8..3ee83d2406d 100644
--- a/packages/pieces/community/google-calendar/src/lib/triggers/calendar-event.ts
+++ b/packages/pieces/community/google-calendar/src/lib/triggers/calendar-event.ts
@@ -9,7 +9,7 @@ import { eventOutputSchema } from '../output-schemas';
const polling: Polling<
AppConnectionValueForAuthProperty<typeof googleCalendarAuth>,
- { calendarId?: string; expandRecurringEvent: boolean }
+ { calendarId?: string; expandRecurringEvent?: boolean }
> = {
strategy: DedupeStrategy.TIMEBASED,
items: async ({ auth, propsValue: { calendarId, expandRecurringEvent }, lastFetchEpochMS }) => {
@@ -24,7 +24,7 @@ const polling: Polling<
}
const currentValues: GoogleCalendarEvent[] =
- (await getEvents(calendarId!, expandRecurringEvent, auth, minUpdated)) ?? [];
+ (await getEvents(calendarId!, expandRecurringEvent ?? false, auth, minUpdated)) ?? [];
const items = currentValues.map((item) => ({
epochMilliSeconds: new Date(item.updated).getTime(),
data: item,
@@ -46,9 +46,9 @@ export const calendarEventChanged = createTrigger({
props: {
calendar_id: googleCalendarCommon.calendarDropdown(),
expandRecurringEvent: Property.Checkbox({
- displayName: 'Expand Recurring Event?',
- description: 'If true, the trigger will activate for every occurrence of a recurring event.',
- required: true,
+ displayName: 'Expand Recurring Events',
+ description: 'Fires once per occurrence of a recurring event.',
+ required: false,
defaultValue: false,
}),
},
diff --git a/packages/pieces/community/google-calendar/src/lib/triggers/event-cancelled.ts b/packages/pieces/community/google-calendar/src/lib/triggers/event-cancelled.ts
index 2acd11a0530..d5892669b51 100644
--- a/packages/pieces/community/google-calendar/src/lib/triggers/event-cancelled.ts
+++ b/packages/pieces/community/google-calendar/src/lib/triggers/event-cancelled.ts
@@ -137,16 +137,16 @@ export const eventCancelled = createTrigger({
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
specific_event: Property.Checkbox({
displayName: 'Target Specific Event',
- description:
- 'Enable to monitor a specific event instead of all events in the calendar.',
+ description: 'Watch one event instead of the whole calendar.',
required: false,
defaultValue: false,
}),
event_id: googleCalendarCommon.eventDropdown(false),
cancellation_reason: Property.StaticMultiSelectDropdown({
displayName: 'Cancellation Reasons',
- description: 'Filter by specific types of cancellations (optional)',
+ description: 'Leave empty to fire on every cancellation.',
required: false,
+ advanced: true,
options: {
options: [
{ label: 'Event Deleted', value: 'deleted' },
diff --git a/packages/pieces/community/google-calendar/src/lib/triggers/event-ends.ts b/packages/pieces/community/google-calendar/src/lib/triggers/event-ends.ts
index 7875643bbb9..89d584a9444 100644
--- a/packages/pieces/community/google-calendar/src/lib/triggers/event-ends.ts
+++ b/packages/pieces/community/google-calendar/src/lib/triggers/event-ends.ts
@@ -133,8 +133,7 @@ export const eventEnds = createTrigger({
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
specific_event: Property.Checkbox({
displayName: 'Target Specific Event',
- description:
- 'Enable to monitor a specific event instead of all events in the calendar.',
+ description: 'Watch one event instead of the whole calendar.',
required: false,
defaultValue: false,
}),
diff --git a/packages/pieces/community/google-calendar/src/lib/triggers/event-start-time-before.ts b/packages/pieces/community/google-calendar/src/lib/triggers/event-start-time-before.ts
index 79e15830f1f..6a3319f33a8 100644
--- a/packages/pieces/community/google-calendar/src/lib/triggers/event-start-time-before.ts
+++ b/packages/pieces/community/google-calendar/src/lib/triggers/event-start-time-before.ts
@@ -142,20 +142,20 @@ export const eventStartTimeBefore = createTrigger({
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
specific_event: Property.Checkbox({
displayName: 'Target Specific Event',
- description:
- 'Enable to monitor a specific event instead of all events in the calendar.',
+ description: 'Watch one event instead of the whole calendar.',
required: false,
defaultValue: false,
}),
event_id: googleCalendarCommon.eventDropdown(false),
time_value: Property.Number({
displayName: 'Time Before',
- description: 'The amount of time before the event starts.',
+ description: 'How long before the event starts to fire.',
required: true,
defaultValue: 15,
}),
time_unit: Property.StaticDropdown({
displayName: 'Time Unit',
+ description: 'Unit for Time Before.',
required: true,
options: {
options: [
diff --git a/packages/pieces/community/google-calendar/src/lib/triggers/new-calendar.ts b/packages/pieces/community/google-calendar/src/lib/triggers/new-calendar.ts
index 752b8149536..e6f20cafdbd 100644
--- a/packages/pieces/community/google-calendar/src/lib/triggers/new-calendar.ts
+++ b/packages/pieces/community/google-calendar/src/lib/triggers/new-calendar.ts
@@ -91,8 +91,7 @@ export const newCalendar = createTrigger({
props: {
access_role_filter: Property.StaticMultiSelectDropdown({
displayName: 'Access Role Filter',
- description:
- 'Only trigger for calendars with specific access roles (optional)',
+ description: 'Leave empty to fire for every access role.',
required: false,
options: {
options: [
@@ -105,13 +104,12 @@ export const newCalendar = createTrigger({
}),
calendar_name_filter: Property.ShortText({
displayName: 'Calendar Name Filter',
- description:
- 'Only trigger for calendars containing this text in name or description (optional)',
+ description: 'Only calendars whose name or description contain this.',
required: false,
}),
exclude_shared: Property.Checkbox({
displayName: 'Exclude Shared Calendars',
- description: 'Only trigger for calendars you own, not shared calendars',
+ description: 'Fires only for calendars you own.',
required: false,
defaultValue: false,
}),
diff --git a/packages/pieces/community/google-calendar/src/lib/triggers/new-event-matching-search.ts b/packages/pieces/community/google-calendar/src/lib/triggers/new-event-matching-search.ts
index 6ea2a090aaa..65766841183 100644
--- a/packages/pieces/community/google-calendar/src/lib/triggers/new-event-matching-search.ts
+++ b/packages/pieces/community/google-calendar/src/lib/triggers/new-event-matching-search.ts
@@ -55,19 +55,16 @@ const polling: Polling<
q: search_term,
};
+ let url = `${googleCalendarCommon.baseUrl}/calendars/${calendar_id}/events`;
if (event_types && event_types.length > 0) {
- event_types.forEach((type) => {
- if (!queryParams.eventTypes) {
- queryParams.eventTypes = type;
- } else {
- queryParams.eventTypes += '&eventTypes=' + type;
- }
- });
+ url += `?${event_types
+ .map((type) => `eventTypes=${encodeURIComponent(type)}`)
+ .join('&')}`;
}
const request: HttpRequest = {
method: HttpMethod.GET,
- url: `${googleCalendarCommon.baseUrl}/calendars/${calendar_id}/events`,
+ url,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: await getAccessToken(auth),
@@ -147,18 +144,18 @@ export const newEventMatchingSearch = createTrigger({
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
search_term: Property.ShortText({
displayName: 'Search Term',
- description:
- 'The keyword(s) to search for in new events (searches across title, description, location, and attendees by default).',
+ description: 'Matched against title, description, location and guests.',
required: true,
}),
event_types: Property.StaticMultiSelectDropdown({
displayName: 'Event Types',
- description: 'Filter by specific event types (optional)',
+ description: 'Leave empty to include every type.',
required: false,
+ advanced: true,
options: {
options: [
- { label: 'Default Events', value: 'default' },
- { label: 'Birthday Events', value: 'birthday' },
+ { label: 'Default', value: 'default' },
+ { label: 'Birthday', value: 'birthday' },
{ label: 'Focus Time', value: 'focusTime' },
{ label: 'Out of Office', value: 'outOfOffice' },
{ label: 'Working Location', value: 'workingLocation' },
@@ -167,10 +164,10 @@ export const newEventMatchingSearch = createTrigger({
},
}),
search_fields: Property.StaticMultiSelectDropdown({
- displayName: 'Search In Fields',
- description:
- "Specify which fields to search in (leave empty to use Google's default search across all fields)",
+ displayName: 'Search In',
+ description: 'Leave empty to search every field.',
required: false,
+ advanced: true,
options: {
options: [
{ label: 'Event Title/Summary', value: 'summary' },
diff --git a/packages/pieces/community/google-calendar/src/lib/triggers/new-event.ts b/packages/pieces/community/google-calendar/src/lib/triggers/new-event.ts
index 7e33421c309..3ed6fed90c6 100644
--- a/packages/pieces/community/google-calendar/src/lib/triggers/new-event.ts
+++ b/packages/pieces/community/google-calendar/src/lib/triggers/new-event.ts
@@ -80,14 +80,14 @@ export const newEvent = createTrigger({
props: {
calendar_id: googleCalendarCommon.calendarDropdown('writer'),
event_types: Property.StaticMultiSelectDropdown({
- displayName: 'Event Types to Monitor',
- description:
- 'Filter by specific event types (leave empty to monitor all event types)',
+ displayName: 'Event Types',
+ description: 'Leave empty to include every type.',
required: false,
+ advanced: true,
options: {
options: [
- { label: 'Default Events', value: 'default' },
- { label: 'Birthday Events', value: 'birthday' },
+ { label: 'Default', value: 'default' },
+ { label: 'Birthday', value: 'birthday' },
{ label: 'Focus Time', value: 'focusTime' },
{ label: 'Out of Office', value: 'outOfOffice' },
{ label: 'Working Location', value: 'workingLocation' },
@@ -98,13 +98,15 @@ export const newEvent = createTrigger({
search_filter: Property.ShortText({
displayName: 'Search Filter',
description:
- 'Only trigger for events containing this text in title, description, or location (optional)',
+ 'Only events whose title, description or location contain this.',
required: false,
+ advanced: true,
}),
exclude_all_day: Property.Checkbox({
displayName: 'Exclude All-Day Events',
- description: 'Skip triggering for all-day events',
+ description: 'Skips all-day events.',
required: false,
+ advanced: true,
defaultValue: false,
}),
},
@@ -272,7 +274,7 @@ export const newEvent = createTrigger({
auth
);
- if (!matchesFilters(latestEvent, filters)) {
+ if (isNil(latestEvent) || !matchesFilters(latestEvent, filters)) {
return [];
}
diff --git a/packages/pieces/community/google-calendar/test/update-event.test.ts b/packages/pieces/community/google-calendar/test/update-event.test.ts
new file mode 100644
index 00000000000..1fc172222f7
--- /dev/null
+++ b/packages/pieces/community/google-calendar/test/update-event.test.ts
@@ -0,0 +1,270 @@
+/// <reference types="vitest/globals" />
+
+import { createMockActionContext } from '@activepieces/pieces-framework';
+import { calendar_v3 } from '@googleapis/calendar';
+
+const getMock = vi.fn();
+const updateMock = vi.fn();
+
+vi.mock('@googleapis/calendar', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('@googleapis/calendar')>();
+ return {
+ ...actual,
+ calendar: () => ({
+ events: {
+ get: getMock,
+ update: updateMock,
+ },
+ }),
+ };
+});
+
+vi.mock('../src/lib/auth', () => ({
+ googleCalendarAuth: {},
+ googleCalendarScopes: [],
+ createGoogleClient: vi.fn().mockResolvedValue({}),
+ getAccessToken: vi.fn().mockResolvedValue('an-access-token'),
+}));
+
+import { runUpdateEvent } from '../src/lib/actions/update-event.action';
+
+type UpdateEventContext = Parameters<typeof runUpdateEvent>[0];
+
+const timedEvent: calendar_v3.Schema$Event = {
+ id: 'timed-event-id',
+ status: 'confirmed',
+ summary: 'Weekly Engineering Sync',
+ description: 'Agenda in the doc.',
+ location: 'Room 4',
+ colorId: '5',
+ start: { dateTime: '2026-09-14T10:00:00+03:00', timeZone: 'Asia/Amman' },
+ end: { dateTime: '2026-09-14T11:00:00+03:00', timeZone: 'Asia/Amman' },
+ recurrence: ['RRULE:FREQ=WEEKLY;BYDAY=MO'],
+ attendees: [
+ { email: '[email protected]', responseStatus: 'accepted' },
+ { email: '[email protected]', responseStatus: 'needsAction' },
+ ],
+ guestsCanModify: true,
+ guestsCanInviteOthers: true,
+ guestsCanSeeOtherGuests: true,
+ transparency: 'transparent',
+ visibility: 'private',
+ reminders: {
+ useDefault: false,
+ overrides: [
+ { method: 'popup', minutes: 25 },
+ { method: 'email', minutes: 120 },
+ ],
+ },
+ extendedProperties: {
+ private: { crmDealId: 'DEAL-8842' },
+ shared: { teamTag: 'platform' },
+ },
+ attachments: [
+ { fileUrl: 'https://drive.google.com/file/d/1abc/view', title: 'Notes.pdf', fileId: '1abc' },
+ ],
+ conferenceData: {
+ conferenceId: 'abc-defg-hij',
+ entryPoints: [{ entryPointType: 'video', uri: 'https://meet.google.com/abc-defg-hij' }],
+ },
+};
+
+const allDayEvent: calendar_v3.Schema$Event = {
+ id: 'all-day-event-id',
+ summary: 'Company Offsite',
+ start: { date: '2026-10-05' },
+ end: { date: '2026-10-07' },
+ recurrence: ['RRULE:FREQ=YEARLY'],
+ reminders: { useDefault: false, overrides: [{ method: 'email', minutes: 1440 }] },
+};
+
+const seriesInstance: calendar_v3.Schema$Event = {
+ ...timedEvent,
+ id: 'timed-event-id_20260921T070000Z',
+ recurringEventId: 'timed-event-id',
+ originalStartTime: { dateTime: '2026-09-21T10:00:00+03:00', timeZone: 'Asia/Amman' },
+ recurrence: undefined,
+};
+
+const CHECKBOX_DEFAULTS = {
+ guests_can_modify: false,
+ guests_can_invite_others: false,
+ guests_can_see_other_guests: false,
+};
+
+const AI_GUEST_PROPS_UNSET = {
+ guests_can_modify: undefined,
+ guests_can_invite_others: undefined,
+ guests_can_see_other_guests: undefined,
+};
+
+function buildContext(propsValue: Record<string, unknown>): UpdateEventContext {
+ return createMockActionContext({
+ propsValue: {
+ calendar_id: 'primary',
+ eventId: 'timed-event-id',
+ ...propsValue,
+ },
+ }) as unknown as UpdateEventContext;
+}
+
+async function updateWith({
+ currentEvent,
+ propsValue,
+}: {
+ currentEvent: calendar_v3.Schema$Event;
+ propsValue: Record<string, unknown>;
+}): Promise<calendar_v3.Schema$Event> {
+ getMock.mockResolvedValue({ data: structuredClone(currentEvent) });
+ updateMock.mockClear();
+ updateMock.mockImplementation(async ({ requestBody }) => ({ data: requestBody }));
+ await runUpdateEvent(buildContext(propsValue));
+ return updateMock.mock.calls[0][0].requestBody;
+}
+
+beforeEach(() => {
+ getMock.mockReset();
+ updateMock.mockReset();
+});
+
+describe('runUpdateEvent request body', () => {
+ test('a title-only update preserves every field the action does not expose', async () => {
+ const body = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { title: 'Renamed', ...CHECKBOX_DEFAULTS },
+ });
+
+ expect(body.summary).toBe('Renamed');
+ expect(body.recurrence).toEqual(['RRULE:FREQ=WEEKLY;BYDAY=MO']);
+ expect(body.reminders).toEqual(timedEvent.reminders);
+ expect(body.transparency).toBe('transparent');
+ expect(body.visibility).toBe('private');
+ expect(body.extendedProperties).toEqual(timedEvent.extendedProperties);
+ expect(body.attachments).toEqual(timedEvent.attachments);
+ expect(body.conferenceData).toEqual(timedEvent.conferenceData);
+ expect(body.colorId).toBe('5');
+ expect(body.attendees).toEqual(timedEvent.attendees);
+ });
+
+ test('an update with no fields set is a no-op on the stored event', async () => {
+ const body = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { ...AI_GUEST_PROPS_UNSET },
+ });
+
+ expect(body).toEqual(timedEvent);
+ });
+
+ test('an unset optional prop contributes no key, so it cannot clear the field', async () => {
+ const body = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { title: 'Renamed', ...AI_GUEST_PROPS_UNSET },
+ });
+
+ expect('colorId' in body).toBe(true);
+ expect(body.colorId).toBe('5');
+ expect(Object.values(body).every((value) => value !== undefined)).toBe(true);
+ });
+
+ test('an explicitly supplied colorId is applied', async () => {
+ const body = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { colorId: '11', ...CHECKBOX_DEFAULTS },
+ });
+
+ expect(body.colorId).toBe('11');
+ expect(body.recurrence).toEqual(['RRULE:FREQ=WEEKLY;BYDAY=MO']);
+ });
+
+ test('a reschedule keeps the timezone the event was pinned to', async () => {
+ const body = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: {
+ start_date_time: '2026-09-14T14:00:00+03:00',
+ end_date_time: '2026-09-14T15:00:00+03:00',
+ ...CHECKBOX_DEFAULTS,
+ },
+ });
+
+ expect(body.start?.timeZone).toBe('Asia/Amman');
+ expect(body.end?.timeZone).toBe('Asia/Amman');
+ expect(body.recurrence).toEqual(['RRULE:FREQ=WEEKLY;BYDAY=MO']);
+ });
+
+ test('setting only the start leaves the end untouched', async () => {
+ const body = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { start_date_time: '2026-09-14T16:00:00+03:00', ...AI_GUEST_PROPS_UNSET },
+ });
+
+ expect(body.end).toEqual(timedEvent.end);
+ });
+
+ test('an all-day event stays all-day', async () => {
+ const body = await updateWith({
+ currentEvent: allDayEvent,
+ propsValue: { title: 'Company Offsite 2026', ...CHECKBOX_DEFAULTS },
+ });
+
+ expect(body.start).toEqual({ date: '2026-10-05' });
+ expect(body.end).toEqual({ date: '2026-10-07' });
+ expect(body.start?.dateTime).toBeUndefined();
+ expect(body.recurrence).toEqual(['RRULE:FREQ=YEARLY']);
+ });
+
+ test('updating one occurrence keeps its link back to the series', async () => {
+ const body = await updateWith({
+ currentEvent: seriesInstance,
+ propsValue: { title: 'This week only', ...CHECKBOX_DEFAULTS },
+ });
+
+ expect(body.recurringEventId).toBe('timed-event-id');
+ expect(body.originalStartTime).toEqual(seriesInstance.originalStartTime);
+ });
+
+ test('supplied attendees replace the list, and an empty list keeps it', async () => {
+ const replaced = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { attendees: ['[email protected]'], ...CHECKBOX_DEFAULTS },
+ });
+ expect(replaced.attendees).toEqual([{ email: '[email protected]' }]);
+
+ const kept = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { attendees: [], ...CHECKBOX_DEFAULTS },
+ });
+ expect(kept.attendees).toEqual(timedEvent.attendees);
+ });
+
+ test('guest permissions left empty in the builder are kept', async () => {
+ const body = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: {
+ title: 'Renamed',
+ guests_can_modify: null,
+ guests_can_invite_others: null,
+ guests_can_see_other_guests: null,
+ },
+ });
+ expect(body.guestsCanModify).toBe(true);
+ expect(body.guestsCanInviteOthers).toBe(true);
+ expect(body.guestsCanSeeOtherGuests).toBe(true);
+ });
+
+ test('guest permissions are kept when unset and applied when given', async () => {
+ const unset = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { title: 'Renamed by agent', ...AI_GUEST_PROPS_UNSET },
+ });
+ expect(unset.guestsCanModify).toBe(true);
+ expect(unset.guestsCanInviteOthers).toBe(true);
+ expect(unset.guestsCanSeeOtherGuests).toBe(true);
+
+ const given = await updateWith({
+ currentEvent: timedEvent,
+ propsValue: { ...AI_GUEST_PROPS_UNSET, guests_can_modify: false },
+ });
+ expect(given.guestsCanModify).toBe(false);
+ expect(given.guestsCanInviteOthers).toBe(true);
+ });
+});