{"record":{"id":"90037cdca76fa2d6","repo":"calcom/cal.diy","slug":"action-is-currently-only-available-for-google-c","errorCode":null,"errorMessage":"${action} is currently only available for Google Calendar. Office 365 and Apple support is coming soon.","messagePattern":"(.+?) is currently only available for Google Calendar\\. Office 365 and Apple support is coming soon\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"warning","filePath":"apps/api/v2/src/modules/cal-unified-calendars/services/unified-calendar.service.ts","lineNumber":55,"sourceCode":"  [OFFICE_365_CALENDAR_TYPE]: OFFICE_365_CALENDAR,\n  [APPLE_CALENDAR_TYPE]: APPLE_CALENDAR,\n};\n\n@Injectable()\nexport class UnifiedCalendarService {\n  private readonly pipe = new GoogleCalendarEventOutputPipe();\n\n  constructor(\n    private readonly googleCalendarService: GoogleCalendarService,\n    private readonly freebusyService: UnifiedCalendarsFreebusyService,\n    private readonly calendarsService: CalendarsService\n  ) {}\n\n  // ─── Strategy: validate calendar type ──────────────────────────────────\n\n  private ensureGoogleCalendar(calendar: string, action: string): void {\n    if (calendar !== GOOGLE_CALENDAR) {\n      throw new BadRequestException(\n        `${action} is currently only available for Google Calendar. Office 365 and Apple support is coming soon.`\n      );\n    }\n  }\n\n  private transformEvent(event: GoogleCalendarEventResponse) {\n    return this.pipe.transform(event);\n  }\n\n  private transformEvents(events: GoogleCalendarEventResponse[]) {\n    return events.map((e) => this.pipe.transform(e));\n  }\n\n  // ─── Connections ───────────────────────────────────────────────────────\n\n  async getConnections(\n    userId: number\n  ): Promise<Array<{ connectionId: string; type: \"google\" | \"office365\" | \"apple\"; email: string | null }>> {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/modules/cal-unified-calendars/services/unified-calendar.service.ts#L37-L73","documentation":"Thrown by UnifiedCalendarService.ensureGoogleCalendar when the calendar type slug passed to a unified-calendar endpoint is not exactly the GOOGLE_CALENDAR constant. The message interpolates the action name (e.g. 'Meeting details', 'Create event', 'List events') so the caller knows which operation was blocked. Returns HTTP 400. This is the strategy gate that limits the unified API to Google until Office 365/Apple are implemented.","triggerScenarios":"Calling any user-scoped unified-calendar endpoint with calendar=office_365_calendar or calendar=apple_calendar — getEventDetails, updateEventDetails, listEvents, createEvent, deleteEvent, getFreeBusy all invoke ensureGoogleCalendar first.","commonSituations":"Frontend uses the same UI for all calendar types but only Google is wired; an integration selects the user's default calendar type without checking it's Google; typo in the calendar slug (e.g. 'google' instead of the constant value).","solutions":["Gate UI affordances on calendar type: only show event-create/edit/list for google_calendar connections.","Verify the calendar slug matches the exact value of GOOGLE_CALENDAR from @calcom/platform-constants (import the constant, do not hardcode).","For non-Google calendars, return a friendly 'unsupported provider' state from your integration layer rather than calling the API.","Track provider support rollout and update the gate once Office 365/Apple endpoints land."],"exampleFix":"// before\nimport { GOOGLE_CALENDAR, OFFICE_365_CALENDAR } from '@calcom/platform-constants';\nawait api.listEvents(OFFICE_365_CALENDAR, userId, calId, t0, t1);\n\n// after\nimport { GOOGLE_CALENDAR } from '@calcom/platform-constants';\nif (calendar !== GOOGLE_CALENDAR) {\n  return { status: 'unsupported_provider', provider: calendar };\n}\nawait api.listEvents(GOOGLE_CALENDAR, userId, calId, t0, t1);","handlingStrategy":"type-guard","validationCode":"import { GOOGLE_CALENDAR } from '@calcom/platform-constants';\n\nfunction ensureGoogleCalendar(calendar: string, action: string): void {\n  if (calendar !== GOOGLE_CALENDAR) {\n    throw new Error(`${action} unsupported for ${calendar}; supported: ${GOOGLE_CALENDAR}`);\n  }\n}\n\nensureGoogleCalendar(req.body.calendar, 'Create event');","typeGuard":"import { GOOGLE_CALENDAR } from '@calcom/platform-constants';\n\nfunction isSupportedCalendar(calendar: string): calendar is typeof GOOGLE_CALENDAR {\n  return calendar === GOOGLE_CALENDAR;\n}","tryCatchPattern":"try {\n  await unifiedCalendarService.listEvents(calendar, userId, calId, t0, t1);\n} catch (e) {\n  if (e instanceof BadRequestException && /only available for Google Calendar/.test(e.message)) {\n    return res.status(400).json({ code: 'unsupported_provider', supported: ['google_calendar'] });\n  }\n  throw e;\n}","preventionTips":["Import the GOOGLE_CALENDAR constant; never hardcode the slug string.","Gating UI affordances by provider capability prevents the request from ever being made.","Track provider rollout and update the guard in lock-step when Office 365/Apple ship."],"tags":["google-calendar","office365","apple-calendar","validation","nestjs","provider","unified-calendar"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}