import { GoogleCalendarIcon } from '@/components/icons' import type { TriggerConfig } from '@/triggers/types' export const googleCalendarPollingTrigger: TriggerConfig = { id: 'google_calendar_poller', name: 'Google Calendar Event Trigger', provider: 'google-calendar', description: 'Triggers when events are created, updated, or cancelled in Google Calendar', version: '1.0.0', icon: GoogleCalendarIcon, polling: true, subBlocks: [ { id: 'triggerCredentials', title: 'Credentials', type: 'oauth-input', description: 'Connect your Google account to access Google Calendar.', serviceId: 'google-calendar', requiredScopes: [], required: true, mode: 'trigger', canonicalParamId: 'oauthCredential', }, { id: 'calendarId', title: 'Calendar', type: 'file-selector', description: 'The calendar to monitor for event changes.', required: false, mode: 'trigger', canonicalParamId: 'calendarId', serviceId: 'google-calendar', selectorKey: 'google.calendar', selectorAllowSearch: false, dependsOn: ['triggerCredentials'], }, { id: 'manualCalendarId', title: 'Calendar ID', type: 'short-input', placeholder: 'Enter calendar ID (e.g., primary or calendar@gmail.com)', description: 'The calendar to monitor for event changes.', required: false, mode: 'trigger-advanced', canonicalParamId: 'calendarId', }, { id: 'eventTypeFilter', title: 'Event Type', type: 'dropdown', options: [ { id: '', label: 'All Events' }, { id: 'created', label: 'Created' }, { id: 'updated', label: 'Updated' }, { id: 'cancelled', label: 'Cancelled' }, ], defaultValue: '', description: 'Only trigger for specific event types. Defaults to all events.', required: false, mode: 'trigger', }, { id: 'searchTerm', title: 'Search Term', type: 'short-input', placeholder: 'e.g., team meeting, standup', description: 'Optional: Filter events by text match across title, description, location, and attendees.', required: false, mode: 'trigger', }, { id: 'triggerInstructions', title: 'Setup Instructions', hideFromPreview: true, type: 'text', defaultValue: [ 'Connect your Google account using OAuth credentials', 'Select the calendar to monitor (defaults to your primary calendar)', 'The system will automatically detect new, updated, and cancelled events', ] .map( (instruction, index) => `