Comments (3)
do you have any documentation how to run or how to integrate with already existing node application?
As far as i can tell this library does not run on pure node.js. I tried to write our Tests in jest first, but I ended up using karma, because we require certain browser APIs like DomParser
and XMLSerializer
, latter one having no decent polyfill on NPM.
then open the web browser on localhost:3000 and will see some client but nothing happens.
It seems like you are looking for some GUI? This is simply a library to access Nextcloud's CalDAV/CardDAV server, used by the Contacts app (and future versions of the Calendar / Tasks app).
Please take note that this library is meant to communicate with Nextcloud's CalDAV/CardDAV server. While it's simply CalDAV/CardDAV and should in theory work with other servers, we didn't test this against any other server than Nextcloud and don't accept issues for other servers. Pull-requests that fix compatibility with other servers are certainly welcome though :)
Edit: To answer your main question about docs: You can run npm run build-doc
to automatically generate documentation (as in API-reference) from source-code.
from cdav-library.
Hi George,
thanks fr answer, to be honest I seeking some first step for communication with nextcloud calendar via CalDAV. Just read/write/update the events for particular user.
I will go through yours test cases if there some for work with calendar.
any hint are welcomed
Best regards
Jan
from cdav-library.
Ah, in that case:
- First you need to create the DavClient object.
If you are running as a nextcloud app, you gotta hand over therequestToken
function xhrProvider() {
var headers = {
'X-Requested-With': 'XMLHttpRequest',
'requesttoken': OC.requestToken
}
var xhr = new XMLHttpRequest()
var oldOpen = xhr.open
// override open() method to add headers
xhr.open = function() {
var result = oldOpen.apply(this, arguments)
for (let name in headers) {
xhr.setRequestHeader(name, headers[name])
}
return result
}
OC.registerXHRForErrorProcessing(xhr)
return xhr
}
new DavClient({
rootUrl: OC.linkToRemote('dav')
}, xhrProvider)
If you don't run inside Nextcloud, you gotta do the authentication yourself.
- Start the client
await client.connect({enableCalDAV: true});
const calendars = await client.calendarHomes[0].findAllCalDAVCollections()
const events = await calendars[0].findAllVObjects()
console.log(events[0].data);
from cdav-library.
Related Issues (20)
- Allow us to provide custom props on findAllAndFilterBySimpleProperties HOT 1
- General-purpose WebDAV library HOT 6
- How to create Event? HOT 1
- Need Help in addressbookQuery HOT 2
- Use shared browserslist config
- add If-None-Match: * header for creating events / vcards
- Make requests cancellable
- [Enhancement] Documentation on use would be wonderfully useful HOT 2
- Make a proper module of it? HOT 2
- Cannot read property 'length' of undefined HOT 5
- Versioning and publishing HOT 4
- Allow to fetch user principal language
- Wrong Content-Type request header in PUT requests HOT 4
- `npm run build-doc` throws an error HOT 1
- Rename master branch to main HOT 2
- Installing this via npm broken by one of the newer commits HOT 2
- Migrate Request class to @nextcloud/axios
- npm package is outdated
- Where is the API? How do I use it? HOT 9
- propfind assumes DAV header always exists and causes null exception when missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdav-library.