diff --git a/components/google_calendar/actions/create-event/create-event.mjs b/components/google_calendar/actions/create-event/create-event.mjs index 5933bb929408a..c47e639d8b457 100644 --- a/components/google_calendar/actions/create-event/create-event.mjs +++ b/components/google_calendar/actions/create-event/create-event.mjs @@ -1,11 +1,12 @@ import googleCalendar from "../../google_calendar.app.mjs"; import createEventCommon from "../common/create-event-common.mjs"; +import { v4 as uuidv4 } from "uuid"; export default { key: "google_calendar-create-event", name: "Create Event", description: "Create an event to the Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#insert)", - version: "0.1.6", + version: "0.1.7", type: "action", props: { googleCalendar, @@ -15,6 +16,12 @@ export default { "calendarId", ], }, + createMeetRoom: { + label: "Create Meet Room", + description: "Create a Google Meet room for this event.", + type: "boolean", + optional: true, + }, ...createEventCommon.props({ isUpdate: false, }), @@ -26,7 +33,7 @@ export default { const timeZone = this.getTimeZone(this.timeZone); const attendees = this.formatAttendees(this.attendees); - const response = await this.googleCalendar.createEvent({ + const data = { calendarId: this.calendarId, sendUpdates: this.sendUpdates, sendNotifications: this.sendNotifications, @@ -44,7 +51,21 @@ export default { }), attendees, }, - }); + }; + + if (this.createMeetRoom) { + data.conferenceDataVersion = 1; + data.resource.conferenceData = { + createRequest: { + requestId: uuidv4(), + conferenceSolutionKey: { + type: "hangoutsMeet", + }, + }, + }; + } + + const response = await this.googleCalendar.createEvent(data); $.export("$summary", `Successfully created event: "${response.id}"`); diff --git a/components/google_calendar/package.json b/components/google_calendar/package.json index 1b00f94ad8f5f..5747c92713505 100644 --- a/components/google_calendar/package.json +++ b/components/google_calendar/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/google_calendar", - "version": "0.3.15", + "version": "0.3.16", "description": "Pipedream Google_calendar Components", "main": "google_calendar.app.mjs", "keywords": [