Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-google-calendar-api

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-google-calendar-api - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

140

dist/ApiCalendar.js

@@ -1,2 +0,1 @@

"use strict";
var __defProp = Object.defineProperty;

@@ -36,22 +35,2 @@ var __defProps = Object.defineProperties;

var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};

@@ -93,5 +72,2 @@ // src/ApiCalendar.ts

}
/**
* Auth to the google Api.
*/
initGapiClient() {

@@ -110,6 +86,2 @@ gapi.client.init({

}
/**
* Init Google Api
* And create gapi in global
*/
handleClientLoad() {

@@ -129,4 +101,4 @@ const scriptGoogle = document.createElement("script");

};
scriptGoogle.onload = () => __async(this, null, function* () {
this.tokenClient = yield google.accounts.oauth2.initTokenClient({
scriptGoogle.onload = async () => {
this.tokenClient = await google.accounts.oauth2.initTokenClient({
client_id: this.config.clientId,

@@ -138,7 +110,4 @@ scope: this.config.scope,

});
});
};
}
/**
* Sign in Google user account
*/
handleAuthClick() {

@@ -158,13 +127,5 @@ if (gapi && this.tokenClient) {

}
/**
* Set the default attribute calendar
* @param {string} newCalendar
*/
setCalendar(newCalendar) {
this.calendar = newCalendar;
}
/**
* Execute the callback function when gapi is loaded
* @param callback
*/
onLoad(callback) {

@@ -177,5 +138,2 @@ if (gapi) {

}
/**
* Sign out user google account
*/
handleSignoutClick() {

@@ -194,8 +152,2 @@ if (gapi) {

}
/**
* List all events in the calendar
* @param {number} maxResults to see
* @param {string} calendarId to see by default use the calendar attribute
* @returns {any}
*/
listUpcomingEvents(maxResults, calendarId = this.calendar) {

@@ -205,3 +157,3 @@ if (gapi) {

calendarId,
timeMin: (/* @__PURE__ */ new Date()).toISOString(),
timeMin: new Date().toISOString(),
showDeleted: false,

@@ -217,9 +169,2 @@ singleEvents: true,

}
/**
* List all events in the calendar queried by custom query options
* See all available options here https://developers.google.com/calendar/v3/reference/events/list
* @param {object} queryOptions to see
* @param {string} calendarId to see by default use the calendar attribute
* @returns {any}
*/
listEvents(queryOptions, calendarId = this.calendar) {

@@ -235,11 +180,2 @@ if (gapi) {

}
/**
* Create an event from the current time for a certain period
* @param {number} time in minutes for the event
* @param {string} summary of the event
* @param {string} description of the event
* @param {string} calendarId
* @param {string} timeZone The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".)
* @returns {any}
*/
createEventFromNow({ time, summary, description = "" }, calendarId = this.calendar, timeZone = "Europe/Paris") {

@@ -250,7 +186,7 @@ const event = {

start: {
dateTime: (/* @__PURE__ */ new Date()).toISOString(),
dateTime: new Date().toISOString(),
timeZone
},
end: {
dateTime: new Date((/* @__PURE__ */ new Date()).getTime() + time * 6e4).toISOString(),
dateTime: new Date(new Date().getTime() + time * 6e4).toISOString(),
timeZone

@@ -261,9 +197,2 @@ }

}
/**
* Create Calendar event
* @param {string} calendarId for the event.
* @param {object} event with start and end dateTime
* @param {string} sendUpdates Acceptable values are: "all", "externalOnly", "none"
* @returns {any}
*/
createEvent(event, calendarId = this.calendar, sendUpdates = "none") {

@@ -274,3 +203,2 @@ if (gapi.client.getToken()) {

resource: event,
//@ts-ignore the @types/gapi.calendar package is not up to date(https://developers.google.com/calendar/api/v3/reference/events/insert)
sendUpdates,

@@ -284,31 +212,14 @@ conferenceDataVersion: 1

}
/**
* Create Calendar event with video conference
* @param {string} calendarId for the event.
* @param {object} event with start and end dateTime
* @param {string} sendUpdates Acceptable values are: "all", "externalOnly", "none"
* @returns {any}
*/
createEventWithVideoConference(event, calendarId = this.calendar, sendUpdates = "none") {
return this.createEvent(
__spreadProps(__spreadValues({}, event), {
conferenceData: {
createRequest: {
requestId: crypto.randomUUID(),
conferenceSolutionKey: {
type: "hangoutsMeet"
}
return this.createEvent(__spreadProps(__spreadValues({}, event), {
conferenceData: {
createRequest: {
requestId: crypto.randomUUID(),
conferenceSolutionKey: {
type: "hangoutsMeet"
}
}
}),
calendarId,
sendUpdates
);
}
}), calendarId, sendUpdates);
}
/**
* Delete an event in the calendar.
* @param {string} eventId of the event to delete.
* @param {string} calendarId where the event is.
* @returns {any} Promise resolved when the event is deleted.
*/
deleteEvent(eventId, calendarId = this.calendar) {

@@ -325,10 +236,2 @@ if (gapi) {

}
/**
* Update Calendar event
* @param {string} calendarId for the event.
* @param {string} eventId of the event.
* @param {object} event with details to update, e.g. summary
* @param {string} sendUpdates Acceptable values are: "all", "externalOnly", "none"
* @returns {any}
*/
updateEvent(event, eventId, calendarId = this.calendar, sendUpdates = "none") {

@@ -347,8 +250,2 @@ if (gapi) {

}
/**
* Get Calendar event
* @param {string} calendarId for the event.
* @param {string} eventId specifies individual event
* @returns {any}
*/
getEvent(eventId, calendarId = this.calendar) {

@@ -365,6 +262,2 @@ if (gapi) {

}
/**
* Get Calendar List
* @returns {any}
*/
listCalendars() {

@@ -378,7 +271,2 @@ if (gapi) {

}
/**
* Create Calendar
* @param {string} summary, title of the calendar.
* @returns {any}
*/
createCalendar(summary) {

@@ -385,0 +273,0 @@ if (gapi) {

2

package.json
{
"name": "react-google-calendar-api",
"version": "2.2.1",
"version": "2.2.2",
"description": "An api to manage your google calendar",

@@ -5,0 +5,0 @@ "main": "./dist/ApiCalendar.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc