chore: format calendar events to remove oauthClientIds (#21040)

This commit is contained in:
Morgan authored and GitHub committed 2025-04-30 16:01:34 +01:00
1 parent ab1c1bb015
commit 31b1f31d82
3 files changed
+8 -5

No files matched your search

@@ -8,6 +8,7 @@ import {
CalendarAppDelegationCredentialConfigurationError,
} from "@calcom/lib/CalendarAppError";
import { handleErrorsJson, handleErrorsRaw } from "@calcom/lib/errors";
import { formatCalEvent } from "@calcom/lib/formatCalendarEvent";
import logger from "@calcom/lib/logger";
import type { BufferedBusyTime } from "@calcom/types/BufferedBusyTime";
import type {
@@ -249,9 +250,10 @@ export default class Office365CalendarService implements Calendar {
? `${await this.getUserEndpoint()}/calendars/${mainHostDestinationCalendar?.externalId}/events`
: `${await this.getUserEndpoint()}/calendar/events`;
const formattedEvent = formatCalEvent(event);
const response = await this.fetcher(eventsUrl, {
method: "POST",
body: JSON.stringify(this.translateEvent(event)),
body: JSON.stringify(this.translateEvent(formattedEvent)),
});
const responseJson = await handleErrorsJson<NewCalendarEventType & { iCalUId: string }>(response);
+4 -3
View File
@@ -32,6 +32,7 @@ import type { CredentialPayload } from "@calcom/types/Credential";
import { getLocation, getRichDescription } from "./CalEventParser";
import { symmetricDecrypt } from "./crypto";
import { formatCalEvent } from "./formatCalendarEvent";
import logger from "./logger";
const TIMEZONE_FORMAT = "YYYY-MM-DDTHH:mm:ss[Z]";
@@ -139,10 +140,10 @@ export default abstract class BaseCalendarService implements Calendar {
return attendees;
}
async createEvent(event: CalendarEvent, credentialId: number): Promise<NewCalendarEventType> {
async createEvent(eventRaw: CalendarEvent, credentialId: number): Promise<NewCalendarEventType> {
try {
const calendars = await this.listCalendars(event);
const calendars = await this.listCalendars(eventRaw);
const event = formatCalEvent(eventRaw);
const uid = uuidv4();
// We create local ICS files