diff --git a/index.ts b/index.ts index 5e54ad4..b587aa0 100755 --- a/index.ts +++ b/index.ts @@ -38,7 +38,10 @@ const syncCalendar = async (): Promise<{ timeMin: earliestDate.toISOString(), timeMax: latestDate.toISOString(), }); - const sourceEvents = sourceEventsResponse.data.items || []; + let sourceEvents: calendar_v3.Schema$Event[] = sourceEventsResponse.data.items || []; + + // Do not include events with transparency === transparent as they do not block the time + sourceEvents = sourceEvents.filter(t => !(t.transparency && t.transparency === 'transparent')); const targetEventsResponse = await calendar.events.list({ auth, @@ -134,7 +137,7 @@ const updateEvent = async (sourceEvent: calendar_v3.Schema$Event, sourceEventId: }); } -const getRequestBody = (sourceEvent: calendar_v3.Schema$Event, sourceEventId: string, configEntry: SourceTargetConfiguration) => { +const getRequestBody = (sourceEvent: calendar_v3.Schema$Event, sourceEventId: string, configEntry: SourceTargetConfiguration): calendar_v3.Schema$Event => { return { summary: 'Private event', description: `This is a private event synced by google-calendar-sync. diff --git a/package-lock.json b/package-lock.json index e64dd49..1973a6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cirqusde/google-calendar-sync", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@cirqusde/google-calendar-sync", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "dependencies": { "googleapis": "^100.0.0", diff --git a/package.json b/package.json index cd691a1..45836c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cirqusde/google-calendar-sync", - "version": "1.0.0", + "version": "1.0.1", "repository": "https://github.com/cirqusde/google-calendar-sync", "description": "Sync events from your private Google Calendar to your work Google calendar.", "author": "Simon Leiß",