8 |
13 |
14 |
15 | {{content}}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/docs/_layouts/guide.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: 2ColLeft
3 | ---
4 |
5 | {{ content }}
6 |
7 | {% assign guides = site.guides | sort: 'index' %}
8 | {% for guide in guides %}
9 | {% if page.title == guide.title %}
10 | {% assign prev = guide.index | minus: 2 %}
11 | {% assign next = guide.index %}
12 |
13 |
25 | {% endif %}
26 | {% endfor %}
27 |
--------------------------------------------------------------------------------
/docs/_layouts/post.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 |
6 |
7 | {% include post_details.html %}
8 |
9 | {{ content }}
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/_plugins/markdown.rb:
--------------------------------------------------------------------------------
1 | module Jekyll
2 | class MarkdownBlock < Liquid::Block
3 | def initialize(tag_name, text, tokens)
4 | super
5 | end
6 | require "kramdown"
7 | def render(context)
8 | content = super
9 | "#{Kramdown::Document.new(content).to_html}"
10 | end
11 | end
12 | end
13 | Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock)
--------------------------------------------------------------------------------
/docs/_posts/2014-08-16-pouchdb-3.0.1.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 |
4 | title: PouchDB 3.0.1
5 |
6 | author: Nolan Lawson
7 |
8 | ---
9 |
10 | [PouchDB 3.0.1](https://github.com/pouchdb/pouchdb/releases/tag/3.0.1) is a patch release to fix a migration bug in PouchDB 3.0.0 ([#2456](https://github.com/pouchdb/pouchdb/issues/2456)). Please upgrade your existing users directly from 2.2.3 and do not use 3.0.0.
11 |
12 | This release also contains a small performance boost for `bulkDocs()` ([#2553](https://github.com/pouchdb/pouchdb/issues/2553)).
--------------------------------------------------------------------------------
/docs/_posts/2014-08-20-pouchdb-3.0.2.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 |
4 | title: PouchDB 3.0.2
5 |
6 | author: Nolan Lawson
7 |
8 | ---
9 |
10 | [PouchDB 3.0.2](https://github.com/pouchdb/pouchdb/releases/tag/3.0.2) is another small patch release, this time to fix a bug in replication of deleted documents ([#2636](https://github.com/pouchdb/pouchdb/issues/2636)).
11 |
12 | Other fixes:
13 |
14 | * Ensure PouchDB stops writing after replication is over ([#2639](https://github.com/pouchdb/pouchdb/issues/2639))
15 | * Fix a race condition in LevelDB ([#2631](https://github.com/pouchdb/pouchdb/issues/2631))
16 | * Allow special URI characters in doc IDs ([#2651](https://github.com/pouchdb/pouchdb/issues/2651))
--------------------------------------------------------------------------------
/docs/_posts/2019-06-13-pouchdb-7.1.1.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 |
4 | title: PouchDB 7.1.1 - Bug fixes and dependency updates
5 | author: Garren Smith
6 |
7 | ---
8 |
9 | We have another PouchDB release. The main improvements in this release are bug fixes and dependency updates.
10 | For a full changelog from 7.0 to 7.1.1, please see [the releases page](https://github.com/pouchdb/pouchdb/releases) or view the [latest commits](https://github.com/pouchdb/pouchdb/compare/7.0.0...7.1.1).
11 |
12 |
13 | ## Get in touch
14 |
15 | As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to [file issues](https://github.com/pouchdb/pouchdb/issues) or [get in touch](https://github.com/pouchdb/pouchdb/blob/master/CONTRIBUTING.md#get-in-touch). And of course, a big thanks to all of our [new and existing contributors](https://github.com/pouchdb/pouchdb/graphs/contributors)!
16 |
17 | If you wondering where is 7.1.0, I had a slight publishing issue so the easiest was to bump it up to 7.1.1 to do a fresh deploy.
18 |
--------------------------------------------------------------------------------
/docs/blog/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | title: Blog
4 | edit: false
5 | ---
6 |
7 |
8 |
9 |
10 |
11 | {% for post in paginator.posts %}
12 |
13 |
{{ post.title }}
14 | {% include post_details.html %}
15 |
16 | {% endfor %}
17 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/docs/offline.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | title: Looks like you're offline...
4 | edit: false
5 | ---
6 |
7 |
8 |
9 | You need to be online to see this page, once you've seen it once it'll be available offline in the future!
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/static/assets/pouchdb-getting-started-todo.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/assets/pouchdb-getting-started-todo.zip
--------------------------------------------------------------------------------
/docs/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/favicon.ico
--------------------------------------------------------------------------------
/docs/static/img/HoodieLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/HoodieLogo.png
--------------------------------------------------------------------------------
/docs/static/img/TeamONE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/TeamONE.png
--------------------------------------------------------------------------------
/docs/static/img/apple-indexeddb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/apple-indexeddb.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/android_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/android_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/blackberry_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/blackberry_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/chrome-android_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/chrome-android_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/chrome_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/chrome_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/firefox_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/firefox_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/internet-explorer-tile_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/internet-explorer-tile_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/internet-explorer_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/internet-explorer_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/opera_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/opera_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/safari-ios_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/safari-ios_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/browser-logos/safari_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/browser-logos/safari_32x32.png
--------------------------------------------------------------------------------
/docs/static/img/cloudwall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/cloudwall.png
--------------------------------------------------------------------------------
/docs/static/img/cors_in_couchdb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/cors_in_couchdb.png
--------------------------------------------------------------------------------
/docs/static/img/cozy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/cozy.png
--------------------------------------------------------------------------------
/docs/static/img/debug_mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/debug_mode.png
--------------------------------------------------------------------------------
/docs/static/img/dev_tools.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/dev_tools.png
--------------------------------------------------------------------------------
/docs/static/img/ehealth_africa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/ehealth_africa.png
--------------------------------------------------------------------------------
/docs/static/img/fauxton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/fauxton.png
--------------------------------------------------------------------------------
/docs/static/img/fauxton_updated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/fauxton_updated.png
--------------------------------------------------------------------------------
/docs/static/img/friends/couchdb.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/static/img/friends/github.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/static/img/friends/leveldb.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/static/img/friends/saucelabs.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/docs/static/img/friends/twitter.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/static/img/gradepro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/gradepro.png
--------------------------------------------------------------------------------
/docs/static/img/index/learn.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/static/img/index/node.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/static/img/index/open.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/static/img/kittens.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/kittens.jpg
--------------------------------------------------------------------------------
/docs/static/img/kittens_small.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/kittens_small.jpg
--------------------------------------------------------------------------------
/docs/static/img/mbta_alerts.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/mbta_alerts.jpeg
--------------------------------------------------------------------------------
/docs/static/img/medic-mobile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/medic-mobile.png
--------------------------------------------------------------------------------
/docs/static/img/newt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/newt.png
--------------------------------------------------------------------------------
/docs/static/img/offline_replication.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/offline_replication.gif
--------------------------------------------------------------------------------
/docs/static/img/orson_welles_clapping.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/orson_welles_clapping.gif
--------------------------------------------------------------------------------
/docs/static/img/pepperidge_farm_remembers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/pepperidge_farm_remembers.png
--------------------------------------------------------------------------------
/docs/static/img/pokedexorg-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/pokedexorg-logo.png
--------------------------------------------------------------------------------
/docs/static/img/pouchdb_adapters.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/pouchdb_adapters.png
--------------------------------------------------------------------------------
/docs/static/img/prebuilt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/prebuilt.png
--------------------------------------------------------------------------------
/docs/static/img/safari_inspector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/safari_inspector.png
--------------------------------------------------------------------------------
/docs/static/img/safari_popup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/safari_popup.png
--------------------------------------------------------------------------------
/docs/static/img/screenshots/todo-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/screenshots/todo-1.png
--------------------------------------------------------------------------------
/docs/static/img/sonic_waiting.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/sonic_waiting.gif
--------------------------------------------------------------------------------
/docs/static/img/squarespace_blog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/squarespace_blog.png
--------------------------------------------------------------------------------
/docs/static/img/studymd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/studymd.png
--------------------------------------------------------------------------------
/docs/static/img/travis-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/travis-screenshot.png
--------------------------------------------------------------------------------
/docs/static/img/turtles_db.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/docs/static/img/turtles_db.png
--------------------------------------------------------------------------------
/docs/static/less/bootstrap/breadcrumbs.less:
--------------------------------------------------------------------------------
1 | //
2 | // Breadcrumbs
3 | // --------------------------------------------------
4 |
5 |
6 | .breadcrumb {
7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal;
8 | margin-bottom: @line-height-computed;
9 | list-style: none;
10 | background-color: @breadcrumb-bg;
11 | border-radius: @border-radius-base;
12 |
13 | > li {
14 | display: inline-block;
15 |
16 | + li:before {
17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space
18 | padding: 0 5px;
19 | color: @breadcrumb-color;
20 | }
21 | }
22 |
23 | > .active {
24 | color: @breadcrumb-active-color;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/docs/static/less/bootstrap/close.less:
--------------------------------------------------------------------------------
1 | //
2 | // Close icons
3 | // --------------------------------------------------
4 |
5 |
6 | .close {
7 | float: right;
8 | font-size: (@font-size-base * 1.5);
9 | font-weight: @close-font-weight;
10 | line-height: 1;
11 | color: @close-color;
12 | text-shadow: @close-text-shadow;
13 | .opacity(.2);
14 |
15 | &:hover,
16 | &:focus {
17 | color: @close-color;
18 | text-decoration: none;
19 | cursor: pointer;
20 | .opacity(.5);
21 | }
22 |
23 | // Additional properties for button version
24 | // iOS requires the button element instead of an anchor tag.
25 | // If you want the anchor version, it requires `href="#"`.
26 | button& {
27 | padding: 0;
28 | cursor: pointer;
29 | background: transparent;
30 | border: 0;
31 | -webkit-appearance: none;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/docs/static/less/bootstrap/component-animations.less:
--------------------------------------------------------------------------------
1 | //
2 | // Component animations
3 | // --------------------------------------------------
4 |
5 | // Heads up!
6 | //
7 | // We don't use the `.opacity()` mixin here since it causes a bug with text
8 | // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552.
9 |
10 | .fade {
11 | opacity: 0;
12 | .transition(opacity .15s linear);
13 | &.in {
14 | opacity: 1;
15 | }
16 | }
17 |
18 | .collapse {
19 | display: none;
20 | &.in {
21 | display: block;
22 | }
23 | }
24 | .collapsing {
25 | position: relative;
26 | height: 0;
27 | overflow: hidden;
28 | .transition(height .35s ease);
29 | }
30 |
--------------------------------------------------------------------------------
/docs/static/less/bootstrap/jumbotron.less:
--------------------------------------------------------------------------------
1 | //
2 | // Jumbotron
3 | // --------------------------------------------------
4 |
5 |
6 | .jumbotron {
7 | padding: @jumbotron-padding;
8 | margin-bottom: @jumbotron-padding;
9 | color: @jumbotron-color;
10 | background-color: @jumbotron-bg;
11 |
12 | h1,
13 | .h1 {
14 | color: @jumbotron-heading-color;
15 | }
16 | p {
17 | margin-bottom: (@jumbotron-padding / 2);
18 | font-size: @jumbotron-font-size;
19 | font-weight: 200;
20 | }
21 |
22 | .container & {
23 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container
24 | }
25 |
26 | .container {
27 | max-width: 100%;
28 | }
29 |
30 | @media screen and (min-width: @screen-sm-min) {
31 | padding-top: (@jumbotron-padding * 1.6);
32 | padding-bottom: (@jumbotron-padding * 1.6);
33 |
34 | .container & {
35 | padding-left: (@jumbotron-padding * 2);
36 | padding-right: (@jumbotron-padding * 2);
37 | }
38 |
39 | h1,
40 | .h1 {
41 | font-size: (@font-size-base * 4.5);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/docs/static/less/bootstrap/thumbnails.less:
--------------------------------------------------------------------------------
1 | //
2 | // Thumbnails
3 | // --------------------------------------------------
4 |
5 |
6 | // Mixin and adjust the regular image class
7 | .thumbnail {
8 | display: block;
9 | padding: @thumbnail-padding;
10 | margin-bottom: @line-height-computed;
11 | line-height: @line-height-base;
12 | background-color: @thumbnail-bg;
13 | border: 1px solid @thumbnail-border;
14 | border-radius: @thumbnail-border-radius;
15 | .transition(all .2s ease-in-out);
16 |
17 | > img,
18 | a > img {
19 | &:extend(.img-responsive);
20 | margin-left: auto;
21 | margin-right: auto;
22 | }
23 |
24 | // Add a hover state for linked versions only
25 | a&:hover,
26 | a&:focus,
27 | a&.active {
28 | border-color: @link-color;
29 | }
30 |
31 | // Image captions
32 | .caption {
33 | padding: @thumbnail-caption-padding;
34 | color: @thumbnail-caption-color;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/docs/static/less/bootstrap/utilities.less:
--------------------------------------------------------------------------------
1 | //
2 | // Utility classes
3 | // --------------------------------------------------
4 |
5 |
6 | // Floats
7 | // -------------------------
8 |
9 | .clearfix {
10 | .clearfix();
11 | }
12 | .center-block {
13 | .center-block();
14 | }
15 | .pull-right {
16 | float: right !important;
17 | }
18 | .pull-left {
19 | float: left !important;
20 | }
21 |
22 |
23 | // Toggling content
24 | // -------------------------
25 |
26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1
27 | .hide {
28 | display: none !important;
29 | }
30 | .show {
31 | display: block !important;
32 | }
33 | .invisible {
34 | visibility: hidden;
35 | }
36 | .text-hide {
37 | .text-hide();
38 | }
39 |
40 |
41 | // Hide from screenreaders and browsers
42 | //
43 | // Credit: HTML5 Boilerplate
44 |
45 | .hidden {
46 | display: none !important;
47 | visibility: hidden !important;
48 | }
49 |
50 |
51 | // For Affix plugin
52 | // -------------------------
53 |
54 | .affix {
55 | position: fixed;
56 | }
57 |
--------------------------------------------------------------------------------
/docs/static/less/bootstrap/wells.less:
--------------------------------------------------------------------------------
1 | //
2 | // Wells
3 | // --------------------------------------------------
4 |
5 |
6 | // Base class
7 | .well {
8 | min-height: 20px;
9 | padding: 19px;
10 | margin-bottom: 20px;
11 | background-color: @well-bg;
12 | border: 1px solid @well-border;
13 | border-radius: @border-radius-base;
14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
15 | blockquote {
16 | border-color: #ddd;
17 | border-color: rgba(0,0,0,.15);
18 | }
19 | }
20 |
21 | // Sizes
22 | .well-lg {
23 | padding: 24px;
24 | border-radius: @border-radius-large;
25 | }
26 | .well-sm {
27 | padding: 9px;
28 | border-radius: @border-radius-small;
29 | }
30 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/anchors.less:
--------------------------------------------------------------------------------
1 | .anchor {
2 | .h1 &,
3 | .h2 &,
4 | .h3 &,
5 | .h4 &,
6 | .h5 &,
7 | .h6 & {
8 | display: inline-block;
9 | text-decoration: none;
10 | color: @text-color;
11 | }
12 |
13 | &::before {
14 | content: '# ';
15 | opacity: .25;
16 | }
17 | &:focus { outline: none; }
18 | }
19 |
20 | .anchor-id {
21 | position: relative;
22 | top: -@spacing-base;
23 | }
24 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/band.less:
--------------------------------------------------------------------------------
1 | .band {
2 | padding-top: @spacing-base * 2;
3 | padding-bottom: @spacing-base * 2;
4 | border-bottom: 1px solid #ddd;
5 | }
6 |
7 | .band-inverse {
8 | background-color: @gray-lighter;
9 | }
10 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/block.less:
--------------------------------------------------------------------------------
1 | .block {
2 | @media (max-width: @screen-md-min) {
3 | > p {
4 | margin: 0 auto;
5 | max-width: 60%;
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/code.less:
--------------------------------------------------------------------------------
1 | @import "@{bootstrap}/code.less";
2 |
3 | code {
4 | white-space: normal;
5 | }
6 |
7 | pre {
8 | padding-left: @pre-padding;
9 | padding-right: @pre-padding;
10 | }
11 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/header.less:
--------------------------------------------------------------------------------
1 | header {
2 | overflow: hidden;
3 | position: relative;
4 | padding: (@spacing-base * 1.333333333) 0;
5 | border-bottom: 1px solid #ddd;
6 | background-color: @header-color;
7 | box-shadow: 0 .5rem .5rem -.5rem rgba(0, 0, 0, .15);
8 | }
9 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/icon-edit.less:
--------------------------------------------------------------------------------
1 | .icon-edit {
2 | display: inline-block;
3 | height: .75em;
4 | width: .75em;
5 | margin-left: .2em;
6 | background-size: 100%;
7 | background-image: url('../img/icon-edit.svg');
8 | }
9 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/icons.less:
--------------------------------------------------------------------------------
1 | .icon {
2 | display: block;
3 | margin: auto;
4 | margin-bottom: @spacing-base;
5 | height: 4rem;
6 | opacity: .75;
7 | &:hover { opacity: 1; }
8 | }
9 |
10 | .icon-lg {
11 | height: 8rem;
12 | }
13 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/mixins.less:
--------------------------------------------------------------------------------
1 | @import "@{bootstrap}/mixins.less";
2 |
3 | // Intrinsic Ratio Helper
4 | // https://github.com/nickcolley/intrinsic-ratio-less
5 |
6 |
7 | // Intrinsic ratio
8 | .ir(@ratio: 16/9, @width: 100%, @margin: auto) {
9 | position: relative;
10 | margin: @margin;
11 | width: unit(@width, ~'%');
12 | height: 0;
13 | padding-bottom: unit(@width / @ratio, ~'%');
14 | > iframe {
15 | position: absolute;
16 | width: 100%;
17 | height: 100%;
18 | border: 0;
19 | }
20 | }
21 |
22 | .iframe-responsive {
23 | .ir();
24 | margin-bottom: @spacing-base;
25 | }
26 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/post.less:
--------------------------------------------------------------------------------
1 | .post {
2 | margin-bottom: @spacing-base * 2;
3 | }
4 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/ribbon.less:
--------------------------------------------------------------------------------
1 | .ribbon {
2 | z-index: 1;
3 | position: absolute;
4 | top: 0; right: 0;
5 | padding: .1em 3em;
6 | border: 1px solid rgba(0,0,0,.1);
7 | background-color: @gray-lighter;
8 | color: @text-color;
9 | font-weight: bold;
10 | -webkit-transform: translateX(75%) rotate(45deg) translateX(-30%);
11 | transform: translateX(75%) rotate(45deg) translateX(-30%);
12 | -webkit-transform-origin: top left;
13 | transform-origin: top left;
14 | }
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/scaffolding.less:
--------------------------------------------------------------------------------
1 | @import "@{bootstrap}/scaffolding.less";
2 |
3 | blockquote {
4 | font-size: 1.1em;
5 | border-left-color: #ddf3e7;
6 | cite { font-size: 1.2em; }
7 | }
8 |
9 | // Temporary fix for Jekyll's P tags all over the place. :/
10 | p:empty { display: none; }
11 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/type.less:
--------------------------------------------------------------------------------
1 | @import "@{bootstrap}/type.less";
2 |
3 | h1, h2, h3, h4, h5, h6,
4 | .h1, .h2, .h3, .h4, .h5, .h6 {
5 | display: inline-block;
6 | margin-top: 0;
7 | margin-bottom: .5em;
8 | .highlight + &,
9 | p + & {
10 | margin-top: @spacing-base * 2;
11 | }
12 | }
13 |
14 | h1, h2, h3, .h1, .h2, .h3 {
15 | display: block;
16 | }
17 |
18 | .band h1 {
19 | display: inline-block;
20 | }
21 |
22 | p, ul, ol, pre {
23 | margin-bottom: @spacing-base;
24 | }
25 |
--------------------------------------------------------------------------------
/docs/static/less/pouchdb/utilities.less:
--------------------------------------------------------------------------------
1 | @import "@{bootstrap}/utilities.less";
2 |
3 | .margin-bottom-none {
4 | margin-bottom: 0 !important;
5 | }
6 |
7 | @media (min-width: @screen-md-min) {
8 | .margin-bottom-none-md {
9 | .margin-bottom-none;
10 | }
11 | }
12 |
13 | @media (max-width: @screen-sm-min) {
14 | .btn-block-xs {
15 | .btn-block;
16 | margin-bottom: @spacing-base;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # PouchDB for React Native Example
2 |
3 | - React Native 0.63.4
4 | - PouchDB 7.2.2
5 | - Uses [pouchdb-adapter-react-native-sqlite](https://github.com/craftzdog/pouchdb-adapter-react-native-sqlite) for its backing store
6 |
7 | ## How to use
8 |
9 | It demonstrates replicating documents from a remote CouchDB server.
10 | Edit the CouchDB URL to your own in [src/App.js](https://github.com/craftzdog/pouchdb-react-native/blob/v7/example/src/App.js#L11).
11 |
--------------------------------------------------------------------------------
/example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/debug.keystore
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/pouchdbreactnative/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.pouchdbreactnative;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript. This is used to schedule
9 | * rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "PouchdbReactNativeExample";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | PouchdbReactNative Example
3 |
4 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useAndroidX=true
21 | android.enableJetifier=true
22 | FLIPPER_VERSION=0.54.0
23 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'PouchdbReactNativeExample'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
5 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PouchdbReactNativeExample",
3 | "displayName": "PouchdbReactNative Example"
4 | }
5 |
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | plugins: [
4 | [
5 | 'module-resolver',
6 | {
7 | alias: {
8 | 'pouchdb-md5': 'react-native-pouchdb-md5',
9 | 'pouchdb-binary-utils':
10 | '@craftzdog/pouchdb-binary-utils-react-native',
11 | },
12 | },
13 | ],
14 | ],
15 | };
16 |
--------------------------------------------------------------------------------
/example/index.js:
--------------------------------------------------------------------------------
1 | import 'react-native-get-random-values';
2 | import { AppRegistry } from 'react-native';
3 | import App from './src/App';
4 | import { name as appName } from './app.json';
5 | import { shim as shimBase64 } from 'react-native-quick-base64';
6 |
7 | if (typeof process === 'undefined') {
8 | global.process = require('process');
9 | } else {
10 | const bProcess = require('process');
11 | for (var p in bProcess) {
12 | if (!(p in process)) {
13 | process[p] = bProcess[p];
14 | }
15 | }
16 | }
17 |
18 | shimBase64();
19 | process.browser = true;
20 |
21 | AppRegistry.registerComponent(appName, () => App);
22 |
--------------------------------------------------------------------------------
/example/ios/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // PouchdbReactNativeExample
4 | //
5 |
6 | import Foundation
7 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../node_modules/react-native/scripts/react_native_pods'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | platform :ios, '10.0'
5 |
6 | target 'PouchdbReactNativeExample' do
7 | config = use_native_modules!
8 |
9 | use_react_native!(:path => config["reactNativePath"])
10 |
11 |
12 | # Enables Flipper.
13 | #
14 | # Note that if you have use_frameworks! enabled, Flipper will not work and
15 | # you should disable these next few lines.
16 | use_flipper!
17 | post_install do |installer|
18 | flipper_post_install(installer)
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/example/ios/PouchdbReactNativeExample-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
--------------------------------------------------------------------------------
/example/ios/PouchdbReactNativeExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/PouchdbReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/PouchdbReactNativeExample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (nonatomic, strong) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/example/ios/PouchdbReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/example/ios/PouchdbReactNativeExample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/PouchdbReactNativeExample/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/example/src/pouchdb.js:
--------------------------------------------------------------------------------
1 | import PouchDB from '@craftzdog/pouchdb-core-react-native';
2 | import HttpPouch from 'pouchdb-adapter-http';
3 | import replication from 'pouchdb-replication';
4 | import mapreduce from 'pouchdb-mapreduce';
5 |
6 | import SQLite from 'react-native-sqlite-2';
7 | import SQLiteAdapterFactory from 'pouchdb-adapter-react-native-sqlite';
8 |
9 | const SQLiteAdapter = SQLiteAdapterFactory(SQLite);
10 |
11 | export default PouchDB.plugin(HttpPouch)
12 | .plugin(replication)
13 | .plugin(mapreduce)
14 | .plugin(SQLiteAdapter);
15 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-abstract-mapreduce/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-abstract-mapreduce",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB's secondary index API as an abstract module",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-abstract-mapreduce"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-abstract-mapreduce/src/createViewSignature.js:
--------------------------------------------------------------------------------
1 | function stringify(input) {
2 | if (!input) {
3 | return 'undefined'; // backwards compat for empty reduce
4 | }
5 | // for backwards compat with mapreduce, functions/strings are stringified
6 | // as-is. everything else is JSON-stringified.
7 | switch (typeof input) {
8 | case 'function':
9 | // e.g. a mapreduce map
10 | return input.toString();
11 | case 'string':
12 | // e.g. a mapreduce built-in _reduce function
13 | return input.toString();
14 | default:
15 | // e.g. a JSON object in the case of mango queries
16 | return JSON.stringify(input);
17 | }
18 | }
19 |
20 | /* create a string signature for a view so we can cache it and uniq it */
21 | function createViewSignature(mapFun, reduceFun) {
22 | // the "undefined" part is for backwards compatibility
23 | return stringify(mapFun) + stringify(reduceFun) + 'undefined';
24 | }
25 |
26 | export default createViewSignature;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-abstract-mapreduce/src/taskqueue.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Simple task queue to sequentialize actions. Assumes
3 | * callbacks will eventually fire (once).
4 | */
5 |
6 |
7 | class TaskQueue {
8 | constructor() {
9 | this.promise = new Promise(function (fulfill) {fulfill(); });
10 | }
11 |
12 | add(promiseFactory) {
13 | this.promise = this.promise.catch(function () {
14 | // just recover
15 | }).then(function () {
16 | return promiseFactory();
17 | });
18 | return this.promise;
19 | }
20 |
21 | finish() {
22 | return this.promise;
23 | }
24 | }
25 |
26 | export default TaskQueue;
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-http/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-adapter-http
2 | ======
3 |
4 | PouchDB adapter using HTTP (e.g. a remote CouchDB or CouchDB-like database) as its data store. Designed to run in either Node or the browser. Its adapter name is `'http'` or `'https'` depending on the protocol.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install pouchdb-adapter-http
10 | ```
11 |
12 | ```js
13 | PouchDB.plugin(require('pouchdb-adapter-http'));
14 | var db = new PouchDB('http://127.0.0.1:5984/mydb');
15 | ```
16 |
17 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
18 |
19 | ### Source
20 |
21 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
22 |
23 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
24 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-http/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-http",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB adapter using HTTP (e.g. a remote CouchDB) as its data store.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-adapter-http"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-idb/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-adapter-idb
2 | ======
3 |
4 | PouchDB adapter using IndexedDB as its data store. Designed to run in the browser. Its adapter name
5 | is `'idb'`.
6 |
7 | ### Usage
8 |
9 | ```bash
10 | npm install pouchdb-adapter-idb
11 | ```
12 |
13 | ```js
14 | PouchDB.plugin(require('pouchdb-adapter-idb'));
15 | var db = new PouchDB('mydb', {adapter: 'idb'});
16 | ```
17 |
18 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
19 |
20 | ### Source
21 |
22 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
23 |
24 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-idb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-idb",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB adapter using IndexedDB as its data store.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-adapter-idb"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-idb/src/changesHandler.js:
--------------------------------------------------------------------------------
1 | import { changesHandler as Changes } from 'pouchdb-utils';
2 | export default new Changes();
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-idb/src/countDocs.js:
--------------------------------------------------------------------------------
1 | import { DOC_STORE } from './constants';
2 |
3 | function countDocs(txn, cb) {
4 | var index = txn.objectStore(DOC_STORE).index('deletedOrLocal');
5 | index.count(IDBKeyRange.only('0')).onsuccess = function (e) {
6 | cb(e.target.result);
7 | };
8 | }
9 |
10 | export default countDocs;
11 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-idb/src/getAll.js:
--------------------------------------------------------------------------------
1 | // simple shim for objectStore.getAll(), falling back to IDBCursor
2 | function getAll(objectStore, keyRange, onSuccess) {
3 | if (typeof objectStore.getAll === 'function') {
4 | // use native getAll
5 | objectStore.getAll(keyRange).onsuccess = onSuccess;
6 | return;
7 | }
8 | // fall back to cursors
9 | var values = [];
10 |
11 | function onCursor(e) {
12 | var cursor = e.target.result;
13 | if (cursor) {
14 | values.push(cursor.value);
15 | cursor.continue();
16 | } else {
17 | onSuccess({
18 | target: {
19 | result: values
20 | }
21 | });
22 | }
23 | }
24 |
25 | objectStore.openCursor(keyRange).onsuccess = onCursor;
26 | }
27 |
28 | export default getAll;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-indexeddb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-indexeddb",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB adapter using IndexedDB as its data store.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-adapter-indexeddb"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-indexeddb/src/destroy.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | export default function (dbOpts, openDatabases, idbChanges, callback) {
4 |
5 | idbChanges.removeAllListeners(dbOpts.name);
6 |
7 | function doDestroy() {
8 | var req = indexedDB.deleteDatabase(dbOpts.name);
9 | req.onsuccess = function () {
10 | delete openDatabases[dbOpts.name];
11 | callback(null, {ok: true});
12 | };
13 | }
14 |
15 | // If the database is open we need to close it
16 | if (dbOpts.name in openDatabases) {
17 | openDatabases[dbOpts.name].then(function (res) {
18 | res.idb.close();
19 | doDestroy();
20 | });
21 | } else {
22 | doDestroy();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-indexeddb/src/getAttachment.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | import { btoa, readAsBinaryString } from 'pouchdb-binary-utils';
4 |
5 | import { DOC_STORE } from './util';
6 |
7 | function parseAttachment(attachment, opts, cb) {
8 | if (opts.binary) {
9 | return cb(null, attachment);
10 | } else {
11 | readAsBinaryString(attachment, function (binString) {
12 | cb(null, btoa(binString));
13 | });
14 | }
15 | }
16 |
17 | function getAttachment(txn, docId, attachId, _, opts, cb) {
18 | if (txn.error) {
19 | return cb(txn.error);
20 | }
21 |
22 | var attachment;
23 |
24 | txn.txn.objectStore(DOC_STORE).get(docId).onsuccess = function (e) {
25 | var doc = e.target.result;
26 | var rev = doc.revs[opts.rev || doc.rev].data;
27 | var digest = rev._attachments[attachId].digest;
28 | attachment = doc.attachments[digest].data;
29 | };
30 |
31 | txn.txn.oncomplete = function () {
32 | parseAttachment(attachment, opts, cb);
33 | };
34 |
35 | txn.txn.onabort = cb;
36 | }
37 |
38 | export {
39 | getAttachment,
40 | parseAttachment
41 | };
42 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-indexeddb/src/getRevisionTree.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | import { createError, MISSING_DOC } from 'pouchdb-errors';
4 |
5 | import {DOC_STORE} from './util';
6 |
7 | export default function (txn, id, callback) {
8 | if (txn.error) {
9 | return callback(txn.error);
10 | }
11 |
12 | var req = txn.txn.objectStore(DOC_STORE).get(id);
13 | req.onsuccess = function (e) {
14 | if (!e.target.result) {
15 | callback(createError(MISSING_DOC));
16 | } else {
17 | callback(null, e.target.result.rev_tree);
18 | }
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-indexeddb/src/info.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | export default function (metadata, callback) {
4 | callback(null, {
5 | doc_count: metadata.doc_count,
6 | update_seq: metadata.seq
7 | });
8 | }
9 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb-core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-leveldb-core",
3 | "version": "7.0.0-prerelease",
4 | "description": "Core PouchDB adapter code for LevelDOWN-based adapters",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-adapter-leveldb-core"
13 | },
14 | "jsnext:main": "./src/index.js",
15 | "browser": {
16 | "./lib/index.js": "./lib/index-browser.js",
17 | "./src/createEmptyBlobOrBuffer.js": "./src/createEmptyBlobOrBuffer-browser.js",
18 | "./src/prepareAttachmentForStorage.js": "./src/prepareAttachmentForStorage-browser.js",
19 | "./src/readAsBlobOrBuffer.js": "./src/readAsBlobOrBuffer-browser.js"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb-core/src/createEmptyBlobOrBuffer-browser.js:
--------------------------------------------------------------------------------
1 | import { blob as createBlob } from 'pouchdb-binary-utils';
2 |
3 | function createEmptyBlobOrBuffer(type) {
4 | return createBlob([''], {type: type});
5 | }
6 |
7 | export default createEmptyBlobOrBuffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb-core/src/createEmptyBlobOrBuffer.js:
--------------------------------------------------------------------------------
1 | import { typedBuffer } from 'pouchdb-binary-utils';
2 |
3 | function createEmptyBlobOrBuffer(type) {
4 | return typedBuffer('', 'binary', type);
5 | }
6 |
7 | export default createEmptyBlobOrBuffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb-core/src/prepareAttachmentForStorage-browser.js:
--------------------------------------------------------------------------------
1 | import { readAsBinaryString } from 'pouchdb-binary-utils';
2 |
3 | // In the browser, we store a binary string
4 | function prepareAttachmentForStorage(attData, cb) {
5 | readAsBinaryString(attData, cb);
6 | }
7 |
8 | export default prepareAttachmentForStorage;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb-core/src/prepareAttachmentForStorage.js:
--------------------------------------------------------------------------------
1 | // in Node, we store the buffer directly
2 | function prepareAttachmentForStorage(attData, cb) {
3 | cb(attData);
4 | }
5 |
6 | export default prepareAttachmentForStorage;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb-core/src/readAsBlobOrBuffer-browser.js:
--------------------------------------------------------------------------------
1 | import { blob as createBlob } from 'pouchdb-binary-utils';
2 |
3 | function readAsBlobOrBuffer(storedObject, type) {
4 | // In the browser, we've stored a binary string. This now comes back as a
5 | // browserified Node-style Buffer (implemented as a typed array),
6 | // but we want a Blob instead.
7 | var byteArray = new Uint8Array(storedObject);
8 | return createBlob([byteArray], {type: type});
9 | }
10 |
11 | export default readAsBlobOrBuffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb-core/src/readAsBlobOrBuffer.js:
--------------------------------------------------------------------------------
1 | function readAsBlobOrBuffer(storedObject, type) {
2 | // In Node, we've stored a buffer
3 | storedObject.type = type; // non-standard, but used for consistency
4 | return storedObject;
5 | }
6 |
7 | export default readAsBlobOrBuffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-adapter-leveldb
2 | ======
3 |
4 | PouchDB adapter using LevelDB as its backing store. Designed to run in Node. Its adapter name is `'leveldb'`.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install pouchdb
10 | ```
11 |
12 | ```js
13 | PouchDB.plugin(require('pouchdb-adapter-leveldb'));
14 | var db = new PouchDB('my_db', {adapter: 'leveldb'});
15 | ```
16 |
17 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
18 |
19 | ### Source
20 |
21 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
22 |
23 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-leveldb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-leveldb",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB adapter using LevelDB as its backing store.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "browser": {
8 | "leveldown": false
9 | },
10 | "author": "Dale Harvey ",
11 | "license": "Apache-2.0",
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/pouchdb/pouchdb.git",
15 | "directory": "packages/node_modules/pouchdb-adapter-leveldb"
16 | },
17 | "jsnext:main": "./src/index.js"
18 | }
19 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-localstorage/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-adapter-localstorage
2 | ======
3 |
4 | PouchDB adapter using LocalStorage as its data store. Designed to run in the browser. Its adapter name is `'localstorage'`.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install pouchdb-adapter-localstorage
10 | ```
11 |
12 | ```js
13 | PouchDB.plugin(require('pouchdb-adapter-localstorage'));
14 | var db = new PouchDB('mydb', {adapter: 'localstorage'});
15 | ```
16 |
17 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
18 |
19 | ### Source
20 |
21 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
22 |
23 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-localstorage/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-localstorage",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB adapter using LocalStorage as its data store.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-adapter-localstorage"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-localstorage/src/index.js:
--------------------------------------------------------------------------------
1 | import CoreLevelPouch from 'pouchdb-adapter-leveldb-core';
2 |
3 |
4 | import localstoragedown from 'localstorage-down';
5 |
6 | function LocalStoragePouch(opts, callback) {
7 | var _opts = Object.assign({
8 | db: localstoragedown
9 | }, opts);
10 |
11 | CoreLevelPouch.call(this, _opts, callback);
12 | }
13 |
14 | // overrides for normal LevelDB behavior on Node
15 | LocalStoragePouch.valid = function () {
16 | return typeof localStorage !== 'undefined';
17 | };
18 | LocalStoragePouch.use_prefix = true;
19 |
20 | export default function (PouchDB) {
21 | PouchDB.adapter('localstorage', LocalStoragePouch, true);
22 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-memory/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-adapter-memory
2 | ======
3 |
4 | PouchDB adapter using in-memory as its data store. Designed to run in either Node or the browser. Its adapter name is `'memory'`.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install pouchdb-adapter-memory
10 | ```
11 |
12 | ```js
13 | PouchDB.plugin(require('pouchdb-adapter-memory'));
14 | var db = new PouchDB('mydb', {adapter: 'memory'});
15 | ```
16 |
17 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
18 |
19 | ### Source
20 |
21 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
22 |
23 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-memory/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-memory",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB adapter using in-memory as its data store.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-adapter-memory"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-memory/src/index.js:
--------------------------------------------------------------------------------
1 | import CoreLevelPouch from 'pouchdb-adapter-leveldb-core';
2 |
3 |
4 | import memdown from 'memdown';
5 |
6 | function MemDownPouch(opts, callback) {
7 | var _opts = Object.assign({
8 | db: memdown
9 | }, opts);
10 |
11 | CoreLevelPouch.call(this, _opts, callback);
12 | }
13 |
14 | // overrides for normal LevelDB behavior on Node
15 | MemDownPouch.valid = function () {
16 | return true;
17 | };
18 | MemDownPouch.use_prefix = false;
19 |
20 | export default function (PouchDB) {
21 | PouchDB.adapter('memory', MemDownPouch, true);
22 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-utils/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-adapter-utils 
2 | ======
3 |
4 | Utilities for PouchDB adapters.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-adapter-utils
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 |
15 | ### Warning: semver-free zone!
16 |
17 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
18 |
19 |
20 | ### Source
21 |
22 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
23 |
24 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-adapter-utils",
3 | "version": "7.0.0-prerelease",
4 | "description": "Utilities for PouchDB adapters.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-adapter-utils"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-adapter-utils/src/index.js:
--------------------------------------------------------------------------------
1 | import allDocsKeysQuery from './allDocsKeysQuery';
2 | import parseDoc from './parseDoc';
3 | import {
4 | invalidIdError,
5 | normalizeDdocFunctionName,
6 | parseDdocFunctionName
7 | } from 'pouchdb-utils';
8 | import { isDeleted , isLocalId } from 'pouchdb-merge';
9 | import preprocessAttachments from './preprocessAttachments';
10 | import processDocs from './processDocs';
11 | import updateDoc from './updateDoc';
12 |
13 | export {
14 | allDocsKeysQuery,
15 | invalidIdError,
16 | isDeleted,
17 | isLocalId,
18 | normalizeDdocFunctionName,
19 | parseDdocFunctionName,
20 | parseDoc,
21 | preprocessAttachments,
22 | processDocs,
23 | updateDoc
24 | };
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-binary-utils 
2 | ======
3 |
4 | PouchDB utilities for operating on binary strings and Buffers/Blobs.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-binary-utils
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 | ### Warning: semver-free zone!
15 |
16 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
17 |
18 | ### Source
19 |
20 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
21 |
22 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/base64-browser.js:
--------------------------------------------------------------------------------
1 | var thisAtob = function (str) {
2 | return atob(str);
3 | };
4 |
5 | var thisBtoa = function (str) {
6 | return btoa(str);
7 | };
8 |
9 | export {
10 | thisAtob as atob,
11 | thisBtoa as btoa
12 | };
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/base64.js:
--------------------------------------------------------------------------------
1 | import bufferFrom from 'buffer-from'; // ponyfill for Node <6
2 |
3 | function thisAtob(str) {
4 | var base64 = new Buffer(str, 'base64');
5 | // Node.js will just skip the characters it can't decode instead of
6 | // throwing an exception
7 | if (base64.toString('base64') !== str) {
8 | throw new Error("attachment is not a valid base64 string");
9 | }
10 | return base64.toString('binary');
11 | }
12 |
13 | function thisBtoa(str) {
14 | return bufferFrom(str, 'binary').toString('base64');
15 | }
16 |
17 | export {
18 | thisAtob as atob,
19 | thisBtoa as btoa
20 | };
21 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/base64StringToBlobOrBuffer-browser.js:
--------------------------------------------------------------------------------
1 | import { atob } from './base64';
2 | import binaryStringToBlobOrBuffer from './binaryStringToBlobOrBuffer';
3 |
4 | function b64ToBluffer(b64, type) {
5 | return binaryStringToBlobOrBuffer(atob(b64), type);
6 | }
7 |
8 | export default b64ToBluffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/base64StringToBlobOrBuffer.js:
--------------------------------------------------------------------------------
1 | import typedBuffer from './typedBuffer';
2 |
3 | function b64ToBluffer(b64, type) {
4 | return typedBuffer(b64, 'base64', type);
5 | }
6 |
7 | export default b64ToBluffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/binaryStringToArrayBuffer.js:
--------------------------------------------------------------------------------
1 | // From http://stackoverflow.com/questions/14967647/ (continues on next line)
2 | // encode-decode-image-with-base64-breaks-image (2013-04-21)
3 | function binaryStringToArrayBuffer(bin) {
4 | var length = bin.length;
5 | var buf = new ArrayBuffer(length);
6 | var arr = new Uint8Array(buf);
7 | for (var i = 0; i < length; i++) {
8 | arr[i] = bin.charCodeAt(i);
9 | }
10 | return buf;
11 | }
12 |
13 | export default binaryStringToArrayBuffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/binaryStringToBlobOrBuffer-browser.js:
--------------------------------------------------------------------------------
1 | import createBlob from './blob';
2 |
3 | function binStringToBluffer(binString, type) {
4 | return createBlob([binString], {type: type});
5 | }
6 |
7 | export default binStringToBluffer;
8 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/binaryStringToBlobOrBuffer.js:
--------------------------------------------------------------------------------
1 | import typedBuffer from './typedBuffer';
2 |
3 | function binStringToBluffer(binString, type) {
4 | return typedBuffer(binString, 'binary', type);
5 | }
6 |
7 | export default binStringToBluffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/blob-browser.js:
--------------------------------------------------------------------------------
1 | // Abstracts constructing a Blob object, so it also works in older
2 | // browsers that don't support the native Blob constructor (e.g.
3 | // old QtWebKit versions, Android < 4.4).
4 | function createBlob(parts, properties) {
5 | /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */
6 | parts = parts || [];
7 | properties = properties || {};
8 | try {
9 | return new Blob(parts, properties);
10 | } catch (e) {
11 | if (e.name !== "TypeError") {
12 | throw e;
13 | }
14 | var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
15 | typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
16 | typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
17 | WebKitBlobBuilder;
18 | var builder = new Builder();
19 | for (var i = 0; i < parts.length; i += 1) {
20 | builder.append(parts[i]);
21 | }
22 | return builder.getBlob(properties.type);
23 | }
24 | }
25 |
26 | export default createBlob;
27 |
28 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/blob.js:
--------------------------------------------------------------------------------
1 | // This function is unused in Node
2 | /* istanbul ignore next */
3 | function createBlob() {
4 | }
5 |
6 | export default createBlob;
7 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/blobOrBufferToBase64-browser.js:
--------------------------------------------------------------------------------
1 | function blobToBase64(blobOrBuffer, callback) {
2 | if (blobOrBuffer.size) {
3 | var reader = new FileReader();
4 | reader.onloadend = function (e) {
5 | const text = e.target.result || '';
6 | const base64 = text.split(',')[1];
7 | callback(base64);
8 | };
9 | reader.readAsDataURL(blobOrBuffer);
10 | } else {
11 | const base64 = blobOrBuffer.toString('base64');
12 | setImmediate(() => callback(base64));
13 | }
14 | }
15 |
16 | export default blobToBase64;
17 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/blobOrBufferToBase64.js:
--------------------------------------------------------------------------------
1 | function blobToBase64(blobOrBuffer, callback) {
2 | callback(blobOrBuffer.toString('base64'));
3 | }
4 |
5 | export default blobToBase64;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/blobOrBufferToBinaryString-browser.js:
--------------------------------------------------------------------------------
1 | import readAsBinaryString from './readAsBinaryString';
2 |
3 | function blobToBinaryString(blobOrBuffer, callback) {
4 | readAsBinaryString(blobOrBuffer, function (bin) {
5 | callback(bin);
6 | });
7 | }
8 |
9 | export default blobToBinaryString;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/blobOrBufferToBinaryString.js:
--------------------------------------------------------------------------------
1 | // not used in Node, but here for completeness
2 | function blobToBase64(blobOrBuffer, callback) {
3 | callback(blobOrBuffer.toString('binary'));
4 | }
5 |
6 | export default blobToBase64;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/index.js:
--------------------------------------------------------------------------------
1 | import {atob, btoa} from './base64';
2 | import base64StringToBlobOrBuffer from './base64StringToBlobOrBuffer';
3 | import binaryStringToArrayBuffer from './binaryStringToArrayBuffer';
4 | import binaryStringToBlobOrBuffer from './binaryStringToBlobOrBuffer';
5 | import blob from './blob';
6 | import blobOrBufferToBase64 from './blobOrBufferToBase64';
7 | import blobOrBufferToBinaryString from './blobOrBufferToBinaryString';
8 | import readAsArrayBuffer from './readAsArrayBuffer';
9 | import readAsBinaryString from './readAsBinaryString';
10 | import typedBuffer from './typedBuffer';
11 |
12 | export {
13 | atob,
14 | btoa,
15 | base64StringToBlobOrBuffer,
16 | binaryStringToArrayBuffer,
17 | binaryStringToBlobOrBuffer,
18 | blob,
19 | blobOrBufferToBase64,
20 | blobOrBufferToBinaryString,
21 | readAsArrayBuffer,
22 | readAsBinaryString,
23 | typedBuffer
24 | };
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/readAsArrayBuffer.js:
--------------------------------------------------------------------------------
1 | // simplified API. universal browser support is assumed
2 | function readAsArrayBuffer(blob, callback) {
3 | var reader = new FileReader();
4 | reader.onloadend = function (e) {
5 | var result = e.target.result || new ArrayBuffer(0);
6 | callback(result);
7 | };
8 | reader.readAsArrayBuffer(blob);
9 | }
10 |
11 | export default readAsArrayBuffer;
12 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/readAsBinaryString.js:
--------------------------------------------------------------------------------
1 | import blobToBase64 from './blobOrBufferToBase64';
2 |
3 | function readAsBinaryString(blob, callback) {
4 | blobToBase64(blob, (base64) => {
5 | const binaryString = atob(base64);
6 | callback(binaryString);
7 | });
8 | }
9 |
10 | export default readAsBinaryString;
11 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/typedBuffer-browser.js:
--------------------------------------------------------------------------------
1 | // this is not used in the browser
2 | function typedBuffer() {
3 | }
4 |
5 | export default typedBuffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-binary-utils/src/typedBuffer.js:
--------------------------------------------------------------------------------
1 | import bufferFrom from 'buffer-from'; // ponyfill for Node <6
2 |
3 | function typedBuffer(binString, buffType, type) {
4 | // buffType is either 'binary' or 'base64'
5 | var buff = bufferFrom(binString, buffType);
6 | buff.type = type; // non-standard, but used for consistency with the browser
7 | return buff;
8 | }
9 |
10 | export default typedBuffer;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-browser/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-browser",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB, the browser-only edition.",
5 | "main": "./lib/index.js",
6 | "jsnext:main": "./lib/index.es.js",
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-browser"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-browser/src/index.js:
--------------------------------------------------------------------------------
1 | import PouchDB from 'pouchdb-core';
2 |
3 | import IDBPouch from 'pouchdb-adapter-idb';
4 | import HttpPouch from 'pouchdb-adapter-http';
5 | import mapreduce from 'pouchdb-mapreduce';
6 | import replication from 'pouchdb-replication';
7 |
8 | PouchDB.plugin(IDBPouch)
9 | .plugin(HttpPouch)
10 | .plugin(mapreduce)
11 | .plugin(replication);
12 |
13 | export default PouchDB;
14 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-changes-filter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-changes-filter",
3 | "version": "7.0.0-prerelease",
4 | "description": "Adds \"filter\", \"selector\", etc. to PouchDB's changes/replicate/sync APIs",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-changes-filter"
13 | },
14 | "jsnext:main": "./src/index.js",
15 | "browser": {
16 | "./lib/index.js": "./lib/index-browser.js",
17 | "./src/evalFilter.js": "./src/evalFilter-browser.js",
18 | "./src/evalView.js": "./src/evalView-browser.js"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-changes-filter/src/evalFilter-browser.js:
--------------------------------------------------------------------------------
1 | import { scopeEval } from 'pouchdb-utils';
2 |
3 | function evalFilter(input) {
4 | return scopeEval('"use strict";\nreturn ' + input + ';', {});
5 | }
6 |
7 | export default evalFilter;
8 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-changes-filter/src/evalFilter.js:
--------------------------------------------------------------------------------
1 | import vm from 'vm';
2 |
3 | function evalFilter(input) {
4 | var code = '(function() {\n"use strict";\nreturn ' + input + '\n})()';
5 |
6 | return vm.runInNewContext(code);
7 | }
8 |
9 | export default evalFilter;
10 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-changes-filter/src/evalView-browser.js:
--------------------------------------------------------------------------------
1 | import { scopeEval } from 'pouchdb-utils';
2 |
3 | function evalView(input) {
4 | var code = [
5 | 'return function(doc) {',
6 | ' "use strict";',
7 | ' var emitted = false;',
8 | ' var emit = function (a, b) {',
9 | ' emitted = true;',
10 | ' };',
11 | ' var view = ' + input + ';',
12 | ' view(doc);',
13 | ' if (emitted) {',
14 | ' return true;',
15 | ' }',
16 | '};'
17 | ].join('\n');
18 |
19 | return scopeEval(code, {});
20 | }
21 |
22 | export default evalView;
23 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-changes-filter/src/evalView.js:
--------------------------------------------------------------------------------
1 | import vm from 'vm';
2 |
3 | function evalView(input) {
4 | var code = [
5 | '"use strict";',
6 | 'var emitted = false;',
7 | 'var emit = function (a, b) {',
8 | ' emitted = true;',
9 | '};',
10 | 'var view = ' + input + ';',
11 | 'view(doc);',
12 | 'if (emitted) {',
13 | ' return true;',
14 | '}'
15 | ].join('\n');
16 |
17 | return vm.runInNewContext('(function(doc) {\n' + code + '\n})');
18 | }
19 |
20 | export default evalView;
21 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-checkpointer/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-checkpointer 
2 | ======
3 |
4 | PouchDB tool to write a checkpoint, e.g. during replication.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-checkpointer
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 | ### Warning: semver-free zone!
15 |
16 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
17 |
18 | ### Source
19 |
20 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
21 |
22 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-checkpointer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-checkpointer",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB tool to write a checkpoint, e.g. during replication.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-checkpointer"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-collate/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@craftzdog/pouchdb-collate-react-native",
3 | "version": "7.3.0",
4 | "description": "Collation functions for PouchDB map/reduce",
5 | "main": "lib/index.js",
6 | "keywords": [
7 | "pouchdb",
8 | "pouch",
9 | "couch",
10 | "couchdb"
11 | ],
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/pouchdb/pouchdb.git",
15 | "directory": "packages/node_modules/pouchdb-collate"
16 | },
17 | "license": "Apache-2.0",
18 | "jsnext:main": "./src/index.js"
19 | }
20 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-collections/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-collections 
2 | ======
3 |
4 | Super-minimal ES6 Map and Set shims for PouchDB.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-collections
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 |
15 | ### Warning: semver-free zone!
16 |
17 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
18 |
19 |
20 | ### Source
21 |
22 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
23 |
24 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-collections/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-collections",
3 | "version": "7.0.0-prerelease",
4 | "description": "Map and Set shims for PouchDB",
5 | "main": "./lib/index.js",
6 | "keywords": [
7 | "map",
8 | "set",
9 | "collections"
10 | ],
11 | "author": "Dale Harvey ",
12 | "license": "Apache-2.0",
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/pouchdb/pouchdb.git",
16 | "directory": "packages/node_modules/pouchdb-collections"
17 | },
18 | "jsnext:main": "./src/index.js",
19 | "contributors": [
20 | {
21 | "name": "Calvin Metcalf",
22 | "email": "cmetcalf@appgeo.com"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-collections/src/Set.js:
--------------------------------------------------------------------------------
1 | import Map from './Map';
2 |
3 | function Set(array) {
4 | this._store = new Map();
5 |
6 | // init with an array
7 | if (array && Array.isArray(array)) {
8 | for (var i = 0, len = array.length; i < len; i++) {
9 | this.add(array[i]);
10 | }
11 | }
12 | }
13 | Set.prototype.add = function (key) {
14 | return this._store.set(key, true);
15 | };
16 | Set.prototype.has = function (key) {
17 | return this._store.has(key);
18 | };
19 | Set.prototype.forEach = function (cb) {
20 | this._store.forEach(function (value, key) {
21 | cb(key);
22 | });
23 | };
24 | Object.defineProperty(Set.prototype, 'size', {
25 | get: function () {
26 | return this._store.size;
27 | }
28 | });
29 |
30 | export default Set;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-collections/src/index.js:
--------------------------------------------------------------------------------
1 | // based on https://github.com/montagejs/collections
2 |
3 | import ShimmedMap from './Map';
4 | import ShimmedSet from './Set';
5 | import supportsMapAndSet from './supportsMapAndSet';
6 |
7 | var ExportedSet;
8 | var ExportedMap;
9 |
10 | if (process.env.COVERAGE) { // don't penalize ourselves on coverage
11 | ExportedSet = ShimmedSet;
12 | ExportedMap = ShimmedMap;
13 | } else {
14 | if (supportsMapAndSet()) { // prefer built-in Map/Set
15 | ExportedSet = Set;
16 | ExportedMap = Map;
17 | } else { // fall back to our polyfill
18 | ExportedSet = ShimmedSet;
19 | ExportedMap = ShimmedMap;
20 | }
21 | }
22 |
23 | export {
24 | ExportedSet as Set,
25 | ExportedMap as Map
26 | };
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-collections/src/supportsMapAndSet.js:
--------------------------------------------------------------------------------
1 | // Based on https://kangax.github.io/compat-table/es6/ we can sniff out
2 | // incomplete Map/Set implementations which would otherwise cause our tests to fail.
3 | // Notably they fail in IE11 and iOS 8.4, which this prevents.
4 | function supportsMapAndSet() {
5 | if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') {
6 | return false;
7 | }
8 | var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species);
9 | return prop && 'get' in prop && Map[Symbol.species] === Map;
10 | }
11 | export default supportsMapAndSet;
12 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-core/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-core
2 | ======
3 |
4 | The core of PouchDB as a standalone package. This is a `preset` designed to be combined with other plugins to create new `presets`. By itself, it is not very useful.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install pouchdb-core
10 | ```
11 |
12 | ```js
13 | var PouchDB = require('pouchdb-core');
14 | PouchDB.plugin(/* attach plugins to make me more interesting! */);
15 | ```
16 |
17 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
18 |
19 | ### Source
20 |
21 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
22 |
23 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@craftzdog/pouchdb-core-react-native",
3 | "version": "7.2.2",
4 | "description": "The core of PouchDB as a standalone package.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-core"
13 | },
14 | "jsnext:main": "./lib/index.es.js",
15 | "dependencies": {
16 | "argsarray": "^0.0.1",
17 | "inherits": "^2.0.4",
18 | "pouchdb-changes-filter": "^7.2.2",
19 | "pouchdb-collections": "^7.2.2",
20 | "pouchdb-errors": "^7.2.2",
21 | "pouchdb-fetch": "^7.2.2",
22 | "pouchdb-merge": "^7.2.2",
23 | "pouchdb-utils": "^7.2.2"
24 | },
25 | "module": "./lib/index.es.js",
26 | "files": [
27 | "lib",
28 | "dist",
29 | "tonic-example.js"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-core/src/index.js:
--------------------------------------------------------------------------------
1 | import PouchDB from './setup';
2 | import version from './version';
3 | import pouchChangesFilter from 'pouchdb-changes-filter';
4 |
5 | // TODO: remove from pouchdb-core (breaking)
6 | PouchDB.plugin(pouchChangesFilter);
7 |
8 | PouchDB.version = version;
9 |
10 | export default PouchDB;
11 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-core/src/taskqueue.js:
--------------------------------------------------------------------------------
1 | export default class TaskQueue {
2 | constructor() {
3 | this.isReady = false;
4 | this.failed = false;
5 | this.queue = [];
6 | }
7 |
8 | execute() {
9 | var fun;
10 | if (this.failed) {
11 | while ((fun = this.queue.shift())) {
12 | fun(this.failed);
13 | }
14 | } else {
15 | while ((fun = this.queue.shift())) {
16 | fun();
17 | }
18 | }
19 | }
20 |
21 | fail(err) {
22 | this.failed = err;
23 | this.execute();
24 | }
25 |
26 | ready(db) {
27 | this.isReady = true;
28 | this.db = db;
29 | this.execute();
30 | }
31 |
32 | addTask(fun) {
33 | this.queue.push(fun);
34 | if (this.failed) {
35 | this.execute();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-core/src/utils.js:
--------------------------------------------------------------------------------
1 | function inherits(A, B) {
2 | A.prototype = Object.create(B.prototype, {
3 | constructor: { value: A }
4 | });
5 | }
6 |
7 | export function createClass(parent, init) {
8 | let klass = function (...args) {
9 | if (!(this instanceof klass)) {
10 | return new klass(...args);
11 | }
12 | init.apply(this, args);
13 | };
14 | inherits(klass, parent);
15 | return klass;
16 | }
17 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-core/src/version.js:
--------------------------------------------------------------------------------
1 | // managed automatically by set-version.js
2 | export default "7.0.0-prerelease";
3 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-errors/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-errors 
2 | ======
3 |
4 | Errors exposed by PouchDB.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-errors
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 | ### Warning: semver-free zone!
15 |
16 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
17 |
18 | ### Source
19 |
20 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
21 |
22 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-errors/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-errors",
3 | "version": "7.0.0-prerelease",
4 | "description": "Errors exposed by PouchDB.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-errors"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-fetch/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-fetch 
2 | ======
3 |
4 | PouchDB's fetch() method.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-fetch
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 | ### Warning: semver-free zone!
15 |
16 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
17 |
18 | ### Source
19 |
20 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
21 |
22 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-fetch/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-fetch",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB's fetch() method.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-fetch"
13 | },
14 | "jsnext:main": "./src/index.js",
15 | "browser": {
16 | "./lib/index.js": "./lib/index-browser.js",
17 | "./src/fetch.js": "./src/fetch-browser.js"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-fetch/src/fetch-browser.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // AbortController was introduced quite a while after fetch and
4 | // isnt required for PouchDB to function so polyfill if needed
5 | var a = (typeof AbortController !== 'undefined')
6 | ? AbortController
7 | : function () { return {abort: function () {}}; };
8 |
9 | var f = fetch;
10 | var h = Headers;
11 |
12 | export {f as fetch, h as Headers, a as AbortController};
13 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-fetch/src/fetch.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | import nodeFetch, {Headers} from 'node-fetch';
4 | import fetchCookie from 'fetch-cookie';
5 | import AbortController from 'abort-controller';
6 |
7 | var fetch = fetchCookie(nodeFetch);
8 |
9 | export {fetch, Headers, AbortController};
10 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-fetch/src/index.js:
--------------------------------------------------------------------------------
1 | export {fetch, Headers, AbortController} from './fetch';
2 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-find/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-find",
3 | "version": "7.0.0-prerelease",
4 | "description": "Easy-to-use query language for PouchDB",
5 | "main": "lib/index.js",
6 | "keywords": [
7 | "pouch",
8 | "pouchdb",
9 | "plugin",
10 | "find",
11 | "mango",
12 | "query",
13 | "couch",
14 | "couchdb"
15 | ],
16 | "author": "Nolan Lawson ",
17 | "license": "Apache-2.0",
18 | "repository": {
19 | "type": "git",
20 | "url": "https://github.com/pouchdb/pouchdb.git",
21 | "directory": "packages/node_modules/pouchdb-find"
22 | },
23 | "jsnext:main": "./src/index.js",
24 | "browser": {
25 | "./lib/index.js": "./lib/index-browser.js"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-find/src/adapters/local/delete-index/index.js:
--------------------------------------------------------------------------------
1 | import abstractMapper from '../abstract-mapper';
2 | import { upsert } from 'pouchdb-utils';
3 |
4 | function deleteIndex(db, index) {
5 |
6 | if (!index.ddoc) {
7 | throw new Error('you must supply an index.ddoc when deleting');
8 | }
9 |
10 | if (!index.name) {
11 | throw new Error('you must supply an index.name when deleting');
12 | }
13 |
14 | var docId = index.ddoc;
15 | var viewName = index.name;
16 |
17 | function deltaFun(doc) {
18 | if (Object.keys(doc.views).length === 1 && doc.views[viewName]) {
19 | // only one view in this ddoc, delete the whole ddoc
20 | return {_id: docId, _deleted: true};
21 | }
22 | // more than one view here, just remove the view
23 | delete doc.views[viewName];
24 | return doc;
25 | }
26 |
27 | return upsert(db, docId, deltaFun).then(function () {
28 | return abstractMapper(db).viewCleanup.apply(db);
29 | }).then(function () {
30 | return {ok: true};
31 | });
32 | }
33 |
34 | export default deleteIndex;
35 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-find/src/adapters/local/index.js:
--------------------------------------------------------------------------------
1 | import { callbackify } from '../../utils';
2 | import createIndex from './create-index';
3 | import {find, explain } from './find';
4 | import getIndexes from './get-indexes';
5 | import deleteIndex from './delete-index';
6 |
7 | var createIndexAsCallback = callbackify(createIndex);
8 | var findAsCallback = callbackify(find);
9 | var explainAsCallback = callbackify(explain);
10 | var getIndexesAsCallback = callbackify(getIndexes);
11 | var deleteIndexAsCallback = callbackify(deleteIndex);
12 |
13 | export {
14 | createIndexAsCallback as createIndex,
15 | findAsCallback as find,
16 | getIndexesAsCallback as getIndexes,
17 | deleteIndexAsCallback as deleteIndex,
18 | explainAsCallback as explain
19 | };
20 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-find/src/massageCreateIndexRequest.js:
--------------------------------------------------------------------------------
1 | import { clone } from 'pouchdb-utils';
2 |
3 | // we restucture the supplied JSON considerably, because the official
4 | // Mango API is very particular about a lot of this stuff, but we like
5 | // to be liberal with what we accept in order to prevent mental
6 | // breakdowns in our users
7 | function massageCreateIndexRequest(requestDef) {
8 | requestDef = clone(requestDef);
9 |
10 | if (!requestDef.index) {
11 | requestDef.index = {};
12 | }
13 |
14 | ['type', 'name', 'ddoc'].forEach(function (key) {
15 | if (requestDef.index[key]) {
16 | requestDef[key] = requestDef.index[key];
17 | delete requestDef.index[key];
18 | }
19 | });
20 |
21 | if (requestDef.fields) {
22 | requestDef.index.fields = requestDef.fields;
23 | delete requestDef.fields;
24 | }
25 |
26 | if (!requestDef.type) {
27 | requestDef.type = 'json';
28 | }
29 | return requestDef;
30 | }
31 |
32 | export default massageCreateIndexRequest;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/ajax.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/ajax');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/checkpointer.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/checkpointer');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/fruitdown.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/fruitdown');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/generateReplicationId.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/generateReplicationId');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/localstorage.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/localstorage');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/memory.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/memory');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/promise.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/promise');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/extras/websql.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../lib/extras/websql');
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-for-coverage",
3 | "version": "7.0.0-prerelease",
4 | "main": "./lib/index.js",
5 | "private": true,
6 | "//": [
7 | "Below, the node version is used for coverage tests.",
8 | "The browser version is actually used for tests/integration/utils.js."
9 | ],
10 | "repository": {
11 | "type": "git",
12 | "url": "https://github.com/pouchdb/pouchdb.git",
13 | "directory": "packages/node_modules/pouchdb-for-coverage"
14 | },
15 | "browser": {
16 | "./lib/index.js": "./lib/index-browser.js",
17 | "./src/pouchdb.js": "./src/pouchdb-browser.js"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/src/index.js:
--------------------------------------------------------------------------------
1 | import PouchDB from './pouchdb';
2 | import utils from './utils';
3 | import errors from './errors';
4 | import * as collate from 'pouchdb-collate';
5 | // explicitly include pouchdb-find so coverage captures it correctly
6 | import find from 'pouchdb-find';
7 |
8 | PouchDB.utils = utils;
9 | PouchDB.Errors = errors;
10 | PouchDB.collate = collate;
11 | PouchDB.plugin(find);
12 |
13 | export default PouchDB;
14 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/src/pouchdb-browser.js:
--------------------------------------------------------------------------------
1 | // import directly from src rather than jsnext:main because in ths case
2 | // the jsnext:main is actually built (lib/index*.es.js)
3 | import PouchDB from 'pouchdb-browser/src/index';
4 | export default PouchDB;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-for-coverage/src/pouchdb.js:
--------------------------------------------------------------------------------
1 | // import directly from src rather than jsnext:main because in ths case
2 | // the jsnext:main is actually built (lib/index*.es.js)
3 | import PouchDB from 'pouchdb-node/src/index';
4 | export default PouchDB;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-generate-replication-id/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-generate-replication-id",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB function to generate a replication ID to mark progress during replications.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-generate-replication-id"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-json/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-json 
2 | ======
3 |
4 | PouchDB utilities for safely stringifying and parsing JSON.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-json
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 | ### Warning: semver-free zone!
15 |
16 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
17 |
18 | ### Source
19 |
20 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
21 |
22 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-json/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-json",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB utilities for safely stringifying and parsing JSON.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-json"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-json/src/index.js:
--------------------------------------------------------------------------------
1 | import safeJsonParse from './safeJsonParse';
2 | import safeJsonStringify from './safeJsonStringify';
3 |
4 | export {
5 | safeJsonParse,
6 | safeJsonStringify
7 | };
8 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-json/src/safeJsonParse.js:
--------------------------------------------------------------------------------
1 | import vuvuzela from 'vuvuzela';
2 |
3 | function safeJsonParse(str) {
4 | // This try/catch guards against stack overflow errors.
5 | // JSON.parse() is faster than vuvuzela.parse() but vuvuzela
6 | // cannot overflow.
7 | try {
8 | return JSON.parse(str);
9 | } catch (e) {
10 | /* istanbul ignore next */
11 | return vuvuzela.parse(str);
12 | }
13 | }
14 |
15 | export default safeJsonParse;
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-json/src/safeJsonStringify.js:
--------------------------------------------------------------------------------
1 | import vuvuzela from 'vuvuzela';
2 |
3 | function safeJsonStringify(json) {
4 | try {
5 | return JSON.stringify(json);
6 | } catch (e) {
7 | /* istanbul ignore next */
8 | return vuvuzela.stringify(json);
9 | }
10 | }
11 |
12 | export default safeJsonStringify;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce-utils/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-mapreduce-utils 
2 | ======
3 |
4 | PouchDB utilities used by pouchdb-mapreduce.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-mapreduce-utils
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 | ### Warning: semver-free zone!
15 |
16 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
17 |
18 | ### Source
19 |
20 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
21 |
22 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
23 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-mapreduce-utils",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB utilities used by pouchdb-mapreduce.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-mapreduce-utils"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce-utils/src/errors.js:
--------------------------------------------------------------------------------
1 |
2 | class QueryParseError extends Error {
3 | constructor(message) {
4 | super();
5 | this.status = 400;
6 | this.name = 'query_parse_error';
7 | this.message = message;
8 | this.error = true;
9 | try {
10 | Error.captureStackTrace(this, QueryParseError);
11 | } catch (e) {}
12 | }
13 | }
14 |
15 | class NotFoundError extends Error {
16 | constructor(message) {
17 | super();
18 | this.status = 404;
19 | this.name = 'not_found';
20 | this.message = message;
21 | this.error = true;
22 | try {
23 | Error.captureStackTrace(this, NotFoundError);
24 | } catch (e) {}
25 | }
26 | }
27 |
28 | class BuiltInError extends Error {
29 | constructor(message) {
30 | super();
31 | this.status = 500;
32 | this.name = 'invalid_value';
33 | this.message = message;
34 | this.error = true;
35 | try {
36 | Error.captureStackTrace(this, BuiltInError);
37 | } catch (e) {}
38 | }
39 | }
40 |
41 | export {
42 | QueryParseError,
43 | NotFoundError,
44 | BuiltInError
45 | };
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-mapreduce
2 | ======
3 |
4 | PouchDB's `query()` and `viewCleanup()` functions as a standalone plugin.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save pouchdb-mapreduce
10 | ```
11 |
12 | ```js
13 | var mapreduce = require('pouchdb-mapreduce');
14 | PouchDB.plugin(mapreduce);
15 | ```
16 |
17 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
18 |
19 | ### Source
20 |
21 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
22 |
23 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-mapreduce",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB's map/reduce query API as a plugin.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-mapreduce"
13 | },
14 | "jsnext:main": "./src/index.js",
15 | "browser": {
16 | "./lib/index.js": "./lib/index-browser.js",
17 | "./src/evalFunction.js": "./src/evalFunction-browser.js"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce/src/createBuiltInError.js:
--------------------------------------------------------------------------------
1 | import { BuiltInError } from 'pouchdb-mapreduce-utils';
2 |
3 | function createBuiltInError(name) {
4 | var message = 'builtin ' + name +
5 | ' function requires map values to be numbers' +
6 | ' or number arrays';
7 | return new BuiltInError(message);
8 | }
9 |
10 | export default createBuiltInError;
11 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce/src/evalFunction-browser.js:
--------------------------------------------------------------------------------
1 | import evalFunctionWithEval from './evalFunctionWithEval';
2 | export default evalFunctionWithEval;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce/src/evalFunction.js:
--------------------------------------------------------------------------------
1 | import evalFunctionWithVm from './evalFunctionInVm';
2 | import evalFunctionWithEval from './evalFunctionWithEval';
3 |
4 | // The "stringify, then execute in a VM" strategy totally breaks Istanbul due
5 | // to missing __coverage global objects. As a solution, export different
6 | // code during coverage testing and during regular execution.
7 | // Note that this doesn't get shipped to consumers because Rollup replaces it
8 | // with rollup-plugin-replace, so process.env.COVERAGE is replaced with `false`
9 | var evalFunc;
10 | /* istanbul ignore else */
11 | if (process.env.COVERAGE) {
12 | evalFunc = evalFunctionWithEval;
13 | } else {
14 | evalFunc = evalFunctionWithVm;
15 | }
16 |
17 | export default evalFunc;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-mapreduce/src/evalFunctionWithEval.js:
--------------------------------------------------------------------------------
1 | import { guardedConsole, scopeEval } from 'pouchdb-utils';
2 | import sum from './sum';
3 |
4 | var log = guardedConsole.bind(null, 'log');
5 | var isArray = Array.isArray;
6 | var toJSON = JSON.parse;
7 |
8 | function evalFunctionWithEval(func, emit) {
9 | return scopeEval(
10 | "return (" + func.replace(/;\s*$/, "") + ");",
11 | {
12 | emit: emit,
13 | sum: sum,
14 | log: log,
15 | isArray: isArray,
16 | toJSON: toJSON
17 | }
18 | );
19 | }
20 |
21 | export default evalFunctionWithEval;
22 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-md5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-md5",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB utilities for calculating MD5 checksums.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-md5"
13 | },
14 | "jsnext:main": "./src/index.js",
15 | "browser": {
16 | "./lib/index.js": "./lib/index-browser.js",
17 | "./src/binaryMd5.js": "./src/binaryMd5-browser.js",
18 | "./src/stringMd5.js": "./src/stringMd5-browser.js"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-md5/src/binaryMd5.js:
--------------------------------------------------------------------------------
1 | import crypto from 'crypto';
2 |
3 | function binaryMd5(data, callback) {
4 | var base64 = crypto.createHash('md5').update(data, 'binary').digest('base64');
5 | callback(base64);
6 | }
7 |
8 | export default binaryMd5;
9 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-md5/src/index.js:
--------------------------------------------------------------------------------
1 | import binaryMd5 from './binaryMd5';
2 | import stringMd5 from './stringMd5';
3 |
4 | export {
5 | binaryMd5,
6 | stringMd5
7 | };
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-md5/src/stringMd5-browser.js:
--------------------------------------------------------------------------------
1 | import Md5 from 'spark-md5';
2 |
3 | function stringMd5(string) {
4 | return Md5.hash(string);
5 | }
6 |
7 | export default stringMd5;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-md5/src/stringMd5.js:
--------------------------------------------------------------------------------
1 | import crypto from 'crypto';
2 |
3 | function stringMd5(string) {
4 | return crypto.createHash('md5').update(string, 'binary').digest('hex');
5 | }
6 |
7 | export default stringMd5;
8 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-merge 
2 | ======
3 |
4 | PouchDB's CouchDB-style document merge algorithm as a standalone module.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-merge
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 |
15 | ### Warning: semver-free zone!
16 |
17 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
18 |
19 |
20 | ### Source
21 |
22 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
23 |
24 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-merge",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB's document merge algorithm.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-merge"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/collectConflicts.js:
--------------------------------------------------------------------------------
1 | import winningRev from './winningRev';
2 | import collectLeaves from './collectLeaves';
3 |
4 | // returns revs of all conflicts that is leaves such that
5 | // 1. are not deleted and
6 | // 2. are different than winning revision
7 | function collectConflicts(metadata) {
8 | var win = winningRev(metadata);
9 | var leaves = collectLeaves(metadata.rev_tree);
10 | var conflicts = [];
11 | for (var i = 0, len = leaves.length; i < len; i++) {
12 | var leaf = leaves[i];
13 | if (leaf.rev !== win && !leaf.opts.deleted) {
14 | conflicts.push(leaf.rev);
15 | }
16 | }
17 | return conflicts;
18 | }
19 |
20 | export default collectConflicts;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/collectLeaves.js:
--------------------------------------------------------------------------------
1 | import traverseRevTree from './traverseRevTree';
2 |
3 | function sortByPos(a, b) {
4 | return a.pos - b.pos;
5 | }
6 |
7 | function collectLeaves(revs) {
8 | var leaves = [];
9 | traverseRevTree(revs, function (isLeaf, pos, id, acc, opts) {
10 | if (isLeaf) {
11 | leaves.push({rev: pos + "-" + id, pos: pos, opts: opts});
12 | }
13 | });
14 | leaves.sort(sortByPos).reverse();
15 | for (var i = 0, len = leaves.length; i < len; i++) {
16 | delete leaves[i].pos;
17 | }
18 | return leaves;
19 | }
20 |
21 | export default collectLeaves;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/compactTree.js:
--------------------------------------------------------------------------------
1 | import traverseRevTree from './traverseRevTree';
2 | // compact a tree by marking its non-leafs as missing,
3 | // and return a list of revs to delete
4 | function compactTree(metadata) {
5 | var revs = [];
6 | traverseRevTree(metadata.rev_tree, function (isLeaf, pos,
7 | revHash, ctx, opts) {
8 | if (opts.status === 'available' && !isLeaf) {
9 | revs.push(pos + '-' + revHash);
10 | opts.status = 'missing';
11 | }
12 | });
13 | return revs;
14 | }
15 |
16 | export default compactTree;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/index.js:
--------------------------------------------------------------------------------
1 | import collectConflicts from './collectConflicts';
2 | import collectLeaves from './collectLeaves';
3 | import compactTree from './compactTree';
4 | import merge from './merge';
5 | import revExists from './revExists';
6 | import rootToLeaf from './rootToLeaf';
7 | import traverseRevTree from './traverseRevTree';
8 | import winningRev from './winningRev';
9 | import isDeleted from './isDeleted';
10 | import isLocalId from './isLocalId';
11 | import latest from './latest';
12 |
13 | export {
14 | collectConflicts,
15 | collectLeaves,
16 | compactTree,
17 | isDeleted,
18 | isLocalId,
19 | merge,
20 | revExists,
21 | rootToLeaf,
22 | traverseRevTree,
23 | winningRev,
24 | latest
25 | };
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/isDeleted.js:
--------------------------------------------------------------------------------
1 | import winningRev from './winningRev';
2 |
3 | function getTrees(node) {
4 | return node.ids;
5 | }
6 |
7 | // check if a specific revision of a doc has been deleted
8 | // - metadata: the metadata object from the doc store
9 | // - rev: (optional) the revision to check. defaults to winning revision
10 | function isDeleted(metadata, rev) {
11 | if (!rev) {
12 | rev = winningRev(metadata);
13 | }
14 | var id = rev.substring(rev.indexOf('-') + 1);
15 | var toVisit = metadata.rev_tree.map(getTrees);
16 |
17 | var tree;
18 | while ((tree = toVisit.pop())) {
19 | if (tree[0] === id) {
20 | return !!tree[1].deleted;
21 | }
22 | toVisit = toVisit.concat(tree[2]);
23 | }
24 | }
25 |
26 | export default isDeleted;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/isLocalId.js:
--------------------------------------------------------------------------------
1 | function isLocalId(id) {
2 | return (/^_local/).test(id);
3 | }
4 |
5 | export default isLocalId;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/revExists.js:
--------------------------------------------------------------------------------
1 | // return true if a rev exists in the rev tree, false otherwise
2 | function revExists(revs, rev) {
3 | var toVisit = revs.slice();
4 | var splitRev = rev.split('-');
5 | var targetPos = parseInt(splitRev[0], 10);
6 | var targetId = splitRev[1];
7 |
8 | var node;
9 | while ((node = toVisit.pop())) {
10 | if (node.pos === targetPos && node.ids[0] === targetId) {
11 | return true;
12 | }
13 | var branches = node.ids[2];
14 | for (var i = 0, len = branches.length; i < len; i++) {
15 | toVisit.push({pos: node.pos + 1, ids: branches[i]});
16 | }
17 | }
18 | return false;
19 | }
20 |
21 | export default revExists;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/rootToLeaf.js:
--------------------------------------------------------------------------------
1 | // build up a list of all the paths to the leafs in this revision tree
2 | function rootToLeaf(revs) {
3 | var paths = [];
4 | var toVisit = revs.slice();
5 | var node;
6 | while ((node = toVisit.pop())) {
7 | var pos = node.pos;
8 | var tree = node.ids;
9 | var id = tree[0];
10 | var opts = tree[1];
11 | var branches = tree[2];
12 | var isLeaf = branches.length === 0;
13 |
14 | var history = node.history ? node.history.slice() : [];
15 | history.push({id: id, opts: opts});
16 | if (isLeaf) {
17 | paths.push({pos: (pos + 1 - history.length), ids: history});
18 | }
19 | for (var i = 0, len = branches.length; i < len; i++) {
20 | toVisit.push({pos: pos + 1, ids: branches[i], history: history});
21 | }
22 | }
23 | return paths.reverse();
24 | }
25 |
26 | export default rootToLeaf;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-merge/src/traverseRevTree.js:
--------------------------------------------------------------------------------
1 | // Pretty much all below can be combined into a higher order function to
2 | // traverse revisions
3 | // The return value from the callback will be passed as context to all
4 | // children of that node
5 | function traverseRevTree(revs, callback) {
6 | var toVisit = revs.slice();
7 |
8 | var node;
9 | while ((node = toVisit.pop())) {
10 | var pos = node.pos;
11 | var tree = node.ids;
12 | var branches = tree[2];
13 | var newCtx =
14 | callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]);
15 | for (var i = 0, len = branches.length; i < len; i++) {
16 | toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx});
17 | }
18 | }
19 | }
20 |
21 | export default traverseRevTree;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-node",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB, the Node-only edition.",
5 | "main": "./lib/index.js",
6 | "jsnext:main": "./lib/index.es.js",
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-node"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-node/src/index.js:
--------------------------------------------------------------------------------
1 | import PouchDB from 'pouchdb-core';
2 |
3 | import LevelPouch from 'pouchdb-adapter-leveldb';
4 | import HttpPouch from 'pouchdb-adapter-http';
5 | import mapreduce from 'pouchdb-mapreduce';
6 | import replication from 'pouchdb-replication';
7 |
8 | PouchDB.plugin(LevelPouch)
9 | .plugin(HttpPouch)
10 | .plugin(mapreduce)
11 | .plugin(replication);
12 |
13 | export default PouchDB;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-replication/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-replication
2 | ======
3 |
4 | PouchDB's replication and sync algorithm, as a plugin.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install pouchdb-replication
10 | ```
11 |
12 | ```js
13 | PouchDB.plugin(require('pouchdb-replication'));
14 | var db = new PouchDB('mydb');
15 | db.replicate(/* see replicate/sync API docs for full info */);
16 | ```
17 |
18 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
19 |
20 | ### Source
21 |
22 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
23 |
24 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-replication/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-replication",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB's replication and sync algorithm, as a plugin.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-replication"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-replication/src/index.js:
--------------------------------------------------------------------------------
1 | import { replicate } from './replicateWrapper';
2 | import sync from './sync';
3 |
4 | function replication(PouchDB) {
5 | PouchDB.replicate = replicate;
6 | PouchDB.sync = sync;
7 |
8 | Object.defineProperty(PouchDB.prototype, 'replicate', {
9 | get: function () {
10 | var self = this;
11 | if (typeof this.replicateMethods === 'undefined') {
12 | this.replicateMethods = {
13 | from: function (other, opts, callback) {
14 | return self.constructor.replicate(other, self, opts, callback);
15 | },
16 | to: function (other, opts, callback) {
17 | return self.constructor.replicate(self, other, opts, callback);
18 | }
19 | };
20 | }
21 | return this.replicateMethods;
22 | }
23 | });
24 |
25 | PouchDB.prototype.sync = function (dbName, opts, callback) {
26 | return this.constructor.sync(this, dbName, opts, callback);
27 | };
28 | }
29 |
30 | export default replication;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-selector-core/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-selector-core 
2 | ======
3 |
4 | PouchDB find's core selector as standalone module.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-selector-core
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 |
15 | ### Warning: semver-free zone!
16 |
17 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
18 |
19 |
20 | ### Source
21 |
22 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
23 |
24 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-selector-core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-selector-core",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB's core selector code",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Will Holley ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-selector-core"
13 | },
14 | "jsnext:main": "./src/index.js"
15 | }
16 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-selector-core/src/index.js:
--------------------------------------------------------------------------------
1 | import { matchesSelector } from './matches-selector';
2 | import { filterInMemoryFields, createFieldSorter, rowFilter } from './in-memory-filter';
3 | import {
4 | massageSelector,
5 | isCombinationalField,
6 | getKey,
7 | getValue,
8 | getFieldFromDoc,
9 | setFieldInDoc,
10 | compare,
11 | parseField
12 | } from './utils';
13 |
14 | export {
15 | massageSelector,
16 | matchesSelector,
17 | filterInMemoryFields,
18 | createFieldSorter,
19 | rowFilter,
20 | isCombinationalField,
21 | getKey,
22 | getValue,
23 | getFieldFromDoc,
24 | setFieldInDoc,
25 | compare,
26 | parseField
27 | };
28 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-selector-core/src/matches-selector.js:
--------------------------------------------------------------------------------
1 | import { massageSelector } from './utils';
2 | import { filterInMemoryFields } from './in-memory-filter';
3 |
4 | // return true if the given doc matches the supplied selector
5 | function matchesSelector(doc, selector) {
6 | /* istanbul ignore if */
7 | if (typeof selector !== 'object') {
8 | // match the CouchDB error message
9 | throw new Error('Selector error: expected a JSON object');
10 | }
11 |
12 | selector = massageSelector(selector);
13 | var row = {
14 | 'doc': doc
15 | };
16 |
17 | var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector));
18 | return rowsMatched && rowsMatched.length === 1;
19 | }
20 |
21 | export { matchesSelector };
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/README.md:
--------------------------------------------------------------------------------
1 | pouchdb-utils 
2 | ======
3 |
4 | Unassorted utilities used by PouchDB.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install --save-exact pouchdb-utils
10 | ```
11 |
12 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/). For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
13 |
14 |
15 | ### Warning: semver-free zone!
16 |
17 | This package is conceptually an internal API used by PouchDB or its plugins. It does not follow semantic versioning (semver), and rather its version is pegged to PouchDB's. Use exact versions when installing, e.g. with `--save-exact`.
18 |
19 |
20 | ### Source
21 |
22 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
23 |
24 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb-utils",
3 | "version": "7.0.0-prerelease",
4 | "description": "Unassorted utilities used by PouchDB.",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/pouchdb-utils"
13 | },
14 | "jsnext:main": "./src/index.js",
15 | "browser": {
16 | "./lib/index.js": "./lib/index-browser.js",
17 | "./src/cloneBinaryObject.js": "./src/cloneBinaryObject-browser.js",
18 | "./src/env/hasLocalStorage.js": "./src/env/hasLocalStorage-browser.js",
19 | "./src/explainError.js": "./src/explainError-browser.js",
20 | "./src/isBinaryObject.js": "./src/isBinaryObject-browser.js",
21 | "./src/nextTick.js": "./src/nextTick-browser.js"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/assign.js:
--------------------------------------------------------------------------------
1 | var assign;
2 | if (process.env.COVERAGE) { // don't penalize us on code coverage for this polyfill
3 | assign = Object.assign;
4 | } else {
5 | if (typeof Object.assign === 'function') {
6 | assign = Object.assign;
7 | } else {
8 | // lite Object.assign polyfill based on
9 | // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
10 | assign = function (target) {
11 | var to = Object(target);
12 |
13 | for (var index = 1; index < arguments.length; index++) {
14 | var nextSource = arguments[index];
15 |
16 | if (nextSource != null) { // Skip over if undefined or null
17 | for (var nextKey in nextSource) {
18 | // Avoid bugs when hasOwnProperty is shadowed
19 | if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
20 | to[nextKey] = nextSource[nextKey];
21 | }
22 | }
23 | }
24 | }
25 | return to;
26 | };
27 | }
28 | }
29 |
30 | export default assign;
31 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/cloneBinaryObject-browser.js:
--------------------------------------------------------------------------------
1 | function cloneArrayBuffer(buff) {
2 | if (typeof buff.slice === 'function') {
3 | return buff.slice(0);
4 | }
5 | // IE10-11 slice() polyfill
6 | var target = new ArrayBuffer(buff.byteLength);
7 | var targetArray = new Uint8Array(target);
8 | var sourceArray = new Uint8Array(buff);
9 | targetArray.set(sourceArray);
10 | return target;
11 | }
12 |
13 | function cloneBinaryObject(object) {
14 | if (object instanceof ArrayBuffer) {
15 | return cloneArrayBuffer(object);
16 | }
17 | var size = object.size;
18 | var type = object.type;
19 | // Blob
20 | if (typeof object.slice === 'function') {
21 | return object.slice(0, size, type);
22 | }
23 | // PhantomJS slice() replacement
24 | return object.webkitSlice(0, size, type);
25 | }
26 |
27 | export default cloneBinaryObject;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/cloneBinaryObject.js:
--------------------------------------------------------------------------------
1 | import cloneBuffer from 'clone-buffer'; // correctly uses Buffer.from when available
2 | export default cloneBuffer;
3 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/defaultBackOff.js:
--------------------------------------------------------------------------------
1 | function randomNumber(min, max) {
2 | var maxTimeout = 600000; // Hard-coded default of 10 minutes
3 | min = parseInt(min, 10) || 0;
4 | max = parseInt(max, 10);
5 | if (max !== max || max <= min) {
6 | max = (min || 1) << 1; //doubling
7 | } else {
8 | max = max + 1;
9 | }
10 | // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout
11 | if (max > maxTimeout) {
12 | min = maxTimeout >> 1; // divide by two
13 | max = maxTimeout;
14 | }
15 | var ratio = Math.random();
16 | var range = max - min;
17 |
18 | return ~~(range * ratio + min); // ~~ coerces to an int, but fast.
19 | }
20 |
21 | function defaultBackOff(min) {
22 | var max = 0;
23 | if (!min) {
24 | max = 2000;
25 | }
26 | return randomNumber(min, max);
27 | }
28 |
29 | export default defaultBackOff;
30 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/env/hasLocalStorage-browser.js:
--------------------------------------------------------------------------------
1 | var hasLocal;
2 |
3 | try {
4 | localStorage.setItem('_pouch_check_localstorage', 1);
5 | hasLocal = !!localStorage.getItem('_pouch_check_localstorage');
6 | } catch (e) {
7 | hasLocal = false;
8 | }
9 |
10 | function hasLocalStorage() {
11 | return hasLocal;
12 | }
13 |
14 | export default hasLocalStorage;
15 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/env/hasLocalStorage.js:
--------------------------------------------------------------------------------
1 | // in Node of course this is false
2 | function hasLocalStorage() {
3 | return false;
4 | }
5 |
6 | export default hasLocalStorage;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/explainError-browser.js:
--------------------------------------------------------------------------------
1 | import guardedConsole from './guardedConsole';
2 |
3 | // designed to give info to browser users, who are disturbed
4 | // when they see http errors in the console
5 | function explainError(status, str) {
6 | guardedConsole('info', 'The above ' + status + ' is totally normal. ' + str);
7 | }
8 |
9 | export default explainError;
10 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/explainError.js:
--------------------------------------------------------------------------------
1 | // We assume Node users don't need to see this warning
2 | var res = function () {};
3 |
4 | export default res;
5 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/flatten.js:
--------------------------------------------------------------------------------
1 | function flatten(arrs) {
2 | var res = [];
3 | for (var i = 0, len = arrs.length; i < len; i++) {
4 | res = res.concat(arrs[i]);
5 | }
6 | return res;
7 | }
8 |
9 | export default flatten;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/functionName.js:
--------------------------------------------------------------------------------
1 | // shim for Function.prototype.name,
2 | // for browsers that don't support it like IE
3 |
4 | /* istanbul ignore next */
5 | function f() {}
6 |
7 | var hasName = f.name;
8 | var res;
9 |
10 | // We dont run coverage in IE
11 | /* istanbul ignore else */
12 | if (hasName) {
13 | res = function (fun) {
14 | return fun.name;
15 | };
16 | } else {
17 | res = function (fun) {
18 | var match = fun.toString().match(/^\s*function\s*(?:(\S+)\s*)?\(/);
19 | if (match && match[1]) {
20 | return match[1];
21 | }
22 | else {
23 | return '';
24 | }
25 | };
26 | }
27 |
28 | export default res;
29 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/guardedConsole.js:
--------------------------------------------------------------------------------
1 | function guardedConsole(method) {
2 | /* istanbul ignore else */
3 | if (typeof console !== 'undefined' && typeof console[method] === 'function') {
4 | var args = Array.prototype.slice.call(arguments, 1);
5 | console[method].apply(console, args);
6 | }
7 | }
8 |
9 | export default guardedConsole;
10 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/invalidIdError.js:
--------------------------------------------------------------------------------
1 | import {
2 | INVALID_ID,
3 | MISSING_ID,
4 | RESERVED_ID,
5 | createError
6 | } from 'pouchdb-errors';
7 |
8 | // Determine id an ID is valid
9 | // - invalid IDs begin with an underescore that does not begin '_design' or
10 | // '_local'
11 | // - any other string value is a valid id
12 | // Returns the specific error object for each case
13 | function invalidIdError(id) {
14 | var err;
15 | if (!id) {
16 | err = createError(MISSING_ID);
17 | } else if (typeof id !== 'string') {
18 | err = createError(INVALID_ID);
19 | } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) {
20 | err = createError(RESERVED_ID);
21 | }
22 | if (err) {
23 | throw err;
24 | }
25 | }
26 |
27 | export default invalidIdError;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/isBinaryObject-browser.js:
--------------------------------------------------------------------------------
1 | function isBinaryObject(object) {
2 | return (typeof ArrayBuffer !== 'undefined' && object instanceof ArrayBuffer) ||
3 | (typeof Blob !== 'undefined' && object instanceof Blob);
4 | }
5 |
6 | export default isBinaryObject;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/isBinaryObject.js:
--------------------------------------------------------------------------------
1 | function isBinaryObject(object) {
2 | return object instanceof Buffer;
3 | }
4 |
5 | export default isBinaryObject;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/isPlainObject.js:
--------------------------------------------------------------------------------
1 | // most of this is borrowed from lodash.isPlainObject:
2 | // https://github.com/fis-components/lodash.isplainobject/
3 | // blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js
4 |
5 | var funcToString = Function.prototype.toString;
6 | var objectCtorString = funcToString.call(Object);
7 |
8 | function isPlainObject(value) {
9 | var proto = Object.getPrototypeOf(value);
10 | /* istanbul ignore if */
11 | if (proto === null) { // not sure when this happens, but I guess it can
12 | return true;
13 | }
14 | var Ctor = proto.constructor;
15 | return (typeof Ctor == 'function' &&
16 | Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
17 | }
18 |
19 | export default isPlainObject;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/isRemote.js:
--------------------------------------------------------------------------------
1 | // Checks if a PouchDB object is "remote" or not. This is
2 | // designed to opt-in to certain optimizations, such as
3 | // avoiding checks for "dependentDbs" and other things that
4 | // we know only apply to local databases. In general, "remote"
5 | // should be true for the http adapter, and for third-party
6 | // adapters with similar expensive boundaries to cross for
7 | // every API call, such as socket-pouch and worker-pouch.
8 | // Previously, this was handled via db.type() === 'http'
9 | // which is now deprecated.
10 |
11 | import guardedConsole from './guardedConsole';
12 |
13 | function isRemote(db) {
14 | if (typeof db._remote === 'boolean') {
15 | return db._remote;
16 | }
17 | /* istanbul ignore next */
18 | if (typeof db.type === 'function') {
19 | guardedConsole('warn',
20 | 'db.type() is deprecated and will be removed in ' +
21 | 'a future version of PouchDB');
22 | return db.type() === 'http';
23 | }
24 | /* istanbul ignore next */
25 | return false;
26 | }
27 |
28 | export default isRemote;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/listenerCount.js:
--------------------------------------------------------------------------------
1 | import EE from 'events';
2 |
3 | function listenerCount(ee, type) {
4 | return 'listenerCount' in ee ? ee.listenerCount(type) :
5 | EE.listenerCount(ee, type);
6 | }
7 |
8 | export default listenerCount;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/nextTick-browser.js:
--------------------------------------------------------------------------------
1 | // Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We
2 | // avoid using process.nextTick() directly because the polyfill is very large and we don't
3 | // need all of it (see: https://github.com/defunctzombie/node-process).
4 | // "immediate" 3.0.8 is used by lie, and it's a smaller version of the latest "immediate"
5 | // package, so it's the one we use.
6 | // When we use nextTick() in our codebase, we only care about not releasing Zalgo
7 | // (see: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony).
8 | // Microtask vs macrotask doesn't matter to us. So we're free to use the fastest
9 | // (least latency) option, which is "immediate" due to use of microtasks.
10 | // All of our nextTicks are isolated to this one function so we can easily swap out one
11 | // implementation for another.
12 | import immediate from 'immediate';
13 | export default immediate;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/nextTick.js:
--------------------------------------------------------------------------------
1 | function nextTick(fn) {
2 | process.nextTick(fn);
3 | }
4 |
5 | export default nextTick;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/normalizeDdocFunctionName.js:
--------------------------------------------------------------------------------
1 | import parseDdocFunctionName from './parseDdocFunctionName';
2 |
3 | function normalizeDesignDocFunctionName(s) {
4 | var normalized = parseDdocFunctionName(s);
5 | return normalized ? normalized.join('/') : null;
6 | }
7 |
8 | export default normalizeDesignDocFunctionName;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/once.js:
--------------------------------------------------------------------------------
1 | import getArguments from 'argsarray';
2 |
3 | function once(fun) {
4 | var called = false;
5 | return getArguments(function (args) {
6 | /* istanbul ignore if */
7 | if (called) {
8 | // this is a smoke test and should never actually happen
9 | throw new Error('once called more than once');
10 | } else {
11 | called = true;
12 | fun.apply(this, args);
13 | }
14 | });
15 | }
16 |
17 | export default once;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/parseDdocFunctionName.js:
--------------------------------------------------------------------------------
1 | function parseDesignDocFunctionName(s) {
2 | if (!s) {
3 | return null;
4 | }
5 | var parts = s.split('/');
6 | if (parts.length === 2) {
7 | return parts;
8 | }
9 | if (parts.length === 1) {
10 | return [s, s];
11 | }
12 | return null;
13 | }
14 |
15 | export default parseDesignDocFunctionName;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/pick.js:
--------------------------------------------------------------------------------
1 | // like underscore/lodash _.pick()
2 | function pick(obj, arr) {
3 | var res = {};
4 | for (var i = 0, len = arr.length; i < len; i++) {
5 | var prop = arr[i];
6 | if (prop in obj) {
7 | res[prop] = obj[prop];
8 | }
9 | }
10 | return res;
11 | }
12 |
13 | export default pick;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/rev.js:
--------------------------------------------------------------------------------
1 | import { v4 as uuidV4 } from 'uuid';
2 | import { stringMd5 } from 'pouchdb-md5';
3 |
4 | /**
5 | * Creates a new revision string that does NOT include the revision height
6 | * For example '56649f1b0506c6ca9fda0746eb0cacdf'
7 | */
8 | function rev(doc, deterministic_revs) {
9 | if (!deterministic_revs) {
10 | return uuidV4().replace(/-/g, '').toLowerCase();
11 | }
12 |
13 | var mutateableDoc = Object.assign({}, doc);
14 | delete mutateableDoc._rev_tree;
15 | return stringMd5(JSON.stringify(mutateableDoc));
16 | }
17 |
18 | export default rev;
19 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb-utils/src/scopeEval.js:
--------------------------------------------------------------------------------
1 | // Based on https://github.com/alexdavid/scope-eval v0.0.3
2 | // (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js)
3 | // This is basically just a wrapper around new Function()
4 |
5 | function scopeEval(source, scope) {
6 | var keys = [];
7 | var values = [];
8 | for (var key in scope) {
9 | if (Object.prototype.hasOwnProperty.call(scope, key)) {
10 | keys.push(key);
11 | values.push(scope[key]);
12 | }
13 | }
14 | keys.push(source);
15 | return Function.apply(null, keys).apply(null, values);
16 | }
17 |
18 | export default scopeEval;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/README.md:
--------------------------------------------------------------------------------
1 | pouchdb
2 | ======
3 |
4 | PouchDB is a pocket-sized database.
5 |
6 | ### Usage
7 |
8 | ```bash
9 | npm install pouchdb
10 | ```
11 |
12 | ```js
13 | var PouchDB = require('pouchdb');
14 | var db = new PouchDB('my_db');
15 | ```
16 |
17 | For full API documentation and guides on PouchDB, see [PouchDB.com](http://pouchdb.com/).
18 |
19 | This is the full, batteries-included `pouchdb` package containing code that is designed for both the Browser and Node.js. For details on PouchDB sub-packages, see the [Custom Builds documentation](http://pouchdb.com/custom.html).
20 |
21 | ### Source
22 |
23 | PouchDB and its sub-packages are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).
24 |
25 | For a full list of packages, see [the GitHub source](https://github.com/pouchdb/pouchdb/tree/master/packages).
26 |
27 |
28 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB is a pocket-sized database.",
5 | "repo": "daleharvey/pouchdb",
6 | "keywords": [
7 | "db",
8 | "couchdb",
9 | "pouchdb"
10 | ],
11 | "dependencies": {},
12 | "development": {},
13 | "license": "Apache",
14 | "main": "dist/pouchdb.js",
15 | "scripts": [
16 | "dist/pouchdb.js",
17 | "dist/pouchdb.min.js"
18 | ],
19 | "ignore": [
20 | "**/.*",
21 | "node_modules",
22 | "bower_components",
23 | "tests",
24 | "vendor",
25 | "npm-debug.log",
26 | "phantomjsdriver.log"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB is a pocket-sized database.",
5 | "repo": "daleharvey/pouchdb",
6 | "keywords": [
7 | "db",
8 | "couchdb",
9 | "pouchdb"
10 | ],
11 | "dependencies": {},
12 | "development": {},
13 | "license": "Apache",
14 | "main": "dist/pouchdb.js",
15 | "scripts": [
16 | "dist/pouchdb.js"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouchdb",
3 | "version": "7.0.0-prerelease",
4 | "description": "PouchDB is a pocket-sized database",
5 | "main": "./lib/index.js",
6 | "jsnext:main": "./lib/index.es.js",
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": "https://github.com/pouchdb/pouchdb",
10 | "browser": {
11 | "./lib/index.js": "./lib/index-browser.js",
12 | "./src/pouchdb.js": "./src/pouchdb-browser.js"
13 | },
14 | "jspm": {
15 | "main": "dist/pouchdb.js"
16 | },
17 | "tonicExampleFilename": "tonic-example.js",
18 | "keywords": [
19 | "db",
20 | "couchdb",
21 | "pouchdb"
22 | ],
23 | "tags": [
24 | "db",
25 | "couchdb",
26 | "pouchdb"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/index.js:
--------------------------------------------------------------------------------
1 | import PouchDB from './pouchdb';
2 | export default PouchDB;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/plugins/find.js:
--------------------------------------------------------------------------------
1 | // this code only runs in the browser, as its own dist/ script
2 |
3 | import FindPlugin from 'pouchdb-find';
4 | import { guardedConsole } from 'pouchdb-utils';
5 |
6 | if (typeof PouchDB === 'undefined') {
7 | guardedConsole('error', 'pouchdb-find plugin error: ' +
8 | 'Cannot find global "PouchDB" object! ' +
9 | 'Did you remember to include pouchdb.js?');
10 | } else {
11 | PouchDB.plugin(FindPlugin);
12 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/plugins/fruitdown.js:
--------------------------------------------------------------------------------
1 | // this code only runs in the browser, as its own dist/ script
2 |
3 | import FruitdownPouchPlugin from 'pouchdb-adapter-fruitdown';
4 | import { guardedConsole } from 'pouchdb-utils';
5 |
6 | if (typeof PouchDB === 'undefined') {
7 | guardedConsole('error', 'fruitdown adapter plugin error: ' +
8 | 'Cannot find global "PouchDB" object! ' +
9 | 'Did you remember to include pouchdb.js?');
10 | } else {
11 | PouchDB.plugin(FruitdownPouchPlugin);
12 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/plugins/indexeddb.js:
--------------------------------------------------------------------------------
1 | // this code only runs in the browser, as its own dist/ script
2 |
3 | import IndexeddbPouchPlugin from 'pouchdb-adapter-indexeddb';
4 | import { guardedConsole } from 'pouchdb-utils';
5 |
6 | if (typeof PouchDB === 'undefined') {
7 | guardedConsole('error', 'indexeddb adapter plugin error: ' +
8 | 'Cannot find global "PouchDB" object! ' +
9 | 'Did you remember to include pouchdb.js?');
10 | } else {
11 | PouchDB.plugin(IndexeddbPouchPlugin);
12 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/plugins/localstorage.js:
--------------------------------------------------------------------------------
1 | // this code only runs in the browser, as its own dist/ script
2 |
3 | import LocalStoragePouchPlugin from 'pouchdb-adapter-localstorage';
4 | import { guardedConsole } from 'pouchdb-utils';
5 |
6 | if (typeof PouchDB === 'undefined') {
7 | guardedConsole('error', 'localstorage adapter plugin error: ' +
8 | 'Cannot find global "PouchDB" object! ' +
9 | 'Did you remember to include pouchdb.js?');
10 | } else {
11 | PouchDB.plugin(LocalStoragePouchPlugin);
12 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/plugins/memory.js:
--------------------------------------------------------------------------------
1 | // this code only runs in the browser, as its own dist/ script
2 |
3 | import MemoryPouchPlugin from 'pouchdb-adapter-memory';
4 | import { guardedConsole } from 'pouchdb-utils';
5 |
6 | if (typeof PouchDB === 'undefined') {
7 | guardedConsole('error', 'memory adapter plugin error: ' +
8 | 'Cannot find global "PouchDB" object! ' +
9 | 'Did you remember to include pouchdb.js?');
10 | } else {
11 | PouchDB.plugin(MemoryPouchPlugin);
12 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/plugins/websql.js:
--------------------------------------------------------------------------------
1 | // this code only runs in the browser, as its own dist/ script
2 |
3 | import WebsqlPouchPlugin from 'pouchdb-adapter-websql';
4 | import { guardedConsole } from 'pouchdb-utils';
5 |
6 | if (typeof PouchDB === 'undefined') {
7 | guardedConsole('error', 'websql adapter plugin error: ' +
8 | 'Cannot find global "PouchDB" object! ' +
9 | 'Did you remember to include pouchdb.js?');
10 | } else {
11 | PouchDB.plugin(WebsqlPouchPlugin);
12 | }
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/pouchdb-browser.js:
--------------------------------------------------------------------------------
1 | // Pull from src because pouchdb-node/pouchdb-browser themselves
2 | // are aggressively optimized and jsnext:main would normally give us this
3 | // aggressive bundle.
4 | import PouchDB from 'pouchdb-browser/src/index';
5 | export default PouchDB;
--------------------------------------------------------------------------------
/packages/node_modules/pouchdb/src/pouchdb.js:
--------------------------------------------------------------------------------
1 | // Pull from src because pouchdb-node/pouchdb-browser themselves
2 | // are aggressively optimized and jsnext:main would normally give us this
3 | // aggressive bundle.
4 | import PouchDB from 'pouchdb-node/src/index';
5 | export default PouchDB;
--------------------------------------------------------------------------------
/packages/node_modules/sublevel-pouchdb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sublevel-pouchdb",
3 | "version": "7.0.0-prerelease",
4 | "description": "Fork of level-sublevel with ony the subset of the API that PouchDB uses",
5 | "main": "./lib/index.js",
6 | "keywords": [],
7 | "author": "Dale Harvey ",
8 | "license": "Apache-2.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/pouchdb/pouchdb.git",
12 | "directory": "packages/node_modules/sublevel-pouchdb"
13 | },
14 | "jsnext:main": "./src/index.js",
15 | "contributors": [
16 | {
17 | "name": "Dominic Tarr",
18 | "email": "dominic.tarr@gmail.com"
19 | }
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/packages/node_modules/sublevel-pouchdb/src/NotFoundError.js:
--------------------------------------------------------------------------------
1 | class NotFoundError extends Error {
2 | constructor() {
3 | super();
4 | this.name = 'NotFoundError';
5 | }
6 | }
7 |
8 | export default NotFoundError;
--------------------------------------------------------------------------------
/packages/node_modules/sublevel-pouchdb/src/batch.js:
--------------------------------------------------------------------------------
1 | function addOperation(type, key, value, options) {
2 | var operation = {
3 | type: type,
4 | key: key,
5 | value: value,
6 | options: options
7 | };
8 |
9 | if (options && options.prefix) {
10 | operation.prefix = options.prefix;
11 | delete options.prefix;
12 | }
13 |
14 | this._operations.push(operation);
15 |
16 | return this;
17 | }
18 |
19 | function Batch(sdb) {
20 | this._operations = [];
21 | this._sdb = sdb;
22 |
23 | this.put = addOperation.bind(this, 'put');
24 | this.del = addOperation.bind(this, 'del');
25 | }
26 |
27 | var B = Batch.prototype;
28 |
29 | B.clear = function () {
30 | this._operations = [];
31 | };
32 |
33 | B.write = function (cb) {
34 | this._sdb.batch(this._operations, cb);
35 | };
36 |
37 | export default Batch;
38 |
--------------------------------------------------------------------------------
/packages/node_modules/sublevel-pouchdb/src/index.js:
--------------------------------------------------------------------------------
1 | import nut from './nut';
2 | import shell from './shell';
3 | import Codec from 'level-codec';
4 | import ReadStream from './readStream';
5 | import precodec from './legacyCodec';
6 |
7 | var codec = new Codec();
8 |
9 | function sublevelPouch(db) {
10 | return shell(nut(db, precodec, codec), [], ReadStream, db.options);
11 | }
12 |
13 | export default sublevelPouch;
14 |
--------------------------------------------------------------------------------
/packages/node_modules/sublevel-pouchdb/src/legacyCodec.js:
--------------------------------------------------------------------------------
1 | export default {
2 | encode: function (decodedKey) {
3 | return '\xff' + decodedKey[0] + '\xff' + decodedKey[1];
4 | },
5 | decode: function (encodedKeyAsBuffer) {
6 | var str = encodedKeyAsBuffer.toString();
7 | var idx = str.indexOf('\xff', 1);
8 | return [str.substring(1, idx), str.substring(idx + 1)];
9 | },
10 | lowerBound: '\x00',
11 | upperBound: '\xff'
12 | };
--------------------------------------------------------------------------------
/packages/node_modules/sublevel-pouchdb/src/pull.js:
--------------------------------------------------------------------------------
1 | import pull from 'pull-stream';
2 | // Currently this uses pull streams,
3 | // and not levelup's readstream, but in theory
4 | // I should be able pretty much just drop that in.
5 |
6 | function pullReadStream(options, makeData) {
7 | var stream = pull.defer();
8 | stream.setIterator = function (iterator) {
9 | stream.resolve(function (end, cb) {
10 | if (!end) {
11 | iterator.next(function (err, key, value) {
12 | if (err) {
13 | return cb(err);
14 | }
15 | if (key === undefined || value === undefined) {
16 | return cb(true);
17 | }
18 | cb(null, makeData(key, value));
19 | });
20 | } else {
21 | iterator.end(cb);
22 | }
23 | });
24 | };
25 |
26 | return stream;
27 | }
28 | export default pullReadStream;
--------------------------------------------------------------------------------
/scripts/baldrick-test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -x
2 |
3 | # Run PouchDB test suite, expect a global couchdb command to be installed
4 | #
5 | # Run as:
6 | #
7 | # ./scripts/baldrick-test.sh
8 |
9 | # tmp directory to store CouchDB data files
10 | TMP=./tmp
11 | COUCH_URI_FILE=$TMP/couch.uri
12 |
13 | # Install PouchDB dependancies
14 | npm install
15 |
16 | # Provision a CouchDB instance just for this test
17 | ./scripts/start_standalone_couch.sh $TMP > /dev/null 2>&1 &
18 | COUCH_PID=$!
19 |
20 | # Wait for CouchDB to start by polling for the uri file
21 | # Not nasty at all :)
22 | while [ ! -f $COUCH_URI_FILE ]
23 | do
24 | sleep 2
25 | done
26 | COUCH_HOST=$(cat $COUCH_URI_FILE)
27 |
28 | # Run tests
29 | grunt test --couch-host=$COUCH_HOST
30 | EXIT_STATUS=$?
31 |
32 | # Cleanup
33 | kill $COUCH_PID
34 |
35 | # Make sure we exit with the right status
36 | exit $EXIT_STATUS
--------------------------------------------------------------------------------
/scripts/bundle-browserify-test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo '' > test.html
4 | echo " " >> test.html
5 | echo "" >> test.html
--------------------------------------------------------------------------------
/scripts/jenkins-deploy.sh:
--------------------------------------------------------------------------------
1 | ROOT=$(pwd)
2 |
3 | # Build the docs
4 | cd $ROOT/docs
5 | jekyll
6 |
7 | # Publish docs
8 | cp -R $ROOT/docs/_site/* /home/daleharvey/www/pouchdb.com
9 |
10 | # Build
11 | cd $ROOT
12 | npm install
13 |
14 | grunt
15 | grunt spatial
16 | grunt gql
17 |
18 | cp $ROOT/dist/* /home/daleharvey/www/download.pouchdb.com
--------------------------------------------------------------------------------
/scripts/start_standalone_couch.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | # Start a standalone CouchDB, this is a wrapper around the $ couchdb
4 | # command that will create a standalone instance of CouchDB allowing
5 | # you to easily run serveral servers in parallel, each instance starts
6 | # on an ephemeral port and has a dedicated directory for its data and logs
7 | # use the couch.uri file to locate the host
8 | #
9 | # Run as:
10 | #
11 | # $ ./start_standalone_couch.sh ~/data/instanceId
12 |
13 | COUCH_DIR=$1
14 |
15 | # Make all the directories
16 | mkdir -p $COUCH_DIR/data/views
17 |
18 | # Create a standalone configuration based on the directory
19 | # we are passed in, CouchDB will start on a random port and couch.uri
20 | # will tell us where that is, data is stored within the directory
21 | echo "[httpd]
22 | bind_address = 127.0.0.1
23 | port = 0
24 |
25 | [log]
26 | level = debug
27 | file = $COUCH_DIR/couch.log
28 |
29 | [couchdb]
30 | database_dir = $COUCH_DIR/data
31 | view_index_dir = $COUCH_DIR/data/views
32 | uri_file = $COUCH_DIR/couch.uri" > $COUCH_DIR/couch.ini
33 |
34 | couchdb -a $COUCH_DIR/couch.ini
--------------------------------------------------------------------------------
/tests/find/test-suite-1/test.aaa-setup.js:
--------------------------------------------------------------------------------
1 | if (typeof process === 'undefined' || process.browser) {
2 | window.context = {};
3 | } else {
4 | global.context = {};
5 | }
6 |
7 | beforeEach(function () {
8 | this.timeout(60000);
9 | var dbName = testUtils.adapterUrl(testUtils.adapterType(), 'testdb');
10 | context.db = new PouchDB(dbName);
11 | });
12 |
13 | afterEach(function () {
14 | this.timeout(60000);
15 | return context.db.destroy();
16 | });
17 |
--------------------------------------------------------------------------------
/tests/find/test-suite-1/test.partial.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('test.partial.js', function () {
4 | beforeEach(function () {
5 | const write = context.db.bulkDocs({ docs: [
6 | { _id: 'a', type: 'x', hello: 'world' },
7 | { _id: 'a', type: 'y', hello: 'world' }
8 | ]});
9 | const index = context.db.createIndex({
10 | index: {
11 | fields: ['hello'],
12 | partial_filter_selector: { type: 'x' }
13 | },
14 | ddoc: 'test-partial',
15 | name: 'type-x'
16 | });
17 | return Promise.all([write, index]);
18 | });
19 | it('should apply the partial filter', function () {
20 | return context.db.find({
21 | selector: { hello: 'world' },
22 | use_index: ['_design/test-partial', 'type-x']
23 | }).then(function (result) {
24 | result.docs.should.have.length(1);
25 | const [{ _id: id, type, hello }] = result.docs;
26 | id.should.equal('a');
27 | type.should.equal('x');
28 | hello.should.equal('world');
29 | });
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/tests/fuzzy/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Mocha
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/lateStyle/000003.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/lateStyle/000003.log
--------------------------------------------------------------------------------
/tests/integration/leveldb/lateStyle/CURRENT:
--------------------------------------------------------------------------------
1 | MANIFEST-000002
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/lateStyle/LOCK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/lateStyle/LOCK
--------------------------------------------------------------------------------
/tests/integration/leveldb/lateStyle/LOG:
--------------------------------------------------------------------------------
1 | 2014/10/18-13:54:18.233480 103b7a000 Delete type=3 #1
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/lateStyle/MANIFEST-000002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/lateStyle/MANIFEST-000002
--------------------------------------------------------------------------------
/tests/integration/leveldb/laterStyle/000003.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/laterStyle/000003.log
--------------------------------------------------------------------------------
/tests/integration/leveldb/laterStyle/CURRENT:
--------------------------------------------------------------------------------
1 | MANIFEST-000002
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/laterStyle/LOCK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/laterStyle/LOCK
--------------------------------------------------------------------------------
/tests/integration/leveldb/laterStyle/LOG:
--------------------------------------------------------------------------------
1 | 2014/12/13-15:08:05.242031 103b97000 Delete type=3 #1
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/laterStyle/MANIFEST-000002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/laterStyle/MANIFEST-000002
--------------------------------------------------------------------------------
/tests/integration/leveldb/middleStyle/000003.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/middleStyle/000003.log
--------------------------------------------------------------------------------
/tests/integration/leveldb/middleStyle/CURRENT:
--------------------------------------------------------------------------------
1 | MANIFEST-000002
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/middleStyle/LOCK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/middleStyle/LOCK
--------------------------------------------------------------------------------
/tests/integration/leveldb/middleStyle/LOG:
--------------------------------------------------------------------------------
1 | 2014/04/30-13:26:08.586711 106881000 Delete type=3 #1
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/middleStyle/MANIFEST-000002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/middleStyle/MANIFEST-000002
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle.uuid:
--------------------------------------------------------------------------------
1 | F25693E5-4052-4F30-BEAF-9D1E48DD05CF
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-binary-store/000003.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/attach-binary-store/000003.log
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-binary-store/CURRENT:
--------------------------------------------------------------------------------
1 | MANIFEST-000002
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-binary-store/LOCK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/attach-binary-store/LOCK
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-binary-store/LOG:
--------------------------------------------------------------------------------
1 | 2014/02/21-19:45:02.682927 103b87000 Delete type=3 #1
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-binary-store/MANIFEST-000002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/attach-binary-store/MANIFEST-000002
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-store/000003.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/attach-store/000003.log
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-store/CURRENT:
--------------------------------------------------------------------------------
1 | MANIFEST-000002
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-store/LOCK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/attach-store/LOCK
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-store/LOG:
--------------------------------------------------------------------------------
1 | 2014/02/21-19:45:02.682637 103a81000 Delete type=3 #1
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/attach-store/MANIFEST-000002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/attach-store/MANIFEST-000002
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/by-sequence/000003.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/by-sequence/000003.log
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/by-sequence/CURRENT:
--------------------------------------------------------------------------------
1 | MANIFEST-000002
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/by-sequence/LOCK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/by-sequence/LOCK
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/by-sequence/LOG:
--------------------------------------------------------------------------------
1 | 2014/02/21-19:45:02.682960 103b04000 Delete type=3 #1
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/by-sequence/MANIFEST-000002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/by-sequence/MANIFEST-000002
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/document-store/000003.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/document-store/000003.log
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/document-store/CURRENT:
--------------------------------------------------------------------------------
1 | MANIFEST-000002
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/document-store/LOCK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/document-store/LOCK
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/document-store/LOG:
--------------------------------------------------------------------------------
1 | 2014/02/21-19:45:02.682986 102781000 Delete type=3 #1
2 |
--------------------------------------------------------------------------------
/tests/integration/leveldb/oldStyle/document-store/MANIFEST-000002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/craftzdog/pouchdb-react-native/8f5cca364fb1e30f36b89633476af08ad094675d/tests/integration/leveldb/oldStyle/document-store/MANIFEST-000002
--------------------------------------------------------------------------------
/tests/integration/node.setup.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | // throw an error if any EventEmitter adds too many listeners
3 | require('throw-max-listeners-error');
4 |
5 | var seedrandom = require('seedrandom');
6 | var seed = (process.env.SEED || Date.now()) + "";
7 | console.log('Seeded with: ' + seed);
8 | seedrandom(seed, { global: true });
9 |
10 | var testsDir = process.env.TESTS_DIR || './tmp';
11 | var exec = require('child_process').exec;
12 | function cleanup() {
13 | // Remove test databases
14 | exec('rm -r ' + testsDir);
15 | }
16 | exec('mkdir -p ' + testsDir, function () {
17 | process.on('SIGINT', cleanup);
18 | process.on('exit', cleanup);
19 | });
20 | global.testUtils = require('./utils.js');
21 | global.PouchDB = testUtils.loadPouchDB();
22 | var chai = require('chai');
23 | chai.use(require('chai-as-promised'));
24 | global.should = chai.should();
25 | global.assert = chai.assert;
26 | require('mkdirp').sync('./tmp');
27 | global.fs = require('fs');
28 |
--------------------------------------------------------------------------------
/tests/integration/test.aa.setup.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('DB Setup', function () {
4 |
5 | it('PouchDB has a version', function () {
6 | PouchDB.version.should.be.a('string');
7 | PouchDB.version.should.match(/\d+\.\d+\.\d+/);
8 | });
9 |
10 | if (typeof process !== 'undefined' && !process.browser) {
11 | it('PouchDB version matches package.json', function () {
12 | var pkg = require('../../packages/node_modules/pouchdb/package.json');
13 | PouchDB.version.should.equal(pkg.version);
14 | });
15 | }
16 |
17 | });
18 |
--------------------------------------------------------------------------------
/tests/integration/test.node-websql.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | if (process.env.ADAPTERS === 'websql') {
4 | describe('test.node-websql.js', function () {
5 | it('should run websql when we are actually testing websql', function () {
6 | var db = new PouchDB('testdb');
7 | db.adapter.should.equal('websql');
8 | return db.destroy();
9 | });
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/tests/integration/test.setup_global_hooks.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var currentListener = null;
4 | var currentError = null;
5 |
6 | beforeEach(function (done) {
7 | currentError = null;
8 | currentListener = function (error) {
9 | currentError = error;
10 | };
11 | testUtils.addUnhandledRejectionListener(currentListener);
12 | done();
13 | });
14 |
15 | afterEach(function (done) {
16 | testUtils.removeUnhandledRejectionListener(currentListener);
17 | if (currentError) {
18 | if (currentError instanceof PromiseRejectionEvent) {
19 | currentError = currentError.reason;
20 | }
21 |
22 | console.error(currentError);
23 | }
24 | done(currentError);
25 | });
26 |
--------------------------------------------------------------------------------
/tests/mapreduce/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Mocha
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/tests/misc/express-pouchdb-minimum-for-pouchdb.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var PouchDB = require('../../');
4 |
5 | var app = require('express-pouchdb')(PouchDB, {
6 | mode: 'minimumForPouchDB'
7 | });
8 | app.listen(3000);
9 |
--------------------------------------------------------------------------------
/tests/misc/pouchdb-express-router.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var DB_FILES_DIR = './tmp';
4 |
5 | var fs = require('fs');
6 | var express = require('express');
7 | var app = express();
8 | var PouchDB = require('../../packages/node_modules/pouchdb').defaults({
9 | prefix: DB_FILES_DIR
10 | });
11 |
12 |
13 | if (!fs.existsSync(DB_FILES_DIR)) {
14 | fs.mkdirSync(DB_FILES_DIR);
15 | }
16 | app.use(function (req, res, next) {
17 | res.header("Access-Control-Allow-Origin", req.headers.origin);
18 | res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
19 | res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS");
20 | res.header("Access-Control-Allow-Credentials", "true");
21 | res.header("Access-Control-Max-Age", "1000000000");
22 | if ('OPTIONS' == req.method) {
23 | res.sendStatus(200);
24 | } else {
25 | next();
26 | }
27 | });
28 |
29 | app.use(require('pouchdb-express-router')(PouchDB));
30 |
31 | app.listen(process.env.PORT || 3000);
32 |
--------------------------------------------------------------------------------
/tests/misc/sync-gateway-config-server.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | 'use strict';
4 |
5 | var http = require('http');
6 |
7 | function createSyncGatewayConfigServer() {
8 | if (process.env.SERVER !== 'sync-gateway') {
9 | console.log("not launching SG config server");
10 | return;
11 | }
12 | console.log("launching SG config server for", process.env.COUCH_HOST);
13 | // Sync Gateway should be launched with tests/misc/sync-gateway-config.json
14 | // which causes it to query this port for database-level config.
15 | var SG_CONFIG_PORT = 8001;
16 | var sgDBConfig = {
17 | "server": "walrus:",
18 | "users": {
19 | "GUEST": {"disabled": false, "admin_channels": ["*"] }
20 | }
21 | };
22 | function sgConfig(req, res) {
23 | res.writeHead(200, {'Content-Type': 'application/json'});
24 | res.end(JSON.stringify(sgDBConfig));
25 | }
26 | http.createServer(sgConfig).listen(SG_CONFIG_PORT);
27 | }
28 |
29 | if (require.main === module) {
30 | createSyncGatewayConfigServer();
31 | } else {
32 | module.exports.start = createSyncGatewayConfigServer;
33 | }
34 |
--------------------------------------------------------------------------------
/tests/misc/sync-gateway-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "log" : ["HTTP+"],
3 | "configServer" : "http://localhost:8001/"
4 | }
5 |
--------------------------------------------------------------------------------
/tests/performance/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/tests/unit/test.backoff.js:
--------------------------------------------------------------------------------
1 | var should = require('chai').should();
2 |
3 | var Pouch = require('../../packages/node_modules/pouchdb-for-coverage');
4 | var defaultBackOff = Pouch.utils.defaultBackOff;
5 |
6 | describe('test.backoff.js', function () {
7 |
8 | it('defaultBackoff should start off at most 2 seconds and never exceed 10 minutes', function () {
9 | should.exist(defaultBackOff);
10 | var limit = 600000;
11 | var delay = 0;
12 | var values = [];
13 | for (var i=0; i<100; i++) {
14 | delay = defaultBackOff(delay);
15 | values.push(delay);
16 | }
17 | var max = Math.max.apply(null, values);
18 | values[0].should.be.at.most(2000);
19 | max.should.be.at.most(limit);
20 | });
21 |
22 | });
23 |
--------------------------------------------------------------------------------
/tests/unit/test.once.js:
--------------------------------------------------------------------------------
1 |
2 | 'use strict';
3 |
4 | var should = require('chai').should();
5 | var PouchDB = require('../../packages/node_modules/pouchdb-for-coverage');
6 | var once = PouchDB.utils.once;
7 | var toPromise = PouchDB.utils.toPromise;
8 |
9 | describe('test.once.js', function () {
10 |
11 | it('Only call once ... once', function () {
12 | var myFun = once(function () { });
13 | myFun();
14 | should.throw(myFun);
15 | });
16 |
17 | it('Once wrapped in a promise', function (done) {
18 | var callback = function () {};
19 | var myFun = toPromise(function (callback) {
20 | setTimeout(function () {
21 | callback();
22 | should.throw(callback);
23 | done();
24 | });
25 | });
26 | myFun(callback);
27 | });
28 | });
29 |
--------------------------------------------------------------------------------