type Gcal = {
token: string;
};
export async function main(
gcal_auth: Gcal,
calendarId: string,
start_date?: string,
end_date?: string,
description?: string,
summary: string,
location?: string,
attendees?: Array<object>,
maxAttendees?: number = 2,
) {
const sendNotifications = true;
const sendUpdates = "all";
const supportsAttachments = true;
const CREATE_EVENT_URL = `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/?maxAttendees=${maxAttendees}&sendNotifications=${sendNotifications}&sendUpdates=${sendUpdates}&supportsAttachments${supportsAttachments}`;
const token = gcal_auth["token"];
const body = {
summary: summary,
description: description,
location: location,
end: {
date: end_date,
},
start: {
date: start_date,
},
attendees: attendees,
};
const response = await fetch(CREATE_EVENT_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by admin 466 days ago
type Gcal = {
token: string;
};
export async function main(
gcal_auth: Gcal,
calendarId: string,
start_date?: string,
end_date?: string,
description?: string,
summary: string,
location?: string,
attendees?: Array<object>,
maxAttendees?: number = 2,
) {
const sendNotifications = true;
const sendUpdates = "all";
const supportsAttachments = true;
const CREATE_EVENT_URL =
`https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/?maxAttendees=${maxAttendees}&sendNotifications=${sendNotifications}&sendUpdates=${sendUpdates}&supportsAttachments${supportsAttachments}`;
const token = gcal_auth["token"];
const body = {
"summary": summary,
"description": description,
"location": location,
"end": {
"date": end_date,
},
"start": {
"date": start_date,
},
"attendees": attendees,
};
const response = await fetch(CREATE_EVENT_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by admin 470 days ago
import * as wmill from "https://deno.land/x/windmill@v1.85.0/mod.ts";
export async function main(
gcal_auth: wmill.Resource<"gcal">,
calendarId: string,
start_date?: string,
end_date?: string,
description?: string,
summary: string,
location?: string,
attendees?: Array<object>,
maxAttendees?: number = 2,
) {
const sendNotifications = true;
const sendUpdates = "all";
const supportsAttachments = true;
const CREATE_EVENT_URL =
`https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/?maxAttendees=${maxAttendees}&sendNotifications=${sendNotifications}&sendUpdates=${sendUpdates}&supportsAttachments${supportsAttachments}`;
const token = gcal_auth["token"];
const body = {
"summary": summary,
"description": description,
"location": location,
"end": {
"date": end_date,
},
"start": {
"date": start_date,
},
"attendees": attendees,
};
const response = await fetch(CREATE_EVENT_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by adam186 598 days ago
import * as wmill from "https://deno.land/x/windmill@v1.70.1/mod.ts";
export async function main(
gcal_auth: wmill.Resource<"gcal">,
calendarId: string,
start_date?: string,
end_date?: string,
description?: string,
summary: string,
location?: string,
attendees?: Array<object>,
maxAttendees?: number = 2,
) {
const sendNotifications = true;
const sendUpdates = "all";
const supportsAttachments = true;
const CREATE_EVENT_URL =
`https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/?maxAttendees=${maxAttendees}&sendNotifications=${sendNotifications}&sendUpdates=${sendUpdates}&supportsAttachments${supportsAttachments}`;
const token = gcal_auth["token"];
const body = {
"summary": summary,
"description": description,
"location": location,
"end": {
"date": end_date,
},
"start": {
"date": start_date,
},
"attendees": attendees,
};
const response = await fetch(CREATE_EVENT_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by adam186 633 days ago
import * as wmill from "https://deno.land/x/windmill@v1.23.0/mod.ts";
export async function main(
gcal_auth: wmill.Resource<"gcal">,
calendarId: string,
start_date?: string,
end_date?: string,
description?: string,
summary: string,
location?: string,
attendees?: Array<object>,
maxAttendees?: number = 2,
) {
const sendNotifications = true;
const sendUpdates = "all";
const supportsAttachments = true;
const CREATE_EVENT_URL =
`https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/?maxAttendees=${maxAttendees}&sendNotifications=${sendNotifications}&sendUpdates=${sendUpdates}&supportsAttachments${supportsAttachments}`;
const token = gcal_auth["token"];
const body = {
"summary": summary,
"description": description,
"location": location,
"end": {
"date": end_date,
},
"start": {
"date": start_date,
},
"attendees": attendees,
};
const response = await fetch(CREATE_EVENT_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
const result = await response.json();
return result;
}
Submitted by rossmccrann 849 days ago