Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "addcal", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Open-source web application utility for adding calendar events via certain platform API's (Google, etc.)", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -15,4 +15,6 @@ # AddCal [![Build Status](https://travis-ci.org/daleyjem/addcal.svg?branch=master)](https://travis-ci.org/daleyjem/addcal) | ||
An example for Typescript... | ||
```js | ||
import AddCal from 'addcal'; | ||
import AddCal, {EventParams, generators} from 'addcal'; | ||
@@ -31,4 +33,15 @@ export class AppComponent { | ||
public click_addEvent(eventData){ | ||
this.addCal.addEvent('google', eventData) | ||
/** | ||
* Add event to an api service (google, etc.) | ||
*/ | ||
public click_addEvent(eventData, service /* 'google' */){ | ||
const params = new EventParams({ | ||
summary: eventData.summary, // 'Event Summary' | ||
description: eventData.description, // 'Event description.' | ||
start: eventData.start, // new Date() | ||
duration: eventDate.duration, // 60 minutes | ||
url: eventData.url // 'http://www.google.com' | ||
}); | ||
this.addCal.addEvent(service, params) | ||
.then(() => { | ||
@@ -42,4 +55,19 @@ console.log('The reminder was added!'); | ||
} | ||
/** | ||
* Download an .ics file | ||
*/ | ||
public click_downloadEvent(eventData, type /* 'ical' */){ | ||
const params = new EventParams({ | ||
summary: eventData.summary, // 'Event Summary' | ||
description: eventData.description, // 'Event description.' | ||
start: eventData.start, // new Date() | ||
duration: eventDate.duration, // 60 minutes | ||
url: eventData.url // 'http://www.google.com' | ||
}); | ||
this.addCal.download(type, params); // Or use `generators.ICALENDAR` for 'type' param | ||
} | ||
} | ||
``` |
@@ -86,4 +86,5 @@ import appConfig from './config'; | ||
export {default as EventParams} from './lib/models/event-params'; | ||
export const generators = { | ||
ICALENDAR: 'ical' | ||
}; |
@@ -18,3 +18,3 @@ import BaseCalendar from '../base-calendar'; | ||
* Adds an event to the user's Google calendar | ||
* @param {*} params Event params to add | ||
* @param {EventParams} params Event params to add | ||
* @todo Actually implement the `gapi` calendar `insert` method | ||
@@ -21,0 +21,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15585
71
0