summaryrefslogtreecommitdiffstats
path: root/js/dav
diff options
context:
space:
mode:
authorHendrik Leppelsack <hendrik@leppelsack.de>2016-02-18 16:33:26 +0100
committerHendrik Leppelsack <hendrik@leppelsack.de>2016-02-18 16:39:26 +0100
commit43462d3fc447ac8d843e98e9dc596e21302b1353 (patch)
tree7fae6fd90d269d4c101715d5f36bb844ab0f0a06 /js/dav
parent5b452bc093ebaca4dd95955bd47417d187968352 (diff)
integrate dav library instead of loading via bower
Diffstat (limited to 'js/dav')
-rw-r--r--js/dav/.bower.json12
-rw-r--r--js/dav/.gitignore8
-rw-r--r--js/dav/.npmignore11
-rw-r--r--js/dav/.travis.yml12
-rw-r--r--js/dav/CONTRIBUTING.md57
-rw-r--r--js/dav/HISTORY.md271
-rw-r--r--js/dav/LICENSE363
-rw-r--r--js/dav/Makefile60
-rw-r--r--js/dav/README.md467
-rw-r--r--js/dav/dav.js7323
-rw-r--r--js/dav/lib/accounts.js178
-rw-r--r--js/dav/lib/calendars.js274
-rw-r--r--js/dav/lib/camelize.js11
-rw-r--r--js/dav/lib/client.js115
-rw-r--r--js/dav/lib/contacts.js291
-rw-r--r--js/dav/lib/debug.js7
-rw-r--r--js/dav/lib/fuzzy_url_equals.js10
-rw-r--r--js/dav/lib/index.js14
-rw-r--r--js/dav/lib/model.js106
-rw-r--r--js/dav/lib/namespace.js4
-rw-r--r--js/dav/lib/parser.js160
-rw-r--r--js/dav/lib/polyfill/array_find.js25
-rw-r--r--js/dav/lib/polyfill/object_assign.js35
-rw-r--r--js/dav/lib/polyfill/regenerator_runtime.js564
-rw-r--r--js/dav/lib/request.js233
-rw-r--r--js/dav/lib/sandbox.js34
-rw-r--r--js/dav/lib/template/address_book_query.js16
-rw-r--r--js/dav/lib/template/calendar_query.js16
-rw-r--r--js/dav/lib/template/filter.js20
-rw-r--r--js/dav/lib/template/index.js6
-rw-r--r--js/dav/lib/template/mkcol.js14
-rw-r--r--js/dav/lib/template/prop.js65
-rw-r--r--js/dav/lib/template/propfind.js12
-rw-r--r--js/dav/lib/template/proppatch.js14
-rw-r--r--js/dav/lib/template/sync_collection.js13
-rw-r--r--js/dav/lib/transport.js185
-rw-r--r--js/dav/lib/webdav.js117
-rw-r--r--js/dav/lib/xmlhttprequest.js98
-rw-r--r--js/dav/package.json43
-rw-r--r--js/dav/test/integration/accounts_test.js177
-rw-r--r--js/dav/test/integration/calendars_test.js239
-rw-r--r--js/dav/test/integration/contacts_test.js219
-rw-r--r--js/dav/test/integration/data/bastille_day_party.ics12
-rw-r--r--js/dav/test/integration/data/forrest_gump.vcf16
-rw-r--r--js/dav/test/integration/data/index.js17
-rw-r--r--js/dav/test/integration/server/bootstrap.js105
-rw-r--r--js/dav/test/integration/server/calendarserver.php82
-rw-r--r--js/dav/test/integration/version_test.js10
-rw-r--r--js/dav/test/mocha.opts5
-rw-r--r--js/dav/test/unit/camelize_test.js23
-rw-r--r--js/dav/test/unit/client_test.js265
-rw-r--r--js/dav/test/unit/data/address_book_query.xml72
-rw-r--r--js/dav/test/unit/data/calendar_query.xml24
-rw-r--r--js/dav/test/unit/data/current_user_principal.xml13
-rw-r--r--js/dav/test/unit/data/index.js23
-rw-r--r--js/dav/test/unit/data/propfind.xml39
-rw-r--r--js/dav/test/unit/data/sync_collection.xml16
-rw-r--r--js/dav/test/unit/nock_wrapper.js47
-rw-r--r--js/dav/test/unit/parser_test.js66
-rw-r--r--js/dav/test/unit/request/address_book_query_test.js69
-rw-r--r--js/dav/test/unit/request/basic_test.js63
-rw-r--r--js/dav/test/unit/request/calendar_query_test.js107
-rw-r--r--js/dav/test/unit/request/propfind_test.js84
-rw-r--r--js/dav/test/unit/request/sync_collection_test.js65
-rw-r--r--js/dav/test/unit/sandbox_test.js72
-rw-r--r--js/dav/test/unit/template_test.js69
-rw-r--r--js/dav/test/unit/transport_test.js256
-rw-r--r--js/dav/test/unit/xmlhttprequest_test.js81
68 files changed, 13600 insertions, 0 deletions
diff --git a/js/dav/.bower.json b/js/dav/.bower.json
new file mode 100644
index 00000000..acbb02d5
--- /dev/null
+++ b/js/dav/.bower.json
@@ -0,0 +1,12 @@
+{
+ "name": "dav",
+ "homepage": "https://github.com/irgendwie/dav",
+ "_release": "d33ecad1e6",
+ "_resolution": {
+ "type": "commit",
+ "commit": "d33ecad1e64202ec5b35b6911708d1253064b5a7"
+ },
+ "_source": "git@github.com:irgendwie/dav.git",
+ "_target": "d33ecad1e64202ec5b35b6911708d1253064b5a7",
+ "_originalSource": "git@github.com:irgendwie/dav.git"
+} \ No newline at end of file
diff --git a/js/dav/.gitignore b/js/dav/.gitignore
new file mode 100644
index 00000000..c54db2af
--- /dev/null
+++ b/js/dav/.gitignore
@@ -0,0 +1,8 @@
+SabreDAV/
+
+/*.zip
+/build/
+/coverage/
+/dav.js.map
+/dav.min.js
+/node_modules/
diff --git a/js/dav/.npmignore b/js/dav/.npmignore
new file mode 100644
index 00000000..b3d3f89d
--- /dev/null
+++ b/js/dav/.npmignore
@@ -0,0 +1,11 @@
+SabreDAV/
+
+/*.zip
+/coverage/
+/Makefile
+/.git
+/.gitignore
+/.jshintrc
+/.travis.yml
+/node_modules
+/test
diff --git a/js/dav/.travis.yml b/js/dav/.travis.yml
new file mode 100644
index 00000000..46b9de7e
--- /dev/null
+++ b/js/dav/.travis.yml
@@ -0,0 +1,12 @@
+# This is a bit weird since this is really a js project,
+# but since we're using sabredav for integration testing
+# and since travis doesn't support multiple languages
+# and since travis additionally always installs a base node.js,
+# the easiest thing to do is pretend to be php.
+language: php
+php:
+ - "5.4"
+before_install:
+ - "nvm install iojs-v1.8.1"
+install: npm install
+script: npm test
diff --git a/js/dav/CONTRIBUTING.md b/js/dav/CONTRIBUTING.md
new file mode 100644
index 00000000..6bd75da0
--- /dev/null
+++ b/js/dav/CONTRIBUTING.md
@@ -0,0 +1,57 @@
+# Contributing
+
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
+
+- [Under the hood](#under-the-hood)
+- [Running the tests](#running-the-tests)
+- [Publishing a release](#publishing-a-release)
+- [Related Material](#related-material)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+### Under the hood
+
+dav uses npm to manage external dependencies. External npm modules get bundled into the browser js binary with the (excellent) [browserify](http://browserify.org/) utility. dav uses the `DOMParser` and `XMLHttpRequest` web apis (to parse xml and send http requests). All of the async library operations use es6 [Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise).
+
+### Running the tests
+
+```
+///////////////////////////////////////
+/ suite / command /
+///////////////////////////////////////
+/ integration / make test-integration /
+///////////////////////////////////////
+/ lint / make lint /
+///////////////////////////////////////
+/ unit / make test-unit /
+///////////////////////////////////////
+```
+
+Things to note:
+
++ As of 1.1.1, all of the tests run dav via nodejs. There are no browser tests (yet).
++ You can add helpful debug logs to test output with the `DEBUG` environment variable.
+ + Filter logs by setting `DEBUG=dav:*`, `DEBUG=dav:request:*`, etc.
++ Integration tests run against [sabredav](http://sabre.io/)
+ + The server code lives [here](https://github.com/gaye/dav/blob/master/test/integration/server/calendarserver.php)
+ + There is a make task which downloads a sabredav release from GitHub that `make test-integration` depends on
+ + The sabredav instance uses sqlite to store dav collections and objects among other things.
+ + The code that seeds the database lives [here](https://github.com/gaye/dav/blob/master/test/integration/server/bootstrap.js)
+
+### Publishing a release
+
+1. Update `package.json` to reflect the new version. Use [semver](http://semver.org/) to help decide what new version number is best.
+2. If there are changes to the public api, document them in the README. Then regenerate the `README.md` table of contents with `make toc`.
+3. Add a new entry to `HISTORY.md` with the new version number and a description of the changeset. Regenerate the `HISTORY.md` table of contents with `make toc`.
+4. Commit the changes to `package.json`, `HISTORY.md`, and (perhaps) `README.md`. Push to GitHub.
+5. Run `make && npm publish`.
+6. Create a new GitHub release named `v.{MAJOR}.{MINOR}.{PATCH}` with a description of the changeset. Upload the freshly generated zipball `dav.zip`.
+
+### Related Material
+
++ [Amazing webdav docs](http://sabre.io/dav/)
++ [RFC 4791](http://tools.ietf.org/html/rfc4791)
++ [RFC 5545](http://tools.ietf.org/html/rfc5545)
++ [RFC 6352](http://tools.ietf.org/html/rfc6352)
diff --git a/js/dav/HISTORY.md b/js/dav/HISTORY.md
new file mode 100644
index 00000000..310d4f97
--- /dev/null
+++ b/js/dav/HISTORY.md
@@ -0,0 +1,271 @@
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
+
+- [1.7.8](#178)
+- [1.7.7](#177)
+- [1.7.6](#176)
+- [1.7.5](#175)
+- [1.7.4](#174)
+- [1.7.3](#173)
+- [1.7.2](#172)
+- [1.7.0](#170)
+- [1.6.5](#165)
+- [1.6.4](#164)
+- [1.6.3](#163)
+- [1.6.2](#162)
+- [1.6.1](#161)
+- [1.6.0](#160)
+- [1.5.5](#155)
+- [1.5.4](#154)
+- [1.5.3](#153)
+- [1.5.2](#152)
+- [1.5.1](#151)
+- [1.5.0](#150)
+- [1.4.1](#141)
+- [1.4.0](#140)
+- [1.3.0](#130)
+- [1.2.0](#120)
+- [1.1.2](#112)
+- [1.1.1](#111)
+- [1.1.0](#110)
+- [1.0.4](#104)
+- [1.0.3](#103)
+- [1.0.2](#102)
+- [1.0.1](#101)
+- [1.0.0](#100)
+- [0.11.0](#0110)
+- [0.10.1](#0101)
+- [0.10.0](#0100)
+- [0.9.3](#093)
+- [0.9.2](#092)
+- [0.9.1](#091)
+- [0.9.0](#090)
+- [0.8.0](#080)
+- [0.7.1](#071)
+- [0.7.0](#070)
+- [0.6.0](#060)
+- [0.5.0](#050)
+- [0.4.0](#040)
+- [0.3.1](#031)
+- [0.3.0](#030)
+- [0.2.0](#020)
+- [0.1.0](#010)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
+### 1.7.8
+
++ `listCalendars` passes through all calendars that contain iCalendar
+ objects and not just `VEVENT`s.
+
+### 1.7.7
+
++ Parser processes href and currentUserPrincipal elements
+
+### 1.7.6
+
++ Bundle `regeneratorRuntime` and polyfills for `Array.prototype.find`
+ and `Object.assign` so that consumers don't need babel polyfill.
+
+### 1.7.5
+
++ Trimmed the binary size to 128k minified
++ Remove babel polyfill
++ Remove handlebars
+
+### 1.7.4
+
++ Precompile handlebars templates
++ Use custom debug module
+
+### 1.7.3
+
++ Google CardDAV wasn't working due to a few issues like our url
+ comparison, Google requiring at least one filter for an addressbook
+ query, and Google sometimes returning propstats with statuses but no
+ props.
+
+### 1.7.2
+
++ Fix outstanding nodejs compatibility issues
++ Expose dav.version
+
+### 1.7.0
+
++ Remove lodash, json-stringify-safe, don't expose jsonify
+
+### 1.6.5
+
++ Add brfs as a dependency so that downstream consumers can browserify us
+
+### 1.6.4
+
++ Workaround https://github.com/substack/brfs/issues/39
+
+### 1.6.3
+
++ Convert to use new es6/7 features and transpile with babel
+
+### 1.6.2
+
++ Export debug library under dav ns
+
+### 1.6.1
+
++ Don't bundle xmlhttprequest polyfill in browser binary... again
+
+### 1.6.0
+
++ Add #syncCaldavAccount and #syncCarddavAccount to the public api
++ Expose dav.jsonify and dav.ns
++ Small correctness fix to error case in basic calendar sync
+
+### 1.5.5
+
++ Bundle XMLHttpRequest polyfill for environments where it's not available
+
+### 1.5.4
+
++ Fix browser globals
+
+### 1.5.3
+
++ Don't use window in web workers
+
+### 1.5.2
+
++ Use xmldom in the browser since it's missing from web workers
+
+### 1.5.1
+
++ Expose dav browserify configuration to npm consumers
+
+### 1.5.0
+
++ Decouple requests from the urls they get sent to
+
+### 1.4.1
+
++ Add missing use strict statement to lib/index.js
+
+### 1.4.0
+
++ New sandbox interface
+
+### 1.3.0
+
++ Expose dav.Model, dav.Request, dav.Transport
+
+### 1.2.0
+
++ Implement client#send
+
+### 1.1.2
+
++ Trick browserify into not bundling node shims for web apis
+
+### 1.1.1
+
++ %s/toString/jsonify/ for models
+
+### 1.1.0
+
++ Support for rfc 6352 carddav
+
+### 1.0.4
+
++ Implement #toString on models
+
+### 1.0.3
+
++ Internal DELETE, PUT request refactor
+
+### 1.0.2
+
++ davinci -> dav
+
+### 1.0.1
+
++ Fix issues with browserify build
+
+### 1.0.0
+
++ Update interfaces for pluggable transports, expose transport layer
++ Support for oauth2 authentication
++ Clean up internal multistatus parser
+
+### 0.11.0
+
++ Support for rfc 6578 webdav sync
+
+### 0.10.1
+
++ Set request depth to 0 in the "getctag" propfind issued during sync
+
+### 0.10.0
+
++ Implement time-range filters for calendar queries
+
+### 0.9.3
+
++ Remove dependencies on ical.js and underscore
+
+### 0.9.2
+
++ Fix npm package
++ Change npm name to davincijs
+
+### 0.9.1
+
++ remove nodejs polyfills for DOMParser and XMLHttpRequest from build output
++ generate minified binaries
+
+### 0.9.0
+
++ Implement davinci.Client interface
++ Add transport layer to decouple request details and sending
+
+### 0.8.0
+
++ Expose low-level request methods through davinci.request
++ Add hook to requests to override transformResponse
+
+### 0.7.1
+
++ Expose the underlying, xml parsed dav responses on davinci.Calendar and davinci.CalendarObject models.
+
+### 0.7.0
+
++ Support providing timezone option to #createAccount and #syncCalendar
+
+### 0.6.0
+
++ #syncCalendar added to public api
++ The promise returned from #createAccount now resolves with a davinci.Account object instead of an array of davinci.Calendar objects.
+
+### 0.5.0
+
++ #deleteCalendarObject added to public api
+
+### 0.4.0
+
++ #updateCalendarObject added to public api
++ Internal api refactoring to expose Request objects
+
+### 0.3.1
+
++ Patch bug in build due to bug in brfs.
+
+### 0.3.0
+
++ #createCalendarObject modified to support sandboxing.
+
+### 0.2.0
+
++ #createCalendarObject added to public api
+
+### 0.1.0
+
++ #createAccount added to public api
++ #createSandbox added to public api
diff --git a/js/dav/LICENSE b/js/dav/LICENSE
new file mode 100644
index 00000000..e87a115e
--- /dev/null
+++ b/js/dav/LICENSE
@@ -0,0 +1,363 @@
+Mozilla Public License, version 2.0
+
+1. Definitions
+
+1.1. "Contributor"
+
+ means each individual or legal entity that creates, contributes to the
+ creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+
+ means the combination of the Contributions of others (if any) used by a
+ Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+
+ means Source Code Form to which the initial Contributor has attached the
+ notice in Exhibit A, the Executable Form of such Source Code Form, and
+ Modifications of such Source Code Form, in each case including portions
+ thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ a. that the initial Contributor has attached the notice described in
+ Exhibit B to the Covered Software; or
+
+ b. that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the terms of
+ a Secondary License.
+
+1.6. "Executable Form"
+
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+
+ means a work that combines Covered Software with other material, in a
+ separate file or files, that is not Covered Software.
+
+1.8. "License"
+
+ means this document.
+
+1.9. "Licensable"
+
+ means having the right to grant, to the maximum extent possible, whether
+ at the time of the initial grant or subsequently, any and all of the
+ rights conveyed by this License.
+
+1.10. "Modifications"
+
+ means any of the following:
+
+ a. any file in Source Code Form that results from an addition to,
+ deletion fro