Edits history of script submission #45 for ' Update Event (gcal)'

  • deno
    type Gcal = {
      token: string;
    };
    export async function main(
      gcal_auth: Gcal,
      calendarId: string,
      eventId: string,
      start_date?: string,
      end_date?: string,
      description?: string,
      summary: string,
      location?: string,
      attendees?: Array<object>,
    ) {
      const alwaysIncludeEmail = true;
      const sendUpdates = "all";
      const supportsAttachments = true;
      const UPDATE_EVENT_URL = `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?alwaysIncludeEmail=${alwaysIncludeEmail}&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(UPDATE_EVENT_URL, {
        method: "PUT",
        body: JSON.stringify(body),
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }
    

    Submitted by hugo697 398 days ago

  • deno
    type Gcal = {
      token: string;
    };
    export async function main(
      gcal_auth: Gcal,
      calendarId: string,
      eventId: string,
      start_date?: string,
      end_date?: string,
      description?: string,
      summary: string,
      location?: string,
      attendees?: Array<object>,
    ) {
      const alwaysIncludeEmail = true;
      const sendUpdates = "all";
      const supportsAttachments = true;
      const UPDATE_EVENT_URL = `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?alwaysIncludeEmail=${alwaysIncludeEmail}&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(UPDATE_EVENT_URL, {
        method: "PUT",
        body: JSON.stringify(body),
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }
    

    Submitted by admin 1031 days ago

  • deno
    
    type Gcal = {
      token: string;
    };
    export async function main(
      gcal_auth: Gcal,
      calendarId: string,
      eventId: string,
      start_date?: string,
      end_date?: string,
      description?: string,
      summary: string,
      location?: string,
      attendees?: Array<object>,
    ) {
      const alwaysIncludeEmail = true;
      const sendUpdates = "all";
      const supportsAttachments = true;
      const UPDATE_EVENT_URL =
        `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?alwaysIncludeEmail=${alwaysIncludeEmail}&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(UPDATE_EVENT_URL, {
        method: "PUT",
        body: JSON.stringify(body),
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by admin 1034 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gcal_auth: wmill.Resource<"gcal">,
      calendarId: string,
      eventId: string,
      start_date?: string,
      end_date?: string,
      description?: string,
      summary: string,
      location?: string,
      attendees?: Array<object>,
    ) {
      const alwaysIncludeEmail = true;
      const sendUpdates = "all";
      const supportsAttachments = true;
      const UPDATE_EVENT_URL =
        `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?alwaysIncludeEmail=${alwaysIncludeEmail}&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(UPDATE_EVENT_URL, {
        method: "PUT",
        body: JSON.stringify(body),
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by adam186 1162 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gcal_auth: wmill.Resource<"gcal">,
      calendarId: string,
      eventId: string,
      start_date?: string,
      end_date?: string,
      description?: string,
      summary: string,
      location?: string,
      attendees?: Array<object>,
    ) {
      const alwaysIncludeEmail = true;
      const sendUpdates = "all";
      const supportsAttachments = true;
      const UPDATE_EVENT_URL =
        `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?alwaysIncludeEmail=${alwaysIncludeEmail}&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(UPDATE_EVENT_URL, {
        method: "PUT",
        body: JSON.stringify(body),
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by adam186 1197 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gcal_auth: wmill.Resource<"gcal">,
      calendarId: string,
      eventId: string,
      start_date?: string,
      end_date?: string,
      description?: string,
      summary: string,
      location?: string,
      attendees?: Array<object>,
    ) {
      const alwaysIncludeEmail = true;
      const sendUpdates = "all";
      const supportsAttachments = true;
      const UPDATE_EVENT_URL =
        `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?alwaysIncludeEmail=${alwaysIncludeEmail}&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(UPDATE_EVENT_URL, {
        method: "PUT",
        body: JSON.stringify(body),
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by rossmccrann 1414 days ago