0.7.1 • Published 5 years ago
simple-caldav v0.7.1
simple-caldav
caldav in JavaScript; made easy.
Note on Completeness
The caldav and ICS specifications are large. Additionally, I'm not sure I ever want to implement them completely. But I saw the need to a simple module that works with e.g. radicale and provides decent developer experience. simple-caldav is that attempt.
Installation
$ npm i --save simple-caldavUsage
const SimpleCalDAV = require("simple-caldav");
const URI = "https://example.com/cal/";
const dav = new SimpleCalDAV(URI, { credentials: "include", mode: "cors"});
const evt = dav.getEvent("abc")
.then(console.log)
.catch(console.log);For now, see tests.
Notes
- We translate a VEVENT's
STATUSin the whole library to the name_statusto make sure we're not violating any reserved words rules of JavaScript. - When initializing
new SimpleCalDAVfetchrequest options can be supplied on the second parameter (type object).
Usage and CORS
When using simple-caldav in combination with a remote server and CORS starts
to become an issue, make sure you allow the following CORS properties:
- methods that need to be allowed:
GET, POST, PUT, DELETE, REPORT, PROPFIND, OPTIONS - headers that need to be allowed:
Content-Type,If-None-Match,Depth
Contributing
$ git clone git@github.com:TimDaub/simple-caldav.git
$ cd simple-caldav && npm i
$ npm run testChangelog
0.7.1
- Bump a few dependencies' versions to fix vulnerabilities
0.7.0
- Instead of passing
fetch'scredentialsoption as"include"by default, it's now possible to addfetchrequest options when initializing theSimpleCalDAVclass. credentials: "include"aren't passed as default anymore.
0.6.0
- For all
fetchrequests, allow passing credentials by usingcredentials: true - Add note on CORS
0.5.0
- Remove
xpathandxmldomdependencies for smaller builds. - Remove
getETagsmethod.
0.4.6
- Add
static applyDuration(date, duration)that allows applying an specifically-shaped duration to a JavaScriptDate.
0.4.5
- Add VALUE=DATE-TIME to absolute-time trigger in VALARM.
- Add support for relative
triggers.
RELATED=syntax not yet supported.
0.4.4
- When updating an event, alarm's attendee would wrongly collect action
prefixes like
mailto:orsms:, e.g.mailto:mailto:mailto:email@examlple.com.
0.4.3
- Include
hrefto event when callinggetEventorlistEvents.
0.4.2
- Add
LOCATIONproperty to VEVENT. - Add
ORGANIZER;CN=:mailtoproperty to VEVENT.
0.4.1
- Fix UTC time zone shift calculation in
formatDateTime.
0.4.0
- Switched out moment.js with
date-fns. Breaking change is thatformatDateTimenow only acceptsDateobjects, or throws otherwise.
0.3.5
- Bug fix: When adding multiple alarms,
,BEGIN:VALARMwould show up in VEVENT text.
0.3.4
- Bug fix: When adding a status to an event, in its ical representation status
statement didn't add new
\nnew line instruction.
0.3.3
- Add static
SimpleCalDAV.extractUid(href)method.
0.3.2
- Add
_statusproperty to event.
0.3.1
- Bug fix:
syncCollectionwasn't able to detect a single VEVENT deletion event and simply returned an empty array.
0.3.0
- Bug fix: Stop attempting to parse relative-time VALARMS, as ical.js isn't capable of doing that either. Relative-time VALARMS are now ignored instead. Previously they threw.
0.2.2
- Bug fix: Ensure correct order of
etagandhrefproperties returned fromsyncCollection.
0.2.1
- Introduce new method for retrieving single events with
uid:getEvent(uid). - Parse and include
VALARMs ingetEventandlistEvents.
0.2.0
- Removed
TraversalErrorfrom code base entirely. listEventsnow returns an empty array when no events are found or an invalid xml gets passed.- Instead of throwing
TraversalError,SimpleCalDAV.traverseXMLnow returns an empty array when path couldn't be found. - Added
getSyncTokenmethod to retrieve a sync token from a server. - Added
syncCollectionto receive a diff of an entire collection with a sync token. - Added
ServerErrorthat is thrown when there are problems with the server.
0.1.3
- Fix bug in VALARM construction.
0.1.2
- Fix bug in VEVENT construction.
0.1.1
- Allow adding VALARMS to VEVENTS.
0.1.0
- Transform ical.js events to simple JSON objects and all customizable
transformation parameter on
listEventsmethod.
0.0.1
- Initial release.
License
References
0.7.1
5 years ago
0.4.7
5 years ago
0.8.0
5 years ago
0.7.0
5 years ago
0.6.0
5 years ago
0.5.0
5 years ago
0.4.6
5 years ago
0.4.5
5 years ago
0.4.4
5 years ago
0.4.3
5 years ago
0.4.2
5 years ago
0.4.1
5 years ago
0.4.0
5 years ago
0.3.5
5 years ago
0.3.4
5 years ago
0.3.3
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.2.2
5 years ago
0.1.2
5 years ago
0.1.3
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago
0.0.1
5 years ago