chore: format calendar events to remove oauthClientIds (#21040)
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
"@axiomhq/winston": "^1.2.0",
|
||||
"@calcom/platform-constants": "*",
|
||||
"@calcom/platform-enums": "*",
|
||||
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.176",
|
||||
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.178",
|
||||
"@calcom/platform-libraries-0.0.2": "npm:@calcom/platform-libraries@0.0.2",
|
||||
"@calcom/platform-types": "*",
|
||||
"@calcom/platform-utils": "*",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user