You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by ro...@apache.org on 2015/07/12 14:00:28 UTC
[01/59] [abbrv] couchdb-nmo git commit: fix broken deps
Repository: couchdb-nmo
Updated Branches:
refs/heads/master [created] 35982a557
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/tough-cookie/lib/store.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/store.js b/node_modules/request/node_modules/tough-cookie/lib/store.js
new file mode 100644
index 0000000..ad69c14
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/store.js
@@ -0,0 +1,67 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+'use strict';
+/*jshint unused:false */
+
+function Store() {
+}
+exports.Store = Store;
+
+// Stores may be synchronous, but are still required to use a
+// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync"
+// API that converts from synchronous-callbacks to imperative style.
+Store.prototype.synchronous = false;
+
+Store.prototype.findCookie = function(domain, path, key, cb) {
+ throw new Error('findCookie is not implemented');
+};
+
+Store.prototype.findCookies = function(domain, path, cb) {
+ throw new Error('findCookies is not implemented');
+};
+
+Store.prototype.putCookie = function(cookie, cb) {
+ throw new Error('putCookie is not implemented');
+};
+
+Store.prototype.updateCookie = function(oldCookie, newCookie, cb) {
+ // recommended default implementation:
+ // return this.putCookie(newCookie, cb);
+ throw new Error('updateCookie is not implemented');
+};
+
+Store.prototype.removeCookie = function(domain, path, key, cb) {
+ throw new Error('removeCookie is not implemented');
+};
+
+Store.prototype.removeCookies = function removeCookies(domain, path, cb) {
+ throw new Error('removeCookies is not implemented');
+};
[12/59] [abbrv] couchdb-nmo git commit: node 0.10 compat
Posted by ro...@apache.org.
node 0.10 compat
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/7860d5c0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/7860d5c0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/7860d5c0
Branch: refs/heads/master
Commit: 7860d5c030bd54dcb40d46283c677107cacd76af
Parents: d9c91bd
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri May 22 23:16:13 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri May 22 23:16:18 2015 +0200
----------------------------------------------------------------------
src/nmo.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7860d5c0/src/nmo.js
----------------------------------------------------------------------
diff --git a/src/nmo.js b/src/nmo.js
index 2bfeeed..8fcc130 100644
--- a/src/nmo.js
+++ b/src/nmo.js
@@ -1,4 +1,5 @@
import * as config from './config.js';
+import Promise from 'bluebird';
const commands = [
'isonline',
[30/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
deleted file mode 100644
index d5aa787..0000000
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
+++ /dev/null
@@ -1,6335 +0,0 @@
-{
- "application/1d-interleaved-parityfec": {
- "source": "iana"
- },
- "application/3gpdash-qoe-report+xml": {
- "source": "iana"
- },
- "application/3gpp-ims+xml": {
- "source": "iana"
- },
- "application/a2l": {
- "source": "iana"
- },
- "application/activemessage": {
- "source": "iana"
- },
- "application/alto-costmap+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-costmapfilter+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-directory+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointcost+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointcostparams+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointprop+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-endpointpropparams+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-error+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-networkmap+json": {
- "source": "iana",
- "compressible": true
- },
- "application/alto-networkmapfilter+json": {
- "source": "iana",
- "compressible": true
- },
- "application/aml": {
- "source": "iana"
- },
- "application/andrew-inset": {
- "source": "iana",
- "extensions": ["ez"]
- },
- "application/applefile": {
- "source": "iana"
- },
- "application/applixware": {
- "source": "apache",
- "extensions": ["aw"]
- },
- "application/atf": {
- "source": "iana"
- },
- "application/atfx": {
- "source": "iana"
- },
- "application/atom+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["atom"]
- },
- "application/atomcat+xml": {
- "source": "iana",
- "extensions": ["atomcat"]
- },
- "application/atomdeleted+xml": {
- "source": "iana"
- },
- "application/atomicmail": {
- "source": "iana"
- },
- "application/atomsvc+xml": {
- "source": "iana",
- "extensions": ["atomsvc"]
- },
- "application/atxml": {
- "source": "iana"
- },
- "application/auth-policy+xml": {
- "source": "iana"
- },
- "application/bacnet-xdd+zip": {
- "source": "iana"
- },
- "application/batch-smtp": {
- "source": "iana"
- },
- "application/beep+xml": {
- "source": "iana"
- },
- "application/calendar+json": {
- "source": "iana",
- "compressible": true
- },
- "application/calendar+xml": {
- "source": "iana"
- },
- "application/call-completion": {
- "source": "iana"
- },
- "application/cals-1840": {
- "source": "iana"
- },
- "application/cbor": {
- "source": "iana"
- },
- "application/ccmp+xml": {
- "source": "iana"
- },
- "application/ccxml+xml": {
- "source": "iana",
- "extensions": ["ccxml"]
- },
- "application/cdfx+xml": {
- "source": "iana"
- },
- "application/cdmi-capability": {
- "source": "iana",
- "extensions": ["cdmia"]
- },
- "application/cdmi-container": {
- "source": "iana",
- "extensions": ["cdmic"]
- },
- "application/cdmi-domain": {
- "source": "iana",
- "extensions": ["cdmid"]
- },
- "application/cdmi-object": {
- "source": "iana",
- "extensions": ["cdmio"]
- },
- "application/cdmi-queue": {
- "source": "iana",
- "extensions": ["cdmiq"]
- },
- "application/cea": {
- "source": "iana"
- },
- "application/cea-2018+xml": {
- "source": "iana"
- },
- "application/cellml+xml": {
- "source": "iana"
- },
- "application/cfw": {
- "source": "iana"
- },
- "application/cms": {
- "source": "iana"
- },
- "application/cnrp+xml": {
- "source": "iana"
- },
- "application/coap-group+json": {
- "source": "iana",
- "compressible": true
- },
- "application/commonground": {
- "source": "iana"
- },
- "application/conference-info+xml": {
- "source": "iana"
- },
- "application/cpl+xml": {
- "source": "iana"
- },
- "application/csrattrs": {
- "source": "iana"
- },
- "application/csta+xml": {
- "source": "iana"
- },
- "application/cstadata+xml": {
- "source": "iana"
- },
- "application/cu-seeme": {
- "source": "apache",
- "extensions": ["cu"]
- },
- "application/cybercash": {
- "source": "iana"
- },
- "application/dart": {
- "compressible": true
- },
- "application/dash+xml": {
- "source": "iana",
- "extensions": ["mdp"]
- },
- "application/dashdelta": {
- "source": "iana"
- },
- "application/davmount+xml": {
- "source": "iana",
- "extensions": ["davmount"]
- },
- "application/dca-rft": {
- "source": "iana"
- },
- "application/dcd": {
- "source": "iana"
- },
- "application/dec-dx": {
- "source": "iana"
- },
- "application/dialog-info+xml": {
- "source": "iana"
- },
- "application/dicom": {
- "source": "iana"
- },
- "application/dii": {
- "source": "iana"
- },
- "application/dit": {
- "source": "iana"
- },
- "application/dns": {
- "source": "iana"
- },
- "application/docbook+xml": {
- "source": "apache",
- "extensions": ["dbk"]
- },
- "application/dskpp+xml": {
- "source": "iana"
- },
- "application/dssc+der": {
- "source": "iana",
- "extensions": ["dssc"]
- },
- "application/dssc+xml": {
- "source": "iana",
- "extensions": ["xdssc"]
- },
- "application/dvcs": {
- "source": "iana"
- },
- "application/ecmascript": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ecma"]
- },
- "application/edi-consent": {
- "source": "iana"
- },
- "application/edi-x12": {
- "source": "iana",
- "compressible": false
- },
- "application/edifact": {
- "source": "iana",
- "compressible": false
- },
- "application/emma+xml": {
- "source": "iana",
- "extensions": ["emma"]
- },
- "application/emotionml+xml": {
- "source": "iana"
- },
- "application/encaprtp": {
- "source": "iana"
- },
- "application/epp+xml": {
- "source": "iana"
- },
- "application/epub+zip": {
- "source": "iana",
- "extensions": ["epub"]
- },
- "application/eshop": {
- "source": "iana"
- },
- "application/exi": {
- "source": "iana",
- "extensions": ["exi"]
- },
- "application/fastinfoset": {
- "source": "iana"
- },
- "application/fastsoap": {
- "source": "iana"
- },
- "application/fdt+xml": {
- "source": "iana"
- },
- "application/fits": {
- "source": "iana"
- },
- "application/font-sfnt": {
- "source": "iana"
- },
- "application/font-tdpfr": {
- "source": "iana",
- "extensions": ["pfr"]
- },
- "application/font-woff": {
- "source": "iana",
- "compressible": false,
- "extensions": ["woff"]
- },
- "application/font-woff2": {
- "compressible": false,
- "extensions": ["woff2"]
- },
- "application/framework-attributes+xml": {
- "source": "iana"
- },
- "application/gml+xml": {
- "source": "apache",
- "extensions": ["gml"]
- },
- "application/gpx+xml": {
- "source": "apache",
- "extensions": ["gpx"]
- },
- "application/gxf": {
- "source": "apache",
- "extensions": ["gxf"]
- },
- "application/gzip": {
- "source": "iana",
- "compressible": false
- },
- "application/h224": {
- "source": "iana"
- },
- "application/held+xml": {
- "source": "iana"
- },
- "application/http": {
- "source": "iana"
- },
- "application/hyperstudio": {
- "source": "iana",
- "extensions": ["stk"]
- },
- "application/ibe-key-request+xml": {
- "source": "iana"
- },
- "application/ibe-pkg-reply+xml": {
- "source": "iana"
- },
- "application/ibe-pp-data": {
- "source": "iana"
- },
- "application/iges": {
- "source": "iana"
- },
- "application/im-iscomposing+xml": {
- "source": "iana"
- },
- "application/index": {
- "source": "iana"
- },
- "application/index.cmd": {
- "source": "iana"
- },
- "application/index.obj": {
- "source": "iana"
- },
- "application/index.response": {
- "source": "iana"
- },
- "application/index.vnd": {
- "source": "iana"
- },
- "application/inkml+xml": {
- "source": "iana",
- "extensions": ["ink","inkml"]
- },
- "application/iotp": {
- "source": "iana"
- },
- "application/ipfix": {
- "source": "iana",
- "extensions": ["ipfix"]
- },
- "application/ipp": {
- "source": "iana"
- },
- "application/isup": {
- "source": "iana"
- },
- "application/its+xml": {
- "source": "iana"
- },
- "application/java-archive": {
- "source": "apache",
- "compressible": false,
- "extensions": ["jar"]
- },
- "application/java-serialized-object": {
- "source": "apache",
- "compressible": false,
- "extensions": ["ser"]
- },
- "application/java-vm": {
- "source": "apache",
- "compressible": false,
- "extensions": ["class"]
- },
- "application/javascript": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["js"]
- },
- "application/jose": {
- "source": "iana"
- },
- "application/jose+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jrd+json": {
- "source": "iana",
- "compressible": true
- },
- "application/json": {
- "source": "iana",
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["json","map"]
- },
- "application/json-patch+json": {
- "source": "iana",
- "compressible": true
- },
- "application/json-seq": {
- "source": "iana"
- },
- "application/json5": {
- "extensions": ["json5"]
- },
- "application/jsonml+json": {
- "source": "apache",
- "compressible": true,
- "extensions": ["jsonml"]
- },
- "application/jwk+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jwk-set+json": {
- "source": "iana",
- "compressible": true
- },
- "application/jwt": {
- "source": "iana"
- },
- "application/kpml-request+xml": {
- "source": "iana"
- },
- "application/kpml-response+xml": {
- "source": "iana"
- },
- "application/ld+json": {
- "source": "iana",
- "compressible": true,
- "extensions": ["jsonld"]
- },
- "application/link-format": {
- "source": "iana"
- },
- "application/load-control+xml": {
- "source": "iana"
- },
- "application/lost+xml": {
- "source": "iana",
- "extensions": ["lostxml"]
- },
- "application/lostsync+xml": {
- "source": "iana"
- },
- "application/lxf": {
- "source": "iana"
- },
- "application/mac-binhex40": {
- "source": "iana",
- "extensions": ["hqx"]
- },
- "application/mac-compactpro": {
- "source": "apache",
- "extensions": ["cpt"]
- },
- "application/macwriteii": {
- "source": "iana"
- },
- "application/mads+xml": {
- "source": "iana",
- "extensions": ["mads"]
- },
- "application/manifest+json": {
- "charset": "UTF-8",
- "compressible": true,
- "extensions": ["webmanifest"]
- },
- "application/marc": {
- "source": "iana",
- "extensions": ["mrc"]
- },
- "application/marcxml+xml": {
- "source": "iana",
- "extensions": ["mrcx"]
- },
- "application/mathematica": {
- "source": "iana",
- "extensions": ["ma","nb","mb"]
- },
- "application/mathml+xml": {
- "source": "iana",
- "extensions": ["mathml"]
- },
- "application/mathml-content+xml": {
- "source": "iana"
- },
- "application/mathml-presentation+xml": {
- "source": "iana"
- },
- "application/mbms-associated-procedure-description+xml": {
- "source": "iana"
- },
- "application/mbms-deregister+xml": {
- "source": "iana"
- },
- "application/mbms-envelope+xml": {
- "source": "iana"
- },
- "application/mbms-msk+xml": {
- "source": "iana"
- },
- "application/mbms-msk-response+xml": {
- "source": "iana"
- },
- "application/mbms-protection-description+xml": {
- "source": "iana"
- },
- "application/mbms-reception-report+xml": {
- "source": "iana"
- },
- "application/mbms-register+xml": {
- "source": "iana"
- },
- "application/mbms-register-response+xml": {
- "source": "iana"
- },
- "application/mbms-schedule+xml": {
- "source": "iana"
- },
- "application/mbms-user-service-description+xml": {
- "source": "iana"
- },
- "application/mbox": {
- "source": "iana",
- "extensions": ["mbox"]
- },
- "application/media-policy-dataset+xml": {
- "source": "iana"
- },
- "application/media_control+xml": {
- "source": "iana"
- },
- "application/mediaservercontrol+xml": {
- "source": "iana",
- "extensions": ["mscml"]
- },
- "application/merge-patch+json": {
- "source": "iana",
- "compressible": true
- },
- "application/metalink+xml": {
- "source": "apache",
- "extensions": ["metalink"]
- },
- "application/metalink4+xml": {
- "source": "iana",
- "extensions": ["meta4"]
- },
- "application/mets+xml": {
- "source": "iana",
- "extensions": ["mets"]
- },
- "application/mf4": {
- "source": "iana"
- },
- "application/mikey": {
- "source": "iana"
- },
- "application/mods+xml": {
- "source": "iana",
- "extensions": ["mods"]
- },
- "application/moss-keys": {
- "source": "iana"
- },
- "application/moss-signature": {
- "source": "iana"
- },
- "application/mosskey-data": {
- "source": "iana"
- },
- "application/mosskey-request": {
- "source": "iana"
- },
- "application/mp21": {
- "source": "iana",
- "extensions": ["m21","mp21"]
- },
- "application/mp4": {
- "source": "iana",
- "extensions": ["mp4s","m4p"]
- },
- "application/mpeg4-generic": {
- "source": "iana"
- },
- "application/mpeg4-iod": {
- "source": "iana"
- },
- "application/mpeg4-iod-xmt": {
- "source": "iana"
- },
- "application/mrb-consumer+xml": {
- "source": "iana"
- },
- "application/mrb-publish+xml": {
- "source": "iana"
- },
- "application/msc-ivr+xml": {
- "source": "iana"
- },
- "application/msc-mixer+xml": {
- "source": "iana"
- },
- "application/msword": {
- "source": "iana",
- "compressible": false,
- "extensions": ["doc","dot"]
- },
- "application/mxf": {
- "source": "iana",
- "extensions": ["mxf"]
- },
- "application/nasdata": {
- "source": "iana"
- },
- "application/news-checkgroups": {
- "source": "iana"
- },
- "application/news-groupinfo": {
- "source": "iana"
- },
- "application/news-transmission": {
- "source": "iana"
- },
- "application/nlsml+xml": {
- "source": "iana"
- },
- "application/nss": {
- "source": "iana"
- },
- "application/ocsp-request": {
- "source": "iana"
- },
- "application/ocsp-response": {
- "source": "iana"
- },
- "application/octet-stream": {
- "source": "iana",
- "compressible": false,
- "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"]
- },
- "application/oda": {
- "source": "iana",
- "extensions": ["oda"]
- },
- "application/odx": {
- "source": "iana"
- },
- "application/oebps-package+xml": {
- "source": "iana",
- "extensions": ["opf"]
- },
- "application/ogg": {
- "source": "iana",
- "compressible": false,
- "extensions": ["ogx"]
- },
- "application/omdoc+xml": {
- "source": "apache",
- "extensions": ["omdoc"]
- },
- "application/onenote": {
- "source": "apache",
- "extensions": ["onetoc","onetoc2","onetmp","onepkg"]
- },
- "application/oxps": {
- "source": "iana",
- "extensions": ["oxps"]
- },
- "application/p2p-overlay+xml": {
- "source": "iana"
- },
- "application/parityfec": {
- "source": "iana"
- },
- "application/patch-ops-error+xml": {
- "source": "iana",
- "extensions": ["xer"]
- },
- "application/pdf": {
- "source": "iana",
- "compressible": false,
- "extensions": ["pdf"]
- },
- "application/pdx": {
- "source": "iana"
- },
- "application/pgp-encrypted": {
- "source": "iana",
- "compressible": false,
- "extensions": ["pgp"]
- },
- "application/pgp-keys": {
- "source": "iana"
- },
- "application/pgp-signature": {
- "source": "iana",
- "extensions": ["asc","sig"]
- },
- "application/pics-rules": {
- "source": "apache",
- "extensions": ["prf"]
- },
- "application/pidf+xml": {
- "source": "iana"
- },
- "application/pidf-diff+xml": {
- "source": "iana"
- },
- "application/pkcs10": {
- "source": "iana",
- "extensions": ["p10"]
- },
- "application/pkcs7-mime": {
- "source": "iana",
- "extensions": ["p7m","p7c"]
- },
- "application/pkcs7-signature": {
- "source": "iana",
- "extensions": ["p7s"]
- },
- "application/pkcs8": {
- "source": "iana",
- "extensions": ["p8"]
- },
- "application/pkix-attr-cert": {
- "source": "iana",
- "extensions": ["ac"]
- },
- "application/pkix-cert": {
- "source": "iana",
- "extensions": ["cer"]
- },
- "application/pkix-crl": {
- "source": "iana",
- "extensions": ["crl"]
- },
- "application/pkix-pkipath": {
- "source": "iana",
- "extensions": ["pkipath"]
- },
- "application/pkixcmp": {
- "source": "iana",
- "extensions": ["pki"]
- },
- "application/pls+xml": {
- "source": "iana",
- "extensions": ["pls"]
- },
- "application/poc-settings+xml": {
- "source": "iana"
- },
- "application/postscript": {
- "source": "iana",
- "compressible": true,
- "extensions": ["ai","eps","ps"]
- },
- "application/provenance+xml": {
- "source": "iana"
- },
- "application/prs.alvestrand.titrax-sheet": {
- "source": "iana"
- },
- "application/prs.cww": {
- "source": "iana",
- "extensions": ["cww"]
- },
- "application/prs.hpub+zip": {
- "source": "iana"
- },
- "application/prs.nprend": {
- "source": "iana"
- },
- "application/prs.plucker": {
- "source": "iana"
- },
- "application/prs.rdf-xml-crypt": {
- "source": "iana"
- },
- "application/prs.xsf+xml": {
- "source": "iana"
- },
- "application/pskc+xml": {
- "source": "iana",
- "extensions": ["pskcxml"]
- },
- "application/qsig": {
- "source": "iana"
- },
- "application/raptorfec": {
- "source": "iana"
- },
- "application/rdap+json": {
- "source": "iana",
- "compressible": true
- },
- "application/rdf+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rdf"]
- },
- "application/reginfo+xml": {
- "source": "iana",
- "extensions": ["rif"]
- },
- "application/relax-ng-compact-syntax": {
- "source": "iana",
- "extensions": ["rnc"]
- },
- "application/remote-printing": {
- "source": "iana"
- },
- "application/reputon+json": {
- "source": "iana",
- "compressible": true
- },
- "application/resource-lists+xml": {
- "source": "iana",
- "extensions": ["rl"]
- },
- "application/resource-lists-diff+xml": {
- "source": "iana",
- "extensions": ["rld"]
- },
- "application/riscos": {
- "source": "iana"
- },
- "application/rlmi+xml": {
- "source": "iana"
- },
- "application/rls-services+xml": {
- "source": "iana",
- "extensions": ["rs"]
- },
- "application/rpki-ghostbusters": {
- "source": "iana",
- "extensions": ["gbr"]
- },
- "application/rpki-manifest": {
- "source": "iana",
- "extensions": ["mft"]
- },
- "application/rpki-roa": {
- "source": "iana",
- "extensions": ["roa"]
- },
- "application/rpki-updown": {
- "source": "iana"
- },
- "application/rsd+xml": {
- "source": "apache",
- "extensions": ["rsd"]
- },
- "application/rss+xml": {
- "source": "apache",
- "compressible": true,
- "extensions": ["rss"]
- },
- "application/rtf": {
- "source": "iana",
- "compressible": true,
- "extensions": ["rtf"]
- },
- "application/rtploopback": {
- "source": "iana"
- },
- "application/rtx": {
- "source": "iana"
- },
- "application/samlassertion+xml": {
- "source": "iana"
- },
- "application/samlmetadata+xml": {
- "source": "iana"
- },
- "application/sbml+xml": {
- "source": "iana",
- "extensions": ["sbml"]
- },
- "application/scaip+xml": {
- "source": "iana"
- },
- "application/scvp-cv-request": {
- "source": "iana",
- "extensions": ["scq"]
- },
- "application/scvp-cv-response": {
- "source": "iana",
- "extensions": ["scs"]
- },
- "application/scvp-vp-request": {
- "source": "iana",
- "extensions": ["spq"]
- },
- "application/scvp-vp-response": {
- "source": "iana",
- "extensions": ["spp"]
- },
- "application/sdp": {
- "source": "iana",
- "extensions": ["sdp"]
- },
- "application/sep+xml": {
- "source": "iana"
- },
- "application/sep-exi": {
- "source": "iana"
- },
- "application/session-info": {
- "source": "iana"
- },
- "application/set-payment": {
- "source": "iana"
- },
- "application/set-payment-initiation": {
- "source": "iana",
- "extensions": ["setpay"]
- },
- "application/set-registration": {
- "source": "iana"
- },
- "application/set-registration-initiation": {
- "source": "iana",
- "extensions": ["setreg"]
- },
- "application/sgml": {
- "source": "iana"
- },
- "application/sgml-open-catalog": {
- "source": "iana"
- },
- "application/shf+xml": {
- "source": "iana",
- "extensions": ["shf"]
- },
- "application/sieve": {
- "source": "iana"
- },
- "application/simple-filter+xml": {
- "source": "iana"
- },
- "application/simple-message-summary": {
- "source": "iana"
- },
- "application/simplesymbolcontainer": {
- "source": "iana"
- },
- "application/slate": {
- "source": "iana"
- },
- "application/smil": {
- "source": "iana"
- },
- "application/smil+xml": {
- "source": "iana",
- "extensions": ["smi","smil"]
- },
- "application/smpte336m": {
- "source": "iana"
- },
- "application/soap+fastinfoset": {
- "source": "iana"
- },
- "application/soap+xml": {
- "source": "iana",
- "compressible": true
- },
- "application/sparql-query": {
- "source": "iana",
- "extensions": ["rq"]
- },
- "application/sparql-results+xml": {
- "source": "iana",
- "extensions": ["srx"]
- },
- "application/spirits-event+xml": {
- "source": "iana"
- },
- "application/sql": {
- "source": "iana"
- },
- "application/srgs": {
- "source": "iana",
- "extensions": ["gram"]
- },
- "application/srgs+xml": {
- "source": "iana",
- "extensions": ["grxml"]
- },
- "application/sru+xml": {
- "source": "iana",
- "extensions": ["sru"]
- },
- "application/ssdl+xml": {
- "source": "apache",
- "extensions": ["ssdl"]
- },
- "application/ssml+xml": {
- "source": "iana",
- "extensions": ["ssml"]
- },
- "application/tamp-apex-update": {
- "source": "iana"
- },
- "application/tamp-apex-update-confirm": {
- "source": "iana"
- },
- "application/tamp-community-update": {
- "source": "iana"
- },
- "application/tamp-community-update-confirm": {
- "source": "iana"
- },
- "application/tamp-error": {
- "source": "iana"
- },
- "application/tamp-sequence-adjust": {
- "source": "iana"
- },
- "application/tamp-sequence-adjust-confirm": {
- "source": "iana"
- },
- "application/tamp-status-query": {
- "source": "iana"
- },
- "application/tamp-status-response": {
- "source": "iana"
- },
- "application/tamp-update": {
- "source": "iana"
- },
- "application/tamp-update-confirm": {
- "source": "iana"
- },
- "application/tar": {
- "compressible": true
- },
- "application/tei+xml": {
- "source": "iana",
- "extensions": ["tei","teicorpus"]
- },
- "application/thraud+xml": {
- "source": "iana",
- "extensions": ["tfi"]
- },
- "application/timestamp-query": {
- "source": "iana"
- },
- "application/timestamp-reply": {
- "source": "iana"
- },
- "application/timestamped-data": {
- "source": "iana",
- "extensions": ["tsd"]
- },
- "application/ttml+xml": {
- "source": "iana"
- },
- "application/tve-trigger": {
- "source": "iana"
- },
- "application/ulpfec": {
- "source": "iana"
- },
- "application/urc-grpsheet+xml": {
- "source": "iana"
- },
- "application/urc-ressheet+xml": {
- "source": "iana"
- },
- "application/urc-targetdesc+xml": {
- "source": "iana"
- },
- "application/urc-uisocketdesc+xml": {
- "source": "iana"
- },
- "application/vcard+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vcard+xml": {
- "source": "iana"
- },
- "application/vemmi": {
- "source": "iana"
- },
- "application/vividence.scriptfile": {
- "source": "apache"
- },
- "application/vnd.3gpp.bsf+xml": {
- "source": "iana"
- },
- "application/vnd.3gpp.pic-bw-large": {
- "source": "iana",
- "extensions": ["plb"]
- },
- "application/vnd.3gpp.pic-bw-small": {
- "source": "iana",
- "extensions": ["psb"]
- },
- "application/vnd.3gpp.pic-bw-var": {
- "source": "iana",
- "extensions": ["pvb"]
- },
- "application/vnd.3gpp.sms": {
- "source": "iana"
- },
- "application/vnd.3gpp2.bcmcsinfo+xml": {
- "source": "iana"
- },
- "application/vnd.3gpp2.sms": {
- "source": "iana"
- },
- "application/vnd.3gpp2.tcap": {
- "source": "iana",
- "extensions": ["tcap"]
- },
- "application/vnd.3m.post-it-notes": {
- "source": "iana",
- "extensions": ["pwn"]
- },
- "application/vnd.accpac.simply.aso": {
- "source": "iana",
- "extensions": ["aso"]
- },
- "application/vnd.accpac.simply.imp": {
- "source": "iana",
- "extensions": ["imp"]
- },
- "application/vnd.acucobol": {
- "source": "iana",
- "extensions": ["acu"]
- },
- "application/vnd.acucorp": {
- "source": "iana",
- "extensions": ["atc","acutc"]
- },
- "application/vnd.adobe.air-application-installer-package+zip": {
- "source": "apache",
- "extensions": ["air"]
- },
- "application/vnd.adobe.flash.movie": {
- "source": "iana"
- },
- "application/vnd.adobe.formscentral.fcdt": {
- "source": "iana",
- "extensions": ["fcdt"]
- },
- "application/vnd.adobe.fxp": {
- "source": "iana",
- "extensions": ["fxp","fxpl"]
- },
- "application/vnd.adobe.partial-upload": {
- "source": "iana"
- },
- "application/vnd.adobe.xdp+xml": {
- "source": "iana",
- "extensions": ["xdp"]
- },
- "application/vnd.adobe.xfdf": {
- "source": "iana",
- "extensions": ["xfdf"]
- },
- "application/vnd.aether.imp": {
- "source": "iana"
- },
- "application/vnd.ah-barcode": {
- "source": "iana"
- },
- "application/vnd.ahead.space": {
- "source": "iana",
- "extensions": ["ahead"]
- },
- "application/vnd.airzip.filesecure.azf": {
- "source": "iana",
- "extensions": ["azf"]
- },
- "application/vnd.airzip.filesecure.azs": {
- "source": "iana",
- "extensions": ["azs"]
- },
- "application/vnd.amazon.ebook": {
- "source": "apache",
- "extensions": ["azw"]
- },
- "application/vnd.americandynamics.acc": {
- "source": "iana",
- "extensions": ["acc"]
- },
- "application/vnd.amiga.ami": {
- "source": "iana",
- "extensions": ["ami"]
- },
- "application/vnd.amundsen.maze+xml": {
- "source": "iana"
- },
- "application/vnd.android.package-archive": {
- "source": "apache",
- "compressible": false,
- "extensions": ["apk"]
- },
- "application/vnd.anser-web-certificate-issue-initiation": {
- "source": "iana",
- "extensions": ["cii"]
- },
- "application/vnd.anser-web-funds-transfer-initiation": {
- "source": "apache",
- "extensions": ["fti"]
- },
- "application/vnd.antix.game-component": {
- "source": "iana",
- "extensions": ["atx"]
- },
- "application/vnd.apache.thrift.binary": {
- "source": "iana"
- },
- "application/vnd.apache.thrift.compact": {
- "source": "iana"
- },
- "application/vnd.apache.thrift.json": {
- "source": "iana"
- },
- "application/vnd.api+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.apple.installer+xml": {
- "source": "iana",
- "extensions": ["mpkg"]
- },
- "application/vnd.apple.mpegurl": {
- "source": "iana",
- "extensions": ["m3u8"]
- },
- "application/vnd.arastra.swi": {
- "source": "iana"
- },
- "application/vnd.aristanetworks.swi": {
- "source": "iana",
- "extensions": ["swi"]
- },
- "application/vnd.artsquare": {
- "source": "iana"
- },
- "application/vnd.astraea-software.iota": {
- "source": "iana",
- "extensions": ["iota"]
- },
- "application/vnd.audiograph": {
- "source": "iana",
- "extensions": ["aep"]
- },
- "application/vnd.autopackage": {
- "source": "iana"
- },
- "application/vnd.avistar+xml": {
- "source": "iana"
- },
- "application/vnd.balsamiq.bmml+xml": {
- "source": "iana"
- },
- "application/vnd.balsamiq.bmpr": {
- "source": "iana"
- },
- "application/vnd.bekitzur-stech+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.blueice.multipass": {
- "source": "iana",
- "extensions": ["mpm"]
- },
- "application/vnd.bluetooth.ep.oob": {
- "source": "iana"
- },
- "application/vnd.bluetooth.le.oob": {
- "source": "iana"
- },
- "application/vnd.bmi": {
- "source": "iana",
- "extensions": ["bmi"]
- },
- "application/vnd.businessobjects": {
- "source": "iana",
- "extensions": ["rep"]
- },
- "application/vnd.cab-jscript": {
- "source": "iana"
- },
- "application/vnd.canon-cpdl": {
- "source": "iana"
- },
- "application/vnd.canon-lips": {
- "source": "iana"
- },
- "application/vnd.cendio.thinlinc.clientconf": {
- "source": "iana"
- },
- "application/vnd.century-systems.tcp_stream": {
- "source": "iana"
- },
- "application/vnd.chemdraw+xml": {
- "source": "iana",
- "extensions": ["cdxml"]
- },
- "application/vnd.chipnuts.karaoke-mmd": {
- "source": "iana",
- "extensions": ["mmd"]
- },
- "application/vnd.cinderella": {
- "source": "iana",
- "extensions": ["cdy"]
- },
- "application/vnd.cirpack.isdn-ext": {
- "source": "iana"
- },
- "application/vnd.citationstyles.style+xml": {
- "source": "iana"
- },
- "application/vnd.claymore": {
- "source": "iana",
- "extensions": ["cla"]
- },
- "application/vnd.cloanto.rp9": {
- "source": "iana",
- "extensions": ["rp9"]
- },
- "application/vnd.clonk.c4group": {
- "source": "iana",
- "extensions": ["c4g","c4d","c4f","c4p","c4u"]
- },
- "application/vnd.cluetrust.cartomobile-config": {
- "source": "iana",
- "extensions": ["c11amc"]
- },
- "application/vnd.cluetrust.cartomobile-config-pkg": {
- "source": "iana",
- "extensions": ["c11amz"]
- },
- "application/vnd.coffeescript": {
- "source": "iana"
- },
- "application/vnd.collection+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.collection.doc+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.collection.next+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.commerce-battelle": {
- "source": "iana"
- },
- "application/vnd.commonspace": {
- "source": "iana",
- "extensions": ["csp"]
- },
- "application/vnd.contact.cmsg": {
- "source": "iana",
- "extensions": ["cdbcmsg"]
- },
- "application/vnd.cosmocaller": {
- "source": "iana",
- "extensions": ["cmc"]
- },
- "application/vnd.crick.clicker": {
- "source": "iana",
- "extensions": ["clkx"]
- },
- "application/vnd.crick.clicker.keyboard": {
- "source": "iana",
- "extensions": ["clkk"]
- },
- "application/vnd.crick.clicker.palette": {
- "source": "iana",
- "extensions": ["clkp"]
- },
- "application/vnd.crick.clicker.template": {
- "source": "iana",
- "extensions": ["clkt"]
- },
- "application/vnd.crick.clicker.wordbank": {
- "source": "iana",
- "extensions": ["clkw"]
- },
- "application/vnd.criticaltools.wbs+xml": {
- "source": "iana",
- "extensions": ["wbs"]
- },
- "application/vnd.ctc-posml": {
- "source": "iana",
- "extensions": ["pml"]
- },
- "application/vnd.ctct.ws+xml": {
- "source": "iana"
- },
- "application/vnd.cups-pdf": {
- "source": "iana"
- },
- "application/vnd.cups-postscript": {
- "source": "iana"
- },
- "application/vnd.cups-ppd": {
- "source": "iana",
- "extensions": ["ppd"]
- },
- "application/vnd.cups-raster": {
- "source": "iana"
- },
- "application/vnd.cups-raw": {
- "source": "iana"
- },
- "application/vnd.curl": {
- "source": "iana"
- },
- "application/vnd.curl.car": {
- "source": "apache",
- "extensions": ["car"]
- },
- "application/vnd.curl.pcurl": {
- "source": "apache",
- "extensions": ["pcurl"]
- },
- "application/vnd.cyan.dean.root+xml": {
- "source": "iana"
- },
- "application/vnd.cybank": {
- "source": "iana"
- },
- "application/vnd.dart": {
- "source": "iana",
- "compressible": true,
- "extensions": ["dart"]
- },
- "application/vnd.data-vision.rdz": {
- "source": "iana",
- "extensions": ["rdz"]
- },
- "application/vnd.debian.binary-package": {
- "source": "iana"
- },
- "application/vnd.dece.data": {
- "source": "iana",
- "extensions": ["uvf","uvvf","uvd","uvvd"]
- },
- "application/vnd.dece.ttml+xml": {
- "source": "iana",
- "extensions": ["uvt","uvvt"]
- },
- "application/vnd.dece.unspecified": {
- "source": "iana",
- "extensions": ["uvx","uvvx"]
- },
- "application/vnd.dece.zip": {
- "source": "iana",
- "extensions": ["uvz","uvvz"]
- },
- "application/vnd.denovo.fcselayout-link": {
- "source": "iana",
- "extensions": ["fe_launch"]
- },
- "application/vnd.desmume-movie": {
- "source": "iana"
- },
- "application/vnd.dir-bi.plate-dl-nosuffix": {
- "source": "iana"
- },
- "application/vnd.dm.delegation+xml": {
- "source": "iana"
- },
- "application/vnd.dna": {
- "source": "iana",
- "extensions": ["dna"]
- },
- "application/vnd.document+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.dolby.mlp": {
- "source": "apache",
- "extensions": ["mlp"]
- },
- "application/vnd.dolby.mobile.1": {
- "source": "iana"
- },
- "application/vnd.dolby.mobile.2": {
- "source": "iana"
- },
- "application/vnd.doremir.scorecloud-binary-document": {
- "source": "iana"
- },
- "application/vnd.dpgraph": {
- "source": "iana",
- "extensions": ["dpg"]
- },
- "application/vnd.dreamfactory": {
- "source": "iana",
- "extensions": ["dfac"]
- },
- "application/vnd.ds-keypoint": {
- "source": "apache",
- "extensions": ["kpxx"]
- },
- "application/vnd.dtg.local": {
- "source": "iana"
- },
- "application/vnd.dtg.local.flash": {
- "source": "iana"
- },
- "application/vnd.dtg.local.html": {
- "source": "iana"
- },
- "application/vnd.dvb.ait": {
- "source": "iana",
- "extensions": ["ait"]
- },
- "application/vnd.dvb.dvbj": {
- "source": "iana"
- },
- "application/vnd.dvb.esgcontainer": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcdftnotifaccess": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcesgaccess": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcesgaccess2": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcesgpdd": {
- "source": "iana"
- },
- "application/vnd.dvb.ipdcroaming": {
- "source": "iana"
- },
- "application/vnd.dvb.iptv.alfec-base": {
- "source": "iana"
- },
- "application/vnd.dvb.iptv.alfec-enhancement": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-aggregate-root+xml": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-container+xml": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-generic+xml": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-ia-msglist+xml": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-ia-registration-request+xml": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-ia-registration-response+xml": {
- "source": "iana"
- },
- "application/vnd.dvb.notif-init+xml": {
- "source": "iana"
- },
- "application/vnd.dvb.pfr": {
- "source": "iana"
- },
- "application/vnd.dvb.service": {
- "source": "iana",
- "extensions": ["svc"]
- },
- "application/vnd.dxr": {
- "source": "iana"
- },
- "application/vnd.dynageo": {
- "source": "iana",
- "extensions": ["geo"]
- },
- "application/vnd.dzr": {
- "source": "iana"
- },
- "application/vnd.easykaraoke.cdgdownload": {
- "source": "iana"
- },
- "application/vnd.ecdis-update": {
- "source": "iana"
- },
- "application/vnd.ecowin.chart": {
- "source": "iana",
- "extensions": ["mag"]
- },
- "application/vnd.ecowin.filerequest": {
- "source": "iana"
- },
- "application/vnd.ecowin.fileupdate": {
- "source": "iana"
- },
- "application/vnd.ecowin.series": {
- "source": "iana"
- },
- "application/vnd.ecowin.seriesrequest": {
- "source": "iana"
- },
- "application/vnd.ecowin.seriesupdate": {
- "source": "iana"
- },
- "application/vnd.emclient.accessrequest+xml": {
- "source": "iana"
- },
- "application/vnd.enliven": {
- "source": "iana",
- "extensions": ["nml"]
- },
- "application/vnd.enphase.envoy": {
- "source": "iana"
- },
- "application/vnd.eprints.data+xml": {
- "source": "iana"
- },
- "application/vnd.epson.esf": {
- "source": "iana",
- "extensions": ["esf"]
- },
- "application/vnd.epson.msf": {
- "source": "iana",
- "extensions": ["msf"]
- },
- "application/vnd.epson.quickanime": {
- "source": "iana",
- "extensions": ["qam"]
- },
- "application/vnd.epson.salt": {
- "source": "iana",
- "extensions": ["slt"]
- },
- "application/vnd.epson.ssf": {
- "source": "iana",
- "extensions": ["ssf"]
- },
- "application/vnd.ericsson.quickcall": {
- "source": "iana"
- },
- "application/vnd.eszigno3+xml": {
- "source": "iana",
- "extensions": ["es3","et3"]
- },
- "application/vnd.etsi.aoc+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.asic-e+zip": {
- "source": "iana"
- },
- "application/vnd.etsi.asic-s+zip": {
- "source": "iana"
- },
- "application/vnd.etsi.cug+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvcommand+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvdiscovery+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvprofile+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvsad-bc+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvsad-cod+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvsad-npvr+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvservice+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvsync+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.iptvueprofile+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.mcid+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.mheg5": {
- "source": "iana"
- },
- "application/vnd.etsi.overload-control-policy-dataset+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.pstn+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.sci+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.simservs+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.timestamp-token": {
- "source": "iana"
- },
- "application/vnd.etsi.tsl+xml": {
- "source": "iana"
- },
- "application/vnd.etsi.tsl.der": {
- "source": "iana"
- },
- "application/vnd.eudora.data": {
- "source": "iana"
- },
- "application/vnd.ezpix-album": {
- "source": "iana",
- "extensions": ["ez2"]
- },
- "application/vnd.ezpix-package": {
- "source": "iana",
- "extensions": ["ez3"]
- },
- "application/vnd.f-secure.mobile": {
- "source": "iana"
- },
- "application/vnd.fastcopy-disk-image": {
- "source": "iana"
- },
- "application/vnd.fdf": {
- "source": "iana",
- "extensions": ["fdf"]
- },
- "application/vnd.fdsn.mseed": {
- "source": "iana",
- "extensions": ["mseed"]
- },
- "application/vnd.fdsn.seed": {
- "source": "iana",
- "extensions": ["seed","dataless"]
- },
- "application/vnd.ffsns": {
- "source": "iana"
- },
- "application/vnd.fints": {
- "source": "iana"
- },
- "application/vnd.flographit": {
- "source": "iana",
- "extensions": ["gph"]
- },
- "application/vnd.fluxtime.clip": {
- "source": "iana",
- "extensions": ["ftc"]
- },
- "application/vnd.font-fontforge-sfd": {
- "source": "iana"
- },
- "application/vnd.framemaker": {
- "source": "iana",
- "extensions": ["fm","frame","maker","book"]
- },
- "application/vnd.frogans.fnc": {
- "source": "iana",
- "extensions": ["fnc"]
- },
- "application/vnd.frogans.ltf": {
- "source": "iana",
- "extensions": ["ltf"]
- },
- "application/vnd.fsc.weblaunch": {
- "source": "iana",
- "extensions": ["fsc"]
- },
- "application/vnd.fujitsu.oasys": {
- "source": "iana",
- "extensions": ["oas"]
- },
- "application/vnd.fujitsu.oasys2": {
- "source": "iana",
- "extensions": ["oa2"]
- },
- "application/vnd.fujitsu.oasys3": {
- "source": "iana",
- "extensions": ["oa3"]
- },
- "application/vnd.fujitsu.oasysgp": {
- "source": "iana",
- "extensions": ["fg5"]
- },
- "application/vnd.fujitsu.oasysprs": {
- "source": "iana",
- "extensions": ["bh2"]
- },
- "application/vnd.fujixerox.art-ex": {
- "source": "iana"
- },
- "application/vnd.fujixerox.art4": {
- "source": "iana"
- },
- "application/vnd.fujixerox.ddd": {
- "source": "iana",
- "extensions": ["ddd"]
- },
- "application/vnd.fujixerox.docuworks": {
- "source": "iana",
- "extensions": ["xdw"]
- },
- "application/vnd.fujixerox.docuworks.binder": {
- "source": "iana",
- "extensions": ["xbd"]
- },
- "application/vnd.fujixerox.docuworks.container": {
- "source": "iana"
- },
- "application/vnd.fujixerox.hbpl": {
- "source": "iana"
- },
- "application/vnd.fut-misnet": {
- "source": "iana"
- },
- "application/vnd.fuzzysheet": {
- "source": "iana",
- "extensions": ["fzs"]
- },
- "application/vnd.genomatix.tuxedo": {
- "source": "iana",
- "extensions": ["txd"]
- },
- "application/vnd.geo+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.geocube+xml": {
- "source": "iana"
- },
- "application/vnd.geogebra.file": {
- "source": "iana",
- "extensions": ["ggb"]
- },
- "application/vnd.geogebra.tool": {
- "source": "iana",
- "extensions": ["ggt"]
- },
- "application/vnd.geometry-explorer": {
- "source": "iana",
- "extensions": ["gex","gre"]
- },
- "application/vnd.geonext": {
- "source": "iana",
- "extensions": ["gxt"]
- },
- "application/vnd.geoplan": {
- "source": "iana",
- "extensions": ["g2w"]
- },
- "application/vnd.geospace": {
- "source": "iana",
- "extensions": ["g3w"]
- },
- "application/vnd.gerber": {
- "source": "iana"
- },
- "application/vnd.globalplatform.card-content-mgt": {
- "source": "iana"
- },
- "application/vnd.globalplatform.card-content-mgt-response": {
- "source": "iana"
- },
- "application/vnd.gmx": {
- "source": "iana",
- "extensions": ["gmx"]
- },
- "application/vnd.google-earth.kml+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["kml"]
- },
- "application/vnd.google-earth.kmz": {
- "source": "iana",
- "compressible": false,
- "extensions": ["kmz"]
- },
- "application/vnd.gov.sk.e-form+xml": {
- "source": "iana"
- },
- "application/vnd.gov.sk.e-form+zip": {
- "source": "iana"
- },
- "application/vnd.gov.sk.xmldatacontainer+xml": {
- "source": "iana"
- },
- "application/vnd.grafeq": {
- "source": "iana",
- "extensions": ["gqf","gqs"]
- },
- "application/vnd.gridmp": {
- "source": "iana"
- },
- "application/vnd.groove-account": {
- "source": "iana",
- "extensions": ["gac"]
- },
- "application/vnd.groove-help": {
- "source": "iana",
- "extensions": ["ghf"]
- },
- "application/vnd.groove-identity-message": {
- "source": "iana",
- "extensions": ["gim"]
- },
- "application/vnd.groove-injector": {
- "source": "iana",
- "extensions": ["grv"]
- },
- "application/vnd.groove-tool-message": {
- "source": "iana",
- "extensions": ["gtm"]
- },
- "application/vnd.groove-tool-template": {
- "source": "iana",
- "extensions": ["tpl"]
- },
- "application/vnd.groove-vcard": {
- "source": "iana",
- "extensions": ["vcg"]
- },
- "application/vnd.hal+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hal+xml": {
- "source": "iana",
- "extensions": ["hal"]
- },
- "application/vnd.handheld-entertainment+xml": {
- "source": "iana",
- "extensions": ["zmm"]
- },
- "application/vnd.hbci": {
- "source": "iana",
- "extensions": ["hbci"]
- },
- "application/vnd.hcl-bireports": {
- "source": "iana"
- },
- "application/vnd.heroku+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.hhe.lesson-player": {
- "source": "iana",
- "extensions": ["les"]
- },
- "application/vnd.hp-hpgl": {
- "source": "iana",
- "extensions": ["hpgl"]
- },
- "application/vnd.hp-hpid": {
- "source": "iana",
- "extensions": ["hpid"]
- },
- "application/vnd.hp-hps": {
- "source": "iana",
- "extensions": ["hps"]
- },
- "application/vnd.hp-jlyt": {
- "source": "iana",
- "extensions": ["jlt"]
- },
- "application/vnd.hp-pcl": {
- "source": "iana",
- "extensions": ["pcl"]
- },
- "application/vnd.hp-pclxl": {
- "source": "iana",
- "extensions": ["pclxl"]
- },
- "application/vnd.httphone": {
- "source": "iana"
- },
- "application/vnd.hydrostatix.sof-data": {
- "source": "iana"
- },
- "application/vnd.hzn-3d-crossword": {
- "source": "iana"
- },
- "application/vnd.ibm.afplinedata": {
- "source": "iana"
- },
- "application/vnd.ibm.electronic-media": {
- "source": "iana"
- },
- "application/vnd.ibm.minipay": {
- "source": "iana",
- "extensions": ["mpy"]
- },
- "application/vnd.ibm.modcap": {
- "source": "iana",
- "extensions": ["afp","listafp","list3820"]
- },
- "application/vnd.ibm.rights-management": {
- "source": "iana",
- "extensions": ["irm"]
- },
- "application/vnd.ibm.secure-container": {
- "source": "iana",
- "extensions": ["sc"]
- },
- "application/vnd.iccprofile": {
- "source": "iana",
- "extensions": ["icc","icm"]
- },
- "application/vnd.ieee.1905": {
- "source": "iana"
- },
- "application/vnd.igloader": {
- "source": "iana",
- "extensions": ["igl"]
- },
- "application/vnd.immervision-ivp": {
- "source": "iana",
- "extensions": ["ivp"]
- },
- "application/vnd.immervision-ivu": {
- "source": "iana",
- "extensions": ["ivu"]
- },
- "application/vnd.ims.imsccv1p1": {
- "source": "iana"
- },
- "application/vnd.ims.imsccv1p2": {
- "source": "iana"
- },
- "application/vnd.ims.imsccv1p3": {
- "source": "iana"
- },
- "application/vnd.ims.lis.v2.result+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolproxy+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolproxy.id+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolsettings+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.ims.lti.v2.toolsettings.simple+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.informedcontrol.rms+xml": {
- "source": "iana"
- },
- "application/vnd.informix-visionary": {
- "source": "iana"
- },
- "application/vnd.infotech.project": {
- "source": "iana"
- },
- "application/vnd.infotech.project+xml": {
- "source": "iana"
- },
- "application/vnd.innopath.wamp.notification": {
- "source": "iana"
- },
- "application/vnd.insors.igm": {
- "source": "iana",
- "extensions": ["igm"]
- },
- "application/vnd.intercon.formnet": {
- "source": "iana",
- "extensions": ["xpw","xpx"]
- },
- "application/vnd.intergeo": {
- "source": "iana",
- "extensions": ["i2g"]
- },
- "application/vnd.intertrust.digibox": {
- "source": "iana"
- },
- "application/vnd.intertrust.nncp": {
- "source": "iana"
- },
- "application/vnd.intu.qbo": {
- "source": "iana",
- "extensions": ["qbo"]
- },
- "application/vnd.intu.qfx": {
- "source": "iana",
- "extensions": ["qfx"]
- },
- "application/vnd.iptc.g2.catalogitem+xml": {
- "source": "iana"
- },
- "application/vnd.iptc.g2.conceptitem+xml": {
- "source": "iana"
- },
- "application/vnd.iptc.g2.knowledgeitem+xml": {
- "source": "iana"
- },
- "application/vnd.iptc.g2.newsitem+xml": {
- "source": "iana"
- },
- "application/vnd.iptc.g2.newsmessage+xml": {
- "source": "iana"
- },
- "application/vnd.iptc.g2.packageitem+xml": {
- "source": "iana"
- },
- "application/vnd.iptc.g2.planningitem+xml": {
- "source": "iana"
- },
- "application/vnd.ipunplugged.rcprofile": {
- "source": "iana",
- "extensions": ["rcprofile"]
- },
- "application/vnd.irepository.package+xml": {
- "source": "iana",
- "extensions": ["irp"]
- },
- "application/vnd.is-xpr": {
- "source": "iana",
- "extensions": ["xpr"]
- },
- "application/vnd.isac.fcs": {
- "source": "iana",
- "extensions": ["fcs"]
- },
- "application/vnd.jam": {
- "source": "iana",
- "extensions": ["jam"]
- },
- "application/vnd.japannet-directory-service": {
- "source": "iana"
- },
- "application/vnd.japannet-jpnstore-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-payment-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-registration": {
- "source": "iana"
- },
- "application/vnd.japannet-registration-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-setstore-wakeup": {
- "source": "iana"
- },
- "application/vnd.japannet-verification": {
- "source": "iana"
- },
- "application/vnd.japannet-verification-wakeup": {
- "source": "iana"
- },
- "application/vnd.jcp.javame.midlet-rms": {
- "source": "iana",
- "extensions": ["rms"]
- },
- "application/vnd.jisp": {
- "source": "iana",
- "extensions": ["jisp"]
- },
- "application/vnd.joost.joda-archive": {
- "source": "iana",
- "extensions": ["joda"]
- },
- "application/vnd.jsk.isdn-ngn": {
- "source": "iana"
- },
- "application/vnd.kahootz": {
- "source": "iana",
- "extensions": ["ktz","ktr"]
- },
- "application/vnd.kde.karbon": {
- "source": "iana",
- "extensions": ["karbon"]
- },
- "application/vnd.kde.kchart": {
- "source": "iana",
- "extensions": ["chrt"]
- },
- "application/vnd.kde.kformula": {
- "source": "iana",
- "extensions": ["kfo"]
- },
- "application/vnd.kde.kivio": {
- "source": "iana",
- "extensions": ["flw"]
- },
- "application/vnd.kde.kontour": {
- "source": "iana",
- "extensions": ["kon"]
- },
- "application/vnd.kde.kpresenter": {
- "source": "iana",
- "extensions": ["kpr","kpt"]
- },
- "application/vnd.kde.kspread": {
- "source": "iana",
- "extensions": ["ksp"]
- },
- "application/vnd.kde.kword": {
- "source": "iana",
- "extensions": ["kwd","kwt"]
- },
- "application/vnd.kenameaapp": {
- "source": "iana",
- "extensions": ["htke"]
- },
- "application/vnd.kidspiration": {
- "source": "iana",
- "extensions": ["kia"]
- },
- "application/vnd.kinar": {
- "source": "iana",
- "extensions": ["kne","knp"]
- },
- "application/vnd.koan": {
- "source": "iana",
- "extensions": ["skp","skd","skt","skm"]
- },
- "application/vnd.kodak-descriptor": {
- "source": "iana",
- "extensions": ["sse"]
- },
- "application/vnd.las.las+xml": {
- "source": "iana",
- "extensions": ["lasxml"]
- },
- "application/vnd.liberty-request+xml": {
- "source": "iana"
- },
- "application/vnd.llamagraphics.life-balance.desktop": {
- "source": "iana",
- "extensions": ["lbd"]
- },
- "application/vnd.llamagraphics.life-balance.exchange+xml": {
- "source": "iana",
- "extensions": ["lbe"]
- },
- "application/vnd.lotus-1-2-3": {
- "source": "iana",
- "extensions": ["123"]
- },
- "application/vnd.lotus-approach": {
- "source": "iana",
- "extensions": ["apr"]
- },
- "application/vnd.lotus-freelance": {
- "source": "iana",
- "extensions": ["pre"]
- },
- "application/vnd.lotus-notes": {
- "source": "iana",
- "extensions": ["nsf"]
- },
- "application/vnd.lotus-organizer": {
- "source": "iana",
- "extensions": ["org"]
- },
- "application/vnd.lotus-screencam": {
- "source": "iana",
- "extensions": ["scm"]
- },
- "application/vnd.lotus-wordpro": {
- "source": "iana",
- "extensions": ["lwp"]
- },
- "application/vnd.macports.portpkg": {
- "source": "iana",
- "extensions": ["portpkg"]
- },
- "application/vnd.marlin.drm.actiontoken+xml": {
- "source": "iana"
- },
- "application/vnd.marlin.drm.conftoken+xml": {
- "source": "iana"
- },
- "application/vnd.marlin.drm.license+xml": {
- "source": "iana"
- },
- "application/vnd.marlin.drm.mdcf": {
- "source": "iana"
- },
- "application/vnd.mason+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.maxmind.maxmind-db": {
- "source": "iana"
- },
- "application/vnd.mcd": {
- "source": "iana",
- "extensions": ["mcd"]
- },
- "application/vnd.medcalcdata": {
- "source": "iana",
- "extensions": ["mc1"]
- },
- "application/vnd.mediastation.cdkey": {
- "source": "iana",
- "extensions": ["cdkey"]
- },
- "application/vnd.meridian-slingshot": {
- "source": "iana"
- },
- "application/vnd.mfer": {
- "source": "iana",
- "extensions": ["mwf"]
- },
- "application/vnd.mfmp": {
- "source": "iana",
- "extensions": ["mfm"]
- },
- "application/vnd.micro+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.micrografx.flo": {
- "source": "iana",
- "extensions": ["flo"]
- },
- "application/vnd.micrografx.igx": {
- "source": "iana",
- "extensions": ["igx"]
- },
- "application/vnd.microsoft.portable-executable": {
- "source": "iana"
- },
- "application/vnd.miele+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.mif": {
- "source": "iana",
- "extensions": ["mif"]
- },
- "application/vnd.minisoft-hp3000-save": {
- "source": "iana"
- },
- "application/vnd.mitsubishi.misty-guard.trustweb": {
- "source": "iana"
- },
- "application/vnd.mobius.daf": {
- "source": "iana",
- "extensions": ["daf"]
- },
- "application/vnd.mobius.dis": {
- "source": "iana",
- "extensions": ["dis"]
- },
- "application/vnd.mobius.mbk": {
- "source": "iana",
- "extensions": ["mbk"]
- },
- "application/vnd.mobius.mqy": {
- "source": "iana",
- "extensions": ["mqy"]
- },
- "application/vnd.mobius.msl": {
- "source": "iana",
- "extensions": ["msl"]
- },
- "application/vnd.mobius.plc": {
- "source": "iana",
- "extensions": ["plc"]
- },
- "application/vnd.mobius.txf": {
- "source": "iana",
- "extensions": ["txf"]
- },
- "application/vnd.mophun.application": {
- "source": "iana",
- "extensions": ["mpn"]
- },
- "application/vnd.mophun.certificate": {
- "source": "iana",
- "extensions": ["mpc"]
- },
- "application/vnd.motorola.flexsuite": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.adsi": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.fis": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.gotap": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.kmr": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.ttc": {
- "source": "iana"
- },
- "application/vnd.motorola.flexsuite.wem": {
- "source": "iana"
- },
- "application/vnd.motorola.iprm": {
- "source": "iana"
- },
- "application/vnd.mozilla.xul+xml": {
- "source": "iana",
- "compressible": true,
- "extensions": ["xul"]
- },
- "application/vnd.ms-3mfdocument": {
- "source": "iana"
- },
- "application/vnd.ms-artgalry": {
- "source": "iana",
- "extensions": ["cil"]
- },
- "application/vnd.ms-asf": {
- "source": "iana"
- },
- "application/vnd.ms-cab-compressed": {
- "source": "iana",
- "extensions": ["cab"]
- },
- "application/vnd.ms-color.iccprofile": {
- "source": "apache"
- },
- "application/vnd.ms-excel": {
- "source": "iana",
- "compressible": false,
- "extensions": ["xls","xlm","xla","xlc","xlt","xlw"]
- },
- "application/vnd.ms-excel.addin.macroenabled.12": {
- "source": "iana",
- "extensions": ["xlam"]
- },
- "application/vnd.ms-excel.sheet.binary.macroenabled.12": {
- "source": "iana",
- "extensions": ["xlsb"]
- },
- "application/vnd.ms-excel.sheet.macroenabled.12": {
- "source": "iana",
- "extensions": ["xlsm"]
- },
- "application/vnd.ms-excel.template.macroenabled.12": {
- "source": "iana",
- "extensions": ["xltm"]
- },
- "application/vnd.ms-fontobject": {
- "source": "iana",
- "compressible": true,
- "extensions": ["eot"]
- },
- "application/vnd.ms-htmlhelp": {
- "source": "iana",
- "extensions": ["chm"]
- },
- "application/vnd.ms-ims": {
- "source": "iana",
- "extensions": ["ims"]
- },
- "application/vnd.ms-lrm": {
- "source": "iana",
- "extensions": ["lrm"]
- },
- "application/vnd.ms-office.activex+xml": {
- "source": "iana"
- },
- "application/vnd.ms-officetheme": {
- "source": "iana",
- "extensions": ["thmx"]
- },
- "application/vnd.ms-opentype": {
- "source": "apache",
- "compressible": true
- },
- "application/vnd.ms-package.obfuscated-opentype": {
- "source": "apache"
- },
- "application/vnd.ms-pki.seccat": {
- "source": "apache",
- "extensions": ["cat"]
- },
- "application/vnd.ms-pki.stl": {
- "source": "apache",
- "extensions": ["stl"]
- },
- "application/vnd.ms-playready.initiator+xml": {
- "source": "iana"
- },
- "application/vnd.ms-powerpoint": {
- "source": "iana",
- "compressible": false,
- "extensions": ["ppt","pps","pot"]
- },
- "application/vnd.ms-powerpoint.addin.macroenabled.12": {
- "source": "iana",
- "extensions": ["ppam"]
- },
- "application/vnd.ms-powerpoint.presentation.macroenabled.12": {
- "source": "iana",
- "extensions": ["pptm"]
- },
- "application/vnd.ms-powerpoint.slide.macroenabled.12": {
- "source": "iana",
- "extensions": ["sldm"]
- },
- "application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
- "source": "iana",
- "extensions": ["ppsm"]
- },
- "application/vnd.ms-powerpoint.template.macroenabled.12": {
- "source": "iana",
- "extensions": ["potm"]
- },
- "application/vnd.ms-printing.printticket+xml": {
- "source": "apache"
- },
- "application/vnd.ms-project": {
- "source": "iana",
- "extensions": ["mpp","mpt"]
- },
- "application/vnd.ms-tnef": {
- "source": "iana"
- },
- "application/vnd.ms-windows.printerpairing": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.lic-chlg-req": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.lic-resp": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.meter-chlg-req": {
- "source": "iana"
- },
- "application/vnd.ms-wmdrm.meter-resp": {
- "source": "iana"
- },
- "application/vnd.ms-word.document.macroenabled.12": {
- "source": "iana",
- "extensions": ["docm"]
- },
- "application/vnd.ms-word.template.macroenabled.12": {
- "source": "iana",
- "extensions": ["dotm"]
- },
- "application/vnd.ms-works": {
- "source": "iana",
- "extensions": ["wps","wks","wcm","wdb"]
- },
- "application/vnd.ms-wpl": {
- "source": "iana",
- "extensions": ["wpl"]
- },
- "application/vnd.ms-xpsdocument": {
- "source": "iana",
- "compressible": false,
- "extensions": ["xps"]
- },
- "application/vnd.msa-disk-image": {
- "source": "iana"
- },
- "application/vnd.mseq": {
- "source": "iana",
- "extensions": ["mseq"]
- },
- "application/vnd.msign": {
- "source": "iana"
- },
- "application/vnd.multiad.creator": {
- "source": "iana"
- },
- "application/vnd.multiad.creator.cif": {
- "source": "iana"
- },
- "application/vnd.music-niff": {
- "source": "iana"
- },
- "application/vnd.musician": {
- "source": "iana",
- "extensions": ["mus"]
- },
- "application/vnd.muvee.style": {
- "source": "iana",
- "extensions": ["msty"]
- },
- "application/vnd.mynfc": {
- "source": "iana",
- "extensions": ["taglet"]
- },
- "application/vnd.ncd.control": {
- "source": "iana"
- },
- "application/vnd.ncd.reference": {
- "source": "iana"
- },
- "application/vnd.nervana": {
- "source": "iana"
- },
- "application/vnd.netfpx": {
- "source": "iana"
- },
- "application/vnd.neurolanguage.nlu": {
- "source": "iana",
- "extensions": ["nlu"]
- },
- "application/vnd.nintendo.nitro.rom": {
- "source": "iana"
- },
- "application/vnd.nintendo.snes.rom": {
- "source": "iana"
- },
- "application/vnd.nitf": {
- "source": "iana",
- "extensions": ["ntf","nitf"]
- },
- "application/vnd.noblenet-directory": {
- "source": "iana",
- "extensions": ["nnd"]
- },
- "application/vnd.noblenet-sealer": {
- "source": "iana",
- "extensions": ["nns"]
- },
- "application/vnd.noblenet-web": {
- "source": "iana",
- "extensions": ["nnw"]
- },
- "application/vnd.nokia.catalogs": {
- "source": "iana"
- },
- "application/vnd.nokia.conml+wbxml": {
- "source": "iana"
- },
- "application/vnd.nokia.conml+xml": {
- "source": "iana"
- },
- "application/vnd.nokia.iptv.config+xml": {
- "source": "iana"
- },
- "application/vnd.nokia.isds-radio-presets": {
- "source": "iana"
- },
- "application/vnd.nokia.landmark+wbxml": {
- "source": "iana"
- },
- "application/vnd.nokia.landmark+xml": {
- "source": "iana"
- },
- "application/vnd.nokia.landmarkcollection+xml": {
- "source": "iana"
- },
- "application/vnd.nokia.n-gage.ac+xml": {
- "source": "iana"
- },
- "application/vnd.nokia.n-gage.data": {
- "source": "iana",
- "extensions": ["ngdat"]
- },
- "application/vnd.nokia.n-gage.symbian.install": {
- "source": "iana"
- },
- "application/vnd.nokia.ncd": {
- "source": "iana"
- },
- "application/vnd.nokia.pcd+wbxml": {
- "source": "iana"
- },
- "application/vnd.nokia.pcd+xml": {
- "source": "iana"
- },
- "application/vnd.nokia.radio-preset": {
- "source": "iana",
- "extensions": ["rpst"]
- },
- "application/vnd.nokia.radio-presets": {
- "source": "iana",
- "extensions": ["rpss"]
- },
- "application/vnd.novadigm.edm": {
- "source": "iana",
- "extensions": ["edm"]
- },
- "application/vnd.novadigm.edx": {
- "source": "iana",
- "extensions": ["edx"]
- },
- "application/vnd.novadigm.ext": {
- "source": "iana",
- "extensions": ["ext"]
- },
- "application/vnd.ntt-local.content-share": {
- "source": "iana"
- },
- "application/vnd.ntt-local.file-transfer": {
- "source": "iana"
- },
- "application/vnd.ntt-local.ogw_remote-access": {
- "source": "iana"
- },
- "application/vnd.ntt-local.sip-ta_remote": {
- "source": "iana"
- },
- "application/vnd.ntt-local.sip-ta_tcp_stream": {
- "source": "iana"
- },
- "application/vnd.oasis.opendocument.chart": {
- "source": "iana",
- "extensions": ["odc"]
- },
- "application/vnd.oasis.opendocument.chart-template": {
- "source": "iana",
- "extensions": ["otc"]
- },
- "application/vnd.oasis.opendocument.database": {
- "source": "iana",
- "extensions": ["odb"]
- },
- "application/vnd.oasis.opendocument.formula": {
- "source": "iana",
- "extensions": ["odf"]
- },
- "application/vnd.oasis.opendocument.formula-template": {
- "source": "iana",
- "extensions": ["odft"]
- },
- "application/vnd.oasis.opendocument.graphics": {
- "source": "iana",
- "compressible": false,
- "extensions": ["odg"]
- },
- "application/vnd.oasis.opendocument.graphics-template": {
- "source": "iana",
- "extensions": ["otg"]
- },
- "application/vnd.oasis.opendocument.image": {
- "source": "iana",
- "extensions": ["odi"]
- },
- "application/vnd.oasis.opendocument.image-template": {
- "source": "iana",
- "extensions": ["oti"]
- },
- "application/vnd.oasis.opendocument.presentation": {
- "source": "iana",
- "compressible": false,
- "extensions": ["odp"]
- },
- "application/vnd.oasis.opendocument.presentation-template": {
- "source": "iana",
- "extensions": ["otp"]
- },
- "application/vnd.oasis.opendocument.spreadsheet": {
- "source": "iana",
- "compressible": false,
- "extensions": ["ods"]
- },
- "application/vnd.oasis.opendocument.spreadsheet-template": {
- "source": "iana",
- "extensions": ["ots"]
- },
- "application/vnd.oasis.opendocument.text": {
- "source": "iana",
- "compressible": false,
- "extensions": ["odt"]
- },
- "application/vnd.oasis.opendocument.text-master": {
- "source": "iana",
- "extensions": ["odm"]
- },
- "application/vnd.oasis.opendocument.text-template": {
- "source": "iana",
- "extensions": ["ott"]
- },
- "application/vnd.oasis.opendocument.text-web": {
- "source": "iana",
- "extensions": ["oth"]
- },
- "application/vnd.obn": {
- "source": "iana"
- },
- "application/vnd.oftn.l10n+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.oipf.contentaccessdownload+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.contentaccessstreaming+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.cspg-hexbinary": {
- "source": "iana"
- },
- "application/vnd.oipf.dae.svg+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.dae.xhtml+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.mippvcontrolmessage+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.pae.gem": {
- "source": "iana"
- },
- "application/vnd.oipf.spdiscovery+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.spdlist+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.ueprofile+xml": {
- "source": "iana"
- },
- "application/vnd.oipf.userprofile+xml": {
- "source": "iana"
- },
- "application/vnd.olpc-sugar": {
- "source": "iana",
- "extensions": ["xo"]
- },
- "application/vnd.oma-scws-config": {
- "source": "iana"
- },
- "application/vnd.oma-scws-http-request": {
- "source": "iana"
- },
- "application/vnd.oma-scws-http-response": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.associated-procedure-parameter+xml": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.drm-trigger+xml": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.imd+xml": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.ltkm": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.notification+xml": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.provisioningtrigger": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.sgboot": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.sgdd+xml": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.sgdu": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.simple-symbol-container": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.smartcard-trigger+xml": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.sprov+xml": {
- "source": "iana"
- },
- "application/vnd.oma.bcast.stkm": {
- "source": "iana"
- },
- "application/vnd.oma.cab-address-book+xml": {
- "source": "iana"
- },
- "application/vnd.oma.cab-feature-handler+xml": {
- "source": "iana"
- },
- "application/vnd.oma.cab-pcc+xml": {
- "source": "iana"
- },
- "application/vnd.oma.cab-subs-invite+xml": {
- "source": "iana"
- },
- "application/vnd.oma.cab-user-prefs+xml": {
- "source": "iana"
- },
- "application/vnd.oma.dcd": {
- "source": "iana"
- },
- "application/vnd.oma.dcdc": {
- "source": "iana"
- },
- "application/vnd.oma.dd2+xml": {
- "source": "iana",
- "extensions": ["dd2"]
- },
- "application/vnd.oma.drm.risd+xml": {
- "source": "iana"
- },
- "application/vnd.oma.group-usage-list+xml": {
- "source": "iana"
- },
- "application/vnd.oma.pal+xml": {
- "source": "iana"
- },
- "application/vnd.oma.poc.detailed-progress-report+xml": {
- "source": "iana"
- },
- "application/vnd.oma.poc.final-report+xml": {
- "source": "iana"
- },
- "application/vnd.oma.poc.groups+xml": {
- "source": "iana"
- },
- "application/vnd.oma.poc.invocation-descriptor+xml": {
- "source": "iana"
- },
- "application/vnd.oma.poc.optimized-progress-report+xml": {
- "source": "iana"
- },
- "application/vnd.oma.push": {
- "source": "iana"
- },
- "application/vnd.oma.scidm.messages+xml": {
- "source": "iana"
- },
- "application/vnd.oma.xcap-directory+xml": {
- "source": "iana"
- },
- "application/vnd.omads-email+xml": {
- "source": "iana"
- },
- "application/vnd.omads-file+xml": {
- "source": "iana"
- },
- "application/vnd.omads-folder+xml": {
- "source": "iana"
- },
- "application/vnd.omaloc-supl-init": {
- "source": "iana"
- },
- "application/vnd.openeye.oeb": {
- "source": "iana"
- },
- "application/vnd.openofficeorg.extension": {
- "source": "apache",
- "extensions": ["oxt"]
- },
- "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.drawing+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml-template": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
- "source": "iana",
- "compressible": false,
- "extensions": ["pptx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slide": {
- "source": "iana",
- "extensions": ["sldx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
- "source": "iana",
- "extensions": ["ppsx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.template": {
- "source": "apache",
- "extensions": ["potx"]
- },
- "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml-template": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
- "source": "iana",
- "compressible": false,
- "extensions": ["xlsx"]
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
- "source": "apache",
- "extensions": ["xltx"]
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.theme+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.vmldrawing": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml-template": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
- "source": "iana",
- "compressible": false,
- "extensions": ["docx"]
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
- "source": "apache",
- "extensions": ["dotx"]
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-package.core-properties+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
- "source": "iana"
- },
- "application/vnd.openxmlformats-package.relationships+xml": {
- "source": "iana"
- },
- "application/vnd.oracle.resource+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.orange.indata": {
- "source": "iana"
- },
- "application/vnd.osa.netdeploy": {
- "source": "iana"
- },
- "application/vnd.osgeo.mapguide.package": {
- "source": "iana",
- "extensions": ["mgp"]
- },
- "application/vnd.osgi.bundle": {
- "source": "iana"
- },
- "application/vnd.osgi.dp": {
- "source": "iana",
- "extensions": ["dp"]
- },
- "application/vnd.osgi.subsystem": {
- "source": "iana",
- "extensions": ["esa"]
- },
- "application/vnd.otps.ct-kip+xml": {
- "source": "iana"
- },
- "application/vnd.palm": {
- "source": "iana",
- "extensions": ["pdb","pqa","oprc"]
- },
- "application/vnd.panoply": {
- "source": "iana"
- },
- "application/vnd.paos+xml": {
- "source": "iana"
- },
- "application/vnd.paos.xml": {
- "source": "apache"
- },
- "application/vnd.pawaafile": {
- "source": "iana",
- "extensions": ["paw"]
- },
- "application/vnd.pcos": {
- "source": "iana"
- },
- "application/vnd.pg.format": {
- "source": "iana",
- "extensions": ["str"]
- },
- "application/vnd.pg.osasli": {
- "source": "iana",
- "extensions": ["ei6"]
- },
- "application/vnd.piaccess.application-licence": {
- "source": "iana"
- },
- "application/vnd.picsel": {
- "source": "iana",
- "extensions": ["efif"]
- },
- "application/vnd.pmi.widget": {
- "source": "iana",
- "extensions": ["wg"]
- },
- "application/vnd.poc.group-advertisement+xml": {
- "source": "iana"
- },
- "application/vnd.pocketlearn": {
- "source": "iana",
- "extensions": ["plf"]
- },
- "application/vnd.powerbuilder6": {
- "source": "iana",
- "extensions": ["pbd"]
- },
- "application/vnd.powerbuilder6-s": {
- "source": "iana"
- },
- "application/vnd.powerbuilder7": {
- "source": "iana"
- },
- "application/vnd.powerbuilder7-s": {
- "source": "iana"
- },
- "application/vnd.powerbuilder75": {
- "source": "iana"
- },
- "application/vnd.powerbuilder75-s": {
- "source": "iana"
- },
- "application/vnd.preminet": {
- "source": "iana"
- },
- "application/vnd.previewsystems.box": {
- "source": "iana",
- "extensions": ["box"]
- },
- "application/vnd.proteus.magazine": {
- "source": "iana",
- "extensions": ["mgz"]
- },
- "application/vnd.publishare-delta-tree": {
- "source": "iana",
- "extensions": ["qps"]
- },
- "application/vnd.pvi.ptid1": {
- "source": "iana",
- "extensions": ["ptid"]
- },
- "application/vnd.pwg-multiplexed": {
- "source": "iana"
- },
- "application/vnd.pwg-xhtml-print+xml": {
- "source": "iana"
- },
- "application/vnd.qualcomm.brew-app-res": {
- "source": "iana"
- },
- "application/vnd.quark.quarkxpress": {
- "source": "iana",
- "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"]
- },
- "application/vnd.quobject-quoxdocument": {
- "source": "iana"
- },
- "application/vnd.radisys.moml+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-audit+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-audit-conf+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-audit-conn+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-audit-dialog+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-audit-stream+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-conf+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-dialog+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-dialog-base+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-dialog-fax-detect+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-dialog-group+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-dialog-speech+xml": {
- "source": "iana"
- },
- "application/vnd.radisys.msml-dialog-transform+xml": {
- "source": "iana"
- },
- "application/vnd.rainstor.data": {
- "source": "iana"
- },
- "application/vnd.rapid": {
- "source": "iana"
- },
- "application/vnd.realvnc.bed": {
- "source": "iana",
- "extensions": ["bed"]
- },
- "application/vnd.recordare.musicxml": {
- "source": "iana",
- "extensions": ["mxl"]
- },
- "application/vnd.recordare.musicxml+xml": {
- "source": "iana",
- "extensions": ["musicxml"]
- },
- "application/vnd.renlearn.rlprint": {
- "source": "iana"
- },
- "application/vnd.rig.cryptonote": {
- "source": "iana",
- "extensions": ["cryptonote"]
- },
- "application/vnd.rim.cod": {
- "source": "apache",
- "extensions": ["cod"]
- },
- "application/vnd.rn-realmedia": {
- "source": "apache",
- "extensions": ["rm"]
- },
- "application/vnd.rn-realmedia-vbr": {
- "source": "apache",
- "extensions": ["rmvb"]
- },
- "application/vnd.route66.link66+xml": {
- "source": "iana",
- "extensions": ["link66"]
- },
- "application/vnd.rs-274x": {
- "source": "iana"
- },
- "application/vnd.ruckus.download": {
- "source": "iana"
- },
- "application/vnd.s3sms": {
- "source": "iana"
- },
- "application/vnd.sailingtracker.track": {
- "source": "iana",
- "extensions": ["st"]
- },
- "application/vnd.sbm.cid": {
- "source": "iana"
- },
- "application/vnd.sbm.mid2": {
- "source": "iana"
- },
- "application/vnd.scribus": {
- "source": "iana"
- },
- "application/vnd.sealed.3df": {
- "source": "iana"
- },
- "application/vnd.sealed.csf": {
- "source": "iana"
- },
- "application/vnd.sealed.doc": {
- "source": "iana"
- },
- "application/vnd.sealed.eml": {
- "source": "iana"
- },
- "application/vnd.sealed.mht": {
- "source": "iana"
- },
- "application/vnd.sealed.net": {
- "source": "iana"
- },
- "application/vnd.sealed.ppt": {
- "source": "iana"
- },
- "application/vnd.sealed.tiff": {
- "source": "iana"
- },
- "application/vnd.sealed.xls": {
- "source": "iana"
- },
- "application/vnd.sealedmedia.softseal.html": {
- "source": "iana"
- },
- "application/vnd.sealedmedia.softseal.pdf": {
- "source": "iana"
- },
- "application/vnd.seemail": {
- "source": "iana",
- "extensions": ["see"]
- },
- "application/vnd.sema": {
- "source": "iana",
- "extensions": ["sema"]
- },
- "application/vnd.semd": {
- "source": "iana",
- "extensions": ["semd"]
- },
- "application/vnd.semf": {
- "source": "iana",
- "extensions": ["semf"]
- },
- "application/vnd.shana.informed.formdata": {
- "source": "iana",
- "extensions": ["ifm"]
- },
- "application/vnd.shana.informed.formtemplate": {
- "source": "iana",
- "extensions": ["itp"]
- },
- "application/vnd.shana.informed.interchange": {
- "source": "iana",
- "extensions": ["iif"]
- },
- "application/vnd.shana.informed.package": {
- "source": "iana",
- "extensions": ["ipk"]
- },
- "application/vnd.simtech-mindmapper": {
- "source": "iana",
- "extensions": ["twd","twds"]
- },
- "application/vnd.siren+json": {
- "source": "iana",
- "compressible": true
- },
- "application/vnd.smaf": {
- "source": "iana",
- "extensions": ["mmf"]
- },
- "application/vnd.smart.notebook": {
- "source": "iana"
- },
- "application/vnd.smart.teacher": {
- "source": "iana",
- "extensions": ["teacher"]
- },
- "application/vnd.software602.filler.form+xml": {
- "source": "iana"
- },
- "application/vnd.software602.filler.form-xml-zip": {
- "source": "iana"
- },
- "application/vnd.solent.sdkm+xml": {
- "source": "iana",
- "extensions": ["sdkm","sdkd"]
- },
- "application/vnd.spotfire.dxp": {
- "source": "iana",
- "extensions": ["dxp"]
- },
- "application/vnd.spotfire.sfs": {
- "source": "iana",
- "extensions": ["sfs"]
- },
- "application/vnd.sss-cod": {
- "source": "iana"
- },
- "application/vnd.sss-dtf": {
- "source": "iana"
- },
- "application/vnd.sss-ntf": {
- "source": "iana"
- },
- "application/vnd.stardivision.calc": {
- "source": "apache",
- "extensions": ["sdc"]
- },
- "application/vnd.stardivision.draw": {
- "source": "apache",
- "extensions": ["sda"]
- },
- "application/vnd.stardivision.impress": {
- "source": "apache",
- "extensions": ["sdd"]
- },
- "application/vnd.stardivision.math": {
- "source": "apache",
- "extensions": ["smf"]
- },
- "application/vnd.stardivision.writer": {
- "source": "apache",
- "extensions": ["sdw","vor"]
- },
- "application/vnd.stardivision.writer-global": {
- "source": "apache",
- "extensions": ["sgl"]
- },
- "application/vnd.stepmania.package": {
- "source": "iana",
- "extensions": ["smzip"]
- },
- "application/vnd.stepmania.stepchart": {
- "source": "iana",
- "extensions": ["sm"]
- },
- "application/vnd.street-stream": {
- "source": "iana"
- },
- "application/vnd.sun.wadl+xml": {
- "source": "iana"
- },
- "application/vnd.sun.xml.calc": {
- "source": "apache",
- "extensions": ["sxc"]
- },
- "application/vnd.sun.xml.calc.template": {
- "source": "apache",
- "extensions": ["stc"]
- },
- "application/vnd.sun.xml.draw": {
- "source": "apache",
- "extensions": ["sxd"]
- },
- "application/vnd.sun.xml.draw.template": {
- "source": "apache",
- "extensions": ["std"]
- },
- "application/vnd.sun.xml.impress": {
- "source": "apache",
- "extensions": ["sxi"]
- },
- "application/vnd.sun.xml.impress.template": {
- "source": "apache",
- "extensions": ["sti"]
- },
- "application/vnd.sun.xml.math": {
- "source": "apache",
- "extensions": ["sxm"]
- },
- "application/vnd.sun.xml.writer": {
- "source": "apache",
- "extensions": ["sxw"]
- },
- "application/vnd.sun.xml.writer.global": {
- "source": "apache",
- "extensions": ["sxg"]
- },
- "application/vnd.sun.xml.writer.template": {
- "source": "apache",
- "extensions": ["stw"]
- },
- "application/vnd.sus-calendar": {
- "source": "iana",
- "extensions": ["sus","susp"]
- },
- "application/vnd.svd": {
- "source": "iana",
- "extensions": ["svd"]
-
<TRUNCATED>
[56/59] [abbrv] couchdb-nmo git commit: add wreck@5.6.0
Posted by ro...@apache.org.
add wreck@5.6.0
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/bd300fa9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/bd300fa9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/bd300fa9
Branch: refs/heads/master
Commit: bd300fa9f4edef8bd3f44454133866058838cabb
Parents: 7ee4acd
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Jun 26 00:51:27 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri Jun 26 00:51:27 2015 +0200
----------------------------------------------------------------------
node_modules/wreck/.npmignore | 18 +
node_modules/wreck/.travis.yml | 8 +
node_modules/wreck/CONTRIBUTING.md | 14 +
node_modules/wreck/LICENSE | 28 +
node_modules/wreck/README.md | 234 ++
node_modules/wreck/images/wreck.png | Bin 0 -> 30090 bytes
node_modules/wreck/lib/index.js | 472 ++++
node_modules/wreck/lib/payload.js | 42 +
node_modules/wreck/lib/recorder.js | 44 +
node_modules/wreck/lib/tap.js | 33 +
node_modules/wreck/node_modules/boom/.npmignore | 18 +
.../wreck/node_modules/boom/.travis.yml | 7 +
.../wreck/node_modules/boom/CONTRIBUTING.md | 1 +
node_modules/wreck/node_modules/boom/LICENSE | 28 +
node_modules/wreck/node_modules/boom/README.md | 597 +++++
.../wreck/node_modules/boom/images/boom.png | Bin 0 -> 29479 bytes
.../wreck/node_modules/boom/lib/index.js | 301 +++
.../wreck/node_modules/boom/package.json | 64 +
.../wreck/node_modules/boom/test/index.js | 616 +++++
node_modules/wreck/node_modules/hoek/.npmignore | 18 +
.../wreck/node_modules/hoek/.travis.yml | 7 +
.../wreck/node_modules/hoek/CONTRIBUTING.md | 1 +
node_modules/wreck/node_modules/hoek/LICENSE | 31 +
node_modules/wreck/node_modules/hoek/Makefile | 8 +
node_modules/wreck/node_modules/hoek/README.md | 574 +++++
.../wreck/node_modules/hoek/images/hoek.png | Bin 0 -> 37939 bytes
node_modules/wreck/node_modules/hoek/index.js | 1 +
.../wreck/node_modules/hoek/lib/escape.js | 132 +
.../wreck/node_modules/hoek/lib/index.js | 977 +++++++
.../wreck/node_modules/hoek/package.json | 60 +
.../wreck/node_modules/hoek/test/escaper.js | 88 +
.../wreck/node_modules/hoek/test/index.js | 2425 ++++++++++++++++++
.../node_modules/hoek/test/modules/ignore.txt | 0
.../node_modules/hoek/test/modules/test1.js | 1 +
.../node_modules/hoek/test/modules/test2.js | 1 +
.../node_modules/hoek/test/modules/test3.js | 1 +
node_modules/wreck/package.json | 61 +
node_modules/wreck/test/index.js | 1752 +++++++++++++
38 files changed, 8663 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/wreck/.npmignore b/node_modules/wreck/.npmignore
new file mode 100644
index 0000000..77ba16c
--- /dev/null
+++ b/node_modules/wreck/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/wreck/.travis.yml b/node_modules/wreck/.travis.yml
new file mode 100755
index 0000000..119800a
--- /dev/null
+++ b/node_modules/wreck/.travis.yml
@@ -0,0 +1,8 @@
+sudo: false
+language: node_js
+
+node_js:
+ - "0.10"
+ - "0.12"
+ - iojs
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/wreck/CONTRIBUTING.md b/node_modules/wreck/CONTRIBUTING.md
new file mode 100644
index 0000000..2fe9f7c
--- /dev/null
+++ b/node_modules/wreck/CONTRIBUTING.md
@@ -0,0 +1,14 @@
+# How to contribute
+We welcome contributions from the community and are pleased to have them. Please follow this guide when logging issues or making code changes.
+
+## Logging Issues
+All issues should be created using the [new issue form](https://github.com/hapijs/wreck/issues/new). Clearly describe the issue including steps to reproduce if there are any. Also, make sure to indicate the earliest version that has the issue being reported.
+
+## Patching Code
+Code changes are welcome and should follow the guidelines below.
+
+* Fork the repository on GitHub.
+* Fix the issue ensuring that your code follows the [style guide](https://github.com/hapijs/contrib/blob/master/Style.md).
+* Add tests for your new code ensuring that you have 100% code coverage (we can help you reach 100% but will not merge without it).
+ * Run `make test-cov-html` to generate a report of test coverage
+* [Pull requests](http://help.github.com/send-pull-requests/) should be made to the [master branch](https://github.com/hapijs/wreck/tree/master).
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/wreck/LICENSE b/node_modules/wreck/LICENSE
new file mode 100755
index 0000000..0d67fed
--- /dev/null
+++ b/node_modules/wreck/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2014, Walmart and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/wreck/graphs/contributors
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/README.md
----------------------------------------------------------------------
diff --git a/node_modules/wreck/README.md b/node_modules/wreck/README.md
new file mode 100755
index 0000000..fd9cf7c
--- /dev/null
+++ b/node_modules/wreck/README.md
@@ -0,0 +1,234 @@
+
+
+HTTP Client Utilities
+
+[](http://travis-ci.org/hapijs/wreck)
+
+Lead Maintainer: [Wyatt Preul](https://github.com/geek)
+
+## Usage
+
+### Basic
+```javascript
+var Wreck = require('wreck');
+
+Wreck.get('https://google.com/', function (err, res, payload) {
+ /* do stuff */
+});
+```
+
+### Advanced
+```javascript
+var Wreck = require('wreck');
+
+var method = 'GET'; // GET, POST, PUT, DELETE
+var uri = 'https://google.com/';
+var readableStream = Wreck.toReadableStream('foo=bar');
+
+var wreck = Wreck.defaults({
+ headers: { 'x-foo-bar': 123 }
+});
+
+// cascading example -- does not alter `wreck`
+var wreckWithTimeout = wreck.defaults({
+ timeout: 5
+});
+
+// all attributes are optional
+var options = {
+ baseUrl: fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain.
+ If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. Any
+ querystring in the `baseUrl` will be overwritten with the querystring in the `uri` When `baseUrl` is given, `uri` must also be a string.
+ payload: readableStream || 'foo=bar' || new Buffer('foo=bar'),
+ headers: { /* http headers */ },
+ redirects: 3,
+ timeout: 1000, // 1 second, default: unlimited
+ maxBytes: 1048576, // 1 MB, default: unlimited
+ rejectUnauthorized: true || false,
+ downstreamRes: null,
+ agent: null, // Node Core http.Agent
+ secureProtocol: 'SSLv3_method' // The SSL method to use
+};
+
+var optionalCallback = function (err, res) {
+
+ /* handle err if it exists, in which case res will be undefined */
+
+ // buffer the response stream
+ Wreck.read(res, null, function (err, body) {
+ /* do stuff */
+ });
+};
+
+var req = wreck.request(method, uri, options, optionalCallback);
+```
+
+### `defaults(options)`
+
+Returns a *new* instance of Wreck which merges the provided `options` with those provided on a per-request basis. You can call defaults repeatedly to build up multiple http clients.
+- `options` - Config object containing settings for both `request` and `read` operations.
+
+### `request(method, uri, [options, [callback]])`
+
+Initiate an HTTP request.
+- `method` - A string specifying the HTTP request method, defaulting to 'GET'.
+- `uri` - The URI of the requested resource.
+- `options` - An optional configuration object. To omit this argument but still
+ use a callback, pass `null` in this position. The options object supports the
+ following optional keys:
+ - `payload` - The request body as string, Buffer, or Readable Stream.
+ - `headers` - An object containing request headers.
+ - `rejectUnauthorized` - [TLS](http://nodejs.org/api/tls.html) flag indicating
+ whether the client should reject a response from a server with invalid certificates. This cannot be set at the
+ same time as the `agent` option is set.
+ - `redirects` - The maximum number of redirects to follow.
+ - `agent` - Node Core [http.Agent](http://nodejs.org/api/http.html#http_class_http_agent).
+ Defaults to either `wreck.agents.http` or `wreck.agents.https`. Setting to `false` disables agent pooling.
+ - `timeout` - The number of milliseconds to wait without receiving a response
+ before aborting the request. Defaults to unlimited.
+ - `secureProtocol` - [TLS](http://nodejs.org/api/tls.html) flag indicating the SSL method to use, e.g. `SSLv3_method`
+ to force SSL version 3. The possible values depend on your installation of OpenSSL. Read the official OpenSSL docs
+ for possible [SSL_METHODS](http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS).
+- `callback` - The optional callback function using the signature `function (err, response)` where:
+ - `err` - Any error that may have occurred during the handling of the request.
+ - `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage)
+ object, which is also a readable stream.
+
+Returns an instance of the node.js [ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object.
+
+
+### `read(response, options, callback)`
+- `response` - An HTTP Incoming Message object.
+- `options` - `null` or a configuration object with the following optional keys:
+ - `timeout` - The number of milliseconds to wait while reading data before
+ aborting handling of the response. Defaults to unlimited.
+ - `json` - A value indicating how to try to parse the payload as JSON. Defaults to `undefined` meaning no parse logic.
+ - `true`, 'smart' - only try `JSON.parse` if the response indicates a JSON content-type.
+ - `force` - try `JSON.parse` regardless of the content-type header.
+ - `maxBytes` - The maximum allowed response payload size. Defaults to unlimited.
+- `callback` - The callback function using the signature `function (err, payload)` where:
+ - `err` - Any error that may have occurred while reading the response.
+ - `payload` - The payload in the form of a Buffer or (optionally) parsed JavaScript object (JSON).
+
+
+### `get(uri, [options], callback)`
+
+Convenience method for GET operations.
+- `uri` - The URI of the requested resource.
+- `options` - Optional config object containing settings for both `request` and
+ `read` operations.
+- `callback` - The callback function using the signature `function (err, response, payload)` where:
+ - `err` - Any error that may have occurred during handling of the request.
+ - `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage)
+ object, which is also a readable stream.
+ - `payload` - The payload in the form of a Buffer or (optionally) parsed JavaScript object (JSON).
+
+Returns an instance of the node.js [ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object.
+
+
+### `post(uri, [options], callback)`
+
+Convenience method for POST operations.
+- `uri` - The URI of the requested resource.
+- `options` - Optional config object containing settings for both `request` and
+ `read` operations.
+- `callback` - The callback function using the signature `function (err, response, payload)` where:
+ - `err` - Any error that may have occurred during handling of the request.
+ - `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage)
+ object, which is also a readable stream.
+ - `payload` - The payload in the form of a Buffer or (optionally) parsed JavaScript object (JSON).
+
+Returns an instance of the node.js [ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object.
+
+
+### `put(uri, [options], callback)`
+
+Convenience method for PUT operations.
+- `uri` - The URI of the requested resource.
+- `options` - Optional config object containing settings for both `request` and
+ `read` operations.
+- `callback` - The callback function using the signature `function (err, response, payload)` where:
+ - `err` - Any error that may have occurred during handling of the request.
+ - `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage)
+ object, which is also a readable stream.
+ - `payload` - The payload in the form of a Buffer or (optionally) parsed JavaScript object (JSON).
+
+Returns an instance of the node.js [ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object.
+
+
+### `delete(uri, [options], callback)`
+
+Convenience method for DELETE operations.
+- `uri` - The URI of the requested resource.
+- `options` - Optional config object containing settings for both `request` and
+ `read` operations.
+- `callback` - The callback function using the signature `function (err, response, payload)` where:
+ - `err` - Any error that may have occurred during handling of the request.
+ - `response` - The [HTTP Incoming Message](http://nodejs.org/api/http.html#http_http_incomingmessage)
+ object, which is also a readable stream.
+ - `payload` - The payload in the form of a Buffer or (optionally) parsed JavaScript object (JSON).
+
+Returns an instance of the node.js [ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object.
+
+
+### `toReadableStream(payload, [encoding])`
+
+Creates a [readable stream](http://nodejs.org/api/stream.html#stream_class_stream_readable)
+for the provided payload and encoding.
+- `payload` - The Buffer or string to be wrapped in a readable stream.
+- `encoding` - The encoding to use. Must be a valid Buffer encoding, such as 'utf8' or 'ascii'.
+
+```javascript
+var stream = Wreck.toReadableStream(new Buffer('Hello', 'ascii'), 'ascii');
+var read = stream.read();
+// read -> 'Hello'
+```
+
+### `parseCacheControl(field)`
+
+Parses the provided *cache-control* request header value into an object containing
+a property for each directive and it's value. Boolean directives, such as "private"
+or "no-cache" will be set to the boolean `true`.
+- `field` - The header cache control value to be parsed.
+
+```javascript
+var result = Wreck.parseCacheControl('private, max-age=0, no-cache');
+// result.private -> true
+// result['max-age'] -> 0
+// result['no-cache'] -> true
+```
+
+### `agents`
+
+Object that contains the agents for pooling connections for `http` and `https`. The properties are `http`, `https`, and
+`httpsAllowUnauthorized` which is an `https` agent with `rejectUnauthorized` set to true. All agents have `maxSockets`
+configured to `Infinity`. They are each instances of the node.js
+[Agent](http://nodejs.org/api/http.html#http_class_http_agent) and expose the standard properties.
+
+For example, the following code demonstrates changing `maxSockets` on the `http` agent.
+
+ ```js
+ var Wreck = require('wreck');
+
+ Wreck.agents.http.maxSockets = 20;
+ ```
+
+
+### Events
+
+#### `response`
+
+The response event is always emitted for any request that *wreck* makes. The handler should accept the following
+arguments `(error, request, response, start, uri)` where:
+ - `error` - a Boom error
+ - `request` - the raw `ClientHttp` request object
+ - `response` - the raw `IncomingMessage` response object
+ - `start` - the time that the request was initiated
+ - `uri` - the result of `Url.parse(uri)`. This will provide information about the resource requested. Also includes
+ the headers and method.
+
+This event is useful for logging all requests that go through *wreck*.
+The error and response arguments can be undefined depending on if an error occurs. Please be aware that if multiple
+modules are depending on the same cached *wreck* module that this event can fire for each request made across all
+modules. The start argument is the timestamp when the request was started. This can be useful for determining how long
+it takes *wreck* to get a response back and processed.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/images/wreck.png
----------------------------------------------------------------------
diff --git a/node_modules/wreck/images/wreck.png b/node_modules/wreck/images/wreck.png
new file mode 100755
index 0000000..2122a10
Binary files /dev/null and b/node_modules/wreck/images/wreck.png differ
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/lib/index.js b/node_modules/wreck/lib/index.js
new file mode 100755
index 0000000..1360577
--- /dev/null
+++ b/node_modules/wreck/lib/index.js
@@ -0,0 +1,472 @@
+
+// Load modules
+
+var Events = require('events');
+var Url = require('url');
+var Http = require('http');
+var Https = require('https');
+var Stream = require('stream');
+var Hoek = require('hoek');
+var Boom = require('boom');
+var Payload = require('./payload');
+var Recorder = require('./recorder');
+var Tap = require('./tap');
+
+
+// Declare internals
+
+var internals = {
+ jsonRegex: /^application\/[a-z.+-]*json$/
+};
+
+
+// new instance is exported as module.exports
+
+internals.Client = function (defaults) {
+
+ Events.EventEmitter.call(this);
+
+ this.agents = {
+ https: new Https.Agent({ maxSockets: Infinity }),
+ http: new Http.Agent({ maxSockets: Infinity }),
+ httpsAllowUnauthorized: new Https.Agent({ maxSockets: Infinity, rejectUnauthorized: false })
+ };
+
+ this._defaults = defaults || {};
+};
+
+Hoek.inherits(internals.Client, Events.EventEmitter);
+
+
+internals.Client.prototype.defaults = function (options) {
+
+ options = Hoek.applyToDefaultsWithShallow(options, this._defaults, ['agent', 'payload', 'downstreamRes']);
+ return new internals.Client(options);
+};
+
+
+internals.resolveUrl = function (baseUrl, path) {
+
+ if (!path) {
+ return baseUrl;
+ }
+
+ var parsedBase = Url.parse(baseUrl);
+ var parsedPath = Url.parse(path);
+
+ parsedBase.pathname += parsedPath.pathname;
+ parsedBase.pathname = parsedBase.pathname.replace(/[/]{2,}/g, '/');
+ parsedBase.search = parsedPath.search; // Always use the querystring from the path argument
+
+ return Url.format(parsedBase);
+};
+
+
+internals.Client.prototype.request = function (method, url, options, callback, _trace) {
+
+ var self = this;
+
+ options = Hoek.applyToDefaultsWithShallow(options || {}, this._defaults, ['agent', 'payload', 'downstreamRes']);
+
+ Hoek.assert(options.payload === null || options.payload === undefined || typeof options.payload === 'string' ||
+ options.payload instanceof Stream || Buffer.isBuffer(options.payload),
+ 'options.payload must be a string, a Buffer, or a Stream');
+
+ Hoek.assert((options.agent === undefined || options.agent === null) || (typeof options.rejectUnauthorized !== 'boolean'),
+ 'options.agent cannot be set to an Agent at the same time as options.rejectUnauthorized is set');
+
+ if (options.baseUrl) {
+ url = internals.resolveUrl(options.baseUrl, url);
+ }
+
+ var uri = Url.parse(url);
+ var timeoutId;
+ uri.method = method.toUpperCase();
+ uri.headers = options.headers;
+
+ var payloadSupported = (uri.method !== 'GET' && uri.method !== 'HEAD' && options.payload !== null && options.payload !== undefined);
+ if (payloadSupported &&
+ (typeof options.payload === 'string' || Buffer.isBuffer(options.payload))) {
+
+ uri.headers = Hoek.clone(uri.headers) || {};
+ uri.headers['Content-Length'] = Buffer.isBuffer(options.payload) ? options.payload.length : Buffer.byteLength(options.payload);
+ }
+
+ var redirects = (options.hasOwnProperty('redirects') ? options.redirects : false); // Needed to allow 0 as valid value when passed recursively
+
+ _trace = (_trace || []);
+ _trace.push({ method: uri.method, url: url });
+
+ var client = (uri.protocol === 'https:' ? Https : Http);
+
+ if (options.rejectUnauthorized !== undefined && uri.protocol === 'https:') {
+ uri.agent = options.rejectUnauthorized ? this.agents.https : this.agents.httpsAllowUnauthorized;
+ }
+ else if (options.agent || options.agent === false) {
+ uri.agent = options.agent;
+ }
+ else {
+ uri.agent = uri.protocol === 'https:' ? this.agents.https : this.agents.http;
+ }
+
+ if (options.secureProtocol !== undefined) {
+ uri.secureProtocol = options.secureProtocol;
+ }
+
+ var start = Date.now();
+ var req = client.request(uri);
+
+ var shadow = null; // A copy of the streamed request payload when redirects are enabled
+
+ // Register handlers
+
+ var finish = function (err, res) {
+
+ if (!callback || err) {
+ req.abort();
+ }
+
+ req.removeListener('response', onResponse);
+ req.removeListener('error', onError);
+ req.on('error', Hoek.ignore);
+ clearTimeout(timeoutId);
+ self.emit('response', err, req, res, start, uri);
+
+ if (callback) {
+ return callback(err, res);
+ }
+ };
+
+ finish = Hoek.once(finish);
+
+ var onError = function (err) {
+
+ err.trace = _trace;
+ return finish(Boom.badGateway('Client request error', err));
+ };
+
+ req.once('error', onError);
+
+ var onResponse = function (res) {
+
+ // Pass-through response
+
+ if (redirects === false ||
+ [301, 302, 307, 308].indexOf(res.statusCode) === -1) {
+
+ return finish(null, res);
+ }
+
+ // Redirection
+
+ var redirectMethod = (res.statusCode === 301 || res.statusCode === 302 ? 'GET' : uri.method);
+ var location = res.headers.location;
+
+ res.destroy();
+
+ if (redirects === 0) {
+ return finish(Boom.badGateway('Maximum redirections reached', _trace));
+ }
+
+ if (!location) {
+ return finish(Boom.badGateway('Received redirection without location', _trace));
+ }
+
+ if (!/^https?:/i.test(location)) {
+ location = Url.resolve(uri.href, location);
+ }
+
+ var redirectOptions = {
+ headers: options.headers,
+ payload: shadow || options.payload, // shadow must be ready at this point if set
+ redirects: --redirects
+ };
+
+ return self.request(redirectMethod, location, redirectOptions, finish, _trace);
+ };
+
+ req.once('response', onResponse);
+
+ if (options.timeout) {
+ timeoutId = setTimeout(function () {
+
+ return finish(Boom.gatewayTimeout('Client request timeout'));
+ }, options.timeout);
+ }
+
+ // Write payload
+
+ if (payloadSupported) {
+ if (options.payload instanceof Stream) {
+ var stream = options.payload;
+
+ if (redirects) {
+ var collector = new Tap();
+ collector.once('finish', function () {
+
+ shadow = collector.collect();
+ });
+
+ stream = options.payload.pipe(collector);
+ }
+
+ stream.pipe(req);
+ return;
+ }
+
+ req.write(options.payload);
+ }
+
+ // Custom abort method to detect early aborts
+
+ var _abort = req.abort;
+ var aborted = false;
+ req.abort = function () {
+
+ if (!aborted && !req.res && !req.socket) {
+ process.nextTick(function () {
+
+ // Fake an ECONNRESET error
+
+ var error = new Error('socket hang up');
+ error.code = 'ECONNRESET';
+ finish(error);
+ });
+ }
+
+ aborted = true;
+ return _abort.call(req);
+ };
+
+ // Finalize request
+
+ req.end();
+
+ return req;
+};
+
+
+// read()
+
+internals.Client.prototype.read = function (res, options, callback) {
+
+ options = Hoek.applyToDefaultsWithShallow(options || {}, this._defaults, ['agent', 'payload', 'downstreamRes']);
+
+
+ // Set stream timeout
+
+ var clientTimeout = options.timeout;
+ var clientTimeoutId = null;
+
+ if (clientTimeout &&
+ clientTimeout > 0) {
+
+ clientTimeoutId = setTimeout(function () {
+
+ finish(Boom.clientTimeout());
+ }, clientTimeout);
+ }
+
+ // Finish once
+
+ var finish = function (err, buffer) {
+
+ clearTimeout(clientTimeoutId);
+ reader.removeListener('error', onReaderError);
+ reader.removeListener('finish', onReaderFinish);
+ res.removeListener('error', onResError);
+ res.removeListener('close', onResClose);
+ res.on('error', Hoek.ignore);
+
+ if (err || !options.json) {
+ return callback(err, buffer);
+ }
+
+ // Parse JSON
+
+ var result;
+ if (buffer.length === 0) {
+ return callback(null, null);
+ }
+
+ if (options.json === 'force') {
+ result = internals.tryParseBuffer(buffer);
+ return callback(result.err, result.json);
+ }
+
+ // mode is "smart" or true
+
+ var contentType = (res.headers && res.headers['content-type']) || '';
+ var mime = contentType.split(';')[0].trim().toLowerCase();
+
+ if (!internals.jsonRegex.test(mime)) {
+ return callback(null, buffer);
+ }
+
+ result = internals.tryParseBuffer(buffer);
+ return callback(result.err, result.json);
+ };
+
+ finish = Hoek.once(finish);
+
+ // Hander errors
+
+ var onResError = function (err) {
+
+ return finish(Boom.internal('Payload stream error', err));
+ };
+
+ var onResClose = function () {
+
+ return finish(Boom.internal('Payload stream closed prematurely'));
+ };
+
+ res.once('error', onResError);
+ res.once('close', onResClose);
+
+ // Read payload
+
+ var reader = new Recorder({ maxBytes: options.maxBytes });
+
+ var onReaderError = function (err) {
+
+ res.destroy();
+ return finish(err);
+ };
+
+ reader.once('error', onReaderError);
+
+ var onReaderFinish = function () {
+
+ return finish(null, reader.collect());
+ };
+
+ reader.once('finish', onReaderFinish);
+
+ res.pipe(reader);
+};
+
+
+// toReadableStream()
+
+internals.Client.prototype.toReadableStream = function (payload, encoding) {
+
+ return new Payload(payload, encoding);
+};
+
+
+// parseCacheControl()
+
+internals.Client.prototype.parseCacheControl = function (field) {
+
+ /*
+ Cache-Control = 1#cache-directive
+ cache-directive = token [ "=" ( token / quoted-string ) ]
+ token = [^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+
+ quoted-string = "(?:[^"\\]|\\.)*"
+ */
+
+ // 1: directive = 2: token 3: quoted-string
+ var regex = /(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g;
+
+ var header = {};
+ var error = field.replace(regex, function ($0, $1, $2, $3) {
+
+ var value = $2 || $3;
+ header[$1] = value ? value.toLowerCase() : true;
+ return '';
+ });
+
+ if (header['max-age']) {
+ try {
+ var maxAge = parseInt(header['max-age'], 10);
+ if (isNaN(maxAge)) {
+ return null;
+ }
+
+ header['max-age'] = maxAge;
+ }
+ catch (err) { }
+ }
+
+ return (error ? null : header);
+};
+
+
+// Shortcuts
+
+internals.Client.prototype.get = function (uri, options, callback) {
+
+ return this._shortcutWrap('GET', uri, options, callback);
+};
+
+
+internals.Client.prototype.post = function (uri, options, callback) {
+
+ return this._shortcutWrap('POST', uri, options, callback);
+};
+
+
+internals.Client.prototype.put = function (uri, options, callback) {
+
+ return this._shortcutWrap('PUT', uri, options, callback);
+};
+
+
+internals.Client.prototype.delete = function (uri, options, callback) {
+
+ return this._shortcutWrap('DELETE', uri, options, callback);
+};
+
+
+// Wrapper so that shortcut can be optimized with required params
+
+internals.Client.prototype._shortcutWrap = function (method, uri /* [options], callback */) {
+
+ var options = (typeof arguments[2] === 'function' ? {} : arguments[2]);
+ var callback = (typeof arguments[2] === 'function' ? arguments[2] : arguments[3]);
+
+ return this._shortcut(method, uri, options, callback);
+};
+
+
+internals.Client.prototype._shortcut = function (method, uri, options, callback) {
+
+ var self = this;
+
+ return this.request(method, uri, options, function (err, res) {
+
+ if (err) {
+ return callback(err);
+ }
+
+ self.read(res, options, function (err, payload) {
+
+ if (payload instanceof Buffer) {
+ payload = payload.toString();
+ }
+
+ return callback(err, res, payload);
+ });
+ });
+};
+
+
+internals.tryParseBuffer = function (buffer) {
+
+ var result = {
+ json: null,
+ err: null
+ };
+ try {
+ var json = JSON.parse(buffer.toString());
+ result.json = json;
+ }
+ catch (err) {
+ result.err = err;
+ }
+ return result;
+};
+
+
+module.exports = new internals.Client();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/lib/payload.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/lib/payload.js b/node_modules/wreck/lib/payload.js
new file mode 100644
index 0000000..59a7196
--- /dev/null
+++ b/node_modules/wreck/lib/payload.js
@@ -0,0 +1,42 @@
+
+// Load modules
+
+var Hoek = require('hoek');
+var Stream = require('stream');
+
+
+// Declare internals
+
+var internals = {};
+
+
+module.exports = internals.Payload = function (payload, encoding) {
+
+ Stream.Readable.call(this);
+
+ var data = [].concat(payload || '');
+ var size = 0;
+ for (var i = 0, il = data.length; i < il; ++i) {
+ var chunk = data[i];
+ size += chunk.length;
+ data[i] = Buffer.isBuffer(chunk) ? chunk : new Buffer(chunk);
+ }
+
+ this._data = Buffer.concat(data, size);
+ this._position = 0;
+ this._encoding = encoding || 'utf8';
+};
+
+Hoek.inherits(internals.Payload, Stream.Readable);
+
+
+internals.Payload.prototype._read = function (size) {
+
+ var chunk = this._data.slice(this._position, this._position + size);
+ this.push(chunk, this._encoding);
+ this._position += chunk.length;
+
+ if (this._position >= this._data.length) {
+ this.push(null);
+ }
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/lib/recorder.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/lib/recorder.js b/node_modules/wreck/lib/recorder.js
new file mode 100644
index 0000000..4acf892
--- /dev/null
+++ b/node_modules/wreck/lib/recorder.js
@@ -0,0 +1,44 @@
+
+// Load modules
+
+var Boom = require('boom');
+var Hoek = require('hoek');
+var Stream = require('stream');
+
+
+// Declare internals
+
+var internals = {};
+
+
+module.exports = internals.Recorder = function (options) {
+
+ Stream.Writable.call(this);
+
+ this.settings = options; // No need to clone since called internally with new object
+ this.buffers = [];
+ this.length = 0;
+};
+
+Hoek.inherits(internals.Recorder, Stream.Writable);
+
+
+internals.Recorder.prototype._write = function (chunk, encoding, next) {
+
+ if (this.settings.maxBytes &&
+ this.length + chunk.length > this.settings.maxBytes) {
+
+ return this.emit('error', Boom.badRequest('Payload content length greater than maximum allowed: ' + this.settings.maxBytes));
+ }
+
+ this.length += chunk.length;
+ this.buffers.push(chunk);
+ next();
+};
+
+
+internals.Recorder.prototype.collect = function () {
+
+ var buffer = (this.buffers.length === 0 ? new Buffer(0) : (this.buffers.length === 1 ? this.buffers[0] : Buffer.concat(this.buffers, this.length)));
+ return buffer;
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/lib/tap.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/lib/tap.js b/node_modules/wreck/lib/tap.js
new file mode 100644
index 0000000..3a7aa9e
--- /dev/null
+++ b/node_modules/wreck/lib/tap.js
@@ -0,0 +1,33 @@
+
+// Load modules
+
+var Hoek = require('hoek');
+var Stream = require('stream');
+var Payload = require('./payload');
+
+
+// Declare internals
+
+var internals = {};
+
+
+module.exports = internals.Tap = function () {
+
+ Stream.Transform.call(this);
+ this.buffers = [];
+};
+
+Hoek.inherits(internals.Tap, Stream.Transform);
+
+
+internals.Tap.prototype._transform = function (chunk, encoding, next) {
+
+ this.buffers.push(chunk);
+ next(null, chunk);
+};
+
+
+internals.Tap.prototype.collect = function () {
+
+ return new Payload(this.buffers);
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/.npmignore b/node_modules/wreck/node_modules/boom/.npmignore
new file mode 100644
index 0000000..77ba16c
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/.travis.yml b/node_modules/wreck/node_modules/boom/.travis.yml
new file mode 100755
index 0000000..c84aade
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+
+node_js:
+ - 0.10
+ - 0.12
+ - iojs
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/CONTRIBUTING.md b/node_modules/wreck/node_modules/boom/CONTRIBUTING.md
new file mode 100644
index 0000000..8928361
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/LICENSE b/node_modules/wreck/node_modules/boom/LICENSE
new file mode 100755
index 0000000..3946889
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2014, Walmart and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/README.md
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/README.md b/node_modules/wreck/node_modules/boom/README.md
new file mode 100755
index 0000000..cb1e908
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/README.md
@@ -0,0 +1,597 @@
+
+
+HTTP-friendly error objects
+
+[](http://travis-ci.org/hapijs/boom)
+[](https://www.npmjs.com/package/boom)
+
+Lead Maintainer: [Adam Bretz](https://github.com/arb)
+
+**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response
+object (instance of `Error`) which includes the following properties:
+- `isBoom` - if `true`, indicates this is a `Boom` object instance.
+- `isServer` - convenience bool indicating status code >= 500.
+- `message` - the error message.
+- `output` - the formatted response. Can be directly manipulated after object construction to return a custom
+ error response. Allowed root keys:
+ - `statusCode` - the HTTP status code (typically 4xx or 5xx).
+ - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content.
+ - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any
+ changes will be lost
+ if `reformat()` is called. Any content allowed and by default includes the following content:
+ - `statusCode` - the HTTP status code, derived from `error.output.statusCode`.
+ - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`.
+ - `message` - the error message derived from `error.message`.
+- inherited `Error` properties.
+
+The `Boom` object also supports the following method:
+- `reformat()` - rebuilds `error.output` using the other object properties.
+
+## Helper Methods
+
+### `wrap(error, [statusCode], [message])`
+
+Decorates an error with the **boom** properties where:
+- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object.
+- `statusCode` - optional HTTP status code. Defaults to `500`.
+- `message` - optional message string. If the error already has a message, it adds the message as a prefix.
+ Defaults to no message.
+
+```js
+var error = new Error('Unexpected input');
+Boom.wrap(error, 400);
+```
+
+### `create(statusCode, [message], [data])`
+
+Generates an `Error` object with the **boom** decorations where:
+- `statusCode` - an HTTP error code number. Must be greater or equal 400.
+- `message` - optional message string.
+- `data` - additional error data set to `error.data` property.
+
+```js
+var error = Boom.create(400, 'Bad request', { timestamp: Date.now() });
+```
+
+## HTTP 4xx Errors
+
+### `Boom.badRequest([message], [data])`
+
+Returns a 400 Bad Request error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badRequest('invalid query');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 400,
+ "error": "Bad Request",
+ "message": "invalid query"
+}
+```
+
+### `Boom.unauthorized([message], [scheme], [attributes])`
+
+Returns a 401 Unauthorized error where:
+- `message` - optional message.
+- `scheme` can be one of the following:
+ - an authentication scheme name
+ - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header.
+- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used
+ when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the
+ 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key.
+ `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as
+ the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header
+ will not be present and `isMissing` will be true on the error object.
+
+If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response.
+
+```js
+Boom.unauthorized('invalid password');
+```
+
+Generates the following response:
+
+```json
+"payload": {
+ "statusCode": 401,
+ "error": "Unauthorized",
+ "message": "invalid password"
+},
+"headers" {}
+```
+
+```js
+Boom.unauthorized('invalid password', 'sample');
+```
+
+Generates the following response:
+
+```json
+"payload": {
+ "statusCode": 401,
+ "error": "Unauthorized",
+ "message": "invalid password",
+ "attributes": {
+ "error": "invalid password"
+ }
+},
+"headers" {
+ "WWW-Authenticate": "sample error=\"invalid password\""
+}
+```
+
+```js
+Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' });
+```
+
+Generates the following response:
+
+```json
+"payload": {
+ "statusCode": 401,
+ "error": "Unauthorized",
+ "message": "invalid password",
+ "attributes": {
+ "error": "invalid password",
+ "ttl": 0,
+ "cache": "",
+ "foo": "bar"
+ }
+},
+"headers" {
+ "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\""
+}
+```
+
+### `Boom.forbidden([message], [data])`
+
+Returns a 403 Forbidden error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.forbidden('try again some time');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 403,
+ "error": "Forbidden",
+ "message": "try again some time"
+}
+```
+
+### `Boom.notFound([message], [data])`
+
+Returns a 404 Not Found error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.notFound('missing');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 404,
+ "error": "Not Found",
+ "message": "missing"
+}
+```
+
+### `Boom.methodNotAllowed([message], [data])`
+
+Returns a 405 Method Not Allowed error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.methodNotAllowed('that method is not allowed');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 405,
+ "error": "Method Not Allowed",
+ "message": "that method is not allowed"
+}
+```
+
+### `Boom.notAcceptable([message], [data])`
+
+Returns a 406 Not Acceptable error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.notAcceptable('unacceptable');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 406,
+ "error": "Not Acceptable",
+ "message": "unacceptable"
+}
+```
+
+### `Boom.proxyAuthRequired([message], [data])`
+
+Returns a 407 Proxy Authentication Required error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.proxyAuthRequired('auth missing');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 407,
+ "error": "Proxy Authentication Required",
+ "message": "auth missing"
+}
+```
+
+### `Boom.clientTimeout([message], [data])`
+
+Returns a 408 Request Time-out error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.clientTimeout('timed out');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 408,
+ "error": "Request Time-out",
+ "message": "timed out"
+}
+```
+
+### `Boom.conflict([message], [data])`
+
+Returns a 409 Conflict error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.conflict('there was a conflict');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 409,
+ "error": "Conflict",
+ "message": "there was a conflict"
+}
+```
+
+### `Boom.resourceGone([message], [data])`
+
+Returns a 410 Gone error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.resourceGone('it is gone');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 410,
+ "error": "Gone",
+ "message": "it is gone"
+}
+```
+
+### `Boom.lengthRequired([message], [data])`
+
+Returns a 411 Length Required error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.lengthRequired('length needed');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 411,
+ "error": "Length Required",
+ "message": "length needed"
+}
+```
+
+### `Boom.preconditionFailed([message], [data])`
+
+Returns a 412 Precondition Failed error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.preconditionFailed();
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 412,
+ "error": "Precondition Failed"
+}
+```
+
+### `Boom.entityTooLarge([message], [data])`
+
+Returns a 413 Request Entity Too Large error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.entityTooLarge('too big');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 413,
+ "error": "Request Entity Too Large",
+ "message": "too big"
+}
+```
+
+### `Boom.uriTooLong([message], [data])`
+
+Returns a 414 Request-URI Too Large error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.uriTooLong('uri is too long');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 414,
+ "error": "Request-URI Too Large",
+ "message": "uri is too long"
+}
+```
+
+### `Boom.unsupportedMediaType([message], [data])`
+
+Returns a 415 Unsupported Media Type error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.unsupportedMediaType('that media is not supported');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 415,
+ "error": "Unsupported Media Type",
+ "message": "that media is not supported"
+}
+```
+
+### `Boom.rangeNotSatisfiable([message], [data])`
+
+Returns a 416 Requested Range Not Satisfiable error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.rangeNotSatisfiable();
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 416,
+ "error": "Requested Range Not Satisfiable"
+}
+```
+
+### `Boom.expectationFailed([message], [data])`
+
+Returns a 417 Expectation Failed error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.expectationFailed('expected this to work');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 417,
+ "error": "Expectation Failed",
+ "message": "expected this to work"
+}
+```
+
+### `Boom.badData([message], [data])`
+
+Returns a 422 Unprocessable Entity error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badData('your data is bad and you should feel bad');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 422,
+ "error": "Unprocessable Entity",
+ "message": "your data is bad and you should feel bad"
+}
+```
+
+### `Boom.tooManyRequests([message], [data])`
+
+Returns a 429 Too Many Requests error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.tooManyRequests('you have exceeded your request limit');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 429,
+ "error": "Too Many Requests",
+ "message": "you have exceeded your request limit"
+}
+```
+
+## HTTP 5xx Errors
+
+All 500 errors hide your message from the end user. Your message is recorded in the server log.
+
+### `Boom.notImplemented([message], [data])`
+
+Returns a 501 Not Implemented error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.notImplemented('method not implemented');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 501,
+ "error": "Not Implemented",
+ "message": "method not implemented"
+}
+```
+
+### `Boom.badGateway([message], [data])`
+
+Returns a 502 Bad Gateway error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badGateway('that is a bad gateway');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 502,
+ "error": "Bad Gateway",
+ "message": "that is a bad gateway"
+}
+```
+
+### `Boom.serverTimeout([message], [data])`
+
+Returns a 503 Service Unavailable error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.serverTimeout('unavailable');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 503,
+ "error": "Service Unavailable",
+ "message": "unavailable"
+}
+```
+
+### `Boom.gatewayTimeout([message], [data])`
+
+Returns a 504 Gateway Time-out error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.gatewayTimeout();
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 504,
+ "error": "Gateway Time-out"
+}
+```
+
+### `Boom.badImplementation([message], [data])`
+
+Returns a 500 Internal Server Error error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badImplementation('terrible implementation');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 500,
+ "error": "Internal Server Error",
+ "message": "An internal server error occurred"
+}
+```
+
+## F.A.Q.
+
+###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives?
+
+There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/images/boom.png
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/images/boom.png b/node_modules/wreck/node_modules/boom/images/boom.png
new file mode 100755
index 0000000..373bc13
Binary files /dev/null and b/node_modules/wreck/node_modules/boom/images/boom.png differ
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/lib/index.js b/node_modules/wreck/node_modules/boom/lib/index.js
new file mode 100755
index 0000000..fb6564a
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/lib/index.js
@@ -0,0 +1,301 @@
+// Load modules
+
+var Http = require('http');
+var Hoek = require('hoek');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.wrap = function (error, statusCode, message) {
+
+ Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object');
+ return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message));
+};
+
+
+exports.create = function (statusCode, message, data) {
+
+ var error = new Error(message ? message : undefined); // Avoids settings null message
+ error.data = data || null;
+ internals.initialize(error, statusCode);
+ return error;
+};
+
+
+internals.initialize = function (error, statusCode, message) {
+
+ var numberCode = parseInt(statusCode, 10);
+ Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode);
+
+ error.isBoom = true;
+ error.isServer = numberCode >= 500;
+
+ if (!error.hasOwnProperty('data')) {
+ error.data = null;
+ }
+
+ error.output = {
+ statusCode: numberCode,
+ payload: {},
+ headers: {}
+ };
+
+ error.reformat = internals.reformat;
+ error.reformat();
+
+ if (!message &&
+ !error.message) {
+
+ message = error.output.payload.error;
+ }
+
+ if (message) {
+ error.message = (message + (error.message ? ': ' + error.message : ''));
+ }
+
+ return error;
+};
+
+
+internals.reformat = function () {
+
+ this.output.payload.statusCode = this.output.statusCode;
+ this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown';
+
+ if (this.output.statusCode === 500) {
+ this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user
+ }
+ else if (this.message) {
+ this.output.payload.message = this.message;
+ }
+};
+
+
+// 4xx Client Errors
+
+exports.badRequest = function (message, data) {
+
+ return exports.create(400, message, data);
+};
+
+
+exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[])
+
+ var err = exports.create(401, message);
+
+ if (!scheme) {
+ return err;
+ }
+
+ var wwwAuthenticate = '';
+ var i = 0;
+ var il = 0;
+
+ if (typeof scheme === 'string') {
+
+ // function (message, scheme, attributes)
+
+ wwwAuthenticate = scheme;
+
+ if (attributes || message) {
+ err.output.payload.attributes = {};
+ }
+
+ if (attributes) {
+ var names = Object.keys(attributes);
+ for (i = 0, il = names.length; i < il; ++i) {
+ var name = names[i];
+ if (i) {
+ wwwAuthenticate += ',';
+ }
+
+ var value = attributes[name];
+ if (value === null ||
+ value === undefined) { // Value can be zero
+
+ value = '';
+ }
+ wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
+ err.output.payload.attributes[name] = value;
+ }
+ }
+
+ if (message) {
+ if (attributes) {
+ wwwAuthenticate += ',';
+ }
+ wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"';
+ err.output.payload.attributes.error = message;
+ }
+ else {
+ err.isMissing = true;
+ }
+ }
+ else {
+
+ // function (message, wwwAuthenticate[])
+
+ var wwwArray = scheme;
+ for (i = 0, il = wwwArray.length; i < il; ++i) {
+ if (i) {
+ wwwAuthenticate += ', ';
+ }
+
+ wwwAuthenticate += wwwArray[i];
+ }
+ }
+
+ err.output.headers['WWW-Authenticate'] = wwwAuthenticate;
+
+ return err;
+};
+
+
+exports.forbidden = function (message, data) {
+
+ return exports.create(403, message, data);
+};
+
+
+exports.notFound = function (message, data) {
+
+ return exports.create(404, message, data);
+};
+
+
+exports.methodNotAllowed = function (message, data) {
+
+ return exports.create(405, message, data);
+};
+
+
+exports.notAcceptable = function (message, data) {
+
+ return exports.create(406, message, data);
+};
+
+
+exports.proxyAuthRequired = function (message, data) {
+
+ return exports.create(407, message, data);
+};
+
+
+exports.clientTimeout = function (message, data) {
+
+ return exports.create(408, message, data);
+};
+
+
+exports.conflict = function (message, data) {
+
+ return exports.create(409, message, data);
+};
+
+
+exports.resourceGone = function (message, data) {
+
+ return exports.create(410, message, data);
+};
+
+
+exports.lengthRequired = function (message, data) {
+
+ return exports.create(411, message, data);
+};
+
+
+exports.preconditionFailed = function (message, data) {
+
+ return exports.create(412, message, data);
+};
+
+
+exports.entityTooLarge = function (message, data) {
+
+ return exports.create(413, message, data);
+};
+
+
+exports.uriTooLong = function (message, data) {
+
+ return exports.create(414, message, data);
+};
+
+
+exports.unsupportedMediaType = function (message, data) {
+
+ return exports.create(415, message, data);
+};
+
+
+exports.rangeNotSatisfiable = function (message, data) {
+
+ return exports.create(416, message, data);
+};
+
+
+exports.expectationFailed = function (message, data) {
+
+ return exports.create(417, message, data);
+};
+
+exports.badData = function (message, data) {
+
+ return exports.create(422, message, data);
+};
+
+
+exports.tooManyRequests = function (message, data) {
+
+ return exports.create(429, message, data);
+};
+
+
+// 5xx Server Errors
+
+exports.internal = function (message, data, statusCode) {
+
+ var error = (data instanceof Error ? exports.wrap(data, statusCode, message) : exports.create(statusCode || 500, message));
+
+ if (data instanceof Error === false) {
+ error.data = data;
+ }
+
+ return error;
+};
+
+
+exports.notImplemented = function (message, data) {
+
+ return exports.internal(message, data, 501);
+};
+
+
+exports.badGateway = function (message, data) {
+
+ return exports.internal(message, data, 502);
+};
+
+
+exports.serverTimeout = function (message, data) {
+
+ return exports.internal(message, data, 503);
+};
+
+
+exports.gatewayTimeout = function (message, data) {
+
+ return exports.internal(message, data, 504);
+};
+
+
+exports.badImplementation = function (message, data) {
+
+ var err = exports.internal(message, data, 500);
+ err.isDeveloperError = true;
+ return err;
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/package.json
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/package.json b/node_modules/wreck/node_modules/boom/package.json
new file mode 100644
index 0000000..df8da9f
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "boom",
+ "description": "HTTP-friendly error objects",
+ "version": "2.8.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hapijs/boom.git"
+ },
+ "main": "lib/index.js",
+ "keywords": [
+ "error",
+ "http"
+ ],
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "dependencies": {
+ "hoek": "2.x.x"
+ },
+ "devDependencies": {
+ "code": "1.x.x",
+ "lab": "5.x.x"
+ },
+ "scripts": {
+ "test": "lab -a code -t 100",
+ "test-cov-html": "lab -a code -r html -o coverage.html"
+ },
+ "license": "BSD-3-Clause",
+ "gitHead": "43f13bf2d336b35ccbb062b32ba2a17259f6d24c",
+ "bugs": {
+ "url": "https://github.com/hapijs/boom/issues"
+ },
+ "homepage": "https://github.com/hapijs/boom#readme",
+ "_id": "boom@2.8.0",
+ "_shasum": "317bdfd47018fe7dd79b0e9da73efe244119fdf1",
+ "_from": "boom@>=2.0.0 <3.0.0",
+ "_npmVersion": "2.11.1",
+ "_nodeVersion": "0.10.38",
+ "_npmUser": {
+ "name": "arb",
+ "email": "arbretz@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ {
+ "name": "wyatt",
+ "email": "wpreul@gmail.com"
+ },
+ {
+ "name": "arb",
+ "email": "arbretz@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "317bdfd47018fe7dd79b0e9da73efe244119fdf1",
+ "tarball": "http://registry.npmjs.org/boom/-/boom-2.8.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/boom/-/boom-2.8.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/boom/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/boom/test/index.js b/node_modules/wreck/node_modules/boom/test/index.js
new file mode 100755
index 0000000..489f77c
--- /dev/null
+++ b/node_modules/wreck/node_modules/boom/test/index.js
@@ -0,0 +1,616 @@
+// Load modules
+
+var Util = require('util');
+var Code = require('code');
+var Boom = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.describe;
+var it = lab.it;
+var expect = Code.expect;
+
+
+it('returns the same object when already boom', function (done) {
+
+ var error = Boom.badRequest();
+ var wrapped = Boom.wrap(error);
+ expect(error).to.equal(wrapped);
+ done();
+});
+
+it('returns an error with info when constructed using another error', function (done) {
+
+ var error = new Error('ka-boom');
+ error.xyz = 123;
+ var err = Boom.wrap(error);
+ expect(err.xyz).to.equal(123);
+ expect(err.message).to.equal('ka-boom');
+ expect(err.output).to.deep.equal({
+ statusCode: 500,
+ payload: {
+ statusCode: 500,
+ error: 'Internal Server Error',
+ message: 'An internal server error occurred'
+ },
+ headers: {}
+ });
+ expect(err.data).to.equal(null);
+ done();
+});
+
+it('does not override data when constructed using another error', function (done) {
+
+ var error = new Error('ka-boom');
+ error.data = { useful: 'data' };
+ var err = Boom.wrap(error);
+ expect(err.data).to.equal(error.data);
+ done();
+});
+
+it('sets new message when none exists', function (done) {
+
+ var error = new Error();
+ var wrapped = Boom.wrap(error, 400, 'something bad');
+ expect(wrapped.message).to.equal('something bad');
+ done();
+});
+
+it('throws when statusCode is not a number', function (done) {
+
+ expect(function () {
+
+ Boom.create('x');
+ }).to.throw('First argument must be a number (400+): x');
+ done();
+});
+
+it('will cast a number-string to an integer', function (done) {
+
+ var codes = [
+ { input: '404', result: 404 },
+ { input: '404.1', result: 404 },
+ { input: 400, result: 400 },
+ { input: 400.123, result: 400 }]
+ for (var i = 0, il = codes.length; i < il; ++i) {
+ var code = codes[i];
+ var err = Boom.create(code.input);
+ expect(err.output.statusCode).to.equal(code.result);
+ }
+
+ done();
+});
+
+it('throws when statusCode is not finite', function (done) {
+
+ expect(function () {
+
+ Boom.create(1 / 0);
+ }).to.throw('First argument must be a number (400+): null');
+ done();
+});
+
+it('sets error code to unknown', function (done) {
+
+ var err = Boom.create(999);
+ expect(err.output.payload.error).to.equal('Unknown');
+ done();
+});
+
+describe('create()', function () {
+
+ it('does not sets null message', function (done) {
+
+ var error = Boom.unauthorized(null);
+ expect(error.output.payload.message).to.not.exist();
+ expect(error.isServer).to.be.false();
+ done();
+ });
+
+ it('sets message and data', function (done) {
+
+ var error = Boom.badRequest('Missing data', { type: 'user' });
+ expect(error.data.type).to.equal('user');
+ expect(error.output.payload.message).to.equal('Missing data');
+ done();
+ });
+});
+
+describe('isBoom()', function () {
+
+ it('returns true for Boom object', function (done) {
+
+ expect(Boom.badRequest().isBoom).to.equal(true);
+ done();
+ });
+
+ it('returns false for Error object', function (done) {
+
+ expect((new Error()).isBoom).to.not.exist();
+ done();
+ });
+});
+
+describe('badRequest()', function () {
+
+ it('returns a 400 error statusCode', function (done) {
+
+ var error = Boom.badRequest();
+
+ expect(error.output.statusCode).to.equal(400);
+ expect(error.isServer).to.be.false();
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.badRequest('my message').message).to.equal('my message');
+ done();
+ });
+
+ it('sets the message to HTTP status if none provided', function (done) {
+
+ expect(Boom.badRequest().message).to.equal('Bad Request');
+ done();
+ });
+});
+
+describe('unauthorized()', function () {
+
+ it('returns a 401 error statusCode', function (done) {
+
+ var err = Boom.unauthorized();
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers).to.deep.equal({});
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.unauthorized('my message').message).to.equal('my message');
+ done();
+ });
+
+ it('returns a WWW-Authenticate header when passed a scheme', function (done) {
+
+ var err = Boom.unauthorized('boom', 'Test');
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test error="boom"');
+ done();
+ });
+
+ it('returns a WWW-Authenticate header set to the schema array value', function (done) {
+
+ var err = Boom.unauthorized(null, ['Test','one','two']);
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test, one, two');
+ done();
+ });
+
+ it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) {
+
+ var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 });
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"');
+ expect(err.output.payload.attributes).to.deep.equal({ a: 1, b: 'something', c: '', d: 0, error: 'boom' });
+ done();
+ });
+
+ it('returns a WWW-Authenticate header when passed attributes, missing error', function (done) {
+
+ var err = Boom.unauthorized(null, 'Test', { a: 1, b: 'something', c: null, d: 0 });
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0"');
+ expect(err.isMissing).to.equal(true);
+ done();
+ });
+
+ it('sets the isMissing flag when error message is empty', function (done) {
+
+ var err = Boom.unauthorized('', 'Basic');
+ expect(err.isMissing).to.equal(true);
+ done();
+ });
+
+ it('does not set the isMissing flag when error message is not empty', function (done) {
+
+ var err = Boom.unauthorized('message', 'Basic');
+ expect(err.isMissing).to.equal(undefined);
+ done();
+ });
+
+ it('sets a WWW-Authenticate when passed as an array', function (done) {
+
+ var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"');
+ done();
+ });
+});
+
+
+describe('methodNotAllowed()', function () {
+
+ it('returns a 405 error statusCode', function (done) {
+
+ expect(Boom.methodNotAllowed().output.statusCode).to.equal(405);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.methodNotAllowed('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('notAcceptable()', function () {
+
+ it('returns a 406 error statusCode', function (done) {
+
+ expect(Boom.notAcceptable().output.statusCode).to.equal(406);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.notAcceptable('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('proxyAuthRequired()', function () {
+
+ it('returns a 407 error statusCode', function (done) {
+
+ expect(Boom.proxyAuthRequired().output.statusCode).to.equal(407);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.proxyAuthRequired('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('clientTimeout()', function () {
+
+ it('returns a 408 error statusCode', function (done) {
+
+ expect(Boom.clientTimeout().output.statusCode).to.equal(408);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.clientTimeout('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('conflict()', function () {
+
+ it('returns a 409 error statusCode', function (done) {
+
+ expect(Boom.conflict().output.statusCode).to.equal(409);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.conflict('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('resourceGone()', function () {
+
+ it('returns a 410 error statusCode', function (done) {
+
+ expect(Boom.resourceGone().output.statusCode).to.equal(410);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.resourceGone('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('lengthRequired()', function () {
+
+ it('returns a 411 error statusCode', function (done) {
+
+ expect(Boom.lengthRequired().output.statusCode).to.equal(411);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.lengthRequired('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('preconditionFailed()', function () {
+
+ it('returns a 412 error statusCode', function (done) {
+
+ expect(Boom.preconditionFailed().output.statusCode).to.equal(412);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.preconditionFailed('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('entityTooLarge()', function () {
+
+ it('returns a 413 error statusCode', function (done) {
+
+ expect(Boom.entityTooLarge().output.statusCode).to.equal(413);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.entityTooLarge('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('uriTooLong()', function () {
+
+ it('returns a 414 error statusCode', function (done) {
+
+ expect(Boom.uriTooLong().output.statusCode).to.equal(414);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.uriTooLong('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('unsupportedMediaType()', function () {
+
+ it('returns a 415 error statusCode', function (done) {
+
+ expect(Boom.unsupportedMediaType().output.statusCode).to.equal(415);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.unsupportedMediaType('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('rangeNotSatisfiable()', function () {
+
+ it('returns a 416 error statusCode', function (done) {
+
+ expect(Boom.rangeNotSatisfiable().output.statusCode).to.equal(416);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.rangeNotSatisfiable('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('expectationFailed()', function () {
+
+ it('returns a 417 error statusCode', function (done) {
+
+ expect(Boom.expectationFailed().output.statusCode).to.equal(417);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.expectationFailed('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('badData()', function () {
+
+ it('returns a 422 error statusCode', function (done) {
+
+ expect(Boom.badData().output.statusCode).to.equal(422);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.badData('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('tooManyRequests()', function () {
+
+ it('returns a 429 error statusCode', function (done) {
+
+ expect(Boom.tooManyRequests().output.statusCode).to.equal(429);
+ done();
+ });
+
+ it('sets the message with the passed-in message', function (done) {
+
+ expect(Boom.tooManyRequests('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('serverTimeout()', function () {
+
+ it('returns a 503 error statusCode', function (done) {
+
+ expect(Boom.serverTimeout().output.statusCode).to.equal(503);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.serverTimeout('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('forbidden()', function () {
+
+ it('returns a 403 error statusCode', function (done) {
+
+ expect(Boom.forbidden().output.statusCode).to.equal(403);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.forbidden('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('notFound()', function () {
+
+ it('returns a 404 error statusCode', function (done) {
+
+ expect(Boom.notFound().output.statusCode).to.equal(404);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.notFound('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('internal()', function () {
+
+ it('returns a 500 error statusCode', function (done) {
+
+ expect(Boom.internal().output.statusCode).to.equal(500);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ var err = Boom.internal('my message');
+ expect(err.message).to.equal('my message');
+ expect(err.isServer).to.true();
+ expect(err.output.payload.message).to.equal('An internal server error occurred');
+ done();
+ });
+
+ it('passes data on the callback if its passed in', function (done) {
+
+ expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data');
+ done();
+ });
+
+ it('returns an error with composite message', function (done) {
+
+ try {
+ JSON.parse('{');
+ }
+ catch (err) {
+ var boom = Boom.internal('Someting bad', err);
+ expect(boom.message).to.equal('Someting bad: Unexpected end of input');
+ expect(boom.isServer).to.be.true();
+ done();
+ }
+ });
+});
+
+describe('notImplemented()', function () {
+
+ it('returns a 501 error statusCode', function (done) {
+
+ expect(Boom.notImplemented().output.statusCode).to.equal(501);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.notImplemented('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('badGateway()', function () {
+
+ it('returns a 502 error statusCode', function (done) {
+
+ expect(Boom.badGateway().output.statusCode).to.equal(502);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.badGateway('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('gatewayTimeout()', function () {
+
+ it('returns a 504 error statusCode', function (done) {
+
+ expect(Boom.gatewayTimeout().output.statusCode).to.equal(504);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.gatewayTimeout('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('badImplementation()', function () {
+
+ it('returns a 500 error statusCode', function (done) {
+
+ var err = Boom.badImplementation();
+ expect(err.output.statusCode).to.equal(500);
+ expect(err.isDeveloperError).to.equal(true);
+ expect(err.isServer).to.be.true();
+ done();
+ });
+});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/.npmignore b/node_modules/wreck/node_modules/hoek/.npmignore
new file mode 100644
index 0000000..7e1574d
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+complexity.md
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/.travis.yml b/node_modules/wreck/node_modules/hoek/.travis.yml
new file mode 100755
index 0000000..c84aade
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+
+node_js:
+ - 0.10
+ - 0.12
+ - iojs
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/CONTRIBUTING.md b/node_modules/wreck/node_modules/hoek/CONTRIBUTING.md
new file mode 100644
index 0000000..8928361
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/LICENSE b/node_modules/wreck/node_modules/hoek/LICENSE
new file mode 100755
index 0000000..5530904
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2011-2014, Walmart and other contributors.
+Copyright (c) 2011, Yahoo Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/hapi/graphs/contributors
+Portions of this project were initially based on the Yahoo! Inc. Postmile project,
+published at https://github.com/yahoo/postmile.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/Makefile b/node_modules/wreck/node_modules/hoek/Makefile
new file mode 100755
index 0000000..83aaf0c
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/Makefile
@@ -0,0 +1,8 @@
+test:
+ @node node_modules/lab/bin/lab -a code
+test-cov:
+ @node node_modules/lab/bin/lab -a code -t 100 -L
+test-cov-html:
+ @node node_modules/lab/bin/lab -a code -r html -o coverage.html
+
+.PHONY: test test-cov test-cov-html
[42/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json
deleted file mode 100644
index c1f4ab9..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json
+++ /dev/null
@@ -1,79 +0,0 @@
-[
- {
- "description": "uniqueItems validation",
- "schema": {"uniqueItems": true},
- "tests": [
- {
- "description": "unique array of integers is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "non-unique array of integers is invalid",
- "data": [1, 1],
- "valid": false
- },
- {
- "description": "numbers are unique if mathematically unequal",
- "data": [1.0, 1.00, 1],
- "valid": false
- },
- {
- "description": "unique array of objects is valid",
- "data": [{"foo": "bar"}, {"foo": "baz"}],
- "valid": true
- },
- {
- "description": "non-unique array of objects is invalid",
- "data": [{"foo": "bar"}, {"foo": "bar"}],
- "valid": false
- },
- {
- "description": "unique array of nested objects is valid",
- "data": [
- {"foo": {"bar" : {"baz" : true}}},
- {"foo": {"bar" : {"baz" : false}}}
- ],
- "valid": true
- },
- {
- "description": "non-unique array of nested objects is invalid",
- "data": [
- {"foo": {"bar" : {"baz" : true}}},
- {"foo": {"bar" : {"baz" : true}}}
- ],
- "valid": false
- },
- {
- "description": "unique array of arrays is valid",
- "data": [["foo"], ["bar"]],
- "valid": true
- },
- {
- "description": "non-unique array of arrays is invalid",
- "data": [["foo"], ["foo"]],
- "valid": false
- },
- {
- "description": "1 and true are unique",
- "data": [1, true],
- "valid": true
- },
- {
- "description": "0 and false are unique",
- "data": [0, false],
- "valid": true
- },
- {
- "description": "unique heterogeneous types are valid",
- "data": [{}, [1], true, null, 1],
- "valid": true
- },
- {
- "description": "non-unique heterogeneous types are invalid",
- "data": [{}, [1], true, null, {}, 1],
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js
deleted file mode 100644
index e68a263..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var tape = require('tape')
-var fs = require('fs')
-var validator = require('../')
-
-var files = fs.readdirSync(__dirname+'/json-schema-draft4')
- .map(function(file) {
- if (file === 'definitions.json') return null
- if (file === 'refRemote.json') return null
- return require('./json-schema-draft4/'+file)
- })
- .filter(Boolean)
-
-files.forEach(function(file) {
- file.forEach(function(f) {
- tape('json-schema-test-suite '+f.description, function(t) {
- var validate = validator(f.schema)
- f.tests.forEach(function(test) {
- t.same(validate(test.data), test.valid, test.description)
- })
- t.end()
- })
- })
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
deleted file mode 100644
index b5109e5..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
+++ /dev/null
@@ -1,429 +0,0 @@
-var tape = require('tape')
-var cosmic = require('./fixtures/cosmic')
-var validator = require('../')
-var validatorRequire = require('../require')
-
-tape('simple', function(t) {
- var schema = {
- required: true,
- type: 'object',
- properties: {
- hello: {type:'string', required:true}
- }
- }
-
- var validate = validator(schema)
-
- t.ok(validate({hello: 'world'}), 'should be valid')
- t.notOk(validate(), 'should be invalid')
- t.notOk(validate({}), 'should be invalid')
- t.end()
-})
-
-tape('advanced', function(t) {
- var validate = validator(cosmic.schema)
-
- t.ok(validate(cosmic.valid), 'should be valid')
- t.notOk(validate(cosmic.invalid), 'should be invalid')
- t.end()
-})
-
-tape('greedy/false', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- x: {
- type: 'number'
- }
- },
- required: ['x', 'y']
- });
- t.notOk(validate({}), 'should be invalid')
- t.strictEqual(validate.errors.length, 2);
- t.strictEqual(validate.errors[0].field, 'data.x')
- t.strictEqual(validate.errors[0].message, 'is required')
- t.strictEqual(validate.errors[1].field, 'data.y')
- t.strictEqual(validate.errors[1].message, 'is required')
- t.notOk(validate({x: 'string'}), 'should be invalid')
- t.strictEqual(validate.errors.length, 1);
- t.strictEqual(validate.errors[0].field, 'data.y')
- t.strictEqual(validate.errors[0].message, 'is required')
- t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid')
- t.strictEqual(validate.errors.length, 1);
- t.strictEqual(validate.errors[0].field, 'data.x')
- t.strictEqual(validate.errors[0].message, 'is the wrong type')
- t.end();
-});
-
-tape('greedy/true', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- x: {
- type: 'number'
- }
- },
- required: ['x', 'y']
- }, {
- greedy: true
- });
- t.notOk(validate({}), 'should be invalid')
- t.strictEqual(validate.errors.length, 2);
- t.strictEqual(validate.errors[0].field, 'data.x')
- t.strictEqual(validate.errors[0].message, 'is required')
- t.strictEqual(validate.errors[1].field, 'data.y')
- t.strictEqual(validate.errors[1].message, 'is required')
- t.notOk(validate({x: 'string'}), 'should be invalid')
- t.strictEqual(validate.errors.length, 2);
- t.strictEqual(validate.errors[0].field, 'data.y')
- t.strictEqual(validate.errors[0].message, 'is required')
- t.strictEqual(validate.errors[1].field, 'data.x')
- t.strictEqual(validate.errors[1].message, 'is the wrong type')
- t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid')
- t.strictEqual(validate.errors.length, 1);
- t.strictEqual(validate.errors[0].field, 'data.x')
- t.strictEqual(validate.errors[0].message, 'is the wrong type')
- t.ok(validate({x: 1, y: 'value'}), 'should be invalid')
- t.end();
-});
-
-tape('additional props', function(t) {
- var validate = validator({
- type: 'object',
- additionalProperties: false
- }, {
- verbose: true
- })
-
- t.ok(validate({}))
- t.notOk(validate({foo:'bar'}))
- t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode')
- t.end()
-})
-
-tape('array', function(t) {
- var validate = validator({
- type: 'array',
- required: true,
- items: {
- type: 'string'
- }
- })
-
- t.notOk(validate({}), 'wrong type')
- t.notOk(validate(), 'is required')
- t.ok(validate(['test']))
- t.end()
-})
-
-tape('nested array', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- list: {
- type: 'array',
- required: true,
- items: {
- type: 'string'
- }
- }
- }
- })
-
- t.notOk(validate({}), 'is required')
- t.ok(validate({list:['test']}))
- t.notOk(validate({list:[1]}))
- t.end()
-})
-
-tape('enum', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- foo: {
- type: 'number',
- required: true,
- enum: [42]
- }
- }
- })
-
- t.notOk(validate({}), 'is required')
- t.ok(validate({foo:42}))
- t.notOk(validate({foo:43}))
- t.end()
-})
-
-tape('minimum/maximum', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- foo: {
- type: 'number',
- minimum: 0,
- maximum: 0
- }
- }
- })
-
- t.notOk(validate({foo:-42}))
- t.ok(validate({foo:0}))
- t.notOk(validate({foo:42}))
- t.end()
-})
-
-tape('exclusiveMinimum/exclusiveMaximum', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- foo: {
- type: 'number',
- minimum: 10,
- maximum: 20,
- exclusiveMinimum: true,
- exclusiveMaximum: true
- }
- }
- })
-
- t.notOk(validate({foo:10}))
- t.ok(validate({foo:11}))
- t.notOk(validate({foo:20}))
- t.ok(validate({foo:19}))
- t.end()
-})
-
-tape('custom format', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- foo: {
- type: 'string',
- format: 'as'
- }
- }
- }, {formats: {as:/^a+$/}})
-
- t.notOk(validate({foo:''}), 'not as')
- t.notOk(validate({foo:'b'}), 'not as')
- t.notOk(validate({foo:'aaab'}), 'not as')
- t.ok(validate({foo:'a'}), 'as')
- t.ok(validate({foo:'aaaaaa'}), 'as')
- t.end()
-})
-
-tape('custom format function', function(t) {
- var validate = validator({
- type: 'object',
- properties: {
- foo: {
- type: 'string',
- format: 'as'
- }
- }
- }, {formats: {as:function(s) { return /^a+$/.test(s) } }})
-
- t.notOk(validate({foo:''}), 'not as')
- t.notOk(validate({foo:'b'}), 'not as')
- t.notOk(validate({foo:'aaab'}), 'not as')
- t.ok(validate({foo:'a'}), 'as')
- t.ok(validate({foo:'aaaaaa'}), 'as')
- t.end()
-})
-
-tape('do not mutate schema', function(t) {
- var sch = {
- items: [
- {}
- ],
- additionalItems: {
- type: 'integer'
- }
- }
-
- var copy = JSON.parse(JSON.stringify(sch))
-
- validator(sch)
-
- t.same(sch, copy, 'did not mutate')
- t.end()
-})
-
-tape('#toJSON()', function(t) {
- var schema = {
- required: true,
- type: 'object',
- properties: {
- hello: {type:'string', required:true}
- }
- }
-
- var validate = validator(schema)
-
- t.deepEqual(validate.toJSON(), schema, 'should return original schema')
- t.end()
-})
-
-tape('external schemas', function(t) {
- var ext = {type: 'string'}
- var schema = {
- required: true,
- $ref: '#ext'
- }
-
- var validate = validator(schema, {schemas: {ext:ext}})
-
- t.ok(validate('hello string'), 'is a string')
- t.notOk(validate(42), 'not a string')
- t.end()
-})
-
-tape('top-level external schema', function(t) {
- var defs = {
- "string": {
- type: "string"
- },
- "sex": {
- type: "string",
- enum: ["male", "female", "other"]
- }
- }
- var schema = {
- type: "object",
- properties: {
- "name": { $ref: "definitions.json#/string" },
- "sex": { $ref: "definitions.json#/sex" }
- },
- required: ["name", "sex"]
- }
-
- var validate = validator(schema, {
- schemas: {
- "definitions.json": defs
- }
- })
- t.ok(validate({name:"alice", sex:"female"}), 'is an object')
- t.notOk(validate({name:"alice", sex: "bob"}), 'recognizes external schema')
- t.notOk(validate({name:2, sex: "female"}), 'recognizes external schema')
- t.end()
-})
-
-tape('nested required array decl', function(t) {
- var schema = {
- properties: {
- x: {
- type: 'object',
- properties: {
- y: {
- type: 'object',
- properties: {
- z: {
- type: 'string'
- }
- },
- required: ['z']
- }
- }
- }
- },
- required: ['x']
- }
-
- var validate = validator(schema)
-
- t.ok(validate({x: {}}), 'should be valid')
- t.notOk(validate({}), 'should not be valid')
- t.strictEqual(validate.errors[0].field, 'data.x', 'should output the missing field')
- t.end()
-})
-
-tape('verbose mode', function(t) {
- var schema = {
- required: true,
- type: 'object',
- properties: {
- hello: {
- required: true,
- type: 'string'
- }
- }
- };
-
- var validate = validator(schema, {verbose: true})
-
- t.ok(validate({hello: 'string'}), 'should be valid')
- t.notOk(validate({hello: 100}), 'should not be valid')
- t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value')
- t.end()
-})
-
-tape('additional props in verbose mode', function(t) {
- var schema = {
- type: 'object',
- required: true,
- additionalProperties: false,
- properties: {
- foo: {
- type: 'string'
- },
- 'hello world': {
- type: 'object',
- required: true,
- additionalProperties: false,
- properties: {
- foo: {
- type: 'string'
- }
- }
- }
- }
- };
-
- var validate = validator(schema, {verbose: true})
-
- validate({'hello world': {bar: 'string'}});
-
- t.strictEqual(validate.errors[0].value, 'data["hello world"].bar', 'should output the path to the additional prop in the error')
- t.end()
-})
-
-tape('Date.now() is an integer', function(t) {
- var schema = {type: 'integer'}
- var validate = validator(schema)
-
- t.ok(validate(Date.now()), 'is integer')
- t.end()
-})
-
-tape('field shows item index in arrays', function(t) {
- var schema = {
- type: 'array',
- items: {
- type: 'array',
- items: {
- properties: {
- foo: {
- type: 'string',
- required: true
- }
- }
- }
- }
- }
-
- var validate = validator(schema)
-
- validate([
- [
- { foo: 'test' },
- { foo: 'test' }
- ],
- [
- { foo: 'test' },
- { baz: 'test' }
- ]
- ])
-
- t.strictEqual(validate.errors[0].field, 'data.1.1.foo', 'should output the field with specific index of failing item in the error')
- t.end()
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/package.json b/node_modules/request/node_modules/har-validator/package.json
deleted file mode 100644
index 3545d99..0000000
--- a/node_modules/request/node_modules/har-validator/package.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "version": "1.7.0",
- "name": "har-validator",
- "description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
- "author": {
- "name": "Ahmad Nassri",
- "email": "ahmad@ahmadnassri.com",
- "url": "https://www.ahmadnassri.com/"
- },
- "homepage": "https://github.com/ahmadnassri/har-validator",
- "license": "MIT",
- "main": "./src/index.js",
- "bin": {
- "har-validator": "./bin/har-validator"
- },
- "keywords": [
- "har",
- "http",
- "archive",
- "validate",
- "validator"
- ],
- "engines": {
- "node": ">=0.10"
- },
- "files": [
- "bin",
- "src"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/ahmadnassri/har-validator"
- },
- "bugs": {
- "url": "https://github.com/ahmadnassri/har-validator/issues"
- },
- "scripts": {
- "test": "standard && mocha --reporter spec",
- "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha",
- "codeclimate": "codeclimate < coverage/lcov.info"
- },
- "devDependencies": {
- "codeclimate-test-reporter": "0.0.4",
- "istanbul": "^0.3.13",
- "mocha": "^2.2.4",
- "require-directory": "^2.1.0",
- "should": "^6.0.1",
- "standard": "^3.7.2"
- },
- "dependencies": {
- "bluebird": "^2.9.25",
- "chalk": "^1.0.0",
- "commander": "^2.8.1",
- "is-my-json-valid": "^2.10.1"
- },
- "gitHead": "74aab6b4994681cdb961db88f5129c5096eaf06a",
- "_id": "har-validator@1.7.0",
- "_shasum": "563f8c58edca6410e2e408b0e540161da580dc46",
- "_from": "har-validator@>=1.4.0 <2.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.1",
- "_npmUser": {
- "name": "ahmadnassri",
- "email": "ahmad@ahmadnassri.com"
- },
- "maintainers": [
- {
- "name": "ahmadnassri",
- "email": "ahmad@ahmadnassri.com"
- }
- ],
- "dist": {
- "shasum": "563f8c58edca6410e2e408b0e540161da580dc46",
- "tarball": "http://registry.npmjs.org/har-validator/-/har-validator-1.7.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.7.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/error.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/error.js b/node_modules/request/node_modules/har-validator/src/error.js
deleted file mode 100644
index fc08a87..0000000
--- a/node_modules/request/node_modules/har-validator/src/error.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict'
-
-function ValidationError (errors) {
- this.name = 'ValidationError'
- this.errors = errors
-}
-
-ValidationError.prototype = Error.prototype
-
-module.exports = ValidationError
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/index.js b/node_modules/request/node_modules/har-validator/src/index.js
deleted file mode 100644
index 6d52167..0000000
--- a/node_modules/request/node_modules/har-validator/src/index.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict'
-
-var schemas = require('./schemas')
-var ValidationError = require('./error')
-var validator = require('is-my-json-valid')
-
-var runner = function (schema, data, cb) {
- var validate = validator(schema, {
- greedy: true,
- verbose: true,
- schemas: schemas
- })
-
- var valid = false
-
- if (data !== undefined) {
- // execute is-my-json-valid
- valid = validate(data)
- }
-
- // callback?
- if (!cb) {
- return validate.errors ? false : true
- } else {
- return cb(validate.errors ? new ValidationError(validate.errors) : null, valid)
- }
-
- return valid
-}
-
-module.exports = function (data, cb) {
- return runner(schemas.har, data, cb)
-}
-
-Object.keys(schemas).map(function (name) {
- module.exports[name] = function (data, cb) {
- return runner(schemas[name], data, cb)
- }
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/cache.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/cache.json b/node_modules/request/node_modules/har-validator/src/schemas/cache.json
deleted file mode 100644
index a3ab682..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/cache.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "properties": {
- "beforeRequest": {
- "$ref": "#cacheEntry"
- },
- "afterRequest": {
- "$ref": "#cacheEntry"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/cacheEntry.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/cacheEntry.json b/node_modules/request/node_modules/har-validator/src/schemas/cacheEntry.json
deleted file mode 100644
index a397439..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/cacheEntry.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "oneOf": [{
- "type": "object",
- "optional": true,
- "required": [
- "lastAccess",
- "eTag",
- "hitCount"
- ],
- "properties": {
- "expires": {
- "type": "string"
- },
- "lastAccess": {
- "type": "string"
- },
- "eTag": {
- "type": "string"
- },
- "hitCount": {
- "type": "integer"
- },
- "comment": {
- "type": "string"
- }
- }
- }, {
- "type": null,
- "additionalProperties": false
- }]
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/content.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/content.json b/node_modules/request/node_modules/har-validator/src/schemas/content.json
deleted file mode 100644
index 3710d79..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/content.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "type": "object",
- "required": [
- "size",
- "mimeType"
- ],
- "properties": {
- "size": {
- "type": "integer"
- },
- "compression": {
- "type": "integer"
- },
- "mimeType": {
- "type": "string"
- },
- "text": {
- "type": "string"
- },
- "encoding": {
- "type": "string"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/cookie.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/cookie.json b/node_modules/request/node_modules/har-validator/src/schemas/cookie.json
deleted file mode 100644
index 5768181..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/cookie.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "type": "object",
- "required": [
- "name",
- "value"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "value": {
- "type": "string"
- },
- "path": {
- "type": "string"
- },
- "domain": {
- "type": "string"
- },
- "expires": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "httpOnly": {
- "type": "boolean"
- },
- "secure": {
- "type": "boolean"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/creator.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/creator.json b/node_modules/request/node_modules/har-validator/src/schemas/creator.json
deleted file mode 100644
index 5058600..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/creator.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "type": "object",
- "required": [
- "name",
- "version"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "version": {
- "type": "string"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/entry.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/entry.json b/node_modules/request/node_modules/har-validator/src/schemas/entry.json
deleted file mode 100644
index 7acdc1b..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/entry.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "type": "object",
- "optional": true,
- "required": [
- "startedDateTime",
- "time",
- "request",
- "response",
- "cache",
- "timings"
- ],
- "properties": {
- "pageref": {
- "type": "string"
- },
- "startedDateTime": {
- "type": "string",
- "format": "date-time",
- "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
- },
- "time": {
- "type": "number",
- "min": 0
- },
- "request": {
- "$ref": "#request"
- },
- "response": {
- "$ref": "#response"
- },
- "cache": {
- "$ref": "#cache"
- },
- "timings": {
- "$ref": "#timings"
- },
- "serverIPAddress": {
- "type": "string",
- "format": "ipv4"
- },
- "connection": {
- "type": "string"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/har.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/har.json b/node_modules/request/node_modules/har-validator/src/schemas/har.json
deleted file mode 100644
index b542782..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/har.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "type": "object",
- "required": [
- "log"
- ],
- "properties": {
- "log": {
- "$ref": "#log"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/index.js b/node_modules/request/node_modules/har-validator/src/schemas/index.js
deleted file mode 100644
index 7b6db7d..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict'
-
-var schemas = {
- cache: require('./cache.json'),
- cacheEntry: require('./cacheEntry.json'),
- content: require('./content.json'),
- cookie: require('./cookie.json'),
- creator: require('./creator.json'),
- entry: require('./entry.json'),
- har: require('./har.json'),
- log: require('./log.json'),
- page: require('./page.json'),
- pageTimings: require('./pageTimings.json'),
- postData: require('./postData.json'),
- record: require('./record.json'),
- request: require('./request.json'),
- response: require('./response.json'),
- timings: require('./timings.json')
-}
-
-// is-my-json-valid does not provide meaningful error messages for external schemas
-// this is a workaround
-schemas.cache.properties.beforeRequest = schemas.cacheEntry
-schemas.cache.properties.afterRequest = schemas.cacheEntry
-
-schemas.page.properties.pageTimings = schemas.pageTimings
-
-schemas.request.properties.cookies.items = schemas.cookie
-schemas.request.properties.headers.items = schemas.record
-schemas.request.properties.queryString.items = schemas.record
-schemas.request.properties.postData = schemas.postData
-
-schemas.response.properties.cookies.items = schemas.cookie
-schemas.response.properties.headers.items = schemas.record
-schemas.response.properties.content = schemas.content
-
-schemas.entry.properties.request = schemas.request
-schemas.entry.properties.response = schemas.response
-schemas.entry.properties.cache = schemas.cache
-schemas.entry.properties.timings = schemas.timings
-
-schemas.log.properties.creator = schemas.creator
-schemas.log.properties.browser = schemas.creator
-schemas.log.properties.pages.items = schemas.page
-schemas.log.properties.entries.items = schemas.entry
-
-schemas.har.properties.log = schemas.log
-
-module.exports = schemas
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/log.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/log.json b/node_modules/request/node_modules/har-validator/src/schemas/log.json
deleted file mode 100644
index 0c91d38..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/log.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "type": "object",
- "required": [
- "version",
- "creator",
- "entries"
- ],
- "properties": {
- "version": {
- "type": "string"
- },
- "creator": {
- "$ref": "#creator"
- },
- "browser": {
- "$ref": "#creator"
- },
- "pages": {
- "type": "array",
- "items": {
- "$ref": "#page"
- }
- },
- "entries": {
- "type": "array",
- "items": {
- "$ref": "#entry"
- }
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/page.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/page.json b/node_modules/request/node_modules/har-validator/src/schemas/page.json
deleted file mode 100644
index ef64abe..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/page.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "type": "object",
- "optional": true,
- "required": [
- "startedDateTime",
- "id",
- "title",
- "pageTimings"
- ],
- "properties": {
- "startedDateTime": {
- "type": "string",
- "format": "date-time",
- "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
- },
- "id": {
- "type": "string",
- "unique": true
- },
- "title": {
- "type": "string"
- },
- "pageTimings": {
- "$ref": "#pageTimings"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/pageTimings.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/pageTimings.json b/node_modules/request/node_modules/har-validator/src/schemas/pageTimings.json
deleted file mode 100644
index adc83cc..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/pageTimings.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "type": "object",
- "properties": {
- "onContentLoad": {
- "type": "number",
- "min": -1
- },
- "onLoad": {
- "type": "number",
- "min": -1
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/postData.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/postData.json b/node_modules/request/node_modules/har-validator/src/schemas/postData.json
deleted file mode 100644
index 91958b6..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/postData.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "type": "object",
- "optional": true,
- "required": [
- "mimeType"
- ],
- "properties": {
- "mimeType": {
- "type": "string"
- },
- "text": {
- "type": "string"
- },
- "params": {
- "type": "array",
- "required": [
- "name"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "value": {
- "type": "string"
- },
- "fileName": {
- "type": "string"
- },
- "contentType": {
- "type": "string"
- },
- "comment": {
- "type": "string"
- }
- }
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/record.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/record.json b/node_modules/request/node_modules/har-validator/src/schemas/record.json
deleted file mode 100644
index 04acd51..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/record.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "type": "object",
- "required": [
- "name",
- "value"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "value": {
- "type": "string"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/request.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/request.json b/node_modules/request/node_modules/har-validator/src/schemas/request.json
deleted file mode 100644
index 639af06..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/request.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "type": "object",
- "required": [
- "method",
- "url",
- "httpVersion",
- "cookies",
- "headers",
- "queryString",
- "headersSize",
- "bodySize"
- ],
- "properties": {
- "method": {
- "type": "string"
- },
- "url": {
- "type": "string",
- "format": "uri"
- },
- "httpVersion": {
- "type": "string"
- },
- "cookies": {
- "type": "array",
- "items": {
- "$ref": "#cookie"
- }
- },
- "headers": {
- "type": "array",
- "items": {
- "$ref": "#record"
- }
- },
- "queryString": {
- "type": "array",
- "items": {
- "$ref": "#record"
- }
- },
- "postData": {
- "$ref": "#postData"
- },
- "headersSize": {
- "type": "integer"
- },
- "bodySize": {
- "type": "integer"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/response.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/response.json b/node_modules/request/node_modules/har-validator/src/schemas/response.json
deleted file mode 100644
index de99c55..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/response.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "type": "object",
- "required": [
- "status",
- "statusText",
- "httpVersion",
- "cookies",
- "headers",
- "content",
- "redirectURL",
- "headersSize",
- "bodySize"
- ],
- "properties": {
- "status": {
- "type": "integer"
- },
- "statusText": {
- "type": "string"
- },
- "httpVersion": {
- "type": "string"
- },
- "cookies": {
- "type": "array",
- "items": {
- "$ref": "#cookie"
- }
- },
- "headers": {
- "type": "array",
- "items": {
- "$ref": "#record"
- }
- },
- "content": {
- "$ref": "#content"
- },
- "redirectURL": {
- "type": "string"
- },
- "headersSize": {
- "type": "integer"
- },
- "bodySize": {
- "type": "integer"
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/src/schemas/timings.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/src/schemas/timings.json b/node_modules/request/node_modules/har-validator/src/schemas/timings.json
deleted file mode 100644
index 066ef71..0000000
--- a/node_modules/request/node_modules/har-validator/src/schemas/timings.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "required": [
- "send",
- "wait",
- "receive"
- ],
- "properties": {
- "dns": {
- "type": "number",
- "min": -1
- },
- "connect": {
- "type": "number",
- "min": -1
- },
- "blocked": {
- "type": "number",
- "min": -1
- },
- "send": {
- "type": "number",
- "min": -1
- },
- "wait": {
- "type": "number",
- "min": -1
- },
- "receive": {
- "type": "number",
- "min": -1
- },
- "ssl": {
- "type": "number",
- "min": -1
- },
- "comment": {
- "type": "string"
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/.npmignore b/node_modules/request/node_modules/hawk/.npmignore
deleted file mode 100644
index 70febc0..0000000
--- a/node_modules/request/node_modules/hawk/.npmignore
+++ /dev/null
@@ -1,20 +0,0 @@
-.idea
-*.iml
-npm-debug.log
-dump.rdb
-node_modules
-components
-build
-results.tap
-results.xml
-npm-shrinkwrap.json
-config.json
-.DS_Store
-*/.DS_Store
-*/*/.DS_Store
-._*
-*/._*
-*/*/._*
-coverage.*
-lib-cov
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/.travis.yml b/node_modules/request/node_modules/hawk/.travis.yml
deleted file mode 100755
index 047f7e3..0000000
--- a/node_modules/request/node_modules/hawk/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-
-node_js:
- - 0.10
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/LICENSE b/node_modules/request/node_modules/hawk/LICENSE
deleted file mode 100755
index 7880936..0000000
--- a/node_modules/request/node_modules/hawk/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2012-2014, Eran Hammer and other contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * The names of any contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- * * *
-
-The complete list of contributors can be found at: https://github.com/hueniverse/hawk/graphs/contributors
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/Makefile b/node_modules/request/node_modules/hawk/Makefile
deleted file mode 100755
index b102d5a..0000000
--- a/node_modules/request/node_modules/hawk/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-test:
- @node node_modules/lab/bin/lab -a code
-test-cov:
- @node node_modules/lab/bin/lab -a code -t 100
-test-cov-html:
- @node node_modules/lab/bin/lab -a code -r html -o coverage.html
-
-.PHONY: test test-cov test-cov-html
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/README.md b/node_modules/request/node_modules/hawk/README.md
deleted file mode 100755
index 0bcd287..0000000
--- a/node_modules/request/node_modules/hawk/README.md
+++ /dev/null
@@ -1,635 +0,0 @@
-
-
-<img align="right" src="https://raw.github.com/hueniverse/hawk/master/images/logo.png" /> **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial
-HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz).
-
-Current version: **2.3**
-
-Note: 2.x is the same exact protocol as 1.1. The version increment reflects a change in the internal error format
-used by the module and used by the node API.
-
-[](http://travis-ci.org/hueniverse/hawk)
-
-# Table of Content
-
-- [**Introduction**](#introduction)
- - [Replay Protection](#replay-protection)
- - [Usage Example](#usage-example)
- - [Protocol Example](#protocol-example)
- - [Payload Validation](#payload-validation)
- - [Response Payload Validation](#response-payload-validation)
- - [Browser Support and Considerations](#browser-support-and-considerations)
-<p></p>
-- [**Single URI Authorization**](#single-uri-authorization)
- - [Usage Example](#bewit-usage-example)
-<p></p>
-- [**Security Considerations**](#security-considerations)
- - [MAC Keys Transmission](#mac-keys-transmission)
- - [Confidentiality of Requests](#confidentiality-of-requests)
- - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers)
- - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials)
- - [Entropy of Keys](#entropy-of-keys)
- - [Coverage Limitations](#coverage-limitations)
- - [Future Time Manipulation](#future-time-manipulation)
- - [Client Clock Poisoning](#client-clock-poisoning)
- - [Bewit Limitations](#bewit-limitations)
- - [Host Header Forgery](#host-header-forgery)
-<p></p>
-- [**Frequently Asked Questions**](#frequently-asked-questions)
-<p></p>
-- [**Implementations**](#implementations)
-- [**Acknowledgements**](#acknowledgements)
-
-# Introduction
-
-**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with
-partial cryptographic verification of the request and response, covering the HTTP method, request URI, host,
-and optionally the request payload.
-
-Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of
-client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme,
-the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is
-included in its place.
-
-However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of
-replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less
-"chattiness" (interaction with the server).
-
-Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because
-the client and server must both have access to the key material in the clear.
-
-The primary design goals of this scheme are to:
-* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources,
-* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where
- to send an authenticated request), and
-* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client
- failure to validate the server's identity as part of its TLS handshake.
-
-In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using
-a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk).
-
-The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server,
-which is beyond the scope of this module. Typically, the shared credentials are established via an initial
-TLS-protected phase or derived from some other shared confidential information available to both the client
-and the server.
-
-
-## Replay Protection
-
-Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more
-than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when
-making requests. This gives the server enough information to prevent replay attacks.
-
-The nonce is generated by the client, and is a string unique across all requests with the same timestamp and
-key identifier combination.
-
-The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards
-are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks.
-By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in
-practice translates to a maximum of 2 minutes as the skew can be positive or negative).
-
-Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client
-clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types
-(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response
-to a bad timestamp.
-
-There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a
-potential attack vector). Instead, the client only uses the server's time to calculate an offset used only
-for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing
-the number of round trips required to authenticate the first request.
-
-
-## Usage Example
-
-Server code:
-
-```javascript
-var Http = require('http');
-var Hawk = require('hawk');
-
-
-// Credentials lookup function
-
-var credentialsFunc = function (id, callback) {
-
- var credentials = {
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'Steve'
- };
-
- return callback(null, credentials);
-};
-
-// Create HTTP server
-
-var handler = function (req, res) {
-
- // Authenticate incoming request
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- // Prepare response
-
- var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');
- var headers = { 'Content-Type': 'text/plain' };
-
- // Generate Server-Authorization response header
-
- var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] });
- headers['Server-Authorization'] = header;
-
- // Send the response back
-
- res.writeHead(!err ? 200 : 401, headers);
- res.end(payload);
- });
-};
-
-// Start server
-
-Http.createServer(handler).listen(8000, 'example.com');
-```
-
-Client code:
-
-```javascript
-var Request = require('request');
-var Hawk = require('hawk');
-
-
-// Client credentials
-
-var credentials = {
- id: 'dh37fgj492je',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256'
-}
-
-// Request options
-
-var requestOptions = {
- uri: 'http://example.com:8000/resource/1?b=1&a=2',
- method: 'GET',
- headers: {}
-};
-
-// Generate Authorization request header
-
-var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' });
-requestOptions.headers.Authorization = header.field;
-
-// Send authenticated request
-
-Request(requestOptions, function (error, response, body) {
-
- // Authenticate the server's response
-
- var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });
-
- // Output results
-
- console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));
-});
-```
-
-**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local
-machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method.
-
-```javascript
-Hawk.sntp.start();
-```
-
-
-## Protocol Example
-
-The client attempts to access a protected resource without authentication, sending the following HTTP request to
-the resource server:
-
-```
-GET /resource/1?b=1&a=2 HTTP/1.1
-Host: example.com:8000
-```
-
-The resource server returns an authentication challenge.
-
-```
-HTTP/1.1 401 Unauthorized
-WWW-Authenticate: Hawk
-```
-
-The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/"
-server. The **Hawk** credentials issued to the client include the following attributes:
-
-* Key identifier: dh37fgj492je
-* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn
-* Algorithm: sha256
-
-The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1,
-1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline
-character):
-
-```
-hawk.1.header
-1353832234
-j4h3g2
-GET
-/resource/1?b=1&a=2
-example.com
-8000
-
-some-app-ext-data
-
-```
-
-The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string.
-The result is base64-encoded to produce the request MAC:
-
-```
-6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=
-```
-
-The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using
-the HTTP `Authorization` request header field:
-
-```
-GET /resource/1?b=1&a=2 HTTP/1.1
-Host: example.com:8000
-Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="
-```
-
-The server validates the request by calculating the request MAC again based on the request received and verifies the validity
-and scope of the **Hawk** credentials. If valid, the server responds with the requested resource.
-
-
-### Payload Validation
-
-**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash
-using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character):
-* `hawk.1.payload`
-* the content-type in lowercase, without any parameters (e.g. `application/json`)
-* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability)
-
-For example:
-
-* Payload: `Thank you for flying Hawk`
-* Content Type: `text/plain`
-* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=`
-
-Results in the following input to the payload hash function (newline terminated values):
-
-```
-hawk.1.payload
-text/plain
-Thank you for flying Hawk
-
-```
-
-Which produces the following hash value:
-
-```
-Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=
-```
-
-The client constructs the normalized request string (newline terminated values):
-
-```
-hawk.1.header
-1353832234
-j4h3g2
-POST
-/resource/1?a=1&b=2
-example.com
-8000
-Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=
-some-app-ext-data
-
-```
-
-Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data,
-and request MAC, with the request using the HTTP `Authorization` request header field:
-
-```
-POST /resource/1?a=1&b=2 HTTP/1.1
-Host: example.com:8000
-Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw="
-```
-
-It is up to the server if and when it validates the payload for any given request, based solely on it's security policy
-and the nature of the data included.
-
-If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct
-the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value
-with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash.
-
-However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed
-at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value
-provided by the client after validating the MAC.
-
-It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value
-included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided
-by the client, the payload may be modified by an attacker.
-
-
-## Response Payload Validation
-
-**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the
-client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header
-as a response header using the exact same syntax as the `Authorization` request header field.
-
-The header is contructed using the same process as the client's request header. The server uses the same credentials and other
-artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with
-new values based on the server response. The rest as identical to those used by the client.
-
-The result MAC digest is included with the optional `hash` and `ext` values:
-
-```
-Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"
-```
-
-
-## Browser Support and Considerations
-
-A browser script is provided for including using a `<script>` tag in [lib/browser.js](/lib/browser.js). It's also a [component](http://component.io/hueniverse/hawk).
-
-**Hawk** relies on the _Server-Authorization_ and _WWW-Authenticate_ headers in its response to communicate with the client.
-Therefore, in case of CORS requests, it is important to consider sending _Access-Control-Expose-Headers_ with the value
-_"WWW-Authenticate, Server-Authorization"_ on each response from your server. As explained in the
-[specifications](http://www.w3.org/TR/cors/#access-control-expose-headers-response-header), it will indicate that these headers
-can safely be accessed by the client (using getResponseHeader() on the XmlHttpRequest object). Otherwise you will be met with a
-["simple response header"](http://www.w3.org/TR/cors/#simple-response-header) which excludes these fields and would prevent the
-Hawk client from authenticating the requests.You can read more about the why and how in this
-[article](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server)
-
-
-# Single URI Authorization
-
-There are cases in which limited and short-term access to a protected resource is granted to a third party which does not
-have access to the shared credentials. For example, displaying a protected image on a web page accessed by anyone. **Hawk**
-provides limited support for such URIs in the form of a _bewit_ - a URI query parameter appended to the request URI which contains
-the necessary credentials to authenticate the request.
-
-Because of the significant security risks involved in issuing such access, bewit usage is purposely limited only to GET requests
-and for a finite period of time. Both the client and server can issue bewit credentials, however, the server should not use the same
-credentials as the client to maintain clear traceability as to who issued which credentials.
-
-In order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within
-the granted access timeframe.
-
-
-## Bewit Usage Example
-
-Server code:
-
-```javascript
-var Http = require('http');
-var Hawk = require('hawk');
-
-
-// Credentials lookup function
-
-var credentialsFunc = function (id, callback) {
-
- var credentials = {
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256'
- };
-
- return callback(null, credentials);
-};
-
-// Create HTTP server
-
-var handler = function (req, res) {
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- res.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' });
- res.end(!err ? 'Access granted' : 'Shoosh!');
- });
-};
-
-Http.createServer(handler).listen(8000, 'example.com');
-```
-
-Bewit code generation:
-
-```javascript
-var Request = require('request');
-var Hawk = require('hawk');
-
-
-// Client credentials
-
-var credentials = {
- id: 'dh37fgj492je',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256'
-}
-
-// Generate bewit
-
-var duration = 60 * 5; // 5 Minutes
-var bewit = Hawk.uri.getBewit('http://example.com:8080/resource/1?b=1&a=2', { credentials: credentials, ttlSec: duration, ext: 'some-app-data' });
-var uri = 'http://example.com:8000/resource/1?b=1&a=2' + '&bewit=' + bewit;
-```
-
-
-# Security Considerations
-
-The greatest sources of security risks are usually found not in **Hawk** but in the policies and procedures surrounding its use.
-Implementers are strongly encouraged to assess how this module addresses their security requirements. This section includes
-an incomplete list of security considerations that must be reviewed and understood before deploying **Hawk** on the server.
-Many of the protections provided in **Hawk** depends on whether and how they are used.
-
-### MAC Keys Transmission
-
-**Hawk** does not provide any mechanism for obtaining or transmitting the set of shared credentials required. Any mechanism used
-to obtain **Hawk** credentials must ensure that these transmissions are protected using transport-layer mechanisms such as TLS.
-
-### Confidentiality of Requests
-
-While **Hawk** provides a mechanism for verifying the integrity of HTTP requests, it provides no guarantee of request
-confidentiality. Unless other precautions are taken, eavesdroppers will have full access to the request content. Servers should
-carefully consider the types of data likely to be sent as part of such requests, and employ transport-layer security mechanisms
-to protect sensitive resources.
-
-### Spoofing by Counterfeit Servers
-
-**Hawk** provides limited verification of the server authenticity. When receiving a response back from the server, the server
-may choose to include a response `Server-Authorization` header which the client can use to verify the response. However, it is up to
-the server to determine when such measure is included, to up to the client to enforce that policy.
-
-A hostile party could take advantage of this by intercepting the client's requests and returning misleading or otherwise
-incorrect responses. Service providers should consider such attacks when developing services using this protocol, and should
-require transport-layer security for any requests where the authenticity of the resource server or of server responses is an issue.
-
-### Plaintext Storage of Credentials
-
-The **Hawk** key functions the same way passwords do in traditional authentication systems. In order to compute the request MAC,
-the server must have access to the key in plaintext form. This is in contrast, for example, to modern operating systems, which
-store only a one-way hash of user credentials.
-
-If an attacker were to gain access to these keys - or worse, to the server's database of all such keys - he or she would be able
-to perform any action on behalf of any resource owner. Accordingly, it is critical that servers protect these keys from unauthorized
-access.
-
-### Entropy of Keys
-
-Unless a transport-layer security protocol is used, eavesdroppers will have full access to authenticated requests and request
-MAC values, and will thus be able to mount offline brute-force attacks to recover the key used. Servers should be careful to
-assign keys which are long enough, and random enough, to resist such attacks for at least the length of time that the **Hawk**
-credentials are valid.
-
-For example, if the credentials are valid for two weeks, servers should ensure that it is not possible to mount a brute force
-attack that recovers the key in less than two weeks. Of course, servers are urged to err on the side of caution, and use the
-longest key reasonable.
-
-It is equally important that the pseudo-random number generator (PRNG) used to generate these keys be of sufficiently high
-quality. Many PRNG implementations generate number sequences that may appear to be random, but which nevertheless exhibit
-patterns or other weaknesses which make cryptanalysis or brute force attacks easier. Implementers should be careful to use
-cryptographically secure PRNGs to avoid these problems.
-
-### Coverage Limitations
-
-The request MAC only covers the HTTP `Host` header and optionally the `Content-Type` header. It does not cover any other headers
-which can often affect how the request body is interpreted by the server. If the server behavior is influenced by the presence
-or value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the
-`ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC.
-
-The response authentication, when performed, only covers the response payload, content-type, and the request information
-provided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or
-any other response header field (e.g. Location) which can affect the client's behaviour.
-
-### Future Time Manipulation
-
-The protocol relies on a clock sync between the client and server. To accomplish this, the server informs the client of its
-current time when an invalid timestamp is received.
-
-If an attacker is able to manipulate this information and cause the client to use an incorrect time, it would be able to cause
-the client to generate authenticated requests using time in the future. Such requests will fail when sent by the client, and will
-not likely leave a trace on the server (given the common implementation of nonce, if at all enforced). The attacker will then
-be able to replay the request at the correct time without detection.
-
-The client must only use the time information provided by the server if:
-* it was delivered over a TLS connection and the server identity has been verified, or
-* the `tsm` MAC digest calculated using the same client credentials over the timestamp has been verified.
-
-### Client Clock Poisoning
-
-When receiving a request with a bad timestamp, the server provides the client with its current time. The client must never use
-the time received from the server to adjust its own clock, and must only use it to calculate an offset for communicating with
-that particular server.
-
-### Bewit Limitations
-
-Special care must be taken when issuing bewit credentials to third parties. Bewit credentials are valid until expiration and cannot
-be revoked or limited without using other means. Whatever resource they grant access to will be completely exposed to anyone with
-access to the bewit credentials which act as bearer credentials for that particular resource. While bewit usage is limited to GET
-requests only and therefore cannot be used to perform transactions or change server state, it can still be used to expose private
-and sensitive information.
-
-### Host Header Forgery
-
-Hawk validates the incoming request MAC against the incoming HTTP Host header. However, unless the optional `host` and `port`
-options are used with `server.authenticate()`, a malicous client can mint new host names pointing to the server's IP address and
-use that to craft an attack by sending a valid request that's meant for another hostname than the one used by the server. Server
-implementors must manually verify that the host header received matches their expectation (or use the options mentioned above).
-
-# Frequently Asked Questions
-
-### Where is the protocol specification?
-
-If you are looking for some prose explaining how all this works, **this is it**. **Hawk** is being developed as an open source
-project instead of a standard. In other words, the [code](/hueniverse/hawk/tree/master/lib) is the specification. Not sure about
-something? Open an issue!
-
-### Is it done?
-
-As of version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental
-and is likely to change. This also means your feedback and contribution are very welcome. Feel free to open issues with questions
-and suggestions.
-
-### Where can I find **Hawk** implementations in other languages?
-
-**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, it has been ported to other languages.
-The full list is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port&state=closed). Please add an issue if you are
-working on another port. A cross-platform test-suite is in the works.
-
-### Why isn't the algorithm part of the challenge or dynamically negotiated?
-
-The algorithm used is closely related to the key issued as different algorithms require different key sizes (and other
-requirements). While some keys can be used for multiple algorithm, the protocol is designed to closely bind the key and algorithm
-together as part of the issued credentials.
-
-### Why is Host and Content-Type the only headers covered by the request MAC?
-
-It is really hard to include other headers. Headers can be changed by proxies and other intermediaries and there is no
-well-established way to normalize them. Many platforms change the case of header field names and values. The only
-straight-forward solution is to include the headers in some blob (say, base64 encoded JSON) and include that with the request,
-an approach taken by JWT and other such formats. However, that design violates the HTTP header boundaries, repeats information,
-and introduces other security issues because firewalls will not be aware of these "hidden" headers. In addition, any information
-repeated must be compared to the duplicated information in the header and therefore only moves the problem elsewhere.
-
-### Why not just use HTTP Digest?
-
-Digest requires pre-negotiation to establish a nonce. This means you can't just make a request - you must first send
-a protocol handshake to the server. This pattern has become unacceptable for most web services, especially mobile
-where extra round-trip are costly.
-
-### Why bother with all this nonce and timestamp business?
-
-**Hawk** is an attempt to find a reasonable, practical compromise between security and usability. OAuth 1.0 got timestamp
-and nonces halfway right but failed when it came to scalability and consistent developer experience. **Hawk** addresses
-it by requiring the client to sync its clock, but provides it with tools to accomplish it.
-
-In general, replay protection is a matter of application-specific threat model. It is less of an issue on a TLS-protected
-system where the clients are implemented using best practices and are under the control of the server. Instead of dropping
-replay protection, **Hawk** offers a required time window and an optional nonce verification. Together, it provides developers
-with the ability to decide how to enforce their security policy without impacting the client's implementation.
-
-### What are `app` and `dlg` in the authorization header and normalized mac string?
-
-The original motivation for **Hawk** was to replace the OAuth 1.0 use cases. This included both a simple client-server mode which
-this module is specifically designed for, and a delegated access mode which is being developed separately in
-[Oz](https://github.com/hueniverse/oz). In addition to the **Hawk** use cases, Oz requires another attribute: the application id `app`.
-This provides binding between the credentials and the application in a way that prevents an attacker from tricking an application
-to use credentials issued to someone else. It also has an optional 'delegated-by' attribute `dlg` which is the application id of the
-application the credentials were directly issued to. The goal of these two additions is to allow Oz to utilize **Hawk** directly,
-but with the additional security of delegated credentials.
-
-### What is the purpose of the static strings used in each normalized MAC input?
-
-When calculating a hash or MAC, a static prefix (tag) is added. The prefix is used to prevent MAC values from being
-used or reused for a purpose other than what they were created for (i.e. prevents switching MAC values between a request,
-response, and a bewit use cases). It also protects against exploits created after a potential change in how the protocol
-creates the normalized string. For example, if a future version would switch the order of nonce and timestamp, it
-can create an exploit opportunity for cases where the nonce is similar in format to a timestamp.
-
-### Does **Hawk** have anything to do with OAuth?
-
-Short answer: no.
-
-**Hawk** was originally proposed as the OAuth MAC Token specification. However, the OAuth working group in its consistent
-incompetence failed to produce a final, usable solution to address one of the most popular use cases of OAuth 1.0 - using it
-to authenticate simple client-server transactions (i.e. two-legged). As you can guess, the OAuth working group is still hard
-at work to produce more garbage.
-
-**Hawk** provides a simple HTTP authentication scheme for making client-server requests. It does not address the OAuth use case
-of delegating access to a third party. If you are looking for an OAuth alternative, check out [Oz](https://github.com/hueniverse/oz).
-
-# Implementations
-
-- [Logibit Hawk in F#/.Net](https://github.com/logibit/logibit.hawk/)
-- [Tent Hawk in Ruby](https://github.com/tent/hawk-ruby)
-- [Wealdtech in Java](https://github.com/wealdtech/hawk)
-- [Kumar's Mohawk in Python](https://github.com/kumar303/mohawk/)
-
-# Acknowledgements
-
-**Hawk** is a derivative work of the [HTTP MAC Authentication Scheme](http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05) proposal
-co-authored by Ben Adida, Adam Barth, and Eran Hammer, which in turn was based on the OAuth 1.0 community specification.
-
-Special thanks to Ben Laurie for his always insightful feedback and advice.
-
-The **Hawk** logo was created by [Chris Carrasco](http://chriscarrasco.com).
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/bower.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/bower.json b/node_modules/request/node_modules/hawk/bower.json
deleted file mode 100644
index 7d2d120..0000000
--- a/node_modules/request/node_modules/hawk/bower.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "hawk",
- "main": "lib/browser.js",
- "license": "./LICENSE",
- "ignore": [
- "!lib",
- "lib/*",
- "!lib/browser.js",
- "index.js"
- ],
- "keywords": [
- "http",
- "authentication",
- "scheme",
- "hawk"
- ],
- "authors": [
- "Eran Hammer <er...@hammer.io>"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/hueniverse/hawk.git"
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/component.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/component.json b/node_modules/request/node_modules/hawk/component.json
deleted file mode 100644
index 63e76a2..0000000
--- a/node_modules/request/node_modules/hawk/component.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "hawk",
- "repo": "hueniverse/hawk",
- "description": "HTTP Hawk Authentication Scheme",
- "version": "1.0.0",
- "keywords": [
- "http",
- "authentication",
- "scheme",
- "hawk"
- ],
- "dependencies": {},
- "development": {},
- "license": "BSD",
- "main": "lib/browser.js",
- "scripts": [
- "lib/browser.js"
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/example/usage.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/example/usage.js b/node_modules/request/node_modules/hawk/example/usage.js
deleted file mode 100755
index 8c063f6..0000000
--- a/node_modules/request/node_modules/hawk/example/usage.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// Load modules
-
-var Http = require('http');
-var Request = require('request');
-var Hawk = require('../lib');
-
-
-// Declare internals
-
-var internals = {
- credentials: {
- dh37fgj492je: {
- id: 'dh37fgj492je', // Required by Hawk.client.header
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'Steve'
- }
- }
-};
-
-
-// Credentials lookup function
-
-var credentialsFunc = function (id, callback) {
-
- return callback(null, internals.credentials[id]);
-};
-
-
-// Create HTTP server
-
-var handler = function (req, res) {
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');
- var headers = {
- 'Content-Type': 'text/plain',
- 'Server-Authorization': Hawk.server.header(credentials, artifacts, { payload: payload, contentType: 'text/plain' })
- };
-
- res.writeHead(!err ? 200 : 401, headers);
- res.end(payload);
- });
-};
-
-Http.createServer(handler).listen(8000, '127.0.0.1');
-
-
-// Send unauthenticated request
-
-Request('http://127.0.0.1:8000/resource/1?b=1&a=2', function (error, response, body) {
-
- console.log(response.statusCode + ': ' + body);
-});
-
-
-// Send authenticated request
-
-credentialsFunc('dh37fgj492je', function (err, credentials) {
-
- var header = Hawk.client.header('http://127.0.0.1:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'and welcome!' });
- var options = {
- uri: 'http://127.0.0.1:8000/resource/1?b=1&a=2',
- method: 'GET',
- headers: {
- authorization: header.field
- }
- };
-
- Request(options, function (error, response, body) {
-
- var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });
- console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));
- process.exit(0);
- });
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/images/hawk.png
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/images/hawk.png b/node_modules/request/node_modules/hawk/images/hawk.png
deleted file mode 100755
index a0e15cd..0000000
Binary files a/node_modules/request/node_modules/hawk/images/hawk.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/images/logo.png
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/images/logo.png b/node_modules/request/node_modules/hawk/images/logo.png
deleted file mode 100755
index b8ff590..0000000
Binary files a/node_modules/request/node_modules/hawk/images/logo.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/index.js b/node_modules/request/node_modules/hawk/index.js
deleted file mode 100755
index 4cc88b3..0000000
--- a/node_modules/request/node_modules/hawk/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib');
\ No newline at end of file
[26/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js b/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
deleted file mode 100644
index f07aa2b..0000000
--- a/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************
- * AUTOMATICALLY GENERATED by generate-pubsuffix.js *
- * DO NOT EDIT! *
- ****************************************************/
-
-"use strict";
-
-var punycode = require('punycode');
-
-module.exports.getPublicSuffix = function getPublicSuffix(domain) {
- /*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
- if (!domain) {
- return null;
- }
- if (domain.match(/^\./)) {
- return null;
- }
- var asciiDomain = punycode.toASCII(domain);
- var converted = false;
- if (asciiDomain !== domain) {
- domain = asciiDomain;
- converted = true;
- }
- if (index[domain]) {
- return null;
- }
-
- domain = domain.toLowerCase();
- var parts = domain.split('.').reverse();
-
- var suffix = '';
- var suffixLen = 0;
- for (var i=0; i<parts.length; i++) {
- var part = parts[i];
- var starstr = '*'+suffix;
- var partstr = part+suffix;
-
- if (index[starstr]) { // star rule matches
- suffixLen = i+1;
- if (index[partstr] === false) { // exception rule matches (NB: false, not undefined)
- suffixLen--;
- }
- } else if (index[partstr]) { // exact match, not exception
- suffixLen = i+1;
- }
-
- suffix = '.'+partstr;
- }
-
- if (index['*'+suffix]) { // *.domain exists (e.g. *.kyoto.jp for domain='kyoto.jp');
- return null;
- }
-
- suffixLen = suffixLen || 1;
- if (parts.length > suffixLen) {
- var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.');
- return converted ? punycode.toUnicode(publicSuffix) : publicSuffix;
- }
-
- return null;
-};
-
-// The following generated structure is used under the MPL version 1.1
-// See public-suffix.txt for more information
-
-var index = module.exports.index = Object.freeze(
-{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"edu
cator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software
.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,
"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":
true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,
"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"ne
t.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn"
:true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov
.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"*.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci
.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":tru
e,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":t
rue,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.
id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"*.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it
":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige
.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria
-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"ca
tanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":tru
e,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pesca
ra.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"tran
i-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehim
e.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn-
-efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city
.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takah
ama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gon
ohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":t
rue,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true
,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp
":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"sho
nai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kit
akata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"
hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma
.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiro
shima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.
hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkai
do.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokk
aido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.
jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka
.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.i
baraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.
jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagaw
a.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagaw
a.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.j
p":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.ku
mamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mi
e.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":
true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":t
rue,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"
nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasa
ki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.
nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.ni
igata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,
"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":t
rue,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,
"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.
jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama
.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"hi
gashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shi
mane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shi
zuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"koma
tsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koga
nei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"y
azu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama
.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":t
rue,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikaw
amisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.
km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":t
rue,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,
"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":t
rue,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimo
re.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"ca
rrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"
contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum"
:true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelv
inck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"ir
aq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"ma
d.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":tru
e,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprin
gs.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabar
bara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum
":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.
museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museu
m.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"s
ch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"
xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":
true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no
":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bie
<TRUNCATED>
[57/59] [abbrv] couchdb-nmo git commit: use wreck instead of request
Posted by ro...@apache.org.
use wreck instead of request
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/30c7a148
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/30c7a148
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/30c7a148
Branch: refs/heads/master
Commit: 30c7a148fc8b4d4f6e7bf1454f64f82abfc1bdad
Parents: bd300fa
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Jun 26 00:56:19 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri Jun 26 00:56:19 2015 +0200
----------------------------------------------------------------------
package.json | 4 ++--
src/isonline.js | 5 ++---
src/utils.js | 9 ++-------
test/cluster.js | 31 +------------------------------
test/common.js | 10 ----------
test/isonline.js | 8 --------
6 files changed, 7 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/30c7a148/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 8095998..e1343d2 100644
--- a/package.json
+++ b/package.json
@@ -30,8 +30,8 @@
"nopt": "~3.0.1",
"npmlog": "~1.2.0",
"osenv": "~0.1.0",
- "request": "~2.55.0",
"valid-url": "~1.0.9",
+ "wreck": "~5.6.0",
"xtend": "~4.0.0"
},
"bundleDependencies": [
@@ -41,8 +41,8 @@
"nopt",
"npmlog",
"osenv",
- "request",
"valid-url",
+ "wreck",
"xtend"
],
"devDependencies": {
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/30c7a148/src/isonline.js
----------------------------------------------------------------------
diff --git a/src/isonline.js b/src/isonline.js
index 619a2ba..804087b 100644
--- a/src/isonline.js
+++ b/src/isonline.js
@@ -1,6 +1,6 @@
import * as utils from './utils.js';
import log from 'npmlog';
-import request from 'request';
+import Wreck from 'wreck';
import Promise from 'bluebird';
import nmo from './nmo.js';
@@ -73,8 +73,7 @@ function isNodeOnline (url) {
const cleanedUrl = utils.removeUsernamePw(url);
log.http('request', 'GET', cleanedUrl);
- request(url, (err, res, body) => {
-
+ Wreck.get(url, (err, res, payload) => {
if (err && (err.code === 'ECONNREFUSED'
|| err.code === 'ENOTFOUND')) {
return resolve({[url]: false});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/30c7a148/src/utils.js
----------------------------------------------------------------------
diff --git a/src/utils.js b/src/utils.js
index 408470f..1c02195 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -3,7 +3,7 @@
import assert from 'assert';
import {isUri as checkUri} from 'valid-url';
-import request from 'request';
+import Wreck from 'wreck';
import Promise from 'bluebird';
import log from 'npmlog';
import url from 'url';
@@ -29,12 +29,7 @@ export function sendJsonToNode (url, json) {
const cleanedUrl = removeUsernamePw(url);
log.http('request', 'POST', cleanedUrl);
- request({
- method: 'POST',
- uri: url,
- json: true,
- body: json
- }, (err, res, body) => {
+ Wreck.post(url, {payload: JSON.stringify(json), json: true}, (err, res, body) => {
if (err) {
return reject(err);
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/30c7a148/test/cluster.js
----------------------------------------------------------------------
diff --git a/test/cluster.js b/test/cluster.js
index 6ec5d83..e583c29 100644
--- a/test/cluster.js
+++ b/test/cluster.js
@@ -31,14 +31,6 @@ node2=${common.NODE_TWO}
[clustervalidurlswithpw]
node1=${common.NODE_WITH_PW}
node2=${common.NODE_TWO_WITH_PW}
-
-[clustervalidurlsclosingsocket]
-node1=${common.NODE}
-node2=${common.NODE_TWO + '/socketclose'}
-
-[clustervalidurlsclosingsocketaftercheck]
-node1=${common.NODE}
-node2=${common.NODE_TWO + '/socket_close_on_second_request'}
`;
const nmoconf = {nmoconf: __dirname + '/fixtures/randomini'};
@@ -130,7 +122,6 @@ lab.experiment('cluster - join', () => {
});
});
-
lab.test('errors on empty args', (done) => {
nmo.load(nmoconf).then(() => {
cluster
@@ -230,29 +221,9 @@ lab.experiment('cluster - join', () => {
});
});
- lab.test('rejects on connection errors', (done) => {
- nmo.load(nmoconf).then(() => {
- cluster
- .join('clustervalidurlsclosingsocket')
- .catch((err) => {
- assert.ok(err instanceof Error);
- done();
- });
- });
- });
-
- lab.test('rejects on connection errors during join', (done) => {
- nmo.load(nmoconf).then(() => {
- cluster
- .join('clustervalidurlsclosingsocketaftercheck')
- .catch((err) => {
- assert.ok(err instanceof Error);
- done();
- });
- });
- });
});
+
lab.experiment('cluster - cli', () => {
let servers;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/30c7a148/test/common.js
----------------------------------------------------------------------
diff --git a/test/common.js b/test/common.js
index 3e19963..c0ff48b 100644
--- a/test/common.js
+++ b/test/common.js
@@ -31,16 +31,6 @@ export function createTestServer (port) {
let i = 0;
return new Promise((resolve) => {
const s = http.createServer((req, res) => {
- if (req.url === '/socketclose') {
- res.write('a');
- }
-
- if (req.url === '/socket_close_on_second_request') {
- i++;
- if (i === 1) {
- res.write('a');
- }
- }
res.writeHead(200, {'Content-Type': 'application/json'});
res.end(JSON.stringify({ok: true}));
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/30c7a148/test/isonline.js
----------------------------------------------------------------------
diff --git a/test/isonline.js b/test/isonline.js
index da0e3b7..14fac85 100644
--- a/test/isonline.js
+++ b/test/isonline.js
@@ -62,14 +62,6 @@ lab.experiment('isonline', () => {
});
});
- lab.test('rejects the promise for connection errors', (done) => {
- isonline(common.NODE + '/socketclose')
- .catch((err) => {
- assert.ok(err instanceof Error);
- done();
- });
- });
-
lab.test('returns error for all other errors', (done) => {
isonline({})
.catch((err) => {
[48/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/caseless/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/caseless/index.js b/node_modules/request/node_modules/caseless/index.js
deleted file mode 100644
index ba711f6..0000000
--- a/node_modules/request/node_modules/caseless/index.js
+++ /dev/null
@@ -1,65 +0,0 @@
-function Caseless (dict) {
- this.dict = dict || {}
-}
-Caseless.prototype.set = function (name, value, clobber) {
- if (typeof name === 'object') {
- for (var i in name) {
- this.set(i, name[i], value)
- }
- } else {
- if (typeof clobber === 'undefined') clobber = true
- var has = this.has(name)
-
- if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value
- else this.dict[has || name] = value
- return has
- }
-}
-Caseless.prototype.has = function (name) {
- var keys = Object.keys(this.dict)
- , name = name.toLowerCase()
- ;
- for (var i=0;i<keys.length;i++) {
- if (keys[i].toLowerCase() === name) return keys[i]
- }
- return false
-}
-Caseless.prototype.get = function (name) {
- name = name.toLowerCase()
- var result, _key
- var headers = this.dict
- Object.keys(headers).forEach(function (key) {
- _key = key.toLowerCase()
- if (name === _key) result = headers[key]
- })
- return result
-}
-Caseless.prototype.swap = function (name) {
- var has = this.has(name)
- if (!has) throw new Error('There is no header than matches "'+name+'"')
- this.dict[name] = this.dict[has]
- delete this.dict[has]
-}
-Caseless.prototype.del = function (name) {
- var has = this.has(name)
- return delete this.dict[has || name]
-}
-
-module.exports = function (dict) {return new Caseless(dict)}
-module.exports.httpify = function (resp, headers) {
- var c = new Caseless(headers)
- resp.setHeader = function (key, value, clobber) {
- return c.set(key, value, clobber)
- }
- resp.hasHeader = function (key) {
- return c.has(key)
- }
- resp.getHeader = function (key) {
- return c.get(key)
- }
- resp.removeHeader = function (key) {
- return c.del(key)
- }
- resp.headers = c.dict
- return c
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/caseless/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/caseless/package.json b/node_modules/request/node_modules/caseless/package.json
deleted file mode 100644
index 39153e6..0000000
--- a/node_modules/request/node_modules/caseless/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "caseless",
- "version": "0.9.0",
- "description": "Caseless object set/get/has, very useful when working with HTTP headers.",
- "main": "index.js",
- "scripts": {
- "test": "node test.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/mikeal/caseless"
- },
- "keywords": [
- "headers",
- "http",
- "caseless"
- ],
- "test": "node test.js",
- "author": {
- "name": "Mikeal Rogers",
- "email": "mikeal.rogers@gmail.com"
- },
- "license": "BSD",
- "bugs": {
- "url": "https://github.com/mikeal/caseless/issues"
- },
- "devDependencies": {
- "tape": "^2.10.2"
- },
- "gitHead": "5ff0ccebbbf14dad5dc91def1f274887801db3e3",
- "homepage": "https://github.com/mikeal/caseless",
- "_id": "caseless@0.9.0",
- "_shasum": "b7b65ce6bf1413886539cfd533f0b30effa9cf88",
- "_from": "caseless@>=0.9.0 <0.10.0",
- "_npmVersion": "1.4.14",
- "_npmUser": {
- "name": "nylen",
- "email": "jnylen@gmail.com"
- },
- "maintainers": [
- {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- },
- {
- "name": "nylen",
- "email": "jnylen@gmail.com"
- }
- ],
- "dist": {
- "shasum": "b7b65ce6bf1413886539cfd533f0b30effa9cf88",
- "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.9.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/caseless/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/caseless/test.js b/node_modules/request/node_modules/caseless/test.js
deleted file mode 100644
index 084bbaf..0000000
--- a/node_modules/request/node_modules/caseless/test.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var tape = require('tape')
- , caseless = require('./')
- ;
-
-tape('set get has', function (t) {
- var headers = {}
- , c = caseless(headers)
- ;
- t.plan(17)
- c.set('a-Header', 'asdf')
- t.equal(c.get('a-header'), 'asdf')
- t.equal(c.has('a-header'), 'a-Header')
- t.ok(!c.has('nothing'))
- // old bug where we used the wrong regex
- t.ok(!c.has('a-hea'))
- c.set('a-header', 'fdsa')
- t.equal(c.get('a-header'), 'fdsa')
- t.equal(c.get('a-Header'), 'fdsa')
- c.set('a-HEADER', 'more', false)
- t.equal(c.get('a-header'), 'fdsa,more')
-
- t.deepEqual(headers, {'a-Header': 'fdsa,more'})
- c.swap('a-HEADER')
- t.deepEqual(headers, {'a-HEADER': 'fdsa,more'})
-
- c.set('deleteme', 'foobar')
- t.ok(c.has('deleteme'))
- t.ok(c.del('deleteme'))
- t.notOk(c.has('deleteme'))
- t.notOk(c.has('idonotexist'))
- t.ok(c.del('idonotexist'))
-
- c.set('tva', 'test1')
- c.set('tva-header', 'test2')
- t.equal(c.has('tva'), 'tva')
- t.notOk(c.has('header'))
-
- t.equal(c.get('tva'), 'test1')
-
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/License
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/License b/node_modules/request/node_modules/combined-stream/License
deleted file mode 100644
index 4804b7a..0000000
--- a/node_modules/request/node_modules/combined-stream/License
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011 Debuggable Limited <fe...@debuggable.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/Readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/Readme.md b/node_modules/request/node_modules/combined-stream/Readme.md
deleted file mode 100644
index 8043cb4..0000000
--- a/node_modules/request/node_modules/combined-stream/Readme.md
+++ /dev/null
@@ -1,132 +0,0 @@
-# combined-stream [](https://travis-ci.org/felixge/node-combined-stream)
-
-A stream that emits multiple other streams one after another.
-
-## Installation
-
-``` bash
-npm install combined-stream
-```
-
-## Usage
-
-Here is a simple example that shows how you can use combined-stream to combine
-two files into one:
-
-``` javascript
-var CombinedStream = require('combined-stream');
-var fs = require('fs');
-
-var combinedStream = CombinedStream.create();
-combinedStream.append(fs.createReadStream('file1.txt'));
-combinedStream.append(fs.createReadStream('file2.txt'));
-
-combinedStream.pipe(fs.createWriteStream('combined.txt'));
-```
-
-While the example above works great, it will pause all source streams until
-they are needed. If you don't want that to happen, you can set `pauseStreams`
-to `false`:
-
-``` javascript
-var CombinedStream = require('combined-stream');
-var fs = require('fs');
-
-var combinedStream = CombinedStream.create({pauseStreams: false});
-combinedStream.append(fs.createReadStream('file1.txt'));
-combinedStream.append(fs.createReadStream('file2.txt'));
-
-combinedStream.pipe(fs.createWriteStream('combined.txt'));
-```
-
-However, what if you don't have all the source streams yet, or you don't want
-to allocate the resources (file descriptors, memory, etc.) for them right away?
-Well, in that case you can simply provide a callback that supplies the stream
-by calling a `next()` function:
-
-``` javascript
-var CombinedStream = require('combined-stream');
-var fs = require('fs');
-
-var combinedStream = CombinedStream.create();
-combinedStream.append(function(next) {
- next(fs.createReadStream('file1.txt'));
-});
-combinedStream.append(function(next) {
- next(fs.createReadStream('file2.txt'));
-});
-
-combinedStream.pipe(fs.createWriteStream('combined.txt'));
-```
-
-## API
-
-### CombinedStream.create([options])
-
-Returns a new combined stream object. Available options are:
-
-* `maxDataSize`
-* `pauseStreams`
-
-The effect of those options is described below.
-
-### combinedStream.pauseStreams = `true`
-
-Whether to apply back pressure to the underlaying streams. If set to `false`,
-the underlaying streams will never be paused. If set to `true`, the
-underlaying streams will be paused right after being appended, as well as when
-`delayedStream.pipe()` wants to throttle.
-
-### combinedStream.maxDataSize = `2 * 1024 * 1024`
-
-The maximum amount of bytes (or characters) to buffer for all source streams.
-If this value is exceeded, `combinedStream` emits an `'error'` event.
-
-### combinedStream.dataSize = `0`
-
-The amount of bytes (or characters) currently buffered by `combinedStream`.
-
-### combinedStream.append(stream)
-
-Appends the given `stream` to the combinedStream object. If `pauseStreams` is
-set to `true, this stream will also be paused right away.
-
-`streams` can also be a function that takes one parameter called `next`. `next`
-is a function that must be invoked in order to provide the `next` stream, see
-example above.
-
-Regardless of how the `stream` is appended, combined-stream always attaches an
-`'error'` listener to it, so you don't have to do that manually.
-
-Special case: `stream` can also be a String or Buffer.
-
-### combinedStream.write(data)
-
-You should not call this, `combinedStream` takes care of piping the appended
-streams into itself for you.
-
-### combinedStream.resume()
-
-Causes `combinedStream` to start drain the streams it manages. The function is
-idempotent, and also emits a `'resume'` event each time which usually goes to
-the stream that is currently being drained.
-
-### combinedStream.pause();
-
-If `combinedStream.pauseStreams` is set to `false`, this does nothing.
-Otherwise a `'pause'` event is emitted, this goes to the stream that is
-currently being drained, so you can use it to apply back pressure.
-
-### combinedStream.end();
-
-Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
-all streams from the queue.
-
-### combinedStream.destroy();
-
-Same as `combinedStream.end()`, except it emits a `'close'` event instead of
-`'end'`.
-
-## License
-
-combined-stream is licensed under the MIT license.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/lib/combined_stream.js b/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
deleted file mode 100644
index 6b5c21b..0000000
--- a/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
+++ /dev/null
@@ -1,188 +0,0 @@
-var util = require('util');
-var Stream = require('stream').Stream;
-var DelayedStream = require('delayed-stream');
-
-module.exports = CombinedStream;
-function CombinedStream() {
- this.writable = false;
- this.readable = true;
- this.dataSize = 0;
- this.maxDataSize = 2 * 1024 * 1024;
- this.pauseStreams = true;
-
- this._released = false;
- this._streams = [];
- this._currentStream = null;
-}
-util.inherits(CombinedStream, Stream);
-
-CombinedStream.create = function(options) {
- var combinedStream = new this();
-
- options = options || {};
- for (var option in options) {
- combinedStream[option] = options[option];
- }
-
- return combinedStream;
-};
-
-CombinedStream.isStreamLike = function(stream) {
- return (typeof stream !== 'function')
- && (typeof stream !== 'string')
- && (typeof stream !== 'boolean')
- && (typeof stream !== 'number')
- && (!Buffer.isBuffer(stream));
-};
-
-CombinedStream.prototype.append = function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
-
- if (isStreamLike) {
- if (!(stream instanceof DelayedStream)) {
- var newStream = DelayedStream.create(stream, {
- maxDataSize: Infinity,
- pauseStream: this.pauseStreams,
- });
- stream.on('data', this._checkDataSize.bind(this));
- stream = newStream;
- }
-
- this._handleErrors(stream);
-
- if (this.pauseStreams) {
- stream.pause();
- }
- }
-
- this._streams.push(stream);
- return this;
-};
-
-CombinedStream.prototype.pipe = function(dest, options) {
- Stream.prototype.pipe.call(this, dest, options);
- this.resume();
- return dest;
-};
-
-CombinedStream.prototype._getNext = function() {
- this._currentStream = null;
- var stream = this._streams.shift();
-
-
- if (typeof stream == 'undefined') {
- this.end();
- return;
- }
-
- if (typeof stream !== 'function') {
- this._pipeNext(stream);
- return;
- }
-
- var getStream = stream;
- getStream(function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('data', this._checkDataSize.bind(this));
- this._handleErrors(stream);
- }
-
- this._pipeNext(stream);
- }.bind(this));
-};
-
-CombinedStream.prototype._pipeNext = function(stream) {
- this._currentStream = stream;
-
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('end', this._getNext.bind(this));
- stream.pipe(this, {end: false});
- return;
- }
-
- var value = stream;
- this.write(value);
- this._getNext();
-};
-
-CombinedStream.prototype._handleErrors = function(stream) {
- var self = this;
- stream.on('error', function(err) {
- self._emitError(err);
- });
-};
-
-CombinedStream.prototype.write = function(data) {
- this.emit('data', data);
-};
-
-CombinedStream.prototype.pause = function() {
- if (!this.pauseStreams) {
- return;
- }
-
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
- this.emit('pause');
-};
-
-CombinedStream.prototype.resume = function() {
- if (!this._released) {
- this._released = true;
- this.writable = true;
- this._getNext();
- }
-
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
- this.emit('resume');
-};
-
-CombinedStream.prototype.end = function() {
- this._reset();
- this.emit('end');
-};
-
-CombinedStream.prototype.destroy = function() {
- this._reset();
- this.emit('close');
-};
-
-CombinedStream.prototype._reset = function() {
- this.writable = false;
- this._streams = [];
- this._currentStream = null;
-};
-
-CombinedStream.prototype._checkDataSize = function() {
- this._updateDataSize();
- if (this.dataSize <= this.maxDataSize) {
- return;
- }
-
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
- this._emitError(new Error(message));
-};
-
-CombinedStream.prototype._updateDataSize = function() {
- this.dataSize = 0;
-
- var self = this;
- this._streams.forEach(function(stream) {
- if (!stream.dataSize) {
- return;
- }
-
- self.dataSize += stream.dataSize;
- });
-
- if (this._currentStream && this._currentStream.dataSize) {
- this.dataSize += this._currentStream.dataSize;
- }
-};
-
-CombinedStream.prototype._emitError = function(err) {
- this._reset();
- this.emit('error', err);
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
deleted file mode 100644
index 2fedb26..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.un~
-/node_modules/*
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License
deleted file mode 100644
index 4804b7a..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011 Debuggable Limited <fe...@debuggable.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile
deleted file mode 100644
index b4ff85a..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-SHELL := /bin/bash
-
-test:
- @./test/run.js
-
-.PHONY: test
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
deleted file mode 100644
index 5cb5b35..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
+++ /dev/null
@@ -1,154 +0,0 @@
-# delayed-stream
-
-Buffers events from a stream until you are ready to handle them.
-
-## Installation
-
-``` bash
-npm install delayed-stream
-```
-
-## Usage
-
-The following example shows how to write a http echo server that delays its
-response by 1000 ms.
-
-``` javascript
-var DelayedStream = require('delayed-stream');
-var http = require('http');
-
-http.createServer(function(req, res) {
- var delayed = DelayedStream.create(req);
-
- setTimeout(function() {
- res.writeHead(200);
- delayed.pipe(res);
- }, 1000);
-});
-```
-
-If you are not using `Stream#pipe`, you can also manually release the buffered
-events by calling `delayedStream.resume()`:
-
-``` javascript
-var delayed = DelayedStream.create(req);
-
-setTimeout(function() {
- // Emit all buffered events and resume underlaying source
- delayed.resume();
-}, 1000);
-```
-
-## Implementation
-
-In order to use this meta stream properly, here are a few things you should
-know about the implementation.
-
-### Event Buffering / Proxying
-
-All events of the `source` stream are hijacked by overwriting the `source.emit`
-method. Until node implements a catch-all event listener, this is the only way.
-
-However, delayed-stream still continues to emit all events it captures on the
-`source`, regardless of whether you have released the delayed stream yet or
-not.
-
-Upon creation, delayed-stream captures all `source` events and stores them in
-an internal event buffer. Once `delayedStream.release()` is called, all
-buffered events are emitted on the `delayedStream`, and the event buffer is
-cleared. After that, delayed-stream merely acts as a proxy for the underlaying
-source.
-
-### Error handling
-
-Error events on `source` are buffered / proxied just like any other events.
-However, `delayedStream.create` attaches a no-op `'error'` listener to the
-`source`. This way you only have to handle errors on the `delayedStream`
-object, rather than in two places.
-
-### Buffer limits
-
-delayed-stream provides a `maxDataSize` property that can be used to limit
-the amount of data being buffered. In order to protect you from bad `source`
-streams that don't react to `source.pause()`, this feature is enabled by
-default.
-
-## API
-
-### DelayedStream.create(source, [options])
-
-Returns a new `delayedStream`. Available options are:
-
-* `pauseStream`
-* `maxDataSize`
-
-The description for those properties can be found below.
-
-### delayedStream.source
-
-The `source` stream managed by this object. This is useful if you are
-passing your `delayedStream` around, and you still want to access properties
-on the `source` object.
-
-### delayedStream.pauseStream = true
-
-Whether to pause the underlaying `source` when calling
-`DelayedStream.create()`. Modifying this property afterwards has no effect.
-
-### delayedStream.maxDataSize = 1024 * 1024
-
-The amount of data to buffer before emitting an `error`.
-
-If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
-refers to bytes.
-
-If the underlaying source is emitting JavaScript strings, the size refers to
-characters.
-
-If you know what you are doing, you can set this property to `Infinity` to
-disable this feature. You can also modify this property during runtime.
-
-### delayedStream.maxDataSize = 1024 * 1024
-
-The amount of data to buffer before emitting an `error`.
-
-If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
-refers to bytes.
-
-If the underlaying source is emitting JavaScript strings, the size refers to
-characters.
-
-If you know what you are doing, you can set this property to `Infinity` to
-disable this feature.
-
-### delayedStream.dataSize = 0
-
-The amount of data buffered so far.
-
-### delayedStream.readable
-
-An ECMA5 getter that returns the value of `source.readable`.
-
-### delayedStream.resume()
-
-If the `delayedStream` has not been released so far, `delayedStream.release()`
-is called.
-
-In either case, `source.resume()` is called.
-
-### delayedStream.pause()
-
-Calls `source.pause()`.
-
-### delayedStream.pipe(dest)
-
-Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
-
-### delayedStream.release()
-
-Emits and clears all events that have been buffered up so far. This does not
-resume the underlaying source, use `delayedStream.resume()` instead.
-
-## License
-
-delayed-stream is licensed under the MIT license.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
deleted file mode 100644
index 7c10d48..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
+++ /dev/null
@@ -1,99 +0,0 @@
-var Stream = require('stream').Stream;
-var util = require('util');
-
-module.exports = DelayedStream;
-function DelayedStream() {
- this.source = null;
- this.dataSize = 0;
- this.maxDataSize = 1024 * 1024;
- this.pauseStream = true;
-
- this._maxDataSizeExceeded = false;
- this._released = false;
- this._bufferedEvents = [];
-}
-util.inherits(DelayedStream, Stream);
-
-DelayedStream.create = function(source, options) {
- var delayedStream = new this();
-
- options = options || {};
- for (var option in options) {
- delayedStream[option] = options[option];
- }
-
- delayedStream.source = source;
-
- var realEmit = source.emit;
- source.emit = function() {
- delayedStream._handleEmit(arguments);
- return realEmit.apply(source, arguments);
- };
-
- source.on('error', function() {});
- if (delayedStream.pauseStream) {
- source.pause();
- }
-
- return delayedStream;
-};
-
-DelayedStream.prototype.__defineGetter__('readable', function() {
- return this.source.readable;
-});
-
-DelayedStream.prototype.resume = function() {
- if (!this._released) {
- this.release();
- }
-
- this.source.resume();
-};
-
-DelayedStream.prototype.pause = function() {
- this.source.pause();
-};
-
-DelayedStream.prototype.release = function() {
- this._released = true;
-
- this._bufferedEvents.forEach(function(args) {
- this.emit.apply(this, args);
- }.bind(this));
- this._bufferedEvents = [];
-};
-
-DelayedStream.prototype.pipe = function() {
- var r = Stream.prototype.pipe.apply(this, arguments);
- this.resume();
- return r;
-};
-
-DelayedStream.prototype._handleEmit = function(args) {
- if (this._released) {
- this.emit.apply(this, args);
- return;
- }
-
- if (args[0] === 'data') {
- this.dataSize += args[1].length;
- this._checkIfMaxDataSizeExceeded();
- }
-
- this._bufferedEvents.push(args);
-};
-
-DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
- if (this._maxDataSizeExceeded) {
- return;
- }
-
- if (this.dataSize <= this.maxDataSize) {
- return;
- }
-
- this._maxDataSizeExceeded = true;
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
- this.emit('error', new Error(message));
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
deleted file mode 100644
index 3324a13..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "author": {
- "name": "Felix Geisendörfer",
- "email": "felix@debuggable.com",
- "url": "http://debuggable.com/"
- },
- "name": "delayed-stream",
- "description": "Buffers events from a stream until you are ready to handle them.",
- "version": "0.0.5",
- "homepage": "https://github.com/felixge/node-delayed-stream",
- "repository": {
- "type": "git",
- "url": "git://github.com/felixge/node-delayed-stream.git"
- },
- "main": "./lib/delayed_stream",
- "engines": {
- "node": ">=0.4.0"
- },
- "dependencies": {},
- "devDependencies": {
- "fake": "0.2.0",
- "far": "0.0.1"
- },
- "_id": "delayed-stream@0.0.5",
- "_engineSupported": true,
- "_npmVersion": "1.0.3",
- "_nodeVersion": "v0.4.9-pre",
- "_defaultsLoaded": true,
- "dist": {
- "shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
- "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
- },
- "scripts": {},
- "directories": {},
- "_shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
- "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz",
- "_from": "delayed-stream@0.0.5",
- "bugs": {
- "url": "https://github.com/felixge/node-delayed-stream/issues"
- },
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js
deleted file mode 100644
index 4d71b8a..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js
+++ /dev/null
@@ -1,6 +0,0 @@
-var common = module.exports;
-
-common.DelayedStream = require('..');
-common.assert = require('assert');
-common.fake = require('fake');
-common.PORT = 49252;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
deleted file mode 100644
index 9ecad5b..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var DelayedStream = common.DelayedStream;
-var http = require('http');
-
-var UPLOAD = new Buffer(10 * 1024 * 1024);
-
-var server = http.createServer(function(req, res) {
- var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length});
-
- setTimeout(function() {
- res.writeHead(200);
- delayed.pipe(res);
- }, 10);
-});
-server.listen(common.PORT, function() {
- var request = http.request({
- method: 'POST',
- port: common.PORT,
- });
-
- request.write(UPLOAD);
- request.end();
-
- request.on('response', function(res) {
- var received = 0;
- res
- .on('data', function(chunk) {
- received += chunk.length;
- })
- .on('end', function() {
- assert.equal(received, UPLOAD.length);
- server.close();
- });
- });
-});
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js
deleted file mode 100644
index 6f417f3..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testAutoPause() {
- var source = new Stream();
-
- fake.expect(source, 'pause', 1);
- var delayedStream = DelayedStream.create(source);
- fake.verify();
-})();
-
-(function testDisableAutoPause() {
- var source = new Stream();
- fake.expect(source, 'pause', 0);
-
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
- fake.verify();
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js
deleted file mode 100644
index b50c397..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testDelayEventsUntilResume() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- fake.expect(source, 'pause');
- delayedStream.pause();
- fake.verify();
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js
deleted file mode 100644
index fc4047e..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testDelayEventsUntilResume() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- // delayedStream must not emit until we resume
- fake.expect(delayedStream, 'emit', 0);
-
- // but our original source must emit
- var params = [];
- source.on('foo', function(param) {
- params.push(param);
- });
-
- source.emit('foo', 1);
- source.emit('foo', 2);
-
- // Make sure delayedStream did not emit, and source did
- assert.deepEqual(params, [1, 2]);
- fake.verify();
-
- // After resume, delayedStream must playback all events
- fake
- .stub(delayedStream, 'emit')
- .times(Infinity)
- .withArg(1, 'newListener');
- fake.expect(delayedStream, 'emit', ['foo', 1]);
- fake.expect(delayedStream, 'emit', ['foo', 2]);
- fake.expect(source, 'resume');
-
- delayedStream.resume();
- fake.verify();
-
- // Calling resume again will delegate to source
- fake.expect(source, 'resume');
- delayedStream.resume();
- fake.verify();
-
- // Emitting more events directly leads to them being emitted
- fake.expect(delayedStream, 'emit', ['foo', 3]);
- source.emit('foo', 3);
- fake.verify();
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js
deleted file mode 100644
index a9d35e7..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testHandleSourceErrors() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- // We deal with this by attaching a no-op listener to 'error' on the source
- // when creating a new DelayedStream. This way error events on the source
- // won't throw.
- source.emit('error', new Error('something went wrong'));
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js
deleted file mode 100644
index 7638a2b..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testMaxDataSize() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false});
-
- source.emit('data', new Buffer(1024));
-
- fake
- .expect(delayedStream, 'emit')
- .withArg(1, 'error');
- source.emit('data', new Buffer(1));
- fake.verify();
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js
deleted file mode 100644
index 7d312ab..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testPipeReleases() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- fake.expect(delayedStream, 'resume');
- delayedStream.pipe(new Stream());
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js
deleted file mode 100644
index d436163..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testProxyReadableProperty() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- source.readable = fake.value('source.readable');
- assert.strictEqual(delayedStream.readable, source.readable);
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js
deleted file mode 100755
index 0bb8e82..0000000
--- a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env node
-var far = require('far').create();
-
-far.add(__dirname);
-far.include(/test-.*\.js$/);
-
-far.execute();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/combined-stream/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/package.json b/node_modules/request/node_modules/combined-stream/package.json
deleted file mode 100644
index a44fef9..0000000
--- a/node_modules/request/node_modules/combined-stream/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "author": {
- "name": "Felix Geisendörfer",
- "email": "felix@debuggable.com",
- "url": "http://debuggable.com/"
- },
- "name": "combined-stream",
- "description": "A stream that emits multiple other streams one after another.",
- "version": "0.0.7",
- "homepage": "https://github.com/felixge/node-combined-stream",
- "repository": {
- "type": "git",
- "url": "git://github.com/felixge/node-combined-stream.git"
- },
- "main": "./lib/combined_stream",
- "scripts": {
- "test": "node test/run.js"
- },
- "engines": {
- "node": ">= 0.8"
- },
- "dependencies": {
- "delayed-stream": "0.0.5"
- },
- "devDependencies": {
- "far": "~0.0.7"
- },
- "bugs": {
- "url": "https://github.com/felixge/node-combined-stream/issues"
- },
- "_id": "combined-stream@0.0.7",
- "dist": {
- "shasum": "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f",
- "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz"
- },
- "_from": "combined-stream@>=0.0.5 <0.1.0",
- "_npmVersion": "1.4.3",
- "_npmUser": {
- "name": "felixge",
- "email": "felix@debuggable.com"
- },
- "maintainers": [
- {
- "name": "felixge",
- "email": "felix@debuggable.com"
- },
- {
- "name": "celer",
- "email": "celer@scrypt.net"
- },
- {
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
- }
- ],
- "directories": {},
- "_shasum": "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f",
- "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/forever-agent/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/forever-agent/LICENSE b/node_modules/request/node_modules/forever-agent/LICENSE
deleted file mode 100644
index a4a9aee..0000000
--- a/node_modules/request/node_modules/forever-agent/LICENSE
+++ /dev/null
@@ -1,55 +0,0 @@
-Apache License
-
-Version 2.0, January 2004
-
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modi
fications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/forever-agent/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/forever-agent/README.md b/node_modules/request/node_modules/forever-agent/README.md
deleted file mode 100644
index 9d5b663..0000000
--- a/node_modules/request/node_modules/forever-agent/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-forever-agent
-=============
-
-HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/forever-agent/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/forever-agent/index.js b/node_modules/request/node_modules/forever-agent/index.js
deleted file mode 100644
index 416c7ab..0000000
--- a/node_modules/request/node_modules/forever-agent/index.js
+++ /dev/null
@@ -1,138 +0,0 @@
-module.exports = ForeverAgent
-ForeverAgent.SSL = ForeverAgentSSL
-
-var util = require('util')
- , Agent = require('http').Agent
- , net = require('net')
- , tls = require('tls')
- , AgentSSL = require('https').Agent
-
-function getConnectionName(host, port) {
- var name = ''
- if (typeof host === 'string') {
- name = host + ':' + port
- } else {
- // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.
- name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')
- }
- return name
-}
-
-function ForeverAgent(options) {
- var self = this
- self.options = options || {}
- self.requests = {}
- self.sockets = {}
- self.freeSockets = {}
- self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
- self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
- self.on('free', function(socket, host, port) {
- var name = getConnectionName(host, port)
-
- if (self.requests[name] && self.requests[name].length) {
- self.requests[name].shift().onSocket(socket)
- } else if (self.sockets[name].length < self.minSockets) {
- if (!self.freeSockets[name]) self.freeSockets[name] = []
- self.freeSockets[name].push(socket)
-
- // if an error happens while we don't use the socket anyway, meh, throw the socket away
- var onIdleError = function() {
- socket.destroy()
- }
- socket._onIdleError = onIdleError
- socket.on('error', onIdleError)
- } else {
- // If there are no pending requests just destroy the
- // socket and it will get removed from the pool. This
- // gets us out of timeout issues and allows us to
- // default to Connection:keep-alive.
- socket.destroy()
- }
- })
-
-}
-util.inherits(ForeverAgent, Agent)
-
-ForeverAgent.defaultMinSockets = 5
-
-
-ForeverAgent.prototype.createConnection = net.createConnection
-ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
-ForeverAgent.prototype.addRequest = function(req, host, port) {
- var name = getConnectionName(host, port)
-
- if (typeof host !== 'string') {
- var options = host
- port = options.port
- host = options.host
- }
-
- if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
- var idleSocket = this.freeSockets[name].pop()
- idleSocket.removeListener('error', idleSocket._onIdleError)
- delete idleSocket._onIdleError
- req._reusedSocket = true
- req.onSocket(idleSocket)
- } else {
- this.addRequestNoreuse(req, host, port)
- }
-}
-
-ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
- if (this.sockets[name]) {
- var index = this.sockets[name].indexOf(s)
- if (index !== -1) {
- this.sockets[name].splice(index, 1)
- }
- } else if (this.sockets[name] && this.sockets[name].length === 0) {
- // don't leak
- delete this.sockets[name]
- delete this.requests[name]
- }
-
- if (this.freeSockets[name]) {
- var index = this.freeSockets[name].indexOf(s)
- if (index !== -1) {
- this.freeSockets[name].splice(index, 1)
- if (this.freeSockets[name].length === 0) {
- delete this.freeSockets[name]
- }
- }
- }
-
- if (this.requests[name] && this.requests[name].length) {
- // If we have pending requests and a socket gets closed a new one
- // needs to be created to take over in the pool for the one that closed.
- this.createSocket(name, host, port).emit('free')
- }
-}
-
-function ForeverAgentSSL (options) {
- ForeverAgent.call(this, options)
-}
-util.inherits(ForeverAgentSSL, ForeverAgent)
-
-ForeverAgentSSL.prototype.createConnection = createConnectionSSL
-ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest
-
-function createConnectionSSL (port, host, options) {
- if (typeof port === 'object') {
- options = port;
- } else if (typeof host === 'object') {
- options = host;
- } else if (typeof options === 'object') {
- options = options;
- } else {
- options = {};
- }
-
- if (typeof port === 'number') {
- options.port = port;
- }
-
- if (typeof host === 'string') {
- options.host = host;
- }
-
- return tls.connect(options);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/forever-agent/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/forever-agent/package.json b/node_modules/request/node_modules/forever-agent/package.json
deleted file mode 100644
index 60459c6..0000000
--- a/node_modules/request/node_modules/forever-agent/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "author": {
- "name": "Mikeal Rogers",
- "email": "mikeal.rogers@gmail.com",
- "url": "http://www.futurealoof.com"
- },
- "name": "forever-agent",
- "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
- "version": "0.6.1",
- "license": "Apache-2.0",
- "repository": {
- "url": "https://github.com/mikeal/forever-agent"
- },
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {},
- "optionalDependencies": {},
- "engines": {
- "node": "*"
- },
- "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d",
- "bugs": {
- "url": "https://github.com/mikeal/forever-agent/issues"
- },
- "homepage": "https://github.com/mikeal/forever-agent",
- "_id": "forever-agent@0.6.1",
- "scripts": {},
- "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
- "_from": "forever-agent@>=0.6.0 <0.7.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
- },
- "maintainers": [
- {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- },
- {
- "name": "nylen",
- "email": "jnylen@gmail.com"
- },
- {
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
- }
- ],
- "dist": {
- "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
- "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/License
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/License b/node_modules/request/node_modules/form-data/License
deleted file mode 100644
index c7ff12a..0000000
--- a/node_modules/request/node_modules/form-data/License
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/Readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/Readme.md b/node_modules/request/node_modules/form-data/Readme.md
deleted file mode 100644
index c8a1a55..0000000
--- a/node_modules/request/node_modules/form-data/Readme.md
+++ /dev/null
@@ -1,175 +0,0 @@
-# Form-Data [](https://travis-ci.org/felixge/node-form-data) [](https://gemnasium.com/felixge/node-form-data)
-
-A module to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
-
-The API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].
-
-[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
-[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions
-
-## Install
-
-```
-npm install form-data
-```
-
-## Usage
-
-In this example we are constructing a form with 3 fields that contain a string,
-a buffer and a file stream.
-
-``` javascript
-var FormData = require('form-data');
-var fs = require('fs');
-
-var form = new FormData();
-form.append('my_field', 'my value');
-form.append('my_buffer', new Buffer(10));
-form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
-```
-
-Also you can use http-response stream:
-
-``` javascript
-var FormData = require('form-data');
-var http = require('http');
-
-var form = new FormData();
-
-http.request('http://nodejs.org/images/logo.png', function(response) {
- form.append('my_field', 'my value');
- form.append('my_buffer', new Buffer(10));
- form.append('my_logo', response);
-});
-```
-
-Or @mikeal's request stream:
-
-``` javascript
-var FormData = require('form-data');
-var request = require('request');
-
-var form = new FormData();
-
-form.append('my_field', 'my value');
-form.append('my_buffer', new Buffer(10));
-form.append('my_logo', request('http://nodejs.org/images/logo.png'));
-```
-
-In order to submit this form to a web application, call ```submit(url, [callback])``` method:
-
-``` javascript
-form.submit('http://example.org/', function(err, res) {
- // res – response object (http.IncomingMessage) //
- res.resume(); // for node-0.10.x
-});
-
-```
-
-For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.
-
-### Alternative submission methods
-
-You can use node's http client interface:
-
-``` javascript
-var http = require('http');
-
-var request = http.request({
- method: 'post',
- host: 'example.org',
- path: '/upload',
- headers: form.getHeaders()
-});
-
-form.pipe(request);
-
-request.on('response', function(res) {
- console.log(res.statusCode);
-});
-```
-
-Or if you would prefer the `'Content-Length'` header to be set for you:
-
-``` javascript
-form.submit('example.org/upload', function(err, res) {
- console.log(res.statusCode);
-});
-```
-
-To use custom headers and pre-known length in parts:
-
-``` javascript
-var CRLF = '\r\n';
-var form = new FormData();
-
-var options = {
- header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
- knownLength: 1
-};
-
-form.append('my_buffer', buffer, options);
-
-form.submit('http://example.com/', function(err, res) {
- if (err) throw err;
- console.log('Done');
-});
-```
-
-Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually:
-
-``` javascript
-someModule.stream(function(err, stdout, stderr) {
- if (err) throw err;
-
- var form = new FormData();
-
- form.append('file', stdout, {
- filename: 'unicycle.jpg',
- contentType: 'image/jpg',
- knownLength: 19806
- });
-
- form.submit('http://example.com/', function(err, res) {
- if (err) throw err;
- console.log('Done');
- });
-});
-```
-
-For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:
-
-``` javascript
-form.submit({
- host: 'example.com',
- path: '/probably.php?extra=params',
- auth: 'username:password'
-}, function(err, res) {
- console.log(res.statusCode);
-});
-```
-
-In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
-
-``` javascript
-form.submit({
- host: 'example.com',
- path: '/surelynot.php',
- headers: {'x-test-header': 'test-header-value'}
-}, function(err, res) {
- console.log(res.statusCode);
-});
-```
-
-## Notes
-
-- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
-- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]
-
-## TODO
-
-- Add new streams (0.10) support and try really hard not to break it for 0.8.x.
-
-## License
-
-Form-Data is licensed under the MIT license.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/lib/form_data.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/request/node_modules/form-data/lib/form_data.js
deleted file mode 100644
index 5b33f55..0000000
--- a/node_modules/request/node_modules/form-data/lib/form_data.js
+++ /dev/null
@@ -1,351 +0,0 @@
-var CombinedStream = require('combined-stream');
-var util = require('util');
-var path = require('path');
-var http = require('http');
-var https = require('https');
-var parseUrl = require('url').parse;
-var fs = require('fs');
-var mime = require('mime-types');
-var async = require('async');
-
-module.exports = FormData;
-function FormData() {
- this._overheadLength = 0;
- this._valueLength = 0;
- this._lengthRetrievers = [];
-
- CombinedStream.call(this);
-}
-util.inherits(FormData, CombinedStream);
-
-FormData.LINE_BREAK = '\r\n';
-
-FormData.prototype.append = function(field, value, options) {
- options = options || {};
-
- var append = CombinedStream.prototype.append.bind(this);
-
- // all that streamy business can't handle numbers
- if (typeof value == 'number') value = ''+value;
-
- // https://github.com/felixge/node-form-data/issues/38
- if (util.isArray(value)) {
- // Please convert your array into string
- // the way web server expects it
- this._error(new Error('Arrays are not supported.'));
- return;
- }
-
- var header = this._multiPartHeader(field, value, options);
- var footer = this._multiPartFooter(field, value, options);
-
- append(header);
- append(value);
- append(footer);
-
- // pass along options.knownLength
- this._trackLength(header, value, options);
-};
-
-FormData.prototype._trackLength = function(header, value, options) {
- var valueLength = 0;
-
- // used w/ getLengthSync(), when length is known.
- // e.g. for streaming directly from a remote server,
- // w/ a known file a size, and not wanting to wait for
- // incoming file to finish to get its size.
- if (options.knownLength != null) {
- valueLength += +options.knownLength;
- } else if (Buffer.isBuffer(value)) {
- valueLength = value.length;
- } else if (typeof value === 'string') {
- valueLength = Buffer.byteLength(value);
- }
-
- this._valueLength += valueLength;
-
- // @check why add CRLF? does this account for custom/multiple CRLFs?
- this._overheadLength +=
- Buffer.byteLength(header) +
- + FormData.LINE_BREAK.length;
-
- // empty or either doesn't have path or not an http response
- if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
- return;
- }
-
- // no need to bother with the length
- if (!options.knownLength)
- this._lengthRetrievers.push(function(next) {
-
- if (value.hasOwnProperty('fd')) {
-
- // take read range into a account
- // `end` = Infinity –> read file till the end
- //
- // TODO: Looks like there is bug in Node fs.createReadStream
- // it doesn't respect `end` options without `start` options
- // Fix it when node fixes it.
- // https://github.com/joyent/node/issues/7819
- if (value.end != undefined && value.end != Infinity && value.start != undefined) {
-
- // when end specified
- // no need to calculate range
- // inclusive, starts with 0
- next(null, value.end+1 - (value.start ? value.start : 0));
-
- // not that fast snoopy
- } else {
- // still need to fetch file size from fs
- fs.stat(value.path, function(err, stat) {
-
- var fileSize;
-
- if (err) {
- next(err);
- return;
- }
-
- // update final size based on the range options
- fileSize = stat.size - (value.start ? value.start : 0);
- next(null, fileSize);
- });
- }
-
- // or http response
- } else if (value.hasOwnProperty('httpVersion')) {
- next(null, +value.headers['content-length']);
-
- // or request stream http://github.com/mikeal/request
- } else if (value.hasOwnProperty('httpModule')) {
- // wait till response come back
- value.on('response', function(response) {
- value.pause();
- next(null, +response.headers['content-length']);
- });
- value.resume();
-
- // something else
- } else {
- next('Unknown stream');
- }
- });
-};
-
-FormData.prototype._multiPartHeader = function(field, value, options) {
- var boundary = this.getBoundary();
- var header = '';
-
- // custom header specified (as string)?
- // it becomes responsible for boundary
- // (e.g. to handle extra CRLFs on .NET servers)
- if (options.header != null) {
- header = options.header;
- } else {
- header += '--' + boundary + FormData.LINE_BREAK +
- 'Content-Disposition: form-data; name="' + field + '"';
-
- // fs- and request- streams have path property
- // or use custom filename and/or contentType
- // TODO: Use request's response mime-type
- if (options.filename || value.path) {
- header +=
- '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK +
- 'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path));
-
- // http response has not
- } else if (value.readable && value.hasOwnProperty('httpVersion')) {
- header +=
- '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK +
- 'Content-Type: ' + value.headers['content-type'];
- }
-
- header += FormData.LINE_BREAK + FormData.LINE_BREAK;
- }
-
- return header;
-};
-
-FormData.prototype._multiPartFooter = function(field, value, options) {
- return function(next) {
- var footer = FormData.LINE_BREAK;
-
- var lastPart = (this._streams.length === 0);
- if (lastPart) {
- footer += this._lastBoundary();
- }
-
- next(footer);
- }.bind(this);
-};
-
-FormData.prototype._lastBoundary = function() {
- return '--' + this.getBoundary() + '--';
-};
-
-FormData.prototype.getHeaders = function(userHeaders) {
- var formHeaders = {
- 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
- };
-
- for (var header in userHeaders) {
- formHeaders[header.toLowerCase()] = userHeaders[header];
- }
-
- return formHeaders;
-}
-
-FormData.prototype.getCustomHeaders = function(contentType) {
- contentType = contentType ? contentType : 'multipart/form-data';
-
- var formHeaders = {
- 'content-type': contentType + '; boundary=' + this.getBoundary(),
- 'content-length': this.getLengthSync()
- };
-
- return formHeaders;
-}
-
-FormData.prototype.getBoundary = function() {
- if (!this._boundary) {
- this._generateBoundary();
- }
-
- return this._boundary;
-};
-
-FormData.prototype._generateBoundary = function() {
- // This generates a 50 character boundary similar to those used by Firefox.
- // They are optimized for boyer-moore parsing.
- var boundary = '--------------------------';
- for (var i = 0; i < 24; i++) {
- boundary += Math.floor(Math.random() * 10).toString(16);
- }
-
- this._boundary = boundary;
-};
-
-// Note: getLengthSync DOESN'T calculate streams length
-// As workaround one can calculate file size manually
-// and add it as knownLength option
-FormData.prototype.getLengthSync = function(debug) {
- var knownLength = this._overheadLength + this._valueLength;
-
- // Don't get confused, there are 3 "internal" streams for each keyval pair
- // so it basically checks if there is any value added to the form
- if (this._streams.length) {
- knownLength += this._lastBoundary().length;
- }
-
- // https://github.com/felixge/node-form-data/issues/40
- if (this._lengthRetrievers.length) {
- // Some async length retrivers are present
- // therefore synchronous length calculation is false.
- // Please use getLength(callback) to get proper length
- this._error(new Error('Cannot calculate proper length in synchronous way.'));
- }
-
- return knownLength;
-};
-
-FormData.prototype.getLength = function(cb) {
- var knownLength = this._overheadLength + this._valueLength;
-
- if (this._streams.length) {
- knownLength += this._lastBoundary().length;
- }
-
- if (!this._lengthRetrievers.length) {
- process.nextTick(cb.bind(this, null, knownLength));
- return;
- }
-
- async.parallel(this._lengthRetrievers, function(err, values) {
- if (err) {
- cb(err);
- return;
- }
-
- values.forEach(function(length) {
- knownLength += length;
- });
-
- cb(null, knownLength);
- });
-};
-
-FormData.prototype.submit = function(params, cb) {
-
- var request
- , options
- , defaults = {
- method : 'post'
- };
-
- // parse provided url if it's string
- // or treat it as options object
- if (typeof params == 'string') {
- params = parseUrl(params);
-
- options = populate({
- port: params.port,
- path: params.pathname,
- host: params.hostname
- }, defaults);
- }
- else // use custom params
- {
- options = populate(params, defaults);
- // if no port provided use default one
- if (!options.port) {
- options.port = options.protocol == 'https:' ? 443 : 80;
- }
- }
-
- // put that good code in getHeaders to some use
- options.headers = this.getHeaders(params.headers);
-
- // https if specified, fallback to http in any other case
- if (params.protocol == 'https:') {
- request = https.request(options);
- } else {
- request = http.request(options);
- }
-
- // get content length and fire away
- this.getLength(function(err, length) {
-
- // TODO: Add chunked encoding when no length (if err)
-
- // add content length
- request.setHeader('Content-Length', length);
-
- this.pipe(request);
- if (cb) {
- request.on('error', cb);
- request.on('response', cb.bind(this, null));
- }
- }.bind(this));
-
- return request;
-};
-
-FormData.prototype._error = function(err) {
- if (this.error) return;
-
- this.error = err;
- this.pause();
- this.emit('error', err);
-};
-
-/*
- * Santa's little helpers
- */
-
-// populates missing values
-function populate(dst, src) {
- for (var prop in src) {
- if (!dst[prop]) dst[prop] = src[prop];
- }
- return dst;
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml b/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
deleted file mode 100644
index 6064ca0..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
- - "0.12"
- - "iojs"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
deleted file mode 100644
index 8f29698..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2010-2014 Caolan McMahon
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
[47/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/README.md b/node_modules/request/node_modules/form-data/node_modules/async/README.md
deleted file mode 100644
index 6cfb922..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/README.md
+++ /dev/null
@@ -1,1647 +0,0 @@
-# Async.js
-
-[](https://travis-ci.org/caolan/async)
-
-
-Async is a utility module which provides straight-forward, powerful functions
-for working with asynchronous JavaScript. Although originally designed for
-use with [Node.js](http://nodejs.org) and installable via `npm install async`,
-it can also be used directly in the browser.
-
-Async is also installable via:
-
-- [bower](http://bower.io/): `bower install async`
-- [component](https://github.com/component/component): `component install
- caolan/async`
-- [jam](http://jamjs.org/): `jam install async`
-- [spm](http://spmjs.io/): `spm install async`
-
-Async provides around 20 functions that include the usual 'functional'
-suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns
-for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these
-functions assume you follow the Node.js convention of providing a single
-callback as the last argument of your `async` function.
-
-
-## Quick Examples
-
-```javascript
-async.map(['file1','file2','file3'], fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-
-async.filter(['file1','file2','file3'], fs.exists, function(results){
- // results now equals an array of the existing files
-});
-
-async.parallel([
- function(){ ... },
- function(){ ... }
-], callback);
-
-async.series([
- function(){ ... },
- function(){ ... }
-]);
-```
-
-There are many more functions available so take a look at the docs below for a
-full list. This module aims to be comprehensive, so if you feel anything is
-missing please create a GitHub issue for it.
-
-## Common Pitfalls
-
-### Binding a context to an iterator
-
-This section is really about `bind`, not about `async`. If you are wondering how to
-make `async` execute your iterators in a given context, or are confused as to why
-a method of another library isn't working as an iterator, study this example:
-
-```js
-// Here is a simple object with an (unnecessarily roundabout) squaring method
-var AsyncSquaringLibrary = {
- squareExponent: 2,
- square: function(number, callback){
- var result = Math.pow(number, this.squareExponent);
- setTimeout(function(){
- callback(null, result);
- }, 200);
- }
-};
-
-async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
- // result is [NaN, NaN, NaN]
- // This fails because the `this.squareExponent` expression in the square
- // function is not evaluated in the context of AsyncSquaringLibrary, and is
- // therefore undefined.
-});
-
-async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
- // result is [1, 4, 9]
- // With the help of bind we can attach a context to the iterator before
- // passing it to async. Now the square function will be executed in its
- // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
- // will be as expected.
-});
-```
-
-## Download
-
-The source is available for download from
-[GitHub](http://github.com/caolan/async).
-Alternatively, you can install using Node Package Manager (`npm`):
-
- npm install async
-
-__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
-
-## In the Browser
-
-So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
-
-Usage:
-
-```html
-<script type="text/javascript" src="async.js"></script>
-<script type="text/javascript">
-
- async.map(data, asyncProcess, function(err, results){
- alert(results);
- });
-
-</script>
-```
-
-## Documentation
-
-### Collections
-
-* [`each`](#each)
-* [`eachSeries`](#eachSeries)
-* [`eachLimit`](#eachLimit)
-* [`map`](#map)
-* [`mapSeries`](#mapSeries)
-* [`mapLimit`](#mapLimit)
-* [`filter`](#filter)
-* [`filterSeries`](#filterSeries)
-* [`reject`](#reject)
-* [`rejectSeries`](#rejectSeries)
-* [`reduce`](#reduce)
-* [`reduceRight`](#reduceRight)
-* [`detect`](#detect)
-* [`detectSeries`](#detectSeries)
-* [`sortBy`](#sortBy)
-* [`some`](#some)
-* [`every`](#every)
-* [`concat`](#concat)
-* [`concatSeries`](#concatSeries)
-
-### Control Flow
-
-* [`series`](#seriestasks-callback)
-* [`parallel`](#parallel)
-* [`parallelLimit`](#parallellimittasks-limit-callback)
-* [`whilst`](#whilst)
-* [`doWhilst`](#doWhilst)
-* [`until`](#until)
-* [`doUntil`](#doUntil)
-* [`forever`](#forever)
-* [`waterfall`](#waterfall)
-* [`compose`](#compose)
-* [`seq`](#seq)
-* [`applyEach`](#applyEach)
-* [`applyEachSeries`](#applyEachSeries)
-* [`queue`](#queue)
-* [`priorityQueue`](#priorityQueue)
-* [`cargo`](#cargo)
-* [`auto`](#auto)
-* [`retry`](#retry)
-* [`iterator`](#iterator)
-* [`apply`](#apply)
-* [`nextTick`](#nextTick)
-* [`times`](#times)
-* [`timesSeries`](#timesSeries)
-
-### Utils
-
-* [`memoize`](#memoize)
-* [`unmemoize`](#unmemoize)
-* [`log`](#log)
-* [`dir`](#dir)
-* [`noConflict`](#noConflict)
-
-
-## Collections
-
-<a name="forEach" />
-<a name="each" />
-### each(arr, iterator, callback)
-
-Applies the function `iterator` to each item in `arr`, in parallel.
-The `iterator` is called with an item from the list, and a callback for when it
-has finished. If the `iterator` passes an error to its `callback`, the main
-`callback` (for the `each` function) is immediately called with the error.
-
-Note, that since this function applies `iterator` to each item in parallel,
-there is no guarantee that the iterator functions will complete in order.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err)` which must be called once it has
- completed. If no error has occurred, the `callback` should be run without
- arguments or with an explicit `null` argument.
-* `callback(err)` - A callback which is called when all `iterator` functions
- have finished, or an error occurs.
-
-__Examples__
-
-
-```js
-// assuming openFiles is an array of file names and saveFile is a function
-// to save the modified contents of that file:
-
-async.each(openFiles, saveFile, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
-```js
-// assuming openFiles is an array of file names
-
-async.each(openFiles, function(file, callback) {
-
- // Perform operation on file here.
- console.log('Processing file ' + file);
-
- if( file.length > 32 ) {
- console.log('This file name is too long');
- callback('File name too long');
- } else {
- // Do work to process file here
- console.log('File processed');
- callback();
- }
-}, function(err){
- // if any of the file processing produced an error, err would equal that error
- if( err ) {
- // One of the iterations produced an error.
- // All processing will now stop.
- console.log('A file failed to process');
- } else {
- console.log('All files have been processed successfully');
- }
-});
-```
-
----------------------------------------
-
-<a name="forEachSeries" />
-<a name="eachSeries" />
-### eachSeries(arr, iterator, callback)
-
-The same as [`each`](#each), only `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
-This means the `iterator` functions will complete in order.
-
-
----------------------------------------
-
-<a name="forEachLimit" />
-<a name="eachLimit" />
-### eachLimit(arr, limit, iterator, callback)
-
-The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously
-running at any time.
-
-Note that the items in `arr` are not processed in batches, so there is no guarantee that
-the first `limit` `iterator` functions will complete before any others are started.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `limit` - The maximum number of `iterator`s to run at any time.
-* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err)` which must be called once it has
- completed. If no error has occurred, the callback should be run without
- arguments or with an explicit `null` argument.
-* `callback(err)` - A callback which is called when all `iterator` functions
- have finished, or an error occurs.
-
-__Example__
-
-```js
-// Assume documents is an array of JSON objects and requestApi is a
-// function that interacts with a rate-limited REST api.
-
-async.eachLimit(documents, 20, requestApi, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
----------------------------------------
-
-<a name="map" />
-### map(arr, iterator, callback)
-
-Produces a new array of values by mapping each value in `arr` through
-the `iterator` function. The `iterator` is called with an item from `arr` and a
-callback for when it has finished processing. Each of these callback takes 2 arguments:
-an `error`, and the transformed item from `arr`. If `iterator` passes an error to his
-callback, the main `callback` (for the `map` function) is immediately called with the error.
-
-Note, that since this function applies the `iterator` to each item in parallel,
-there is no guarantee that the `iterator` functions will complete in order.
-However, the results array will be in the same order as the original `arr`.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, transformed)` which must be called once
- it has completed with an error (which can be `null`) and a transformed item.
-* `callback(err, results)` - A callback which is called when all `iterator`
- functions have finished, or an error occurs. Results is an array of the
- transformed items from the `arr`.
-
-__Example__
-
-```js
-async.map(['file1','file2','file3'], fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-<a name="mapSeries" />
-### mapSeries(arr, iterator, callback)
-
-The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
-The results array will be in the same order as the original.
-
-
----------------------------------------
-
-<a name="mapLimit" />
-### mapLimit(arr, limit, iterator, callback)
-
-The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously
-running at any time.
-
-Note that the items are not processed in batches, so there is no guarantee that
-the first `limit` `iterator` functions will complete before any others are started.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `limit` - The maximum number of `iterator`s to run at any time.
-* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, transformed)` which must be called once
- it has completed with an error (which can be `null`) and a transformed item.
-* `callback(err, results)` - A callback which is called when all `iterator`
- calls have finished, or an error occurs. The result is an array of the
- transformed items from the original `arr`.
-
-__Example__
-
-```js
-async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-<a name="select" />
-<a name="filter" />
-### filter(arr, iterator, callback)
-
-__Alias:__ `select`
-
-Returns a new array of all the values in `arr` which pass an async truth test.
-_The callback for each `iterator` call only accepts a single argument of `true` or
-`false`; it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like `fs.exists`. This operation is
-performed in parallel, but the results array will be in the same order as the
-original.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
- The `iterator` is passed a `callback(truthValue)`, which must be called with a
- boolean argument once it has completed.
-* `callback(results)` - A callback which is called after all the `iterator`
- functions have finished.
-
-__Example__
-
-```js
-async.filter(['file1','file2','file3'], fs.exists, function(results){
- // results now equals an array of the existing files
-});
-```
-
----------------------------------------
-
-<a name="selectSeries" />
-<a name="filterSeries" />
-### filterSeries(arr, iterator, callback)
-
-__Alias:__ `selectSeries`
-
-The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
-The results array will be in the same order as the original.
-
----------------------------------------
-
-<a name="reject" />
-### reject(arr, iterator, callback)
-
-The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
-
----------------------------------------
-
-<a name="rejectSeries" />
-### rejectSeries(arr, iterator, callback)
-
-The same as [`reject`](#reject), only the `iterator` is applied to each item in `arr`
-in series.
-
-
----------------------------------------
-
-<a name="reduce" />
-### reduce(arr, memo, iterator, callback)
-
-__Aliases:__ `inject`, `foldl`
-
-Reduces `arr` into a single value using an async `iterator` to return
-each successive step. `memo` is the initial state of the reduction.
-This function only operates in series.
-
-For performance reasons, it may make sense to split a call to this function into
-a parallel map, and then use the normal `Array.prototype.reduce` on the results.
-This function is for situations where each step in the reduction needs to be async;
-if you can get the data before reducing it, then it's probably a good idea to do so.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `memo` - The initial state of the reduction.
-* `iterator(memo, item, callback)` - A function applied to each item in the
- array to produce the next step in the reduction. The `iterator` is passed a
- `callback(err, reduction)` which accepts an optional error as its first
- argument, and the state of the reduction as the second. If an error is
- passed to the callback, the reduction is stopped and the main `callback` is
- immediately called with the error.
-* `callback(err, result)` - A callback which is called after all the `iterator`
- functions have finished. Result is the reduced value.
-
-__Example__
-
-```js
-async.reduce([1,2,3], 0, function(memo, item, callback){
- // pointless async:
- process.nextTick(function(){
- callback(null, memo + item)
- });
-}, function(err, result){
- // result is now equal to the last value of memo, which is 6
-});
-```
-
----------------------------------------
-
-<a name="reduceRight" />
-### reduceRight(arr, memo, iterator, callback)
-
-__Alias:__ `foldr`
-
-Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
-
-
----------------------------------------
-
-<a name="detect" />
-### detect(arr, iterator, callback)
-
-Returns the first value in `arr` that passes an async truth test. The
-`iterator` is applied in parallel, meaning the first iterator to return `true` will
-fire the detect `callback` with that result. That means the result might not be
-the first item in the original `arr` (in terms of order) that passes the test.
-
-If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
- The iterator is passed a `callback(truthValue)` which must be called with a
- boolean argument once it has completed.
-* `callback(result)` - A callback which is called as soon as any iterator returns
- `true`, or after all the `iterator` functions have finished. Result will be
- the first item in the array that passes the truth test (iterator) or the
- value `undefined` if none passed.
-
-__Example__
-
-```js
-async.detect(['file1','file2','file3'], fs.exists, function(result){
- // result now equals the first file in the list that exists
-});
-```
-
----------------------------------------
-
-<a name="detectSeries" />
-### detectSeries(arr, iterator, callback)
-
-The same as [`detect`](#detect), only the `iterator` is applied to each item in `arr`
-in series. This means the result is always the first in the original `arr` (in
-terms of array order) that passes the truth test.
-
-
----------------------------------------
-
-<a name="sortBy" />
-### sortBy(arr, iterator, callback)
-
-Sorts a list by the results of running each `arr` value through an async `iterator`.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, sortValue)` which must be called once it
- has completed with an error (which can be `null`) and a value to use as the sort
- criteria.
-* `callback(err, results)` - A callback which is called after all the `iterator`
- functions have finished, or an error occurs. Results is the items from
- the original `arr` sorted by the values returned by the `iterator` calls.
-
-__Example__
-
-```js
-async.sortBy(['file1','file2','file3'], function(file, callback){
- fs.stat(file, function(err, stats){
- callback(err, stats.mtime);
- });
-}, function(err, results){
- // results is now the original array of files sorted by
- // modified date
-});
-```
-
-__Sort Order__
-
-By modifying the callback parameter the sorting order can be influenced:
-
-```js
-//ascending order
-async.sortBy([1,9,3,5], function(x, callback){
- callback(null, x);
-}, function(err,result){
- //result callback
-} );
-
-//descending order
-async.sortBy([1,9,3,5], function(x, callback){
- callback(null, x*-1); //<- x*-1 instead of x, turns the order around
-}, function(err,result){
- //result callback
-} );
-```
-
----------------------------------------
-
-<a name="some" />
-### some(arr, iterator, callback)
-
-__Alias:__ `any`
-
-Returns `true` if at least one element in the `arr` satisfies an async test.
-_The callback for each iterator call only accepts a single argument of `true` or
-`false`; it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like `fs.exists`. Once any iterator
-call returns `true`, the main `callback` is immediately called.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A truth test to apply to each item in the array
- in parallel. The iterator is passed a callback(truthValue) which must be
- called with a boolean argument once it has completed.
-* `callback(result)` - A callback which is called as soon as any iterator returns
- `true`, or after all the iterator functions have finished. Result will be
- either `true` or `false` depending on the values of the async tests.
-
-__Example__
-
-```js
-async.some(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then at least one of the files exists
-});
-```
-
----------------------------------------
-
-<a name="every" />
-### every(arr, iterator, callback)
-
-__Alias:__ `all`
-
-Returns `true` if every element in `arr` satisfies an async test.
-_The callback for each `iterator` call only accepts a single argument of `true` or
-`false`; it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like `fs.exists`.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A truth test to apply to each item in the array
- in parallel. The iterator is passed a callback(truthValue) which must be
- called with a boolean argument once it has completed.
-* `callback(result)` - A callback which is called after all the `iterator`
- functions have finished. Result will be either `true` or `false` depending on
- the values of the async tests.
-
-__Example__
-
-```js
-async.every(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then every file exists
-});
-```
-
----------------------------------------
-
-<a name="concat" />
-### concat(arr, iterator, callback)
-
-Applies `iterator` to each item in `arr`, concatenating the results. Returns the
-concatenated list. The `iterator`s are called in parallel, and the results are
-concatenated as they return. There is no guarantee that the results array will
-be returned in the original order of `arr` passed to the `iterator` function.
-
-__Arguments__
-
-* `arr` - An array to iterate over.
-* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, results)` which must be called once it
- has completed with an error (which can be `null`) and an array of results.
-* `callback(err, results)` - A callback which is called after all the `iterator`
- functions have finished, or an error occurs. Results is an array containing
- the concatenated results of the `iterator` function.
-
-__Example__
-
-```js
-async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
- // files is now a list of filenames that exist in the 3 directories
-});
-```
-
----------------------------------------
-
-<a name="concatSeries" />
-### concatSeries(arr, iterator, callback)
-
-Same as [`concat`](#concat), but executes in series instead of parallel.
-
-
-## Control Flow
-
-<a name="series" />
-### series(tasks, [callback])
-
-Run the functions in the `tasks` array in series, each one running once the previous
-function has completed. If any functions in the series pass an error to its
-callback, no more functions are run, and `callback` is immediately called with the value of the error.
-Otherwise, `callback` receives an array of results when `tasks` have completed.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function, and the results will be passed to the final `callback` as an object
-instead of an array. This can be a more readable way of handling results from
-[`series`](#series).
-
-**Note** that while many implementations preserve the order of object properties, the
-[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
-explicitly states that
-
-> The mechanics and order of enumerating the properties is not specified.
-
-So if you rely on the order in which your series of functions are executed, and want
-this to work on all platforms, consider using an array.
-
-__Arguments__
-
-* `tasks` - An array or object containing functions to run, each function is passed
- a `callback(err, result)` it must call on completion with an error `err` (which can
- be `null`) and an optional `result` value.
-* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the `task` callbacks.
-
-__Example__
-
-```js
-async.series([
- function(callback){
- // do some stuff ...
- callback(null, 'one');
- },
- function(callback){
- // do some more stuff ...
- callback(null, 'two');
- }
-],
-// optional callback
-function(err, results){
- // results is now equal to ['one', 'two']
-});
-
-
-// an example using an object instead of an array
-async.series({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equal to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-<a name="parallel" />
-### parallel(tasks, [callback])
-
-Run the `tasks` array of functions in parallel, without waiting until the previous
-function has completed. If any of the functions pass an error to its
-callback, the main `callback` is immediately called with the value of the error.
-Once the `tasks` have completed, the results are passed to the final `callback` as an
-array.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final `callback` as an object
-instead of an array. This can be a more readable way of handling results from
-[`parallel`](#parallel).
-
-
-__Arguments__
-
-* `tasks` - An array or object containing functions to run. Each function is passed
- a `callback(err, result)` which it must call on completion with an error `err`
- (which can be `null`) and an optional `result` value.
-* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
-__Example__
-
-```js
-async.parallel([
- function(callback){
- setTimeout(function(){
- callback(null, 'one');
- }, 200);
- },
- function(callback){
- setTimeout(function(){
- callback(null, 'two');
- }, 100);
- }
-],
-// optional callback
-function(err, results){
- // the results array will equal ['one','two'] even though
- // the second function had a shorter timeout.
-});
-
-
-// an example using an object instead of an array
-async.parallel({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equals to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-<a name="parallelLimit" />
-### parallelLimit(tasks, limit, [callback])
-
-The same as [`parallel`](#parallel), only `tasks` are executed in parallel
-with a maximum of `limit` tasks executing at any time.
-
-Note that the `tasks` are not executed in batches, so there is no guarantee that
-the first `limit` tasks will complete before any others are started.
-
-__Arguments__
-
-* `tasks` - An array or object containing functions to run, each function is passed
- a `callback(err, result)` it must call on completion with an error `err` (which can
- be `null`) and an optional `result` value.
-* `limit` - The maximum number of `tasks` to run at any time.
-* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the `task` callbacks.
-
----------------------------------------
-
-<a name="whilst" />
-### whilst(test, fn, callback)
-
-Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
-or an error occurs.
-
-__Arguments__
-
-* `test()` - synchronous truth test to perform before each execution of `fn`.
-* `fn(callback)` - A function which is called each time `test` passes. The function is
- passed a `callback(err)`, which must be called once it has completed with an
- optional `err` argument.
-* `callback(err)` - A callback which is called after the test fails and repeated
- execution of `fn` has stopped.
-
-__Example__
-
-```js
-var count = 0;
-
-async.whilst(
- function () { return count < 5; },
- function (callback) {
- count++;
- setTimeout(callback, 1000);
- },
- function (err) {
- // 5 seconds have passed
- }
-);
-```
-
----------------------------------------
-
-<a name="doWhilst" />
-### doWhilst(fn, test, callback)
-
-The post-check version of [`whilst`](#whilst). To reflect the difference in
-the order of operations, the arguments `test` and `fn` are switched.
-
-`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
-
----------------------------------------
-
-<a name="until" />
-### until(test, fn, callback)
-
-Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
-or an error occurs.
-
-The inverse of [`whilst`](#whilst).
-
----------------------------------------
-
-<a name="doUntil" />
-### doUntil(fn, test, callback)
-
-Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
-
----------------------------------------
-
-<a name="forever" />
-### forever(fn, errback)
-
-Calls the asynchronous function `fn` with a callback parameter that allows it to
-call itself again, in series, indefinitely.
-
-If an error is passed to the callback then `errback` is called with the
-error, and execution stops, otherwise it will never be called.
-
-```js
-async.forever(
- function(next) {
- // next is suitable for passing to things that need a callback(err [, whatever]);
- // it will result in this function being called again.
- },
- function(err) {
- // if next is called with a value in its first parameter, it will appear
- // in here as 'err', and execution will stop.
- }
-);
-```
-
----------------------------------------
-
-<a name="waterfall" />
-### waterfall(tasks, [callback])
-
-Runs the `tasks` array of functions in series, each passing their results to the next in
-the array. However, if any of the `tasks` pass an error to their own callback, the
-next function is not executed, and the main `callback` is immediately called with
-the error.
-
-__Arguments__
-
-* `tasks` - An array of functions to run, each function is passed a
- `callback(err, result1, result2, ...)` it must call on completion. The first
- argument is an error (which can be `null`) and any further arguments will be
- passed as arguments in order to the next task.
-* `callback(err, [results])` - An optional callback to run once all the functions
- have completed. This will be passed the results of the last task's callback.
-
-
-
-__Example__
-
-```js
-async.waterfall([
- function(callback) {
- callback(null, 'one', 'two');
- },
- function(arg1, arg2, callback) {
- // arg1 now equals 'one' and arg2 now equals 'two'
- callback(null, 'three');
- },
- function(arg1, callback) {
- // arg1 now equals 'three'
- callback(null, 'done');
- }
-], function (err, result) {
- // result now equals 'done'
-});
-```
-
----------------------------------------
-<a name="compose" />
-### compose(fn1, fn2...)
-
-Creates a function which is a composition of the passed asynchronous
-functions. Each function consumes the return value of the function that
-follows. Composing functions `f()`, `g()`, and `h()` would produce the result of
-`f(g(h()))`, only this version uses callbacks to obtain the return values.
-
-Each function is executed with the `this` binding of the composed function.
-
-__Arguments__
-
-* `functions...` - the asynchronous functions to compose
-
-
-__Example__
-
-```js
-function add1(n, callback) {
- setTimeout(function () {
- callback(null, n + 1);
- }, 10);
-}
-
-function mul3(n, callback) {
- setTimeout(function () {
- callback(null, n * 3);
- }, 10);
-}
-
-var add1mul3 = async.compose(mul3, add1);
-
-add1mul3(4, function (err, result) {
- // result now equals 15
-});
-```
-
----------------------------------------
-<a name="seq" />
-### seq(fn1, fn2...)
-
-Version of the compose function that is more natural to read.
-Each function consumes the return value of the previous function.
-It is the equivalent of [`compose`](#compose) with the arguments reversed.
-
-Each function is executed with the `this` binding of the composed function.
-
-__Arguments__
-
-* functions... - the asynchronous functions to compose
-
-
-__Example__
-
-```js
-// Requires lodash (or underscore), express3 and dresende's orm2.
-// Part of an app, that fetches cats of the logged user.
-// This example uses `seq` function to avoid overnesting and error
-// handling clutter.
-app.get('/cats', function(request, response) {
- var User = request.models.User;
- async.seq(
- _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
- function(user, fn) {
- user.getCats(fn); // 'getCats' has signature (callback(err, data))
- }
- )(req.session.user_id, function (err, cats) {
- if (err) {
- console.error(err);
- response.json({ status: 'error', message: err.message });
- } else {
- response.json({ status: 'ok', message: 'Cats found', data: cats });
- }
- });
-});
-```
-
----------------------------------------
-<a name="applyEach" />
-### applyEach(fns, args..., callback)
-
-Applies the provided arguments to each function in the array, calling
-`callback` after all functions have completed. If you only provide the first
-argument, then it will return a function which lets you pass in the
-arguments as if it were a single function call.
-
-__Arguments__
-
-* `fns` - the asynchronous functions to all call with the same arguments
-* `args...` - any number of separate arguments to pass to the function
-* `callback` - the final argument should be the callback, called when all
- functions have completed processing
-
-
-__Example__
-
-```js
-async.applyEach([enableSearch, updateSchema], 'bucket', callback);
-
-// partial application example:
-async.each(
- buckets,
- async.applyEach([enableSearch, updateSchema]),
- callback
-);
-```
-
----------------------------------------
-
-<a name="applyEachSeries" />
-### applyEachSeries(arr, iterator, callback)
-
-The same as [`applyEach`](#applyEach) only the functions are applied in series.
-
----------------------------------------
-
-<a name="queue" />
-### queue(worker, concurrency)
-
-Creates a `queue` object with the specified `concurrency`. Tasks added to the
-`queue` are processed in parallel (up to the `concurrency` limit). If all
-`worker`s are in progress, the task is queued until one becomes available.
-Once a `worker` completes a `task`, that `task`'s callback is called.
-
-__Arguments__
-
-* `worker(task, callback)` - An asynchronous function for processing a queued
- task, which must call its `callback(err)` argument when finished, with an
- optional `error` as an argument.
-* `concurrency` - An `integer` for determining how many `worker` functions should be
- run in parallel.
-
-__Queue objects__
-
-The `queue` object returned by this function has the following properties and
-methods:
-
-* `length()` - a function returning the number of items waiting to be processed.
-* `started` - a function returning whether or not any items have been pushed and processed by the queue
-* `running()` - a function returning the number of items currently being processed.
-* `idle()` - a function returning false if there are items waiting or being processed, or true if not.
-* `concurrency` - an integer for determining how many `worker` functions should be
- run in parallel. This property can be changed after a `queue` is created to
- alter the concurrency on-the-fly.
-* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
- the `worker` has finished processing the task. Instead of a single task, a `tasks` array
- can be submitted. The respective callback is used for every task in the list.
-* `unshift(task, [callback])` - add a new task to the front of the `queue`.
-* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
- and further tasks will be queued.
-* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
-* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
-* `paused` - a boolean for determining whether the queue is in a paused state
-* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
-* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
-* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.
-
-__Example__
-
-```js
-// create a queue object with concurrency 2
-
-var q = async.queue(function (task, callback) {
- console.log('hello ' + task.name);
- callback();
-}, 2);
-
-
-// assign a callback
-q.drain = function() {
- console.log('all items have been processed');
-}
-
-// add some items to the queue
-
-q.push({name: 'foo'}, function (err) {
- console.log('finished processing foo');
-});
-q.push({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-
-// add some items to the queue (batch-wise)
-
-q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
- console.log('finished processing item');
-});
-
-// add some items to the front of the queue
-
-q.unshift({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-```
-
-
----------------------------------------
-
-<a name="priorityQueue" />
-### priorityQueue(worker, concurrency)
-
-The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
-
-* `push(task, priority, [callback])` - `priority` should be a number. If an array of
- `tasks` is given, all tasks will be assigned the same priority.
-* The `unshift` method was removed.
-
----------------------------------------
-
-<a name="cargo" />
-### cargo(worker, [payload])
-
-Creates a `cargo` object with the specified payload. Tasks added to the
-cargo will be processed altogether (up to the `payload` limit). If the
-`worker` is in progress, the task is queued until it becomes available. Once
-the `worker` has completed some tasks, each callback of those tasks is called.
-Check out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work.
-
-While [queue](#queue) passes only one task to one of a group of workers
-at a time, cargo passes an array of tasks to a single worker, repeating
-when the worker is finished.
-
-__Arguments__
-
-* `worker(tasks, callback)` - An asynchronous function for processing an array of
- queued tasks, which must call its `callback(err)` argument when finished, with
- an optional `err` argument.
-* `payload` - An optional `integer` for determining how many tasks should be
- processed per round; if omitted, the default is unlimited.
-
-__Cargo objects__
-
-The `cargo` object returned by this function has the following properties and
-methods:
-
-* `length()` - A function returning the number of items waiting to be processed.
-* `payload` - An `integer` for determining how many tasks should be
- process per round. This property can be changed after a `cargo` is created to
- alter the payload on-the-fly.
-* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
- once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
- can be submitted. The respective callback is used for every task in the list.
-* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
-* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
-* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
-
-__Example__
-
-```js
-// create a cargo object with payload 2
-
-var cargo = async.cargo(function (tasks, callback) {
- for(var i=0; i<tasks.length; i++){
- console.log('hello ' + tasks[i].name);
- }
- callback();
-}, 2);
-
-
-// add some items
-
-cargo.push({name: 'foo'}, function (err) {
- console.log('finished processing foo');
-});
-cargo.push({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-cargo.push({name: 'baz'}, function (err) {
- console.log('finished processing baz');
-});
-```
-
----------------------------------------
-
-<a name="auto" />
-### auto(tasks, [callback])
-
-Determines the best order for running the functions in `tasks`, based on their
-requirements. Each function can optionally depend on other functions being completed
-first, and each function is run as soon as its requirements are satisfied.
-
-If any of the functions pass an error to their callback, it will not
-complete (so any other functions depending on it will not run), and the main
-`callback` is immediately called with the error. Functions also receive an
-object containing the results of functions which have completed so far.
-
-Note, all functions are called with a `results` object as a second argument,
-so it is unsafe to pass functions in the `tasks` object which cannot handle the
-extra argument.
-
-For example, this snippet of code:
-
-```js
-async.auto({
- readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
-}, callback);
-```
-
-will have the effect of calling `readFile` with the results object as the last
-argument, which will fail:
-
-```js
-fs.readFile('data.txt', 'utf-8', cb, {});
-```
-
-Instead, wrap the call to `readFile` in a function which does not forward the
-`results` object:
-
-```js
-async.auto({
- readData: function(cb, results){
- fs.readFile('data.txt', 'utf-8', cb);
- }
-}, callback);
-```
-
-__Arguments__
-
-* `tasks` - An object. Each of its properties is either a function or an array of
- requirements, with the function itself the last item in the array. The object's key
- of a property serves as the name of the task defined by that property,
- i.e. can be used when specifying requirements for other tasks.
- The function receives two arguments: (1) a `callback(err, result)` which must be
- called when finished, passing an `error` (which can be `null`) and the result of
- the function's execution, and (2) a `results` object, containing the results of
- the previously executed functions.
-* `callback(err, results)` - An optional callback which is called when all the
- tasks have been completed. It receives the `err` argument if any `tasks`
- pass an error to their callback. Results are always returned; however, if
- an error occurs, no further `tasks` will be performed, and the results
- object will only contain partial results.
-
-
-__Example__
-
-```js
-async.auto({
- get_data: function(callback){
- console.log('in get_data');
- // async code to get some data
- callback(null, 'data', 'converted to array');
- },
- make_folder: function(callback){
- console.log('in make_folder');
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- callback(null, 'folder');
- },
- write_file: ['get_data', 'make_folder', function(callback, results){
- console.log('in write_file', JSON.stringify(results));
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- callback(null, 'filename');
- }],
- email_link: ['write_file', function(callback, results){
- console.log('in email_link', JSON.stringify(results));
- // once the file is written let's email a link to it...
- // results.write_file contains the filename returned by write_file.
- callback(null, {'file':results.write_file, 'email':'user@example.com'});
- }]
-}, function(err, results) {
- console.log('err = ', err);
- console.log('results = ', results);
-});
-```
-
-This is a fairly trivial example, but to do this using the basic parallel and
-series functions would look like this:
-
-```js
-async.parallel([
- function(callback){
- console.log('in get_data');
- // async code to get some data
- callback(null, 'data', 'converted to array');
- },
- function(callback){
- console.log('in make_folder');
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- callback(null, 'folder');
- }
-],
-function(err, results){
- async.series([
- function(callback){
- console.log('in write_file', JSON.stringify(results));
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- results.push('filename');
- callback(null);
- },
- function(callback){
- console.log('in email_link', JSON.stringify(results));
- // once the file is written let's email a link to it...
- callback(null, {'file':results.pop(), 'email':'user@example.com'});
- }
- ]);
-});
-```
-
-For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
-new tasks much easier (and the code more readable).
-
-
----------------------------------------
-
-<a name="retry" />
-### retry([times = 5], task, [callback])
-
-Attempts to get a successful response from `task` no more than `times` times before
-returning an error. If the task is successful, the `callback` will be passed the result
-of the successful task. If all attempts fail, the callback will be passed the error and
-result (if any) of the final attempt.
-
-__Arguments__
-
-* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.
-* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
- which must be called when finished, passing `err` (which can be `null`) and the `result` of
- the function's execution, and (2) a `results` object, containing the results of
- the previously executed functions (if nested inside another control flow).
-* `callback(err, results)` - An optional callback which is called when the
- task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
-
-The [`retry`](#retry) function can be used as a stand-alone control flow by passing a
-callback, as shown below:
-
-```js
-async.retry(3, apiMethod, function(err, result) {
- // do something with the result
-});
-```
-
-It can also be embeded within other control flow functions to retry individual methods
-that are not as reliable, like this:
-
-```js
-async.auto({
- users: api.getUsers.bind(api),
- payments: async.retry(3, api.getPayments.bind(api))
-}, function(err, results) {
- // do something with the results
-});
-```
-
-
----------------------------------------
-
-<a name="iterator" />
-### iterator(tasks)
-
-Creates an iterator function which calls the next function in the `tasks` array,
-returning a continuation to call the next one after that. It's also possible to
-“peek” at the next iterator with `iterator.next()`.
-
-This function is used internally by the `async` module, but can be useful when
-you want to manually control the flow of functions in series.
-
-__Arguments__
-
-* `tasks` - An array of functions to run.
-
-__Example__
-
-```js
-var iterator = async.iterator([
- function(){ sys.p('one'); },
- function(){ sys.p('two'); },
- function(){ sys.p('three'); }
-]);
-
-node> var iterator2 = iterator();
-'one'
-node> var iterator3 = iterator2();
-'two'
-node> iterator3();
-'three'
-node> var nextfn = iterator2.next();
-node> nextfn();
-'three'
-```
-
----------------------------------------
-
-<a name="apply" />
-### apply(function, arguments..)
-
-Creates a continuation function with some arguments already applied.
-
-Useful as a shorthand when combined with other control flow functions. Any arguments
-passed to the returned function are added to the arguments originally passed
-to apply.
-
-__Arguments__
-
-* `function` - The function you want to eventually apply all arguments to.
-* `arguments...` - Any number of arguments to automatically apply when the
- continuation is called.
-
-__Example__
-
-```js
-// using apply
-
-async.parallel([
- async.apply(fs.writeFile, 'testfile1', 'test1'),
- async.apply(fs.writeFile, 'testfile2', 'test2'),
-]);
-
-
-// the same process without using apply
-
-async.parallel([
- function(callback){
- fs.writeFile('testfile1', 'test1', callback);
- },
- function(callback){
- fs.writeFile('testfile2', 'test2', callback);
- }
-]);
-```
-
-It's possible to pass any number of additional arguments when calling the
-continuation:
-
-```js
-node> var fn = async.apply(sys.puts, 'one');
-node> fn('two', 'three');
-one
-two
-three
-```
-
----------------------------------------
-
-<a name="nextTick" />
-### nextTick(callback), setImmediate(callback)
-
-Calls `callback` on a later loop around the event loop. In Node.js this just
-calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
-if available, otherwise `setTimeout(callback, 0)`, which means other higher priority
-events may precede the execution of `callback`.
-
-This is used internally for browser-compatibility purposes.
-
-__Arguments__
-
-* `callback` - The function to call on a later loop around the event loop.
-
-__Example__
-
-```js
-var call_order = [];
-async.nextTick(function(){
- call_order.push('two');
- // call_order now equals ['one','two']
-});
-call_order.push('one')
-```
-
-<a name="times" />
-### times(n, callback)
-
-Calls the `callback` function `n` times, and accumulates results in the same manner
-you would use with [`map`](#map).
-
-__Arguments__
-
-* `n` - The number of times to run the function.
-* `callback` - The function to call `n` times.
-
-__Example__
-
-```js
-// Pretend this is some complicated async factory
-var createUser = function(id, callback) {
- callback(null, {
- id: 'user' + id
- })
-}
-// generate 5 users
-async.times(5, function(n, next){
- createUser(n, function(err, user) {
- next(err, user)
- })
-}, function(err, users) {
- // we should now have 5 users
-});
-```
-
-<a name="timesSeries" />
-### timesSeries(n, callback)
-
-The same as [`times`](#times), only the iterator is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
-The results array will be in the same order as the original.
-
-
-## Utils
-
-<a name="memoize" />
-### memoize(fn, [hasher])
-
-Caches the results of an `async` function. When creating a hash to store function
-results against, the callback is omitted from the hash and an optional hash
-function can be used.
-
-The cache of results is exposed as the `memo` property of the function returned
-by `memoize`.
-
-__Arguments__
-
-* `fn` - The function to proxy and cache results from.
-* `hasher` - Tn optional function for generating a custom hash for storing
- results. It has all the arguments applied to it apart from the callback, and
- must be synchronous.
-
-__Example__
-
-```js
-var slow_fn = function (name, callback) {
- // do something
- callback(null, result);
-};
-var fn = async.memoize(slow_fn);
-
-// fn can now be used as if it were slow_fn
-fn('some name', function () {
- // callback
-});
-```
-
-<a name="unmemoize" />
-### unmemoize(fn)
-
-Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized
-form. Handy for testing.
-
-__Arguments__
-
-* `fn` - the memoized function
-
-<a name="log" />
-### log(function, arguments)
-
-Logs the result of an `async` function to the `console`. Only works in Node.js or
-in browsers that support `console.log` and `console.error` (such as FF and Chrome).
-If multiple arguments are returned from the async function, `console.log` is
-called on each argument in order.
-
-__Arguments__
-
-* `function` - The function you want to eventually apply all arguments to.
-* `arguments...` - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, 'hello ' + name);
- }, 1000);
-};
-```
-```js
-node> async.log(hello, 'world');
-'hello world'
-```
-
----------------------------------------
-
-<a name="dir" />
-### dir(function, arguments)
-
-Logs the result of an `async` function to the `console` using `console.dir` to
-display the properties of the resulting object. Only works in Node.js or
-in browsers that support `console.dir` and `console.error` (such as FF and Chrome).
-If multiple arguments are returned from the async function, `console.dir` is
-called on each argument in order.
-
-__Arguments__
-
-* `function` - The function you want to eventually apply all arguments to.
-* `arguments...` - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, {hello: name});
- }, 1000);
-};
-```
-```js
-node> async.dir(hello, 'world');
-{hello: 'world'}
-```
-
----------------------------------------
-
-<a name="noConflict" />
-### noConflict()
-
-Changes the value of `async` back to its original value, returning a reference to the
-`async` object.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/bower.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/bower.json b/node_modules/request/node_modules/form-data/node_modules/async/bower.json
deleted file mode 100644
index 1817688..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/bower.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "async",
- "description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.9.2",
- "main": "lib/async.js",
- "keywords": [
- "async",
- "callback",
- "utility",
- "module"
- ],
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/caolan/async.git"
- },
- "devDependencies": {
- "nodeunit": ">0.0.0",
- "uglify-js": "1.2.x",
- "nodelint": ">0.0.0",
- "lodash": ">=2.4.1"
- },
- "moduleType": [
- "amd",
- "globals",
- "node"
- ],
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "tests"
- ],
- "authors": [
- "Caolan McMahon"
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/component.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/component.json b/node_modules/request/node_modules/form-data/node_modules/async/component.json
deleted file mode 100644
index 5003a7c..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/component.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "async",
- "description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.9.2",
- "keywords": [
- "async",
- "callback",
- "utility",
- "module"
- ],
- "license": "MIT",
- "repository": "caolan/async",
- "scripts": [
- "lib/async.js"
- ]
-}
\ No newline at end of file
[11/59] [abbrv] couchdb-nmo git commit: tests: fixes & raise coverage
again
Posted by ro...@apache.org.
tests: fixes & raise coverage again
- back to 100% code coverage
- pin to lab-babel 1.0.0
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/d9c91bd3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/d9c91bd3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/d9c91bd3
Branch: refs/heads/master
Commit: d9c91bd3de198442c5c20b49ca0c8aa8b418d800
Parents: a67e6ba
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri May 22 22:44:18 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri May 22 23:13:37 2015 +0200
----------------------------------------------------------------------
package.json | 2 +-
test/common.js | 4 ++--
test/isonline.js | 8 ++++++++
test/utils.js | 14 ++++++++++++++
4 files changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/d9c91bd3/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index e861efc..8095998 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"devDependencies": {
"babel": "^5.1.10",
"lab": "~5.5.1",
- "lab-babel": "~1.0.0",
+ "lab-babel": "1.0.0",
"less": "~2.5.0",
"marked-man": "~0.1.4",
"node-doc-generator": "robertkowalski/node-documentation-generator#sloppy"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/d9c91bd3/test/common.js
----------------------------------------------------------------------
diff --git a/test/common.js b/test/common.js
index 511905c..3e19963 100644
--- a/test/common.js
+++ b/test/common.js
@@ -20,11 +20,11 @@ export function createTestServers () {
}
export function stopTestServers (servers) {
- const servers = servers.map((s) => {
+ const s = servers.map((s) => {
const close = Promise.promisify(s.close).bind(s);
return close();
});
- return Promise.all(servers);
+ return Promise.all(s);
}
export function createTestServer (port) {
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/d9c91bd3/test/isonline.js
----------------------------------------------------------------------
diff --git a/test/isonline.js b/test/isonline.js
index fc81f17..da0e3b7 100644
--- a/test/isonline.js
+++ b/test/isonline.js
@@ -86,6 +86,14 @@ lab.experiment('isonline', () => {
});
});
+ lab.test('returns an error for non http urls', (done) => {
+ isonline('ftp://127.0.0.1:65516')
+ .catch((err) => {
+ assert.ok(err instanceof Error);
+ done();
+ });
+ });
+
lab.test('returns false for down site with bad DNS', (done) => {
isonline('http://exampleneverexists')
.then((res) => {
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/d9c91bd3/test/utils.js
----------------------------------------------------------------------
diff --git a/test/utils.js b/test/utils.js
index 2beef5c..41a31ea 100644
--- a/test/utils.js
+++ b/test/utils.js
@@ -98,3 +98,17 @@ lab.experiment('utils: send json to node', () => {
});
});
});
+
+lab.experiment('utils: removeUsernamePw', () => {
+ lab.test('removes credentials', (done) => {
+ var res = utils.removeUsernamePw('https://foo:bar@example.com');
+ assert.equal(res, 'https://USER:PW@example.com/');
+ done();
+ });
+
+ lab.test('keeps other urls valid', (done) => {
+ var res = utils.removeUsernamePw('https://example.com');
+ assert.equal(res, 'https://example.com/');
+ done();
+ });
+});
[53/59] [abbrv] couchdb-nmo git commit: add wreck@5.6.0
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/test/index.js b/node_modules/wreck/test/index.js
new file mode 100755
index 0000000..c45717d
--- /dev/null
+++ b/node_modules/wreck/test/index.js
@@ -0,0 +1,1752 @@
+// Load modules
+
+var Http = require('http');
+var Https = require('https');
+var Path = require('path');
+var Fs = require('fs');
+var Events = require('events');
+var Stream = require('stream');
+var Code = require('code');
+var Hoek = require('hoek');
+var Lab = require('lab');
+var Wreck = require('../');
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.describe;
+var it = lab.it;
+var expect = Code.expect;
+
+
+var payload = new Array(1640).join('0123456789'); // make sure we have a payload larger than 16384 bytes for chunking coverage
+
+describe('request()', function () {
+
+ it('requests a resource with callback', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(payload);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('requests a POST resource', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ expect(req.headers['content-length']).to.equal('16390');
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ req.pipe(res);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('post', 'http://localhost:' + server.address().port, { payload: payload }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('requests a POST resource with unicode characters in payload', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ expect(req.headers['content-length']).to.equal('14');
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ req.pipe(res);
+ });
+
+ server.listen(0, function () {
+
+ var unicodePayload = JSON.stringify({ field: 'ć' });
+ Wreck.request('post', 'http://localhost:' + server.address().port, { payload: unicodePayload }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(unicodePayload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('requests a POST resource with headers', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ req.pipe(res);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('post', 'http://localhost:' + server.address().port, { headers: { 'user-agent': 'wreck' }, payload: payload }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('requests a POST resource with stream payload', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ req.pipe(res);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('post', 'http://localhost:' + server.address().port, { payload: Wreck.toReadableStream(payload) }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('requests a resource without callback', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(payload);
+ server.close();
+ done();
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, {});
+ });
+ });
+
+ it('cannot set agent and rejectUnauthorized at the same time', function (done) {
+
+ var fn = function () {
+
+ Wreck.request('get', 'https://google.com', { rejectUnauthorized: true, agent: new Https.Agent() }, function (err, res) {});
+ };
+
+ expect(fn).to.throw();
+ done();
+ });
+
+ it('cannot set a false agent and rejectUnauthorized at the same time', function (done) {
+
+ var fn = function () {
+
+ Wreck.request('get', 'https://google.com', { rejectUnauthorized: false, agent: false }, function (err, res) {});
+ };
+
+ expect(fn).to.throw();
+ done();
+ });
+
+ it('can set a null agent and rejectUnauthorized at the same time', function (done) {
+
+ var fn = function () {
+
+ Wreck.request('get', 'https://google.com', { rejectUnauthorized: false, agent: null }, function (err, res) {});
+ };
+
+ expect(fn).to.not.throw();
+ done();
+ });
+
+ it('requests an https resource', function (done) {
+
+ Wreck.request('get', 'https://google.com', { rejectUnauthorized: true }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.contain('<HTML>');
+ done();
+ });
+ });
+ });
+
+ it('requests an https resource with secure protocol set', function (done) {
+
+ Wreck.request('get', 'https://google.com', { rejectUnauthorized: true, secureProtocol: 'SSLv23_method' }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.contain('<HTML>');
+ done();
+ });
+ });
+ });
+
+ it('fails when an https resource has invalid certs and the default rejectUnauthorized', function (done) {
+
+ var httpsOptions = {
+ key: '-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA0UqyXDCqWDKpoNQQK/fdr0OkG4gW6DUafxdufH9GmkX/zoKz\ng/SFLrPipzSGINKWtyMvo7mPjXqqVgE10LDI3VFV8IR6fnART+AF8CW5HMBPGt/s\nfQW4W4puvBHkBxWSW1EvbecgNEIS9hTGvHXkFzm4xJ2e9DHp2xoVAjREC73B7JbF\nhc5ZGGchKw+CFmAiNysU0DmBgQcac0eg2pWoT+YGmTeQj6sRXO67n2xy/hA1DuN6\nA4WBK3wM3O4BnTG0dNbWUEbe7yAbV5gEyq57GhJIeYxRvveVDaX90LoAqM4cUH06\n6rciON0UbDHV2LP/JaH5jzBjUyCnKLLo5snlbwIDAQABAoIBAQDJm7YC3pJJUcxb\nc8x8PlHbUkJUjxzZ5MW4Zb71yLkfRYzsxrTcyQA+g+QzA4KtPY8XrZpnkgm51M8e\n+B16AcIMiBxMC6HgCF503i16LyyJiKrrDYfGy2rTK6AOJQHO3TXWJ3eT3BAGpxuS\n12K2Cq6EvQLCy79iJm7Ks+5G6EggMZPfCVdEhffRm2Epl4T7LpIAqWiUDcDfS05n\nNNfAGxxvALPn+D+kzcSF6hpmCVrFVTf9ouhvnr+0DpIIVPwSK/REAF3Ux5SQvFuL\njPmh3bGwfRtcC5d21QNrHdoBVSN2UBLmbHUpBUcOBI8FyivAWJhRfKnhTvXMFG8L\nwaXB51IZAoGBAP/E3uz6zCyN7l2j09wmbyNOi1AKvr1WSmuBJveITouwblnRSdvc\nsYm4YYE0Vb94AG4n7JIfZLKtTN0xvnCo8tYjrdwMJyGfEfMGCQQ9MpOBXAkVVZvP\ne2k4zHNNsfvSc38UNSt7K0HkVuH5BkRBQeskcsyMeu0qK4wQwdtiCoBDAoGBANF7\nFMppYxSW4ir7Jvkh0P8bP/
Z7AtaSmkX7iMmUYT+gMFB5EKqFTQjNQgSJxS/uHVDE\nSC5co8WGHnRk7YH2Pp+Ty1fHfXNWyoOOzNEWvg6CFeMHW2o+/qZd4Z5Fep6qCLaa\nFvzWWC2S5YslEaaP8DQ74aAX4o+/TECrxi0z2lllAoGAdRB6qCSyRsI/k4Rkd6Lv\nw00z3lLMsoRIU6QtXaZ5rN335Awyrfr5F3vYxPZbOOOH7uM/GDJeOJmxUJxv+cia\nPQDflpPJZU4VPRJKFjKcb38JzO6C3Gm+po5kpXGuQQA19LgfDeO2DNaiHZOJFrx3\nm1R3Zr/1k491lwokcHETNVkCgYBPLjrZl6Q/8BhlLrG4kbOx+dbfj/euq5NsyHsX\n1uI7bo1Una5TBjfsD8nYdUr3pwWltcui2pl83Ak+7bdo3G8nWnIOJ/WfVzsNJzj7\n/6CvUzR6sBk5u739nJbfgFutBZBtlSkDQPHrqA7j3Ysibl3ZIJlULjMRKrnj6Ans\npCDwkQKBgQCM7gu3p7veYwCZaxqDMz5/GGFUB1My7sK0hcT7/oH61yw3O8pOekee\nuctI1R3NOudn1cs5TAy/aypgLDYTUGQTiBRILeMiZnOrvQQB9cEf7TFgDoRNCcDs\nV/ZWiegVB/WY7H0BkCekuq5bHwjgtJTpvHGqQ9YD7RhE8RSYOhdQ/Q==\n-----END RSA PRIVATE KEY-----\n',
+ cert: '-----BEGIN CERTIFICATE-----\nMIIDBjCCAe4CCQDvLNml6smHlTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJV\nUzETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0\ncyBQdHkgTHRkMB4XDTE0MDEyNTIxMjIxOFoXDTE1MDEyNTIxMjIxOFowRTELMAkG\nA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0\nIFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nANFKslwwqlgyqaDUECv33a9DpBuIFug1Gn8Xbnx/RppF/86Cs4P0hS6z4qc0hiDS\nlrcjL6O5j416qlYBNdCwyN1RVfCEen5wEU/gBfAluRzATxrf7H0FuFuKbrwR5AcV\nkltRL23nIDRCEvYUxrx15Bc5uMSdnvQx6dsaFQI0RAu9weyWxYXOWRhnISsPghZg\nIjcrFNA5gYEHGnNHoNqVqE/mBpk3kI+rEVzuu59scv4QNQ7jegOFgSt8DNzuAZ0x\ntHTW1lBG3u8gG1eYBMquexoSSHmMUb73lQ2l/dC6AKjOHFB9Ouq3IjjdFGwx1diz\n/yWh+Y8wY1Mgpyiy6ObJ5W8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAoSc6Skb4\ng1e0ZqPKXBV2qbx7hlqIyYpubCl1rDiEdVzqYYZEwmst36fJRRrVaFuAM/1DYAmT\nWMhU+yTfA+vCS4tql9b9zUhPw/IDHpBDWyR01spoZFBF/hE1MGNpCSXXsAbmCiVf\naxrIgR2DNketbDxkQx671KwF1+1JOMo9ffXp+OhuRo5NaGIxhTsZ+f/MA4y084Aj\nDI39av50sTRTWWShlN+J7PtdQ
VA5SZD97oYbeUeL7gI18kAJww9eUdmT0nEjcwKs\nxsQT1fyKbo7AlZBY4KSlUMuGnn0VnAsB9b+LxtXlDfnjyM8bVQx1uAfRo0DO8p/5\n3J5DTjAU55deBQ==\n-----END CERTIFICATE-----\n'
+ };
+
+ var server = Https.createServer(httpsOptions, function (req, res) {
+
+ res.writeHead(200);
+ res.end();
+ });
+
+ server.listen(0, function (err) {
+
+ expect(err).to.not.exist();
+
+ Wreck.request('get', 'https://localhost:' + server.address().port, {}, function (err, res) {
+
+ expect(err).to.exist();
+ done();
+ });
+ });
+ });
+
+ it('succeeds when an https resource has unauthorized certs and rejectUnauthorized is false', function (done) {
+
+ var httpsOptions = {
+ key: '-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA0UqyXDCqWDKpoNQQK/fdr0OkG4gW6DUafxdufH9GmkX/zoKz\ng/SFLrPipzSGINKWtyMvo7mPjXqqVgE10LDI3VFV8IR6fnART+AF8CW5HMBPGt/s\nfQW4W4puvBHkBxWSW1EvbecgNEIS9hTGvHXkFzm4xJ2e9DHp2xoVAjREC73B7JbF\nhc5ZGGchKw+CFmAiNysU0DmBgQcac0eg2pWoT+YGmTeQj6sRXO67n2xy/hA1DuN6\nA4WBK3wM3O4BnTG0dNbWUEbe7yAbV5gEyq57GhJIeYxRvveVDaX90LoAqM4cUH06\n6rciON0UbDHV2LP/JaH5jzBjUyCnKLLo5snlbwIDAQABAoIBAQDJm7YC3pJJUcxb\nc8x8PlHbUkJUjxzZ5MW4Zb71yLkfRYzsxrTcyQA+g+QzA4KtPY8XrZpnkgm51M8e\n+B16AcIMiBxMC6HgCF503i16LyyJiKrrDYfGy2rTK6AOJQHO3TXWJ3eT3BAGpxuS\n12K2Cq6EvQLCy79iJm7Ks+5G6EggMZPfCVdEhffRm2Epl4T7LpIAqWiUDcDfS05n\nNNfAGxxvALPn+D+kzcSF6hpmCVrFVTf9ouhvnr+0DpIIVPwSK/REAF3Ux5SQvFuL\njPmh3bGwfRtcC5d21QNrHdoBVSN2UBLmbHUpBUcOBI8FyivAWJhRfKnhTvXMFG8L\nwaXB51IZAoGBAP/E3uz6zCyN7l2j09wmbyNOi1AKvr1WSmuBJveITouwblnRSdvc\nsYm4YYE0Vb94AG4n7JIfZLKtTN0xvnCo8tYjrdwMJyGfEfMGCQQ9MpOBXAkVVZvP\ne2k4zHNNsfvSc38UNSt7K0HkVuH5BkRBQeskcsyMeu0qK4wQwdtiCoBDAoGBANF7\nFMppYxSW4ir7Jvkh0P8bP/
Z7AtaSmkX7iMmUYT+gMFB5EKqFTQjNQgSJxS/uHVDE\nSC5co8WGHnRk7YH2Pp+Ty1fHfXNWyoOOzNEWvg6CFeMHW2o+/qZd4Z5Fep6qCLaa\nFvzWWC2S5YslEaaP8DQ74aAX4o+/TECrxi0z2lllAoGAdRB6qCSyRsI/k4Rkd6Lv\nw00z3lLMsoRIU6QtXaZ5rN335Awyrfr5F3vYxPZbOOOH7uM/GDJeOJmxUJxv+cia\nPQDflpPJZU4VPRJKFjKcb38JzO6C3Gm+po5kpXGuQQA19LgfDeO2DNaiHZOJFrx3\nm1R3Zr/1k491lwokcHETNVkCgYBPLjrZl6Q/8BhlLrG4kbOx+dbfj/euq5NsyHsX\n1uI7bo1Una5TBjfsD8nYdUr3pwWltcui2pl83Ak+7bdo3G8nWnIOJ/WfVzsNJzj7\n/6CvUzR6sBk5u739nJbfgFutBZBtlSkDQPHrqA7j3Ysibl3ZIJlULjMRKrnj6Ans\npCDwkQKBgQCM7gu3p7veYwCZaxqDMz5/GGFUB1My7sK0hcT7/oH61yw3O8pOekee\nuctI1R3NOudn1cs5TAy/aypgLDYTUGQTiBRILeMiZnOrvQQB9cEf7TFgDoRNCcDs\nV/ZWiegVB/WY7H0BkCekuq5bHwjgtJTpvHGqQ9YD7RhE8RSYOhdQ/Q==\n-----END RSA PRIVATE KEY-----\n',
+ cert: '-----BEGIN CERTIFICATE-----\nMIIDBjCCAe4CCQDvLNml6smHlTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJV\nUzETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0\ncyBQdHkgTHRkMB4XDTE0MDEyNTIxMjIxOFoXDTE1MDEyNTIxMjIxOFowRTELMAkG\nA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0\nIFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nANFKslwwqlgyqaDUECv33a9DpBuIFug1Gn8Xbnx/RppF/86Cs4P0hS6z4qc0hiDS\nlrcjL6O5j416qlYBNdCwyN1RVfCEen5wEU/gBfAluRzATxrf7H0FuFuKbrwR5AcV\nkltRL23nIDRCEvYUxrx15Bc5uMSdnvQx6dsaFQI0RAu9weyWxYXOWRhnISsPghZg\nIjcrFNA5gYEHGnNHoNqVqE/mBpk3kI+rEVzuu59scv4QNQ7jegOFgSt8DNzuAZ0x\ntHTW1lBG3u8gG1eYBMquexoSSHmMUb73lQ2l/dC6AKjOHFB9Ouq3IjjdFGwx1diz\n/yWh+Y8wY1Mgpyiy6ObJ5W8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAoSc6Skb4\ng1e0ZqPKXBV2qbx7hlqIyYpubCl1rDiEdVzqYYZEwmst36fJRRrVaFuAM/1DYAmT\nWMhU+yTfA+vCS4tql9b9zUhPw/IDHpBDWyR01spoZFBF/hE1MGNpCSXXsAbmCiVf\naxrIgR2DNketbDxkQx671KwF1+1JOMo9ffXp+OhuRo5NaGIxhTsZ+f/MA4y084Aj\nDI39av50sTRTWWShlN+J7PtdQ
VA5SZD97oYbeUeL7gI18kAJww9eUdmT0nEjcwKs\nxsQT1fyKbo7AlZBY4KSlUMuGnn0VnAsB9b+LxtXlDfnjyM8bVQx1uAfRo0DO8p/5\n3J5DTjAU55deBQ==\n-----END CERTIFICATE-----\n'
+ };
+
+ var server = Https.createServer(httpsOptions, function (req, res) {
+
+ res.writeHead(200);
+ res.end();
+ });
+
+ server.listen(0, function (err) {
+
+ expect(err).to.not.exist();
+
+ Wreck.request('get', 'https://localhost:' + server.address().port, { rejectUnauthorized: false }, function (err, res) {
+
+ expect(err).to.not.exist();
+ done();
+ });
+ });
+ });
+
+ it('requests a resource with downstream dependency', function (done) {
+
+ var up = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(payload);
+ });
+
+ up.listen(0, function () {
+
+ var down = Http.createServer(function (req, res1) {
+
+ res1.writeHead(200, { 'Content-Type': 'text/plain' });
+ Wreck.request('get', 'http://localhost:' + up.address().port, { downstreamRes: res1 }, function (err, res2) {
+
+ expect(err).to.not.exist();
+ res2.pipe(res1);
+ });
+ });
+
+ down.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + down.address().port, {}, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ up.close();
+ down.close();
+ done();
+ });
+ });
+ });
+ });
+ });
+
+ it('does not follow redirections by default', function (done) {
+
+ var gen = 0;
+ var server = Http.createServer(function (req, res) {
+
+ if (!gen++) {
+ res.writeHead(301, { 'Location': 'http://localhost:' + server.address().port });
+ res.end();
+ }
+ else {
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(payload);
+ }
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(301);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('handles redirections', function (done) {
+
+ var gen = 0;
+ var server = Http.createServer(function (req, res) {
+
+ if (!gen++) {
+ res.writeHead(301, { 'Location': 'http://localhost:' + server.address().port });
+ res.end();
+ }
+ else {
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(payload);
+ }
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { redirects: 1 }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('handles redirections with relative location', function (done) {
+
+ var gen = 0;
+ var server = Http.createServer(function (req, res) {
+
+ if (!gen++) {
+ res.writeHead(301, { 'Location': '/' });
+ res.end();
+ }
+ else {
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(payload);
+ }
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { redirects: 1 }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('reaches max redirections count', function (done) {
+
+ var gen = 0;
+ var server = Http.createServer(function (req, res) {
+
+ if (gen++ < 2) {
+ res.writeHead(301, { 'Location': 'http://localhost:' + server.address().port });
+ res.end();
+ }
+ else {
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(payload);
+ }
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { redirects: 1 }, function (err, res) {
+
+ expect(err.message).to.equal('Maximum redirections reached');
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('handles malformed redirection response', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(301);
+ res.end();
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { redirects: 1 }, function (err, res) {
+
+ expect(err.message).to.equal('Received redirection without location');
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('handles redirections with POST stream payload', function (done) {
+
+ var gen = 0;
+ var server = Http.createServer(function (req, res) {
+
+ if (!gen++) {
+ res.writeHead(307, { 'Location': '/' });
+ res.end();
+ }
+ else {
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ Wreck.read(req, null, function (err, res2) {
+
+ res.end(res2);
+ });
+ }
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('post', 'http://localhost:' + server.address().port, { redirects: 1, payload: Wreck.toReadableStream(payload) }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('handles request errors with a boom response', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ req.destroy();
+ res.end();
+ });
+
+ server.once('listening', function () {
+
+ Wreck.request('get', 'http://127.0.0.1:' + server.address().port, { payload: '' }, function (err) {
+
+ expect(err.code).to.equal('ECONNRESET');
+ done();
+ });
+ });
+
+ server.listen(0);
+ });
+
+ it('handles request errors with a boom response when payload is being sent', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ req.destroy();
+ res.end();
+ });
+
+ server.once('listening', function () {
+
+ Wreck.request('get', 'http://127.0.0.1:' + server.address().port, { payload: '' }, function (err) {
+
+ expect(err.code).to.equal('ECONNRESET');
+ done();
+ });
+ });
+
+ server.listen(0);
+ });
+
+ it('handles response errors with a boom response', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.destroy();
+ });
+
+ server.once('listening', function () {
+
+ Wreck.request('get', 'http://127.0.0.1:' + server.address().port, { payload: '' }, function (err) {
+
+ expect(err.code).to.equal('ECONNRESET');
+ done();
+ });
+ });
+
+ server.listen(0);
+ });
+
+ it('handles errors when remote server is unavailable', function (done) {
+
+ Wreck.request('get', 'http://127.0.0.1:10', { payload: '' }, function (err) {
+
+ expect(err).to.exist();
+ done();
+ });
+ });
+
+ it('handles a timeout during a socket close', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ req.once('error', function () { });
+ res.once('error', function () { });
+
+ setTimeout(function () {
+
+ req.destroy();
+ }, 5);
+ });
+
+ server.once('error', function () { });
+
+ server.once('listening', function () {
+
+ Wreck.request('get', 'http://127.0.0.1:' + server.address().port, { payload: '', timeout: 5 }, function (err) {
+
+ expect(err).to.exist();
+ server.close();
+
+ setTimeout(done, 5);
+ });
+ });
+
+ server.listen(0);
+ });
+
+ it('handles an error after a timeout', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ req.once('error', function () { });
+ res.once('error', function () { });
+
+ setTimeout(function () {
+
+ res.socket.write('ERROR');
+ }, 5);
+ });
+
+ server.once('error', function () { });
+
+ server.once('listening', function () {
+
+ Wreck.request('get', 'http://127.0.0.1:' + server.address().port, { payload: '', timeout: 5 }, function (err) {
+
+ expect(err).to.exist();
+ server.close();
+
+ setTimeout(done, 5);
+ });
+ });
+
+ server.listen(0);
+ });
+
+ it('allows request without a callback', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.end('ok');
+ });
+
+ server.once('listening', function () {
+
+ Wreck.request('get', 'http://127.0.0.1:' + server.address().port);
+ done();
+ });
+
+ server.listen(0);
+ });
+
+ it('requests can be aborted', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end();
+ });
+
+ server.listen(0, function () {
+
+ var req = Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err) {
+
+ expect(err).to.exist();
+ expect(err.code).to.equal('ECONNRESET');
+ done();
+ });
+
+ req.abort();
+ });
+ });
+
+ it('request shortcuts can be aborted', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end();
+ });
+
+ server.listen(0, function () {
+
+ var req = Wreck.get('http://localhost:' + server.address().port, function (err) {
+
+ expect(err).to.exist();
+ expect(err.code).to.equal('ECONNRESET');
+ done();
+ });
+
+ req.abort();
+ });
+ });
+
+ it('in-progress requests can be aborted', function (done) {
+
+ var wreck;
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end();
+
+ wreck.abort();
+ });
+
+ server.listen(0, function () {
+
+ wreck = Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err) {
+
+ expect(err).to.exist();
+ expect(err.code).to.equal('ECONNRESET');
+ done();
+ });
+ });
+ });
+
+ it('uses agent option', function (done) {
+
+ var agent = new Http.Agent();
+ expect(Object.keys(agent.sockets).length).to.equal(0);
+
+ Wreck.request('get', 'http://localhost/', { agent: agent }, function (err, res) {
+
+ expect(Object.keys(agent.sockets).length).to.equal(1);
+ done();
+ });
+ });
+
+ it('pooling can be disabled by setting agent to false', function (done) {
+
+ var complete;
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.write('foo');
+
+ complete = complete || function () {
+
+ res.end();
+ };
+ });
+
+ server.listen(0, function () {
+
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { agent: false, timeout: 15 }, function (err, res) {
+
+ expect(err).to.not.exist();
+ expect(Object.keys(Wreck.agents.http.sockets).length).to.equal(0);
+ expect(Object.keys(Wreck.agents.http.requests).length).to.equal(0);
+
+ Wreck.request('get', 'http://localhost:' + server.address().port + '/thatone', { agent: false, timeout: 15 }, function (err, innerRes) {
+
+ expect(err).to.not.exist();
+
+ expect(Object.keys(Wreck.agents.http.sockets).length).to.equal(0);
+ expect(Object.keys(Wreck.agents.http.requests).length).to.equal(0);
+
+ complete();
+
+ Wreck.read(res, null, function () {
+
+ setTimeout(function () {
+
+ expect(Object.keys(Wreck.agents.http.sockets).length).to.equal(0);
+ expect(Object.keys(Wreck.agents.http.requests).length).to.equal(0);
+
+ done();
+ }, 100);
+ });
+ });
+ });
+ });
+ });
+
+ it('requests payload in buffer', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ req.pipe(res);
+ });
+
+ server.listen(0, function () {
+
+ var buf = new Buffer(payload, 'ascii');
+
+ Wreck.request('post', 'http://localhost:' + server.address().port, { payload: buf }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal(payload);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('requests head method', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ req.pipe(res);
+ });
+
+ server.listen(0, function () {
+
+ var buf = new Buffer(payload, 'ascii');
+
+ Wreck.request('head', 'http://localhost:' + server.address().port, { payload: null }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal('');
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('post null payload', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.statusCode = 500;
+ res.end();
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('post', 'http://localhost:' + server.address().port, { headers: { connection: 'close' }, payload: null }, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, null, function (err, body) {
+
+ expect(err).to.not.exist();
+ expect(body.toString()).to.equal('');
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('handles read timeout', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ setTimeout(function () {
+
+ res.writeHead(200);
+ res.write(payload);
+ res.end();
+ }, 2000);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { timeout: 100 }, function (err, res) {
+
+ expect(err).to.exist();
+ expect(err.output.statusCode).to.equal(504);
+ done();
+ });
+ });
+ });
+
+ it('cleans socket on agent deferred read timeout', function (done) {
+
+ var complete;
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.write('foo');
+
+ complete = complete || function () {
+
+ res.end();
+ };
+ });
+
+ server.listen(0, function () {
+
+ var agent = new Http.Agent({ maxSockets: 1 });
+ expect(Object.keys(agent.sockets).length).to.equal(0);
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { agent: agent, timeout: 15 }, function (err, res) {
+
+ expect(err).to.not.exist();
+ expect(Object.keys(agent.sockets).length).to.equal(1);
+ expect(Object.keys(agent.requests).length).to.equal(0);
+
+ Wreck.request('get', 'http://localhost:' + server.address().port + '/thatone', { agent: agent, timeout: 15 }, function (err, innerRes) {
+
+ expect(err).to.exist();
+ expect(err.output.statusCode).to.equal(504);
+
+ expect(Object.keys(agent.sockets).length).to.equal(1);
+ expect(Object.keys(agent.requests).length).to.equal(1);
+
+ complete();
+
+ Wreck.read(res, null, function () {
+
+ setTimeout(function () {
+
+ expect(Object.keys(agent.sockets).length).to.equal(0);
+ expect(Object.keys(agent.requests).length).to.equal(0);
+
+ done();
+ }, 100);
+ });
+ });
+ });
+ });
+ });
+
+ it('defaults maxSockets to Infinity', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.write(payload);
+ res.end();
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { timeout: 100 }, function (err, res) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(Wreck.agents.http.maxSockets).to.equal(Infinity);
+ done();
+ });
+ });
+ });
+
+ it('maxSockets on default agents can be changed', function (done) {
+
+ var complete;
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.write('foo');
+
+ complete = complete || function () {
+
+ res.end();
+ };
+ });
+
+ server.listen(0, function () {
+
+ Wreck.agents.http.maxSockets = 1;
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, { timeout: 15 }, function (err, res) {
+
+ expect(err).to.not.exist();
+
+ Wreck.request('get', 'http://localhost:' + server.address().port + '/thatone', { timeout: 15 }, function (err, innerRes) {
+
+ expect(err).to.exist();
+ expect(err.output.statusCode).to.equal(504);
+
+ complete();
+
+ Wreck.read(res, null, function () {
+
+ Wreck.agents.http.maxSockets = Infinity;
+ done();
+ });
+ });
+ });
+ });
+ });
+});
+
+describe('options.baseUrl', function () {
+
+ it('uses baseUrl option with trailing slash and uri is prefixed with a slash', function (done) {
+
+ var r = Wreck.request('get', '/foo', { baseUrl: 'http://localhost/' }, function (err, res) {
+
+ expect(r._headers.host).to.equal('localhost');
+ done();
+ });
+ });
+
+ it('uses baseUrl option without trailing slash and uri is prefixed with a slash', function (done) {
+
+ var request = Wreck.request('get', '/foo', { baseUrl: 'http://localhost' }, Hoek.ignore);
+
+ expect(request._headers.host).to.equal('localhost');
+ expect(request.path).to.equal('/foo');
+ done();
+ });
+
+ it('uses baseUrl option with trailing slash and uri is prefixed without a slash', function (done) {
+
+ var request = Wreck.request('get', 'foo', { baseUrl: 'http://localhost/' }, Hoek.ignore);
+
+ expect(request._headers.host).to.equal('localhost');
+ expect(request.path).to.equal('/foo');
+ done();
+ });
+
+ it('uses baseUrl option without trailing slash and uri is prefixed without a slash', function (done) {
+
+ var request = Wreck.request('get', 'foo', { baseUrl: 'http://localhost' }, Hoek.ignore);
+
+ expect(request._headers.host).to.equal('localhost');
+ expect(request.path).to.equal('/foo');
+ done();
+ });
+
+ it('uses baseUrl option when uri is an empty string', function (done) {
+
+ var request = Wreck.request('get', '', { baseUrl: 'http://localhost' }, Hoek.ignore);
+
+ expect(request._headers.host).to.equal('localhost');
+ expect(request.path).to.equal('/');
+ done();
+ });
+
+ it('uses baseUrl option with a path', function (done) {
+
+ var request = Wreck.request('get', '/bar', { baseUrl: 'http://localhost/foo' }, Hoek.ignore);
+
+ expect(request._headers.host).to.equal('localhost');
+ expect(request.path).to.equal('/foo/bar');
+ done();
+ });
+
+ it('uses baseUrl option with a path and removes extra slashes', function (done) {
+
+ var request = Wreck.request('get', '/bar', { baseUrl: 'http://localhost/foo/' }, Hoek.ignore);
+
+ expect(request._headers.host).to.equal('localhost');
+ expect(request.path).to.equal('/foo/bar');
+ done();
+ });
+
+ it('uses baseUrl option with a url that has a querystring', function (done) {
+
+ var request = Wreck.request('get', '/bar?test=hello', { baseUrl: 'http://localhost/foo' }, Hoek.ignore);
+
+ expect(request._headers.host).to.equal('localhost');
+ expect(request.path).to.equal('/foo/bar?test=hello');
+ done();
+ });
+});
+
+describe('read()', function () {
+
+ it('handles errors with a boom response', function (done) {
+
+ var res = new Events.EventEmitter();
+ res.pipe = function () { };
+
+ Wreck.read(res, null, function (err) {
+
+ expect(err.isBoom).to.equal(true);
+ done();
+ });
+
+ res.emit('error', new Error('my error'));
+ });
+
+ it('handles responses that close early', function (done) {
+
+ var res = new Events.EventEmitter();
+ res.pipe = function () { };
+
+ Wreck.read(res, null, function (err) {
+
+ expect(err.isBoom).to.equal(true);
+ done();
+ });
+
+ res.emit('close');
+ });
+
+ it('times out when stream read takes too long', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.write(payload);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, { timeout: 100 }, function (err, body) {
+
+ expect(err).to.exist();
+ expect(err.output.statusCode).to.equal(408);
+ expect(body).to.not.exist();
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('errors when stream is too big', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.write(payload);
+ res.end(payload);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err, res) {
+
+ expect(err).to.not.exist();
+ Wreck.read(res, { maxBytes: 120 }, function (err, body) {
+
+ expect(err).to.exist();
+ expect(err.output.statusCode).to.equal(400);
+ expect(body).to.not.exist();
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('reads a file streamed via HTTP', function (done) {
+
+ var path = Path.join(__dirname, '../images/wreck.png');
+ var stats = Fs.statSync(path);
+ var fileStream = Fs.createReadStream(path);
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ fileStream.pipe(res);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err, res) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+
+ Wreck.read(res, null, function (err, body) {
+
+ expect(body.length).to.equal(stats.size);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('reads a multiple buffers response', function (done) {
+
+ var path = Path.join(__dirname, '../images/wreck.png');
+ var stats = Fs.statSync(path);
+ var file = Fs.readFileSync(path);
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.write(file);
+ setTimeout(function () {
+
+ res.write(file);
+ res.end();
+ }, 100);
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('get', 'http://localhost:' + server.address().port, {}, function (err, res) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+
+ Wreck.read(res, null, function (err, body) {
+
+ expect(body.length).to.equal(stats.size * 2);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('writes a file streamed via HTTP', function (done) {
+
+ var path = Path.join(__dirname, '../images/wreck.png');
+ var stats = Fs.statSync(path);
+ var fileStream = Fs.createReadStream(path);
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+
+ Wreck.read(req, null, function (err, body) {
+
+ res.end(body);
+ });
+ });
+
+ server.listen(0, function () {
+
+ Wreck.request('post', 'http://localhost:' + server.address().port, { payload: fileStream }, function (err, res) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+
+ Wreck.read(res, null, function (err, body) {
+
+ expect(body.length).to.equal(stats.size);
+ server.close();
+ done();
+ });
+ });
+ });
+ });
+
+ it('handles responses with no headers', function (done) {
+
+ var res = Wreck.toReadableStream(payload);
+ Wreck.read(res, { json: true }, function (err) {
+
+ expect(err).to.equal(null);
+ done();
+ });
+ });
+});
+
+describe('parseCacheControl()', function () {
+
+ it('parses valid header', function (done) {
+
+ var header = Wreck.parseCacheControl('must-revalidate, max-age=3600');
+ expect(header).to.exist();
+ expect(header['must-revalidate']).to.equal(true);
+ expect(header['max-age']).to.equal(3600);
+ done();
+ });
+
+ it('parses valid header with quoted string', function (done) {
+
+ var header = Wreck.parseCacheControl('must-revalidate, max-age="3600"');
+ expect(header).to.exist();
+ expect(header['must-revalidate']).to.equal(true);
+ expect(header['max-age']).to.equal(3600);
+ done();
+ });
+
+ it('errors on invalid header', function (done) {
+
+ var header = Wreck.parseCacheControl('must-revalidate, b =3600');
+ expect(header).to.not.exist();
+ done();
+ });
+
+ it('errors on invalid max-age', function (done) {
+
+ var header = Wreck.parseCacheControl('must-revalidate, max-age=a3600');
+ expect(header).to.not.exist();
+ done();
+ });
+});
+
+describe('Shortcut', function () {
+
+ it('get request', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ Wreck.get('http://localhost:' + server.address().port, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.equal('ok');
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('post request', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ Wreck.post('http://localhost:' + server.address().port, { payload: '123' }, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.equal('ok');
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('put request', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ Wreck.put('http://localhost:' + server.address().port, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.equal('ok');
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('delete request', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ Wreck.delete('http://localhost:' + server.address().port, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.equal('ok');
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('errors on bad request', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ server.close();
+
+ Wreck.get('http://localhost:' + port, function (err, res, payload) {
+
+ expect(err).to.exist();
+ done();
+ });
+ });
+ });
+});
+
+describe('json', function () {
+
+ it('json requested and received', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ foo: 'bar' }));
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: true
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.not.equal(null);
+ expect(payload.foo).to.exist();
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('json-based type requested and received', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'application/vnd.api+json' });
+ res.end(JSON.stringify({ foo: 'bar' }));
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: true
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.not.equal(null);
+ expect(payload.foo).to.exist();
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('json requested but not received - flag is ignored', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: true
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.not.equal(null);
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('invalid json received', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: true
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.exist();
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('json not requested but received as string', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ foo: 'bar' }));
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: false
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.not.equal(null);
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('should not be parsed on empty buffer', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(204, { 'Content-Type': 'application/json' });
+ res.end();
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: 'SMART'
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(204);
+ expect(payload).to.equal(null);
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('will try to parse json in "force" mode, regardless of the header', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end(JSON.stringify({ foo: 'bar' }));
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: 'force'
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.not.equal(null);
+ expect(payload).to.deep.equal({
+ foo: 'bar'
+ });
+ server.close();
+ done();
+ });
+ });
+ });
+
+ it('will error on invalid json received in "force" mode', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end('ok');
+ });
+
+ server.listen(0, function () {
+
+ var port = server.address().port;
+ var options = {
+ json: 'force'
+ };
+
+ Wreck.get('http://localhost:' + port, options, function (err, res, payload) {
+
+ expect(err).to.exist();
+ server.close();
+ done();
+ });
+ });
+ });
+});
+
+describe('toReadableStream()', function () {
+
+ it('handle empty payload', function (done) {
+
+ var stream = Wreck.toReadableStream();
+ expect(stream instanceof Stream).to.be.true();
+ var read = stream.read(); // Make sure read has no problems
+ expect(read).to.be.null();
+ done();
+ });
+
+ it('handle explicit encoding', function (done) {
+
+ var data = 'Hello';
+ var buf = new Buffer(data, 'ascii');
+ var stream = Wreck.toReadableStream(data, 'ascii');
+ expect(stream instanceof Stream).to.be.true();
+ var read = stream.read();
+ expect(read.toString()).to.equal(data);
+ done();
+ });
+
+ it('chunks to requested size', function (done) {
+
+ var buf;
+ var data = new Array(101).join('0123456789');
+ var stream = Wreck.toReadableStream(data);
+
+ buf = stream.read(100);
+ expect(buf.length).to.equal(100);
+
+ buf = stream.read(400);
+ expect(buf.length).to.equal(400);
+
+ buf = stream.read();
+ expect(buf.length).to.equal(500);
+
+ buf = stream.read();
+ expect(buf).to.equal(null);
+
+ done();
+ });
+});
+
+describe('Events', function () {
+
+ it('emits response event when wreck is finished', function (done) {
+
+ var server = Http.createServer(function (req, res) {
+
+ res.writeHead(200);
+ res.end('ok');
+ });
+
+ Wreck.once('response', function (err, req, res, start, uri) {
+
+ expect(err).to.not.exist();
+ expect(req).to.exist();
+ expect(res).to.exist();
+ expect(typeof start).to.equal('number');
+ expect(uri.href).to.equal('http://localhost:' + server.address().port + '/');
+ done();
+ });
+
+
+ server.listen(0, function () {
+
+ Wreck.put('http://localhost:' + server.address().port, function (err, res, payload) {
+
+ expect(err).to.not.exist();
+ expect(res.statusCode).to.equal(200);
+ expect(payload).to.equal('ok');
+ server.close();
+ });
+ });
+ });
+
+ it('response event includes error when it occurs', { timeout: 2500 }, function (done) {
+
+ Wreck.once('response', function (err, req, res) {
+
+ expect(err).to.exist();
+ expect(req).to.exist();
+ expect(res).to.not.exist();
+ done();
+ });
+
+ Wreck.get('http://0', function (err) {
+
+ expect(err).to.exist();
+ });
+
+ });
+
+ it('multiple requests execute the same response handler', { timeout: 5000 }, function (done) {
+
+ var count = 0;
+ var handler = function (err, req, res) {
+
+ expect(err).to.exist();
+ expect(req).to.exist();
+ expect(res).to.not.exist();
+ count++;
+ };
+
+ Wreck.on('response', handler);
+
+ Wreck.get('http://0', function (err) {
+
+ expect(err).to.exist();
+
+ Wreck.get('http://0', function (err) {
+
+ expect(err).to.exist();
+ expect(count).to.equal(2);
+ Wreck.removeListener('response', handler);
+ done();
+ });
+ });
+ });
+
+ it('rejects attempts to use defaults without an options hash', function (done) {
+
+ var fn = function () {
+
+ Wreck.defaults();
+ };
+
+ expect(fn).to.throw();
+ done();
+ });
+
+ it('respects defaults without bleeding across instances', function (done) {
+
+ var req;
+
+ var optionsA = { headers: { foo: 123 } };
+ var optionsB = { headers: { bar: 321 } };
+
+ var wreckA = Wreck.defaults(optionsA);
+ var wreckB = Wreck.defaults(optionsB);
+ var wreckAB = wreckA.defaults(optionsB);
+
+ // var agent = new Http.Agent();
+ // expect(Object.keys(agent.sockets).length).to.equal(0);
+
+ req = wreckA.request('get', 'http://localhost/', { headers: { banana: 911 } }, function (err, res) {
+
+ expect(req._headers.banana).to.exist();
+ expect(req._headers.foo).to.exist();
+ expect(req._headers.bar).to.not.exist();
+
+ req = wreckB.request('get', 'http://localhost/', { headers: { banana: 911 } }, function (err, res) {
+
+ expect(req._headers.banana).to.exist();
+ expect(req._headers.foo).to.not.exist();
+ expect(req._headers.bar).to.exist();
+
+ req = wreckAB.request('get', 'http://localhost/', { headers: { banana: 911 } }, function (err, res) {
+
+ expect(req._headers.banana).to.exist();
+ expect(req._headers.foo).to.exist();
+ expect(req._headers.bar).to.exist();
+
+ done();
+ });
+ });
+ });
+ });
+});
[38/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
deleted file mode 100755
index 3261ae8..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
+++ /dev/null
@@ -1,2425 +0,0 @@
-// Load modules
-
-var Fs = require('fs');
-var Path = require('path');
-var Code = require('code');
-var Hoek = require('../lib');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-var nestedObj = {
- v: [7, 8, 9],
- w: /^something$/igm,
- x: {
- a: [1, 2, 3],
- b: 123456,
- c: new Date(),
- d: /hi/igm,
- e: /hello/
- },
- y: 'y',
- z: new Date(1378775452757)
-};
-
-var dupsArray = [nestedObj, { z: 'z' }, nestedObj];
-var reducedDupsArray = [nestedObj, { z: 'z' }];
-
-describe('clone()', function () {
-
- it('clones a nested object', function (done) {
-
- var a = nestedObj;
- var b = Hoek.clone(a);
-
- expect(a).to.deep.equal(b);
- expect(a.z.getTime()).to.equal(b.z.getTime());
- done();
- });
-
- it('clones a null object', function (done) {
-
- var b = Hoek.clone(null);
-
- expect(b).to.equal(null);
- done();
- });
-
- it('should not convert undefined properties to null', function (done) {
-
- var obj = { something: undefined };
- var b = Hoek.clone(obj);
-
- expect(typeof b.something).to.equal('undefined');
- done();
- });
-
- it('should not throw on circular reference', function (done) {
-
- var a = {};
- a.x = a;
-
- var test = function () {
-
- var b = Hoek.clone(a);
- };
-
- expect(test).to.not.throw();
- done();
- });
-
- it('clones circular reference', function (done) {
-
- var x = {
- 'z': new Date()
- };
- x.y = x;
-
- var b = Hoek.clone(x);
- expect(Object.keys(b.y)).to.deep.equal(Object.keys(x));
- expect(b.z).to.not.equal(x.z);
- expect(b.y).to.not.equal(x.y);
- expect(b.y.z).to.not.equal(x.y.z);
- expect(b.y).to.equal(b);
- expect(b.y.y.y.y).to.equal(b);
- done();
- });
-
- it('clones an object with a null prototype', function (done) {
-
- var obj = Object.create(null);
- var b = Hoek.clone(obj);
-
- expect(b).to.deep.equal(obj);
- done();
- });
-
- it('clones deeply nested object', function (done) {
-
- var a = {
- x: {
- y: {
- a: [1, 2, 3],
- b: 123456,
- c: new Date(),
- d: /hi/igm,
- e: /hello/
- }
- }
- };
-
- var b = Hoek.clone(a);
-
- expect(a).to.deep.equal(b);
- expect(a.x.y.c.getTime()).to.equal(b.x.y.c.getTime());
- done();
- });
-
- it('clones arrays', function (done) {
-
- var a = [1, 2, 3];
-
- var b = Hoek.clone(a);
-
- expect(a).to.deep.equal(b);
- done();
- });
-
- it('performs actual copy for shallow keys (no pass by reference)', function (done) {
-
- var x = Hoek.clone(nestedObj);
- var y = Hoek.clone(nestedObj);
-
- // Date
- expect(x.z).to.not.equal(nestedObj.z);
- expect(x.z).to.not.equal(y.z);
-
- // Regex
- expect(x.w).to.not.equal(nestedObj.w);
- expect(x.w).to.not.equal(y.w);
-
- // Array
- expect(x.v).to.not.equal(nestedObj.v);
- expect(x.v).to.not.equal(y.v);
-
- // Immutable(s)
- x.y = 5;
- expect(x.y).to.not.equal(nestedObj.y);
- expect(x.y).to.not.equal(y.y);
-
- done();
- });
-
- it('performs actual copy for deep keys (no pass by reference)', function (done) {
-
- var x = Hoek.clone(nestedObj);
- var y = Hoek.clone(nestedObj);
-
- expect(x.x.c).to.not.equal(nestedObj.x.c);
- expect(x.x.c).to.not.equal(y.x.c);
-
- expect(x.x.c.getTime()).to.equal(nestedObj.x.c.getTime());
- expect(x.x.c.getTime()).to.equal(y.x.c.getTime());
- done();
- });
-
- it('copies functions with properties', function (done) {
-
- var a = {
- x: function () {
-
- return 1;
- },
- y: {}
- };
- a.x.z = 'string in function';
- a.x.v = function () {
-
- return 2;
- };
- a.y.u = a.x;
-
- var b = Hoek.clone(a);
- expect(b.x()).to.equal(1);
- expect(b.x.v()).to.equal(2);
- expect(b.y.u).to.equal(b.x);
- expect(b.x.z).to.equal('string in function');
- done();
- });
-
- it('should copy a buffer', function (done) {
-
- var tls = {
- key: new Buffer([1, 2, 3, 4, 5]),
- cert: new Buffer([1, 2, 3, 4, 5, 6, 10])
- };
-
- var copiedTls = Hoek.clone(tls);
- expect(Buffer.isBuffer(copiedTls.key)).to.equal(true);
- expect(JSON.stringify(copiedTls.key)).to.equal(JSON.stringify(tls.key));
- expect(Buffer.isBuffer(copiedTls.cert)).to.equal(true);
- expect(JSON.stringify(copiedTls.cert)).to.equal(JSON.stringify(tls.cert));
- done();
- });
-
- it('clones an object with a prototype', function (done) {
-
- var Obj = function () {
-
- this.a = 5;
- };
-
- Obj.prototype.b = function () {
-
- return 'c';
- };
-
- var a = new Obj();
- var b = Hoek.clone(a);
-
- expect(b.a).to.equal(5);
- expect(b.b()).to.equal('c');
- expect(a).to.deep.equal(b);
- done();
- });
-
- it('reuses cloned Date object', function (done) {
-
- var obj = {
- a: new Date()
- };
-
- obj.b = obj.a;
-
- var copy = Hoek.clone(obj);
- expect(copy.a).to.equal(copy.b);
- done();
- });
-
- it('shallow copies an object with a prototype and isImmutable flag', function (done) {
-
- var Obj = function () {
-
- this.value = 5;
- };
-
- Obj.prototype.b = function () {
-
- return 'c';
- };
-
- Obj.prototype.isImmutable = true;
-
- var obj = {
- a: new Obj()
- };
-
- var copy = Hoek.clone(obj);
-
- expect(obj.a.value).to.equal(5);
- expect(copy.a.value).to.equal(5);
- expect(copy.a.b()).to.equal('c');
- expect(obj.a).to.equal(copy.a);
- done();
- });
-
- it('clones an object with property getter without executing it', function (done) {
-
- var obj = {};
- var value = 1;
- var execCount = 0;
-
- Object.defineProperty(obj, 'test', {
- enumerable: true,
- configurable: true,
- get: function () {
-
- ++execCount;
- return value;
- }
- });
-
- var copy = Hoek.clone(obj);
- expect(execCount).to.equal(0);
- expect(copy.test).to.equal(1);
- expect(execCount).to.equal(1);
- done();
- });
-
- it('clones an object with property getter and setter', function (done) {
-
- var obj = {
- _test: 0
- };
-
- Object.defineProperty(obj, 'test', {
- enumerable: true,
- configurable: true,
- get: function () {
-
- return this._test;
- },
- set: function (value) {
-
- this._test = value - 1;
- }
- });
-
- var copy = Hoek.clone(obj);
- expect(copy.test).to.equal(0);
- copy.test = 5;
- expect(copy.test).to.equal(4);
- done();
- });
-
- it('clones an object with only property setter', function (done) {
-
- var obj = {
- _test: 0
- };
-
- Object.defineProperty(obj, 'test', {
- enumerable: true,
- configurable: true,
- set: function (value) {
-
- this._test = value - 1;
- }
- });
-
- var copy = Hoek.clone(obj);
- expect(copy._test).to.equal(0);
- copy.test = 5;
- expect(copy._test).to.equal(4);
- done();
- });
-
- it('clones an object with non-enumerable properties', function (done) {
-
- var obj = {
- _test: 0
- };
-
- Object.defineProperty(obj, 'test', {
- enumerable: false,
- configurable: true,
- set: function (value) {
-
- this._test = value - 1;
- }
- });
-
- var copy = Hoek.clone(obj);
- expect(copy._test).to.equal(0);
- copy.test = 5;
- expect(copy._test).to.equal(4);
- done();
- });
-});
-
-describe('merge()', function () {
-
- it('deep copies source items', function (done) {
-
- var target = {
- b: 3,
- d: []
- };
-
- var source = {
- c: {
- d: 1
- },
- d: [{ e: 1 }]
- };
-
- Hoek.merge(target, source);
- expect(target.c).to.not.equal(source.c);
- expect(target.c).to.deep.equal(source.c);
- expect(target.d).to.not.equal(source.d);
- expect(target.d[0]).to.not.equal(source.d[0]);
- expect(target.d).to.deep.equal(source.d);
- done();
- });
-
- it('merges array over an object', function (done) {
-
- var a = {
- x: ['n', 'm']
- };
-
- var b = {
- x: {
- n: '1',
- m: '2'
- }
- };
-
- Hoek.merge(b, a);
- expect(a.x[0]).to.equal('n');
- expect(a.x.n).to.not.exist();
- done();
- });
-
- it('merges object over an array', function (done) {
-
- var a = {
- x: ['n', 'm']
- };
-
- var b = {
- x: {
- n: '1',
- m: '2'
- }
- };
-
- Hoek.merge(a, b);
- expect(a.x.n).to.equal('1');
- expect(a.x[0]).to.not.exist();
- done();
- });
-
- it('does not throw if source is null', function (done) {
-
- var a = {};
- var b = null;
- var c = null;
-
- expect(function () {
-
- c = Hoek.merge(a, b);
- }).to.not.throw();
-
- expect(c).to.equal(a);
- done();
- });
-
- it('does not throw if source is undefined', function (done) {
-
- var a = {};
- var b;
- var c = null;
-
- expect(function () {
-
- c = Hoek.merge(a, b);
- }).to.not.throw();
-
- expect(c).to.equal(a);
- done();
- });
-
- it('throws if source is not an object', function (done) {
-
- expect(function () {
-
- var a = {};
- var b = 0;
-
- Hoek.merge(a, b);
- }).to.throw('Invalid source value: must be null, undefined, or an object');
- done();
- });
-
- it('throws if target is not an object', function (done) {
-
- expect(function () {
-
- var a = 0;
- var b = {};
-
- Hoek.merge(a, b);
- }).to.throw('Invalid target value: must be an object');
- done();
- });
-
- it('throws if target is not an array and source is', function (done) {
-
- expect(function () {
-
- var a = {};
- var b = [1, 2];
-
- Hoek.merge(a, b);
- }).to.throw('Cannot merge array onto an object');
- done();
- });
-
- it('returns the same object when merging arrays', function (done) {
-
- var a = [];
- var b = [1, 2];
-
- expect(Hoek.merge(a, b)).to.equal(a);
- done();
- });
-
- it('combines an empty object with a non-empty object', function (done) {
-
- var a = {};
- var b = nestedObj;
-
- var c = Hoek.merge(a, b);
- expect(a).to.deep.equal(b);
- expect(c).to.deep.equal(b);
- done();
- });
-
- it('overrides values in target', function (done) {
-
- var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
- var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
-
- var c = Hoek.merge(a, b);
- expect(c.x).to.equal(null);
- expect(c.y).to.equal(2);
- expect(c.z).to.equal(4);
- expect(c.v).to.equal(0);
- expect(c.m).to.equal('123');
- expect(c.t).to.deep.equal({ u: 6 });
- done();
- });
-
- it('overrides values in target (flip)', function (done) {
-
- var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
- var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
-
- var d = Hoek.merge(b, a);
- expect(d.x).to.equal(1);
- expect(d.y).to.equal(2);
- expect(d.z).to.equal(3);
- expect(d.v).to.equal(5);
- expect(d.m).to.equal('abc');
- expect(d.t).to.deep.equal('test');
- done();
- });
-
- it('retains Date properties', function (done) {
-
- var a = { x: new Date(1378776452757) };
-
- var b = Hoek.merge({}, a);
- expect(a.x.getTime()).to.equal(b.x.getTime());
- done();
- });
-
- it('retains Date properties when merging keys', function (done) {
-
- var a = { x: new Date(1378776452757) };
-
- var b = Hoek.merge({ x: {} }, a);
- expect(a.x.getTime()).to.equal(b.x.getTime());
- done();
- });
-
- it('overrides Buffer', function (done) {
-
- var a = { x: new Buffer('abc') };
-
- var b = Hoek.merge({ x: {} }, a);
- expect(a.x.toString()).to.equal('abc');
- done();
- });
-});
-
-describe('applyToDefaults()', function () {
-
- var defaults = {
- a: 1,
- b: 2,
- c: {
- d: 3,
- e: [5, 6]
- },
- f: 6,
- g: 'test'
- };
-
- it('throws when target is null', function (done) {
-
- expect(function () {
-
- Hoek.applyToDefaults(null, {});
- }).to.throw('Invalid defaults value: must be an object');
- done();
- });
-
- it('returns null if options is false', function (done) {
-
- var result = Hoek.applyToDefaults(defaults, false);
- expect(result).to.equal(null);
- done();
- });
-
- it('returns null if options is null', function (done) {
-
- var result = Hoek.applyToDefaults(defaults, null);
- expect(result).to.equal(null);
- done();
- });
-
- it('returns null if options is undefined', function (done) {
-
- var result = Hoek.applyToDefaults(defaults, undefined);
- expect(result).to.equal(null);
- done();
- });
-
- it('returns a copy of defaults if options is true', function (done) {
-
- var result = Hoek.applyToDefaults(defaults, true);
- expect(result).to.deep.equal(defaults);
- done();
- });
-
- it('applies object to defaults', function (done) {
-
- var obj = {
- a: null,
- c: {
- e: [4]
- },
- f: 0,
- g: {
- h: 5
- }
- };
-
- var result = Hoek.applyToDefaults(defaults, obj);
- expect(result.c.e).to.deep.equal([4]);
- expect(result.a).to.equal(1);
- expect(result.b).to.equal(2);
- expect(result.f).to.equal(0);
- expect(result.g).to.deep.equal({ h: 5 });
- done();
- });
-
- it('applies object to defaults with null', function (done) {
-
- var obj = {
- a: null,
- c: {
- e: [4]
- },
- f: 0,
- g: {
- h: 5
- }
- };
-
- var result = Hoek.applyToDefaults(defaults, obj, true);
- expect(result.c.e).to.deep.equal([4]);
- expect(result.a).to.equal(null);
- expect(result.b).to.equal(2);
- expect(result.f).to.equal(0);
- expect(result.g).to.deep.equal({ h: 5 });
- done();
- });
-});
-
-describe('cloneWithShallow()', function () {
-
- it('deep clones except for listed keys', function (done) {
-
- var source = {
- a: {
- b: 5
- },
- c: {
- d: 6
- }
- };
-
- var copy = Hoek.cloneWithShallow(source, ['c']);
- expect(copy).to.deep.equal(source);
- expect(copy).to.not.equal(source);
- expect(copy.a).to.not.equal(source.a);
- expect(copy.b).to.equal(source.b);
- done();
- });
-
- it('returns immutable value', function (done) {
-
- expect(Hoek.cloneWithShallow(5)).to.equal(5);
- done();
- });
-
- it('returns null value', function (done) {
-
- expect(Hoek.cloneWithShallow(null)).to.equal(null);
- done();
- });
-
- it('returns undefined value', function (done) {
-
- expect(Hoek.cloneWithShallow(undefined)).to.equal(undefined);
- done();
- });
-
- it('deep clones except for listed keys (including missing keys)', function (done) {
-
- var source = {
- a: {
- b: 5
- },
- c: {
- d: 6
- }
- };
-
- var copy = Hoek.cloneWithShallow(source, ['c', 'v']);
- expect(copy).to.deep.equal(source);
- expect(copy).to.not.equal(source);
- expect(copy.a).to.not.equal(source.a);
- expect(copy.b).to.equal(source.b);
- done();
- });
-});
-
-describe('applyToDefaultsWithShallow()', function () {
-
- it('shallow copies the listed keys from options without merging', function (done) {
-
- var defaults = {
- a: {
- b: 5,
- e: 3
- },
- c: {
- d: 7,
- g: 1
- }
- };
-
- var options = {
- a: {
- b: 4
- },
- c: {
- d: 6,
- f: 7
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['a']);
- expect(merged).to.deep.equal({ a: { b: 4 }, c: { d: 6, g: 1, f: 7 } });
- expect(merged.a).to.equal(options.a);
- expect(merged.a).to.not.equal(defaults.a);
- expect(merged.c).to.not.equal(options.c);
- expect(merged.c).to.not.equal(defaults.c);
- done();
- });
-
- it('shallow copies the nested keys (override)', function (done) {
-
- var defaults = {
- a: {
- b: 5
- },
- c: {
- d: 7,
- g: 1
- }
- };
-
- var options = {
- a: {
- b: 4
- },
- c: {
- d: 6,
- g: {
- h: 8
- }
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
- expect(merged).to.deep.equal({ a: { b: 4 }, c: { d: 6, g: { h: 8 } } });
- expect(merged.c.g).to.equal(options.c.g);
- done();
- });
-
- it('shallow copies the nested keys (missing)', function (done) {
-
- var defaults = {
- a: {
- b: 5
- }
- };
-
- var options = {
- a: {
- b: 4
- },
- c: {
- g: {
- h: 8
- }
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
- expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
- expect(merged.c.g).to.equal(options.c.g);
- done();
- });
-
- it('shallow copies the nested keys (override)', function (done) {
-
- var defaults = {
- a: {
- b: 5
- },
- c: {
- g: {
- d: 7
- }
- }
- };
-
- var options = {
- a: {
- b: 4
- },
- c: {
- g: {
- h: 8
- }
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
- expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
- expect(merged.c.g).to.equal(options.c.g);
- done();
- });
-
- it('shallow copies the nested keys (deeper)', function (done) {
-
- var defaults = {
- a: {
- b: 5
- }
- };
-
- var options = {
- a: {
- b: 4
- },
- c: {
- g: {
- r: {
- h: 8
- }
- }
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g.r']);
- expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
- expect(merged.c.g.r).to.equal(options.c.g.r);
- done();
- });
-
- it('shallow copies the nested keys (not present)', function (done) {
-
- var defaults = {
- a: {
- b: 5
- }
- };
-
- var options = {
- a: {
- b: 4
- },
- c: {
- g: {
- r: {
- h: 8
- }
- }
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['x.y']);
- expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
- done();
- });
-
- it('shallow copies the listed keys in the defaults', function (done) {
-
- var defaults = {
- a: {
- b: 1
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, {}, ['a']);
- expect(merged.a).to.equal(defaults.a);
- done();
- });
-
- it('shallow copies the listed keys in the defaults (true)', function (done) {
-
- var defaults = {
- a: {
- b: 1
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, true, ['a']);
- expect(merged.a).to.equal(defaults.a);
- done();
- });
-
- it('returns null on false', function (done) {
-
- var defaults = {
- a: {
- b: 1
- }
- };
-
- var merged = Hoek.applyToDefaultsWithShallow(defaults, false, ['a']);
- expect(merged).to.equal(null);
- done();
- });
-
- it('throws on missing defaults', function (done) {
-
- expect(function () {
-
- Hoek.applyToDefaultsWithShallow(null, {}, ['a']);
- }).to.throw('Invalid defaults value: must be an object');
- done();
- });
-
- it('throws on invalid defaults', function (done) {
-
- expect(function () {
-
- Hoek.applyToDefaultsWithShallow('abc', {}, ['a']);
- }).to.throw('Invalid defaults value: must be an object');
- done();
- });
-
- it('throws on invalid options', function (done) {
-
- expect(function () {
-
- Hoek.applyToDefaultsWithShallow({}, 'abc', ['a']);
- }).to.throw('Invalid options value: must be true, falsy or an object');
- done();
- });
-
- it('throws on missing keys', function (done) {
-
- expect(function () {
-
- Hoek.applyToDefaultsWithShallow({}, true);
- }).to.throw('Invalid keys');
- done();
- });
-
- it('throws on invalid keys', function (done) {
-
- expect(function () {
-
- Hoek.applyToDefaultsWithShallow({}, true, 'a');
- }).to.throw('Invalid keys');
- done();
- });
-});
-
-describe('deepEqual()', function () {
-
- it('compares simple values', function (done) {
-
- expect(Hoek.deepEqual('x', 'x')).to.be.true();
- expect(Hoek.deepEqual('x', 'y')).to.be.false();
- expect(Hoek.deepEqual('x1', 'x')).to.be.false();
- expect(Hoek.deepEqual(-0, +0)).to.be.false();
- expect(Hoek.deepEqual(-0, -0)).to.be.true();
- expect(Hoek.deepEqual(+0, +0)).to.be.true();
- expect(Hoek.deepEqual(+0, -0)).to.be.false();
- expect(Hoek.deepEqual(1, 1)).to.be.true();
- expect(Hoek.deepEqual(0, 0)).to.be.true();
- expect(Hoek.deepEqual(-1, 1)).to.be.false();
- expect(Hoek.deepEqual(NaN, 0)).to.be.false();
- expect(Hoek.deepEqual(NaN, NaN)).to.be.true();
- done();
- });
-
- it('compares different types', function (done) {
-
- expect(Hoek.deepEqual([], 5)).to.be.false();
- expect(Hoek.deepEqual(5, [])).to.be.false();
- expect(Hoek.deepEqual({}, null)).to.be.false();
- expect(Hoek.deepEqual(null, {})).to.be.false();
- expect(Hoek.deepEqual('abc', {})).to.be.false();
- expect(Hoek.deepEqual({}, 'abc')).to.be.false();
- done();
- });
-
- it('compares empty structures', function (done) {
-
- expect(Hoek.deepEqual([], [])).to.be.true();
- expect(Hoek.deepEqual({}, {})).to.be.true();
- expect(Hoek.deepEqual([], {})).to.be.false();
- done();
- });
-
- it('compares empty arguments object', function (done) {
-
- var compare = function () {
-
- expect(Hoek.deepEqual([], arguments)).to.be.false();
- };
-
- compare();
- done();
- });
-
- it('compares empty arguments objects', function (done) {
-
- var compare = function () {
-
- var arg1 = arguments;
-
- var inner = function () {
-
- expect(Hoek.deepEqual(arg1, arguments)).to.be.false(); // callee is not the same
- };
-
- inner();
- };
-
- compare();
- done();
- });
-
- it('compares dates', function (done) {
-
- expect(Hoek.deepEqual(new Date(2015, 1, 1), new Date(2015, 1, 1))).to.be.true();
- expect(Hoek.deepEqual(new Date(100), new Date(101))).to.be.false();
- expect(Hoek.deepEqual(new Date(), {})).to.be.false();
- done();
- });
-
- it('compares regular expressions', function (done) {
-
- expect(Hoek.deepEqual(/\s/, new RegExp('\\\s'))).to.be.true();
- expect(Hoek.deepEqual(/\s/g, /\s/g)).to.be.true();
- expect(Hoek.deepEqual(/a/, {})).to.be.false();
- expect(Hoek.deepEqual(/\s/g, /\s/i)).to.be.false();
- expect(Hoek.deepEqual(/a/g, /b/g)).to.be.false();
- done();
- });
-
- it('compares arrays', function (done) {
-
- expect(Hoek.deepEqual([[1]], [[1]])).to.be.true();
- expect(Hoek.deepEqual([1, 2, 3], [1, 2, 3])).to.be.true();
- expect(Hoek.deepEqual([1, 2, 3], [1, 3, 2])).to.be.false();
- expect(Hoek.deepEqual([1, 2, 3], [1, 2])).to.be.false();
- expect(Hoek.deepEqual([1], [1])).to.be.true();
- done();
- });
-
- it('compares buffers', function (done) {
-
- expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2, 3]))).to.be.true();
- expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 3, 2]))).to.be.false();
- expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2]))).to.be.false();
- expect(Hoek.deepEqual(new Buffer([1, 2, 3]), {})).to.be.false();
- expect(Hoek.deepEqual(new Buffer([1, 2, 3]), [1, 2, 3])).to.be.false();
- done();
- });
-
- it('compares objects', function (done) {
-
- expect(Hoek.deepEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 })).to.be.true();
- expect(Hoek.deepEqual({ foo: 'bar' }, { foo: 'baz' })).to.be.false();
- expect(Hoek.deepEqual({ foo: { bar: 'foo' } }, { foo: { bar: 'baz' } })).to.be.false();
- done();
- });
-
- it('handles circular dependency', function (done) {
-
- var a = {};
- a.x = a;
-
- var b = Hoek.clone(a);
- expect(Hoek.deepEqual(a, b)).to.be.true();
- done();
- });
-
- it('compares an object with property getter without executing it', function (done) {
-
- var obj = {};
- var value = 1;
- var execCount = 0;
-
- Object.defineProperty(obj, 'test', {
- enumerable: true,
- configurable: true,
- get: function () {
-
- ++execCount;
- return value;
- }
- });
-
- var copy = Hoek.clone(obj);
- expect(Hoek.deepEqual(obj, copy)).to.be.true();
- expect(execCount).to.equal(0);
- expect(copy.test).to.equal(1);
- expect(execCount).to.equal(1);
- done();
- });
-
- it('compares objects with property getters', function (done) {
-
- var obj = {};
- Object.defineProperty(obj, 'test', {
- enumerable: true,
- configurable: true,
- get: function () {
-
- return 1;
- }
- });
-
- var ref = {};
- Object.defineProperty(ref, 'test', {
- enumerable: true,
- configurable: true,
- get: function () {
-
- return 2;
- }
- });
-
- expect(Hoek.deepEqual(obj, ref)).to.be.false();
- done();
- });
-
- it('compares object prototypes', function (done) {
-
- var Obj = function () {
-
- this.a = 5;
- };
-
- Obj.prototype.b = function () {
-
- return this.a;
- };
-
- var Ref = function () {
-
- this.a = 5;
- };
-
- Ref.prototype.b = function () {
-
- return this.a;
- };
-
- expect(Hoek.deepEqual(new Obj(), new Ref())).to.be.false();
- expect(Hoek.deepEqual(new Obj(), new Obj())).to.be.true();
- expect(Hoek.deepEqual(new Ref(), new Ref())).to.be.true();
- done();
- });
-
- it('compares plain objects', function (done) {
-
- var a = Object.create(null);
- var b = Object.create(null);
-
- a.b = 'c';
- b.b = 'c';
-
- expect(Hoek.deepEqual(a, b)).to.be.true();
- expect(Hoek.deepEqual(a, { b: 'c' })).to.be.false();
- done();
- });
-
- it('compares an object with an empty object', function (done) {
-
- var a = { a: 1, b: 2 };
-
- expect(Hoek.deepEqual({}, a)).to.be.false();
- expect(Hoek.deepEqual(a, {})).to.be.false();
- done();
- });
-
- it('compares an object ignoring the prototype', function (done) {
-
- var a = Object.create(null);
- var b = {};
-
- expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
- done();
- });
-
- it('compares an object ignoring the prototype recursively', function (done) {
-
- var a = [Object.create(null)];
- var b = [{}];
-
- expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
- done();
- });
-});
-
-describe('unique()', function () {
-
- it('ensures uniqueness within array of objects based on subkey', function (done) {
-
- var a = Hoek.unique(dupsArray, 'x');
- expect(a).to.deep.equal(reducedDupsArray);
- done();
- });
-
- it('removes duplicated without key', function (done) {
-
- expect(Hoek.unique([1, 2, 3, 4, 2, 1, 5])).to.deep.equal([1, 2, 3, 4, 5]);
- done();
- });
-});
-
-describe('mapToObject()', function () {
-
- it('returns null on null array', function (done) {
-
- var a = Hoek.mapToObject(null);
- expect(a).to.equal(null);
- done();
- });
-
- it('converts basic array to existential object', function (done) {
-
- var keys = [1, 2, 3, 4];
- var a = Hoek.mapToObject(keys);
- for (var i in keys) {
- expect(a[keys[i]]).to.equal(true);
- }
- done();
- });
-
- it('converts array of objects to existential object', function (done) {
-
- var keys = [{ x: 1 }, { x: 2 }, { x: 3 }, { y: 4 }];
- var subkey = 'x';
- var a = Hoek.mapToObject(keys, subkey);
- expect(a).to.deep.equal({ 1: true, 2: true, 3: true });
- done();
- });
-});
-
-describe('intersect()', function () {
-
- it('returns the common objects of two arrays', function (done) {
-
- var array1 = [1, 2, 3, 4, 4, 5, 5];
- var array2 = [5, 4, 5, 6, 7];
- var common = Hoek.intersect(array1, array2);
- expect(common.length).to.equal(2);
- done();
- });
-
- it('returns just the first common object of two arrays', function (done) {
-
- var array1 = [1, 2, 3, 4, 4, 5, 5];
- var array2 = [5, 4, 5, 6, 7];
- var common = Hoek.intersect(array1, array2, true);
- expect(common).to.equal(5);
- done();
- });
-
- it('returns null when no common and returning just the first common object of two arrays', function (done) {
-
- var array1 = [1, 2, 3, 4, 4, 5, 5];
- var array2 = [6, 7];
- var common = Hoek.intersect(array1, array2, true);
- expect(common).to.equal(null);
- done();
- });
-
- it('returns an empty array if either input is null', function (done) {
-
- expect(Hoek.intersect([1], null).length).to.equal(0);
- expect(Hoek.intersect(null, [1]).length).to.equal(0);
- done();
- });
-
- it('returns the common objects of object and array', function (done) {
-
- var array1 = [1, 2, 3, 4, 4, 5, 5];
- var array2 = [5, 4, 5, 6, 7];
- var common = Hoek.intersect(Hoek.mapToObject(array1), array2);
- expect(common.length).to.equal(2);
- done();
- });
-});
-
-describe('contain()', function () {
-
- it('tests strings', function (done) {
-
- expect(Hoek.contain('abc', 'ab')).to.be.true();
- expect(Hoek.contain('abc', 'abc', { only: true })).to.be.true();
- expect(Hoek.contain('aaa', 'a', { only: true })).to.be.true();
- expect(Hoek.contain('abc', 'b', { once: true })).to.be.true();
- expect(Hoek.contain('abc', ['a', 'c'])).to.be.true();
- expect(Hoek.contain('abc', ['a', 'd'], { part: true })).to.be.true();
-
- expect(Hoek.contain('abc', 'ac')).to.be.false();
- expect(Hoek.contain('abcd', 'abc', { only: true })).to.be.false();
- expect(Hoek.contain('aab', 'a', { only: true })).to.be.false();
- expect(Hoek.contain('abb', 'b', { once: true })).to.be.false();
- expect(Hoek.contain('abc', ['a', 'd'])).to.be.false();
- expect(Hoek.contain('abc', ['ab', 'bc'])).to.be.false(); // Overlapping values not supported
- done();
- });
-
- it('tests arrays', function (done) {
-
- expect(Hoek.contain([1, 2, 3], 1)).to.be.true();
- expect(Hoek.contain([{ a: 1 }], { a: 1 }, { deep: true })).to.be.true();
- expect(Hoek.contain([1, 2, 3], [1, 2])).to.be.true();
- expect(Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true })).to.be.true();
- expect(Hoek.contain([1, 1, 2], [1, 2], { only: true })).to.be.true();
- expect(Hoek.contain([1, 2], [1, 2], { once: true })).to.be.true();
- expect(Hoek.contain([1, 2, 3], [1, 4], { part: true })).to.be.true();
- expect(Hoek.contain([[1], [2]], [[1]], { deep: true })).to.be.true();
-
- expect(Hoek.contain([1, 2, 3], 4)).to.be.false();
- expect(Hoek.contain([{ a: 1 }], { a: 2 }, { deep: true })).to.be.false();
- expect(Hoek.contain([{ a: 1 }], { a: 1 })).to.be.false();
- expect(Hoek.contain([1, 2, 3], [4, 5])).to.be.false();
- expect(Hoek.contain([[3], [2]], [[1]])).to.be.false();
- expect(Hoek.contain([[1], [2]], [[1]])).to.be.false();
- expect(Hoek.contain([{ a: 1 }], [{ a: 2 }], { deep: true })).to.be.false();
- expect(Hoek.contain([1, 3, 2], [1, 2], { only: true })).to.be.false();
- expect(Hoek.contain([1, 2, 2], [1, 2], { once: true })).to.be.false();
- expect(Hoek.contain([0, 2, 3], [1, 4], { part: true })).to.be.false();
- done();
- });
-
- it('tests objects', function (done) {
-
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'a')).to.be.true();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'c'])).to.be.true();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'b', 'c'], { only: true })).to.be.true();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1 })).to.be.true();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, c: 3 })).to.be.true();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true })).to.be.true();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }, { only: true })).to.be.true();
- expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] }, { deep: true })).to.be.true();
- expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true })).to.be.true();
- expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: true })).to.be.true();
- expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: false })).to.be.false();
- expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: true })).to.be.false();
- expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: false })).to.be.true();
-
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'd')).to.be.false();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'd'])).to.be.false();
- expect(Hoek.contain({ a: 1, b: 2, c: 3, d: 4 }, ['a', 'b', 'c'], { only: true })).to.be.false();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 2 })).to.be.false();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 2, b: 2 }, { part: true })).to.be.false(); // part does not ignore bad value
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 3 })).to.be.false();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 })).to.be.false();
- expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 }, { only: true })).to.be.false();
- expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] })).to.be.false();
- expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } })).to.be.false();
- expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true })).to.be.true();
- expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: true })).to.be.false();
- expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: false })).to.be.true();
- expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: true })).to.be.true();
- expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: false })).to.be.false();
-
- // Getter check
- var Foo = function (bar) {
-
- this.bar = bar;
- };
-
- Object.defineProperty(Foo.prototype, 'baz', {
- enumerable: true,
- get: function () {
-
- return this.bar;
- }
- });
-
- expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true })).to.be.true();
- expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true, part: true })).to.be.true();
- expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true })).to.be.true();
- expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, only: true })).to.be.false();
- expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: false })).to.be.false();
- expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: true })).to.be.true();
-
- done();
- });
-});
-
-describe('flatten()', function () {
-
- it('returns a flat array', function (done) {
-
- var result = Hoek.flatten([1, 2, [3, 4, [5, 6], [7], 8], [9], [10, [11, 12]], 13]);
- expect(result.length).to.equal(13);
- expect(result).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
- done();
- });
-});
-
-describe('reach()', function () {
-
- var obj = {
- a: {
- b: {
- c: {
- d: 1,
- e: 2
- },
- f: 'hello'
- },
- g: {
- h: 3
- }
- },
- i: function () { },
- j: null,
- k: [4, 8, 9, 1]
- };
-
- obj.i.x = 5;
-
- it('returns first value of array', function (done) {
-
- expect(Hoek.reach(obj, 'k.0')).to.equal(4);
- done();
- });
-
- it('returns last value of array using negative index', function (done) {
-
- expect(Hoek.reach(obj, 'k.-2')).to.equal(9);
- done();
- });
-
- it('returns a valid member', function (done) {
-
- expect(Hoek.reach(obj, 'a.b.c.d')).to.equal(1);
- done();
- });
-
- it('returns a valid member with separator override', function (done) {
-
- expect(Hoek.reach(obj, 'a/b/c/d', '/')).to.equal(1);
- done();
- });
-
- it('returns undefined on null object', function (done) {
-
- expect(Hoek.reach(null, 'a.b.c.d')).to.equal(undefined);
- done();
- });
-
- it('returns undefined on missing object member', function (done) {
-
- expect(Hoek.reach(obj, 'a.b.c.d.x')).to.equal(undefined);
- done();
- });
-
- it('returns undefined on missing function member', function (done) {
-
- expect(Hoek.reach(obj, 'i.y', { functions: true })).to.equal(undefined);
- done();
- });
-
- it('throws on missing member in strict mode', function (done) {
-
- expect(function () {
-
- Hoek.reach(obj, 'a.b.c.o.x', { strict: true });
- }).to.throw('Missing segment o in reach path a.b.c.o.x');
-
- done();
- });
-
- it('returns undefined on invalid member', function (done) {
-
- expect(Hoek.reach(obj, 'a.b.c.d-.x')).to.equal(undefined);
- done();
- });
-
- it('returns function member', function (done) {
-
- expect(typeof Hoek.reach(obj, 'i')).to.equal('function');
- done();
- });
-
- it('returns function property', function (done) {
-
- expect(Hoek.reach(obj, 'i.x')).to.equal(5);
- done();
- });
-
- it('returns null', function (done) {
-
- expect(Hoek.reach(obj, 'j')).to.equal(null);
- done();
- });
-
- it('throws on function property when functions not allowed', function (done) {
-
- expect(function () {
-
- Hoek.reach(obj, 'i.x', { functions: false });
- }).to.throw('Invalid segment x in reach path i.x');
-
- done();
- });
-
- it('will return a default value if property is not found', function (done) {
-
- expect(Hoek.reach(obj, 'a.b.q', { default: 'defaultValue' })).to.equal('defaultValue');
- done();
- });
-
- it('will return a default value if path is not found', function (done) {
-
- expect(Hoek.reach(obj, 'q', { default: 'defaultValue' })).to.equal('defaultValue');
- done();
- });
-
- it('allows a falsey value to be used as the default value', function (done) {
-
- expect(Hoek.reach(obj, 'q', { default: '' })).to.equal('');
- done();
- });
-});
-
-describe('reachTemplate()', function () {
-
- it('applies object to template', function (done) {
-
- var obj = {
- a: {
- b: {
- c: {
- d: 1
- }
- }
- },
- j: null,
- k: [4, 8, 9, 1]
- };
-
- var template = '{k.0}:{k.-2}:{a.b.c.d}:{x.y}:{j}';
-
- expect(Hoek.reachTemplate(obj, template)).to.equal('4:9:1::');
- done();
- });
-
- it('applies object to template (options)', function (done) {
-
- var obj = {
- a: {
- b: {
- c: {
- d: 1
- }
- }
- },
- j: null,
- k: [4, 8, 9, 1]
- };
-
- var template = '{k/0}:{k/-2}:{a/b/c/d}:{x/y}:{j}';
-
- expect(Hoek.reachTemplate(obj, template, '/')).to.equal('4:9:1::');
- done();
- });
-});
-
-describe('callStack()', function () {
-
- it('returns the full call stack', function (done) {
-
- var stack = Hoek.callStack();
- expect(stack[0][0]).to.contain('index.js');
- expect(stack[0][2]).to.equal(26);
- done();
- });
-});
-
-describe('displayStack ()', function () {
-
- it('returns the full call stack for display', function (done) {
-
- var stack = Hoek.displayStack();
- expect(stack[0]).to.contain(Path.normalize('/test/index.js') + ':');
- done();
- });
-
- it('includes constructor functions correctly', function (done) {
-
- var Something = function (next) {
-
- next();
- };
-
- var something = new Something(function () {
-
- var stack = Hoek.displayStack();
- expect(stack[1]).to.contain('new Something');
- done();
- });
- });
-});
-
-describe('abort()', function () {
-
- it('exits process when not in test mode', function (done) {
-
- var env = process.env.NODE_ENV;
- var write = process.stdout.write;
- var exit = process.exit;
-
- process.env.NODE_ENV = 'nottatest';
- process.stdout.write = function () { };
- process.exit = function (state) {
-
- process.exit = exit;
- process.env.NODE_ENV = env;
- process.stdout.write = write;
-
- expect(state).to.equal(1);
- done();
- };
-
- Hoek.abort('Boom');
- });
-
- it('throws when not in test mode and abortThrow is true', function (done) {
-
- var env = process.env.NODE_ENV;
- process.env.NODE_ENV = 'nottatest';
- Hoek.abortThrow = true;
-
- var fn = function () {
-
- Hoek.abort('my error message');
- };
-
- expect(fn).to.throw('my error message');
- Hoek.abortThrow = false;
- process.env.NODE_ENV = env;
-
- done();
- });
-
- it('respects hideStack argument', function (done) {
-
- var env = process.env.NODE_ENV;
- var write = process.stdout.write;
- var exit = process.exit;
- var output = '';
-
- process.exit = function () { };
- process.env.NODE_ENV = '';
- process.stdout.write = function (message) {
-
- output = message;
- };
-
- Hoek.abort('my error message', true);
-
- process.env.NODE_ENV = env;
- process.stdout.write = write;
- process.exit = exit;
-
- expect(output).to.equal('ABORT: my error message\n\t\n');
-
- done();
- });
-
- it('throws in test mode', function (done) {
-
- var env = process.env.NODE_ENV;
- process.env.NODE_ENV = 'test';
-
- expect(function () {
-
- Hoek.abort('my error message', true);
- }).to.throw('my error message');
-
- process.env.NODE_ENV = env;
- done();
- });
-
- it('throws in test mode with default message', function (done) {
-
- var env = process.env.NODE_ENV;
- process.env.NODE_ENV = 'test';
-
- expect(function () {
-
- Hoek.abort('', true);
- }).to.throw('Unknown error');
-
- process.env.NODE_ENV = env;
- done();
- });
-
- it('defaults to showing stack', function (done) {
-
- var env = process.env.NODE_ENV;
- var write = process.stdout.write;
- var exit = process.exit;
- var output = '';
-
- process.exit = function () { };
- process.env.NODE_ENV = '';
- process.stdout.write = function (message) {
-
- output = message;
- };
-
- Hoek.abort('my error message');
-
- process.env.NODE_ENV = env;
- process.stdout.write = write;
- process.exit = exit;
-
- expect(output).to.contain('index.js');
-
- done();
- });
-});
-
-describe('assert()', function () {
-
- it('throws an Error when using assert in a test', function (done) {
-
- var fn = function () {
-
- Hoek.assert(false, 'my error message');
- };
-
- expect(fn).to.throw('my error message');
- done();
- });
-
- it('throws an Error when using assert in a test with no message', function (done) {
-
- var fn = function () {
-
- Hoek.assert(false);
- };
-
- expect(fn).to.throw('Unknown error');
- done();
- });
-
- it('throws an Error when using assert in a test with multipart message', function (done) {
-
- var fn = function () {
-
- Hoek.assert(false, 'This', 'is', 'my message');
- };
-
- expect(fn).to.throw('This is my message');
- done();
- });
-
- it('throws an Error when using assert in a test with multipart message (empty)', function (done) {
-
- var fn = function () {
-
- Hoek.assert(false, 'This', 'is', '', 'my message');
- };
-
- expect(fn).to.throw('This is my message');
- done();
- });
-
- it('throws an Error when using assert in a test with object message', function (done) {
-
- var fn = function () {
-
- Hoek.assert(false, 'This', 'is', { spinal: 'tap' });
- };
-
- expect(fn).to.throw('This is {"spinal":"tap"}');
- done();
- });
-
- it('throws an Error when using assert in a test with multipart string and error messages', function (done) {
-
- var fn = function () {
-
- Hoek.assert(false, 'This', 'is', new Error('spinal'), new Error('tap'));
- };
-
- expect(fn).to.throw('This is spinal tap');
- done();
- });
-
- it('throws an Error when using assert in a test with error object message', function (done) {
-
- var fn = function () {
-
- Hoek.assert(false, new Error('This is spinal tap'));
- };
-
- expect(fn).to.throw('This is spinal tap');
- done();
- });
-
- it('throws the same Error that is passed to it if there is only one error passed', function (done) {
-
- var error = new Error('ruh roh');
- var error2 = new Error('ruh roh');
-
- var fn = function () {
-
- Hoek.assert(false, error);
- };
-
- try {
- fn();
- } catch (err) {
- expect(error).to.equal(error); // should be the same reference
- expect(error).to.not.equal(error2); // error with the same message should not match
- }
-
- done();
- });
-});
-
-describe('Timer', function () {
-
- it('returns time elapsed', function (done) {
-
- var timer = new Hoek.Timer();
- setTimeout(function () {
-
- expect(timer.elapsed()).to.be.above(9);
- done();
- }, 12);
- });
-});
-
-describe('Bench', function () {
-
- it('returns time elapsed', function (done) {
-
- var timer = new Hoek.Bench();
- setTimeout(function () {
-
- expect(timer.elapsed()).to.be.above(9);
- done();
- }, 12);
- });
-});
-
-describe('escapeRegex()', function () {
-
- it('escapes all special regular expression characters', function (done) {
-
- var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,');
- expect(a).to.equal('4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s\\,');
- done();
- });
-});
-
-describe('Base64Url', function () {
-
- var base64str = 'AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w';
- var str = unescape('%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF');
-
- describe('base64urlEncode()', function () {
-
- it('should base64 URL-safe a string', function (done) {
-
- expect(Hoek.base64urlEncode(str)).to.equal(base64str);
- done();
- });
-
- it('encodes a buffer', function (done) {
-
- expect(Hoek.base64urlEncode(new Buffer(str, 'binary'))).to.equal(base64str);
- done();
- });
-
- it('should base64 URL-safe a hex string', function (done) {
-
- var buffer = new Buffer(str, 'binary');
- expect(Hoek.base64urlEncode(buffer.toString('hex'), 'hex')).to.equal(base64str);
- done();
- });
-
- it('works on larger input strings', function (done) {
-
- var input = Fs.readFileSync(Path.join(__dirname, 'index.js')).toString();
- var encoded = Hoek.base64urlEncode(input);
-
- expect(encoded).to.not.contain('+');
- expect(encoded).to.not.contain('/');
-
- var decoded = Hoek.base64urlDecode(encoded);
-
- expect(decoded).to.equal(input);
- done();
- });
- });
-
- describe('base64urlDecode()', function () {
-
- it('should un-base64 URL-safe a string', function (done) {
-
- expect(Hoek.base64urlDecode(base64str)).to.equal(str);
- done();
- });
-
- it('should un-base64 URL-safe a string into hex', function (done) {
-
- expect(Hoek.base64urlDecode(base64str, 'hex')).to.equal(new Buffer(str, 'binary').toString('hex'));
- done();
- });
-
- it('should un-base64 URL-safe a string and return a buffer', function (done) {
-
- var buf = Hoek.base64urlDecode(base64str, 'buffer');
- expect(buf instanceof Buffer).to.equal(true);
- expect(buf.toString('binary')).to.equal(str);
- done();
- });
-
- it('returns error on undefined input', function (done) {
-
- expect(Hoek.base64urlDecode().message).to.exist();
- done();
- });
-
- it('returns error on invalid input', function (done) {
-
- expect(Hoek.base64urlDecode('*').message).to.exist();
- done();
- });
- });
-});
-
-describe('escapeHeaderAttribute()', function () {
-
- it('should not alter ascii values', function (done) {
-
- var a = Hoek.escapeHeaderAttribute('My Value');
- expect(a).to.equal('My Value');
- done();
- });
-
- it('escapes all special HTTP header attribute characters', function (done) {
-
- var a = Hoek.escapeHeaderAttribute('I said go!!!#"' + String.fromCharCode(92));
- expect(a).to.equal('I said go!!!#\\"\\\\');
- done();
- });
-
- it('throws on large unicode characters', function (done) {
-
- var fn = function () {
-
- Hoek.escapeHeaderAttribute('this is a test' + String.fromCharCode(500) + String.fromCharCode(300));
- };
-
- expect(fn).to.throw(Error);
- done();
- });
-
- it('throws on CRLF to prevent response splitting', function (done) {
-
- var fn = function () {
-
- Hoek.escapeHeaderAttribute('this is a test\r\n');
- };
-
- expect(fn).to.throw(Error);
- done();
- });
-});
-
-describe('escapeHtml()', function () {
-
- it('escapes all special HTML characters', function (done) {
-
- var a = Hoek.escapeHtml('&<>"\'`');
- expect(a).to.equal('&<>"'`');
- done();
- });
-
- it('returns empty string on falsy input', function (done) {
-
- var a = Hoek.escapeHtml('');
- expect(a).to.equal('');
- done();
- });
-
- it('returns unchanged string on no reserved input', function (done) {
-
- var a = Hoek.escapeHtml('abc');
- expect(a).to.equal('abc');
- done();
- });
-});
-
-describe('nextTick()', function () {
-
- it('calls the provided callback on nextTick', function (done) {
-
- var a = 0;
-
- var inc = function (step, next) {
-
- a += step;
- next();
- };
-
- var ticked = Hoek.nextTick(inc);
-
- ticked(5, function () {
-
- expect(a).to.equal(6);
- done();
- });
-
- expect(a).to.equal(0);
- inc(1, function () {
-
- expect(a).to.equal(1);
- });
- });
-});
-
-describe('once()', function () {
-
- it('allows function to only execute once', function (done) {
-
- var gen = 0;
- var add = function (x) {
-
- gen += x;
- };
-
- add(5);
- expect(gen).to.equal(5);
- add = Hoek.once(add);
- add(5);
- expect(gen).to.equal(10);
- add(5);
- expect(gen).to.equal(10);
- done();
- });
-
- it('double once wraps one time', function (done) {
-
- var method = function () { };
- method = Hoek.once(method);
- method.x = 1;
- method = Hoek.once(method);
- expect(method.x).to.equal(1);
- done();
- });
-});
-
-describe('isAbsoltePath()', function () {
-
- it('identifies if path is absolute on Unix without node support', { parallel: false }, function (done) {
-
- var orig = Path.isAbsolute;
- Path.isAbsolute = undefined;
-
- expect(Hoek.isAbsolutePath('')).to.equal(false);
- expect(Hoek.isAbsolutePath('a')).to.equal(false);
- expect(Hoek.isAbsolutePath('./a')).to.equal(false);
- expect(Hoek.isAbsolutePath('/a')).to.equal(true);
- expect(Hoek.isAbsolutePath('/')).to.equal(true);
-
- Path.isAbsolute = orig;
-
- done();
- });
-
- it('identifies if path is absolute with fake node support', { parallel: false }, function (done) {
-
- var orig = Path.isAbsolute;
- Path.isAbsolute = function (path) {
-
- return path[0] === '/';
- };
-
- expect(Hoek.isAbsolutePath('', 'linux')).to.equal(false);
- expect(Hoek.isAbsolutePath('a', 'linux')).to.equal(false);
- expect(Hoek.isAbsolutePath('./a', 'linux')).to.equal(false);
- expect(Hoek.isAbsolutePath('/a', 'linux')).to.equal(true);
- expect(Hoek.isAbsolutePath('/', 'linux')).to.equal(true);
-
- Path.isAbsolute = orig;
-
- done();
- });
-
- it('identifies if path is absolute on Windows without node support', { parallel: false }, function (done) {
-
- var orig = Path.isAbsolute;
- Path.isAbsolute = undefined;
-
- expect(Hoek.isAbsolutePath('//server/file', 'win32')).to.equal(true);
- expect(Hoek.isAbsolutePath('//server/file', 'win32')).to.equal(true);
- expect(Hoek.isAbsolutePath('\\\\server\\file', 'win32')).to.equal(true);
- expect(Hoek.isAbsolutePath('C:/Users/', 'win32')).to.equal(true);
- expect(Hoek.isAbsolutePath('C:\\Users\\', 'win32')).to.equal(true);
- expect(Hoek.isAbsolutePath('C:cwd/another', 'win32')).to.equal(false);
- expect(Hoek.isAbsolutePath('C:cwd\\another', 'win32')).to.equal(false);
- expect(Hoek.isAbsolutePath('directory/directory', 'win32')).to.equal(false);
- expect(Hoek.isAbsolutePath('directory\\directory', 'win32')).to.equal(false);
-
- Path.isAbsolute = orig;
-
- done();
- });
-});
-
-describe('isInteger()', function () {
-
- it('validates integers', function (done) {
-
- expect(Hoek.isInteger(0)).to.equal(true);
- expect(Hoek.isInteger(1)).to.equal(true);
- expect(Hoek.isInteger(1394035612500)).to.equal(true);
- expect(Hoek.isInteger('0')).to.equal(false);
- expect(Hoek.isInteger(1.0)).to.equal(true);
- expect(Hoek.isInteger(1.1)).to.equal(false);
- done();
- });
-});
-
-describe('ignore()', function () {
-
- it('exists', function (done) {
-
- expect(Hoek.ignore).to.exist();
- expect(typeof Hoek.ignore).to.equal('function');
- done();
- });
-});
-
-describe('inherits()', function () {
-
- it('exists', function (done) {
-
- expect(Hoek.inherits).to.exist();
- expect(typeof Hoek.inherits).to.equal('function');
- done();
- });
-});
-
-describe('format()', function () {
-
- it('exists', function (done) {
-
- expect(Hoek.format).to.exist();
- expect(typeof Hoek.format).to.equal('function');
- done();
- });
-
- it('is a reference to Util.format', function (done) {
-
- expect(Hoek.format('hello %s', 'world')).to.equal('hello world');
- done();
- });
-});
-
-describe('transform()', function () {
-
- var source = {
- address: {
- one: '123 main street',
- two: 'PO Box 1234'
- },
- zip: {
- code: 3321232,
- province: null
- },
- title: 'Warehouse',
- state: 'CA'
- };
-
- it('transforms an object based on the input object', function (done) {
-
- var result = Hoek.transform(source, {
- 'person.address.lineOne': 'address.one',
- 'person.address.lineTwo': 'address.two',
- 'title': 'title',
- 'person.address.region': 'state',
- 'person.address.zip': 'zip.code',
- 'person.address.location': 'zip.province'
- });
-
- expect(result).to.deep.equal({
- person: {
- address: {
- lineOne: '123 main street',
- lineTwo: 'PO Box 1234',
- region: 'CA',
- zip: 3321232,
- location: null
- }
- },
- title: 'Warehouse'
- });
-
- done();
- });
-
- it('uses the reach options passed into it', function (done) {
-
- var schema = {
- 'person.address.lineOne': 'address-one',
- 'person.address.lineTwo': 'address-two',
- 'title': 'title',
- 'person.address.region': 'state',
- 'person.prefix': 'person-title',
- 'person.zip': 'zip-code'
- };
- var options = {
- separator: '-',
- default: 'unknown'
- };
- var result = Hoek.transform(source, schema, options);
-
- expect(result).to.deep.equal({
- person: {
- address: {
- lineOne: '123 main street',
- lineTwo: 'PO Box 1234',
- region: 'CA'
- },
- prefix: 'unknown',
- zip: 3321232
- },
- title: 'Warehouse'
- });
-
- done();
- });
-
- it('works to create shallow objects', function (done) {
-
- var result = Hoek.transform(source, {
- lineOne: 'address.one',
- lineTwo: 'address.two',
- title: 'title',
- region: 'state',
- province: 'zip.province'
- });
-
- expect(result).to.deep.equal({
- lineOne: '123 main street',
- lineTwo: 'PO Box 1234',
- title: 'Warehouse',
- region: 'CA',
- province: null
- });
-
- done();
- });
-
- it('only allows strings in the map', function (done) {
-
- expect(function () {
-
- var result = Hoek.transform(source, {
- lineOne: {}
- });
- }).to.throw('All mappings must be "." delineated strings');
-
- done();
- });
-
- it('throws an error on invalid arguments', function (done) {
-
- expect(function () {
-
- var result = Hoek.transform(NaN, {});
- }).to.throw('Invalid source object: must be null, undefined, or an object');
-
- done();
- });
-
- it('is safe to pass null', function (done) {
-
- var result = Hoek.transform(null, {});
- expect(result).to.deep.equal({});
-
- done();
- });
-
- it('is safe to pass undefined', function (done) {
-
- var result = Hoek.transform(undefined, {});
- expect(result).to.deep.equal({});
-
- done();
- });
-});
-
-describe('uniqueFilename()', function () {
-
- it('generates a random file path', function (done) {
-
- var result = Hoek.uniqueFilename('./test/modules');
-
- expect(result).to.exist();
- expect(result).to.be.a.string();
- expect(result).to.contain('test/modules');
- done();
- });
-
- it('is random enough to use in fast loops', function (done) {
-
- var results = [];
-
- for (var i = 0; i < 10; ++i) {
- results[i] = Hoek.uniqueFilename('./test/modules');
- }
-
- var filter = results.filter(function (item, index, array) {
-
- return array.indexOf(item) === index;
- });
-
- expect(filter.length).to.equal(10);
- expect(results.length).to.equal(10);
- done();
-
- });
-
- it('combines the random elements with a supplied character', function (done) {
-
- var result = Hoek.uniqueFilename('./test', 'txt');
-
- expect(result).to.contain('test/');
- expect(result).to.contain('.txt');
-
- done();
- });
-
- it('accepts extensions with a "." in it', function (done) {
-
- var result = Hoek.uniqueFilename('./test', '.mp3');
-
- expect(result).to.contain('test/');
- expect(result).to.contain('.mp3');
-
- done();
- });
-});
-
-describe('stringify()', function (done) {
-
- it('converts object to string', function (done) {
-
- var obj = { a: 1 };
- expect(Hoek.stringify(obj)).to.equal('{"a":1}');
- done();
- });
-
- it('returns error in result string', function (done) {
-
- var obj = { a: 1 };
- obj.b = obj;
- expect(Hoek.stringify(obj)).to.equal('[Cannot display object: Converting circular structure to JSON]');
- done();
- });
-});
-
-describe('shallow()', function (done) {
-
- it('shallow copies an object', function (done) {
-
- var obj = {
- a: 5,
- b: {
- c: 6
- }
- };
-
- var shallow = Hoek.shallow(obj);
- expect(shallow).to.not.equal(obj);
- expect(shallow).to.deep.equal(obj);
- expect(shallow.b).to.equal(obj.b);
- done();
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/ignore.txt
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/ignore.txt b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/ignore.txt
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js
deleted file mode 100755
index fa4e06a..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.x = 1;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js
deleted file mode 100755
index 88e9166..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.y = 2;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js
deleted file mode 100755
index 670e724..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js
+++ /dev/null
@@ -1 +0,0 @@
-exports.z = 3;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore b/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore
deleted file mode 100644
index 77ba16c..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore
+++ /dev/null
@@ -1,18 +0,0 @@
-.idea
-*.iml
-npm-debug.log
-dump.rdb
-node_modules
-results.tap
-results.xml
-npm-shrinkwrap.json
-config.json
-.DS_Store
-*/.DS_Store
-*/*/.DS_Store
-._*
-*/._*
-*/*/._*
-coverage.*
-lib-cov
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml
deleted file mode 100755
index 047f7e3..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-
-node_js:
- - 0.10
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE b/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE
deleted file mode 100755
index b0d8774..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2012-2014, Eran Hammer and other contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * The names of any contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- * * *
-
-The complete list of contributors can be found at: https://github.com/hueniverse/sntp/graphs/contributors
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile b/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile
deleted file mode 100755
index 417fd93..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-test:
- @node node_modules/lab/bin/lab
-test-cov:
- @node node_modules/lab/bin/lab -t 100 -m 3000
-test-cov-html:
- @node node_modules/lab/bin/lab -r html -o coverage.html
-
-.PHONY: test test-cov test-cov-html
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/README.md b/node_modules/request/node_modules/hawk/node_modules/sntp/README.md
deleted file mode 100755
index 98a6e02..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# sntp
-
-An SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time
-along with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset
-to the local time.
-
-[](http://travis-ci.org/hueniverse/sntp)
-
-# Usage
-
-```javascript
-var Sntp = require('sntp');
-
-// All options are optional
-
-var options = {
- host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org
- port: 123, // Defaults to 123 (NTP)
- resolveReference: true, // Default to false (not resolving)
- timeout: 1000 // Defaults to zero (no timeout)
-};
-
-// Request server time
-
-Sntp.time(options, function (err, time) {
-
- if (err) {
- console.log('Failed: ' + err.message);
- process.exit(1);
- }
-
- console.log('Local clock is off by: ' + time.t + ' milliseconds');
- process.exit(0);
-});
-```
-
-If an application needs to maintain continuous time synchronization, the module provides a stateful method for
-querying the current offset only when the last one is too old (defaults to daily).
-
-```javascript
-// Request offset once
-
-Sntp.offset(function (err, offset) {
-
- console.log(offset); // New (served fresh)
-
- // Request offset again
-
- Sntp.offset(function (err, offset) {
-
- console.log(offset); // Identical (served from cache)
- });
-});
-```
-
-To set a background offset refresh, start the interval and use the provided now() method. If for any reason the
-client fails to obtain an up-to-date offset, the current system clock is used.
-
-```javascript
-var before = Sntp.now(); // System time without offset
-
-Sntp.start(function () {
-
- var now = Sntp.now(); // With offset
- Sntp.stop();
-});
-```
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js b/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js
deleted file mode 100755
index 0303f6d..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var Sntp = require('../lib');
-
-// Request offset once
-
-Sntp.offset(function (err, offset) {
-
- console.log(offset); // New (served fresh)
-
- // Request offset again
-
- Sntp.offset(function (err, offset) {
-
- console.log(offset); // Identical (served from cache)
- });
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js b/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js
deleted file mode 100755
index bd70d0e..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var Sntp = require('../lib');
-
-// All options are optional
-
-var options = {
- host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org
- port: 123, // Defaults to 123 (NTP)
- resolveReference: true, // Default to false (not resolving)
- timeout: 1000 // Defaults to zero (no timeout)
-};
-
-// Request server time
-
-Sntp.time(options, function (err, time) {
-
- if (err) {
- console.log('Failed: ' + err.message);
- process.exit(1);
- }
-
- console.log(time);
- console.log('Local clock is off by: ' + time.t + ' milliseconds');
- process.exit(0);
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/index.js b/node_modules/request/node_modules/hawk/node_modules/sntp/index.js
deleted file mode 100755
index 4cc88b3..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib');
\ No newline at end of file
[34/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/lib/parser.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/parser.js b/node_modules/request/node_modules/http-signature/lib/parser.js
deleted file mode 100644
index fd9ac10..0000000
--- a/node_modules/request/node_modules/http-signature/lib/parser.js
+++ /dev/null
@@ -1,304 +0,0 @@
-// Copyright 2012 Joyent, Inc. All rights reserved.
-
-var assert = require('assert-plus');
-var util = require('util');
-
-
-
-///--- Globals
-
-var Algorithms = {
- 'rsa-sha1': true,
- 'rsa-sha256': true,
- 'rsa-sha512': true,
- 'dsa-sha1': true,
- 'hmac-sha1': true,
- 'hmac-sha256': true,
- 'hmac-sha512': true
-};
-
-var State = {
- New: 0,
- Params: 1
-};
-
-var ParamsState = {
- Name: 0,
- Quote: 1,
- Value: 2,
- Comma: 3
-};
-
-
-
-///--- Specific Errors
-
-function HttpSignatureError(message, caller) {
- if (Error.captureStackTrace)
- Error.captureStackTrace(this, caller || HttpSignatureError);
-
- this.message = message;
- this.name = caller.name;
-}
-util.inherits(HttpSignatureError, Error);
-
-function ExpiredRequestError(message) {
- HttpSignatureError.call(this, message, ExpiredRequestError);
-}
-util.inherits(ExpiredRequestError, HttpSignatureError);
-
-
-function InvalidHeaderError(message) {
- HttpSignatureError.call(this, message, InvalidHeaderError);
-}
-util.inherits(InvalidHeaderError, HttpSignatureError);
-
-
-function InvalidParamsError(message) {
- HttpSignatureError.call(this, message, InvalidParamsError);
-}
-util.inherits(InvalidParamsError, HttpSignatureError);
-
-
-function MissingHeaderError(message) {
- HttpSignatureError.call(this, message, MissingHeaderError);
-}
-util.inherits(MissingHeaderError, HttpSignatureError);
-
-
-
-///--- Exported API
-
-module.exports = {
-
- /**
- * Parses the 'Authorization' header out of an http.ServerRequest object.
- *
- * Note that this API will fully validate the Authorization header, and throw
- * on any error. It will not however check the signature, or the keyId format
- * as those are specific to your environment. You can use the options object
- * to pass in extra constraints.
- *
- * As a response object you can expect this:
- *
- * {
- * "scheme": "Signature",
- * "params": {
- * "keyId": "foo",
- * "algorithm": "rsa-sha256",
- * "headers": [
- * "date" or "x-date",
- * "content-md5"
- * ],
- * "signature": "base64"
- * },
- * "signingString": "ready to be passed to crypto.verify()"
- * }
- *
- * @param {Object} request an http.ServerRequest.
- * @param {Object} options an optional options object with:
- * - clockSkew: allowed clock skew in seconds (default 300).
- * - headers: required header names (def: date or x-date)
- * - algorithms: algorithms to support (default: all).
- * @return {Object} parsed out object (see above).
- * @throws {TypeError} on invalid input.
- * @throws {InvalidHeaderError} on an invalid Authorization header error.
- * @throws {InvalidParamsError} if the params in the scheme are invalid.
- * @throws {MissingHeaderError} if the params indicate a header not present,
- * either in the request headers from the params,
- * or not in the params from a required header
- * in options.
- * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
- */
- parseRequest: function parseRequest(request, options) {
- assert.object(request, 'request');
- assert.object(request.headers, 'request.headers');
- if (options === undefined) {
- options = {};
- }
- if (options.headers === undefined) {
- options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
- }
- assert.object(options, 'options');
- assert.arrayOfString(options.headers, 'options.headers');
- assert.optionalNumber(options.clockSkew, 'options.clockSkew');
-
- if (!request.headers.authorization)
- throw new MissingHeaderError('no authorization header present in ' +
- 'the request');
-
- options.clockSkew = options.clockSkew || 300;
-
-
- var i = 0;
- var state = State.New;
- var substate = ParamsState.Name;
- var tmpName = '';
- var tmpValue = '';
-
- var parsed = {
- scheme: '',
- params: {},
- signingString: '',
-
- get algorithm() {
- return this.params.algorithm.toUpperCase();
- },
-
- get keyId() {
- return this.params.keyId;
- }
-
- };
-
- var authz = request.headers.authorization;
- for (i = 0; i < authz.length; i++) {
- var c = authz.charAt(i);
-
- switch (Number(state)) {
-
- case State.New:
- if (c !== ' ') parsed.scheme += c;
- else state = State.Params;
- break;
-
- case State.Params:
- switch (Number(substate)) {
-
- case ParamsState.Name:
- var code = c.charCodeAt(0);
- // restricted name of A-Z / a-z
- if ((code >= 0x41 && code <= 0x5a) || // A-Z
- (code >= 0x61 && code <= 0x7a)) { // a-z
- tmpName += c;
- } else if (c === '=') {
- if (tmpName.length === 0)
- throw new InvalidHeaderError('bad param format');
- substate = ParamsState.Quote;
- } else {
- throw new InvalidHeaderError('bad param format');
- }
- break;
-
- case ParamsState.Quote:
- if (c === '"') {
- tmpValue = '';
- substate = ParamsState.Value;
- } else {
- throw new InvalidHeaderError('bad param format');
- }
- break;
-
- case ParamsState.Value:
- if (c === '"') {
- parsed.params[tmpName] = tmpValue;
- substate = ParamsState.Comma;
- } else {
- tmpValue += c;
- }
- break;
-
- case ParamsState.Comma:
- if (c === ',') {
- tmpName = '';
- substate = ParamsState.Name;
- } else {
- throw new InvalidHeaderError('bad param format');
- }
- break;
-
- default:
- throw new Error('Invalid substate');
- }
- break;
-
- default:
- throw new Error('Invalid substate');
- }
-
- }
-
- if (!parsed.params.headers || parsed.params.headers === '') {
- if (request.headers['x-date']) {
- parsed.params.headers = ['x-date'];
- } else {
- parsed.params.headers = ['date'];
- }
- } else {
- parsed.params.headers = parsed.params.headers.split(' ');
- }
-
- // Minimally validate the parsed object
- if (!parsed.scheme || parsed.scheme !== 'Signature')
- throw new InvalidHeaderError('scheme was not "Signature"');
-
- if (!parsed.params.keyId)
- throw new InvalidHeaderError('keyId was not specified');
-
- if (!parsed.params.algorithm)
- throw new InvalidHeaderError('algorithm was not specified');
-
- if (!parsed.params.signature)
- throw new InvalidHeaderError('signature was not specified');
-
- // Check the algorithm against the official list
- parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
- if (!Algorithms[parsed.params.algorithm])
- throw new InvalidParamsError(parsed.params.algorithm +
- ' is not supported');
-
- // Build the signingString
- for (i = 0; i < parsed.params.headers.length; i++) {
- var h = parsed.params.headers[i].toLowerCase();
- parsed.params.headers[i] = h;
-
- if (h !== 'request-line') {
- var value = request.headers[h];
- if (!value)
- throw new MissingHeaderError(h + ' was not in the request');
- parsed.signingString += h + ': ' + value;
- } else {
- parsed.signingString +=
- request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;
- }
-
- if ((i + 1) < parsed.params.headers.length)
- parsed.signingString += '\n';
- }
-
- // Check against the constraints
- var date;
- if (request.headers.date || request.headers['x-date']) {
- if (request.headers['x-date']) {
- date = new Date(request.headers['x-date']);
- } else {
- date = new Date(request.headers.date);
- }
- var now = new Date();
- var skew = Math.abs(now.getTime() - date.getTime());
-
- if (skew > options.clockSkew * 1000) {
- throw new ExpiredRequestError('clock skew of ' +
- (skew / 1000) +
- 's was greater than ' +
- options.clockSkew + 's');
- }
- }
-
- options.headers.forEach(function (hdr) {
- // Remember that we already checked any headers in the params
- // were in the request, so if this passes we're good.
- if (parsed.params.headers.indexOf(hdr) < 0)
- throw new MissingHeaderError(hdr + ' was not a signed header');
- });
-
- if (options.algorithms) {
- if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
- throw new InvalidParamsError(parsed.params.algorithm +
- ' is not a supported algorithm');
- }
-
- return parsed;
- }
-
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/lib/signer.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/signer.js b/node_modules/request/node_modules/http-signature/lib/signer.js
deleted file mode 100644
index 3507f4d..0000000
--- a/node_modules/request/node_modules/http-signature/lib/signer.js
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright 2012 Joyent, Inc. All rights reserved.
-
-var assert = require('assert-plus');
-var crypto = require('crypto');
-var http = require('http');
-
-var sprintf = require('util').format;
-
-
-
-///--- Globals
-
-var Algorithms = {
- 'rsa-sha1': true,
- 'rsa-sha256': true,
- 'rsa-sha512': true,
- 'dsa-sha1': true,
- 'hmac-sha1': true,
- 'hmac-sha256': true,
- 'hmac-sha512': true
-};
-
-var Authorization =
- 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
-
-
-
-///--- Specific Errors
-
-function MissingHeaderError(message) {
- this.name = 'MissingHeaderError';
- this.message = message;
- this.stack = (new Error()).stack;
-}
-MissingHeaderError.prototype = new Error();
-
-
-function InvalidAlgorithmError(message) {
- this.name = 'InvalidAlgorithmError';
- this.message = message;
- this.stack = (new Error()).stack;
-}
-InvalidAlgorithmError.prototype = new Error();
-
-
-
-///--- Internal Functions
-
-function _pad(val) {
- if (parseInt(val, 10) < 10) {
- val = '0' + val;
- }
- return val;
-}
-
-
-function _rfc1123() {
- var date = new Date();
-
- var months = ['Jan',
- 'Feb',
- 'Mar',
- 'Apr',
- 'May',
- 'Jun',
- 'Jul',
- 'Aug',
- 'Sep',
- 'Oct',
- 'Nov',
- 'Dec'];
- var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
- return days[date.getUTCDay()] + ', ' +
- _pad(date.getUTCDate()) + ' ' +
- months[date.getUTCMonth()] + ' ' +
- date.getUTCFullYear() + ' ' +
- _pad(date.getUTCHours()) + ':' +
- _pad(date.getUTCMinutes()) + ':' +
- _pad(date.getUTCSeconds()) +
- ' GMT';
-}
-
-
-
-///--- Exported API
-
-module.exports = {
-
- /**
- * Adds an 'Authorization' header to an http.ClientRequest object.
- *
- * Note that this API will add a Date header if it's not already set. Any
- * other headers in the options.headers array MUST be present, or this
- * will throw.
- *
- * You shouldn't need to check the return type; it's just there if you want
- * to be pedantic.
- *
- * @param {Object} request an instance of http.ClientRequest.
- * @param {Object} options signing parameters object:
- * - {String} keyId required.
- * - {String} key required (either a PEM or HMAC key).
- * - {Array} headers optional; defaults to ['date'].
- * - {String} algorithm optional; defaults to 'rsa-sha256'.
- * - {String} httpVersion optional; defaults to '1.1'.
- * @return {Boolean} true if Authorization (and optionally Date) were added.
- * @throws {TypeError} on bad parameter types (input).
- * @throws {InvalidAlgorithmError} if algorithm was bad.
- * @throws {MissingHeaderError} if a header to be signed was specified but
- * was not present.
- */
- signRequest: function signRequest(request, options) {
- assert.object(request, 'request');
- assert.object(options, 'options');
- assert.optionalString(options.algorithm, 'options.algorithm');
- assert.string(options.keyId, 'options.keyId');
- assert.optionalArrayOfString(options.headers, 'options.headers');
- assert.optionalString(options.httpVersion, 'options.httpVersion');
-
- if (!request.getHeader('Date'))
- request.setHeader('Date', _rfc1123());
- if (!options.headers)
- options.headers = ['date'];
- if (!options.algorithm)
- options.algorithm = 'rsa-sha256';
- if (!options.httpVersion)
- options.httpVersion = '1.1';
-
- options.algorithm = options.algorithm.toLowerCase();
-
- if (!Algorithms[options.algorithm])
- throw new InvalidAlgorithmError(options.algorithm + ' is not supported');
-
- var i;
- var stringToSign = '';
- for (i = 0; i < options.headers.length; i++) {
- if (typeof (options.headers[i]) !== 'string')
- throw new TypeError('options.headers must be an array of Strings');
-
- var h = options.headers[i].toLowerCase();
-
- if (h !== 'request-line') {
- var value = request.getHeader(h);
- if (!value) {
- throw new MissingHeaderError(h + ' was not in the request');
- }
- stringToSign += h + ': ' + value;
- } else {
- stringToSign +=
- request.method + ' ' + request.path + ' HTTP/' + options.httpVersion;
- }
-
- if ((i + 1) < options.headers.length)
- stringToSign += '\n';
- }
-
- var alg = options.algorithm.match(/(hmac|rsa)-(\w+)/);
- var signature;
- if (alg[1] === 'hmac') {
- var hmac = crypto.createHmac(alg[2].toUpperCase(), options.key);
- hmac.update(stringToSign);
- signature = hmac.digest('base64');
- } else {
- var signer = crypto.createSign(options.algorithm.toUpperCase());
- signer.update(stringToSign);
- signature = signer.sign(options.key, 'base64');
- }
-
- request.setHeader('Authorization', sprintf(Authorization,
- options.keyId,
- options.algorithm,
- options.headers.join(' '),
- signature));
-
- return true;
- }
-
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/lib/util.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/util.js b/node_modules/request/node_modules/http-signature/lib/util.js
deleted file mode 100644
index e7d915e..0000000
--- a/node_modules/request/node_modules/http-signature/lib/util.js
+++ /dev/null
@@ -1,304 +0,0 @@
-// Copyright 2012 Joyent, Inc. All rights reserved.
-
-var assert = require('assert-plus');
-var crypto = require('crypto');
-
-var asn1 = require('asn1');
-var ctype = require('ctype');
-
-
-
-///--- Helpers
-
-function readNext(buffer, offset) {
- var len = ctype.ruint32(buffer, 'big', offset);
- offset += 4;
-
- var newOffset = offset + len;
-
- return {
- data: buffer.slice(offset, newOffset),
- offset: newOffset
- };
-}
-
-
-function writeInt(writer, buffer) {
- writer.writeByte(0x02); // ASN1.Integer
- writer.writeLength(buffer.length);
-
- for (var i = 0; i < buffer.length; i++)
- writer.writeByte(buffer[i]);
-
- return writer;
-}
-
-
-function rsaToPEM(key) {
- var buffer;
- var der;
- var exponent;
- var i;
- var modulus;
- var newKey = '';
- var offset = 0;
- var type;
- var tmp;
-
- try {
- buffer = new Buffer(key.split(' ')[1], 'base64');
-
- tmp = readNext(buffer, offset);
- type = tmp.data.toString();
- offset = tmp.offset;
-
- if (type !== 'ssh-rsa')
- throw new Error('Invalid ssh key type: ' + type);
-
- tmp = readNext(buffer, offset);
- exponent = tmp.data;
- offset = tmp.offset;
-
- tmp = readNext(buffer, offset);
- modulus = tmp.data;
- } catch (e) {
- throw new Error('Invalid ssh key: ' + key);
- }
-
- // DER is a subset of BER
- der = new asn1.BerWriter();
-
- der.startSequence();
-
- der.startSequence();
- der.writeOID('1.2.840.113549.1.1.1');
- der.writeNull();
- der.endSequence();
-
- der.startSequence(0x03); // bit string
- der.writeByte(0x00);
-
- // Actual key
- der.startSequence();
- writeInt(der, modulus);
- writeInt(der, exponent);
- der.endSequence();
-
- // bit string
- der.endSequence();
-
- der.endSequence();
-
- tmp = der.buffer.toString('base64');
- for (i = 0; i < tmp.length; i++) {
- if ((i % 64) === 0)
- newKey += '\n';
- newKey += tmp.charAt(i);
- }
-
- if (!/\\n$/.test(newKey))
- newKey += '\n';
-
- return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
-}
-
-
-function dsaToPEM(key) {
- var buffer;
- var offset = 0;
- var tmp;
- var der;
- var newKey = '';
-
- var type;
- var p;
- var q;
- var g;
- var y;
-
- try {
- buffer = new Buffer(key.split(' ')[1], 'base64');
-
- tmp = readNext(buffer, offset);
- type = tmp.data.toString();
- offset = tmp.offset;
-
- /* JSSTYLED */
- if (!/^ssh-ds[as].*/.test(type))
- throw new Error('Invalid ssh key type: ' + type);
-
- tmp = readNext(buffer, offset);
- p = tmp.data;
- offset = tmp.offset;
-
- tmp = readNext(buffer, offset);
- q = tmp.data;
- offset = tmp.offset;
-
- tmp = readNext(buffer, offset);
- g = tmp.data;
- offset = tmp.offset;
-
- tmp = readNext(buffer, offset);
- y = tmp.data;
- } catch (e) {
- console.log(e.stack);
- throw new Error('Invalid ssh key: ' + key);
- }
-
- // DER is a subset of BER
- der = new asn1.BerWriter();
-
- der.startSequence();
-
- der.startSequence();
- der.writeOID('1.2.840.10040.4.1');
-
- der.startSequence();
- writeInt(der, p);
- writeInt(der, q);
- writeInt(der, g);
- der.endSequence();
-
- der.endSequence();
-
- der.startSequence(0x03); // bit string
- der.writeByte(0x00);
- writeInt(der, y);
- der.endSequence();
-
- der.endSequence();
-
- tmp = der.buffer.toString('base64');
- for (var i = 0; i < tmp.length; i++) {
- if ((i % 64) === 0)
- newKey += '\n';
- newKey += tmp.charAt(i);
- }
-
- if (!/\\n$/.test(newKey))
- newKey += '\n';
-
- return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
-}
-
-
-///--- API
-
-module.exports = {
-
- /**
- * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
- *
- * The intent of this module is to interoperate with OpenSSL only,
- * specifically the node crypto module's `verify` method.
- *
- * @param {String} key an OpenSSH public key.
- * @return {String} PEM encoded form of the RSA public key.
- * @throws {TypeError} on bad input.
- * @throws {Error} on invalid ssh key formatted data.
- */
- sshKeyToPEM: function sshKeyToPEM(key) {
- assert.string(key, 'ssh_key');
-
- /* JSSTYLED */
- if (/^ssh-rsa.*/.test(key))
- return rsaToPEM(key);
-
- /* JSSTYLED */
- if (/^ssh-ds[as].*/.test(key))
- return dsaToPEM(key);
-
- throw new Error('Only RSA and DSA public keys are allowed');
- },
-
-
- /**
- * Generates an OpenSSH fingerprint from an ssh public key.
- *
- * @param {String} key an OpenSSH public key.
- * @return {String} key fingerprint.
- * @throws {TypeError} on bad input.
- * @throws {Error} if what you passed doesn't look like an ssh public key.
- */
- fingerprint: function fingerprint(key) {
- assert.string(key, 'ssh_key');
-
- var pieces = key.split(' ');
- if (!pieces || !pieces.length || pieces.length < 2)
- throw new Error('invalid ssh key');
-
- var data = new Buffer(pieces[1], 'base64');
-
- var hash = crypto.createHash('md5');
- hash.update(data);
- var digest = hash.digest('hex');
-
- var fp = '';
- for (var i = 0; i < digest.length; i++) {
- if (i && i % 2 === 0)
- fp += ':';
-
- fp += digest[i];
- }
-
- return fp;
- },
-
- /**
- * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
- *
- * The reverse of the above function.
- */
- pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
- assert.equal('string', typeof pem, 'typeof pem');
-
- // chop off the BEGIN PUBLIC KEY and END PUBLIC KEY portion
- var cleaned = pem.split('\n').slice(1, -2).join('');
-
- var buf = new Buffer(cleaned, 'base64');
-
- var der = new asn1.BerReader(buf);
-
- der.readSequence();
- der.readSequence();
-
- var oid = der.readOID();
- assert.equal(oid, '1.2.840.113549.1.1.1', 'pem not in RSA format');
-
- // Null -- XXX this probably isn't good practice
- der.readByte();
- der.readByte();
-
- // bit string sequence
- der.readSequence(0x03);
- der.readByte();
- der.readSequence();
-
- // modulus
- assert.equal(der.peek(), asn1.Ber.Integer, 'modulus not an integer');
- der._offset = der.readLength(der.offset + 1);
- var modulus = der._buf.slice(der.offset, der.offset + der.length);
- der._offset += der.length;
-
- // exponent
- assert.equal(der.peek(), asn1.Ber.Integer, 'exponent not an integer');
- der._offset = der.readLength(der.offset + 1);
- var exponent = der._buf.slice(der.offset, der.offset + der.length);
- der._offset += der.length;
-
- // now, make the key
- var type = new Buffer('ssh-rsa');
- var buffer = new Buffer(4 + type.length + 4 + modulus.length + 4 + exponent.length);
- var i = 0;
- buffer.writeUInt32BE(type.length, i); i += 4;
- type.copy(buffer, i); i += type.length;
- buffer.writeUInt32BE(exponent.length, i); i += 4;
- exponent.copy(buffer, i); i += exponent.length;
- buffer.writeUInt32BE(modulus.length, i); i += 4;
- modulus.copy(buffer, i); i += modulus.length;
-
- var s = type.toString() + ' ' + buffer.toString('base64') + ' ' + (comment || '');
- return s;
- }
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/lib/verify.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/verify.js b/node_modules/request/node_modules/http-signature/lib/verify.js
deleted file mode 100644
index 5bf9589..0000000
--- a/node_modules/request/node_modules/http-signature/lib/verify.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2011 Joyent, Inc. All rights reserved.
-
-var assert = require('assert-plus');
-var crypto = require('crypto');
-
-
-
-///--- Exported API
-
-module.exports = {
-
- /**
- * Simply wraps up the node crypto operations for you, and returns
- * true or false. You are expected to pass in an object that was
- * returned from `parse()`.
- *
- * @param {Object} parsedSignature the object you got from `parse`.
- * @param {String} key either an RSA private key PEM or HMAC secret.
- * @return {Boolean} true if valid, false otherwise.
- * @throws {TypeError} if you pass in bad arguments.
- */
- verifySignature: function verifySignature(parsedSignature, key) {
- assert.object(parsedSignature, 'parsedSignature');
- assert.string(key, 'key');
-
- var alg = parsedSignature.algorithm.match(/(HMAC|RSA|DSA)-(\w+)/);
- if (!alg || alg.length !== 3)
- throw new TypeError('parsedSignature: unsupported algorithm ' +
- parsedSignature.algorithm);
-
- if (alg[1] === 'HMAC') {
- var hmac = crypto.createHmac(alg[2].toUpperCase(), key);
- hmac.update(parsedSignature.signingString);
- return (hmac.digest('base64') === parsedSignature.params.signature);
- } else {
- var verify = crypto.createVerify(alg[0]);
- verify.update(parsedSignature.signingString);
- return verify.verify(key, parsedSignature.params.signature, 'base64');
- }
- }
-
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore b/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore
deleted file mode 100644
index eb03e3e..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-*.log
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE b/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE
deleted file mode 100644
index 9b5dcdb..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011 Mark Cavage, All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md b/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md
deleted file mode 100644
index 7cebf7a..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.
-Currently BER encoding is supported; at some point I'll likely have to do DER.
-
-## Usage
-
-Mostly, if you're *actually* needing to read and write ASN.1, you probably don't
-need this readme to explain what and why. If you have no idea what ASN.1 is,
-see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
-
-The source is pretty much self-explanatory, and has read/write methods for the
-common types out there.
-
-### Decoding
-
-The following reads an ASN.1 sequence with a boolean.
-
- var Ber = require('asn1').Ber;
-
- var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
-
- reader.readSequence();
- console.log('Sequence len: ' + reader.length);
- if (reader.peek() === Ber.Boolean)
- console.log(reader.readBoolean());
-
-### Encoding
-
-The following generates the same payload as above.
-
- var Ber = require('asn1').Ber;
-
- var writer = new Ber.Writer();
-
- writer.startSequence();
- writer.writeBoolean(true);
- writer.endSequence();
-
- console.log(writer.buffer);
-
-## Installation
-
- npm install asn1
-
-## License
-
-MIT.
-
-## Bugs
-
-See <https://github.com/mcavage/node-asn1/issues>.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
deleted file mode 100644
index ff21d4f..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-
-module.exports = {
-
- newInvalidAsn1Error: function(msg) {
- var e = new Error();
- e.name = 'InvalidAsn1Error';
- e.message = msg || '';
- return e;
- }
-
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
deleted file mode 100644
index 4fb90ae..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-var errors = require('./errors');
-var types = require('./types');
-
-var Reader = require('./reader');
-var Writer = require('./writer');
-
-
-///--- Exports
-
-module.exports = {
-
- Reader: Reader,
-
- Writer: Writer
-
-};
-
-for (var t in types) {
- if (types.hasOwnProperty(t))
- module.exports[t] = types[t];
-}
-for (var e in errors) {
- if (errors.hasOwnProperty(e))
- module.exports[e] = errors[e];
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
deleted file mode 100644
index bd3357a..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
+++ /dev/null
@@ -1,267 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-var assert = require('assert');
-
-var ASN1 = require('./types');
-var errors = require('./errors');
-
-
-///--- Globals
-
-var newInvalidAsn1Error = errors.newInvalidAsn1Error;
-
-
-
-///--- API
-
-function Reader(data) {
- if (!data || !Buffer.isBuffer(data))
- throw new TypeError('data must be a node Buffer');
-
- this._buf = data;
- this._size = data.length;
-
- // These hold the "current" state
- this._len = 0;
- this._offset = 0;
-
- var self = this;
- this.__defineGetter__('length', function() { return self._len; });
- this.__defineGetter__('offset', function() { return self._offset; });
- this.__defineGetter__('remain', function() {
- return self._size - self._offset;
- });
- this.__defineGetter__('buffer', function() {
- return self._buf.slice(self._offset);
- });
-}
-
-
-/**
- * Reads a single byte and advances offset; you can pass in `true` to make this
- * a "peek" operation (i.e., get the byte, but don't advance the offset).
- *
- * @param {Boolean} peek true means don't move offset.
- * @return {Number} the next byte, null if not enough data.
- */
-Reader.prototype.readByte = function(peek) {
- if (this._size - this._offset < 1)
- return null;
-
- var b = this._buf[this._offset] & 0xff;
-
- if (!peek)
- this._offset += 1;
-
- return b;
-};
-
-
-Reader.prototype.peek = function() {
- return this.readByte(true);
-};
-
-
-/**
- * Reads a (potentially) variable length off the BER buffer. This call is
- * not really meant to be called directly, as callers have to manipulate
- * the internal buffer afterwards.
- *
- * As a result of this call, you can call `Reader.length`, until the
- * next thing called that does a readLength.
- *
- * @return {Number} the amount of offset to advance the buffer.
- * @throws {InvalidAsn1Error} on bad ASN.1
- */
-Reader.prototype.readLength = function(offset) {
- if (offset === undefined)
- offset = this._offset;
-
- if (offset >= this._size)
- return null;
-
- var lenB = this._buf[offset++] & 0xff;
- if (lenB === null)
- return null;
-
- if ((lenB & 0x80) == 0x80) {
- lenB &= 0x7f;
-
- if (lenB == 0)
- throw newInvalidAsn1Error('Indefinite length not supported');
-
- if (lenB > 4)
- throw newInvalidAsn1Error('encoding too long');
-
- if (this._size - offset < lenB)
- return null;
-
- this._len = 0;
- for (var i = 0; i < lenB; i++)
- this._len = (this._len << 8) + (this._buf[offset++] & 0xff);
-
- } else {
- // Wasn't a variable length
- this._len = lenB;
- }
-
- return offset;
-};
-
-
-/**
- * Parses the next sequence in this BER buffer.
- *
- * To get the length of the sequence, call `Reader.length`.
- *
- * @return {Number} the sequence's tag.
- */
-Reader.prototype.readSequence = function(tag) {
- var seq = this.peek();
- if (seq === null)
- return null;
- if (tag !== undefined && tag !== seq)
- throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
- ': got 0x' + seq.toString(16));
-
- var o = this.readLength(this._offset + 1); // stored in `length`
- if (o === null)
- return null;
-
- this._offset = o;
- return seq;
-};
-
-
-Reader.prototype.readInt = function() {
- return this._readTag(ASN1.Integer);
-};
-
-
-Reader.prototype.readBoolean = function() {
- return (this._readTag(ASN1.Boolean) === 0 ? false : true);
-};
-
-
-Reader.prototype.readEnumeration = function() {
- return this._readTag(ASN1.Enumeration);
-};
-
-
-Reader.prototype.readString = function(tag, retbuf) {
- if (!tag)
- tag = ASN1.OctetString;
-
- var b = this.peek();
- if (b === null)
- return null;
-
- if (b !== tag)
- throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
- ': got 0x' + b.toString(16));
-
- var o = this.readLength(this._offset + 1); // stored in `length`
-
- if (o === null)
- return null;
-
- if (this.length > this._size - o)
- return null;
-
- this._offset = o;
-
- if (this.length === 0)
- return '';
-
- var str = this._buf.slice(this._offset, this._offset + this.length);
- this._offset += this.length;
-
- return retbuf ? str : str.toString('utf8');
-};
-
-Reader.prototype.readOID = function(tag) {
- if (!tag)
- tag = ASN1.OID;
-
- var b = this.peek();
- if (b === null)
- return null;
-
- if (b !== tag)
- throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
- ': got 0x' + b.toString(16));
-
- var o = this.readLength(this._offset + 1); // stored in `length`
- if (o === null)
- return null;
-
- if (this.length > this._size - o)
- return null;
-
- this._offset = o;
-
- var values = [];
- var value = 0;
-
- for (var i = 0; i < this.length; i++) {
- var byte = this._buf[this._offset++] & 0xff;
-
- value <<= 7;
- value += byte & 0x7f;
- if ((byte & 0x80) == 0) {
- values.push(value);
- value = 0;
- }
- }
-
- value = values.shift();
- values.unshift(value % 40);
- values.unshift((value / 40) >> 0);
-
- return values.join('.');
-};
-
-
-Reader.prototype._readTag = function(tag) {
- assert.ok(tag !== undefined);
-
- var b = this.peek();
-
- if (b === null)
- return null;
-
- if (b !== tag)
- throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
- ': got 0x' + b.toString(16));
-
- var o = this.readLength(this._offset + 1); // stored in `length`
- if (o === null)
- return null;
-
- if (this.length > 4)
- throw newInvalidAsn1Error('Integer too long: ' + this.length);
-
- if (this.length > this._size - o)
- return null;
- this._offset = o;
-
- var fb = this._buf[this._offset++];
- var value = 0;
-
- value = fb & 0x7F;
- for (var i = 1; i < this.length; i++) {
- value <<= 8;
- value |= (this._buf[this._offset++] & 0xff);
- }
-
- if ((fb & 0x80) == 0x80)
- value = -value;
-
- return value;
-};
-
-
-
-///--- Exported API
-
-module.exports = Reader;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
deleted file mode 100644
index 8aea000..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-
-module.exports = {
- EOC: 0,
- Boolean: 1,
- Integer: 2,
- BitString: 3,
- OctetString: 4,
- Null: 5,
- OID: 6,
- ObjectDescriptor: 7,
- External: 8,
- Real: 9, // float
- Enumeration: 10,
- PDV: 11,
- Utf8String: 12,
- RelativeOID: 13,
- Sequence: 16,
- Set: 17,
- NumericString: 18,
- PrintableString: 19,
- T61String: 20,
- VideotexString: 21,
- IA5String: 22,
- UTCTime: 23,
- GeneralizedTime: 24,
- GraphicString: 25,
- VisibleString: 26,
- GeneralString: 28,
- UniversalString: 29,
- CharacterString: 30,
- BMPString: 31,
- Constructor: 32,
- Context: 128
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
deleted file mode 100644
index 7b445cc..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
+++ /dev/null
@@ -1,317 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-var assert = require('assert');
-var ASN1 = require('./types');
-var errors = require('./errors');
-
-
-///--- Globals
-
-var newInvalidAsn1Error = errors.newInvalidAsn1Error;
-
-var DEFAULT_OPTS = {
- size: 1024,
- growthFactor: 8
-};
-
-
-///--- Helpers
-
-function merge(from, to) {
- assert.ok(from);
- assert.equal(typeof(from), 'object');
- assert.ok(to);
- assert.equal(typeof(to), 'object');
-
- var keys = Object.getOwnPropertyNames(from);
- keys.forEach(function(key) {
- if (to[key])
- return;
-
- var value = Object.getOwnPropertyDescriptor(from, key);
- Object.defineProperty(to, key, value);
- });
-
- return to;
-}
-
-
-
-///--- API
-
-function Writer(options) {
- options = merge(DEFAULT_OPTS, options || {});
-
- this._buf = new Buffer(options.size || 1024);
- this._size = this._buf.length;
- this._offset = 0;
- this._options = options;
-
- // A list of offsets in the buffer where we need to insert
- // sequence tag/len pairs.
- this._seq = [];
-
- var self = this;
- this.__defineGetter__('buffer', function() {
- if (self._seq.length)
- throw new InvalidAsn1Error(self._seq.length + ' unended sequence(s)');
-
- return self._buf.slice(0, self._offset);
- });
-}
-
-
-Writer.prototype.writeByte = function(b) {
- if (typeof(b) !== 'number')
- throw new TypeError('argument must be a Number');
-
- this._ensure(1);
- this._buf[this._offset++] = b;
-};
-
-
-Writer.prototype.writeInt = function(i, tag) {
- if (typeof(i) !== 'number')
- throw new TypeError('argument must be a Number');
- if (typeof(tag) !== 'number')
- tag = ASN1.Integer;
-
- var sz = 4;
-
- while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000)) &&
- (sz > 1)) {
- sz--;
- i <<= 8;
- }
-
- if (sz > 4)
- throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff');
-
- this._ensure(2 + sz);
- this._buf[this._offset++] = tag;
- this._buf[this._offset++] = sz;
-
- while (sz-- > 0) {
- this._buf[this._offset++] = ((i & 0xff000000) >> 24);
- i <<= 8;
- }
-
-};
-
-
-Writer.prototype.writeNull = function() {
- this.writeByte(ASN1.Null);
- this.writeByte(0x00);
-};
-
-
-Writer.prototype.writeEnumeration = function(i, tag) {
- if (typeof(i) !== 'number')
- throw new TypeError('argument must be a Number');
- if (typeof(tag) !== 'number')
- tag = ASN1.Enumeration;
-
- return this.writeInt(i, tag);
-};
-
-
-Writer.prototype.writeBoolean = function(b, tag) {
- if (typeof(b) !== 'boolean')
- throw new TypeError('argument must be a Boolean');
- if (typeof(tag) !== 'number')
- tag = ASN1.Boolean;
-
- this._ensure(3);
- this._buf[this._offset++] = tag;
- this._buf[this._offset++] = 0x01;
- this._buf[this._offset++] = b ? 0xff : 0x00;
-};
-
-
-Writer.prototype.writeString = function(s, tag) {
- if (typeof(s) !== 'string')
- throw new TypeError('argument must be a string (was: ' + typeof(s) + ')');
- if (typeof(tag) !== 'number')
- tag = ASN1.OctetString;
-
- var len = Buffer.byteLength(s);
- this.writeByte(tag);
- this.writeLength(len);
- if (len) {
- this._ensure(len);
- this._buf.write(s, this._offset);
- this._offset += len;
- }
-};
-
-
-Writer.prototype.writeBuffer = function(buf, tag) {
- if (typeof(tag) !== 'number')
- throw new TypeError('tag must be a number');
- if (!Buffer.isBuffer(buf))
- throw new TypeError('argument must be a buffer');
-
- this.writeByte(tag);
- this.writeLength(buf.length);
- this._ensure(buf.length);
- buf.copy(this._buf, this._offset, 0, buf.length);
- this._offset += buf.length;
-};
-
-
-Writer.prototype.writeStringArray = function(strings) {
- if ((!strings instanceof Array))
- throw new TypeError('argument must be an Array[String]');
-
- var self = this;
- strings.forEach(function(s) {
- self.writeString(s);
- });
-};
-
-// This is really to solve DER cases, but whatever for now
-Writer.prototype.writeOID = function(s, tag) {
- if (typeof(s) !== 'string')
- throw new TypeError('argument must be a string');
- if (typeof(tag) !== 'number')
- tag = ASN1.OID;
-
- if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
- throw new Error('argument is not a valid OID string');
-
- function encodeOctet(bytes, octet) {
- if (octet < 128) {
- bytes.push(octet);
- } else if (octet < 16384) {
- bytes.push((octet >>> 7) | 0x80);
- bytes.push(octet & 0x7F);
- } else if (octet < 2097152) {
- bytes.push((octet >>> 14) | 0x80);
- bytes.push(((octet >>> 7) | 0x80) & 0xFF);
- bytes.push(octet & 0x7F);
- } else if (octet < 268435456) {
- bytes.push((octet >>> 21) | 0x80);
- bytes.push(((octet >>> 14) | 0x80) & 0xFF);
- bytes.push(((octet >>> 7) | 0x80) & 0xFF);
- bytes.push(octet & 0x7F);
- } else {
- bytes.push(((octet >>> 28) | 0x80) & 0xFF);
- bytes.push(((octet >>> 21) | 0x80) & 0xFF);
- bytes.push(((octet >>> 14) | 0x80) & 0xFF);
- bytes.push(((octet >>> 7) | 0x80) & 0xFF);
- bytes.push(octet & 0x7F);
- }
- }
-
- var tmp = s.split('.');
- var bytes = [];
- bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
- tmp.slice(2).forEach(function(b) {
- encodeOctet(bytes, parseInt(b, 10));
- });
-
- var self = this;
- this._ensure(2 + bytes.length);
- this.writeByte(tag);
- this.writeLength(bytes.length);
- bytes.forEach(function(b) {
- self.writeByte(b);
- });
-};
-
-
-Writer.prototype.writeLength = function(len) {
- if (typeof(len) !== 'number')
- throw new TypeError('argument must be a Number');
-
- this._ensure(4);
-
- if (len <= 0x7f) {
- this._buf[this._offset++] = len;
- } else if (len <= 0xff) {
- this._buf[this._offset++] = 0x81;
- this._buf[this._offset++] = len;
- } else if (len <= 0xffff) {
- this._buf[this._offset++] = 0x82;
- this._buf[this._offset++] = len >> 8;
- this._buf[this._offset++] = len;
- } else if (len <= 0xffffff) {
- this._shift(start, len, 1);
- this._buf[this._offset++] = 0x83;
- this._buf[this._offset++] = len >> 16;
- this._buf[this._offset++] = len >> 8;
- this._buf[this._offset++] = len;
- } else {
- throw new InvalidAsn1ERror('Length too long (> 4 bytes)');
- }
-};
-
-Writer.prototype.startSequence = function(tag) {
- if (typeof(tag) !== 'number')
- tag = ASN1.Sequence | ASN1.Constructor;
-
- this.writeByte(tag);
- this._seq.push(this._offset);
- this._ensure(3);
- this._offset += 3;
-};
-
-
-Writer.prototype.endSequence = function() {
- var seq = this._seq.pop();
- var start = seq + 3;
- var len = this._offset - start;
-
- if (len <= 0x7f) {
- this._shift(start, len, -2);
- this._buf[seq] = len;
- } else if (len <= 0xff) {
- this._shift(start, len, -1);
- this._buf[seq] = 0x81;
- this._buf[seq + 1] = len;
- } else if (len <= 0xffff) {
- this._buf[seq] = 0x82;
- this._buf[seq + 1] = len >> 8;
- this._buf[seq + 2] = len;
- } else if (len <= 0xffffff) {
- this._shift(start, len, 1);
- this._buf[seq] = 0x83;
- this._buf[seq + 1] = len >> 16;
- this._buf[seq + 2] = len >> 8;
- this._buf[seq + 3] = len;
- } else {
- throw new InvalidAsn1Error('Sequence too long');
- }
-};
-
-
-Writer.prototype._shift = function(start, len, shift) {
- assert.ok(start !== undefined);
- assert.ok(len !== undefined);
- assert.ok(shift);
-
- this._buf.copy(this._buf, start + shift, start, start + len);
- this._offset += shift;
-};
-
-Writer.prototype._ensure = function(len) {
- assert.ok(len);
-
- if (this._size - this._offset < len) {
- var sz = this._size * this._options.growthFactor;
- if (sz - this._offset < len)
- sz += len;
-
- var buf = new Buffer(sz);
-
- this._buf.copy(buf, 0, 0, this._offset);
- this._buf = buf;
- this._size = sz;
- }
-};
-
-
-
-///--- Exported API
-
-module.exports = Writer;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
deleted file mode 100644
index d1766e7..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-// If you have no idea what ASN.1 or BER is, see this:
-// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
-
-var Ber = require('./ber/index');
-
-
-
-///--- Exported API
-
-module.exports = {
-
- Ber: Ber,
-
- BerReader: Ber.Reader,
-
- BerWriter: Ber.Writer
-
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json b/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
deleted file mode 100644
index 8c68193..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
- "author": {
- "name": "Mark Cavage",
- "email": "mcavage@gmail.com"
- },
- "contributors": [
- {
- "name": "David Gwynne",
- "email": "loki@animata.net"
- },
- {
- "name": "Yunong Xiao",
- "email": "yunong@joyent.com"
- }
- ],
- "name": "asn1",
- "description": "Contains parsers and serializers for ASN.1 (currently BER only)",
- "version": "0.1.11",
- "repository": {
- "type": "git",
- "url": "git://github.com/mcavage/node-asn1.git"
- },
- "main": "lib/index.js",
- "engines": {
- "node": ">=0.4.9"
- },
- "dependencies": {},
- "devDependencies": {
- "tap": "0.1.4"
- },
- "scripts": {
- "pretest": "which gjslint; if [[ \"$?\" = 0 ]] ; then gjslint --nojsdoc -r lib -r tst; else echo \"Missing gjslint. Skipping lint\"; fi",
- "test": "tap ./tst"
- },
- "_npmUser": {
- "name": "mcavage",
- "email": "mcavage@gmail.com"
- },
- "_id": "asn1@0.1.11",
- "_engineSupported": true,
- "_npmVersion": "1.1.0-beta-4",
- "_nodeVersion": "v0.6.6",
- "_defaultsLoaded": true,
- "dist": {
- "shasum": "559be18376d08a4ec4dbe80877d27818639b2df7",
- "tarball": "http://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
- },
- "maintainers": [
- {
- "name": "mcavage",
- "email": "mcavage@gmail.com"
- }
- ],
- "directories": {},
- "_shasum": "559be18376d08a4ec4dbe80877d27818639b2df7",
- "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz",
- "_from": "asn1@0.1.11",
- "bugs": {
- "url": "https://github.com/mcavage/node-asn1/issues"
- },
- "readme": "ERROR: No README data found!",
- "homepage": "https://github.com/mcavage/node-asn1"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js
deleted file mode 100644
index 0b78b47..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js
+++ /dev/null
@@ -1,172 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-var test = require('tap').test;
-
-
-
-///--- Globals
-
-var BerReader;
-
-
-
-///--- Tests
-
-test('load library', function(t) {
- BerReader = require('../../lib/index').BerReader;
- t.ok(BerReader);
- try {
- new BerReader();
- t.fail('Should have thrown');
- } catch (e) {
- t.ok(e instanceof TypeError, 'Should have been a type error');
- }
- t.end();
-});
-
-
-test('read byte', function(t) {
- var reader = new BerReader(new Buffer([0xde]));
- t.ok(reader);
- t.equal(reader.readByte(), 0xde, 'wrong value');
- t.end();
-});
-
-
-test('read 1 byte int', function(t) {
- var reader = new BerReader(new Buffer([0x02, 0x01, 0x03]));
- t.ok(reader);
- t.equal(reader.readInt(), 0x03, 'wrong value');
- t.equal(reader.length, 0x01, 'wrong length');
- t.end();
-});
-
-
-test('read 2 byte int', function(t) {
- var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde]));
- t.ok(reader);
- t.equal(reader.readInt(), 0x7ede, 'wrong value');
- t.equal(reader.length, 0x02, 'wrong length');
- t.end();
-});
-
-
-test('read 3 byte int', function(t) {
- var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03]));
- t.ok(reader);
- t.equal(reader.readInt(), 0x7ede03, 'wrong value');
- t.equal(reader.length, 0x03, 'wrong length');
- t.end();
-});
-
-
-test('read 4 byte int', function(t) {
- var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01]));
- t.ok(reader);
- t.equal(reader.readInt(), 0x7ede0301, 'wrong value');
- t.equal(reader.length, 0x04, 'wrong length');
- t.end();
-});
-
-
-test('read boolean true', function(t) {
- var reader = new BerReader(new Buffer([0x01, 0x01, 0xff]));
- t.ok(reader);
- t.equal(reader.readBoolean(), true, 'wrong value');
- t.equal(reader.length, 0x01, 'wrong length');
- t.end();
-});
-
-
-test('read boolean false', function(t) {
- var reader = new BerReader(new Buffer([0x01, 0x01, 0x00]));
- t.ok(reader);
- t.equal(reader.readBoolean(), false, 'wrong value');
- t.equal(reader.length, 0x01, 'wrong length');
- t.end();
-});
-
-
-test('read enumeration', function(t) {
- var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20]));
- t.ok(reader);
- t.equal(reader.readEnumeration(), 0x20, 'wrong value');
- t.equal(reader.length, 0x01, 'wrong length');
- t.end();
-});
-
-
-test('read string', function(t) {
- var dn = 'cn=foo,ou=unit,o=test';
- var buf = new Buffer(dn.length + 2);
- buf[0] = 0x04;
- buf[1] = Buffer.byteLength(dn);
- buf.write(dn, 2);
- var reader = new BerReader(buf);
- t.ok(reader);
- t.equal(reader.readString(), dn, 'wrong value');
- t.equal(reader.length, dn.length, 'wrong length');
- t.end();
-});
-
-
-test('read sequence', function(t) {
- var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
- t.ok(reader);
- t.equal(reader.readSequence(), 0x30, 'wrong value');
- t.equal(reader.length, 0x03, 'wrong length');
- t.equal(reader.readBoolean(), true, 'wrong value');
- t.equal(reader.length, 0x01, 'wrong length');
- t.end();
-});
-
-
-test('anonymous LDAPv3 bind', function(t) {
- var BIND = new Buffer(14);
- BIND[0] = 0x30; // Sequence
- BIND[1] = 12; // len
- BIND[2] = 0x02; // ASN.1 Integer
- BIND[3] = 1; // len
- BIND[4] = 0x04; // msgid (make up 4)
- BIND[5] = 0x60; // Bind Request
- BIND[6] = 7; // len
- BIND[7] = 0x02; // ASN.1 Integer
- BIND[8] = 1; // len
- BIND[9] = 0x03; // v3
- BIND[10] = 0x04; // String (bind dn)
- BIND[11] = 0; // len
- BIND[12] = 0x80; // ContextSpecific (choice)
- BIND[13] = 0; // simple bind
-
- // Start testing ^^
- var ber = new BerReader(BIND);
- t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence');
- t.equal(ber.length, 12, 'Message length should be 12');
- t.equal(ber.readInt(), 4, 'Message id should have been 4');
- t.equal(ber.readSequence(), 96, 'Bind Request should have been 96');
- t.equal(ber.length, 7, 'Bind length should have been 7');
- t.equal(ber.readInt(), 3, 'LDAP version should have been 3');
- t.equal(ber.readString(), '', 'Bind DN should have been empty');
- t.equal(ber.length, 0, 'string length should have been 0');
- t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)');
- t.equal(ber.readByte(), 0, 'Should have been simple bind');
- t.equal(null, ber.readByte(), 'Should be out of data');
- t.end();
-});
-
-
-test('long string', function(t) {
- var buf = new Buffer(256);
- var o;
- var s =
- '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' +
- 'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' +
- 'Teena Vradmin\'s description.';
- buf[0] = 0x04;
- buf[1] = 0x81;
- buf[2] = 0x94;
- buf.write(s, 3);
- var ber = new BerReader(buf.slice(0, 3 + s.length));
- t.equal(ber.readString(), s);
- t.end();
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js
deleted file mode 100644
index add0b9f..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
-
-var test = require('tap').test;
-var sys = require('sys');
-
-///--- Globals
-
-var BerWriter;
-
-var BerReader;
-
-
-///--- Tests
-
-test('load library', function(t) {
- BerWriter = require('../../lib/index').BerWriter;
- t.ok(BerWriter);
- t.ok(new BerWriter());
- t.end();
-});
-
-
-test('write byte', function(t) {
- var writer = new BerWriter();
-
- writer.writeByte(0xC2);
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 1, 'Wrong length');
- t.equal(ber[0], 0xC2, 'value wrong');
-
- t.end();
-});
-
-
-test('write 1 byte int', function(t) {
- var writer = new BerWriter();
-
- writer.writeInt(0x7f);
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 3, 'Wrong length for an int: ' + ber.length);
- t.equal(ber[0], 0x02, 'ASN.1 tag wrong (2) -> ' + ber[0]);
- t.equal(ber[1], 0x01, 'length wrong(1) -> ' + ber[1]);
- t.equal(ber[2], 0x7f, 'value wrong(3) -> ' + ber[2]);
-
- t.end();
-});
-
-
-test('write 2 byte int', function(t) {
- var writer = new BerWriter();
-
- writer.writeInt(0x7ffe);
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 4, 'Wrong length for an int');
- t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
- t.equal(ber[1], 0x02, 'length wrong');
- t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
- t.equal(ber[3], 0xfe, 'value wrong (byte 2)');
-
- t.end();
-});
-
-
-test('write 3 byte int', function(t) {
- var writer = new BerWriter();
-
- writer.writeInt(0x7ffffe);
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 5, 'Wrong length for an int');
- t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
- t.equal(ber[1], 0x03, 'length wrong');
- t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
- t.equal(ber[3], 0xff, 'value wrong (byte 2)');
- t.equal(ber[4], 0xfe, 'value wrong (byte 3)');
-
- t.end();
-});
-
-
-test('write 4 byte int', function(t) {
- var writer = new BerWriter();
-
- writer.writeInt(0x7ffffffe);
- var ber = writer.buffer;
-
- t.ok(ber);
-
- t.equal(ber.length, 6, 'Wrong length for an int');
- t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
- t.equal(ber[1], 0x04, 'length wrong');
- t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
- t.equal(ber[3], 0xff, 'value wrong (byte 2)');
- t.equal(ber[4], 0xff, 'value wrong (byte 3)');
- t.equal(ber[5], 0xfe, 'value wrong (byte 4)');
-
- t.end();
-});
-
-
-test('write boolean', function(t) {
- var writer = new BerWriter();
-
- writer.writeBoolean(true);
- writer.writeBoolean(false);
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 6, 'Wrong length');
- t.equal(ber[0], 0x01, 'tag wrong');
- t.equal(ber[1], 0x01, 'length wrong');
- t.equal(ber[2], 0xff, 'value wrong');
- t.equal(ber[3], 0x01, 'tag wrong');
- t.equal(ber[4], 0x01, 'length wrong');
- t.equal(ber[5], 0x00, 'value wrong');
-
- t.end();
-});
-
-
-test('write string', function(t) {
- var writer = new BerWriter();
- writer.writeString('hello world');
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 13, 'wrong length');
- t.equal(ber[0], 0x04, 'wrong tag');
- t.equal(ber[1], 11, 'wrong length');
- t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
-
- t.end();
-});
-
-test('write buffer', function(t) {
- var writer = new BerWriter();
- // write some stuff to start with
- writer.writeString('hello world');
- var ber = writer.buffer;
- var buf = new Buffer([0x04, 0x0b, 0x30, 0x09, 0x02, 0x01, 0x0f, 0x01, 0x01,
- 0xff, 0x01, 0x01, 0xff]);
- writer.writeBuffer(buf.slice(2, buf.length), 0x04);
- ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 26, 'wrong length');
- t.equal(ber[0], 0x04, 'wrong tag');
- t.equal(ber[1], 11, 'wrong length');
- t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
- t.equal(ber[13], buf[0], 'wrong tag');
- t.equal(ber[14], buf[1], 'wrong length');
- for (var i = 13, j = 0; i < ber.length && j < buf.length; i++, j++) {
- t.equal(ber[i], buf[j], 'buffer contents not identical');
- }
- t.end();
-});
-
-test('write string array', function(t) {
- var writer = new BerWriter();
- writer.writeStringArray(['hello world', 'fubar!']);
- var ber = writer.buffer;
-
- t.ok(ber);
-
- t.equal(ber.length, 21, 'wrong length');
- t.equal(ber[0], 0x04, 'wrong tag');
- t.equal(ber[1], 11, 'wrong length');
- t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
-
- t.equal(ber[13], 0x04, 'wrong tag');
- t.equal(ber[14], 6, 'wrong length');
- t.equal(ber.slice(15).toString('utf8'), 'fubar!', 'wrong value');
-
- t.end();
-});
-
-
-test('resize internal buffer', function(t) {
- var writer = new BerWriter({size: 2});
- writer.writeString('hello world');
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 13, 'wrong length');
- t.equal(ber[0], 0x04, 'wrong tag');
- t.equal(ber[1], 11, 'wrong length');
- t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
-
- t.end();
-});
-
-
-test('sequence', function(t) {
- var writer = new BerWriter({size: 25});
- writer.startSequence();
- writer.writeString('hello world');
- writer.endSequence();
- var ber = writer.buffer;
-
- t.ok(ber);
- console.log(ber);
- t.equal(ber.length, 15, 'wrong length');
- t.equal(ber[0], 0x30, 'wrong tag');
- t.equal(ber[1], 13, 'wrong length');
- t.equal(ber[2], 0x04, 'wrong tag');
- t.equal(ber[3], 11, 'wrong length');
- t.equal(ber.slice(4).toString('utf8'), 'hello world', 'wrong value');
-
- t.end();
-});
-
-
-test('nested sequence', function(t) {
- var writer = new BerWriter({size: 25});
- writer.startSequence();
- writer.writeString('hello world');
- writer.startSequence();
- writer.writeString('hello world');
- writer.endSequence();
- writer.endSequence();
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 30, 'wrong length');
- t.equal(ber[0], 0x30, 'wrong tag');
- t.equal(ber[1], 28, 'wrong length');
- t.equal(ber[2], 0x04, 'wrong tag');
- t.equal(ber[3], 11, 'wrong length');
- t.equal(ber.slice(4, 15).toString('utf8'), 'hello world', 'wrong value');
- t.equal(ber[15], 0x30, 'wrong tag');
- t.equal(ber[16], 13, 'wrong length');
- t.equal(ber[17], 0x04, 'wrong tag');
- t.equal(ber[18], 11, 'wrong length');
- t.equal(ber.slice(19, 30).toString('utf8'), 'hello world', 'wrong value');
-
- t.end();
-});
-
-
-test('LDAP bind message', function(t) {
- var dn = 'cn=foo,ou=unit,o=test';
- var writer = new BerWriter();
- writer.startSequence();
- writer.writeInt(3); // msgid = 3
- writer.startSequence(0x60); // ldap bind
- writer.writeInt(3); // ldap v3
- writer.writeString(dn);
- writer.writeByte(0x80);
- writer.writeByte(0x00);
- writer.endSequence();
- writer.endSequence();
- var ber = writer.buffer;
-
- t.ok(ber);
- t.equal(ber.length, 35, 'wrong length (buffer)');
- t.equal(ber[0], 0x30, 'wrong tag');
- t.equal(ber[1], 33, 'wrong length');
- t.equal(ber[2], 0x02, 'wrong tag');
- t.equal(ber[3], 1, 'wrong length');
- t.equal(ber[4], 0x03, 'wrong value');
- t.equal(ber[5], 0x60, 'wrong tag');
- t.equal(ber[6], 28, 'wrong length');
- t.equal(ber[7], 0x02, 'wrong tag');
- t.equal(ber[8], 1, 'wrong length');
- t.equal(ber[9], 0x03, 'wrong value');
- t.equal(ber[10], 0x04, 'wrong tag');
- t.equal(ber[11], dn.length, 'wrong length');
- t.equal(ber.slice(12, 33).toString('utf8'), dn, 'wrong value');
- t.equal(ber[33], 0x80, 'wrong tag');
- t.equal(ber[34], 0x00, 'wrong len');
-
- t.end();
-});
-
-
-test('Write OID', function(t) {
- var oid = '1.2.840.113549.1.1.1';
- var writer = new BerWriter();
- writer.writeOID(oid);
-
- var ber = writer.buffer;
- t.ok(ber);
- console.log(require('util').inspect(ber));
- console.log(require('util').inspect(new Buffer([0x06, 0x09, 0x2a, 0x86,
- 0x48, 0x86, 0xf7, 0x0d,
- 0x01, 0x01, 0x01])));
-
- t.end();
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md
deleted file mode 100644
index c0c3a53..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md
+++ /dev/null
@@ -1,126 +0,0 @@
-# node-assert-plus
-
-This library is a super small wrapper over node's assert module that has two
-things: (1) the ability to disable assertions with the environment variable
-NODE_NDEBUG, and (2) some API wrappers for argument testing. Like
-`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks
-like this:
-
- var assert = require('assert-plus');
-
- function fooAccount(options, callback) {
- assert.object(options, 'options');
- assert.number(options.id, 'options.id);
- assert.bool(options.isManager, 'options.isManager');
- assert.string(options.name, 'options.name');
- assert.arrayOfString(options.email, 'options.email');
- assert.func(callback, 'callback');
-
- // Do stuff
- callback(null, {});
- }
-
-# API
-
-All methods that *aren't* part of node's core assert API are simply assumed to
-take an argument, and then a string 'name' that's not a message; `AssertionError`
-will be thrown if the assertion fails with a message like:
-
- AssertionError: foo (string) is required
- at test (/home/mark/work/foo/foo.js:3:9)
- at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
- at Module._compile (module.js:446:26)
- at Object..js (module.js:464:10)
- at Module.load (module.js:353:31)
- at Function._load (module.js:311:12)
- at Array.0 (module.js:484:10)
- at EventEmitter._tickCallback (node.js:190:38)
-
-from:
-
- function test(foo) {
- assert.string(foo, 'foo');
- }
-
-There you go. You can check that arrays are of a homogenous type with `Arrayof$Type`:
-
- function test(foo) {
- assert.arrayOfString(foo, 'foo');
- }
-
-You can assert IFF an argument is not `undefined` (i.e., an optional arg):
-
- assert.optionalString(foo, 'foo');
-
-Lastly, you can opt-out of assertion checking altogether by setting the
-environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have
-lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
-production.
-
-The complete list of APIs is:
-
-* assert.bool
-* assert.buffer
-* assert.func
-* assert.number
-* assert.object
-* assert.string
-* assert.arrayOfBool
-* assert.arrayOfFunc
-* assert.arrayOfNumber
-* assert.arrayOfObject
-* assert.arrayOfString
-* assert.optionalBool
-* assert.optionalBuffer
-* assert.optionalFunc
-* assert.optionalNumber
-* assert.optionalObject
-* assert.optionalString
-* assert.optionalArrayOfBool
-* assert.optionalArrayOfFunc
-* assert.optionalArrayOfNumber
-* assert.optionalArrayOfObject
-* assert.optionalArrayOfString
-* assert.AssertionError
-* assert.fail
-* assert.ok
-* assert.equal
-* assert.notEqual
-* assert.deepEqual
-* assert.notDeepEqual
-* assert.strictEqual
-* assert.notStrictEqual
-* assert.throws
-* assert.doesNotThrow
-* assert.ifError
-
-# Installation
-
- npm install assert-plus
-
-## License
-
-The MIT License (MIT)
-Copyright (c) 2012 Mark Cavage
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-## Bugs
-
-See <https://github.com/mcavage/node-assert-plus/issues>.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
deleted file mode 100644
index ff2ba02..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
+++ /dev/null
@@ -1,245 +0,0 @@
-// Copyright (c) 2012, Mark Cavage. All rights reserved.
-
-var assert = require('assert');
-var Stream = require('stream').Stream;
-var util = require('util');
-
-
-
-///--- Globals
-
-var NDEBUG = process.env.NODE_NDEBUG || false;
-var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
-
-
-
-///--- Messages
-
-var ARRAY_TYPE_REQUIRED = '%s ([%s]) required';
-var TYPE_REQUIRED = '%s (%s) is required';
-
-
-
-///--- Internal
-
-function capitalize(str) {
- return (str.charAt(0).toUpperCase() + str.slice(1));
-}
-
-function uncapitalize(str) {
- return (str.charAt(0).toLowerCase() + str.slice(1));
-}
-
-function _() {
- return (util.format.apply(util, arguments));
-}
-
-
-function _assert(arg, type, name, stackFunc) {
- if (!NDEBUG) {
- name = name || type;
- stackFunc = stackFunc || _assert.caller;
- var t = typeof (arg);
-
- if (t !== type) {
- throw new assert.AssertionError({
- message: _(TYPE_REQUIRED, name, type),
- actual: t,
- expected: type,
- operator: '===',
- stackStartFunction: stackFunc
- });
- }
- }
-}
-
-
-function _instanceof(arg, type, name, stackFunc) {
- if (!NDEBUG) {
- name = name || type;
- stackFunc = stackFunc || _instanceof.caller;
-
- if (!(arg instanceof type)) {
- throw new assert.AssertionError({
- message: _(TYPE_REQUIRED, name, type.name),
- actual: _getClass(arg),
- expected: type.name,
- operator: 'instanceof',
- stackStartFunction: stackFunc
- });
- }
- }
-}
-
-function _getClass(object) {
- return (Object.prototype.toString.call(object).slice(8, -1));
-};
-
-
-
-///--- API
-
-function array(arr, type, name) {
- if (!NDEBUG) {
- name = name || type;
-
- if (!Array.isArray(arr)) {
- throw new assert.AssertionError({
- message: _(ARRAY_TYPE_REQUIRED, name, type),
- actual: typeof (arr),
- expected: 'array',
- operator: 'Array.isArray',
- stackStartFunction: array.caller
- });
- }
-
- for (var i = 0; i < arr.length; i++) {
- _assert(arr[i], type, name, array);
- }
- }
-}
-
-
-function bool(arg, name) {
- _assert(arg, 'boolean', name, bool);
-}
-
-
-function buffer(arg, name) {
- if (!Buffer.isBuffer(arg)) {
- throw new assert.AssertionError({
- message: _(TYPE_REQUIRED, name || '', 'Buffer'),
- actual: typeof (arg),
- expected: 'buffer',
- operator: 'Buffer.isBuffer',
- stackStartFunction: buffer
- });
- }
-}
-
-
-function func(arg, name) {
- _assert(arg, 'function', name);
-}
-
-
-function number(arg, name) {
- _assert(arg, 'number', name);
- if (!NDEBUG && (isNaN(arg) || !isFinite(arg))) {
- throw new assert.AssertionError({
- message: _(TYPE_REQUIRED, name, 'number'),
- actual: arg,
- expected: 'number',
- operator: 'isNaN',
- stackStartFunction: number
- });
- }
-}
-
-
-function object(arg, name) {
- _assert(arg, 'object', name);
-}
-
-
-function stream(arg, name) {
- _instanceof(arg, Stream, name);
-}
-
-
-function date(arg, name) {
- _instanceof(arg, Date, name);
-}
-
-function regexp(arg, name) {
- _instanceof(arg, RegExp, name);
-}
-
-
-function string(arg, name) {
- _assert(arg, 'string', name);
-}
-
-
-function uuid(arg, name) {
- string(arg, name);
- if (!NDEBUG && !UUID_REGEXP.test(arg)) {
- throw new assert.AssertionError({
- message: _(TYPE_REQUIRED, name, 'uuid'),
- actual: 'string',
- expected: 'uuid',
- operator: 'test',
- stackStartFunction: uuid
- });
- }
-}
-
-
-///--- Exports
-
-module.exports = {
- bool: bool,
- buffer: buffer,
- date: date,
- func: func,
- number: number,
- object: object,
- regexp: regexp,
- stream: stream,
- string: string,
- uuid: uuid
-};
-
-
-Object.keys(module.exports).forEach(function (k) {
- if (k === 'buffer')
- return;
-
- var name = 'arrayOf' + capitalize(k);
-
- if (k === 'bool')
- k = 'boolean';
- if (k === 'func')
- k = 'function';
- module.exports[name] = function (arg, name) {
- array(arg, k, name);
- };
-});
-
-Object.keys(module.exports).forEach(function (k) {
- var _name = 'optional' + capitalize(k);
- var s = uncapitalize(k.replace('arrayOf', ''));
- if (s === 'bool')
- s = 'boolean';
- if (s === 'func')
- s = 'function';
-
- if (k.indexOf('arrayOf') !== -1) {
- module.exports[_name] = function (arg, name) {
- if (!NDEBUG && arg !== undefined) {
- array(arg, s, name);
- }
- };
- } else {
- module.exports[_name] = function (arg, name) {
- if (!NDEBUG && arg !== undefined) {
- _assert(arg, s, name);
- }
- };
- }
-});
-
-
-// Reexport built-in assertions
-Object.keys(assert).forEach(function (k) {
- if (k === 'AssertionError') {
- module.exports[k] = assert[k];
- return;
- }
-
- module.exports[k] = function () {
- if (!NDEBUG) {
- assert[k].apply(assert[k], arguments);
- }
- };
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
deleted file mode 100644
index 1b935b6..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "author": {
- "name": "Mark Cavage",
- "email": "mcavage@gmail.com"
- },
- "name": "assert-plus",
- "description": "Extra assertions on top of node's assert module",
- "version": "0.1.5",
- "main": "./assert.js",
- "devDependencies": {},
- "optionalDependencies": {},
- "repository": {
- "type": "git",
- "url": "https://github.com/mcavage/node-assert-plus.git"
- },
- "engines": {
- "node": ">=0.8"
- },
- "bugs": {
- "url": "https://github.com/mcavage/node-assert-plus/issues"
- },
- "dependencies": {},
- "_id": "assert-plus@0.1.5",
- "dist": {
- "shasum": "ee74009413002d84cec7219c6ac811812e723160",
- "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz"
- },
- "_from": "assert-plus@>=0.1.5 <0.2.0",
- "_npmVersion": "1.3.11",
- "_npmUser": {
- "name": "mcavage",
- "email": "mcavage@gmail.com"
- },
- "maintainers": [
- {
- "name": "mcavage",
- "email": "mcavage@gmail.com"
- }
- ],
- "directories": {},
- "_shasum": "ee74009413002d84cec7219c6ac811812e723160",
- "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz",
- "readme": "ERROR: No README data found!",
- "homepage": "https://github.com/mcavage/node-assert-plus",
- "scripts": {}
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore b/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore
deleted file mode 100644
index dc6d3b2..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-tst/
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG b/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG
deleted file mode 100644
index 426da9e..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG
+++ /dev/null
@@ -1,78 +0,0 @@
-This contains tickets fixed in each version release in reverse chronological
-order. There is one ticket per line. Each commits message has the tickets fixed
-in it. The commit message also has the corresponding github issue. i.e. CTYPE-42
-would be issue 42. Each issue can be found at:
-https://github.com/rmustacc/node-ctype/issues/%d.
-
-v0.5.3
-CTYPE-50 Release 0.5.3
-Contributed by Nick Schonning:
-CTYPE-49 Add repository section to package.json
-Contributed by Jonathan Ong:
-CTYPE-48 Create .npmignore
-
-v0.5.2
-CTYPE-46 Release 0.5.2
-CTYPE-45 error in setEndian logic
-
-v0.5.1
-CTYPE-44 Release 0.5.1
-Contributed by Terin Stock:
-CTYPE-41 CTypeParser.writeStruct should return its offset
-Contributed by Terin Stock:
-CTYPE-42 int64_t returns wrong size
-
-v0.5.0
-CTYPE-40 Release 0.5.0
-CTYPE-39 want > 0.6 engine support
-
-v0.4.0
-CTYPE-37 Release v0.4.0
-CTYPE-6 want additional entry point for write
-CTYPE-20 Add 64-bit int support into core parser
-CTYPE-31 Fix bounds errors node/2129
-CTYPE-33 Update copyright holders
-CTYPE-34 ctf.js confuses sign bit.
-CTYPE-35 Make the README more useful for getting started
-CTYPE-36 want manual page on ctio functions
-
-v0.3.1
-CTYPE-29 Release 0.3.1
-CTYPE-28 Want v0.6 npm support
-
-v0.3.0
-CTYPE-27 Release v0.3.0
-CTYPE-26 Want alternate default char behavior
-
-v0.2.1
-CTYPE-25 Release v0.2.1
-CTYPE-24 Writing structs is busted
-
-v0.2.0:
-CTYPE-23 Release v0.2.0
-CTYPE-21 Add support for CTF JSON data
-CTYPE-22 Add Javascriptlint profile
-CTYPE-15 Pull in ctio updates from node/master
-
-v0.1.0:
-CTYPE-18 Bump version to v0.1.0
-CTYPE-17 Fix nested structures
-CTYPE-16 Remove extraneous logging
-CTYPE-14 toAbs64 and toApprox64 are not exported
-
-v0.0.3:
-CTYPE-12 Bump version to v0.0.3
-CTYPE-11 fix typo in wuint64
-CTYPE-10 Integrate jsstyle
-
-v0.0.2:
-CTYPE-8 dump npm version to v0.0.2
-CTYPE-9 want changelog
-CTYPE-7 fix typo in detypes.
-
-v0.0.1:
-CTYPE-5 Missing from NPM registry
-CTYPE-4 int16_t calls wrong read function
-CTYPE-3 API example types are missing quotes as strings
-CTYPE-2 doc missing 64-bit functions
-CTYPE-1 Need license
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE b/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE
deleted file mode 100644
index 22ced3e..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE
+++ /dev/null
@@ -1,24 +0,0 @@
-The following license applies to all files unless the file is specified below.
-Each file specified below has its license information embedded in it:
-
-tools/jsstyle
-
-Copyright 2011, Robert Mustacchi. All rights reserved.
-Copyright 2011, Joyent, Inc. All rights reserved.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/README
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/README b/node_modules/request/node_modules/http-signature/node_modules/ctype/README
deleted file mode 100644
index 4efd7ee..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/README
+++ /dev/null
@@ -1,82 +0,0 @@
-Node-CType is a way to read and write binary data in structured and easy to use
-format. Its name comes from the C header file.
-
-To get started, simply clone the repository or use npm to install it. Once it is
-there, simply require it.
-
-git clone git://github.com/rmustacc/node-ctype
-npm install ctype
-var mod_ctype = require('ctype')
-
-
-There are two APIs that you can use, depending on what abstraction you'd like.
-The low level API let's you read and write individual integers and floats from
-buffers. The higher level API let's you read and write structures of these. To
-illustrate this, let's looks look at how we would read and write a binary
-encoded x,y point.
-
-In C we would define this structure as follows:
-
-typedef struct point {
- uint16_t p_x;
- uint16_t p_y;
-} point_t;
-
-To read a binary encoded point from a Buffer, we first need to create a CType
-parser (where we specify the endian and other options) and add the typedef.
-
-var parser = new mod_ctype.Parser({ endian: 'big' });
-parser.typedef('point_t', [
- { x: { type: 'uint16_t' } },
- { y: { type: 'uint16_t' } }
-]);
-
-From here, given a buffer buf and an offset into it, we can read a point.
-
-var out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);
-console.log(out);
-{ point: { x: 23, y: 42 } }
-
-Another way to get the same information would be to use the low level methods.
-Note that these require you to manually deal with the offset. Here's how we'd
-get the same values of x and y from the buffer.
-
-var x = mod_ctype.ruint16(buf, 'big', 0);
-var y = mod_ctype.ruint16(buf, 'big', 2);
-console.log(x + ', ' + y);
-23, 42
-
-The true power of this API comes from the ability to define and nest typedefs,
-just as you would in C. By default, the following types are defined by default.
-Note that they return a Number, unless indicated otherwise.
-
- * int8_t
- * int16_t
- * int32_t
- * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
- * uint8_t
- * uint16_t
- * uint32_t
- * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
- * float
- * double
- * char (either returns a buffer with that character or a uint8_t)
- * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
-
-
-ctf2json integration:
-
-Node-CType supports consuming the output of ctf2json. Once you read in a JSON file,
-all you have to do to add all the definitions it contains is:
-
-var data, parser;
-data = JSON.parse(parsedJSONData);
-parser = mod_ctype.parseCTF(data, { endian: 'big' });
-
-For more documentation, see the file README.old. Full documentation is in the
-process of being rewritten as a series of manual pages which will be available
-in the repository and online for viewing.
-
-To read the ctio manual page simple run, from the root of the workspace:
-
-man -Mman -s 3ctype ctio
[31/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
deleted file mode 100644
index f24590e..0000000
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
+++ /dev/null
@@ -1,195 +0,0 @@
-1.10.0 / 2015-05-19
-===================
-
- * Add `application/vnd.balsamiq.bmpr`
- * Add `application/vnd.microsoft.portable-executable`
- * Add `application/x-ns-proxy-autoconfig`
-
-1.9.1 / 2015-04-19
-==================
-
- * Remove `.json` extension from `application/manifest+json`
- - This is causing bugs downstream
-
-1.9.0 / 2015-04-19
-==================
-
- * Add `application/manifest+json`
- * Add `application/vnd.micro+json`
- * Add `image/vnd.zbrush.pcx`
- * Add `image/x-ms-bmp`
-
-1.8.0 / 2015-03-13
-==================
-
- * Add `application/vnd.citationstyles.style+xml`
- * Add `application/vnd.fastcopy-disk-image`
- * Add `application/vnd.gov.sk.xmldatacontainer+xml`
- * Add extension `.jsonld` to `application/ld+json`
-
-1.7.0 / 2015-02-08
-==================
-
- * Add `application/vnd.gerber`
- * Add `application/vnd.msa-disk-image`
-
-1.6.1 / 2015-02-05
-==================
-
- * Community extensions ownership transferred from `node-mime`
-
-1.6.0 / 2015-01-29
-==================
-
- * Add `application/jose`
- * Add `application/jose+json`
- * Add `application/json-seq`
- * Add `application/jwk+json`
- * Add `application/jwk-set+json`
- * Add `application/jwt`
- * Add `application/rdap+json`
- * Add `application/vnd.gov.sk.e-form+xml`
- * Add `application/vnd.ims.imsccv1p3`
-
-1.5.0 / 2014-12-30
-==================
-
- * Add `application/vnd.oracle.resource+json`
- * Fix various invalid MIME type entries
- - `application/mbox+xml`
- - `application/oscp-response`
- - `application/vwg-multiplexed`
- - `audio/g721`
-
-1.4.0 / 2014-12-21
-==================
-
- * Add `application/vnd.ims.imsccv1p2`
- * Fix various invalid MIME type entries
- - `application/vnd-acucobol`
- - `application/vnd-curl`
- - `application/vnd-dart`
- - `application/vnd-dxr`
- - `application/vnd-fdf`
- - `application/vnd-mif`
- - `application/vnd-sema`
- - `application/vnd-wap-wmlc`
- - `application/vnd.adobe.flash-movie`
- - `application/vnd.dece-zip`
- - `application/vnd.dvb_service`
- - `application/vnd.micrografx-igx`
- - `application/vnd.sealed-doc`
- - `application/vnd.sealed-eml`
- - `application/vnd.sealed-mht`
- - `application/vnd.sealed-ppt`
- - `application/vnd.sealed-tiff`
- - `application/vnd.sealed-xls`
- - `application/vnd.sealedmedia.softseal-html`
- - `application/vnd.sealedmedia.softseal-pdf`
- - `application/vnd.wap-slc`
- - `application/vnd.wap-wbxml`
- - `audio/vnd.sealedmedia.softseal-mpeg`
- - `image/vnd-djvu`
- - `image/vnd-svf`
- - `image/vnd-wap-wbmp`
- - `image/vnd.sealed-png`
- - `image/vnd.sealedmedia.softseal-gif`
- - `image/vnd.sealedmedia.softseal-jpg`
- - `model/vnd-dwf`
- - `model/vnd.parasolid.transmit-binary`
- - `model/vnd.parasolid.transmit-text`
- - `text/vnd-a`
- - `text/vnd-curl`
- - `text/vnd.wap-wml`
- * Remove example template MIME types
- - `application/example`
- - `audio/example`
- - `image/example`
- - `message/example`
- - `model/example`
- - `multipart/example`
- - `text/example`
- - `video/example`
-
-1.3.1 / 2014-12-16
-==================
-
- * Fix missing extensions
- - `application/json5`
- - `text/hjson`
-
-1.3.0 / 2014-12-07
-==================
-
- * Add `application/a2l`
- * Add `application/aml`
- * Add `application/atfx`
- * Add `application/atxml`
- * Add `application/cdfx+xml`
- * Add `application/dii`
- * Add `application/json5`
- * Add `application/lxf`
- * Add `application/mf4`
- * Add `application/vnd.apache.thrift.compact`
- * Add `application/vnd.apache.thrift.json`
- * Add `application/vnd.coffeescript`
- * Add `application/vnd.enphase.envoy`
- * Add `application/vnd.ims.imsccv1p1`
- * Add `text/csv-schema`
- * Add `text/hjson`
- * Add `text/markdown`
- * Add `text/yaml`
-
-1.2.0 / 2014-11-09
-==================
-
- * Add `application/cea`
- * Add `application/dit`
- * Add `application/vnd.gov.sk.e-form+zip`
- * Add `application/vnd.tmd.mediaflex.api+xml`
- * Type `application/epub+zip` is now IANA-registered
-
-1.1.2 / 2014-10-23
-==================
-
- * Rebuild database for `application/x-www-form-urlencoded` change
-
-1.1.1 / 2014-10-20
-==================
-
- * Mark `application/x-www-form-urlencoded` as compressible.
-
-1.1.0 / 2014-09-28
-==================
-
- * Add `application/font-woff2`
-
-1.0.3 / 2014-09-25
-==================
-
- * Fix engine requirement in package
-
-1.0.2 / 2014-09-25
-==================
-
- * Add `application/coap-group+json`
- * Add `application/dcd`
- * Add `application/vnd.apache.thrift.binary`
- * Add `image/vnd.tencent.tap`
- * Mark all JSON-derived types as compressible
- * Update `text/vtt` data
-
-1.0.1 / 2014-08-30
-==================
-
- * Fix extension ordering
-
-1.0.0 / 2014-08-30
-==================
-
- * Add `application/atf`
- * Add `application/merge-patch+json`
- * Add `multipart/x-mixed-replace`
- * Add `source: 'apache'` metadata
- * Add `source: 'iana'` metadata
- * Remove badly-assumed charset data
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE b/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE
deleted file mode 100644
index a7ae8ee..0000000
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-
-The MIT License (MIT)
-
-Copyright (c) 2014 Jonathan Ong me@jongleberry.com
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md b/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md
deleted file mode 100644
index 2c54bb4..0000000
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# mime-db
-
-[![NPM Version][npm-version-image]][npm-url]
-[![NPM Downloads][npm-downloads-image]][npm-url]
-[![Node.js Version][node-image]][node-url]
-[![Build Status][travis-image]][travis-url]
-[![Coverage Status][coveralls-image]][coveralls-url]
-
-This is a database of all mime types.
-It consists of a single, public JSON file and does not include any logic,
-allowing it to remain as un-opinionated as possible with an API.
-It aggregates data from the following sources:
-
-- http://www.iana.org/assignments/media-types/media-types.xhtml
-- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
-
-## Installation
-
-```bash
-npm install mime-db
-```
-
-If you're crazy enough to use this in the browser,
-you can just grab the JSON file:
-
-```
-https://cdn.rawgit.com/jshttp/mime-db/master/db.json
-```
-
-## Usage
-
-```js
-var db = require('mime-db');
-
-// grab data on .js files
-var data = db['application/javascript'];
-```
-
-## Data Structure
-
-The JSON file is a map lookup for lowercased mime types.
-Each mime type has the following properties:
-
-- `.source` - where the mime type is defined.
- If not set, it's probably a custom media type.
- - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
- - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
-- `.extensions[]` - known extensions associated with this mime type.
-- `.compressible` - whether a file of this type is can be gzipped.
-- `.charset` - the default charset associated with this type, if any.
-
-If unknown, every property could be `undefined`.
-
-## Contributing
-
-To edit the database, only make PRs against `src/custom.json` or
-`src/custom-suffix.json`.
-
-To update the build, run `npm run update`.
-
-## Adding Custom Media Types
-
-The best way to get new media types included in this library is to register
-them with the IANA. The community registration procedure is outlined in
-[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
-registered with the IANA are automatically pulled into this library.
-
-[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg
-[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg
-[npm-url]: https://npmjs.org/package/mime-db
-[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg
-[travis-url]: https://travis-ci.org/jshttp/mime-db
-[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg
-[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
-[node-image]: https://img.shields.io/node/v/mime-db.svg
-[node-url]: http://nodejs.org/download/
[58/59] [abbrv] couchdb-nmo git commit: add subcomponents to LICENSE
file
Posted by ro...@apache.org.
add subcomponents to LICENSE file
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/1f09715c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/1f09715c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/1f09715c
Branch: refs/heads/master
Commit: 1f09715ccf49bfb203499c571d0cef1cd865a6f8
Parents: 30c7a14
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Jun 26 00:58:25 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri Jun 26 00:58:25 2015 +0200
----------------------------------------------------------------------
LICENSE | 542 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 542 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/1f09715c/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index f6cd2bc..0044e32 100644
--- a/LICENSE
+++ b/LICENSE
@@ -200,3 +200,545 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+
+nmo Subcomponents
+
+The nmo project includes a number of subcomponents with separate
+copyright notices and license terms. Your use of the code for the these
+subcomponents is subject to the terms and conditions of the following licenses.
+
+
+node_modules/bluebird:
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Petka Antonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:</p>
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+node_modules/config-chain:
+
+Copyright (c) 2011 Dominic Tarr
+
+Permission is hereby granted, free of charge,
+to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to
+deal in the Software without restriction, including
+without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom
+the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+node_modules/config-chain/node_modules/proto-list:
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/ini:
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/nopt:
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/nopt/node_modules/abbrev:
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/osenv:
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/valid-url:
+
+Copyright (c) 2013 Odysseas Tsatalos and oDesk Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+node_modules/xtend:
+
+Copyright (c) 2012-2014 Raynos.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.å
+
+
+node_modules/npmlog:
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/npmlog/node_modules/ansi:
+
+(The MIT License)
+
+Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+node_modules/npmlog/node_modules/ansi:
+
+(The MIT License)
+
+Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+node_modules/npmlog/node_modules/readable-stream:
+
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
+
+node_modules/npmlog/node_modules/readable-stream/node_modules/core-util-is:
+
+MIT
+
+
+node_modules/npmlog/node_modules/readable-stream/node_modules/inherits:
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/npmlog/node_modules/readable-stream/node_modules/isarray:
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+node_modules/npmlog/node_modules/readable-stream/node_modules/string_decoder:
+
+Copyright Joyent, Inc. and other Node contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+node_modules/npmlog/node_modules/gauge:
+
+Copyright (c) 2014, Rebecca Turner <me...@re-becca.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/npmlog/node_modules/gauge/node_modules/has-unicode:
+
+Copyright (c) 2014, Rebecca Turner <me...@re-becca.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/lodash._createpadding/node_modules/lodash.repeat:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/lodash._createpadding/node_modules/lodash.repeat:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/lodash._createpadding/node_modules/lodash.repeat:
+node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/lodash._createpadding/node_modules/lodash.repeat:
+
+Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas,
+DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+node_modules/npmlog/node_modules/are-we-there-yet:
+
+ISC
+
+
+node_modules/wreck:
+
+Copyright (c) 2012-2014, Walmart and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/wreck/graphs/contributors
+
+
+node_modules/wreck/node_modules/boom:
+
+Copyright (c) 2012-2014, Walmart and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors
+
+
+node_modules/wreck/node_modules/boom:
+
+Copyright (c) 2011-2014, Walmart and other contributors.
+Copyright (c) 2011, Yahoo Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/hapi/graphs/contributors
+Portions of this project were initially based on the Yahoo! Inc. Postmile project,
+published at https://github.com/yahoo/postmile.
[19/59] [abbrv] couchdb-nmo git commit: add version command
Posted by ro...@apache.org.
add version command
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/ce0ece72
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/ce0ece72
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/ce0ece72
Branch: refs/heads/master
Commit: ce0ece7241cde2247ade3b50ac33c88720cfafd3
Parents: 0ce5e47
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Jun 3 02:59:27 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed Jun 3 02:59:27 2015 +0200
----------------------------------------------------------------------
bin/nmo-cli.js | 2 +-
doc/api/nmo-v.md | 11 +++++++++++
doc/cli/nmo-v.md | 12 ++++++++++++
src/help.js | 3 ++-
src/nmo.js | 6 +++++-
src/v.js | 22 ++++++++++++++++++++++
test/nemo.js | 8 ++++++++
test/v.js | 42 ++++++++++++++++++++++++++++++++++++++++++
8 files changed, 103 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/bin/nmo-cli.js
----------------------------------------------------------------------
diff --git a/bin/nmo-cli.js b/bin/nmo-cli.js
index 7ef2880..c1638be 100755
--- a/bin/nmo-cli.js
+++ b/bin/nmo-cli.js
@@ -9,7 +9,7 @@ var nmo = require('../lib/nmo.js');
var parsed = nopt({
'json': [Boolean],
'force': [Boolean]
-}, {}, process.argv, 2);
+}, {'v': 'v'}, process.argv, 2);
var cmd = parsed.argv.remain.shift();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/doc/api/nmo-v.md
----------------------------------------------------------------------
diff --git a/doc/api/nmo-v.md b/doc/api/nmo-v.md
new file mode 100644
index 0000000..83a75b0
--- /dev/null
+++ b/doc/api/nmo-v.md
@@ -0,0 +1,11 @@
+nmo-v(3) -- get the current nmo version
+=======================================
+
+## SYNOPSIS
+
+ nmo.commands.v()
+
+
+## DESCRIPTION
+
+Returns the current version of nmo.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/doc/cli/nmo-v.md
----------------------------------------------------------------------
diff --git a/doc/cli/nmo-v.md b/doc/cli/nmo-v.md
new file mode 100644
index 0000000..afd5605
--- /dev/null
+++ b/doc/cli/nmo-v.md
@@ -0,0 +1,12 @@
+nmo-v(1) -- get the current nmo version
+=======================================
+
+## SYNOPSIS
+
+ nmo v
+ nmo -v
+
+
+## DESCRIPTION
+
+Prints the current node and nmo version.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/src/help.js
----------------------------------------------------------------------
diff --git a/src/help.js b/src/help.js
index 9af9101..c135190 100644
--- a/src/help.js
+++ b/src/help.js
@@ -16,7 +16,8 @@ ${cmds}
Get help for a command:
nmo help <command>
-`;
+
+nmo@${nmo.version}`;
}
export default help;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/src/nmo.js
----------------------------------------------------------------------
diff --git a/src/nmo.js b/src/nmo.js
index 8fcc130..874cec9 100644
--- a/src/nmo.js
+++ b/src/nmo.js
@@ -1,11 +1,13 @@
import * as config from './config.js';
import Promise from 'bluebird';
+import pkg from '../package.json'
const commands = [
'isonline',
'help',
'config',
- 'cluster'
+ 'cluster',
+ 'v'
];
const nmo = {
@@ -30,6 +32,8 @@ Object.defineProperty(nmo, 'cli', {
}
});
+nmo.version = pkg.version;
+
const commandFuncs = {}, cliFuncs = {};
nmo.load = function load (opts) {
return new Promise((resolve, reject) => {
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/src/v.js
----------------------------------------------------------------------
diff --git a/src/v.js b/src/v.js
new file mode 100644
index 0000000..a0ca7be
--- /dev/null
+++ b/src/v.js
@@ -0,0 +1,22 @@
+import nmo from './nmo.js';
+
+
+export default version;
+function version () {
+ return new Promise((resolve, reject) => {
+ resolve({
+ nmo: nmo.version,
+ node: process.version
+ });
+ });
+}
+
+export const cli = versionCli;
+function versionCli () {
+ return new Promise((resolve, reject) => {
+ console.log(`nmo version: ${nmo.version}`);
+ console.log(`node version: ${process.version}`);
+ resolve();
+ });
+};
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/test/nemo.js
----------------------------------------------------------------------
diff --git a/test/nemo.js b/test/nemo.js
index f8f25ff..fe22b17 100644
--- a/test/nemo.js
+++ b/test/nemo.js
@@ -43,4 +43,12 @@ lab.experiment('nmo', () => {
done();
});
});
+
+ lab.test('has a version property', (done) => {
+ nmo.config = null;
+ nmo.load({nmoconf: __dirname + '/fixtures/randomini'}).then(() => {
+ assert.ok(nmo.version);
+ done();
+ });
+ });
});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/ce0ece72/test/v.js
----------------------------------------------------------------------
diff --git a/test/v.js b/test/v.js
new file mode 100644
index 0000000..9f7b70a
--- /dev/null
+++ b/test/v.js
@@ -0,0 +1,42 @@
+import assert from 'assert';
+
+import Lab from 'lab';
+export const lab = Lab.script();
+
+import * as version from '../src/v.js';
+import versionApi from '../src/v.js';
+
+import pkg from '../package.json'
+
+const oldConsole = console.log;
+
+lab.experiment('api: version', () => {
+
+ lab.test('gets the current nmo version', (done) => {
+ versionApi().then((res) => {
+ assert.equal(pkg.version, res.nmo);
+ done();
+ });
+ });
+});
+
+lab.experiment('cli: version', () => {
+ lab.afterEach((done) => {
+ console.log = oldConsole;
+ done();
+ });
+
+ lab.test('logs the current version', (done) => {
+ console.log = (...args) => {
+ if (/nmo/.test(args[0])) {
+ assert.ok(new RegExp(pkg.version, 'ig').test(args[0]));
+ }
+ };
+
+ version
+ .cli()
+ .then(() => {
+ done();
+ });
+ });
+});
[41/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/lib/browser.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/browser.js b/node_modules/request/node_modules/hawk/lib/browser.js
deleted file mode 100755
index 3307fa2..0000000
--- a/node_modules/request/node_modules/hawk/lib/browser.js
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
- HTTP Hawk Authentication Scheme
- Copyright (c) 2012-2014, Eran Hammer <er...@hammer.io>
- BSD Licensed
-*/
-
-
-// Declare namespace
-
-var hawk = {
- internals: {}
-};
-
-
-hawk.client = {
-
- // Generate an Authorization header for a given request
-
- /*
- uri: 'http://example.com/resource?a=b' or object generated by hawk.utils.parseUri()
- method: HTTP verb (e.g. 'GET', 'POST')
- options: {
-
- // Required
-
- credentials: {
- id: 'dh37fgj492je',
- key: 'aoijedoaijsdlaksjdl',
- algorithm: 'sha256' // 'sha1', 'sha256'
- },
-
- // Optional
-
- ext: 'application-specific', // Application specific data sent via the ext attribute
- timestamp: Date.now() / 1000, // A pre-calculated timestamp in seconds
- nonce: '2334f34f', // A pre-generated nonce
- localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
- payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
- contentType: 'application/json', // Payload content-type (ignored if hash provided)
- hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash
- app: '24s23423f34dx', // Oz application id
- dlg: '234sz34tww3sd' // Oz delegated-by application id
- }
- */
-
- header: function (uri, method, options) {
-
- var result = {
- field: '',
- artifacts: {}
- };
-
- // Validate inputs
-
- if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
- !method || typeof method !== 'string' ||
- !options || typeof options !== 'object') {
-
- result.err = 'Invalid argument type';
- return result;
- }
-
- // Application time
-
- var timestamp = options.timestamp || hawk.utils.now(options.localtimeOffsetMsec);
-
- // Validate credentials
-
- var credentials = options.credentials;
- if (!credentials ||
- !credentials.id ||
- !credentials.key ||
- !credentials.algorithm) {
-
- result.err = 'Invalid credentials object';
- return result;
- }
-
- if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- result.err = 'Unknown algorithm';
- return result;
- }
-
- // Parse URI
-
- if (typeof uri === 'string') {
- uri = hawk.utils.parseUri(uri);
- }
-
- // Calculate signature
-
- var artifacts = {
- ts: timestamp,
- nonce: options.nonce || hawk.utils.randomString(6),
- method: method,
- resource: uri.relative,
- host: uri.hostname,
- port: uri.port,
- hash: options.hash,
- ext: options.ext,
- app: options.app,
- dlg: options.dlg
- };
-
- result.artifacts = artifacts;
-
- // Calculate payload hash
-
- if (!artifacts.hash &&
- (options.payload || options.payload === '')) {
-
- artifacts.hash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
- }
-
- var mac = hawk.crypto.calculateMac('header', credentials, artifacts);
-
- // Construct header
-
- var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed
- var header = 'Hawk id="' + credentials.id +
- '", ts="' + artifacts.ts +
- '", nonce="' + artifacts.nonce +
- (artifacts.hash ? '", hash="' + artifacts.hash : '') +
- (hasExt ? '", ext="' + hawk.utils.escapeHeaderAttribute(artifacts.ext) : '') +
- '", mac="' + mac + '"';
-
- if (artifacts.app) {
- header += ', app="' + artifacts.app +
- (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
- }
-
- result.field = header;
-
- return result;
- },
-
- // Generate a bewit value for a given URI
-
- /*
- uri: 'http://example.com/resource?a=b'
- options: {
-
- // Required
-
- credentials: {
- id: 'dh37fgj492je',
- key: 'aoijedoaijsdlaksjdl',
- algorithm: 'sha256' // 'sha1', 'sha256'
- },
- ttlSec: 60 * 60, // TTL in seconds
-
- // Optional
-
- ext: 'application-specific', // Application specific data sent via the ext attribute
- localtimeOffsetMsec: 400 // Time offset to sync with server time
- };
- */
-
- bewit: function (uri, options) {
-
- // Validate inputs
-
- if (!uri ||
- (typeof uri !== 'string') ||
- !options ||
- typeof options !== 'object' ||
- !options.ttlSec) {
-
- return '';
- }
-
- options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value
-
- // Application time
-
- var now = hawk.utils.now(options.localtimeOffsetMsec);
-
- // Validate credentials
-
- var credentials = options.credentials;
- if (!credentials ||
- !credentials.id ||
- !credentials.key ||
- !credentials.algorithm) {
-
- return '';
- }
-
- if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return '';
- }
-
- // Parse URI
-
- uri = hawk.utils.parseUri(uri);
-
- // Calculate signature
-
- var exp = now + options.ttlSec;
- var mac = hawk.crypto.calculateMac('bewit', credentials, {
- ts: exp,
- nonce: '',
- method: 'GET',
- resource: uri.relative, // Maintain trailing '?' and query params
- host: uri.hostname,
- port: uri.port,
- ext: options.ext
- });
-
- // Construct bewit: id\exp\mac\ext
-
- var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
- return hawk.utils.base64urlEncode(bewit);
- },
-
- // Validate server response
-
- /*
- request: object created via 'new XMLHttpRequest()' after response received
- artifacts: object received from header().artifacts
- options: {
- payload: optional payload received
- required: specifies if a Server-Authorization header is required. Defaults to 'false'
- }
- */
-
- authenticate: function (request, credentials, artifacts, options) {
-
- options = options || {};
-
- var getHeader = function (name) {
-
- return request.getResponseHeader ? request.getResponseHeader(name) : request.getHeader(name);
- };
-
- var wwwAuthenticate = getHeader('www-authenticate');
- if (wwwAuthenticate) {
-
- // Parse HTTP WWW-Authenticate header
-
- var attributes = hawk.utils.parseAuthorizationHeader(wwwAuthenticate, ['ts', 'tsm', 'error']);
- if (!attributes) {
- return false;
- }
-
- if (attributes.ts) {
- var tsm = hawk.crypto.calculateTsMac(attributes.ts, credentials);
- if (tsm !== attributes.tsm) {
- return false;
- }
-
- hawk.utils.setNtpOffset(attributes.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
- }
- }
-
- // Parse HTTP Server-Authorization header
-
- var serverAuthorization = getHeader('server-authorization');
- if (!serverAuthorization &&
- !options.required) {
-
- return true;
- }
-
- var attributes = hawk.utils.parseAuthorizationHeader(serverAuthorization, ['mac', 'ext', 'hash']);
- if (!attributes) {
- return false;
- }
-
- var modArtifacts = {
- ts: artifacts.ts,
- nonce: artifacts.nonce,
- method: artifacts.method,
- resource: artifacts.resource,
- host: artifacts.host,
- port: artifacts.port,
- hash: attributes.hash,
- ext: attributes.ext,
- app: artifacts.app,
- dlg: artifacts.dlg
- };
-
- var mac = hawk.crypto.calculateMac('response', credentials, modArtifacts);
- if (mac !== attributes.mac) {
- return false;
- }
-
- if (!options.payload &&
- options.payload !== '') {
-
- return true;
- }
-
- if (!attributes.hash) {
- return false;
- }
-
- var calculatedHash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, getHeader('content-type'));
- return (calculatedHash === attributes.hash);
- },
-
- message: function (host, port, message, options) {
-
- // Validate inputs
-
- if (!host || typeof host !== 'string' ||
- !port || typeof port !== 'number' ||
- message === null || message === undefined || typeof message !== 'string' ||
- !options || typeof options !== 'object') {
-
- return null;
- }
-
- // Application time
-
- var timestamp = options.timestamp || hawk.utils.now(options.localtimeOffsetMsec);
-
- // Validate credentials
-
- var credentials = options.credentials;
- if (!credentials ||
- !credentials.id ||
- !credentials.key ||
- !credentials.algorithm) {
-
- // Invalid credential object
- return null;
- }
-
- if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return null;
- }
-
- // Calculate signature
-
- var artifacts = {
- ts: timestamp,
- nonce: options.nonce || hawk.utils.randomString(6),
- host: host,
- port: port,
- hash: hawk.crypto.calculatePayloadHash(message, credentials.algorithm)
- };
-
- // Construct authorization
-
- var result = {
- id: credentials.id,
- ts: artifacts.ts,
- nonce: artifacts.nonce,
- hash: artifacts.hash,
- mac: hawk.crypto.calculateMac('message', credentials, artifacts)
- };
-
- return result;
- },
-
- authenticateTimestamp: function (message, credentials, updateClock) { // updateClock defaults to true
-
- var tsm = hawk.crypto.calculateTsMac(message.ts, credentials);
- if (tsm !== message.tsm) {
- return false;
- }
-
- if (updateClock !== false) {
- hawk.utils.setNtpOffset(message.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
- }
-
- return true;
- }
-};
-
-
-hawk.crypto = {
-
- headerVersion: '1',
-
- algorithms: ['sha1', 'sha256'],
-
- calculateMac: function (type, credentials, options) {
-
- var normalized = hawk.crypto.generateNormalizedString(type, options);
-
- var hmac = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()](normalized, credentials.key);
- return hmac.toString(CryptoJS.enc.Base64);
- },
-
- generateNormalizedString: function (type, options) {
-
- var normalized = 'hawk.' + hawk.crypto.headerVersion + '.' + type + '\n' +
- options.ts + '\n' +
- options.nonce + '\n' +
- (options.method || '').toUpperCase() + '\n' +
- (options.resource || '') + '\n' +
- options.host.toLowerCase() + '\n' +
- options.port + '\n' +
- (options.hash || '') + '\n';
-
- if (options.ext) {
- normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
- }
-
- normalized += '\n';
-
- if (options.app) {
- normalized += options.app + '\n' +
- (options.dlg || '') + '\n';
- }
-
- return normalized;
- },
-
- calculatePayloadHash: function (payload, algorithm, contentType) {
-
- var hash = CryptoJS.algo[algorithm.toUpperCase()].create();
- hash.update('hawk.' + hawk.crypto.headerVersion + '.payload\n');
- hash.update(hawk.utils.parseContentType(contentType) + '\n');
- hash.update(payload);
- hash.update('\n');
- return hash.finalize().toString(CryptoJS.enc.Base64);
- },
-
- calculateTsMac: function (ts, credentials) {
-
- var hash = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()]('hawk.' + hawk.crypto.headerVersion + '.ts\n' + ts + '\n', credentials.key);
- return hash.toString(CryptoJS.enc.Base64);
- }
-};
-
-
-// localStorage compatible interface
-
-hawk.internals.LocalStorage = function () {
-
- this._cache = {};
- this.length = 0;
-
- this.getItem = function (key) {
-
- return this._cache.hasOwnProperty(key) ? String(this._cache[key]) : null;
- };
-
- this.setItem = function (key, value) {
-
- this._cache[key] = String(value);
- this.length = Object.keys(this._cache).length;
- };
-
- this.removeItem = function (key) {
-
- delete this._cache[key];
- this.length = Object.keys(this._cache).length;
- };
-
- this.clear = function () {
-
- this._cache = {};
- this.length = 0;
- };
-
- this.key = function (i) {
-
- return Object.keys(this._cache)[i || 0];
- };
-};
-
-
-hawk.utils = {
-
- storage: new hawk.internals.LocalStorage(),
-
- setStorage: function (storage) {
-
- var ntpOffset = hawk.utils.storage.getItem('hawk_ntp_offset');
- hawk.utils.storage = storage;
- if (ntpOffset) {
- hawk.utils.setNtpOffset(ntpOffset);
- }
- },
-
- setNtpOffset: function (offset) {
-
- try {
- hawk.utils.storage.setItem('hawk_ntp_offset', offset);
- }
- catch (err) {
- console.error('[hawk] could not write to storage.');
- console.error(err);
- }
- },
-
- getNtpOffset: function () {
-
- var offset = hawk.utils.storage.getItem('hawk_ntp_offset');
- if (!offset) {
- return 0;
- }
-
- return parseInt(offset, 10);
- },
-
- now: function (localtimeOffsetMsec) {
-
- return Math.floor(((new Date()).getTime() + (localtimeOffsetMsec || 0)) / 1000) + hawk.utils.getNtpOffset();
- },
-
- escapeHeaderAttribute: function (attribute) {
-
- return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"');
- },
-
- parseContentType: function (header) {
-
- if (!header) {
- return '';
- }
-
- return header.split(';')[0].replace(/^\s+|\s+$/g, '').toLowerCase();
- },
-
- parseAuthorizationHeader: function (header, keys) {
-
- if (!header) {
- return null;
- }
-
- var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/); // Header: scheme[ something]
- if (!headerParts) {
- return null;
- }
-
- var scheme = headerParts[1];
- if (scheme.toLowerCase() !== 'hawk') {
- return null;
- }
-
- var attributesString = headerParts[2];
- if (!attributesString) {
- return null;
- }
-
- var attributes = {};
- var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
-
- // Check valid attribute names
-
- if (keys.indexOf($1) === -1) {
- return;
- }
-
- // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
-
- if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
- return;
- }
-
- // Check for duplicates
-
- if (attributes.hasOwnProperty($1)) {
- return;
- }
-
- attributes[$1] = $2;
- return '';
- });
-
- if (verify !== '') {
- return null;
- }
-
- return attributes;
- },
-
- randomString: function (size) {
-
- var randomSource = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
- var len = randomSource.length;
-
- var result = [];
- for (var i = 0; i < size; ++i) {
- result[i] = randomSource[Math.floor(Math.random() * len)];
- }
-
- return result.join('');
- },
-
- parseUri: function (input) {
-
- // Based on: parseURI 1.2.2
- // http://blog.stevenlevithan.com/archives/parseuri
- // (c) Steven Levithan <stevenlevithan.com>
- // MIT License
-
- var keys = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'hostname', 'port', 'resource', 'relative', 'pathname', 'directory', 'file', 'query', 'fragment'];
-
- var uriRegex = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?)(?:#(.*))?)/;
- var uriByNumber = input.match(uriRegex);
- var uri = {};
-
- for (var i = 0, il = keys.length; i < il; ++i) {
- uri[keys[i]] = uriByNumber[i] || '';
- }
-
- if (uri.port === '') {
- uri.port = (uri.protocol.toLowerCase() === 'http' ? '80' : (uri.protocol.toLowerCase() === 'https' ? '443' : ''));
- }
-
- return uri;
- },
-
- base64urlEncode: function (value) {
-
- var wordArray = CryptoJS.enc.Utf8.parse(value);
- var encoded = CryptoJS.enc.Base64.stringify(wordArray);
- return encoded.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
- }
-};
-
-
-// $lab:coverage:off$
-
-// Based on: Crypto-JS v3.1.2
-// Copyright (c) 2009-2013, Jeff Mott. All rights reserved.
-// http://code.google.com/p/crypto-js/
-// http://code.google.com/p/crypto-js/wiki/License
-
-var CryptoJS = CryptoJS || function (h, r) { var k = {}, l = k.lib = {}, n = function () { }, f = l.Base = { extend: function (a) { n.prototype = this; var b = new n; a && b.mixIn(a); b.hasOwnProperty("init") || (b.init = function () { b.$super.init.apply(this, arguments) }); b.init.prototype = b; b.$super = this; return b }, create: function () { var a = this.extend(); a.init.apply(a, arguments); return a }, init: function () { }, mixIn: function (a) { for (var b in a) a.hasOwnProperty(b) && (this[b] = a[b]); a.hasOwnProperty("toString") && (this.toString = a.toString) }, clone: function () { return this.init.prototype.extend(this) } }, j = l.WordArray = f.extend({ init: function (a, b) { a = this.words = a || []; this.sigBytes = b != r ? b : 4 * a.length }, toString: function (a) { return (a || s).stringify(this) }, concat: function (a) { var b = this.words, d = a.words, c = this.sigBytes; a = a.sigBytes; this.clamp(); if (c % 4) for (var e = 0; e < a; e++) b[c + e >>> 2] |= (d[e
>>> 2] >>> 24 - 8 * (e % 4) & 255) << 24 - 8 * ((c + e) % 4); else if (65535 < d.length) for (e = 0; e < a; e += 4) b[c + e >>> 2] = d[e >>> 2]; else b.push.apply(b, d); this.sigBytes += a; return this }, clamp: function () { var a = this.words, b = this.sigBytes; a[b >>> 2] &= 4294967295 << 32 - 8 * (b % 4); a.length = h.ceil(b / 4) }, clone: function () { var a = f.clone.call(this); a.words = this.words.slice(0); return a }, random: function (a) { for (var b = [], d = 0; d < a; d += 4) b.push(4294967296 * h.random() | 0); return new j.init(b, a) } }), m = k.enc = {}, s = m.Hex = { stringify: function (a) { var b = a.words; a = a.sigBytes; for (var d = [], c = 0; c < a; c++) { var e = b[c >>> 2] >>> 24 - 8 * (c % 4) & 255; d.push((e >>> 4).toString(16)); d.push((e & 15).toString(16)) } return d.join("") }, parse: function (a) { for (var b = a.length, d = [], c = 0; c < b; c += 2) d[c >>> 3] |= parseInt(a.substr(c, 2), 16) << 24 - 4 * (c % 8); return new j.init(d, b / 2) } }, p = m.
Latin1 = { stringify: function (a) { var b = a.words; a = a.sigBytes; for (var d = [], c = 0; c < a; c++) d.push(String.fromCharCode(b[c >>> 2] >>> 24 - 8 * (c % 4) & 255)); return d.join("") }, parse: function (a) { for (var b = a.length, d = [], c = 0; c < b; c++) d[c >>> 2] |= (a.charCodeAt(c) & 255) << 24 - 8 * (c % 4); return new j.init(d, b) } }, t = m.Utf8 = { stringify: function (a) { try { return decodeURIComponent(escape(p.stringify(a))) } catch (b) { throw Error("Malformed UTF-8 data"); } }, parse: function (a) { return p.parse(unescape(encodeURIComponent(a))) } }, q = l.BufferedBlockAlgorithm = f.extend({ reset: function () { this._data = new j.init; this._nDataBytes = 0 }, _append: function (a) { "string" == typeof a && (a = t.parse(a)); this._data.concat(a); this._nDataBytes += a.sigBytes }, _process: function (a) { var b = this._data, d = b.words, c = b.sigBytes, e = this.blockSize, f = c / (4 * e), f = a ? h.ceil(f) : h.max((f | 0) - this._minBufferSize, 0); a = f *
e; c = h.min(4 * a, c); if (a) { for (var g = 0; g < a; g += e) this._doProcessBlock(d, g); g = d.splice(0, a); b.sigBytes -= c } return new j.init(g, c) }, clone: function () { var a = f.clone.call(this); a._data = this._data.clone(); return a }, _minBufferSize: 0 }); l.Hasher = q.extend({ cfg: f.extend(), init: function (a) { this.cfg = this.cfg.extend(a); this.reset() }, reset: function () { q.reset.call(this); this._doReset() }, update: function (a) { this._append(a); this._process(); return this }, finalize: function (a) { a && this._append(a); return this._doFinalize() }, blockSize: 16, _createHelper: function (a) { return function (b, d) { return (new a.init(d)).finalize(b) } }, _createHmacHelper: function (a) { return function (b, d) { return (new u.HMAC.init(a, d)).finalize(b) } } }); var u = k.algo = {}; return k }(Math);
-(function () { var k = CryptoJS, b = k.lib, m = b.WordArray, l = b.Hasher, d = [], b = k.algo.SHA1 = l.extend({ _doReset: function () { this._hash = new m.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) }, _doProcessBlock: function (n, p) { for (var a = this._hash.words, e = a[0], f = a[1], h = a[2], j = a[3], b = a[4], c = 0; 80 > c; c++) { if (16 > c) d[c] = n[p + c] | 0; else { var g = d[c - 3] ^ d[c - 8] ^ d[c - 14] ^ d[c - 16]; d[c] = g << 1 | g >>> 31 } g = (e << 5 | e >>> 27) + b + d[c]; g = 20 > c ? g + ((f & h | ~f & j) + 1518500249) : 40 > c ? g + ((f ^ h ^ j) + 1859775393) : 60 > c ? g + ((f & h | f & j | h & j) - 1894007588) : g + ((f ^ h ^ j) - 899497514); b = j; j = h; h = f << 30 | f >>> 2; f = e; e = g } a[0] = a[0] + e | 0; a[1] = a[1] + f | 0; a[2] = a[2] + h | 0; a[3] = a[3] + j | 0; a[4] = a[4] + b | 0 }, _doFinalize: function () { var b = this._data, d = b.words, a = 8 * this._nDataBytes, e = 8 * b.sigBytes; d[e >>> 5] |= 128 << 24 - e % 32; d[
(e + 64 >>> 9 << 4) + 14] = Math.floor(a / 4294967296); d[(e + 64 >>> 9 << 4) + 15] = a; b.sigBytes = 4 * d.length; this._process(); return this._hash }, clone: function () { var b = l.clone.call(this); b._hash = this._hash.clone(); return b } }); k.SHA1 = l._createHelper(b); k.HmacSHA1 = l._createHmacHelper(b) })();
-(function (k) { for (var g = CryptoJS, h = g.lib, v = h.WordArray, j = h.Hasher, h = g.algo, s = [], t = [], u = function (q) { return 4294967296 * (q - (q | 0)) | 0 }, l = 2, b = 0; 64 > b;) { var d; a: { d = l; for (var w = k.sqrt(d), r = 2; r <= w; r++) if (!(d % r)) { d = !1; break a } d = !0 } d && (8 > b && (s[b] = u(k.pow(l, 0.5))), t[b] = u(k.pow(l, 1 / 3)), b++); l++ } var n = [], h = h.SHA256 = j.extend({ _doReset: function () { this._hash = new v.init(s.slice(0)) }, _doProcessBlock: function (q, h) { for (var a = this._hash.words, c = a[0], d = a[1], b = a[2], k = a[3], f = a[4], g = a[5], j = a[6], l = a[7], e = 0; 64 > e; e++) { if (16 > e) n[e] = q[h + e] | 0; else { var m = n[e - 15], p = n[e - 2]; n[e] = ((m << 25 | m >>> 7) ^ (m << 14 | m >>> 18) ^ m >>> 3) + n[e - 7] + ((p << 15 | p >>> 17) ^ (p << 13 | p >>> 19) ^ p >>> 10) + n[e - 16] } m = l + ((f << 26 | f >>> 6) ^ (f << 21 | f >>> 11) ^ (f << 7 | f >>> 25)) + (f & g ^ ~f & j) + t[e] + n[e]; p = ((c << 30 | c >
>> 2) ^ (c << 19 | c >>> 13) ^ (c << 10 | c >>> 22)) + (c & d ^ c & b ^ d & b); l = j; j = g; g = f; f = k + m | 0; k = b; b = d; d = c; c = m + p | 0 } a[0] = a[0] + c | 0; a[1] = a[1] + d | 0; a[2] = a[2] + b | 0; a[3] = a[3] + k | 0; a[4] = a[4] + f | 0; a[5] = a[5] + g | 0; a[6] = a[6] + j | 0; a[7] = a[7] + l | 0 }, _doFinalize: function () { var d = this._data, b = d.words, a = 8 * this._nDataBytes, c = 8 * d.sigBytes; b[c >>> 5] |= 128 << 24 - c % 32; b[(c + 64 >>> 9 << 4) + 14] = k.floor(a / 4294967296); b[(c + 64 >>> 9 << 4) + 15] = a; d.sigBytes = 4 * b.length; this._process(); return this._hash }, clone: function () { var b = j.clone.call(this); b._hash = this._hash.clone(); return b } }); g.SHA256 = j._createHelper(h); g.HmacSHA256 = j._createHmacHelper(h) })(Math);
-(function () { var c = CryptoJS, k = c.enc.Utf8; c.algo.HMAC = c.lib.Base.extend({ init: function (a, b) { a = this._hasher = new a.init; "string" == typeof b && (b = k.parse(b)); var c = a.blockSize, e = 4 * c; b.sigBytes > e && (b = a.finalize(b)); b.clamp(); for (var f = this._oKey = b.clone(), g = this._iKey = b.clone(), h = f.words, j = g.words, d = 0; d < c; d++) h[d] ^= 1549556828, j[d] ^= 909522486; f.sigBytes = g.sigBytes = e; this.reset() }, reset: function () { var a = this._hasher; a.reset(); a.update(this._iKey) }, update: function (a) { this._hasher.update(a); return this }, finalize: function (a) { var b = this._hasher; a = b.finalize(a); b.reset(); return b.finalize(this._oKey.clone().concat(a)) } }) })();
-(function () { var h = CryptoJS, j = h.lib.WordArray; h.enc.Base64 = { stringify: function (b) { var e = b.words, f = b.sigBytes, c = this._map; b.clamp(); b = []; for (var a = 0; a < f; a += 3) for (var d = (e[a >>> 2] >>> 24 - 8 * (a % 4) & 255) << 16 | (e[a + 1 >>> 2] >>> 24 - 8 * ((a + 1) % 4) & 255) << 8 | e[a + 2 >>> 2] >>> 24 - 8 * ((a + 2) % 4) & 255, g = 0; 4 > g && a + 0.75 * g < f; g++) b.push(c.charAt(d >>> 6 * (3 - g) & 63)); if (e = c.charAt(64)) for (; b.length % 4;) b.push(e); return b.join("") }, parse: function (b) { var e = b.length, f = this._map, c = f.charAt(64); c && (c = b.indexOf(c), -1 != c && (e = c)); for (var c = [], a = 0, d = 0; d < e; d++) if (d % 4) { var g = f.indexOf(b.charAt(d - 1)) << 2 * (d % 4), h = f.indexOf(b.charAt(d)) >>> 6 - 2 * (d % 4); c[a >>> 2] |= (g | h) << 24 - 8 * (a % 4); a++ } return j.create(c, a) }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" } })();
-
-hawk.crypto.internals = CryptoJS;
-
-
-// Export if used as a module
-
-if (typeof module !== 'undefined' && module.exports) {
- module.exports = hawk;
-}
-
-// $lab:coverage:on$
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/lib/client.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/client.js b/node_modules/request/node_modules/hawk/lib/client.js
deleted file mode 100755
index 7fdd484..0000000
--- a/node_modules/request/node_modules/hawk/lib/client.js
+++ /dev/null
@@ -1,369 +0,0 @@
-// Load modules
-
-var Url = require('url');
-var Hoek = require('hoek');
-var Cryptiles = require('cryptiles');
-var Crypto = require('./crypto');
-var Utils = require('./utils');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Generate an Authorization header for a given request
-
-/*
- uri: 'http://example.com/resource?a=b' or object from Url.parse()
- method: HTTP verb (e.g. 'GET', 'POST')
- options: {
-
- // Required
-
- credentials: {
- id: 'dh37fgj492je',
- key: 'aoijedoaijsdlaksjdl',
- algorithm: 'sha256' // 'sha1', 'sha256'
- },
-
- // Optional
-
- ext: 'application-specific', // Application specific data sent via the ext attribute
- timestamp: Date.now(), // A pre-calculated timestamp
- nonce: '2334f34f', // A pre-generated nonce
- localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
- payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
- contentType: 'application/json', // Payload content-type (ignored if hash provided)
- hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash
- app: '24s23423f34dx', // Oz application id
- dlg: '234sz34tww3sd' // Oz delegated-by application id
- }
-*/
-
-exports.header = function (uri, method, options) {
-
- var result = {
- field: '',
- artifacts: {}
- };
-
- // Validate inputs
-
- if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
- !method || typeof method !== 'string' ||
- !options || typeof options !== 'object') {
-
- result.err = 'Invalid argument type';
- return result;
- }
-
- // Application time
-
- var timestamp = options.timestamp || Utils.nowSecs(options.localtimeOffsetMsec);
-
- // Validate credentials
-
- var credentials = options.credentials;
- if (!credentials ||
- !credentials.id ||
- !credentials.key ||
- !credentials.algorithm) {
-
- result.err = 'Invalid credential object';
- return result;
- }
-
- if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- result.err = 'Unknown algorithm';
- return result;
- }
-
- // Parse URI
-
- if (typeof uri === 'string') {
- uri = Url.parse(uri);
- }
-
- // Calculate signature
-
- var artifacts = {
- ts: timestamp,
- nonce: options.nonce || Cryptiles.randomString(6),
- method: method,
- resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
- host: uri.hostname,
- port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
- hash: options.hash,
- ext: options.ext,
- app: options.app,
- dlg: options.dlg
- };
-
- result.artifacts = artifacts;
-
- // Calculate payload hash
-
- if (!artifacts.hash &&
- (options.payload || options.payload === '')) {
-
- artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
- }
-
- var mac = Crypto.calculateMac('header', credentials, artifacts);
-
- // Construct header
-
- var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed
- var header = 'Hawk id="' + credentials.id +
- '", ts="' + artifacts.ts +
- '", nonce="' + artifacts.nonce +
- (artifacts.hash ? '", hash="' + artifacts.hash : '') +
- (hasExt ? '", ext="' + Hoek.escapeHeaderAttribute(artifacts.ext) : '') +
- '", mac="' + mac + '"';
-
- if (artifacts.app) {
- header += ', app="' + artifacts.app +
- (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
- }
-
- result.field = header;
-
- return result;
-};
-
-
-// Validate server response
-
-/*
- res: node's response object
- artifacts: object received from header().artifacts
- options: {
- payload: optional payload received
- required: specifies if a Server-Authorization header is required. Defaults to 'false'
- }
-*/
-
-exports.authenticate = function (res, credentials, artifacts, options) {
-
- artifacts = Hoek.clone(artifacts);
- options = options || {};
-
- if (res.headers['www-authenticate']) {
-
- // Parse HTTP WWW-Authenticate header
-
- var attributes = Utils.parseAuthorizationHeader(res.headers['www-authenticate'], ['ts', 'tsm', 'error']);
- if (attributes instanceof Error) {
- return false;
- }
-
- // Validate server timestamp (not used to update clock since it is done via the SNPT client)
-
- if (attributes.ts) {
- var tsm = Crypto.calculateTsMac(attributes.ts, credentials);
- if (tsm !== attributes.tsm) {
- return false;
- }
- }
- }
-
- // Parse HTTP Server-Authorization header
-
- if (!res.headers['server-authorization'] &&
- !options.required) {
-
- return true;
- }
-
- var attributes = Utils.parseAuthorizationHeader(res.headers['server-authorization'], ['mac', 'ext', 'hash']);
- if (attributes instanceof Error) {
- return false;
- }
-
- artifacts.ext = attributes.ext;
- artifacts.hash = attributes.hash;
-
- var mac = Crypto.calculateMac('response', credentials, artifacts);
- if (mac !== attributes.mac) {
- return false;
- }
-
- if (!options.payload &&
- options.payload !== '') {
-
- return true;
- }
-
- if (!attributes.hash) {
- return false;
- }
-
- var calculatedHash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, res.headers['content-type']);
- return (calculatedHash === attributes.hash);
-};
-
-
-// Generate a bewit value for a given URI
-
-/*
- uri: 'http://example.com/resource?a=b' or object from Url.parse()
- options: {
-
- // Required
-
- credentials: {
- id: 'dh37fgj492je',
- key: 'aoijedoaijsdlaksjdl',
- algorithm: 'sha256' // 'sha1', 'sha256'
- },
- ttlSec: 60 * 60, // TTL in seconds
-
- // Optional
-
- ext: 'application-specific', // Application specific data sent via the ext attribute
- localtimeOffsetMsec: 400 // Time offset to sync with server time
- };
-*/
-
-exports.getBewit = function (uri, options) {
-
- // Validate inputs
-
- if (!uri ||
- (typeof uri !== 'string' && typeof uri !== 'object') ||
- !options ||
- typeof options !== 'object' ||
- !options.ttlSec) {
-
- return '';
- }
-
- options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value
-
- // Application time
-
- var now = Utils.now(options.localtimeOffsetMsec);
-
- // Validate credentials
-
- var credentials = options.credentials;
- if (!credentials ||
- !credentials.id ||
- !credentials.key ||
- !credentials.algorithm) {
-
- return '';
- }
-
- if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return '';
- }
-
- // Parse URI
-
- if (typeof uri === 'string') {
- uri = Url.parse(uri);
- }
-
- // Calculate signature
-
- var exp = Math.floor(now / 1000) + options.ttlSec;
- var mac = Crypto.calculateMac('bewit', credentials, {
- ts: exp,
- nonce: '',
- method: 'GET',
- resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
- host: uri.hostname,
- port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
- ext: options.ext
- });
-
- // Construct bewit: id\exp\mac\ext
-
- var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
- return Hoek.base64urlEncode(bewit);
-};
-
-
-// Generate an authorization string for a message
-
-/*
- host: 'example.com',
- port: 8000,
- message: '{"some":"payload"}', // UTF-8 encoded string for body hash generation
- options: {
-
- // Required
-
- credentials: {
- id: 'dh37fgj492je',
- key: 'aoijedoaijsdlaksjdl',
- algorithm: 'sha256' // 'sha1', 'sha256'
- },
-
- // Optional
-
- timestamp: Date.now(), // A pre-calculated timestamp
- nonce: '2334f34f', // A pre-generated nonce
- localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
- }
-*/
-
-exports.message = function (host, port, message, options) {
-
- // Validate inputs
-
- if (!host || typeof host !== 'string' ||
- !port || typeof port !== 'number' ||
- message === null || message === undefined || typeof message !== 'string' ||
- !options || typeof options !== 'object') {
-
- return null;
- }
-
- // Application time
-
- var timestamp = options.timestamp || Utils.nowSecs(options.localtimeOffsetMsec);
-
- // Validate credentials
-
- var credentials = options.credentials;
- if (!credentials ||
- !credentials.id ||
- !credentials.key ||
- !credentials.algorithm) {
-
- // Invalid credential object
- return null;
- }
-
- if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return null;
- }
-
- // Calculate signature
-
- var artifacts = {
- ts: timestamp,
- nonce: options.nonce || Cryptiles.randomString(6),
- host: host,
- port: port,
- hash: Crypto.calculatePayloadHash(message, credentials.algorithm)
- };
-
- // Construct authorization
-
- var result = {
- id: credentials.id,
- ts: artifacts.ts,
- nonce: artifacts.nonce,
- hash: artifacts.hash,
- mac: Crypto.calculateMac('message', credentials, artifacts)
- };
-
- return result;
-};
-
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/lib/crypto.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/crypto.js b/node_modules/request/node_modules/hawk/lib/crypto.js
deleted file mode 100755
index d3c8244..0000000
--- a/node_modules/request/node_modules/hawk/lib/crypto.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Load modules
-
-var Crypto = require('crypto');
-var Url = require('url');
-var Utils = require('./utils');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// MAC normalization format version
-
-exports.headerVersion = '1'; // Prevent comparison of mac values generated with different normalized string formats
-
-
-// Supported HMAC algorithms
-
-exports.algorithms = ['sha1', 'sha256'];
-
-
-// Calculate the request MAC
-
-/*
- type: 'header', // 'header', 'bewit', 'response'
- credentials: {
- key: 'aoijedoaijsdlaksjdl',
- algorithm: 'sha256' // 'sha1', 'sha256'
- },
- options: {
- method: 'GET',
- resource: '/resource?a=1&b=2',
- host: 'example.com',
- port: 8080,
- ts: 1357718381034,
- nonce: 'd3d345f',
- hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
- ext: 'app-specific-data',
- app: 'hf48hd83qwkj', // Application id (Oz)
- dlg: 'd8djwekds9cj' // Delegated by application id (Oz), requires options.app
- }
-*/
-
-exports.calculateMac = function (type, credentials, options) {
-
- var normalized = exports.generateNormalizedString(type, options);
-
- var hmac = Crypto.createHmac(credentials.algorithm, credentials.key).update(normalized);
- var digest = hmac.digest('base64');
- return digest;
-};
-
-
-exports.generateNormalizedString = function (type, options) {
-
- var resource = options.resource || '';
- if (resource &&
- resource[0] !== '/') {
-
- var url = Url.parse(resource, false);
- resource = url.path; // Includes query
- }
-
- var normalized = 'hawk.' + exports.headerVersion + '.' + type + '\n' +
- options.ts + '\n' +
- options.nonce + '\n' +
- (options.method || '').toUpperCase() + '\n' +
- resource + '\n' +
- options.host.toLowerCase() + '\n' +
- options.port + '\n' +
- (options.hash || '') + '\n';
-
- if (options.ext) {
- normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
- }
-
- normalized += '\n';
-
- if (options.app) {
- normalized += options.app + '\n' +
- (options.dlg || '') + '\n';
- }
-
- return normalized;
-};
-
-
-exports.calculatePayloadHash = function (payload, algorithm, contentType) {
-
- var hash = exports.initializePayloadHash(algorithm, contentType);
- hash.update(payload || '');
- return exports.finalizePayloadHash(hash);
-};
-
-
-exports.initializePayloadHash = function (algorithm, contentType) {
-
- var hash = Crypto.createHash(algorithm);
- hash.update('hawk.' + exports.headerVersion + '.payload\n');
- hash.update(Utils.parseContentType(contentType) + '\n');
- return hash;
-};
-
-
-exports.finalizePayloadHash = function (hash) {
-
- hash.update('\n');
- return hash.digest('base64');
-};
-
-
-exports.calculateTsMac = function (ts, credentials) {
-
- var hmac = Crypto.createHmac(credentials.algorithm, credentials.key);
- hmac.update('hawk.' + exports.headerVersion + '.ts\n' + ts + '\n');
- return hmac.digest('base64');
-};
-
-
-exports.timestampMessage = function (credentials, localtimeOffsetMsec) {
-
- var now = Utils.nowSecs(localtimeOffsetMsec);
- var tsm = exports.calculateTsMac(now, credentials);
- return { ts: now, tsm: tsm };
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/index.js b/node_modules/request/node_modules/hawk/lib/index.js
deleted file mode 100755
index a883882..0000000
--- a/node_modules/request/node_modules/hawk/lib/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Export sub-modules
-
-exports.error = exports.Error = require('boom');
-exports.sntp = require('sntp');
-
-exports.server = require('./server');
-exports.client = require('./client');
-exports.crypto = require('./crypto');
-exports.utils = require('./utils');
-
-exports.uri = {
- authenticate: exports.server.authenticateBewit,
- getBewit: exports.client.getBewit
-};
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/lib/server.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/server.js b/node_modules/request/node_modules/hawk/lib/server.js
deleted file mode 100755
index a803930..0000000
--- a/node_modules/request/node_modules/hawk/lib/server.js
+++ /dev/null
@@ -1,534 +0,0 @@
-// Load modules
-
-var Boom = require('boom');
-var Hoek = require('hoek');
-var Cryptiles = require('cryptiles');
-var Crypto = require('./crypto');
-var Utils = require('./utils');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Hawk authentication
-
-/*
- req: node's HTTP request object or an object as follows:
-
- var request = {
- method: 'GET',
- url: '/resource/4?a=1&b=2',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
- };
-
- credentialsFunc: required function to lookup the set of Hawk credentials based on the provided credentials id.
- The credentials include the MAC key, MAC algorithm, and other attributes (such as username)
- needed by the application. This function is the equivalent of verifying the username and
- password in Basic authentication.
-
- var credentialsFunc = function (id, callback) {
-
- // Lookup credentials in database
- db.lookup(id, function (err, item) {
-
- if (err || !item) {
- return callback(err);
- }
-
- var credentials = {
- // Required
- key: item.key,
- algorithm: item.algorithm,
- // Application specific
- user: item.user
- };
-
- return callback(null, credentials);
- });
- };
-
- options: {
-
- hostHeaderName: optional header field name, used to override the default 'Host' header when used
- behind a cache of a proxy. Apache2 changes the value of the 'Host' header while preserving
- the original (which is what the module must verify) in the 'x-forwarded-host' header field.
- Only used when passed a node Http.ServerRequest object.
-
- nonceFunc: optional nonce validation function. The function signature is function(nonce, ts, callback)
- where 'callback' must be called using the signature function(err).
-
- timestampSkewSec: optional number of seconds of permitted clock skew for incoming timestamps. Defaults to 60 seconds.
- Provides a +/- skew which means actual allowed window is double the number of seconds.
-
- localtimeOffsetMsec: optional local clock time offset express in a number of milliseconds (positive or negative).
- Defaults to 0.
-
- payload: optional payload for validation. The client calculates the hash value and includes it via the 'hash'
- header attribute. The server always ensures the value provided has been included in the request
- MAC. When this option is provided, it validates the hash value itself. Validation is done by calculating
- a hash value over the entire payload (assuming it has already be normalized to the same format and
- encoding used by the client to calculate the hash on request). If the payload is not available at the time
- of authentication, the authenticatePayload() method can be used by passing it the credentials and
- attributes.hash returned in the authenticate callback.
-
- host: optional host name override. Only used when passed a node request object.
- port: optional port override. Only used when passed a node request object.
- }
-
- callback: function (err, credentials, artifacts) { }
- */
-
-exports.authenticate = function (req, credentialsFunc, options, callback) {
-
- callback = Hoek.nextTick(callback);
-
- // Default options
-
- options.nonceFunc = options.nonceFunc || function (nonce, ts, nonceCallback) { return nonceCallback(); }; // No validation
- options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds
-
- // Application time
-
- var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing
-
- // Convert node Http request object to a request configuration object
-
- var request = Utils.parseRequest(req, options);
- if (request instanceof Error) {
- return callback(Boom.badRequest(request.message));
- }
-
- // Parse HTTP Authorization header
-
- var attributes = Utils.parseAuthorizationHeader(request.authorization);
- if (attributes instanceof Error) {
- return callback(attributes);
- }
-
- // Construct artifacts container
-
- var artifacts = {
- method: request.method,
- host: request.host,
- port: request.port,
- resource: request.url,
- ts: attributes.ts,
- nonce: attributes.nonce,
- hash: attributes.hash,
- ext: attributes.ext,
- app: attributes.app,
- dlg: attributes.dlg,
- mac: attributes.mac,
- id: attributes.id
- };
-
- // Verify required header attributes
-
- if (!attributes.id ||
- !attributes.ts ||
- !attributes.nonce ||
- !attributes.mac) {
-
- return callback(Boom.badRequest('Missing attributes'), null, artifacts);
- }
-
- // Fetch Hawk credentials
-
- credentialsFunc(attributes.id, function (err, credentials) {
-
- if (err) {
- return callback(err, credentials || null, artifacts);
- }
-
- if (!credentials) {
- return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, artifacts);
- }
-
- if (!credentials.key ||
- !credentials.algorithm) {
-
- return callback(Boom.internal('Invalid credentials'), credentials, artifacts);
- }
-
- if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return callback(Boom.internal('Unknown algorithm'), credentials, artifacts);
- }
-
- // Calculate MAC
-
- var mac = Crypto.calculateMac('header', credentials, artifacts);
- if (!Cryptiles.fixedTimeComparison(mac, attributes.mac)) {
- return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, artifacts);
- }
-
- // Check payload hash
-
- if (options.payload ||
- options.payload === '') {
-
- if (!attributes.hash) {
- return callback(Boom.unauthorized('Missing required payload hash', 'Hawk'), credentials, artifacts);
- }
-
- var hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, request.contentType);
- if (!Cryptiles.fixedTimeComparison(hash, attributes.hash)) {
- return callback(Boom.unauthorized('Bad payload hash', 'Hawk'), credentials, artifacts);
- }
- }
-
- // Check nonce
-
- options.nonceFunc(attributes.nonce, attributes.ts, function (err) {
-
- if (err) {
- return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials, artifacts);
- }
-
- // Check timestamp staleness
-
- if (Math.abs((attributes.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
- var tsm = Crypto.timestampMessage(credentials, options.localtimeOffsetMsec);
- return callback(Boom.unauthorized('Stale timestamp', 'Hawk', tsm), credentials, artifacts);
- }
-
- // Successful authentication
-
- return callback(null, credentials, artifacts);
- });
- });
-};
-
-
-// Authenticate payload hash - used when payload cannot be provided during authenticate()
-
-/*
- payload: raw request payload
- credentials: from authenticate callback
- artifacts: from authenticate callback
- contentType: req.headers['content-type']
-*/
-
-exports.authenticatePayload = function (payload, credentials, artifacts, contentType) {
-
- var calculatedHash = Crypto.calculatePayloadHash(payload, credentials.algorithm, contentType);
- return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash);
-};
-
-
-// Authenticate payload hash - used when payload cannot be provided during authenticate()
-
-/*
- calculatedHash: the payload hash calculated using Crypto.calculatePayloadHash()
- artifacts: from authenticate callback
-*/
-
-exports.authenticatePayloadHash = function (calculatedHash, artifacts) {
-
- return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash);
-};
-
-
-// Generate a Server-Authorization header for a given response
-
-/*
- credentials: {}, // Object received from authenticate()
- artifacts: {} // Object received from authenticate(); 'mac', 'hash', and 'ext' - ignored
- options: {
- ext: 'application-specific', // Application specific data sent via the ext attribute
- payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
- contentType: 'application/json', // Payload content-type (ignored if hash provided)
- hash: 'U4MKKSmiVxk37JCCrAVIjV=' // Pre-calculated payload hash
- }
-*/
-
-exports.header = function (credentials, artifacts, options) {
-
- // Prepare inputs
-
- options = options || {};
-
- if (!artifacts ||
- typeof artifacts !== 'object' ||
- typeof options !== 'object') {
-
- return '';
- }
-
- artifacts = Hoek.clone(artifacts);
- delete artifacts.mac;
- artifacts.hash = options.hash;
- artifacts.ext = options.ext;
-
- // Validate credentials
-
- if (!credentials ||
- !credentials.key ||
- !credentials.algorithm) {
-
- // Invalid credential object
- return '';
- }
-
- if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return '';
- }
-
- // Calculate payload hash
-
- if (!artifacts.hash &&
- (options.payload || options.payload === '')) {
-
- artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
- }
-
- var mac = Crypto.calculateMac('response', credentials, artifacts);
-
- // Construct header
-
- var header = 'Hawk mac="' + mac + '"' +
- (artifacts.hash ? ', hash="' + artifacts.hash + '"' : '');
-
- if (artifacts.ext !== null &&
- artifacts.ext !== undefined &&
- artifacts.ext !== '') { // Other falsey values allowed
-
- header += ', ext="' + Hoek.escapeHeaderAttribute(artifacts.ext) + '"';
- }
-
- return header;
-};
-
-
-/*
- * Arguments and options are the same as authenticate() with the exception that the only supported options are:
- * 'hostHeaderName', 'localtimeOffsetMsec', 'host', 'port'
- */
-
-exports.authenticateBewit = function (req, credentialsFunc, options, callback) {
-
- callback = Hoek.nextTick(callback);
-
- // Application time
-
- var now = Utils.now(options.localtimeOffsetMsec);
-
- // Convert node Http request object to a request configuration object
-
- var request = Utils.parseRequest(req, options);
- if (request instanceof Error) {
- return callback(Boom.badRequest(request.message));
- }
-
- // Extract bewit
-
- // 1 2 3 4
- var resource = request.url.match(/^(\/.*)([\?&])bewit\=([^&$]*)(?:&(.+))?$/);
- if (!resource) {
- return callback(Boom.unauthorized(null, 'Hawk'));
- }
-
- // Bewit not empty
-
- if (!resource[3]) {
- return callback(Boom.unauthorized('Empty bewit', 'Hawk'));
- }
-
- // Verify method is GET
-
- if (request.method !== 'GET' &&
- request.method !== 'HEAD') {
-
- return callback(Boom.unauthorized('Invalid method', 'Hawk'));
- }
-
- // No other authentication
-
- if (request.authorization) {
- return callback(Boom.badRequest('Multiple authentications'));
- }
-
- // Parse bewit
-
- var bewitString = Hoek.base64urlDecode(resource[3]);
- if (bewitString instanceof Error) {
- return callback(Boom.badRequest('Invalid bewit encoding'));
- }
-
- // Bewit format: id\exp\mac\ext ('\' is used because it is a reserved header attribute character)
-
- var bewitParts = bewitString.split('\\');
- if (bewitParts.length !== 4) {
- return callback(Boom.badRequest('Invalid bewit structure'));
- }
-
- var bewit = {
- id: bewitParts[0],
- exp: parseInt(bewitParts[1], 10),
- mac: bewitParts[2],
- ext: bewitParts[3] || ''
- };
-
- if (!bewit.id ||
- !bewit.exp ||
- !bewit.mac) {
-
- return callback(Boom.badRequest('Missing bewit attributes'));
- }
-
- // Construct URL without bewit
-
- var url = resource[1];
- if (resource[4]) {
- url += resource[2] + resource[4];
- }
-
- // Check expiration
-
- if (bewit.exp * 1000 <= now) {
- return callback(Boom.unauthorized('Access expired', 'Hawk'), null, bewit);
- }
-
- // Fetch Hawk credentials
-
- credentialsFunc(bewit.id, function (err, credentials) {
-
- if (err) {
- return callback(err, credentials || null, bewit.ext);
- }
-
- if (!credentials) {
- return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, bewit);
- }
-
- if (!credentials.key ||
- !credentials.algorithm) {
-
- return callback(Boom.internal('Invalid credentials'), credentials, bewit);
- }
-
- if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return callback(Boom.internal('Unknown algorithm'), credentials, bewit);
- }
-
- // Calculate MAC
-
- var mac = Crypto.calculateMac('bewit', credentials, {
- ts: bewit.exp,
- nonce: '',
- method: 'GET',
- resource: url,
- host: request.host,
- port: request.port,
- ext: bewit.ext
- });
-
- if (!Cryptiles.fixedTimeComparison(mac, bewit.mac)) {
- return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, bewit);
- }
-
- // Successful authentication
-
- return callback(null, credentials, bewit);
- });
-};
-
-
-/*
- * options are the same as authenticate() with the exception that the only supported options are:
- * 'nonceFunc', 'timestampSkewSec', 'localtimeOffsetMsec'
- */
-
-exports.authenticateMessage = function (host, port, message, authorization, credentialsFunc, options, callback) {
-
- callback = Hoek.nextTick(callback);
-
- // Default options
-
- options.nonceFunc = options.nonceFunc || function (nonce, ts, nonceCallback) { return nonceCallback(); }; // No validation
- options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds
-
- // Application time
-
- var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing
-
- // Validate authorization
-
- if (!authorization.id ||
- !authorization.ts ||
- !authorization.nonce ||
- !authorization.hash ||
- !authorization.mac) {
-
- return callback(Boom.badRequest('Invalid authorization'))
- }
-
- // Fetch Hawk credentials
-
- credentialsFunc(authorization.id, function (err, credentials) {
-
- if (err) {
- return callback(err, credentials || null);
- }
-
- if (!credentials) {
- return callback(Boom.unauthorized('Unknown credentials', 'Hawk'));
- }
-
- if (!credentials.key ||
- !credentials.algorithm) {
-
- return callback(Boom.internal('Invalid credentials'), credentials);
- }
-
- if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
- return callback(Boom.internal('Unknown algorithm'), credentials);
- }
-
- // Construct artifacts container
-
- var artifacts = {
- ts: authorization.ts,
- nonce: authorization.nonce,
- host: host,
- port: port,
- hash: authorization.hash
- };
-
- // Calculate MAC
-
- var mac = Crypto.calculateMac('message', credentials, artifacts);
- if (!Cryptiles.fixedTimeComparison(mac, authorization.mac)) {
- return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials);
- }
-
- // Check payload hash
-
- var hash = Crypto.calculatePayloadHash(message, credentials.algorithm);
- if (!Cryptiles.fixedTimeComparison(hash, authorization.hash)) {
- return callback(Boom.unauthorized('Bad message hash', 'Hawk'), credentials);
- }
-
- // Check nonce
-
- options.nonceFunc(authorization.nonce, authorization.ts, function (err) {
-
- if (err) {
- return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials);
- }
-
- // Check timestamp staleness
-
- if (Math.abs((authorization.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
- return callback(Boom.unauthorized('Stale timestamp'), credentials);
- }
-
- // Successful authentication
-
- return callback(null, credentials);
- });
- });
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/lib/utils.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/utils.js b/node_modules/request/node_modules/hawk/lib/utils.js
deleted file mode 100755
index de74606..0000000
--- a/node_modules/request/node_modules/hawk/lib/utils.js
+++ /dev/null
@@ -1,164 +0,0 @@
-// Load modules
-
-var Sntp = require('sntp');
-var Boom = require('boom');
-
-
-// Declare internals
-
-var internals = {};
-
-
-exports.version = function () {
-
- return require('../package.json').version;
-};
-
-
-// Extract host and port from request
-
-// $1 $2
-internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+))?(?:(?:\r\n)?\s)*$/; // (IPv4, hostname)|(IPv6)
-
-
-exports.parseHost = function (req, hostHeaderName) {
-
- hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host');
- var hostHeader = req.headers[hostHeaderName];
- if (!hostHeader) {
- return null;
- }
-
- var hostParts = hostHeader.match(internals.hostHeaderRegex);
- if (!hostParts) {
- return null;
- }
-
- return {
- name: hostParts[1],
- port: (hostParts[2] ? hostParts[2] : (req.connection && req.connection.encrypted ? 443 : 80))
- };
-};
-
-
-// Parse Content-Type header content
-
-exports.parseContentType = function (header) {
-
- if (!header) {
- return '';
- }
-
- return header.split(';')[0].trim().toLowerCase();
-};
-
-
-// Convert node's to request configuration object
-
-exports.parseRequest = function (req, options) {
-
- if (!req.headers) {
- return req;
- }
-
- // Obtain host and port information
-
- if (!options.host || !options.port) {
- var host = exports.parseHost(req, options.hostHeaderName);
- if (!host) {
- return new Error('Invalid Host header');
- }
- }
-
- var request = {
- method: req.method,
- url: req.url,
- host: options.host || host.name,
- port: options.port || host.port,
- authorization: req.headers.authorization,
- contentType: req.headers['content-type'] || ''
- };
-
- return request;
-};
-
-
-exports.now = function (localtimeOffsetMsec) {
-
- return Sntp.now() + (localtimeOffsetMsec || 0);
-};
-
-
-exports.nowSecs = function (localtimeOffsetMsec) {
-
- return Math.floor(exports.now(localtimeOffsetMsec) / 1000);
-};
-
-
-// Parse Hawk HTTP Authorization header
-
-exports.parseAuthorizationHeader = function (header, keys) {
-
- keys = keys || ['id', 'ts', 'nonce', 'hash', 'ext', 'mac', 'app', 'dlg'];
-
- if (!header) {
- return Boom.unauthorized(null, 'Hawk');
- }
-
- var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/); // Header: scheme[ something]
- if (!headerParts) {
- return Boom.badRequest('Invalid header syntax');
- }
-
- var scheme = headerParts[1];
- if (scheme.toLowerCase() !== 'hawk') {
- return Boom.unauthorized(null, 'Hawk');
- }
-
- var attributesString = headerParts[2];
- if (!attributesString) {
- return Boom.badRequest('Invalid header syntax');
- }
-
- var attributes = {};
- var errorMessage = '';
- var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
-
- // Check valid attribute names
-
- if (keys.indexOf($1) === -1) {
- errorMessage = 'Unknown attribute: ' + $1;
- return;
- }
-
- // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
-
- if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
- errorMessage = 'Bad attribute value: ' + $1;
- return;
- }
-
- // Check for duplicates
-
- if (attributes.hasOwnProperty($1)) {
- errorMessage = 'Duplicate attribute: ' + $1;
- return;
- }
-
- attributes[$1] = $2;
- return '';
- });
-
- if (verify !== '') {
- return Boom.badRequest(errorMessage || 'Bad header format');
- }
-
- return attributes;
-};
-
-
-exports.unauthorized = function (message) {
-
- return Boom.unauthorized(message, 'Hawk');
-};
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore b/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore
deleted file mode 100644
index 77ba16c..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore
+++ /dev/null
@@ -1,18 +0,0 @@
-.idea
-*.iml
-npm-debug.log
-dump.rdb
-node_modules
-results.tap
-results.xml
-npm-shrinkwrap.json
-config.json
-.DS_Store
-*/.DS_Store
-*/*/.DS_Store
-._*
-*/._*
-*/*/._*
-coverage.*
-lib-cov
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml
deleted file mode 100755
index c84aade..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: node_js
-
-node_js:
- - 0.10
- - 0.12
- - iojs
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md b/node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md
deleted file mode 100644
index 8928361..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md
+++ /dev/null
@@ -1 +0,0 @@
-Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE b/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE
deleted file mode 100755
index 3946889..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2012-2014, Walmart and other contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * The names of any contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- * * *
-
-The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/README.md b/node_modules/request/node_modules/hawk/node_modules/boom/README.md
deleted file mode 100755
index 43f1562..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/README.md
+++ /dev/null
@@ -1,583 +0,0 @@
-
-
-HTTP-friendly error objects
-
-[](http://travis-ci.org/hapijs/boom)
-[](https://www.npmjs.com/package/boom)
-
-Lead Maintainer: [Adam Bretz](https://github.com/arb)
-
-**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response
-object (instance of `Error`) which includes the following properties:
-- `isBoom` - if `true`, indicates this is a `Boom` object instance.
-- `isServer` - convenience bool indicating status code >= 500.
-- `message` - the error message.
-- `output` - the formatted response. Can be directly manipulated after object construction to return a custom
- error response. Allowed root keys:
- - `statusCode` - the HTTP status code (typically 4xx or 5xx).
- - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content.
- - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any
- changes will be lost
- if `reformat()` is called. Any content allowed and by default includes the following content:
- - `statusCode` - the HTTP status code, derived from `error.output.statusCode`.
- - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`.
- - `message` - the error message derived from `error.message`.
-- inherited `Error` properties.
-
-The `Boom` object also supports the following method:
-- `reformat()` - rebuilds `error.output` using the other object properties.
-
-## Helper Methods
-
-### `wrap(error, [statusCode], [message])`
-
-Decorates an error with the **boom** properties where:
-- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object.
-- `statusCode` - optional HTTP status code. Defaults to `500`.
-- `message` - optional message string. If the error already has a message, it adds the message as a prefix.
- Defaults to no message.
-
-```js
-var error = new Error('Unexpected input');
-Boom.wrap(error, 400);
-```
-
-### `create(statusCode, [message], [data])`
-
-Generates an `Error` object with the **boom** decorations where:
-- `statusCode` - an HTTP error code number. Must be greater or equal 400.
-- `message` - optional message string.
-- `data` - additional error data set to `error.data` property.
-
-```js
-var error = Boom.create(400, 'Bad request', { timestamp: Date.now() });
-```
-
-## HTTP 4xx Errors
-
-### `Boom.badRequest([message], [data])`
-
-Returns a 400 Bad Request error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.badRequest('invalid query');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 400,
- "error": "Bad Request",
- "message": "invalid query"
-}
-```
-
-### `Boom.unauthorized([message], [scheme], [attributes])`
-
-Returns a 401 Unauthorized error where:
-- `message` - optional message.
-- `scheme` can be one of the following:
- - an authentication scheme name
- - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header.
-- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"'. `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header will not be present and `isMissing` will be true on the error object.
-
-If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response.
-
-```js
-Boom.unauthorized('invalid password');
-```
-
-Generates the following response:
-
-```json
-"payload": {
- "statusCode": 401,
- "error": "Unauthorized",
- "message": "invalid password"
-},
-"headers" {}
-```
-
-```js
-Boom.unauthorized('invalid password', 'sample');
-```
-
-Generates the following response:
-
-```json
-"payload": {
- "statusCode": 401,
- "error": "Unauthorized",
- "message": "invalid password"
-},
-"headers" {
- "WWW-Authenticate": "sample error=\"invalid password\""
-}
-```
-
-```js
-Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' });
-```
-
-Generates the following response:
-
-```json
-"payload": {
- "statusCode": 401,
- "error": "Unauthorized",
- "message": "invalid password"
-},
-"headers" {
- "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\""
-}
-```
-
-### `Boom.forbidden([message], [data])`
-
-Returns a 403 Forbidden error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.forbidden('try again some time');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 403,
- "error": "Forbidden",
- "message": "try again some time"
-}
-```
-
-### `Boom.notFound([message], [data])`
-
-Returns a 404 Not Found error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.notFound('missing');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 404,
- "error": "Not Found",
- "message": "missing"
-}
-```
-
-### `Boom.methodNotAllowed([message], [data])`
-
-Returns a 405 Method Not Allowed error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.methodNotAllowed('that method is not allowed');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 405,
- "error": "Method Not Allowed",
- "message": "that method is not allowed"
-}
-```
-
-### `Boom.notAcceptable([message], [data])`
-
-Returns a 406 Not Acceptable error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.notAcceptable('unacceptable');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 406,
- "error": "Not Acceptable",
- "message": "unacceptable"
-}
-```
-
-### `Boom.proxyAuthRequired([message], [data])`
-
-Returns a 407 Proxy Authentication Required error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.proxyAuthRequired('auth missing');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 407,
- "error": "Proxy Authentication Required",
- "message": "auth missing"
-}
-```
-
-### `Boom.clientTimeout([message], [data])`
-
-Returns a 408 Request Time-out error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.clientTimeout('timed out');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 408,
- "error": "Request Time-out",
- "message": "timed out"
-}
-```
-
-### `Boom.conflict([message], [data])`
-
-Returns a 409 Conflict error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.conflict('there was a conflict');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 409,
- "error": "Conflict",
- "message": "there was a conflict"
-}
-```
-
-### `Boom.resourceGone([message], [data])`
-
-Returns a 410 Gone error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.resourceGone('it is gone');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 410,
- "error": "Gone",
- "message": "it is gone"
-}
-```
-
-### `Boom.lengthRequired([message], [data])`
-
-Returns a 411 Length Required error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.lengthRequired('length needed');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 411,
- "error": "Length Required",
- "message": "length needed"
-}
-```
-
-### `Boom.preconditionFailed([message], [data])`
-
-Returns a 412 Precondition Failed error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.preconditionFailed();
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 412,
- "error": "Precondition Failed"
-}
-```
-
-### `Boom.entityTooLarge([message], [data])`
-
-Returns a 413 Request Entity Too Large error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.entityTooLarge('too big');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 413,
- "error": "Request Entity Too Large",
- "message": "too big"
-}
-```
-
-### `Boom.uriTooLong([message], [data])`
-
-Returns a 414 Request-URI Too Large error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.uriTooLong('uri is too long');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 414,
- "error": "Request-URI Too Large",
- "message": "uri is too long"
-}
-```
-
-### `Boom.unsupportedMediaType([message], [data])`
-
-Returns a 415 Unsupported Media Type error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.unsupportedMediaType('that media is not supported');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 415,
- "error": "Unsupported Media Type",
- "message": "that media is not supported"
-}
-```
-
-### `Boom.rangeNotSatisfiable([message], [data])`
-
-Returns a 416 Requested Range Not Satisfiable error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.rangeNotSatisfiable();
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 416,
- "error": "Requested Range Not Satisfiable"
-}
-```
-
-### `Boom.expectationFailed([message], [data])`
-
-Returns a 417 Expectation Failed error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.expectationFailed('expected this to work');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 417,
- "error": "Expectation Failed",
- "message": "expected this to work"
-}
-```
-
-### `Boom.badData([message], [data])`
-
-Returns a 422 Unprocessable Entity error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.badData('your data is bad and you should feel bad');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 422,
- "error": "Unprocessable Entity",
- "message": "your data is bad and you should feel bad"
-}
-```
-
-### `Boom.tooManyRequests([message], [data])`
-
-Returns a 429 Too Many Requests error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.tooManyRequests('you have exceeded your request limit');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 429,
- "error": "Too Many Requests",
- "message": "you have exceeded your request limit"
-}
-```
-
-## HTTP 5xx Errors
-
-All 500 errors hide your message from the end user. Your message is recorded in the server log.
-
-### `Boom.notImplemented([message], [data])`
-
-Returns a 501 Not Implemented error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.notImplemented('method not implemented');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 501,
- "error": "Not Implemented",
- "message": "method not implemented"
-}
-```
-
-### `Boom.badGateway([message], [data])`
-
-Returns a 502 Bad Gateway error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.badGateway('that is a bad gateway');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 502,
- "error": "Bad Gateway",
- "message": "that is a bad gateway"
-}
-```
-
-### `Boom.serverTimeout([message], [data])`
-
-Returns a 503 Service Unavailable error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.serverTimeout('unavailable');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 503,
- "error": "Service Unavailable",
- "message": "unavailable"
-}
-```
-
-### `Boom.gatewayTimeout([message], [data])`
-
-Returns a 504 Gateway Time-out error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.gatewayTimeout();
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 504,
- "error": "Gateway Time-out"
-}
-```
-
-### `Boom.badImplementation([message], [data])`
-
-Returns a 500 Internal Server Error error where:
-- `message` - optional message.
-- `data` - optional additional error data.
-
-```js
-Boom.badImplementation('terrible implementation');
-```
-
-Generates the following response payload:
-
-```json
-{
- "statusCode": 500,
- "error": "Internal Server Error",
- "message": "An internal server error occurred"
-}
-```
-
-## F.A.Q.
-
-###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives?
-
-There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png b/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png
deleted file mode 100755
index 373bc13..0000000
Binary files a/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/index.js b/node_modules/request/node_modules/hawk/node_modules/boom/index.js
deleted file mode 100755
index 4cc88b3..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib');
\ No newline at end of file
[52/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
remove request module
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/7ee4acde
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/7ee4acde
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/7ee4acde
Branch: refs/heads/master
Commit: 7ee4acdec34d96896601f050cc13a7bc3e406f56
Parents: 1d9e376
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Jun 26 00:50:50 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri Jun 26 00:50:50 2015 +0200
----------------------------------------------------------------------
node_modules/request/.eslintrc | 39 -
node_modules/request/.npmignore | 3 -
node_modules/request/.travis.yml | 12 -
node_modules/request/CHANGELOG.md | 467 -
node_modules/request/CONTRIBUTING.md | 44 -
node_modules/request/LICENSE | 55 -
node_modules/request/README.md | 1031 --
node_modules/request/disabled.appveyor.yml | 36 -
node_modules/request/examples/README.md | 115 -
node_modules/request/index.js | 154 -
node_modules/request/lib/auth.js | 153 -
node_modules/request/lib/cookies.js | 39 -
node_modules/request/lib/copy.js | 10 -
node_modules/request/lib/getProxyFromURI.js | 79 -
node_modules/request/lib/har.js | 205 -
node_modules/request/lib/helpers.js | 55 -
node_modules/request/lib/multipart.js | 109 -
node_modules/request/lib/oauth.js | 125 -
node_modules/request/lib/redirect.js | 154 -
.../request/node_modules/.bin/har-validator | 1 -
node_modules/request/node_modules/.bin/uuid | 1 -
.../request/node_modules/aws-sign2/LICENSE | 55 -
.../request/node_modules/aws-sign2/README.md | 4 -
.../request/node_modules/aws-sign2/index.js | 202 -
.../request/node_modules/aws-sign2/package.json | 47 -
node_modules/request/node_modules/bl/.jshintrc | 59 -
node_modules/request/node_modules/bl/.npmignore | 1 -
.../request/node_modules/bl/.travis.yml | 11 -
node_modules/request/node_modules/bl/LICENSE.md | 13 -
node_modules/request/node_modules/bl/README.md | 198 -
node_modules/request/node_modules/bl/bl.js | 216 -
.../bl/node_modules/readable-stream/.npmignore | 5 -
.../bl/node_modules/readable-stream/LICENSE | 18 -
.../bl/node_modules/readable-stream/README.md | 15 -
.../bl/node_modules/readable-stream/duplex.js | 1 -
.../readable-stream/lib/_stream_duplex.js | 89 -
.../readable-stream/lib/_stream_passthrough.js | 46 -
.../readable-stream/lib/_stream_readable.js | 982 --
.../readable-stream/lib/_stream_transform.js | 210 -
.../readable-stream/lib/_stream_writable.js | 386 -
.../node_modules/core-util-is/README.md | 3 -
.../node_modules/core-util-is/float.patch | 604 -
.../node_modules/core-util-is/lib/util.js | 107 -
.../node_modules/core-util-is/package.json | 54 -
.../node_modules/core-util-is/util.js | 106 -
.../node_modules/inherits/LICENSE | 16 -
.../node_modules/inherits/README.md | 42 -
.../node_modules/inherits/inherits.js | 1 -
.../node_modules/inherits/inherits_browser.js | 23 -
.../node_modules/inherits/package.json | 51 -
.../node_modules/inherits/test.js | 25 -
.../node_modules/isarray/README.md | 54 -
.../node_modules/isarray/build/build.js | 209 -
.../node_modules/isarray/component.json | 19 -
.../node_modules/isarray/index.js | 3 -
.../node_modules/isarray/package.json | 53 -
.../node_modules/string_decoder/.npmignore | 2 -
.../node_modules/string_decoder/LICENSE | 20 -
.../node_modules/string_decoder/README.md | 7 -
.../node_modules/string_decoder/index.js | 221 -
.../node_modules/string_decoder/package.json | 54 -
.../node_modules/readable-stream/package.json | 70 -
.../node_modules/readable-stream/passthrough.js | 1 -
.../bl/node_modules/readable-stream/readable.js | 8 -
.../node_modules/readable-stream/transform.js | 1 -
.../bl/node_modules/readable-stream/writable.js | 1 -
.../request/node_modules/bl/package.json | 62 -
.../request/node_modules/bl/test/basic-test.js | 541 -
.../request/node_modules/bl/test/sauce.js | 38 -
.../request/node_modules/bl/test/test.js | 9 -
.../request/node_modules/caseless/README.md | 45 -
.../request/node_modules/caseless/index.js | 65 -
.../request/node_modules/caseless/package.json | 57 -
.../request/node_modules/caseless/test.js | 40 -
.../node_modules/combined-stream/License | 19 -
.../node_modules/combined-stream/Readme.md | 132 -
.../combined-stream/lib/combined_stream.js | 188 -
.../node_modules/delayed-stream/.npmignore | 2 -
.../node_modules/delayed-stream/License | 19 -
.../node_modules/delayed-stream/Makefile | 7 -
.../node_modules/delayed-stream/Readme.md | 154 -
.../delayed-stream/lib/delayed_stream.js | 99 -
.../node_modules/delayed-stream/package.json | 42 -
.../node_modules/delayed-stream/test/common.js | 6 -
.../integration/test-delayed-http-upload.js | 38 -
.../test-delayed-stream-auto-pause.js | 21 -
.../integration/test-delayed-stream-pause.js | 14 -
.../test/integration/test-delayed-stream.js | 48 -
.../integration/test-handle-source-errors.js | 15 -
.../test/integration/test-max-data-size.js | 18 -
.../test/integration/test-pipe-resumes.js | 13 -
.../test/integration/test-proxy-readable.js | 13 -
.../node_modules/delayed-stream/test/run.js | 7 -
.../node_modules/combined-stream/package.json | 60 -
.../request/node_modules/forever-agent/LICENSE | 55 -
.../node_modules/forever-agent/README.md | 4 -
.../request/node_modules/forever-agent/index.js | 138 -
.../node_modules/forever-agent/package.json | 56 -
.../request/node_modules/form-data/License | 19 -
.../request/node_modules/form-data/Readme.md | 175 -
.../node_modules/form-data/lib/form_data.js | 351 -
.../form-data/node_modules/async/.travis.yml | 5 -
.../form-data/node_modules/async/LICENSE | 19 -
.../form-data/node_modules/async/README.md | 1647 ---
.../form-data/node_modules/async/bower.json | 38 -
.../form-data/node_modules/async/component.json | 16 -
.../form-data/node_modules/async/lib/async.js | 1123 --
.../form-data/node_modules/async/package.json | 84 -
.../async/support/sync-package-managers.js | 53 -
.../request/node_modules/form-data/package.json | 80 -
.../request/node_modules/har-validator/LICENSE | 21 -
.../node_modules/har-validator/README.md | 362 -
.../har-validator/bin/har-validator | 45 -
.../har-validator/node_modules/chalk/index.js | 100 -
.../har-validator/node_modules/chalk/license | 21 -
.../chalk/node_modules/.bin/has-ansi | 1 -
.../chalk/node_modules/.bin/strip-ansi | 1 -
.../chalk/node_modules/.bin/supports-color | 1 -
.../chalk/node_modules/ansi-styles/index.js | 56 -
.../chalk/node_modules/ansi-styles/license | 21 -
.../chalk/node_modules/ansi-styles/package.json | 80 -
.../chalk/node_modules/ansi-styles/readme.md | 86 -
.../node_modules/escape-string-regexp/index.js | 11 -
.../node_modules/escape-string-regexp/license | 21 -
.../escape-string-regexp/package.json | 70 -
.../node_modules/escape-string-regexp/readme.md | 27 -
.../chalk/node_modules/has-ansi/cli.js | 45 -
.../chalk/node_modules/has-ansi/index.js | 4 -
.../chalk/node_modules/has-ansi/license | 21 -
.../has-ansi/node_modules/ansi-regex/index.js | 4 -
.../has-ansi/node_modules/ansi-regex/license | 21 -
.../node_modules/ansi-regex/package.json | 86 -
.../has-ansi/node_modules/ansi-regex/readme.md | 33 -
.../has-ansi/node_modules/get-stdin/index.js | 49 -
.../node_modules/get-stdin/package.json | 64 -
.../has-ansi/node_modules/get-stdin/readme.md | 44 -
.../chalk/node_modules/has-ansi/package.json | 92 -
.../chalk/node_modules/has-ansi/readme.md | 45 -
.../chalk/node_modules/strip-ansi/cli.js | 47 -
.../chalk/node_modules/strip-ansi/index.js | 6 -
.../strip-ansi/node_modules/ansi-regex/index.js | 4 -
.../strip-ansi/node_modules/ansi-regex/license | 21 -
.../node_modules/ansi-regex/package.json | 86 -
.../node_modules/ansi-regex/readme.md | 33 -
.../chalk/node_modules/strip-ansi/package.json | 89 -
.../chalk/node_modules/strip-ansi/readme.md | 43 -
.../chalk/node_modules/supports-color/cli.js | 29 -
.../chalk/node_modules/supports-color/index.js | 43 -
.../chalk/node_modules/supports-color/license | 21 -
.../node_modules/supports-color/package.json | 85 -
.../chalk/node_modules/supports-color/readme.md | 46 -
.../node_modules/chalk/package.json | 83 -
.../har-validator/node_modules/chalk/readme.md | 197 -
.../node_modules/commander/History.md | 256 -
.../node_modules/commander/LICENSE | 22 -
.../node_modules/commander/Readme.md | 342 -
.../node_modules/commander/index.js | 1103 --
.../node_modules/graceful-readlink/.npmignore | 3 -
.../node_modules/graceful-readlink/.travis.yml | 5 -
.../node_modules/graceful-readlink/LICENSE | 22 -
.../node_modules/graceful-readlink/README.md | 17 -
.../node_modules/graceful-readlink/index.js | 12 -
.../node_modules/graceful-readlink/package.json | 48 -
.../node_modules/commander/package.json | 75 -
.../node_modules/is-my-json-valid/.npmignore | 2 -
.../node_modules/is-my-json-valid/.travis.yml | 3 -
.../node_modules/is-my-json-valid/LICENSE | 21 -
.../node_modules/is-my-json-valid/README.md | 173 -
.../node_modules/is-my-json-valid/example.js | 18 -
.../node_modules/is-my-json-valid/formats.js | 14 -
.../node_modules/is-my-json-valid/index.js | 569 -
.../node_modules/generate-function/.npmignore | 1 -
.../node_modules/generate-function/.travis.yml | 3 -
.../node_modules/generate-function/README.md | 72 -
.../node_modules/generate-function/example.js | 27 -
.../node_modules/generate-function/index.js | 61 -
.../node_modules/generate-function/package.json | 53 -
.../node_modules/generate-function/test.js | 33 -
.../generate-object-property/.npmignore | 1 -
.../generate-object-property/.travis.yml | 3 -
.../generate-object-property/LICENSE | 21 -
.../generate-object-property/README.md | 19 -
.../generate-object-property/index.js | 12 -
.../node_modules/is-property/.npmignore | 17 -
.../node_modules/is-property/LICENSE | 22 -
.../node_modules/is-property/README.md | 28 -
.../node_modules/is-property/is-property.js | 5 -
.../node_modules/is-property/package.json | 59 -
.../generate-object-property/package.json | 51 -
.../generate-object-property/test.js | 12 -
.../node_modules/jsonpointer/.travis.yml | 6 -
.../node_modules/jsonpointer/README.md | 31 -
.../node_modules/jsonpointer/jsonpointer.js | 79 -
.../node_modules/jsonpointer/package.json | 61 -
.../node_modules/jsonpointer/test.js | 100 -
.../node_modules/is-my-json-valid/package.json | 67 -
.../node_modules/is-my-json-valid/require.js | 12 -
.../is-my-json-valid/test/fixtures/cosmic.js | 84 -
.../json-schema-draft4/additionalItems.json | 82 -
.../additionalProperties.json | 88 -
.../test/json-schema-draft4/allOf.json | 112 -
.../test/json-schema-draft4/anyOf.json | 68 -
.../test/json-schema-draft4/bignum.json | 107 -
.../test/json-schema-draft4/default.json | 49 -
.../test/json-schema-draft4/definitions.json | 32 -
.../test/json-schema-draft4/dependencies.json | 113 -
.../test/json-schema-draft4/enum.json | 72 -
.../test/json-schema-draft4/format.json | 143 -
.../test/json-schema-draft4/items.json | 46 -
.../test/json-schema-draft4/maxItems.json | 28 -
.../test/json-schema-draft4/maxLength.json | 28 -
.../test/json-schema-draft4/maxProperties.json | 28 -
.../test/json-schema-draft4/maximum.json | 42 -
.../test/json-schema-draft4/minItems.json | 28 -
.../test/json-schema-draft4/minLength.json | 28 -
.../test/json-schema-draft4/minProperties.json | 28 -
.../test/json-schema-draft4/minimum.json | 42 -
.../test/json-schema-draft4/multipleOf.json | 60 -
.../test/json-schema-draft4/not.json | 96 -
.../test/json-schema-draft4/nullAndFormat.json | 18 -
.../test/json-schema-draft4/oneOf.json | 68 -
.../test/json-schema-draft4/pattern.json | 23 -
.../json-schema-draft4/patternProperties.json | 110 -
.../test/json-schema-draft4/properties.json | 92 -
.../test/json-schema-draft4/ref.json | 128 -
.../test/json-schema-draft4/refRemote.json | 74 -
.../test/json-schema-draft4/required.json | 39 -
.../test/json-schema-draft4/type.json | 330 -
.../test/json-schema-draft4/uniqueItems.json | 79 -
.../is-my-json-valid/test/json-schema.js | 23 -
.../node_modules/is-my-json-valid/test/misc.js | 429 -
.../node_modules/har-validator/package.json | 79 -
.../node_modules/har-validator/src/error.js | 10 -
.../node_modules/har-validator/src/index.js | 39 -
.../har-validator/src/schemas/cache.json | 13 -
.../har-validator/src/schemas/cacheEntry.json | 31 -
.../har-validator/src/schemas/content.json | 27 -
.../har-validator/src/schemas/cookie.json | 34 -
.../har-validator/src/schemas/creator.json | 18 -
.../har-validator/src/schemas/entry.json | 48 -
.../har-validator/src/schemas/har.json | 11 -
.../har-validator/src/schemas/index.js | 49 -
.../har-validator/src/schemas/log.json | 34 -
.../har-validator/src/schemas/page.json | 30 -
.../har-validator/src/schemas/pageTimings.json | 16 -
.../har-validator/src/schemas/postData.json | 41 -
.../har-validator/src/schemas/record.json | 18 -
.../har-validator/src/schemas/request.json | 55 -
.../har-validator/src/schemas/response.json | 52 -
.../har-validator/src/schemas/timings.json | 40 -
.../request/node_modules/hawk/.npmignore | 20 -
.../request/node_modules/hawk/.travis.yml | 5 -
node_modules/request/node_modules/hawk/LICENSE | 28 -
node_modules/request/node_modules/hawk/Makefile | 8 -
.../request/node_modules/hawk/README.md | 635 --
.../request/node_modules/hawk/bower.json | 24 -
.../request/node_modules/hawk/component.json | 19 -
.../request/node_modules/hawk/example/usage.js | 78 -
.../request/node_modules/hawk/images/hawk.png | Bin 6945 -> 0 bytes
.../request/node_modules/hawk/images/logo.png | Bin 71732 -> 0 bytes
node_modules/request/node_modules/hawk/index.js | 1 -
.../request/node_modules/hawk/lib/browser.js | 641 --
.../request/node_modules/hawk/lib/client.js | 369 -
.../request/node_modules/hawk/lib/crypto.js | 126 -
.../request/node_modules/hawk/lib/index.js | 15 -
.../request/node_modules/hawk/lib/server.js | 534 -
.../request/node_modules/hawk/lib/utils.js | 164 -
.../hawk/node_modules/boom/.npmignore | 18 -
.../hawk/node_modules/boom/.travis.yml | 7 -
.../hawk/node_modules/boom/CONTRIBUTING.md | 1 -
.../node_modules/hawk/node_modules/boom/LICENSE | 28 -
.../hawk/node_modules/boom/README.md | 583 -
.../hawk/node_modules/boom/images/boom.png | Bin 29479 -> 0 bytes
.../hawk/node_modules/boom/index.js | 1 -
.../hawk/node_modules/boom/lib/index.js | 293 -
.../hawk/node_modules/boom/package.json | 64 -
.../hawk/node_modules/boom/test/index.js | 615 -
.../hawk/node_modules/cryptiles/.npmignore | 18 -
.../hawk/node_modules/cryptiles/.travis.yml | 5 -
.../hawk/node_modules/cryptiles/LICENSE | 28 -
.../hawk/node_modules/cryptiles/Makefile | 9 -
.../hawk/node_modules/cryptiles/README.md | 14 -
.../hawk/node_modules/cryptiles/index.js | 1 -
.../hawk/node_modules/cryptiles/lib/index.js | 68 -
.../hawk/node_modules/cryptiles/package.json | 65 -
.../hawk/node_modules/cryptiles/test/index.js | 108 -
.../hawk/node_modules/hoek/.npmignore | 18 -
.../hawk/node_modules/hoek/.travis.yml | 7 -
.../hawk/node_modules/hoek/CONTRIBUTING.md | 1 -
.../node_modules/hawk/node_modules/hoek/LICENSE | 31 -
.../hawk/node_modules/hoek/Makefile | 8 -
.../hawk/node_modules/hoek/README.md | 574 -
.../hawk/node_modules/hoek/images/hoek.png | Bin 37939 -> 0 bytes
.../hawk/node_modules/hoek/index.js | 1 -
.../hawk/node_modules/hoek/lib/escape.js | 132 -
.../hawk/node_modules/hoek/lib/index.js | 977 --
.../hawk/node_modules/hoek/package.json | 60 -
.../hawk/node_modules/hoek/test/escaper.js | 88 -
.../hawk/node_modules/hoek/test/index.js | 2425 ----
.../node_modules/hoek/test/modules/ignore.txt | 0
.../node_modules/hoek/test/modules/test1.js | 1 -
.../node_modules/hoek/test/modules/test2.js | 1 -
.../node_modules/hoek/test/modules/test3.js | 1 -
.../hawk/node_modules/sntp/.npmignore | 18 -
.../hawk/node_modules/sntp/.travis.yml | 5 -
.../node_modules/hawk/node_modules/sntp/LICENSE | 28 -
.../hawk/node_modules/sntp/Makefile | 9 -
.../hawk/node_modules/sntp/README.md | 68 -
.../hawk/node_modules/sntp/examples/offset.js | 16 -
.../hawk/node_modules/sntp/examples/time.js | 25 -
.../hawk/node_modules/sntp/index.js | 1 -
.../hawk/node_modules/sntp/lib/index.js | 412 -
.../hawk/node_modules/sntp/package.json | 65 -
.../hawk/node_modules/sntp/test/index.js | 435 -
.../request/node_modules/hawk/package.json | 71 -
.../request/node_modules/hawk/test/browser.js | 1453 ---
.../request/node_modules/hawk/test/client.js | 443 -
.../request/node_modules/hawk/test/crypto.js | 86 -
.../request/node_modules/hawk/test/index.js | 378 -
.../request/node_modules/hawk/test/message.js | 261 -
.../request/node_modules/hawk/test/readme.js | 98 -
.../request/node_modules/hawk/test/server.js | 985 --
.../request/node_modules/hawk/test/uri.js | 590 -
.../request/node_modules/hawk/test/utils.js | 120 -
.../node_modules/http-signature/.dir-locals.el | 6 -
.../node_modules/http-signature/.npmignore | 7 -
.../request/node_modules/http-signature/LICENSE | 18 -
.../node_modules/http-signature/README.md | 79 -
.../node_modules/http-signature/http_signing.md | 296 -
.../node_modules/http-signature/lib/index.js | 26 -
.../node_modules/http-signature/lib/parser.js | 304 -
.../node_modules/http-signature/lib/signer.js | 178 -
.../node_modules/http-signature/lib/util.js | 304 -
.../node_modules/http-signature/lib/verify.js | 42 -
.../http-signature/node_modules/asn1/.npmignore | 2 -
.../http-signature/node_modules/asn1/LICENSE | 19 -
.../http-signature/node_modules/asn1/README.md | 50 -
.../node_modules/asn1/lib/ber/errors.js | 13 -
.../node_modules/asn1/lib/ber/index.js | 27 -
.../node_modules/asn1/lib/ber/reader.js | 267 -
.../node_modules/asn1/lib/ber/types.js | 36 -
.../node_modules/asn1/lib/ber/writer.js | 317 -
.../node_modules/asn1/lib/index.js | 20 -
.../node_modules/asn1/package.json | 63 -
.../node_modules/asn1/tst/ber/reader.test.js | 172 -
.../node_modules/asn1/tst/ber/writer.test.js | 296 -
.../node_modules/assert-plus/README.md | 126 -
.../node_modules/assert-plus/assert.js | 245 -
.../node_modules/assert-plus/package.json | 46 -
.../node_modules/ctype/.npmignore | 1 -
.../http-signature/node_modules/ctype/CHANGELOG | 78 -
.../http-signature/node_modules/ctype/LICENSE | 24 -
.../http-signature/node_modules/ctype/README | 82 -
.../node_modules/ctype/README.old | 298 -
.../http-signature/node_modules/ctype/ctf.js | 245 -
.../http-signature/node_modules/ctype/ctio.js | 1485 ---
.../http-signature/node_modules/ctype/ctype.js | 944 --
.../ctype/man/man3ctype/ctio.3ctype | 241 -
.../node_modules/ctype/package.json | 43 -
.../node_modules/ctype/tools/jsl.conf | 129 -
.../node_modules/ctype/tools/jsstyle | 839 --
.../node_modules/http-signature/package.json | 72 -
.../request/node_modules/isstream/.jshintrc | 59 -
.../request/node_modules/isstream/.npmignore | 1 -
.../request/node_modules/isstream/.travis.yml | 12 -
.../request/node_modules/isstream/LICENSE.md | 11 -
.../request/node_modules/isstream/README.md | 66 -
.../request/node_modules/isstream/isstream.js | 27 -
.../request/node_modules/isstream/package.json | 59 -
.../request/node_modules/isstream/test.js | 168 -
.../node_modules/json-stringify-safe/.npmignore | 1 -
.../json-stringify-safe/CHANGELOG.md | 14 -
.../node_modules/json-stringify-safe/LICENSE | 15 -
.../node_modules/json-stringify-safe/Makefile | 35 -
.../node_modules/json-stringify-safe/README.md | 52 -
.../json-stringify-safe/package.json | 68 -
.../json-stringify-safe/stringify.js | 27 -
.../json-stringify-safe/test/mocha.opts | 2 -
.../json-stringify-safe/test/stringify_test.js | 246 -
.../request/node_modules/mime-types/HISTORY.md | 103 -
.../request/node_modules/mime-types/LICENSE | 22 -
.../request/node_modules/mime-types/README.md | 102 -
.../request/node_modules/mime-types/index.js | 63 -
.../mime-types/node_modules/mime-db/HISTORY.md | 195 -
.../mime-types/node_modules/mime-db/LICENSE | 22 -
.../mime-types/node_modules/mime-db/README.md | 76 -
.../mime-types/node_modules/mime-db/db.json | 6335 -----------
.../mime-types/node_modules/mime-db/index.js | 11 -
.../node_modules/mime-db/package.json | 94 -
.../node_modules/mime-types/package.json | 84 -
.../request/node_modules/node-uuid/.npmignore | 2 -
.../request/node_modules/node-uuid/LICENSE.md | 21 -
.../request/node_modules/node-uuid/README.md | 243 -
.../node_modules/node-uuid/benchmark/README.md | 53 -
.../node_modules/node-uuid/benchmark/bench.gnu | 174 -
.../node_modules/node-uuid/benchmark/bench.sh | 34 -
.../node-uuid/benchmark/benchmark-native.c | 34 -
.../node-uuid/benchmark/benchmark.js | 84 -
.../request/node_modules/node-uuid/bin/uuid | 26 -
.../request/node_modules/node-uuid/bower.json | 23 -
.../node_modules/node-uuid/component.json | 18 -
.../request/node_modules/node-uuid/package.json | 65 -
.../node_modules/node-uuid/test/compare_v1.js | 63 -
.../node_modules/node-uuid/test/test.html | 17 -
.../request/node_modules/node-uuid/test/test.js | 228 -
.../request/node_modules/node-uuid/uuid.js | 247 -
.../request/node_modules/oauth-sign/LICENSE | 55 -
.../request/node_modules/oauth-sign/README.md | 4 -
.../request/node_modules/oauth-sign/index.js | 131 -
.../node_modules/oauth-sign/package.json | 53 -
.../request/node_modules/oauth-sign/test.js | 74 -
.../request/node_modules/qs/.jshintignore | 1 -
node_modules/request/node_modules/qs/.jshintrc | 10 -
node_modules/request/node_modules/qs/.npmignore | 18 -
.../request/node_modules/qs/.travis.yml | 6 -
.../request/node_modules/qs/CHANGELOG.md | 73 -
.../request/node_modules/qs/CONTRIBUTING.md | 1 -
node_modules/request/node_modules/qs/LICENSE | 28 -
node_modules/request/node_modules/qs/Makefile | 8 -
node_modules/request/node_modules/qs/README.md | 233 -
node_modules/request/node_modules/qs/index.js | 1 -
.../request/node_modules/qs/lib/index.js | 15 -
.../request/node_modules/qs/lib/parse.js | 157 -
.../request/node_modules/qs/lib/stringify.js | 97 -
.../request/node_modules/qs/lib/utils.js | 132 -
.../request/node_modules/qs/package.json | 59 -
.../request/node_modules/qs/test/parse.js | 414 -
.../request/node_modules/qs/test/stringify.js | 209 -
.../node_modules/stringstream/.npmignore | 15 -
.../node_modules/stringstream/.travis.yml | 4 -
.../node_modules/stringstream/LICENSE.txt | 4 -
.../request/node_modules/stringstream/README.md | 38 -
.../node_modules/stringstream/example.js | 27 -
.../node_modules/stringstream/package.json | 49 -
.../node_modules/stringstream/stringstream.js | 102 -
.../node_modules/tough-cookie/.editorconfig | 12 -
.../request/node_modules/tough-cookie/.jshintrc | 70 -
.../node_modules/tough-cookie/.npmignore | 4 -
.../node_modules/tough-cookie/.travis.yml | 9 -
.../node_modules/tough-cookie/CONTRIBUTING.md | 9 -
.../request/node_modules/tough-cookie/LICENSE | 74 -
.../request/node_modules/tough-cookie/README.md | 423 -
.../tough-cookie/generate-pubsuffix.js | 293 -
.../node_modules/tough-cookie/lib/cookie.js | 1137 --
.../node_modules/tough-cookie/lib/memstore.js | 143 -
.../node_modules/tough-cookie/lib/pubsuffix.js | 98 -
.../node_modules/tough-cookie/lib/store.js | 67 -
.../node_modules/tough-cookie/package.json | 66 -
.../node_modules/tough-cookie/public-suffix.txt | 10079 -----------------
.../node_modules/tough-cookie/test/api_test.js | 372 -
.../tough-cookie/test/cookie_jar_test.js | 468 -
.../tough-cookie/test/cookie_sorting_test.js | 90 -
.../tough-cookie/test/cookie_to_json_test.js | 164 -
.../tough-cookie/test/cookie_to_string_test.js | 162 -
.../node_modules/tough-cookie/test/date_test.js | 79 -
.../tough-cookie/test/domain_and_path_test.js | 201 -
.../test/ietf_data/dates/bsd-examples.json | 168 -
.../test/ietf_data/dates/examples.json | 48 -
.../tough-cookie/test/ietf_data/parser.json | 1959 ----
.../node_modules/tough-cookie/test/ietf_test.js | 106 -
.../tough-cookie/test/lifetime_test.js | 97 -
.../tough-cookie/test/parsing_test.js | 294 -
.../tough-cookie/test/regression_test.js | 143 -
.../tough-cookie/tough-cookie-deps.tsv | 6 -
.../request/node_modules/tunnel-agent/.jshintrc | 5 -
.../request/node_modules/tunnel-agent/LICENSE | 55 -
.../request/node_modules/tunnel-agent/README.md | 4 -
.../request/node_modules/tunnel-agent/index.js | 236 -
.../node_modules/tunnel-agent/package.json | 46 -
node_modules/request/package.json | 106 -
node_modules/request/release.sh | 45 -
node_modules/request/request.js | 1569 ---
472 files changed, 74275 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/.eslintrc
----------------------------------------------------------------------
diff --git a/node_modules/request/.eslintrc b/node_modules/request/.eslintrc
deleted file mode 100644
index 8538b41..0000000
--- a/node_modules/request/.eslintrc
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "env": {
- "node": true
- },
- "rules": {
- // 2-space indentation
- "indent": [2, 2],
- // Disallow semi-colons, unless needed to disambiguate statement
- "semi": [2, "never"],
- // Require strings to use single quotes
- "quotes": [2, "single"],
- // Require curly braces for all control statements
- "curly": 2,
- // Disallow using variables and functions before they've been defined
- "no-use-before-define": 2,
- // Allow any case for variable naming
- "camelcase": 0,
- // Disallow unused variables, except as function arguments
- "no-unused-vars": [2, {"args":"none"}],
- // Allow leading underscores for method names
- // REASON: we use underscores to denote private methods
- "no-underscore-dangle": 0,
- // Allow multi spaces around operators since they are
- // used for alignment. This is not consistent in the
- // code.
- "no-multi-spaces": 0,
- // Style rule is: most objects use { beforeColon: false, afterColon: true }, unless aligning which uses:
- //
- // {
- // beforeColon : true,
- // afterColon : true
- // }
- //
- // eslint can't handle this, so the check is disabled.
- "key-spacing": 0,
- // Allow shadowing vars in outer scope (needs discussion)
- "no-shadow": 0
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/.npmignore b/node_modules/request/.npmignore
deleted file mode 100644
index 53fc9ef..0000000
--- a/node_modules/request/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-coverage
-tests
-node_modules
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/.travis.yml b/node_modules/request/.travis.yml
deleted file mode 100644
index bd0f638..0000000
--- a/node_modules/request/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: node_js
-node_js:
- - "io.js"
- - "0.12"
- - "0.10"
-after_script: ./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape tests/test-*.js --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js --verbose
-webhooks:
- urls: https://webhooks.gitter.im/e/237280ed4796c19cc626
- on_success: change # options: [always|never|change] default: always
- on_failure: always # options: [always|never|change] default: always
- on_start: false # default: false
-sudo: false
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/node_modules/request/CHANGELOG.md b/node_modules/request/CHANGELOG.md
deleted file mode 100644
index 1c01d08..0000000
--- a/node_modules/request/CHANGELOG.md
+++ /dev/null
@@ -1,467 +0,0 @@
-## Change Log
-
-### v2.55.0 (2015/04/05)
-- [#1520](https://github.com/request/request/pull/1520) Refactor defaults (@simov)
-- [#1525](https://github.com/request/request/pull/1525) Delete request headers with undefined value. (@froatsnook)
-- [#1521](https://github.com/request/request/pull/1521) Add promise tests (@simov)
-- [#1518](https://github.com/request/request/pull/1518) Fix defaults (@simov)
-- [#1515](https://github.com/request/request/pull/1515) Allow static invoking of convenience methods (@simov)
-- [#1505](https://github.com/request/request/pull/1505) Fix multipart boundary extraction regexp (@simov)
-- [#1510](https://github.com/request/request/pull/1510) Fix basic auth form data (@simov)
-
-### v2.54.0 (2015/03/24)
-- [#1501](https://github.com/request/request/pull/1501) HTTP Archive 1.2 support (@ahmadnassri)
-- [#1486](https://github.com/request/request/pull/1486) Add a test for the forever agent (@akshayp)
-- [#1500](https://github.com/request/request/pull/1500) Adding handling for no auth method and null bearer (@philberg)
-- [#1498](https://github.com/request/request/pull/1498) Add table of contents in readme (@simov)
-- [#1477](https://github.com/request/request/pull/1477) Add support for qs options via qsOptions key (@simov)
-- [#1496](https://github.com/request/request/pull/1496) Parameters encoded to base 64 should be decoded as UTF-8, not ASCII. (@albanm)
-- [#1494](https://github.com/request/request/pull/1494) Update eslint (@froatsnook)
-- [#1474](https://github.com/request/request/pull/1474) Require Colon in Basic Auth (@erykwalder)
-- [#1481](https://github.com/request/request/pull/1481) Fix baseUrl and redirections. (@burningtree)
-- [#1469](https://github.com/request/request/pull/1469) Feature/base url (@froatsnook)
-- [#1459](https://github.com/request/request/pull/1459) Add option to time request/response cycle (including rollup of redirects) (@aaron-em)
-- [#1468](https://github.com/request/request/pull/1468) Re-enable io.js/node 0.12 build (@simov, @BBB)
-- [#1442](https://github.com/request/request/pull/1442) Fixed the issue with strictSSL tests on 0.12 & io.js by explicitly setting a cipher that matches the cert. (@BBB, @nicolasmccurdy, @simov, @0x4139)
-- [#1460](https://github.com/request/request/pull/1460) localAddress or proxy config is lost when redirecting (@simov, @0x4139)
-- [#1453](https://github.com/request/request/pull/1453) Test on Node.js 0.12 and io.js with allowed failures (@nicolasmccurdy)
-- [#1426](https://github.com/request/request/pull/1426) Fixing tests to pass on io.js and node 0.12 (only test-https.js stiff failing) (@mikeal)
-- [#1446](https://github.com/request/request/pull/1446) Missing HTTP referer header with redirects Fixes #1038 (@simov, @guimonz)
-- [#1428](https://github.com/request/request/pull/1428) Deprecate Node v0.8.x (@nylen)
-- [#1436](https://github.com/request/request/pull/1436) Add ability to set a requester without setting default options (@tikotzky)
-- [#1435](https://github.com/request/request/pull/1435) dry up verb methods (@sethpollack)
-- [#1423](https://github.com/request/request/pull/1423) Allow fully qualified multipart content-type header (@simov)
-- [#1430](https://github.com/request/request/pull/1430) Fix recursive requester (@tikotzky)
-- [#1429](https://github.com/request/request/pull/1429) Throw error when making HEAD request with a body (@tikotzky)
-- [#1419](https://github.com/request/request/pull/1419) Add note that the project is broken in 0.12.x (@nylen)
-- [#1413](https://github.com/request/request/pull/1413) Fix basic auth (@simov)
-- [#1397](https://github.com/request/request/pull/1397) Improve pipe-from-file tests (@nylen)
-
-### v2.53.0 (2015/02/02)
-- [#1396](https://github.com/request/request/pull/1396) Do not rfc3986 escape JSON bodies (@nylen, @simov)
-- [#1392](https://github.com/request/request/pull/1392) Improve `timeout` option description (@watson)
-
-### v2.52.0 (2015/02/02)
-- [#1383](https://github.com/request/request/pull/1383) Add missing HTTPS options that were not being passed to tunnel (@brichard19) (@nylen, @brichard19)
-- [#1388](https://github.com/request/request/pull/1388) Upgrade mime-types package version (@roderickhsiao)
-- [#1389](https://github.com/request/request/pull/1389) Revise Setup Tunnel Function (@seanstrom)
-- [#1374](https://github.com/request/request/pull/1374) Allow explicitly disabling tunneling for proxied https destinations (@nylen)
-- [#1376](https://github.com/request/request/pull/1376) Use karma-browserify for tests. Add browser test coverage reporter. (@eiriksm)
-- [#1366](https://github.com/request/request/pull/1366) Refactor OAuth into separate module (@simov)
-- [#1373](https://github.com/request/request/pull/1373) Rewrite tunnel test to be pure Node.js (@nylen)
-- [#1371](https://github.com/request/request/pull/1371) Upgrade test reporter (@nylen)
-- [#1360](https://github.com/request/request/pull/1360) Refactor basic, bearer, digest auth logic into separate class (@simov)
-- [#1354](https://github.com/request/request/pull/1354) Remove circular dependency from debugging code (@nylen)
-- [#1351](https://github.com/request/request/pull/1351) Move digest auth into private prototype method (@simov)
-- [#1352](https://github.com/request/request/pull/1352) Update hawk dependency to ~2.3.0 (@mridgway)
-- [#1353](https://github.com/request/request/pull/1353) Correct travis-ci badge (@dogancelik)
-- [#1349](https://github.com/request/request/pull/1349) Make sure we return on errored browser requests. (@eiriksm)
-- [#1346](https://github.com/request/request/pull/1346) getProxyFromURI Extraction Refactor (@seanstrom)
-- [#1337](https://github.com/request/request/pull/1337) Standardize test ports on 6767 (@nylen)
-- [#1341](https://github.com/request/request/pull/1341) Emit FormData error events as Request error events (@nylen, @rwky)
-- [#1343](https://github.com/request/request/pull/1343) Clean up readme badges, and add Travis and Coveralls badges (@nylen)
-- [#1345](https://github.com/request/request/pull/1345) Update README.md (@Aaron-Hartwig)
-- [#1338](https://github.com/request/request/pull/1338) Always wait for server.close() callback in tests (@nylen)
-- [#1342](https://github.com/request/request/pull/1342) Add mock https server and redo start of browser tests for this purpose. (@eiriksm)
-- [#1339](https://github.com/request/request/pull/1339) Improve auth docs (@nylen)
-- [#1335](https://github.com/request/request/pull/1335) Add support for OAuth plaintext signature method (@simov)
-- [#1332](https://github.com/request/request/pull/1332) Add clean script to remove test-browser.js after the tests run (@seanstrom)
-- [#1327](https://github.com/request/request/pull/1327) Fix errors generating coverage reports. (@nylen)
-- [#1330](https://github.com/request/request/pull/1330) Return empty buffer upon empty response body and encoding is set to null (@seanstrom)
-- [#1326](https://github.com/request/request/pull/1326) Use faster container-based infrastructure on Travis (@nylen)
-- [#1315](https://github.com/request/request/pull/1315) Implement rfc3986 option (@simov)
-- [#1314](https://github.com/request/request/pull/1314) Detect urlencoded form data header via regex (@simov)
-- [#1317](https://github.com/request/request/pull/1317) Improve OAuth1.0 server side flow example (@simov)
-
-### v2.51.0 (2014/12/10)
-- [#1310](https://github.com/request/request/pull/1310) Revert changes introduced in https://github.com/request/request/pull/1282 (@simov)
-
-### v2.50.0 (2014/12/09)
-- [#1308](https://github.com/request/request/pull/1308) Add browser test to keep track of browserify compability. (@eiriksm)
-- [#1299](https://github.com/request/request/pull/1299) Add optional support for jsonReviver (@poislagarde)
-- [#1277](https://github.com/request/request/pull/1277) Add Coveralls configuration (@simov)
-- [#1307](https://github.com/request/request/pull/1307) Upgrade form-data, add back browserify compability. Fixes #455. (@eiriksm)
-- [#1305](https://github.com/request/request/pull/1305) Fix typo in README.md (@LewisJEllis)
-- [#1288](https://github.com/request/request/pull/1288) Update README.md to explain custom file use case (@cliffcrosland)
-
-### v2.49.0 (2014/11/28)
-- [#1295](https://github.com/request/request/pull/1295) fix(proxy): no-proxy false positive (@oliamb)
-- [#1292](https://github.com/request/request/pull/1292) Upgrade `caseless` to 0.8.1 (@mmalecki)
-- [#1276](https://github.com/request/request/pull/1276) Set transfer encoding for multipart/related to chunked by default (@simov)
-- [#1275](https://github.com/request/request/pull/1275) Fix multipart content-type headers detection (@simov)
-- [#1269](https://github.com/request/request/pull/1269) adds streams example for review (@tbuchok)
-- [#1238](https://github.com/request/request/pull/1238) Add examples README.md (@simov)
-
-### v2.48.0 (2014/11/12)
-- [#1263](https://github.com/request/request/pull/1263) Fixed a syntax error / typo in README.md (@xna2)
-- [#1253](https://github.com/request/request/pull/1253) Add multipart chunked flag (@simov, @nylen)
-- [#1251](https://github.com/request/request/pull/1251) Clarify that defaults() does not modify global defaults (@nylen)
-- [#1250](https://github.com/request/request/pull/1250) Improve documentation for pool and maxSockets options (@nylen)
-- [#1237](https://github.com/request/request/pull/1237) Documenting error handling when using streams (@vmattos)
-- [#1244](https://github.com/request/request/pull/1244) Finalize changelog command (@nylen)
-- [#1241](https://github.com/request/request/pull/1241) Fix typo (@alexanderGugel)
-- [#1223](https://github.com/request/request/pull/1223) Show latest version number instead of "upcoming" in changelog (@nylen)
-- [#1236](https://github.com/request/request/pull/1236) Document how to use custom CA in README (#1229) (@hypesystem)
-- [#1228](https://github.com/request/request/pull/1228) Support for oauth with RSA-SHA1 signing (@nylen)
-- [#1216](https://github.com/request/request/pull/1216) Made json and multipart options coexist (@nylen, @simov)
-- [#1225](https://github.com/request/request/pull/1225) Allow header white/exclusive lists in any case. (@RReverser)
-
-### v2.47.0 (2014/10/26)
-- [#1222](https://github.com/request/request/pull/1222) Move from mikeal/request to request/request (@nylen)
-- [#1220](https://github.com/request/request/pull/1220) update qs dependency to 2.3.1 (@FredKSchott)
-- [#1212](https://github.com/request/request/pull/1212) Improve tests/test-timeout.js (@nylen)
-- [#1219](https://github.com/request/request/pull/1219) remove old globalAgent workaround for node 0.4 (@request)
-- [#1214](https://github.com/request/request/pull/1214) Remove cruft left over from optional dependencies (@nylen)
-- [#1215](https://github.com/request/request/pull/1215) Add proxyHeaderExclusiveList option for proxy-only headers. (@RReverser)
-- [#1211](https://github.com/request/request/pull/1211) Allow 'Host' header instead of 'host' and remember case across redirects (@nylen)
-- [#1208](https://github.com/request/request/pull/1208) Improve release script (@nylen)
-- [#1213](https://github.com/request/request/pull/1213) Support for custom cookie store (@nylen, @mitsuru)
-- [#1197](https://github.com/request/request/pull/1197) Clean up some code around setting the agent (@FredKSchott)
-- [#1209](https://github.com/request/request/pull/1209) Improve multipart form append test (@simov)
-- [#1207](https://github.com/request/request/pull/1207) Update changelog (@nylen)
-- [#1185](https://github.com/request/request/pull/1185) Stream multipart/related bodies (@simov)
-
-### v2.46.0 (2014/10/23)
-- [#1198](https://github.com/request/request/pull/1198) doc for TLS/SSL protocol options (@shawnzhu)
-- [#1200](https://github.com/request/request/pull/1200) Add a Gitter chat badge to README.md (@gitter-badger)
-- [#1196](https://github.com/request/request/pull/1196) Upgrade taper test reporter to v0.3.0 (@nylen)
-- [#1199](https://github.com/request/request/pull/1199) Fix lint error: undeclared var i (@nylen)
-- [#1191](https://github.com/request/request/pull/1191) Move self.proxy decision logic out of init and into a helper (@FredKSchott)
-- [#1190](https://github.com/request/request/pull/1190) Move _buildRequest() logic back into init (@FredKSchott)
-- [#1186](https://github.com/request/request/pull/1186) Support Smarter Unix URL Scheme (@FredKSchott)
-- [#1178](https://github.com/request/request/pull/1178) update form documentation for new usage (@FredKSchott)
-- [#1180](https://github.com/request/request/pull/1180) Enable no-mixed-requires linting rule (@nylen)
-- [#1184](https://github.com/request/request/pull/1184) Don't forward authorization header across redirects to different hosts (@nylen)
-- [#1183](https://github.com/request/request/pull/1183) Correct README about pre and postamble CRLF using multipart and not mult... (@netpoetica)
-- [#1179](https://github.com/request/request/pull/1179) Lint tests directory (@nylen)
-- [#1169](https://github.com/request/request/pull/1169) add metadata for form-data file field (@dotcypress)
-- [#1173](https://github.com/request/request/pull/1173) remove optional dependencies (@seanstrom)
-- [#1165](https://github.com/request/request/pull/1165) Cleanup event listeners and remove function creation from init (@FredKSchott)
-- [#1174](https://github.com/request/request/pull/1174) update the request.cookie docs to have a valid cookie example (@seanstrom)
-- [#1168](https://github.com/request/request/pull/1168) create a detach helper and use detach helper in replace of nextTick (@seanstrom)
-- [#1171](https://github.com/request/request/pull/1171) in post can send form data and use callback (@MiroRadenovic)
-- [#1159](https://github.com/request/request/pull/1159) accept charset for x-www-form-urlencoded content-type (@seanstrom)
-- [#1157](https://github.com/request/request/pull/1157) Update README.md: body with json=true (@Rob--W)
-- [#1164](https://github.com/request/request/pull/1164) Disable tests/test-timeout.js on Travis (@nylen)
-- [#1153](https://github.com/request/request/pull/1153) Document how to run a single test (@nylen)
-- [#1144](https://github.com/request/request/pull/1144) adds documentation for the "response" event within the streaming section (@tbuchok)
-- [#1162](https://github.com/request/request/pull/1162) Update eslintrc file to no longer allow past errors (@FredKSchott)
-- [#1155](https://github.com/request/request/pull/1155) Support/use self everywhere (@seanstrom)
-- [#1161](https://github.com/request/request/pull/1161) fix no-use-before-define lint warnings (@emkay)
-- [#1156](https://github.com/request/request/pull/1156) adding curly brackets to get rid of lint errors (@emkay)
-- [#1151](https://github.com/request/request/pull/1151) Fix localAddress test on OS X (@nylen)
-- [#1145](https://github.com/request/request/pull/1145) documentation: fix outdated reference to setCookieSync old name in README (@FredKSchott)
-- [#1131](https://github.com/request/request/pull/1131) Update pool documentation (@FredKSchott)
-- [#1143](https://github.com/request/request/pull/1143) Rewrite all tests to use tape (@nylen)
-- [#1137](https://github.com/request/request/pull/1137) Add ability to specifiy querystring lib in options. (@jgrund)
-- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@cappslock)
-- [#1134](https://github.com/request/request/pull/1134) Fix multiple redirects and `self.followRedirect` (@blakeembrey)
-- [#1130](https://github.com/request/request/pull/1130) documentation fix: add note about npm test for contributing (@FredKSchott)
-- [#1120](https://github.com/request/request/pull/1120) Support/refactor request setup tunnel (@seanstrom)
-- [#1129](https://github.com/request/request/pull/1129) linting fix: convert double quote strings to use single quotes (@FredKSchott)
-- [#1124](https://github.com/request/request/pull/1124) linting fix: remove unneccesary semi-colons (@FredKSchott)
-
-### v2.45.0 (2014/10/06)
-- [#1128](https://github.com/request/request/pull/1128) Add test for setCookie regression (@nylen)
-- [#1127](https://github.com/request/request/pull/1127) added tests around using objects as values in a query string (@bcoe)
-- [#1103](https://github.com/request/request/pull/1103) Support/refactor request constructor (@nylen, @seanstrom)
-- [#1119](https://github.com/request/request/pull/1119) add basic linting to request library (@FredKSchott)
-- [#1121](https://github.com/request/request/pull/1121) Revert "Explicitly use sync versions of cookie functions" (@nylen)
-- [#1118](https://github.com/request/request/pull/1118) linting fix: Restructure bad empty if statement (@FredKSchott)
-- [#1117](https://github.com/request/request/pull/1117) Fix a bad check for valid URIs (@FredKSchott)
-- [#1113](https://github.com/request/request/pull/1113) linting fix: space out operators (@FredKSchott)
-- [#1116](https://github.com/request/request/pull/1116) Fix typo in `noProxyHost` definition (@FredKSchott)
-- [#1114](https://github.com/request/request/pull/1114) linting fix: Added a `new` operator that was missing when creating and throwing a new error (@FredKSchott)
-- [#1096](https://github.com/request/request/pull/1096) No_proxy support (@samcday)
-- [#1107](https://github.com/request/request/pull/1107) linting-fix: remove unused variables (@FredKSchott)
-- [#1112](https://github.com/request/request/pull/1112) linting fix: Make return values consistent and more straitforward (@FredKSchott)
-- [#1111](https://github.com/request/request/pull/1111) linting fix: authPieces was getting redeclared (@FredKSchott)
-- [#1105](https://github.com/request/request/pull/1105) Use strict mode in request (@FredKSchott)
-- [#1110](https://github.com/request/request/pull/1110) linting fix: replace lazy '==' with more strict '===' (@FredKSchott)
-- [#1109](https://github.com/request/request/pull/1109) linting fix: remove function call from if-else conditional statement (@FredKSchott)
-- [#1102](https://github.com/request/request/pull/1102) Fix to allow setting a `requester` on recursive calls to `request.defaults` (@tikotzky)
-- [#1095](https://github.com/request/request/pull/1095) Tweaking engines in package.json (@pdehaan)
-- [#1082](https://github.com/request/request/pull/1082) Forward the socket event from the httpModule request (@seanstrom)
-- [#972](https://github.com/request/request/pull/972) Clarify gzip handling in the README (@kevinoid)
-- [#1089](https://github.com/request/request/pull/1089) Mention that encoding defaults to utf8, not Buffer (@stuartpb)
-- [#1088](https://github.com/request/request/pull/1088) Fix cookie example in README.md and make it more clear (@pipi32167)
-- [#1027](https://github.com/request/request/pull/1027) Add support for multipart form data in request options. (@crocket)
-- [#1076](https://github.com/request/request/pull/1076) use Request.abort() to abort the request when the request has timed-out (@seanstrom)
-- [#1068](https://github.com/request/request/pull/1068) add optional postamble required by .NET multipart requests (@netpoetica)
-
-### v2.43.0 (2014/09/18)
-- [#1057](https://github.com/request/request/pull/1057) Defaults should not overwrite defined options (@davidwood)
-- [#1046](https://github.com/request/request/pull/1046) Propagate datastream errors, useful in case gzip fails. (@ZJONSSON, @Janpot)
-- [#1063](https://github.com/request/request/pull/1063) copy the input headers object #1060 (@finnp)
-- [#1031](https://github.com/request/request/pull/1031) Explicitly use sync versions of cookie functions (@ZJONSSON)
-- [#1056](https://github.com/request/request/pull/1056) Fix redirects when passing url.parse(x) as URL to convenience method (@nylen)
-
-### v2.42.0 (2014/09/04)
-- [#1053](https://github.com/request/request/pull/1053) Fix #1051 Parse auth properly when using non-tunneling proxy (@isaacs)
-
-### v2.41.0 (2014/09/04)
-- [#1050](https://github.com/request/request/pull/1050) Pass whitelisted headers to tunneling proxy. Organize all tunneling logic. (@isaacs, @Feldhacker)
-- [#1035](https://github.com/request/request/pull/1035) souped up nodei.co badge (@rvagg)
-- [#1048](https://github.com/request/request/pull/1048) Aws is now possible over a proxy (@steven-aerts)
-- [#1039](https://github.com/request/request/pull/1039) extract out helper functions to a helper file (@seanstrom)
-- [#1021](https://github.com/request/request/pull/1021) Support/refactor indexjs (@seanstrom)
-- [#1033](https://github.com/request/request/pull/1033) Improve and document debug options (@nylen)
-- [#1034](https://github.com/request/request/pull/1034) Fix readme headings (@nylen)
-- [#1030](https://github.com/request/request/pull/1030) Allow recursive request.defaults (@tikotzky)
-- [#1029](https://github.com/request/request/pull/1029) Fix a couple of typos (@nylen)
-- [#675](https://github.com/request/request/pull/675) Checking for SSL fault on connection before reading SSL properties (@VRMink)
-- [#989](https://github.com/request/request/pull/989) Added allowRedirect function. Should return true if redirect is allowed or false otherwise (@doronin)
-- [#1025](https://github.com/request/request/pull/1025) [fixes #1023] Set self._ended to true once response has ended (@mridgway)
-- [#1020](https://github.com/request/request/pull/1020) Add back removed debug metadata (@FredKSchott)
-- [#1008](https://github.com/request/request/pull/1008) Moving to module instead of cutomer buffer concatenation. (@mikeal)
-- [#770](https://github.com/request/request/pull/770) Added dependency badge for README file; (@timgluz)
-- [#1016](https://github.com/request/request/pull/1016) toJSON no longer results in an infinite loop, returns simple objects (@FredKSchott)
-- [#1018](https://github.com/request/request/pull/1018) Remove pre-0.4.4 HTTPS fix (@mmalecki)
-- [#1006](https://github.com/request/request/pull/1006) Migrate to caseless, fixes #1001 (@mikeal)
-- [#995](https://github.com/request/request/pull/995) Fix parsing array of objects (@sjonnet19)
-- [#999](https://github.com/request/request/pull/999) Fix fallback for browserify for optional modules. (@eiriksm)
-- [#996](https://github.com/request/request/pull/996) Wrong oauth signature when multiple same param keys exist [updated] (@bengl)
-
-### v2.40.0 (2014/08/06)
-- [#992](https://github.com/request/request/pull/992) Fix security vulnerability. Update qs (@poeticninja)
-- [#988](https://github.com/request/request/pull/988) “--” -> “—” (@upisfree)
-- [#987](https://github.com/request/request/pull/987) Show optional modules as being loaded by the module that reqeusted them (@iarna)
-
-### v2.39.0 (2014/07/24)
-- [#976](https://github.com/request/request/pull/976) Update README.md (@pvoznenko)
-
-### v2.38.0 (2014/07/22)
-- [#952](https://github.com/request/request/pull/952) Adding support to client certificate with proxy use case (@ofirshaked)
-- [#884](https://github.com/request/request/pull/884) Documented tough-cookie installation. (@wbyoung)
-- [#935](https://github.com/request/request/pull/935) Correct repository url (@fritx)
-- [#963](https://github.com/request/request/pull/963) Update changelog (@nylen)
-- [#960](https://github.com/request/request/pull/960) Support gzip with encoding on node pre-v0.9.4 (@kevinoid)
-- [#953](https://github.com/request/request/pull/953) Add async Content-Length computation when using form-data (@LoicMahieu)
-- [#844](https://github.com/request/request/pull/844) Add support for HTTP[S]_PROXY environment variables. Fixes #595. (@jvmccarthy)
-- [#946](https://github.com/request/request/pull/946) defaults: merge headers (@aj0strow)
-
-### v2.37.0 (2014/07/07)
-- [#957](https://github.com/request/request/pull/957) Silence EventEmitter memory leak warning #311 (@watson)
-- [#955](https://github.com/request/request/pull/955) check for content-length header before setting it in nextTick (@camilleanne)
-- [#951](https://github.com/request/request/pull/951) Add support for gzip content decoding (@kevinoid)
-- [#949](https://github.com/request/request/pull/949) Manually enter querystring in form option (@charlespwd)
-- [#944](https://github.com/request/request/pull/944) Make request work with browserify (@eiriksm)
-- [#943](https://github.com/request/request/pull/943) New mime module (@eiriksm)
-- [#927](https://github.com/request/request/pull/927) Bump version of hawk dep. (@samccone)
-- [#907](https://github.com/request/request/pull/907) append secureOptions to poolKey (@medovob)
-
-### v2.35.0 (2014/05/17)
-- [#901](https://github.com/request/request/pull/901) Fixes #555 (@pigulla)
-- [#897](https://github.com/request/request/pull/897) merge with default options (@vohof)
-- [#891](https://github.com/request/request/pull/891) fixes 857 - options object is mutated by calling request (@lalitkapoor)
-- [#869](https://github.com/request/request/pull/869) Pipefilter test (@tgohn)
-- [#866](https://github.com/request/request/pull/866) Fix typo (@dandv)
-- [#861](https://github.com/request/request/pull/861) Add support for RFC 6750 Bearer Tokens (@phedny)
-- [#809](https://github.com/request/request/pull/809) upgrade tunnel-proxy to 0.4.0 (@ksato9700)
-- [#850](https://github.com/request/request/pull/850) Fix word consistency in readme (@0xNobody)
-- [#810](https://github.com/request/request/pull/810) add some exposition to mpu example in README.md (@mikermcneil)
-- [#840](https://github.com/request/request/pull/840) improve error reporting for invalid protocols (@FND)
-- [#821](https://github.com/request/request/pull/821) added secureOptions back (@nw)
-- [#815](https://github.com/request/request/pull/815) Create changelog based on pull requests (@lalitkapoor)
-
-### v2.34.0 (2014/02/18)
-- [#516](https://github.com/request/request/pull/516) UNIX Socket URL Support (@lyuzashi)
-- [#801](https://github.com/request/request/pull/801) 794 ignore cookie parsing and domain errors (@lalitkapoor)
-- [#802](https://github.com/request/request/pull/802) Added the Apache license to the package.json. (@keskival)
-- [#793](https://github.com/request/request/pull/793) Adds content-length calculation when submitting forms using form-data li... (@Juul)
-- [#785](https://github.com/request/request/pull/785) Provide ability to override content-type when `json` option used (@vvo)
-- [#781](https://github.com/request/request/pull/781) simpler isReadStream function (@joaojeronimo)
-
-### v2.32.0 (2014/01/16)
-- [#767](https://github.com/request/request/pull/767) Use tough-cookie CookieJar sync API (@stash)
-- [#764](https://github.com/request/request/pull/764) Case-insensitive authentication scheme (@bobyrizov)
-- [#763](https://github.com/request/request/pull/763) Upgrade tough-cookie to 0.10.0 (@stash)
-- [#744](https://github.com/request/request/pull/744) Use Cookie.parse (@lalitkapoor)
-- [#757](https://github.com/request/request/pull/757) require aws-sign2 (@mafintosh)
-
-### v2.31.0 (2014/01/08)
-- [#645](https://github.com/request/request/pull/645) update twitter api url to v1.1 (@mick)
-- [#746](https://github.com/request/request/pull/746) README: Markdown code highlight (@weakish)
-- [#745](https://github.com/request/request/pull/745) updating setCookie example to make it clear that the callback is required (@emkay)
-- [#742](https://github.com/request/request/pull/742) Add note about JSON output body type (@iansltx)
-- [#741](https://github.com/request/request/pull/741) README example is using old cookie jar api (@emkay)
-- [#736](https://github.com/request/request/pull/736) Fix callback arguments documentation (@mmalecki)
-
-### v2.30.0 (2013/12/13)
-- [#732](https://github.com/request/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium)
-- [#730](https://github.com/request/request/pull/730) better HTTP DIGEST support (@dai-shi)
-- [#728](https://github.com/request/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow)
-
-### v2.29.0 (2013/12/06)
-- [#727](https://github.com/request/request/pull/727) fix requester bug (@jchris)
-
-### v2.28.0 (2013/12/04)
-- [#724](https://github.com/request/request/pull/724) README.md: add custom HTTP Headers example. (@tcort)
-- [#719](https://github.com/request/request/pull/719) Made a comment gender neutral. (@oztu)
-- [#715](https://github.com/request/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub)
-- [#710](https://github.com/request/request/pull/710) Fixing listing in callback part of docs. (@lukasz-zak)
-- [#696](https://github.com/request/request/pull/696) Edited README.md for formatting and clarity of phrasing (@Zearin)
-- [#694](https://github.com/request/request/pull/694) Typo in README (@VRMink)
-- [#690](https://github.com/request/request/pull/690) Handle blank password in basic auth. (@diversario)
-- [#682](https://github.com/request/request/pull/682) Optional dependencies (@Turbo87)
-- [#683](https://github.com/request/request/pull/683) Travis CI support (@Turbo87)
-- [#674](https://github.com/request/request/pull/674) change cookie module,to tough-cookie.please check it . (@sxyizhiren)
-- [#666](https://github.com/request/request/pull/666) make `ciphers` and `secureProtocol` to work in https request (@richarddong)
-- [#656](https://github.com/request/request/pull/656) Test case for #304. (@diversario)
-- [#662](https://github.com/request/request/pull/662) option.tunnel to explicitly disable tunneling (@seanmonstar)
-- [#659](https://github.com/request/request/pull/659) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm)
-- [#630](https://github.com/request/request/pull/630) Send random cnonce for HTTP Digest requests (@wprl)
-
-### v2.27.0 (2013/08/15)
-- [#619](https://github.com/request/request/pull/619) decouple things a bit (@joaojeronimo)
-
-### v2.26.0 (2013/08/07)
-- [#613](https://github.com/request/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander)
-- [#605](https://github.com/request/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker)
-
-### v2.24.0 (2013/07/23)
-- [#596](https://github.com/request/request/pull/596) Global agent is being used when pool is specified (@Cauldrath)
-- [#594](https://github.com/request/request/pull/594) Emit complete event when there is no callback (@RomainLK)
-- [#601](https://github.com/request/request/pull/601) Fixed a small typo (@michalstanko)
-
-### v2.23.0 (2013/07/23)
-- [#589](https://github.com/request/request/pull/589) Prevent setting headers after they are sent (@geek)
-- [#587](https://github.com/request/request/pull/587) Global cookie jar disabled by default (@threepointone)
-
-### v2.22.0 (2013/07/05)
-- [#544](https://github.com/request/request/pull/544) Update http-signature version. (@davidlehn)
-- [#581](https://github.com/request/request/pull/581) Fix spelling of "ignoring." (@bigeasy)
-- [#568](https://github.com/request/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette)
-- [#564](https://github.com/request/request/pull/564) Fix redirections (@criloz)
-- [#541](https://github.com/request/request/pull/541) The exported request function doesn't have an auth method (@tschaub)
-- [#542](https://github.com/request/request/pull/542) Expose Request class (@regality)
-
-### v2.21.0 (2013/04/30)
-- [#536](https://github.com/request/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando)
-- [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva)
-- [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath)
-- [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi)
-- [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421)
-- [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka)
-
-### v2.17.0 (2013/04/22)
-- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421)
-- [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421)
-- [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun)
-- [#510](https://github.com/request/request/pull/510) Add HTTP Signature support. (@davidlehn)
-- [#502](https://github.com/request/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen)
-- [#508](https://github.com/request/request/pull/508) Honor the .strictSSL option when using proxies (tunnel-agent) (@jhs)
-- [#512](https://github.com/request/request/pull/512) Make password optional to support the format: http://username@hostname/ (@pajato1)
-- [#513](https://github.com/request/request/pull/513) add 'localAddress' support (@yyfrankyy)
-- [#498](https://github.com/request/request/pull/498) Moving response emit above setHeaders on destination streams (@kenperkins)
-- [#490](https://github.com/request/request/pull/490) Empty response body (3-rd argument) must be passed to callback as an empty string (@Olegas)
-- [#479](https://github.com/request/request/pull/479) Changing so if Accept header is explicitly set, sending json does not ov... (@RoryH)
-- [#475](https://github.com/request/request/pull/475) Use `unescape` from `querystring` (@shimaore)
-- [#473](https://github.com/request/request/pull/473) V0.10 compat (@isaacs)
-- [#471](https://github.com/request/request/pull/471) Using querystring library from visionmedia (@kbackowski)
-- [#461](https://github.com/request/request/pull/461) Strip the UTF8 BOM from a UTF encoded response (@kppullin)
-- [#460](https://github.com/request/request/pull/460) hawk 0.10.0 (@hueniverse)
-- [#462](https://github.com/request/request/pull/462) if query params are empty, then request path shouldn't end with a '?' (merges cleanly now) (@jaipandya)
-- [#456](https://github.com/request/request/pull/456) hawk 0.9.0 (@hueniverse)
-- [#429](https://github.com/request/request/pull/429) Copy options before adding callback. (@nrn)
-- [#454](https://github.com/request/request/pull/454) Destroy the response if present when destroying the request (clean merge) (@mafintosh)
-- [#310](https://github.com/request/request/pull/310) Twitter Oauth Stuff Out of Date; Now Updated (@joemccann)
-- [#413](https://github.com/request/request/pull/413) rename googledoodle.png to .jpg (@nfriedly)
-- [#448](https://github.com/request/request/pull/448) Convenience method for PATCH (@mloar)
-- [#444](https://github.com/request/request/pull/444) protect against double callbacks on error path (@spollack)
-- [#433](https://github.com/request/request/pull/433) Added support for HTTPS cert & key (@mmalecki)
-- [#430](https://github.com/request/request/pull/430) Respect specified {Host,host} headers, not just {host} (@andrewschaaf)
-- [#415](https://github.com/request/request/pull/415) Fixed a typo. (@jerem)
-- [#338](https://github.com/request/request/pull/338) Add more auth options, including digest support (@nylen)
-- [#403](https://github.com/request/request/pull/403) Optimize environment lookup to happen once only (@mmalecki)
-- [#398](https://github.com/request/request/pull/398) Add more reporting to tests (@mmalecki)
-- [#388](https://github.com/request/request/pull/388) Ensure "safe" toJSON doesn't break EventEmitters (@othiym23)
-- [#381](https://github.com/request/request/pull/381) Resolving "Invalid signature. Expected signature base string: " (@landeiro)
-- [#380](https://github.com/request/request/pull/380) Fixes missing host header on retried request when using forever agent (@mac-)
-- [#376](https://github.com/request/request/pull/376) Headers lost on redirect (@kapetan)
-- [#375](https://github.com/request/request/pull/375) Fix for missing oauth_timestamp parameter (@jplock)
-- [#374](https://github.com/request/request/pull/374) Correct Host header for proxy tunnel CONNECT (@youurayy)
-- [#370](https://github.com/request/request/pull/370) Twitter reverse auth uses x_auth_mode not x_auth_type (@drudge)
-- [#369](https://github.com/request/request/pull/369) Don't remove x_auth_mode for Twitter reverse auth (@drudge)
-- [#344](https://github.com/request/request/pull/344) Make AWS auth signing find headers correctly (@nlf)
-- [#363](https://github.com/request/request/pull/363) rfc3986 on base_uri, now passes tests (@jeffmarshall)
-- [#362](https://github.com/request/request/pull/362) Running `rfc3986` on `base_uri` in `oauth.hmacsign` instead of just `encodeURIComponent` (@jeffmarshall)
-- [#361](https://github.com/request/request/pull/361) Don't create a Content-Length header if we already have it set (@danjenkins)
-- [#360](https://github.com/request/request/pull/360) Delete self._form along with everything else on redirect (@jgautier)
-- [#355](https://github.com/request/request/pull/355) stop sending erroneous headers on redirected requests (@azylman)
-- [#332](https://github.com/request/request/pull/332) Fix #296 - Only set Content-Type if body exists (@Marsup)
-- [#343](https://github.com/request/request/pull/343) Allow AWS to work in more situations, added a note in the README on its usage (@nlf)
-- [#320](https://github.com/request/request/pull/320) request.defaults() doesn't need to wrap jar() (@StuartHarris)
-- [#322](https://github.com/request/request/pull/322) Fix + test for piped into request bumped into redirect. #321 (@alexindigo)
-- [#326](https://github.com/request/request/pull/326) Do not try to remove listener from an undefined connection (@strk)
-- [#318](https://github.com/request/request/pull/318) Pass servername to tunneling secure socket creation (@isaacs)
-- [#317](https://github.com/request/request/pull/317) Workaround for #313 (@isaacs)
-- [#293](https://github.com/request/request/pull/293) Allow parser errors to bubble up to request (@mscdex)
-- [#290](https://github.com/request/request/pull/290) A test for #289 (@isaacs)
-- [#280](https://github.com/request/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1)
-- [#207](https://github.com/request/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs)
-- [#214](https://github.com/request/request/pull/214) documenting additional behavior of json option (@jphaas)
-- [#272](https://github.com/request/request/pull/272) Boundary begins with CRLF? (@elspoono)
-- [#284](https://github.com/request/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry)
-- [#241](https://github.com/request/request/pull/241) Composability updates suggested by issue #239 (@polotek)
-- [#282](https://github.com/request/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock)
-- [#279](https://github.com/request/request/pull/279) fix tests with boundary by injecting boundry from header (@benatkin)
-- [#273](https://github.com/request/request/pull/273) Pipe back pressure issue (@mafintosh)
-- [#268](https://github.com/request/request/pull/268) I'm not OCD seriously (@TehShrike)
-- [#263](https://github.com/request/request/pull/263) Bug in OAuth key generation for sha1 (@nanodocumet)
-- [#265](https://github.com/request/request/pull/265) uncaughtException when redirected to invalid URI (@naholyr)
-- [#262](https://github.com/request/request/pull/262) JSON test should check for equality (@timshadel)
-- [#261](https://github.com/request/request/pull/261) Setting 'pool' to 'false' does NOT disable Agent pooling (@timshadel)
-- [#249](https://github.com/request/request/pull/249) Fix for the fix of your (closed) issue #89 where self.headers[content-length] is set to 0 for all methods (@sethbridges)
-- [#255](https://github.com/request/request/pull/255) multipart allow body === '' ( the empty string ) (@Filirom1)
-- [#260](https://github.com/request/request/pull/260) fixed just another leak of 'i' (@sreuter)
-- [#246](https://github.com/request/request/pull/246) Fixing the set-cookie header (@jeromegn)
-- [#243](https://github.com/request/request/pull/243) Dynamic boundary (@zephrax)
-- [#240](https://github.com/request/request/pull/240) don't error when null is passed for options (@polotek)
-- [#211](https://github.com/request/request/pull/211) Replace all occurrences of special chars in RFC3986 (@chriso)
-- [#224](https://github.com/request/request/pull/224) Multipart content-type change (@janjongboom)
-- [#217](https://github.com/request/request/pull/217) need to use Authorization (titlecase) header with Tumblr OAuth (@visnup)
-- [#203](https://github.com/request/request/pull/203) Fix cookie and redirect bugs and add auth support for HTTPS tunnel (@milewise)
-- [#199](https://github.com/request/request/pull/199) Tunnel (@isaacs)
-- [#198](https://github.com/request/request/pull/198) Bugfix on forever usage of util.inherits (@isaacs)
-- [#197](https://github.com/request/request/pull/197) Make ForeverAgent work with HTTPS (@isaacs)
-- [#193](https://github.com/request/request/pull/193) Fixes GH-119 (@goatslacker)
-- [#188](https://github.com/request/request/pull/188) Add abort support to the returned request (@itay)
-- [#176](https://github.com/request/request/pull/176) Querystring option (@csainty)
-- [#182](https://github.com/request/request/pull/182) Fix request.defaults to support (uri, options, callback) api (@twilson63)
-- [#180](https://github.com/request/request/pull/180) Modified the post, put, head and del shortcuts to support uri optional param (@twilson63)
-- [#179](https://github.com/request/request/pull/179) fix to add opts in .pipe(stream, opts) (@substack)
-- [#177](https://github.com/request/request/pull/177) Issue #173 Support uri as first and optional config as second argument (@twilson63)
-- [#170](https://github.com/request/request/pull/170) can't create a cookie in a wrapped request (defaults) (@fabianonunes)
-- [#168](https://github.com/request/request/pull/168) Picking off an EasyFix by adding some missing mimetypes. (@serby)
-- [#161](https://github.com/request/request/pull/161) Fix cookie jar/headers.cookie collision (#125) (@papandreou)
-- [#162](https://github.com/request/request/pull/162) Fix issue #159 (@dpetukhov)
-- [#90](https://github.com/request/request/pull/90) add option followAllRedirects to follow post/put redirects (@jroes)
-- [#148](https://github.com/request/request/pull/148) Retry Agent (@thejh)
-- [#146](https://github.com/request/request/pull/146) Multipart should respect content-type if previously set (@apeace)
-- [#144](https://github.com/request/request/pull/144) added "form" option to readme (@petejkim)
-- [#133](https://github.com/request/request/pull/133) Fixed cookies parsing (@afanasy)
-- [#135](https://github.com/request/request/pull/135) host vs hostname (@iangreenleaf)
-- [#132](https://github.com/request/request/pull/132) return the body as a Buffer when encoding is set to null (@jahewson)
-- [#112](https://github.com/request/request/pull/112) Support using a custom http-like module (@jhs)
-- [#104](https://github.com/request/request/pull/104) Cookie handling contains bugs (@janjongboom)
-- [#121](https://github.com/request/request/pull/121) Another patch for cookie handling regression (@jhurliman)
-- [#117](https://github.com/request/request/pull/117) Remove the global `i` (@3rd-Eden)
-- [#110](https://github.com/request/request/pull/110) Update to Iris Couch URL (@jhs)
-- [#86](https://github.com/request/request/pull/86) Can't post binary to multipart requests (@developmentseed)
-- [#105](https://github.com/request/request/pull/105) added test for proxy option. (@dominictarr)
-- [#102](https://github.com/request/request/pull/102) Implemented cookies - closes issue 82: https://github.com/mikeal/request/issues/82 (@alessioalex)
-- [#97](https://github.com/request/request/pull/97) Typo in previous pull causes TypeError in non-0.5.11 versions (@isaacs)
-- [#96](https://github.com/request/request/pull/96) Authless parsed url host support (@isaacs)
-- [#81](https://github.com/request/request/pull/81) Enhance redirect handling (@danmactough)
-- [#78](https://github.com/request/request/pull/78) Don't try to do strictSSL for non-ssl connections (@isaacs)
-- [#76](https://github.com/request/request/pull/76) Bug when a request fails and a timeout is set (@Marsup)
-- [#70](https://github.com/request/request/pull/70) add test script to package.json (@isaacs)
-- [#73](https://github.com/request/request/pull/73) Fix #71 Respect the strictSSL flag (@isaacs)
-- [#69](https://github.com/request/request/pull/69) Flatten chunked requests properly (@isaacs)
-- [#67](https://github.com/request/request/pull/67) fixed global variable leaks (@aheckmann)
-- [#66](https://github.com/request/request/pull/66) Do not overwrite established content-type headers for read stream deliver (@voodootikigod)
-- [#53](https://github.com/request/request/pull/53) Parse json: Issue #51 (@benatkin)
-- [#45](https://github.com/request/request/pull/45) Added timeout option (@mbrevoort)
-- [#35](https://github.com/request/request/pull/35) The "end" event isn't emitted for some responses (@voxpelli)
-- [#31](https://github.com/request/request/pull/31) Error on piping a request to a destination (@tobowers)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/request/CONTRIBUTING.md b/node_modules/request/CONTRIBUTING.md
deleted file mode 100644
index 06b1968..0000000
--- a/node_modules/request/CONTRIBUTING.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# This is an OPEN Open Source Project
-
------------------------------------------
-
-## What?
-
-Individuals making significant and valuable contributions are given
-commit-access to the project to contribute as they see fit. This project is
-more like an open wiki than a standard guarded open source project.
-
-## Rules
-
-There are a few basic ground-rules for contributors:
-
-1. **No `--force` pushes** or modifying the Git history in any way.
-1. **Non-master branches** ought to be used for ongoing work.
-1. **External API changes and significant modifications** ought to be subject
- to an **internal pull-request** to solicit feedback from other contributors.
-1. Internal pull-requests to solicit feedback are *encouraged* for any other
- non-trivial contribution but left to the discretion of the contributor.
-1. For significant changes wait a full 24 hours before merging so that active
- contributors who are distributed throughout the world have a chance to weigh
- in.
-1. Contributors should attempt to adhere to the prevailing code-style.
-1. Run `npm test` locally before submitting your PR, to catch any easy to miss
- style & testing issues. To diagnose test failures, there are two ways to
- run a single test file:
- - `node_modules/.bin/taper tests/test-file.js` - run using the default
- [`taper`](https://github.com/nylen/taper) test reporter.
- - `node tests/test-file.js` - view the raw
- [tap](https://testanything.org/) output.
-
-
-## Releases
-
-Declaring formal releases remains the prerogative of the project maintainer.
-
-## Changes to this arrangement
-
-This is an experiment and feedback is welcome! This document may also be
-subject to pull-requests or changes by contributors where you believe you have
-something valuable to add or change.
-
------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/LICENSE b/node_modules/request/LICENSE
deleted file mode 100644
index a4a9aee..0000000
--- a/node_modules/request/LICENSE
+++ /dev/null
@@ -1,55 +0,0 @@
-Apache License
-
-Version 2.0, January 2004
-
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modi
fications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
[15/59] [abbrv] couchdb-nmo git commit: website: add styles & fix
markup
Posted by ro...@apache.org.
website: add styles & fix markup
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/6f5bdfd0
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/6f5bdfd0
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/6f5bdfd0
Branch: refs/heads/master
Commit: 6f5bdfd09f45bd8af0fa27d6a0b41ac8dc8ebe75
Parents: 2870177
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Mon May 25 22:46:54 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Mon May 25 22:46:54 2015 +0200
----------------------------------------------------------------------
doc/website/assets/css/custom.less | 10 +++++++++-
doc/website/doc-template.html | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6f5bdfd0/doc/website/assets/css/custom.less
----------------------------------------------------------------------
diff --git a/doc/website/assets/css/custom.less b/doc/website/assets/css/custom.less
index 17395dd..19cf6f1 100644
--- a/doc/website/assets/css/custom.less
+++ b/doc/website/assets/css/custom.less
@@ -7,7 +7,7 @@
}
.wrapper {
- margin: 0 auto;
+ margin: 0 auto 100px auto;
width: 43%;
overflow: hidden;
}
@@ -25,3 +25,11 @@ footer {
.mark {
margin-left: 2%;
}
+
+header a {
+ text-decoration: none;
+}
+
+iframe {
+ margin-bottom: 5%;
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6f5bdfd0/doc/website/doc-template.html
----------------------------------------------------------------------
diff --git a/doc/website/doc-template.html b/doc/website/doc-template.html
index 85a5c1e..18ee98d 100644
--- a/doc/website/doc-template.html
+++ b/doc/website/doc-template.html
@@ -7,7 +7,7 @@
</head>
<body>
- <div class="wrapper"
+ <div class="wrapper">
<header>
<h1>
<a href="__PATH__/">nmo</a>
[20/59] [abbrv] couchdb-nmo git commit: add fork me on github ribbon
Posted by ro...@apache.org.
add fork me on github ribbon
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/1d9e3767
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/1d9e3767
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/1d9e3767
Branch: refs/heads/master
Commit: 1d9e3767d1e00f3a03b0b0e0ea4b5be3c9e83bfd
Parents: ce0ece7
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Thu Jun 25 23:06:04 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu Jun 25 23:06:04 2015 +0200
----------------------------------------------------------------------
doc/website/doc-template.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/1d9e3767/doc/website/doc-template.html
----------------------------------------------------------------------
diff --git a/doc/website/doc-template.html b/doc/website/doc-template.html
index 18ee98d..2608042 100644
--- a/doc/website/doc-template.html
+++ b/doc/website/doc-template.html
@@ -6,7 +6,7 @@
<link rel="stylesheet" href="__PATH__/assets/css/style.css">
</head>
<body>
-
+<a href="https://github.com/robertkowalski/nmo"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/567c3a48d796e2fc06ea80409cc9dd82bf714434/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png"></a>
<div class="wrapper">
<header>
<h1>
[32/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype b/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
deleted file mode 100644
index 3f94986..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
+++ /dev/null
@@ -1,241 +0,0 @@
-'\" te
-.\" Copyright (c) 2011, Robert Mustacchi. All Rights Reserved.
-.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved.
-.\"
-.\" Permission is hereby granted, free of charge, to any person obtaining a copy
-.\" of this software and associated documentation files (the "Software"), to
-.\" deal in the Software without restriction, including without limitation the
-.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-.\" sell copies of the Software, and to permit persons to whom the Software is
-.\" furnished to do so, subject to the following conditions:
-.\"
-.\" The above copyright notice and this permission notice shall be included in
-.\" all copies or substantial portions of the Software.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-.\" IN THE SOFTWARE.
-.TH CTIO 3CTYPE "December 12, 2011"
-.SH NAME
-ctio, ruint8, ruint16, ruint32, ruint64, wuint8, wuint16, wuint32, wuint64,
-rsint8, rsint16, rsint32, rsint64, wsint8, wsint16, wsint32, wsint64, rfloat,
-rdouble, wfloat, wdouble \- integer and float operations
-.SH SYNOPSIS
-.LP
-.nf
-var mod_ctype = require('ctype');
-
-\fBNumber\fR \fBmod_ctype.ruint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber\fR \fBmod_ctype.ruint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber\fR \fBmod_ctype.ruint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber[2]\fR \fBmod_ctype.ruint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber\fR \fBmod_ctype.rsint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber\fR \fBmod_ctype.rsint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber\fR \fBmod_ctype.rsint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber[2]\fR \fBmod_ctype.rsint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber\fR \fBmod_ctype.rfloat\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBNumber\fR \fBmod_ctype.rdouble\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wuint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wuint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wuint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wuint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wsint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wsint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wsint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wsint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wfloat\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBmod_ctype.wdouble\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The argument \fIbuf\fR refers to a valid buffer (from calling new Buffer()). The
-argument \fIendian\fR is either the string 'big' or 'little' and controls
-whether the data in the buffer is interpreted as big or little endian. The argument
-\fIoffset\fR indicates the starting index into the buffer to read or write. All
-functions ensure that starting at \fIoffset\fR does not overflow the end of the
-buffer. The argument \fIvalue\fR is a Number that is the valid type for the
-specific function. All functions that take \fIvalue\fR as an argument, verify
-that the passed value is valid.
-
-.SS "\fBruint8()\fR, \fBruint16()\fR, \fBruint32()\fR"
-.sp
-.LP
-The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions read an 8,
-16, and 32-bit unsigned value from \fIbuf\fR and return it. The value read is
-influenced by the values of \fIoffset\fR and \fRendian\fI.
-
-
-.SS "\fBrsint8()\fR, \fBrsint16()\fR, \fBrsint32()\fR"
-.sp
-.LP
-The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions work just as
-\fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR, except they return signed
-integers.
-
-.SS "\fBruint64()\fR, \fBrsint64()\fR"
-.sp
-.LP
-The \fBruint64()\fR and \fBrsint64()\fR functions read unsigned and signed 64
-bit integers respectively from \fBbuf\fR. Due to the limitations of ECMAScript's
-\fBNumber\fR type, they cannot be stored as one value without a loss of
-precision. Instead of returning the values as a single \fBNumber\fR, the
-functions return an array of two numbers. The first entry always contains the
-upper 32-bits and the second value contains the lower 32-bits. The lossy
-transformation into a number would be \fIres[0]*Math.pow(2,32)+res[1]\fR.
-Note that, unless an entry is zero, both array entries are guaranteed to have
-the same sign.
-
-.SS "\fBwuint8()\fR, \fBwuint16()\fR, \fBwuint32()\fR"
-.sp
-.LP
-The functions \fBwuint8()\fR, \fBwuint16()\fR, and \fBwuint32()\fR modify the
-contents of \fBbuf\fR by writing an 8, 16, and 32-bit unsigned integer
-respectively to \fBbuf\fR. It is illegal to pass a number that is not an integer
-within the domain of the integer size, for example, for \fBwuint8()\fR the valid
-range is \fB[0, 255]\fR. The value will be written in either big or little
-endian format based upon the value of \fBendian\fR.
-
-
-.SS "\fBwsint8()\fR, \fBwsint16()\fR, \fBwsint32()\fR"
-.sp
-.LP
-The functions \fBwsint8()\fR, \fBwsint16()\fR, and \fBwsint32()\fR function
-identically to the functions \fBwuint8()\fR, \fBwuint16()\fR, and
-\fBwuint32()\fR except that they the valid domain for \fBvalue\fR is that of a
-signed number instead of an unsigned number. For example the \fBwsint8()\fR has
-a domain of \fB[-128, 127]\fR.
-
-.SS "\fBwuint64()\fR, \fBwsint64()\fR"
-.sp
-.LP
-The functions \fBwuint64()\fR and \fBswint64()\fR write out 64-bit unsigned and
-signed integers to \fBbuf\fR. The \fBvalue\fR argument must be in the same
-format as described in \fBruint64()\fR and \fBrsint64()\fR.
-
-.SS "\fBrfloat()\fR, \fBrdouble()\fR"
-.sp
-.LP
-The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other read
-functions, except that they read a single precision and double precision
-IEEE-754 floating point value instead.
-
-.SS "\fBwfloat()\fR, \fBwdouble()\fR"
-.sp
-.LP
-The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other write
-functions, except that the domain for a float is that of a single precision 4
-byte value. The domain for a double is any \fBNumber\fR in ECMAScript, which is
-defined to be represented by a double.
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE ATTRIBUTE VALUE
-_
-Interface Stability Committed
-_
-MT-Level See below.
-_
-Standard Not standardized.
-.TE
-
-.sp
-.LP
-
-All functions are MT-safe in so far as there aren't shared memory MT concerns in
-most node programs. If one where to concoct such an environment, these functions
-wouldn't be MT-safe.
-
-.SH SEE ALSO
-.sp
-.LP
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json b/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
deleted file mode 100644
index 4e1d867..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "ctype",
- "version": "0.5.3",
- "description": "read and write binary structures and data types",
- "homepage": "https://github.com/rmustacc/node-ctype",
- "author": {
- "name": "Robert Mustacchi",
- "email": "rm@fingolfin.org"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "main": "ctype.js",
- "repository": {
- "type": "git",
- "url": "https://github.com/rmustacc/node-ctype.git"
- },
- "_id": "ctype@0.5.3",
- "dist": {
- "shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f",
- "tarball": "http://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz"
- },
- "_npmVersion": "1.1.59",
- "_npmUser": {
- "name": "rm",
- "email": "rm@fingolfin.org"
- },
- "maintainers": [
- {
- "name": "rm",
- "email": "rm@fingolfin.org"
- }
- ],
- "directories": {},
- "_shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f",
- "_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz",
- "_from": "ctype@0.5.3",
- "bugs": {
- "url": "https://github.com/rmustacc/node-ctype/issues"
- },
- "readme": "ERROR: No README data found!",
- "scripts": {}
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf b/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf
deleted file mode 100755
index 845f367..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf
+++ /dev/null
@@ -1,129 +0,0 @@
-#
-# Configuration File for JavaScript Lint 0.3.0
-# Developed by Matthias Miller (http://www.JavaScriptLint.com)
-#
-# This configuration file can be used to lint a collection of scripts, or to enable
-# or disable warnings for scripts that are linted via the command line.
-#
-
-### Warnings
-# Enable or disable warnings based on requirements.
-# Use "+WarningName" to display or "-WarningName" to suppress.
-#
-+no_return_value # function {0} does not always return a value
-+duplicate_formal # duplicate formal argument {0}
-+equal_as_assign # test for equality (==) mistyped as assignment (=)?{0}
-+var_hides_arg # variable {0} hides argument
-+redeclared_var # redeclaration of {0} {1}
-+anon_no_return_value # anonymous function does not always return a value
-+missing_semicolon # missing semicolon
-+meaningless_block # meaningless block; curly braces have no impact
-+comma_separated_stmts # multiple statements separated by commas (use semicolons?)
-+unreachable_code # unreachable code
-+missing_break # missing break statement
-+missing_break_for_last_case # missing break statement for last case in switch
-+comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
--inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement
-+useless_void # use of the void type may be unnecessary (void is always undefined)
--useless_quotes # quotation marks are unnecessary
-+multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
-+use_of_label # use of label
--block_without_braces # block statement without curly braces
-+leading_decimal_point # leading decimal point may indicate a number or an object member
-+trailing_decimal_point # trailing decimal point may indicate a number or an object member
--octal_number # leading zeros make an octal number
-+nested_comment # nested comment
-+misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
-+ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement
-+empty_statement # empty statement or extra semicolon
--missing_option_explicit # the "option explicit" control comment is missing
-+partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag
-+dup_option_explicit # duplicate "option explicit" control comment
-+useless_assign # useless assignment
-+ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity
-+ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
-+missing_default_case # missing default case in switch statement
-+duplicate_case_in_switch # duplicate case in switch statements
-+default_not_at_end # the default case is not at the end of the switch statement
-+legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax
-+jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax
-+useless_comparison # useless comparison; comparing identical expressions
-+with_statement # with statement hides undeclared variables; use temporary variable instead
-+trailing_comma_in_array # extra comma is not recommended in array initializers
-+assign_to_function_call # assignment to a function call
-+parseint_missing_radix # parseInt missing radix parameter
--unreferenced_argument # argument declared but never referenced: {name}
-
-### Output format
-# Customize the format of the error message.
-# __FILE__ indicates current file path
-# __FILENAME__ indicates current file name
-# __LINE__ indicates current line
-# __ERROR__ indicates error message
-#
-# Visual Studio syntax (default):
-+output-format __FILE__(__LINE__): __ERROR__
-# Alternative syntax:
-#+output-format __FILE__:__LINE__: __ERROR__
-
-
-### Context
-# Show the in-line position of the error.
-# Use "+context" to display or "-context" to suppress.
-#
-+context
-
-
-### Semicolons
-# By default, assignments of an anonymous function to a variable or
-# property (such as a function prototype) must be followed by a semicolon.
-#
-#+lambda_assign_requires_semicolon # deprecated setting
-
-
-### Control Comments
-# Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for
-# the /*@keyword@*/ control comments and JScript conditional comments. (The latter is
-# enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason,
-# although legacy control comments are enabled by default for backward compatibility.
-#
-+legacy_control_comments
-
-
-### JScript Function Extensions
-# JScript allows member functions to be defined like this:
-# function MyObj() { /*constructor*/ }
-# function MyObj.prototype.go() { /*member function*/ }
-#
-# It also allows events to be attached like this:
-# function window::onload() { /*init page*/ }
-#
-# This is a Microsoft-only JavaScript extension. Enable this setting to allow them.
-#
-#-jscript_function_extensions # deprecated setting
-
-
-### Defining identifiers
-# By default, "option explicit" is enabled on a per-file basis.
-# To enable this for all files, use "+always_use_option_explicit"
--always_use_option_explicit
-
-# Define certain identifiers of which the lint is not aware.
-# (Use this in conjunction with the "undeclared identifier" warning.)
-#
-# Common uses for webpages might be:
-#+define window
-#+define document
-+define require
-+define exports
-+define console
-+define Buffer
-+define JSON
-
-### Files
-# Specify which files to lint
-# Use "+recurse" to enable recursion (disabled by default).
-# To add a set of files, use "+process FileName", "+process Folder\Path\*.js",
-# or "+process Folder\Path\*.htm".
-#
-#+process jsl-test.js
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle b/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle
deleted file mode 100755
index 96c72b6..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle
+++ /dev/null
@@ -1,839 +0,0 @@
-#!/usr/bin/env perl
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# Copyright 2011 Joyent, Inc. All rights reserved.
-#
-# jsstyle - check for some common stylistic errors.
-#
-# jsstyle is a sort of "lint" for Javascript coding style. This tool is
-# derived from the cstyle tool, used to check for the style used in the
-# Solaris kernel, sometimes known as "Bill Joy Normal Form".
-#
-# There's a lot this can't check for, like proper indentation of code
-# blocks. There's also a lot more this could check for.
-#
-# A note to the non perl literate:
-#
-# perl regular expressions are pretty much like egrep
-# regular expressions, with the following special symbols
-#
-# \s any space character
-# \S any non-space character
-# \w any "word" character [a-zA-Z0-9_]
-# \W any non-word character
-# \d a digit [0-9]
-# \D a non-digit
-# \b word boundary (between \w and \W)
-# \B non-word boundary
-#
-
-require 5.0;
-use IO::File;
-use Getopt::Std;
-use strict;
-
-my $usage =
-"usage: jsstyle [-chvC] [-o constructs] file ...
- -c check continuation indentation inside functions
- -h perform heuristic checks that are sometimes wrong
- -v verbose
- -C don't check anything in header block comments
- -o constructs
- allow a comma-seperated list of optional constructs:
- doxygen allow doxygen-style block comments (/** /*!)
- splint allow splint-style lint comments (/*@ ... @*/)
-";
-
-my %opts;
-
-if (!getopts("cho:vC", \%opts)) {
- print $usage;
- exit 2;
-}
-
-my $check_continuation = $opts{'c'};
-my $heuristic = $opts{'h'};
-my $verbose = $opts{'v'};
-my $ignore_hdr_comment = $opts{'C'};
-
-my $doxygen_comments = 0;
-my $splint_comments = 0;
-
-if (defined($opts{'o'})) {
- for my $x (split /,/, $opts{'o'}) {
- if ($x eq "doxygen") {
- $doxygen_comments = 1;
- } elsif ($x eq "splint") {
- $splint_comments = 1;
- } else {
- print "jsstyle: unrecognized construct \"$x\"\n";
- print $usage;
- exit 2;
- }
- }
-}
-
-my ($filename, $line, $prev); # shared globals
-
-my $fmt;
-my $hdr_comment_start;
-
-if ($verbose) {
- $fmt = "%s: %d: %s\n%s\n";
-} else {
- $fmt = "%s: %d: %s\n";
-}
-
-if ($doxygen_comments) {
- # doxygen comments look like "/*!" or "/**"; allow them.
- $hdr_comment_start = qr/^\s*\/\*[\!\*]?$/;
-} else {
- $hdr_comment_start = qr/^\s*\/\*$/;
-}
-
-# Note, following must be in single quotes so that \s and \w work right.
-my $lint_re = qr/\/\*(?:
- jsl:\w+?|ARGSUSED[0-9]*|NOTREACHED|LINTLIBRARY|VARARGS[0-9]*|
- CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY|
- FALLTHRU|FALLTHROUGH|LINTED.*?|PRINTFLIKE[0-9]*|
- PROTOLIB[0-9]*|SCANFLIKE[0-9]*|JSSTYLED.*?
- )\*\//x;
-
-my $splint_re = qr/\/\*@.*?@\*\//x;
-
-my $err_stat = 0; # exit status
-
-if ($#ARGV >= 0) {
- foreach my $arg (@ARGV) {
- my $fh = new IO::File $arg, "r";
- if (!defined($fh)) {
- printf "%s: cannot open\n", $arg;
- } else {
- &jsstyle($arg, $fh);
- close $fh;
- }
- }
-} else {
- &jsstyle("<stdin>", *STDIN);
-}
-exit $err_stat;
-
-my $no_errs = 0; # set for JSSTYLED-protected lines
-
-sub err($) {
- my ($error) = @_;
- unless ($no_errs) {
- printf $fmt, $filename, $., $error, $line;
- $err_stat = 1;
- }
-}
-
-sub err_prefix($$) {
- my ($prevline, $error) = @_;
- my $out = $prevline."\n".$line;
- unless ($no_errs) {
- printf $fmt, $filename, $., $error, $out;
- $err_stat = 1;
- }
-}
-
-sub err_prev($) {
- my ($error) = @_;
- unless ($no_errs) {
- printf $fmt, $filename, $. - 1, $error, $prev;
- $err_stat = 1;
- }
-}
-
-sub jsstyle($$) {
-
-my ($fn, $filehandle) = @_;
-$filename = $fn; # share it globally
-
-my $in_cpp = 0;
-my $next_in_cpp = 0;
-
-my $in_comment = 0;
-my $in_header_comment = 0;
-my $comment_done = 0;
-my $in_function = 0;
-my $in_function_header = 0;
-my $in_declaration = 0;
-my $note_level = 0;
-my $nextok = 0;
-my $nocheck = 0;
-
-my $in_string = 0;
-
-my ($okmsg, $comment_prefix);
-
-$line = '';
-$prev = '';
-reset_indent();
-
-line: while (<$filehandle>) {
- s/\r?\n$//; # strip return and newline
-
- # save the original line, then remove all text from within
- # double or single quotes, we do not want to check such text.
-
- $line = $_;
-
- #
- # C allows strings to be continued with a backslash at the end of
- # the line. We translate that into a quoted string on the previous
- # line followed by an initial quote on the next line.
- #
- # (we assume that no-one will use backslash-continuation with character
- # constants)
- #
- $_ = '"' . $_ if ($in_string && !$nocheck && !$in_comment);
-
- #
- # normal strings and characters
- #
- s/'([^\\']|\\.)*'/\'\'/g;
- s/"([^\\"]|\\.)*"/\"\"/g;
-
- #
- # detect string continuation
- #
- if ($nocheck || $in_comment) {
- $in_string = 0;
- } else {
- #
- # Now that all full strings are replaced with "", we check
- # for unfinished strings continuing onto the next line.
- #
- $in_string =
- (s/([^"](?:"")*)"([^\\"]|\\.)*\\$/$1""/ ||
- s/^("")*"([^\\"]|\\.)*\\$/""/);
- }
-
- #
- # figure out if we are in a cpp directive
- #
- $in_cpp = $next_in_cpp || /^\s*#/; # continued or started
- $next_in_cpp = $in_cpp && /\\$/; # only if continued
-
- # strip off trailing backslashes, which appear in long macros
- s/\s*\\$//;
-
- # an /* END JSSTYLED */ comment ends a no-check block.
- if ($nocheck) {
- if (/\/\* *END *JSSTYLED *\*\//) {
- $nocheck = 0;
- } else {
- reset_indent();
- next line;
- }
- }
-
- # a /*JSSTYLED*/ comment indicates that the next line is ok.
- if ($nextok) {
- if ($okmsg) {
- err($okmsg);
- }
- $nextok = 0;
- $okmsg = 0;
- if (/\/\* *JSSTYLED.*\*\//) {
- /^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
- $okmsg = $1;
- $nextok = 1;
- }
- $no_errs = 1;
- } elsif ($no_errs) {
- $no_errs = 0;
- }
-
- # check length of line.
- # first, a quick check to see if there is any chance of being too long.
- if (($line =~ tr/\t/\t/) * 7 + length($line) > 80) {
- # yes, there is a chance.
- # replace tabs with spaces and check again.
- my $eline = $line;
- 1 while $eline =~
- s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
- if (length($eline) > 80) {
- err("line > 80 characters");
- }
- }
-
- # ignore NOTE(...) annotations (assumes NOTE is on lines by itself).
- if ($note_level || /\b_?NOTE\s*\(/) { # if in NOTE or this is NOTE
- s/[^()]//g; # eliminate all non-parens
- $note_level += s/\(//g - length; # update paren nest level
- next;
- }
-
- # a /* BEGIN JSSTYLED */ comment starts a no-check block.
- if (/\/\* *BEGIN *JSSTYLED *\*\//) {
- $nocheck = 1;
- }
-
- # a /*JSSTYLED*/ comment indicates that the next line is ok.
- if (/\/\* *JSSTYLED.*\*\//) {
- /^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
- $okmsg = $1;
- $nextok = 1;
- }
- if (/\/\/ *JSSTYLED/) {
- /^.*\/\/ *JSSTYLED *(.*)$/;
- $okmsg = $1;
- $nextok = 1;
- }
-
- # universal checks; apply to everything
- if (/\t +\t/) {
- err("spaces between tabs");
- }
- if (/ \t+ /) {
- err("tabs between spaces");
- }
- if (/\s$/) {
- err("space or tab at end of line");
- }
- if (/[^ \t(]\/\*/ && !/\w\(\/\*.*\*\/\);/) {
- err("comment preceded by non-blank");
- }
-
- # is this the beginning or ending of a function?
- # (not if "struct foo\n{\n")
- if (/^{$/ && $prev =~ /\)\s*(const\s*)?(\/\*.*\*\/\s*)?\\?$/) {
- $in_function = 1;
- $in_declaration = 1;
- $in_function_header = 0;
- $prev = $line;
- next line;
- }
- if (/^}\s*(\/\*.*\*\/\s*)*$/) {
- if ($prev =~ /^\s*return\s*;/) {
- err_prev("unneeded return at end of function");
- }
- $in_function = 0;
- reset_indent(); # we don't check between functions
- $prev = $line;
- next line;
- }
- if (/^\w*\($/) {
- $in_function_header = 1;
- }
-
- # a blank line terminates the declarations within a function.
- # XXX - but still a problem in sub-blocks.
- if ($in_declaration && /^$/) {
- $in_declaration = 0;
- }
-
- if ($comment_done) {
- $in_comment = 0;
- $in_header_comment = 0;
- $comment_done = 0;
- }
- # does this looks like the start of a block comment?
- if (/$hdr_comment_start/) {
- if (!/^\t*\/\*/) {
- err("block comment not indented by tabs");
- }
- $in_comment = 1;
- /^(\s*)\//;
- $comment_prefix = $1;
- if ($comment_prefix eq "") {
- $in_header_comment = 1;
- }
- $prev = $line;
- next line;
- }
- # are we still in the block comment?
- if ($in_comment) {
- if (/^$comment_prefix \*\/$/) {
- $comment_done = 1;
- } elsif (/\*\//) {
- $comment_done = 1;
- err("improper block comment close")
- unless ($ignore_hdr_comment && $in_header_comment);
- } elsif (!/^$comment_prefix \*[ \t]/ &&
- !/^$comment_prefix \*$/) {
- err("improper block comment")
- unless ($ignore_hdr_comment && $in_header_comment);
- }
- }
-
- if ($in_header_comment && $ignore_hdr_comment) {
- $prev = $line;
- next line;
- }
-
- # check for errors that might occur in comments and in code.
-
- # allow spaces to be used to draw pictures in header comments.
- #if (/[^ ] / && !/".* .*"/ && !$in_header_comment) {
- # err("spaces instead of tabs");
- #}
- #if (/^ / && !/^ \*[ \t\/]/ && !/^ \*$/ &&
- # (!/^ \w/ || $in_function != 0)) {
- # err("indent by spaces instead of tabs");
- #}
- if (/^ {2,}/ && !/^ [^ ]/) {
- err("indent by spaces instead of tabs");
- }
- if (/^\t+ [^ \t\*]/ || /^\t+ \S/ || /^\t+ \S/) {
- err("continuation line not indented by 4 spaces");
- }
-
- if (/^\s*\/\*./ && !/^\s*\/\*.*\*\// && !/$hdr_comment_start/) {
- err("improper first line of block comment");
- }
-
- if ($in_comment) { # still in comment, don't do further checks
- $prev = $line;
- next line;
- }
-
- if ((/[^(]\/\*\S/ || /^\/\*\S/) &&
- !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
- err("missing blank after open comment");
- }
- if (/\S\*\/[^)]|\S\*\/$/ &&
- !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
- err("missing blank before close comment");
- }
- if (/\/\/\S/) { # C++ comments
- err("missing blank after start comment");
- }
- # check for unterminated single line comments, but allow them when
- # they are used to comment out the argument list of a function
- # declaration.
- if (/\S.*\/\*/ && !/\S.*\/\*.*\*\// && !/\(\/\*/) {
- err("unterminated single line comment");
- }
-
- if (/^(#else|#endif|#include)(.*)$/) {
- $prev = $line;
- next line;
- }
-
- #
- # delete any comments and check everything else. Note that
- # ".*?" is a non-greedy match, so that we don't get confused by
- # multiple comments on the same line.
- #
- s/\/\*.*?\*\///g;
- s/\/\/.*$//; # C++ comments
-
- # delete any trailing whitespace; we have already checked for that.
- s/\s*$//;
-
- # following checks do not apply to text in comments.
- if (/"/) {
- err("literal string using double-quote instead of single");
- }
-
- if (/[^=!<>\s][!<>=]=/ || /[^<>!=][!<>=]==?[^\s,=]/ ||
- (/[^->]>[^,=>\s]/ && !/[^->]>$/) ||
- (/[^<]<[^,=<\s]/ && !/[^<]<$/) ||
- /[^<\s]<[^<]/ || /[^->\s]>[^>]/) {
- err("missing space around relational operator");
- }
- if (/\S>>=/ || /\S<<=/ || />>=\S/ || /<<=\S/ || /\S[-+*\/&|^%]=/ ||
- (/[^-+*\/&|^%!<>=\s]=[^=]/ && !/[^-+*\/&|^%!<>=\s]=$/) ||
- (/[^!<>=]=[^=\s]/ && !/[^!<>=]=$/)) {
- # XXX - should only check this for C++ code
- # XXX - there are probably other forms that should be allowed
- if (!/\soperator=/) {
- err("missing space around assignment operator");
- }
- }
- if (/[,;]\S/ && !/\bfor \(;;\)/) {
- err("comma or semicolon followed by non-blank");
- }
- # allow "for" statements to have empty "while" clauses
- if (/\s[,;]/ && !/^[\t]+;$/ && !/^\s*for \([^;]*; ;[^;]*\)/) {
- err("comma or semicolon preceded by blank");
- }
- if (/^\s*(&&|\|\|)/) {
- err("improper boolean continuation");
- }
- if (/\S *(&&|\|\|)/ || /(&&|\|\|) *\S/) {
- err("more than one space around boolean operator");
- }
- if (/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\(/) {
- err("missing space between keyword and paren");
- }
- if (/(\b(catch|for|if|with|while|switch|return)\b.*){2,}/) {
- # multiple "case" and "sizeof" allowed
- err("more than one keyword on line");
- }
- if (/\b(delete|typeof|instanceOf|with|throw|catch|new|function|in|for|if|while|switch|return|case)\s\s+\(/ &&
- !/^#if\s+\(/) {
- err("extra space between keyword and paren");
- }
- # try to detect "func (x)" but not "if (x)" or
- # "#define foo (x)" or "int (*func)();"
- if (/\w\s\(/) {
- my $s = $_;
- # strip off all keywords on the line
- s/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\s\(/XXX(/g;
- s/#elif\s\(/XXX(/g;
- s/^#define\s+\w+\s+\(/XXX(/;
- # do not match things like "void (*f)();"
- # or "typedef void (func_t)();"
- s/\w\s\(+\*/XXX(*/g;
- s/\b(void)\s+\(+/XXX(/og;
- if (/\w\s\(/) {
- err("extra space between function name and left paren");
- }
- $_ = $s;
- }
-
- if (/^\s*return\W[^;]*;/ && !/^\s*return\s*\(.*\);/) {
- err("unparenthesized return expression");
- }
- if (/\btypeof\b/ && !/\btypeof\s*\(.*\)/) {
- err("unparenthesized typeof expression");
- }
- if (/\(\s/) {
- err("whitespace after left paren");
- }
- # allow "for" statements to have empty "continue" clauses
- if (/\s\)/ && !/^\s*for \([^;]*;[^;]*; \)/) {
- err("whitespace before right paren");
- }
- if (/^\s*\(void\)[^ ]/) {
- err("missing space after (void) cast");
- }
- if (/\S{/ && !/({|\(){/) {
- err("missing space before left brace");
- }
- if ($in_function && /^\s+{/ &&
- ($prev =~ /\)\s*$/ || $prev =~ /\bstruct\s+\w+$/)) {
- err("left brace starting a line");
- }
- if (/}(else|while)/) {
- err("missing space after right brace");
- }
- if (/}\s\s+(else|while)/) {
- err("extra space after right brace");
- }
- if (/^\s+#/) {
- err("preprocessor statement not in column 1");
- }
- if (/^#\s/) {
- err("blank after preprocessor #");
- }
-
- #
- # We completely ignore, for purposes of indentation:
- # * lines outside of functions
- # * preprocessor lines
- #
- if ($check_continuation && $in_function && !$in_cpp) {
- process_indent($_);
- }
-
- if ($heuristic) {
- # cannot check this everywhere due to "struct {\n...\n} foo;"
- if ($in_function && !$in_declaration &&
- /}./ && !/}\s+=/ && !/{.*}[;,]$/ && !/}(\s|)*$/ &&
- !/} (else|while)/ && !/}}/) {
- err("possible bad text following right brace");
- }
- # cannot check this because sub-blocks in
- # the middle of code are ok
- if ($in_function && /^\s+{/) {
- err("possible left brace starting a line");
- }
- }
- if (/^\s*else\W/) {
- if ($prev =~ /^\s*}$/) {
- err_prefix($prev,
- "else and right brace should be on same line");
- }
- }
- $prev = $line;
-}
-
-if ($prev eq "") {
- err("last line in file is blank");
-}
-
-}
-
-#
-# Continuation-line checking
-#
-# The rest of this file contains the code for the continuation checking
-# engine. It's a pretty simple state machine which tracks the expression
-# depth (unmatched '('s and '['s).
-#
-# Keep in mind that the argument to process_indent() has already been heavily
-# processed; all comments have been replaced by control-A, and the contents of
-# strings and character constants have been elided.
-#
-
-my $cont_in; # currently inside of a continuation
-my $cont_off; # skipping an initializer or definition
-my $cont_noerr; # suppress cascading errors
-my $cont_start; # the line being continued
-my $cont_base; # the base indentation
-my $cont_first; # this is the first line of a statement
-my $cont_multiseg; # this continuation has multiple segments
-
-my $cont_special; # this is a C statement (if, for, etc.)
-my $cont_macro; # this is a macro
-my $cont_case; # this is a multi-line case
-
-my @cont_paren; # the stack of unmatched ( and [s we've seen
-
-sub
-reset_indent()
-{
- $cont_in = 0;
- $cont_off = 0;
-}
-
-sub
-delabel($)
-{
- #
- # replace labels with tabs. Note that there may be multiple
- # labels on a line.
- #
- local $_ = $_[0];
-
- while (/^(\t*)( *(?:(?:\w+\s*)|(?:case\b[^:]*)): *)(.*)$/) {
- my ($pre_tabs, $label, $rest) = ($1, $2, $3);
- $_ = $pre_tabs;
- while ($label =~ s/^([^\t]*)(\t+)//) {
- $_ .= "\t" x (length($2) + length($1) / 8);
- }
- $_ .= ("\t" x (length($label) / 8)).$rest;
- }
-
- return ($_);
-}
-
-sub
-process_indent($)
-{
- require strict;
- local $_ = $_[0]; # preserve the global $_
-
- s///g; # No comments
- s/\s+$//; # Strip trailing whitespace
-
- return if (/^$/); # skip empty lines
-
- # regexps used below; keywords taking (), macros, and continued cases
- my $special = '(?:(?:\}\s*)?else\s+)?(?:if|for|while|switch)\b';
- my $macro = '[A-Z_][A-Z_0-9]*\(';
- my $case = 'case\b[^:]*$';
-
- # skip over enumerations, array definitions, initializers, etc.
- if ($cont_off <= 0 && !/^\s*$special/ &&
- (/(?:(?:\b(?:enum|struct|union)\s*[^\{]*)|(?:\s+=\s*)){/ ||
- (/^\s*{/ && $prev =~ /=\s*(?:\/\*.*\*\/\s*)*$/))) {
- $cont_in = 0;
- $cont_off = tr/{/{/ - tr/}/}/;
- return;
- }
- if ($cont_off) {
- $cont_off += tr/{/{/ - tr/}/}/;
- return;
- }
-
- if (!$cont_in) {
- $cont_start = $line;
-
- if (/^\t* /) {
- err("non-continuation indented 4 spaces");
- $cont_noerr = 1; # stop reporting
- }
- $_ = delabel($_); # replace labels with tabs
-
- # check if the statement is complete
- return if (/^\s*\}?$/);
- return if (/^\s*\}?\s*else\s*\{?$/);
- return if (/^\s*do\s*\{?$/);
- return if (/{$/);
- return if (/}[,;]?$/);
-
- # Allow macros on their own lines
- return if (/^\s*[A-Z_][A-Z_0-9]*$/);
-
- # cases we don't deal with, generally non-kosher
- if (/{/) {
- err("stuff after {");
- return;
- }
-
- # Get the base line, and set up the state machine
- /^(\t*)/;
- $cont_base = $1;
- $cont_in = 1;
- @cont_paren = ();
- $cont_first = 1;
- $cont_multiseg = 0;
-
- # certain things need special processing
- $cont_special = /^\s*$special/? 1 : 0;
- $cont_macro = /^\s*$macro/? 1 : 0;
- $cont_case = /^\s*$case/? 1 : 0;
- } else {
- $cont_first = 0;
-
- # Strings may be pulled back to an earlier (half-)tabstop
- unless ($cont_noerr || /^$cont_base / ||
- (/^\t*(?: )?(?:gettext\()?\"/ && !/^$cont_base\t/)) {
- err_prefix($cont_start,
- "continuation should be indented 4 spaces");
- }
- }
-
- my $rest = $_; # keeps the remainder of the line
-
- #
- # The split matches 0 characters, so that each 'special' character
- # is processed separately. Parens and brackets are pushed and
- # popped off the @cont_paren stack. For normal processing, we wait
- # until a ; or { terminates the statement. "special" processing
- # (if/for/while/switch) is allowed to stop when the stack empties,
- # as is macro processing. Case statements are terminated with a :
- # and an empty paren stack.
- #
- foreach $_ (split /[^\(\)\[\]\{\}\;\:]*/) {
- next if (length($_) == 0);
-
- # rest contains the remainder of the line
- my $rxp = "[^\Q$_\E]*\Q$_\E";
- $rest =~ s/^$rxp//;
-
- if (/\(/ || /\[/) {
- push @cont_paren, $_;
- } elsif (/\)/ || /\]/) {
- my $cur = $_;
- tr/\)\]/\(\[/;
-
- my $old = (pop @cont_paren);
- if (!defined($old)) {
- err("unexpected '$cur'");
- $cont_in = 0;
- last;
- } elsif ($old ne $_) {
- err("'$cur' mismatched with '$old'");
- $cont_in = 0;
- last;
- }
-
- #
- # If the stack is now empty, do special processing
- # for if/for/while/switch and macro statements.
- #
- next if (@cont_paren != 0);
- if ($cont_special) {
- if ($rest =~ /^\s*{?$/) {
- $cont_in = 0;
- last;
- }
- if ($rest =~ /^\s*;$/) {
- err("empty if/for/while body ".
- "not on its own line");
- $cont_in = 0;
- last;
- }
- if (!$cont_first && $cont_multiseg == 1) {
- err_prefix($cont_start,
- "multiple statements continued ".
- "over multiple lines");
- $cont_multiseg = 2;
- } elsif ($cont_multiseg == 0) {
- $cont_multiseg = 1;
- }
- # We've finished this section, start
- # processing the next.
- goto section_ended;
- }
- if ($cont_macro) {
- if ($rest =~ /^$/) {
- $cont_in = 0;
- last;
- }
- }
- } elsif (/\;/) {
- if ($cont_case) {
- err("unexpected ;");
- } elsif (!$cont_special) {
- err("unexpected ;") if (@cont_paren != 0);
- if (!$cont_first && $cont_multiseg == 1) {
- err_prefix($cont_start,
- "multiple statements continued ".
- "over multiple lines");
- $cont_multiseg = 2;
- } elsif ($cont_multiseg == 0) {
- $cont_multiseg = 1;
- }
- if ($rest =~ /^$/) {
- $cont_in = 0;
- last;
- }
- if ($rest =~ /^\s*special/) {
- err("if/for/while/switch not started ".
- "on its own line");
- }
- goto section_ended;
- }
- } elsif (/\{/) {
- err("{ while in parens/brackets") if (@cont_paren != 0);
- err("stuff after {") if ($rest =~ /[^\s}]/);
- $cont_in = 0;
- last;
- } elsif (/\}/) {
- err("} while in parens/brackets") if (@cont_paren != 0);
- if (!$cont_special && $rest !~ /^\s*(while|else)\b/) {
- if ($rest =~ /^$/) {
- err("unexpected }");
- } else {
- err("stuff after }");
- }
- $cont_in = 0;
- last;
- }
- } elsif (/\:/ && $cont_case && @cont_paren == 0) {
- err("stuff after multi-line case") if ($rest !~ /$^/);
- $cont_in = 0;
- last;
- }
- next;
-section_ended:
- # End of a statement or if/while/for loop. Reset
- # cont_special and cont_macro based on the rest of the
- # line.
- $cont_special = ($rest =~ /^\s*$special/)? 1 : 0;
- $cont_macro = ($rest =~ /^\s*$macro/)? 1 : 0;
- $cont_case = 0;
- next;
- }
- $cont_noerr = 0 if (!$cont_in);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/package.json b/node_modules/request/node_modules/http-signature/package.json
deleted file mode 100644
index 2dd58f5..0000000
--- a/node_modules/request/node_modules/http-signature/package.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "name": "http-signature",
- "description": "Reference implementation of Joyent's HTTP Signature scheme.",
- "version": "0.10.1",
- "license": "MIT",
- "author": {
- "name": "Joyent, Inc"
- },
- "contributors": [
- {
- "name": "Mark Cavage",
- "email": "mcavage@gmail.com"
- },
- {
- "name": "David I. Lehn",
- "email": "dil@lehn.org"
- }
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/joyent/node-http-signature.git"
- },
- "homepage": "https://github.com/joyent/node-http-signature/",
- "bugs": {
- "url": "https://github.com/joyent/node-http-signature/issues"
- },
- "keywords": [
- "https",
- "request"
- ],
- "engines": {
- "node": ">=0.8"
- },
- "main": "lib/index.js",
- "scripts": {
- "test": "tap test/*.js"
- },
- "dependencies": {
- "assert-plus": "^0.1.5",
- "asn1": "0.1.11",
- "ctype": "0.5.3"
- },
- "devDependencies": {
- "node-uuid": "^1.4.1",
- "tap": "0.4.2"
- },
- "_id": "http-signature@0.10.1",
- "_shasum": "4fbdac132559aa8323121e540779c0a012b27e66",
- "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz",
- "_from": "http-signature@>=0.10.0 <0.11.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "pfmooney",
- "email": "patrick.f.mooney@gmail.com"
- },
- "maintainers": [
- {
- "name": "mcavage",
- "email": "mcavage@gmail.com"
- },
- {
- "name": "pfmooney",
- "email": "patrick.f.mooney@gmail.com"
- }
- ],
- "dist": {
- "shasum": "4fbdac132559aa8323121e540779c0a012b27e66",
- "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz"
- },
- "directories": {},
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/.jshintrc
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/.jshintrc b/node_modules/request/node_modules/isstream/.jshintrc
deleted file mode 100644
index c8ef3ca..0000000
--- a/node_modules/request/node_modules/isstream/.jshintrc
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "predef": [ ]
- , "bitwise": false
- , "camelcase": false
- , "curly": false
- , "eqeqeq": false
- , "forin": false
- , "immed": false
- , "latedef": false
- , "noarg": true
- , "noempty": true
- , "nonew": true
- , "plusplus": false
- , "quotmark": true
- , "regexp": false
- , "undef": true
- , "unused": true
- , "strict": false
- , "trailing": true
- , "maxlen": 120
- , "asi": true
- , "boss": true
- , "debug": true
- , "eqnull": true
- , "esnext": true
- , "evil": true
- , "expr": true
- , "funcscope": false
- , "globalstrict": false
- , "iterator": false
- , "lastsemic": true
- , "laxbreak": true
- , "laxcomma": true
- , "loopfunc": true
- , "multistr": false
- , "onecase": false
- , "proto": false
- , "regexdash": false
- , "scripturl": true
- , "smarttabs": false
- , "shadow": false
- , "sub": true
- , "supernew": false
- , "validthis": true
- , "browser": true
- , "couch": false
- , "devel": false
- , "dojo": false
- , "mootools": false
- , "node": true
- , "nonstandard": true
- , "prototypejs": false
- , "rhino": false
- , "worker": true
- , "wsh": false
- , "nomen": false
- , "onevar": false
- , "passfail": false
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/.npmignore b/node_modules/request/node_modules/isstream/.npmignore
deleted file mode 100644
index aa1ec1e..0000000
--- a/node_modules/request/node_modules/isstream/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-*.tgz
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/.travis.yml b/node_modules/request/node_modules/isstream/.travis.yml
deleted file mode 100644
index 1fec2ab..0000000
--- a/node_modules/request/node_modules/isstream/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: node_js
-node_js:
- - "0.8"
- - "0.10"
- - "0.11"
-branches:
- only:
- - master
-notifications:
- email:
- - rod@vagg.org
-script: npm test
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/LICENSE.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/LICENSE.md b/node_modules/request/node_modules/isstream/LICENSE.md
deleted file mode 100644
index 43f7153..0000000
--- a/node_modules/request/node_modules/isstream/LICENSE.md
+++ /dev/null
@@ -1,11 +0,0 @@
-The MIT License (MIT)
-=====================
-
-Copyright (c) 2015 Rod Vagg
----------------------------
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/README.md b/node_modules/request/node_modules/isstream/README.md
deleted file mode 100644
index 06770e8..0000000
--- a/node_modules/request/node_modules/isstream/README.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# isStream
-
-[](http://travis-ci.org/rvagg/isstream)
-
-**Test if an object is a `Stream`**
-
-[](https://nodei.co/npm/isstream/)
-
-The missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.
-
-## Usage:
-
-```js
-var isStream = require('isstream')
-var Stream = require('stream')
-
-isStream(new Stream()) // true
-
-isStream({}) // false
-
-isStream(new Stream.Readable()) // true
-isStream(new Stream.Writable()) // true
-isStream(new Stream.Duplex()) // true
-isStream(new Stream.Transform()) // true
-isStream(new Stream.PassThrough()) // true
-```
-
-## But wait! There's more!
-
-You can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.
-
-```js
-var isReadable = require('isstream').isReadable
-var isWritable = require('isstream').isWritable
-var isDuplex = require('isstream').isDuplex
-var Stream = require('stream')
-
-isReadable(new Stream()) // false
-isWritable(new Stream()) // false
-isDuplex(new Stream()) // false
-
-isReadable(new Stream.Readable()) // true
-isReadable(new Stream.Writable()) // false
-isReadable(new Stream.Duplex()) // true
-isReadable(new Stream.Transform()) // true
-isReadable(new Stream.PassThrough()) // true
-
-isWritable(new Stream.Readable()) // false
-isWritable(new Stream.Writable()) // true
-isWritable(new Stream.Duplex()) // true
-isWritable(new Stream.Transform()) // true
-isWritable(new Stream.PassThrough()) // true
-
-isDuplex(new Stream.Readable()) // false
-isDuplex(new Stream.Writable()) // false
-isDuplex(new Stream.Duplex()) // true
-isDuplex(new Stream.Transform()) // true
-isDuplex(new Stream.PassThrough()) // true
-```
-
-*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*
-
-
-## License
-
-**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/isstream.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/isstream.js b/node_modules/request/node_modules/isstream/isstream.js
deleted file mode 100644
index a1d104a..0000000
--- a/node_modules/request/node_modules/isstream/isstream.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var stream = require('stream')
-
-
-function isStream (obj) {
- return obj instanceof stream.Stream
-}
-
-
-function isReadable (obj) {
- return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'
-}
-
-
-function isWritable (obj) {
- return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'
-}
-
-
-function isDuplex (obj) {
- return isReadable(obj) && isWritable(obj)
-}
-
-
-module.exports = isStream
-module.exports.isReadable = isReadable
-module.exports.isWritable = isWritable
-module.exports.isDuplex = isDuplex
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/package.json b/node_modules/request/node_modules/isstream/package.json
deleted file mode 100644
index 7fdfa0a..0000000
--- a/node_modules/request/node_modules/isstream/package.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "name": "isstream",
- "version": "0.1.2",
- "description": "Determine if an object is a Stream",
- "main": "isstream.js",
- "scripts": {
- "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/rvagg/isstream.git"
- },
- "keywords": [
- "stream",
- "type",
- "streams",
- "readable-stream",
- "hippo"
- ],
- "devDependencies": {
- "tape": "~2.12.3",
- "core-util-is": "~1.0.0",
- "isarray": "0.0.1",
- "string_decoder": "~0.10.x",
- "inherits": "~2.0.1"
- },
- "author": {
- "name": "Rod Vagg",
- "email": "rod@vagg.org"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/rvagg/isstream/issues"
- },
- "homepage": "https://github.com/rvagg/isstream",
- "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc",
- "_id": "isstream@0.1.2",
- "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a",
- "_from": "isstream@>=0.1.1 <0.2.0",
- "_npmVersion": "2.6.1",
- "_nodeVersion": "1.4.3",
- "_npmUser": {
- "name": "rvagg",
- "email": "rod@vagg.org"
- },
- "maintainers": [
- {
- "name": "rvagg",
- "email": "rod@vagg.org"
- }
- ],
- "dist": {
- "shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a",
- "tarball": "http://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/isstream/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/isstream/test.js b/node_modules/request/node_modules/isstream/test.js
deleted file mode 100644
index 8c950c5..0000000
--- a/node_modules/request/node_modules/isstream/test.js
+++ /dev/null
@@ -1,168 +0,0 @@
-var tape = require('tape')
- , EE = require('events').EventEmitter
- , util = require('util')
-
-
- , isStream = require('./')
- , isReadable = require('./').isReadable
- , isWritable = require('./').isWritable
- , isDuplex = require('./').isDuplex
-
- , CoreStreams = require('stream')
- , ReadableStream10 = require('./readable-stream-1.0/')
- , ReadableStream11 = require('./readable-stream-1.1/')
-
-
-function test (pass, type, stream) {
- tape('isStream(' + type + ')', function (t) {
- t.plan(1)
- t.ok(pass === isStream(stream), type)
- })
-}
-
-
-function testReadable (pass, type, stream) {
- tape('isReadable(' + type + ')', function (t) {
- t.plan(1)
- t.ok(pass === isReadable(stream), type)
- })
-}
-
-
-function testWritable (pass, type, stream) {
- tape('isWritable(' + type + ')', function (t) {
- t.plan(1)
- t.ok(pass === isWritable(stream), type)
- })
-}
-
-
-function testDuplex (pass, type, stream) {
- tape('isDuplex(' + type + ')', function (t) {
- t.plan(1)
- t.ok(pass === isDuplex(stream), type)
- })
-}
-
-
-[ undefined, null, '', true, false, 0, 1, 1.0, 'string', {}, function foo () {} ].forEach(function (o) {
- test(false, 'non-stream / primitive: ' + (JSON.stringify(o) || (o && o.toString()) || o), o)
-})
-
-
-test(false, 'fake stream obj', { pipe: function () {} })
-
-
-;(function () {
-
- // looks like a stream!
-
- function Stream () {
- EE.call(this)
- }
- util.inherits(Stream, EE)
- Stream.prototype.pipe = function () {}
- Stream.Stream = Stream
-
- test(false, 'fake stream "new Stream()"', new Stream())
-
-}())
-
-
-test(true, 'CoreStreams.Stream', new (CoreStreams.Stream)())
-test(true, 'CoreStreams.Readable', new (CoreStreams.Readable)())
-test(true, 'CoreStreams.Writable', new (CoreStreams.Writable)())
-test(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
-test(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
-test(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
-
-test(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
-test(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
-test(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
-test(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
-test(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
-
-test(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
-test(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
-test(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
-test(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
-test(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
-
-
-testReadable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)())
-testReadable(true, 'CoreStreams.Readable', new (CoreStreams.Readable)())
-testReadable(false, 'CoreStreams.Writable', new (CoreStreams.Writable)())
-testReadable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
-testReadable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
-testReadable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
-
-testReadable(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
-testReadable(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
-testReadable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
-testReadable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
-testReadable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
-
-testReadable(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
-testReadable(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
-testReadable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
-testReadable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
-testReadable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
-
-
-testWritable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)())
-testWritable(false, 'CoreStreams.Readable', new (CoreStreams.Readable)())
-testWritable(true, 'CoreStreams.Writable', new (CoreStreams.Writable)())
-testWritable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
-testWritable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
-testWritable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
-
-testWritable(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
-testWritable(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
-testWritable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
-testWritable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
-testWritable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
-
-testWritable(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
-testWritable(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
-testWritable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
-testWritable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
-testWritable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
-
-
-testDuplex(false, 'CoreStreams.Stream', new (CoreStreams.Stream)())
-testDuplex(false, 'CoreStreams.Readable', new (CoreStreams.Readable)())
-testDuplex(false, 'CoreStreams.Writable', new (CoreStreams.Writable)())
-testDuplex(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
-testDuplex(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
-testDuplex(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
-
-testDuplex(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
-testDuplex(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
-testDuplex(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
-testDuplex(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
-testDuplex(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
-
-testDuplex(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
-testDuplex(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
-testDuplex(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
-testDuplex(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
-testDuplex(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
-
-
-;[ CoreStreams, ReadableStream10, ReadableStream11 ].forEach(function (p) {
- [ 'Stream', 'Readable', 'Writable', 'Duplex', 'Transform', 'PassThrough' ].forEach(function (k) {
- if (!p[k])
- return
-
- function SubStream () {
- p[k].call(this)
- }
- util.inherits(SubStream, p[k])
-
- test(true, 'Stream subclass: ' + p.name + '.' + k, new SubStream())
-
- })
-})
-
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/.npmignore b/node_modules/request/node_modules/json-stringify-safe/.npmignore
deleted file mode 100644
index 17d6b36..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-/*.tgz
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md b/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
deleted file mode 100644
index 42bcb60..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
+++ /dev/null
@@ -1,14 +0,0 @@
-## Unreleased
-- Fixes stringify to only take ancestors into account when checking
- circularity.
- It previously assumed every visited object was circular which led to [false
- positives][issue9].
- Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago.
-- Fixes calling the `replacer` function in the proper context (`thisArg`).
-- Fixes calling the `cycleReplacer` function in the proper context (`thisArg`).
-- Speeds serializing by a factor of
- Big-O(h-my-god-it-linearly-searched-every-object) it had ever seen. Searching
- only the ancestors for a circular references speeds up things considerably.
-
-[must]: https://github.com/moll/js-must
-[issue9]: https://github.com/isaacs/json-stringify-safe/issues/9
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/LICENSE b/node_modules/request/node_modules/json-stringify-safe/LICENSE
deleted file mode 100644
index 19129e3..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/Makefile b/node_modules/request/node_modules/json-stringify-safe/Makefile
deleted file mode 100644
index 36088c7..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-NODE_OPTS =
-TEST_OPTS =
-
-love:
- @echo "Feel like makin' love."
-
-test:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS)
-
-spec:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS)
-
-autotest:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS)
-
-autospec:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS)
-
-pack:
- @file=$$(npm pack); echo "$$file"; tar tf "$$file"
-
-publish:
- npm publish
-
-tag:
- git tag "v$$(node -e 'console.log(require("./package").version)')"
-
-clean:
- rm -f *.tgz
- npm prune --production
-
-.PHONY: love
-.PHONY: test spec autotest autospec
-.PHONY: pack publish tag
-.PHONY: clean
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/README.md b/node_modules/request/node_modules/json-stringify-safe/README.md
deleted file mode 100644
index a11f302..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# json-stringify-safe
-
-Like JSON.stringify, but doesn't throw on circular references.
-
-## Usage
-
-Takes the same arguments as `JSON.stringify`.
-
-```javascript
-var stringify = require('json-stringify-safe');
-var circularObj = {};
-circularObj.circularRef = circularObj;
-circularObj.list = [ circularObj, circularObj ];
-console.log(stringify(circularObj, null, 2));
-```
-
-Output:
-
-```json
-{
- "circularRef": "[Circular]",
- "list": [
- "[Circular]",
- "[Circular]"
- ]
-}
-```
-
-## Details
-
-```
-stringify(obj, serializer, indent, decycler)
-```
-
-The first three arguments are the same as to JSON.stringify. The last
-is an argument that's only used when the object has been seen already.
-
-The default `decycler` function returns the string `'[Circular]'`.
-If, for example, you pass in `function(k,v){}` (return nothing) then it
-will prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,
-then cyclical objects will always be represented as `{"foo":"bar"}` in
-the result.
-
-```
-stringify.getSerialize(serializer, decycler)
-```
-
-Returns a serializer that can be used elsewhere. This is the actual
-function that's passed to JSON.stringify.
-
-**Note** that the function returned from `getSerialize` is stateful for now, so
-do **not** use it more than once.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/package.json b/node_modules/request/node_modules/json-stringify-safe/package.json
deleted file mode 100644
index e3cbf9a..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/package.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "name": "json-stringify-safe",
- "version": "5.0.1",
- "description": "Like JSON.stringify, but doesn't blow up on circular refs.",
- "keywords": [
- "json",
- "stringify",
- "circular",
- "safe"
- ],
- "homepage": "https://github.com/isaacs/json-stringify-safe",
- "bugs": {
- "url": "https://github.com/isaacs/json-stringify-safe/issues"
- },
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me"
- },
- "contributors": [
- {
- "name": "Andri Möll",
- "email": "andri@dot.ee",
- "url": "http://themoll.com"
- }
- ],
- "license": "ISC",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/json-stringify-safe.git"
- },
- "main": "stringify.js",
- "scripts": {
- "test": "node test.js"
- },
- "devDependencies": {
- "mocha": ">= 2.1.0 < 3",
- "must": ">= 0.12 < 0.13",
- "sinon": ">= 1.12.2 < 2"
- },
- "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5",
- "_id": "json-stringify-safe@5.0.1",
- "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
- "_from": "json-stringify-safe@>=5.0.0 <5.1.0",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
- "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "moll",
- "email": "andri@dot.ee"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/stringify.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/stringify.js b/node_modules/request/node_modules/json-stringify-safe/stringify.js
deleted file mode 100644
index 124a452..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/stringify.js
+++ /dev/null
@@ -1,27 +0,0 @@
-exports = module.exports = stringify
-exports.getSerialize = serializer
-
-function stringify(obj, replacer, spaces, cycleReplacer) {
- return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
-}
-
-function serializer(replacer, cycleReplacer) {
- var stack = [], keys = []
-
- if (cycleReplacer == null) cycleReplacer = function(key, value) {
- if (stack[0] === value) return "[Circular ~]"
- return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
- }
-
- return function(key, value) {
- if (stack.length > 0) {
- var thisPos = stack.indexOf(this)
- ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
- ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
- if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
- }
- else stack.push(value)
-
- return replacer == null ? value : replacer.call(this, key, value)
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts b/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
deleted file mode 100644
index 2544e58..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
+++ /dev/null
@@ -1,2 +0,0 @@
---recursive
---require must
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js b/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
deleted file mode 100644
index 5b32583..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
+++ /dev/null
@@ -1,246 +0,0 @@
-var Sinon = require("sinon")
-var stringify = require("..")
-function jsonify(obj) { return JSON.stringify(obj, null, 2) }
-
-describe("Stringify", function() {
- it("must stringify circular objects", function() {
- var obj = {name: "Alice"}
- obj.self = obj
- var json = stringify(obj, null, 2)
- json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
- })
-
- it("must stringify circular objects with intermediaries", function() {
- var obj = {name: "Alice"}
- obj.identity = {self: obj}
- var json = stringify(obj, null, 2)
- json.must.eql(jsonify({name: "Alice", identity: {self: "[Circular ~]"}}))
- })
-
- it("must stringify circular objects deeper", function() {
- var obj = {name: "Alice", child: {name: "Bob"}}
- obj.child.self = obj.child
-
- stringify(obj, null, 2).must.eql(jsonify({
- name: "Alice",
- child: {name: "Bob", self: "[Circular ~.child]"}
- }))
- })
-
- it("must stringify circular objects deeper with intermediaries", function() {
- var obj = {name: "Alice", child: {name: "Bob"}}
- obj.child.identity = {self: obj.child}
-
- stringify(obj, null, 2).must.eql(jsonify({
- name: "Alice",
- child: {name: "Bob", identity: {self: "[Circular ~.child]"}}
- }))
- })
-
- it("must stringify circular objects in an array", function() {
- var obj = {name: "Alice"}
- obj.self = [obj, obj]
-
- stringify(obj, null, 2).must.eql(jsonify({
- name: "Alice", self: ["[Circular ~]", "[Circular ~]"]
- }))
- })
-
- it("must stringify circular objects deeper in an array", function() {
- var obj = {name: "Alice", children: [{name: "Bob"}, {name: "Eve"}]}
- obj.children[0].self = obj.children[0]
- obj.children[1].self = obj.children[1]
-
- stringify(obj, null, 2).must.eql(jsonify({
- name: "Alice",
- children: [
- {name: "Bob", self: "[Circular ~.children.0]"},
- {name: "Eve", self: "[Circular ~.children.1]"}
- ]
- }))
- })
-
- it("must stringify circular arrays", function() {
- var obj = []
- obj.push(obj)
- obj.push(obj)
- var json = stringify(obj, null, 2)
- json.must.eql(jsonify(["[Circular ~]", "[Circular ~]"]))
- })
-
- it("must stringify circular arrays with intermediaries", function() {
- var obj = []
- obj.push({name: "Alice", self: obj})
- obj.push({name: "Bob", self: obj})
-
- stringify(obj, null, 2).must.eql(jsonify([
- {name: "Alice", self: "[Circular ~]"},
- {name: "Bob", self: "[Circular ~]"}
- ]))
- })
-
- it("must stringify repeated objects in objects", function() {
- var obj = {}
- var alice = {name: "Alice"}
- obj.alice1 = alice
- obj.alice2 = alice
-
- stringify(obj, null, 2).must.eql(jsonify({
- alice1: {name: "Alice"},
- alice2: {name: "Alice"}
- }))
- })
-
- it("must stringify repeated objects in arrays", function() {
- var alice = {name: "Alice"}
- var obj = [alice, alice]
- var json = stringify(obj, null, 2)
- json.must.eql(jsonify([{name: "Alice"}, {name: "Alice"}]))
- })
-
- it("must call given decycler and use its output", function() {
- var obj = {}
- obj.a = obj
- obj.b = obj
-
- var decycle = Sinon.spy(function() { return decycle.callCount })
- var json = stringify(obj, null, 2, decycle)
- json.must.eql(jsonify({a: 1, b: 2}, null, 2))
-
- decycle.callCount.must.equal(2)
- decycle.thisValues[0].must.equal(obj)
- decycle.args[0][0].must.equal("a")
- decycle.args[0][1].must.equal(obj)
- decycle.thisValues[1].must.equal(obj)
- decycle.args[1][0].must.equal("b")
- decycle.args[1][1].must.equal(obj)
- })
-
- it("must call replacer and use its output", function() {
- var obj = {name: "Alice", child: {name: "Bob"}}
-
- var replacer = Sinon.spy(bangString)
- var json = stringify(obj, replacer, 2)
- json.must.eql(jsonify({name: "Alice!", child: {name: "Bob!"}}))
-
- replacer.callCount.must.equal(4)
- replacer.args[0][0].must.equal("")
- replacer.args[0][1].must.equal(obj)
- replacer.thisValues[1].must.equal(obj)
- replacer.args[1][0].must.equal("name")
- replacer.args[1][1].must.equal("Alice")
- replacer.thisValues[2].must.equal(obj)
- replacer.args[2][0].must.equal("child")
- replacer.args[2][1].must.equal(obj.child)
- replacer.thisValues[3].must.equal(obj.child)
- replacer.args[3][0].must.equal("name")
- replacer.args[3][1].must.equal("Bob")
- })
-
- it("must call replacer after describing circular references", function() {
- var obj = {name: "Alice"}
- obj.self = obj
-
- var replacer = Sinon.spy(bangString)
- var json = stringify(obj, replacer, 2)
- json.must.eql(jsonify({name: "Alice!", self: "[Circular ~]!"}))
-
- replacer.callCount.must.equal(3)
- replacer.args[0][0].must.equal("")
- replacer.args[0][1].must.equal(obj)
- replacer.thisValues[1].must.equal(obj)
- replacer.args[1][0].must.equal("name")
- replacer.args[1][1].must.equal("Alice")
- replacer.thisValues[2].must.equal(obj)
- replacer.args[2][0].must.equal("self")
- replacer.args[2][1].must.equal("[Circular ~]")
- })
-
- it("must call given decycler and use its output for nested objects",
- function() {
- var obj = {}
- obj.a = obj
- obj.b = {self: obj}
-
- var decycle = Sinon.spy(function() { return decycle.callCount })
- var json = stringify(obj, null, 2, decycle)
- json.must.eql(jsonify({a: 1, b: {self: 2}}))
-
- decycle.callCount.must.equal(2)
- decycle.args[0][0].must.equal("a")
- decycle.args[0][1].must.equal(obj)
- decycle.args[1][0].must.equal("self")
- decycle.args[1][1].must.equal(obj)
- })
-
- it("must use decycler's output when it returned null", function() {
- var obj = {a: "b"}
- obj.self = obj
- obj.selves = [obj, obj]
-
- function decycle() { return null }
- stringify(obj, null, 2, decycle).must.eql(jsonify({
- a: "b",
- self: null,
- selves: [null, null]
- }))
- })
-
- it("must use decycler's output when it returned undefined", function() {
- var obj = {a: "b"}
- obj.self = obj
- obj.selves = [obj, obj]
-
- function decycle() {}
- stringify(obj, null, 2, decycle).must.eql(jsonify({
- a: "b",
- selves: [null, null]
- }))
- })
-
- it("must throw given a decycler that returns a cycle", function() {
- var obj = {}
- obj.self = obj
- var err
- function identity(key, value) { return value }
- try { stringify(obj, null, 2, identity) } catch (ex) { err = ex }
- err.must.be.an.instanceof(TypeError)
- })
-
- describe(".getSerialize", function() {
- it("must stringify circular objects", function() {
- var obj = {a: "b"}
- obj.circularRef = obj
- obj.list = [obj, obj]
-
- var json = JSON.stringify(obj, stringify.getSerialize(), 2)
- json.must.eql(jsonify({
- "a": "b",
- "circularRef": "[Circular ~]",
- "list": ["[Circular ~]", "[Circular ~]"]
- }))
- })
-
- // This is the behavior as of Mar 3, 2015.
- // The serializer function keeps state inside the returned function and
- // so far I'm not sure how to not do that. JSON.stringify's replacer is not
- // called _after_ serialization.
- xit("must return a function that could be called twice", function() {
- var obj = {name: "Alice"}
- obj.self = obj
-
- var json
- var serializer = stringify.getSerialize()
-
- json = JSON.stringify(obj, serializer, 2)
- json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
-
- json = JSON.stringify(obj, serializer, 2)
- json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
- })
- })
-})
-
-function bangString(key, value) {
- return typeof value == "string" ? value + "!" : value
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/HISTORY.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/HISTORY.md b/node_modules/request/node_modules/mime-types/HISTORY.md
deleted file mode 100644
index 3f4ebe9..0000000
--- a/node_modules/request/node_modules/mime-types/HISTORY.md
+++ /dev/null
@@ -1,103 +0,0 @@
-2.0.12 / 2015-05-19
-===================
-
- * deps: mime-db@~1.10.0
- - Add new mime types
-
-2.0.11 / 2015-05-05
-===================
-
- * deps: mime-db@~1.9.1
- - Add new mime types
-
-2.0.10 / 2015-03-13
-===================
-
- * deps: mime-db@~1.8.0
- - Add new mime types
-
-2.0.9 / 2015-02-09
-==================
-
- * deps: mime-db@~1.7.0
- - Add new mime types
- - Community extensions ownership transferred from `node-mime`
-
-2.0.8 / 2015-01-29
-==================
-
- * deps: mime-db@~1.6.0
- - Add new mime types
-
-2.0.7 / 2014-12-30
-==================
-
- * deps: mime-db@~1.5.0
- - Add new mime types
- - Fix various invalid MIME type entries
-
-2.0.6 / 2014-12-30
-==================
-
- * deps: mime-db@~1.4.0
- - Add new mime types
- - Fix various invalid MIME type entries
- - Remove example template MIME types
-
-2.0.5 / 2014-12-29
-==================
-
- * deps: mime-db@~1.3.1
- - Fix missing extensions
-
-2.0.4 / 2014-12-10
-==================
-
- * deps: mime-db@~1.3.0
- - Add new mime types
-
-2.0.3 / 2014-11-09
-==================
-
- * deps: mime-db@~1.2.0
- - Add new mime types
-
-2.0.2 / 2014-09-28
-==================
-
- * deps: mime-db@~1.1.0
- - Add new mime types
- - Add additional compressible
- - Update charsets
-
-2.0.1 / 2014-09-07
-==================
-
- * Support Node.js 0.6
-
-2.0.0 / 2014-09-02
-==================
-
- * Use `mime-db`
- * Remove `.define()`
-
-1.0.2 / 2014-08-04
-==================
-
- * Set charset=utf-8 for `text/javascript`
-
-1.0.1 / 2014-06-24
-==================
-
- * Add `text/jsx` type
-
-1.0.0 / 2014-05-12
-==================
-
- * Return `false` for unknown types
- * Set charset=utf-8 for `application/json`
-
-0.1.0 / 2014-05-02
-==================
-
- * Initial release
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/LICENSE b/node_modules/request/node_modules/mime-types/LICENSE
deleted file mode 100644
index a7ae8ee..0000000
--- a/node_modules/request/node_modules/mime-types/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-
-The MIT License (MIT)
-
-Copyright (c) 2014 Jonathan Ong me@jongleberry.com
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/README.md b/node_modules/request/node_modules/mime-types/README.md
deleted file mode 100644
index 3727493..0000000
--- a/node_modules/request/node_modules/mime-types/README.md
+++ /dev/null
@@ -1,102 +0,0 @@
-# mime-types
-
-[![NPM Version][npm-image]][npm-url]
-[![NPM Downloads][downloads-image]][downloads-url]
-[![Node.js Version][node-version-image]][node-version-url]
-[![Build Status][travis-image]][travis-url]
-[![Test Coverage][coveralls-image]][coveralls-url]
-
-The ultimate javascript content-type utility.
-
-Similar to [node-mime](https://github.com/broofa/node-mime), except:
-
-- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`,
- so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
-- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
-- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db)
-- No `.define()` functionality
-
-Otherwise, the API is compatible.
-
-## Install
-
-```sh
-$ npm install mime-types
-```
-
-## Adding Types
-
-All mime types are based on [mime-db](https://github.com/jshttp/mime-db),
-so open a PR there if you'd like to add mime types.
-
-## API
-
-```js
-var mime = require('mime-types')
-```
-
-All functions return `false` if input is invalid or not found.
-
-### mime.lookup(path)
-
-Lookup the content-type associated with a file.
-
-```js
-mime.lookup('json') // 'application/json'
-mime.lookup('.md') // 'text/x-markdown'
-mime.lookup('file.html') // 'text/html'
-mime.lookup('folder/file.js') // 'application/javascript'
-
-mime.lookup('cats') // false
-```
-
-### mime.contentType(type)
-
-Create a full content-type header given a content-type or extension.
-
-```js
-mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
-mime.contentType('file.json') // 'application/json; charset=utf-8'
-
-// from a full path
-mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
-```
-
-### mime.extension(type)
-
-Get the default extension for a content-type.
-
-```js
-mime.extension('application/octet-stream') // 'bin'
-```
-
-### mime.charset(type)
-
-Lookup the implied default charset of a content-type.
-
-```js
-mime.charset('text/x-markdown') // 'UTF-8'
-```
-
-### var type = mime.types[extension]
-
-A map of content-types by extension.
-
-### [extensions...] = mime.extensions[type]
-
-A map of extensions by content-type.
-
-## License
-
-[MIT](LICENSE)
-
-[npm-image]: https://img.shields.io/npm/v/mime-types.svg
-[npm-url]: https://npmjs.org/package/mime-types
-[node-version-image]: https://img.shields.io/node/v/mime-types.svg
-[node-version-url]: http://nodejs.org/download/
-[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
-[travis-url]: https://travis-ci.org/jshttp/mime-types
-[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
-[coveralls-url]: https://coveralls.io/r/jshttp/mime-types
-[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg
-[downloads-url]: https://npmjs.org/package/mime-types
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/index.js b/node_modules/request/node_modules/mime-types/index.js
deleted file mode 100644
index b46a202..0000000
--- a/node_modules/request/node_modules/mime-types/index.js
+++ /dev/null
@@ -1,63 +0,0 @@
-
-var db = require('mime-db')
-
-// types[extension] = type
-exports.types = Object.create(null)
-// extensions[type] = [extensions]
-exports.extensions = Object.create(null)
-
-Object.keys(db).forEach(function (name) {
- var mime = db[name]
- var exts = mime.extensions
- if (!exts || !exts.length) return
- exports.extensions[name] = exts
- exts.forEach(function (ext) {
- exports.types[ext] = name
- })
-})
-
-exports.lookup = function (string) {
- if (!string || typeof string !== "string") return false
- // remove any leading paths, though we should just use path.basename
- string = string.replace(/.*[\.\/\\]/, '').toLowerCase()
- if (!string) return false
- return exports.types[string] || false
-}
-
-exports.extension = function (type) {
- if (!type || typeof type !== "string") return false
- // to do: use media-typer
- type = type.match(/^\s*([^;\s]*)(?:;|\s|$)/)
- if (!type) return false
- var exts = exports.extensions[type[1].toLowerCase()]
- if (!exts || !exts.length) return false
- return exts[0]
-}
-
-// type has to be an exact mime type
-exports.charset = function (type) {
- var mime = db[type]
- if (mime && mime.charset) return mime.charset
-
- // default text/* to utf-8
- if (/^text\//.test(type)) return 'UTF-8'
-
- return false
-}
-
-// backwards compatibility
-exports.charsets = {
- lookup: exports.charset
-}
-
-// to do: maybe use set-type module or something
-exports.contentType = function (type) {
- if (!type || typeof type !== "string") return false
- if (!~type.indexOf('/')) type = exports.lookup(type)
- if (!type) return false
- if (!~type.indexOf('charset')) {
- var charset = exports.charset(type)
- if (charset) type += '; charset=' + charset.toLowerCase()
- }
- return type
-}
[24/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/public-suffix.txt
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/public-suffix.txt b/node_modules/request/node_modules/tough-cookie/public-suffix.txt
deleted file mode 100644
index f8941f7..0000000
--- a/node_modules/request/node_modules/tough-cookie/public-suffix.txt
+++ /dev/null
@@ -1,10079 +0,0 @@
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-// ===BEGIN ICANN DOMAINS===
-
-// ac : http://en.wikipedia.org/wiki/.ac
-ac
-com.ac
-edu.ac
-gov.ac
-net.ac
-mil.ac
-org.ac
-
-// ad : http://en.wikipedia.org/wiki/.ad
-ad
-nom.ad
-
-// ae : http://en.wikipedia.org/wiki/.ae
-// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php
-ae
-co.ae
-net.ae
-org.ae
-sch.ae
-ac.ae
-gov.ae
-mil.ae
-
-// aero : see http://www.information.aero/index.php?id=66
-aero
-accident-investigation.aero
-accident-prevention.aero
-aerobatic.aero
-aeroclub.aero
-aerodrome.aero
-agents.aero
-aircraft.aero
-airline.aero
-airport.aero
-air-surveillance.aero
-airtraffic.aero
-air-traffic-control.aero
-ambulance.aero
-amusement.aero
-association.aero
-author.aero
-ballooning.aero
-broker.aero
-caa.aero
-cargo.aero
-catering.aero
-certification.aero
-championship.aero
-charter.aero
-civilaviation.aero
-club.aero
-conference.aero
-consultant.aero
-consulting.aero
-control.aero
-council.aero
-crew.aero
-design.aero
-dgca.aero
-educator.aero
-emergency.aero
-engine.aero
-engineer.aero
-entertainment.aero
-equipment.aero
-exchange.aero
-express.aero
-federation.aero
-flight.aero
-freight.aero
-fuel.aero
-gliding.aero
-government.aero
-groundhandling.aero
-group.aero
-hanggliding.aero
-homebuilt.aero
-insurance.aero
-journal.aero
-journalist.aero
-leasing.aero
-logistics.aero
-magazine.aero
-maintenance.aero
-marketplace.aero
-media.aero
-microlight.aero
-modelling.aero
-navigation.aero
-parachuting.aero
-paragliding.aero
-passenger-association.aero
-pilot.aero
-press.aero
-production.aero
-recreation.aero
-repbody.aero
-res.aero
-research.aero
-rotorcraft.aero
-safety.aero
-scientist.aero
-services.aero
-show.aero
-skydiving.aero
-software.aero
-student.aero
-taxi.aero
-trader.aero
-trading.aero
-trainer.aero
-union.aero
-workinggroup.aero
-works.aero
-
-// af : http://www.nic.af/help.jsp
-af
-gov.af
-com.af
-org.af
-net.af
-edu.af
-
-// ag : http://www.nic.ag/prices.htm
-ag
-com.ag
-org.ag
-net.ag
-co.ag
-nom.ag
-
-// ai : http://nic.com.ai/
-ai
-off.ai
-com.ai
-net.ai
-org.ai
-
-// al : http://www.ert.gov.al/ert_alb/faq_det.html?Id=31
-al
-com.al
-edu.al
-gov.al
-mil.al
-net.al
-org.al
-
-// am : http://en.wikipedia.org/wiki/.am
-am
-
-// an : http://www.una.an/an_domreg/default.asp
-an
-com.an
-net.an
-org.an
-edu.an
-
-// ao : http://en.wikipedia.org/wiki/.ao
-// http://www.dns.ao/REGISTR.DOC
-ao
-ed.ao
-gv.ao
-og.ao
-co.ao
-pb.ao
-it.ao
-
-// aq : http://en.wikipedia.org/wiki/.aq
-aq
-
-// ar : https://nic.ar/normativa-vigente.xhtml
-ar
-com.ar
-edu.ar
-gob.ar
-gov.ar
-int.ar
-mil.ar
-net.ar
-org.ar
-tur.ar
-
-// arpa : http://en.wikipedia.org/wiki/.arpa
-// Confirmed by registry <ia...@icann.org> 2008-06-18
-arpa
-e164.arpa
-in-addr.arpa
-ip6.arpa
-iris.arpa
-uri.arpa
-urn.arpa
-
-// as : http://en.wikipedia.org/wiki/.as
-as
-gov.as
-
-// asia : http://en.wikipedia.org/wiki/.asia
-asia
-
-// at : http://en.wikipedia.org/wiki/.at
-// Confirmed by registry <it...@nic.at> 2008-06-17
-at
-ac.at
-co.at
-gv.at
-or.at
-
-// au : http://en.wikipedia.org/wiki/.au
-// http://www.auda.org.au/
-au
-// 2LDs
-com.au
-net.au
-org.au
-edu.au
-gov.au
-asn.au
-id.au
-// Historic 2LDs (closed to new registration, but sites still exist)
-info.au
-conf.au
-oz.au
-// CGDNs - http://www.cgdn.org.au/
-act.au
-nsw.au
-nt.au
-qld.au
-sa.au
-tas.au
-vic.au
-wa.au
-// 3LDs
-act.edu.au
-nsw.edu.au
-nt.edu.au
-qld.edu.au
-sa.edu.au
-tas.edu.au
-vic.edu.au
-wa.edu.au
-// act.gov.au Bug 984824 - Removed at request of Greg Tankard
-// nsw.gov.au Bug 547985 - Removed at request of <Sh...@services.nsw.gov.au>
-// nt.gov.au Bug 940478 - Removed at request of Greg Connors <Gr...@nt.gov.au>
-qld.gov.au
-sa.gov.au
-tas.gov.au
-vic.gov.au
-wa.gov.au
-
-// aw : http://en.wikipedia.org/wiki/.aw
-aw
-com.aw
-
-// ax : http://en.wikipedia.org/wiki/.ax
-ax
-
-// az : http://en.wikipedia.org/wiki/.az
-az
-com.az
-net.az
-int.az
-gov.az
-org.az
-edu.az
-info.az
-pp.az
-mil.az
-name.az
-pro.az
-biz.az
-
-// ba : http://en.wikipedia.org/wiki/.ba
-ba
-org.ba
-net.ba
-edu.ba
-gov.ba
-mil.ba
-unsa.ba
-unbi.ba
-co.ba
-com.ba
-rs.ba
-
-// bb : http://en.wikipedia.org/wiki/.bb
-bb
-biz.bb
-co.bb
-com.bb
-edu.bb
-gov.bb
-info.bb
-net.bb
-org.bb
-store.bb
-tv.bb
-
-// bd : http://en.wikipedia.org/wiki/.bd
-*.bd
-
-// be : http://en.wikipedia.org/wiki/.be
-// Confirmed by registry <te...@dns.be> 2008-06-08
-be
-ac.be
-
-// bf : http://en.wikipedia.org/wiki/.bf
-bf
-gov.bf
-
-// bg : http://en.wikipedia.org/wiki/.bg
-// https://www.register.bg/user/static/rules/en/index.html
-bg
-a.bg
-b.bg
-c.bg
-d.bg
-e.bg
-f.bg
-g.bg
-h.bg
-i.bg
-j.bg
-k.bg
-l.bg
-m.bg
-n.bg
-o.bg
-p.bg
-q.bg
-r.bg
-s.bg
-t.bg
-u.bg
-v.bg
-w.bg
-x.bg
-y.bg
-z.bg
-0.bg
-1.bg
-2.bg
-3.bg
-4.bg
-5.bg
-6.bg
-7.bg
-8.bg
-9.bg
-
-// bh : http://en.wikipedia.org/wiki/.bh
-bh
-com.bh
-edu.bh
-net.bh
-org.bh
-gov.bh
-
-// bi : http://en.wikipedia.org/wiki/.bi
-// http://whois.nic.bi/
-bi
-co.bi
-com.bi
-edu.bi
-or.bi
-org.bi
-
-// biz : http://en.wikipedia.org/wiki/.biz
-biz
-
-// bj : http://en.wikipedia.org/wiki/.bj
-bj
-asso.bj
-barreau.bj
-gouv.bj
-
-// bm : http://www.bermudanic.bm/dnr-text.txt
-bm
-com.bm
-edu.bm
-gov.bm
-net.bm
-org.bm
-
-// bn : http://en.wikipedia.org/wiki/.bn
-*.bn
-
-// bo : http://www.nic.bo/
-bo
-com.bo
-edu.bo
-gov.bo
-gob.bo
-int.bo
-org.bo
-net.bo
-mil.bo
-tv.bo
-
-// br : http://registro.br/dominio/categoria.html
-// Submitted by registry <fn...@registro.br> 2014-08-11
-br
-adm.br
-adv.br
-agr.br
-am.br
-arq.br
-art.br
-ato.br
-b.br
-bio.br
-blog.br
-bmd.br
-cim.br
-cng.br
-cnt.br
-com.br
-coop.br
-ecn.br
-eco.br
-edu.br
-emp.br
-eng.br
-esp.br
-etc.br
-eti.br
-far.br
-flog.br
-fm.br
-fnd.br
-fot.br
-fst.br
-g12.br
-ggf.br
-gov.br
-imb.br
-ind.br
-inf.br
-jor.br
-jus.br
-leg.br
-lel.br
-mat.br
-med.br
-mil.br
-mp.br
-mus.br
-net.br
-*.nom.br
-not.br
-ntr.br
-odo.br
-org.br
-ppg.br
-pro.br
-psc.br
-psi.br
-qsl.br
-radio.br
-rec.br
-slg.br
-srv.br
-taxi.br
-teo.br
-tmp.br
-trd.br
-tur.br
-tv.br
-vet.br
-vlog.br
-wiki.br
-zlg.br
-
-// bs : http://www.nic.bs/rules.html
-bs
-com.bs
-net.bs
-org.bs
-edu.bs
-gov.bs
-
-// bt : http://en.wikipedia.org/wiki/.bt
-bt
-com.bt
-edu.bt
-gov.bt
-net.bt
-org.bt
-
-// bv : No registrations at this time.
-// Submitted by registry <ja...@uninett.no> 2006-06-16
-bv
-
-// bw : http://en.wikipedia.org/wiki/.bw
-// http://www.gobin.info/domainname/bw.doc
-// list of other 2nd level tlds ?
-bw
-co.bw
-org.bw
-
-// by : http://en.wikipedia.org/wiki/.by
-// http://tld.by/rules_2006_en.html
-// list of other 2nd level tlds ?
-by
-gov.by
-mil.by
-// Official information does not indicate that com.by is a reserved
-// second-level domain, but it's being used as one (see www.google.com.by and
-// www.yahoo.com.by, for example), so we list it here for safety's sake.
-com.by
-
-// http://hoster.by/
-of.by
-
-// bz : http://en.wikipedia.org/wiki/.bz
-// http://www.belizenic.bz/
-bz
-com.bz
-net.bz
-org.bz
-edu.bz
-gov.bz
-
-// ca : http://en.wikipedia.org/wiki/.ca
-ca
-// ca geographical names
-ab.ca
-bc.ca
-mb.ca
-nb.ca
-nf.ca
-nl.ca
-ns.ca
-nt.ca
-nu.ca
-on.ca
-pe.ca
-qc.ca
-sk.ca
-yk.ca
-// gc.ca: http://en.wikipedia.org/wiki/.gc.ca
-// see also: http://registry.gc.ca/en/SubdomainFAQ
-gc.ca
-
-// cat : http://en.wikipedia.org/wiki/.cat
-cat
-
-// cc : http://en.wikipedia.org/wiki/.cc
-cc
-
-// cd : http://en.wikipedia.org/wiki/.cd
-// see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1
-cd
-gov.cd
-
-// cf : http://en.wikipedia.org/wiki/.cf
-cf
-
-// cg : http://en.wikipedia.org/wiki/.cg
-cg
-
-// ch : http://en.wikipedia.org/wiki/.ch
-ch
-
-// ci : http://en.wikipedia.org/wiki/.ci
-// http://www.nic.ci/index.php?page=charte
-ci
-org.ci
-or.ci
-com.ci
-co.ci
-edu.ci
-ed.ci
-ac.ci
-net.ci
-go.ci
-asso.ci
-aéroport.ci
-int.ci
-presse.ci
-md.ci
-gouv.ci
-
-// ck : http://en.wikipedia.org/wiki/.ck
-*.ck
-!www.ck
-
-// cl : http://en.wikipedia.org/wiki/.cl
-cl
-gov.cl
-gob.cl
-co.cl
-mil.cl
-
-// cm : http://en.wikipedia.org/wiki/.cm plus bug 981927
-cm
-co.cm
-com.cm
-gov.cm
-net.cm
-
-// cn : http://en.wikipedia.org/wiki/.cn
-// Submitted by registry <ta...@cnnic.cn> 2008-06-11
-cn
-ac.cn
-com.cn
-edu.cn
-gov.cn
-net.cn
-org.cn
-mil.cn
-公司.cn
-网络.cn
-網絡.cn
-// cn geographic names
-ah.cn
-bj.cn
-cq.cn
-fj.cn
-gd.cn
-gs.cn
-gz.cn
-gx.cn
-ha.cn
-hb.cn
-he.cn
-hi.cn
-hl.cn
-hn.cn
-jl.cn
-js.cn
-jx.cn
-ln.cn
-nm.cn
-nx.cn
-qh.cn
-sc.cn
-sd.cn
-sh.cn
-sn.cn
-sx.cn
-tj.cn
-xj.cn
-xz.cn
-yn.cn
-zj.cn
-hk.cn
-mo.cn
-tw.cn
-
-// co : http://en.wikipedia.org/wiki/.co
-// Submitted by registry <te...@uniandes.edu.co> 2008-06-11
-co
-arts.co
-com.co
-edu.co
-firm.co
-gov.co
-info.co
-int.co
-mil.co
-net.co
-nom.co
-org.co
-rec.co
-web.co
-
-// com : http://en.wikipedia.org/wiki/.com
-com
-
-// coop : http://en.wikipedia.org/wiki/.coop
-coop
-
-// cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do
-cr
-ac.cr
-co.cr
-ed.cr
-fi.cr
-go.cr
-or.cr
-sa.cr
-
-// cu : http://en.wikipedia.org/wiki/.cu
-cu
-com.cu
-edu.cu
-org.cu
-net.cu
-gov.cu
-inf.cu
-
-// cv : http://en.wikipedia.org/wiki/.cv
-cv
-
-// cw : http://www.una.cw/cw_registry/
-// Confirmed by registry <re...@una.net> 2013-03-26
-cw
-com.cw
-edu.cw
-net.cw
-org.cw
-
-// cx : http://en.wikipedia.org/wiki/.cx
-// list of other 2nd level tlds ?
-cx
-gov.cx
-
-// cy : http://en.wikipedia.org/wiki/.cy
-*.cy
-
-// cz : http://en.wikipedia.org/wiki/.cz
-cz
-
-// de : http://en.wikipedia.org/wiki/.de
-// Confirmed by registry <op...@denic.de> (with technical
-// reservations) 2008-07-01
-de
-
-// dj : http://en.wikipedia.org/wiki/.dj
-dj
-
-// dk : http://en.wikipedia.org/wiki/.dk
-// Confirmed by registry <ro...@dk-hostmaster.dk> 2008-06-17
-dk
-
-// dm : http://en.wikipedia.org/wiki/.dm
-dm
-com.dm
-net.dm
-org.dm
-edu.dm
-gov.dm
-
-// do : http://en.wikipedia.org/wiki/.do
-do
-art.do
-com.do
-edu.do
-gob.do
-gov.do
-mil.do
-net.do
-org.do
-sld.do
-web.do
-
-// dz : http://en.wikipedia.org/wiki/.dz
-dz
-com.dz
-org.dz
-net.dz
-gov.dz
-edu.dz
-asso.dz
-pol.dz
-art.dz
-
-// ec : http://www.nic.ec/reg/paso1.asp
-// Submitted by registry <va...@nic.ec> 2008-07-04
-ec
-com.ec
-info.ec
-net.ec
-fin.ec
-k12.ec
-med.ec
-pro.ec
-org.ec
-edu.ec
-gov.ec
-gob.ec
-mil.ec
-
-// edu : http://en.wikipedia.org/wiki/.edu
-edu
-
-// ee : http://www.eenet.ee/EENet/dom_reeglid.html#lisa_B
-ee
-edu.ee
-gov.ee
-riik.ee
-lib.ee
-med.ee
-com.ee
-pri.ee
-aip.ee
-org.ee
-fie.ee
-
-// eg : http://en.wikipedia.org/wiki/.eg
-eg
-com.eg
-edu.eg
-eun.eg
-gov.eg
-mil.eg
-name.eg
-net.eg
-org.eg
-sci.eg
-
-// er : http://en.wikipedia.org/wiki/.er
-*.er
-
-// es : https://www.nic.es/site_ingles/ingles/dominios/index.html
-es
-com.es
-nom.es
-org.es
-gob.es
-edu.es
-
-// et : http://en.wikipedia.org/wiki/.et
-et
-com.et
-gov.et
-org.et
-edu.et
-biz.et
-name.et
-info.et
-
-// eu : http://en.wikipedia.org/wiki/.eu
-eu
-
-// fi : http://en.wikipedia.org/wiki/.fi
-fi
-// aland.fi : http://en.wikipedia.org/wiki/.ax
-// This domain is being phased out in favor of .ax. As there are still many
-// domains under aland.fi, we still keep it on the list until aland.fi is
-// completely removed.
-// TODO: Check for updates (expected to be phased out around Q1/2009)
-aland.fi
-
-// fj : http://en.wikipedia.org/wiki/.fj
-*.fj
-
-// fk : http://en.wikipedia.org/wiki/.fk
-*.fk
-
-// fm : http://en.wikipedia.org/wiki/.fm
-fm
-
-// fo : http://en.wikipedia.org/wiki/.fo
-fo
-
-// fr : http://www.afnic.fr/
-// domaines descriptifs : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-descriptifs
-fr
-com.fr
-asso.fr
-nom.fr
-prd.fr
-presse.fr
-tm.fr
-// domaines sectoriels : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-sectoriels
-aeroport.fr
-assedic.fr
-avocat.fr
-avoues.fr
-cci.fr
-chambagri.fr
-chirurgiens-dentistes.fr
-experts-comptables.fr
-geometre-expert.fr
-gouv.fr
-greta.fr
-huissier-justice.fr
-medecin.fr
-notaires.fr
-pharmacien.fr
-port.fr
-veterinaire.fr
-
-// ga : http://en.wikipedia.org/wiki/.ga
-ga
-
-// gb : This registry is effectively dormant
-// Submitted by registry <Da...@ja.net> 2008-06-12
-gb
-
-// gd : http://en.wikipedia.org/wiki/.gd
-gd
-
-// ge : http://www.nic.net.ge/policy_en.pdf
-ge
-com.ge
-edu.ge
-gov.ge
-org.ge
-mil.ge
-net.ge
-pvt.ge
-
-// gf : http://en.wikipedia.org/wiki/.gf
-gf
-
-// gg : http://www.channelisles.net/register-domains/
-// Confirmed by registry <ni...@channelisles.net> 2013-11-28
-gg
-co.gg
-net.gg
-org.gg
-
-// gh : http://en.wikipedia.org/wiki/.gh
-// see also: http://www.nic.gh/reg_now.php
-// Although domains directly at second level are not possible at the moment,
-// they have been possible for some time and may come back.
-gh
-com.gh
-edu.gh
-gov.gh
-org.gh
-mil.gh
-
-// gi : http://www.nic.gi/rules.html
-gi
-com.gi
-ltd.gi
-gov.gi
-mod.gi
-edu.gi
-org.gi
-
-// gl : http://en.wikipedia.org/wiki/.gl
-// http://nic.gl
-gl
-
-// gm : http://www.nic.gm/htmlpages%5Cgm-policy.htm
-gm
-
-// gn : http://psg.com/dns/gn/gn.txt
-// Submitted by registry <ra...@psg.com> 2008-06-17
-gn
-ac.gn
-com.gn
-edu.gn
-gov.gn
-org.gn
-net.gn
-
-// gov : http://en.wikipedia.org/wiki/.gov
-gov
-
-// gp : http://www.nic.gp/index.php?lang=en
-gp
-com.gp
-net.gp
-mobi.gp
-edu.gp
-org.gp
-asso.gp
-
-// gq : http://en.wikipedia.org/wiki/.gq
-gq
-
-// gr : https://grweb.ics.forth.gr/english/1617-B-2005.html
-// Submitted by registry <se...@ics.forth.gr> 2008-06-09
-gr
-com.gr
-edu.gr
-net.gr
-org.gr
-gov.gr
-
-// gs : http://en.wikipedia.org/wiki/.gs
-gs
-
-// gt : http://www.gt/politicas_de_registro.html
-gt
-com.gt
-edu.gt
-gob.gt
-ind.gt
-mil.gt
-net.gt
-org.gt
-
-// gu : http://gadao.gov.gu/registration.txt
-*.gu
-
-// gw : http://en.wikipedia.org/wiki/.gw
-gw
-
-// gy : http://en.wikipedia.org/wiki/.gy
-// http://registry.gy/
-gy
-co.gy
-com.gy
-net.gy
-
-// hk : https://www.hkdnr.hk
-// Submitted by registry <hk...@hkirc.hk> 2008-06-11
-hk
-com.hk
-edu.hk
-gov.hk
-idv.hk
-net.hk
-org.hk
-公司.hk
-教育.hk
-敎育.hk
-政府.hk
-個人.hk
-个人.hk
-箇人.hk
-網络.hk
-网络.hk
-组織.hk
-網絡.hk
-网絡.hk
-组织.hk
-組織.hk
-組织.hk
-
-// hm : http://en.wikipedia.org/wiki/.hm
-hm
-
-// hn : http://www.nic.hn/politicas/ps02,,05.html
-hn
-com.hn
-edu.hn
-org.hn
-net.hn
-mil.hn
-gob.hn
-
-// hr : http://www.dns.hr/documents/pdf/HRTLD-regulations.pdf
-hr
-iz.hr
-from.hr
-name.hr
-com.hr
-
-// ht : http://www.nic.ht/info/charte.cfm
-ht
-com.ht
-shop.ht
-firm.ht
-info.ht
-adult.ht
-net.ht
-pro.ht
-org.ht
-med.ht
-art.ht
-coop.ht
-pol.ht
-asso.ht
-edu.ht
-rel.ht
-gouv.ht
-perso.ht
-
-// hu : http://www.domain.hu/domain/English/sld.html
-// Confirmed by registry <pa...@iszt.hu> 2008-06-12
-hu
-co.hu
-info.hu
-org.hu
-priv.hu
-sport.hu
-tm.hu
-2000.hu
-agrar.hu
-bolt.hu
-casino.hu
-city.hu
-erotica.hu
-erotika.hu
-film.hu
-forum.hu
-games.hu
-hotel.hu
-ingatlan.hu
-jogasz.hu
-konyvelo.hu
-lakas.hu
-media.hu
-news.hu
-reklam.hu
-sex.hu
-shop.hu
-suli.hu
-szex.hu
-tozsde.hu
-utazas.hu
-video.hu
-
-// id : https://register.pandi.or.id/
-id
-ac.id
-biz.id
-co.id
-desa.id
-go.id
-mil.id
-my.id
-net.id
-or.id
-sch.id
-web.id
-
-// ie : http://en.wikipedia.org/wiki/.ie
-ie
-gov.ie
-
-// il : http://en.wikipedia.org/wiki/.il
-*.il
-
-// im : https://www.nic.im/
-// Submitted by registry <in...@nic.im> 2013-11-15
-im
-ac.im
-co.im
-com.im
-ltd.co.im
-net.im
-org.im
-plc.co.im
-tt.im
-tv.im
-
-// in : http://en.wikipedia.org/wiki/.in
-// see also: https://registry.in/Policies
-// Please note, that nic.in is not an offical eTLD, but used by most
-// government institutions.
-in
-co.in
-firm.in
-net.in
-org.in
-gen.in
-ind.in
-nic.in
-ac.in
-edu.in
-res.in
-gov.in
-mil.in
-
-// info : http://en.wikipedia.org/wiki/.info
-info
-
-// int : http://en.wikipedia.org/wiki/.int
-// Confirmed by registry <ia...@icann.org> 2008-06-18
-int
-eu.int
-
-// io : http://www.nic.io/rules.html
-// list of other 2nd level tlds ?
-io
-com.io
-
-// iq : http://www.cmc.iq/english/iq/iqregister1.htm
-iq
-gov.iq
-edu.iq
-mil.iq
-com.iq
-org.iq
-net.iq
-
-// ir : http://www.nic.ir/Terms_and_Conditions_ir,_Appendix_1_Domain_Rules
-// Also see http://www.nic.ir/Internationalized_Domain_Names
-// Two <iran>.ir entries added at request of <te...@nic.ir>, 2010-04-16
-ir
-ac.ir
-co.ir
-gov.ir
-id.ir
-net.ir
-org.ir
-sch.ir
-// xn--mgba3a4f16a.ir (<iran>.ir, Persian YEH)
-ایران.ir
-// xn--mgba3a4fra.ir (<iran>.ir, Arabic YEH)
-ايران.ir
-
-// is : http://www.isnic.is/domain/rules.php
-// Confirmed by registry <ma...@isgate.is> 2008-12-06
-is
-net.is
-com.is
-edu.is
-gov.is
-org.is
-int.is
-
-// it : http://en.wikipedia.org/wiki/.it
-it
-gov.it
-edu.it
-// Reserved geo-names:
-// http://www.nic.it/documenti/regolamenti-e-linee-guida/regolamento-assegnazione-versione-6.0.pdf
-// There is also a list of reserved geo-names corresponding to Italian municipalities
-// http://www.nic.it/documenti/appendice-c.pdf, but it is not included here.
-// Regions
-abr.it
-abruzzo.it
-aosta-valley.it
-aostavalley.it
-bas.it
-basilicata.it
-cal.it
-calabria.it
-cam.it
-campania.it
-emilia-romagna.it
-emiliaromagna.it
-emr.it
-friuli-v-giulia.it
-friuli-ve-giulia.it
-friuli-vegiulia.it
-friuli-venezia-giulia.it
-friuli-veneziagiulia.it
-friuli-vgiulia.it
-friuliv-giulia.it
-friulive-giulia.it
-friulivegiulia.it
-friulivenezia-giulia.it
-friuliveneziagiulia.it
-friulivgiulia.it
-fvg.it
-laz.it
-lazio.it
-lig.it
-liguria.it
-lom.it
-lombardia.it
-lombardy.it
-lucania.it
-mar.it
-marche.it
-mol.it
-molise.it
-piedmont.it
-piemonte.it
-pmn.it
-pug.it
-puglia.it
-sar.it
-sardegna.it
-sardinia.it
-sic.it
-sicilia.it
-sicily.it
-taa.it
-tos.it
-toscana.it
-trentino-a-adige.it
-trentino-aadige.it
-trentino-alto-adige.it
-trentino-altoadige.it
-trentino-s-tirol.it
-trentino-stirol.it
-trentino-sud-tirol.it
-trentino-sudtirol.it
-trentino-sued-tirol.it
-trentino-suedtirol.it
-trentinoa-adige.it
-trentinoaadige.it
-trentinoalto-adige.it
-trentinoaltoadige.it
-trentinos-tirol.it
-trentinostirol.it
-trentinosud-tirol.it
-trentinosudtirol.it
-trentinosued-tirol.it
-trentinosuedtirol.it
-tuscany.it
-umb.it
-umbria.it
-val-d-aosta.it
-val-daosta.it
-vald-aosta.it
-valdaosta.it
-valle-aosta.it
-valle-d-aosta.it
-valle-daosta.it
-valleaosta.it
-valled-aosta.it
-valledaosta.it
-vallee-aoste.it
-valleeaoste.it
-vao.it
-vda.it
-ven.it
-veneto.it
-// Provinces
-ag.it
-agrigento.it
-al.it
-alessandria.it
-alto-adige.it
-altoadige.it
-an.it
-ancona.it
-andria-barletta-trani.it
-andria-trani-barletta.it
-andriabarlettatrani.it
-andriatranibarletta.it
-ao.it
-aosta.it
-aoste.it
-ap.it
-aq.it
-aquila.it
-ar.it
-arezzo.it
-ascoli-piceno.it
-ascolipiceno.it
-asti.it
-at.it
-av.it
-avellino.it
-ba.it
-balsan.it
-bari.it
-barletta-trani-andria.it
-barlettatraniandria.it
-belluno.it
-benevento.it
-bergamo.it
-bg.it
-bi.it
-biella.it
-bl.it
-bn.it
-bo.it
-bologna.it
-bolzano.it
-bozen.it
-br.it
-brescia.it
-brindisi.it
-bs.it
-bt.it
-bz.it
-ca.it
-cagliari.it
-caltanissetta.it
-campidano-medio.it
-campidanomedio.it
-campobasso.it
-carbonia-iglesias.it
-carboniaiglesias.it
-carrara-massa.it
-carraramassa.it
-caserta.it
-catania.it
-catanzaro.it
-cb.it
-ce.it
-cesena-forli.it
-cesenaforli.it
-ch.it
-chieti.it
-ci.it
-cl.it
-cn.it
-co.it
-como.it
-cosenza.it
-cr.it
-cremona.it
-crotone.it
-cs.it
-ct.it
-cuneo.it
-cz.it
-dell-ogliastra.it
-dellogliastra.it
-en.it
-enna.it
-fc.it
-fe.it
-fermo.it
-ferrara.it
-fg.it
-fi.it
-firenze.it
-florence.it
-fm.it
-foggia.it
-forli-cesena.it
-forlicesena.it
-fr.it
-frosinone.it
-ge.it
-genoa.it
-genova.it
-go.it
-gorizia.it
-gr.it
-grosseto.it
-iglesias-carbonia.it
-iglesiascarbonia.it
-im.it
-imperia.it
-is.it
-isernia.it
-kr.it
-la-spezia.it
-laquila.it
-laspezia.it
-latina.it
-lc.it
-le.it
-lecce.it
-lecco.it
-li.it
-livorno.it
-lo.it
-lodi.it
-lt.it
-lu.it
-lucca.it
-macerata.it
-mantova.it
-massa-carrara.it
-massacarrara.it
-matera.it
-mb.it
-mc.it
-me.it
-medio-campidano.it
-mediocampidano.it
-messina.it
-mi.it
-milan.it
-milano.it
-mn.it
-mo.it
-modena.it
-monza-brianza.it
-monza-e-della-brianza.it
-monza.it
-monzabrianza.it
-monzaebrianza.it
-monzaedellabrianza.it
-ms.it
-mt.it
-na.it
-naples.it
-napoli.it
-no.it
-novara.it
-nu.it
-nuoro.it
-og.it
-ogliastra.it
-olbia-tempio.it
-olbiatempio.it
-or.it
-oristano.it
-ot.it
-pa.it
-padova.it
-padua.it
-palermo.it
-parma.it
-pavia.it
-pc.it
-pd.it
-pe.it
-perugia.it
-pesaro-urbino.it
-pesarourbino.it
-pescara.it
-pg.it
-pi.it
-piacenza.it
-pisa.it
-pistoia.it
-pn.it
-po.it
-pordenone.it
-potenza.it
-pr.it
-prato.it
-pt.it
-pu.it
-pv.it
-pz.it
-ra.it
-ragusa.it
-ravenna.it
-rc.it
-re.it
-reggio-calabria.it
-reggio-emilia.it
-reggiocalabria.it
-reggioemilia.it
-rg.it
-ri.it
-rieti.it
-rimini.it
-rm.it
-rn.it
-ro.it
-roma.it
-rome.it
-rovigo.it
-sa.it
-salerno.it
-sassari.it
-savona.it
-si.it
-siena.it
-siracusa.it
-so.it
-sondrio.it
-sp.it
-sr.it
-ss.it
-suedtirol.it
-sv.it
-ta.it
-taranto.it
-te.it
-tempio-olbia.it
-tempioolbia.it
-teramo.it
-terni.it
-tn.it
-to.it
-torino.it
-tp.it
-tr.it
-trani-andria-barletta.it
-trani-barletta-andria.it
-traniandriabarletta.it
-tranibarlettaandria.it
-trapani.it
-trentino.it
-trento.it
-treviso.it
-trieste.it
-ts.it
-turin.it
-tv.it
-ud.it
-udine.it
-urbino-pesaro.it
-urbinopesaro.it
-va.it
-varese.it
-vb.it
-vc.it
-ve.it
-venezia.it
-venice.it
-verbania.it
-vercelli.it
-verona.it
-vi.it
-vibo-valentia.it
-vibovalentia.it
-vicenza.it
-viterbo.it
-vr.it
-vs.it
-vt.it
-vv.it
-
-// je : http://www.channelisles.net/register-domains/
-// Confirmed by registry <ni...@channelisles.net> 2013-11-28
-je
-co.je
-net.je
-org.je
-
-// jm : http://www.com.jm/register.html
-*.jm
-
-// jo : http://www.dns.jo/Registration_policy.aspx
-jo
-com.jo
-org.jo
-net.jo
-edu.jo
-sch.jo
-gov.jo
-mil.jo
-name.jo
-
-// jobs : http://en.wikipedia.org/wiki/.jobs
-jobs
-
-// jp : http://en.wikipedia.org/wiki/.jp
-// http://jprs.co.jp/en/jpdomain.html
-// Submitted by registry <in...@jprs.jp> 2014-10-30
-jp
-// jp organizational type names
-ac.jp
-ad.jp
-co.jp
-ed.jp
-go.jp
-gr.jp
-lg.jp
-ne.jp
-or.jp
-// jp prefecture type names
-aichi.jp
-akita.jp
-aomori.jp
-chiba.jp
-ehime.jp
-fukui.jp
-fukuoka.jp
-fukushima.jp
-gifu.jp
-gunma.jp
-hiroshima.jp
-hokkaido.jp
-hyogo.jp
-ibaraki.jp
-ishikawa.jp
-iwate.jp
-kagawa.jp
-kagoshima.jp
-kanagawa.jp
-kochi.jp
-kumamoto.jp
-kyoto.jp
-mie.jp
-miyagi.jp
-miyazaki.jp
-nagano.jp
-nagasaki.jp
-nara.jp
-niigata.jp
-oita.jp
-okayama.jp
-okinawa.jp
-osaka.jp
-saga.jp
-saitama.jp
-shiga.jp
-shimane.jp
-shizuoka.jp
-tochigi.jp
-tokushima.jp
-tokyo.jp
-tottori.jp
-toyama.jp
-wakayama.jp
-yamagata.jp
-yamaguchi.jp
-yamanashi.jp
-栃木.jp
-愛知.jp
-愛媛.jp
-兵庫.jp
-熊本.jp
-茨城.jp
-北海道.jp
-千葉.jp
-和歌山.jp
-長崎.jp
-長野.jp
-新潟.jp
-青森.jp
-静岡.jp
-東京.jp
-石川.jp
-埼玉.jp
-三重.jp
-京都.jp
-佐賀.jp
-大分.jp
-大阪.jp
-奈良.jp
-宮城.jp
-宮崎.jp
-富山.jp
-山口.jp
-山形.jp
-山梨.jp
-岩手.jp
-岐阜.jp
-岡山.jp
-島根.jp
-広島.jp
-徳島.jp
-沖縄.jp
-滋賀.jp
-神奈川.jp
-福井.jp
-福岡.jp
-福島.jp
-秋田.jp
-群馬.jp
-香川.jp
-高知.jp
-鳥取.jp
-鹿児島.jp
-// jp geographic type names
-// http://jprs.jp/doc/rule/saisoku-1.html
-*.kawasaki.jp
-*.kitakyushu.jp
-*.kobe.jp
-*.nagoya.jp
-*.sapporo.jp
-*.sendai.jp
-*.yokohama.jp
-!city.kawasaki.jp
-!city.kitakyushu.jp
-!city.kobe.jp
-!city.nagoya.jp
-!city.sapporo.jp
-!city.sendai.jp
-!city.yokohama.jp
-// 4th level registration
-aisai.aichi.jp
-ama.aichi.jp
-anjo.aichi.jp
-asuke.aichi.jp
-chiryu.aichi.jp
-chita.aichi.jp
-fuso.aichi.jp
-gamagori.aichi.jp
-handa.aichi.jp
-hazu.aichi.jp
-hekinan.aichi.jp
-higashiura.aichi.jp
-ichinomiya.aichi.jp
-inazawa.aichi.jp
-inuyama.aichi.jp
-isshiki.aichi.jp
-iwakura.aichi.jp
-kanie.aichi.jp
-kariya.aichi.jp
-kasugai.aichi.jp
-kira.aichi.jp
-kiyosu.aichi.jp
-komaki.aichi.jp
-konan.aichi.jp
-kota.aichi.jp
-mihama.aichi.jp
-miyoshi.aichi.jp
-nishio.aichi.jp
-nisshin.aichi.jp
-obu.aichi.jp
-oguchi.aichi.jp
-oharu.aichi.jp
-okazaki.aichi.jp
-owariasahi.aichi.jp
-seto.aichi.jp
-shikatsu.aichi.jp
-shinshiro.aichi.jp
-shitara.aichi.jp
-tahara.aichi.jp
-takahama.aichi.jp
-tobishima.aichi.jp
-toei.aichi.jp
-togo.aichi.jp
-tokai.aichi.jp
-tokoname.aichi.jp
-toyoake.aichi.jp
-toyohashi.aichi.jp
-toyokawa.aichi.jp
-toyone.aichi.jp
-toyota.aichi.jp
-tsushima.aichi.jp
-yatomi.aichi.jp
-akita.akita.jp
-daisen.akita.jp
-fujisato.akita.jp
-gojome.akita.jp
-hachirogata.akita.jp
-happou.akita.jp
-higashinaruse.akita.jp
-honjo.akita.jp
-honjyo.akita.jp
-ikawa.akita.jp
-kamikoani.akita.jp
-kamioka.akita.jp
-katagami.akita.jp
-kazuno.akita.jp
-kitaakita.akita.jp
-kosaka.akita.jp
-kyowa.akita.jp
-misato.akita.jp
-mitane.akita.jp
-moriyoshi.akita.jp
-nikaho.akita.jp
-noshiro.akita.jp
-odate.akita.jp
-oga.akita.jp
-ogata.akita.jp
-semboku.akita.jp
-yokote.akita.jp
-yurihonjo.akita.jp
-aomori.aomori.jp
-gonohe.aomori.jp
-hachinohe.aomori.jp
-hashikami.aomori.jp
-hiranai.aomori.jp
-hirosaki.aomori.jp
-itayanagi.aomori.jp
-kuroishi.aomori.jp
-misawa.aomori.jp
-mutsu.aomori.jp
-nakadomari.aomori.jp
-noheji.aomori.jp
-oirase.aomori.jp
-owani.aomori.jp
-rokunohe.aomori.jp
-sannohe.aomori.jp
-shichinohe.aomori.jp
-shingo.aomori.jp
-takko.aomori.jp
-towada.aomori.jp
-tsugaru.aomori.jp
-tsuruta.aomori.jp
-abiko.chiba.jp
-asahi.chiba.jp
-chonan.chiba.jp
-chosei.chiba.jp
-choshi.chiba.jp
-chuo.chiba.jp
-funabashi.chiba.jp
-futtsu.chiba.jp
-hanamigawa.chiba.jp
-ichihara.chiba.jp
-ichikawa.chiba.jp
-ichinomiya.chiba.jp
-inzai.chiba.jp
-isumi.chiba.jp
-kamagaya.chiba.jp
-kamogawa.chiba.jp
-kashiwa.chiba.jp
-katori.chiba.jp
-katsuura.chiba.jp
-kimitsu.chiba.jp
-kisarazu.chiba.jp
-kozaki.chiba.jp
-kujukuri.chiba.jp
-kyonan.chiba.jp
-matsudo.chiba.jp
-midori.chiba.jp
-mihama.chiba.jp
-minamiboso.chiba.jp
-mobara.chiba.jp
-mutsuzawa.chiba.jp
-nagara.chiba.jp
-nagareyama.chiba.jp
-narashino.chiba.jp
-narita.chiba.jp
-noda.chiba.jp
-oamishirasato.chiba.jp
-omigawa.chiba.jp
-onjuku.chiba.jp
-otaki.chiba.jp
-sakae.chiba.jp
-sakura.chiba.jp
-shimofusa.chiba.jp
-shirako.chiba.jp
-shiroi.chiba.jp
-shisui.chiba.jp
-sodegaura.chiba.jp
-sosa.chiba.jp
-tako.chiba.jp
-tateyama.chiba.jp
-togane.chiba.jp
-tohnosho.chiba.jp
-tomisato.chiba.jp
-urayasu.chiba.jp
-yachimata.chiba.jp
-yachiyo.chiba.jp
-yokaichiba.chiba.jp
-yokoshibahikari.chiba.jp
-yotsukaido.chiba.jp
-ainan.ehime.jp
-honai.ehime.jp
-ikata.ehime.jp
-imabari.ehime.jp
-iyo.ehime.jp
-kamijima.ehime.jp
-kihoku.ehime.jp
-kumakogen.ehime.jp
-masaki.ehime.jp
-matsuno.ehime.jp
-matsuyama.ehime.jp
-namikata.ehime.jp
-niihama.ehime.jp
-ozu.ehime.jp
-saijo.ehime.jp
-seiyo.ehime.jp
-shikokuchuo.ehime.jp
-tobe.ehime.jp
-toon.ehime.jp
-uchiko.ehime.jp
-uwajima.ehime.jp
-yawatahama.ehime.jp
-echizen.fukui.jp
-eiheiji.fukui.jp
-fukui.fukui.jp
-ikeda.fukui.jp
-katsuyama.fukui.jp
-mihama.fukui.jp
-minamiechizen.fukui.jp
-obama.fukui.jp
-ohi.fukui.jp
-ono.fukui.jp
-sabae.fukui.jp
-sakai.fukui.jp
-takahama.fukui.jp
-tsuruga.fukui.jp
-wakasa.fukui.jp
-ashiya.fukuoka.jp
-buzen.fukuoka.jp
-chikugo.fukuoka.jp
-chikuho.fukuoka.jp
-chikujo.fukuoka.jp
-chikushino.fukuoka.jp
-chikuzen.fukuoka.jp
-chuo.fukuoka.jp
-dazaifu.fukuoka.jp
-fukuchi.fukuoka.jp
-hakata.fukuoka.jp
-higashi.fukuoka.jp
-hirokawa.fukuoka.jp
-hisayama.fukuoka.jp
-iizuka.fukuoka.jp
-inatsuki.fukuoka.jp
-kaho.fukuoka.jp
-kasuga.fukuoka.jp
-kasuya.fukuoka.jp
-kawara.fukuoka.jp
-keisen.fukuoka.jp
-koga.fukuoka.jp
-kurate.fukuoka.jp
-kurogi.fukuoka.jp
-kurume.fukuoka.jp
-minami.fukuoka.jp
-miyako.fukuoka.jp
-miyama.fukuoka.jp
-miyawaka.fukuoka.jp
-mizumaki.fukuoka.jp
-munakata.fukuoka.jp
-nakagawa.fukuoka.jp
-nakama.fukuoka.jp
-nishi.fukuoka.jp
-nogata.fukuoka.jp
-ogori.fukuoka.jp
-okagaki.fukuoka.jp
-okawa.fukuoka.jp
-oki.fukuoka.jp
-omuta.fukuoka.jp
-onga.fukuoka.jp
-onojo.fukuoka.jp
-oto.fukuoka.jp
-saigawa.fukuoka.jp
-sasaguri.fukuoka.jp
-shingu.fukuoka.jp
-shinyoshitomi.fukuoka.jp
-shonai.fukuoka.jp
-soeda.fukuoka.jp
-sue.fukuoka.jp
-tachiarai.fukuoka.jp
-tagawa.fukuoka.jp
-takata.fukuoka.jp
-toho.fukuoka.jp
-toyotsu.fukuoka.jp
-tsuiki.fukuoka.jp
-ukiha.fukuoka.jp
-umi.fukuoka.jp
-usui.fukuoka.jp
-yamada.fukuoka.jp
-yame.fukuoka.jp
-yanagawa.fukuoka.jp
-yukuhashi.fukuoka.jp
-aizubange.fukushima.jp
-aizumisato.fukushima.jp
-aizuwakamatsu.fukushima.jp
-asakawa.fukushima.jp
-bandai.fukushima.jp
-date.fukushima.jp
-fukushima.fukushima.jp
-furudono.fukushima.jp
-futaba.fukushima.jp
-hanawa.fukushima.jp
-higashi.fukushima.jp
-hirata.fukushima.jp
-hirono.fukushima.jp
-iitate.fukushima.jp
-inawashiro.fukushima.jp
-ishikawa.fukushima.jp
-iwaki.fukushima.jp
-izumizaki.fukushima.jp
-kagamiishi.fukushima.jp
-kaneyama.fukushima.jp
-kawamata.fukushima.jp
-kitakata.fukushima.jp
-kitashiobara.fukushima.jp
-koori.fukushima.jp
-koriyama.fukushima.jp
-kunimi.fukushima.jp
-miharu.fukushima.jp
-mishima.fukushima.jp
-namie.fukushima.jp
-nango.fukushima.jp
-nishiaizu.fukushima.jp
-nishigo.fukushima.jp
-okuma.fukushima.jp
-omotego.fukushima.jp
-ono.fukushima.jp
-otama.fukushima.jp
-samegawa.fukushima.jp
-shimogo.fukushima.jp
-shirakawa.fukushima.jp
-showa.fukushima.jp
-soma.fukushima.jp
-sukagawa.fukushima.jp
-taishin.fukushima.jp
-tamakawa.fukushima.jp
-tanagura.fukushima.jp
-tenei.fukushima.jp
-yabuki.fukushima.jp
-yamato.fukushima.jp
-yamatsuri.fukushima.jp
-yanaizu.fukushima.jp
-yugawa.fukushima.jp
-anpachi.gifu.jp
-ena.gifu.jp
-gifu.gifu.jp
-ginan.gifu.jp
-godo.gifu.jp
-gujo.gifu.jp
-hashima.gifu.jp
-hichiso.gifu.jp
-hida.gifu.jp
-higashishirakawa.gifu.jp
-ibigawa.gifu.jp
-ikeda.gifu.jp
-kakamigahara.gifu.jp
-kani.gifu.jp
-kasahara.gifu.jp
-kasamatsu.gifu.jp
-kawaue.gifu.jp
-kitagata.gifu.jp
-mino.gifu.jp
-minokamo.gifu.jp
-mitake.gifu.jp
-mizunami.gifu.jp
-motosu.gifu.jp
-nakatsugawa.gifu.jp
-ogaki.gifu.jp
-sakahogi.gifu.jp
-seki.gifu.jp
-sekigahara.gifu.jp
-shirakawa.gifu.jp
-tajimi.gifu.jp
-takayama.gifu.jp
-tarui.gifu.jp
-toki.gifu.jp
-tomika.gifu.jp
-wanouchi.gifu.jp
-yamagata.gifu.jp
-yaotsu.gifu.jp
-yoro.gifu.jp
-annaka.gunma.jp
-chiyoda.gunma.jp
-fujioka.gunma.jp
-higashiagatsuma.gunma.jp
-isesaki.gunma.jp
-itakura.gunma.jp
-kanna.gunma.jp
-kanra.gunma.jp
-katashina.gunma.jp
-kawaba.gunma.jp
-kiryu.gunma.jp
-kusatsu.gunma.jp
-maebashi.gunma.jp
-meiwa.gunma.jp
-midori.gunma.jp
-minakami.gunma.jp
-naganohara.gunma.jp
-nakanojo.gunma.jp
-nanmoku.gunma.jp
-numata.gunma.jp
-oizumi.gunma.jp
-ora.gunma.jp
-ota.gunma.jp
-shibukawa.gunma.jp
-shimonita.gunma.jp
-shinto.gunma.jp
-showa.gunma.jp
-takasaki.gunma.jp
-takayama.gunma.jp
-tamamura.gunma.jp
-tatebayashi.gunma.jp
-tomioka.gunma.jp
-tsukiyono.gunma.jp
-tsumagoi.gunma.jp
-ueno.gunma.jp
-yoshioka.gunma.jp
-asaminami.hiroshima.jp
-daiwa.hiroshima.jp
-etajima.hiroshima.jp
-fuchu.hiroshima.jp
-fukuyama.hiroshima.jp
-hatsukaichi.hiroshima.jp
-higashihiroshima.hiroshima.jp
-hongo.hiroshima.jp
-jinsekikogen.hiroshima.jp
-kaita.hiroshima.jp
-kui.hiroshima.jp
-kumano.hiroshima.jp
-kure.hiroshima.jp
-mihara.hiroshima.jp
-miyoshi.hiroshima.jp
-naka.hiroshima.jp
-onomichi.hiroshima.jp
-osakikamijima.hiroshima.jp
-otake.hiroshima.jp
-saka.hiroshima.jp
-sera.hiroshima.jp
-seranishi.hiroshima.jp
-shinichi.hiroshima.jp
-shobara.hiroshima.jp
-takehara.hiroshima.jp
-abashiri.hokkaido.jp
-abira.hokkaido.jp
-aibetsu.hokkaido.jp
-akabira.hokkaido.jp
-akkeshi.hokkaido.jp
-asahikawa.hokkaido.jp
-ashibetsu.hokkaido.jp
-ashoro.hokkaido.jp
-assabu.hokkaido.jp
-atsuma.hokkaido.jp
-bibai.hokkaido.jp
-biei.hokkaido.jp
-bifuka.hokkaido.jp
-bihoro.hokkaido.jp
-biratori.hokkaido.jp
-chippubetsu.hokkaido.jp
-chitose.hokkaido.jp
-date.hokkaido.jp
-ebetsu.hokkaido.jp
-embetsu.hokkaido.jp
-eniwa.hokkaido.jp
-erimo.hokkaido.jp
-esan.hokkaido.jp
-esashi.hokkaido.jp
-fukagawa.hokkaido.jp
-fukushima.hokkaido.jp
-furano.hokkaido.jp
-furubira.hokkaido.jp
-haboro.hokkaido.jp
-hakodate.hokkaido.jp
-hamatonbetsu.hokkaido.jp
-hidaka.hokkaido.jp
-higashikagura.hokkaido.jp
-higashikawa.hokkaido.jp
-hiroo.hokkaido.jp
-hokuryu.hokkaido.jp
-hokuto.hokkaido.jp
-honbetsu.hokkaido.jp
-horokanai.hokkaido.jp
-horonobe.hokkaido.jp
-ikeda.hokkaido.jp
-imakane.hokkaido.jp
-ishikari.hokkaido.jp
-iwamizawa.hokkaido.jp
-iwanai.hokkaido.jp
-kamifurano.hokkaido.jp
-kamikawa.hokkaido.jp
-kamishihoro.hokkaido.jp
-kamisunagawa.hokkaido.jp
-kamoenai.hokkaido.jp
-kayabe.hokkaido.jp
-kembuchi.hokkaido.jp
-kikonai.hokkaido.jp
-kimobetsu.hokkaido.jp
-kitahiroshima.hokkaido.jp
-kitami.hokkaido.jp
-kiyosato.hokkaido.jp
-koshimizu.hokkaido.jp
-kunneppu.hokkaido.jp
-kuriyama.hokkaido.jp
-kuromatsunai.hokkaido.jp
-kushiro.hokkaido.jp
-kutchan.hokkaido.jp
-kyowa.hokkaido.jp
-mashike.hokkaido.jp
-matsumae.hokkaido.jp
-mikasa.hokkaido.jp
-minamifurano.hokkaido.jp
-mombetsu.hokkaido.jp
-moseushi.hokkaido.jp
-mukawa.hokkaido.jp
-muroran.hokkaido.jp
-naie.hokkaido.jp
-nakagawa.hokkaido.jp
-nakasatsunai.hokkaido.jp
-nakatombetsu.hokkaido.jp
-nanae.hokkaido.jp
-nanporo.hokkaido.jp
-nayoro.hokkaido.jp
-nemuro.hokkaido.jp
-niikappu.hokkaido.jp
-niki.hokkaido.jp
-nishiokoppe.hokkaido.jp
-noboribetsu.hokkaido.jp
-numata.hokkaido.jp
-obihiro.hokkaido.jp
-obira.hokkaido.jp
-oketo.hokkaido.jp
-okoppe.hokkaido.jp
-otaru.hokkaido.jp
-otobe.hokkaido.jp
-otofuke.hokkaido.jp
-otoineppu.hokkaido.jp
-oumu.hokkaido.jp
-ozora.hokkaido.jp
-pippu.hokkaido.jp
-rankoshi.hokkaido.jp
-rebun.hokkaido.jp
-rikubetsu.hokkaido.jp
-rishiri.hokkaido.jp
-rishirifuji.hokkaido.jp
-saroma.hokkaido.jp
-sarufutsu.hokkaido.jp
-shakotan.hokkaido.jp
-shari.hokkaido.jp
-shibecha.hokkaido.jp
-shibetsu.hokkaido.jp
-shikabe.hokkaido.jp
-shikaoi.hokkaido.jp
-shimamaki.hokkaido.jp
-shimizu.hokkaido.jp
-shimokawa.hokkaido.jp
-shinshinotsu.hokkaido.jp
-shintoku.hokkaido.jp
-shiranuka.hokkaido.jp
-shiraoi.hokkaido.jp
-shiriuchi.hokkaido.jp
-sobetsu.hokkaido.jp
-sunagawa.hokkaido.jp
-taiki.hokkaido.jp
-takasu.hokkaido.jp
-takikawa.hokkaido.jp
-takinoue.hokkaido.jp
-teshikaga.hokkaido.jp
-tobetsu.hokkaido.jp
-tohma.hokkaido.jp
-tomakomai.hokkaido.jp
-tomari.hokkaido.jp
-toya.hokkaido.jp
-toyako.hokkaido.jp
-toyotomi.hokkaido.jp
-toyoura.hokkaido.jp
-tsubetsu.hokkaido.jp
-tsukigata.hokkaido.jp
-urakawa.hokkaido.jp
-urausu.hokkaido.jp
-uryu.hokkaido.jp
-utashinai.hokkaido.jp
-wakkanai.hokkaido.jp
-wassamu.hokkaido.jp
-yakumo.hokkaido.jp
-yoichi.hokkaido.jp
-aioi.hyogo.jp
-akashi.hyogo.jp
-ako.hyogo.jp
-amagasaki.hyogo.jp
-aogaki.hyogo.jp
-asago.hyogo.jp
-ashiya.hyogo.jp
-awaji.hyogo.jp
-fukusaki.hyogo.jp
-goshiki.hyogo.jp
-harima.hyogo.jp
-himeji.hyogo.jp
-ichikawa.hyogo.jp
-inagawa.hyogo.jp
-itami.hyogo.jp
-kakogawa.hyogo.jp
-kamigori.hyogo.jp
-kamikawa.hyogo.jp
-kasai.hyogo.jp
-kasuga.hyogo.jp
-kawanishi.hyogo.jp
-miki.hyogo.jp
-minamiawaji.hyogo.jp
-nishinomiya.hyogo.jp
-nishiwaki.hyogo.jp
-ono.hyogo.jp
-sanda.hyogo.jp
-sannan.hyogo.jp
-sasayama.hyogo.jp
-sayo.hyogo.jp
-shingu.hyogo.jp
-shinonsen.hyogo.jp
-shiso.hyogo.jp
-sumoto.hyogo.jp
-taishi.hyogo.jp
-taka.hyogo.jp
-takarazuka.hyogo.jp
-takasago.hyogo.jp
-takino.hyogo.jp
-tamba.hyogo.jp
-tatsuno.hyogo.jp
-toyooka.hyogo.jp
-yabu.hyogo.jp
-yashiro.hyogo.jp
-yoka.hyogo.jp
-yokawa.hyogo.jp
-ami.ibaraki.jp
-asahi.ibaraki.jp
-bando.ibaraki.jp
-chikusei.ibaraki.jp
-daigo.ibaraki.jp
-fujishiro.ibaraki.jp
-hitachi.ibaraki.jp
-hitachinaka.ibaraki.jp
-hitachiomiya.ibaraki.jp
-hitachiota.ibaraki.jp
-ibaraki.ibaraki.jp
-ina.ibaraki.jp
-inashiki.ibaraki.jp
-itako.ibaraki.jp
-iwama.ibaraki.jp
-joso.ibaraki.jp
-kamisu.ibaraki.jp
-kasama.ibaraki.jp
-kashima.ibaraki.jp
-kasumigaura.ibaraki.jp
-koga.ibaraki.jp
-miho.ibaraki.jp
-mito.ibaraki.jp
-moriya.ibaraki.jp
-naka.ibaraki.jp
-namegata.ibaraki.jp
-oarai.ibaraki.jp
-ogawa.ibaraki.jp
-omitama.ibaraki.jp
-ryugasaki.ibaraki.jp
-sakai.ibaraki.jp
-sakuragawa.ibaraki.jp
-shimodate.ibaraki.jp
-shimotsuma.ibaraki.jp
-shirosato.ibaraki.jp
-sowa.ibaraki.jp
-suifu.ibaraki.jp
-takahagi.ibaraki.jp
-tamatsukuri.ibaraki.jp
-tokai.ibaraki.jp
-tomobe.ibaraki.jp
-tone.ibaraki.jp
-toride.ibaraki.jp
-tsuchiura.ibaraki.jp
-tsukuba.ibaraki.jp
-uchihara.ibaraki.jp
-ushiku.ibaraki.jp
-yachiyo.ibaraki.jp
-yamagata.ibaraki.jp
-yawara.ibaraki.jp
-yuki.ibaraki.jp
-anamizu.ishikawa.jp
-hakui.ishikawa.jp
-hakusan.ishikawa.jp
-kaga.ishikawa.jp
-kahoku.ishikawa.jp
-kanazawa.ishikawa.jp
-kawakita.ishikawa.jp
-komatsu.ishikawa.jp
-nakanoto.ishikawa.jp
-nanao.ishikawa.jp
-nomi.ishikawa.jp
-nonoichi.ishikawa.jp
-noto.ishikawa.jp
-shika.ishikawa.jp
-suzu.ishikawa.jp
-tsubata.ishikawa.jp
-tsurugi.ishikawa.jp
-uchinada.ishikawa.jp
-wajima.ishikawa.jp
-fudai.iwate.jp
-fujisawa.iwate.jp
-hanamaki.iwate.jp
-hiraizumi.iwate.jp
-hirono.iwate.jp
-ichinohe.iwate.jp
-ichinoseki.iwate.jp
-iwaizumi.iwate.jp
-iwate.iwate.jp
-joboji.iwate.jp
-kamaishi.iwate.jp
-kanegasaki.iwate.jp
-karumai.iwate.jp
-kawai.iwate.jp
-kitakami.iwate.jp
-kuji.iwate.jp
-kunohe.iwate.jp
-kuzumaki.iwate.jp
-miyako.iwate.jp
-mizusawa.iwate.jp
-morioka.iwate.jp
-ninohe.iwate.jp
-noda.iwate.jp
-ofunato.iwate.jp
-oshu.iwate.jp
-otsuchi.iwate.jp
-rikuzentakata.iwate.jp
-shiwa.iwate.jp
-shizukuishi.iwate.jp
-sumita.iwate.jp
-tanohata.iwate.jp
-tono.iwate.jp
-yahaba.iwate.jp
-yamada.iwate.jp
-ayagawa.kagawa.jp
-higashikagawa.kagawa.jp
-kanonji.kagawa.jp
-kotohira.kagawa.jp
-manno.kagawa.jp
-marugame.kagawa.jp
-mitoyo.kagawa.jp
-naoshima.kagawa.jp
-sanuki.kagawa.jp
-tadotsu.kagawa.jp
-takamatsu.kagawa.jp
-tonosho.kagawa.jp
-uchinomi.kagawa.jp
-utazu.kagawa.jp
-zentsuji.kagawa.jp
-akune.kagoshima.jp
-amami.kagoshima.jp
-hioki.kagoshima.jp
-isa.kagoshima.jp
-isen.kagoshima.jp
-izumi.kagoshima.jp
-kagoshima.kagoshima.jp
-kanoya.kagoshima.jp
-kawanabe.kagoshima.jp
-kinko.kagoshima.jp
-kouyama.kagoshima.jp
-makurazaki.kagoshima.jp
-matsumoto.kagoshima.jp
-minamitane.kagoshima.jp
-nakatane.kagoshima.jp
-nishinoomote.kagoshima.jp
-satsumasendai.kagoshima.jp
-soo.kagoshima.jp
-tarumizu.kagoshima.jp
-yusui.kagoshima.jp
-aikawa.kanagawa.jp
-atsugi.kanagawa.jp
-ayase.kanagawa.jp
-chigasaki.kanagawa.jp
-ebina.kanagawa.jp
-fujisawa.kanagawa.jp
-hadano.kanagawa.jp
-hakone.kanagawa.jp
-hiratsuka.kanagawa.jp
-isehara.kanagawa.jp
-kaisei.kanagawa.jp
-kamakura.kanagawa.jp
-kiyokawa.kanagawa.jp
-matsuda.kanagawa.jp
-minamiashigara.kanagawa.jp
-miura.kanagawa.jp
-nakai.kanagawa.jp
-ninomiya.kanagawa.jp
-odawara.kanagawa.jp
-oi.kanagawa.jp
-oiso.kanagawa.jp
-sagamihara.kanagawa.jp
-samukawa.kanagawa.jp
-tsukui.kanagawa.jp
-yamakita.kanagawa.jp
-yamato.kanagawa.jp
-yokosuka.kanagawa.jp
-yugawara.kanagawa.jp
-zama.kanagawa.jp
-zushi.kanagawa.jp
-aki.kochi.jp
-geisei.kochi.jp
-hidaka.kochi.jp
-higashitsuno.kochi.jp
-ino.kochi.jp
-kagami.kochi.jp
-kami.kochi.jp
-kitagawa.kochi.jp
-kochi.kochi.jp
-mihara.kochi.jp
-motoyama.kochi.jp
-muroto.kochi.jp
-nahari.kochi.jp
-nakamura.kochi.jp
-nankoku.kochi.jp
-nishitosa.kochi.jp
-niyodogawa.kochi.jp
-ochi.kochi.jp
-okawa.kochi.jp
-otoyo.kochi.jp
-otsuki.kochi.jp
-sakawa.kochi.jp
-sukumo.kochi.jp
-susaki.kochi.jp
-tosa.kochi.jp
-tosashimizu.kochi.jp
-toyo.kochi.jp
-tsuno.kochi.jp
-umaji.kochi.jp
-yasuda.kochi.jp
-yusuhara.kochi.jp
-amakusa.kumamoto.jp
-arao.kumamoto.jp
-aso.kumamoto.jp
-choyo.kumamoto.jp
-gyokuto.kumamoto.jp
-hitoyoshi.kumamoto.jp
-kamiamakusa.kumamoto.jp
-kashima.kumamoto.jp
-kikuchi.kumamoto.jp
-kosa.kumamoto.jp
-kumamoto.kumamoto.jp
-mashiki.kumamoto.jp
-mifune.kumamoto.jp
-minamata.kumamoto.jp
-minamioguni.kumamoto.jp
-nagasu.kumamoto.jp
-nishihara.kumamoto.jp
-oguni.kumamoto.jp
-ozu.kumamoto.jp
-sumoto.kumamoto.jp
-takamori.kumamoto.jp
-uki.kumamoto.jp
-uto.kumamoto.jp
-yamaga.kumamoto.jp
-yamato.kumamoto.jp
-yatsushiro.kumamoto.jp
-ayabe.kyoto.jp
-fukuchiyama.kyoto.jp
-higashiyama.kyoto.jp
-ide.kyoto.jp
-ine.kyoto.jp
-joyo.kyoto.jp
-kameoka.kyoto.jp
-kamo.kyoto.jp
-kita.kyoto.jp
-kizu.kyoto.jp
-kumiyama.kyoto.jp
-kyotamba.kyoto.jp
-kyotanabe.kyoto.jp
-kyotango.kyoto.jp
-maizuru.kyoto.jp
-minami.kyoto.jp
-minamiyamashiro.kyoto.jp
-miyazu.kyoto.jp
-muko.kyoto.jp
-nagaokakyo.kyoto.jp
-nakagyo.kyoto.jp
-nantan.kyoto.jp
-oyamazaki.kyoto.jp
-sakyo.kyoto.jp
-seika.kyoto.jp
-tanabe.kyoto.jp
-uji.kyoto.jp
-ujitawara.kyoto.jp
-wazuka.kyoto.jp
-yamashina.kyoto.jp
-yawata.kyoto.jp
-asahi.mie.jp
-inabe.mie.jp
-ise.mie.jp
-kameyama.mie.jp
-kawagoe.mie.jp
-kiho.mie.jp
-kisosaki.mie.jp
-kiwa.mie.jp
-komono.mie.jp
-kumano.mie.jp
-kuwana.mie.jp
-matsusaka.mie.jp
-meiwa.mie.jp
-mihama.mie.jp
-minamiise.mie.jp
-misugi.mie.jp
-miyama.mie.jp
-nabari.mie.jp
-shima.mie.jp
-suzuka.mie.jp
-tado.mie.jp
-taiki.mie.jp
-taki.mie.jp
-tamaki.mie.jp
-toba.mie.jp
-tsu.mie.jp
-udono.mie.jp
-ureshino.mie.jp
-watarai.mie.jp
-yokkaichi.mie.jp
-furukawa.miyagi.jp
-higashimatsushima.miyagi.jp
-ishinomaki.miyagi.jp
-iwanuma.miyagi.jp
-kakuda.miyagi.jp
-kami.miyagi.jp
-kawasaki.miyagi.jp
-kesennuma.miyagi.jp
-marumori.miyagi.jp
-matsushima.miyagi.jp
-minamisanriku.miyagi.jp
-misato.miyagi.jp
-murata.miyagi.jp
-natori.miyagi.jp
-ogawara.miyagi.jp
-ohira.miyagi.jp
-onagawa.miyagi.jp
-osaki.miyagi.jp
-rifu.miyagi.jp
-semine.miyagi.jp
-shibata.miyagi.jp
-shichikashuku.miyagi.jp
-shikama.miyagi.jp
-shiogama.miyagi.jp
-shiroishi.miyagi.jp
-tagajo.miyagi.jp
-taiwa.miyagi.jp
-tome.miyagi.jp
-tomiya.miyagi.jp
-wakuya.miyagi.jp
-watari.miyagi.jp
-yamamoto.miyagi.jp
-zao.miyagi.jp
-aya.miyazaki.jp
-ebino.miyazaki.jp
-gokase.miyazaki.jp
-hyuga.miyazaki.jp
-kadogawa.miyazaki.jp
-kawaminami.miyazaki.jp
-kijo.miyazaki.jp
-kitagawa.miyazaki.jp
-kitakata.miyazaki.jp
-kitaura.miyazaki.jp
-kobayashi.miyazaki.jp
-kunitomi.miyazaki.jp
-kushima.miyazaki.jp
-mimata.miyazaki.jp
-miyakonojo.miyazaki.jp
-miyazaki.miyazaki.jp
-morotsuka.miyazaki.jp
-nichinan.miyazaki.jp
-nishimera.miyazaki.jp
-nobeoka.miyazaki.jp
-saito.miyazaki.jp
-shiiba.miyazaki.jp
-shintomi.miyazaki.jp
-takaharu.miyazaki.jp
-takanabe.miyazaki.jp
-takazaki.miyazaki.jp
-tsuno.miyazaki.jp
-achi.nagano.jp
-agematsu.nagano.jp
-anan.nagano.jp
-aoki.nagano.jp
-asahi.nagano.jp
-azumino.nagano.jp
-chikuhoku.nagano.jp
-chikuma.nagano.jp
-chino.nagano.jp
-fujimi.nagano.jp
-hakuba.nagano.jp
-hara.nagano.jp
-hiraya.nagano.jp
-iida.nagano.jp
-iijima.nagano.jp
-iiyama.nagano.jp
-iizuna.nagano.jp
-ikeda.nagano.jp
-ikusaka.nagano.jp
-ina.nagano.jp
-karuizawa.nagano.jp
-kawakami.nagano.jp
-kiso.nagano.jp
-kisofukushima.nagano.jp
-kitaaiki.nagano.jp
-komagane.nagano.jp
-komoro.nagano.jp
-matsukawa.nagano.jp
-matsumoto.nagano.jp
-miasa.nagano.jp
-minamiaiki.nagano.jp
-minamimaki.nagano.jp
-minamiminowa.nagano.jp
-minowa.nagano.jp
-miyada.nagano.jp
-miyota.nagano.jp
-mochizuki.nagano.jp
-nagano.nagano.jp
-nagawa.nagano.jp
-nagiso.nagano.jp
-nakagawa.nagano.jp
-nakano.nagano.jp
-nozawaonsen.nagano.jp
-obuse.nagano.jp
-ogawa.nagano.jp
-okaya.nagano.jp
-omachi.nagano.jp
-omi.nagano.jp
-ookuwa.nagano.jp
-ooshika.nagano.jp
-otaki.nagano.jp
-otari.nagano.jp
-sakae.nagano.jp
-sakaki.nagano.jp
-saku.nagano.jp
-sakuho.nagano.jp
-shimosuwa.nagano.jp
-shinanomachi.nagano.jp
-shiojiri.nagano.jp
-suwa.nagano.jp
-suzaka.nagano.jp
-takagi.nagano.jp
-takamori.nagano.jp
-takayama.nagano.jp
-tateshina.nagano.jp
-tatsuno.nagano.jp
-togakushi.nagano.jp
-togura.nagano.jp
-tomi.nagano.jp
-ueda.nagano.jp
-wada.nagano.jp
-yamagata.nagano.jp
-yamanouchi.nagano.jp
-yasaka.nagano.jp
-yasuoka.nagano.jp
-chijiwa.nagasaki.jp
-futsu.nagasaki.jp
-goto.nagasaki.jp
-hasami.nagasaki.jp
-hirado.nagasaki.jp
-iki.nagasaki.jp
-isahaya.nagasaki.jp
-kawatana.nagasaki.jp
-kuchinotsu.nagasaki.jp
-matsuura.nagasaki.jp
-nagasaki.nagasaki.jp
-obama.nagasaki.jp
-omura.nagasaki.jp
-oseto.nagasaki.jp
-saikai.nagasaki.jp
-sasebo.nagasaki.jp
-seihi.nagasaki.jp
-shimabara.nagasaki.jp
-shinkamigoto.nagasaki.jp
-togitsu.nagasaki.jp
-tsushima.nagasaki.jp
-unzen.nagasaki.jp
-ando.nara.jp
-gose.nara.jp
-heguri.nara.jp
-higashiyoshino.nara.jp
-ikaruga.nara.jp
-ikoma.nara.jp
-kamikitayama.nara.jp
-kanmaki.nara.jp
-kashiba.nara.jp
-kashihara.nara.jp
-katsuragi.nara.jp
-kawai.nara.jp
-kawakami.nara.jp
-kawanishi.nara.jp
-koryo.nara.jp
-kurotaki.nara.jp
-mitsue.nara.jp
-miyake.nara.jp
-nara.nara.jp
-nosegawa.nara.jp
-oji.nara.jp
-ouda.nara.jp
-oyodo.nara.jp
-sakurai.nara.jp
-sango.nara.jp
-shimoichi.nara.jp
-shimokitayama.nara.jp
-shinjo.nara.jp
-soni.nara.jp
-takatori.nara.jp
-tawaramoto.nara.jp
-tenkawa.nara.jp
-tenri.nara.jp
-uda.nara.jp
-yamatokoriyama.nara.jp
-yamatotakada.nara.jp
-yamazoe.nara.jp
-yoshino.nara.jp
-aga.niigata.jp
-agano.niigata.jp
-gosen.niigata.jp
-itoigawa.niigata.jp
-izumozaki.niigata.jp
-joetsu.niigata.jp
-kamo.niigata.jp
-kariwa.niigata.jp
-kashiwazaki.niigata.jp
-minamiuonuma.niigata.jp
-mitsuke.niigata.jp
-muika.niigata.jp
-murakami.niigata.jp
-myoko.niigata.jp
-nagaoka.niigata.jp
-niigata.niigata.jp
-ojiya.niigata.jp
-omi.niigata.jp
-sado.niigata.jp
-sanjo.niigata.jp
-seiro.niigata.jp
-seirou.niigata.jp
-sekikawa.niigata.jp
-shibata.niigata.jp
-tagami.niigata.jp
-tainai.niigata.jp
-tochio.niigata.jp
-tokamachi.niigata.jp
-tsubame.niigata.jp
-tsunan.niigata.jp
-uonuma.niigata.jp
-yahiko.niigata.jp
-yoita.niigata.jp
-yuzawa.niigata.jp
-beppu.oita.jp
-bungoono.oita.jp
-bungotakada.oita.jp
-hasama.oita.jp
-hiji.oita.jp
-himeshima.oita.jp
-hita.oita.jp
-kamitsue.oita.jp
-kokonoe.oita.jp
-kuju.oita.jp
-kunisaki.oita.jp
-kusu.oita.jp
-oita.oita.jp
-saiki.oita.jp
-taketa.oita.jp
-tsukumi.oita.jp
-usa.oita.jp
-usuki.oita.jp
-yufu.oita.jp
-akaiwa.okayama.jp
-asakuchi.okayama.jp
-bizen.okayama.jp
-hayashima.okayama.jp
-ibara.okayama.jp
-kagamino.okayama.jp
-kasaoka.okayama.jp
-kibichuo.okayama.jp
-kumenan.okayama.jp
-kurashiki.okayama.jp
-maniwa.okayama.jp
-misaki.okayama.jp
-nagi.okayama.jp
-niimi.okayama.jp
-nishiawakura.okayama.jp
-okayama.okayama.jp
-satosho.okayama.jp
-setouchi.okayama.jp
-shinjo.okayama.jp
-shoo.okayama.jp
-soja.okayama.jp
-takahashi.okayama.jp
-tamano.okayama.jp
-tsuyama.okayama.jp
-wake.okayama.jp
-yakage.okayama.jp
-aguni.okinawa.jp
-ginowan.okinawa.jp
-ginoza.okinawa.jp
-gushikami.okinawa.jp
-haebaru.okinawa.jp
-higashi.okinawa.jp
-hirara.okinawa.jp
-iheya.okinawa.jp
-ishigaki.okinawa.jp
-ishikawa.okinawa.jp
-itoman.okinawa.jp
-izena.okinawa.jp
-kadena.okinawa.jp
-kin.okinawa.jp
-kitadaito.okinawa.jp
-kitanakagusuku.okinawa.jp
-kumejima.okinawa.jp
-kunigami.okinawa.jp
-minamidaito.okinawa.jp
-motobu.okinawa.jp
-nago.okinawa.jp
-naha.okinawa.jp
-nakagusuku.okinawa.jp
-nakijin.okinawa.jp
-nanjo.okinawa.jp
-nishihara.okinawa.jp
-ogimi.okinawa.jp
-okinawa.okinawa.jp
-onna.okinawa.jp
-shimoji.okinawa.jp
-taketomi.okinawa.jp
-tarama.okinawa.jp
-tokashiki.okinawa.jp
-tomigusuku.okinawa.jp
-tonaki.okinawa.jp
-urasoe.okinawa.jp
-uruma.okinawa.jp
-yaese.okinawa.jp
-yomitan.okinawa.jp
-yonabaru.okinawa.jp
-yonaguni.okinawa.jp
-zamami.okinawa.jp
-abeno.osaka.jp
-chihayaakasaka.osaka.jp
-chuo.osaka.jp
-daito.osaka.jp
-fujiidera.osaka.jp
-habikino.osaka.jp
-hannan.osaka.jp
-higashiosaka.osaka.jp
-higashisumiyoshi.osaka.jp
-higashiyodogawa.osaka.jp
-hirakata.osaka.jp
-ibaraki.osaka.jp
-ikeda.osaka.jp
-izumi.osaka.jp
-izumiotsu.osaka.jp
-izumisano.osaka.jp
-kadoma.osaka.jp
-kaizuka.osaka.jp
-kanan.osaka.jp
-kashiwara.osaka.jp
-katano.osaka.jp
-kawachinagano.osaka.jp
-kishiwada.osaka.jp
-kita.osaka.jp
-kumatori.osaka.jp
-matsubara.osaka.jp
-minato.osaka.jp
-minoh.osaka.jp
-misaki.osaka.jp
-moriguchi.osaka.jp
-neyagawa.osaka.jp
-nishi.osaka.jp
-nose.osaka.jp
-osakasayama.osaka.jp
-sakai.osaka.jp
-sayama.osaka.jp
-sennan.osaka.jp
-settsu.osaka.jp
-shijonawate.osaka.jp
-shimamoto.osaka.jp
-suita.osaka.jp
-tadaoka.osaka.jp
-taishi.osaka.jp
-tajiri.osaka.jp
-takaishi.osaka.jp
-takatsuki.osaka.jp
-tondabayashi.osaka.jp
-toyonaka.osaka.jp
-toyono.osaka.jp
-yao.osaka.jp
-ariake.saga.jp
-arita.saga.jp
-fukudomi.saga.jp
-genkai.saga.jp
-hamatama.saga.jp
-hizen.saga.jp
-imari.saga.jp
-kamimine.saga.jp
-kanzaki.saga.jp
-karatsu.saga.jp
-kashima.saga.jp
-kitagata.saga.jp
-kitahata.saga.jp
-kiyama.saga.jp
-kouhoku.saga.jp
-kyuragi.saga.jp
-nishiarita.saga.jp
-ogi.saga.jp
-omachi.saga.jp
-ouchi.saga.jp
-saga.saga.jp
-shiroishi.saga.jp
-taku.saga.jp
-tara.saga.jp
-tosu.saga.jp
-yoshinogari.saga.jp
-arakawa.saitama.jp
-asaka.saitama.jp
-chichibu.saitama.jp
-fujimi.saitama.jp
-fujimino.saitama.jp
-fukaya.saitama.jp
-hanno.saitama.jp
-hanyu.saitama.jp
-hasuda.saitama.jp
-hatogaya.saitama.jp
-hatoyama.saitama.jp
-hidaka.saitama.jp
-higashichichibu.saitama.jp
-higashimatsuyama.saitama.jp
-honjo.saitama.jp
-ina.saitama.jp
-iruma.saitama.jp
-iwatsuki.saitama.jp
-kamiizumi.saitama.jp
-kamikawa.saitama.jp
-kamisato.saitama.jp
-kasukabe.saitama.jp
-kawagoe.saitama.jp
-kawaguchi.saitama.jp
-kawajima.saitama.jp
-kazo.saitama.jp
-kitamoto.saitama.jp
-koshigaya.saitama.jp
-kounosu.saitama.jp
-kuki.saitama.jp
-kumagaya.saitama.jp
-matsubushi.saitama.jp
-minano.saitama.jp
-misato.saitama.jp
-miyashiro.saitama.jp
-miyoshi.saitama.jp
-moroyama.saitama.jp
-nagatoro.saitama.jp
-namegawa.saitama.jp
-niiza.saitama.jp
-ogano.saitama.jp
-ogawa.saitama.jp
-ogose.saitama.jp
-okegawa.saitama.jp
-omiya.saitama.jp
-otaki.saitama.jp
-ranzan.saitama.jp
-ryokami.saitama.jp
-saitama.saitama.jp
-sakado.saitama.jp
-satte.saitama.jp
-sayama.saitama.jp
-shiki.saitama.jp
-shiraoka.saitama.jp
-soka.saitama.jp
-sugito.saitama.jp
-toda.saitama.jp
-tokigawa.saitama.jp
-tokorozawa.saitama.jp
-tsurugashima.saitama.jp
-urawa.saitama.jp
-warabi.saitama.jp
-yashio.saitama.jp
-yokoze.saitama.jp
-yono.saitama.jp
-yorii.saitama.jp
-yoshida.saitama.jp
-yoshikawa.saitama.jp
-yoshimi.saitama.jp
-aisho.shiga.jp
-gamo.shiga.jp
-higashiomi.shiga.jp
-hikone.shiga.jp
-koka.shiga.jp
-konan.shiga.jp
-kosei.shiga.jp
-koto.shiga.jp
-kusatsu.shiga.jp
-maibara.shiga.jp
-moriyama.shiga.jp
-nagahama.shiga.jp
-nishiazai.shiga.jp
-notogawa.shiga.jp
-omihachiman.shiga.jp
-otsu.shiga.jp
-ritto.shiga.jp
-ryuoh.shiga.jp
-takashima.shiga.jp
-takatsuki.shiga.jp
-torahime.shiga.jp
-toyosato.shiga.jp
-yasu.shiga.jp
-akagi.shimane.jp
-ama.shimane.jp
-gotsu.shimane.jp
-hamada.shimane.jp
-higashiizumo.shimane.jp
-hikawa.shimane.jp
-hikimi.shimane.jp
-izumo.shimane.jp
-kakinoki.shimane.jp
-masuda.shimane.jp
-matsue.shimane.jp
-misato.shimane.jp
-nishinoshima.shimane.jp
-ohda.shimane.jp
-okinoshima.shimane.jp
-okuizumo.shimane.jp
-shimane.shimane.jp
-tamayu.shimane.jp
-tsuwano.shimane.jp
-unnan.shimane.jp
-yakumo.shimane.jp
-yasugi.shimane.jp
-yatsuka.shimane.jp
-arai.shizuoka.jp
-atami.shizuoka.jp
-fuji.shizuoka.jp
-fujieda.shizuoka.jp
-fujikawa.shizuoka.jp
-fujinomiya.shizuoka.jp
-fukuroi.shizuoka.jp
-gotemba.shizuoka.jp
-haibara.shizuoka.jp
-hamamatsu.shizuoka.jp
-higashiizu.shizuoka.jp
-ito.shizuoka.jp
-iwata.shizuoka.jp
-izu.shizuoka.jp
-izunokuni.shizuoka.jp
-kakegawa.shizuoka.jp
-kannami.shizuoka.jp
-kawanehon.shizuoka.jp
-kawazu.shizuoka.jp
-kikugawa.shizuoka.jp
-kosai.shizuoka.jp
-makinohara.shizuoka.jp
-matsuzaki.shizuoka.jp
-minamiizu.shizuoka.jp
-mishima.shizuoka.jp
-morimachi.shizuoka.jp
-nishiizu.shizuoka.jp
-numazu.shizuoka.jp
-omaezaki.shizuoka.jp
-shimada.shizuoka.jp
-shimizu.shizuoka.jp
-shimoda.shizuoka.jp
-shizuoka.shizuoka.jp
-susono.shizuoka.jp
-yaizu.shizuoka.jp
-yoshida.shizuoka.jp
-ashikaga.tochigi.jp
-bato.tochigi.jp
-haga.tochigi.jp
-ichikai.tochigi.jp
-iwafune.tochigi.jp
-kaminokawa.tochigi.jp
-kanuma.tochigi.jp
-karasuyama.tochigi.jp
-kuroiso.tochigi.jp
-mashiko.tochigi.jp
-mibu.tochigi.jp
-moka.tochigi.jp
-motegi.tochigi.jp
-nasu.tochigi.jp
-nasushiobara.tochigi.jp
-nikko.tochigi.jp
-nishikata.tochigi.jp
-nogi.tochigi.jp
-ohira.tochigi.jp
-ohtawara.tochigi.jp
-oyama.tochigi.jp
-sakura.tochigi.jp
-sano.tochigi.jp
-shimotsuke.tochigi.jp
-shioya.tochigi.jp
-takanezawa.tochigi.jp
-tochigi.tochigi.jp
-tsuga.tochigi.jp
-ujiie.tochigi.jp
-utsunomiya.tochigi.jp
-yaita.tochigi.jp
-aizumi.tokushima.jp
-anan.tokushima.jp
-ichiba.tokushima.jp
-itano.tokushima.jp
-kainan.tokushima.jp
-komatsushima.tokushima.jp
-matsushige.tokushima.jp
-mima.tokushima.jp
-minami.tokushima.jp
-miyoshi.tokushima.jp
-mugi.tokushima.jp
-nakagawa.tokushima.jp
-naruto.tokushima.jp
-sanagochi.tokushima.jp
-shishikui.tokushima.jp
-tokushima.tokushima.jp
-wajiki.tokushima.jp
-adachi.tokyo.jp
-akiruno.tokyo.jp
-akishima.tokyo.jp
-aogashima.tokyo.jp
-arakawa.tokyo.jp
-bunkyo.tokyo.jp
-chiyoda.tokyo.jp
-chofu.tokyo.jp
-chuo.tokyo.jp
-edogawa.tokyo.jp
-fuchu.tokyo.jp
-fussa.tokyo.jp
-hachijo.tokyo.jp
-hachioji.tokyo.jp
-hamura.tokyo.jp
-higashikurume.tokyo.jp
-higashimurayama.tokyo.jp
-higashiyamato.tokyo.jp
-hino.tokyo.jp
-hinode.tokyo.jp
-hinohara.tokyo.jp
-inagi.tokyo.jp
-itabashi.tokyo.jp
-katsushika.tokyo.jp
-kita.tokyo.jp
-kiyose.tokyo.jp
-kodaira.tokyo.jp
-koganei.tokyo.jp
-kokubunji.tokyo.jp
-komae.tokyo.jp
-koto.tokyo.jp
-kouzushima.tokyo.jp
-kunitachi.tokyo.jp
-machida.tokyo.jp
-meguro.tokyo.jp
-minato.tokyo.jp
-mitaka.tokyo.jp
-mizuho.tokyo.jp
-musashimurayama.tokyo.jp
-musashino.tokyo.jp
-nakano.tokyo.jp
-nerima.tokyo.jp
-ogasawara.tokyo.jp
-okutama.tokyo.jp
-ome.tokyo.jp
-oshima.tokyo.jp
-ota.tokyo.jp
-setagaya.tokyo.jp
-shibuya.tokyo.jp
-shinagawa.tokyo.jp
-shinjuku.tokyo.jp
-suginami.tokyo.jp
-sumida.tokyo.jp
-tachikawa.tokyo.jp
-taito.tokyo.jp
-tama.tokyo.jp
-toshima.tokyo.jp
-chizu.tottori.jp
-hino.tottori.jp
-kawahara.tottori.jp
-koge.tottori.jp
-kotoura.tottori.jp
-misasa.tottori.jp
-nanbu.tottori.jp
-nichinan.tottori.jp
-sakaiminato.tottori.jp
-tottori.tottori.jp
-wakasa.tottori.jp
-yazu.tottori.jp
-yonago.tottori.jp
-asahi.toyama.jp
-fuchu.toyama.jp
-fukumitsu.toyama.jp
-funahashi.toyama.jp
-himi.toyama.jp
-imizu.toyama.jp
-inami.toyama.jp
-johana.toyama.jp
-kamiichi.toyama.jp
-kurobe.toyama.jp
-nakaniikawa.toyama.jp
-namerikawa.toyama.jp
-nanto.toyama.jp
-nyuzen.toyama.jp
-oyabe.toyama.jp
-taira.toyama.jp
-takaoka.toyama.jp
-tateyama.toyama.jp
-toga.toyama.jp
-tonami.toyama.jp
-toyama.toyama.jp
-unazuki.toyama.jp
-uozu.toyama.jp
-yamada.toyama.jp
-arida.wakayama.jp
-aridagawa.wakayama.jp
-gobo.wakayama.jp
-hashimoto.wakayama.jp
-hidaka.wakayama.jp
-hirogawa.wakayama.jp
-inami.wakayama.jp
-iwade.wakayama.jp
-kainan.wakayama.jp
-kamitonda.wakayama.jp
-katsuragi.wakayama.jp
-kimino.wakayama.jp
-kinokawa.wakayama.jp
-kitayama.wakayama.jp
-koya.wakayama.jp
-koza.wakayama.jp
-kozagawa.wakayama.jp
-kudoyama.wakayama.jp
-kushimoto.wakayama.jp
-mihama.wakayama.jp
-misato.wakayama.jp
-nachikatsuura.wakayama.jp
-shingu.wakayama.jp
-shirahama.wakayama.jp
-taiji.wakayama.jp
-tanabe.wakayama.jp
-wakayama.wakayama.jp
-yuasa.wakayama.jp
-yura.wakayama.jp
-asahi.yamagata.jp
-funagata.yamagata.jp
-higashine.yamagata.jp
-iide.yamagata.jp
-kahoku.yamagata.jp
-kaminoyama.yamagata.jp
-kaneyama.yamagata.jp
-kawanishi.yamagata.jp
-mamurogawa.yamagata.jp
-mikawa.yamagata.jp
-murayama.yamagata.jp
-nagai.yamagata.jp
-nakayama.yamagata.jp
-nanyo.yamagata.jp
-nishikawa.yamagata.jp
-obanazawa.yamagata.jp
-oe.yamagata.jp
-oguni.yamagata.jp
-ohkura.yamagata.jp
-oishida.yamagata.jp
-sagae.yamagata.jp
-sakata.yamagata.jp
-sakegawa.yamagata.jp
-shinjo.yamagata.jp
-shirataka.yamagata.jp
-shonai.yamagata.jp
-takahata.yamagata.jp
-tendo.yamagata.jp
-tozawa.yamagata.jp
-tsuruoka.yamagata.jp
-yamagata.yamagata.jp
-yamanobe.yamagata.jp
-yonezawa.yamagata.jp
-yuza.yamagata.jp
-abu.yamaguchi.jp
-hagi.yamaguchi.jp
-hikari.yamaguchi.jp
-hofu.yamaguchi.jp
-iwakuni.yamaguchi.jp
-kudamatsu.yamaguchi.jp
-mitou.yamaguchi.jp
-nagato.yamaguchi.jp
-oshima.yamaguchi.jp
-shimonoseki.yamaguchi.jp
-shunan.yamaguchi.jp
-tabuse.yamaguchi.jp
-tokuyama.yamaguchi.jp
-toyota.yamaguchi.jp
-ube.yamaguchi.jp
-yuu.yamaguchi.jp
-chuo.yamanashi.jp
-doshi.yamanashi.jp
-fuefuki.yamanashi.jp
-fujikawa.yamanashi.jp
-fujikawaguchiko.yamanashi.jp
-fujiyoshida.yamanashi.jp
-hayakawa.yamanashi.jp
-hokuto.yamanashi.jp
-ichikawamisato.yamanashi.jp
-kai.yamanashi.jp
-kofu.yamanashi.jp
-koshu.yamanashi.jp
-kosuge.yamanashi.jp
-minami-alps.yamanashi.jp
-minobu.yamanashi.jp
-nakamichi.yamanashi.jp
-nanbu.yamanashi.jp
-narusawa.yamanashi.jp
-nirasaki.yamanashi.jp
-nishikatsura.yamanashi.jp
-oshino.yamanashi.jp
-otsuki.yamanashi.jp
-showa.yamanashi.jp
-tabayama.yamanashi.jp
-tsuru.yamanashi.jp
-uenohara.yamanashi.jp
-yamanakako.yamanashi.jp
-yamanashi.yamanashi.jp
-
-// ke : http://www.kenic.or.ke/index.php?option=com_content&task=view&id=117&Itemid=145
-*.ke
-
-// kg : http://www.domain.kg/dmn_n.html
-kg
-org.kg
-net.kg
-com.kg
-edu.kg
-gov.kg
-mil.kg
-
-// kh : http://www.mptc.gov.kh/dns_registration.htm
-*.kh
-
-// ki : http://www.ki/dns/index.html
-ki
-edu.ki
-biz.ki
-net.ki
-org.ki
-gov.ki
-info.ki
-com.ki
-
-// km : http://en.wikipedia.org/wiki/.km
-// http://www.domaine.km/documents/charte.doc
-km
-org.km
-nom.km
-gov.km
-prd.km
-tm.km
-edu.km
-mil.km
-ass.km
-com.km
-// These are only mentioned as proposed suggestions at domaine.km, but
-// http://en.wikipedia.org/wiki/.km says they're available for registration:
-coop.km
-asso.km
-presse.km
-medecin.km
-notaires.km
-pharmaciens.km
-veterinaire.km
-gouv.km
-
-// kn : http://en.wikipedia.org/wiki/.kn
-// http://www.dot.kn/domainRules.html
-kn
-net.kn
-org.kn
-edu.kn
-gov.kn
-
-// kp : http://www.kcce.kp/en_index.php
-kp
-com.kp
-edu.kp
-gov.kp
-org.kp
-rep.kp
-tra.kp
-
-// kr : http://en.wikipedia.org/wiki/.kr
-// see also: http://domain.nida.or.kr/eng/registration.jsp
-kr
-ac.kr
-co.kr
-es.kr
-go.kr
-hs.kr
-kg.kr
-mil.kr
-ms.kr
-ne.kr
-or.kr
-pe.kr
-re.kr
-sc.kr
-// kr geographical names
-busan.kr
-chungbuk.kr
-chungnam.kr
-daegu.kr
-daejeon.kr
-gangwon.kr
-gwangju.kr
-gyeongbuk.kr
-gyeonggi.kr
-gyeongnam.kr
-incheon.kr
-jeju.kr
-jeonbuk.kr
-jeonnam.kr
-seoul.kr
-ulsan.kr
-
-// kw : http://en.wikipedia.org/wiki/.kw
-*.kw
-
-// ky : http://www.icta.ky/da_ky_reg_dom.php
-// Confirmed by registry <ky...@perimeterusa.com> 2008-06-17
-ky
-edu.ky
-gov.ky
-com.ky
-org.ky
-net.ky
-
-// kz : http://en.wikipedia.org/wiki/.kz
-// see also: http://www.nic.kz/rules/index.jsp
-kz
-org.kz
-edu.kz
-net.kz
-gov.kz
-mil.kz
-com.kz
-
-// la : http://en.wikipedia.org/wiki/.la
-// Submitted by registry <ga...@nic.la> 2008-06-10
-la
-int.la
-net.la
-info.la
-edu.la
-gov.la
-per.la
-com.la
-org.la
-
-// lb : http://en.wikipedia.org/wiki/.lb
-// Submitted by registry <ra...@psg.com> 2008-06-17
-lb
-com.lb
-edu.lb
-gov.lb
-net.lb
-org.lb
-
-// lc : http://en.wikipedia.org/wiki/.lc
-// see also: http://www.nic.lc/rules.htm
-lc
-com.lc
-net.lc
-co.lc
-org.lc
-edu.lc
-gov.lc
-
-// li : http://en.wikipedia.org/wiki/.li
-li
-
-// lk : http://www.nic.lk/seclevpr.html
-lk
-gov.lk
-sch.lk
-net.lk
-int.lk
-com.lk
-org.lk
-edu.lk
-ngo.lk
-soc.lk
-web.lk
-ltd.lk
-assn.lk
-grp.lk
-hotel.lk
-
-// lr : http://psg.com/dns/lr/lr.txt
-// Submitted by registry <ra...@psg.com> 2008-06-17
-lr
-com.lr
-edu.lr
-gov.lr
-org.lr
-net.lr
-
-// ls : http://en.wikipedia.org/wiki/.ls
-ls
-co.ls
-org.ls
-
-// lt : http://en.wikipedia.org/wiki/.lt
-lt
-// gov.lt : http://www.gov.lt/index_en.php
-gov.lt
-
-// lu : http://www.dns.lu/en/
-lu
-
-// lv : http://www.nic.lv/DNS/En/generic.php
-lv
-com.lv
-edu.lv
-gov.lv
-org.lv
-mil.lv
-id.lv
-net.lv
-asn.lv
-conf.lv
-
-// ly : http://www.nic.ly/regulations.php
-ly
-com.ly
-net.ly
-gov.ly
-plc.ly
-edu.ly
-sch.ly
-med.ly
-org.ly
-id.ly
-
-// ma : http://en.wikipedia.org/wiki/.ma
-// http://www.anrt.ma/fr/admin/download/upload/file_fr782.pdf
-ma
-co.ma
-net.ma
-gov.ma
-org.ma
-ac.ma
-press.ma
-
-// mc : http://www.nic.mc/
-mc
-tm.mc
-asso.mc
-
-// md : http://en.wikipedia.org/wiki/.md
-md
-
-// me : http://en.wikipedia.org/wiki/.me
-me
-co.me
-net.me
-org.me
-edu.me
-ac.me
-gov.me
-its.me
-priv.me
-
-// mg : http://www.nic.mg/tarif.htm
-mg
-org.mg
-nom.mg
-gov.mg
-prd.mg
-tm.mg
-edu.mg
-mil.mg
-com.mg
-
-// mh : http://en.wikipedia.org/wiki/.mh
-mh
-
-// mil : http://en.wikipedia.org/wiki/.mil
-mil
-
-// mk : http://en.wikipedia.org/wiki/.mk
-// see also: http://dns.marnet.net.mk/postapka.php
-mk
-com.mk
-org.mk
-net.mk
-edu.mk
-gov.mk
-inf.mk
-name.mk
-
-// ml : http://www.gobin.info/domainname/ml-template.doc
-// see also: http://en.wikipedia.org/wiki/.ml
-ml
-com.ml
-edu.ml
-gouv.ml
-gov.ml
-net.ml
-org.ml
-presse.ml
-
-// mm : http://en.wikipedia.org/wiki/.mm
-*.mm
-
-// mn : http://en.wikipedia.org/wiki/.mn
-mn
-gov.mn
-edu.mn
-org.mn
-
-// mo : http://www.monic.net.mo/
-mo
-com.mo
-net.mo
-org.mo
-edu.mo
-gov.mo
-
-// mobi : http://en.wikipedia.org/wiki/.mobi
-mobi
-
-// mp : http://www.dot.mp/
-// Confirmed by registry <dc...@saipan.com> 2008-06-17
-mp
-
-// mq : http://en.wikipedia.org/wiki/.mq
-mq
-
-// mr : http://en.wikipedia.org/wiki/.mr
-mr
-gov.mr
-
-// ms : http://www.nic.ms/pdf/MS_Domain_Name_Rules.pdf
-ms
-com.ms
-edu.ms
-gov.ms
-net.ms
-org.ms
-
-// mt : https://www.nic.org.mt/go/policy
-// Submitted by registry <he...@nic.org.mt> 2013-11-19
-mt
-com.mt
-edu.mt
-net.mt
-org.mt
-
-// mu : http://en.wikipedia.org/wiki/.mu
-mu
-com.mu
-net.mu
-org.mu
-gov.mu
-ac.mu
-co.mu
-or.mu
-
-// museum : http://about.museum/naming/
-// http://index.museum/
-museum
-academy.museum
-agriculture.museum
-air.museum
-airguard.museum
-alabama.museum
-alaska.museum
-amber.museum
-ambulance.museum
-american.museum
-americana.museum
-americanantiques.museum
-americanart.museum
-amsterdam.museum
-and.museum
-annefrank.museum
-anthro.museum
-anthropology.museum
-antiques.museum
-aquarium.museum
-arboretum.museum
-archaeological.museum
-archaeology.museum
-architecture.museum
-art.museum
-artanddesign.museum
-artcenter.museum
-artdeco.museum
-arteducation.museum
-artgallery.museum
-arts.museum
-artsandcrafts.museum
-asmatart.museum
-assassination.museum
-assisi.museum
-association.museum
-astronomy.museum
-atlanta.museum
-austin.museum
-australia.museum
-automotive.museum
-aviation.museum
-axis.museum
-badajoz.museum
-baghdad.museum
-bahn.museum
-bale.museum
-baltimore.museum
-barcelona.museum
-baseball.museum
-basel.museum
-baths.museum
-bauern.museum
-beauxarts.museum
-beeldengeluid.museum
-bellevue.museum
-bergbau.museum
-berkeley.museum
-berlin.museum
-bern.museum
-bible.museum
-bilbao.museum
-bill.museum
-birdart.museum
-birthplace.museum
-bonn.museum
-boston.museum
-botanical.museum
-botanicalgarden.museum
-botanicgarden.museum
-botany.museum
-brandywinevalley.museum
-brasil.museum
-bristol.museum
-british.museum
-britishcolumbia.museum
-broadcast.museum
-brunel.museum
-brussel.museum
-brussels.museum
-bruxelles.museum
-building.museum
-burghof.museum
-bus.museum
-bushey.museum
-cadaques.museum
-california.museum
-cambridge.museum
-can.museum
-canada.museum
-capebreton.museum
-carrier.museum
-cartoonart.museum
-casadelamoneda.museum
-castle.museum
-castres.museum
-celtic.museum
-center.museum
-chattanooga.museum
-cheltenham.museum
-chesapeakebay.museum
-chicago.museum
-children.museum
-childrens.museum
-childrensgarden.museum
-chiropractic.museum
-chocolate.museum
-christiansburg.museum
-cincinnati.museum
-cinema.museum
-circus.museum
-civilisation.museum
-civilization.museum
-civilwar.museum
-clinton.museum
-clock.museum
-coal.museum
-coastaldefence.museum
-cody.museum
-coldwar.museum
-collection.museum
-colonialwilliamsburg.museum
-coloradoplateau.museum
-columbia.museum
-columbus.museum
-communication.museum
-communications.museum
-community.museum
-computer.museum
-computerhistory.museum
-comunicações.museum
-contemporary.museum
-contemporaryart.museum
-convent.museum
-copenhagen.museum
-corporation.museum
-correios-e-telecomunicações.museum
-corvette.museum
-costume.museum
-countryestate.museum
-county.museum
-crafts.museum
-cranbrook.museum
-creation.museum
-cultural.museum
-culturalcenter.museum
-culture.museum
-cyber.museum
-cymru.museum
-dali.museum
-dallas.museum
-database.museum
-ddr.museum
-decorativearts.museum
-delaware.museum
-delmenhorst.museum
-denmark.museum
-depot.museum
-design.museum
-detroit.museum
-dinosaur.museum
-discovery.museum
-dolls.museum
-donostia.museum
-durham.museum
-eastafrica.museum
-eastcoast.museum
-education.museum
-educational.museum
-egyptian.museum
-eisenbahn.museum
-elburg.museum
-elvendrell.museum
-embroidery.museum
-encyclopedic.museum
-england.museum
-entomology.museum
-environment.museum
-environmentalconservation.museum
-epilepsy.museum
-essex.museum
-estate.museum
-ethnology.museum
-exeter.museum
-exhibition.museum
-family.museum
-farm.museum
-farmequipment.museum
-farmers.museum
-farmstead.museum
-field.museum
-figueres.museum
-filatelia.museum
-film.museum
-fineart.museum
-finearts.museum
-finland.museum
-flanders.museum
-florida.museum
-force.museum
-fortmissoula.museum
-fortworth.museum
-foundation.museum
-francaise.museum
-frankfurt.museum
-franziskaner.museum
-freemasonry.museum
-freiburg.museum
-fribourg.museum
-frog.museum
-fundacio.museum
-furniture.museum
-gallery.museum
-garden.museum
-gateway.museum
-geelvinck.museum
-gemological.museum
-geology.museum
-georgia.museum
-giessen.museum
-glas.museum
-glass.museum
-gorge.museum
-grandrapids.museum
-graz.museum
-guernsey.museum
-halloffame.museum
-hamburg.museum
-handson.museum
-harvestcelebration.museum
-hawaii.museum
-health.museum
-heimatunduhren.museum
-hellas.museum
-helsinki.museum
-hembygdsforbund.museum
-heritage.museum
-histoire.museum
-historical.museum
-historicalsociety.museum
-historichouses.museum
-historisch.museum
-historisches.museum
-history.museum
-historyofscience.museum
-horology.museum
-house.museum
-humanities.museum
-illustration.museum
-imageandsound.museum
-indian.museum
-indiana.museum
-indianapolis.museum
-indianmarket.museum
-intelligence.museum
-interactive.museum
-iraq.museum
-iron.museum
-isleofman.museum
-jamison.museum
-jefferson.museum
-jerusalem.museum
-jewelry.museum
-jewish.museum
-jewishart.museum
-jfk.museum
-journalism.museum
-judaica.museum
-judygarland.museum
-juedisches.museum
-juif.museum
-karate.museum
-karikatur.museum
-kids.museum
-koebenhavn.museum
-koeln.museum
-kunst.museum
-kunstsammlung.museum
-kunstunddesign.museum
-labor.museum
-labour.museum
-lajolla.museum
-lancashire.museum
-landes.museum
-lans.museum
-läns.museum
-larsson.museum
-lewismiller.museum
-lincoln.museum
-linz.museum
-living.museum
-livinghistory.museum
-localhistory.museum
-london.museum
-losangeles.museum
-louvre.museum
-loyalist.museum
-lucerne.museum
-luxembourg.museum
-luzern.museum
-mad.museum
-madrid.museum
-mallorca.museum
-manchester.museum
-mansion.museum
-mansions.museum
-manx.museum
-marburg.museum
-maritime.museum
-maritimo.museum
-maryland.museum
-marylhurst.museum
-media.museum
-medical.museum
-medizinhistorisches.museum
-meeres.museum
-memorial.museum
-mesaverde.museum
-michigan.museum
-midatlantic.museum
-military.museum
-mill.museum
-miners.museum
-mining.museum
-minnesota.museum
-missile.museum
-missoula.museum
-modern.museum
-moma.museum
-money.museum
-monmouth.museum
-monticello.museum
-montreal.museum
-moscow.museum
-motorcycle.museum
-muenchen.museum
-muenster.museum
-mulhouse.museum
-muncie.museum
-museet.museum
-museumcenter.museum
-museumvereniging.museum
-music.museum
-national.museum
-nationalfirearms.museum
-nationalheritage.museum
-nativeamerican.museum
-naturalhistory.museum
-naturalhistorymuseum.museum
-naturalsciences.museum
-nature.museum
-naturhistorisches.museum
-natuurwetenschappen.museum
-naumburg.museum
-naval.museum
-nebraska.museum
-neues.museum
-newhampshire.museum
-newjersey.museum
-newmexico.museum
-newport.museum
-newspaper.museum
-newyork.museum
-niepce.museum
-norfolk.museum
-north.museum
-nrw.museum
-nuernberg.museum
-nuremberg.museum
-nyc.museum
-nyny.museum
-oceanographic.museum
-oceanographique.museum
-omaha.museum
-online.museum
-ontario.museum
-openair.museum
-oregon.museum
-oregontrail.museum
-otago.museum
-oxford.museum
-pacific.museum
-paderborn.museum
-palace.museum
-paleo.museum
-palmsprings.museum
-panama.museum
-paris.museum
-pasadena.museum
-pharmacy.museum
-philadelphia.museum
-philadelphiaarea.museum
-philately.museum
-phoenix.museum
-photography.museum
-pilots.museum
-pittsburgh.museum
-planetarium.museum
-plantation.museum
-plants.museum
-plaza.museum
-portal.museum
-portland.museum
-portlligat.museum
-posts-and-telecommunications.museum
-preservation.museum
-presidio.museum
-press.museum
-project.museum
-public.museum
-pubol.museum
-quebec.museum
-railroad.museum
-railway.museum
-research.museum
-resistance.museum
-riodejaneiro.museum
-rochester.museum
-rockart.museum
-roma.museum
-russia.museum
-saintlouis.museum
-salem.museum
-salvadordali.museum
-salzburg.museum
-sandiego.museum
-sanfrancisco.museum
-santabarbara.museum
-santacruz.museum
-santafe.museum
-saskatchewan.museum
-satx.museum
-savannahga.museum
-schlesisches.museum
-schoenbrunn.museum
-schokoladen.museum
-school.museum
-schweiz.museum
-science.museum
-scienceandhistory.museum
-scienceandindustry.museum
-sciencecenter.museum
-sciencecenters.museum
-science-fiction.museum
-sciencehistory.museum
-sciences.museum
-sciencesnaturelles.museum
-scotland.museum
-seaport.museum
-settlement.museum
-settlers.museum
-shell.museum
-sherbrooke.museum
-sibenik.museum
-silk.museum
-ski.museum
-skole.museum
-society.museum
-sologne.museum
-soundandvision.museum
-southcarolina.museum
-southwest.museum
-space.museum
-spy.museum
-square.museum
-stadt.museum
-stalbans.museum
-starnberg.museum
-state.museum
-stateofdelaware.museum
-station.museum
-steam.museum
-steiermark.museum
-stjohn.museum
-stockholm.museum
-stpetersburg.museum
-stuttgart.museum
-suisse.museum
-surgeonshall.museum
-surrey.museum
-svizzera.museum
-sweden.museum
-sydney.museum
-tank.museum
-tcm.museum
-technology.museum
-telekommunikation.museum
-television.museum
-texas.museum
-textile.museum
-theater.museum
-time.museum
-timekeeping.museum
-topology.museum
-torino.museum
-touch.museum
-town.museum
-transport.museum
-tree.museum
-trolley.museum
-trust.museum
-trustee.museum
-uhren.museum
-ulm.museum
-undersea.museum
-university.museum
-usa.museum
-usantiques.museum
-usarts.museum
-uscountryestate.museum
-usculture.museum
-usdecorativearts.museum
-usgarden.museum
-ushistory.museum
-ushuaia.museum
-uslivinghistory.museum
-utah.museum
-uvic.museum
-valley.museum
-vantaa.museum
-versailles.museum
-viking.museum
-village.museum
-virginia.museum
-virtual.museum
-virtuel.museum
-vlaanderen.museum
-volkenkunde.museum
-wales.museum
-wallonie.museum
-war.museum
-washingtondc.museum
-watchandclock.museum
-watch-and-clock.museum
-western.museum
-westfalen.museum
-whaling.museum
-wildlife.museum
-williamsburg.museum
-windmill.museum
-workshop.museum
-york.museum
-yorkshire.museum
-yosemite.museum
-youth.museum
-zoological.museum
-zoology.museum
-ירושלים.museum
-иком.museum
-
-// mv : http://en.wikipedia.org/wiki/.mv
-// "mv" included because, contra Wikipedia, google.mv exists.
-mv
-aero.mv
-biz.mv
-com.mv
-coop.mv
-edu.mv
-gov.mv
-info.mv
-int.mv
-mil.mv
-museum.mv
-name.mv
-net.mv
-org.mv
-pro.mv
-
-// mw : http://www.registrar.mw/
-mw
-ac.mw
-biz.mw
-co.mw
-com.mw
-coop.mw
-edu.mw
-gov.mw
-int.mw
-museum.mw
-net.mw
-org.mw
-
-// mx : http://www.nic.mx/
-// Submitted by registry <fa...@nic.mx> 2008-06-19
-mx
-com.mx
-org.mx
-gob.mx
-edu.mx
-net.mx
-
-// my : http://www.mynic.net.my/
-my
-com.my
-net.my
-org.my
-gov.my
-edu.my
-mil.my
-name.my
-
-// mz : http://www.gobin.info/domainname/mz-template.doc
-*.mz
-!teledata.mz
-
-// na : http://www.na-nic.com.na/
-// http://www.info.na/domain/
-na
-info.na
-pro.na
-name.na
-school.na
-or.na
-dr.na
-us.na
-mx.na
-ca.na
-in.na
-cc.na
-tv.na
-ws.na
-mobi.na
-co.na
-com.na
-org.na
-
-// name : has 2nd-level tlds, but there's no list of them
-name
-
-// nc : http://www.cctld.nc/
-nc
-asso.nc
-
-// ne : http://en.wikipedia.org/wiki/.ne
-ne
-
-// net : http://en.wikipedia.org/wiki/.net
-net
-
-// nf : http://en.wikipedia.org/wiki/.nf
-nf
-com.nf
-net.nf
-per.nf
-rec.nf
-web.nf
-arts.nf
-firm.nf
-info.nf
-other.nf
-store.nf
-
-// ng : http://psg.com/dns/ng/
-ng
-com.ng
-edu.ng
-name.ng
-net.ng
-org.ng
-sch.ng
-gov.ng
-mil.ng
-mobi.ng
-
-// ni : http://www.nic.ni/dominios.htm
-*.ni
-
-// nl : http://www.domain-registry.nl/ace.php/c,728,122,,,,Home.html
-// Confirmed by registry <An...@sidn.nl> (with technical
-// reservations) 2008-06-08
-nl
-
-// BV.nl will be a registry for dutch BV's (besloten vennootschap)
-bv.nl
-
-// no : http://www.norid.no/regelverk/index.en.html
-// The Norwegian registry has declined to notify us of updates. The web pages
-// referenced below are the official source of the data. There is also an
-// announce mailing list:
-// https://postlister.uninett.no/sympa/info/norid-diskusjon
-no
-// Norid generic domains : http://www.norid.no/regelverk/vedlegg-c.en.html
-fhs.no
-vgs.no
-fylkesbibl.no
-folkebibl.no
-museum.no
-idrett.no
-priv.no
-// Non-Norid generic domains : http://www.norid.no/regelverk/vedlegg-d.en.html
-mil.no
-stat.no
-dep.no
-kommune.no
-herad.no
-// no geographical names : http://www.norid.no/regelverk/vedlegg-b.en.html
-// counties
-aa.no
-ah.no
-bu.no
-fm.no
-hl.no
-hm.no
-jan-mayen.no
-mr.no
-nl.no
-nt.no
-of.no
-ol.no
-oslo.no
-rl.no
-sf.no
-st.no
-svalbard.no
-tm.no
-tr.no
-va.no
-vf.no
-// primary and lower secondary schools per county
-gs.aa.no
-gs.ah.no
-gs.bu.no
-gs.fm.no
-gs.hl.no
-gs.hm.no
-gs.jan-mayen.no
-gs.mr.no
-gs.nl.no
-gs.nt.no
-gs.of.no
-gs.ol.no
-gs.oslo.no
-gs.rl.no
-gs.sf.no
-gs.st.no
-gs.svalbard.no
-gs.tm.no
-gs.tr.no
-gs.va.no
-gs.vf.no
-// cities
-akrehamn.no
-åkrehamn.no
-algard.no
-ålgård.no
-arna.no
-brumunddal.no
-bryne.no
-bronnoysund.no
-brønnøysund.no
-drobak.no
-drøbak.no
-egersund.no
-fetsund.no
-floro.no
-florø.no
-fredrikstad.no
-hokksund.no
-honefoss.no
-hønefoss.no
-jessheim.no
-jorpeland.no
-jørpeland.no
-kirkenes.no
-kopervik.no
-krokstadelva.no
-langevag.no
-langevåg.no
-leirvik.no
-mjondalen.no
-mjøndalen.no
-mo-i-rana.no
-mosjoen.no
-mosjøen.no
-nesoddtangen.no
-orkanger.no
-osoyro.no
-osøyro.no
-raholt.no
-råholt.no
-sandnessjoen.no
-sandnessjøen.no
-skedsmokorset.no
-slattum.no
-spjelkavik.no
-stathelle.no
-stavern.no
-stjordalshalsen.no
-stjørdalshalsen.no
-tananger.no
-tranby.no
-vossevangen.no
-// communities
-afjord.no
-åfjord.no
-agdenes.no
-al.no
-ål.no
-alesund.no
-ålesund.no
-alstahaug.no
-alta.no
-áltá.no
-alaheadju.no
-álaheadju.no
-alvdal.no
-amli.no
-åmli.no
-amot.no
-åmot.no
-andebu.no
-andoy.no
-andøy.no
-andasuolo.no
-ardal.no
-årdal.no
-aremark.no
-arendal.no
-ås.no
-aseral.no
-åseral.no
-asker.no
-askim.no
-askvoll.no
-askoy.no
-askøy.no
-asnes.no
-åsnes.no
-audnedaln.no
-aukra.no
-aure.no
-aurland.no
-aurskog-holand.no
-aurskog-høland.no
-austevoll.no
-austrheim.no
-averoy.no
-averøy.no
-balestrand.no
-ballangen.no
-balat.no
-bálát.no
-balsfjord.no
-bahccavuotna.no
-báhccavuotna.no
-bamble.no
-bardu.no
-beardu.no
-beiarn.no
-bajddar.no
-bájddar.no
-baidar.no
-báidár.no
-berg.no
-bergen.no
-berlevag.no
-berlevåg.no
-bearalvahki.no
-bearalváhki.no
-bindal.no
-birkenes.no
-bjarkoy.no
-bjarkøy.no
-bjerkreim.no
-bjugn.no
-bodo.no
-bodø.no
-badaddja.no
-bådåddjå.no
-budejju.no
-bokn.no
-bremanger.no
-bronnoy.no
-brønnøy.no
-bygland.no
-bykle.no
-barum.no
-bærum.no
-bo.telemark.no
-bø.telemark.no
-bo.nordland.no
-bø.nordland.no
-bievat.no
-bievát.no
-bomlo.no
-bømlo.no
-batsfjord.no
-båtsfjord.no
-bahcavuotna.no
-báhcavuotna.no
-dovre.no
-drammen.no
-drangedal.no
-dyroy.no
-dyrøy.no
-donna.no
-dønna.no
-eid.no
-eidfjord.no
-eidsberg.no
-eidskog.no
-eidsvoll.no
-eigersund.no
-elverum.no
-enebakk.no
-engerdal.no
-etne.no
-etnedal.no
-evenes.no
-evenassi.no
-evenášši.no
-evje-og-hornnes.no
-farsund.no
-fauske.no
-fuossko.no
-fuoisku.no
-fedje.no
-fet.no
-finnoy.no
-finnøy.no
-fitjar.no
-fjaler.no
-fjell.no
-flakstad.no
-flatanger.no
-flekkefjord.no
-flesberg.no
-flora.no
-fla.no
-flå.no
-folldal.no
-forsand.no
-fosnes.no
-frei.no
-frogn.no
-froland.no
-frosta.no
-frana.no
-fræna.no
-froya.no
-frøya.no
-fusa.no
-fyresdal.no
-forde.no
-førde.no
-gamvik.no
-gangaviika.no
-gáŋgaviika.no
-gaular.no
-gausdal.no
-gildeskal.no
-gildeskål.no
-giske.no
-gjemnes.no
-gjerdrum.no
-gjerstad.no
-gjesdal.no
-gjovik.no
-gjøvik.no
-gloppen.no
-gol.no
-gran.no
-grane.no
-granvin.no
-gratangen.no
-grimstad.no
-grong.no
-kraanghke.no
-kråanghke.no
-grue.no
-gulen.no
-hadsel.no
-halden.no
-halsa.no
-hamar.no
-hamaroy.no
-habmer.no
-hábmer.no
-hapmir.no
-hápmir.no
-hammerfest.no
-hammarfeasta.no
-hámmárfeasta.no
-haram.no
-hareid.no
-harstad.no
-hasvik.no
-aknoluokta.no
-ákŋoluokta.no
-hattfjelldal.no
-aarborte.no
-haugesund.no
-hemne.no
-hemnes.no
-hemsedal.no
-heroy.more-og-romsdal.no
-herøy.møre-og-romsdal.no
-heroy.nordland.no
-herøy.nordland.no
-hitra.no
-hjartdal.no
-hjelmeland.no
-hobol.no
-hobøl.no
-hof.no
-hol.no
-hole.no
-holmestrand.no
-holtalen.no
-holtålen.no
-hornindal.no
-horten.no
-hurdal.no
-hurum.no
-hvaler.no
-hyllestad.no
-hagebostad.no
-hægebostad.no
-hoyanger.no
-høyanger.no
-hoylandet.no
-høylandet.no
-ha.no
-hå.no
-ibestad.no
-inderoy.no
-inderøy.no
-iveland.no
-jevnaker.no
-jondal.no
-jolster.no
-jølster.no
-karasjok.no
-karasjohka.no
-kárášjohka.no
-karlsoy.no
-galsa.no
-gálsá.no
-karmoy.no
-karmøy.no
-kautokeino.no
-guovdageaidnu.no
-klepp.no
-klabu.no
-klæbu.no
-kongsberg.no
-kongsvinger.no
-kragero.no
-kragerø.no
-kristiansand.no
-kristiansund.no
-krodsherad.no
-krødsherad.no
-kvalsund.no
-rahkkeravju.no
-ráhkkerávju.no
-kvam.no
-kvinesdal.no
-kvinnherad.no
-kviteseid.no
-kvitsoy.no
-kvitsøy.no
-kvafjord.no
-kvæfjord.no
-giehtavuoatna.no
-kvanangen.no
-kvænangen.no
-navuotna.no
-návuotna.no
-kafjord.no
-kåfjord.no
-gaivuotna.no
-gáivuotna.no
-larvik.no
-lavangen.no
-lavagis.no
-loabat.no
-loabát.no
-lebesby.no
-davvesiida.no
-leikanger.no
-leirfjord.no
-leka.no
-leksvik.no
-lenvik.no
-leangaviika.no
-leaŋgaviika.no
-lesja.no
-levanger.no
-lier.no
-lierne.no
-lillehammer.no
-lillesand.no
-lindesnes.no
-lindas.no
-lindås.no
-lom.no
-loppa.no
-lahppi.no
-láhppi.no
-lund.no
-lunner.no
-luroy.no
-lurøy.no
-luster.no
-lyngdal.no
-lyngen.no
-ivgu.no
-lardal.no
-lerdal.no
-lærdal.no
-lodingen.no
-lødingen.no
-lorenskog.no
-lørenskog.no
-loten.no
-løten.no
-malvik.no
-masoy.no
-måsøy.no
-muosat.no
-muosát.no
-mandal.no
-marker.no
-marnardal.no
-masfjorden.no
-meland.no
-meldal.no
-melhus.no
-meloy.no
-meløy.no
-meraker.no
-meråker.no
-moareke.no
-moåreke.no
-midsund.no
-midtre-gauldal.no
-modalen.no
-modum.no
-molde.no
-moskenes.no
-moss.no
-mosvik.no
-malselv.no
-målselv.no
-malatvuopmi.no
-málatvuopmi.no
-namdalseid.no
-aejrie.no
-namsos.no
-namsskogan.no
-naamesjevuemie.no
-nååmesjevuemie.no
-laakesvuemie.no
-nannestad.no
-narvik.no
-narviika.no
-naustdal.no
-nedre-eiker.no
-nes.akershus.no
-nes.buskerud.no
-nesna.no
-nesodden.no
-nesseby.no
-unjarga.no
-unjárga.no
-nesset.no
-nissedal.no
-nittedal.no
-nord-aurdal.no
-nord-fron.no
-nord-odal.no
-norddal.no
-nordkapp.no
-davvenjarga.no
-davvenjárga.no
-nordre-land.no
-nordreisa.no
-raisa.no
-ráisa.no
-nore-og-uvdal.no
-notodden.no
-naroy.no
-nærøy.no
-notteroy.no
-nøtterøy.no
-odda.no
-oksnes.no
-øksnes.no
-oppdal.no
-oppegard.no
-oppegård.no
-orkdal.no
-orland.no
-ørland.no
-orskog.no
-ørskog.no
-orsta.no
-ørsta.no
-os.hedmark.no
-os.hordaland.no
-osen.no
-osteroy.no
-osterøy.no
-ostre-toten.no
-østre-toten.no
-overhalla.no
-ovre-eiker.no
-øvre-eiker.no
-oyer.no
-øyer.no
-oygarden.no
-øygarden.no
-oystre-slidre.no
-øystre-slidre.no
-porsanger.no
-porsangu.no
-porsáŋgu.no
-porsgrunn.no
-radoy.no
-radøy.no
-rakkestad.no
-rana.no
-ruovat.no
-randaberg.no
-rauma.no
-rendalen.no
-rennebu.no
-rennesoy.no
-rennesøy.no
-rindal.no
-ringebu.no
-ringerike.no
-ringsaker.no
-rissa.no
-risor.no
-risør.no
-roan.no
-rollag.no
-rygge.no
-ralingen.no
-rælingen.no
-rodoy.no
-rødøy.no
-romskog.no
-rømskog.no
-roros.no
-røros.no
-rost.no
-røst.no
-royken.no
-røyken.no
-royrvik.no
-røyrvik.no
-rade.no
-råde.no
-salangen.no
-siellak.no
-saltdal.no
-salat.no
-sálát.no
-sálat.no
-samnanger.no
-sande.more-og-romsdal.no
-sande.møre-og-romsdal.no
-sande.vestfold.no
-sandefjord.no
-sandnes.no
-sandoy.no
-sandøy.no
-sarpsborg.no
-sauda.no
-sauherad.no
-sel.no
-selbu.no
-selje.no
-seljord.no
-sigdal.no
-siljan.no
-sirdal.no
-skaun.no
-skedsmo.no
-ski.no
-skien.no
-skiptvet.no
-skjervoy.no
-skjervøy.no
-skierva.no
-skiervá.no
-skjak.no
-skjåk.no
-skodje.no
-skanland.no
-skånland.no
-skanit.no
-skánit.no
-smola.no
-smøla.no
-snillfjord.no
-snasa.no
-snåsa.no
-snoasa.no
-snaase.no
-snåase.no
-sogndal.no
-sokndal.no
-sola.no
-solund.no
-songdalen.no
-sortland.no
-spydeberg.no
-stange.no
-stavanger.no
-steigen.no
-steinkjer.no
-stjordal.no
-stjørdal.no
-stokke.no
-stor-elvdal.no
-stord.no
-stordal.no
-storfjord.no
-omasvuotna.no
-strand.no
-stranda.no
-stryn.no
-sula.no
-suldal.no
-sund.no
-sunndal.no
-surnadal.no
-sveio.no
-svelvik.no
-sykkylven.no
-sogne.no
-søgne.no
-somna.no
-sømna.no
-sondre-land.no
-søndre-land.no
-sor-aurdal.no
-sør-aurdal.no
-sor-fron.no
-sør-fron.no
-sor-odal.no
-sør-odal.no
-sor-varanger.no
-sør-varanger.no
-matta-varjjat.no
-mátta-várjjat.no
-sorfold.no
-sørfold.no
-sorreisa.no
-sørreisa.no
-sorum.no
-sørum.no
-tana.no
-deatnu.no
-time.no
-tingvoll.no
-tinn.no
-tjeldsund.no
-dielddanuorri.no
-tjome.no
-tjøme.no
-tokke.no
-tolga.no
-torsken.no
-tranoy.no
-tranøy.no
-tromso.no
-tromsø.no
-tromsa.no
-romsa.no
-trondheim.no
-troandin.no
-trysil.no
-trana.no
-træna.no
-trogstad.no
-trøgstad.no
-tvedestrand.no
-tydal.no
-tynset.no
-tysfjord.no
-divtasvuodna.no
-divttasvuotna.no
-tysnes.no
-tysvar.no
-tysvær.no
-tonsberg.no
-tønsberg.no
-ullensaker.no
-ullensvang.no
-ulvik.no
-utsira.no
-vadso.no
-vadsø.no
-cahcesuolo.no
-čáhcesuolo.no
-vaksdal.no
-valle.no
-vang.no
-vanylven.no
-vardo.no
-vardø.no
-varggat.no
-várggát.no
-vefsn.no
-vaapste.no
-vega.no
-vegarshei.no
-vegårshei.no
-vennesla.no
-verdal.no
-verran.no
-vestby.no
-vestnes.no
-vestre-slidre.no
-vestre-toten.no
-vestvagoy.no
-vestvågøy.no
-vevelstad.no
-vik.no
-vikna.no
-vindafjord.no
-volda.no
-voss.no
-varoy.no
-værøy.no
-vagan.no
-vågan.no
-voagat.no
-vagsoy.no
-vågsøy.no
-vaga.no
-vågå.no
-valer.ostfold.no
-våler.østfold.no
-valer.hedmark.no
-våler.hedmark.no
-
-// np : http://www.mos.com.np/register.html
-*.np
-
-// nr : http://cenpac.net.nr/dns/index.html
-// Confirmed by registry <te...@cenpac.net.nr> 2008-06-17
-nr
-biz.nr
-info.nr
-gov.nr
-edu.nr
-org.nr
-net.nr
-com.nr
-
-// nu : http://en.wikipedia.org/wiki/.nu
-nu
-
-// nz : http://en.wikipedia.org/wiki/.nz
-// Confirmed by registry <ja...@nzrs.net.nz> 2014-05-19
-nz
-ac.nz
-co.nz
-cri.nz
-geek.nz
-gen.nz
-govt.nz
-health.nz
-iwi.nz
-kiwi.nz
-maori.nz
-mil.nz
-māori.nz
-net.nz
-org.nz
-parliament.nz
-school.nz
-
-// om : http://en.wikipedia.org/wiki/.om
-om
-co.om
-com.om
-edu.om
-gov.om
-med.om
-museum.om
-net.om
-org.om
-pro.om
-
-// org : http://en.wikipedia.org/wiki/.org
-org
-
-// pa : http://www.nic.pa/
-// Some additional second level "domains" resolve directly as hostnames, such as
-// pannet.pa, so we add a rule for "pa".
-pa
-ac.pa
-gob.pa
-com.pa
-org.pa
-sld.pa
-edu.pa
-net.pa
-ing.pa
-abo.pa
-med.pa
-nom.pa
-
-// pe : https://www.nic.pe/InformeFinalComision.pdf
-pe
-edu.pe
-gob.pe
-nom.pe
-mil.pe
-org.pe
-com.pe
-net.pe
-
-// pf : http://www.gobin.info/domainname/formulaire-pf.pdf
-pf
-com.pf
-org.pf
-edu.pf
-
-// pg : http://en.wikipedia.org/wiki/.pg
-*.pg
-
-// ph : http://www.domains.ph/FAQ2.asp
-// Submitted by registry <je...@email.com.ph> 2008-06-13
-ph
-com.ph
-net.ph
-org.ph
-gov.ph
-edu.ph
-ngo.ph
-mil.ph
-i.ph
-
-// pk : http://pk5.pknic.net.pk/pk5/msgNamepk.PK
-pk
-com.pk
-net.pk
-edu.pk
-org.pk
-fam.pk
-biz.pk
-web.pk
-gov.pk
-gob.pk
-gok.pk
-gon.pk
-gop.pk
-gos.pk
-info.pk
-
-// pl http://www.dns.pl/english/index.html
-// confirmed on 26.09.2014 from Bogna Tchórzewska <pa...@dns.pl>
-pl
-com.pl
-net.pl
-org.pl
-info.pl
-waw.pl
-gov.pl
-// pl functional domains (http://www.dns.pl/english/index.html)
-aid.pl
-agro.pl
-atm.pl
-auto.pl
-biz.pl
-edu.pl
-gmina.pl
-gsm.pl
-mail.pl
-miasta.pl
-media.pl
-mil.pl
-nieruchomosci.pl
-nom.pl
-pc.pl
-powiat.pl
-priv.pl
-realestate.pl
-rel.pl
-sex.pl
-shop.pl
-sklep.pl
-sos.pl
-szkola.pl
-targi.pl
-tm.pl
-tourism.pl
-travel.pl
-turystyka.pl
-// Government domains (administred by ippt.gov.pl)
-uw.gov.pl
-um.gov.pl
-ug.gov.pl
-upow.gov.pl
-starostwo.gov.pl
-so.gov.pl
-sr.gov.pl
-po.gov.pl
-pa.gov.pl
-// pl regional domains (http://www.dns.pl/english/index.html)
-augustow.pl
-babia-gora.pl
-bedzin.pl
-beskidy.pl
-bialowieza.pl
-bialystok.pl
-bielawa.pl
-bieszczady.pl
-boleslawiec.pl
-bydgoszcz.pl
-bytom.pl
-cieszyn.pl
-czeladz.pl
-czest.pl
-dlugoleka.pl
-elblag.pl
-elk.pl
-glogow.pl
-gniezno.pl
-gorlice.pl
-grajewo.pl
-ilawa.pl
-jaworzno.pl
-jelenia-gora.pl
-jgora.pl
-kalisz.pl
-kazimierz-dolny.pl
-karpacz.pl
-kartuzy.pl
-kaszuby.pl
-katowice.pl
-kepno.pl
-ketrzyn.pl
-klodzko.pl
-kobierzyce.pl
-kolobrzeg.pl
-konin.pl
-konskowola.pl
-kutno.pl
-lapy.pl
-lebork.pl
-legnica.pl
-lezajsk.pl
-limanowa.pl
-lomza.pl
-lowicz.pl
-lubin.pl
-lukow.pl
-malbork.pl
-malopolska.pl
-mazowsze.pl
-mazury.pl
-mielec.pl
-mielno.pl
-mragowo.pl
-naklo.pl
-nowaruda.pl
-nysa.pl
-olawa.pl
-olecko.pl
-olkusz.pl
-olsztyn.pl
-opoczno.pl
-opole.pl
-ostroda.pl
-ostroleka.pl
-ostrowiec.pl
-ostrowwlkp.pl
-pila.pl
-pisz.pl
-podhale.pl
-podlasie.pl
-polkowice.pl
-pomorze.pl
-pomorskie.pl
-prochowice.pl
-pruszkow.pl
-przeworsk.pl
-pulawy.pl
-radom.pl
-rawa-maz.pl
-rybnik.pl
-rzeszow.pl
-sanok.pl
-sejny.pl
-slask.pl
-slupsk.pl
-sosnowiec.pl
-stalowa-wola.pl
-skoczow.pl
-starachowice.pl
-stargard.pl
-suwalki.pl
-swidnica.pl
-swiebodzin.pl
-swinoujscie.pl
-szczecin.pl
-szczytno.pl
-tarnobrzeg.pl
-tgory.pl
-turek.pl
-tychy.pl
-ustka.pl
-walbrzych.pl
-warmia.pl
-warszawa.pl
-wegrow.pl
-wielun.pl
-wlocl.pl
-wloclawek.pl
-wodzislaw.pl
-wolomin.pl
-wroclaw.pl
-zachpomor.pl
-zagan.pl
-zarow.pl
-zgora.pl
-zgorzelec.pl
-
-// pm : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf
-pm
-
-// pn : http://www.government.pn/PnRegistry/policies.htm
-pn
-gov.pn
-co.pn
-org.pn
-edu.pn
-net.pn
-
-// post : http://en.wikipedia.org/wiki/.post
-post
-
-// pr : http://www.nic.pr/index.asp?f=1
-pr
-com.pr
-net.pr
-org.pr
-gov.pr
-edu.pr
-isla.pr
-pro.pr
-biz.pr
-info.pr
-name.pr
-// these aren't mentioned on nic.pr, but on http://en.wikipedia.org/wiki/.pr
-est.pr
-prof.pr
-ac.pr
-
-// pro : http://www.nic.pro/support_faq.htm
-pro
-aca.pro
-bar.pro
-cpa.pro
-jur.pro
-law.pro
-med.pro
-eng.pro
-
-// ps : http://en.wikipedia.org/wiki/.ps
-// http://www.nic.ps/registration/policy.html#reg
-ps
-edu.ps
-gov.ps
-sec.ps
-plo.ps
-com.ps
-org.ps
-net.ps
-
-// pt : http://online.dns.pt/dns/start_dns
-pt
-net.pt
-gov.pt
-org.pt
-edu.pt
-int.pt
-publ.pt
-com.pt
-nome.pt
-
-// pw : http://en.wikipedia.org/wiki/.pw
-pw
-co.pw
-ne.pw
-or.pw
-ed.pw
-go.pw
-belau.pw
-
-// py : http://www.nic.py/pautas.html#seccion_9
-// Confirmed by registry 2012-10-03
-py
-com.py
-coop.py
-edu.py
-gov.py
-mil.py
-net.py
-org.py
-
-// qa : http://domains.qa/en/
-qa
-com.qa
-edu.qa
-gov.qa
-mil.qa
-name.qa
-net.qa
-org.qa
-sch.qa
-
-// re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs
-re
-com.re
-asso.re
-nom.re
-
-// ro : http://www.rotld.ro/
-ro
-com.ro
-org.ro
-tm.ro
-nt.ro
-nom.ro
-info.ro
-rec.ro
-arts.ro
-firm.ro
-store.ro
-www.ro
-
-// rs : http://en.wikipedia.org/wiki/.rs
-rs
-co.rs
-org.rs
-edu.rs
-ac.rs
-gov.rs
-in.rs
-
-// ru : http://www.cctld.ru/ru/docs/aktiv_8.php
-// Industry domains
-ru
-ac.ru
-com.ru
-edu.ru
-int.ru
-net.ru
-org.ru
-pp.ru
-// Geographical domains
-adygeya.ru
-altai.ru
-amur.ru
-arkhangelsk.ru
-astrakhan.ru
-bashkiria.ru
-belgorod.ru
-bir.ru
-bryansk.ru
-buryatia.ru
-cbg.ru
-chel.ru
-chelyabinsk.ru
-chita.ru
-chukotka.ru
-chuvashia.ru
-dagestan.ru
-dudinka.ru
-e-burg.ru
-grozny.ru
-irkutsk.ru
-ivanovo.ru
-izhevsk.ru
-jar.ru
-joshkar-ola.ru
-kalmykia.ru
-kaluga.ru
-kamchatka.ru
-karelia.ru
-kazan.ru
-kchr.ru
-kemerovo.ru
-khabarovsk.ru
-khakassia.ru
-khv.ru
-kirov.ru
-koenig.ru
-komi.ru
-kostroma.ru
-krasnoyarsk.ru
-kuban.ru
-kurgan.ru
-kursk.ru
-lipetsk.ru
-magadan.ru
-mari.ru
-mari-el.ru
-marine.ru
-mordovia.ru
-// mosreg.ru Bug 1090800 - removed at request of Aleksey Konstantinov <ko...@mosreg.ru>
-msk.ru
-murmansk.ru
-nalchik.ru
-nnov.ru
-nov.ru
-novosibirsk.ru
-nsk.ru
-omsk.ru
-orenburg.ru
-oryol.ru
-palana.ru
-penza.ru
-perm.ru
-ptz.ru
-rnd.ru
-ryazan.ru
-sakhalin.ru
-samara.ru
-saratov.ru
-simbirsk.ru
-smolensk.ru
-spb.ru
-stavropol.ru
-stv.ru
-surgut.ru
-tambov.ru
-tatarstan.ru
-tom.ru
-tomsk.ru
-tsaritsyn.ru
-tsk.ru
-tula.ru
-tuva.ru
-tver.ru
-tyumen.ru
-udm.ru
-udmurtia.ru
-ulan-ude.ru
-vladikavkaz.ru
-vladimir.ru
-vladivostok.ru
-volgograd.ru
-vologda.ru
-voronezh.ru
-vrn.ru
-vyatka.ru
-yakutia.ru
-yamal.ru
-yaroslavl.ru
-yekaterinburg.ru
-yuzhno-sakhalinsk.ru
-// More geographical domains
-amursk.ru
-baikal.ru
-cmw.ru
-fareast.ru
-jamal.ru
-kms.ru
-k-uralsk.ru
-kustanai.ru
-kuzbass.ru
-magnitka.ru
-mytis.ru
-nakhodka.ru
-nkz.ru
-norilsk.ru
-oskol.ru
-pyatigorsk.ru
-rubtsovsk.ru
-snz.ru
-syzran.ru
-vdonsk.ru
-zgrad.ru
-// State domains
-gov.ru
-mil.ru
-// Technical domains
-test.ru
-
-// rw : http://www.nic.rw/cgi-bin/policy.pl
-rw
-gov.rw
-net.rw
-edu.rw
-ac.rw
-com.rw
-co.rw
-int.rw
-mil.rw
-gouv.rw
-
-// sa : http://www.nic.net.sa/
-sa
-com.sa
-net.sa
-org.sa
-gov.sa
-med.sa
-pub.sa
-edu.sa
-sch.sa
-
-// sb : http://www.sbnic.net.sb/
-// Submitted by registry <le...@telekom.com.sb> 2008-06-08
-sb
-com.sb
-edu.sb
-gov.sb
-net.sb
-org.sb
-
-// sc : http://www.nic.sc/
-sc
-com.sc
-gov.sc
-net.sc
-org.sc
-edu.sc
-
-// sd : http://www.isoc.sd/sudanic.isoc.sd/billing_pricing.htm
-// Submitted by registry <ad...@isoc.sd> 2008-06-17
-sd
-com.sd
-net.sd
-org.sd
-edu.sd
-med.sd
-tv.sd
-gov.sd
-info.sd
-
-// se : htt
<TRUNCATED>
[40/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
deleted file mode 100755
index 256bf32..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
+++ /dev/null
@@ -1,293 +0,0 @@
-// Load modules
-
-var Http = require('http');
-var Hoek = require('hoek');
-
-
-// Declare internals
-
-var internals = {};
-
-
-exports.wrap = function (error, statusCode, message) {
-
- Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object');
- return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message));
-};
-
-
-exports.create = function (statusCode, message, data) {
-
- var error = new Error(message ? message : undefined); // Avoids settings null message
- error.data = data || null;
- internals.initialize(error, statusCode);
- return error;
-};
-
-
-internals.initialize = function (error, statusCode, message) {
-
- var numberCode = parseInt(statusCode, 10);
- Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode);
-
- error.isBoom = true;
- error.isServer = numberCode >= 500;
-
- if (!error.hasOwnProperty('data')) {
- error.data = null;
- }
-
- error.output = {
- statusCode: numberCode,
- payload: {},
- headers: {}
- };
-
- error.reformat = internals.reformat;
- error.reformat();
-
- if (!message &&
- !error.message) {
-
- message = error.output.payload.error;
- }
-
- if (message) {
- error.message = (message + (error.message ? ': ' + error.message : ''));
- }
-
- return error;
-};
-
-
-internals.reformat = function () {
-
- this.output.payload.statusCode = this.output.statusCode;
- this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown';
-
- if (this.output.statusCode === 500) {
- this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user
- }
- else if (this.message) {
- this.output.payload.message = this.message;
- }
-};
-
-
-// 4xx Client Errors
-
-exports.badRequest = function (message, data) {
-
- return exports.create(400, message, data);
-};
-
-
-exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[])
-
- var err = exports.create(401, message);
-
- if (!scheme) {
- return err;
- }
-
- var wwwAuthenticate = '';
- var i = 0;
- var il = 0;
-
- if (typeof scheme === 'string') {
-
- // function (message, scheme, attributes)
-
- wwwAuthenticate = scheme;
- if (attributes) {
- var names = Object.keys(attributes);
- for (i = 0, il = names.length; i < il; ++i) {
- if (i) {
- wwwAuthenticate += ',';
- }
-
- var value = attributes[names[i]];
- if (value === null ||
- value === undefined) { // Value can be zero
-
- value = '';
- }
- wwwAuthenticate += ' ' + names[i] + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
- }
- }
-
- if (message) {
- if (attributes) {
- wwwAuthenticate += ',';
- }
- wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"';
- }
- else {
- err.isMissing = true;
- }
- }
- else {
-
- // function (message, wwwAuthenticate[])
-
- var wwwArray = scheme;
- for (i = 0, il = wwwArray.length; i < il; ++i) {
- if (i) {
- wwwAuthenticate += ', ';
- }
-
- wwwAuthenticate += wwwArray[i];
- }
- }
-
- err.output.headers['WWW-Authenticate'] = wwwAuthenticate;
-
- return err;
-};
-
-
-exports.forbidden = function (message, data) {
-
- return exports.create(403, message, data);
-};
-
-
-exports.notFound = function (message, data) {
-
- return exports.create(404, message, data);
-};
-
-
-exports.methodNotAllowed = function (message, data) {
-
- return exports.create(405, message, data);
-};
-
-
-exports.notAcceptable = function (message, data) {
-
- return exports.create(406, message, data);
-};
-
-
-exports.proxyAuthRequired = function (message, data) {
-
- return exports.create(407, message, data);
-};
-
-
-exports.clientTimeout = function (message, data) {
-
- return exports.create(408, message, data);
-};
-
-
-exports.conflict = function (message, data) {
-
- return exports.create(409, message, data);
-};
-
-
-exports.resourceGone = function (message, data) {
-
- return exports.create(410, message, data);
-};
-
-
-exports.lengthRequired = function (message, data) {
-
- return exports.create(411, message, data);
-};
-
-
-exports.preconditionFailed = function (message, data) {
-
- return exports.create(412, message, data);
-};
-
-
-exports.entityTooLarge = function (message, data) {
-
- return exports.create(413, message, data);
-};
-
-
-exports.uriTooLong = function (message, data) {
-
- return exports.create(414, message, data);
-};
-
-
-exports.unsupportedMediaType = function (message, data) {
-
- return exports.create(415, message, data);
-};
-
-
-exports.rangeNotSatisfiable = function (message, data) {
-
- return exports.create(416, message, data);
-};
-
-
-exports.expectationFailed = function (message, data) {
-
- return exports.create(417, message, data);
-};
-
-exports.badData = function (message, data) {
-
- return exports.create(422, message, data);
-};
-
-
-exports.tooManyRequests = function (message, data) {
-
- return exports.create(429, message, data);
-};
-
-
-// 5xx Server Errors
-
-exports.internal = function (message, data, statusCode) {
-
- var error = (data instanceof Error ? exports.wrap(data, statusCode, message) : exports.create(statusCode || 500, message));
-
- if (data instanceof Error === false) {
- error.data = data;
- }
-
- return error;
-};
-
-
-exports.notImplemented = function (message, data) {
-
- return exports.internal(message, data, 501);
-};
-
-
-exports.badGateway = function (message, data) {
-
- return exports.internal(message, data, 502);
-};
-
-
-exports.serverTimeout = function (message, data) {
-
- return exports.internal(message, data, 503);
-};
-
-
-exports.gatewayTimeout = function (message, data) {
-
- return exports.internal(message, data, 504);
-};
-
-
-exports.badImplementation = function (message, data) {
-
- var err = exports.internal(message, data, 500);
- err.isDeveloperError = true;
- return err;
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/node_modules/request/node_modules/hawk/node_modules/boom/package.json
deleted file mode 100644
index ba76f4d..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/package.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "name": "boom",
- "description": "HTTP-friendly error objects",
- "version": "2.7.2",
- "repository": {
- "type": "git",
- "url": "git://github.com/hapijs/boom"
- },
- "main": "index",
- "keywords": [
- "error",
- "http"
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "dependencies": {
- "hoek": "2.x.x"
- },
- "devDependencies": {
- "code": "1.x.x",
- "lab": "5.x.x"
- },
- "scripts": {
- "test": "lab -a code -t 100",
- "test-cov-html": "lab -a code -r html -o coverage.html"
- },
- "license": "BSD-3-Clause",
- "gitHead": "29be188e9ecfce3a2e090b8714dec2b6e0791724",
- "bugs": {
- "url": "https://github.com/hapijs/boom/issues"
- },
- "homepage": "https://github.com/hapijs/boom",
- "_id": "boom@2.7.2",
- "_shasum": "dad628d897f7fd2e32cc82197f13307971cf8354",
- "_from": "boom@>=2.0.0 <3.0.0",
- "_npmVersion": "2.7.0",
- "_nodeVersion": "0.10.38",
- "_npmUser": {
- "name": "arb",
- "email": "arbretz@gmail.com"
- },
- "maintainers": [
- {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- },
- {
- "name": "wyatt",
- "email": "wpreul@gmail.com"
- },
- {
- "name": "arb",
- "email": "arbretz@gmail.com"
- }
- ],
- "dist": {
- "shasum": "dad628d897f7fd2e32cc82197f13307971cf8354",
- "tarball": "http://registry.npmjs.org/boom/-/boom-2.7.2.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/boom/-/boom-2.7.2.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js b/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
deleted file mode 100755
index a0db4df..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
+++ /dev/null
@@ -1,615 +0,0 @@
-// Load modules
-
-var Util = require('util');
-var Code = require('code');
-var Boom = require('../lib');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.describe;
-var it = lab.it;
-var expect = Code.expect;
-
-
-it('returns the same object when already boom', function (done) {
-
- var error = Boom.badRequest();
- var wrapped = Boom.wrap(error);
- expect(error).to.equal(wrapped);
- done();
-});
-
-it('returns an error with info when constructed using another error', function (done) {
-
- var error = new Error('ka-boom');
- error.xyz = 123;
- var err = Boom.wrap(error);
- expect(err.xyz).to.equal(123);
- expect(err.message).to.equal('ka-boom');
- expect(err.output).to.deep.equal({
- statusCode: 500,
- payload: {
- statusCode: 500,
- error: 'Internal Server Error',
- message: 'An internal server error occurred'
- },
- headers: {}
- });
- expect(err.data).to.equal(null);
- done();
-});
-
-it('does not override data when constructed using another error', function (done) {
-
- var error = new Error('ka-boom');
- error.data = { useful: 'data' };
- var err = Boom.wrap(error);
- expect(err.data).to.equal(error.data);
- done();
-});
-
-it('sets new message when none exists', function (done) {
-
- var error = new Error();
- var wrapped = Boom.wrap(error, 400, 'something bad');
- expect(wrapped.message).to.equal('something bad');
- done();
-});
-
-it('throws when statusCode is not a number', function (done) {
-
- expect(function () {
-
- Boom.create('x');
- }).to.throw('First argument must be a number (400+): x');
- done();
-});
-
-it('will cast a number-string to an integer', function (done) {
-
- var codes = [
- { input: '404', result: 404 },
- { input: '404.1', result: 404 },
- { input: 400, result: 400 },
- { input: 400.123, result: 400 }]
- for (var i = 0, il = codes.length; i < il; ++i) {
- var code = codes[i];
- var err = Boom.create(code.input);
- expect(err.output.statusCode).to.equal(code.result);
- }
-
- done();
-});
-
-it('throws when statusCode is not finite', function (done) {
-
- expect(function () {
-
- Boom.create(1 / 0);
- }).to.throw('First argument must be a number (400+): null');
- done();
-});
-
-it('sets error code to unknown', function (done) {
-
- var err = Boom.create(999);
- expect(err.output.payload.error).to.equal('Unknown');
- done();
-});
-
-describe('create()', function () {
-
- it('does not sets null message', function (done) {
-
- var error = Boom.unauthorized(null);
- expect(error.output.payload.message).to.not.exist();
- expect(error.isServer).to.be.false();
- done();
- });
-
- it('sets message and data', function (done) {
-
- var error = Boom.badRequest('Missing data', { type: 'user' });
- expect(error.data.type).to.equal('user');
- expect(error.output.payload.message).to.equal('Missing data');
- done();
- });
-});
-
-describe('isBoom()', function () {
-
- it('returns true for Boom object', function (done) {
-
- expect(Boom.badRequest().isBoom).to.equal(true);
- done();
- });
-
- it('returns false for Error object', function (done) {
-
- expect((new Error()).isBoom).to.not.exist();
- done();
- });
-});
-
-describe('badRequest()', function () {
-
- it('returns a 400 error statusCode', function (done) {
-
- var error = Boom.badRequest();
-
- expect(error.output.statusCode).to.equal(400);
- expect(error.isServer).to.be.false();
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.badRequest('my message').message).to.equal('my message');
- done();
- });
-
- it('sets the message to HTTP status if none provided', function (done) {
-
- expect(Boom.badRequest().message).to.equal('Bad Request');
- done();
- });
-});
-
-describe('unauthorized()', function () {
-
- it('returns a 401 error statusCode', function (done) {
-
- var err = Boom.unauthorized();
- expect(err.output.statusCode).to.equal(401);
- expect(err.output.headers).to.deep.equal({});
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.unauthorized('my message').message).to.equal('my message');
- done();
- });
-
- it('returns a WWW-Authenticate header when passed a scheme', function (done) {
-
- var err = Boom.unauthorized('boom', 'Test');
- expect(err.output.statusCode).to.equal(401);
- expect(err.output.headers['WWW-Authenticate']).to.equal('Test error="boom"');
- done();
- });
-
- it('returns a WWW-Authenticate header set to the schema array value', function (done) {
-
- var err = Boom.unauthorized(null, ['Test','one','two']);
- expect(err.output.statusCode).to.equal(401);
- expect(err.output.headers['WWW-Authenticate']).to.equal('Test, one, two');
- done();
- });
-
- it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) {
-
- var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 });
- expect(err.output.statusCode).to.equal(401);
- expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"');
- done();
- });
-
- it('returns a WWW-Authenticate header when passed attributes, missing error', function (done) {
-
- var err = Boom.unauthorized(null, 'Test', { a: 1, b: 'something', c: null, d: 0 });
- expect(err.output.statusCode).to.equal(401);
- expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0"');
- expect(err.isMissing).to.equal(true);
- done();
- });
-
- it('sets the isMissing flag when error message is empty', function (done) {
-
- var err = Boom.unauthorized('', 'Basic');
- expect(err.isMissing).to.equal(true);
- done();
- });
-
- it('does not set the isMissing flag when error message is not empty', function (done) {
-
- var err = Boom.unauthorized('message', 'Basic');
- expect(err.isMissing).to.equal(undefined);
- done();
- });
-
- it('sets a WWW-Authenticate when passed as an array', function (done) {
-
- var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']);
- expect(err.output.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"');
- done();
- });
-});
-
-
-describe('methodNotAllowed()', function () {
-
- it('returns a 405 error statusCode', function (done) {
-
- expect(Boom.methodNotAllowed().output.statusCode).to.equal(405);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.methodNotAllowed('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('notAcceptable()', function () {
-
- it('returns a 406 error statusCode', function (done) {
-
- expect(Boom.notAcceptable().output.statusCode).to.equal(406);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.notAcceptable('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('proxyAuthRequired()', function () {
-
- it('returns a 407 error statusCode', function (done) {
-
- expect(Boom.proxyAuthRequired().output.statusCode).to.equal(407);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.proxyAuthRequired('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('clientTimeout()', function () {
-
- it('returns a 408 error statusCode', function (done) {
-
- expect(Boom.clientTimeout().output.statusCode).to.equal(408);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.clientTimeout('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('conflict()', function () {
-
- it('returns a 409 error statusCode', function (done) {
-
- expect(Boom.conflict().output.statusCode).to.equal(409);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.conflict('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('resourceGone()', function () {
-
- it('returns a 410 error statusCode', function (done) {
-
- expect(Boom.resourceGone().output.statusCode).to.equal(410);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.resourceGone('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('lengthRequired()', function () {
-
- it('returns a 411 error statusCode', function (done) {
-
- expect(Boom.lengthRequired().output.statusCode).to.equal(411);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.lengthRequired('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('preconditionFailed()', function () {
-
- it('returns a 412 error statusCode', function (done) {
-
- expect(Boom.preconditionFailed().output.statusCode).to.equal(412);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.preconditionFailed('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('entityTooLarge()', function () {
-
- it('returns a 413 error statusCode', function (done) {
-
- expect(Boom.entityTooLarge().output.statusCode).to.equal(413);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.entityTooLarge('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('uriTooLong()', function () {
-
- it('returns a 414 error statusCode', function (done) {
-
- expect(Boom.uriTooLong().output.statusCode).to.equal(414);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.uriTooLong('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('unsupportedMediaType()', function () {
-
- it('returns a 415 error statusCode', function (done) {
-
- expect(Boom.unsupportedMediaType().output.statusCode).to.equal(415);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.unsupportedMediaType('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('rangeNotSatisfiable()', function () {
-
- it('returns a 416 error statusCode', function (done) {
-
- expect(Boom.rangeNotSatisfiable().output.statusCode).to.equal(416);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.rangeNotSatisfiable('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('expectationFailed()', function () {
-
- it('returns a 417 error statusCode', function (done) {
-
- expect(Boom.expectationFailed().output.statusCode).to.equal(417);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.expectationFailed('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('badData()', function () {
-
- it('returns a 422 error statusCode', function (done) {
-
- expect(Boom.badData().output.statusCode).to.equal(422);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.badData('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('tooManyRequests()', function () {
-
- it('returns a 429 error statusCode', function (done) {
-
- expect(Boom.tooManyRequests().output.statusCode).to.equal(429);
- done();
- });
-
- it('sets the message with the passed-in message', function (done) {
-
- expect(Boom.tooManyRequests('my message').message).to.equal('my message');
- done();
- });
-});
-
-describe('serverTimeout()', function () {
-
- it('returns a 503 error statusCode', function (done) {
-
- expect(Boom.serverTimeout().output.statusCode).to.equal(503);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.serverTimeout('my message').message).to.equal('my message');
- done();
- });
-});
-
-describe('forbidden()', function () {
-
- it('returns a 403 error statusCode', function (done) {
-
- expect(Boom.forbidden().output.statusCode).to.equal(403);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.forbidden('my message').message).to.equal('my message');
- done();
- });
-});
-
-describe('notFound()', function () {
-
- it('returns a 404 error statusCode', function (done) {
-
- expect(Boom.notFound().output.statusCode).to.equal(404);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.notFound('my message').message).to.equal('my message');
- done();
- });
-});
-
-describe('internal()', function () {
-
- it('returns a 500 error statusCode', function (done) {
-
- expect(Boom.internal().output.statusCode).to.equal(500);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- var err = Boom.internal('my message');
- expect(err.message).to.equal('my message');
- expect(err.isServer).to.true();
- expect(err.output.payload.message).to.equal('An internal server error occurred');
- done();
- });
-
- it('passes data on the callback if its passed in', function (done) {
-
- expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data');
- done();
- });
-
- it('returns an error with composite message', function (done) {
-
- try {
- JSON.parse('{');
- }
- catch (err) {
- var boom = Boom.internal('Someting bad', err);
- expect(boom.message).to.equal('Someting bad: Unexpected end of input');
- expect(boom.isServer).to.be.true();
- done();
- }
- });
-});
-
-describe('notImplemented()', function () {
-
- it('returns a 501 error statusCode', function (done) {
-
- expect(Boom.notImplemented().output.statusCode).to.equal(501);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.notImplemented('my message').message).to.equal('my message');
- done();
- });
-});
-
-
-describe('badGateway()', function () {
-
- it('returns a 502 error statusCode', function (done) {
-
- expect(Boom.badGateway().output.statusCode).to.equal(502);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.badGateway('my message').message).to.equal('my message');
- done();
- });
-});
-
-describe('gatewayTimeout()', function () {
-
- it('returns a 504 error statusCode', function (done) {
-
- expect(Boom.gatewayTimeout().output.statusCode).to.equal(504);
- done();
- });
-
- it('sets the message with the passed in message', function (done) {
-
- expect(Boom.gatewayTimeout('my message').message).to.equal('my message');
- done();
- });
-});
-
-describe('badImplementation()', function () {
-
- it('returns a 500 error statusCode', function (done) {
-
- var err = Boom.badImplementation();
- expect(err.output.statusCode).to.equal(500);
- expect(err.isDeveloperError).to.equal(true);
- expect(err.isServer).to.be.true();
- done();
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore b/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore
deleted file mode 100644
index 77ba16c..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore
+++ /dev/null
@@ -1,18 +0,0 @@
-.idea
-*.iml
-npm-debug.log
-dump.rdb
-node_modules
-results.tap
-results.xml
-npm-shrinkwrap.json
-config.json
-.DS_Store
-*/.DS_Store
-*/*/.DS_Store
-._*
-*/._*
-*/*/._*
-coverage.*
-lib-cov
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml
deleted file mode 100755
index 047f7e3..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-
-node_js:
- - 0.10
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE b/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE
deleted file mode 100755
index cda4473..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2014, Eran Hammer and other contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * The names of any contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- * * *
-
-The complete list of contributors can be found at: https://github.com/hueniverse/cryptiles/graphs/contributors
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile b/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile
deleted file mode 100755
index 3a89298..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-test:
- node node_modules/lab/bin/lab
-test-cov:
- node node_modules/lab/bin/lab -t 100
-test-cov-html:
- node node_modules/lab/bin/lab -r html -o coverage.html
-
-.PHONY: test test-cov test-cov-html
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md b/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md
deleted file mode 100644
index be943f8..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-cryptiles
-=========
-
-General purpose crypto utilities
-
-[](http://travis-ci.org/hapijs/cryptiles)
-
-## Methods
-
-### `randomString(<Number> size)`
-Returns a cryptographically strong pseudo-random data string. Takes a size argument for the length of the string.
-
-### `fixedTimeComparison(<String> a, <String> b)`
-Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match). Returns `true` if the strings match, `false` if they differ.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js b/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js
deleted file mode 100755
index 4cc88b3..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
deleted file mode 100755
index f385870..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// Load modules
-
-var Crypto = require('crypto');
-var Boom = require('boom');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Generate a cryptographically strong pseudo-random data
-
-exports.randomString = function (size) {
-
- var buffer = exports.randomBits((size + 1) * 6);
- if (buffer instanceof Error) {
- return buffer;
- }
-
- var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
- return string.slice(0, size);
-};
-
-
-exports.randomBits = function (bits) {
-
- if (!bits ||
- bits < 0) {
-
- return Boom.internal('Invalid random bits count');
- }
-
- var bytes = Math.ceil(bits / 8);
- try {
- return Crypto.randomBytes(bytes);
- }
- catch (err) {
- return Boom.internal('Failed generating random bits: ' + err.message);
- }
-};
-
-
-// Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match)
-
-exports.fixedTimeComparison = function (a, b) {
-
- if (typeof a !== 'string' ||
- typeof b !== 'string') {
-
- return false;
- }
-
- var mismatch = (a.length === b.length ? 0 : 1);
- if (mismatch) {
- b = a;
- }
-
- for (var i = 0, il = a.length; i < il; ++i) {
- var ac = a.charCodeAt(i);
- var bc = b.charCodeAt(i);
- mismatch |= (ac ^ bc);
- }
-
- return (mismatch === 0);
-};
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json b/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
deleted file mode 100755
index 18fee92..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "name": "cryptiles",
- "description": "General purpose crypto utilities",
- "version": "2.0.4",
- "author": {
- "name": "Eran Hammer",
- "email": "eran@hammer.io",
- "url": "http://hueniverse.com"
- },
- "contributors": [],
- "repository": {
- "type": "git",
- "url": "git://github.com/hapijs/cryptiles"
- },
- "main": "index",
- "keywords": [
- "cryptography",
- "security",
- "utilites"
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "dependencies": {
- "boom": "2.x.x"
- },
- "devDependencies": {
- "lab": "4.x.x"
- },
- "scripts": {
- "test": "make test-cov"
- },
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/hapijs/cryptiles/raw/master/LICENSE"
- }
- ],
- "gitHead": "944263dbb628b9b3da542d35600d587f861eeaf0",
- "bugs": {
- "url": "https://github.com/hapijs/cryptiles/issues"
- },
- "homepage": "https://github.com/hapijs/cryptiles",
- "_id": "cryptiles@2.0.4",
- "_shasum": "09ea1775b9e1c7de7e60a99d42ab6f08ce1a1285",
- "_from": "cryptiles@>=2.0.0 <3.0.0",
- "_npmVersion": "1.4.23",
- "_npmUser": {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- },
- "maintainers": [
- {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- }
- ],
- "dist": {
- "shasum": "09ea1775b9e1c7de7e60a99d42ab6f08ce1a1285",
- "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-2.0.4.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.4.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js b/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js
deleted file mode 100755
index 3340141..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// Load modules
-
-var Lab = require('lab');
-var Cryptiles = require('../lib');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var before = lab.before;
-var after = lab.after;
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Lab.expect;
-
-
-describe('Cryptiles', function () {
-
- describe('#randomString', function () {
-
- it('should generate the right length string', function (done) {
-
- for (var i = 1; i <= 1000; ++i) {
- expect(Cryptiles.randomString(i).length).to.equal(i);
- }
-
- done();
- });
-
- it('returns an error on invalid bits size', function (done) {
-
- expect(Cryptiles.randomString(99999999999999999999).message).to.equal('Failed generating random bits: Argument #1 must be number > 0');
- done();
- });
- });
-
- describe('#randomBits', function () {
-
- it('returns an error on invalid input', function (done) {
-
- expect(Cryptiles.randomBits(0).message).to.equal('Invalid random bits count');
- done();
- });
- });
-
- describe('#fixedTimeComparison', function () {
-
- var a = Cryptiles.randomString(50000);
- var b = Cryptiles.randomString(150000);
-
- it('should take the same amount of time comparing different string sizes', function (done) {
-
- var now = Date.now();
- Cryptiles.fixedTimeComparison(b, a);
- var t1 = Date.now() - now;
-
- now = Date.now();
- Cryptiles.fixedTimeComparison(b, b);
- var t2 = Date.now() - now;
-
- expect(t2 - t1).to.be.within(-20, 20);
- done();
- });
-
- it('should return true for equal strings', function (done) {
-
- expect(Cryptiles.fixedTimeComparison(a, a)).to.equal(true);
- done();
- });
-
- it('should return false for different strings (size, a < b)', function (done) {
-
- expect(Cryptiles.fixedTimeComparison(a, a + 'x')).to.equal(false);
- done();
- });
-
- it('should return false for different strings (size, a > b)', function (done) {
-
- expect(Cryptiles.fixedTimeComparison(a + 'x', a)).to.equal(false);
- done();
- });
-
- it('should return false for different strings (size, a = b)', function (done) {
-
- expect(Cryptiles.fixedTimeComparison(a + 'x', a + 'y')).to.equal(false);
- done();
- });
-
- it('should return false when not a string', function (done) {
-
- expect(Cryptiles.fixedTimeComparison('x', null)).to.equal(false);
- done();
- });
-
- it('should return false when not a string (left)', function (done) {
-
- expect(Cryptiles.fixedTimeComparison(null, 'x')).to.equal(false);
- done();
- });
- });
-});
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore b/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore
deleted file mode 100644
index 7e1574d..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore
+++ /dev/null
@@ -1,18 +0,0 @@
-.idea
-*.iml
-npm-debug.log
-dump.rdb
-node_modules
-results.tap
-results.xml
-npm-shrinkwrap.json
-config.json
-.DS_Store
-*/.DS_Store
-*/*/.DS_Store
-._*
-*/._*
-*/*/._*
-coverage.*
-lib-cov
-complexity.md
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml
deleted file mode 100755
index c84aade..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: node_js
-
-node_js:
- - 0.10
- - 0.12
- - iojs
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md b/node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md
deleted file mode 100644
index 8928361..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md
+++ /dev/null
@@ -1 +0,0 @@
-Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE b/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE
deleted file mode 100755
index 5530904..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright (c) 2011-2014, Walmart and other contributors.
-Copyright (c) 2011, Yahoo Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * The names of any contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- * * *
-
-The complete list of contributors can be found at: https://github.com/hapijs/hapi/graphs/contributors
-Portions of this project were initially based on the Yahoo! Inc. Postmile project,
-published at https://github.com/yahoo/postmile.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile b/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile
deleted file mode 100755
index 83aaf0c..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-test:
- @node node_modules/lab/bin/lab -a code
-test-cov:
- @node node_modules/lab/bin/lab -a code -t 100 -L
-test-cov-html:
- @node node_modules/lab/bin/lab -a code -r html -o coverage.html
-
-.PHONY: test test-cov test-cov-html
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/README.md b/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
deleted file mode 100755
index 19357bb..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
+++ /dev/null
@@ -1,574 +0,0 @@
-
-
-Utility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore).
-
-[](http://travis-ci.org/hapijs/hoek)
-
-Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
-
-# Table of Contents
-
-* [Introduction](#introduction "Introduction")
-* [Object](#object "Object")
- * [clone](#cloneobj "clone")
- * [cloneWithShallow](#clonewithshallowobj-keys "cloneWithShallow")
- * [merge](#mergetarget-source-isnulloverride-ismergearrays "merge")
- * [applyToDefaults](#applytodefaultsdefaults-options-isnulloverride "applyToDefaults")
- * [applyToDefaultsWithShallow](#applytodefaultswithshallowdefaults-options-keys "applyToDefaultsWithShallow")
- * [deepEqual](#deepequala-b "deepEqual")
- * [unique](#uniquearray-key "unique")
- * [mapToObject](#maptoobjectarray-key "mapToObject")
- * [intersect](#intersectarray1-array2 "intersect")
- * [contain](#containref-values-options "contain")
- * [flatten](#flattenarray-target "flatten")
- * [reach](#reachobj-chain-options "reach")
- * [reachTemplate](#reachobj-template-options "reachTemplate")
- * [transform](#transformobj-transform-options "transform")
- * [shallow](#shallowobj "shallow")
- * [stringify](#stringifyobj "stringify")
-* [Timer](#timer "Timer")
-* [Bench](#bench "Bench")
-* [Binary Encoding/Decoding](#binary-encodingdecoding "Binary Encoding/Decoding")
- * [base64urlEncode](#base64urlencodevalue "binary64urlEncode")
- * [base64urlDecode](#base64urldecodevalue "binary64urlDecode")
-* [Escaping Characters](#escaping-characters "Escaping Characters")
- * [escapeHtml](#escapehtmlstring "escapeHtml")
- * [escapeHeaderAttribute](#escapeheaderattributeattribute "escapeHeaderAttribute")
- * [escapeRegex](#escaperegexstring "escapeRegex")
-* [Errors](#errors "Errors")
- * [assert](#assertcondition-message "assert")
- * [abort](#abortmessage "abort")
- * [displayStack](#displaystackslice "displayStack")
- * [callStack](#callstackslice "callStack")
-* [Function](#function "Function")
- * [nextTick](#nexttickfn "nextTick")
- * [once](#oncefn "once")
- * [ignore](#ignore "ignore")
-* [Miscellaneous](#miscellaneous "Miscellaneous")
- * [uniqueFilename](#uniquefilename "uniqueFilename")
- * [isInteger](#isInteger "isInteger")
-
-
-
-# Introduction
-
-The *Hoek* library contains some common functions used within the hapi ecosystem. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.
-
-For example, to use Hoek to set configuration with default options:
-```javascript
-var Hoek = require('hoek');
-
-var default = {url : "www.github.com", port : "8000", debug : true};
-
-var config = Hoek.applyToDefaults(default, {port : "3000", admin : true});
-
-// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }
-```
-
-Under each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the `var Hoek = require('hoek');` is omitted for brevity.
-
-## Object
-
-Hoek provides several helpful methods for objects and arrays.
-
-### clone(obj)
-
-This method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects, as well as non-enumerable properties).
-
-```javascript
-
-var nestedObj = {
- w: /^something$/ig,
- x: {
- a: [1, 2, 3],
- b: 123456,
- c: new Date()
- },
- y: 'y',
- z: new Date()
- };
-
-var copy = Hoek.clone(nestedObj);
-
-copy.x.b = 100;
-
-console.log(copy.y); // results in 'y'
-console.log(nestedObj.x.b); // results in 123456
-console.log(copy.x.b); // results in 100
-```
-
-### cloneWithShallow(obj, keys)
-keys is an array of key names to shallow copy
-
-This method is also used to clone an object or array, however any keys listed in the `keys` array are shallow copied while those not listed are deep copied.
-
-```javascript
-
-var nestedObj = {
- w: /^something$/ig,
- x: {
- a: [1, 2, 3],
- b: 123456,
- c: new Date()
- },
- y: 'y',
- z: new Date()
- };
-
-var copy = Hoek.cloneWithShallow(nestedObj, ['x']);
-
-copy.x.b = 100;
-
-console.log(copy.y); // results in 'y'
-console.log(nestedObj.x.b); // results in 100
-console.log(copy.x.b); // results in 100
-```
-
-### merge(target, source, isNullOverride, isMergeArrays)
-isNullOverride, isMergeArrays default to true
-
-Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied.
-Merge is destructive where the target is modified. For non destructive merge, use `applyToDefaults`.
-
-
-```javascript
-
-var target = {a: 1, b : 2};
-var source = {a: 0, c: 5};
-var source2 = {a: null, c: 5};
-
-Hoek.merge(target, source); // results in {a: 0, b: 2, c: 5}
-Hoek.merge(target, source2); // results in {a: null, b: 2, c: 5}
-Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}
-
-var targetArray = [1, 2, 3];
-var sourceArray = [4, 5];
-
-Hoek.merge(targetArray, sourceArray); // results in [1, 2, 3, 4, 5]
-Hoek.merge(targetArray, sourceArray, true, false); // results in [4, 5]
-```
-
-### applyToDefaults(defaults, options, isNullOverride)
-isNullOverride defaults to false
-
-Apply options to a copy of the defaults
-
-```javascript
-
-var defaults = { host: "localhost", port: 8000 };
-var options = { port: 8080 };
-
-var config = Hoek.applyToDefaults(defaults, options); // results in { host: "localhost", port: 8080 }
-```
-
-Apply options with a null value to a copy of the defaults
-
-```javascript
-
-var defaults = { host: "localhost", port: 8000 };
-var options = { host: null, port: 8080 };
-
-var config = Hoek.applyToDefaults(defaults, options, true); // results in { host: null, port: 8080 }
-```
-
-### applyToDefaultsWithShallow(defaults, options, keys)
-keys is an array of key names to shallow copy
-
-Apply options to a copy of the defaults. Keys specified in the last parameter are shallow copied from options instead of merged.
-
-```javascript
-
-var defaults = {
- server: {
- host: "localhost",
- port: 8000
- },
- name: 'example'
- };
-
-var options = { server: { port: 8080 } };
-
-var config = Hoek.applyToDefaults(defaults, options); // results in { server: { port: 8080 }, name: 'example' }
-```
-
-### deepEqual(b, a, [options])
-
-Performs a deep comparison of the two values including support for circular dependencies, prototype, and properties. To skip prototype comparisons, use `options.prototype = false`
-
-```javascript
-Hoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true
-Hoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true
-Hoek.deepEqual(Object.create(null), {}); //results in false
-```
-
-### unique(array, key)
-
-Remove duplicate items from Array
-
-```javascript
-
-var array = [1, 2, 2, 3, 3, 4, 5, 6];
-
-var newArray = Hoek.unique(array); // results in [1,2,3,4,5,6]
-
-array = [{id: 1}, {id: 1}, {id: 2}];
-
-newArray = Hoek.unique(array, "id"); // results in [{id: 1}, {id: 2}]
-```
-
-### mapToObject(array, key)
-
-Convert an Array into an Object
-
-```javascript
-
-var array = [1,2,3];
-var newObject = Hoek.mapToObject(array); // results in [{"1": true}, {"2": true}, {"3": true}]
-
-array = [{id: 1}, {id: 2}];
-newObject = Hoek.mapToObject(array, "id"); // results in [{"id": 1}, {"id": 2}]
-```
-
-### intersect(array1, array2)
-
-Find the common unique items in two arrays
-
-```javascript
-
-var array1 = [1, 2, 3];
-var array2 = [1, 4, 5];
-
-var newArray = Hoek.intersect(array1, array2); // results in [1]
-```
-
-### contain(ref, values, [options])
-
-Tests if the reference value contains the provided values where:
-- `ref` - the reference string, array, or object.
-- `values` - a single or array of values to find within the `ref` value. If `ref` is an object, `values` can be a key name,
- an array of key names, or an object with key-value pairs to compare.
-- `options` - an optional object with the following optional settings:
- - `deep` - if `true`, performed a deep comparison of the values.
- - `once` - if `true`, allows only one occurrence of each value.
- - `only` - if `true`, does not allow values not explicitly listed.
- - `part` - if `true`, allows partial match of the values (at least one must always match).
-
-Note: comparing a string to overlapping values will result in failed comparison (e.g. `contain('abc', ['ab', 'bc'])`).
-Also, if an object key's value does not match the provided value, `false` is returned even when `part` is specified.
-
-```javascript
-Hoek.contain('aaa', 'a', { only: true }); // true
-Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true }); // true
-Hoek.contain([1, 2, 2], [1, 2], { once: true }); // false
-Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true
-```
-
-### flatten(array, [target])
-
-Flatten an array
-
-```javascript
-
-var array = [1, [2, 3]];
-
-var flattenedArray = Hoek.flatten(array); // results in [1, 2, 3]
-
-array = [1, [2, 3]];
-target = [4, [5]];
-
-flattenedArray = Hoek.flatten(array, target); // results in [4, [5], 1, 2, 3]
-```
-
-### reach(obj, chain, [options])
-
-Converts an object key chain string to reference
-
-- `options` - optional settings
- - `separator` - string to split chain path on, defaults to '.'
- - `default` - value to return if the path or value is not present, default is `undefined`
- - `strict` - if `true`, will throw an error on missing member, default is `false`
- - `functions` - if `true` allow traversing functions for properties. `false` will throw an error if a function is part of the chain.
-
-A chain including negative numbers will work like negative indices on an
-array.
-
-```javascript
-
-var chain = 'a.b.c';
-var obj = {a : {b : { c : 1}}};
-
-Hoek.reach(obj, chain); // returns 1
-
-var chain = 'a.b.-1';
-var obj = {a : {b : [2,3,6]}};
-
-Hoek.reach(obj, chain); // returns 6
-```
-
-### reachTemplate(obj, template, [options])
-
-Replaces string parameters (`{name}`) with their corresponding object key values by applying the
-(`reach()`)[#reachobj-chain-options] method where:
-
-- `obj` - the context object used for key lookup.
-- `template` - a string containing `{}` parameters.
-- `options` - optional (`reach()`)[#reachobj-chain-options] options.
-
-```javascript
-
-var chain = 'a.b.c';
-var obj = {a : {b : { c : 1}}};
-
-Hoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'
-```
-
-### transform(obj, transform, [options])
-
-Transforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options.
-
-```javascript
-var source = {
- address: {
- one: '123 main street',
- two: 'PO Box 1234'
- },
- title: 'Warehouse',
- state: 'CA'
-};
-
-var result = Hoek.transform(source, {
- 'person.address.lineOne': 'address.one',
- 'person.address.lineTwo': 'address.two',
- 'title': 'title',
- 'person.address.region': 'state'
-});
-// Results in
-// {
-// person: {
-// address: {
-// lineOne: '123 main street',
-// lineTwo: 'PO Box 1234',
-// region: 'CA'
-// }
-// },
-// title: 'Warehouse'
-// }
-```
-
-### shallow(obj)
-
-Performs a shallow copy by copying the references of all the top level children where:
-- `obj` - the object to be copied.
-
-```javascript
-var shallow = Hoek.shallow({ a: { b: 1 } });
-```
-
-### stringify(obj)
-
-Converts an object to string using the built-in `JSON.stringify()` method with the difference that any errors are caught
-and reported back in the form of the returned string. Used as a shortcut for displaying information to the console (e.g. in
-error message) without the need to worry about invalid conversion.
-
-```javascript
-var a = {};
-a.b = a;
-Hoek.stringify(a); // Returns '[Cannot display object: Converting circular structure to JSON]'
-```
-
-# Timer
-
-A Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
-
-```javascript
-
-var timerObj = new Hoek.Timer();
-console.log("Time is now: " + timerObj.ts);
-console.log("Elapsed time from initialization: " + timerObj.elapsed() + 'milliseconds');
-```
-
-
-# Bench
-
-Same as Timer with the exception that `ts` stores the internal node clock which is not related to `Date.now()` and cannot be used to display
-human-readable timestamps. More accurate for benchmarking or internal timers.
-
-# Binary Encoding/Decoding
-
-### base64urlEncode(value)
-
-Encodes value in Base64 or URL encoding
-
-### base64urlDecode(value)
-
-Decodes data in Base64 or URL encoding.
-# Escaping Characters
-
-Hoek provides convenient methods for escaping html characters. The escaped characters are as followed:
-
-```javascript
-
-internals.htmlEscaped = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '`': '`'
-};
-```
-
-### escapeHtml(string)
-
-```javascript
-
-var string = '<html> hey </html>';
-var escapedString = Hoek.escapeHtml(string); // returns <html> hey </html>
-```
-
-### escapeHeaderAttribute(attribute)
-
-Escape attribute value for use in HTTP header
-
-```javascript
-
-var a = Hoek.escapeHeaderAttribute('I said "go w\\o me"'); //returns I said \"go w\\o me\"
-```
-
-
-### escapeRegex(string)
-
-Escape string for Regex construction
-
-```javascript
-
-var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); // returns 4\^f\$s\.4\*5\+\-_\?%\=#\!\:@\|~\\\/`"\(>\)\[<\]d\{\}s\,
-```
-
-# Errors
-
-### assert(condition, message)
-
-```javascript
-
-var a = 1, b = 2;
-
-Hoek.assert(a === b, 'a should equal b'); // Throws 'a should equal b'
-```
-
-Note that you may also pass an already created Error object as the second parameter, and `assert` will throw that object.
-
-```javascript
-
-var a = 1, b = 2;
-
-Hoek.assert(a === b, new Error('a should equal b')); // Throws the given error object
-```
-
-### abort(message)
-
-First checks if `process.env.NODE_ENV === 'test'`, and if so, throws error message. Otherwise,
-displays most recent stack and then exits process.
-
-
-
-### displayStack(slice)
-
-Displays the trace stack
-
-```javascript
-
-var stack = Hoek.displayStack();
-console.log(stack); // returns something like:
-
-[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',
- 'Module._compile (module.js:449:26)',
- 'Module._extensions..js (module.js:467:10)',
- 'Module.load (module.js:356:32)',
- 'Module._load (module.js:312:12)',
- 'Module.runMain (module.js:492:10)',
- 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]
-```
-
-### callStack(slice)
-
-Returns a trace stack array.
-
-```javascript
-
-var stack = Hoek.callStack();
-console.log(stack); // returns something like:
-
-[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],
- [ 'module.js', 449, 26, 'Module._compile', false ],
- [ 'module.js', 467, 10, 'Module._extensions..js', false ],
- [ 'module.js', 356, 32, 'Module.load', false ],
- [ 'module.js', 312, 12, 'Module._load', false ],
- [ 'module.js', 492, 10, 'Module.runMain', false ],
- [ 'node.js',
- 244,
- 9,
- 'startup.processNextTick.process._tickCallback',
- false ] ]
-```
-
-## Function
-
-### nextTick(fn)
-
-Returns a new function that wraps `fn` in `process.nextTick`.
-
-```javascript
-
-var myFn = function () {
- console.log('Do this later');
-};
-
-var nextFn = Hoek.nextTick(myFn);
-
-nextFn();
-console.log('Do this first');
-
-// Results in:
-//
-// Do this first
-// Do this later
-```
-
-### once(fn)
-
-Returns a new function that can be run multiple times, but makes sure `fn` is only run once.
-
-```javascript
-
-var myFn = function () {
- console.log('Ran myFn');
-};
-
-var onceFn = Hoek.once(myFn);
-onceFn(); // results in "Ran myFn"
-onceFn(); // results in undefined
-```
-
-### ignore
-
-A simple no-op function. It does nothing at all.
-
-## Miscellaneous
-
-### uniqueFilename(path, extension)
-`path` to prepend with the randomly generated file name. `extension` is the optional file extension, defaults to `''`.
-
-Returns a randomly generated file name at the specified `path`. The result is a fully resolved path to a file.
-
-```javascript
-var result = Hoek.uniqueFilename('./test/modules', 'txt'); // results in "full/path/test/modules/{random}.txt"
-```
-
-### isInteger(value)
-
-Check `value` to see if it is an integer. Returns true/false.
-
-```javascript
-var result = Hoek.isInteger('23')
-```
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png b/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png
deleted file mode 100755
index 6ccfcb1..0000000
Binary files a/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/index.js b/node_modules/request/node_modules/hawk/node_modules/hoek/index.js
deleted file mode 100755
index bb0a047..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib');
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
deleted file mode 100755
index 9ecde66..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
+++ /dev/null
@@ -1,132 +0,0 @@
-// Declare internals
-
-var internals = {};
-
-
-exports.escapeJavaScript = function (input) {
-
- if (!input) {
- return '';
- }
-
- var escaped = '';
-
- for (var i = 0, il = input.length; i < il; ++i) {
-
- var charCode = input.charCodeAt(i);
-
- if (internals.isSafe(charCode)) {
- escaped += input[i];
- }
- else {
- escaped += internals.escapeJavaScriptChar(charCode);
- }
- }
-
- return escaped;
-};
-
-
-exports.escapeHtml = function (input) {
-
- if (!input) {
- return '';
- }
-
- var escaped = '';
-
- for (var i = 0, il = input.length; i < il; ++i) {
-
- var charCode = input.charCodeAt(i);
-
- if (internals.isSafe(charCode)) {
- escaped += input[i];
- }
- else {
- escaped += internals.escapeHtmlChar(charCode);
- }
- }
-
- return escaped;
-};
-
-
-internals.escapeJavaScriptChar = function (charCode) {
-
- if (charCode >= 256) {
- return '\\u' + internals.padLeft('' + charCode, 4);
- }
-
- var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
- return '\\x' + internals.padLeft(hexValue, 2);
-};
-
-
-internals.escapeHtmlChar = function (charCode) {
-
- var namedEscape = internals.namedHtml[charCode];
- if (typeof namedEscape !== 'undefined') {
- return namedEscape;
- }
-
- if (charCode >= 256) {
- return '&#' + charCode + ';';
- }
-
- var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
- return '&#x' + internals.padLeft(hexValue, 2) + ';';
-};
-
-
-internals.padLeft = function (str, len) {
-
- while (str.length < len) {
- str = '0' + str;
- }
-
- return str;
-};
-
-
-internals.isSafe = function (charCode) {
-
- return (typeof internals.safeCharCodes[charCode] !== 'undefined');
-};
-
-
-internals.namedHtml = {
- '38': '&',
- '60': '<',
- '62': '>',
- '34': '"',
- '160': ' ',
- '162': '¢',
- '163': '£',
- '164': '¤',
- '169': '©',
- '174': '®'
-};
-
-
-internals.safeCharCodes = (function () {
-
- var safe = {};
-
- for (var i = 32; i < 123; ++i) {
-
- if ((i >= 97) || // a-z
- (i >= 65 && i <= 90) || // A-Z
- (i >= 48 && i <= 57) || // 0-9
- i === 32 || // space
- i === 46 || // .
- i === 44 || // ,
- i === 45 || // -
- i === 58 || // :
- i === 95) { // _
-
- safe[i] = null;
- }
- }
-
- return safe;
-}());
[25/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/lib/store.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/store.js b/node_modules/request/node_modules/tough-cookie/lib/store.js
deleted file mode 100644
index ad69c14..0000000
--- a/node_modules/request/node_modules/tough-cookie/lib/store.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-'use strict';
-/*jshint unused:false */
-
-function Store() {
-}
-exports.Store = Store;
-
-// Stores may be synchronous, but are still required to use a
-// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync"
-// API that converts from synchronous-callbacks to imperative style.
-Store.prototype.synchronous = false;
-
-Store.prototype.findCookie = function(domain, path, key, cb) {
- throw new Error('findCookie is not implemented');
-};
-
-Store.prototype.findCookies = function(domain, path, cb) {
- throw new Error('findCookies is not implemented');
-};
-
-Store.prototype.putCookie = function(cookie, cb) {
- throw new Error('putCookie is not implemented');
-};
-
-Store.prototype.updateCookie = function(oldCookie, newCookie, cb) {
- // recommended default implementation:
- // return this.putCookie(newCookie, cb);
- throw new Error('updateCookie is not implemented');
-};
-
-Store.prototype.removeCookie = function(domain, path, key, cb) {
- throw new Error('removeCookie is not implemented');
-};
-
-Store.prototype.removeCookies = function removeCookies(domain, path, cb) {
- throw new Error('removeCookies is not implemented');
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/package.json b/node_modules/request/node_modules/tough-cookie/package.json
deleted file mode 100644
index f38a15d..0000000
--- a/node_modules/request/node_modules/tough-cookie/package.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "author": {
- "name": "Jeremy Stashewsky",
- "email": "jstashewsky@salesforce.com"
- },
- "license": "BSD-3-Clause",
- "name": "tough-cookie",
- "description": "RFC6265 Cookies and Cookie Jar for node.js",
- "keywords": [
- "HTTP",
- "cookie",
- "cookies",
- "set-cookie",
- "cookiejar",
- "jar",
- "RFC6265",
- "RFC2965"
- ],
- "version": "1.1.0",
- "homepage": "https://github.com/SalesforceEng/tough-cookie",
- "repository": {
- "type": "git",
- "url": "git://github.com/SalesforceEng/tough-cookie.git"
- },
- "bugs": {
- "url": "https://github.com/SalesforceEng/tough-cookie/issues"
- },
- "main": "./lib/cookie",
- "scripts": {
- "test": "vows test/*_test.js"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "devDependencies": {
- "vows": "0.7.0",
- "async": ">=0.1.12"
- },
- "gitHead": "ddbcc02c8c24726c68e36a67d5864291acfdf57d",
- "_id": "tough-cookie@1.1.0",
- "_shasum": "126d2490e66ae5286b6863debd4a341076915954",
- "_from": "tough-cookie@>=0.12.0",
- "_npmVersion": "2.7.4",
- "_nodeVersion": "0.12.2",
- "_npmUser": {
- "name": "jstash",
- "email": "jstash@gmail.com"
- },
- "dist": {
- "shasum": "126d2490e66ae5286b6863debd4a341076915954",
- "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-1.1.0.tgz"
- },
- "maintainers": [
- {
- "name": "jstash",
- "email": "jeremy@goinstant.com"
- },
- {
- "name": "goinstant",
- "email": "services@goinstant.com"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.1.0.tgz",
- "readme": "ERROR: No README data found!"
-}
[49/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch
deleted file mode 100644
index a06d5c0..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch
+++ /dev/null
@@ -1,604 +0,0 @@
-diff --git a/lib/util.js b/lib/util.js
-index a03e874..9074e8e 100644
---- a/lib/util.js
-+++ b/lib/util.js
-@@ -19,430 +19,6 @@
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
--var formatRegExp = /%[sdj%]/g;
--exports.format = function(f) {
-- if (!isString(f)) {
-- var objects = [];
-- for (var i = 0; i < arguments.length; i++) {
-- objects.push(inspect(arguments[i]));
-- }
-- return objects.join(' ');
-- }
--
-- var i = 1;
-- var args = arguments;
-- var len = args.length;
-- var str = String(f).replace(formatRegExp, function(x) {
-- if (x === '%%') return '%';
-- if (i >= len) return x;
-- switch (x) {
-- case '%s': return String(args[i++]);
-- case '%d': return Number(args[i++]);
-- case '%j':
-- try {
-- return JSON.stringify(args[i++]);
-- } catch (_) {
-- return '[Circular]';
-- }
-- default:
-- return x;
-- }
-- });
-- for (var x = args[i]; i < len; x = args[++i]) {
-- if (isNull(x) || !isObject(x)) {
-- str += ' ' + x;
-- } else {
-- str += ' ' + inspect(x);
-- }
-- }
-- return str;
--};
--
--
--// Mark that a method should not be used.
--// Returns a modified function which warns once by default.
--// If --no-deprecation is set, then it is a no-op.
--exports.deprecate = function(fn, msg) {
-- // Allow for deprecating things in the process of starting up.
-- if (isUndefined(global.process)) {
-- return function() {
-- return exports.deprecate(fn, msg).apply(this, arguments);
-- };
-- }
--
-- if (process.noDeprecation === true) {
-- return fn;
-- }
--
-- var warned = false;
-- function deprecated() {
-- if (!warned) {
-- if (process.throwDeprecation) {
-- throw new Error(msg);
-- } else if (process.traceDeprecation) {
-- console.trace(msg);
-- } else {
-- console.error(msg);
-- }
-- warned = true;
-- }
-- return fn.apply(this, arguments);
-- }
--
-- return deprecated;
--};
--
--
--var debugs = {};
--var debugEnviron;
--exports.debuglog = function(set) {
-- if (isUndefined(debugEnviron))
-- debugEnviron = process.env.NODE_DEBUG || '';
-- set = set.toUpperCase();
-- if (!debugs[set]) {
-- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
-- var pid = process.pid;
-- debugs[set] = function() {
-- var msg = exports.format.apply(exports, arguments);
-- console.error('%s %d: %s', set, pid, msg);
-- };
-- } else {
-- debugs[set] = function() {};
-- }
-- }
-- return debugs[set];
--};
--
--
--/**
-- * Echos the value of a value. Trys to print the value out
-- * in the best way possible given the different types.
-- *
-- * @param {Object} obj The object to print out.
-- * @param {Object} opts Optional options object that alters the output.
-- */
--/* legacy: obj, showHidden, depth, colors*/
--function inspect(obj, opts) {
-- // default options
-- var ctx = {
-- seen: [],
-- stylize: stylizeNoColor
-- };
-- // legacy...
-- if (arguments.length >= 3) ctx.depth = arguments[2];
-- if (arguments.length >= 4) ctx.colors = arguments[3];
-- if (isBoolean(opts)) {
-- // legacy...
-- ctx.showHidden = opts;
-- } else if (opts) {
-- // got an "options" object
-- exports._extend(ctx, opts);
-- }
-- // set default options
-- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
-- if (isUndefined(ctx.depth)) ctx.depth = 2;
-- if (isUndefined(ctx.colors)) ctx.colors = false;
-- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
-- if (ctx.colors) ctx.stylize = stylizeWithColor;
-- return formatValue(ctx, obj, ctx.depth);
--}
--exports.inspect = inspect;
--
--
--// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
--inspect.colors = {
-- 'bold' : [1, 22],
-- 'italic' : [3, 23],
-- 'underline' : [4, 24],
-- 'inverse' : [7, 27],
-- 'white' : [37, 39],
-- 'grey' : [90, 39],
-- 'black' : [30, 39],
-- 'blue' : [34, 39],
-- 'cyan' : [36, 39],
-- 'green' : [32, 39],
-- 'magenta' : [35, 39],
-- 'red' : [31, 39],
-- 'yellow' : [33, 39]
--};
--
--// Don't use 'blue' not visible on cmd.exe
--inspect.styles = {
-- 'special': 'cyan',
-- 'number': 'yellow',
-- 'boolean': 'yellow',
-- 'undefined': 'grey',
-- 'null': 'bold',
-- 'string': 'green',
-- 'date': 'magenta',
-- // "name": intentionally not styling
-- 'regexp': 'red'
--};
--
--
--function stylizeWithColor(str, styleType) {
-- var style = inspect.styles[styleType];
--
-- if (style) {
-- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
-- '\u001b[' + inspect.colors[style][1] + 'm';
-- } else {
-- return str;
-- }
--}
--
--
--function stylizeNoColor(str, styleType) {
-- return str;
--}
--
--
--function arrayToHash(array) {
-- var hash = {};
--
-- array.forEach(function(val, idx) {
-- hash[val] = true;
-- });
--
-- return hash;
--}
--
--
--function formatValue(ctx, value, recurseTimes) {
-- // Provide a hook for user-specified inspect functions.
-- // Check that value is an object with an inspect function on it
-- if (ctx.customInspect &&
-- value &&
-- isFunction(value.inspect) &&
-- // Filter out the util module, it's inspect function is special
-- value.inspect !== exports.inspect &&
-- // Also filter out any prototype objects using the circular check.
-- !(value.constructor && value.constructor.prototype === value)) {
-- var ret = value.inspect(recurseTimes, ctx);
-- if (!isString(ret)) {
-- ret = formatValue(ctx, ret, recurseTimes);
-- }
-- return ret;
-- }
--
-- // Primitive types cannot have properties
-- var primitive = formatPrimitive(ctx, value);
-- if (primitive) {
-- return primitive;
-- }
--
-- // Look up the keys of the object.
-- var keys = Object.keys(value);
-- var visibleKeys = arrayToHash(keys);
--
-- if (ctx.showHidden) {
-- keys = Object.getOwnPropertyNames(value);
-- }
--
-- // Some type of object without properties can be shortcutted.
-- if (keys.length === 0) {
-- if (isFunction(value)) {
-- var name = value.name ? ': ' + value.name : '';
-- return ctx.stylize('[Function' + name + ']', 'special');
-- }
-- if (isRegExp(value)) {
-- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
-- }
-- if (isDate(value)) {
-- return ctx.stylize(Date.prototype.toString.call(value), 'date');
-- }
-- if (isError(value)) {
-- return formatError(value);
-- }
-- }
--
-- var base = '', array = false, braces = ['{', '}'];
--
-- // Make Array say that they are Array
-- if (isArray(value)) {
-- array = true;
-- braces = ['[', ']'];
-- }
--
-- // Make functions say that they are functions
-- if (isFunction(value)) {
-- var n = value.name ? ': ' + value.name : '';
-- base = ' [Function' + n + ']';
-- }
--
-- // Make RegExps say that they are RegExps
-- if (isRegExp(value)) {
-- base = ' ' + RegExp.prototype.toString.call(value);
-- }
--
-- // Make dates with properties first say the date
-- if (isDate(value)) {
-- base = ' ' + Date.prototype.toUTCString.call(value);
-- }
--
-- // Make error with message first say the error
-- if (isError(value)) {
-- base = ' ' + formatError(value);
-- }
--
-- if (keys.length === 0 && (!array || value.length == 0)) {
-- return braces[0] + base + braces[1];
-- }
--
-- if (recurseTimes < 0) {
-- if (isRegExp(value)) {
-- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
-- } else {
-- return ctx.stylize('[Object]', 'special');
-- }
-- }
--
-- ctx.seen.push(value);
--
-- var output;
-- if (array) {
-- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
-- } else {
-- output = keys.map(function(key) {
-- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
-- });
-- }
--
-- ctx.seen.pop();
--
-- return reduceToSingleString(output, base, braces);
--}
--
--
--function formatPrimitive(ctx, value) {
-- if (isUndefined(value))
-- return ctx.stylize('undefined', 'undefined');
-- if (isString(value)) {
-- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
-- .replace(/'/g, "\\'")
-- .replace(/\\"/g, '"') + '\'';
-- return ctx.stylize(simple, 'string');
-- }
-- if (isNumber(value)) {
-- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
-- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
-- if (value === 0 && 1 / value < 0)
-- return ctx.stylize('-0', 'number');
-- return ctx.stylize('' + value, 'number');
-- }
-- if (isBoolean(value))
-- return ctx.stylize('' + value, 'boolean');
-- // For some reason typeof null is "object", so special case here.
-- if (isNull(value))
-- return ctx.stylize('null', 'null');
--}
--
--
--function formatError(value) {
-- return '[' + Error.prototype.toString.call(value) + ']';
--}
--
--
--function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
-- var output = [];
-- for (var i = 0, l = value.length; i < l; ++i) {
-- if (hasOwnProperty(value, String(i))) {
-- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
-- String(i), true));
-- } else {
-- output.push('');
-- }
-- }
-- keys.forEach(function(key) {
-- if (!key.match(/^\d+$/)) {
-- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
-- key, true));
-- }
-- });
-- return output;
--}
--
--
--function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
-- var name, str, desc;
-- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
-- if (desc.get) {
-- if (desc.set) {
-- str = ctx.stylize('[Getter/Setter]', 'special');
-- } else {
-- str = ctx.stylize('[Getter]', 'special');
-- }
-- } else {
-- if (desc.set) {
-- str = ctx.stylize('[Setter]', 'special');
-- }
-- }
-- if (!hasOwnProperty(visibleKeys, key)) {
-- name = '[' + key + ']';
-- }
-- if (!str) {
-- if (ctx.seen.indexOf(desc.value) < 0) {
-- if (isNull(recurseTimes)) {
-- str = formatValue(ctx, desc.value, null);
-- } else {
-- str = formatValue(ctx, desc.value, recurseTimes - 1);
-- }
-- if (str.indexOf('\n') > -1) {
-- if (array) {
-- str = str.split('\n').map(function(line) {
-- return ' ' + line;
-- }).join('\n').substr(2);
-- } else {
-- str = '\n' + str.split('\n').map(function(line) {
-- return ' ' + line;
-- }).join('\n');
-- }
-- }
-- } else {
-- str = ctx.stylize('[Circular]', 'special');
-- }
-- }
-- if (isUndefined(name)) {
-- if (array && key.match(/^\d+$/)) {
-- return str;
-- }
-- name = JSON.stringify('' + key);
-- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
-- name = name.substr(1, name.length - 2);
-- name = ctx.stylize(name, 'name');
-- } else {
-- name = name.replace(/'/g, "\\'")
-- .replace(/\\"/g, '"')
-- .replace(/(^"|"$)/g, "'");
-- name = ctx.stylize(name, 'string');
-- }
-- }
--
-- return name + ': ' + str;
--}
--
--
--function reduceToSingleString(output, base, braces) {
-- var numLinesEst = 0;
-- var length = output.reduce(function(prev, cur) {
-- numLinesEst++;
-- if (cur.indexOf('\n') >= 0) numLinesEst++;
-- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
-- }, 0);
--
-- if (length > 60) {
-- return braces[0] +
-- (base === '' ? '' : base + '\n ') +
-- ' ' +
-- output.join(',\n ') +
-- ' ' +
-- braces[1];
-- }
--
-- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
--}
--
--
- // NOTE: These type checking functions intentionally don't use `instanceof`
- // because it is fragile and can be easily faked with `Object.create()`.
- function isArray(ar) {
-@@ -522,166 +98,10 @@ function isPrimitive(arg) {
- exports.isPrimitive = isPrimitive;
-
- function isBuffer(arg) {
-- return arg instanceof Buffer;
-+ return Buffer.isBuffer(arg);
- }
- exports.isBuffer = isBuffer;
-
- function objectToString(o) {
- return Object.prototype.toString.call(o);
--}
--
--
--function pad(n) {
-- return n < 10 ? '0' + n.toString(10) : n.toString(10);
--}
--
--
--var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
-- 'Oct', 'Nov', 'Dec'];
--
--// 26 Feb 16:19:34
--function timestamp() {
-- var d = new Date();
-- var time = [pad(d.getHours()),
-- pad(d.getMinutes()),
-- pad(d.getSeconds())].join(':');
-- return [d.getDate(), months[d.getMonth()], time].join(' ');
--}
--
--
--// log is just a thin wrapper to console.log that prepends a timestamp
--exports.log = function() {
-- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
--};
--
--
--/**
-- * Inherit the prototype methods from one constructor into another.
-- *
-- * The Function.prototype.inherits from lang.js rewritten as a standalone
-- * function (not on Function.prototype). NOTE: If this file is to be loaded
-- * during bootstrapping this function needs to be rewritten using some native
-- * functions as prototype setup using normal JavaScript does not work as
-- * expected during bootstrapping (see mirror.js in r114903).
-- *
-- * @param {function} ctor Constructor function which needs to inherit the
-- * prototype.
-- * @param {function} superCtor Constructor function to inherit prototype from.
-- */
--exports.inherits = function(ctor, superCtor) {
-- ctor.super_ = superCtor;
-- ctor.prototype = Object.create(superCtor.prototype, {
-- constructor: {
-- value: ctor,
-- enumerable: false,
-- writable: true,
-- configurable: true
-- }
-- });
--};
--
--exports._extend = function(origin, add) {
-- // Don't do anything if add isn't an object
-- if (!add || !isObject(add)) return origin;
--
-- var keys = Object.keys(add);
-- var i = keys.length;
-- while (i--) {
-- origin[keys[i]] = add[keys[i]];
-- }
-- return origin;
--};
--
--function hasOwnProperty(obj, prop) {
-- return Object.prototype.hasOwnProperty.call(obj, prop);
--}
--
--
--// Deprecated old stuff.
--
--exports.p = exports.deprecate(function() {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- console.error(exports.inspect(arguments[i]));
-- }
--}, 'util.p: Use console.error() instead');
--
--
--exports.exec = exports.deprecate(function() {
-- return require('child_process').exec.apply(this, arguments);
--}, 'util.exec is now called `child_process.exec`.');
--
--
--exports.print = exports.deprecate(function() {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- process.stdout.write(String(arguments[i]));
-- }
--}, 'util.print: Use console.log instead');
--
--
--exports.puts = exports.deprecate(function() {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- process.stdout.write(arguments[i] + '\n');
-- }
--}, 'util.puts: Use console.log instead');
--
--
--exports.debug = exports.deprecate(function(x) {
-- process.stderr.write('DEBUG: ' + x + '\n');
--}, 'util.debug: Use console.error instead');
--
--
--exports.error = exports.deprecate(function(x) {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- process.stderr.write(arguments[i] + '\n');
-- }
--}, 'util.error: Use console.error instead');
--
--
--exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
-- var callbackCalled = false;
--
-- function call(a, b, c) {
-- if (callback && !callbackCalled) {
-- callback(a, b, c);
-- callbackCalled = true;
-- }
-- }
--
-- readStream.addListener('data', function(chunk) {
-- if (writeStream.write(chunk) === false) readStream.pause();
-- });
--
-- writeStream.addListener('drain', function() {
-- readStream.resume();
-- });
--
-- readStream.addListener('end', function() {
-- writeStream.end();
-- });
--
-- readStream.addListener('close', function() {
-- call();
-- });
--
-- readStream.addListener('error', function(err) {
-- writeStream.end();
-- call(err);
-- });
--
-- writeStream.addListener('error', function(err) {
-- readStream.destroy();
-- call(err);
-- });
--}, 'util.pump(): Use readableStream.pipe() instead');
--
--
--var uv;
--exports._errnoException = function(err, syscall) {
-- if (isUndefined(uv)) uv = process.binding('uv');
-- var errname = uv.errname(err);
-- var e = new Error(syscall + ' ' + errname);
-- e.code = errname;
-- e.errno = errname;
-- e.syscall = syscall;
-- return e;
--};
-+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
deleted file mode 100644
index 9074e8e..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) &&
- (objectToString(e) === '[object Error]' || e instanceof Error);
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-function isBuffer(arg) {
- return Buffer.isBuffer(arg);
-}
-exports.isBuffer = isBuffer;
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
deleted file mode 100644
index 4eb9ce4..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "name": "core-util-is",
- "version": "1.0.1",
- "description": "The `util.is*` functions introduced in Node v0.12.",
- "main": "lib/util.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/core-util-is"
- },
- "keywords": [
- "util",
- "isBuffer",
- "isArray",
- "isNumber",
- "isString",
- "isRegExp",
- "isThis",
- "isThat",
- "polyfill"
- ],
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/isaacs/core-util-is/issues"
- },
- "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/isaacs/core-util-is",
- "_id": "core-util-is@1.0.1",
- "dist": {
- "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
- },
- "_from": "core-util-is@>=1.0.0 <1.1.0",
- "_npmVersion": "1.3.23",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "directories": {},
- "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz",
- "scripts": {}
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
deleted file mode 100644
index 007fa10..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) && objectToString(e) === '[object Error]';
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-function isBuffer(arg) {
- return arg instanceof Buffer;
-}
-exports.isBuffer = isBuffer;
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE
deleted file mode 100644
index dea3013..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md
deleted file mode 100644
index b1c5665..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-Browser-friendly inheritance fully compatible with standard node.js
-[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
-
-This package exports standard `inherits` from node.js `util` module in
-node environment, but also provides alternative browser-friendly
-implementation through [browser
-field](https://gist.github.com/shtylman/4339901). Alternative
-implementation is a literal copy of standard one located in standalone
-module to avoid requiring of `util`. It also has a shim for old
-browsers with no `Object.create` support.
-
-While keeping you sure you are using standard `inherits`
-implementation in node.js environment, it allows bundlers such as
-[browserify](https://github.com/substack/node-browserify) to not
-include full `util` package to your client code if all you need is
-just `inherits` function. It worth, because browser shim for `util`
-package is large and `inherits` is often the single function you need
-from it.
-
-It's recommended to use this package instead of
-`require('util').inherits` for any code that has chances to be used
-not only in node.js but in browser too.
-
-## usage
-
-```js
-var inherits = require('inherits');
-// then use exactly as the standard one
-```
-
-## note on version ~1.0
-
-Version ~1.0 had completely different motivation and is not compatible
-neither with 2.0 nor with standard node.js `inherits`.
-
-If you are using version ~1.0 and planning to switch to ~2.0, be
-careful:
-
-* new version uses `super_` instead of `super` for referencing
- superclass
-* new version overwrites current prototype while old one preserves any
- existing fields on it
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js
deleted file mode 100644
index 29f5e24..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('util').inherits
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js
deleted file mode 100644
index c1e78a7..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js
+++ /dev/null
@@ -1,23 +0,0 @@
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json
deleted file mode 100644
index 15d6b42..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "inherits",
- "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
- "version": "2.0.1",
- "keywords": [
- "inheritance",
- "class",
- "klass",
- "oop",
- "object-oriented",
- "inherits",
- "browser",
- "browserify"
- ],
- "main": "./inherits.js",
- "browser": "./inherits_browser.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/inherits"
- },
- "license": "ISC",
- "scripts": {
- "test": "node test"
- },
- "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom
it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/isaacs/inherits/issues"
- },
- "_id": "inherits@2.0.1",
- "dist": {
- "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
- "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
- },
- "_from": "inherits@>=2.0.1 <2.1.0",
- "_npmVersion": "1.3.8",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "directories": {},
- "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
- "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
- "homepage": "https://github.com/isaacs/inherits"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js
deleted file mode 100644
index fc53012..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var inherits = require('./inherits.js')
-var assert = require('assert')
-
-function test(c) {
- assert(c.constructor === Child)
- assert(c.constructor.super_ === Parent)
- assert(Object.getPrototypeOf(c) === Child.prototype)
- assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype)
- assert(c instanceof Child)
- assert(c instanceof Parent)
-}
-
-function Child() {
- Parent.call(this)
- test(this)
-}
-
-function Parent() {}
-
-inherits(Child, Parent)
-
-var c = new Child
-test(c)
-
-console.log('ok')
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
deleted file mode 100644
index 052a62b..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-# isarray
-
-`Array#isArray` for older browsers.
-
-## Usage
-
-```js
-var isArray = require('isarray');
-
-console.log(isArray([])); // => true
-console.log(isArray({})); // => false
-```
-
-## Installation
-
-With [npm](http://npmjs.org) do
-
-```bash
-$ npm install isarray
-```
-
-Then bundle for the browser with
-[browserify](https://github.com/substack/browserify).
-
-With [component](http://component.io) do
-
-```bash
-$ component install juliangruber/isarray
-```
-
-## License
-
-(MIT)
-
-Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js
deleted file mode 100644
index ec58596..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js
+++ /dev/null
@@ -1,209 +0,0 @@
-
-/**
- * Require the given path.
- *
- * @param {String} path
- * @return {Object} exports
- * @api public
- */
-
-function require(path, parent, orig) {
- var resolved = require.resolve(path);
-
- // lookup failed
- if (null == resolved) {
- orig = orig || path;
- parent = parent || 'root';
- var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
- err.path = orig;
- err.parent = parent;
- err.require = true;
- throw err;
- }
-
- var module = require.modules[resolved];
-
- // perform real require()
- // by invoking the module's
- // registered function
- if (!module.exports) {
- module.exports = {};
- module.client = module.component = true;
- module.call(this, module.exports, require.relative(resolved), module);
- }
-
- return module.exports;
-}
-
-/**
- * Registered modules.
- */
-
-require.modules = {};
-
-/**
- * Registered aliases.
- */
-
-require.aliases = {};
-
-/**
- * Resolve `path`.
- *
- * Lookup:
- *
- * - PATH/index.js
- * - PATH.js
- * - PATH
- *
- * @param {String} path
- * @return {String} path or null
- * @api private
- */
-
-require.resolve = function(path) {
- if (path.charAt(0) === '/') path = path.slice(1);
- var index = path + '/index.js';
-
- var paths = [
- path,
- path + '.js',
- path + '.json',
- path + '/index.js',
- path + '/index.json'
- ];
-
- for (var i = 0; i < paths.length; i++) {
- var path = paths[i];
- if (require.modules.hasOwnProperty(path)) return path;
- }
-
- if (require.aliases.hasOwnProperty(index)) {
- return require.aliases[index];
- }
-};
-
-/**
- * Normalize `path` relative to the current path.
- *
- * @param {String} curr
- * @param {String} path
- * @return {String}
- * @api private
- */
-
-require.normalize = function(curr, path) {
- var segs = [];
-
- if ('.' != path.charAt(0)) return path;
-
- curr = curr.split('/');
- path = path.split('/');
-
- for (var i = 0; i < path.length; ++i) {
- if ('..' == path[i]) {
- curr.pop();
- } else if ('.' != path[i] && '' != path[i]) {
- segs.push(path[i]);
- }
- }
-
- return curr.concat(segs).join('/');
-};
-
-/**
- * Register module at `path` with callback `definition`.
- *
- * @param {String} path
- * @param {Function} definition
- * @api private
- */
-
-require.register = function(path, definition) {
- require.modules[path] = definition;
-};
-
-/**
- * Alias a module definition.
- *
- * @param {String} from
- * @param {String} to
- * @api private
- */
-
-require.alias = function(from, to) {
- if (!require.modules.hasOwnProperty(from)) {
- throw new Error('Failed to alias "' + from + '", it does not exist');
- }
- require.aliases[to] = from;
-};
-
-/**
- * Return a require function relative to the `parent` path.
- *
- * @param {String} parent
- * @return {Function}
- * @api private
- */
-
-require.relative = function(parent) {
- var p = require.normalize(parent, '..');
-
- /**
- * lastIndexOf helper.
- */
-
- function lastIndexOf(arr, obj) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === obj) return i;
- }
- return -1;
- }
-
- /**
- * The relative require() itself.
- */
-
- function localRequire(path) {
- var resolved = localRequire.resolve(path);
- return require(resolved, parent, path);
- }
-
- /**
- * Resolve relative to the parent.
- */
-
- localRequire.resolve = function(path) {
- var c = path.charAt(0);
- if ('/' == c) return path.slice(1);
- if ('.' == c) return require.normalize(p, path);
-
- // resolve deps by returning
- // the dep in the nearest "deps"
- // directory
- var segs = parent.split('/');
- var i = lastIndexOf(segs, 'deps') + 1;
- if (!i) i = 0;
- path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
- return path;
- };
-
- /**
- * Check if module is defined at `path`.
- */
-
- localRequire.exists = function(path) {
- return require.modules.hasOwnProperty(localRequire.resolve(path));
- };
-
- return localRequire;
-};
-require.register("isarray/index.js", function(exports, require, module){
-module.exports = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
-};
-
-});
-require.alias("isarray/index.js", "isarray/index.js");
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json
deleted file mode 100644
index 9e31b68..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name" : "isarray",
- "description" : "Array#isArray for older browsers",
- "version" : "0.0.1",
- "repository" : "juliangruber/isarray",
- "homepage": "https://github.com/juliangruber/isarray",
- "main" : "index.js",
- "scripts" : [
- "index.js"
- ],
- "dependencies" : {},
- "keywords": ["browser","isarray","array"],
- "author": {
- "name": "Julian Gruber",
- "email": "mail@juliangruber.com",
- "url": "http://juliangruber.com"
- },
- "license": "MIT"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
deleted file mode 100644
index 5f5ad45..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json
deleted file mode 100644
index 19228ab..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "name": "isarray",
- "description": "Array#isArray for older browsers",
- "version": "0.0.1",
- "repository": {
- "type": "git",
- "url": "git://github.com/juliangruber/isarray.git"
- },
- "homepage": "https://github.com/juliangruber/isarray",
- "main": "index.js",
- "scripts": {
- "test": "tap test/*.js"
- },
- "dependencies": {},
- "devDependencies": {
- "tap": "*"
- },
- "keywords": [
- "browser",
- "isarray",
- "array"
- ],
- "author": {
- "name": "Julian Gruber",
- "email": "mail@juliangruber.com",
- "url": "http://juliangruber.com"
- },
- "license": "MIT",
- "_id": "isarray@0.0.1",
- "dist": {
- "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
- "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
- },
- "_from": "isarray@0.0.1",
- "_npmVersion": "1.2.18",
- "_npmUser": {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- },
- "maintainers": [
- {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- }
- ],
- "directories": {},
- "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
- "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
- "bugs": {
- "url": "https://github.com/juliangruber/isarray/issues"
- },
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore
deleted file mode 100644
index 206320c..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build
-test
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE
deleted file mode 100644
index 6de584a..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright Joyent, Inc. and other Node contributors.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to permit
-persons to whom the Software is furnished to do so, subject to the
-following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md
deleted file mode 100644
index 4d2aa00..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-**string_decoder.js** (`require('string_decoder')`) from Node.js core
-
-Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
-
-Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
-
-The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js
deleted file mode 100644
index b00e54f..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js
+++ /dev/null
@@ -1,221 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-var Buffer = require('buffer').Buffer;
-
-var isBufferEncoding = Buffer.isEncoding
- || function(encoding) {
- switch (encoding && encoding.toLowerCase()) {
- case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
- default: return false;
- }
- }
-
-
-function assertEncoding(encoding) {
- if (encoding && !isBufferEncoding(encoding)) {
- throw new Error('Unknown encoding: ' + encoding);
- }
-}
-
-// StringDecoder provides an interface for efficiently splitting a series of
-// buffers into a series of JS strings without breaking apart multi-byte
-// characters. CESU-8 is handled as part of the UTF-8 encoding.
-//
-// @TODO Handling all encodings inside a single object makes it very difficult
-// to reason about this code, so it should be split up in the future.
-// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
-// points as used by CESU-8.
-var StringDecoder = exports.StringDecoder = function(encoding) {
- this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
- assertEncoding(encoding);
- switch (this.encoding) {
- case 'utf8':
- // CESU-8 represents each of Surrogate Pair by 3-bytes
- this.surrogateSize = 3;
- break;
- case 'ucs2':
- case 'utf16le':
- // UTF-16 represents each of Surrogate Pair by 2-bytes
- this.surrogateSize = 2;
- this.detectIncompleteChar = utf16DetectIncompleteChar;
- break;
- case 'base64':
- // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
- this.surrogateSize = 3;
- this.detectIncompleteChar = base64DetectIncompleteChar;
- break;
- default:
- this.write = passThroughWrite;
- return;
- }
-
- // Enough space to store all bytes of a single character. UTF-8 needs 4
- // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
- this.charBuffer = new Buffer(6);
- // Number of bytes received for the current incomplete multi-byte character.
- this.charReceived = 0;
- // Number of bytes expected for the current incomplete multi-byte character.
- this.charLength = 0;
-};
-
-
-// write decodes the given buffer and returns it as JS string that is
-// guaranteed to not contain any partial multi-byte characters. Any partial
-// character found at the end of the buffer is buffered up, and will be
-// returned when calling write again with the remaining bytes.
-//
-// Note: Converting a Buffer containing an orphan surrogate to a String
-// currently works, but converting a String to a Buffer (via `new Buffer`, or
-// Buffer#write) will replace incomplete surrogates with the unicode
-// replacement character. See https://codereview.chromium.org/121173009/ .
-StringDecoder.prototype.write = function(buffer) {
- var charStr = '';
- // if our last write ended with an incomplete multibyte character
- while (this.charLength) {
- // determine how many remaining bytes this buffer has to offer for this char
- var available = (buffer.length >= this.charLength - this.charReceived) ?
- this.charLength - this.charReceived :
- buffer.length;
-
- // add the new bytes to the char buffer
- buffer.copy(this.charBuffer, this.charReceived, 0, available);
- this.charReceived += available;
-
- if (this.charReceived < this.charLength) {
- // still not enough chars in this buffer? wait for more ...
- return '';
- }
-
- // remove bytes belonging to the current character from the buffer
- buffer = buffer.slice(available, buffer.length);
-
- // get the character that was split
- charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
-
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
- var charCode = charStr.charCodeAt(charStr.length - 1);
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- this.charLength += this.surrogateSize;
- charStr = '';
- continue;
- }
- this.charReceived = this.charLength = 0;
-
- // if there are no more bytes in this buffer, just emit our char
- if (buffer.length === 0) {
- return charStr;
- }
- break;
- }
-
- // determine and set charLength / charReceived
- this.detectIncompleteChar(buffer);
-
- var end = buffer.length;
- if (this.charLength) {
- // buffer the incomplete character bytes we got
- buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
- end -= this.charReceived;
- }
-
- charStr += buffer.toString(this.encoding, 0, end);
-
- var end = charStr.length - 1;
- var charCode = charStr.charCodeAt(end);
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- var size = this.surrogateSize;
- this.charLength += size;
- this.charReceived += size;
- this.charBuffer.copy(this.charBuffer, size, 0, size);
- buffer.copy(this.charBuffer, 0, 0, size);
- return charStr.substring(0, end);
- }
-
- // or just emit the charStr
- return charStr;
-};
-
-// detectIncompleteChar determines if there is an incomplete UTF-8 character at
-// the end of the given buffer. If so, it sets this.charLength to the byte
-// length that character, and sets this.charReceived to the number of bytes
-// that are available for this character.
-StringDecoder.prototype.detectIncompleteChar = function(buffer) {
- // determine how many bytes we have to check at the end of this buffer
- var i = (buffer.length >= 3) ? 3 : buffer.length;
-
- // Figure out if one of the last i bytes of our buffer announces an
- // incomplete char.
- for (; i > 0; i--) {
- var c = buffer[buffer.length - i];
-
- // See http://en.wikipedia.org/wiki/UTF-8#Description
-
- // 110XXXXX
- if (i == 1 && c >> 5 == 0x06) {
- this.charLength = 2;
- break;
- }
-
- // 1110XXXX
- if (i <= 2 && c >> 4 == 0x0E) {
- this.charLength = 3;
- break;
- }
-
- // 11110XXX
- if (i <= 3 && c >> 3 == 0x1E) {
- this.charLength = 4;
- break;
- }
- }
- this.charReceived = i;
-};
-
-StringDecoder.prototype.end = function(buffer) {
- var res = '';
- if (buffer && buffer.length)
- res = this.write(buffer);
-
- if (this.charReceived) {
- var cr = this.charReceived;
- var buf = this.charBuffer;
- var enc = this.encoding;
- res += buf.slice(0, cr).toString(enc);
- }
-
- return res;
-};
-
-function passThroughWrite(buffer) {
- return buffer.toString(this.encoding);
-}
-
-function utf16DetectIncompleteChar(buffer) {
- this.charReceived = buffer.length % 2;
- this.charLength = this.charReceived ? 2 : 0;
-}
-
-function base64DetectIncompleteChar(buffer) {
- this.charReceived = buffer.length % 3;
- this.charLength = this.charReceived ? 3 : 0;
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
deleted file mode 100644
index 0364d54..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "name": "string_decoder",
- "version": "0.10.31",
- "description": "The string_decoder module from Node core",
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {
- "tap": "~0.4.8"
- },
- "scripts": {
- "test": "tap test/simple/*.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/rvagg/string_decoder.git"
- },
- "homepage": "https://github.com/rvagg/string_decoder",
- "keywords": [
- "string",
- "decoder",
- "browser",
- "browserify"
- ],
- "license": "MIT",
- "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
- "bugs": {
- "url": "https://github.com/rvagg/string_decoder/issues"
- },
- "_id": "string_decoder@0.10.31",
- "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
- "_from": "string_decoder@>=0.10.0 <0.11.0",
- "_npmVersion": "1.4.23",
- "_npmUser": {
- "name": "rvagg",
- "email": "rod@vagg.org"
- },
- "maintainers": [
- {
- "name": "substack",
- "email": "mail@substack.net"
- },
- {
- "name": "rvagg",
- "email": "rod@vagg.org"
- }
- ],
- "dist": {
- "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
- "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
deleted file mode 100644
index 986488a..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "name": "readable-stream",
- "version": "1.0.33",
- "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x",
- "main": "readable.js",
- "dependencies": {
- "core-util-is": "~1.0.0",
- "isarray": "0.0.1",
- "string_decoder": "~0.10.x",
- "inherits": "~2.0.1"
- },
- "devDependencies": {
- "tap": "~0.2.6"
- },
- "scripts": {
- "test": "tap test/simple/*.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/readable-stream"
- },
- "keywords": [
- "readable",
- "stream",
- "pipe"
- ],
- "browser": {
- "util": false
- },
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "license": "MIT",
- "gitHead": "0bf97a117c5646556548966409ebc57a6dda2638",
- "bugs": {
- "url": "https://github.com/isaacs/readable-stream/issues"
- },
- "homepage": "https://github.com/isaacs/readable-stream",
- "_id": "readable-stream@1.0.33",
- "_shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c",
- "_from": "readable-stream@>=1.0.26 <1.1.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "rvagg",
- "email": "rod@vagg.org"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- {
- "name": "rvagg",
- "email": "rod@vagg.org"
- }
- ],
- "dist": {
- "shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c",
- "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js
deleted file mode 100644
index 27e8d8a..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_passthrough.js")
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
deleted file mode 100644
index 8b5337b..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify
-exports = module.exports = require('./lib/_stream_readable.js');
-exports.Stream = Stream;
-exports.Readable = exports;
-exports.Writable = require('./lib/_stream_writable.js');
-exports.Duplex = require('./lib/_stream_duplex.js');
-exports.Transform = require('./lib/_stream_transform.js');
-exports.PassThrough = require('./lib/_stream_passthrough.js');
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js
deleted file mode 100644
index 5d482f0..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_transform.js")
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js
deleted file mode 100644
index e1e9efd..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_writable.js")
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/package.json b/node_modules/request/node_modules/bl/package.json
deleted file mode 100644
index 3ffbd6a..0000000
--- a/node_modules/request/node_modules/bl/package.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "name": "bl",
- "version": "0.9.4",
- "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
- "main": "bl.js",
- "scripts": {
- "test": "node test/test.js | faucet",
- "test-local": "brtapsauce-local test/basic-test.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/rvagg/bl.git"
- },
- "homepage": "https://github.com/rvagg/bl",
- "authors": [
- "Rod Vagg <ro...@vagg.org> (https://github.com/rvagg)",
- "Matteo Collina <ma...@gmail.com> (https://github.com/mcollina)",
- "Jarett Cruger <jc...@gmail.com> (https://github.com/jcrugzz)"
- ],
- "keywords": [
- "buffer",
- "buffers",
- "stream",
- "awesomesauce"
- ],
- "license": "MIT",
- "dependencies": {
- "readable-stream": "~1.0.26"
- },
- "devDependencies": {
- "tape": "~2.12.3",
- "hash_file": "~0.1.1",
- "faucet": "~0.0.1",
- "brtapsauce": "~0.3.0"
- },
- "gitHead": "e7f90703c5f90ca26f60455ea6ad0b6be4a9feee",
- "bugs": {
- "url": "https://github.com/rvagg/bl/issues"
- },
- "_id": "bl@0.9.4",
- "_shasum": "4702ddf72fbe0ecd82787c00c113aea1935ad0e7",
- "_from": "bl@>=0.9.0 <0.10.0",
- "_npmVersion": "2.1.18",
- "_nodeVersion": "1.0.3",
- "_npmUser": {
- "name": "rvagg",
- "email": "rod@vagg.org"
- },
- "maintainers": [
- {
- "name": "rvagg",
- "email": "rod@vagg.org"
- }
- ],
- "dist": {
- "shasum": "4702ddf72fbe0ecd82787c00c113aea1935ad0e7",
- "tarball": "http://registry.npmjs.org/bl/-/bl-0.9.4.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/bl/-/bl-0.9.4.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/test/basic-test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/test/basic-test.js b/node_modules/request/node_modules/bl/test/basic-test.js
deleted file mode 100644
index 75116a3..0000000
--- a/node_modules/request/node_modules/bl/test/basic-test.js
+++ /dev/null
@@ -1,541 +0,0 @@
-var tape = require('tape')
- , crypto = require('crypto')
- , fs = require('fs')
- , hash = require('hash_file')
- , BufferList = require('../')
-
- , encodings =
- ('hex utf8 utf-8 ascii binary base64'
- + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-
-tape('single bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
-
- t.end()
-})
-
-tape('single bytes from multiple buffers', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
- t.equal(bl.get(4), 101)
- t.equal(bl.get(5), 102)
- t.equal(bl.get(6), 103)
- t.equal(bl.get(7), 104)
- t.equal(bl.get(8), 105)
- t.equal(bl.get(9), 106)
- t.end()
-})
-
-tape('multi bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
- t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
- t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffer lists', function (t) {
- var bl = new BufferList()
-
- bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
- bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('consuming from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- bl.consume(3)
- t.equal(bl.length, 7)
- t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
-
- bl.consume(2)
- t.equal(bl.length, 5)
- t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
-
- bl.consume(1)
- t.equal(bl.length, 4)
- t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
-
- bl.consume(1)
- t.equal(bl.length, 3)
- t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
-
- bl.consume(2)
- t.equal(bl.length, 1)
- t.equal(bl.slice(0, 1).toString('ascii'), 'j')
-
- t.end()
-})
-
-tape('test readUInt8 / readInt8', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt8(2), 0x3)
- t.equal(bl.readInt8(2), 0x3)
- t.equal(bl.readUInt8(3), 0x4)
- t.equal(bl.readInt8(3), 0x4)
- t.equal(bl.readUInt8(4), 0x23)
- t.equal(bl.readInt8(4), 0x23)
- t.equal(bl.readUInt8(5), 0x42)
- t.equal(bl.readInt8(5), 0x42)
- t.end()
-})
-
-tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt16BE(2), 0x0304)
- t.equal(bl.readUInt16LE(2), 0x0403)
- t.equal(bl.readInt16BE(2), 0x0304)
- t.equal(bl.readInt16LE(2), 0x0403)
- t.equal(bl.readUInt16BE(3), 0x0423)
- t.equal(bl.readUInt16LE(3), 0x2304)
- t.equal(bl.readInt16BE(3), 0x0423)
- t.equal(bl.readInt16LE(3), 0x2304)
- t.equal(bl.readUInt16BE(4), 0x2342)
- t.equal(bl.readUInt16LE(4), 0x4223)
- t.equal(bl.readInt16BE(4), 0x2342)
- t.equal(bl.readInt16LE(4), 0x4223)
- t.end()
-})
-
-tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt32BE(2), 0x03042342)
- t.equal(bl.readUInt32LE(2), 0x42230403)
- t.equal(bl.readInt32BE(2), 0x03042342)
- t.equal(bl.readInt32LE(2), 0x42230403)
- t.end()
-})
-
-tape('test readFloatLE / readFloatBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x00
- buf2[2] = 0x00
- buf3[0] = 0x80
- buf3[1] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readFloatLE(2), 0x01)
- t.end()
-})
-
-tape('test readDoubleLE / readDoubleBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(10)
- , bl = new BufferList()
-
- buf2[1] = 0x55
- buf2[2] = 0x55
- buf3[0] = 0x55
- buf3[1] = 0x55
- buf3[2] = 0x55
- buf3[3] = 0x55
- buf3[4] = 0xd5
- buf3[5] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readDoubleLE(2), 0.3333333333333333)
- t.end()
-})
-
-tape('test toString', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
- t.equal(bl.toString('ascii', 3, 10), 'defghij')
- t.equal(bl.toString('ascii', 3, 6), 'def')
- t.equal(bl.toString('ascii', 3, 8), 'defgh')
- t.equal(bl.toString('ascii', 5, 10), 'fghij')
-
- t.end()
-})
-
-tape('test toString encoding', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
- bl.append(new Buffer('\xff\x00'))
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc), enc)
- })
-
- t.end()
-})
-
-!process.browser && tape('test stream', function (t) {
- var random = crypto.randomBytes(65534)
- , rndhash = hash(random, 'md5')
- , md5sum = crypto.createHash('md5')
- , bl = new BufferList(function (err, buf) {
- t.ok(Buffer.isBuffer(buf))
- t.ok(err === null)
- t.equal(rndhash, hash(bl.slice(), 'md5'))
- t.equal(rndhash, hash(buf, 'md5'))
-
- bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
- .on('close', function () {
- var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
- s.on('data', md5sum.update.bind(md5sum))
- s.on('end', function() {
- t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
- t.end()
- })
- })
-
- })
-
- fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
- fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
-})
-
-tape('instantiation with Buffer', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = crypto.randomBytes(1024)
- , b = BufferList(buf)
-
- t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
- b = BufferList([ buf, buf2 ])
- t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('test String appendage', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append('abcd')
- bl.append('efg')
- bl.append('hi')
- bl.append('j')
- bl.append('\xff\x00')
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('write nothing, should get empty buffer', function (t) {
- t.plan(3)
- BufferList(function (err, data) {
- t.notOk(err, 'no error')
- t.ok(Buffer.isBuffer(data), 'got a buffer')
- t.equal(0, data.length, 'got a zero-length buffer')
- t.end()
- }).end()
-})
-
-tape('unicode string', function (t) {
- t.plan(2)
- var inp1 = '\u2600'
- , inp2 = '\u2603'
- , exp = inp1 + ' and ' + inp2
- , bl = BufferList()
- bl.write(inp1)
- bl.write(' and ')
- bl.write(inp2)
- t.equal(exp, bl.toString())
- t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
-})
-
-tape('should emit finish', function (t) {
- var source = BufferList()
- , dest = BufferList()
-
- source.write('hello')
- source.pipe(dest)
-
- dest.on('finish', function () {
- t.equal(dest.toString('utf8'), 'hello')
- t.end()
- })
-})
-
-tape('basic copy', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy after many appends', function (t) {
- var buf = crypto.randomBytes(512)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy at a precise position', function (t) {
- var buf = crypto.randomBytes(1004)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2, 20)
- t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy starting from a precise location', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(5)
- , b = BufferList(buf)
-
- b.copy(buf2, 0, 5)
- t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy in an interval', function (t) {
- var rnd = crypto.randomBytes(10)
- , b = BufferList(rnd) // put the random bytes there
- , actual = new Buffer(3)
- , expected = new Buffer(3)
-
- rnd.copy(expected, 0, 5, 8)
- b.copy(actual, 0, 5, 8)
-
- t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy an interval between two buffers', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(10)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2, 0, 5, 15)
-
- t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('duplicate', function (t) {
- t.plan(2)
-
- var bl = new BufferList('abcdefghij\xff\x00')
- , dup = bl.duplicate()
-
- t.equal(bl.prototype, dup.prototype)
- t.equal(bl.toString('hex'), dup.toString('hex'))
-})
-
-tape('destroy no pipe', function (t) {
- t.plan(2)
-
- var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-
-})
-
-!process.browser && tape('destroy with pipe before read end with race', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- setTimeout(function () {
- bl.destroy()
- setTimeout(function () {
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }, 500)
- }, 500)
-})
-
-!process.browser && tape('destroy with pipe after read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }
-})
-
-!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
- t.plan(4)
-
- var bl = new BufferList()
- , ds = new BufferList()
-
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.pipe(ds)
-
- setTimeout(function () {
- bl.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- ds.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- }, 100)
- }
-})
-
-!process.browser && tape('handle error', function (t) {
- t.plan(2)
- fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
- t.ok(err instanceof Error, 'has error')
- t.notOk(data, 'no data')
- }))
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/test/sauce.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/test/sauce.js b/node_modules/request/node_modules/bl/test/sauce.js
deleted file mode 100644
index a6d2862..0000000
--- a/node_modules/request/node_modules/bl/test/sauce.js
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-const user = process.env.SAUCE_USER
- , key = process.env.SAUCE_KEY
- , path = require('path')
- , brtapsauce = require('brtapsauce')
- , testFile = path.join(__dirname, 'basic-test.js')
-
- , capabilities = [
- { browserName: 'chrome' , platform: 'Windows XP', version: '' }
- , { browserName: 'firefox' , platform: 'Windows 8' , version: '' }
- , { browserName: 'firefox' , platform: 'Windows XP', version: '4' }
- , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' }
- , { browserName: 'safari' , platform: 'Windows 7' , version: '5' }
- , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '11' }
- , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' }
- ]
-
-if (!user)
- throw new Error('Must set a SAUCE_USER env var')
-if (!key)
- throw new Error('Must set a SAUCE_KEY env var')
-
-brtapsauce({
- name : 'Traversty'
- , user : user
- , key : key
- , brsrc : testFile
- , capabilities : capabilities
- , options : { timeout: 60 * 6 }
-})
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/test/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/test/test.js b/node_modules/request/node_modules/bl/test/test.js
deleted file mode 100644
index aa9b487..0000000
--- a/node_modules/request/node_modules/bl/test/test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-require('./basic-test')
-
-if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
- return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
-
-if (!/v0\.10/.test(process.version))
- return console.log('Not Node v0.10.x, not running sauce tests')
-
-require('./sauce.js')
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/caseless/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/caseless/README.md b/node_modules/request/node_modules/caseless/README.md
deleted file mode 100644
index e5077a2..0000000
--- a/node_modules/request/node_modules/caseless/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing.
-
-This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set.
-
-## Usage
-
-```javascript
-var headers = {}
- , c = caseless(headers)
- ;
-c.set('a-Header', 'asdf')
-c.get('a-header') === 'asdf'
-```
-
-## has(key)
-
-Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with.
-
-```javascript
-c.has('a-header') === 'a-Header'
-```
-
-## set(key, value[, clobber=true])
-
-Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header.
-
-```javascript
-c.set('a-Header', 'fdas')
-c.set('a-HEADER', 'more', false)
-c.get('a-header') === 'fdsa,more'
-```
-
-## swap(key)
-
-Swaps the casing of a header with the new one that is passed in.
-
-```javascript
-var headers = {}
- , c = caseless(headers)
- ;
-c.set('a-Header', 'fdas')
-c.swap('a-HEADER')
-c.has('a-header') === 'a-HEADER'
-headers === {'a-HEADER': 'fdas'}
-```
[03/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
index a798cd8..f24590e 100644
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
@@ -1,3 +1,10 @@
+1.10.0 / 2015-05-19
+===================
+
+ * Add `application/vnd.balsamiq.bmpr`
+ * Add `application/vnd.microsoft.portable-executable`
+ * Add `application/x-ns-proxy-autoconfig`
+
1.9.1 / 2015-04-19
==================
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
index 023a985..d5aa787 100644
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
@@ -1312,6 +1312,9 @@
"application/vnd.balsamiq.bmml+xml": {
"source": "iana"
},
+ "application/vnd.balsamiq.bmpr": {
+ "source": "iana"
+ },
"application/vnd.bekitzur-stech+json": {
"source": "iana",
"compressible": true
@@ -2391,6 +2394,9 @@
"source": "iana",
"extensions": ["igx"]
},
+ "application/vnd.microsoft.portable-executable": {
+ "source": "iana"
+ },
"application/vnd.miele+json": {
"source": "iana",
"compressible": true
@@ -4375,6 +4381,10 @@
"source": "apache",
"extensions": ["nc","cdf"]
},
+ "application/x-ns-proxy-autoconfig": {
+ "compressible": true,
+ "extensions": ["pac"]
+ },
"application/x-nzb": {
"source": "apache",
"extensions": ["nzb"]
@@ -4563,7 +4573,7 @@
"extensions": ["xhtml","xht"]
},
"application/xhtml-voice+xml": {
- "source": "iana"
+ "source": "apache"
},
"application/xml": {
"source": "iana",
@@ -4864,7 +4874,7 @@
"extensions": ["oga","ogg","spx"]
},
"audio/opus": {
- "source": "apache"
+ "source": "iana"
},
"audio/parityfec": {
"source": "iana"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
index 5fe483d..f2b6767 100644
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
@@ -1,7 +1,7 @@
{
"name": "mime-db",
"description": "Media Type Database",
- "version": "1.9.1",
+ "version": "1.10.0",
"contributors": [
{
"name": "Douglas Christopher Wilson",
@@ -34,13 +34,13 @@
},
"devDependencies": {
"bluebird": "~2.9.20",
- "co": "4.5.1",
- "cogent": "1",
- "csv-parse": "0.1.0",
+ "co": "4.5.4",
+ "cogent": "1.0.1",
+ "csv-parse": "0.1.1",
"gnode": "0.1.1",
- "istanbul": "0.3.8",
- "mocha": "~1.21.4",
- "raw-body": "~1.3.3",
+ "istanbul": "0.3.9",
+ "mocha": "1.21.5",
+ "raw-body": "2.0.1",
"stream-to-array": "2"
},
"files": [
@@ -61,14 +61,14 @@
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
"update": "npm run fetch && npm run build"
},
- "gitHead": "590a8b6afceeee64b424fcd2d0d73a3bebc81685",
+ "gitHead": "260552f9177fe78986b92699999f81999c7fe43c",
"bugs": {
"url": "https://github.com/jshttp/mime-db/issues"
},
"homepage": "https://github.com/jshttp/mime-db",
- "_id": "mime-db@1.9.1",
- "_shasum": "1431049a71791482c29f37bafc8ea2cb3a6dd3e8",
- "_from": "mime-db@>=1.9.1 <1.10.0",
+ "_id": "mime-db@1.10.0",
+ "_shasum": "e6308063c758ebd12837874c3d1ea9170766b03b",
+ "_from": "mime-db@>=1.10.0 <1.11.0",
"_npmVersion": "1.4.28",
"_npmUser": {
"name": "dougwilson",
@@ -85,10 +85,10 @@
}
],
"dist": {
- "shasum": "1431049a71791482c29f37bafc8ea2cb3a6dd3e8",
- "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.9.1.tgz"
+ "shasum": "e6308063c758ebd12837874c3d1ea9170766b03b",
+ "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.10.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.9.1.tgz",
+ "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.10.0.tgz",
"readme": "ERROR: No README data found!"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/mime-types/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/package.json b/node_modules/request/node_modules/mime-types/package.json
index d4116da..8896ffc 100644
--- a/node_modules/request/node_modules/mime-types/package.json
+++ b/node_modules/request/node_modules/mime-types/package.json
@@ -1,7 +1,7 @@
{
"name": "mime-types",
"description": "The ultimate javascript content-type utility.",
- "version": "2.0.11",
+ "version": "2.0.12",
"contributors": [
{
"name": "Douglas Christopher Wilson",
@@ -28,7 +28,7 @@
"url": "https://github.com/jshttp/mime-types"
},
"dependencies": {
- "mime-db": "~1.9.1"
+ "mime-db": "~1.10.0"
},
"devDependencies": {
"istanbul": "0.3.9",
@@ -47,13 +47,13 @@
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
},
- "gitHead": "4b233cfbb6704e88eca121e9d9f6e6f23957e48a",
+ "gitHead": "a1e3c4b6bbb6afb615c8a058481d58cb57a4cb95",
"bugs": {
"url": "https://github.com/jshttp/mime-types/issues"
},
"homepage": "https://github.com/jshttp/mime-types",
- "_id": "mime-types@2.0.11",
- "_shasum": "bf3449042799d877c815c29929d1e74760e72007",
+ "_id": "mime-types@2.0.12",
+ "_shasum": "87ae9f124e94f8e440c93d1a72d0dccecdb71135",
"_from": "mime-types@>=2.0.1 <2.1.0",
"_npmVersion": "1.4.28",
"_npmUser": {
@@ -75,10 +75,10 @@
}
],
"dist": {
- "shasum": "bf3449042799d877c815c29929d1e74760e72007",
- "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.11.tgz"
+ "shasum": "87ae9f124e94f8e440c93d1a72d0dccecdb71135",
+ "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.12.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.11.tgz",
+ "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.12.tgz",
"readme": "ERROR: No README data found!"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/qs/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/index.js b/node_modules/request/node_modules/qs/lib/index.js
new file mode 100755
index 0000000..0e09493
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/index.js
@@ -0,0 +1,15 @@
+// Load modules
+
+var Stringify = require('./stringify');
+var Parse = require('./parse');
+
+
+// Declare internals
+
+var internals = {};
+
+
+module.exports = {
+ stringify: Stringify,
+ parse: Parse
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/qs/lib/parse.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/parse.js b/node_modules/request/node_modules/qs/lib/parse.js
new file mode 100755
index 0000000..5c154bb
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/parse.js
@@ -0,0 +1,157 @@
+// Load modules
+
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&',
+ depth: 5,
+ arrayLimit: 20,
+ parameterLimit: 1000
+};
+
+
+internals.parseValues = function (str, options) {
+
+ var obj = {};
+ var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
+
+ for (var i = 0, il = parts.length; i < il; ++i) {
+ var part = parts[i];
+ var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
+
+ if (pos === -1) {
+ obj[Utils.decode(part)] = '';
+ }
+ else {
+ var key = Utils.decode(part.slice(0, pos));
+ var val = Utils.decode(part.slice(pos + 1));
+
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
+ obj[key] = val;
+ }
+ else {
+ obj[key] = [].concat(obj[key]).concat(val);
+ }
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseObject = function (chain, val, options) {
+
+ if (!chain.length) {
+ return val;
+ }
+
+ var root = chain.shift();
+
+ var obj = {};
+ if (root === '[]') {
+ obj = [];
+ obj = obj.concat(internals.parseObject(chain, val, options));
+ }
+ else {
+ var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
+ var index = parseInt(cleanRoot, 10);
+ var indexString = '' + index;
+ if (!isNaN(index) &&
+ root !== cleanRoot &&
+ indexString === cleanRoot &&
+ index >= 0 &&
+ index <= options.arrayLimit) {
+
+ obj = [];
+ obj[index] = internals.parseObject(chain, val, options);
+ }
+ else {
+ obj[cleanRoot] = internals.parseObject(chain, val, options);
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseKeys = function (key, val, options) {
+
+ if (!key) {
+ return;
+ }
+
+ // The regex chunks
+
+ var parent = /^([^\[\]]*)/;
+ var child = /(\[[^\[\]]*\])/g;
+
+ // Get the parent
+
+ var segment = parent.exec(key);
+
+ // Don't allow them to overwrite object prototype properties
+
+ if (Object.prototype.hasOwnProperty(segment[1])) {
+ return;
+ }
+
+ // Stash the parent if it exists
+
+ var keys = [];
+ if (segment[1]) {
+ keys.push(segment[1]);
+ }
+
+ // Loop through children appending to the array until we hit depth
+
+ var i = 0;
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
+
+ ++i;
+ if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
+ keys.push(segment[1]);
+ }
+ }
+
+ // If there's a remainder, just add whatever is left
+
+ if (segment) {
+ keys.push('[' + key.slice(segment.index) + ']');
+ }
+
+ return internals.parseObject(keys, val, options);
+};
+
+
+module.exports = function (str, options) {
+
+ if (str === '' ||
+ str === null ||
+ typeof str === 'undefined') {
+
+ return {};
+ }
+
+ options = options || {};
+ options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
+ options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
+ options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
+ options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
+
+ var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str;
+ var obj = {};
+
+ // Iterate over the keys and setup the new object
+
+ var keys = Object.keys(tempObj);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var newObj = internals.parseKeys(key, tempObj[key], options);
+ obj = Utils.merge(obj, newObj);
+ }
+
+ return Utils.compact(obj);
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/qs/lib/stringify.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/stringify.js b/node_modules/request/node_modules/qs/lib/stringify.js
new file mode 100755
index 0000000..3ce6cc1
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/stringify.js
@@ -0,0 +1,97 @@
+// Load modules
+
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&',
+ arrayPrefixGenerators: {
+ brackets: function (prefix, key) {
+ return prefix + '[]';
+ },
+ indices: function (prefix, key) {
+ return prefix + '[' + key + ']';
+ },
+ repeat: function (prefix, key) {
+ return prefix;
+ }
+ }
+};
+
+
+internals.stringify = function (obj, prefix, generateArrayPrefix) {
+
+ if (Utils.isBuffer(obj)) {
+ obj = obj.toString();
+ }
+ else if (obj instanceof Date) {
+ obj = obj.toISOString();
+ }
+ else if (obj === null) {
+ obj = '';
+ }
+
+ if (typeof obj === 'string' ||
+ typeof obj === 'number' ||
+ typeof obj === 'boolean') {
+
+ return [encodeURIComponent(prefix) + '=' + encodeURIComponent(obj)];
+ }
+
+ var values = [];
+
+ if (typeof obj === 'undefined') {
+ return values;
+ }
+
+ var objKeys = Object.keys(obj);
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
+ var key = objKeys[i];
+ if (Array.isArray(obj)) {
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix));
+ }
+ else {
+ values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix));
+ }
+ }
+
+ return values;
+};
+
+
+module.exports = function (obj, options) {
+
+ options = options || {};
+ var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
+
+ var keys = [];
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return '';
+ }
+
+ var arrayFormat;
+ if (options.arrayFormat in internals.arrayPrefixGenerators) {
+ arrayFormat = options.arrayFormat;
+ }
+ else if ('indices' in options) {
+ arrayFormat = options.indices ? 'indices' : 'repeat';
+ }
+ else {
+ arrayFormat = 'indices';
+ }
+
+ var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat];
+
+ var objKeys = Object.keys(obj);
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
+ var key = objKeys[i];
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix));
+ }
+
+ return keys.join(delimiter);
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/qs/lib/utils.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/utils.js b/node_modules/request/node_modules/qs/lib/utils.js
new file mode 100755
index 0000000..5240bd5
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/utils.js
@@ -0,0 +1,132 @@
+// Load modules
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.arrayToObject = function (source) {
+
+ var obj = {};
+ for (var i = 0, il = source.length; i < il; ++i) {
+ if (typeof source[i] !== 'undefined') {
+
+ obj[i] = source[i];
+ }
+ }
+
+ return obj;
+};
+
+
+exports.merge = function (target, source) {
+
+ if (!source) {
+ return target;
+ }
+
+ if (typeof source !== 'object') {
+ if (Array.isArray(target)) {
+ target.push(source);
+ }
+ else {
+ target[source] = true;
+ }
+
+ return target;
+ }
+
+ if (typeof target !== 'object') {
+ target = [target].concat(source);
+ return target;
+ }
+
+ if (Array.isArray(target) &&
+ !Array.isArray(source)) {
+
+ target = exports.arrayToObject(target);
+ }
+
+ var keys = Object.keys(source);
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var value = source[key];
+
+ if (!target[key]) {
+ target[key] = value;
+ }
+ else {
+ target[key] = exports.merge(target[key], value);
+ }
+ }
+
+ return target;
+};
+
+
+exports.decode = function (str) {
+
+ try {
+ return decodeURIComponent(str.replace(/\+/g, ' '));
+ } catch (e) {
+ return str;
+ }
+};
+
+
+exports.compact = function (obj, refs) {
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return obj;
+ }
+
+ refs = refs || [];
+ var lookup = refs.indexOf(obj);
+ if (lookup !== -1) {
+ return refs[lookup];
+ }
+
+ refs.push(obj);
+
+ if (Array.isArray(obj)) {
+ var compacted = [];
+
+ for (var i = 0, il = obj.length; i < il; ++i) {
+ if (typeof obj[i] !== 'undefined') {
+ compacted.push(obj[i]);
+ }
+ }
+
+ return compacted;
+ }
+
+ var keys = Object.keys(obj);
+ for (i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ obj[key] = exports.compact(obj[key], refs);
+ }
+
+ return obj;
+};
+
+
+exports.isRegExp = function (obj) {
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
+};
+
+
+exports.isBuffer = function (obj) {
+
+ if (obj === null ||
+ typeof obj === 'undefined') {
+
+ return false;
+ }
+
+ return !!(obj.constructor &&
+ obj.constructor.isBuffer &&
+ obj.constructor.isBuffer(obj));
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/tough-cookie/lib/cookie.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/node_modules/request/node_modules/tough-cookie/lib/cookie.js
new file mode 100644
index 0000000..9ca9531
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/cookie.js
@@ -0,0 +1,1137 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+'use strict';
+var net = require('net');
+var urlParse = require('url').parse;
+var pubsuffix = require('./pubsuffix');
+var Store = require('./store').Store;
+
+var punycode;
+try {
+ punycode = require('punycode');
+} catch(e) {
+ console.warn("cookie: can't load punycode; won't use punycode for domain normalization");
+}
+
+var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
+
+// From RFC6265 S4.1.1
+// note that it excludes \x3B ";"
+var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/;
+var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'$');
+
+// Double quotes are part of the value (see: S4.1.1).
+// '\r', '\n' and '\0' should be treated as a terminator in the "relaxed" mode
+// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60)
+// '=' and ';' are attribute/values separators
+// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64)
+var COOKIE_PAIR = /^([^=;]+)\s*=\s*(("?)[^\n\r\0]*\3)/;
+
+// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
+// Note ';' is \x3B
+var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
+
+// Used for checking whether or not there is a trailing semi-colon
+var TRAILING_SEMICOLON = /;+$/;
+
+var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/;
+var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/;
+var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i;
+
+var MONTH_TO_NUM = {
+ jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
+ jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
+};
+var NUM_TO_MONTH = [
+ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
+];
+var NUM_TO_DAY = [
+ 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
+];
+
+var YEAR = /^(\d{2}|\d{4})$/; // 2 to 4 digits
+
+var MAX_TIME = 2147483647000; // 31-bit max
+var MIN_TIME = 0; // 31-bit min
+
+var cookiesCreated = 0; // Number of cookies created in runtime
+
+
+// RFC6265 S5.1.1 date parser:
+function parseDate(str) {
+ if (!str) {
+ return;
+ }
+
+ /* RFC6265 S5.1.1:
+ * 2. Process each date-token sequentially in the order the date-tokens
+ * appear in the cookie-date
+ */
+ var tokens = str.split(DATE_DELIM);
+ if (!tokens) {
+ return;
+ }
+
+ var hour = null;
+ var minutes = null;
+ var seconds = null;
+ var day = null;
+ var month = null;
+ var year = null;
+
+ for (var i=0; i<tokens.length; i++) {
+ var token = tokens[i].trim();
+ if (!token.length) {
+ continue;
+ }
+
+ var result;
+
+ /* 2.1. If the found-time flag is not set and the token matches the time
+ * production, set the found-time flag and set the hour- value,
+ * minute-value, and second-value to the numbers denoted by the digits in
+ * the date-token, respectively. Skip the remaining sub-steps and continue
+ * to the next date-token.
+ */
+ if (seconds === null) {
+ result = TIME.exec(token);
+ if (result) {
+ hour = parseInt(result[1], 10);
+ minutes = parseInt(result[2], 10);
+ seconds = parseInt(result[3], 10);
+ /* RFC6265 S5.1.1.5:
+ * [fail if]
+ * * the hour-value is greater than 23,
+ * * the minute-value is greater than 59, or
+ * * the second-value is greater than 59.
+ */
+ if(hour > 23 || minutes > 59 || seconds > 59) {
+ return;
+ }
+
+ continue;
+ }
+ }
+
+ /* 2.2. If the found-day-of-month flag is not set and the date-token matches
+ * the day-of-month production, set the found-day-of- month flag and set
+ * the day-of-month-value to the number denoted by the date-token. Skip
+ * the remaining sub-steps and continue to the next date-token.
+ */
+ if (day === null) {
+ result = DAY_OF_MONTH.exec(token);
+ if (result) {
+ day = parseInt(result, 10);
+ /* RFC6265 S5.1.1.5:
+ * [fail if] the day-of-month-value is less than 1 or greater than 31
+ */
+ if(day < 1 || day > 31) {
+ return;
+ }
+ continue;
+ }
+ }
+
+ /* 2.3. If the found-month flag is not set and the date-token matches the
+ * month production, set the found-month flag and set the month-value to
+ * the month denoted by the date-token. Skip the remaining sub-steps and
+ * continue to the next date-token.
+ */
+ if (month === null) {
+ result = MONTH.exec(token);
+ if (result) {
+ month = MONTH_TO_NUM[result[1].toLowerCase()];
+ continue;
+ }
+ }
+
+ /* 2.4. If the found-year flag is not set and the date-token matches the year
+ * production, set the found-year flag and set the year-value to the number
+ * denoted by the date-token. Skip the remaining sub-steps and continue to
+ * the next date-token.
+ */
+ if (year === null) {
+ result = YEAR.exec(token);
+ if (result) {
+ year = parseInt(result[0], 10);
+ /* From S5.1.1:
+ * 3. If the year-value is greater than or equal to 70 and less
+ * than or equal to 99, increment the year-value by 1900.
+ * 4. If the year-value is greater than or equal to 0 and less
+ * than or equal to 69, increment the year-value by 2000.
+ */
+ if (70 <= year && year <= 99) {
+ year += 1900;
+ } else if (0 <= year && year <= 69) {
+ year += 2000;
+ }
+
+ if (year < 1601) {
+ return; // 5. ... the year-value is less than 1601
+ }
+ }
+ }
+ }
+
+ if (seconds === null || day === null || month === null || year === null) {
+ return; // 5. ... at least one of the found-day-of-month, found-month, found-
+ // year, or found-time flags is not set,
+ }
+
+ return new Date(Date.UTC(year, month, day, hour, minutes, seconds));
+}
+
+function formatDate(date) {
+ var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;
+ var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;
+ var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;
+ var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;
+ return NUM_TO_DAY[date.getUTCDay()] + ', ' +
+ d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+
+ h+':'+m+':'+s+' GMT';
+}
+
+// S5.1.2 Canonicalized Host Names
+function canonicalDomain(str) {
+ if (str == null) {
+ return null;
+ }
+ str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading .
+
+ // convert to IDN if any non-ASCII characters
+ if (punycode && /[^\u0001-\u007f]/.test(str)) {
+ str = punycode.toASCII(str);
+ }
+
+ return str.toLowerCase();
+}
+
+// S5.1.3 Domain Matching
+function domainMatch(str, domStr, canonicalize) {
+ if (str == null || domStr == null) {
+ return null;
+ }
+ if (canonicalize !== false) {
+ str = canonicalDomain(str);
+ domStr = canonicalDomain(domStr);
+ }
+
+ /*
+ * "The domain string and the string are identical. (Note that both the
+ * domain string and the string will have been canonicalized to lower case at
+ * this point)"
+ */
+ if (str == domStr) {
+ return true;
+ }
+
+ /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
+
+ /* "* The string is a host name (i.e., not an IP address)." */
+ if (net.isIP(str)) {
+ return false;
+ }
+
+ /* "* The domain string is a suffix of the string" */
+ var idx = str.indexOf(domStr);
+ if (idx <= 0) {
+ return false; // it's a non-match (-1) or prefix (0)
+ }
+
+ // e.g "a.b.c".indexOf("b.c") === 2
+ // 5 === 3+2
+ if (str.length !== domStr.length + idx) { // it's not a suffix
+ return false;
+ }
+
+ /* "* The last character of the string that is not included in the domain
+ * string is a %x2E (".") character." */
+ if (str.substr(idx-1,1) !== '.') {
+ return false;
+ }
+
+ return true;
+}
+
+
+// RFC6265 S5.1.4 Paths and Path-Match
+
+/*
+ * "The user agent MUST use an algorithm equivalent to the following algorithm
+ * to compute the default-path of a cookie:"
+ *
+ * Assumption: the path (and not query part or absolute uri) is passed in.
+ */
+function defaultPath(path) {
+ // "2. If the uri-path is empty or if the first character of the uri-path is not
+ // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
+ if (!path || path.substr(0,1) !== "/") {
+ return "/";
+ }
+
+ // "3. If the uri-path contains no more than one %x2F ("/") character, output
+ // %x2F ("/") and skip the remaining step."
+ if (path === "/") {
+ return path;
+ }
+
+ var rightSlash = path.lastIndexOf("/");
+ if (rightSlash === 0) {
+ return "/";
+ }
+
+ // "4. Output the characters of the uri-path from the first character up to,
+ // but not including, the right-most %x2F ("/")."
+ return path.slice(0, rightSlash);
+}
+
+/*
+ * "A request-path path-matches a given cookie-path if at least one of the
+ * following conditions holds:"
+ */
+function pathMatch(reqPath,cookiePath) {
+ // "o The cookie-path and the request-path are identical."
+ if (cookiePath === reqPath) {
+ return true;
+ }
+
+ var idx = reqPath.indexOf(cookiePath);
+ if (idx === 0) {
+ // "o The cookie-path is a prefix of the request-path, and the last
+ // character of the cookie-path is %x2F ("/")."
+ if (cookiePath.substr(-1) === "/") {
+ return true;
+ }
+
+ // " o The cookie-path is a prefix of the request-path, and the first
+ // character of the request-path that is not included in the cookie- path
+ // is a %x2F ("/") character."
+ if (reqPath.substr(cookiePath.length,1) === "/") {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function parse(str) {
+ str = str.trim();
+
+ // S4.1.1 Trailing semi-colons are not part of the specification.
+ var semiColonCheck = TRAILING_SEMICOLON.exec(str);
+ if (semiColonCheck) {
+ str = str.slice(0, semiColonCheck.index);
+ }
+
+ // We use a regex to parse the "name-value-pair" part of S5.2
+ var firstSemi = str.indexOf(';'); // S5.2 step 1
+ var result = COOKIE_PAIR.exec(firstSemi === -1 ? str : str.substr(0,firstSemi));
+
+ // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")"
+ // constraints as well as trimming any whitespace.
+ if (!result) {
+ return;
+ }
+
+ var c = new Cookie();
+ c.key = result[1].trim();
+ c.value = result[2].trim();
+
+ if (firstSemi === -1) {
+ return c;
+ }
+
+ // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
+ // (including the %x3B (";") in question)." plus later on in the same section
+ // "discard the first ";" and trim".
+ var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim();
+
+ // "If the unparsed-attributes string is empty, skip the rest of these
+ // steps."
+ if (unparsed.length === 0) {
+ return c;
+ }
+
+ /*
+ * S5.2 says that when looping over the items "[p]rocess the attribute-name
+ * and attribute-value according to the requirements in the following
+ * subsections" for every item. Plus, for many of the individual attributes
+ * in S5.3 it says to use the "attribute-value of the last attribute in the
+ * cookie-attribute-list". Therefore, in this implementation, we overwrite
+ * the previous value.
+ */
+ var cookie_avs = unparsed.split(/\s*;\s*/);
+ while (cookie_avs.length) {
+ var av = cookie_avs.shift();
+ var av_sep = av.indexOf('=');
+ var av_key, av_value;
+
+ if (av_sep === -1) {
+ av_key = av;
+ av_value = null;
+ } else {
+ av_key = av.substr(0,av_sep);
+ av_value = av.substr(av_sep+1);
+ }
+
+ av_key = av_key.trim().toLowerCase();
+
+ if (av_value) {
+ av_value = av_value.trim();
+ }
+
+ switch(av_key) {
+ case 'expires': // S5.2.1
+ if (av_value) {
+ var exp = parseDate(av_value);
+ // "If the attribute-value failed to parse as a cookie date, ignore the
+ // cookie-av."
+ if (exp) {
+ // over and underflow not realistically a concern: V8's getTime() seems to
+ // store something larger than a 32-bit time_t (even with 32-bit node)
+ c.expires = exp;
+ }
+ }
+ break;
+
+ case 'max-age': // S5.2.2
+ if (av_value) {
+ // "If the first character of the attribute-value is not a DIGIT or a "-"
+ // character ...[or]... If the remainder of attribute-value contains a
+ // non-DIGIT character, ignore the cookie-av."
+ if (/^-?[0-9]+$/.test(av_value)) {
+ var delta = parseInt(av_value, 10);
+ // "If delta-seconds is less than or equal to zero (0), let expiry-time
+ // be the earliest representable date and time."
+ c.setMaxAge(delta);
+ }
+ }
+ break;
+
+ case 'domain': // S5.2.3
+ // "If the attribute-value is empty, the behavior is undefined. However,
+ // the user agent SHOULD ignore the cookie-av entirely."
+ if (av_value) {
+ // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
+ // (".") character."
+ var domain = av_value.trim().replace(/^\./, '');
+ if (domain) {
+ // "Convert the cookie-domain to lower case."
+ c.domain = domain.toLowerCase();
+ }
+ }
+ break;
+
+ case 'path': // S5.2.4
+ /*
+ * "If the attribute-value is empty or if the first character of the
+ * attribute-value is not %x2F ("/"):
+ * Let cookie-path be the default-path.
+ * Otherwise:
+ * Let cookie-path be the attribute-value."
+ *
+ * We'll represent the default-path as null since it depends on the
+ * context of the parsing.
+ */
+ c.path = av_value && av_value[0] === "/" ? av_value : null;
+ break;
+
+ case 'secure': // S5.2.5
+ /*
+ * "If the attribute-name case-insensitively matches the string "Secure",
+ * the user agent MUST append an attribute to the cookie-attribute-list
+ * with an attribute-name of Secure and an empty attribute-value."
+ */
+ c.secure = true;
+ break;
+
+ case 'httponly': // S5.2.6 -- effectively the same as 'secure'
+ c.httpOnly = true;
+ break;
+
+ default:
+ c.extensions = c.extensions || [];
+ c.extensions.push(av);
+ break;
+ }
+ }
+
+ // ensure a default date for sorting:
+ c.creation = new Date();
+ //NOTE: add runtime index for the cookieCompare() to resolve the situation when Date's precision is not enough .
+ //Store initial UTC time as well, so we will be able to determine if we need to fallback to the Date object.
+ c._creationRuntimeIdx = ++cookiesCreated;
+ c._initialCreationTime = c.creation.getTime();
+ return c;
+}
+
+function fromJSON(str) {
+ if (!str) {
+ return null;
+ }
+
+ var obj;
+ try {
+ obj = JSON.parse(str);
+ } catch (e) {
+ return null;
+ }
+
+ var c = new Cookie();
+ for (var i=0; i<numCookieProperties; i++) {
+ var prop = cookieProperties[i];
+ if (obj[prop] == null) {
+ continue;
+ }
+ if (prop === 'expires' ||
+ prop === 'creation' ||
+ prop === 'lastAccessed')
+ {
+ c[prop] = obj[prop] == "Infinity" ? "Infinity" : new Date(obj[prop]);
+ } else {
+ c[prop] = obj[prop];
+ }
+ }
+
+
+ // ensure a default date for sorting:
+ c.creation = c.creation || new Date();
+
+ return c;
+}
+
+/* Section 5.4 part 2:
+ * "* Cookies with longer paths are listed before cookies with
+ * shorter paths.
+ *
+ * * Among cookies that have equal-length path fields, cookies with
+ * earlier creation-times are listed before cookies with later
+ * creation-times."
+ */
+
+function cookieCompare(a,b) {
+ // descending for length: b CMP a
+ var deltaLen = (b.path ? b.path.length : 0) - (a.path ? a.path.length : 0);
+ if (deltaLen !== 0) {
+ return deltaLen;
+ }
+
+ var aTime = a.creation ? a.creation.getTime() : MAX_TIME;
+ var bTime = b.creation ? b.creation.getTime() : MAX_TIME;
+
+ // NOTE: if creation dates are equal and they were not modified from the outside,
+ // then use _creationRuntimeIdx for the comparison.
+ if(aTime === bTime && aTime === a._initialCreationTime && bTime === b._initialCreationTime) {
+ return a._creationRuntimeIdx - b._creationRuntimeIdx;
+ }
+
+ // ascending for time: a CMP b
+ return aTime - bTime;
+}
+
+// Gives the permutation of all possible domainMatch()es of a given domain. The
+// array is in shortest-to-longest order. Handy for indexing.
+function permuteDomain(domain) {
+ var pubSuf = pubsuffix.getPublicSuffix(domain);
+ if (!pubSuf) {
+ return null;
+ }
+ if (pubSuf == domain) {
+ return [domain];
+ }
+
+ var prefix = domain.slice(0,-(pubSuf.length+1)); // ".example.com"
+ var parts = prefix.split('.').reverse();
+ var cur = pubSuf;
+ var permutations = [cur];
+ while (parts.length) {
+ cur = parts.shift()+'.'+cur;
+ permutations.push(cur);
+ }
+ return permutations;
+}
+
+// Gives the permutation of all possible pathMatch()es of a given path. The
+// array is in longest-to-shortest order. Handy for indexing.
+function permutePath(path) {
+ if (path === '/') {
+ return ['/'];
+ }
+ if (path.lastIndexOf('/') === path.length-1) {
+ path = path.substr(0,path.length-1);
+ }
+ var permutations = [path];
+ while (path.length > 1) {
+ var lindex = path.lastIndexOf('/');
+ if (lindex === 0) {
+ break;
+ }
+ path = path.substr(0,lindex);
+ permutations.push(path);
+ }
+ permutations.push('/');
+ return permutations;
+}
+
+function getCookieContext(url) {
+ if(url instanceof Object)
+ return url;
+
+ // NOTE: decodeURI will throw on malformed URIs (see GH-32).
+ // Therefore, we will just skip decoding for such URIs.
+ try {
+ url = decodeURI(url);
+ }
+ catch(err) {
+ // Silently swallow error
+ }
+
+ return urlParse(url);
+}
+
+function Cookie (opts) {
+ if (typeof opts !== "object") {
+ return;
+ }
+ Object.keys(opts).forEach(function (key) {
+ if (Cookie.prototype.hasOwnProperty(key)) {
+ this[key] = opts[key] || Cookie.prototype[key];
+ }
+ }.bind(this));
+}
+
+Cookie.parse = parse;
+Cookie.fromJSON = fromJSON;
+
+Cookie.prototype.key = "";
+Cookie.prototype.value = "";
+
+// the order in which the RFC has them:
+Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity
+Cookie.prototype.maxAge = null; // takes precedence over expires for TTL
+Cookie.prototype.domain = null;
+Cookie.prototype.path = null;
+Cookie.prototype.secure = false;
+Cookie.prototype.httpOnly = false;
+Cookie.prototype.extensions = null;
+
+// set by the CookieJar:
+Cookie.prototype.hostOnly = null; // boolean when set
+Cookie.prototype.pathIsDefault = null; // boolean when set
+Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
+Cookie.prototype._initialCreationTime = null; // Used to determine if cookie.creation was modified
+Cookie.prototype._creationRuntimeIdx = null; // Runtime index of the created cookie, used in cookieCompare()
+Cookie.prototype.lastAccessed = null; // Date when set
+
+var cookieProperties = Object.freeze(Object.keys(Cookie.prototype).map(function(p) {
+ if (p instanceof Function) {
+ return;
+ }
+ return p;
+}));
+var numCookieProperties = cookieProperties.length;
+
+Cookie.prototype.inspect = function inspect() {
+ var now = Date.now();
+ return 'Cookie="'+this.toString() +
+ '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +
+ '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +
+ '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +
+ '"';
+};
+
+Cookie.prototype.validate = function validate() {
+ if (!COOKIE_OCTETS.test(this.value)) {
+ return false;
+ }
+ if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires,true)) {
+ return false;
+ }
+ if (this.maxAge != null && this.maxAge <= 0) {
+ return false; // "Max-Age=" non-zero-digit *DIGIT
+ }
+ if (this.path != null && !PATH_VALUE.test(this.path)) {
+ return false;
+ }
+
+ var cdomain = this.cdomain();
+ if (cdomain) {
+ if (cdomain.match(/\.$/)) {
+ return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this
+ }
+ var suffix = pubsuffix.getPublicSuffix(cdomain);
+ if (suffix == null) { // it's a public suffix
+ return false;
+ }
+ }
+ return true;
+};
+
+Cookie.prototype.setExpires = function setExpires(exp) {
+ if (exp instanceof Date) {
+ this.expires = exp;
+ } else {
+ this.expires = parseDate(exp) || "Infinity";
+ }
+};
+
+Cookie.prototype.setMaxAge = function setMaxAge(age) {
+ if (age === Infinity || age === -Infinity) {
+ this.maxAge = age.toString(); // so JSON.stringify() works
+ } else {
+ this.maxAge = age;
+ }
+};
+
+// gives Cookie header format
+Cookie.prototype.cookieString = function cookieString() {
+ var val = this.value;
+ if (val == null) {
+ val = '';
+ }
+ return this.key+'='+val;
+};
+
+// gives Set-Cookie header format
+Cookie.prototype.toString = function toString() {
+ var str = this.cookieString();
+
+ if (this.expires != Infinity) {
+ if (this.expires instanceof Date) {
+ str += '; Expires='+formatDate(this.expires);
+ } else {
+ str += '; Expires='+this.expires;
+ }
+ }
+
+ if (this.maxAge != null && this.maxAge != Infinity) {
+ str += '; Max-Age='+this.maxAge;
+ }
+
+ if (this.domain && !this.hostOnly) {
+ str += '; Domain='+this.domain;
+ }
+ if (this.path) {
+ str += '; Path='+this.path;
+ }
+
+ if (this.secure) {
+ str += '; Secure';
+ }
+ if (this.httpOnly) {
+ str += '; HttpOnly';
+ }
+ if (this.extensions) {
+ this.extensions.forEach(function(ext) {
+ str += '; '+ext;
+ });
+ }
+
+ return str;
+};
+
+// TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
+// elsewhere)
+// S5.3 says to give the "latest representable date" for which we use Infinity
+// For "expired" we use 0
+Cookie.prototype.TTL = function TTL(now) {
+ /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires
+ * attribute, the Max-Age attribute has precedence and controls the
+ * expiration date of the cookie.
+ * (Concurs with S5.3 step 3)
+ */
+ if (this.maxAge != null) {
+ return this.maxAge<=0 ? 0 : this.maxAge*1000;
+ }
+
+ var expires = this.expires;
+ if (expires != Infinity) {
+ if (!(expires instanceof Date)) {
+ expires = parseDate(expires) || Infinity;
+ }
+
+ if (expires == Infinity) {
+ return Infinity;
+ }
+
+ return expires.getTime() - (now || Date.now());
+ }
+
+ return Infinity;
+};
+
+// expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
+// elsewhere)
+Cookie.prototype.expiryTime = function expiryTime(now) {
+ if (this.maxAge != null) {
+ var relativeTo = this.creation || now || new Date();
+ var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;
+ return relativeTo.getTime() + age;
+ }
+
+ if (this.expires == Infinity) {
+ return Infinity;
+ }
+ return this.expires.getTime();
+};
+
+// expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
+// elsewhere), except it returns a Date
+Cookie.prototype.expiryDate = function expiryDate(now) {
+ var millisec = this.expiryTime(now);
+ if (millisec == Infinity) {
+ return new Date(MAX_TIME);
+ } else if (millisec == -Infinity) {
+ return new Date(MIN_TIME);
+ } else {
+ return new Date(millisec);
+ }
+};
+
+// This replaces the "persistent-flag" parts of S5.3 step 3
+Cookie.prototype.isPersistent = function isPersistent() {
+ return (this.maxAge != null || this.expires != Infinity);
+};
+
+// Mostly S5.1.2 and S5.2.3:
+Cookie.prototype.cdomain =
+Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
+ if (this.domain == null) {
+ return null;
+ }
+ return canonicalDomain(this.domain);
+};
+
+
+var memstore;
+function CookieJar(store, rejectPublicSuffixes) {
+ if (rejectPublicSuffixes != null) {
+ this.rejectPublicSuffixes = rejectPublicSuffixes;
+ }
+
+ if (!store) {
+ memstore = memstore || require('./memstore');
+ store = new memstore.MemoryCookieStore();
+ }
+ this.store = store;
+}
+CookieJar.prototype.store = null;
+CookieJar.prototype.rejectPublicSuffixes = true;
+var CAN_BE_SYNC = [];
+
+CAN_BE_SYNC.push('setCookie');
+CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
+ var err;
+ var context = getCookieContext(url);
+ if (options instanceof Function) {
+ cb = options;
+ options = {};
+ }
+
+ var host = canonicalDomain(context.hostname);
+
+ // S5.3 step 1
+ if (!(cookie instanceof Cookie)) {
+ cookie = Cookie.parse(cookie);
+ }
+ if (!cookie) {
+ err = new Error("Cookie failed to parse");
+ return cb(options.ignoreError ? null : err);
+ }
+
+ // S5.3 step 2
+ var now = options.now || new Date(); // will assign later to save effort in the face of errors
+
+ // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
+
+ // S5.3 step 4: NOOP; domain is null by default
+
+ // S5.3 step 5: public suffixes
+ if (this.rejectPublicSuffixes && cookie.domain) {
+ var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
+ if (suffix == null) { // e.g. "com"
+ err = new Error("Cookie has domain set to a public suffix");
+ return cb(options.ignoreError ? null : err);
+ }
+ }
+
+ // S5.3 step 6:
+ if (cookie.domain) {
+ if (!domainMatch(host, cookie.cdomain(), false)) {
+ err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host);
+ return cb(options.ignoreError ? null : err);
+ }
+
+ if (cookie.hostOnly == null) { // don't reset if already set
+ cookie.hostOnly = false;
+ }
+
+ } else {
+ cookie.hostOnly = true;
+ cookie.domain = host;
+ }
+
+ //S5.2.4 If the attribute-value is empty or if the first character of the
+ //attribute-value is not %x2F ("/"):
+ //Let cookie-path be the default-path.
+ if (!cookie.path || cookie.path[0] !== '/') {
+ cookie.path = defaultPath(context.pathname);
+ cookie.pathIsDefault = true;
+ }
+
+ // S5.3 step 8: NOOP; secure attribute
+ // S5.3 step 9: NOOP; httpOnly attribute
+
+ // S5.3 step 10
+ if (options.http === false && cookie.httpOnly) {
+ err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
+ return cb(options.ignoreError ? null : err);
+ }
+
+ var store = this.store;
+
+ if (!store.updateCookie) {
+ store.updateCookie = function(oldCookie, newCookie, cb) {
+ this.putCookie(newCookie, cb);
+ };
+ }
+
+ function withCookie(err, oldCookie) {
+ if (err) {
+ return cb(err);
+ }
+
+ var next = function(err) {
+ if (err) {
+ return cb(err);
+ } else {
+ cb(null, cookie);
+ }
+ };
+
+ if (oldCookie) {
+ // S5.3 step 11 - "If the cookie store contains a cookie with the same name,
+ // domain, and path as the newly created cookie:"
+ if (options.http === false && oldCookie.httpOnly) { // step 11.2
+ err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
+ return cb(options.ignoreError ? null : err);
+ }
+ cookie.creation = oldCookie.creation; // step 11.3
+ cookie.lastAccessed = now;
+ // Step 11.4 (delete cookie) is implied by just setting the new one:
+ store.updateCookie(oldCookie, cookie, next); // step 12
+
+ } else {
+ cookie.creation = cookie.lastAccessed = now;
+ store.putCookie(cookie, next); // step 12
+ }
+ }
+
+ store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
+};
+
+// RFC6365 S5.4
+CAN_BE_SYNC.push('getCookies');
+CookieJar.prototype.getCookies = function(url, options, cb) {
+ var context = getCookieContext(url);
+ if (options instanceof Function) {
+ cb = options;
+ options = {};
+ }
+
+ var host = canonicalDomain(context.hostname);
+ var path = context.pathname || '/';
+
+ var secure = options.secure;
+ if (secure == null && context.protocol &&
+ (context.protocol == 'https:' || context.protocol == 'wss:'))
+ {
+ secure = true;
+ }
+
+ var http = options.http;
+ if (http == null) {
+ http = true;
+ }
+
+ var now = options.now || Date.now();
+ var expireCheck = options.expire !== false;
+ var allPaths = !!options.allPaths;
+ var store = this.store;
+
+ function matchingCookie(c) {
+ // "Either:
+ // The cookie's host-only-flag is true and the canonicalized
+ // request-host is identical to the cookie's domain.
+ // Or:
+ // The cookie's host-only-flag is false and the canonicalized
+ // request-host domain-matches the cookie's domain."
+ if (c.hostOnly) {
+ if (c.domain != host) {
+ return false;
+ }
+ } else {
+ if (!domainMatch(host, c.domain, false)) {
+ return false;
+ }
+ }
+
+ // "The request-uri's path path-matches the cookie's path."
+ if (!allPaths && !pathMatch(path, c.path)) {
+ return false;
+ }
+
+ // "If the cookie's secure-only-flag is true, then the request-uri's
+ // scheme must denote a "secure" protocol"
+ if (c.secure && !secure) {
+ return false;
+ }
+
+ // "If the cookie's http-only-flag is true, then exclude the cookie if the
+ // cookie-string is being generated for a "non-HTTP" API"
+ if (c.httpOnly && !http) {
+ return false;
+ }
+
+ // deferred from S5.3
+ // non-RFC: allow retention of expired cookies by choice
+ if (expireCheck && c.expiryTime() <= now) {
+ store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored
+ return false;
+ }
+
+ return true;
+ }
+
+ store.findCookies(host, allPaths ? null : path, function(err,cookies) {
+ if (err) {
+ return cb(err);
+ }
+
+ cookies = cookies.filter(matchingCookie);
+
+ // sorting of S5.4 part 2
+ if (options.sort !== false) {
+ cookies = cookies.sort(cookieCompare);
+ }
+
+ // S5.4 part 3
+ var now = new Date();
+ cookies.forEach(function(c) {
+ c.lastAccessed = now;
+ });
+ // TODO persist lastAccessed
+
+ cb(null,cookies);
+ });
+};
+
+CAN_BE_SYNC.push('getCookieString');
+CookieJar.prototype.getCookieString = function(/*..., cb*/) {
+ var args = Array.prototype.slice.call(arguments,0);
+ var cb = args.pop();
+ var next = function(err,cookies) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, cookies
+ .sort(cookieCompare)
+ .map(function(c){
+ return c.cookieString();
+ })
+ .join('; '));
+ }
+ };
+ args.push(next);
+ this.getCookies.apply(this,args);
+};
+
+CAN_BE_SYNC.push('getSetCookieStrings');
+CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
+ var args = Array.prototype.slice.call(arguments,0);
+ var cb = args.pop();
+ var next = function(err,cookies) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, cookies.map(function(c){
+ return c.toString();
+ }));
+ }
+ };
+ args.push(next);
+ this.getCookies.apply(this,args);
+};
+
+// Use a closure to provide a true imperative API for synchronous stores.
+function syncWrap(method) {
+ return function() {
+ if (!this.store.synchronous) {
+ throw new Error('CookieJar store is not synchronous; use async API instead.');
+ }
+
+ var args = Array.prototype.slice.call(arguments);
+ var syncErr, syncResult;
+ args.push(function syncCb(err, result) {
+ syncErr = err;
+ syncResult = result;
+ });
+ this[method].apply(this, args);
+
+ if (syncErr) {
+ throw syncErr;
+ }
+ return syncResult;
+ };
+}
+
+// wrap all declared CAN_BE_SYNC methods in the sync wrapper
+CAN_BE_SYNC.forEach(function(method) {
+ CookieJar.prototype[method+'Sync'] = syncWrap(method);
+});
+
+module.exports = {
+ CookieJar: CookieJar,
+ Cookie: Cookie,
+ Store: Store,
+ parseDate: parseDate,
+ formatDate: formatDate,
+ parse: parse,
+ fromJSON: fromJSON,
+ domainMatch: domainMatch,
+ defaultPath: defaultPath,
+ pathMatch: pathMatch,
+ getPublicSuffix: pubsuffix.getPublicSuffix,
+ cookieCompare: cookieCompare,
+ permuteDomain: permuteDomain,
+ permutePath: permutePath,
+ canonicalDomain: canonicalDomain
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/tough-cookie/lib/memstore.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/memstore.js b/node_modules/request/node_modules/tough-cookie/lib/memstore.js
new file mode 100644
index 0000000..ce3ee66
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/memstore.js
@@ -0,0 +1,143 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+'use strict';
+var tough = require('./cookie');
+var Store = require('./store').Store;
+var permuteDomain = tough.permuteDomain;
+var pathMatch = tough.pathMatch;
+var util = require('util');
+
+function MemoryCookieStore() {
+ Store.call(this);
+ this.idx = {};
+}
+util.inherits(MemoryCookieStore, Store);
+exports.MemoryCookieStore = MemoryCookieStore;
+MemoryCookieStore.prototype.idx = null;
+MemoryCookieStore.prototype.synchronous = true;
+
+// force a default depth:
+MemoryCookieStore.prototype.inspect = function() {
+ return "{ idx: "+util.inspect(this.idx, false, 2)+' }';
+};
+
+MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {
+ if (!this.idx[domain]) {
+ return cb(null,undefined);
+ }
+ if (!this.idx[domain][path]) {
+ return cb(null,undefined);
+ }
+ return cb(null,this.idx[domain][path][key]||null);
+};
+
+MemoryCookieStore.prototype.findCookies = function(domain, path, cb) {
+ var results = [];
+ if (!domain) {
+ return cb(null,[]);
+ }
+
+ var pathMatcher;
+ if (!path) {
+ // null means "all paths"
+ pathMatcher = function matchAll(domainIndex) {
+ for (var curPath in domainIndex) {
+ var pathIndex = domainIndex[curPath];
+ for (var key in pathIndex) {
+ results.push(pathIndex[key]);
+ }
+ }
+ };
+
+ } else {
+ pathMatcher = function matchRFC(domainIndex) {
+ //NOTE: we should use path-match algorithm from S5.1.4 here
+ //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)
+ Object.keys(domainIndex).forEach(function (cookiePath) {
+ if (pathMatch(path, cookiePath)) {
+ var pathIndex = domainIndex[cookiePath];
+
+ for (var key in pathIndex) {
+ results.push(pathIndex[key]);
+ }
+ }
+ });
+ };
+ }
+
+ var domains = permuteDomain(domain) || [domain];
+ var idx = this.idx;
+ domains.forEach(function(curDomain) {
+ var domainIndex = idx[curDomain];
+ if (!domainIndex) {
+ return;
+ }
+ pathMatcher(domainIndex);
+ });
+
+ cb(null,results);
+};
+
+MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
+ if (!this.idx[cookie.domain]) {
+ this.idx[cookie.domain] = {};
+ }
+ if (!this.idx[cookie.domain][cookie.path]) {
+ this.idx[cookie.domain][cookie.path] = {};
+ }
+ this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
+ cb(null);
+};
+
+MemoryCookieStore.prototype.updateCookie = function updateCookie(oldCookie, newCookie, cb) {
+ // updateCookie() may avoid updating cookies that are identical. For example,
+ // lastAccessed may not be important to some stores and an equality
+ // comparison could exclude that field.
+ this.putCookie(newCookie,cb);
+};
+
+MemoryCookieStore.prototype.removeCookie = function removeCookie(domain, path, key, cb) {
+ if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {
+ delete this.idx[domain][path][key];
+ }
+ cb(null);
+};
+
+MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path, cb) {
+ if (this.idx[domain]) {
+ if (path) {
+ delete this.idx[domain][path];
+ } else {
+ delete this.idx[domain];
+ }
+ }
+ return cb(null);
+};
[06/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/README.md b/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
index 978f63a..19357bb 100755
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
@@ -22,6 +22,7 @@ Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
* [contain](#containref-values-options "contain")
* [flatten](#flattenarray-target "flatten")
* [reach](#reachobj-chain-options "reach")
+ * [reachTemplate](#reachobj-template-options "reachTemplate")
* [transform](#transformobj-transform-options "transform")
* [shallow](#shallowobj "shallow")
* [stringify](#stringifyobj "stringify")
@@ -304,6 +305,23 @@ var obj = {a : {b : [2,3,6]}};
Hoek.reach(obj, chain); // returns 6
```
+### reachTemplate(obj, template, [options])
+
+Replaces string parameters (`{name}`) with their corresponding object key values by applying the
+(`reach()`)[#reachobj-chain-options] method where:
+
+- `obj` - the context object used for key lookup.
+- `template` - a string containing `{}` parameters.
+- `options` - optional (`reach()`)[#reachobj-chain-options] options.
+
+```javascript
+
+var chain = 'a.b.c';
+var obj = {a : {b : { c : 1}}};
+
+Hoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'
+```
+
### transform(obj, transform, [options])
Transforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
new file mode 100755
index 0000000..9ecde66
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
@@ -0,0 +1,132 @@
+// Declare internals
+
+var internals = {};
+
+
+exports.escapeJavaScript = function (input) {
+
+ if (!input) {
+ return '';
+ }
+
+ var escaped = '';
+
+ for (var i = 0, il = input.length; i < il; ++i) {
+
+ var charCode = input.charCodeAt(i);
+
+ if (internals.isSafe(charCode)) {
+ escaped += input[i];
+ }
+ else {
+ escaped += internals.escapeJavaScriptChar(charCode);
+ }
+ }
+
+ return escaped;
+};
+
+
+exports.escapeHtml = function (input) {
+
+ if (!input) {
+ return '';
+ }
+
+ var escaped = '';
+
+ for (var i = 0, il = input.length; i < il; ++i) {
+
+ var charCode = input.charCodeAt(i);
+
+ if (internals.isSafe(charCode)) {
+ escaped += input[i];
+ }
+ else {
+ escaped += internals.escapeHtmlChar(charCode);
+ }
+ }
+
+ return escaped;
+};
+
+
+internals.escapeJavaScriptChar = function (charCode) {
+
+ if (charCode >= 256) {
+ return '\\u' + internals.padLeft('' + charCode, 4);
+ }
+
+ var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+ return '\\x' + internals.padLeft(hexValue, 2);
+};
+
+
+internals.escapeHtmlChar = function (charCode) {
+
+ var namedEscape = internals.namedHtml[charCode];
+ if (typeof namedEscape !== 'undefined') {
+ return namedEscape;
+ }
+
+ if (charCode >= 256) {
+ return '&#' + charCode + ';';
+ }
+
+ var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+ return '&#x' + internals.padLeft(hexValue, 2) + ';';
+};
+
+
+internals.padLeft = function (str, len) {
+
+ while (str.length < len) {
+ str = '0' + str;
+ }
+
+ return str;
+};
+
+
+internals.isSafe = function (charCode) {
+
+ return (typeof internals.safeCharCodes[charCode] !== 'undefined');
+};
+
+
+internals.namedHtml = {
+ '38': '&',
+ '60': '<',
+ '62': '>',
+ '34': '"',
+ '160': ' ',
+ '162': '¢',
+ '163': '£',
+ '164': '¤',
+ '169': '©',
+ '174': '®'
+};
+
+
+internals.safeCharCodes = (function () {
+
+ var safe = {};
+
+ for (var i = 32; i < 123; ++i) {
+
+ if ((i >= 97) || // a-z
+ (i >= 65 && i <= 90) || // A-Z
+ (i >= 48 && i <= 57) || // 0-9
+ i === 32 || // space
+ i === 46 || // .
+ i === 44 || // ,
+ i === 45 || // -
+ i === 58 || // :
+ i === 95) { // _
+
+ safe[i] = null;
+ }
+ }
+
+ return safe;
+}());
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
new file mode 100755
index 0000000..5f6f90c
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
@@ -0,0 +1,977 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Path = require('path');
+var Util = require('util');
+var Escape = require('./escape');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Clone object or array
+
+exports.clone = function (obj, seen) {
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return obj;
+ }
+
+ seen = seen || { orig: [], copy: [] };
+
+ var lookup = seen.orig.indexOf(obj);
+ if (lookup !== -1) {
+ return seen.copy[lookup];
+ }
+
+ var newObj;
+ var cloneDeep = false;
+
+ if (!Array.isArray(obj)) {
+ if (Buffer.isBuffer(obj)) {
+ newObj = new Buffer(obj);
+ }
+ else if (obj instanceof Date) {
+ newObj = new Date(obj.getTime());
+ }
+ else if (obj instanceof RegExp) {
+ newObj = new RegExp(obj);
+ }
+ else {
+ var proto = Object.getPrototypeOf(obj);
+ if (proto &&
+ proto.isImmutable) {
+
+ newObj = obj;
+ }
+ else {
+ newObj = Object.create(proto);
+ cloneDeep = true;
+ }
+ }
+ }
+ else {
+ newObj = [];
+ cloneDeep = true;
+ }
+
+ seen.orig.push(obj);
+ seen.copy.push(newObj);
+
+ if (cloneDeep) {
+ var keys = Object.getOwnPropertyNames(obj);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var descriptor = Object.getOwnPropertyDescriptor(obj, key);
+ if (descriptor.get ||
+ descriptor.set) {
+
+ Object.defineProperty(newObj, key, descriptor);
+ }
+ else {
+ newObj[key] = exports.clone(obj[key], seen);
+ }
+ }
+ }
+
+ return newObj;
+};
+
+
+// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied
+/*eslint-disable */
+exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) {
+/*eslint-enable */
+ exports.assert(target && typeof target === 'object', 'Invalid target value: must be an object');
+ exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
+
+ if (!source) {
+ return target;
+ }
+
+ if (Array.isArray(source)) {
+ exports.assert(Array.isArray(target), 'Cannot merge array onto an object');
+ if (isMergeArrays === false) { // isMergeArrays defaults to true
+ target.length = 0; // Must not change target assignment
+ }
+
+ for (var i = 0, il = source.length; i < il; ++i) {
+ target.push(exports.clone(source[i]));
+ }
+
+ return target;
+ }
+
+ var keys = Object.keys(source);
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var value = source[key];
+ if (value &&
+ typeof value === 'object') {
+
+ if (!target[key] ||
+ typeof target[key] !== 'object' ||
+ (Array.isArray(target[key]) ^ Array.isArray(value)) ||
+ value instanceof Date ||
+ Buffer.isBuffer(value) ||
+ value instanceof RegExp) {
+
+ target[key] = exports.clone(value);
+ }
+ else {
+ exports.merge(target[key], value, isNullOverride, isMergeArrays);
+ }
+ }
+ else {
+ if (value !== null &&
+ value !== undefined) { // Explicit to preserve empty strings
+
+ target[key] = value;
+ }
+ else if (isNullOverride !== false) { // Defaults to true
+ target[key] = value;
+ }
+ }
+ }
+
+ return target;
+};
+
+
+// Apply options to a copy of the defaults
+
+exports.applyToDefaults = function (defaults, options, isNullOverride) {
+
+ exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
+ exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
+
+ if (!options) { // If no options, return null
+ return null;
+ }
+
+ var copy = exports.clone(defaults);
+
+ if (options === true) { // If options is set to true, use defaults
+ return copy;
+ }
+
+ return exports.merge(copy, options, isNullOverride === true, false);
+};
+
+
+// Clone an object except for the listed keys which are shallow copied
+
+exports.cloneWithShallow = function (source, keys) {
+
+ if (!source ||
+ typeof source !== 'object') {
+
+ return source;
+ }
+
+ var storage = internals.store(source, keys); // Move shallow copy items to storage
+ var copy = exports.clone(source); // Deep copy the rest
+ internals.restore(copy, source, storage); // Shallow copy the stored items and restore
+ return copy;
+};
+
+
+internals.store = function (source, keys) {
+
+ var storage = {};
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var value = exports.reach(source, key);
+ if (value !== undefined) {
+ storage[key] = value;
+ internals.reachSet(source, key, undefined);
+ }
+ }
+
+ return storage;
+};
+
+
+internals.restore = function (copy, source, storage) {
+
+ var keys = Object.keys(storage);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ internals.reachSet(copy, key, storage[key]);
+ internals.reachSet(source, key, storage[key]);
+ }
+};
+
+
+internals.reachSet = function (obj, key, value) {
+
+ var path = key.split('.');
+ var ref = obj;
+ for (var i = 0, il = path.length; i < il; ++i) {
+ var segment = path[i];
+ if (i + 1 === il) {
+ ref[segment] = value;
+ }
+
+ ref = ref[segment];
+ }
+};
+
+
+// Apply options to defaults except for the listed keys which are shallow copied from option without merging
+
+exports.applyToDefaultsWithShallow = function (defaults, options, keys) {
+
+ exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
+ exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
+ exports.assert(keys && Array.isArray(keys), 'Invalid keys');
+
+ if (!options) { // If no options, return null
+ return null;
+ }
+
+ var copy = exports.cloneWithShallow(defaults, keys);
+
+ if (options === true) { // If options is set to true, use defaults
+ return copy;
+ }
+
+ var storage = internals.store(options, keys); // Move shallow copy items to storage
+ exports.merge(copy, options, false, false); // Deep copy the rest
+ internals.restore(copy, options, storage); // Shallow copy the stored items and restore
+ return copy;
+};
+
+
+// Deep object or array comparison
+
+exports.deepEqual = function (obj, ref, options, seen) {
+
+ options = options || { prototype: true };
+
+ var type = typeof obj;
+
+ if (type !== typeof ref) {
+ return false;
+ }
+
+ if (type !== 'object' ||
+ obj === null ||
+ ref === null) {
+
+ if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql
+ return obj !== 0 || 1 / obj === 1 / ref; // -0 / +0
+ }
+
+ return obj !== obj && ref !== ref; // NaN
+ }
+
+ seen = seen || [];
+ if (seen.indexOf(obj) !== -1) {
+ return true; // If previous comparison failed, it would have stopped execution
+ }
+
+ seen.push(obj);
+
+ if (Array.isArray(obj)) {
+ if (!Array.isArray(ref)) {
+ return false;
+ }
+
+ if (!options.part && obj.length !== ref.length) {
+ return false;
+ }
+
+ for (var i = 0, il = obj.length; i < il; ++i) {
+ if (options.part) {
+ var found = false;
+ for (var r = 0, rl = ref.length; r < rl; ++r) {
+ if (exports.deepEqual(obj[i], ref[r], options, seen)) {
+ found = true;
+ break;
+ }
+ }
+
+ return found;
+ }
+
+ if (!exports.deepEqual(obj[i], ref[i], options, seen)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (Buffer.isBuffer(obj)) {
+ if (!Buffer.isBuffer(ref)) {
+ return false;
+ }
+
+ if (obj.length !== ref.length) {
+ return false;
+ }
+
+ for (var j = 0, jl = obj.length; j < jl; ++j) {
+ if (obj[j] !== ref[j]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (obj instanceof Date) {
+ return (ref instanceof Date && obj.getTime() === ref.getTime());
+ }
+
+ if (obj instanceof RegExp) {
+ return (ref instanceof RegExp && obj.toString() === ref.toString());
+ }
+
+ if (options.prototype) {
+ if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) {
+ return false;
+ }
+ }
+
+ var keys = Object.getOwnPropertyNames(obj);
+
+ if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) {
+ return false;
+ }
+
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var descriptor = Object.getOwnPropertyDescriptor(obj, key);
+ if (descriptor.get) {
+ if (!exports.deepEqual(descriptor, Object.getOwnPropertyDescriptor(ref, key), options, seen)) {
+ return false;
+ }
+ }
+ else if (!exports.deepEqual(obj[key], ref[key], options, seen)) {
+ return false;
+ }
+ }
+
+ return true;
+};
+
+
+// Remove duplicate items from array
+
+exports.unique = function (array, key) {
+
+ var index = {};
+ var result = [];
+
+ for (var i = 0, il = array.length; i < il; ++i) {
+ var id = (key ? array[i][key] : array[i]);
+ if (index[id] !== true) {
+
+ result.push(array[i]);
+ index[id] = true;
+ }
+ }
+
+ return result;
+};
+
+
+// Convert array into object
+
+exports.mapToObject = function (array, key) {
+
+ if (!array) {
+ return null;
+ }
+
+ var obj = {};
+ for (var i = 0, il = array.length; i < il; ++i) {
+ if (key) {
+ if (array[i][key]) {
+ obj[array[i][key]] = true;
+ }
+ }
+ else {
+ obj[array[i]] = true;
+ }
+ }
+
+ return obj;
+};
+
+
+// Find the common unique items in two arrays
+
+exports.intersect = function (array1, array2, justFirst) {
+
+ if (!array1 || !array2) {
+ return [];
+ }
+
+ var common = [];
+ var hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1);
+ var found = {};
+ for (var i = 0, il = array2.length; i < il; ++i) {
+ if (hash[array2[i]] && !found[array2[i]]) {
+ if (justFirst) {
+ return array2[i];
+ }
+
+ common.push(array2[i]);
+ found[array2[i]] = true;
+ }
+ }
+
+ return (justFirst ? null : common);
+};
+
+
+// Test if the reference contains the values
+
+exports.contain = function (ref, values, options) {
+
+ /*
+ string -> string(s)
+ array -> item(s)
+ object -> key(s)
+ object -> object (key:value)
+ */
+
+ var valuePairs = null;
+ if (typeof ref === 'object' &&
+ typeof values === 'object' &&
+ !Array.isArray(ref) &&
+ !Array.isArray(values)) {
+
+ valuePairs = values;
+ values = Object.keys(values);
+ }
+ else {
+ values = [].concat(values);
+ }
+
+ options = options || {}; // deep, once, only, part
+
+ exports.assert(arguments.length >= 2, 'Insufficient arguments');
+ exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object');
+ exports.assert(values.length, 'Values array cannot be empty');
+
+ var compare, compareFlags;
+ if (options.deep) {
+ compare = exports.deepEqual;
+
+ var hasOnly = options.hasOwnProperty('only'), hasPart = options.hasOwnProperty('part');
+
+ compareFlags = {
+ prototype: hasOnly ? options.only : hasPart ? !options.part : false,
+ part: hasOnly ? !options.only : hasPart ? options.part : true
+ };
+ }
+ else {
+ compare = function (a, b) {
+
+ return a === b;
+ };
+ }
+
+ var misses = false;
+ var matches = new Array(values.length);
+ for (var i = 0, il = matches.length; i < il; ++i) {
+ matches[i] = 0;
+ }
+
+ if (typeof ref === 'string') {
+ var pattern = '(';
+ for (i = 0, il = values.length; i < il; ++i) {
+ var value = values[i];
+ exports.assert(typeof value === 'string', 'Cannot compare string reference to non-string value');
+ pattern += (i ? '|' : '') + exports.escapeRegex(value);
+ }
+
+ var regex = new RegExp(pattern + ')', 'g');
+ var leftovers = ref.replace(regex, function ($0, $1) {
+
+ var index = values.indexOf($1);
+ ++matches[index];
+ return ''; // Remove from string
+ });
+
+ misses = !!leftovers;
+ }
+ else if (Array.isArray(ref)) {
+ for (i = 0, il = ref.length; i < il; ++i) {
+ for (var j = 0, jl = values.length, matched = false; j < jl && matched === false; ++j) {
+ matched = compare(values[j], ref[i], compareFlags) && j;
+ }
+
+ if (matched !== false) {
+ ++matches[matched];
+ }
+ else {
+ misses = true;
+ }
+ }
+ }
+ else {
+ var keys = Object.keys(ref);
+ for (i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var pos = values.indexOf(key);
+ if (pos !== -1) {
+ if (valuePairs &&
+ !compare(valuePairs[key], ref[key], compareFlags)) {
+
+ return false;
+ }
+
+ ++matches[pos];
+ }
+ else {
+ misses = true;
+ }
+ }
+ }
+
+ var result = false;
+ for (i = 0, il = matches.length; i < il; ++i) {
+ result = result || !!matches[i];
+ if ((options.once && matches[i] > 1) ||
+ (!options.part && !matches[i])) {
+
+ return false;
+ }
+ }
+
+ if (options.only &&
+ misses) {
+
+ return false;
+ }
+
+ return result;
+};
+
+
+// Flatten array
+
+exports.flatten = function (array, target) {
+
+ var result = target || [];
+
+ for (var i = 0, il = array.length; i < il; ++i) {
+ if (Array.isArray(array[i])) {
+ exports.flatten(array[i], result);
+ }
+ else {
+ result.push(array[i]);
+ }
+ }
+
+ return result;
+};
+
+
+// Convert an object key chain string ('a.b.c') to reference (object[a][b][c])
+
+exports.reach = function (obj, chain, options) {
+
+ options = options || {};
+ if (typeof options === 'string') {
+ options = { separator: options };
+ }
+
+ var path = chain.split(options.separator || '.');
+ var ref = obj;
+ for (var i = 0, il = path.length; i < il; ++i) {
+ var key = path[i];
+ if (key[0] === '-' && Array.isArray(ref)) {
+ key = key.slice(1, key.length);
+ key = ref.length - key;
+ }
+
+ if (!ref ||
+ !ref.hasOwnProperty(key) ||
+ (typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties
+
+ exports.assert(!options.strict || i + 1 === il, 'Missing segment', key, 'in reach path ', chain);
+ exports.assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain);
+ ref = options.default;
+ break;
+ }
+
+ ref = ref[key];
+ }
+
+ return ref;
+};
+
+
+exports.reachTemplate = function (obj, template, options) {
+
+ return template.replace(/{([^}]+)}/g, function ($0, chain) {
+
+ var value = exports.reach(obj, chain, options);
+ return (value === undefined || value === null ? '' : value);
+ });
+};
+
+
+exports.formatStack = function (stack) {
+
+ var trace = [];
+ for (var i = 0, il = stack.length; i < il; ++i) {
+ var item = stack[i];
+ trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]);
+ }
+
+ return trace;
+};
+
+
+exports.formatTrace = function (trace) {
+
+ var display = [];
+
+ for (var i = 0, il = trace.length; i < il; ++i) {
+ var row = trace[i];
+ display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')');
+ }
+
+ return display;
+};
+
+
+exports.callStack = function (slice) {
+
+ // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+
+ var v8 = Error.prepareStackTrace;
+ Error.prepareStackTrace = function (err, stack) {
+
+ return stack;
+ };
+
+ var capture = {};
+ Error.captureStackTrace(capture, arguments.callee); /*eslint no-caller:0 */
+ var stack = capture.stack;
+
+ Error.prepareStackTrace = v8;
+
+ var trace = exports.formatStack(stack);
+
+ if (slice) {
+ return trace.slice(slice);
+ }
+
+ return trace;
+};
+
+
+exports.displayStack = function (slice) {
+
+ var trace = exports.callStack(slice === undefined ? 1 : slice + 1);
+
+ return exports.formatTrace(trace);
+};
+
+
+exports.abortThrow = false;
+
+
+exports.abort = function (message, hideStack) {
+
+ if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) {
+ throw new Error(message || 'Unknown error');
+ }
+
+ var stack = '';
+ if (!hideStack) {
+ stack = exports.displayStack(1).join('\n\t');
+ }
+ console.log('ABORT: ' + message + '\n\t' + stack);
+ process.exit(1);
+};
+
+
+exports.assert = function (condition /*, msg1, msg2, msg3 */) {
+
+ if (condition) {
+ return;
+ }
+
+ if (arguments.length === 2 && arguments[1] instanceof Error) {
+ throw arguments[1];
+ }
+
+ var msgs = [];
+ for (var i = 1, il = arguments.length; i < il; ++i) {
+ if (arguments[i] !== '') {
+ msgs.push(arguments[i]); // Avoids Array.slice arguments leak, allowing for V8 optimizations
+ }
+ }
+
+ msgs = msgs.map(function (msg) {
+
+ return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : exports.stringify(msg);
+ });
+ throw new Error(msgs.join(' ') || 'Unknown error');
+};
+
+
+exports.Timer = function () {
+
+ this.ts = 0;
+ this.reset();
+};
+
+
+exports.Timer.prototype.reset = function () {
+
+ this.ts = Date.now();
+};
+
+
+exports.Timer.prototype.elapsed = function () {
+
+ return Date.now() - this.ts;
+};
+
+
+exports.Bench = function () {
+
+ this.ts = 0;
+ this.reset();
+};
+
+
+exports.Bench.prototype.reset = function () {
+
+ this.ts = exports.Bench.now();
+};
+
+
+exports.Bench.prototype.elapsed = function () {
+
+ return exports.Bench.now() - this.ts;
+};
+
+
+exports.Bench.now = function () {
+
+ var ts = process.hrtime();
+ return (ts[0] * 1e3) + (ts[1] / 1e6);
+};
+
+
+// Escape string for Regex construction
+
+exports.escapeRegex = function (string) {
+
+ // Escape ^$.*+-?=!:|\/()[]{},
+ return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
+};
+
+
+// Base64url (RFC 4648) encode
+
+exports.base64urlEncode = function (value, encoding) {
+
+ var buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary'));
+ return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+};
+
+
+// Base64url (RFC 4648) decode
+
+exports.base64urlDecode = function (value, encoding) {
+
+ if (value &&
+ !/^[\w\-]*$/.test(value)) {
+
+ return new Error('Invalid character');
+ }
+
+ try {
+ var buf = new Buffer(value, 'base64');
+ return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary'));
+ }
+ catch (err) {
+ return err;
+ }
+};
+
+
+// Escape attribute value for use in HTTP header
+
+exports.escapeHeaderAttribute = function (attribute) {
+
+ // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
+
+ exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')');
+
+ return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash
+};
+
+
+exports.escapeHtml = function (string) {
+
+ return Escape.escapeHtml(string);
+};
+
+
+exports.escapeJavaScript = function (string) {
+
+ return Escape.escapeJavaScript(string);
+};
+
+
+exports.nextTick = function (callback) {
+
+ return function () {
+
+ var args = arguments;
+ process.nextTick(function () {
+
+ callback.apply(null, args);
+ });
+ };
+};
+
+
+exports.once = function (method) {
+
+ if (method._hoekOnce) {
+ return method;
+ }
+
+ var once = false;
+ var wrapped = function () {
+
+ if (!once) {
+ once = true;
+ method.apply(null, arguments);
+ }
+ };
+
+ wrapped._hoekOnce = true;
+
+ return wrapped;
+};
+
+
+exports.isAbsolutePath = function (path, platform) {
+
+ if (!path) {
+ return false;
+ }
+
+ if (Path.isAbsolute) { // node >= 0.11
+ return Path.isAbsolute(path);
+ }
+
+ platform = platform || process.platform;
+
+ // Unix
+
+ if (platform !== 'win32') {
+ return path[0] === '/';
+ }
+
+ // Windows
+
+ return !!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path); // C:\ or \\something\something
+};
+
+
+exports.isInteger = function (value) {
+
+ return (typeof value === 'number' &&
+ parseFloat(value) === parseInt(value, 10) &&
+ !isNaN(value));
+};
+
+
+exports.ignore = function () { };
+
+
+exports.inherits = Util.inherits;
+
+
+exports.format = Util.format;
+
+
+exports.transform = function (source, transform, options) {
+
+ exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source object: must be null, undefined, or an object');
+
+ var result = {};
+ var keys = Object.keys(transform);
+
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var path = key.split('.');
+ var sourcePath = transform[key];
+
+ exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings');
+
+ var segment;
+ var res = result;
+
+ while (path.length > 1) {
+ segment = path.shift();
+ if (!res[segment]) {
+ res[segment] = {};
+ }
+ res = res[segment];
+ }
+ segment = path.shift();
+ res[segment] = exports.reach(source, sourcePath, options);
+ }
+
+ return result;
+};
+
+
+exports.uniqueFilename = function (path, extension) {
+
+ if (extension) {
+ extension = extension[0] !== '.' ? '.' + extension : extension;
+ }
+ else {
+ extension = '';
+ }
+
+ path = Path.resolve(path);
+ var name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension;
+ return Path.join(path, name);
+};
+
+
+exports.stringify = function () {
+
+ try {
+ return JSON.stringify.apply(null, arguments);
+ }
+ catch (err) {
+ return '[Cannot display object: ' + err.message + ']';
+ }
+};
+
+
+exports.shallow = function (source) {
+
+ var target = {};
+ var keys = Object.keys(source);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ target[key] = source[key];
+ }
+
+ return target;
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
index 4da8c75..716fe27 100644
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
@@ -1,7 +1,7 @@
{
"name": "hoek",
"description": "General purpose node utilities",
- "version": "2.13.0",
+ "version": "2.14.0",
"repository": {
"type": "git",
"url": "git://github.com/hapijs/hoek.git"
@@ -21,29 +21,24 @@
"scripts": {
"test": "make test-cov"
},
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/hapijs/hoek/raw/master/LICENSE"
- }
- ],
- "gitHead": "29dba078c24dbf2f0a7917f33c79a59f3bac45e3",
+ "license": "BSD-3-Clause",
+ "gitHead": "e80875a516f4b0eaa757ac4814c4510eebdcf589",
"bugs": {
"url": "https://github.com/hapijs/hoek/issues"
},
"homepage": "https://github.com/hapijs/hoek#readme",
- "_id": "hoek@2.13.0",
- "_shasum": "cc86b5c1c344b41a7271be449e232fac8d6f450c",
+ "_id": "hoek@2.14.0",
+ "_shasum": "81211691f52a5a835ae49edbf1e89c9003476aa4",
"_from": "hoek@>=2.0.0 <3.0.0",
- "_npmVersion": "2.8.4",
- "_nodeVersion": "0.10.38",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "0.12.2",
"_npmUser": {
"name": "nlf",
"email": "quitlahok@gmail.com"
},
"dist": {
- "shasum": "cc86b5c1c344b41a7271be449e232fac8d6f450c",
- "tarball": "http://registry.npmjs.org/hoek/-/hoek-2.13.0.tgz"
+ "shasum": "81211691f52a5a835ae49edbf1e89c9003476aa4",
+ "tarball": "http://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz"
},
"maintainers": [
{
@@ -60,6 +55,6 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.13.0.tgz",
+ "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz",
"readme": "ERROR: No README data found!"
}
[13/59] [abbrv] couchdb-nmo git commit: website: add footer
Posted by ro...@apache.org.
website: add footer
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/d9b401f1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/d9b401f1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/d9b401f1
Branch: refs/heads/master
Commit: d9b401f1294892967b1b3b8cc507cd93fd72dd55
Parents: 7860d5c
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat May 23 23:49:56 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat May 23 23:49:56 2015 +0200
----------------------------------------------------------------------
doc/website/assets/css/custom.less | 5 +++++
doc/website/doc-template.html | 6 ++++++
2 files changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/d9b401f1/doc/website/assets/css/custom.less
----------------------------------------------------------------------
diff --git a/doc/website/assets/css/custom.less b/doc/website/assets/css/custom.less
index 4675742..17395dd 100644
--- a/doc/website/assets/css/custom.less
+++ b/doc/website/assets/css/custom.less
@@ -17,6 +17,11 @@ header {
height: 5%;
}
+footer {
+ margin: 15% auto 0 auto;
+ text-align: center;
+}
+
.mark {
margin-left: 2%;
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/d9b401f1/doc/website/doc-template.html
----------------------------------------------------------------------
diff --git a/doc/website/doc-template.html b/doc/website/doc-template.html
index 1bce7b8..85a5c1e 100644
--- a/doc/website/doc-template.html
+++ b/doc/website/doc-template.html
@@ -17,6 +17,12 @@
<div class="content">
__CONTENT__
</div>
+
+ <footer>
+ <a href="https://github.com/robertkowalski/nmo">
+ Found a bug or typo? Want to contribute code?
+ </a>
+ </footer>
</div>
<nav class="toc-container">
<div class="toc section-toc">
[50/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/aws-sign2/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/aws-sign2/index.js b/node_modules/request/node_modules/aws-sign2/index.js
deleted file mode 100644
index 576e49d..0000000
--- a/node_modules/request/node_modules/aws-sign2/index.js
+++ /dev/null
@@ -1,202 +0,0 @@
-
-/*!
- * knox - auth
- * Copyright(c) 2010 LearnBoost <de...@learnboost.com>
- * MIT Licensed
- */
-
-/**
- * Module dependencies.
- */
-
-var crypto = require('crypto')
- , parse = require('url').parse
- ;
-
-/**
- * Valid keys.
- */
-
-var keys =
- [ 'acl'
- , 'location'
- , 'logging'
- , 'notification'
- , 'partNumber'
- , 'policy'
- , 'requestPayment'
- , 'torrent'
- , 'uploadId'
- , 'uploads'
- , 'versionId'
- , 'versioning'
- , 'versions'
- , 'website'
- ]
-
-/**
- * Return an "Authorization" header value with the given `options`
- * in the form of "AWS <key>:<signature>"
- *
- * @param {Object} options
- * @return {String}
- * @api private
- */
-
-function authorization (options) {
- return 'AWS ' + options.key + ':' + sign(options)
-}
-
-module.exports = authorization
-module.exports.authorization = authorization
-
-/**
- * Simple HMAC-SHA1 Wrapper
- *
- * @param {Object} options
- * @return {String}
- * @api private
- */
-
-function hmacSha1 (options) {
- return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')
-}
-
-module.exports.hmacSha1 = hmacSha1
-
-/**
- * Create a base64 sha1 HMAC for `options`.
- *
- * @param {Object} options
- * @return {String}
- * @api private
- */
-
-function sign (options) {
- options.message = stringToSign(options)
- return hmacSha1(options)
-}
-module.exports.sign = sign
-
-/**
- * Create a base64 sha1 HMAC for `options`.
- *
- * Specifically to be used with S3 presigned URLs
- *
- * @param {Object} options
- * @return {String}
- * @api private
- */
-
-function signQuery (options) {
- options.message = queryStringToSign(options)
- return hmacSha1(options)
-}
-module.exports.signQuery= signQuery
-
-/**
- * Return a string for sign() with the given `options`.
- *
- * Spec:
- *
- * <verb>\n
- * <md5>\n
- * <content-type>\n
- * <date>\n
- * [headers\n]
- * <resource>
- *
- * @param {Object} options
- * @return {String}
- * @api private
- */
-
-function stringToSign (options) {
- var headers = options.amazonHeaders || ''
- if (headers) headers += '\n'
- var r =
- [ options.verb
- , options.md5
- , options.contentType
- , options.date ? options.date.toUTCString() : ''
- , headers + options.resource
- ]
- return r.join('\n')
-}
-module.exports.queryStringToSign = stringToSign
-
-/**
- * Return a string for sign() with the given `options`, but is meant exclusively
- * for S3 presigned URLs
- *
- * Spec:
- *
- * <date>\n
- * <resource>
- *
- * @param {Object} options
- * @return {String}
- * @api private
- */
-
-function queryStringToSign (options){
- return 'GET\n\n\n' + options.date + '\n' + options.resource
-}
-module.exports.queryStringToSign = queryStringToSign
-
-/**
- * Perform the following:
- *
- * - ignore non-amazon headers
- * - lowercase fields
- * - sort lexicographically
- * - trim whitespace between ":"
- * - join with newline
- *
- * @param {Object} headers
- * @return {String}
- * @api private
- */
-
-function canonicalizeHeaders (headers) {
- var buf = []
- , fields = Object.keys(headers)
- ;
- for (var i = 0, len = fields.length; i < len; ++i) {
- var field = fields[i]
- , val = headers[field]
- , field = field.toLowerCase()
- ;
- if (0 !== field.indexOf('x-amz')) continue
- buf.push(field + ':' + val)
- }
- return buf.sort().join('\n')
-}
-module.exports.canonicalizeHeaders = canonicalizeHeaders
-
-/**
- * Perform the following:
- *
- * - ignore non sub-resources
- * - sort lexicographically
- *
- * @param {String} resource
- * @return {String}
- * @api private
- */
-
-function canonicalizeResource (resource) {
- var url = parse(resource, true)
- , path = url.pathname
- , buf = []
- ;
-
- Object.keys(url.query).forEach(function(key){
- if (!~keys.indexOf(key)) return
- var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])
- buf.push(key + val)
- })
-
- return path + (buf.length ? '?' + buf.sort().join('&') : '')
-}
-module.exports.canonicalizeResource = canonicalizeResource
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/aws-sign2/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/aws-sign2/package.json b/node_modules/request/node_modules/aws-sign2/package.json
deleted file mode 100644
index 9104550..0000000
--- a/node_modules/request/node_modules/aws-sign2/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "author": {
- "name": "Mikeal Rogers",
- "email": "mikeal.rogers@gmail.com",
- "url": "http://www.futurealoof.com"
- },
- "name": "aws-sign2",
- "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.",
- "version": "0.5.0",
- "repository": {
- "url": "https://github.com/mikeal/aws-sign"
- },
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {},
- "optionalDependencies": {},
- "engines": {
- "node": "*"
- },
- "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/mikeal/aws-sign/issues"
- },
- "_id": "aws-sign2@0.5.0",
- "dist": {
- "shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63",
- "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
- },
- "_from": "aws-sign2@>=0.5.0 <0.6.0",
- "_npmVersion": "1.3.2",
- "_npmUser": {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- },
- "maintainers": [
- {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- }
- ],
- "directories": {},
- "_shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63",
- "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz",
- "homepage": "https://github.com/mikeal/aws-sign",
- "scripts": {}
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/.jshintrc
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/.jshintrc b/node_modules/request/node_modules/bl/.jshintrc
deleted file mode 100644
index c8ef3ca..0000000
--- a/node_modules/request/node_modules/bl/.jshintrc
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "predef": [ ]
- , "bitwise": false
- , "camelcase": false
- , "curly": false
- , "eqeqeq": false
- , "forin": false
- , "immed": false
- , "latedef": false
- , "noarg": true
- , "noempty": true
- , "nonew": true
- , "plusplus": false
- , "quotmark": true
- , "regexp": false
- , "undef": true
- , "unused": true
- , "strict": false
- , "trailing": true
- , "maxlen": 120
- , "asi": true
- , "boss": true
- , "debug": true
- , "eqnull": true
- , "esnext": true
- , "evil": true
- , "expr": true
- , "funcscope": false
- , "globalstrict": false
- , "iterator": false
- , "lastsemic": true
- , "laxbreak": true
- , "laxcomma": true
- , "loopfunc": true
- , "multistr": false
- , "onecase": false
- , "proto": false
- , "regexdash": false
- , "scripturl": true
- , "smarttabs": false
- , "shadow": false
- , "sub": true
- , "supernew": false
- , "validthis": true
- , "browser": true
- , "couch": false
- , "devel": false
- , "dojo": false
- , "mootools": false
- , "node": true
- , "nonstandard": true
- , "prototypejs": false
- , "rhino": false
- , "worker": true
- , "wsh": false
- , "nomen": false
- , "onevar": false
- , "passfail": false
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/.npmignore b/node_modules/request/node_modules/bl/.npmignore
deleted file mode 100644
index 40b878d..0000000
--- a/node_modules/request/node_modules/bl/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/.travis.yml b/node_modules/request/node_modules/bl/.travis.yml
deleted file mode 100644
index 7ddb9c9..0000000
--- a/node_modules/request/node_modules/bl/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: node_js
-node_js:
- - 0.8
- - "0.10"
-branches:
- only:
- - master
-notifications:
- email:
- - rod@vagg.org
-script: npm test
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/LICENSE.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/LICENSE.md b/node_modules/request/node_modules/bl/LICENSE.md
deleted file mode 100644
index ccb2479..0000000
--- a/node_modules/request/node_modules/bl/LICENSE.md
+++ /dev/null
@@ -1,13 +0,0 @@
-The MIT License (MIT)
-=====================
-
-Copyright (c) 2014 bl contributors
-----------------------------------
-
-*bl contributors listed at <https://github.com/rvagg/bl#contributors>*
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/README.md b/node_modules/request/node_modules/bl/README.md
deleted file mode 100644
index 6b7fb6d..0000000
--- a/node_modules/request/node_modules/bl/README.md
+++ /dev/null
@@ -1,198 +0,0 @@
-# bl *(BufferList)*
-
-**A Node.js Buffer list collector, reader and streamer thingy.**
-
-[](https://nodei.co/npm/bl/)
-[](https://nodei.co/npm/bl/)
-
-**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
-
-The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
-
-```js
-const BufferList = require('bl')
-
-var bl = new BufferList()
-bl.append(new Buffer('abcd'))
-bl.append(new Buffer('efg'))
-bl.append('hi') // bl will also accept & convert Strings
-bl.append(new Buffer('j'))
-bl.append(new Buffer([ 0x3, 0x4 ]))
-
-console.log(bl.length) // 12
-
-console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
-console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
-console.log(bl.slice(3, 6).toString('ascii')) // 'def'
-console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
-console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
-
-// or just use toString!
-console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
-console.log(bl.toString('ascii', 3, 8)) // 'defgh'
-console.log(bl.toString('ascii', 5, 10)) // 'fghij'
-
-// other standard Buffer readables
-console.log(bl.readUInt16BE(10)) // 0x0304
-console.log(bl.readUInt16LE(10)) // 0x0403
-```
-
-Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
-
-```js
-const bl = require('bl')
- , fs = require('fs')
-
-fs.createReadStream('README.md')
- .pipe(bl(function (err, data) { // note 'new' isn't strictly required
- // `data` is a complete Buffer object containing the full data
- console.log(data.toString())
- }))
-```
-
-Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
-
-Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
-```js
-const hyperquest = require('hyperquest')
- , bl = require('bl')
- , url = 'https://raw.github.com/rvagg/bl/master/README.md'
-
-hyperquest(url).pipe(bl(function (err, data) {
- console.log(data.toString())
-}))
-```
-
-Or, use it as a readable stream to recompose a list of Buffers to an output source:
-
-```js
-const BufferList = require('bl')
- , fs = require('fs')
-
-var bl = new BufferList()
-bl.append(new Buffer('abcd'))
-bl.append(new Buffer('efg'))
-bl.append(new Buffer('hi'))
-bl.append(new Buffer('j'))
-
-bl.pipe(fs.createWriteStream('gibberish.txt'))
-```
-
-## API
-
- * <a href="#ctor"><code><b>new BufferList([ callback ])</b></code></a>
- * <a href="#length"><code>bl.<b>length</b></code></a>
- * <a href="#append"><code>bl.<b>append(buffer)</b></code></a>
- * <a href="#get"><code>bl.<b>get(index)</b></code></a>
- * <a href="#slice"><code>bl.<b>slice([ start[, end ] ])</b></code></a>
- * <a href="#copy"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>
- * <a href="#duplicate"><code>bl.<b>duplicate()</b></code></a>
- * <a href="#consume"><code>bl.<b>consume(bytes)</b></code></a>
- * <a href="#toString"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>
- * <a href="#readXX"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>
- * <a href="#streams">Streams</a>
-
---------------------------------------------------------
-<a name="ctor"></a>
-### new BufferList([ callback | buffer | buffer array ])
-The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
-
-Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
-
-`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
-
-```js
-var bl = require('bl')
-var myinstance = bl()
-
-// equivilant to:
-
-var BufferList = require('bl')
-var myinstance = new BufferList()
-```
-
---------------------------------------------------------
-<a name="length"></a>
-### bl.length
-Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
-
---------------------------------------------------------
-<a name="append"></a>
-### bl.append(buffer)
-`append(buffer)` adds an additional buffer or BufferList to the internal list.
-
---------------------------------------------------------
-<a name="get"></a>
-### bl.get(index)
-`get()` will return the byte at the specified index.
-
---------------------------------------------------------
-<a name="slice"></a>
-### bl.slice([ start, [ end ] ])
-`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
-
-If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
-
---------------------------------------------------------
-<a name="copy"></a>
-### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
-`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
-
---------------------------------------------------------
-<a name="duplicate"></a>
-### bl.duplicate()
-`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
-
-```js
-var bl = new BufferList()
-
-bl.append('hello')
-bl.append(' world')
-bl.append('\n')
-
-bl.duplicate().pipe(process.stdout, { end: false })
-
-console.log(bl.toString())
-```
-
---------------------------------------------------------
-<a name="consume"></a>
-### bl.consume(bytes)
-`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data.
-
---------------------------------------------------------
-<a name="toString"></a>
-### bl.toString([encoding, [ start, [ end ]]])
-`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
-
---------------------------------------------------------
-<a name="readXX"></a>
-### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
-
-All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
-
-See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.
-
---------------------------------------------------------
-<a name="streams"></a>
-### Streams
-**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.
-
---------------------------------------------------------
-
-## Contributors
-
-**bl** is brought to you by the following hackers:
-
- * [Rod Vagg](https://github.com/rvagg)
- * [Matteo Collina](https://github.com/mcollina)
- * [Jarett Cruger](https://github.com/jcrugzz)
-
-=======
-
-<a name="license"></a>
-## License & copyright
-
-Copyright (c) 2013-2014 bl contributors (listed above).
-
-bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/bl.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/bl.js b/node_modules/request/node_modules/bl/bl.js
deleted file mode 100644
index 7a2f997..0000000
--- a/node_modules/request/node_modules/bl/bl.js
+++ /dev/null
@@ -1,216 +0,0 @@
-var DuplexStream = require('readable-stream/duplex')
- , util = require('util')
-
-function BufferList (callback) {
- if (!(this instanceof BufferList))
- return new BufferList(callback)
-
- this._bufs = []
- this.length = 0
-
- if (typeof callback == 'function') {
- this._callback = callback
-
- var piper = function (err) {
- if (this._callback) {
- this._callback(err)
- this._callback = null
- }
- }.bind(this)
-
- this.on('pipe', function (src) {
- src.on('error', piper)
- })
- this.on('unpipe', function (src) {
- src.removeListener('error', piper)
- })
- }
- else if (Buffer.isBuffer(callback))
- this.append(callback)
- else if (Array.isArray(callback)) {
- callback.forEach(function (b) {
- Buffer.isBuffer(b) && this.append(b)
- }.bind(this))
- }
-
- DuplexStream.call(this)
-}
-
-util.inherits(BufferList, DuplexStream)
-
-BufferList.prototype._offset = function (offset) {
- var tot = 0, i = 0, _t
- for (; i < this._bufs.length; i++) {
- _t = tot + this._bufs[i].length
- if (offset < _t)
- return [ i, offset - tot ]
- tot = _t
- }
-}
-
-BufferList.prototype.append = function (buf) {
- var isBuffer = Buffer.isBuffer(buf) ||
- buf instanceof BufferList
-
- this._bufs.push(isBuffer ? buf : new Buffer(buf))
- this.length += buf.length
- return this
-}
-
-BufferList.prototype._write = function (buf, encoding, callback) {
- this.append(buf)
- if (callback)
- callback()
-}
-
-BufferList.prototype._read = function (size) {
- if (!this.length)
- return this.push(null)
- size = Math.min(size, this.length)
- this.push(this.slice(0, size))
- this.consume(size)
-}
-
-BufferList.prototype.end = function (chunk) {
- DuplexStream.prototype.end.call(this, chunk)
-
- if (this._callback) {
- this._callback(null, this.slice())
- this._callback = null
- }
-}
-
-BufferList.prototype.get = function (index) {
- return this.slice(index, index + 1)[0]
-}
-
-BufferList.prototype.slice = function (start, end) {
- return this.copy(null, 0, start, end)
-}
-
-BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
- if (typeof srcStart != 'number' || srcStart < 0)
- srcStart = 0
- if (typeof srcEnd != 'number' || srcEnd > this.length)
- srcEnd = this.length
- if (srcStart >= this.length)
- return dst || new Buffer(0)
- if (srcEnd <= 0)
- return dst || new Buffer(0)
-
- var copy = !!dst
- , off = this._offset(srcStart)
- , len = srcEnd - srcStart
- , bytes = len
- , bufoff = (copy && dstStart) || 0
- , start = off[1]
- , l
- , i
-
- // copy/slice everything
- if (srcStart === 0 && srcEnd == this.length) {
- if (!copy) // slice, just return a full concat
- return Buffer.concat(this._bufs)
-
- // copy, need to copy individual buffers
- for (i = 0; i < this._bufs.length; i++) {
- this._bufs[i].copy(dst, bufoff)
- bufoff += this._bufs[i].length
- }
-
- return dst
- }
-
- // easy, cheap case where it's a subset of one of the buffers
- if (bytes <= this._bufs[off[0]].length - start) {
- return copy
- ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
- : this._bufs[off[0]].slice(start, start + bytes)
- }
-
- if (!copy) // a slice, we need something to copy in to
- dst = new Buffer(len)
-
- for (i = off[0]; i < this._bufs.length; i++) {
- l = this._bufs[i].length - start
-
- if (bytes > l) {
- this._bufs[i].copy(dst, bufoff, start)
- } else {
- this._bufs[i].copy(dst, bufoff, start, start + bytes)
- break
- }
-
- bufoff += l
- bytes -= l
-
- if (start)
- start = 0
- }
-
- return dst
-}
-
-BufferList.prototype.toString = function (encoding, start, end) {
- return this.slice(start, end).toString(encoding)
-}
-
-BufferList.prototype.consume = function (bytes) {
- while (this._bufs.length) {
- if (bytes > this._bufs[0].length) {
- bytes -= this._bufs[0].length
- this.length -= this._bufs[0].length
- this._bufs.shift()
- } else {
- this._bufs[0] = this._bufs[0].slice(bytes)
- this.length -= bytes
- break
- }
- }
- return this
-}
-
-BufferList.prototype.duplicate = function () {
- var i = 0
- , copy = new BufferList()
-
- for (; i < this._bufs.length; i++)
- copy.append(this._bufs[i])
-
- return copy
-}
-
-BufferList.prototype.destroy = function () {
- this._bufs.length = 0;
- this.length = 0;
- this.push(null);
-}
-
-;(function () {
- var methods = {
- 'readDoubleBE' : 8
- , 'readDoubleLE' : 8
- , 'readFloatBE' : 4
- , 'readFloatLE' : 4
- , 'readInt32BE' : 4
- , 'readInt32LE' : 4
- , 'readUInt32BE' : 4
- , 'readUInt32LE' : 4
- , 'readInt16BE' : 2
- , 'readInt16LE' : 2
- , 'readUInt16BE' : 2
- , 'readUInt16LE' : 2
- , 'readInt8' : 1
- , 'readUInt8' : 1
- }
-
- for (var m in methods) {
- (function (m) {
- BufferList.prototype[m] = function (offset) {
- return this.slice(offset, offset + methods[m])[m](0)
- }
- }(m))
- }
-}())
-
-module.exports = BufferList
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore
deleted file mode 100644
index 38344f8..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-build/
-test/
-examples/
-fs.js
-zlib.js
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
deleted file mode 100644
index e3d4e69..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-Copyright Joyent, Inc. and other Node contributors. All rights reserved.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md
deleted file mode 100644
index 3fb3e80..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# readable-stream
-
-***Node-core streams for userland***
-
-[](https://nodei.co/npm/readable-stream/)
-[](https://nodei.co/npm/readable-stream/)
-
-This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
-
-If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core.
-
-**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
-
-**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js
deleted file mode 100644
index ca807af..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_duplex.js")
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
deleted file mode 100644
index b513d61..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a duplex stream is just a stream that is both readable and writable.
-// Since JS doesn't have multiple prototypal inheritance, this class
-// prototypally inherits from Readable, and then parasitically from
-// Writable.
-
-module.exports = Duplex;
-
-/*<replacement>*/
-var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) keys.push(key);
- return keys;
-}
-/*</replacement>*/
-
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-var Readable = require('./_stream_readable');
-var Writable = require('./_stream_writable');
-
-util.inherits(Duplex, Readable);
-
-forEach(objectKeys(Writable.prototype), function(method) {
- if (!Duplex.prototype[method])
- Duplex.prototype[method] = Writable.prototype[method];
-});
-
-function Duplex(options) {
- if (!(this instanceof Duplex))
- return new Duplex(options);
-
- Readable.call(this, options);
- Writable.call(this, options);
-
- if (options && options.readable === false)
- this.readable = false;
-
- if (options && options.writable === false)
- this.writable = false;
-
- this.allowHalfOpen = true;
- if (options && options.allowHalfOpen === false)
- this.allowHalfOpen = false;
-
- this.once('end', onend);
-}
-
-// the no-half-open enforcer
-function onend() {
- // if we allow half-open state, or if the writable side ended,
- // then we're ok.
- if (this.allowHalfOpen || this._writableState.ended)
- return;
-
- // no more data can be written.
- // But allow more writes to happen in this tick.
- process.nextTick(this.end.bind(this));
-}
-
-function forEach (xs, f) {
- for (var i = 0, l = xs.length; i < l; i++) {
- f(xs[i], i);
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
deleted file mode 100644
index 895ca50..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a passthrough stream.
-// basically just the most minimal sort of Transform stream.
-// Every written chunk gets output as-is.
-
-module.exports = PassThrough;
-
-var Transform = require('./_stream_transform');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-util.inherits(PassThrough, Transform);
-
-function PassThrough(options) {
- if (!(this instanceof PassThrough))
- return new PassThrough(options);
-
- Transform.call(this, options);
-}
-
-PassThrough.prototype._transform = function(chunk, encoding, cb) {
- cb(null, chunk);
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
deleted file mode 100644
index 6307220..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
+++ /dev/null
@@ -1,982 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-module.exports = Readable;
-
-/*<replacement>*/
-var isArray = require('isarray');
-/*</replacement>*/
-
-
-/*<replacement>*/
-var Buffer = require('buffer').Buffer;
-/*</replacement>*/
-
-Readable.ReadableState = ReadableState;
-
-var EE = require('events').EventEmitter;
-
-/*<replacement>*/
-if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
- return emitter.listeners(type).length;
-};
-/*</replacement>*/
-
-var Stream = require('stream');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-var StringDecoder;
-
-util.inherits(Readable, Stream);
-
-function ReadableState(options, stream) {
- options = options || {};
-
- // the point at which it stops calling _read() to fill the buffer
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
- var hwm = options.highWaterMark;
- this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
-
- // cast to ints.
- this.highWaterMark = ~~this.highWaterMark;
-
- this.buffer = [];
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = false;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false;
-
- // In streams that never have any data, and do push(null) right away,
- // the consumer can miss the 'end' event if they do some I/O before
- // consuming the stream. So, we don't emit('end') until some reading
- // happens.
- this.calledRead = false;
-
- // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, becuase any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true;
-
- // whenever we return null, then we set a flag to say
- // that we're awaiting a 'readable' event emission.
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
-
-
- // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // when piping, we only care about 'readable' events that happen
- // after read()ing all the bytes and not getting any pushback.
- this.ranOut = false;
-
- // the number of writers that are awaiting a drain event in .pipe()s
- this.awaitDrain = 0;
-
- // if true, a maybeReadMore has been scheduled
- this.readingMore = false;
-
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder)
- StringDecoder = require('string_decoder/').StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
-}
-
-function Readable(options) {
- if (!(this instanceof Readable))
- return new Readable(options);
-
- this._readableState = new ReadableState(options, this);
-
- // legacy
- this.readable = true;
-
- Stream.call(this);
-}
-
-// Manually shove something into the read() buffer.
-// This returns true if the highWaterMark has not been hit yet,
-// similar to how Writable.write() returns true if you should
-// write() some more.
-Readable.prototype.push = function(chunk, encoding) {
- var state = this._readableState;
-
- if (typeof chunk === 'string' && !state.objectMode) {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = new Buffer(chunk, encoding);
- encoding = '';
- }
- }
-
- return readableAddChunk(this, state, chunk, encoding, false);
-};
-
-// Unshift should *always* be something directly out of read()
-Readable.prototype.unshift = function(chunk) {
- var state = this._readableState;
- return readableAddChunk(this, state, chunk, '', true);
-};
-
-function readableAddChunk(stream, state, chunk, encoding, addToFront) {
- var er = chunkInvalid(state, chunk);
- if (er) {
- stream.emit('error', er);
- } else if (chunk === null || chunk === undefined) {
- state.reading = false;
- if (!state.ended)
- onEofChunk(stream, state);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (state.ended && !addToFront) {
- var e = new Error('stream.push() after EOF');
- stream.emit('error', e);
- } else if (state.endEmitted && addToFront) {
- var e = new Error('stream.unshift() after end event');
- stream.emit('error', e);
- } else {
- if (state.decoder && !addToFront && !encoding)
- chunk = state.decoder.write(chunk);
-
- // update the buffer info.
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront) {
- state.buffer.unshift(chunk);
- } else {
- state.reading = false;
- state.buffer.push(chunk);
- }
-
- if (state.needReadable)
- emitReadable(stream);
-
- maybeReadMore(stream, state);
- }
- } else if (!addToFront) {
- state.reading = false;
- }
-
- return needMoreData(state);
-}
-
-
-
-// if it's past the high water mark, we can push in some more.
-// Also, if we have no data yet, we can stand some
-// more bytes. This is to work around cases where hwm=0,
-// such as the repl. Also, if the push() triggered a
-// readable event, and the user called read(largeNumber) such that
-// needReadable was set, then we ought to push more, so that another
-// 'readable' event will be triggered.
-function needMoreData(state) {
- return !state.ended &&
- (state.needReadable ||
- state.length < state.highWaterMark ||
- state.length === 0);
-}
-
-// backwards compatibility.
-Readable.prototype.setEncoding = function(enc) {
- if (!StringDecoder)
- StringDecoder = require('string_decoder/').StringDecoder;
- this._readableState.decoder = new StringDecoder(enc);
- this._readableState.encoding = enc;
-};
-
-// Don't raise the hwm > 128MB
-var MAX_HWM = 0x800000;
-function roundUpToNextPowerOf2(n) {
- if (n >= MAX_HWM) {
- n = MAX_HWM;
- } else {
- // Get the next highest power of 2
- n--;
- for (var p = 1; p < 32; p <<= 1) n |= n >> p;
- n++;
- }
- return n;
-}
-
-function howMuchToRead(n, state) {
- if (state.length === 0 && state.ended)
- return 0;
-
- if (state.objectMode)
- return n === 0 ? 0 : 1;
-
- if (n === null || isNaN(n)) {
- // only flow one buffer at a time
- if (state.flowing && state.buffer.length)
- return state.buffer[0].length;
- else
- return state.length;
- }
-
- if (n <= 0)
- return 0;
-
- // If we're asking for more than the target buffer level,
- // then raise the water mark. Bump up to the next highest
- // power of 2, to prevent increasing it excessively in tiny
- // amounts.
- if (n > state.highWaterMark)
- state.highWaterMark = roundUpToNextPowerOf2(n);
-
- // don't have that much. return null, unless we've ended.
- if (n > state.length) {
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- } else
- return state.length;
- }
-
- return n;
-}
-
-// you can override either this method, or the async _read(n) below.
-Readable.prototype.read = function(n) {
- var state = this._readableState;
- state.calledRead = true;
- var nOrig = n;
- var ret;
-
- if (typeof n !== 'number' || n > 0)
- state.emittedReadable = false;
-
- // if we're doing read(0) to trigger a readable event, but we
- // already have a bunch of data in the buffer, then just trigger
- // the 'readable' event and move on.
- if (n === 0 &&
- state.needReadable &&
- (state.length >= state.highWaterMark || state.ended)) {
- emitReadable(this);
- return null;
- }
-
- n = howMuchToRead(n, state);
-
- // if we've ended, and we're now clear, then finish it up.
- if (n === 0 && state.ended) {
- ret = null;
-
- // In cases where the decoder did not receive enough data
- // to produce a full chunk, then immediately received an
- // EOF, state.buffer will contain [<Buffer >, <Buffer 00 ...>].
- // howMuchToRead will see this and coerce the amount to
- // read to zero (because it's looking at the length of the
- // first <Buffer > in state.buffer), and we'll end up here.
- //
- // This can only happen via state.decoder -- no other venue
- // exists for pushing a zero-length chunk into state.buffer
- // and triggering this behavior. In this case, we return our
- // remaining data and end the stream, if appropriate.
- if (state.length > 0 && state.decoder) {
- ret = fromList(n, state);
- state.length -= ret.length;
- }
-
- if (state.length === 0)
- endReadable(this);
-
- return ret;
- }
-
- // All the actual chunk generation logic needs to be
- // *below* the call to _read. The reason is that in certain
- // synthetic stream cases, such as passthrough streams, _read
- // may be a completely synchronous operation which may change
- // the state of the read buffer, providing enough data when
- // before there was *not* enough.
- //
- // So, the steps are:
- // 1. Figure out what the state of things will be after we do
- // a read from the buffer.
- //
- // 2. If that resulting state will trigger a _read, then call _read.
- // Note that this may be asynchronous, or synchronous. Yes, it is
- // deeply ugly to write APIs this way, but that still doesn't mean
- // that the Readable class should behave improperly, as streams are
- // designed to be sync/async agnostic.
- // Take note if the _read call is sync or async (ie, if the read call
- // has returned yet), so that we know whether or not it's safe to emit
- // 'readable' etc.
- //
- // 3. Actually pull the requested chunks out of the buffer and return.
-
- // if we need a readable event, then we need to do some reading.
- var doRead = state.needReadable;
-
- // if we currently have less than the highWaterMark, then also read some
- if (state.length - n <= state.highWaterMark)
- doRead = true;
-
- // however, if we've ended, then there's no point, and if we're already
- // reading, then it's unnecessary.
- if (state.ended || state.reading)
- doRead = false;
-
- if (doRead) {
- state.reading = true;
- state.sync = true;
- // if the length is currently zero, then we *need* a readable event.
- if (state.length === 0)
- state.needReadable = true;
- // call internal read method
- this._read(state.highWaterMark);
- state.sync = false;
- }
-
- // If _read called its callback synchronously, then `reading`
- // will be false, and we need to re-evaluate how much data we
- // can return to the user.
- if (doRead && !state.reading)
- n = howMuchToRead(nOrig, state);
-
- if (n > 0)
- ret = fromList(n, state);
- else
- ret = null;
-
- if (ret === null) {
- state.needReadable = true;
- n = 0;
- }
-
- state.length -= n;
-
- // If we have nothing in the buffer, then we want to know
- // as soon as we *do* get something into the buffer.
- if (state.length === 0 && !state.ended)
- state.needReadable = true;
-
- // If we happened to read() exactly the remaining amount in the
- // buffer, and the EOF has been seen at this point, then make sure
- // that we emit 'end' on the very next tick.
- if (state.ended && !state.endEmitted && state.length === 0)
- endReadable(this);
-
- return ret;
-};
-
-function chunkInvalid(state, chunk) {
- var er = null;
- if (!Buffer.isBuffer(chunk) &&
- 'string' !== typeof chunk &&
- chunk !== null &&
- chunk !== undefined &&
- !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- return er;
-}
-
-
-function onEofChunk(stream, state) {
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
-
- // if we've ended and we have some data left, then emit
- // 'readable' now to make sure it gets picked up.
- if (state.length > 0)
- emitReadable(stream);
- else
- endReadable(stream);
-}
-
-// Don't emit readable right away in sync mode, because this can trigger
-// another read() call => stack overflow. This way, it might trigger
-// a nextTick recursion warning, but that's not so bad.
-function emitReadable(stream) {
- var state = stream._readableState;
- state.needReadable = false;
- if (state.emittedReadable)
- return;
-
- state.emittedReadable = true;
- if (state.sync)
- process.nextTick(function() {
- emitReadable_(stream);
- });
- else
- emitReadable_(stream);
-}
-
-function emitReadable_(stream) {
- stream.emit('readable');
-}
-
-
-// at this point, the user has presumably seen the 'readable' event,
-// and called read() to consume some data. that may have triggered
-// in turn another _read(n) call, in which case reading = true if
-// it's in progress.
-// However, if we're not ended, or reading, and the length < hwm,
-// then go ahead and try to read some more preemptively.
-function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- process.nextTick(function() {
- maybeReadMore_(stream, state);
- });
- }
-}
-
-function maybeReadMore_(stream, state) {
- var len = state.length;
- while (!state.reading && !state.flowing && !state.ended &&
- state.length < state.highWaterMark) {
- stream.read(0);
- if (len === state.length)
- // didn't get any data, stop spinning.
- break;
- else
- len = state.length;
- }
- state.readingMore = false;
-}
-
-// abstract method. to be overridden in specific implementation classes.
-// call cb(er, data) where data is <= n in length.
-// for virtual (non-string, non-buffer) streams, "length" is somewhat
-// arbitrary, and perhaps not very meaningful.
-Readable.prototype._read = function(n) {
- this.emit('error', new Error('not implemented'));
-};
-
-Readable.prototype.pipe = function(dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
-
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
-
- var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
- dest !== process.stdout &&
- dest !== process.stderr;
-
- var endFn = doEnd ? onend : cleanup;
- if (state.endEmitted)
- process.nextTick(endFn);
- else
- src.once('end', endFn);
-
- dest.on('unpipe', onunpipe);
- function onunpipe(readable) {
- if (readable !== src) return;
- cleanup();
- }
-
- function onend() {
- dest.end();
- }
-
- // when the dest drains, it reduces the awaitDrain counter
- // on the source. This would be more elegant with a .once()
- // handler in flow(), but adding and removing repeatedly is
- // too slow.
- var ondrain = pipeOnDrain(src);
- dest.on('drain', ondrain);
-
- function cleanup() {
- // cleanup event handlers once the pipe is broken
- dest.removeListener('close', onclose);
- dest.removeListener('finish', onfinish);
- dest.removeListener('drain', ondrain);
- dest.removeListener('error', onerror);
- dest.removeListener('unpipe', onunpipe);
- src.removeListener('end', onend);
- src.removeListener('end', cleanup);
-
- // if the reader is waiting for a drain event from this
- // specific writer, then it would cause it to never start
- // flowing again.
- // So, if this is awaiting a drain, then we just call it now.
- // If we don't know, then assume that we are waiting for one.
- if (!dest._writableState || dest._writableState.needDrain)
- ondrain();
- }
-
- // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
- function onerror(er) {
- unpipe();
- dest.removeListener('error', onerror);
- if (EE.listenerCount(dest, 'error') === 0)
- dest.emit('error', er);
- }
- // This is a brutally ugly hack to make sure that our error handler
- // is attached before any userland ones. NEVER DO THIS.
- if (!dest._events || !dest._events.error)
- dest.on('error', onerror);
- else if (isArray(dest._events.error))
- dest._events.error.unshift(onerror);
- else
- dest._events.error = [onerror, dest._events.error];
-
-
-
- // Both close and finish should trigger unpipe, but only once.
- function onclose() {
- dest.removeListener('finish', onfinish);
- unpipe();
- }
- dest.once('close', onclose);
- function onfinish() {
- dest.removeListener('close', onclose);
- unpipe();
- }
- dest.once('finish', onfinish);
-
- function unpipe() {
- src.unpipe(dest);
- }
-
- // tell the dest that it's being piped to
- dest.emit('pipe', src);
-
- // start the flow if it hasn't been started already.
- if (!state.flowing) {
- // the handler that waits for readable events after all
- // the data gets sucked out in flow.
- // This would be easier to follow with a .once() handler
- // in flow(), but that is too slow.
- this.on('readable', pipeOnReadable);
-
- state.flowing = true;
- process.nextTick(function() {
- flow(src);
- });
- }
-
- return dest;
-};
-
-function pipeOnDrain(src) {
- return function() {
- var dest = this;
- var state = src._readableState;
- state.awaitDrain--;
- if (state.awaitDrain === 0)
- flow(src);
- };
-}
-
-function flow(src) {
- var state = src._readableState;
- var chunk;
- state.awaitDrain = 0;
-
- function write(dest, i, list) {
- var written = dest.write(chunk);
- if (false === written) {
- state.awaitDrain++;
- }
- }
-
- while (state.pipesCount && null !== (chunk = src.read())) {
-
- if (state.pipesCount === 1)
- write(state.pipes, 0, null);
- else
- forEach(state.pipes, write);
-
- src.emit('data', chunk);
-
- // if anyone needs a drain, then we have to wait for that.
- if (state.awaitDrain > 0)
- return;
- }
-
- // if every destination was unpiped, either before entering this
- // function, or in the while loop, then stop flowing.
- //
- // NB: This is a pretty rare edge case.
- if (state.pipesCount === 0) {
- state.flowing = false;
-
- // if there were data event listeners added, then switch to old mode.
- if (EE.listenerCount(src, 'data') > 0)
- emitDataEvents(src);
- return;
- }
-
- // at this point, no one needed a drain, so we just ran out of data
- // on the next readable event, start it over again.
- state.ranOut = true;
-}
-
-function pipeOnReadable() {
- if (this._readableState.ranOut) {
- this._readableState.ranOut = false;
- flow(this);
- }
-}
-
-
-Readable.prototype.unpipe = function(dest) {
- var state = this._readableState;
-
- // if we're not piping anywhere, then do nothing.
- if (state.pipesCount === 0)
- return this;
-
- // just one destination. most common case.
- if (state.pipesCount === 1) {
- // passed in one, but it's not the right one.
- if (dest && dest !== state.pipes)
- return this;
-
- if (!dest)
- dest = state.pipes;
-
- // got a match.
- state.pipes = null;
- state.pipesCount = 0;
- this.removeListener('readable', pipeOnReadable);
- state.flowing = false;
- if (dest)
- dest.emit('unpipe', this);
- return this;
- }
-
- // slow case. multiple pipe destinations.
-
- if (!dest) {
- // remove all.
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- this.removeListener('readable', pipeOnReadable);
- state.flowing = false;
-
- for (var i = 0; i < len; i++)
- dests[i].emit('unpipe', this);
- return this;
- }
-
- // try to find the right one.
- var i = indexOf(state.pipes, dest);
- if (i === -1)
- return this;
-
- state.pipes.splice(i, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1)
- state.pipes = state.pipes[0];
-
- dest.emit('unpipe', this);
-
- return this;
-};
-
-// set up data events if they are asked for
-// Ensure readable listeners eventually get something
-Readable.prototype.on = function(ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
-
- if (ev === 'data' && !this._readableState.flowing)
- emitDataEvents(this);
-
- if (ev === 'readable' && this.readable) {
- var state = this._readableState;
- if (!state.readableListening) {
- state.readableListening = true;
- state.emittedReadable = false;
- state.needReadable = true;
- if (!state.reading) {
- this.read(0);
- } else if (state.length) {
- emitReadable(this, state);
- }
- }
- }
-
- return res;
-};
-Readable.prototype.addListener = Readable.prototype.on;
-
-// pause() and resume() are remnants of the legacy readable stream API
-// If the user uses them, then switch into old mode.
-Readable.prototype.resume = function() {
- emitDataEvents(this);
- this.read(0);
- this.emit('resume');
-};
-
-Readable.prototype.pause = function() {
- emitDataEvents(this, true);
- this.emit('pause');
-};
-
-function emitDataEvents(stream, startPaused) {
- var state = stream._readableState;
-
- if (state.flowing) {
- // https://github.com/isaacs/readable-stream/issues/16
- throw new Error('Cannot switch to old mode now.');
- }
-
- var paused = startPaused || false;
- var readable = false;
-
- // convert to an old-style stream.
- stream.readable = true;
- stream.pipe = Stream.prototype.pipe;
- stream.on = stream.addListener = Stream.prototype.on;
-
- stream.on('readable', function() {
- readable = true;
-
- var c;
- while (!paused && (null !== (c = stream.read())))
- stream.emit('data', c);
-
- if (c === null) {
- readable = false;
- stream._readableState.needReadable = true;
- }
- });
-
- stream.pause = function() {
- paused = true;
- this.emit('pause');
- };
-
- stream.resume = function() {
- paused = false;
- if (readable)
- process.nextTick(function() {
- stream.emit('readable');
- });
- else
- this.read(0);
- this.emit('resume');
- };
-
- // now make it start, just in case it hadn't already.
- stream.emit('readable');
-}
-
-// wrap an old-style stream as the async data source.
-// This is *not* part of the readable stream interface.
-// It is an ugly unfortunate mess of history.
-Readable.prototype.wrap = function(stream) {
- var state = this._readableState;
- var paused = false;
-
- var self = this;
- stream.on('end', function() {
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length)
- self.push(chunk);
- }
-
- self.push(null);
- });
-
- stream.on('data', function(chunk) {
- if (state.decoder)
- chunk = state.decoder.write(chunk);
-
- // don't skip over falsy values in objectMode
- //if (state.objectMode && util.isNullOrUndefined(chunk))
- if (state.objectMode && (chunk === null || chunk === undefined))
- return;
- else if (!state.objectMode && (!chunk || !chunk.length))
- return;
-
- var ret = self.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- });
-
- // proxy all the other methods.
- // important when wrapping filters and duplexes.
- for (var i in stream) {
- if (typeof stream[i] === 'function' &&
- typeof this[i] === 'undefined') {
- this[i] = function(method) { return function() {
- return stream[method].apply(stream, arguments);
- }}(i);
- }
- }
-
- // proxy certain important events.
- var events = ['error', 'close', 'destroy', 'pause', 'resume'];
- forEach(events, function(ev) {
- stream.on(ev, self.emit.bind(self, ev));
- });
-
- // when we try to consume some more bytes, simply unpause the
- // underlying stream.
- self._read = function(n) {
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
-
- return self;
-};
-
-
-
-// exposed for testing purposes only.
-Readable._fromList = fromList;
-
-// Pluck off n bytes from an array of buffers.
-// Length is the combined lengths of all the buffers in the list.
-function fromList(n, state) {
- var list = state.buffer;
- var length = state.length;
- var stringMode = !!state.decoder;
- var objectMode = !!state.objectMode;
- var ret;
-
- // nothing in the list, definitely empty.
- if (list.length === 0)
- return null;
-
- if (length === 0)
- ret = null;
- else if (objectMode)
- ret = list.shift();
- else if (!n || n >= length) {
- // read it all, truncate the array.
- if (stringMode)
- ret = list.join('');
- else
- ret = Buffer.concat(list, length);
- list.length = 0;
- } else {
- // read just some of it.
- if (n < list[0].length) {
- // just take a part of the first list item.
- // slice is the same for buffers and strings.
- var buf = list[0];
- ret = buf.slice(0, n);
- list[0] = buf.slice(n);
- } else if (n === list[0].length) {
- // first list is a perfect match
- ret = list.shift();
- } else {
- // complex case.
- // we have enough to cover it, but it spans past the first buffer.
- if (stringMode)
- ret = '';
- else
- ret = new Buffer(n);
-
- var c = 0;
- for (var i = 0, l = list.length; i < l && c < n; i++) {
- var buf = list[0];
- var cpy = Math.min(n - c, buf.length);
-
- if (stringMode)
- ret += buf.slice(0, cpy);
- else
- buf.copy(ret, c, 0, cpy);
-
- if (cpy < buf.length)
- list[0] = buf.slice(cpy);
- else
- list.shift();
-
- c += cpy;
- }
- }
- }
-
- return ret;
-}
-
-function endReadable(stream) {
- var state = stream._readableState;
-
- // If we get here before consuming all the bytes, then that is a
- // bug in node. Should never happen.
- if (state.length > 0)
- throw new Error('endReadable called on non-empty stream');
-
- if (!state.endEmitted && state.calledRead) {
- state.ended = true;
- process.nextTick(function() {
- // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- }
- });
- }
-}
-
-function forEach (xs, f) {
- for (var i = 0, l = xs.length; i < l; i++) {
- f(xs[i], i);
- }
-}
-
-function indexOf (xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) return i;
- }
- return -1;
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
deleted file mode 100644
index eb188df..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-// a transform stream is a readable/writable stream where you do
-// something with the data. Sometimes it's called a "filter",
-// but that's not a great name for it, since that implies a thing where
-// some bits pass through, and others are simply ignored. (That would
-// be a valid example of a transform, of course.)
-//
-// While the output is causally related to the input, it's not a
-// necessarily symmetric or synchronous transformation. For example,
-// a zlib stream might take multiple plain-text writes(), and then
-// emit a single compressed chunk some time in the future.
-//
-// Here's how this works:
-//
-// The Transform stream has all the aspects of the readable and writable
-// stream classes. When you write(chunk), that calls _write(chunk,cb)
-// internally, and returns false if there's a lot of pending writes
-// buffered up. When you call read(), that calls _read(n) until
-// there's enough pending readable data buffered up.
-//
-// In a transform stream, the written data is placed in a buffer. When
-// _read(n) is called, it transforms the queued up data, calling the
-// buffered _write cb's as it consumes chunks. If consuming a single
-// written chunk would result in multiple output chunks, then the first
-// outputted bit calls the readcb, and subsequent chunks just go into
-// the read buffer, and will cause it to emit 'readable' if necessary.
-//
-// This way, back-pressure is actually determined by the reading side,
-// since _read has to be called to start processing a new chunk. However,
-// a pathological inflate type of transform can cause excessive buffering
-// here. For example, imagine a stream where every byte of input is
-// interpreted as an integer from 0-255, and then results in that many
-// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
-// 1kb of data being output. In this case, you could write a very small
-// amount of input, and end up with a very large amount of output. In
-// such a pathological inflating mechanism, there'd be no way to tell
-// the system to stop doing the transform. A single 4MB write could
-// cause the system to run out of memory.
-//
-// However, even in such a pathological case, only a single written chunk
-// would be consumed, and then the rest would wait (un-transformed) until
-// the results of the previous transformed chunk were consumed.
-
-module.exports = Transform;
-
-var Duplex = require('./_stream_duplex');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-util.inherits(Transform, Duplex);
-
-
-function TransformState(options, stream) {
- this.afterTransform = function(er, data) {
- return afterTransform(stream, er, data);
- };
-
- this.needTransform = false;
- this.transforming = false;
- this.writecb = null;
- this.writechunk = null;
-}
-
-function afterTransform(stream, er, data) {
- var ts = stream._transformState;
- ts.transforming = false;
-
- var cb = ts.writecb;
-
- if (!cb)
- return stream.emit('error', new Error('no writecb in Transform class'));
-
- ts.writechunk = null;
- ts.writecb = null;
-
- if (data !== null && data !== undefined)
- stream.push(data);
-
- if (cb)
- cb(er);
-
- var rs = stream._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- stream._read(rs.highWaterMark);
- }
-}
-
-
-function Transform(options) {
- if (!(this instanceof Transform))
- return new Transform(options);
-
- Duplex.call(this, options);
-
- var ts = this._transformState = new TransformState(options, this);
-
- // when the writable side finishes, then flush out anything remaining.
- var stream = this;
-
- // start out asking for a readable event once data is transformed.
- this._readableState.needReadable = true;
-
- // we have implemented the _read method, and done the other things
- // that Readable wants before the first _read call, so unset the
- // sync guard flag.
- this._readableState.sync = false;
-
- this.once('finish', function() {
- if ('function' === typeof this._flush)
- this._flush(function(er) {
- done(stream, er);
- });
- else
- done(stream);
- });
-}
-
-Transform.prototype.push = function(chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
-};
-
-// This is the part where you do stuff!
-// override this function in implementation classes.
-// 'chunk' is an input chunk.
-//
-// Call `push(newChunk)` to pass along transformed output
-// to the readable side. You may call 'push' zero or more times.
-//
-// Call `cb(err)` when you are done with this chunk. If you pass
-// an error, then that'll put the hurt on the whole operation. If you
-// never call cb(), then you'll never get another chunk.
-Transform.prototype._transform = function(chunk, encoding, cb) {
- throw new Error('not implemented');
-};
-
-Transform.prototype._write = function(chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform ||
- rs.needReadable ||
- rs.length < rs.highWaterMark)
- this._read(rs.highWaterMark);
- }
-};
-
-// Doesn't matter what the args are here.
-// _transform does all the work.
-// That we got here means that the readable side wants more data.
-Transform.prototype._read = function(n) {
- var ts = this._transformState;
-
- if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- // mark that we need a transform, so that any data that comes in
- // will get processed, now that we've asked for it.
- ts.needTransform = true;
- }
-};
-
-
-function done(stream, er) {
- if (er)
- return stream.emit('error', er);
-
- // if there's nothing in the write buffer, then that means
- // that nothing more will ever be provided
- var ws = stream._writableState;
- var rs = stream._readableState;
- var ts = stream._transformState;
-
- if (ws.length)
- throw new Error('calling transform done when ws.length != 0');
-
- if (ts.transforming)
- throw new Error('calling transform done when still transforming');
-
- return stream.push(null);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
deleted file mode 100644
index 4bdaa4f..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
+++ /dev/null
@@ -1,386 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// A bit simpler than readable streams.
-// Implement an async ._write(chunk, cb), and it'll handle all
-// the drain event emission and buffering.
-
-module.exports = Writable;
-
-/*<replacement>*/
-var Buffer = require('buffer').Buffer;
-/*</replacement>*/
-
-Writable.WritableState = WritableState;
-
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-var Stream = require('stream');
-
-util.inherits(Writable, Stream);
-
-function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
-}
-
-function WritableState(options, stream) {
- options = options || {};
-
- // the point at which write() starts returning false
- // Note: 0 is a valid value, means that we always return false if
- // the entire buffer is not flushed immediately on write()
- var hwm = options.highWaterMark;
- this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
-
- // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
-
- // cast to ints.
- this.highWaterMark = ~~this.highWaterMark;
-
- this.needDrain = false;
- // at the start of calling end()
- this.ending = false;
- // when end() has been called, and returned
- this.ended = false;
- // when 'finish' is emitted
- this.finished = false;
-
- // should we decode strings into buffers before passing to _write?
- // this is here so that some node-core streams can optimize string
- // handling at a lower level.
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // not an actual buffer we keep track of, but a measurement
- // of how much we're waiting to get pushed to some underlying
- // socket or file.
- this.length = 0;
-
- // a flag to see when we're in the middle of a write.
- this.writing = false;
-
- // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, becuase any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true;
-
- // a flag to know if we're processing previously buffered items, which
- // may call the _write() callback in the same tick, so that we don't
- // end up in an overlapped onwrite situation.
- this.bufferProcessing = false;
-
- // the callback that's passed to _write(chunk,cb)
- this.onwrite = function(er) {
- onwrite(stream, er);
- };
-
- // the callback that the user supplies to write(chunk,encoding,cb)
- this.writecb = null;
-
- // the amount that is being written when _write is called.
- this.writelen = 0;
-
- this.buffer = [];
-
- // True if the error was already emitted and should not be thrown again
- this.errorEmitted = false;
-}
-
-function Writable(options) {
- var Duplex = require('./_stream_duplex');
-
- // Writable ctor is applied to Duplexes, though they're not
- // instanceof Writable, they're instanceof Readable.
- if (!(this instanceof Writable) && !(this instanceof Duplex))
- return new Writable(options);
-
- this._writableState = new WritableState(options, this);
-
- // legacy.
- this.writable = true;
-
- Stream.call(this);
-}
-
-// Otherwise people can pipe Writable streams, which is just wrong.
-Writable.prototype.pipe = function() {
- this.emit('error', new Error('Cannot pipe. Not readable.'));
-};
-
-
-function writeAfterEnd(stream, state, cb) {
- var er = new Error('write after end');
- // TODO: defer error events consistently everywhere, not just the cb
- stream.emit('error', er);
- process.nextTick(function() {
- cb(er);
- });
-}
-
-// If we get something that is not a buffer, string, null, or undefined,
-// and we're not in objectMode, then that's an error.
-// Otherwise stream chunks are all considered to be of length=1, and the
-// watermarks determine how many objects to keep in the buffer, rather than
-// how many bytes or characters.
-function validChunk(stream, state, chunk, cb) {
- var valid = true;
- if (!Buffer.isBuffer(chunk) &&
- 'string' !== typeof chunk &&
- chunk !== null &&
- chunk !== undefined &&
- !state.objectMode) {
- var er = new TypeError('Invalid non-string/buffer chunk');
- stream.emit('error', er);
- process.nextTick(function() {
- cb(er);
- });
- valid = false;
- }
- return valid;
-}
-
-Writable.prototype.write = function(chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
-
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
-
- if (Buffer.isBuffer(chunk))
- encoding = 'buffer';
- else if (!encoding)
- encoding = state.defaultEncoding;
-
- if (typeof cb !== 'function')
- cb = function() {};
-
- if (state.ended)
- writeAfterEnd(this, state, cb);
- else if (validChunk(this, state, chunk, cb))
- ret = writeOrBuffer(this, state, chunk, encoding, cb);
-
- return ret;
-};
-
-function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode &&
- state.decodeStrings !== false &&
- typeof chunk === 'string') {
- chunk = new Buffer(chunk, encoding);
- }
- return chunk;
-}
-
-// if we're already writing something, then just put this
-// in the queue, and wait our turn. Otherwise, call _write
-// If we return false, then we need a drain event, so set that flag.
-function writeOrBuffer(stream, state, chunk, encoding, cb) {
- chunk = decodeChunk(state, chunk, encoding);
- if (Buffer.isBuffer(chunk))
- encoding = 'buffer';
- var len = state.objectMode ? 1 : chunk.length;
-
- state.length += len;
-
- var ret = state.length < state.highWaterMark;
- // we must ensure that previous needDrain will not be reset to false.
- if (!ret)
- state.needDrain = true;
-
- if (state.writing)
- state.buffer.push(new WriteReq(chunk, encoding, cb));
- else
- doWrite(stream, state, len, chunk, encoding, cb);
-
- return ret;
-}
-
-function doWrite(stream, state, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- stream._write(chunk, encoding, state.onwrite);
- state.sync = false;
-}
-
-function onwriteError(stream, state, sync, er, cb) {
- if (sync)
- process.nextTick(function() {
- cb(er);
- });
- else
- cb(er);
-
- stream._writableState.errorEmitted = true;
- stream.emit('error', er);
-}
-
-function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
-}
-
-function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
-
- onwriteStateUpdate(state);
-
- if (er)
- onwriteError(stream, state, sync, er, cb);
- else {
- // Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(stream, state);
-
- if (!finished && !state.bufferProcessing && state.buffer.length)
- clearBuffer(stream, state);
-
- if (sync) {
- process.nextTick(function() {
- afterWrite(stream, state, finished, cb);
- });
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
-}
-
-function afterWrite(stream, state, finished, cb) {
- if (!finished)
- onwriteDrain(stream, state);
- cb();
- if (finished)
- finishMaybe(stream, state);
-}
-
-// Must force callback to be called on nextTick, so that we don't
-// emit 'drain' before the write() consumer gets the 'false' return
-// value, and has a chance to attach a 'drain' listener.
-function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit('drain');
- }
-}
-
-
-// if there's something in the buffer waiting, then process it
-function clearBuffer(stream, state) {
- state.bufferProcessing = true;
-
- for (var c = 0; c < state.buffer.length; c++) {
- var entry = state.buffer[c];
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
-
- doWrite(stream, state, len, chunk, encoding, cb);
-
- // if we didn't call the onwrite immediately, then
- // it means that we need to wait until it does.
- // also, that means that the chunk and cb are currently
- // being processed, so move the buffer counter past them.
- if (state.writing) {
- c++;
- break;
- }
- }
-
- state.bufferProcessing = false;
- if (c < state.buffer.length)
- state.buffer = state.buffer.slice(c);
- else
- state.buffer.length = 0;
-}
-
-Writable.prototype._write = function(chunk, encoding, cb) {
- cb(new Error('not implemented'));
-};
-
-Writable.prototype.end = function(chunk, encoding, cb) {
- var state = this._writableState;
-
- if (typeof chunk === 'function') {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
-
- if (typeof chunk !== 'undefined' && chunk !== null)
- this.write(chunk, encoding);
-
- // ignore unnecessary end() calls.
- if (!state.ending && !state.finished)
- endWritable(this, state, cb);
-};
-
-
-function needFinish(stream, state) {
- return (state.ending &&
- state.length === 0 &&
- !state.finished &&
- !state.writing);
-}
-
-function finishMaybe(stream, state) {
- var need = needFinish(stream, state);
- if (need) {
- state.finished = true;
- stream.emit('finish');
- }
- return need;
-}
-
-function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished)
- process.nextTick(cb);
- else
- stream.once('finish', cb);
- }
- state.ended = true;
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md
deleted file mode 100644
index 5a76b41..0000000
--- a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# core-util-is
-
-The `util.is*` functions introduced in Node v0.12.
[33/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old b/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old
deleted file mode 100644
index 9326b72..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old
+++ /dev/null
@@ -1,298 +0,0 @@
-This library provides a way to read and write binary data.
-
-Node CType is a way to read and write binary data in structured and easy to use
-formats. It's name comes from the header file, though it does not share as much
-with it as it perhaps should.
-
-There are two levels of the API. One is the raw API which everything is built on
-top of, while the other provides a much nicer abstraction and is built entirely
-by using the lower level API. The hope is that the low level API is both clear
-and useful. The low level API gets it's names from stdint.h (a rather
-appropriate source). The lower level API is presented at the end of this
-document.
-
-Standard CType API
-
-The CType interface is presented as a parser object that controls the
-endianness combined with a series of methods to change that value, parse and
-write out buffers, and a way to provide typedefs. Standard Types
-
-The CType parser supports the following basic types which return Numbers except
-as indicated:
-
- * int8_t
- * int16_t
- * int32_t
- * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
- * uint8_t
- * uint16_t
- * uint32_t
- * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
- * float
- * double
- * char (returns a buffer with just that single character)
- * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
-
-Specifying Structs
-
-The CType parser also supports the notion of structs. A struct is an array of
-JSON objects that defines an order of keys which have types and values. One
-would build a struct to represent a point (x,y) as follows:
-
-[
- { x: { type: 'int16_t' }},
- { y: { type: 'int16_t' }}
-]
-
-When this is passed into the read routine, it would read the first two bytes
-(as defined by int16_t) to determine the Number to use for X, and then it would
-read the next two bytes to determine the value of Y. When read this could
-return something like:
-
-{
- x: 42,
- y: -23
-}
-
-When someone wants to write values, we use the same format as above, but with
-additional value field:
-
-[
- { x: { type: 'int16_t', value: 42 }},
- { y: { type: 'int16_t', value: -23 }}
-]
-
-Now, the structure above may be optionally annotated with offsets. This tells
-us to rather than read continuously we should read the given value at the
-specified offset. If an offset is provided, it is is effectively the equivalent
-of lseek(offset, SEEK_SET). Thus, subsequent values will be read from that
-offset and incremented by the appropriate value. As an example:
-
-[
- { x: { type: 'int16_t' }},
- { y: { type: 'int16_t', offset: 20 }},
- { z: { type: 'int16_t' }}
-]
-
-We would read x from the first starting offset given to us, for the sake of
-example, let's assume that's 0. After reading x, the next offset to read from
-would be 2; however, y specifies an offset, thus we jump directly to that
-offset and read y from byte 20. We would then read z from byte 22.
-
-The same offsets may be used when writing values.
-
-Typedef
-
-The basic set of types while covers the basics, is somewhat limiting. To make
-this richer, there is functionality to typedef something like in C. One can use
-typedef to add a new name to an existing type or to define a name to refer to a
-struct. Thus the following are all examples of a typedef:
-
-typedef('size_t', 'uint32_t');
-typedef('ssize_t', 'int32_t');
-typedef('point_t', [
- { x: { type: 'int16_t' }},
- { y: { type: 'int16_t' }}
-]);
-
-Once something has been typedef'd it can be used in any of the definitions
-previously shown.
-
-One cannot remove a typedef once created, this is analogous to C.
-
-The set of defined types can be printed with lstypes. The format of this output
-is subject to change, but likely will look something like:
-
-> lstypes();
-{
- size_t: 'uint32_t',
- ssize_t: 'int32_t',
- point_t: [
- { x: { type: 'int16_t' }},
- { y: { type: 'int16_t' }}
- ]
-}
-
-Specifying arrays
-
-Arrays can be specified by appending []s to a type. Arrays must have the size
-specified. The size must be specified and it can be done in one of two ways:
-
- * An explicit non-zero integer size
- * A name of a previously declared variable in the struct whose value is a
- number.
-
-Note, that when using the name of a variable, it should be the string name for
-the key. This is only valid inside structs and the value must be declared
-before the value with the array. The following are examples:
-
-[
- { ip_addr4: { type: 'uint8_t[4]' }},
- { len: { type: 'uint32_t' }},
- { data: { type: 'uint8_t[len]' }}
-]
-
-Arrays are permitted in typedefs; however, they must have a declared integer
-size. The following are examples of valid and invalid arrays:
-
-typedef('path', 'char[1024]'); /* Good */
-typedef('path', 'char[len]'); /* Bad! */
-
-64 bit values:
-
-Unfortunately Javascript represents values with a double, so you lose precision
-and the ability to represent Integers roughly beyond 2^53. To alleviate this, I
-propose the following for returning 64 bit integers when read:
-
-value[2]: Each entry is a 32 bit number which can be reconstructed to the
-original by the following formula:
-
-value[0] << 32 + value[1] (Note this will not work in Javascript)
-
-CTF JSON data:
-
-node-ctype can also handle JSON data that mathces the format described in the
-documentation of the tool ctf2json. Given the JSON data which specifies type
-information, it will transform that into a parser that understands all of the
-types defined inside of it. This is useful for more complicated structures that
-have a lot of typedefs.
-
-Interface overview
-
-The following is the header-file like interface to the parser object:
-
-/*
- * Create a new instance of the parser. Each parser has its own store of
- * typedefs and endianness. Conf is an object with the following values:
- *
- * endian Either 'big' or 'little' do determine the endianness we
- * want to read from or write to.
- *
- */
-function CTypeParser(conf);
-
-/*
- * Parses the CTF JSON data and creates a parser that understands all of those
- * types.
- *
- * data Parsed JSON data that maches that CTF JSON
- * specification.
- *
- * conf The configuration object to create a new CTypeParser
- * from.
- */
-CTypeParser parseCTF(data, conf);
-
-/*
- * This is what we were born to do. We read the data from a buffer and return it
- * in an object whose keys match the values from the object.
- *
- * def The array definition of the data to read in
- *
- * buffer The buffer to read data from
- *
- * offset The offset to start writing to
- *
- * Returns an object where each key corresponds to an entry in def and the value
- * is the read value.
- */
-Object CTypeParser.readData(<Type Definition>, buffer, offset);
-
-/*
- * This is the second half of what we were born to do, write out the data
- * itself.
- *
- * def The array definition of the data to write out with
- * values
- *
- * buffer The buffer to write to
- *
- * offset The offset in the buffer to write to
- */
-void CTypeParser.writeData(<Type Definition>, buffer, offset);
-
-/*
- * A user has requested to add a type, let us honor their request. Yet, if their
- * request doth spurn us, send them unto the Hells which Dante describes.
- *
- * name The string for the type definition we're adding
- *
- * value Either a string that is a type/array name or an object
- * that describes a struct.
- */
-void CTypeParser.prototype.typedef(name, value);
-
-Object CTypeParser.prototype.lstypes();
-
-/*
- * Get the endian value for the current parser
- */
-String CTypeParser.prototype.getEndian();
-
-/*
- * Sets the current endian value for the Parser. If the value is not valid,
- * throws an Error.
- *
- * endian Either 'big' or 'little' do determine the endianness we
- * want to read from or write to.
- *
- */
-void CTypeParser.protoype.setEndian(String);
-
-/*
- * Attempts to convert an array of two integers returned from rsint64 / ruint64
- * into an absolute 64 bit number. If however the value would exceed 2^52 this
- * will instead throw an error. The mantissa in a double is a 52 bit number and
- * rather than potentially give you a value that is an approximation this will
- * error. If you would rather an approximation, please see toApprox64.
- *
- * val An array of two 32-bit integers
- */
-Number function toAbs64(val)
-
-/*
- * Will return the 64 bit value as returned in an array from rsint64 / ruint64
- * to a value as close as it can. Note that Javascript stores all numbers as a
- * double and the mantissa only has 52 bits. Thus this version may approximate
- * the value.
- *
- * val An array of two 32-bit integers
- */
-Number function toApprox64(val)
-
-Low Level API
-
-The following function are provided at the low level:
-
-Read unsigned integers from a buffer:
-Number ruint8(buffer, endian, offset);
-Number ruint16(buffer, endian, offset);
-Number ruint32(buffer, endian, offset);
-Number[] ruint64(buffer, endian, offset);
-
-Read signed integers from a buffer:
-Number rsint8(buffer, endian, offset);
-Number rsint16(buffer, endian, offset);
-Number rsint32(buffer, endian, offset);
-Number[] rsint64(buffer, endian, offset);
-
-Read floating point numbers from a buffer:
-Number rfloat(buffer, endian, offset); /* IEEE-754 Single precision */
-Number rdouble(buffer, endian, offset); /* IEEE-754 Double precision */
-
-Write unsigned integers to a buffer:
-void wuint8(Number, endian, buffer, offset);
-void wuint16(Number, endian, buffer, offset);
-void wuint32(Number, endian, buffer, offset);
-void wuint64(Number[], endian, buffer, offset);
-
-Write signed integers from a buffer:
-void wsint8(Number, endian, buffer, offset);
-void wsint16(Number, endian, buffer, offset);
-void wsint32(Number, endian, buffer, offset);
-void wsint64(Number[], endian, buffer offset);
-
-Write floating point numbers from a buffer:
-void wfloat(Number, buffer, endian, offset); /* IEEE-754 Single precision */
-void wdouble(Number, buffer, endian, offset); /* IEEE-754 Double precision */
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js
deleted file mode 100644
index 66d5f73..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * ctf.js
- *
- * Understand and parse all of the different JSON formats of CTF data and
- * translate that into a series of node-ctype friendly pieces. The reason for
- * the abstraction is to handle different changes in the file format.
- *
- * We have to be careful here that we don't end up using a name that is already
- * a built in type.
- */
-var mod_assert = require('assert');
-var ASSERT = mod_assert.ok;
-
-var ctf_versions = [ '1.0' ];
-var ctf_entries = [ 'integer', 'float', 'typedef', 'struct' ];
-var ctf_deftypes = [ 'int8_t', 'uint8_t', 'int16_t', 'uint16_t', 'int32_t',
- 'uint32_t', 'float', 'double' ];
-
-function ctfParseInteger(entry, ctype)
-{
- var name, sign, len, type;
-
- name = entry['name'];
- if (!('signed' in entry['integer']))
- throw (new Error('Malformed CTF JSON: integer missing ' +
- 'signed value'));
-
-
- if (!('length' in entry['integer']))
- throw (new Error('Malformed CTF JSON: integer missing ' +
- 'length value'));
-
- sign = entry['integer']['signed'];
- len = entry['integer']['length'];
- type = null;
-
- if (sign && len == 1)
- type = 'int8_t';
- else if (len == 1)
- type = 'uint8_t';
- else if (sign && len == 2)
- type = 'int16_t';
- else if (len == 2)
- type = 'uint16_t';
- else if (sign && len == 4)
- type = 'int32_t';
- else if (len == 4)
- type = 'uint32_t';
- else if (sign && len == 8)
- type = 'int64_t';
- else if (len == 8)
- type = 'uint64_t';
-
- if (type === null)
- throw (new Error('Malformed CTF JSON: integer has ' +
- 'unsupported length and sign - ' + len + '/' + sign));
-
- /*
- * This means that this is the same as one of our built in types. If
- * that's the case defining it would be an error. So instead of trying
- * to typedef it, we'll return here.
- */
- if (name == type)
- return;
-
- if (name == 'char') {
- ASSERT(type == 'int8_t');
- return;
- }
-
- ctype.typedef(name, type);
-}
-
-function ctfParseFloat(entry, ctype)
-{
- var name, len;
-
- name = entry['name'];
- if (!('length' in entry['float']))
- throw (new Error('Malformed CTF JSON: float missing ' +
- 'length value'));
-
- len = entry['float']['length'];
- if (len != 4 && len != 8)
- throw (new Error('Malformed CTF JSON: float has invalid ' +
- 'length value'));
-
- if (len == 4) {
- if (name == 'float')
- return;
- ctype.typedef(name, 'float');
- } else if (len == 8) {
- if (name == 'double')
- return;
- ctype.typedef(name, 'double');
- }
-}
-
-function ctfParseTypedef(entry, ctype)
-{
- var name, type, ii;
-
- name = entry['name'];
- if (typeof (entry['typedef']) != 'string')
- throw (new Error('Malformed CTF JSON: typedef value in not ' +
- 'a string'));
-
- type = entry['typedef'];
-
- /*
- * We need to ensure that we're not looking at type that's one of our
- * built in types. Traditionally in C a uint32_t would be a typedef to
- * some kind of integer. However, those size types are built ins.
- */
- for (ii = 0; ii < ctf_deftypes.length; ii++) {
- if (name == ctf_deftypes[ii])
- return;
- }
-
- ctype.typedef(name, type);
-}
-
-function ctfParseStruct(entry, ctype)
-{
- var name, type, ii, val, index, member, push;
-
- member = [];
- if (!Array.isArray(entry['struct']))
- throw (new Error('Malformed CTF JSON: struct value is not ' +
- 'an array'));
-
- for (ii = 0; ii < entry['struct'].length; ii++) {
- val = entry['struct'][ii];
- if (!('name' in val))
- throw (new Error('Malformed CTF JSON: struct member ' +
- 'missing name'));
-
- if (!('type' in val))
- throw (new Error('Malformed CTF JSON: struct member ' +
- 'missing type'));
-
- if (typeof (val['name']) != 'string')
- throw (new Error('Malformed CTF JSON: struct member ' +
- 'name isn\'t a string'));
-
- if (typeof (val['type']) != 'string')
- throw (new Error('Malformed CTF JSON: struct member ' +
- 'type isn\'t a string'));
-
- /*
- * CTF version 2 specifies array names as <type> [<num>] where
- * as node-ctype does this as <type>[<num>].
- */
- name = val['name'];
- type = val['type'];
- index = type.indexOf(' [');
- if (index != -1) {
- type = type.substring(0, index) +
- type.substring(index + 1, type.length);
- }
- push = {};
- push[name] = { 'type': type };
- member.push(push);
- }
-
- name = entry['name'];
- ctype.typedef(name, member);
-}
-
-function ctfParseEntry(entry, ctype)
-{
- var ii, found;
-
- if (!('name' in entry))
- throw (new Error('Malformed CTF JSON: entry missing "name" ' +
- 'section'));
-
- for (ii = 0; ii < ctf_entries.length; ii++) {
- if (ctf_entries[ii] in entry)
- found++;
- }
-
- if (found === 0)
- throw (new Error('Malformed CTF JSON: found no entries'));
-
- if (found >= 2)
- throw (new Error('Malformed CTF JSON: found more than one ' +
- 'entry'));
-
- if ('integer' in entry) {
- ctfParseInteger(entry, ctype);
- return;
- }
-
- if ('float' in entry) {
- ctfParseFloat(entry, ctype);
- return;
- }
-
- if ('typedef' in entry) {
- ctfParseTypedef(entry, ctype);
- return;
- }
-
- if ('struct' in entry) {
- ctfParseStruct(entry, ctype);
- return;
- }
-
- ASSERT(false, 'shouldn\'t reach here');
-}
-
-function ctfParseJson(json, ctype)
-{
- var version, ii;
-
- ASSERT(json);
- ASSERT(ctype);
- if (!('metadata' in json))
- throw (new Error('Invalid CTF JSON: missing metadata section'));
-
- if (!('ctf2json_version' in json['metadata']))
- throw (new Error('Invalid CTF JSON: missing ctf2json_version'));
-
- version = json['metadata']['ctf2json_version'];
- for (ii = 0; ii < ctf_versions.length; ii++) {
- if (ctf_versions[ii] == version)
- break;
- }
-
- if (ii == ctf_versions.length)
- throw (new Error('Unsuported ctf2json_version: ' + version));
-
- if (!('data' in json))
- throw (new Error('Invalid CTF JSON: missing data section'));
-
- if (!Array.isArray(json['data']))
- throw (new Error('Malformed CTF JSON: data section is not ' +
- 'an array'));
-
- for (ii = 0; ii < json['data'].length; ii++)
- ctfParseEntry(json['data'][ii], ctype);
-}
-
-exports.ctfParseJson = ctfParseJson;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js
deleted file mode 100644
index 62c5d7b..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js
+++ /dev/null
@@ -1,1485 +0,0 @@
-/*
- * rm - Feb 2011
- * ctio.js:
- *
- * A simple way to read and write simple ctypes. Of course, as you'll find the
- * code isn't as simple as it might appear. The following types are currently
- * supported in big and little endian formats:
- *
- * uint8_t int8_t
- * uint16_t int16_t
- * uint32_t int32_t
- * float (single precision IEEE 754)
- * double (double precision IEEE 754)
- *
- * This is designed to work in Node and v8. It may in fact work in other
- * Javascript interpreters (that'd be pretty neat), but it hasn't been tested.
- * If you find that it does in fact work, that's pretty cool. Try and pass word
- * back to the original author.
- *
- * Note to the reader: If you're tabstop isn't set to 8, parts of this may look
- * weird.
- */
-
-/*
- * Numbers in Javascript have a secret: all numbers must be represented with an
- * IEEE-754 double. The double has a mantissa with a length of 52 bits with an
- * implicit one. Thus the range of integers that can be represented is limited
- * to the size of the mantissa, this makes reading and writing 64-bit integers
- * difficult, but far from impossible.
- *
- * Another side effect of this representation is what happens when you use the
- * bitwise operators, i.e. shift left, shift right, and, or, etc. In Javascript,
- * each operand and the result is cast to a signed 32-bit number. However, in
- * the case of >>> the values are cast to an unsigned number.
- */
-
-/*
- * A reminder on endian related issues:
- *
- * Big Endian: MSB -> First byte
- * Little Endian: MSB->Last byte
- */
-var mod_assert = require('assert');
-
-/*
- * An 8 bit unsigned integer involves doing no significant work.
- */
-function ruint8(buffer, endian, offset)
-{
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- return (buffer[offset]);
-}
-
-/*
- * For 16 bit unsigned numbers we can do all the casting that we want to do.
- */
-function rgint16(buffer, endian, offset)
-{
- var val = 0;
-
- if (endian == 'big') {
- val = buffer[offset] << 8;
- val |= buffer[offset+1];
- } else {
- val = buffer[offset];
- val |= buffer[offset+1] << 8;
- }
-
- return (val);
-
-}
-
-function ruint16(buffer, endian, offset)
-{
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 1 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- return (rgint16(buffer, endian, offset));
-}
-
-/*
- * Because most bitshifting is done using signed numbers, if we would go into
- * the realm where we use that 32nd bit, we'll end up going into the negative
- * range. i.e.:
- * > 200 << 24
- * -939524096
- *
- * Not the value you'd expect. To work around this, we end up having to do some
- * abuse of the JavaScript standard. in this case, we know that a >>> shift is
- * defined to cast our value to an *unsigned* 32-bit number. Because of that, we
- * use that instead to save us some additional math, though it does feel a
- * little weird and it isn't obvious as to why you woul dwant to do this at
- * first.
- */
-function rgint32(buffer, endian, offset)
-{
- var val = 0;
-
- if (endian == 'big') {
- val = buffer[offset+1] << 16;
- val |= buffer[offset+2] << 8;
- val |= buffer[offset+3];
- val = val + (buffer[offset] << 24 >>> 0);
- } else {
- val = buffer[offset+2] << 16;
- val |= buffer[offset+1] << 8;
- val |= buffer[offset];
- val = val + (buffer[offset + 3] << 24 >>> 0);
- }
-
- return (val);
-}
-
-function ruint32(buffer, endian, offset)
-{
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 3 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- return (rgint32(buffer, endian, offset));
-}
-
-/*
- * Reads a 64-bit unsigned number. The astue observer will note that this
- * doesn't quite work. Javascript has chosen to only have numbers that can be
- * represented by a double. A double only has 52 bits of mantissa with an
- * implicit 1, thus we have up to 53 bits to represent an integer. However, 2^53
- * doesn't quite give us what we want. Isn't 53 bits enough for anyone? What
- * could you have possibly wanted to represent that was larger than that? Oh,
- * maybe a size? You mean we bypassed the 4 GB limit on file sizes, when did
- * that happen?
- *
- * To get around this egregious language issue, we're going to instead construct
- * an array of two 32 bit unsigned integers. Where arr[0] << 32 + arr[1] would
- * give the actual number. However, note that the above code probably won't
- * produce the desired results because of the way Javascript numbers are
- * doubles.
- */
-function rgint64(buffer, endian, offset)
-{
- var val = new Array(2);
-
- if (endian == 'big') {
- val[0] = ruint32(buffer, endian, offset);
- val[1] = ruint32(buffer, endian, offset+4);
- } else {
- val[0] = ruint32(buffer, endian, offset+4);
- val[1] = ruint32(buffer, endian, offset);
- }
-
- return (val);
-}
-
-function ruint64(buffer, endian, offset)
-{
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 7 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- return (rgint64(buffer, endian, offset));
-}
-
-
-/*
- * Signed integer types, yay team! A reminder on how two's complement actually
- * works. The first bit is the signed bit, i.e. tells us whether or not the
- * number should be positive or negative. If the two's complement value is
- * positive, then we're done, as it's equivalent to the unsigned representation.
- *
- * Now if the number is positive, you're pretty much done, you can just leverage
- * the unsigned translations and return those. Unfortunately, negative numbers
- * aren't quite that straightforward.
- *
- * At first glance, one might be inclined to use the traditional formula to
- * translate binary numbers between the positive and negative values in two's
- * complement. (Though it doesn't quite work for the most negative value)
- * Mainly:
- * - invert all the bits
- * - add one to the result
- *
- * Of course, this doesn't quite work in Javascript. Take for example the value
- * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of
- * course, Javascript will do the following:
- *
- * > ~0xff80
- * -65409
- *
- * Whoh there, Javascript, that's not quite right. But wait, according to
- * Javascript that's perfectly correct. When Javascript ends up seeing the
- * constant 0xff80, it has no notion that it is actually a signed number. It
- * assumes that we've input the unsigned value 0xff80. Thus, when it does the
- * binary negation, it casts it into a signed value, (positive 0xff80). Then
- * when you perform binary negation on that, it turns it into a negative number.
- *
- * Instead, we're going to have to use the following general formula, that works
- * in a rather Javascript friendly way. I'm glad we don't support this kind of
- * weird numbering scheme in the kernel.
- *
- * (BIT-MAX - (unsigned)val + 1) * -1
- *
- * The astute observer, may think that this doesn't make sense for 8-bit numbers
- * (really it isn't necessary for them). However, when you get 16-bit numbers,
- * you do. Let's go back to our prior example and see how this will look:
- *
- * (0xffff - 0xff80 + 1) * -1
- * (0x007f + 1) * -1
- * (0x0080) * -1
- *
- * Doing it this way ends up allowing us to treat it appropriately in
- * Javascript. Sigh, that's really quite ugly for what should just be a few bit
- * shifts, ~ and &.
- */
-
-/*
- * Endianness doesn't matter for 8-bit signed values. We could in fact optimize
- * this case because the more traditional methods work, but for consistency,
- * we'll keep doing this the same way.
- */
-function rsint8(buffer, endian, offset)
-{
- var neg;
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- neg = buffer[offset] & 0x80;
- if (!neg)
- return (buffer[offset]);
-
- return ((0xff - buffer[offset] + 1) * -1);
-}
-
-/*
- * The 16-bit version requires a bit more effort. In this case, we can leverage
- * our unsigned code to generate the value we want to return.
- */
-function rsint16(buffer, endian, offset)
-{
- var neg, val;
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 1 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = rgint16(buffer, endian, offset);
- neg = val & 0x8000;
- if (!neg)
- return (val);
-
- return ((0xffff - val + 1) * -1);
-}
-
-/*
- * We really shouldn't leverage our 32-bit code here and instead utilize the
- * fact that we know that since these are signed numbers, we can do all the
- * shifting and binary anding to generate the 32-bit number. But, for
- * consistency we'll do the same. If we want to do otherwise, we should instead
- * make the 32 bit unsigned code do the optimization. But as long as there
- * aren't floats secretly under the hood for that, we /should/ be okay.
- */
-function rsint32(buffer, endian, offset)
-{
- var neg, val;
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 3 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = rgint32(buffer, endian, offset);
- neg = val & 0x80000000;
- if (!neg)
- return (val);
-
- return ((0xffffffff - val + 1) * -1);
-}
-
-/*
- * The signed version of this code suffers from all of the same problems of the
- * other 64 bit version.
- */
-function rsint64(buffer, endian, offset)
-{
- var neg, val;
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 3 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = rgint64(buffer, endian, offset);
- neg = val[0] & 0x80000000;
-
- if (!neg)
- return (val);
-
- val[0] = (0xffffffff - val[0]) * -1;
- val[1] = (0xffffffff - val[1] + 1) * -1;
-
- /*
- * If we had the key 0x8000000000000000, that would leave the lower 32
- * bits as 0xffffffff, however, since we're goint to add one, that would
- * actually leave the lower 32-bits as 0x100000000, which would break
- * our ability to write back a value that we received. To work around
- * this, if we actually get that value, we're going to bump the upper
- * portion by 1 and set this to zero.
- */
- mod_assert.ok(val[1] <= 0x100000000);
- if (val[1] == -0x100000000) {
- val[1] = 0;
- val[0]--;
- }
-
- return (val);
-}
-
-/*
- * We now move onto IEEE 754: The traditional form for floating point numbers
- * and what is secretly hiding at the heart of everything in this. I really hope
- * that someone is actually using this, as otherwise, this effort is probably
- * going to be more wasted.
- *
- * One might be tempted to use parseFloat here, but that wouldn't work at all
- * for several reasons. Mostly due to the way floats actually work, and
- * parseFloat only actually works in base 10. I don't see base 10 anywhere near
- * this file.
- *
- * In this case we'll implement the single and double precision versions. The
- * quadruple precision, while probably useful, wouldn't really be accepted by
- * Javascript, so let's not even waste our time.
- *
- * So let's review how this format looks like. A single precision value is 32
- * bits and has three parts:
- * - Sign bit
- * - Exponent (Using bias notation)
- * - Mantissa
- *
- * |s|eeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmm|
- * 31| 30-23 | 22 - 0 |
- *
- * The exponent is stored in a biased input. The bias in this case 127.
- * Therefore, our exponent is equal to the 8-bit value - 127.
- *
- * By default, a number is normalized in IEEE, that means that the mantissa has
- * an implicit one that we don't see. So really the value stored is 1.m.
- * However, if the exponent is all zeros, then instead we have to shift
- * everything to the right one and there is no more implicit one.
- *
- * Special values:
- * - Positive Infinity:
- * Sign: 0
- * Exponent: All 1s
- * Mantissa: 0
- * - Negative Infinity:
- * Sign: 1
- * Exponent: All 1s
- * Mantissa: 0
- * - NaN:
- * Sign: *
- * Exponent: All 1s
- * Mantissa: non-zero
- * - Zero:
- * Sign: *
- * Exponent: All 0s
- * Mantissa: 0
- *
- * In the case of zero, the sign bit determines whether we get a positive or
- * negative zero. However, since Javascript cannot determine the difference
- * between the two: i.e. -0 == 0, we just always return 0.
- *
- */
-function rfloat(buffer, endian, offset)
-{
- var bytes = [];
- var sign, exponent, mantissa, val;
- var bias = 127;
- var maxexp = 0xff;
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 3 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- /* Normalize the bytes to be in endian order */
- if (endian == 'big') {
- bytes[0] = buffer[offset];
- bytes[1] = buffer[offset+1];
- bytes[2] = buffer[offset+2];
- bytes[3] = buffer[offset+3];
- } else {
- bytes[3] = buffer[offset];
- bytes[2] = buffer[offset+1];
- bytes[1] = buffer[offset+2];
- bytes[0] = buffer[offset+3];
- }
-
- sign = bytes[0] & 0x80;
- exponent = (bytes[0] & 0x7f) << 1;
- exponent |= (bytes[1] & 0x80) >>> 7;
- mantissa = (bytes[1] & 0x7f) << 16;
- mantissa |= bytes[2] << 8;
- mantissa |= bytes[3];
-
- /* Check for special cases before we do general parsing */
- if (!sign && exponent == maxexp && mantissa === 0)
- return (Number.POSITIVE_INFINITY);
-
- if (sign && exponent == maxexp && mantissa === 0)
- return (Number.NEGATIVE_INFINITY);
-
- if (exponent == maxexp && mantissa !== 0)
- return (Number.NaN);
-
- /*
- * Javascript really doesn't have support for positive or negative zero.
- * So we're not going to try and give it to you. That would be just
- * plain weird. Besides -0 == 0.
- */
- if (exponent === 0 && mantissa === 0)
- return (0);
-
- /*
- * Now we can deal with the bias and the determine whether the mantissa
- * has the implicit one or not.
- */
- exponent -= bias;
- if (exponent == -bias) {
- exponent++;
- val = 0;
- } else {
- val = 1;
- }
-
- val = (val + mantissa * Math.pow(2, -23)) * Math.pow(2, exponent);
-
- if (sign)
- val *= -1;
-
- return (val);
-}
-
-/*
- * Doubles in IEEE 754 are like their brothers except for a few changes and
- * increases in size:
- * - The exponent is now 11 bits
- * - The mantissa is now 52 bits
- * - The bias is now 1023
- *
- * |s|eeeeeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm|
- * 63| 62 - 52 | 51 - 0 |
- * 63| 62 - 52 | 51 - 0 |
- *
- * While the size has increased a fair amount, we're going to end up keeping the
- * same general formula for calculating the final value. As a reminder, this
- * formula is:
- *
- * (-1)^s * (n + m) * 2^(e-b)
- *
- * Where:
- * s is the sign bit
- * n is (exponent > 0) ? 1 : 0 -- Determines whether we're normalized
- * or not
- * m is the mantissa
- * e is the exponent specified
- * b is the bias for the exponent
- *
- */
-function rdouble(buffer, endian, offset)
-{
- var bytes = [];
- var sign, exponent, mantissa, val, lowmant;
- var bias = 1023;
- var maxexp = 0x7ff;
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 7 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- /* Normalize the bytes to be in endian order */
- if (endian == 'big') {
- bytes[0] = buffer[offset];
- bytes[1] = buffer[offset+1];
- bytes[2] = buffer[offset+2];
- bytes[3] = buffer[offset+3];
- bytes[4] = buffer[offset+4];
- bytes[5] = buffer[offset+5];
- bytes[6] = buffer[offset+6];
- bytes[7] = buffer[offset+7];
- } else {
- bytes[7] = buffer[offset];
- bytes[6] = buffer[offset+1];
- bytes[5] = buffer[offset+2];
- bytes[4] = buffer[offset+3];
- bytes[3] = buffer[offset+4];
- bytes[2] = buffer[offset+5];
- bytes[1] = buffer[offset+6];
- bytes[0] = buffer[offset+7];
- }
-
- /*
- * We can construct the exponent and mantissa the same way as we did in
- * the case of a float, just increase the range of the exponent.
- */
- sign = bytes[0] & 0x80;
- exponent = (bytes[0] & 0x7f) << 4;
- exponent |= (bytes[1] & 0xf0) >>> 4;
-
- /*
- * This is going to be ugly but then again, we're dealing with IEEE 754.
- * This could probably be done as a node add on in a few lines of C++,
- * but oh we'll, we've made it this far so let's be native the rest of
- * the way...
- *
- * What we're going to do is break the mantissa into two parts, the
- * lower 24 bits and the upper 28 bits. We'll multiply the upper 28 bits
- * by the appropriate power and then add in the lower 24-bits. Not
- * really that great. It's pretty much a giant kludge to deal with
- * Javascript eccentricities around numbers.
- */
- lowmant = bytes[7];
- lowmant |= bytes[6] << 8;
- lowmant |= bytes[5] << 16;
- mantissa = bytes[4];
- mantissa |= bytes[3] << 8;
- mantissa |= bytes[2] << 16;
- mantissa |= (bytes[1] & 0x0f) << 24;
- mantissa *= Math.pow(2, 24); /* Equivalent to << 24, but JS compat */
- mantissa += lowmant;
-
- /* Check for special cases before we do general parsing */
- if (!sign && exponent == maxexp && mantissa === 0)
- return (Number.POSITIVE_INFINITY);
-
- if (sign && exponent == maxexp && mantissa === 0)
- return (Number.NEGATIVE_INFINITY);
-
- if (exponent == maxexp && mantissa !== 0)
- return (Number.NaN);
-
- /*
- * Javascript really doesn't have support for positive or negative zero.
- * So we're not going to try and give it to you. That would be just
- * plain weird. Besides -0 == 0.
- */
- if (exponent === 0 && mantissa === 0)
- return (0);
-
- /*
- * Now we can deal with the bias and the determine whether the mantissa
- * has the implicit one or not.
- */
- exponent -= bias;
- if (exponent == -bias) {
- exponent++;
- val = 0;
- } else {
- val = 1;
- }
-
- val = (val + mantissa * Math.pow(2, -52)) * Math.pow(2, exponent);
-
- if (sign)
- val *= -1;
-
- return (val);
-}
-
-/*
- * Now that we have gone through the pain of reading the individual types, we're
- * probably going to want some way to write these back. None of this is going to
- * be good. But since we have Javascript numbers this should certainly be more
- * interesting. Though we can constrain this end a little bit more in what is
- * valid. For now, let's go back to our friends the unsigned value.
- */
-
-/*
- * Unsigned numbers seem deceptively easy. Here are the general steps and rules
- * that we are going to take:
- * - If the number is negative, throw an Error
- * - Truncate any floating point portion
- * - Take the modulus of the number in our base
- * - Write it out to the buffer in the endian format requested at the offset
- */
-
-/*
- * We have to make sure that the value is a valid integer. This means that it is
- * non-negative. It has no fractional component and that it does not exceed the
- * maximum allowed value.
- *
- * value The number to check for validity
- *
- * max The maximum value
- */
-function prepuint(value, max)
-{
- if (typeof (value) != 'number')
- throw (new (Error('cannot write a non-number as a number')));
-
- if (value < 0)
- throw (new Error('specified a negative value for writing an ' +
- 'unsigned value'));
-
- if (value > max)
- throw (new Error('value is larger than maximum value for ' +
- 'type'));
-
- if (Math.floor(value) !== value)
- throw (new Error('value has a fractional component'));
-
- return (value);
-}
-
-/*
- * 8-bit version, classy. We can ignore endianness which is good.
- */
-function wuint8(value, endian, buffer, offset)
-{
- var val;
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = prepuint(value, 0xff);
- buffer[offset] = val;
-}
-
-/*
- * Pretty much the same as the 8-bit version, just this time we need to worry
- * about endian related issues.
- */
-function wgint16(val, endian, buffer, offset)
-{
- if (endian == 'big') {
- buffer[offset] = (val & 0xff00) >>> 8;
- buffer[offset+1] = val & 0x00ff;
- } else {
- buffer[offset+1] = (val & 0xff00) >>> 8;
- buffer[offset] = val & 0x00ff;
- }
-}
-
-function wuint16(value, endian, buffer, offset)
-{
- var val;
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 1 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = prepuint(value, 0xffff);
- wgint16(val, endian, buffer, offset);
-}
-
-/*
- * The 32-bit version is going to have to be a little different unfortunately.
- * We can't quite bitshift to get the largest byte, because that would end up
- * getting us caught by the signed values.
- *
- * And yes, we do want to subtract out the lower part by default. This means
- * that when we do the division, it will be treated as a bit shift and we won't
- * end up generating a floating point value. If we did generate a floating point
- * value we'd have to truncate it intelligently, this saves us that problem and
- * may even be somewhat faster under the hood.
- */
-function wgint32(val, endian, buffer, offset)
-{
- if (endian == 'big') {
- buffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24);
- buffer[offset+1] = (val >>> 16) & 0xff;
- buffer[offset+2] = (val >>> 8) & 0xff;
- buffer[offset+3] = val & 0xff;
- } else {
- buffer[offset+3] = (val - (val & 0x00ffffff)) /
- Math.pow(2, 24);
- buffer[offset+2] = (val >>> 16) & 0xff;
- buffer[offset+1] = (val >>> 8) & 0xff;
- buffer[offset] = val & 0xff;
- }
-}
-
-function wuint32(value, endian, buffer, offset)
-{
- var val;
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 3 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = prepuint(value, 0xffffffff);
- wgint32(val, endian, buffer, offset);
-}
-
-/*
- * Unlike the other versions, we expect the value to be in the form of two
- * arrays where value[0] << 32 + value[1] would result in the value that we
- * want.
- */
-function wgint64(value, endian, buffer, offset)
-{
- if (endian == 'big') {
- wgint32(value[0], endian, buffer, offset);
- wgint32(value[1], endian, buffer, offset+4);
- } else {
- wgint32(value[0], endian, buffer, offset+4);
- wgint32(value[1], endian, buffer, offset);
- }
-}
-
-function wuint64(value, endian, buffer, offset)
-{
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (!(value instanceof Array))
- throw (new Error('value must be an array'));
-
- if (value.length != 2)
- throw (new Error('value must be an array of length 2'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 7 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- prepuint(value[0], 0xffffffff);
- prepuint(value[1], 0xffffffff);
- wgint64(value, endian, buffer, offset);
-}
-
-/*
- * We now move onto our friends in the signed number category. Unlike unsigned
- * numbers, we're going to have to worry a bit more about how we put values into
- * arrays. Since we are only worrying about signed 32-bit values, we're in
- * slightly better shape. Unfortunately, we really can't do our favorite binary
- * & in this system. It really seems to do the wrong thing. For example:
- *
- * > -32 & 0xff
- * 224
- *
- * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of
- * this aren't treated as a signed number. Ultimately a bad thing.
- *
- * What we're going to want to do is basically create the unsigned equivalent of
- * our representation and pass that off to the wuint* functions. To do that
- * we're going to do the following:
- *
- * - if the value is positive
- * we can pass it directly off to the equivalent wuint
- * - if the value is negative
- * we do the following computation:
- * mb + val + 1, where
- * mb is the maximum unsigned value in that byte size
- * val is the Javascript negative integer
- *
- *
- * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If
- * you do out the computations:
- *
- * 0xffff - 128 + 1
- * 0xffff - 127
- * 0xff80
- *
- * You can then encode this value as the signed version. This is really rather
- * hacky, but it should work and get the job done which is our goal here.
- *
- * Thus the overall flow is:
- * - Truncate the floating point part of the number
- * - We don't have to take the modulus, because the unsigned versions will
- * take care of that for us. And we don't have to worry about that
- * potentially causing bad things to happen because of sign extension
- * - Pass it off to the appropriate unsigned version, potentially modifying
- * the negative portions as necessary.
- */
-
-/*
- * A series of checks to make sure we actually have a signed 32-bit number
- */
-function prepsint(value, max, min)
-{
- if (typeof (value) != 'number')
- throw (new (Error('cannot write a non-number as a number')));
-
- if (value > max)
- throw (new Error('value larger than maximum allowed value'));
-
- if (value < min)
- throw (new Error('value smaller than minimum allowed value'));
-
- if (Math.floor(value) !== value)
- throw (new Error('value has a fractional component'));
-
- return (value);
-}
-
-/*
- * The 8-bit version of the signed value. Overall, fairly straightforward.
- */
-function wsint8(value, endian, buffer, offset)
-{
- var val;
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = prepsint(value, 0x7f, -0x80);
- if (val >= 0)
- wuint8(val, endian, buffer, offset);
- else
- wuint8(0xff + val + 1, endian, buffer, offset);
-}
-
-/*
- * The 16-bit version of the signed value. Also, fairly straightforward.
- */
-function wsint16(value, endian, buffer, offset)
-{
- var val;
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 1 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = prepsint(value, 0x7fff, -0x8000);
- if (val >= 0)
- wgint16(val, endian, buffer, offset);
- else
- wgint16(0xffff + val + 1, endian, buffer, offset);
-
-}
-
-/*
- * We can do this relatively easily by leveraging the code used for 32-bit
- * unsigned code.
- */
-function wsint32(value, endian, buffer, offset)
-{
- var val;
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 3 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- val = prepsint(value, 0x7fffffff, -0x80000000);
- if (val >= 0)
- wgint32(val, endian, buffer, offset);
- else
- wgint32(0xffffffff + val + 1, endian, buffer, offset);
-}
-
-/*
- * The signed 64 bit integer should by in the same format as when received.
- * Mainly it should ensure that the value is an array of two integers where
- * value[0] << 32 + value[1] is the desired number. Furthermore, the two values
- * need to be equal.
- */
-function wsint64(value, endian, buffer, offset)
-{
- var vzpos, vopos;
- var vals = new Array(2);
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (!(value instanceof Array))
- throw (new Error('value must be an array'));
-
- if (value.length != 2)
- throw (new Error('value must be an array of length 2'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
- if (offset + 7 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- /*
- * We need to make sure that we have the same sign on both values. The
- * hokiest way to to do this is to multiply the number by +inf. If we do
- * this, we'll get either +/-inf depending on the sign of the value.
- * Once we have this, we can compare it to +inf to see if the number is
- * positive or not.
- */
- vzpos = (value[0] * Number.POSITIVE_INFINITY) ==
- Number.POSITIVE_INFINITY;
- vopos = (value[1] * Number.POSITIVE_INFINITY) ==
- Number.POSITIVE_INFINITY;
-
- /*
- * If either of these is zero, then we don't actually need this check.
- */
- if (value[0] != 0 && value[1] != 0 && vzpos != vopos)
- throw (new Error('Both entries in the array must have ' +
- 'the same sign'));
-
- /*
- * Doing verification for a signed 64-bit integer is actually a big
- * trickier than it appears. We can't quite use our standard techniques
- * because we need to compare both sets of values. The first value is
- * pretty straightforward. If the first value is beond the extremes than
- * we error out. However, the valid range of the second value varies
- * based on the first one. If the first value is negative, and *not* the
- * largest negative value, than it can be any integer within the range [
- * 0, 0xffffffff ]. If it is the largest negative number, it must be
- * zero.
- *
- * If the first number is positive, than it doesn't matter what the
- * value is. We just simply have to make sure we have a valid positive
- * integer.
- */
- if (vzpos) {
- prepuint(value[0], 0x7fffffff);
- prepuint(value[1], 0xffffffff);
- } else {
- prepsint(value[0], 0, -0x80000000);
- prepsint(value[1], 0, -0xffffffff);
- if (value[0] == -0x80000000 && value[1] != 0)
- throw (new Error('value smaller than minimum ' +
- 'allowed value'));
- }
-
- /* Fix negative numbers */
- if (value[0] < 0 || value[1] < 0) {
- vals[0] = 0xffffffff - Math.abs(value[0]);
- vals[1] = 0x100000000 - Math.abs(value[1]);
- if (vals[1] == 0x100000000) {
- vals[1] = 0;
- vals[0]++;
- }
- } else {
- vals[0] = value[0];
- vals[1] = value[1];
- }
- wgint64(vals, endian, buffer, offset);
-}
-
-/*
- * Now we are moving onto the weirder of these, the float and double. For this
- * we're going to just have to do something that's pretty weird. First off, we
- * have no way to get at the underlying float representation, at least not
- * easily. But that doesn't mean we can't figure it out, we just have to use our
- * heads.
- *
- * One might propose to use Number.toString(2). Of course, this is not really
- * that good, because the ECMAScript 262 v3 Standard says the following Section
- * 15.7.4.2-Number.prototype.toString (radix):
- *
- * If radix is an integer from 2 to 36, but not 10, the result is a string, the
- * choice of which is implementation-dependent.
- *
- * Well that doesn't really help us one bit now does it? We could use the
- * standard base 10 version of the string, but that's just going to create more
- * errors as we end up trying to convert it back to a binary value. So, really
- * this just means we have to be non-lazy and parse the structure intelligently.
- *
- * First off, we can do the basic checks: NaN, positive and negative infinity.
- *
- * Now that those are done we can work backwards to generate the mantissa and
- * exponent.
- *
- * The first thing we need to do is determine the sign bit, easy to do, check
- * whether the value is less than 0. And convert the number to its absolute
- * value representation. Next, we need to determine if the value is less than
- * one or greater than or equal to one and from there determine what power was
- * used to get there. What follows is now specific to floats, though the general
- * ideas behind this will hold for doubles as well, but the exact numbers
- * involved will change.
- *
- * Once we have that power we can determine the exponent and the mantissa. Call
- * the value that has the number of bits to reach the power ebits. In the
- * general case they have the following values:
- *
- * exponent 127 + ebits
- * mantissa value * 2^(23 - ebits) & 0x7fffff
- *
- * In the case where the value of ebits is <= -127 we are now in the case where
- * we no longer have normalized numbers. In this case the values take on the
- * following values:
- *
- * exponent 0
- * mantissa value * 2^149 & 0x7fffff
- *
- * Once we have the values for the sign, mantissa, and exponent. We reconstruct
- * the four bytes as follows:
- *
- * byte0 sign bit and seven most significant bits from the exp
- * sign << 7 | (exponent & 0xfe) >>> 1
- *
- * byte1 lsb from the exponent and 7 top bits from the mantissa
- * (exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16
- *
- * byte2 bits 8-15 (zero indexing) from mantissa
- * mantissa & 0xff00 >> 8
- *
- * byte3 bits 0-7 from mantissa
- * mantissa & 0xff
- *
- * Once we have this we have to assign them into the buffer in proper endian
- * order.
- */
-
-/*
- * Compute the log base 2 of the value. Now, someone who remembers basic
- * properties of logarithms will point out that we could use the change of base
- * formula for logs, and in fact that would be astute, because that's what we'll
- * do for now. It feels cleaner, albeit it may be less efficient than just
- * iterating and dividing by 2. We may want to come back and revisit that some
- * day.
- */
-function log2(value)
-{
- return (Math.log(value) / Math.log(2));
-}
-
-/*
- * Helper to determine the exponent of the number we're looking at.
- */
-function intexp(value)
-{
- return (Math.floor(log2(value)));
-}
-
-/*
- * Helper to determine the exponent of the fractional part of the value.
- */
-function fracexp(value)
-{
- return (Math.floor(log2(value)));
-}
-
-function wfloat(value, endian, buffer, offset)
-{
- var sign, exponent, mantissa, ebits;
- var bytes = [];
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
-
- if (offset + 3 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- if (isNaN(value)) {
- sign = 0;
- exponent = 0xff;
- mantissa = 23;
- } else if (value == Number.POSITIVE_INFINITY) {
- sign = 0;
- exponent = 0xff;
- mantissa = 0;
- } else if (value == Number.NEGATIVE_INFINITY) {
- sign = 1;
- exponent = 0xff;
- mantissa = 0;
- } else {
- /* Well we have some work to do */
-
- /* Thankfully the sign bit is trivial */
- if (value < 0) {
- sign = 1;
- value = Math.abs(value);
- } else {
- sign = 0;
- }
-
- /* Use the correct function to determine number of bits */
- if (value < 1)
- ebits = fracexp(value);
- else
- ebits = intexp(value);
-
- /* Time to deal with the issues surrounding normalization */
- if (ebits <= -127) {
- exponent = 0;
- mantissa = (value * Math.pow(2, 149)) & 0x7fffff;
- } else {
- exponent = 127 + ebits;
- mantissa = value * Math.pow(2, 23 - ebits);
- mantissa &= 0x7fffff;
- }
- }
-
- bytes[0] = sign << 7 | (exponent & 0xfe) >>> 1;
- bytes[1] = (exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16;
- bytes[2] = (mantissa & 0x00ff00) >>> 8;
- bytes[3] = mantissa & 0x0000ff;
-
- if (endian == 'big') {
- buffer[offset] = bytes[0];
- buffer[offset+1] = bytes[1];
- buffer[offset+2] = bytes[2];
- buffer[offset+3] = bytes[3];
- } else {
- buffer[offset] = bytes[3];
- buffer[offset+1] = bytes[2];
- buffer[offset+2] = bytes[1];
- buffer[offset+3] = bytes[0];
- }
-}
-
-/*
- * Now we move onto doubles. Doubles are similar to floats in pretty much all
- * ways except that the processing isn't quite as straightforward because we
- * can't always use shifting, i.e. we have > 32 bit values.
- *
- * We're going to proceed in an identical fashion to floats and utilize the same
- * helper functions. All that really is changing are the specific values that we
- * use to do the calculations. Thus, to review we have to do the following.
- *
- * First get the sign bit and convert the value to its absolute value
- * representation. Next, we determine the number of bits that we used to get to
- * the value, branching whether the value is greater than or less than 1. Once
- * we have that value which we will again call ebits, we have to do the
- * following in the general case:
- *
- * exponent 1023 + ebits
- * mantissa [value * 2^(52 - ebits)] % 2^52
- *
- * In the case where the value of ebits <= -1023 we no longer use normalized
- * numbers, thus like with floats we have to do slightly different processing:
- *
- * exponent 0
- * mantissa [value * 2^1074] % 2^52
- *
- * Once we have determined the sign, exponent and mantissa we can construct the
- * bytes as follows:
- *
- * byte0 sign bit and seven most significant bits form the exp
- * sign << 7 | (exponent & 0x7f0) >>> 4
- *
- * byte1 Remaining 4 bits from the exponent and the four most
- * significant bits from the mantissa 48-51
- * (exponent & 0x00f) << 4 | mantissa >>> 48
- *
- * byte2 Bits 40-47 from the mantissa
- * (mantissa >>> 40) & 0xff
- *
- * byte3 Bits 32-39 from the mantissa
- * (mantissa >>> 32) & 0xff
- *
- * byte4 Bits 24-31 from the mantissa
- * (mantissa >>> 24) & 0xff
- *
- * byte5 Bits 16-23 from the Mantissa
- * (mantissa >>> 16) & 0xff
- *
- * byte6 Bits 8-15 from the mantissa
- * (mantissa >>> 8) & 0xff
- *
- * byte7 Bits 0-7 from the mantissa
- * mantissa & 0xff
- *
- * Now we can't quite do the right shifting that we want in bytes 1 - 3, because
- * we'll have extended too far and we'll lose those values when we try and do
- * the shift. Instead we have to use an alternate approach. To try and stay out
- * of floating point, what we'll do is say that mantissa -= bytes[4-7] and then
- * divide by 2^32. Once we've done that we can use binary arithmetic. Oof,
- * that's ugly, but it seems to avoid using floating point (just based on how v8
- * seems to be optimizing for base 2 arithmetic).
- */
-function wdouble(value, endian, buffer, offset)
-{
- var sign, exponent, mantissa, ebits;
- var bytes = [];
-
- if (value === undefined)
- throw (new Error('missing value'));
-
- if (endian === undefined)
- throw (new Error('missing endian'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer'));
-
- if (offset === undefined)
- throw (new Error('missing offset'));
-
-
- if (offset + 7 >= buffer.length)
- throw (new Error('Trying to read beyond buffer length'));
-
- if (isNaN(value)) {
- sign = 0;
- exponent = 0x7ff;
- mantissa = 23;
- } else if (value == Number.POSITIVE_INFINITY) {
- sign = 0;
- exponent = 0x7ff;
- mantissa = 0;
- } else if (value == Number.NEGATIVE_INFINITY) {
- sign = 1;
- exponent = 0x7ff;
- mantissa = 0;
- } else {
- /* Well we have some work to do */
-
- /* Thankfully the sign bit is trivial */
- if (value < 0) {
- sign = 1;
- value = Math.abs(value);
- } else {
- sign = 0;
- }
-
- /* Use the correct function to determine number of bits */
- if (value < 1)
- ebits = fracexp(value);
- else
- ebits = intexp(value);
-
- /*
- * This is a total hack to determine a denormalized value.
- * Unfortunately, we sometimes do not get a proper value for
- * ebits, i.e. we lose the values that would get rounded off.
- *
- *
- * The astute observer may wonder why we would be
- * multiplying by two Math.pows rather than just summing
- * them. Well, that's to get around a small bug in the
- * way v8 seems to implement the function. On occasion
- * doing:
- *
- * foo * Math.pow(2, 1023 + 51)
- *
- * Causes us to overflow to infinity, where as doing:
- *
- * foo * Math.pow(2, 1023) * Math.pow(2, 51)
- *
- * Does not cause us to overflow. Go figure.
- *
- */
- if (value <= 2.225073858507201e-308 || ebits <= -1023) {
- exponent = 0;
- mantissa = value * Math.pow(2, 1023) * Math.pow(2, 51);
- mantissa %= Math.pow(2, 52);
- } else {
- /*
- * We might have gotten fucked by our floating point
- * logarithm magic. This is rather crappy, but that's
- * our luck. If we just had a log base 2 or access to
- * the stupid underlying representation this would have
- * been much easier and we wouldn't have such stupid
- * kludges or hacks.
- */
- if (ebits > 1023)
- ebits = 1023;
- exponent = 1023 + ebits;
- mantissa = value * Math.pow(2, -ebits);
- mantissa *= Math.pow(2, 52);
- mantissa %= Math.pow(2, 52);
- }
- }
-
- /* Fill the bytes in backwards to deal with the size issues */
- bytes[7] = mantissa & 0xff;
- bytes[6] = (mantissa >>> 8) & 0xff;
- bytes[5] = (mantissa >>> 16) & 0xff;
- mantissa = (mantissa - (mantissa & 0xffffff)) / Math.pow(2, 24);
- bytes[4] = mantissa & 0xff;
- bytes[3] = (mantissa >>> 8) & 0xff;
- bytes[2] = (mantissa >>> 16) & 0xff;
- bytes[1] = (exponent & 0x00f) << 4 | mantissa >>> 24;
- bytes[0] = (sign << 7) | (exponent & 0x7f0) >>> 4;
-
- if (endian == 'big') {
- buffer[offset] = bytes[0];
- buffer[offset+1] = bytes[1];
- buffer[offset+2] = bytes[2];
- buffer[offset+3] = bytes[3];
- buffer[offset+4] = bytes[4];
- buffer[offset+5] = bytes[5];
- buffer[offset+6] = bytes[6];
- buffer[offset+7] = bytes[7];
- } else {
- buffer[offset+7] = bytes[0];
- buffer[offset+6] = bytes[1];
- buffer[offset+5] = bytes[2];
- buffer[offset+4] = bytes[3];
- buffer[offset+3] = bytes[4];
- buffer[offset+2] = bytes[5];
- buffer[offset+1] = bytes[6];
- buffer[offset] = bytes[7];
- }
-}
-
-/*
- * Actually export our work above. One might argue that we shouldn't expose
- * these interfaces and just force people to use the higher level abstractions
- * around this work. However, unlike say other libraries we've come across, this
- * interface has several properties: it makes sense, it's simple, and it's
- * useful.
- */
-exports.ruint8 = ruint8;
-exports.ruint16 = ruint16;
-exports.ruint32 = ruint32;
-exports.ruint64 = ruint64;
-exports.wuint8 = wuint8;
-exports.wuint16 = wuint16;
-exports.wuint32 = wuint32;
-exports.wuint64 = wuint64;
-
-exports.rsint8 = rsint8;
-exports.rsint16 = rsint16;
-exports.rsint32 = rsint32;
-exports.rsint64 = rsint64;
-exports.wsint8 = wsint8;
-exports.wsint16 = wsint16;
-exports.wsint32 = wsint32;
-exports.wsint64 = wsint64;
-
-exports.rfloat = rfloat;
-exports.rdouble = rdouble;
-exports.wfloat = wfloat;
-exports.wdouble = wdouble;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js
deleted file mode 100644
index 7d2f4a5..0000000
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js
+++ /dev/null
@@ -1,944 +0,0 @@
-/*
- * rm - Feb 2011
- * ctype.js
- *
- * This module provides a simple abstraction towards reading and writing
- * different types of binary data. It is designed to use ctio.js and provide a
- * richer and more expressive API on top of it.
- *
- * By default we support the following as built in basic types:
- * int8_t
- * int16_t
- * int32_t
- * uint8_t
- * uint16_t
- * uint32_t
- * uint64_t
- * float
- * double
- * char
- * char[]
- *
- * Each type is returned as a Number, with the exception of char and char[]
- * which are returned as Node Buffers. A char is considered a uint8_t.
- *
- * Requests to read and write data are specified as an array of JSON objects.
- * This is also the same way that one declares structs. Even if just a single
- * value is requested, it must be done as a struct. The array order determines
- * the order that we try and read values. Each entry has the following format
- * with values marked with a * being optional.
- *
- * { key: { type: /type/, value*: /value/, offset*: /offset/ }
- *
- * If offset is defined, we lseek(offset, SEEK_SET) before reading the next
- * value. Value is defined when we're writing out data, otherwise it's ignored.
- *
- */
-
-var mod_ctf = require('./ctf.js');
-var mod_ctio = require('./ctio.js');
-var mod_assert = require('assert');
-
-/*
- * This is the set of basic types that we support.
- *
- * read The function to call to read in a value from a buffer
- *
- * write The function to call to write a value to a buffer
- *
- */
-var deftypes = {
- 'uint8_t': { read: ctReadUint8, write: ctWriteUint8 },
- 'uint16_t': { read: ctReadUint16, write: ctWriteUint16 },
- 'uint32_t': { read: ctReadUint32, write: ctWriteUint32 },
- 'uint64_t': { read: ctReadUint64, write: ctWriteUint64 },
- 'int8_t': { read: ctReadSint8, write: ctWriteSint8 },
- 'int16_t': { read: ctReadSint16, write: ctWriteSint16 },
- 'int32_t': { read: ctReadSint32, write: ctWriteSint32 },
- 'int64_t': { read: ctReadSint64, write: ctWriteSint64 },
- 'float': { read: ctReadFloat, write: ctWriteFloat },
- 'double': { read: ctReadDouble, write: ctWriteDouble },
- 'char': { read: ctReadChar, write: ctWriteChar },
- 'char[]': { read: ctReadCharArray, write: ctWriteCharArray }
-};
-
-/*
- * The following are wrappers around the CType IO low level API. They encode
- * knowledge about the size and return something in the expected format.
- */
-function ctReadUint8(endian, buffer, offset)
-{
- var val = mod_ctio.ruint8(buffer, endian, offset);
- return ({ value: val, size: 1 });
-}
-
-function ctReadUint16(endian, buffer, offset)
-{
- var val = mod_ctio.ruint16(buffer, endian, offset);
- return ({ value: val, size: 2 });
-}
-
-function ctReadUint32(endian, buffer, offset)
-{
- var val = mod_ctio.ruint32(buffer, endian, offset);
- return ({ value: val, size: 4 });
-}
-
-function ctReadUint64(endian, buffer, offset)
-{
- var val = mod_ctio.ruint64(buffer, endian, offset);
- return ({ value: val, size: 8 });
-}
-
-function ctReadSint8(endian, buffer, offset)
-{
- var val = mod_ctio.rsint8(buffer, endian, offset);
- return ({ value: val, size: 1 });
-}
-
-function ctReadSint16(endian, buffer, offset)
-{
- var val = mod_ctio.rsint16(buffer, endian, offset);
- return ({ value: val, size: 2 });
-}
-
-function ctReadSint32(endian, buffer, offset)
-{
- var val = mod_ctio.rsint32(buffer, endian, offset);
- return ({ value: val, size: 4 });
-}
-
-function ctReadSint64(endian, buffer, offset)
-{
- var val = mod_ctio.rsint64(buffer, endian, offset);
- return ({ value: val, size: 8 });
-}
-
-function ctReadFloat(endian, buffer, offset)
-{
- var val = mod_ctio.rfloat(buffer, endian, offset);
- return ({ value: val, size: 4 });
-}
-
-function ctReadDouble(endian, buffer, offset)
-{
- var val = mod_ctio.rdouble(buffer, endian, offset);
- return ({ value: val, size: 8 });
-}
-
-/*
- * Reads a single character into a node buffer
- */
-function ctReadChar(endian, buffer, offset)
-{
- var res = new Buffer(1);
- res[0] = mod_ctio.ruint8(buffer, endian, offset);
- return ({ value: res, size: 1 });
-}
-
-function ctReadCharArray(length, endian, buffer, offset)
-{
- var ii;
- var res = new Buffer(length);
-
- for (ii = 0; ii < length; ii++)
- res[ii] = mod_ctio.ruint8(buffer, endian, offset + ii);
-
- return ({ value: res, size: length });
-}
-
-function ctWriteUint8(value, endian, buffer, offset)
-{
- mod_ctio.wuint8(value, endian, buffer, offset);
- return (1);
-}
-
-function ctWriteUint16(value, endian, buffer, offset)
-{
- mod_ctio.wuint16(value, endian, buffer, offset);
- return (2);
-}
-
-function ctWriteUint32(value, endian, buffer, offset)
-{
- mod_ctio.wuint32(value, endian, buffer, offset);
- return (4);
-}
-
-function ctWriteUint64(value, endian, buffer, offset)
-{
- mod_ctio.wuint64(value, endian, buffer, offset);
- return (8);
-}
-
-function ctWriteSint8(value, endian, buffer, offset)
-{
- mod_ctio.wsint8(value, endian, buffer, offset);
- return (1);
-}
-
-function ctWriteSint16(value, endian, buffer, offset)
-{
- mod_ctio.wsint16(value, endian, buffer, offset);
- return (2);
-}
-
-function ctWriteSint32(value, endian, buffer, offset)
-{
- mod_ctio.wsint32(value, endian, buffer, offset);
- return (4);
-}
-
-function ctWriteSint64(value, endian, buffer, offset)
-{
- mod_ctio.wsint64(value, endian, buffer, offset);
- return (8);
-}
-
-function ctWriteFloat(value, endian, buffer, offset)
-{
- mod_ctio.wfloat(value, endian, buffer, offset);
- return (4);
-}
-
-function ctWriteDouble(value, endian, buffer, offset)
-{
- mod_ctio.wdouble(value, endian, buffer, offset);
- return (8);
-}
-
-/*
- * Writes a single character into a node buffer
- */
-function ctWriteChar(value, endian, buffer, offset)
-{
- if (!(value instanceof Buffer))
- throw (new Error('Input must be a buffer'));
-
- mod_ctio.ruint8(value[0], endian, buffer, offset);
- return (1);
-}
-
-/*
- * We're going to write 0s into the buffer if the string is shorter than the
- * length of the array.
- */
-function ctWriteCharArray(value, length, endian, buffer, offset)
-{
- var ii;
-
- if (!(value instanceof Buffer))
- throw (new Error('Input must be a buffer'));
-
- if (value.length > length)
- throw (new Error('value length greater than array length'));
-
- for (ii = 0; ii < value.length && ii < length; ii++)
- mod_ctio.wuint8(value[ii], endian, buffer, offset + ii);
-
- for (; ii < length; ii++)
- mod_ctio.wuint8(0, endian, offset + ii);
-
-
- return (length);
-}
-
-/*
- * Each parser has their own set of types. We want to make sure that they each
- * get their own copy as they may need to modify it.
- */
-function ctGetBasicTypes()
-{
- var ret = {};
- var key;
- for (key in deftypes)
- ret[key] = deftypes[key];
-
- return (ret);
-}
-
-/*
- * Given a string in the form of type[length] we want to split this into an
- * object that extracts that information. We want to note that we could possibly
- * have nested arrays so this should only check the furthest one. It may also be
- * the case that we have no [] pieces, in which case we just return the current
- * type.
- */
-function ctParseType(str)
-{
- var begInd, endInd;
- var type, len;
- if (typeof (str) != 'string')
- throw (new Error('type must be a Javascript string'));
-
- endInd = str.lastIndexOf(']');
- if (endInd == -1) {
- if (str.lastIndexOf('[') != -1)
- throw (new Error('found invalid type with \'[\' but ' +
- 'no corresponding \']\''));
-
- return ({ type: str });
- }
-
- begInd = str.lastIndexOf('[');
- if (begInd == -1)
- throw (new Error('found invalid type with \']\' but ' +
- 'no corresponding \'[\''));
-
- if (begInd >= endInd)
- throw (new Error('malformed type, \']\' appears before \'[\''));
-
- type = str.substring(0, begInd);
- len = str.substring(begInd + 1, endInd);
-
- return ({ type: type, len: len });
-}
-
-/*
- * Given a request validate that all of the fields for it are valid and make
- * sense. This includes verifying the following notions:
- * - Each type requested is present in types
- * - Only allow a name for a field to be specified once
- * - If an array is specified, validate that the requested field exists and
- * comes before it.
- * - If fields is defined, check that each entry has the occurrence of field
- */
-function ctCheckReq(def, types, fields)
-{
- var ii, jj;
- var req, keys, key;
- var found = {};
-
- if (!(def instanceof Array))
- throw (new Error('definition is not an array'));
-
- if (def.length === 0)
- throw (new Error('definition must have at least one element'));
-
- for (ii = 0; ii < def.length; ii++) {
- req = def[ii];
- if (!(req instanceof Object))
- throw (new Error('definition must be an array of' +
- 'objects'));
-
- keys = Object.keys(req);
- if (keys.length != 1)
- throw (new Error('definition entry must only have ' +
- 'one key'));
-
- if (keys[0] in found)
- throw (new Error('Specified name already ' +
- 'specified: ' + keys[0]));
-
- if (!('type' in req[keys[0]]))
- throw (new Error('missing required type definition'));
-
- key = ctParseType(req[keys[0]]['type']);
-
- /*
- * We may have nested arrays, we need to check the validity of
- * the types until the len field is undefined in key. However,
- * each time len is defined we need to verify it is either an
- * integer or corresponds to an already seen key.
- */
- while (key['len'] !== undefined) {
- if (isNaN(parseInt(key['len'], 10))) {
- if (!(key['len'] in found))
- throw (new Error('Given an array ' +
- 'length without a matching type'));
-
- }
-
- key = ctParseType(key['type']);
- }
-
- /* Now we can validate if the type is valid */
- if (!(key['type'] in types))
- throw (new Error('type not found or typdefed: ' +
- key['type']));
-
- /* Check for any required fields */
- if (fields !== undefined) {
- for (jj = 0; jj < fields.length; jj++) {
- if (!(fields[jj] in req[keys[0]]))
- throw (new Error('Missing required ' +
- 'field: ' + fields[jj]));
- }
- }
-
- found[keys[0]] = true;
- }
-}
-
-
-/*
- * Create a new instance of the parser. Each parser has its own store of
- * typedefs and endianness. Conf is an object with the following required
- * values:
- *
- * endian Either 'big' or 'little' do determine the endianness we
- * want to read from or write to.
- *
- * And the following optional values:
- *
- * char-type Valid options here are uint8 and int8. If uint8 is
- * specified this changes the default behavior of a single
- * char from being a buffer of a single character to being
- * a uint8_t. If int8, it becomes an int8_t instead.
- */
-function CTypeParser(conf)
-{
- if (!conf) throw (new Error('missing required argument'));
-
- if (!('endian' in conf))
- throw (new Error('missing required endian value'));
-
- if (conf['endian'] != 'big' && conf['endian'] != 'little')
- throw (new Error('Invalid endian type'));
-
- if ('char-type' in conf && (conf['char-type'] != 'uint8' &&
- conf['char-type'] != 'int8'))
- throw (new Error('invalid option for char-type: ' +
- conf['char-type']));
-
- this.endian = conf['endian'];
- this.types = ctGetBasicTypes();
-
- /*
- * There may be a more graceful way to do this, but this will have to
- * serve.
- */
- if ('char-type' in conf && conf['char-type'] == 'uint8')
- this.types['char'] = this.types['uint8_t'];
-
- if ('char-type' in conf && conf['char-type'] == 'int8')
- this.types['char'] = this.types['int8_t'];
-}
-
-/*
- * Sets the current endian value for the Parser. If the value is not valid,
- * throws an Error.
- *
- * endian Either 'big' or 'little' do determine the endianness we
- * want to read from or write to.
- *
- */
-CTypeParser.prototype.setEndian = function (endian)
-{
- if (endian != 'big' && endian != 'little')
- throw (new Error('invalid endian type, must be big or ' +
- 'little'));
-
- this.endian = endian;
-};
-
-/*
- * Returns the current value of the endian value for the parser.
- */
-CTypeParser.prototype.getEndian = function ()
-{
- return (this.endian);
-};
-
-/*
- * A user has requested to add a type, let us honor their request. Yet, if their
- * request doth spurn us, send them unto the Hells which Dante describes.
- *
- * name The string for the type definition we're adding
- *
- * value Either a string that is a type/array name or an object
- * that describes a struct.
- */
-CTypeParser.prototype.typedef = function (name, value)
-{
- var type;
-
- if (name === undefined)
- throw (new (Error('missing required typedef argument: name')));
-
- if (value === undefined)
- throw (new (Error('missing required typedef argument: value')));
-
- if (typeof (name) != 'string')
- throw (new (Error('the name of a type must be a string')));
-
- type = ctParseType(name);
-
- if (type['len'] !== undefined)
- throw (new Error('Cannot have an array in the typedef name'));
-
- if (name in this.types)
- throw (new Error('typedef name already present: ' + name));
-
- if (typeof (value) != 'string' && !(value instanceof Array))
- throw (new Error('typedef value must either be a string or ' +
- 'struct'));
-
- if (typeof (value) == 'string') {
- type = ctParseType(value);
- if (type['len'] !== undefined) {
- if (isNaN(parseInt(type['len'], 10)))
- throw (new (Error('typedef value must use ' +
- 'fixed size array when outside of a ' +
- 'struct')));
- }
-
- this.types[name] = value;
- } else {
- /* We have a struct, validate it */
- ctCheckReq(value, this.types);
- this.types[name] = value;
- }
-};
-
-/*
- * Include all of the typedefs, but none of the built in types. This should be
- * treated as read-only.
- */
-CTypeParser.prototype.lstypes = function ()
-{
- var key;
- var ret = {};
-
- for (key in this.types) {
- if (key in deftypes)
- continue;
- ret[key] = this.types[key];
- }
-
- return (ret);
-};
-
-/*
- * Given a type string that may have array types that aren't numbers, try and
- * fill them in from the values object. The object should be of the format where
- * indexing into it should return a number for that type.
- *
- * str The type string
- *
- * values An object that can be used to fulfill type information
- */
-function ctResolveArray(str, values)
-{
- var ret = '';
- var type = ctParseType(str);
-
- while (type['len'] !== undefined) {
- if (isNaN(parseInt(type['len'], 10))) {
- if (typeof (values[type['len']]) != 'number')
- throw (new Error('cannot sawp in non-number ' +
- 'for array value'));
- ret = '[' + values[type['len']] + ']' + ret;
- } else {
- ret = '[' + type['len'] + ']' + ret;
- }
- type = ctParseType(type['type']);
- }
-
- ret = type['type'] + ret;
-
- return (ret);
-}
-
-/*
- * [private] Either the typedef resolves to another type string or to a struct.
- * If it resolves to a struct, we just pass it off to read struct. If not, we
- * can just pass it off to read entry.
- */
-CTypeParser.prototype.resolveTypedef = function (type, dispatch, buffer,
- offset, value)
-{
- var pt;
-
- mod_assert.ok(type in this.types);
- if (typeof (this.types[type]) == 'string') {
- pt = ctParseType(this.types[type]);
- if (dispatch == 'read')
- return (this.readEntry(pt, buffer, offset));
- else if (dispatch == 'write')
- return (this.writeEntry(value, pt, buffer, offset));
- else
- throw (new Error('invalid dispatch type to ' +
- 'resolveTypedef'));
- } else {
- if (dispatch == 'read')
- return (this.readStruct(this.types[type], buffer,
- offset));
- else if (dispatch == 'write')
- return (this.writeStruct(value, this.types[type],
- buffer, offset));
- else
- throw (new Error('invalid dispatch type to ' +
- 'resolveTypedef'));
- }
-
-};
-
-/*
- * [private] Try and read in the specific entry.
- */
-CTypeParser.prototype.readEntry = function (type, buffer, offset)
-{
- var parse, len;
-
- /*
- * Because we want to special case char[]s this is unfortunately
- * a bit uglier than it really should be. We want to special
- * case char[]s so that we return a node buffer, thus they are a
- * first class type where as all other arrays just call into a
- * generic array routine which calls their data-specific routine
- * the specified number of times.
- *
- * The valid dispatch options we have are:
- * - Array and char => char[] handler
- * - Generic array handler
- * - Generic typedef handler
- * - Basic type handler
- */
- if (type['len'] !== undefined) {
- len = parseInt(type['len'], 10);
- if (isNaN(len))
- throw (new Error('somehow got a non-numeric length'));
-
- if (type['type'] == 'char')
- parse = this.types['char[]']['read'](len,
- this.endian, buffer, offset);
- else
- parse = this.readArray(type['type'],
- len, buffer, offset);
- } else {
- if (type['type'] in deftypes)
- parse = this.types[type['type']]['read'](this.endian,
- buffer, offset);
- else
- parse = this.resolveTypedef(type['type'], 'read',
- buffer, offset);
- }
-
- return (parse);
-};
-
-/*
- * [private] Read an array of data
- */
-CTypeParser.prototype.readArray = function (type, length, buffer, offset)
-{
- var ii, ent, pt;
- var baseOffset = offset;
- var ret = new Array(length);
- pt = ctParseType(type);
-
- for (ii = 0; ii < length; ii++) {
- ent = this.readEntry(pt, buffer, offset);
- offset += ent['size'];
- ret[ii] = ent['value'];
- }
-
- return ({ value: ret, size: offset - baseOffset });
-};
-
-/*
- * [private] Read a single struct in.
- */
-CTypeParser.prototype.readStruct = function (def, buffer, offset)
-{
- var parse, ii, type, entry, key;
- var baseOffset = offset;
- var ret = {};
-
- /* Walk it and handle doing what's necessary */
- for (ii = 0; ii < def.length; ii++) {
- key = Object.keys(def[ii])[0];
- entry = def[ii][key];
-
- /* Resolve all array values */
- type = ctParseType(ctResolveArray(entry['type'], ret));
-
- if ('offset' in entry)
- offset = baseOffset + entry['offset'];
-
- parse = this.readEntry(type, buffer, offset);
-
- offset += parse['size'];
- ret[key] = parse['value'];
- }
-
- return ({ value: ret, size: (offset-baseOffset)});
-};
-
-/*
- * This is what we were born to do. We read the data from a buffer and return it
- * in an object whose keys match the values from the object.
- *
- * def The array definition of the data to read in
- *
- * buffer The buffer to read data from
- *
- * offset The offset to start writing to
- *
- * Returns an object where each key corresponds to an entry in def and the value
- * is the read value.
- */
-CTypeParser.prototype.readData = function (def, buffer, offset)
-{
- /* Sanity check for arguments */
- if (def === undefined)
- throw (new Error('missing definition for what we should be' +
- 'parsing'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer for what we should be ' +
- 'parsing'));
-
- if (offset === undefined)
- throw (new Error('missing offset for what we should be ' +
- 'parsing'));
-
- /* Sanity check the object definition */
- ctCheckReq(def, this.types);
-
- return (this.readStruct(def, buffer, offset)['value']);
-};
-
-/*
- * [private] Write out an array of data
- */
-CTypeParser.prototype.writeArray = function (value, type, length, buffer,
- offset)
-{
- var ii, pt;
- var baseOffset = offset;
- if (!(value instanceof Array))
- throw (new Error('asked to write an array, but value is not ' +
- 'an array'));
-
- if (value.length != length)
- throw (new Error('asked to write array of length ' + length +
- ' but that does not match value length: ' + value.length));
-
- pt = ctParseType(type);
- for (ii = 0; ii < length; ii++)
- offset += this.writeEntry(value[ii], pt, buffer, offset);
-
- return (offset - baseOffset);
-};
-
-/*
- * [private] Write the specific entry
- */
-CTypeParser.prototype.writeEntry = function (value, type, buffer, offset)
-{
- var len, ret;
-
- if (type['len'] !== undefined) {
- len = parseInt(type['len'], 10);
- if (isNaN(len))
- throw (new Error('somehow got a non-numeric length'));
-
- if (type['type'] == 'char')
- ret = this.types['char[]']['write'](value, len,
- this.endian, buffer, offset);
- else
- ret = this.writeArray(value, type['type'],
- len, buffer, offset);
- } else {
- if (type['type'] in deftypes)
- ret = this.types[type['type']]['write'](value,
- this.endian, buffer, offset);
- else
- ret = this.resolveTypedef(type['type'], 'write',
- buffer, offset, value);
- }
-
- return (ret);
-};
-
-/*
- * [private] Write a single struct out.
- */
-CTypeParser.prototype.writeStruct = function (value, def, buffer, offset)
-{
- var ii, entry, type, key;
- var baseOffset = offset;
- var vals = {};
-
- for (ii = 0; ii < def.length; ii++) {
- key = Object.keys(def[ii])[0];
- entry = def[ii][key];
-
- type = ctParseType(ctResolveArray(entry['type'], vals));
-
- if ('offset' in entry)
- offset = baseOffset + entry['offset'];
-
- offset += this.writeEntry(value[ii], type, buffer, offset);
- /* Now that we've written it out, we can use it for arrays */
- vals[key] = value[ii];
- }
-
- return (offset);
-};
-
-/*
- * Unfortunately, we're stuck with the sins of an initial poor design. Because
- * of that, we are going to have to support the old way of writing data via
- * writeData. There we insert the values that you want to write into the
- * definition. A little baroque. Internally, we use the new model. So we need to
- * just get those values out of there. But to maintain the principle of least
- * surprise, we're not going to modify the input data.
- */
-function getValues(def)
-{
- var ii, out, key;
- out = [];
- for (ii = 0; ii < def.length; ii++) {
- key = Object.keys(def[ii])[0];
- mod_assert.ok('value' in def[ii][key]);
- out.push(def[ii][key]['value']);
- }
-
- return (out);
-}
-
-/*
- * This is the second half of what we were born to do, write out the data
- * itself. Historically this function required you to put your values in the
- * definition section. This was not the smartest thing to do and a bit of an
- * oversight to be honest. As such, this function now takes a values argument.
- * If values is non-null and non-undefined, it will be used to determine the
- * values. This means that the old method is still supported, but is no longer
- * acceptable.
- *
- * def The array definition of the data to write out with
- * values
- *
- * buffer The buffer to write to
- *
- * offset The offset in the buffer to write to
- *
- * values An array of values to write.
- */
-CTypeParser.prototype.writeData = function (def, buffer, offset, values)
-{
- var hv;
-
- if (def === undefined)
- throw (new Error('missing definition for what we should be' +
- 'parsing'));
-
- if (buffer === undefined)
- throw (new Error('missing buffer for what we should be ' +
- 'parsing'));
-
- if (offset === undefined)
- throw (new Error('missing offset for what we should be ' +
- 'parsing'));
-
- hv = (values != null && values != undefined);
- if (hv) {
- if (!Array.isArray(values))
- throw (new Error('missing values for writing'));
- ctCheckReq(def, this.types);
- } else {
- ctCheckReq(def, this.types, [ 'value' ]);
- }
-
- this.writeStruct(hv ? values : getValues(def), def, buffer, offset);
-};
-
-/*
- * Functions to go to and from 64 bit numbers in a way that is compatible with
- * Javascript limitations. There are two sets. One where the user is okay with
- * an approximation and one where they are definitely not okay with an
- * approximation.
- */
-
-/*
- * Attempts to convert an array of two integers returned from rsint64 / ruint64
- * into an absolute 64 bit number. If however the value would exceed 2^52 this
- * will instead throw an error. The mantissa in a double is a 52 bit number and
- * rather than potentially give you a value that is an approximation this will
- * error. If you would rather an approximation, please see toApprox64.
- *
- * val An array of two 32-bit integers
- */
-function toAbs64(val)
-{
- if (val === undefined)
- throw (new Error('missing required arg: value'));
-
- if (!Array.isArray(val))
- throw (new Error('value must be an array'));
-
- if (val.length != 2)
- throw (new Error('value must be an array of length 2'));
-
- /* We have 20 bits worth of precision in this range */
- if (val[0] >= 0x100000)
- throw (new Error('value would become approximated'));
-
- return (val[0] * Math.pow(2, 32) + val[1]);
-}
-
-/*
- * Will return the 64 bit value as returned in an array from rsint64 / ruint64
- * to a value as close as it can. Note that Javascript stores all numbers as a
- * double and the mantissa only has 52 bits. Thus this version may approximate
- * the value.
- *
- * val An array of two 32-bit integers
- */
-function toApprox64(val)
-{
- if (val === undefined)
- throw (new Error('missing required arg: value'));
-
- if (!Array.isArray(val))
- throw (new Error('value must be an array'));
-
- if (val.length != 2)
- throw (new Error('value must be an array of length 2'));
-
- return (Math.pow(2, 32) * val[0] + val[1]);
-}
-
-function parseCTF(json, conf)
-{
- var ctype = new CTypeParser(conf);
- mod_ctf.ctfParseJson(json, ctype);
-
- return (ctype);
-}
-
-/*
- * Export the few things we actually want to. Currently this is just the CType
- * Parser and ctio.
- */
-exports.Parser = CTypeParser;
-exports.toAbs64 = toAbs64;
-exports.toApprox64 = toApprox64;
-
-exports.parseCTF = parseCTF;
-
-exports.ruint8 = mod_ctio.ruint8;
-exports.ruint16 = mod_ctio.ruint16;
-exports.ruint32 = mod_ctio.ruint32;
-exports.ruint64 = mod_ctio.ruint64;
-exports.wuint8 = mod_ctio.wuint8;
-exports.wuint16 = mod_ctio.wuint16;
-exports.wuint32 = mod_ctio.wuint32;
-exports.wuint64 = mod_ctio.wuint64;
-
-exports.rsint8 = mod_ctio.rsint8;
-exports.rsint16 = mod_ctio.rsint16;
-exports.rsint32 = mod_ctio.rsint32;
-exports.rsint64 = mod_ctio.rsint64;
-exports.wsint8 = mod_ctio.wsint8;
-exports.wsint16 = mod_ctio.wsint16;
-exports.wsint32 = mod_ctio.wsint32;
-exports.wsint64 = mod_ctio.wsint64;
-
-exports.rfloat = mod_ctio.rfloat;
-exports.rdouble = mod_ctio.rdouble;
-exports.wfloat = mod_ctio.wfloat;
-exports.wdouble = mod_ctio.wdouble;
[35/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/server.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/server.js b/node_modules/request/node_modules/hawk/test/server.js
deleted file mode 100755
index 00d7d08..0000000
--- a/node_modules/request/node_modules/hawk/test/server.js
+++ /dev/null
@@ -1,985 +0,0 @@
-// Load modules
-
-var Url = require('url');
-var Code = require('code');
-var Hawk = require('../lib');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- describe('server', function () {
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- id: id,
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: (id === '1' ? 'sha1' : 'sha256'),
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- describe('#authenticate', function () {
-
- it('parses a valid authentication header (sha1)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
-
- it('parses a valid authentication header (sha256)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/1?b=1&a=2',
- host: 'example.com',
- port: 8000,
- authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", mac="m8r1rHbXN6NgO+KIIhjO7sFRyd78RNGVUwehe8Cp2dU=", ext="some-app-data"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353832234000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
-
- it('parses a valid authentication header (host override)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example1.com:8080',
- authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
- }
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { host: 'example.com', localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
-
- it('parses a valid authentication header (host port override)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example1.com:80',
- authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
- }
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { host: 'example.com', port: 8080, localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
-
- it('parses a valid authentication header (POST with payload)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123456", ts="1357926341", nonce="1AwuJD", hash="qAiXIVv+yjDATneWxZP2YCTa9aHRgQdnH9b3Wc+o3dg=", ext="some-app-data", mac="UeYcj5UoTVaAWXNvJfLVia7kU3VabxCqrccXP8sUGC4="'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1357926341000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
-
- it('errors on missing hash', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/1?b=1&a=2',
- host: 'example.com',
- port: 8000,
- authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", mac="m8r1rHbXN6NgO+KIIhjO7sFRyd78RNGVUwehe8Cp2dU=", ext="some-app-data"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { payload: 'body', localtimeOffsetMsec: 1353832234000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Missing required payload hash');
- done();
- });
- });
-
- it('errors on a stale timestamp', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123456", ts="1362337299", nonce="UzmxSs", ext="some-app-data", mac="wnNUxchvvryMH2RxckTdZ/gY3ijzvccx4keVvELC61w="'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Stale timestamp');
- var header = err.output.headers['WWW-Authenticate'];
- var ts = header.match(/^Hawk ts\=\"(\d+)\"\, tsm\=\"([^\"]+)\"\, error=\"Stale timestamp\"$/);
- var now = Hawk.utils.now();
- expect(parseInt(ts[1], 10) * 1000).to.be.within(now - 1000, now + 1000);
-
- var res = {
- headers: {
- 'www-authenticate': header
- }
- };
-
- expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
- done();
- });
- });
-
- it('errors on a replay', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="bXx7a7p1h9QYQNZ8x7QhvDQym8ACgab4m3lVSFn4DBw=", ext="hello"'
- };
-
- var memoryCache = {};
- var options = {
- localtimeOffsetMsec: 1353788437000 - Hawk.utils.now(),
- nonceFunc: function (nonce, ts, callback) {
-
- if (memoryCache[nonce]) {
- return callback(new Error());
- }
-
- memoryCache[nonce] = true;
- return callback();
- }
- };
-
- Hawk.server.authenticate(req, credentialsFunc, options, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
-
- Hawk.server.authenticate(req, credentialsFunc, options, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid nonce');
- done();
- });
- });
- });
-
- it('errors on an invalid authentication header: wrong scheme', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Basic asdasdasdasd'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.not.exist();
- done();
- });
- });
-
- it('errors on an invalid authentication header: no scheme', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: '!@#'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid header syntax');
- done();
- });
- });
-
- it('errors on an missing authorization header', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.isMissing).to.equal(true);
- done();
- });
- });
-
- it('errors on an missing host header', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- headers: {
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- }
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid Host header');
- done();
- });
- });
-
- it('errors on an missing authorization attribute (id)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Missing attributes');
- done();
- });
- });
-
- it('errors on an missing authorization attribute (ts)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Missing attributes');
- done();
- });
- });
-
- it('errors on an missing authorization attribute (nonce)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Missing attributes');
- done();
- });
- });
-
- it('errors on an missing authorization attribute (mac)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Missing attributes');
- done();
- });
- });
-
- it('errors on an unknown authorization attribute', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", x="3", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Unknown attribute: x');
- done();
- });
- });
-
- it('errors on an bad authorization header format', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123\\", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Bad header format');
- done();
- });
- });
-
- it('errors on an bad authorization attribute value', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="\t", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Bad attribute value: id');
- done();
- });
- });
-
- it('errors on an empty authorization attribute value', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Bad attribute value: id');
- done();
- });
- });
-
- it('errors on duplicated authorization attribute key', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", id="456", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Duplicate attribute: id');
- done();
- });
- });
-
- it('errors on an invalid authorization header format', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk'
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid header syntax');
- done();
- });
- });
-
- it('errors on an bad host header (missing host)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- headers: {
- host: ':8080',
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- }
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid Host header');
- done();
- });
- });
-
- it('errors on an bad host header (pad port)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:something',
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- }
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid Host header');
- done();
- });
- });
-
- it('errors on credentialsFunc error', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- var credentialsFunc = function (id, callback) {
-
- return callback(new Error('Unknown user'));
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Unknown user');
- done();
- });
- });
-
- it('errors on credentialsFunc error (with credentials)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- var credentialsFunc = function (id, callback) {
-
- return callback(new Error('Unknown user'), { some: 'value' });
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Unknown user');
- expect(credentials.some).to.equal('value');
- done();
- });
- });
-
- it('errors on missing credentials', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- var credentialsFunc = function (id, callback) {
-
- return callback(null, null);
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Unknown credentials');
- done();
- });
- });
-
- it('errors on invalid credentials (id)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid credentials');
- expect(err.output.payload.message).to.equal('An internal server error occurred');
- done();
- });
- });
-
- it('errors on invalid credentials (key)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- id: '23434d3q4d5345d',
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid credentials');
- expect(err.output.payload.message).to.equal('An internal server error occurred');
- done();
- });
- });
-
- it('errors on unknown credentials algorithm', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'hmac-sha-0',
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Unknown algorithm');
- expect(err.output.payload.message).to.equal('An internal server error occurred');
- done();
- });
- });
-
- it('errors on unknown bad mac', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080,
- authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcU4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
- };
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Bad mac');
- done();
- });
- });
- });
-
- describe('#header', function () {
-
- it('generates header', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1398546787',
- nonce: 'xUwusx',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
- id: '123456'
- };
-
- var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(header).to.equal('Hawk mac=\"n14wVJK4cOxAytPUMc5bPezQzuJGl5n7MYXhFQgEKsE=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\", ext=\"response-specific\"');
- done();
- });
-
- it('generates header (empty payload)', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1398546787',
- nonce: 'xUwusx',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
- id: '123456'
- };
-
- var header = Hawk.server.header(credentials, artifacts, { payload: '', contentType: 'text/plain', ext: 'response-specific' });
- expect(header).to.equal('Hawk mac=\"i8/kUBDx0QF+PpCtW860kkV/fa9dbwEoe/FpGUXowf0=\", hash=\"q/t+NNAkQZNlq/aAD6PlexImwQTxwgT2MahfTa9XRLA=\", ext=\"response-specific\"');
- done();
- });
-
- it('generates header (pre calculated hash)', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1398546787',
- nonce: 'xUwusx',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
- id: '123456'
- };
-
- var options = { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' };
- options.hash = Hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
- var header = Hawk.server.header(credentials, artifacts, options);
- expect(header).to.equal('Hawk mac=\"n14wVJK4cOxAytPUMc5bPezQzuJGl5n7MYXhFQgEKsE=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\", ext=\"response-specific\"');
- done();
- });
-
- it('generates header (null ext)', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1398546787',
- nonce: 'xUwusx',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
- id: '123456'
- };
-
- var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: null });
- expect(header).to.equal('Hawk mac=\"6PrybJTJs20jsgBw5eilXpcytD8kUbaIKNYXL+6g0ns=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\"');
- done();
- });
-
- it('errors on missing artifacts', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var header = Hawk.server.header(credentials, null, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(header).to.equal('');
- done();
- });
-
- it('errors on invalid artifacts', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var header = Hawk.server.header(credentials, 5, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(header).to.equal('');
- done();
- });
-
- it('errors on missing credentials', function (done) {
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1398546787',
- nonce: 'xUwusx',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
- id: '123456'
- };
-
- var header = Hawk.server.header(null, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(header).to.equal('');
- done();
- });
-
- it('errors on invalid credentials (key)', function (done) {
-
- var credentials = {
- id: '123456',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1398546787',
- nonce: 'xUwusx',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
- id: '123456'
- };
-
- var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(header).to.equal('');
- done();
- });
-
- it('errors on invalid algorithm', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'x',
- user: 'steve'
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1398546787',
- nonce: 'xUwusx',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
- id: '123456'
- };
-
- var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(header).to.equal('');
- done();
- });
- });
-
- describe('#authenticateMessage', function () {
-
- it('errors on invalid authorization (ts)', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- delete auth.ts;
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid authorization');
- done();
- });
- });
- });
-
- it('errors on invalid authorization (nonce)', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- delete auth.nonce;
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid authorization');
- done();
- });
- });
- });
-
- it('errors on invalid authorization (hash)', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- delete auth.hash;
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid authorization');
- done();
- });
- });
- });
-
- it('errors with credentials', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, function (id, callback) { callback(new Error('something'), { some: 'value' }); }, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('something');
- expect(credentials.some).to.equal('value');
- done();
- });
- });
- });
- });
-
- describe('#authenticatePayloadHash', function () {
-
- it('checks payload hash', function (done) {
-
- expect(Hawk.server.authenticatePayloadHash('abcdefg', { hash: 'abcdefg' })).to.equal(true);
- expect(Hawk.server.authenticatePayloadHash('1234567', { hash: 'abcdefg' })).to.equal(false);
- done();
- });
- });
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/uri.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/uri.js b/node_modules/request/node_modules/hawk/test/uri.js
deleted file mode 100755
index e64b009..0000000
--- a/node_modules/request/node_modules/hawk/test/uri.js
+++ /dev/null
@@ -1,590 +0,0 @@
-// Load modules
-
-var Http = require('http');
-var Url = require('url');
-var Code = require('code');
-var Hawk = require('../lib');
-var Hoek = require('hoek');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- describe('Uri', function () {
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- id: id,
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- it('should generate a bewit then successfully authenticate it', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?a=1&b=2',
- host: 'example.com',
- port: 80
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- var bewit = Hawk.uri.getBewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100, ext: 'some-app-data' });
- req.url += '&bewit=' + bewit;
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(attributes.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('should generate a bewit then successfully authenticate it (no ext)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?a=1&b=2',
- host: 'example.com',
- port: 80
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- var bewit = Hawk.uri.getBewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100 });
- req.url += '&bewit=' + bewit;
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
- });
-
- it('should successfully authenticate a request (last param)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?a=1&b=2&bewit=MTIzNDU2XDQ1MTE0ODQ2MjFcMzFjMmNkbUJFd1NJRVZDOVkva1NFb2c3d3YrdEVNWjZ3RXNmOGNHU2FXQT1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(attributes.ext).to.equal('some-app-data');
- done();
- });
- });
-
- it('should successfully authenticate a request (first param)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2MjFcMzFjMmNkbUJFd1NJRVZDOVkva1NFb2c3d3YrdEVNWjZ3RXNmOGNHU2FXQT1cc29tZS1hcHAtZGF0YQ&a=1&b=2',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(attributes.ext).to.equal('some-app-data');
- done();
- });
- });
-
- it('should successfully authenticate a request (only param)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2NDFcZm1CdkNWT3MvcElOTUUxSTIwbWhrejQ3UnBwTmo4Y1VrSHpQd3Q5OXJ1cz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(attributes.ext).to.equal('some-app-data');
- done();
- });
- });
-
- it('should fail on multiple authentication', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2NDFcZm1CdkNWT3MvcElOTUUxSTIwbWhrejQ3UnBwTmo4Y1VrSHpQd3Q5OXJ1cz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080,
- authorization: 'Basic asdasdasdasd'
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Multiple authentications');
- done();
- });
- });
-
- it('should fail on method other than GET', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- var exp = Math.floor(Hawk.utils.now() / 1000) + 60;
- var ext = 'some-app-data';
- var mac = Hawk.crypto.calculateMac('bewit', credentials, {
- timestamp: exp,
- nonce: '',
- method: req.method,
- resource: req.url,
- host: req.host,
- port: req.port,
- ext: ext
- });
-
- var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + ext;
-
- req.url += '&bewit=' + Hoek.base64urlEncode(bewit);
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid method');
- done();
- });
- });
- });
-
- it('should fail on invalid host header', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
- headers: {
- host: 'example.com:something'
- }
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid Host header');
- done();
- });
- });
-
- it('should fail on empty bewit', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Empty bewit');
- expect(err.isMissing).to.not.exist();
- done();
- });
- });
-
- it('should fail on invalid bewit', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=*',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid bewit encoding');
- expect(err.isMissing).to.not.exist();
- done();
- });
- });
-
- it('should fail on missing bewit', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.not.exist();
- expect(err.isMissing).to.equal(true);
- done();
- });
- });
-
- it('should fail on invalid bewit structure', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=abc',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Invalid bewit structure');
- done();
- });
- });
-
- it('should fail on empty bewit attribute', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=YVxcY1xk',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Missing bewit attributes');
- done();
- });
- });
-
- it('should fail on missing bewit id attribute', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=XDQ1NTIxNDc2MjJcK0JFbFhQMXhuWjcvd1Nrbm1ldGhlZm5vUTNHVjZNSlFVRHk4NWpTZVJ4VT1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Missing bewit attributes');
- done();
- });
- });
-
- it('should fail on expired access', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?a=1&b=2&bewit=MTIzNDU2XDEzNTY0MTg1ODNcWk1wZlMwWU5KNHV0WHpOMmRucTRydEk3NXNXTjFjeWVITTcrL0tNZFdVQT1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Access expired');
- done();
- });
- });
-
- it('should fail on credentials function error', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, function (id, callback) { callback(Hawk.error.badRequest('Boom')); }, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Boom');
- done();
- });
- });
-
- it('should fail on credentials function error with credentials', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, function (id, callback) { callback(Hawk.error.badRequest('Boom'), { some: 'value' }); }, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Boom');
- expect(credentials.some).to.equal('value');
- done();
- });
- });
-
- it('should fail on null credentials function response', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, function (id, callback) { callback(null, null); }, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Unknown credentials');
- done();
- });
- });
-
- it('should fail on invalid credentials function response', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, function (id, callback) { callback(null, {}); }, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid credentials');
- done();
- });
- });
-
- it('should fail on invalid credentials function response (unknown algorithm)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, function (id, callback) { callback(null, { key: 'xxx', algorithm: 'xxx' }); }, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Unknown algorithm');
- done();
- });
- });
-
- it('should fail on expired access', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
- host: 'example.com',
- port: 8080
- };
-
- Hawk.uri.authenticate(req, function (id, callback) { callback(null, { key: 'xxx', algorithm: 'sha256' }); }, {}, function (err, credentials, attributes) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Bad mac');
- done();
- });
- });
- });
-
- describe('#getBewit', function () {
-
- it('returns a valid bewit value', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdca3NjeHdOUjJ0SnBQMVQxekRMTlBiQjVVaUtJVTl0T1NKWFRVZEc3WDloOD1ceGFuZHlhbmR6');
- done();
- });
-
- it('returns a valid bewit value (explicit port)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com:8080/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcaFpiSjNQMmNLRW80a3kwQzhqa1pBa1J5Q1p1ZWc0V1NOYnhWN3ZxM3hIVT1ceGFuZHlhbmR6');
- done();
- });
-
- it('returns a valid bewit value (null ext)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: null });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcSUdZbUxnSXFMckNlOEN4dktQczRKbFdJQStValdKSm91d2dBUmlWaENBZz1c');
- done();
- });
-
- it('returns a valid bewit value (parsed uri)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit(Url.parse('https://example.com/somewhere/over/the/rainbow'), { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdca3NjeHdOUjJ0SnBQMVQxekRMTlBiQjVVaUtJVTl0T1NKWFRVZEc3WDloOD1ceGFuZHlhbmR6');
- done();
- });
-
- it('errors on invalid options', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', 4);
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on missing uri', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit('', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid uri', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit(5, { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid credentials (id)', function (done) {
-
- var credentials = {
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on missing credentials', function (done) {
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { ttlSec: 3000, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid credentials (key)', function (done) {
-
- var credentials = {
- id: '123456',
- algorithm: 'sha256'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid algorithm', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'hmac-sha-0'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on missing options', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'hmac-sha-0'
- };
-
- var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow');
- expect(bewit).to.equal('');
- done();
- });
- });
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/utils.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/utils.js b/node_modules/request/node_modules/hawk/test/utils.js
deleted file mode 100755
index 9ccda8b..0000000
--- a/node_modules/request/node_modules/hawk/test/utils.js
+++ /dev/null
@@ -1,120 +0,0 @@
-// Load modules
-
-var Code = require('code');
-var Hawk = require('../lib');
-var Lab = require('lab');
-var Package = require('../package.json');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- describe('Utils', function () {
-
- describe('#parseHost', function () {
-
- it('returns port 80 for non tls node request', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(80);
- done();
- });
-
- it('returns port 443 for non tls node request', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com',
- 'content-type': 'text/plain;x=y'
- },
- connection: {
- encrypted: true
- }
- };
-
- expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(443);
- done();
- });
-
- it('returns port 443 for non tls node request (IPv6)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: '[123:123:123]',
- 'content-type': 'text/plain;x=y'
- },
- connection: {
- encrypted: true
- }
- };
-
- expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(443);
- done();
- });
-
- it('parses IPv6 headers', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: '[123:123:123]:8000',
- 'content-type': 'text/plain;x=y'
- },
- connection: {
- encrypted: true
- }
- };
-
- var host = Hawk.utils.parseHost(req, 'Host');
- expect(host.port).to.equal('8000');
- expect(host.name).to.equal('[123:123:123]');
- done();
- });
- });
-
- describe('#version', function () {
-
- it('returns the correct package version number', function (done) {
-
- expect(Hawk.utils.version()).to.equal(Package.version);
- done();
- });
- });
-
- describe('#unauthorized', function () {
-
- it('returns a hawk 401', function (done) {
-
- expect(Hawk.utils.unauthorized('kaboom').output.headers['WWW-Authenticate']).to.equal('Hawk error="kaboom"');
- done();
- });
- });
- });
-});
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/.dir-locals.el
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/.dir-locals.el b/node_modules/request/node_modules/http-signature/.dir-locals.el
deleted file mode 100644
index 3bc9235..0000000
--- a/node_modules/request/node_modules/http-signature/.dir-locals.el
+++ /dev/null
@@ -1,6 +0,0 @@
-((nil . ((indent-tabs-mode . nil)
- (tab-width . 8)
- (fill-column . 80)))
- (js-mode . ((js-indent-level . 2)
- (indent-tabs-mode . nil)
- )))
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/.npmignore b/node_modules/request/node_modules/http-signature/.npmignore
deleted file mode 100644
index c143fb3..0000000
--- a/node_modules/request/node_modules/http-signature/.npmignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.gitmodules
-deps
-docs
-Makefile
-node_modules
-test
-tools
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/LICENSE b/node_modules/request/node_modules/http-signature/LICENSE
deleted file mode 100644
index f6d947d..0000000
--- a/node_modules/request/node_modules/http-signature/LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-Copyright Joyent, Inc. All rights reserved.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/README.md b/node_modules/request/node_modules/http-signature/README.md
deleted file mode 100644
index de487d3..0000000
--- a/node_modules/request/node_modules/http-signature/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# node-http-signature
-
-node-http-signature is a node.js library that has client and server components
-for Joyent's [HTTP Signature Scheme](http_signing.md).
-
-## Usage
-
-Note the example below signs a request with the same key/cert used to start an
-HTTP server. This is almost certainly not what you actually want, but is just
-used to illustrate the API calls; you will need to provide your own key
-management in addition to this library.
-
-### Client
-
-```js
-var fs = require('fs');
-var https = require('https');
-var httpSignature = require('http-signature');
-
-var key = fs.readFileSync('./key.pem', 'ascii');
-
-var options = {
- host: 'localhost',
- port: 8443,
- path: '/',
- method: 'GET',
- headers: {}
-};
-
-// Adds a 'Date' header in, signs it, and adds the
-// 'Authorization' header in.
-var req = https.request(options, function(res) {
- console.log(res.statusCode);
-});
-
-
-httpSignature.sign(req, {
- key: key,
- keyId: './cert.pem'
-});
-
-req.end();
-```
-
-### Server
-
-```js
-var fs = require('fs');
-var https = require('https');
-var httpSignature = require('http-signature');
-
-var options = {
- key: fs.readFileSync('./key.pem'),
- cert: fs.readFileSync('./cert.pem')
-};
-
-https.createServer(options, function (req, res) {
- var rc = 200;
- var parsed = httpSignature.parseRequest(req);
- var pub = fs.readFileSync(parsed.keyId, 'ascii');
- if (!httpSignature.verifySignature(parsed, pub))
- rc = 401;
-
- res.writeHead(rc);
- res.end();
-}).listen(8443);
-```
-
-## Installation
-
- npm install http-signature
-
-## License
-
-MIT.
-
-## Bugs
-
-See <https://github.com/joyent/node-http-signature/issues>.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/http_signing.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/http_signing.md b/node_modules/request/node_modules/http-signature/http_signing.md
deleted file mode 100644
index dd81ee5..0000000
--- a/node_modules/request/node_modules/http-signature/http_signing.md
+++ /dev/null
@@ -1,296 +0,0 @@
-# Abstract
-
-This document describes a way to add origin authentication, message integrity,
-and replay resistance to HTTP REST requests. It is intended to be used over
-the HTTPS protocol.
-
-# Copyright Notice
-
-Copyright (c) 2011 Joyent, Inc. and the persons identified as document authors.
-All rights reserved.
-
-Code Components extracted from this document must include MIT License text.
-
-# Introduction
-
-This protocol is intended to provide a standard way for clients to sign HTTP
-requests. RFC2617 (HTTP Authentication) defines Basic and Digest authentication
-mechanisms, and RFC5246 (TLS 1.2) defines client-auth, both of which are widely
-employed on the Internet today. However, it is common place that the burdens of
-PKI prevent web service operators from deploying that methodology, and so many
-fall back to Basic authentication, which has poor security characteristics.
-
-Additionally, OAuth provides a fully-specified alternative for authorization
-of web service requests, but is not (always) ideal for machine to machine
-communication, as the key acquisition steps (generally) imply a fixed
-infrastructure that may not make sense to a service provider (e.g., symmetric
-keys).
-
-Several web service providers have invented their own schemes for signing
-HTTP requests, but to date, none have been placed in the public domain as a
-standard. This document serves that purpose. There are no techniques in this
-proposal that are novel beyond previous art, however, this aims to be a simple
-mechanism for signing these requests.
-
-# Signature Authentication Scheme
-
-The "signature" authentication scheme is based on the model that the client must
-authenticate itself with a digital signature produced by either a private
-asymmetric key (e.g., RSA) or a shared symmetric key (e.g., HMAC). The scheme
-is parameterized enough such that it is not bound to any particular key type or
-signing algorithm. However, it does explicitly assume that clients can send an
-HTTP `Date` header.
-
-## Authorization Header
-
-The client is expected to send an Authorization header (as defined in RFC 2617)
-with the following parameterization:
-
- credentials := "Signature" params
- params := 1#(keyId | algorithm | [headers] | [ext] | signature)
- digitalSignature := plain-string
-
- keyId := "keyId" "=" <"> plain-string <">
- algorithm := "algorithm" "=" <"> plain-string <">
- headers := "headers" "=" <"> 1#headers-value <">
- ext := "ext" "=" <"> plain-string <">
- signature := "signature" "=" <"> plain-string <">
-
- headers-value := plain-string
- plain-string = 1*( %x20-21 / %x23-5B / %x5D-7E )
-
-### Signature Parameters
-
-#### keyId
-
-REQUIRED. The `keyId` field is an opaque string that the server can use to look
-up the component they need to validate the signature. It could be an SSH key
-fingerprint, an LDAP DN, etc. Management of keys and assignment of `keyId` is
-out of scope for this document.
-
-#### algorithm
-
-REQUIRED. The `algorithm` parameter is used if the client and server agree on a
-non-standard digital signature algorithm. The full list of supported signature
-mechanisms is listed below.
-
-#### headers
-
-OPTIONAL. The `headers` parameter is used to specify the list of HTTP headers
-used to sign the request. If specified, it should be a quoted list of HTTP
-header names, separated by a single space character. By default, only one
-HTTP header is signed, which is the `Date` header. Note that the list MUST be
-specified in the order the values are concatenated together during signing. To
-include the HTTP request line in the signature calculation, use the special
-`request-line` value. While this is overloading the definition of `headers` in
-HTTP linguism, the request-line is defined in RFC 2616, and as the outlier from
-headers in useful signature calculation, it is deemed simpler to simply use
-`request-line` than to add a separate parameter for it.
-
-#### extensions
-
-OPTIONAL. The `extensions` parameter is used to include additional information
-which is covered by the request. The content and format of the string is out of
-scope for this document, and expected to be specified by implementors.
-
-#### signature
-
-REQUIRED. The `signature` parameter is a `Base64` encoded digital signature
-generated by the client. The client uses the `algorithm` and `headers` request
-parameters to form a canonicalized `signing string`. This `signing string` is
-then signed with the key associated with `keyId` and the algorithm
-corresponding to `algorithm`. The `signature` parameter is then set to the
-`Base64` encoding of the signature.
-
-### Signing String Composition
-
-In order to generate the string that is signed with a key, the client MUST take
-the values of each HTTP header specified by `headers` in the order they appear.
-
-1. If the header name is not `request-line` then append the lowercased header
- name followed with an ASCII colon `:` and an ASCII space ` `.
-2. If the header name is `request-line` then append the HTTP request line,
- otherwise append the header value.
-3. If value is not the last value then append an ASCII newline `\n`. The string
- MUST NOT include a trailing ASCII newline.
-
-# Example Requests
-
-All requests refer to the following request (body omitted):
-
- POST /foo HTTP/1.1
- Host: example.org
- Date: Tue, 07 Jun 2011 20:51:35 GMT
- Content-Type: application/json
- Content-MD5: h0auK8hnYJKmHTLhKtMTkQ==
- Content-Length: 123
-
-The "rsa-key-1" keyId refers to a private key known to the client and a public
-key known to the server. The "hmac-key-1" keyId refers to key known to the
-client and server.
-
-## Default parameterization
-
-The authorization header and signature would be generated as:
-
- Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",signature="Base64(RSA-SHA256(signing string))"
-
-The client would compose the signing string as:
-
- date: Tue, 07 Jun 2011 20:51:35 GMT
-
-## Header List
-
-The authorization header and signature would be generated as:
-
- Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",headers="request-line date content-type content-md5",signature="Base64(RSA-SHA256(signing string))"
-
-The client would compose the signing string as (`+ "\n"` inserted for
-readability):
-
- POST /foo HTTP/1.1 + "\n"
- date: Tue, 07 Jun 2011 20:51:35 GMT + "\n"
- content-type: application/json + "\n"
- content-md5: h0auK8hnYJKmHTLhKtMTkQ==
-
-## Algorithm
-
-The authorization header and signature would be generated as:
-
- Authorization: Signature keyId="hmac-key-1",algorithm="hmac-sha1",signature="Base64(HMAC-SHA1(signing string))"
-
-The client would compose the signing string as:
-
- date: Tue, 07 Jun 2011 20:51:35 GMT
-
-# Signing Algorithms
-
-Currently supported algorithm names are:
-
-* rsa-sha1
-* rsa-sha256
-* rsa-sha512
-* dsa-sha1
-* hmac-sha1
-* hmac-sha256
-* hmac-sha512
-
-# Security Considerations
-
-## Default Parameters
-
-Note the default parameterization of the `Signature` scheme is only safe if all
-requests are carried over a secure transport (i.e., TLS). Sending the default
-scheme over a non-secure transport will leave the request vulnerable to
-spoofing, tampering, replay/repudiation, and integrity violations (if using the
-STRIDE threat-modeling methodology).
-
-## Insecure Transports
-
-If sending the request over plain HTTP, service providers SHOULD require clients
-to sign ALL HTTP headers, and the `request-line`. Additionally, service
-providers SHOULD require `Content-MD5` calculations to be performed to ensure
-against any tampering from clients.
-
-## Nonces
-
-Nonces are out of scope for this document simply because many service providers
-fail to implement them correctly, or do not adopt security specifications
-because of the infrastructure complexity. Given the `header` parameterization,
-a service provider is fully enabled to add nonce semantics into this scheme by
-using something like an `x-request-nonce` header, and ensuring it is signed
-with the `Date` header.
-
-## Clock Skew
-
-As the default scheme is to sign the `Date` header, service providers SHOULD
-protect against logged replay attacks by enforcing a clock skew. The server
-SHOULD be synchronized with NTP, and the recommendation in this specification
-is to allow 300s of clock skew (in either direction).
-
-## Required Headers to Sign
-
-It is out of scope for this document to dictate what headers a service provider
-will want to enforce, but service providers SHOULD at minimum include the
-`Date` header.
-
-# References
-
-## Normative References
-
-* [RFC2616] Hypertext Transfer Protocol -- HTTP/1.1
-* [RFC2617] HTTP Authentication: Basic and Digest Access Authentication
-* [RFC5246] The Transport Layer Security (TLS) Protocol Version 1.2
-
-## Informative References
-
- Name: Mark Cavage (editor)
- Company: Joyent, Inc.
- Email: mark.cavage@joyent.com
- URI: http://www.joyent.com
-
-# Appendix A - Test Values
-
-The following test data uses the RSA (2048b) keys, which we will refer
-to as `keyId=Test` in the following samples:
-
- -----BEGIN PUBLIC KEY-----
- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3
- 6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6
- Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw
- oYi+1hqp1fIekaxsyQIDAQAB
- -----END PUBLIC KEY-----
-
- -----BEGIN RSA PRIVATE KEY-----
- MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF
- NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F
- UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB
- AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA
- QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK
- kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg
- f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u
- 412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc
- mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7
- kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA
- gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW
- G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI
- 7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==
- -----END RSA PRIVATE KEY-----
-
-And all examples use this request:
-
- POST /foo?param=value&pet=dog HTTP/1.1
- Host: example.com
- Date: Thu, 05 Jan 2012 21:31:40 GMT
- Content-Type: application/json
- Content-MD5: Sd/dVLAcvNLSq16eXua5uQ==
- Content-Length: 18
-
- {"hello": "world"}
-
-### Default
-
-The string to sign would be:
-
- date: Thu, 05 Jan 2012 21:31:40 GMT
-
-The Authorization header would be:
-
- Authorization: Signature keyId="Test",algorithm="rsa-sha256",signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htHFYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA="
-
-### All Headers
-
-Parameterized to include all headers, the string to sign would be (`+ "\n"`
-inserted for readability):
-
- POST /foo?param=value&pet=dog HTTP/1.1 + "\n"
- host: example.com + "\n"
- date: Thu, 05 Jan 2012 21:31:40 GMT + "\n"
- content-type: application/json + "\n"
- content-md5: Sd/dVLAcvNLSq16eXua5uQ== + "\n"
- content-length: 18
-
-The Authorization header would be:
-
- Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="request-line host date content-type content-md5 content-length",signature="H/AaTDkJvLELy4i1RujnKlS6dm8QWiJvEpn9cKRMi49kKF+mohZ15z1r+mF+XiKS5kOOscyS83olfBtsVhYjPg2Ei3/D9D4Mvb7bFm9IaLJgYTFFuQCghrKQQFPiqJN320emjHxFowpIm1BkstnEU7lktH/XdXVBo8a6Uteiztw="
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/http-signature/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/index.js b/node_modules/request/node_modules/http-signature/lib/index.js
deleted file mode 100644
index 217a5dd..0000000
--- a/node_modules/request/node_modules/http-signature/lib/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2011 Joyent, Inc. All rights reserved.
-
-var parser = require('./parser');
-var signer = require('./signer');
-var verify = require('./verify');
-var util = require('./util');
-
-
-
-///--- API
-
-module.exports = {
-
- parse: parser.parseRequest,
- parseRequest: parser.parseRequest,
-
- sign: signer.signRequest,
- signRequest: signer.signRequest,
-
- sshKeyToPEM: util.sshKeyToPEM,
- sshKeyFingerprint: util.fingerprint,
- pemToRsaSSHKey: util.pemToRsaSSHKey,
-
- verify: verify.verifySignature,
- verifySignature: verify.verifySignature
-};
[29/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js b/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js
deleted file mode 100644
index 551031f..0000000
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
- * mime-db
- * Copyright(c) 2014 Jonathan Ong
- * MIT Licensed
- */
-
-/**
- * Module exports.
- */
-
-module.exports = require('./db.json')
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
deleted file mode 100644
index f2b6767..0000000
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "name": "mime-db",
- "description": "Media Type Database",
- "version": "1.10.0",
- "contributors": [
- {
- "name": "Douglas Christopher Wilson",
- "email": "doug@somethingdoug.com"
- },
- {
- "name": "Jonathan Ong",
- "email": "me@jongleberry.com",
- "url": "http://jongleberry.com"
- },
- {
- "name": "Robert Kieffer",
- "email": "robert@broofa.com",
- "url": "http://github.com/broofa"
- }
- ],
- "license": "MIT",
- "keywords": [
- "mime",
- "db",
- "type",
- "types",
- "database",
- "charset",
- "charsets"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/jshttp/mime-db"
- },
- "devDependencies": {
- "bluebird": "~2.9.20",
- "co": "4.5.4",
- "cogent": "1.0.1",
- "csv-parse": "0.1.1",
- "gnode": "0.1.1",
- "istanbul": "0.3.9",
- "mocha": "1.21.5",
- "raw-body": "2.0.1",
- "stream-to-array": "2"
- },
- "files": [
- "HISTORY.md",
- "LICENSE",
- "README.md",
- "db.json",
- "index.js"
- ],
- "engines": {
- "node": ">= 0.6"
- },
- "scripts": {
- "build": "node scripts/build",
- "fetch": "gnode scripts/extensions && gnode scripts/types",
- "test": "mocha --reporter spec --bail --check-leaks test/",
- "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
- "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
- "update": "npm run fetch && npm run build"
- },
- "gitHead": "260552f9177fe78986b92699999f81999c7fe43c",
- "bugs": {
- "url": "https://github.com/jshttp/mime-db/issues"
- },
- "homepage": "https://github.com/jshttp/mime-db",
- "_id": "mime-db@1.10.0",
- "_shasum": "e6308063c758ebd12837874c3d1ea9170766b03b",
- "_from": "mime-db@>=1.10.0 <1.11.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
- },
- "maintainers": [
- {
- "name": "jongleberry",
- "email": "jonathanrichardong@gmail.com"
- },
- {
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
- }
- ],
- "dist": {
- "shasum": "e6308063c758ebd12837874c3d1ea9170766b03b",
- "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.10.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.10.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/mime-types/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/package.json b/node_modules/request/node_modules/mime-types/package.json
deleted file mode 100644
index 8896ffc..0000000
--- a/node_modules/request/node_modules/mime-types/package.json
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- "name": "mime-types",
- "description": "The ultimate javascript content-type utility.",
- "version": "2.0.12",
- "contributors": [
- {
- "name": "Douglas Christopher Wilson",
- "email": "doug@somethingdoug.com"
- },
- {
- "name": "Jeremiah Senkpiel",
- "email": "fishrock123@rocketmail.com",
- "url": "https://searchbeam.jit.su"
- },
- {
- "name": "Jonathan Ong",
- "email": "me@jongleberry.com",
- "url": "http://jongleberry.com"
- }
- ],
- "license": "MIT",
- "keywords": [
- "mime",
- "types"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/jshttp/mime-types"
- },
- "dependencies": {
- "mime-db": "~1.10.0"
- },
- "devDependencies": {
- "istanbul": "0.3.9",
- "mocha": "~1.21.5"
- },
- "files": [
- "HISTORY.md",
- "LICENSE",
- "index.js"
- ],
- "engines": {
- "node": ">= 0.6"
- },
- "scripts": {
- "test": "mocha --reporter spec test/test.js",
- "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
- "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
- },
- "gitHead": "a1e3c4b6bbb6afb615c8a058481d58cb57a4cb95",
- "bugs": {
- "url": "https://github.com/jshttp/mime-types/issues"
- },
- "homepage": "https://github.com/jshttp/mime-types",
- "_id": "mime-types@2.0.12",
- "_shasum": "87ae9f124e94f8e440c93d1a72d0dccecdb71135",
- "_from": "mime-types@>=2.0.1 <2.1.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
- },
- "maintainers": [
- {
- "name": "jongleberry",
- "email": "jonathanrichardong@gmail.com"
- },
- {
- "name": "fishrock123",
- "email": "fishrock123@rocketmail.com"
- },
- {
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
- }
- ],
- "dist": {
- "shasum": "87ae9f124e94f8e440c93d1a72d0dccecdb71135",
- "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.12.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.12.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/.npmignore b/node_modules/request/node_modules/node-uuid/.npmignore
deleted file mode 100644
index fd4f2b0..0000000
--- a/node_modules/request/node_modules/node-uuid/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-.DS_Store
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/LICENSE.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/LICENSE.md b/node_modules/request/node_modules/node-uuid/LICENSE.md
deleted file mode 100644
index 652609b..0000000
--- a/node_modules/request/node_modules/node-uuid/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2010-2012 Robert Kieffer
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/README.md b/node_modules/request/node_modules/node-uuid/README.md
deleted file mode 100644
index b7d04c9..0000000
--- a/node_modules/request/node_modules/node-uuid/README.md
+++ /dev/null
@@ -1,243 +0,0 @@
-# node-uuid
-
-Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.
-
-Features:
-
-* Generate RFC4122 version 1 or version 4 UUIDs
-* Runs in node.js and all browsers.
-* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').
-* Cryptographically strong random # generation on supporting platforms
-* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )
-* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)
-* Comes with a Command Line Interface for generating uuids on the command line
-
-## Getting Started
-
-Install it in your browser:
-
-```html
-<script src="uuid.js"></script>
-```
-
-Or in node.js:
-
-```
-npm install node-uuid
-```
-
-```javascript
-var uuid = require('node-uuid');
-```
-
-Then create some ids ...
-
-```javascript
-// Generate a v1 (time-based) id
-uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
-
-// Generate a v4 (random) id
-uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'
-```
-
-## API
-
-### uuid.v1([`options` [, `buffer` [, `offset`]]])
-
-Generate and return a RFC4122 v1 (timestamp-based) UUID.
-
-* `options` - (Object) Optional uuid state to apply. Properties may include:
-
- * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.
- * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.
- * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.
- * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.
-
-* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
-* `offset` - (Number) Starting index in `buffer` at which to begin writing.
-
-Returns `buffer`, if specified, otherwise the string form of the UUID
-
-Notes:
-
-1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)
-
-Example: Generate string UUID with fully-specified options
-
-```javascript
-uuid.v1({
- node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
- clockseq: 0x1234,
- msecs: new Date('2011-11-01').getTime(),
- nsecs: 5678
-}); // -> "710b962e-041c-11e1-9234-0123456789ab"
-```
-
-Example: In-place generation of two binary IDs
-
-```javascript
-// Generate two ids in an array
-var arr = new Array(32); // -> []
-uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
-uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
-
-// Optionally use uuid.unparse() to get stringify the ids
-uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'
-uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'
-```
-
-### uuid.v4([`options` [, `buffer` [, `offset`]]])
-
-Generate and return a RFC4122 v4 UUID.
-
-* `options` - (Object) Optional uuid state to apply. Properties may include:
-
- * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values
- * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.
-
-* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
-* `offset` - (Number) Starting index in `buffer` at which to begin writing.
-
-Returns `buffer`, if specified, otherwise the string form of the UUID
-
-Example: Generate string UUID with fully-specified options
-
-```javascript
-uuid.v4({
- random: [
- 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
- 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
- ]
-});
-// -> "109156be-c4fb-41ea-b1b4-efe1671c5836"
-```
-
-Example: Generate two IDs in a single buffer
-
-```javascript
-var buffer = new Array(32); // (or 'new Buffer' in node.js)
-uuid.v4(null, buffer, 0);
-uuid.v4(null, buffer, 16);
-```
-
-### uuid.parse(id[, buffer[, offset]])
-### uuid.unparse(buffer[, offset])
-
-Parse and unparse UUIDs
-
- * `id` - (String) UUID(-like) string
- * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used
- * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0
-
-Example parsing and unparsing a UUID string
-
-```javascript
-var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>
-var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'
-```
-
-### uuid.noConflict()
-
-(Browsers only) Set `uuid` property back to it's previous value.
-
-Returns the node-uuid object.
-
-Example:
-
-```javascript
-var myUuid = uuid.noConflict();
-myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
-```
-
-## Deprecated APIs
-
-Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.
-
-### uuid([format [, buffer [, offset]]])
-
-uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).
-
-### uuid.BufferClass
-
-The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.
-
-## Command Line Interface
-
-To use the executable, it's probably best to install this library globally.
-
-`npm install -g node-uuid`
-
-Usage:
-
-```
-USAGE: uuid [version] [options]
-
-
-options:
-
---help Display this message and exit
-```
-
-`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by "v1" and "v4", respectively). `version` defaults to version 4 when not supplied.
-
-### Examples
-
-```
-> uuid
-3a91f950-dec8-4688-ba14-5b7bbfc7a563
-```
-
-```
-> uuid v1
-9d0b43e0-7696-11e3-964b-250efa37a98e
-```
-
-```
-> uuid v4
-6790ac7c-24ac-4f98-8464-42f6d98a53ae
-```
-
-## Testing
-
-In node.js
-
-```
-npm test
-```
-
-In Browser
-
-```
-open test/test.html
-```
-
-### Benchmarking
-
-Requires node.js
-
-```
-npm install uuid uuid-js
-node benchmark/benchmark.js
-```
-
-For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)
-
-For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).
-
-## Release notes
-
-### 1.4.0
-
-* Improved module context detection
-* Removed public RNG functions
-
-### 1.3.2
-
-* Improve tests and handling of v1() options (Issue #24)
-* Expose RNG option to allow for perf testing with different generators
-
-### 1.3.0
-
-* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
-* Support for node.js crypto API
-* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/benchmark/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/README.md b/node_modules/request/node_modules/node-uuid/benchmark/README.md
deleted file mode 100644
index aaeb2ea..0000000
--- a/node_modules/request/node_modules/node-uuid/benchmark/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# node-uuid Benchmarks
-
-### Results
-
-To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark
-
-### Run them yourself
-
-node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`.
-
-To prepare and run the benchmark issue;
-
-```
-npm install uuid uuid-js
-node benchmark/benchmark.js
-```
-
-You'll see an output like this one:
-
-```
-# v4
-nodeuuid.v4(): 854700 uuids/second
-nodeuuid.v4('binary'): 788643 uuids/second
-nodeuuid.v4('binary', buffer): 1336898 uuids/second
-uuid(): 479386 uuids/second
-uuid('binary'): 582072 uuids/second
-uuidjs.create(4): 312304 uuids/second
-
-# v1
-nodeuuid.v1(): 938086 uuids/second
-nodeuuid.v1('binary'): 683060 uuids/second
-nodeuuid.v1('binary', buffer): 1644736 uuids/second
-uuidjs.create(1): 190621 uuids/second
-```
-
-* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library.
-* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK.
-
-If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file:
-
-```
-for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done;
-```
-
-If you're interested in how performance varies between different node versions, you can issue the above command multiple times.
-
-You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot:
-
-```
-(cd benchmark/ && ./bench.sh)
-```
-
-This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu
deleted file mode 100644
index a342fbb..0000000
--- a/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/opt/local/bin/gnuplot -persist
-#
-#
-# G N U P L O T
-# Version 4.4 patchlevel 3
-# last modified March 2011
-# System: Darwin 10.8.0
-#
-# Copyright (C) 1986-1993, 1998, 2004, 2007-2010
-# Thomas Williams, Colin Kelley and many others
-#
-# gnuplot home: http://www.gnuplot.info
-# faq, bugs, etc: type "help seeking-assistance"
-# immediate help: type "help"
-# plot window: hit 'h'
-set terminal postscript eps noenhanced defaultplex \
- leveldefault color colortext \
- solid linewidth 1.2 butt noclip \
- palfuncparam 2000,0.003 \
- "Helvetica" 14
-set output 'bench.eps'
-unset clip points
-set clip one
-unset clip two
-set bar 1.000000 front
-set border 31 front linetype -1 linewidth 1.000
-set xdata
-set ydata
-set zdata
-set x2data
-set y2data
-set timefmt x "%d/%m/%y,%H:%M"
-set timefmt y "%d/%m/%y,%H:%M"
-set timefmt z "%d/%m/%y,%H:%M"
-set timefmt x2 "%d/%m/%y,%H:%M"
-set timefmt y2 "%d/%m/%y,%H:%M"
-set timefmt cb "%d/%m/%y,%H:%M"
-set boxwidth
-set style fill empty border
-set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1
-set style circle radius graph 0.02, first 0, 0
-set dummy x,y
-set format x "% g"
-set format y "% g"
-set format x2 "% g"
-set format y2 "% g"
-set format z "% g"
-set format cb "% g"
-set angles radians
-unset grid
-set key title ""
-set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox
-set key noinvert samplen 4 spacing 1 width 0 height 0
-set key maxcolumns 2 maxrows 0
-unset label
-unset arrow
-set style increment default
-unset style line
-set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0
-unset style arrow
-set style histogram clustered gap 2 title offset character 0, 0, 0
-unset logscale
-set offsets graph 0.05, 0.15, 0, 0
-set pointsize 1.5
-set pointintervalbox 1
-set encoding default
-unset polar
-unset parametric
-unset decimalsign
-set view 60, 30, 1, 1
-set samples 100, 100
-set isosamples 10, 10
-set surface
-unset contour
-set clabel '%8.3g'
-set mapping cartesian
-set datafile separator whitespace
-unset hidden3d
-set cntrparam order 4
-set cntrparam linear
-set cntrparam levels auto 5
-set cntrparam points 5
-set size ratio 0 1,1
-set origin 0,0
-set style data points
-set style function lines
-set xzeroaxis linetype -2 linewidth 1.000
-set yzeroaxis linetype -2 linewidth 1.000
-set zzeroaxis linetype -2 linewidth 1.000
-set x2zeroaxis linetype -2 linewidth 1.000
-set y2zeroaxis linetype -2 linewidth 1.000
-set ticslevel 0.5
-set mxtics default
-set mytics default
-set mztics default
-set mx2tics default
-set my2tics default
-set mcbtics default
-set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
-set xtics norangelimit
-set xtics ()
-set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
-set ytics autofreq norangelimit
-set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0
-set ztics autofreq norangelimit
-set nox2tics
-set noy2tics
-set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
-set cbtics autofreq norangelimit
-set title ""
-set title offset character 0, 0, 0 font "" norotate
-set timestamp bottom
-set timestamp ""
-set timestamp offset character 0, 0, 0 font "" norotate
-set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] )
-set autoscale rfixmin
-set autoscale rfixmax
-set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] )
-set autoscale tfixmin
-set autoscale tfixmax
-set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
-set autoscale ufixmin
-set autoscale ufixmax
-set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
-set autoscale vfixmin
-set autoscale vfixmax
-set xlabel ""
-set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate
-set x2label ""
-set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate
-set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] )
-set autoscale xfixmin
-set autoscale xfixmax
-set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] )
-set autoscale x2fixmin
-set autoscale x2fixmax
-set ylabel ""
-set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
-set y2label ""
-set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
-set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] )
-set autoscale yfixmin
-set autoscale yfixmax
-set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] )
-set autoscale y2fixmin
-set autoscale y2fixmax
-set zlabel ""
-set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate
-set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
-set autoscale zfixmin
-set autoscale zfixmax
-set cblabel ""
-set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
-set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] )
-set autoscale cbfixmin
-set autoscale cbfixmax
-set zero 1e-08
-set lmargin -1
-set bmargin -1
-set rmargin -1
-set tmargin -1
-set pm3d explicit at s
-set pm3d scansautomatic
-set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean
-set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
-set palette rgbformulae 7, 5, 15
-set colorbox default
-set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault
-set loadpath
-set fontpath
-set fit noerrorvariables
-GNUTERM = "aqua"
-plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2
-# EOF
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/benchmark/bench.sh
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/node_modules/request/node_modules/node-uuid/benchmark/bench.sh
deleted file mode 100755
index d870a0c..0000000
--- a/node_modules/request/node_modules/node-uuid/benchmark/bench.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-# for a given node version run:
-# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done;
-
-PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte')
-FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es)
-INDICES=(2 3 2 3 2 2 2 2 2)
-VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " )
-TMPJOIN="tmp_join"
-OUTPUT="bench_results.txt"
-
-for I in ${!FILES[*]}; do
- F=${FILES[$I]}
- P=${PATTERNS[$I]}
- INDEX=${INDICES[$I]}
- echo "version $F" > $F
- for V in $VERSIONS; do
- (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F
- done
- if [ $I == 0 ]; then
- cat $F > $TMPJOIN
- else
- join $TMPJOIN $F > $OUTPUT
- cp $OUTPUT $TMPJOIN
- fi
- rm $F
-done
-
-rm $TMPJOIN
-
-gnuplot bench.gnu
-convert -density 200 -resize 800x560 -flatten bench.eps bench.png
-rm bench.eps
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c
deleted file mode 100644
index dbfc75f..0000000
--- a/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-Test performance of native C UUID generation
-
-To Compile: cc -luuid benchmark-native.c -o benchmark-native
-*/
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <uuid/uuid.h>
-
-int main() {
- uuid_t myid;
- char buf[36+1];
- int i;
- struct timeval t;
- double start, finish;
-
- gettimeofday(&t, NULL);
- start = t.tv_sec + t.tv_usec/1e6;
-
- int n = 2e5;
- for (i = 0; i < n; i++) {
- uuid_generate(myid);
- uuid_unparse(myid, buf);
- }
-
- gettimeofday(&t, NULL);
- finish = t.tv_sec + t.tv_usec/1e6;
- double dur = finish - start;
-
- printf("%d uuids/sec", (int)(n/dur));
- return 0;
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js
deleted file mode 100644
index 40e6efb..0000000
--- a/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js
+++ /dev/null
@@ -1,84 +0,0 @@
-try {
- var nodeuuid = require('../uuid');
-} catch (e) {
- console.error('node-uuid require failed - skipping tests');
-}
-
-try {
- var uuid = require('uuid');
-} catch (e) {
- console.error('uuid require failed - skipping tests');
-}
-
-try {
- var uuidjs = require('uuid-js');
-} catch (e) {
- console.error('uuid-js require failed - skipping tests');
-}
-
-var N = 5e5;
-
-function rate(msg, t) {
- console.log(msg + ': ' +
- (N / (Date.now() - t) * 1e3 | 0) +
- ' uuids/second');
-}
-
-console.log('# v4');
-
-// node-uuid - string form
-if (nodeuuid) {
- for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4();
- rate('nodeuuid.v4() - using node.js crypto RNG', t);
-
- for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG});
- rate('nodeuuid.v4() - using Math.random() RNG', t);
-
- for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary');
- rate('nodeuuid.v4(\'binary\')', t);
-
- var buffer = new nodeuuid.BufferClass(16);
- for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer);
- rate('nodeuuid.v4(\'binary\', buffer)', t);
-}
-
-// libuuid - string form
-if (uuid) {
- for (var i = 0, t = Date.now(); i < N; i++) uuid();
- rate('uuid()', t);
-
- for (var i = 0, t = Date.now(); i < N; i++) uuid('binary');
- rate('uuid(\'binary\')', t);
-}
-
-// uuid-js - string form
-if (uuidjs) {
- for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4);
- rate('uuidjs.create(4)', t);
-}
-
-// 140byte.es
-for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)});
-rate('140byte.es_v4', t);
-
-console.log('');
-console.log('# v1');
-
-// node-uuid - v1 string form
-if (nodeuuid) {
- for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1();
- rate('nodeuuid.v1()', t);
-
- for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary');
- rate('nodeuuid.v1(\'binary\')', t);
-
- var buffer = new nodeuuid.BufferClass(16);
- for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer);
- rate('nodeuuid.v1(\'binary\', buffer)', t);
-}
-
-// uuid-js - v1 string form
-if (uuidjs) {
- for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1);
- rate('uuidjs.create(1)', t);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/bin/uuid
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/bin/uuid b/node_modules/request/node_modules/node-uuid/bin/uuid
deleted file mode 100755
index f732e99..0000000
--- a/node_modules/request/node_modules/node-uuid/bin/uuid
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env node
-
-var path = require('path');
-var uuid = require(path.join(__dirname, '..'));
-
-var arg = process.argv[2];
-
-if ('--help' === arg) {
- console.log('\n USAGE: uuid [version] [options]\n\n');
- console.log(' options:\n');
- console.log(' --help Display this message and exit\n');
- process.exit(0);
-}
-
-if (null == arg) {
- console.log(uuid());
- process.exit(0);
-}
-
-if ('v1' !== arg && 'v4' !== arg) {
- console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"');
- process.exit(1);
-}
-
-console.log(uuid[arg]());
-process.exit(0);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/bower.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/bower.json b/node_modules/request/node_modules/node-uuid/bower.json
deleted file mode 100644
index 1656dc8..0000000
--- a/node_modules/request/node_modules/node-uuid/bower.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "name": "node-uuid",
- "version": "1.4.3",
- "homepage": "https://github.com/broofa/node-uuid",
- "authors": [
- "Robert Kieffer <ro...@broofa.com>"
- ],
- "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
- "main": "uuid.js",
- "keywords": [
- "uuid",
- "gid",
- "rfc4122"
- ],
- "license": "MIT",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "tests"
- ]
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/component.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/component.json b/node_modules/request/node_modules/node-uuid/component.json
deleted file mode 100644
index 149f84b..0000000
--- a/node_modules/request/node_modules/node-uuid/component.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "node-uuid",
- "repo": "broofa/node-uuid",
- "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
- "version": "1.4.3",
- "author": "Robert Kieffer <ro...@broofa.com>",
- "contributors": [
- {"name": "Christoph Tavan <de...@tavan.de>", "github": "https://github.com/ctavan"}
- ],
- "keywords": ["uuid", "guid", "rfc4122"],
- "dependencies": {},
- "development": {},
- "main": "uuid.js",
- "scripts": [
- "uuid.js"
- ],
- "license": "MIT"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/package.json b/node_modules/request/node_modules/node-uuid/package.json
deleted file mode 100644
index a273d8f..0000000
--- a/node_modules/request/node_modules/node-uuid/package.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "name": "node-uuid",
- "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
- "url": "http://github.com/broofa/node-uuid",
- "keywords": [
- "uuid",
- "guid",
- "rfc4122"
- ],
- "author": {
- "name": "Robert Kieffer",
- "email": "robert@broofa.com"
- },
- "contributors": [
- {
- "name": "Christoph Tavan",
- "email": "dev@tavan.de"
- }
- ],
- "bin": {
- "uuid": "./bin/uuid"
- },
- "scripts": {
- "test": "node test/test.js"
- },
- "lib": ".",
- "main": "./uuid.js",
- "repository": {
- "type": "git",
- "url": "https://github.com/broofa/node-uuid.git"
- },
- "version": "1.4.3",
- "licenses": [
- {
- "type": "MIT",
- "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md"
- }
- ],
- "gitHead": "886463c660a095dfebfa69603921a8d156fdb12c",
- "bugs": {
- "url": "https://github.com/broofa/node-uuid/issues"
- },
- "homepage": "https://github.com/broofa/node-uuid",
- "_id": "node-uuid@1.4.3",
- "_shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9",
- "_from": "node-uuid@>=1.4.0 <1.5.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "broofa",
- "email": "robert@broofa.com"
- },
- "maintainers": [
- {
- "name": "broofa",
- "email": "robert@broofa.com"
- }
- ],
- "dist": {
- "shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9",
- "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/test/compare_v1.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/node_modules/request/node_modules/node-uuid/test/compare_v1.js
deleted file mode 100644
index 05af822..0000000
--- a/node_modules/request/node_modules/node-uuid/test/compare_v1.js
+++ /dev/null
@@ -1,63 +0,0 @@
-var assert = require('assert'),
- nodeuuid = require('../uuid'),
- uuidjs = require('uuid-js'),
- libuuid = require('uuid').generate,
- util = require('util'),
- exec = require('child_process').exec,
- os = require('os');
-
-// On Mac Os X / macports there's only the ossp-uuid package that provides uuid
-// On Linux there's uuid-runtime which provides uuidgen
-var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t';
-
-function compare(ids) {
- console.log(ids);
- for (var i = 0; i < ids.length; i++) {
- var id = ids[i].split('-');
- id = [id[2], id[1], id[0]].join('');
- ids[i] = id;
- }
- var sorted = ([].concat(ids)).sort();
-
- if (sorted.toString() !== ids.toString()) {
- console.log('Warning: sorted !== ids');
- } else {
- console.log('everything in order!');
- }
-}
-
-// Test time order of v1 uuids
-var ids = [];
-while (ids.length < 10e3) ids.push(nodeuuid.v1());
-
-var max = 10;
-console.log('node-uuid:');
-ids = [];
-for (var i = 0; i < max; i++) ids.push(nodeuuid.v1());
-compare(ids);
-
-console.log('');
-console.log('uuidjs:');
-ids = [];
-for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString());
-compare(ids);
-
-console.log('');
-console.log('libuuid:');
-ids = [];
-var count = 0;
-var last = function() {
- compare(ids);
-}
-var cb = function(err, stdout, stderr) {
- ids.push(stdout.substring(0, stdout.length-1));
- count++;
- if (count < max) {
- return next();
- }
- last();
-};
-var next = function() {
- exec(uuidCmd, cb);
-};
-next();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/test/test.html
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/test/test.html b/node_modules/request/node_modules/node-uuid/test/test.html
deleted file mode 100644
index d80326e..0000000
--- a/node_modules/request/node_modules/node-uuid/test/test.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<html>
- <head>
- <style>
- div {
- font-family: monospace;
- font-size: 8pt;
- }
- div.log {color: #444;}
- div.warn {color: #550;}
- div.error {color: #800; font-weight: bold;}
- </style>
- <script src="../uuid.js"></script>
- </head>
- <body>
- <script src="./test.js"></script>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/test/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/test/test.js b/node_modules/request/node_modules/node-uuid/test/test.js
deleted file mode 100644
index 2469225..0000000
--- a/node_modules/request/node_modules/node-uuid/test/test.js
+++ /dev/null
@@ -1,228 +0,0 @@
-if (!this.uuid) {
- // node.js
- uuid = require('../uuid');
-}
-
-//
-// x-platform log/assert shims
-//
-
-function _log(msg, type) {
- type = type || 'log';
-
- if (typeof(document) != 'undefined') {
- document.write('<div class="' + type + '">' + msg.replace(/\n/g, '<br />') + '</div>');
- }
- if (typeof(console) != 'undefined') {
- var color = {
- log: '\033[39m',
- warn: '\033[33m',
- error: '\033[31m'
- };
- console[type](color[type] + msg + color.log);
- }
-}
-
-function log(msg) {_log(msg, 'log');}
-function warn(msg) {_log(msg, 'warn');}
-function error(msg) {_log(msg, 'error');}
-
-function assert(res, msg) {
- if (!res) {
- error('FAIL: ' + msg);
- } else {
- log('Pass: ' + msg);
- }
-}
-
-//
-// Unit tests
-//
-
-// Verify ordering of v1 ids created with explicit times
-var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00
-
-function compare(name, ids) {
- ids = ids.map(function(id) {
- return id.split('-').reverse().join('-');
- }).sort();
- var sorted = ([].concat(ids)).sort();
-
- assert(sorted.toString() == ids.toString(), name + ' have expected order');
-}
-
-// Verify ordering of v1 ids created using default behavior
-compare('uuids with current time', [
- uuid.v1(),
- uuid.v1(),
- uuid.v1(),
- uuid.v1(),
- uuid.v1()
-]);
-
-// Verify ordering of v1 ids created with explicit times
-compare('uuids with time option', [
- uuid.v1({msecs: TIME - 10*3600*1000}),
- uuid.v1({msecs: TIME - 1}),
- uuid.v1({msecs: TIME}),
- uuid.v1({msecs: TIME + 1}),
- uuid.v1({msecs: TIME + 28*24*3600*1000})
-]);
-
-assert(
- uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}),
- 'IDs created at same msec are different'
-);
-
-// Verify throw if too many ids created
-var thrown = false;
-try {
- uuid.v1({msecs: TIME, nsecs: 10000});
-} catch (e) {
- thrown = true;
-}
-assert(thrown, 'Exception thrown when > 10K ids created in 1 ms');
-
-// Verify clock regression bumps clockseq
-var uidt = uuid.v1({msecs: TIME});
-var uidtb = uuid.v1({msecs: TIME - 1});
-assert(
- parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1,
- 'Clock regression by msec increments the clockseq'
-);
-
-// Verify clock regression bumps clockseq
-var uidtn = uuid.v1({msecs: TIME, nsecs: 10});
-var uidtnb = uuid.v1({msecs: TIME, nsecs: 9});
-assert(
- parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1,
- 'Clock regression by nsec increments the clockseq'
-);
-
-// Verify explicit options produce expected id
-var id = uuid.v1({
- msecs: 1321651533573,
- nsecs: 5432,
- clockseq: 0x385c,
- node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ]
-});
-assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id');
-
-// Verify adjacent ids across a msec boundary are 1 time unit apart
-var u0 = uuid.v1({msecs: TIME, nsecs: 9999});
-var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0});
-
-var before = u0.split('-')[0], after = u1.split('-')[0];
-var dt = parseInt(after, 16) - parseInt(before, 16);
-assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart');
-
-//
-// Test parse/unparse
-//
-
-id = '00112233445566778899aabbccddeeff';
-assert(uuid.unparse(uuid.parse(id.substr(0,10))) ==
- '00112233-4400-0000-0000-000000000000', 'Short parse');
-assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) ==
- '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse');
-
-//
-// Perf tests
-//
-
-var generators = {
- v1: uuid.v1,
- v4: uuid.v4
-};
-
-var UUID_FORMAT = {
- v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,
- v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i
-};
-
-var N = 1e4;
-
-// Get %'age an actual value differs from the ideal value
-function divergence(actual, ideal) {
- return Math.round(100*100*(actual - ideal)/ideal)/100;
-}
-
-function rate(msg, t) {
- log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second');
-}
-
-for (var version in generators) {
- var counts = {}, max = 0;
- var generator = generators[version];
- var format = UUID_FORMAT[version];
-
- log('\nSanity check ' + N + ' ' + version + ' uuids');
- for (var i = 0, ok = 0; i < N; i++) {
- id = generator();
- if (!format.test(id)) {
- throw Error(id + ' is not a valid UUID string');
- }
-
- if (id != uuid.unparse(uuid.parse(id))) {
- assert(fail, id + ' is not a valid id');
- }
-
- // Count digits for our randomness check
- if (version == 'v4') {
- var digits = id.replace(/-/g, '').split('');
- for (var j = digits.length-1; j >= 0; j--) {
- var c = digits[j];
- max = Math.max(max, counts[c] = (counts[c] || 0) + 1);
- }
- }
- }
-
- // Check randomness for v4 UUIDs
- if (version == 'v4') {
- // Limit that we get worried about randomness. (Purely empirical choice, this!)
- var limit = 2*100*Math.sqrt(1/N);
-
- log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)');
-
- for (var i = 0; i < 16; i++) {
- var c = i.toString(16);
- var bar = '', n = counts[c], p = Math.round(n/max*100|0);
-
- // 1-3,5-8, and D-F: 1:16 odds over 30 digits
- var ideal = N*30/16;
- if (i == 4) {
- // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits
- ideal = N*(1 + 30/16);
- } else if (i >= 8 && i <= 11) {
- // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits
- ideal = N*(1/4 + 30/16);
- } else {
- // Otherwise: 1:16 odds on 30 digits
- ideal = N*30/16;
- }
- var d = divergence(n, ideal);
-
- // Draw bar using UTF squares (just for grins)
- var s = n/max*50 | 0;
- while (s--) bar += '=';
-
- assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)');
- }
- }
-}
-
-// Perf tests
-for (var version in generators) {
- log('\nPerformance testing ' + version + ' UUIDs');
- var generator = generators[version];
- var buf = new uuid.BufferClass(16);
-
- for (var i = 0, t = Date.now(); i < N; i++) generator();
- rate('uuid.' + version + '()', t);
-
- for (var i = 0, t = Date.now(); i < N; i++) generator('binary');
- rate('uuid.' + version + '(\'binary\')', t);
-
- for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf);
- rate('uuid.' + version + '(\'binary\', buffer)', t);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/node-uuid/uuid.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/node-uuid/uuid.js b/node_modules/request/node_modules/node-uuid/uuid.js
deleted file mode 100644
index 0a61769..0000000
--- a/node_modules/request/node_modules/node-uuid/uuid.js
+++ /dev/null
@@ -1,247 +0,0 @@
-// uuid.js
-//
-// Copyright (c) 2010-2012 Robert Kieffer
-// MIT License - http://opensource.org/licenses/mit-license.php
-
-(function() {
- var _global = this;
-
- // Unique ID creation requires a high quality random # generator. We feature
- // detect to determine the best RNG source, normalizing to a function that
- // returns 128-bits of randomness, since that's what's usually required
- var _rng;
-
- // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
- //
- // Moderately fast, high quality
- if (typeof(_global.require) == 'function') {
- try {
- var _rb = _global.require('crypto').randomBytes;
- _rng = _rb && function() {return _rb(16);};
- } catch(e) {}
- }
-
- if (!_rng && _global.crypto && crypto.getRandomValues) {
- // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
- //
- // Moderately fast, high quality
- var _rnds8 = new Uint8Array(16);
- _rng = function whatwgRNG() {
- crypto.getRandomValues(_rnds8);
- return _rnds8;
- };
- }
-
- if (!_rng) {
- // Math.random()-based (RNG)
- //
- // If all else fails, use Math.random(). It's fast, but is of unspecified
- // quality.
- var _rnds = new Array(16);
- _rng = function() {
- for (var i = 0, r; i < 16; i++) {
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
- _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
- }
-
- return _rnds;
- };
- }
-
- // Buffer class to use
- var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array;
-
- // Maps for number <-> hex string conversion
- var _byteToHex = [];
- var _hexToByte = {};
- for (var i = 0; i < 256; i++) {
- _byteToHex[i] = (i + 0x100).toString(16).substr(1);
- _hexToByte[_byteToHex[i]] = i;
- }
-
- // **`parse()` - Parse a UUID into it's component bytes**
- function parse(s, buf, offset) {
- var i = (buf && offset) || 0, ii = 0;
-
- buf = buf || [];
- s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
- if (ii < 16) { // Don't overflow!
- buf[i + ii++] = _hexToByte[oct];
- }
- });
-
- // Zero out remaining bytes if string was short
- while (ii < 16) {
- buf[i + ii++] = 0;
- }
-
- return buf;
- }
-
- // **`unparse()` - Convert UUID byte array (ala parse()) into a string**
- function unparse(buf, offset) {
- var i = offset || 0, bth = _byteToHex;
- return bth[buf[i++]] + bth[buf[i++]] +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] + '-' +
- bth[buf[i++]] + bth[buf[i++]] +
- bth[buf[i++]] + bth[buf[i++]] +
- bth[buf[i++]] + bth[buf[i++]];
- }
-
- // **`v1()` - Generate time-based UUID**
- //
- // Inspired by https://github.com/LiosK/UUID.js
- // and http://docs.python.org/library/uuid.html
-
- // random #'s we need to init node and clockseq
- var _seedBytes = _rng();
-
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
- var _nodeId = [
- _seedBytes[0] | 0x01,
- _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
- ];
-
- // Per 4.2.2, randomize (14 bit) clockseq
- var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
-
- // Previous uuid creation time
- var _lastMSecs = 0, _lastNSecs = 0;
-
- // See https://github.com/broofa/node-uuid for API details
- function v1(options, buf, offset) {
- var i = buf && offset || 0;
- var b = buf || [];
-
- options = options || {};
-
- var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
-
- // UUID timestamps are 100 nano-second units since the Gregorian epoch,
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
- var msecs = options.msecs != null ? options.msecs : new Date().getTime();
-
- // Per 4.2.1.2, use count of uuid's generated during the current clock
- // cycle to simulate higher resolution clock
- var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
-
- // Time since last uuid creation (in msecs)
- var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
-
- // Per 4.2.1.2, Bump clockseq on clock regression
- if (dt < 0 && options.clockseq == null) {
- clockseq = clockseq + 1 & 0x3fff;
- }
-
- // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
- // time interval
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
- nsecs = 0;
- }
-
- // Per 4.2.1.2 Throw error if too many uuids are requested
- if (nsecs >= 10000) {
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
- }
-
- _lastMSecs = msecs;
- _lastNSecs = nsecs;
- _clockseq = clockseq;
-
- // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
- msecs += 12219292800000;
-
- // `time_low`
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
- b[i++] = tl >>> 24 & 0xff;
- b[i++] = tl >>> 16 & 0xff;
- b[i++] = tl >>> 8 & 0xff;
- b[i++] = tl & 0xff;
-
- // `time_mid`
- var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
- b[i++] = tmh >>> 8 & 0xff;
- b[i++] = tmh & 0xff;
-
- // `time_high_and_version`
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
- b[i++] = tmh >>> 16 & 0xff;
-
- // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
- b[i++] = clockseq >>> 8 | 0x80;
-
- // `clock_seq_low`
- b[i++] = clockseq & 0xff;
-
- // `node`
- var node = options.node || _nodeId;
- for (var n = 0; n < 6; n++) {
- b[i + n] = node[n];
- }
-
- return buf ? buf : unparse(b);
- }
-
- // **`v4()` - Generate random UUID**
-
- // See https://github.com/broofa/node-uuid for API details
- function v4(options, buf, offset) {
- // Deprecated - 'format' argument, as supported in v1.2
- var i = buf && offset || 0;
-
- if (typeof(options) == 'string') {
- buf = options == 'binary' ? new BufferClass(16) : null;
- options = null;
- }
- options = options || {};
-
- var rnds = options.random || (options.rng || _rng)();
-
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
-
- // Copy bytes to buffer, if provided
- if (buf) {
- for (var ii = 0; ii < 16; ii++) {
- buf[i + ii] = rnds[ii];
- }
- }
-
- return buf || unparse(rnds);
- }
-
- // Export public API
- var uuid = v4;
- uuid.v1 = v1;
- uuid.v4 = v4;
- uuid.parse = parse;
- uuid.unparse = unparse;
- uuid.BufferClass = BufferClass;
-
- if (typeof(module) != 'undefined' && module.exports) {
- // Publish as node.js module
- module.exports = uuid;
- } else if (typeof define === 'function' && define.amd) {
- // Publish as AMD module
- define(function() {return uuid;});
-
-
- } else {
- // Publish as global (in browsers)
- var _previousRoot = _global.uuid;
-
- // **`noConflict()` - (browser only) to reset global 'uuid' var**
- uuid.noConflict = function() {
- _global.uuid = _previousRoot;
- return uuid;
- };
-
- _global.uuid = uuid;
- }
-}).call(this);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/oauth-sign/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/oauth-sign/LICENSE b/node_modules/request/node_modules/oauth-sign/LICENSE
deleted file mode 100644
index a4a9aee..0000000
--- a/node_modules/request/node_modules/oauth-sign/LICENSE
+++ /dev/null
@@ -1,55 +0,0 @@
-Apache License
-
-Version 2.0, January 2004
-
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modi
fications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/oauth-sign/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/oauth-sign/README.md b/node_modules/request/node_modules/oauth-sign/README.md
deleted file mode 100644
index 34c4a85..0000000
--- a/node_modules/request/node_modules/oauth-sign/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-oauth-sign
-==========
-
-OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/oauth-sign/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/request/node_modules/oauth-sign/index.js
deleted file mode 100644
index 63b418c..0000000
--- a/node_modules/request/node_modules/oauth-sign/index.js
+++ /dev/null
@@ -1,131 +0,0 @@
-var crypto = require('crypto')
- , qs = require('querystring')
- ;
-
-function sha1 (key, body) {
- return crypto.createHmac('sha1', key).update(body).digest('base64')
-}
-
-function rsa (key, body) {
- return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64');
-}
-
-function rfc3986 (str) {
- return encodeURIComponent(str)
- .replace(/!/g,'%21')
- .replace(/\*/g,'%2A')
- .replace(/\(/g,'%28')
- .replace(/\)/g,'%29')
- .replace(/'/g,'%27')
- ;
-}
-
-// Maps object to bi-dimensional array
-// Converts { foo: 'A', bar: [ 'b', 'B' ]} to
-// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]
-function map (obj) {
- var key, val, arr = []
- for (key in obj) {
- val = obj[key]
- if (Array.isArray(val))
- for (var i = 0; i < val.length; i++)
- arr.push([key, val[i]])
- else
- arr.push([key, val])
- }
- return arr
-}
-
-// Compare function for sort
-function compare (a, b) {
- return a > b ? 1 : a < b ? -1 : 0
-}
-
-function generateBase (httpMethod, base_uri, params) {
- // adapted from https://dev.twitter.com/docs/auth/oauth and
- // https://dev.twitter.com/docs/auth/creating-signature
-
- // Parameter normalization
- // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
- var normalized = map(params)
- // 1. First, the name and value of each parameter are encoded
- .map(function (p) {
- return [ rfc3986(p[0]), rfc3986(p[1] || '') ]
- })
- // 2. The parameters are sorted by name, using ascending byte value
- // ordering. If two or more parameters share the same name, they
- // are sorted by their value.
- .sort(function (a, b) {
- return compare(a[0], b[0]) || compare(a[1], b[1])
- })
- // 3. The name of each parameter is concatenated to its corresponding
- // value using an "=" character (ASCII code 61) as a separator, even
- // if the value is empty.
- .map(function (p) { return p.join('=') })
- // 4. The sorted name/value pairs are concatenated together into a
- // single string by using an "&" character (ASCII code 38) as
- // separator.
- .join('&')
-
- var base = [
- rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),
- rfc3986(base_uri),
- rfc3986(normalized)
- ].join('&')
-
- return base
-}
-
-function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
- var base = generateBase(httpMethod, base_uri, params)
- var key = [
- consumer_secret || '',
- token_secret || ''
- ].map(rfc3986).join('&')
-
- return sha1(key, base)
-}
-
-function rsasign (httpMethod, base_uri, params, private_key, token_secret) {
- var base = generateBase(httpMethod, base_uri, params)
- var key = private_key || ''
-
- return rsa(key, base)
-}
-
-function plaintext (consumer_secret, token_secret) {
- var key = [
- consumer_secret || '',
- token_secret || ''
- ].map(rfc3986).join('&')
-
- return key
-}
-
-function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {
- var method
- var skipArgs = 1
-
- switch (signMethod) {
- case 'RSA-SHA1':
- method = rsasign
- break
- case 'HMAC-SHA1':
- method = hmacsign
- break
- case 'PLAINTEXT':
- method = plaintext
- skipArgs = 4
- break
- default:
- throw new Error("Signature method not supported: " + signMethod)
- }
-
- return method.apply(null, [].slice.call(arguments, skipArgs))
-}
-
-exports.hmacsign = hmacsign
-exports.rsasign = rsasign
-exports.plaintext = plaintext
-exports.sign = sign
-exports.rfc3986 = rfc3986
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/oauth-sign/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/request/node_modules/oauth-sign/package.json
deleted file mode 100644
index 019eff0..0000000
--- a/node_modules/request/node_modules/oauth-sign/package.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "author": {
- "name": "Mikeal Rogers",
- "email": "mikeal.rogers@gmail.com",
- "url": "http://www.futurealoof.com"
- },
- "name": "oauth-sign",
- "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
- "version": "0.6.0",
- "repository": {
- "url": "https://github.com/mikeal/oauth-sign"
- },
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {},
- "optionalDependencies": {},
- "engines": {
- "node": "*"
- },
- "scripts": {
- "test": "node test.js"
- },
- "gitHead": "f1b5d7714712ab7eec485cca9d18ae95db58aa6b",
- "bugs": {
- "url": "https://github.com/mikeal/oauth-sign/issues"
- },
- "homepage": "https://github.com/mikeal/oauth-sign",
- "_id": "oauth-sign@0.6.0",
- "_shasum": "7dbeae44f6ca454e1f168451d630746735813ce3",
- "_from": "oauth-sign@>=0.6.0 <0.7.0",
- "_npmVersion": "1.4.14",
- "_npmUser": {
- "name": "nylen",
- "email": "jnylen@gmail.com"
- },
- "maintainers": [
- {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- },
- {
- "name": "nylen",
- "email": "jnylen@gmail.com"
- }
- ],
- "dist": {
- "shasum": "7dbeae44f6ca454e1f168451d630746735813ce3",
- "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.6.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/oauth-sign/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/oauth-sign/test.js b/node_modules/request/node_modules/oauth-sign/test.js
deleted file mode 100644
index aea800b..0000000
--- a/node_modules/request/node_modules/oauth-sign/test.js
+++ /dev/null
@@ -1,74 +0,0 @@
-var oauth = require('./index')
- , hmacsign = oauth.hmacsign
- , assert = require('assert')
- , qs = require('querystring')
- ;
-
-// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth
-
-var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token',
- { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11'
- , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
- , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk'
- , oauth_signature_method: 'HMAC-SHA1'
- , oauth_timestamp: '1272323042'
- , oauth_version: '1.0'
- }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98")
-
-console.log(reqsign)
-console.log('8wUi7m5HFQy76nowoCThusfgB+Q=')
-assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=')
-
-var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token',
- { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
- , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8'
- , oauth_signature_method: 'HMAC-SHA1'
- , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc'
- , oauth_timestamp: '1272323047'
- , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY'
- , oauth_version: '1.0'
- }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA")
-
-console.log(accsign)
-console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
-assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
-
-var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json',
- { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g"
- , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y"
- , oauth_signature_method: "HMAC-SHA1"
- , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw"
- , oauth_timestamp: "1272325550"
- , oauth_version: "1.0"
- , status: 'setting up my twitter 私のさえずりを設定する'
- }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA")
-
-console.log(upsign)
-console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=')
-assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=')
-
-// example in rfc5849
-var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q')
-params.oauth_consumer_key = '9djdj82h48djs9d2'
-params.oauth_token = 'kkk9d7dh3k39sjv7'
-params.oauth_nonce = '7d8f3e4a'
-params.oauth_signature_method = 'HMAC-SHA1'
-params.oauth_timestamp = '137131201'
-
-var rfc5849sign = hmacsign('POST', 'http://example.com/request',
- params, "j49sk3j29djd", "dh893hdasih9")
-
-console.log(rfc5849sign)
-console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=')
-assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=')
-
-
-// PLAINTEXT
-
-var plainSign = oauth.sign('PLAINTEXT', 'GET', 'http://dummy.com', {}, 'consumer_secret', 'token_secret')
-console.log(plainSign)
-assert.equal(plainSign, 'consumer_secret&token_secret')
-
-plainSign = oauth.plaintext('consumer_secret', 'token_secret')
-console.log(plainSign)
-assert.equal(plainSign, 'consumer_secret&token_secret')
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/.jshintignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/.jshintignore b/node_modules/request/node_modules/qs/.jshintignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/request/node_modules/qs/.jshintignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/.jshintrc
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/.jshintrc b/node_modules/request/node_modules/qs/.jshintrc
deleted file mode 100644
index 997b3f7..0000000
--- a/node_modules/request/node_modules/qs/.jshintrc
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "node": true,
-
- "curly": true,
- "latedef": true,
- "quotmark": true,
- "undef": true,
- "unused": true,
- "trailing": true
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/.npmignore b/node_modules/request/node_modules/qs/.npmignore
deleted file mode 100644
index 7e1574d..0000000
--- a/node_modules/request/node_modules/qs/.npmignore
+++ /dev/null
@@ -1,18 +0,0 @@
-.idea
-*.iml
-npm-debug.log
-dump.rdb
-node_modules
-results.tap
-results.xml
-npm-shrinkwrap.json
-config.json
-.DS_Store
-*/.DS_Store
-*/*/.DS_Store
-._*
-*/._*
-*/*/._*
-coverage.*
-lib-cov
-complexity.md
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/.travis.yml b/node_modules/request/node_modules/qs/.travis.yml
deleted file mode 100644
index f502178..0000000
--- a/node_modules/request/node_modules/qs/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-
-node_js:
- - 0.10
- - 0.12
- - iojs
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/CHANGELOG.md b/node_modules/request/node_modules/qs/CHANGELOG.md
deleted file mode 100644
index 378370b..0000000
--- a/node_modules/request/node_modules/qs/CHANGELOG.md
+++ /dev/null
@@ -1,73 +0,0 @@
-
-## [**2.4.1**](https://github.com/hapijs/qs/issues?milestone=20&state=closed)
-- [**#73**](https://github.com/hapijs/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
-
-## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed)
-- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option
-
-## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=closed)
-- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57
-- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader
-
-## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed)
-- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object
-
-## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed)
-- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
-
-## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed)
-- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46
-
-## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed)
-- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer?
-- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45
-- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39
-
-## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed)
-- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number
-
-## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed)
-- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array
-- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
-
-## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed)
-- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value
-- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
-- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
-
-## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed)
-- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31
-- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects
-
-## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed)
-- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present
-- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays
-- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
-- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters?
-
-## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed)
-- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter
-
-## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed)
-- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit?
-- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit
-- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20
-
-## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed)
-- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values
-
-## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed)
-- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters
-- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block
-
-## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed)
-- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument
-- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
-
-## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed)
-- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted
-- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null
-- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README
-
-## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed)
-- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/CONTRIBUTING.md b/node_modules/request/node_modules/qs/CONTRIBUTING.md
deleted file mode 100644
index 8928361..0000000
--- a/node_modules/request/node_modules/qs/CONTRIBUTING.md
+++ /dev/null
@@ -1 +0,0 @@
-Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/LICENSE b/node_modules/request/node_modules/qs/LICENSE
deleted file mode 100755
index d456948..0000000
--- a/node_modules/request/node_modules/qs/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2014 Nathan LaFreniere and other contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * The names of any contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- * * *
-
-The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/Makefile b/node_modules/request/node_modules/qs/Makefile
deleted file mode 100644
index 31cc899..0000000
--- a/node_modules/request/node_modules/qs/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-test:
- @node node_modules/lab/bin/lab -a code -L
-test-cov:
- @node node_modules/lab/bin/lab -a code -t 100 -L
-test-cov-html:
- @node node_modules/lab/bin/lab -a code -L -r html -o coverage.html
-
-.PHONY: test test-cov test-cov-html
[36/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/client.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/client.js b/node_modules/request/node_modules/hawk/test/client.js
deleted file mode 100755
index 5983897..0000000
--- a/node_modules/request/node_modules/hawk/test/client.js
+++ /dev/null
@@ -1,443 +0,0 @@
-// Load modules
-
-var Url = require('url');
-var Code = require('code');
-var Hawk = require('../lib');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- describe('client', function () {
-
- describe('#header', function () {
-
- it('returns a valid authorization header (sha1)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var header = Hawk.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
- done();
- });
-
- it('returns a valid authorization header (sha256)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
- done();
- });
-
- it('returns a valid authorization header (no ext)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
- done();
- });
-
- it('returns a valid authorization header (null ext)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain', ext: null }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
- done();
- });
-
- it('returns a valid authorization header (empty payload)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: '', contentType: 'text/plain' }).field;
- expect(header).to.equal('Hawk id=\"123456\", ts=\"1353809207\", nonce=\"Ygvqdz\", hash=\"q/t+NNAkQZNlq/aAD6PlexImwQTxwgT2MahfTa9XRLA=\", mac=\"U5k16YEzn3UnBHKeBzsDXn067Gu3R4YaY6xOt9PYRZM=\"');
- done();
- });
-
- it('returns a valid authorization header (pre hashed payload)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var options = { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' };
- options.hash = Hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', options).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
- done();
- });
-
- it('errors on missing uri', function (done) {
-
- var header = Hawk.client.header('', 'POST');
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on invalid uri', function (done) {
-
- var header = Hawk.client.header(4, 'POST');
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on missing method', function (done) {
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', '');
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on invalid method', function (done) {
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 5);
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on missing options', function (done) {
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST');
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on invalid credentials (id)', function (done) {
-
- var credentials = {
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid credential object');
- done();
- });
-
- it('errors on missing credentials', function (done) {
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid credential object');
- done();
- });
-
- it('errors on invalid credentials', function (done) {
-
- var credentials = {
- id: '123456',
- algorithm: 'sha256'
- };
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid credential object');
- done();
- });
-
- it('errors on invalid algorithm', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'hmac-sha-0'
- };
-
- var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Unknown algorithm');
- done();
- });
- });
-
- describe('#authenticate', function () {
-
- it('returns false on invalid header', function (done) {
-
- var res = {
- headers: {
- 'server-authorization': 'Hawk mac="abc", bad="xyz"'
- }
- };
-
- expect(Hawk.client.authenticate(res, {})).to.equal(false);
- done();
- });
-
- it('returns false on invalid mac', function (done) {
-
- var res = {
- headers: {
- 'content-type': 'text/plain',
- 'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
- }
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1362336900',
- nonce: 'eb5S_L',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- app: undefined,
- dlg: undefined,
- mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
- id: '123456'
- };
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(false);
- done();
- });
-
- it('returns true on ignoring hash', function (done) {
-
- var res = {
- headers: {
- 'content-type': 'text/plain',
- 'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
- }
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1362336900',
- nonce: 'eb5S_L',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- app: undefined,
- dlg: undefined,
- mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
- id: '123456'
- };
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
- done();
- });
-
- it('fails on invalid WWW-Authenticate header format', function (done) {
-
- var header = 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"';
- expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(false);
- done();
- });
-
- it('fails on invalid WWW-Authenticate header format', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var header = 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"';
- expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, credentials)).to.equal(false);
- done();
- });
-
- it('skips tsm validation when missing ts', function (done) {
-
- var header = 'Hawk error="Stale timestamp"';
- expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(true);
- done();
- });
- });
-
- describe('#message', function () {
-
- it('generates authorization', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.exist();
- expect(auth.ts).to.equal(1353809207);
- expect(auth.nonce).to.equal('abc123');
- done();
- });
-
- it('errors on invalid host', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message(5, 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on invalid port', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', '80', 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on missing host', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 0, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on null message', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 80, null, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on missing message', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 80, undefined, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on invalid message', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 80, 5, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on missing options', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 80, 'I am the boodyman');
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on invalid credentials (id)', function (done) {
-
- var credentials = {
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on invalid credentials (key)', function (done) {
-
- var credentials = {
- id: '123456',
- algorithm: 'sha1'
- };
-
- var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
- expect(auth).to.not.exist();
- done();
- });
- });
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/crypto.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/crypto.js b/node_modules/request/node_modules/hawk/test/crypto.js
deleted file mode 100755
index f2d3d45..0000000
--- a/node_modules/request/node_modules/hawk/test/crypto.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Load modules
-
-var Code = require('code');
-var Hawk = require('../lib');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- describe('Crypto', function () {
-
- describe('#generateNormalizedString', function () {
-
- it('should return a valid normalized string', function (done) {
-
- expect(Hawk.crypto.generateNormalizedString('header', {
- credentials: {
- key: 'dasdfasdf',
- algorithm: 'sha256'
- },
- ts: 1357747017,
- nonce: 'k3k4j5',
- method: 'GET',
- resource: '/resource/something',
- host: 'example.com',
- port: 8080
- })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\n\n');
-
- done();
- });
-
- it('should return a valid normalized string (ext)', function (done) {
-
- expect(Hawk.crypto.generateNormalizedString('header', {
- credentials: {
- key: 'dasdfasdf',
- algorithm: 'sha256'
- },
- ts: 1357747017,
- nonce: 'k3k4j5',
- method: 'GET',
- resource: '/resource/something',
- host: 'example.com',
- port: 8080,
- ext: 'this is some app data'
- })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\nthis is some app data\n');
-
- done();
- });
-
- it('should return a valid normalized string (payload + ext)', function (done) {
-
- expect(Hawk.crypto.generateNormalizedString('header', {
- credentials: {
- key: 'dasdfasdf',
- algorithm: 'sha256'
- },
- ts: 1357747017,
- nonce: 'k3k4j5',
- method: 'GET',
- resource: '/resource/something',
- host: 'example.com',
- port: 8080,
- hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
- ext: 'this is some app data'
- })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\nU4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=\nthis is some app data\n');
-
- done();
- });
- });
- });
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/index.js b/node_modules/request/node_modules/hawk/test/index.js
deleted file mode 100755
index 39f2c5b..0000000
--- a/node_modules/request/node_modules/hawk/test/index.js
+++ /dev/null
@@ -1,378 +0,0 @@
-// Load modules
-
-var Url = require('url');
-var Code = require('code');
-var Hawk = require('../lib');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- id: id,
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: (id === '1' ? 'sha1' : 'sha256'),
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- it('generates a header then successfully parse it (configuration)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header(Url.parse('http://example.com:8080/resource/4?filter=a'), req.method, { credentials: credentials, ext: 'some-app-data' }).field;
- expect(req.authorization).to.exist();
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (node request)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (absolute request uri)', function (done) {
-
- var req = {
- method: 'POST',
- url: 'http://example.com:8080/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (no server header options)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
- done();
- });
- });
- });
-
- it('generates a header then fails to parse it (missing server header hash)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(false);
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (with hash)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it then validate payload', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload('hola!', credentials, artifacts)).to.be.true();
- expect(Hawk.server.authenticatePayload('hello!', credentials, artifacts)).to.be.false();
- done();
- });
- });
- });
-
- it('generates a header then successfully parses and validates payload', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
- Hawk.server.authenticate(req, credentialsFunc, { payload: 'hola!' }, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (app)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(artifacts.app).to.equal('asd23ased');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (app, dlg)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased', dlg: '23434szr3q4d' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(artifacts.app).to.equal('asd23ased');
- expect(artifacts.dlg).to.equal('23434szr3q4d');
- done();
- });
- });
- });
-
- it('generates a header then fail authentication due to bad hash', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
- Hawk.server.authenticate(req, credentialsFunc, { payload: 'byebye!' }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Bad payload hash');
- done();
- });
- });
- });
-
- it('generates a header for one resource then fail to authenticate another', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
- req.url = '/something/else';
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(credentials).to.exist();
- done();
- });
- });
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/message.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/message.js b/node_modules/request/node_modules/hawk/test/message.js
deleted file mode 100755
index b0494cc..0000000
--- a/node_modules/request/node_modules/hawk/test/message.js
+++ /dev/null
@@ -1,261 +0,0 @@
-// Load modules
-
-var Url = require('url');
-var Code = require('code');
-var Hawk = require('../lib');
-var Hoek = require('hoek');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- id: id,
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: (id === '1' ? 'sha1' : 'sha256'),
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- it('should generate an authorization then successfully parse it', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
- });
-
- it('should fail authorization on mismatching host', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- Hawk.server.authenticateMessage('example1.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Bad mac');
- done();
- });
- });
- });
-
- it('should fail authorization on stale timestamp', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { localtimeOffsetMsec: 100000 }, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Stale timestamp');
- done();
- });
- });
- });
-
- it('overrides timestampSkewSec', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials, localtimeOffsetMsec: 100000 });
- expect(auth).to.exist();
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { timestampSkewSec: 500 }, function (err, credentials) {
-
- expect(err).to.not.exist();
- done();
- });
- });
- });
-
- it('should fail authorization on invalid authorization', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
- delete auth.id;
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid authorization');
- done();
- });
- });
- });
-
- it('should fail authorization on bad hash', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message1', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Bad message hash');
- done();
- });
- });
- });
-
- it('should fail authorization on nonce error', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { nonceFunc: function (nonce, ts, callback) { callback (new Error('kaboom')); } }, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid nonce');
- done();
- });
- });
- });
-
- it('should fail authorization on credentials error', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- var errFunc = function (id, callback) {
-
- callback(new Error('kablooey'));
- };
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('kablooey');
- done();
- });
- });
- });
-
- it('should fail authorization on missing credentials', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- var errFunc = function (id, callback) {
-
- callback();
- };
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Unknown credentials');
- done();
- });
- });
- });
-
- it('should fail authorization on invalid credentials', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- var errFunc = function (id, callback) {
-
- callback(null, {});
- };
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Invalid credentials');
- done();
- });
- });
- });
-
- it('should fail authorization on invalid credentials algorithm', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- var errFunc = function (id, callback) {
-
- callback(null, { key: '123', algorithm: '456' });
- };
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Unknown algorithm');
- done();
- });
- });
- });
-
- it('should fail on missing host', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Hawk.client.message(null, 8080, 'some message', { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('should fail on missing credentials', function (done) {
-
- var auth = Hawk.client.message('example.com', 8080, 'some message', {});
- expect(auth).to.not.exist();
- done();
- });
-
- it('should fail on invalid algorithm', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var creds = Hoek.clone(credentials);
- creds.algorithm = 'blah';
- var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: creds });
- expect(auth).to.not.exist();
- done();
- });
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/readme.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/readme.js b/node_modules/request/node_modules/hawk/test/readme.js
deleted file mode 100755
index 60af199..0000000
--- a/node_modules/request/node_modules/hawk/test/readme.js
+++ /dev/null
@@ -1,98 +0,0 @@
-// Load modules
-
-var Code = require('code');
-var Hawk = require('../lib');
-var Hoek = require('hoek');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Hawk', function () {
-
- describe('README', function () {
-
- describe('core', function () {
-
- var credentials = {
- id: 'dh37fgj492je',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256'
- };
-
- var options = {
- credentials: credentials,
- timestamp: 1353832234,
- nonce: 'j4h3g2',
- ext: 'some-app-ext-data'
- };
-
- it('should generate a header protocol example', function (done) {
-
- var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', options).field;
-
- expect(header).to.equal('Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="');
- done();
- });
-
- it('should generate a normalized string protocol example', function (done) {
-
- var normalized = Hawk.crypto.generateNormalizedString('header', {
- credentials: credentials,
- ts: options.timestamp,
- nonce: options.nonce,
- method: 'GET',
- resource: '/resource?a=1&b=2',
- host: 'example.com',
- port: 8000,
- ext: options.ext
- });
-
- expect(normalized).to.equal('hawk.1.header\n1353832234\nj4h3g2\nGET\n/resource?a=1&b=2\nexample.com\n8000\n\nsome-app-ext-data\n');
- done();
- });
-
- var payloadOptions = Hoek.clone(options);
- payloadOptions.payload = 'Thank you for flying Hawk';
- payloadOptions.contentType = 'text/plain';
-
- it('should generate a header protocol example (with payload)', function (done) {
-
- var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'POST', payloadOptions).field;
-
- expect(header).to.equal('Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw="');
- done();
- });
-
- it('should generate a normalized string protocol example (with payload)', function (done) {
-
- var normalized = Hawk.crypto.generateNormalizedString('header', {
- credentials: credentials,
- ts: options.timestamp,
- nonce: options.nonce,
- method: 'POST',
- resource: '/resource?a=1&b=2',
- host: 'example.com',
- port: 8000,
- hash: Hawk.crypto.calculatePayloadHash(payloadOptions.payload, credentials.algorithm, payloadOptions.contentType),
- ext: options.ext
- });
-
- expect(normalized).to.equal('hawk.1.header\n1353832234\nj4h3g2\nPOST\n/resource?a=1&b=2\nexample.com\n8000\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\nsome-app-ext-data\n');
- done();
- });
- });
- });
-});
-
[08/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000..eb188df
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,210 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(Transform, Duplex);
+
+
+function TransformState(options, stream) {
+ this.afterTransform = function(er, data) {
+ return afterTransform(stream, er, data);
+ };
+
+ this.needTransform = false;
+ this.transforming = false;
+ this.writecb = null;
+ this.writechunk = null;
+}
+
+function afterTransform(stream, er, data) {
+ var ts = stream._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb)
+ return stream.emit('error', new Error('no writecb in Transform class'));
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (data !== null && data !== undefined)
+ stream.push(data);
+
+ if (cb)
+ cb(er);
+
+ var rs = stream._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ stream._read(rs.highWaterMark);
+ }
+}
+
+
+function Transform(options) {
+ if (!(this instanceof Transform))
+ return new Transform(options);
+
+ Duplex.call(this, options);
+
+ var ts = this._transformState = new TransformState(options, this);
+
+ // when the writable side finishes, then flush out anything remaining.
+ var stream = this;
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ this.once('finish', function() {
+ if ('function' === typeof this._flush)
+ this._flush(function(er) {
+ done(stream, er);
+ });
+ else
+ done(stream);
+ });
+}
+
+Transform.prototype.push = function(chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function(chunk, encoding, cb) {
+ throw new Error('not implemented');
+};
+
+Transform.prototype._write = function(chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform ||
+ rs.needReadable ||
+ rs.length < rs.highWaterMark)
+ this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function(n) {
+ var ts = this._transformState;
+
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+
+function done(stream, er) {
+ if (er)
+ return stream.emit('error', er);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ var ws = stream._writableState;
+ var rs = stream._readableState;
+ var ts = stream._transformState;
+
+ if (ws.length)
+ throw new Error('calling transform done when ws.length != 0');
+
+ if (ts.transforming)
+ throw new Error('calling transform done when still transforming');
+
+ return stream.push(null);
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000..4bdaa4f
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,386 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, cb), and it'll handle all
+// the drain event emission and buffering.
+
+module.exports = Writable;
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Stream = require('stream');
+
+util.inherits(Writable, Stream);
+
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+}
+
+function WritableState(options, stream) {
+ options = options || {};
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, becuase any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function(er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.buffer = [];
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+}
+
+function Writable(options) {
+ var Duplex = require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, though they're not
+ // instanceof Writable, they're instanceof Readable.
+ if (!(this instanceof Writable) && !(this instanceof Duplex))
+ return new Writable(options);
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function() {
+ this.emit('error', new Error('Cannot pipe. Not readable.'));
+};
+
+
+function writeAfterEnd(stream, state, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ process.nextTick(function() {
+ cb(er);
+ });
+}
+
+// If we get something that is not a buffer, string, null, or undefined,
+// and we're not in objectMode, then that's an error.
+// Otherwise stream chunks are all considered to be of length=1, and the
+// watermarks determine how many objects to keep in the buffer, rather than
+// how many bytes or characters.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+ if (!Buffer.isBuffer(chunk) &&
+ 'string' !== typeof chunk &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode) {
+ var er = new TypeError('Invalid non-string/buffer chunk');
+ stream.emit('error', er);
+ process.nextTick(function() {
+ cb(er);
+ });
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function(chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (Buffer.isBuffer(chunk))
+ encoding = 'buffer';
+ else if (!encoding)
+ encoding = state.defaultEncoding;
+
+ if (typeof cb !== 'function')
+ cb = function() {};
+
+ if (state.ended)
+ writeAfterEnd(this, state, cb);
+ else if (validChunk(this, state, chunk, cb))
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
+
+ return ret;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode &&
+ state.decodeStrings !== false &&
+ typeof chunk === 'string') {
+ chunk = new Buffer(chunk, encoding);
+ }
+ return chunk;
+}
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+ chunk = decodeChunk(state, chunk, encoding);
+ if (Buffer.isBuffer(chunk))
+ encoding = 'buffer';
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret)
+ state.needDrain = true;
+
+ if (state.writing)
+ state.buffer.push(new WriteReq(chunk, encoding, cb));
+ else
+ doWrite(stream, state, len, chunk, encoding, cb);
+
+ return ret;
+}
+
+function doWrite(stream, state, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ if (sync)
+ process.nextTick(function() {
+ cb(er);
+ });
+ else
+ cb(er);
+
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er)
+ onwriteError(stream, state, sync, er, cb);
+ else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(stream, state);
+
+ if (!finished && !state.bufferProcessing && state.buffer.length)
+ clearBuffer(stream, state);
+
+ if (sync) {
+ process.nextTick(function() {
+ afterWrite(stream, state, finished, cb);
+ });
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished)
+ onwriteDrain(stream, state);
+ cb();
+ if (finished)
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+
+ for (var c = 0; c < state.buffer.length; c++) {
+ var entry = state.buffer[c];
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, len, chunk, encoding, cb);
+
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ c++;
+ break;
+ }
+ }
+
+ state.bufferProcessing = false;
+ if (c < state.buffer.length)
+ state.buffer = state.buffer.slice(c);
+ else
+ state.buffer.length = 0;
+}
+
+Writable.prototype._write = function(chunk, encoding, cb) {
+ cb(new Error('not implemented'));
+};
+
+Writable.prototype.end = function(chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (typeof chunk !== 'undefined' && chunk !== null)
+ this.write(chunk, encoding);
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished)
+ endWritable(this, state, cb);
+};
+
+
+function needFinish(stream, state) {
+ return (state.ending &&
+ state.length === 0 &&
+ !state.finished &&
+ !state.writing);
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(stream, state);
+ if (need) {
+ state.finished = true;
+ stream.emit('finish');
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished)
+ process.nextTick(cb);
+ else
+ stream.once('finish', cb);
+ }
+ state.ended = true;
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
new file mode 100644
index 0000000..9074e8e
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
@@ -0,0 +1,107 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// NOTE: These type checking functions intentionally don't use `instanceof`
+// because it is fragile and can be easily faked with `Object.create()`.
+function isArray(ar) {
+ return Array.isArray(ar);
+}
+exports.isArray = isArray;
+
+function isBoolean(arg) {
+ return typeof arg === 'boolean';
+}
+exports.isBoolean = isBoolean;
+
+function isNull(arg) {
+ return arg === null;
+}
+exports.isNull = isNull;
+
+function isNullOrUndefined(arg) {
+ return arg == null;
+}
+exports.isNullOrUndefined = isNullOrUndefined;
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+exports.isNumber = isNumber;
+
+function isString(arg) {
+ return typeof arg === 'string';
+}
+exports.isString = isString;
+
+function isSymbol(arg) {
+ return typeof arg === 'symbol';
+}
+exports.isSymbol = isSymbol;
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+exports.isUndefined = isUndefined;
+
+function isRegExp(re) {
+ return isObject(re) && objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+ return isObject(d) && objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+ return isObject(e) &&
+ (objectToString(e) === '[object Error]' || e instanceof Error);
+}
+exports.isError = isError;
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+exports.isFunction = isFunction;
+
+function isPrimitive(arg) {
+ return arg === null ||
+ typeof arg === 'boolean' ||
+ typeof arg === 'number' ||
+ typeof arg === 'string' ||
+ typeof arg === 'symbol' || // ES6 symbol
+ typeof arg === 'undefined';
+}
+exports.isPrimitive = isPrimitive;
+
+function isBuffer(arg) {
+ return Buffer.isBuffer(arg);
+}
+exports.isBuffer = isBuffer;
+
+function objectToString(o) {
+ return Object.prototype.toString.call(o);
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/lib/combined_stream.js b/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
new file mode 100644
index 0000000..6b5c21b
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
@@ -0,0 +1,188 @@
+var util = require('util');
+var Stream = require('stream').Stream;
+var DelayedStream = require('delayed-stream');
+
+module.exports = CombinedStream;
+function CombinedStream() {
+ this.writable = false;
+ this.readable = true;
+ this.dataSize = 0;
+ this.maxDataSize = 2 * 1024 * 1024;
+ this.pauseStreams = true;
+
+ this._released = false;
+ this._streams = [];
+ this._currentStream = null;
+}
+util.inherits(CombinedStream, Stream);
+
+CombinedStream.create = function(options) {
+ var combinedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ combinedStream[option] = options[option];
+ }
+
+ return combinedStream;
+};
+
+CombinedStream.isStreamLike = function(stream) {
+ return (typeof stream !== 'function')
+ && (typeof stream !== 'string')
+ && (typeof stream !== 'boolean')
+ && (typeof stream !== 'number')
+ && (!Buffer.isBuffer(stream));
+};
+
+CombinedStream.prototype.append = function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+
+ if (isStreamLike) {
+ if (!(stream instanceof DelayedStream)) {
+ var newStream = DelayedStream.create(stream, {
+ maxDataSize: Infinity,
+ pauseStream: this.pauseStreams,
+ });
+ stream.on('data', this._checkDataSize.bind(this));
+ stream = newStream;
+ }
+
+ this._handleErrors(stream);
+
+ if (this.pauseStreams) {
+ stream.pause();
+ }
+ }
+
+ this._streams.push(stream);
+ return this;
+};
+
+CombinedStream.prototype.pipe = function(dest, options) {
+ Stream.prototype.pipe.call(this, dest, options);
+ this.resume();
+ return dest;
+};
+
+CombinedStream.prototype._getNext = function() {
+ this._currentStream = null;
+ var stream = this._streams.shift();
+
+
+ if (typeof stream == 'undefined') {
+ this.end();
+ return;
+ }
+
+ if (typeof stream !== 'function') {
+ this._pipeNext(stream);
+ return;
+ }
+
+ var getStream = stream;
+ getStream(function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('data', this._checkDataSize.bind(this));
+ this._handleErrors(stream);
+ }
+
+ this._pipeNext(stream);
+ }.bind(this));
+};
+
+CombinedStream.prototype._pipeNext = function(stream) {
+ this._currentStream = stream;
+
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('end', this._getNext.bind(this));
+ stream.pipe(this, {end: false});
+ return;
+ }
+
+ var value = stream;
+ this.write(value);
+ this._getNext();
+};
+
+CombinedStream.prototype._handleErrors = function(stream) {
+ var self = this;
+ stream.on('error', function(err) {
+ self._emitError(err);
+ });
+};
+
+CombinedStream.prototype.write = function(data) {
+ this.emit('data', data);
+};
+
+CombinedStream.prototype.pause = function() {
+ if (!this.pauseStreams) {
+ return;
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
+ this.emit('pause');
+};
+
+CombinedStream.prototype.resume = function() {
+ if (!this._released) {
+ this._released = true;
+ this.writable = true;
+ this._getNext();
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
+ this.emit('resume');
+};
+
+CombinedStream.prototype.end = function() {
+ this._reset();
+ this.emit('end');
+};
+
+CombinedStream.prototype.destroy = function() {
+ this._reset();
+ this.emit('close');
+};
+
+CombinedStream.prototype._reset = function() {
+ this.writable = false;
+ this._streams = [];
+ this._currentStream = null;
+};
+
+CombinedStream.prototype._checkDataSize = function() {
+ this._updateDataSize();
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
+ this._emitError(new Error(message));
+};
+
+CombinedStream.prototype._updateDataSize = function() {
+ this.dataSize = 0;
+
+ var self = this;
+ this._streams.forEach(function(stream) {
+ if (!stream.dataSize) {
+ return;
+ }
+
+ self.dataSize += stream.dataSize;
+ });
+
+ if (this._currentStream && this._currentStream.dataSize) {
+ this.dataSize += this._currentStream.dataSize;
+ }
+};
+
+CombinedStream.prototype._emitError = function(err) {
+ this._reset();
+ this.emit('error', err);
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
new file mode 100644
index 0000000..7c10d48
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
@@ -0,0 +1,99 @@
+var Stream = require('stream').Stream;
+var util = require('util');
+
+module.exports = DelayedStream;
+function DelayedStream() {
+ this.source = null;
+ this.dataSize = 0;
+ this.maxDataSize = 1024 * 1024;
+ this.pauseStream = true;
+
+ this._maxDataSizeExceeded = false;
+ this._released = false;
+ this._bufferedEvents = [];
+}
+util.inherits(DelayedStream, Stream);
+
+DelayedStream.create = function(source, options) {
+ var delayedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ delayedStream[option] = options[option];
+ }
+
+ delayedStream.source = source;
+
+ var realEmit = source.emit;
+ source.emit = function() {
+ delayedStream._handleEmit(arguments);
+ return realEmit.apply(source, arguments);
+ };
+
+ source.on('error', function() {});
+ if (delayedStream.pauseStream) {
+ source.pause();
+ }
+
+ return delayedStream;
+};
+
+DelayedStream.prototype.__defineGetter__('readable', function() {
+ return this.source.readable;
+});
+
+DelayedStream.prototype.resume = function() {
+ if (!this._released) {
+ this.release();
+ }
+
+ this.source.resume();
+};
+
+DelayedStream.prototype.pause = function() {
+ this.source.pause();
+};
+
+DelayedStream.prototype.release = function() {
+ this._released = true;
+
+ this._bufferedEvents.forEach(function(args) {
+ this.emit.apply(this, args);
+ }.bind(this));
+ this._bufferedEvents = [];
+};
+
+DelayedStream.prototype.pipe = function() {
+ var r = Stream.prototype.pipe.apply(this, arguments);
+ this.resume();
+ return r;
+};
+
+DelayedStream.prototype._handleEmit = function(args) {
+ if (this._released) {
+ this.emit.apply(this, args);
+ return;
+ }
+
+ if (args[0] === 'data') {
+ this.dataSize += args[1].length;
+ this._checkIfMaxDataSizeExceeded();
+ }
+
+ this._bufferedEvents.push(args);
+};
+
+DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
+ if (this._maxDataSizeExceeded) {
+ return;
+ }
+
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ this._maxDataSizeExceeded = true;
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+ this.emit('error', new Error(message));
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/lib/form_data.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/request/node_modules/form-data/lib/form_data.js
new file mode 100644
index 0000000..5b33f55
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/lib/form_data.js
@@ -0,0 +1,351 @@
+var CombinedStream = require('combined-stream');
+var util = require('util');
+var path = require('path');
+var http = require('http');
+var https = require('https');
+var parseUrl = require('url').parse;
+var fs = require('fs');
+var mime = require('mime-types');
+var async = require('async');
+
+module.exports = FormData;
+function FormData() {
+ this._overheadLength = 0;
+ this._valueLength = 0;
+ this._lengthRetrievers = [];
+
+ CombinedStream.call(this);
+}
+util.inherits(FormData, CombinedStream);
+
+FormData.LINE_BREAK = '\r\n';
+
+FormData.prototype.append = function(field, value, options) {
+ options = options || {};
+
+ var append = CombinedStream.prototype.append.bind(this);
+
+ // all that streamy business can't handle numbers
+ if (typeof value == 'number') value = ''+value;
+
+ // https://github.com/felixge/node-form-data/issues/38
+ if (util.isArray(value)) {
+ // Please convert your array into string
+ // the way web server expects it
+ this._error(new Error('Arrays are not supported.'));
+ return;
+ }
+
+ var header = this._multiPartHeader(field, value, options);
+ var footer = this._multiPartFooter(field, value, options);
+
+ append(header);
+ append(value);
+ append(footer);
+
+ // pass along options.knownLength
+ this._trackLength(header, value, options);
+};
+
+FormData.prototype._trackLength = function(header, value, options) {
+ var valueLength = 0;
+
+ // used w/ getLengthSync(), when length is known.
+ // e.g. for streaming directly from a remote server,
+ // w/ a known file a size, and not wanting to wait for
+ // incoming file to finish to get its size.
+ if (options.knownLength != null) {
+ valueLength += +options.knownLength;
+ } else if (Buffer.isBuffer(value)) {
+ valueLength = value.length;
+ } else if (typeof value === 'string') {
+ valueLength = Buffer.byteLength(value);
+ }
+
+ this._valueLength += valueLength;
+
+ // @check why add CRLF? does this account for custom/multiple CRLFs?
+ this._overheadLength +=
+ Buffer.byteLength(header) +
+ + FormData.LINE_BREAK.length;
+
+ // empty or either doesn't have path or not an http response
+ if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
+ return;
+ }
+
+ // no need to bother with the length
+ if (!options.knownLength)
+ this._lengthRetrievers.push(function(next) {
+
+ if (value.hasOwnProperty('fd')) {
+
+ // take read range into a account
+ // `end` = Infinity –> read file till the end
+ //
+ // TODO: Looks like there is bug in Node fs.createReadStream
+ // it doesn't respect `end` options without `start` options
+ // Fix it when node fixes it.
+ // https://github.com/joyent/node/issues/7819
+ if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+
+ // when end specified
+ // no need to calculate range
+ // inclusive, starts with 0
+ next(null, value.end+1 - (value.start ? value.start : 0));
+
+ // not that fast snoopy
+ } else {
+ // still need to fetch file size from fs
+ fs.stat(value.path, function(err, stat) {
+
+ var fileSize;
+
+ if (err) {
+ next(err);
+ return;
+ }
+
+ // update final size based on the range options
+ fileSize = stat.size - (value.start ? value.start : 0);
+ next(null, fileSize);
+ });
+ }
+
+ // or http response
+ } else if (value.hasOwnProperty('httpVersion')) {
+ next(null, +value.headers['content-length']);
+
+ // or request stream http://github.com/mikeal/request
+ } else if (value.hasOwnProperty('httpModule')) {
+ // wait till response come back
+ value.on('response', function(response) {
+ value.pause();
+ next(null, +response.headers['content-length']);
+ });
+ value.resume();
+
+ // something else
+ } else {
+ next('Unknown stream');
+ }
+ });
+};
+
+FormData.prototype._multiPartHeader = function(field, value, options) {
+ var boundary = this.getBoundary();
+ var header = '';
+
+ // custom header specified (as string)?
+ // it becomes responsible for boundary
+ // (e.g. to handle extra CRLFs on .NET servers)
+ if (options.header != null) {
+ header = options.header;
+ } else {
+ header += '--' + boundary + FormData.LINE_BREAK +
+ 'Content-Disposition: form-data; name="' + field + '"';
+
+ // fs- and request- streams have path property
+ // or use custom filename and/or contentType
+ // TODO: Use request's response mime-type
+ if (options.filename || value.path) {
+ header +=
+ '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK +
+ 'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path));
+
+ // http response has not
+ } else if (value.readable && value.hasOwnProperty('httpVersion')) {
+ header +=
+ '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK +
+ 'Content-Type: ' + value.headers['content-type'];
+ }
+
+ header += FormData.LINE_BREAK + FormData.LINE_BREAK;
+ }
+
+ return header;
+};
+
+FormData.prototype._multiPartFooter = function(field, value, options) {
+ return function(next) {
+ var footer = FormData.LINE_BREAK;
+
+ var lastPart = (this._streams.length === 0);
+ if (lastPart) {
+ footer += this._lastBoundary();
+ }
+
+ next(footer);
+ }.bind(this);
+};
+
+FormData.prototype._lastBoundary = function() {
+ return '--' + this.getBoundary() + '--';
+};
+
+FormData.prototype.getHeaders = function(userHeaders) {
+ var formHeaders = {
+ 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
+ };
+
+ for (var header in userHeaders) {
+ formHeaders[header.toLowerCase()] = userHeaders[header];
+ }
+
+ return formHeaders;
+}
+
+FormData.prototype.getCustomHeaders = function(contentType) {
+ contentType = contentType ? contentType : 'multipart/form-data';
+
+ var formHeaders = {
+ 'content-type': contentType + '; boundary=' + this.getBoundary(),
+ 'content-length': this.getLengthSync()
+ };
+
+ return formHeaders;
+}
+
+FormData.prototype.getBoundary = function() {
+ if (!this._boundary) {
+ this._generateBoundary();
+ }
+
+ return this._boundary;
+};
+
+FormData.prototype._generateBoundary = function() {
+ // This generates a 50 character boundary similar to those used by Firefox.
+ // They are optimized for boyer-moore parsing.
+ var boundary = '--------------------------';
+ for (var i = 0; i < 24; i++) {
+ boundary += Math.floor(Math.random() * 10).toString(16);
+ }
+
+ this._boundary = boundary;
+};
+
+// Note: getLengthSync DOESN'T calculate streams length
+// As workaround one can calculate file size manually
+// and add it as knownLength option
+FormData.prototype.getLengthSync = function(debug) {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ // Don't get confused, there are 3 "internal" streams for each keyval pair
+ // so it basically checks if there is any value added to the form
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ // https://github.com/felixge/node-form-data/issues/40
+ if (this._lengthRetrievers.length) {
+ // Some async length retrivers are present
+ // therefore synchronous length calculation is false.
+ // Please use getLength(callback) to get proper length
+ this._error(new Error('Cannot calculate proper length in synchronous way.'));
+ }
+
+ return knownLength;
+};
+
+FormData.prototype.getLength = function(cb) {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ if (!this._lengthRetrievers.length) {
+ process.nextTick(cb.bind(this, null, knownLength));
+ return;
+ }
+
+ async.parallel(this._lengthRetrievers, function(err, values) {
+ if (err) {
+ cb(err);
+ return;
+ }
+
+ values.forEach(function(length) {
+ knownLength += length;
+ });
+
+ cb(null, knownLength);
+ });
+};
+
+FormData.prototype.submit = function(params, cb) {
+
+ var request
+ , options
+ , defaults = {
+ method : 'post'
+ };
+
+ // parse provided url if it's string
+ // or treat it as options object
+ if (typeof params == 'string') {
+ params = parseUrl(params);
+
+ options = populate({
+ port: params.port,
+ path: params.pathname,
+ host: params.hostname
+ }, defaults);
+ }
+ else // use custom params
+ {
+ options = populate(params, defaults);
+ // if no port provided use default one
+ if (!options.port) {
+ options.port = options.protocol == 'https:' ? 443 : 80;
+ }
+ }
+
+ // put that good code in getHeaders to some use
+ options.headers = this.getHeaders(params.headers);
+
+ // https if specified, fallback to http in any other case
+ if (params.protocol == 'https:') {
+ request = https.request(options);
+ } else {
+ request = http.request(options);
+ }
+
+ // get content length and fire away
+ this.getLength(function(err, length) {
+
+ // TODO: Add chunked encoding when no length (if err)
+
+ // add content length
+ request.setHeader('Content-Length', length);
+
+ this.pipe(request);
+ if (cb) {
+ request.on('error', cb);
+ request.on('response', cb.bind(this, null));
+ }
+ }.bind(this));
+
+ return request;
+};
+
+FormData.prototype._error = function(err) {
+ if (this.error) return;
+
+ this.error = err;
+ this.pause();
+ this.emit('error', err);
+};
+
+/*
+ * Santa's little helpers
+ */
+
+// populates missing values
+function populate(dst, src) {
+ for (var prop in src) {
+ if (!dst[prop]) dst[prop] = src[prop];
+ }
+ return dst;
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml b/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
index 6e5919d..6064ca0 100644
--- a/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
+++ b/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
@@ -1,3 +1,5 @@
language: node_js
node_js:
- "0.10"
+ - "0.12"
+ - "iojs"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/node_modules/async/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/README.md b/node_modules/request/node_modules/form-data/node_modules/async/README.md
index 0bea531..6cfb922 100644
--- a/node_modules/request/node_modules/form-data/node_modules/async/README.md
+++ b/node_modules/request/node_modules/form-data/node_modules/async/README.md
@@ -5,8 +5,16 @@
Async is a utility module which provides straight-forward, powerful functions
for working with asynchronous JavaScript. Although originally designed for
-use with [Node.js](http://nodejs.org), it can also be used directly in the
-browser. Also supports [component](https://github.com/component/component).
+use with [Node.js](http://nodejs.org) and installable via `npm install async`,
+it can also be used directly in the browser.
+
+Async is also installable via:
+
+- [bower](http://bower.io/): `bower install async`
+- [component](https://github.com/component/component): `component install
+ caolan/async`
+- [jam](http://jamjs.org/): `jam install async`
+- [spm](http://spmjs.io/): `spm install async`
Async provides around 20 functions that include the usual 'functional'
suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns
@@ -182,7 +190,7 @@ __Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
The iterator is passed a `callback(err)` which must be called once it has
- completed. If no error has occured, the `callback` should be run without
+ completed. If no error has occurred, the `callback` should be run without
arguments or with an explicit `null` argument.
* `callback(err)` - A callback which is called when all `iterator` functions
have finished, or an error occurs.
@@ -202,7 +210,7 @@ async.each(openFiles, saveFile, function(err){
```js
// assuming openFiles is an array of file names
-async.each(openFiles, function( file, callback) {
+async.each(openFiles, function(file, callback) {
// Perform operation on file here.
console.log('Processing file ' + file);
@@ -256,7 +264,7 @@ __Arguments__
* `limit` - The maximum number of `iterator`s to run at any time.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
The iterator is passed a `callback(err)` which must be called once it has
- completed. If no error has occured, the callback should be run without
+ completed. If no error has occurred, the callback should be run without
arguments or with an explicit `null` argument.
* `callback(err)` - A callback which is called when all `iterator` functions
have finished, or an error occurs.
@@ -280,7 +288,7 @@ async.eachLimit(documents, 20, requestApi, function(err){
Produces a new array of values by mapping each value in `arr` through
the `iterator` function. The `iterator` is called with an item from `arr` and a
callback for when it has finished processing. Each of these callback takes 2 arguments:
-an `error`, and the transformed item from `arr`. If `iterator` passes an error to this
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to his
callback, the main `callback` (for the `map` function) is immediately called with the error.
Note, that since this function applies the `iterator` to each item in parallel,
@@ -536,14 +544,14 @@ By modifying the callback parameter the sorting order can be influenced:
```js
//ascending order
async.sortBy([1,9,3,5], function(x, callback){
- callback(err, x);
+ callback(null, x);
}, function(err,result){
//result callback
} );
//descending order
async.sortBy([1,9,3,5], function(x, callback){
- callback(err, x*-1); //<- x*-1 instead of x, turns the order around
+ callback(null, x*-1); //<- x*-1 instead of x, turns the order around
}, function(err,result){
//result callback
} );
@@ -913,19 +921,19 @@ __Example__
```js
async.waterfall([
- function(callback){
+ function(callback) {
callback(null, 'one', 'two');
},
- function(arg1, arg2, callback){
+ function(arg1, arg2, callback) {
// arg1 now equals 'one' and arg2 now equals 'two'
callback(null, 'three');
},
- function(arg1, callback){
+ function(arg1, callback) {
// arg1 now equals 'three'
callback(null, 'done');
}
], function (err, result) {
- // result now equals 'done'
+ // result now equals 'done'
});
```
@@ -972,7 +980,8 @@ add1mul3(4, function (err, result) {
### seq(fn1, fn2...)
Version of the compose function that is more natural to read.
-Each following function consumes the return value of the latter function.
+Each function consumes the return value of the previous function.
+It is the equivalent of [`compose`](#compose) with the arguments reversed.
Each function is executed with the `this` binding of the composed function.
@@ -989,28 +998,20 @@ __Example__
// This example uses `seq` function to avoid overnesting and error
// handling clutter.
app.get('/cats', function(request, response) {
- function handleError(err, data, callback) {
- if (err) {
- console.error(err);
- response.json({ status: 'error', message: err.message });
- }
- else {
- callback(data);
- }
- }
var User = request.models.User;
async.seq(
_.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
- handleError,
function(user, fn) {
user.getCats(fn); // 'getCats' has signature (callback(err, data))
- },
- handleError,
- function(cats) {
+ }
+ )(req.session.user_id, function (err, cats) {
+ if (err) {
+ console.error(err);
+ response.json({ status: 'error', message: err.message });
+ } else {
response.json({ status: 'ok', message: 'Cats found', data: cats });
}
- )(req.session.user_id);
- }
+ });
});
```
@@ -1092,7 +1093,7 @@ methods:
* `paused` - a boolean for determining whether the queue is in a paused state
* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
-* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle.
+* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.
__Example__
@@ -1122,7 +1123,7 @@ q.push({name: 'bar'}, function (err) {
// add some items to the queue (batch-wise)
q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
- console.log('finished processing bar');
+ console.log('finished processing item');
});
// add some items to the front of the queue
@@ -1349,7 +1350,7 @@ new tasks much easier (and the code more readable).
Attempts to get a successful response from `task` no more than `times` times before
returning an error. If the task is successful, the `callback` will be passed the result
-of the successfull task. If all attemps fail, the callback will be passed the error and
+of the successful task. If all attempts fail, the callback will be passed the error and
result (if any) of the final attempt.
__Arguments__
@@ -1474,7 +1475,7 @@ three
---------------------------------------
<a name="nextTick" />
-### nextTick(callback)
+### nextTick(callback), setImmediate(callback)
Calls `callback` on a later loop around the event loop. In Node.js this just
calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/node_modules/async/bower.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/bower.json b/node_modules/request/node_modules/form-data/node_modules/async/bower.json
new file mode 100644
index 0000000..1817688
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/node_modules/async/bower.json
@@ -0,0 +1,38 @@
+{
+ "name": "async",
+ "description": "Higher-order functions and common patterns for asynchronous code",
+ "version": "0.9.2",
+ "main": "lib/async.js",
+ "keywords": [
+ "async",
+ "callback",
+ "utility",
+ "module"
+ ],
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/caolan/async.git"
+ },
+ "devDependencies": {
+ "nodeunit": ">0.0.0",
+ "uglify-js": "1.2.x",
+ "nodelint": ">0.0.0",
+ "lodash": ">=2.4.1"
+ },
+ "moduleType": [
+ "amd",
+ "globals",
+ "node"
+ ],
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ],
+ "authors": [
+ "Caolan McMahon"
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/node_modules/async/component.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/component.json b/node_modules/request/node_modules/form-data/node_modules/async/component.json
index bbb0115..5003a7c 100644
--- a/node_modules/request/node_modules/form-data/node_modules/async/component.json
+++ b/node_modules/request/node_modules/form-data/node_modules/async/component.json
@@ -1,11 +1,16 @@
{
"name": "async",
- "repo": "caolan/async",
"description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.1.23",
- "keywords": [],
- "dependencies": {},
- "development": {},
- "main": "lib/async.js",
- "scripts": [ "lib/async.js" ]
-}
+ "version": "0.9.2",
+ "keywords": [
+ "async",
+ "callback",
+ "utility",
+ "module"
+ ],
+ "license": "MIT",
+ "repository": "caolan/async",
+ "scripts": [
+ "lib/async.js"
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
new file mode 100644
index 0000000..394c41c
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
@@ -0,0 +1,1123 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+/*jshint onevar: false, indent:4 */
+/*global setImmediate: false, setTimeout: false, console: false */
+(function () {
+
+ var async = {};
+
+ // global on the server, window in the browser
+ var root, previous_async;
+
+ root = this;
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ var called = false;
+ return function() {
+ if (called) throw new Error("Callback was already called.");
+ called = true;
+ fn.apply(root, arguments);
+ }
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
+ var _each = function (arr, iterator) {
+ for (var i = 0; i < arr.length; i += 1) {
+ iterator(arr[i], i, arr);
+ }
+ };
+
+ var _map = function (arr, iterator) {
+ if (arr.map) {
+ return arr.map(iterator);
+ }
+ var results = [];
+ _each(arr, function (x, i, a) {
+ results.push(iterator(x, i, a));
+ });
+ return results;
+ };
+
+ var _reduce = function (arr, iterator, memo) {
+ if (arr.reduce) {
+ return arr.reduce(iterator, memo);
+ }
+ _each(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ };
+
+ var _keys = function (obj) {
+ if (Object.keys) {
+ return Object.keys(obj);
+ }
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+ if (typeof process === 'undefined' || !(process.nextTick)) {
+ if (typeof setImmediate === 'function') {
+ async.nextTick = function (fn) {
+ // not a direct alias for IE10 compatibility
+ setImmediate(fn);
+ };
+ async.setImmediate = async.nextTick;
+ }
+ else {
+ async.nextTick = function (fn) {
+ setTimeout(fn, 0);
+ };
+ async.setImmediate = async.nextTick;
+ }
+ }
+ else {
+ async.nextTick = process.nextTick;
+ if (typeof setImmediate !== 'undefined') {
+ async.setImmediate = function (fn) {
+ // not a direct alias for IE10 compatibility
+ setImmediate(fn);
+ };
+ }
+ else {
+ async.setImmediate = async.nextTick;
+ }
+ }
+
+ async.each = function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ _each(arr, function (x) {
+ iterator(x, only_once(done) );
+ });
+ function done(err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed >= arr.length) {
+ callback();
+ }
+ }
+ }
+ };
+ async.forEach = async.each;
+
+ async.eachSeries = function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ var iterate = function () {
+ iterator(arr[completed], function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed >= arr.length) {
+ callback();
+ }
+ else {
+ iterate();
+ }
+ }
+ });
+ };
+ iterate();
+ };
+ async.forEachSeries = async.eachSeries;
+
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ var fn = _eachLimit(limit);
+ fn.apply(null, [arr, iterator, callback]);
+ };
+ async.forEachLimit = async.eachLimit;
+
+ var _eachLimit = function (limit) {
+
+ return function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length || limit <= 0) {
+ return callback();
+ }
+ var completed = 0;
+ var started = 0;
+ var running = 0;
+
+ (function replenish () {
+ if (completed >= arr.length) {
+ return callback();
+ }
+
+ while (running < limit && started < arr.length) {
+ started += 1;
+ running += 1;
+ iterator(arr[started - 1], function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ running -= 1;
+ if (completed >= arr.length) {
+ callback();
+ }
+ else {
+ replenish();
+ }
+ }
+ });
+ }
+ })();
+ };
+ };
+
+
+ var doParallel = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.each].concat(args));
+ };
+ };
+ var doParallelLimit = function(limit, fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [_eachLimit(limit)].concat(args));
+ };
+ };
+ var doSeries = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.eachSeries].concat(args));
+ };
+ };
+
+
+ var _asyncMap = function (eachfn, arr, iterator, callback) {
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ if (!callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err) {
+ callback(err);
+ });
+ });
+ } else {
+ var results = [];
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err, v) {
+ results[x.index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = function (arr, limit, iterator, callback) {
+ return _mapLimit(limit)(arr, iterator, callback);
+ };
+
+ var _mapLimit = function(limit) {
+ return doParallelLimit(limit, _asyncMap);
+ };
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachSeries(arr, function (x, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+ // inject alias
+ async.inject = async.reduce;
+ // foldl alias
+ async.foldl = async.reduce;
+
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, function (x) {
+ return x;
+ }).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+ // foldr alias
+ async.foldr = async.reduceRight;
+
+ var _filter = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.filter = doParallel(_filter);
+ async.filterSeries = doSeries(_filter);
+ // select alias
+ async.select = async.filter;
+ async.selectSeries = async.filterSeries;
+
+ var _reject = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (!v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.reject = doParallel(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ var _detect = function (eachfn, arr, iterator, main_callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x, function (result) {
+ if (result) {
+ main_callback(x);
+ main_callback = function () {};
+ }
+ else {
+ callback();
+ }
+ });
+ }, function (err) {
+ main_callback();
+ });
+ };
+ async.detect = doParallel(_detect);
+ async.detectSeries = doSeries(_detect);
+
+ async.some = function (arr, iterator, main_callback) {
+ async.each(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ main_callback(true);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(false);
+ });
+ };
+ // any alias
+ async.any = async.some;
+
+ async.every = function (arr, iterator, main_callback) {
+ async.each(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (!v) {
+ main_callback(false);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(true);
+ });
+ };
+ // all alias
+ async.all = async.every;
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ var fn = function (left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ };
+ callback(null, _map(results.sort(fn), function (x) {
+ return x.value;
+ }));
+ }
+ });
+ };
+
+ async.auto = function (tasks, callback) {
+ callback = callback || function () {};
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length
+ if (!remainingTasks) {
+ return callback();
+ }
+
+ var results = {};
+
+ var listeners = [];
+ var addListener = function (fn) {
+ listeners.unshift(fn);
+ };
+ var removeListener = function (fn) {
+ for (var i = 0; i < listeners.length; i += 1) {
+ if (listeners[i] === fn) {
+ listeners.splice(i, 1);
+ return;
+ }
+ }
+ };
+ var taskComplete = function () {
+ remainingTasks--
+ _each(listeners.slice(0), function (fn) {
+ fn();
+ });
+ };
+
+ addListener(function () {
+ if (!remainingTasks) {
+ var theCallback = callback;
+ // prevent final callback from calling itself if it errors
+ callback = function () {};
+
+ theCallback(null, results);
+ }
+ });
+
+ _each(keys, function (k) {
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _each(_keys(results), function(rkey) {
+ safeResults[rkey] = results[rkey];
+ });
+ safeResults[k] = args;
+ callback(err, safeResults);
+ // stop subsequent errors hitting callback multiple times
+ callback = function () {};
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ };
+ var requires = task.slice(0, Math.abs(task.length - 1)) || [];
+ var ready = function () {
+ return _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ };
+ if (ready()) {
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ var listener = function () {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ };
+ addListener(listener);
+ }
+ });
+ };
+
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var attempts = [];
+ // Use defaults if times not passed
+ if (typeof times === 'function') {
+ callback = task;
+ task = times;
+ times = DEFAULT_TIMES;
+ }
+ // Make sure times is a number
+ times = parseInt(times, 10) || DEFAULT_TIMES;
+ var wrappedTask = function(wrappedCallback, wrappedResults) {
+ var retryAttempt = function(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ };
+ while (times) {
+ attempts.push(retryAttempt(task, !(times-=1)));
+ }
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || callback)(data.err, data.result);
+ });
+ }
+ // If a callback is passed, run this as a controll flow
+ return callback ? wrappedTask() : wrappedTask
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = callback || function () {};
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ var wrapIterator = function (iterator) {
+ return function (err) {
+ if (err) {
+ callback.apply(null, arguments);
+ callback = function () {};
+ }
+ else {
+ var args = Array.prototype.slice.call(arguments, 1);
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ async.setImmediate(function () {
+ iterator.apply(null, args);
+ });
+ }
+ };
+ };
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ var _parallel = function(eachfn, tasks, callback) {
+ callback = callback || function () {};
+ if (_isArray(tasks)) {
+ eachfn.map(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ eachfn.each(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.parallel = function (tasks, callback) {
+ _parallel({ map: async.map, each: async.each }, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
+ };
+
+ async.series = function (tasks, callback) {
+ callback = callback || function () {};
+ if (_isArray(tasks)) {
+ async.mapSeries(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ async.eachSeries(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.iterator = function (tasks) {
+ var makeCallback = function (index) {
+ var fn = function () {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ };
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ };
+ return makeCallback(0);
+ };
+
+ async.apply = function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ return function () {
+ return fn.apply(
+ null, args.concat(Array.prototype.slice.call(arguments))
+ );
+ };
+ };
+
+ var _concat = function (eachfn, arr, fn, callback) {
+ var r = [];
+ eachfn(arr, function (x, cb) {
+ fn(x, function (err, y) {
+ r = r.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, r);
+ });
+ };
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ if (test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.whilst(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (test.apply(null, args)) {
+ async.doWhilst(iterator, test, callback);
+ }
+ else {
+ callback();
+ }
+ });
+ };
+
+ async.until = function (test, iterator, callback) {
+ if (!test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.until(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (!test.apply(null, args)) {
+ async.doUntil(iterator, test, callback);
+ }
+ else {
+ callback();
+ }
+ });
+ };
+
+ async.queue = function (worker, concurrency) {
+ if (concurrency === undefined) {
+ concurrency = 1;
+ }
+ function _insert(q, data, pos, callback) {
+ if (!q.started){
+ q.started = true;
+ }
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length == 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ if (q.drain) {
+ q.drain();
+ }
+ });
+ }
+ _each(data, function(task) {
+ var item = {
+ data: task,
+ callback: typeof callback === 'function' ? callback : null
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.saturated && q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ var workers = 0;
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ saturated: null,
+ empty: null,
+ drain: null,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = null;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ if (!q.paused && workers < q.concurrency && q.tasks.length) {
+ var task = q.tasks.shift();
+ if (q.empty && q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ var next = function () {
+ workers -= 1;
+ if (task.callback) {
+ task.callback.apply(task, arguments);
+ }
+ if (q.drain && q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ var cb = only_once(next);
+ worker(task.data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ if (q.paused === true) { return; }
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w <= q.concurrency; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ };
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ };
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (!q.started){
+ q.started = true;
+ }
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length == 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ if (q.drain) {
+ q.drain();
+ }
+ });
+ }
+ _each(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : null
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.saturated && q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ var working = false,
+ tasks = [];
+
+ var cargo = {
+ tasks: tasks,
+ payload: payload,
+ saturated: null,
+ empty: null,
+ drain: null,
+ drained: true,
+ push: function (data, callback) {
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ _each(data, function(task) {
+ tasks.push({
+ data: task,
+ callback: typeof callback === 'function' ? callback : null
+ });
+ cargo.drained = false;
+ if (cargo.saturated && tasks.length === payload) {
+ cargo.saturated();
+ }
+ });
+ async.setImmediate(cargo.process);
+ },
+ process: function process() {
+ if (working) return;
+ if (tasks.length === 0) {
+ if(cargo.drain && !cargo.drained) cargo.drain();
+ cargo.drained = true;
+ return;
+ }
+
+ var ts = typeof payload === 'number'
+ ? tasks.splice(0, payload)
+ : tasks.splice(0, tasks.length);
+
+ var ds = _map(ts, function (task) {
+ return task.data;
+ });
+
+ if(cargo.empty) cargo.empty();
+ working = true;
+ worker(ds, function () {
+ working = false;
+
+ var args = arguments;
+ _each(ts, function (data) {
+ if (data.callback) {
+ data.callback.apply(null, args);
+ }
+ });
+
+ process();
+ });
+ },
+ length: function () {
+ return tasks.length;
+ },
+ running: function () {
+ return working;
+ }
+ };
+ return cargo;
+ };
+
+ var _console_fn = function (name) {
+ return function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ fn.apply(null, args.concat([function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (typeof console !== 'undefined') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _each(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ }]));
+ };
+ };
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ hasher = hasher || function (x) {
+ return x;
+ };
+ var memoized = function () {
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (key in memo) {
+ async.nextTick(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (key in queues) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([function () {
+ memo[key] = arguments;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, arguments);
+ }
+ }]));
+ }
+ };
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ async.times = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i < count; i++) {
+ counter.push(i);
+ }
+ return async.map(counter, iterator, callback);
+ };
+
+ async.timesSeries = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i < count; i++) {
+ counter.push(i);
+ }
+ return async.mapSeries(counter, iterator, callback);
+ };
+
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return function () {
+ var that = this;
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([function () {
+ var err = arguments[0];
+ var nextargs = Array.prototype.slice.call(arguments, 1);
+ cb(err, nextargs);
+ }]))
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ };
+ };
+
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
+ var _applyEach = function (eachfn, fns /*args...*/) {
+ var go = function () {
+ var that = this;
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ return eachfn(fns, function (fn, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ };
+ if (arguments.length > 2) {
+ var args = Array.prototype.slice.call(arguments, 2);
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ };
+ async.applyEach = doParallel(_applyEach);
+ async.applyEachSeries = doSeries(_applyEach);
+
+ async.forever = function (fn, callback) {
+ function next(err) {
+ if (err) {
+ if (callback) {
+ return callback(err);
+ }
+ throw err;
+ }
+ fn(next);
+ }
+ next();
+ };
+
+ // Node.js
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else if (typeof define !== 'undefined' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // included directly via <script> tag
+ else {
+ root.async = async;
+ }
+
+}());
[55/59] [abbrv] couchdb-nmo git commit: add wreck@5.6.0
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/README.md
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/README.md b/node_modules/wreck/node_modules/hoek/README.md
new file mode 100755
index 0000000..19357bb
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/README.md
@@ -0,0 +1,574 @@
+
+
+Utility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore).
+
+[](http://travis-ci.org/hapijs/hoek)
+
+Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
+
+# Table of Contents
+
+* [Introduction](#introduction "Introduction")
+* [Object](#object "Object")
+ * [clone](#cloneobj "clone")
+ * [cloneWithShallow](#clonewithshallowobj-keys "cloneWithShallow")
+ * [merge](#mergetarget-source-isnulloverride-ismergearrays "merge")
+ * [applyToDefaults](#applytodefaultsdefaults-options-isnulloverride "applyToDefaults")
+ * [applyToDefaultsWithShallow](#applytodefaultswithshallowdefaults-options-keys "applyToDefaultsWithShallow")
+ * [deepEqual](#deepequala-b "deepEqual")
+ * [unique](#uniquearray-key "unique")
+ * [mapToObject](#maptoobjectarray-key "mapToObject")
+ * [intersect](#intersectarray1-array2 "intersect")
+ * [contain](#containref-values-options "contain")
+ * [flatten](#flattenarray-target "flatten")
+ * [reach](#reachobj-chain-options "reach")
+ * [reachTemplate](#reachobj-template-options "reachTemplate")
+ * [transform](#transformobj-transform-options "transform")
+ * [shallow](#shallowobj "shallow")
+ * [stringify](#stringifyobj "stringify")
+* [Timer](#timer "Timer")
+* [Bench](#bench "Bench")
+* [Binary Encoding/Decoding](#binary-encodingdecoding "Binary Encoding/Decoding")
+ * [base64urlEncode](#base64urlencodevalue "binary64urlEncode")
+ * [base64urlDecode](#base64urldecodevalue "binary64urlDecode")
+* [Escaping Characters](#escaping-characters "Escaping Characters")
+ * [escapeHtml](#escapehtmlstring "escapeHtml")
+ * [escapeHeaderAttribute](#escapeheaderattributeattribute "escapeHeaderAttribute")
+ * [escapeRegex](#escaperegexstring "escapeRegex")
+* [Errors](#errors "Errors")
+ * [assert](#assertcondition-message "assert")
+ * [abort](#abortmessage "abort")
+ * [displayStack](#displaystackslice "displayStack")
+ * [callStack](#callstackslice "callStack")
+* [Function](#function "Function")
+ * [nextTick](#nexttickfn "nextTick")
+ * [once](#oncefn "once")
+ * [ignore](#ignore "ignore")
+* [Miscellaneous](#miscellaneous "Miscellaneous")
+ * [uniqueFilename](#uniquefilename "uniqueFilename")
+ * [isInteger](#isInteger "isInteger")
+
+
+
+# Introduction
+
+The *Hoek* library contains some common functions used within the hapi ecosystem. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.
+
+For example, to use Hoek to set configuration with default options:
+```javascript
+var Hoek = require('hoek');
+
+var default = {url : "www.github.com", port : "8000", debug : true};
+
+var config = Hoek.applyToDefaults(default, {port : "3000", admin : true});
+
+// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }
+```
+
+Under each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the `var Hoek = require('hoek');` is omitted for brevity.
+
+## Object
+
+Hoek provides several helpful methods for objects and arrays.
+
+### clone(obj)
+
+This method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects, as well as non-enumerable properties).
+
+```javascript
+
+var nestedObj = {
+ w: /^something$/ig,
+ x: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date()
+ },
+ y: 'y',
+ z: new Date()
+ };
+
+var copy = Hoek.clone(nestedObj);
+
+copy.x.b = 100;
+
+console.log(copy.y); // results in 'y'
+console.log(nestedObj.x.b); // results in 123456
+console.log(copy.x.b); // results in 100
+```
+
+### cloneWithShallow(obj, keys)
+keys is an array of key names to shallow copy
+
+This method is also used to clone an object or array, however any keys listed in the `keys` array are shallow copied while those not listed are deep copied.
+
+```javascript
+
+var nestedObj = {
+ w: /^something$/ig,
+ x: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date()
+ },
+ y: 'y',
+ z: new Date()
+ };
+
+var copy = Hoek.cloneWithShallow(nestedObj, ['x']);
+
+copy.x.b = 100;
+
+console.log(copy.y); // results in 'y'
+console.log(nestedObj.x.b); // results in 100
+console.log(copy.x.b); // results in 100
+```
+
+### merge(target, source, isNullOverride, isMergeArrays)
+isNullOverride, isMergeArrays default to true
+
+Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied.
+Merge is destructive where the target is modified. For non destructive merge, use `applyToDefaults`.
+
+
+```javascript
+
+var target = {a: 1, b : 2};
+var source = {a: 0, c: 5};
+var source2 = {a: null, c: 5};
+
+Hoek.merge(target, source); // results in {a: 0, b: 2, c: 5}
+Hoek.merge(target, source2); // results in {a: null, b: 2, c: 5}
+Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}
+
+var targetArray = [1, 2, 3];
+var sourceArray = [4, 5];
+
+Hoek.merge(targetArray, sourceArray); // results in [1, 2, 3, 4, 5]
+Hoek.merge(targetArray, sourceArray, true, false); // results in [4, 5]
+```
+
+### applyToDefaults(defaults, options, isNullOverride)
+isNullOverride defaults to false
+
+Apply options to a copy of the defaults
+
+```javascript
+
+var defaults = { host: "localhost", port: 8000 };
+var options = { port: 8080 };
+
+var config = Hoek.applyToDefaults(defaults, options); // results in { host: "localhost", port: 8080 }
+```
+
+Apply options with a null value to a copy of the defaults
+
+```javascript
+
+var defaults = { host: "localhost", port: 8000 };
+var options = { host: null, port: 8080 };
+
+var config = Hoek.applyToDefaults(defaults, options, true); // results in { host: null, port: 8080 }
+```
+
+### applyToDefaultsWithShallow(defaults, options, keys)
+keys is an array of key names to shallow copy
+
+Apply options to a copy of the defaults. Keys specified in the last parameter are shallow copied from options instead of merged.
+
+```javascript
+
+var defaults = {
+ server: {
+ host: "localhost",
+ port: 8000
+ },
+ name: 'example'
+ };
+
+var options = { server: { port: 8080 } };
+
+var config = Hoek.applyToDefaults(defaults, options); // results in { server: { port: 8080 }, name: 'example' }
+```
+
+### deepEqual(b, a, [options])
+
+Performs a deep comparison of the two values including support for circular dependencies, prototype, and properties. To skip prototype comparisons, use `options.prototype = false`
+
+```javascript
+Hoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true
+Hoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true
+Hoek.deepEqual(Object.create(null), {}); //results in false
+```
+
+### unique(array, key)
+
+Remove duplicate items from Array
+
+```javascript
+
+var array = [1, 2, 2, 3, 3, 4, 5, 6];
+
+var newArray = Hoek.unique(array); // results in [1,2,3,4,5,6]
+
+array = [{id: 1}, {id: 1}, {id: 2}];
+
+newArray = Hoek.unique(array, "id"); // results in [{id: 1}, {id: 2}]
+```
+
+### mapToObject(array, key)
+
+Convert an Array into an Object
+
+```javascript
+
+var array = [1,2,3];
+var newObject = Hoek.mapToObject(array); // results in [{"1": true}, {"2": true}, {"3": true}]
+
+array = [{id: 1}, {id: 2}];
+newObject = Hoek.mapToObject(array, "id"); // results in [{"id": 1}, {"id": 2}]
+```
+
+### intersect(array1, array2)
+
+Find the common unique items in two arrays
+
+```javascript
+
+var array1 = [1, 2, 3];
+var array2 = [1, 4, 5];
+
+var newArray = Hoek.intersect(array1, array2); // results in [1]
+```
+
+### contain(ref, values, [options])
+
+Tests if the reference value contains the provided values where:
+- `ref` - the reference string, array, or object.
+- `values` - a single or array of values to find within the `ref` value. If `ref` is an object, `values` can be a key name,
+ an array of key names, or an object with key-value pairs to compare.
+- `options` - an optional object with the following optional settings:
+ - `deep` - if `true`, performed a deep comparison of the values.
+ - `once` - if `true`, allows only one occurrence of each value.
+ - `only` - if `true`, does not allow values not explicitly listed.
+ - `part` - if `true`, allows partial match of the values (at least one must always match).
+
+Note: comparing a string to overlapping values will result in failed comparison (e.g. `contain('abc', ['ab', 'bc'])`).
+Also, if an object key's value does not match the provided value, `false` is returned even when `part` is specified.
+
+```javascript
+Hoek.contain('aaa', 'a', { only: true }); // true
+Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true }); // true
+Hoek.contain([1, 2, 2], [1, 2], { once: true }); // false
+Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true
+```
+
+### flatten(array, [target])
+
+Flatten an array
+
+```javascript
+
+var array = [1, [2, 3]];
+
+var flattenedArray = Hoek.flatten(array); // results in [1, 2, 3]
+
+array = [1, [2, 3]];
+target = [4, [5]];
+
+flattenedArray = Hoek.flatten(array, target); // results in [4, [5], 1, 2, 3]
+```
+
+### reach(obj, chain, [options])
+
+Converts an object key chain string to reference
+
+- `options` - optional settings
+ - `separator` - string to split chain path on, defaults to '.'
+ - `default` - value to return if the path or value is not present, default is `undefined`
+ - `strict` - if `true`, will throw an error on missing member, default is `false`
+ - `functions` - if `true` allow traversing functions for properties. `false` will throw an error if a function is part of the chain.
+
+A chain including negative numbers will work like negative indices on an
+array.
+
+```javascript
+
+var chain = 'a.b.c';
+var obj = {a : {b : { c : 1}}};
+
+Hoek.reach(obj, chain); // returns 1
+
+var chain = 'a.b.-1';
+var obj = {a : {b : [2,3,6]}};
+
+Hoek.reach(obj, chain); // returns 6
+```
+
+### reachTemplate(obj, template, [options])
+
+Replaces string parameters (`{name}`) with their corresponding object key values by applying the
+(`reach()`)[#reachobj-chain-options] method where:
+
+- `obj` - the context object used for key lookup.
+- `template` - a string containing `{}` parameters.
+- `options` - optional (`reach()`)[#reachobj-chain-options] options.
+
+```javascript
+
+var chain = 'a.b.c';
+var obj = {a : {b : { c : 1}}};
+
+Hoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'
+```
+
+### transform(obj, transform, [options])
+
+Transforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options.
+
+```javascript
+var source = {
+ address: {
+ one: '123 main street',
+ two: 'PO Box 1234'
+ },
+ title: 'Warehouse',
+ state: 'CA'
+};
+
+var result = Hoek.transform(source, {
+ 'person.address.lineOne': 'address.one',
+ 'person.address.lineTwo': 'address.two',
+ 'title': 'title',
+ 'person.address.region': 'state'
+});
+// Results in
+// {
+// person: {
+// address: {
+// lineOne: '123 main street',
+// lineTwo: 'PO Box 1234',
+// region: 'CA'
+// }
+// },
+// title: 'Warehouse'
+// }
+```
+
+### shallow(obj)
+
+Performs a shallow copy by copying the references of all the top level children where:
+- `obj` - the object to be copied.
+
+```javascript
+var shallow = Hoek.shallow({ a: { b: 1 } });
+```
+
+### stringify(obj)
+
+Converts an object to string using the built-in `JSON.stringify()` method with the difference that any errors are caught
+and reported back in the form of the returned string. Used as a shortcut for displaying information to the console (e.g. in
+error message) without the need to worry about invalid conversion.
+
+```javascript
+var a = {};
+a.b = a;
+Hoek.stringify(a); // Returns '[Cannot display object: Converting circular structure to JSON]'
+```
+
+# Timer
+
+A Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
+
+```javascript
+
+var timerObj = new Hoek.Timer();
+console.log("Time is now: " + timerObj.ts);
+console.log("Elapsed time from initialization: " + timerObj.elapsed() + 'milliseconds');
+```
+
+
+# Bench
+
+Same as Timer with the exception that `ts` stores the internal node clock which is not related to `Date.now()` and cannot be used to display
+human-readable timestamps. More accurate for benchmarking or internal timers.
+
+# Binary Encoding/Decoding
+
+### base64urlEncode(value)
+
+Encodes value in Base64 or URL encoding
+
+### base64urlDecode(value)
+
+Decodes data in Base64 or URL encoding.
+# Escaping Characters
+
+Hoek provides convenient methods for escaping html characters. The escaped characters are as followed:
+
+```javascript
+
+internals.htmlEscaped = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ '`': '`'
+};
+```
+
+### escapeHtml(string)
+
+```javascript
+
+var string = '<html> hey </html>';
+var escapedString = Hoek.escapeHtml(string); // returns <html> hey </html>
+```
+
+### escapeHeaderAttribute(attribute)
+
+Escape attribute value for use in HTTP header
+
+```javascript
+
+var a = Hoek.escapeHeaderAttribute('I said "go w\\o me"'); //returns I said \"go w\\o me\"
+```
+
+
+### escapeRegex(string)
+
+Escape string for Regex construction
+
+```javascript
+
+var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); // returns 4\^f\$s\.4\*5\+\-_\?%\=#\!\:@\|~\\\/`"\(>\)\[<\]d\{\}s\,
+```
+
+# Errors
+
+### assert(condition, message)
+
+```javascript
+
+var a = 1, b = 2;
+
+Hoek.assert(a === b, 'a should equal b'); // Throws 'a should equal b'
+```
+
+Note that you may also pass an already created Error object as the second parameter, and `assert` will throw that object.
+
+```javascript
+
+var a = 1, b = 2;
+
+Hoek.assert(a === b, new Error('a should equal b')); // Throws the given error object
+```
+
+### abort(message)
+
+First checks if `process.env.NODE_ENV === 'test'`, and if so, throws error message. Otherwise,
+displays most recent stack and then exits process.
+
+
+
+### displayStack(slice)
+
+Displays the trace stack
+
+```javascript
+
+var stack = Hoek.displayStack();
+console.log(stack); // returns something like:
+
+[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',
+ 'Module._compile (module.js:449:26)',
+ 'Module._extensions..js (module.js:467:10)',
+ 'Module.load (module.js:356:32)',
+ 'Module._load (module.js:312:12)',
+ 'Module.runMain (module.js:492:10)',
+ 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]
+```
+
+### callStack(slice)
+
+Returns a trace stack array.
+
+```javascript
+
+var stack = Hoek.callStack();
+console.log(stack); // returns something like:
+
+[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],
+ [ 'module.js', 449, 26, 'Module._compile', false ],
+ [ 'module.js', 467, 10, 'Module._extensions..js', false ],
+ [ 'module.js', 356, 32, 'Module.load', false ],
+ [ 'module.js', 312, 12, 'Module._load', false ],
+ [ 'module.js', 492, 10, 'Module.runMain', false ],
+ [ 'node.js',
+ 244,
+ 9,
+ 'startup.processNextTick.process._tickCallback',
+ false ] ]
+```
+
+## Function
+
+### nextTick(fn)
+
+Returns a new function that wraps `fn` in `process.nextTick`.
+
+```javascript
+
+var myFn = function () {
+ console.log('Do this later');
+};
+
+var nextFn = Hoek.nextTick(myFn);
+
+nextFn();
+console.log('Do this first');
+
+// Results in:
+//
+// Do this first
+// Do this later
+```
+
+### once(fn)
+
+Returns a new function that can be run multiple times, but makes sure `fn` is only run once.
+
+```javascript
+
+var myFn = function () {
+ console.log('Ran myFn');
+};
+
+var onceFn = Hoek.once(myFn);
+onceFn(); // results in "Ran myFn"
+onceFn(); // results in undefined
+```
+
+### ignore
+
+A simple no-op function. It does nothing at all.
+
+## Miscellaneous
+
+### uniqueFilename(path, extension)
+`path` to prepend with the randomly generated file name. `extension` is the optional file extension, defaults to `''`.
+
+Returns a randomly generated file name at the specified `path`. The result is a fully resolved path to a file.
+
+```javascript
+var result = Hoek.uniqueFilename('./test/modules', 'txt'); // results in "full/path/test/modules/{random}.txt"
+```
+
+### isInteger(value)
+
+Check `value` to see if it is an integer. Returns true/false.
+
+```javascript
+var result = Hoek.isInteger('23')
+```
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/images/hoek.png
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/images/hoek.png b/node_modules/wreck/node_modules/hoek/images/hoek.png
new file mode 100755
index 0000000..6ccfcb1
Binary files /dev/null and b/node_modules/wreck/node_modules/hoek/images/hoek.png differ
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/index.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/index.js b/node_modules/wreck/node_modules/hoek/index.js
new file mode 100755
index 0000000..bb0a047
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib');
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/lib/escape.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/lib/escape.js b/node_modules/wreck/node_modules/hoek/lib/escape.js
new file mode 100755
index 0000000..9ecde66
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/lib/escape.js
@@ -0,0 +1,132 @@
+// Declare internals
+
+var internals = {};
+
+
+exports.escapeJavaScript = function (input) {
+
+ if (!input) {
+ return '';
+ }
+
+ var escaped = '';
+
+ for (var i = 0, il = input.length; i < il; ++i) {
+
+ var charCode = input.charCodeAt(i);
+
+ if (internals.isSafe(charCode)) {
+ escaped += input[i];
+ }
+ else {
+ escaped += internals.escapeJavaScriptChar(charCode);
+ }
+ }
+
+ return escaped;
+};
+
+
+exports.escapeHtml = function (input) {
+
+ if (!input) {
+ return '';
+ }
+
+ var escaped = '';
+
+ for (var i = 0, il = input.length; i < il; ++i) {
+
+ var charCode = input.charCodeAt(i);
+
+ if (internals.isSafe(charCode)) {
+ escaped += input[i];
+ }
+ else {
+ escaped += internals.escapeHtmlChar(charCode);
+ }
+ }
+
+ return escaped;
+};
+
+
+internals.escapeJavaScriptChar = function (charCode) {
+
+ if (charCode >= 256) {
+ return '\\u' + internals.padLeft('' + charCode, 4);
+ }
+
+ var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+ return '\\x' + internals.padLeft(hexValue, 2);
+};
+
+
+internals.escapeHtmlChar = function (charCode) {
+
+ var namedEscape = internals.namedHtml[charCode];
+ if (typeof namedEscape !== 'undefined') {
+ return namedEscape;
+ }
+
+ if (charCode >= 256) {
+ return '&#' + charCode + ';';
+ }
+
+ var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+ return '&#x' + internals.padLeft(hexValue, 2) + ';';
+};
+
+
+internals.padLeft = function (str, len) {
+
+ while (str.length < len) {
+ str = '0' + str;
+ }
+
+ return str;
+};
+
+
+internals.isSafe = function (charCode) {
+
+ return (typeof internals.safeCharCodes[charCode] !== 'undefined');
+};
+
+
+internals.namedHtml = {
+ '38': '&',
+ '60': '<',
+ '62': '>',
+ '34': '"',
+ '160': ' ',
+ '162': '¢',
+ '163': '£',
+ '164': '¤',
+ '169': '©',
+ '174': '®'
+};
+
+
+internals.safeCharCodes = (function () {
+
+ var safe = {};
+
+ for (var i = 32; i < 123; ++i) {
+
+ if ((i >= 97) || // a-z
+ (i >= 65 && i <= 90) || // A-Z
+ (i >= 48 && i <= 57) || // 0-9
+ i === 32 || // space
+ i === 46 || // .
+ i === 44 || // ,
+ i === 45 || // -
+ i === 58 || // :
+ i === 95) { // _
+
+ safe[i] = null;
+ }
+ }
+
+ return safe;
+}());
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/lib/index.js b/node_modules/wreck/node_modules/hoek/lib/index.js
new file mode 100755
index 0000000..5f6f90c
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/lib/index.js
@@ -0,0 +1,977 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Path = require('path');
+var Util = require('util');
+var Escape = require('./escape');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Clone object or array
+
+exports.clone = function (obj, seen) {
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return obj;
+ }
+
+ seen = seen || { orig: [], copy: [] };
+
+ var lookup = seen.orig.indexOf(obj);
+ if (lookup !== -1) {
+ return seen.copy[lookup];
+ }
+
+ var newObj;
+ var cloneDeep = false;
+
+ if (!Array.isArray(obj)) {
+ if (Buffer.isBuffer(obj)) {
+ newObj = new Buffer(obj);
+ }
+ else if (obj instanceof Date) {
+ newObj = new Date(obj.getTime());
+ }
+ else if (obj instanceof RegExp) {
+ newObj = new RegExp(obj);
+ }
+ else {
+ var proto = Object.getPrototypeOf(obj);
+ if (proto &&
+ proto.isImmutable) {
+
+ newObj = obj;
+ }
+ else {
+ newObj = Object.create(proto);
+ cloneDeep = true;
+ }
+ }
+ }
+ else {
+ newObj = [];
+ cloneDeep = true;
+ }
+
+ seen.orig.push(obj);
+ seen.copy.push(newObj);
+
+ if (cloneDeep) {
+ var keys = Object.getOwnPropertyNames(obj);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var descriptor = Object.getOwnPropertyDescriptor(obj, key);
+ if (descriptor.get ||
+ descriptor.set) {
+
+ Object.defineProperty(newObj, key, descriptor);
+ }
+ else {
+ newObj[key] = exports.clone(obj[key], seen);
+ }
+ }
+ }
+
+ return newObj;
+};
+
+
+// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied
+/*eslint-disable */
+exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) {
+/*eslint-enable */
+ exports.assert(target && typeof target === 'object', 'Invalid target value: must be an object');
+ exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
+
+ if (!source) {
+ return target;
+ }
+
+ if (Array.isArray(source)) {
+ exports.assert(Array.isArray(target), 'Cannot merge array onto an object');
+ if (isMergeArrays === false) { // isMergeArrays defaults to true
+ target.length = 0; // Must not change target assignment
+ }
+
+ for (var i = 0, il = source.length; i < il; ++i) {
+ target.push(exports.clone(source[i]));
+ }
+
+ return target;
+ }
+
+ var keys = Object.keys(source);
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var value = source[key];
+ if (value &&
+ typeof value === 'object') {
+
+ if (!target[key] ||
+ typeof target[key] !== 'object' ||
+ (Array.isArray(target[key]) ^ Array.isArray(value)) ||
+ value instanceof Date ||
+ Buffer.isBuffer(value) ||
+ value instanceof RegExp) {
+
+ target[key] = exports.clone(value);
+ }
+ else {
+ exports.merge(target[key], value, isNullOverride, isMergeArrays);
+ }
+ }
+ else {
+ if (value !== null &&
+ value !== undefined) { // Explicit to preserve empty strings
+
+ target[key] = value;
+ }
+ else if (isNullOverride !== false) { // Defaults to true
+ target[key] = value;
+ }
+ }
+ }
+
+ return target;
+};
+
+
+// Apply options to a copy of the defaults
+
+exports.applyToDefaults = function (defaults, options, isNullOverride) {
+
+ exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
+ exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
+
+ if (!options) { // If no options, return null
+ return null;
+ }
+
+ var copy = exports.clone(defaults);
+
+ if (options === true) { // If options is set to true, use defaults
+ return copy;
+ }
+
+ return exports.merge(copy, options, isNullOverride === true, false);
+};
+
+
+// Clone an object except for the listed keys which are shallow copied
+
+exports.cloneWithShallow = function (source, keys) {
+
+ if (!source ||
+ typeof source !== 'object') {
+
+ return source;
+ }
+
+ var storage = internals.store(source, keys); // Move shallow copy items to storage
+ var copy = exports.clone(source); // Deep copy the rest
+ internals.restore(copy, source, storage); // Shallow copy the stored items and restore
+ return copy;
+};
+
+
+internals.store = function (source, keys) {
+
+ var storage = {};
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var value = exports.reach(source, key);
+ if (value !== undefined) {
+ storage[key] = value;
+ internals.reachSet(source, key, undefined);
+ }
+ }
+
+ return storage;
+};
+
+
+internals.restore = function (copy, source, storage) {
+
+ var keys = Object.keys(storage);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ internals.reachSet(copy, key, storage[key]);
+ internals.reachSet(source, key, storage[key]);
+ }
+};
+
+
+internals.reachSet = function (obj, key, value) {
+
+ var path = key.split('.');
+ var ref = obj;
+ for (var i = 0, il = path.length; i < il; ++i) {
+ var segment = path[i];
+ if (i + 1 === il) {
+ ref[segment] = value;
+ }
+
+ ref = ref[segment];
+ }
+};
+
+
+// Apply options to defaults except for the listed keys which are shallow copied from option without merging
+
+exports.applyToDefaultsWithShallow = function (defaults, options, keys) {
+
+ exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
+ exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
+ exports.assert(keys && Array.isArray(keys), 'Invalid keys');
+
+ if (!options) { // If no options, return null
+ return null;
+ }
+
+ var copy = exports.cloneWithShallow(defaults, keys);
+
+ if (options === true) { // If options is set to true, use defaults
+ return copy;
+ }
+
+ var storage = internals.store(options, keys); // Move shallow copy items to storage
+ exports.merge(copy, options, false, false); // Deep copy the rest
+ internals.restore(copy, options, storage); // Shallow copy the stored items and restore
+ return copy;
+};
+
+
+// Deep object or array comparison
+
+exports.deepEqual = function (obj, ref, options, seen) {
+
+ options = options || { prototype: true };
+
+ var type = typeof obj;
+
+ if (type !== typeof ref) {
+ return false;
+ }
+
+ if (type !== 'object' ||
+ obj === null ||
+ ref === null) {
+
+ if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql
+ return obj !== 0 || 1 / obj === 1 / ref; // -0 / +0
+ }
+
+ return obj !== obj && ref !== ref; // NaN
+ }
+
+ seen = seen || [];
+ if (seen.indexOf(obj) !== -1) {
+ return true; // If previous comparison failed, it would have stopped execution
+ }
+
+ seen.push(obj);
+
+ if (Array.isArray(obj)) {
+ if (!Array.isArray(ref)) {
+ return false;
+ }
+
+ if (!options.part && obj.length !== ref.length) {
+ return false;
+ }
+
+ for (var i = 0, il = obj.length; i < il; ++i) {
+ if (options.part) {
+ var found = false;
+ for (var r = 0, rl = ref.length; r < rl; ++r) {
+ if (exports.deepEqual(obj[i], ref[r], options, seen)) {
+ found = true;
+ break;
+ }
+ }
+
+ return found;
+ }
+
+ if (!exports.deepEqual(obj[i], ref[i], options, seen)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (Buffer.isBuffer(obj)) {
+ if (!Buffer.isBuffer(ref)) {
+ return false;
+ }
+
+ if (obj.length !== ref.length) {
+ return false;
+ }
+
+ for (var j = 0, jl = obj.length; j < jl; ++j) {
+ if (obj[j] !== ref[j]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (obj instanceof Date) {
+ return (ref instanceof Date && obj.getTime() === ref.getTime());
+ }
+
+ if (obj instanceof RegExp) {
+ return (ref instanceof RegExp && obj.toString() === ref.toString());
+ }
+
+ if (options.prototype) {
+ if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) {
+ return false;
+ }
+ }
+
+ var keys = Object.getOwnPropertyNames(obj);
+
+ if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) {
+ return false;
+ }
+
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var descriptor = Object.getOwnPropertyDescriptor(obj, key);
+ if (descriptor.get) {
+ if (!exports.deepEqual(descriptor, Object.getOwnPropertyDescriptor(ref, key), options, seen)) {
+ return false;
+ }
+ }
+ else if (!exports.deepEqual(obj[key], ref[key], options, seen)) {
+ return false;
+ }
+ }
+
+ return true;
+};
+
+
+// Remove duplicate items from array
+
+exports.unique = function (array, key) {
+
+ var index = {};
+ var result = [];
+
+ for (var i = 0, il = array.length; i < il; ++i) {
+ var id = (key ? array[i][key] : array[i]);
+ if (index[id] !== true) {
+
+ result.push(array[i]);
+ index[id] = true;
+ }
+ }
+
+ return result;
+};
+
+
+// Convert array into object
+
+exports.mapToObject = function (array, key) {
+
+ if (!array) {
+ return null;
+ }
+
+ var obj = {};
+ for (var i = 0, il = array.length; i < il; ++i) {
+ if (key) {
+ if (array[i][key]) {
+ obj[array[i][key]] = true;
+ }
+ }
+ else {
+ obj[array[i]] = true;
+ }
+ }
+
+ return obj;
+};
+
+
+// Find the common unique items in two arrays
+
+exports.intersect = function (array1, array2, justFirst) {
+
+ if (!array1 || !array2) {
+ return [];
+ }
+
+ var common = [];
+ var hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1);
+ var found = {};
+ for (var i = 0, il = array2.length; i < il; ++i) {
+ if (hash[array2[i]] && !found[array2[i]]) {
+ if (justFirst) {
+ return array2[i];
+ }
+
+ common.push(array2[i]);
+ found[array2[i]] = true;
+ }
+ }
+
+ return (justFirst ? null : common);
+};
+
+
+// Test if the reference contains the values
+
+exports.contain = function (ref, values, options) {
+
+ /*
+ string -> string(s)
+ array -> item(s)
+ object -> key(s)
+ object -> object (key:value)
+ */
+
+ var valuePairs = null;
+ if (typeof ref === 'object' &&
+ typeof values === 'object' &&
+ !Array.isArray(ref) &&
+ !Array.isArray(values)) {
+
+ valuePairs = values;
+ values = Object.keys(values);
+ }
+ else {
+ values = [].concat(values);
+ }
+
+ options = options || {}; // deep, once, only, part
+
+ exports.assert(arguments.length >= 2, 'Insufficient arguments');
+ exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object');
+ exports.assert(values.length, 'Values array cannot be empty');
+
+ var compare, compareFlags;
+ if (options.deep) {
+ compare = exports.deepEqual;
+
+ var hasOnly = options.hasOwnProperty('only'), hasPart = options.hasOwnProperty('part');
+
+ compareFlags = {
+ prototype: hasOnly ? options.only : hasPart ? !options.part : false,
+ part: hasOnly ? !options.only : hasPart ? options.part : true
+ };
+ }
+ else {
+ compare = function (a, b) {
+
+ return a === b;
+ };
+ }
+
+ var misses = false;
+ var matches = new Array(values.length);
+ for (var i = 0, il = matches.length; i < il; ++i) {
+ matches[i] = 0;
+ }
+
+ if (typeof ref === 'string') {
+ var pattern = '(';
+ for (i = 0, il = values.length; i < il; ++i) {
+ var value = values[i];
+ exports.assert(typeof value === 'string', 'Cannot compare string reference to non-string value');
+ pattern += (i ? '|' : '') + exports.escapeRegex(value);
+ }
+
+ var regex = new RegExp(pattern + ')', 'g');
+ var leftovers = ref.replace(regex, function ($0, $1) {
+
+ var index = values.indexOf($1);
+ ++matches[index];
+ return ''; // Remove from string
+ });
+
+ misses = !!leftovers;
+ }
+ else if (Array.isArray(ref)) {
+ for (i = 0, il = ref.length; i < il; ++i) {
+ for (var j = 0, jl = values.length, matched = false; j < jl && matched === false; ++j) {
+ matched = compare(values[j], ref[i], compareFlags) && j;
+ }
+
+ if (matched !== false) {
+ ++matches[matched];
+ }
+ else {
+ misses = true;
+ }
+ }
+ }
+ else {
+ var keys = Object.keys(ref);
+ for (i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var pos = values.indexOf(key);
+ if (pos !== -1) {
+ if (valuePairs &&
+ !compare(valuePairs[key], ref[key], compareFlags)) {
+
+ return false;
+ }
+
+ ++matches[pos];
+ }
+ else {
+ misses = true;
+ }
+ }
+ }
+
+ var result = false;
+ for (i = 0, il = matches.length; i < il; ++i) {
+ result = result || !!matches[i];
+ if ((options.once && matches[i] > 1) ||
+ (!options.part && !matches[i])) {
+
+ return false;
+ }
+ }
+
+ if (options.only &&
+ misses) {
+
+ return false;
+ }
+
+ return result;
+};
+
+
+// Flatten array
+
+exports.flatten = function (array, target) {
+
+ var result = target || [];
+
+ for (var i = 0, il = array.length; i < il; ++i) {
+ if (Array.isArray(array[i])) {
+ exports.flatten(array[i], result);
+ }
+ else {
+ result.push(array[i]);
+ }
+ }
+
+ return result;
+};
+
+
+// Convert an object key chain string ('a.b.c') to reference (object[a][b][c])
+
+exports.reach = function (obj, chain, options) {
+
+ options = options || {};
+ if (typeof options === 'string') {
+ options = { separator: options };
+ }
+
+ var path = chain.split(options.separator || '.');
+ var ref = obj;
+ for (var i = 0, il = path.length; i < il; ++i) {
+ var key = path[i];
+ if (key[0] === '-' && Array.isArray(ref)) {
+ key = key.slice(1, key.length);
+ key = ref.length - key;
+ }
+
+ if (!ref ||
+ !ref.hasOwnProperty(key) ||
+ (typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties
+
+ exports.assert(!options.strict || i + 1 === il, 'Missing segment', key, 'in reach path ', chain);
+ exports.assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain);
+ ref = options.default;
+ break;
+ }
+
+ ref = ref[key];
+ }
+
+ return ref;
+};
+
+
+exports.reachTemplate = function (obj, template, options) {
+
+ return template.replace(/{([^}]+)}/g, function ($0, chain) {
+
+ var value = exports.reach(obj, chain, options);
+ return (value === undefined || value === null ? '' : value);
+ });
+};
+
+
+exports.formatStack = function (stack) {
+
+ var trace = [];
+ for (var i = 0, il = stack.length; i < il; ++i) {
+ var item = stack[i];
+ trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]);
+ }
+
+ return trace;
+};
+
+
+exports.formatTrace = function (trace) {
+
+ var display = [];
+
+ for (var i = 0, il = trace.length; i < il; ++i) {
+ var row = trace[i];
+ display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')');
+ }
+
+ return display;
+};
+
+
+exports.callStack = function (slice) {
+
+ // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+
+ var v8 = Error.prepareStackTrace;
+ Error.prepareStackTrace = function (err, stack) {
+
+ return stack;
+ };
+
+ var capture = {};
+ Error.captureStackTrace(capture, arguments.callee); /*eslint no-caller:0 */
+ var stack = capture.stack;
+
+ Error.prepareStackTrace = v8;
+
+ var trace = exports.formatStack(stack);
+
+ if (slice) {
+ return trace.slice(slice);
+ }
+
+ return trace;
+};
+
+
+exports.displayStack = function (slice) {
+
+ var trace = exports.callStack(slice === undefined ? 1 : slice + 1);
+
+ return exports.formatTrace(trace);
+};
+
+
+exports.abortThrow = false;
+
+
+exports.abort = function (message, hideStack) {
+
+ if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) {
+ throw new Error(message || 'Unknown error');
+ }
+
+ var stack = '';
+ if (!hideStack) {
+ stack = exports.displayStack(1).join('\n\t');
+ }
+ console.log('ABORT: ' + message + '\n\t' + stack);
+ process.exit(1);
+};
+
+
+exports.assert = function (condition /*, msg1, msg2, msg3 */) {
+
+ if (condition) {
+ return;
+ }
+
+ if (arguments.length === 2 && arguments[1] instanceof Error) {
+ throw arguments[1];
+ }
+
+ var msgs = [];
+ for (var i = 1, il = arguments.length; i < il; ++i) {
+ if (arguments[i] !== '') {
+ msgs.push(arguments[i]); // Avoids Array.slice arguments leak, allowing for V8 optimizations
+ }
+ }
+
+ msgs = msgs.map(function (msg) {
+
+ return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : exports.stringify(msg);
+ });
+ throw new Error(msgs.join(' ') || 'Unknown error');
+};
+
+
+exports.Timer = function () {
+
+ this.ts = 0;
+ this.reset();
+};
+
+
+exports.Timer.prototype.reset = function () {
+
+ this.ts = Date.now();
+};
+
+
+exports.Timer.prototype.elapsed = function () {
+
+ return Date.now() - this.ts;
+};
+
+
+exports.Bench = function () {
+
+ this.ts = 0;
+ this.reset();
+};
+
+
+exports.Bench.prototype.reset = function () {
+
+ this.ts = exports.Bench.now();
+};
+
+
+exports.Bench.prototype.elapsed = function () {
+
+ return exports.Bench.now() - this.ts;
+};
+
+
+exports.Bench.now = function () {
+
+ var ts = process.hrtime();
+ return (ts[0] * 1e3) + (ts[1] / 1e6);
+};
+
+
+// Escape string for Regex construction
+
+exports.escapeRegex = function (string) {
+
+ // Escape ^$.*+-?=!:|\/()[]{},
+ return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
+};
+
+
+// Base64url (RFC 4648) encode
+
+exports.base64urlEncode = function (value, encoding) {
+
+ var buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary'));
+ return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+};
+
+
+// Base64url (RFC 4648) decode
+
+exports.base64urlDecode = function (value, encoding) {
+
+ if (value &&
+ !/^[\w\-]*$/.test(value)) {
+
+ return new Error('Invalid character');
+ }
+
+ try {
+ var buf = new Buffer(value, 'base64');
+ return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary'));
+ }
+ catch (err) {
+ return err;
+ }
+};
+
+
+// Escape attribute value for use in HTTP header
+
+exports.escapeHeaderAttribute = function (attribute) {
+
+ // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
+
+ exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')');
+
+ return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash
+};
+
+
+exports.escapeHtml = function (string) {
+
+ return Escape.escapeHtml(string);
+};
+
+
+exports.escapeJavaScript = function (string) {
+
+ return Escape.escapeJavaScript(string);
+};
+
+
+exports.nextTick = function (callback) {
+
+ return function () {
+
+ var args = arguments;
+ process.nextTick(function () {
+
+ callback.apply(null, args);
+ });
+ };
+};
+
+
+exports.once = function (method) {
+
+ if (method._hoekOnce) {
+ return method;
+ }
+
+ var once = false;
+ var wrapped = function () {
+
+ if (!once) {
+ once = true;
+ method.apply(null, arguments);
+ }
+ };
+
+ wrapped._hoekOnce = true;
+
+ return wrapped;
+};
+
+
+exports.isAbsolutePath = function (path, platform) {
+
+ if (!path) {
+ return false;
+ }
+
+ if (Path.isAbsolute) { // node >= 0.11
+ return Path.isAbsolute(path);
+ }
+
+ platform = platform || process.platform;
+
+ // Unix
+
+ if (platform !== 'win32') {
+ return path[0] === '/';
+ }
+
+ // Windows
+
+ return !!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path); // C:\ or \\something\something
+};
+
+
+exports.isInteger = function (value) {
+
+ return (typeof value === 'number' &&
+ parseFloat(value) === parseInt(value, 10) &&
+ !isNaN(value));
+};
+
+
+exports.ignore = function () { };
+
+
+exports.inherits = Util.inherits;
+
+
+exports.format = Util.format;
+
+
+exports.transform = function (source, transform, options) {
+
+ exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source object: must be null, undefined, or an object');
+
+ var result = {};
+ var keys = Object.keys(transform);
+
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var path = key.split('.');
+ var sourcePath = transform[key];
+
+ exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings');
+
+ var segment;
+ var res = result;
+
+ while (path.length > 1) {
+ segment = path.shift();
+ if (!res[segment]) {
+ res[segment] = {};
+ }
+ res = res[segment];
+ }
+ segment = path.shift();
+ res[segment] = exports.reach(source, sourcePath, options);
+ }
+
+ return result;
+};
+
+
+exports.uniqueFilename = function (path, extension) {
+
+ if (extension) {
+ extension = extension[0] !== '.' ? '.' + extension : extension;
+ }
+ else {
+ extension = '';
+ }
+
+ path = Path.resolve(path);
+ var name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension;
+ return Path.join(path, name);
+};
+
+
+exports.stringify = function () {
+
+ try {
+ return JSON.stringify.apply(null, arguments);
+ }
+ catch (err) {
+ return '[Cannot display object: ' + err.message + ']';
+ }
+};
+
+
+exports.shallow = function (source) {
+
+ var target = {};
+ var keys = Object.keys(source);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ target[key] = source[key];
+ }
+
+ return target;
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/package.json
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/package.json b/node_modules/wreck/node_modules/hoek/package.json
new file mode 100644
index 0000000..716fe27
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "hoek",
+ "description": "General purpose node utilities",
+ "version": "2.14.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hapijs/hoek.git"
+ },
+ "main": "index",
+ "keywords": [
+ "utilities"
+ ],
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "code": "1.x.x",
+ "lab": "5.x.x"
+ },
+ "scripts": {
+ "test": "make test-cov"
+ },
+ "license": "BSD-3-Clause",
+ "gitHead": "e80875a516f4b0eaa757ac4814c4510eebdcf589",
+ "bugs": {
+ "url": "https://github.com/hapijs/hoek/issues"
+ },
+ "homepage": "https://github.com/hapijs/hoek#readme",
+ "_id": "hoek@2.14.0",
+ "_shasum": "81211691f52a5a835ae49edbf1e89c9003476aa4",
+ "_from": "hoek@>=2.0.0 <3.0.0",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "0.12.2",
+ "_npmUser": {
+ "name": "nlf",
+ "email": "quitlahok@gmail.com"
+ },
+ "dist": {
+ "shasum": "81211691f52a5a835ae49edbf1e89c9003476aa4",
+ "tarball": "http://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ {
+ "name": "wyatt",
+ "email": "wpreul@gmail.com"
+ },
+ {
+ "name": "nlf",
+ "email": "quitlahok@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/test/escaper.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/test/escaper.js b/node_modules/wreck/node_modules/hoek/test/escaper.js
new file mode 100755
index 0000000..a5d048f
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/test/escaper.js
@@ -0,0 +1,88 @@
+// Load modules
+
+var Code = require('code');
+var Hoek = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('escapeJavaScript()', function () {
+
+ it('encodes / characters', function (done) {
+
+ var encoded = Hoek.escapeJavaScript('<script>alert(1)</script>');
+ expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e');
+ done();
+ });
+
+ it('encodes \' characters', function (done) {
+
+ var encoded = Hoek.escapeJavaScript('something(\'param\')');
+ expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29');
+ done();
+ });
+
+ it('encodes large unicode characters with the correct padding', function (done) {
+
+ var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000));
+ expect(encoded).to.equal('\\u0500\\u1000');
+ done();
+ });
+
+ it('doesn\'t throw an exception when passed null', function (done) {
+
+ var encoded = Hoek.escapeJavaScript(null);
+ expect(encoded).to.equal('');
+ done();
+ });
+});
+
+describe('escapeHtml()', function () {
+
+ it('encodes / characters', function (done) {
+
+ var encoded = Hoek.escapeHtml('<script>alert(1)</script>');
+ expect(encoded).to.equal('<script>alert(1)</script>');
+ done();
+ });
+
+ it('encodes < and > as named characters', function (done) {
+
+ var encoded = Hoek.escapeHtml('<script><>');
+ expect(encoded).to.equal('<script><>');
+ done();
+ });
+
+ it('encodes large unicode characters', function (done) {
+
+ var encoded = Hoek.escapeHtml(String.fromCharCode(500) + String.fromCharCode(1000));
+ expect(encoded).to.equal('ǴϨ');
+ done();
+ });
+
+ it('doesn\'t throw an exception when passed null', function (done) {
+
+ var encoded = Hoek.escapeHtml(null);
+ expect(encoded).to.equal('');
+ done();
+ });
+
+ it('encodes {} characters', function (done) {
+
+ var encoded = Hoek.escapeHtml('{}');
+ expect(encoded).to.equal('{}');
+ done();
+ });
+});
[28/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/README.md b/node_modules/request/node_modules/qs/README.md
deleted file mode 100755
index 2d7e7f5..0000000
--- a/node_modules/request/node_modules/qs/README.md
+++ /dev/null
@@ -1,233 +0,0 @@
-# qs
-
-A querystring parsing and stringifying library with some added security.
-
-[](http://travis-ci.org/hapijs/qs)
-
-Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
-
-The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
-
-## Usage
-
-```javascript
-var Qs = require('qs');
-
-var obj = Qs.parse('a=c'); // { a: 'c' }
-var str = Qs.stringify(obj); // 'a=c'
-```
-
-### Parsing Objects
-
-```javascript
-Qs.parse(string, [options]);
-```
-
-**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
-For example, the string `'foo[bar]=baz'` converts to:
-
-```javascript
-{
- foo: {
- bar: 'baz'
- }
-}
-```
-
-URI encoded strings work too:
-
-```javascript
-Qs.parse('a%5Bb%5D=c');
-// { a: { b: 'c' } }
-```
-
-You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
-
-```javascript
-{
- foo: {
- bar: {
- baz: 'foobarbaz'
- }
- }
-}
-```
-
-By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
-`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
-
-```javascript
-{
- a: {
- b: {
- c: {
- d: {
- e: {
- f: {
- '[g][h][i]': 'j'
- }
- }
- }
- }
- }
- }
-}
-```
-
-This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:
-
-```javascript
-Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
-// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }
-```
-
-The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
-
-For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
-
-```javascript
-Qs.parse('a=b&c=d', { parameterLimit: 1 });
-// { a: 'b' }
-```
-
-An optional delimiter can also be passed:
-
-```javascript
-Qs.parse('a=b;c=d', { delimiter: ';' });
-// { a: 'b', c: 'd' }
-```
-
-Delimiters can be a regular expression too:
-
-```javascript
-Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
-// { a: 'b', c: 'd', e: 'f' }
-```
-
-### Parsing Arrays
-
-**qs** can also parse arrays using a similar `[]` notation:
-
-```javascript
-Qs.parse('a[]=b&a[]=c');
-// { a: ['b', 'c'] }
-```
-
-You may specify an index as well:
-
-```javascript
-Qs.parse('a[1]=c&a[0]=b');
-// { a: ['b', 'c'] }
-```
-
-Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
-to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving
-their order:
-
-```javascript
-Qs.parse('a[1]=b&a[15]=c');
-// { a: ['b', 'c'] }
-```
-
-Note that an empty string is also a value, and will be preserved:
-
-```javascript
-Qs.parse('a[]=&a[]=b');
-// { a: ['', 'b'] }
-Qs.parse('a[0]=b&a[1]=&a[2]=c');
-// { a: ['b', '', 'c'] }
-```
-
-**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
-instead be converted to an object with the index as the key:
-
-```javascript
-Qs.parse('a[100]=b');
-// { a: { '100': 'b' } }
-```
-
-This limit can be overridden by passing an `arrayLimit` option:
-
-```javascript
-Qs.parse('a[1]=b', { arrayLimit: 0 });
-// { a: { '1': 'b' } }
-```
-
-To disable array parsing entirely, set `arrayLimit` to `-1`.
-
-If you mix notations, **qs** will merge the two items into an object:
-
-```javascript
-Qs.parse('a[0]=b&a[b]=c');
-// { a: { '0': 'b', b: 'c' } }
-```
-
-You can also create arrays of objects:
-
-```javascript
-Qs.parse('a[][b]=c');
-// { a: [{ b: 'c' }] }
-```
-
-### Stringifying
-
-```javascript
-Qs.stringify(object, [options]);
-```
-
-When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect:
-
-```javascript
-Qs.stringify({ a: 'b' });
-// 'a=b'
-Qs.stringify({ a: { b: 'c' } });
-// 'a%5Bb%5D=c'
-```
-
-Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
-
-When arrays are stringified, by default they are given explicit indices:
-
-```javascript
-Qs.stringify({ a: ['b', 'c', 'd'] });
-// 'a[0]=b&a[1]=c&a[2]=d'
-```
-
-You may override this by setting the `indices` option to `false`:
-
-```javascript
-Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
-// 'a=b&a=c&a=d'
-```
-
-You may use the `arrayFormat` option to specify the format of the output array
-
-```javascript
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
-// 'a[0]=b&a[1]=c'
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
-// 'a[]=b&a[]=c'
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
-// 'a=b&a=c'
-```
-
-Empty strings and null values will omit the value, but the equals sign (=) remains in place:
-
-```javascript
-Qs.stringify({ a: '' });
-// 'a='
-```
-
-Properties that are set to `undefined` will be omitted entirely:
-
-```javascript
-Qs.stringify({ a: null, b: undefined });
-// 'a='
-```
-
-The delimiter may be overridden with stringify as well:
-
-```javascript
-Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });
-// 'a=b;c=d'
-```
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/index.js b/node_modules/request/node_modules/qs/index.js
deleted file mode 100644
index 2291cd8..0000000
--- a/node_modules/request/node_modules/qs/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib/');
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/index.js b/node_modules/request/node_modules/qs/lib/index.js
deleted file mode 100755
index 0e09493..0000000
--- a/node_modules/request/node_modules/qs/lib/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Load modules
-
-var Stringify = require('./stringify');
-var Parse = require('./parse');
-
-
-// Declare internals
-
-var internals = {};
-
-
-module.exports = {
- stringify: Stringify,
- parse: Parse
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/lib/parse.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/parse.js b/node_modules/request/node_modules/qs/lib/parse.js
deleted file mode 100755
index 5c154bb..0000000
--- a/node_modules/request/node_modules/qs/lib/parse.js
+++ /dev/null
@@ -1,157 +0,0 @@
-// Load modules
-
-var Utils = require('./utils');
-
-
-// Declare internals
-
-var internals = {
- delimiter: '&',
- depth: 5,
- arrayLimit: 20,
- parameterLimit: 1000
-};
-
-
-internals.parseValues = function (str, options) {
-
- var obj = {};
- var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
-
- for (var i = 0, il = parts.length; i < il; ++i) {
- var part = parts[i];
- var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
-
- if (pos === -1) {
- obj[Utils.decode(part)] = '';
- }
- else {
- var key = Utils.decode(part.slice(0, pos));
- var val = Utils.decode(part.slice(pos + 1));
-
- if (!Object.prototype.hasOwnProperty.call(obj, key)) {
- obj[key] = val;
- }
- else {
- obj[key] = [].concat(obj[key]).concat(val);
- }
- }
- }
-
- return obj;
-};
-
-
-internals.parseObject = function (chain, val, options) {
-
- if (!chain.length) {
- return val;
- }
-
- var root = chain.shift();
-
- var obj = {};
- if (root === '[]') {
- obj = [];
- obj = obj.concat(internals.parseObject(chain, val, options));
- }
- else {
- var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
- var index = parseInt(cleanRoot, 10);
- var indexString = '' + index;
- if (!isNaN(index) &&
- root !== cleanRoot &&
- indexString === cleanRoot &&
- index >= 0 &&
- index <= options.arrayLimit) {
-
- obj = [];
- obj[index] = internals.parseObject(chain, val, options);
- }
- else {
- obj[cleanRoot] = internals.parseObject(chain, val, options);
- }
- }
-
- return obj;
-};
-
-
-internals.parseKeys = function (key, val, options) {
-
- if (!key) {
- return;
- }
-
- // The regex chunks
-
- var parent = /^([^\[\]]*)/;
- var child = /(\[[^\[\]]*\])/g;
-
- // Get the parent
-
- var segment = parent.exec(key);
-
- // Don't allow them to overwrite object prototype properties
-
- if (Object.prototype.hasOwnProperty(segment[1])) {
- return;
- }
-
- // Stash the parent if it exists
-
- var keys = [];
- if (segment[1]) {
- keys.push(segment[1]);
- }
-
- // Loop through children appending to the array until we hit depth
-
- var i = 0;
- while ((segment = child.exec(key)) !== null && i < options.depth) {
-
- ++i;
- if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
- keys.push(segment[1]);
- }
- }
-
- // If there's a remainder, just add whatever is left
-
- if (segment) {
- keys.push('[' + key.slice(segment.index) + ']');
- }
-
- return internals.parseObject(keys, val, options);
-};
-
-
-module.exports = function (str, options) {
-
- if (str === '' ||
- str === null ||
- typeof str === 'undefined') {
-
- return {};
- }
-
- options = options || {};
- options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
- options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
- options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
- options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
-
- var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str;
- var obj = {};
-
- // Iterate over the keys and setup the new object
-
- var keys = Object.keys(tempObj);
- for (var i = 0, il = keys.length; i < il; ++i) {
- var key = keys[i];
- var newObj = internals.parseKeys(key, tempObj[key], options);
- obj = Utils.merge(obj, newObj);
- }
-
- return Utils.compact(obj);
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/lib/stringify.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/stringify.js b/node_modules/request/node_modules/qs/lib/stringify.js
deleted file mode 100755
index 3ce6cc1..0000000
--- a/node_modules/request/node_modules/qs/lib/stringify.js
+++ /dev/null
@@ -1,97 +0,0 @@
-// Load modules
-
-var Utils = require('./utils');
-
-
-// Declare internals
-
-var internals = {
- delimiter: '&',
- arrayPrefixGenerators: {
- brackets: function (prefix, key) {
- return prefix + '[]';
- },
- indices: function (prefix, key) {
- return prefix + '[' + key + ']';
- },
- repeat: function (prefix, key) {
- return prefix;
- }
- }
-};
-
-
-internals.stringify = function (obj, prefix, generateArrayPrefix) {
-
- if (Utils.isBuffer(obj)) {
- obj = obj.toString();
- }
- else if (obj instanceof Date) {
- obj = obj.toISOString();
- }
- else if (obj === null) {
- obj = '';
- }
-
- if (typeof obj === 'string' ||
- typeof obj === 'number' ||
- typeof obj === 'boolean') {
-
- return [encodeURIComponent(prefix) + '=' + encodeURIComponent(obj)];
- }
-
- var values = [];
-
- if (typeof obj === 'undefined') {
- return values;
- }
-
- var objKeys = Object.keys(obj);
- for (var i = 0, il = objKeys.length; i < il; ++i) {
- var key = objKeys[i];
- if (Array.isArray(obj)) {
- values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix));
- }
- else {
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix));
- }
- }
-
- return values;
-};
-
-
-module.exports = function (obj, options) {
-
- options = options || {};
- var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
-
- var keys = [];
-
- if (typeof obj !== 'object' ||
- obj === null) {
-
- return '';
- }
-
- var arrayFormat;
- if (options.arrayFormat in internals.arrayPrefixGenerators) {
- arrayFormat = options.arrayFormat;
- }
- else if ('indices' in options) {
- arrayFormat = options.indices ? 'indices' : 'repeat';
- }
- else {
- arrayFormat = 'indices';
- }
-
- var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat];
-
- var objKeys = Object.keys(obj);
- for (var i = 0, il = objKeys.length; i < il; ++i) {
- var key = objKeys[i];
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix));
- }
-
- return keys.join(delimiter);
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/lib/utils.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/lib/utils.js b/node_modules/request/node_modules/qs/lib/utils.js
deleted file mode 100755
index 5240bd5..0000000
--- a/node_modules/request/node_modules/qs/lib/utils.js
+++ /dev/null
@@ -1,132 +0,0 @@
-// Load modules
-
-
-// Declare internals
-
-var internals = {};
-
-
-exports.arrayToObject = function (source) {
-
- var obj = {};
- for (var i = 0, il = source.length; i < il; ++i) {
- if (typeof source[i] !== 'undefined') {
-
- obj[i] = source[i];
- }
- }
-
- return obj;
-};
-
-
-exports.merge = function (target, source) {
-
- if (!source) {
- return target;
- }
-
- if (typeof source !== 'object') {
- if (Array.isArray(target)) {
- target.push(source);
- }
- else {
- target[source] = true;
- }
-
- return target;
- }
-
- if (typeof target !== 'object') {
- target = [target].concat(source);
- return target;
- }
-
- if (Array.isArray(target) &&
- !Array.isArray(source)) {
-
- target = exports.arrayToObject(target);
- }
-
- var keys = Object.keys(source);
- for (var k = 0, kl = keys.length; k < kl; ++k) {
- var key = keys[k];
- var value = source[key];
-
- if (!target[key]) {
- target[key] = value;
- }
- else {
- target[key] = exports.merge(target[key], value);
- }
- }
-
- return target;
-};
-
-
-exports.decode = function (str) {
-
- try {
- return decodeURIComponent(str.replace(/\+/g, ' '));
- } catch (e) {
- return str;
- }
-};
-
-
-exports.compact = function (obj, refs) {
-
- if (typeof obj !== 'object' ||
- obj === null) {
-
- return obj;
- }
-
- refs = refs || [];
- var lookup = refs.indexOf(obj);
- if (lookup !== -1) {
- return refs[lookup];
- }
-
- refs.push(obj);
-
- if (Array.isArray(obj)) {
- var compacted = [];
-
- for (var i = 0, il = obj.length; i < il; ++i) {
- if (typeof obj[i] !== 'undefined') {
- compacted.push(obj[i]);
- }
- }
-
- return compacted;
- }
-
- var keys = Object.keys(obj);
- for (i = 0, il = keys.length; i < il; ++i) {
- var key = keys[i];
- obj[key] = exports.compact(obj[key], refs);
- }
-
- return obj;
-};
-
-
-exports.isRegExp = function (obj) {
- return Object.prototype.toString.call(obj) === '[object RegExp]';
-};
-
-
-exports.isBuffer = function (obj) {
-
- if (obj === null ||
- typeof obj === 'undefined') {
-
- return false;
- }
-
- return !!(obj.constructor &&
- obj.constructor.isBuffer &&
- obj.constructor.isBuffer(obj));
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/package.json b/node_modules/request/node_modules/qs/package.json
deleted file mode 100644
index d7fe24c..0000000
--- a/node_modules/request/node_modules/qs/package.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "name": "qs",
- "version": "2.4.2",
- "description": "A querystring parser that supports nesting and arrays, with a depth limit",
- "homepage": "https://github.com/hapijs/qs",
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {
- "code": "1.x.x",
- "lab": "5.x.x"
- },
- "scripts": {
- "test": "make test-cov"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/hapijs/qs.git"
- },
- "keywords": [
- "querystring",
- "qs"
- ],
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/hapijs/qs/raw/master/LICENSE"
- }
- ],
- "gitHead": "cdd64a9d1385dbc3dde48da6de98b5993f1607bd",
- "bugs": {
- "url": "https://github.com/hapijs/qs/issues"
- },
- "_id": "qs@2.4.2",
- "_shasum": "f7ce788e5777df0b5010da7f7c4e73ba32470f5a",
- "_from": "qs@>=2.4.0 <2.5.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "0.10.38",
- "_npmUser": {
- "name": "nlf",
- "email": "quitlahok@gmail.com"
- },
- "dist": {
- "shasum": "f7ce788e5777df0b5010da7f7c4e73ba32470f5a",
- "tarball": "http://registry.npmjs.org/qs/-/qs-2.4.2.tgz"
- },
- "maintainers": [
- {
- "name": "nlf",
- "email": "quitlahok@gmail.com"
- },
- {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/test/parse.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/test/parse.js b/node_modules/request/node_modules/qs/test/parse.js
deleted file mode 100755
index 79c575b..0000000
--- a/node_modules/request/node_modules/qs/test/parse.js
+++ /dev/null
@@ -1,414 +0,0 @@
-/* eslint no-extend-native:0 */
-// Load modules
-
-var Code = require('code');
-var Lab = require('lab');
-var Qs = require('../');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var expect = Code.expect;
-var describe = lab.experiment;
-var it = lab.test;
-
-
-describe('parse()', function () {
-
- it('parses a simple string', function (done) {
-
- expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' });
- expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' });
- expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } });
- expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } });
- expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } });
- expect(Qs.parse('foo')).to.deep.equal({ foo: '' });
- expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' });
- expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' });
- expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' });
- expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' });
- expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' });
- expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({
- cht: 'p3',
- chd: 't:60,40',
- chs: '250x100',
- chl: 'Hello|World'
- });
- done();
- });
-
- it('parses a single nested string', function (done) {
-
- expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } });
- done();
- });
-
- it('parses a double nested string', function (done) {
-
- expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } });
- done();
- });
-
- it('defaults to a depth of 5', function (done) {
-
- expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } });
- done();
- });
-
- it('only parses one level when depth = 1', function (done) {
-
- expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } });
- expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } });
- done();
- });
-
- it('parses a simple array', function (done) {
-
- expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
- done();
- });
-
- it('parses an explicit array', function (done) {
-
- expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] });
- expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] });
- expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
- done();
- });
-
- it('parses a mix of simple and explicit arrays', function (done) {
-
- expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] });
- expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
- expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
- expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] });
- expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
- expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] });
- done();
- });
-
- it('parses a nested array', function (done) {
-
- expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } });
- expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } });
- done();
- });
-
- it('allows to specify array indices', function (done) {
-
- expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
- expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] });
- expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] });
- done();
- });
-
- it('limits specific array indices to 20', function (done) {
-
- expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] });
- expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } });
- done();
- });
-
- it('supports keys that begin with a number', function (done) {
-
- expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } });
- done();
- });
-
- it('supports encoded = signs', function (done) {
-
- expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' });
- done();
- });
-
- it('is ok with url encoded strings', function (done) {
-
- expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } });
- expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } });
- done();
- });
-
- it('allows brackets in the value', function (done) {
-
- expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' });
- expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' });
- done();
- });
-
- it('allows empty values', function (done) {
-
- expect(Qs.parse('')).to.deep.equal({});
- expect(Qs.parse(null)).to.deep.equal({});
- expect(Qs.parse(undefined)).to.deep.equal({});
- done();
- });
-
- it('transforms arrays to objects', function (done) {
-
- expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
- expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
- expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
- expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
- expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
- expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({foo: [ {a: 'a', b: 'b'}, {a: 'aa', b: 'bb'} ]});
- done();
- });
-
- it('can add keys to objects', function (done) {
-
- expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } });
- done();
- });
-
- it('correctly prunes undefined values when converting an array to an object', function (done) {
-
- expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } });
- done();
- });
-
- it('supports malformed uri characters', function (done) {
-
- expect(Qs.parse('{%:%}')).to.deep.equal({ '{%:%}': '' });
- expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' });
- done();
- });
-
- it('doesn\'t produce empty keys', function (done) {
-
- expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' });
- done();
- });
-
- it('cannot override prototypes', function (done) {
-
- var obj = Qs.parse('hasOwnProperty=bad&toString=bad&bad[toString]=bad&constructor=bad');
- expect(typeof obj.toString).to.equal('function');
- expect(typeof obj.bad.toString).to.equal('function');
- expect(typeof obj.constructor).to.equal('function');
- expect(typeof obj.hasOwnProperty).to.equal('function');
- done();
- });
-
- it('cannot access Object prototype', function (done) {
-
- Qs.parse('constructor[prototype][bad]=bad');
- Qs.parse('bad[constructor][prototype][bad]=bad');
- expect(typeof Object.prototype.bad).to.equal('undefined');
- done();
- });
-
- it('parses arrays of objects', function (done) {
-
- expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
- expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
- done();
- });
-
- it('allows for empty strings in arrays', function (done) {
-
- expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] });
- expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]=')).to.deep.equal({ a: ['b', '', 'c', ''] });
- expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] });
- done();
- });
-
- it('compacts sparse arrays', function (done) {
-
- expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] });
- done();
- });
-
- it('parses semi-parsed strings', function (done) {
-
- expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } });
- expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } });
- done();
- });
-
- it('parses buffers correctly', function (done) {
-
- var b = new Buffer('test');
- expect(Qs.parse({ a: b })).to.deep.equal({ a: b });
- done();
- });
-
- it('continues parsing when no parent is found', function (done) {
-
- expect(Qs.parse('[]&a=b')).to.deep.equal({ '0': '', a: 'b' });
- expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' });
- done();
- });
-
- it('does not error when parsing a very long array', function (done) {
-
- var str = 'a[]=a';
- while (Buffer.byteLength(str) < 128 * 1024) {
- str += '&' + str;
- }
-
- expect(function () {
-
- Qs.parse(str);
- }).to.not.throw();
-
- done();
- });
-
- it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) {
-
- Object.prototype.crash = '';
- Array.prototype.crash = '';
- expect(Qs.parse.bind(null, 'a=b')).to.not.throw();
- expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' });
- expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw();
- expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
- delete Object.prototype.crash;
- delete Array.prototype.crash;
- done();
- });
-
- it('parses a string with an alternative string delimiter', function (done) {
-
- expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' });
- done();
- });
-
- it('parses a string with an alternative RegExp delimiter', function (done) {
-
- expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' });
- done();
- });
-
- it('does not use non-splittable objects as delimiters', function (done) {
-
- expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' });
- done();
- });
-
- it('allows overriding parameter limit', function (done) {
-
- expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' });
- done();
- });
-
- it('allows setting the parameter limit to Infinity', function (done) {
-
- expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' });
- done();
- });
-
- it('allows overriding array limit', function (done) {
-
- expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } });
- expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } });
- expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } });
- done();
- });
-
- it('parses an object', function (done) {
-
- var input = {
- 'user[name]': {'pop[bob]': 3},
- 'user[email]': null
- };
-
- var expected = {
- 'user': {
- 'name': {'pop[bob]': 3},
- 'email': null
- }
- };
-
- var result = Qs.parse(input);
-
- expect(result).to.deep.equal(expected);
- done();
- });
-
- it('parses an object and not child values', function (done) {
-
- var input = {
- 'user[name]': {'pop[bob]': { 'test': 3 }},
- 'user[email]': null
- };
-
- var expected = {
- 'user': {
- 'name': {'pop[bob]': { 'test': 3 }},
- 'email': null
- }
- };
-
- var result = Qs.parse(input);
-
- expect(result).to.deep.equal(expected);
- done();
- });
-
- it('does not blow up when Buffer global is missing', function (done) {
-
- var tempBuffer = global.Buffer;
- delete global.Buffer;
- var result = Qs.parse('a=b&c=d');
- global.Buffer = tempBuffer;
- expect(result).to.deep.equal({ a: 'b', c: 'd' });
- done();
- });
-
- it('does not crash when using invalid dot notation', function (done) {
-
- expect(Qs.parse('roomInfoList[0].childrenAges[0]=15&roomInfoList[0].numberOfAdults=2')).to.deep.equal({ roomInfoList: [['15', '2']] });
- done();
- });
-
- it('does not crash when parsing circular references', function (done) {
-
- var a = {};
- a.b = a;
-
- var parsed;
-
- expect(function () {
-
- parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
- }).to.not.throw();
-
- expect(parsed).to.contain('foo');
- expect(parsed.foo).to.contain('bar', 'baz');
- expect(parsed.foo.bar).to.equal('baz');
- expect(parsed.foo.baz).to.deep.equal(a);
- done();
- });
-
- it('parses plain objects correctly', function (done) {
-
- var a = Object.create(null);
- a.b = 'c';
-
- expect(Qs.parse(a)).to.deep.equal({ b: 'c' });
- var result = Qs.parse({ a: a });
- expect(result).to.contain('a');
- expect(result.a).to.deep.equal(a);
- done();
- });
-
- it('parses dates correctly', function (done) {
-
- var now = new Date();
- expect(Qs.parse({ a: now })).to.deep.equal({ a: now });
- done();
- });
-
- it('parses regular expressions correctly', function (done) {
-
- var re = /^test$/;
- expect(Qs.parse({ a: re })).to.deep.equal({ a: re });
- done();
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/qs/test/stringify.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/qs/test/stringify.js b/node_modules/request/node_modules/qs/test/stringify.js
deleted file mode 100755
index 7bdec32..0000000
--- a/node_modules/request/node_modules/qs/test/stringify.js
+++ /dev/null
@@ -1,209 +0,0 @@
-/* eslint no-extend-native:0 */
-// Load modules
-
-var Code = require('code');
-var Lab = require('lab');
-var Qs = require('../');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var expect = Code.expect;
-var describe = lab.experiment;
-var it = lab.test;
-
-
-describe('stringify()', function () {
-
- it('stringifies a querystring object', function (done) {
-
- expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
- expect(Qs.stringify({ a: 1 })).to.equal('a=1');
- expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2');
- done();
- });
-
- it('stringifies a nested object', function (done) {
-
- expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
- expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e');
- done();
- });
-
- it('stringifies an array value', function (done) {
-
- expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
- done();
- });
-
- it('omits array indices when asked', function (done) {
-
- expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d');
- done();
- });
-
- it('stringifies a nested array value', function (done) {
-
- expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
- done();
- });
-
- it('stringifies an object inside an array', function (done) {
-
- expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c');
- expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
- done();
- });
-
- it('does not omit object keys when indices = false', function (done) {
-
- expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c');
- done();
- });
-
- it('uses indices notation for arrays when indices=true', function (done) {
-
- expect(Qs.stringify({ a: ['b', 'c'] }, { indices: true })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
- done();
- });
-
- it('uses indices notation for arrays when no arrayFormat is specified', function (done) {
-
- expect(Qs.stringify({ a: ['b', 'c'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
- done();
- });
-
- it('uses indices notation for arrays when no arrayFormat=indices', function (done) {
-
- expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
- done();
- });
-
- it('uses repeat notation for arrays when no arrayFormat=repeat', function (done) {
-
- expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).to.equal('a=b&a=c');
- done();
- });
-
- it('uses brackets notation for arrays when no arrayFormat=brackets', function (done) {
-
- expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).to.equal('a%5B%5D=b&a%5B%5D=c');
- done();
- });
-
- it('stringifies a complicated object', function (done) {
-
- expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e');
- done();
- });
-
- it('stringifies an empty value', function (done) {
-
- expect(Qs.stringify({ a: '' })).to.equal('a=');
- expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b=');
- expect(Qs.stringify({ a: null })).to.equal('a=');
- expect(Qs.stringify({ a: { b: null } })).to.equal('a%5Bb%5D=');
- done();
- });
-
- it('stringifies an empty object', function (done) {
-
- var obj = Object.create(null);
- obj.a = 'b';
- expect(Qs.stringify(obj)).to.equal('a=b');
- done();
- });
-
- it('returns an empty string for invalid input', function (done) {
-
- expect(Qs.stringify(undefined)).to.equal('');
- expect(Qs.stringify(false)).to.equal('');
- expect(Qs.stringify(null)).to.equal('');
- expect(Qs.stringify('')).to.equal('');
- done();
- });
-
- it('stringifies an object with an empty object as a child', function (done) {
-
- var obj = {
- a: Object.create(null)
- };
-
- obj.a.b = 'c';
- expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c');
- done();
- });
-
- it('drops keys with a value of undefined', function (done) {
-
- expect(Qs.stringify({ a: undefined })).to.equal('');
- expect(Qs.stringify({ a: { b: undefined, c: null } })).to.equal('a%5Bc%5D=');
- done();
- });
-
- it('url encodes values', function (done) {
-
- expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c');
- done();
- });
-
- it('stringifies a date', function (done) {
-
- var now = new Date();
- var str = 'a=' + encodeURIComponent(now.toISOString());
- expect(Qs.stringify({ a: now })).to.equal(str);
- done();
- });
-
- it('stringifies the weird object from qs', function (done) {
-
- expect(Qs.stringify({ 'my weird field': 'q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F');
- done();
- });
-
- it('skips properties that are part of the object prototype', function (done) {
-
- Object.prototype.crash = 'test';
- expect(Qs.stringify({ a: 'b'})).to.equal('a=b');
- expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
- delete Object.prototype.crash;
- done();
- });
-
- it('stringifies boolean values', function (done) {
-
- expect(Qs.stringify({ a: true })).to.equal('a=true');
- expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true');
- expect(Qs.stringify({ b: false })).to.equal('b=false');
- expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false');
- done();
- });
-
- it('stringifies buffer values', function (done) {
-
- expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test');
- expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test');
- done();
- });
-
- it('stringifies an object using an alternative delimiter', function (done) {
-
- expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d');
- done();
- });
-
- it('doesn\'t blow up when Buffer global is missing', function (done) {
-
- var tempBuffer = global.Buffer;
- delete global.Buffer;
- expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d');
- global.Buffer = tempBuffer;
- done();
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/stringstream/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/stringstream/.npmignore b/node_modules/request/node_modules/stringstream/.npmignore
deleted file mode 100644
index 7dccd97..0000000
--- a/node_modules/request/node_modules/stringstream/.npmignore
+++ /dev/null
@@ -1,15 +0,0 @@
-lib-cov
-*.seed
-*.log
-*.csv
-*.dat
-*.out
-*.pid
-*.gz
-
-pids
-logs
-results
-
-node_modules
-npm-debug.log
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/stringstream/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/stringstream/.travis.yml b/node_modules/request/node_modules/stringstream/.travis.yml
deleted file mode 100644
index f1d0f13..0000000
--- a/node_modules/request/node_modules/stringstream/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - 0.4
- - 0.6
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/stringstream/LICENSE.txt
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/stringstream/LICENSE.txt b/node_modules/request/node_modules/stringstream/LICENSE.txt
deleted file mode 100644
index eac1881..0000000
--- a/node_modules/request/node_modules/stringstream/LICENSE.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Copyright 2012 Michael Hart (michael.hart.au@gmail.com)
-
-This project is free software released under the MIT license:
-http://www.opensource.org/licenses/mit-license.php
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/stringstream/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/stringstream/README.md b/node_modules/request/node_modules/stringstream/README.md
deleted file mode 100644
index 32fc982..0000000
--- a/node_modules/request/node_modules/stringstream/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Decode streams into strings The Right Way(tm)
-
-```javascript
-var fs = require('fs')
-var zlib = require('zlib')
-var strs = require('stringstream')
-
-var utf8Stream = fs.createReadStream('massiveLogFile.gz')
- .pipe(zlib.createGunzip())
- .pipe(strs('utf8'))
-```
-
-No need to deal with `setEncoding()` weirdness, just compose streams
-like they were supposed to be!
-
-Handles input and output encoding:
-
-```javascript
-// Stream from utf8 to hex to base64... Why not, ay.
-var hex64Stream = fs.createReadStream('myFile')
- .pipe(strs('utf8', 'hex'))
- .pipe(strs('hex', 'base64'))
-```
-
-Also deals with `base64` output correctly by aligning each emitted data
-chunk so that there are no dangling `=` characters:
-
-```javascript
-var stream = fs.createReadStream('myFile').pipe(strs('base64'))
-
-var base64Str = ''
-
-stream.on('data', function(data) { base64Str += data })
-stream.on('end', function() {
- console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()
- console.log('Original file is: ' + new Buffer(base64Str, 'base64'))
-})
-```
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/stringstream/example.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/stringstream/example.js b/node_modules/request/node_modules/stringstream/example.js
deleted file mode 100644
index f82b85e..0000000
--- a/node_modules/request/node_modules/stringstream/example.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var fs = require('fs')
-var zlib = require('zlib')
-var strs = require('stringstream')
-
-var utf8Stream = fs.createReadStream('massiveLogFile.gz')
- .pipe(zlib.createGunzip())
- .pipe(strs('utf8'))
-
-utf8Stream.pipe(process.stdout)
-
-// Stream from utf8 to hex to base64... Why not, ay.
-var hex64Stream = fs.createReadStream('myFile')
- .pipe(strs('utf8', 'hex'))
- .pipe(strs('hex', 'base64'))
-
-hex64Stream.pipe(process.stdout)
-
-// Deals with base64 correctly by aligning chunks
-var stream = fs.createReadStream('myFile').pipe(strs('base64'))
-
-var base64Str = ''
-
-stream.on('data', function(data) { base64Str += data })
-stream.on('end', function() {
- console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()
- console.log('Original file is: ' + new Buffer(base64Str, 'base64'))
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/stringstream/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/stringstream/package.json b/node_modules/request/node_modules/stringstream/package.json
deleted file mode 100644
index b71cf28..0000000
--- a/node_modules/request/node_modules/stringstream/package.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "stringstream",
- "version": "0.0.4",
- "description": "Encode and decode streams into string streams",
- "author": {
- "name": "Michael Hart",
- "email": "michael.hart.au@gmail.com",
- "url": "http://github.com/mhart"
- },
- "main": "stringstream.js",
- "keywords": [
- "string",
- "stream",
- "base64",
- "gzip"
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/mhart/StringStream.git"
- },
- "license": "MIT",
- "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) /
/ Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n",
- "readmeFilename": "README.md",
- "_id": "stringstream@0.0.4",
- "dist": {
- "shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92",
- "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
- },
- "_npmVersion": "1.2.0",
- "_npmUser": {
- "name": "hichaelmart",
- "email": "michael.hart.au@gmail.com"
- },
- "maintainers": [
- {
- "name": "hichaelmart",
- "email": "michael.hart.au@gmail.com"
- }
- ],
- "directories": {},
- "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92",
- "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz",
- "_from": "stringstream@>=0.0.4 <0.1.0",
- "bugs": {
- "url": "https://github.com/mhart/StringStream/issues"
- },
- "homepage": "https://github.com/mhart/StringStream",
- "scripts": {}
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/stringstream/stringstream.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/stringstream/stringstream.js b/node_modules/request/node_modules/stringstream/stringstream.js
deleted file mode 100644
index 4ece127..0000000
--- a/node_modules/request/node_modules/stringstream/stringstream.js
+++ /dev/null
@@ -1,102 +0,0 @@
-var util = require('util')
-var Stream = require('stream')
-var StringDecoder = require('string_decoder').StringDecoder
-
-module.exports = StringStream
-module.exports.AlignedStringDecoder = AlignedStringDecoder
-
-function StringStream(from, to) {
- if (!(this instanceof StringStream)) return new StringStream(from, to)
-
- Stream.call(this)
-
- if (from == null) from = 'utf8'
-
- this.readable = this.writable = true
- this.paused = false
- this.toEncoding = (to == null ? from : to)
- this.fromEncoding = (to == null ? '' : from)
- this.decoder = new AlignedStringDecoder(this.toEncoding)
-}
-util.inherits(StringStream, Stream)
-
-StringStream.prototype.write = function(data) {
- if (!this.writable) {
- var err = new Error('stream not writable')
- err.code = 'EPIPE'
- this.emit('error', err)
- return false
- }
- if (this.fromEncoding) {
- if (Buffer.isBuffer(data)) data = data.toString()
- data = new Buffer(data, this.fromEncoding)
- }
- var string = this.decoder.write(data)
- if (string.length) this.emit('data', string)
- return !this.paused
-}
-
-StringStream.prototype.flush = function() {
- if (this.decoder.flush) {
- var string = this.decoder.flush()
- if (string.length) this.emit('data', string)
- }
-}
-
-StringStream.prototype.end = function() {
- if (!this.writable && !this.readable) return
- this.flush()
- this.emit('end')
- this.writable = this.readable = false
- this.destroy()
-}
-
-StringStream.prototype.destroy = function() {
- this.decoder = null
- this.writable = this.readable = false
- this.emit('close')
-}
-
-StringStream.prototype.pause = function() {
- this.paused = true
-}
-
-StringStream.prototype.resume = function () {
- if (this.paused) this.emit('drain')
- this.paused = false
-}
-
-function AlignedStringDecoder(encoding) {
- StringDecoder.call(this, encoding)
-
- switch (this.encoding) {
- case 'base64':
- this.write = alignedWrite
- this.alignedBuffer = new Buffer(3)
- this.alignedBytes = 0
- break
- }
-}
-util.inherits(AlignedStringDecoder, StringDecoder)
-
-AlignedStringDecoder.prototype.flush = function() {
- if (!this.alignedBuffer || !this.alignedBytes) return ''
- var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes)
- this.alignedBytes = 0
- return leftover
-}
-
-function alignedWrite(buffer) {
- var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length
- if (!rem && !this.alignedBytes) return buffer.toString(this.encoding)
-
- var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem)
-
- this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes)
- buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem)
-
- buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length)
- this.alignedBytes = rem
-
- return returnBuffer.toString(this.encoding)
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/.editorconfig
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/.editorconfig b/node_modules/request/node_modules/tough-cookie/.editorconfig
deleted file mode 100644
index e09b844..0000000
--- a/node_modules/request/node_modules/tough-cookie/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file is for unifying the coding style for different editors and IDEs
-# editorconfig.org
-
-root = true
-
-[*]
-end_of_line = lf
-charset = utf-8
-insert_final_newline = true
-trim_trailing_whitespace = true
-indent_style = space
-indent_size = 2
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/.jshintrc
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/.jshintrc b/node_modules/request/node_modules/tough-cookie/.jshintrc
deleted file mode 100644
index fb11913..0000000
--- a/node_modules/request/node_modules/tough-cookie/.jshintrc
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "passfail" : false,
- "maxerr" : 100,
-
- "browser" : false,
- "node" : true,
- "rhino" : false,
- "couch" : false,
- "wsh" : false,
-
- "jquery" : false,
- "prototypejs" : false,
- "mootools" : false,
- "dojo" : false,
-
- "debug" : false,
- "devel" : false,
-
- "esnext" : true,
- "strict" : true,
- "globalstrict" : true,
-
- "asi" : false,
- "laxbreak" : false,
- "bitwise" : true,
- "boss" : false,
- "curly" : true,
- "eqeqeq" : false,
- "eqnull" : true,
- "evil" : false,
- "expr" : false,
- "forin" : false,
- "immed" : true,
- "lastsemic" : true,
- "latedef" : false,
- "loopfunc" : false,
- "noarg" : true,
- "regexp" : false,
- "regexdash" : false,
- "scripturl" : false,
- "shadow" : false,
- "supernew" : false,
- "undef" : true,
- "unused" : true,
-
- "newcap" : true,
- "noempty" : true,
- "nonew" : true,
- "nomen" : false,
- "onevar" : false,
- "onecase" : true,
- "plusplus" : false,
- "proto" : false,
- "sub" : true,
- "trailing" : true,
- "white" : false,
-
- "predef": [
- "describe",
- "it",
- "before",
- "beforeEach",
- "after",
- "afterEach",
- "expect",
- "setTimeout",
- "clearTimeout"
- ],
- "maxlen": 0
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/.npmignore b/node_modules/request/node_modules/tough-cookie/.npmignore
deleted file mode 100644
index 5a8d2d8..0000000
--- a/node_modules/request/node_modules/tough-cookie/.npmignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.idea
-node_modules/
-.*.sw[nmop]
-npm-debug.log
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/.travis.yml b/node_modules/request/node_modules/tough-cookie/.travis.yml
deleted file mode 100644
index 02059d0..0000000
--- a/node_modules/request/node_modules/tough-cookie/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: node_js
-node_js:
-- "0.10"
-- "0.12"
-- iojs
-matrix:
- fast_finish: true
- allow_failures:
- - node_js: 0.11
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/CONTRIBUTING.md b/node_modules/request/node_modules/tough-cookie/CONTRIBUTING.md
deleted file mode 100644
index 7d37411..0000000
--- a/node_modules/request/node_modules/tough-cookie/CONTRIBUTING.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Contributing
-
-This is the contribution guide for tough-cookie.
-
-## CLA
-
-As with all Salesforce open-source projects, tough-cookie requires a Contributor License Agreement to be signed by you (or your company).
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/LICENSE b/node_modules/request/node_modules/tough-cookie/LICENSE
deleted file mode 100644
index 84e0cad..0000000
--- a/node_modules/request/node_modules/tough-cookie/LICENSE
+++ /dev/null
@@ -1,74 +0,0 @@
-Copyright (c) 2015, Salesforce.com, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-===
-
-The following exceptions apply:
-
-===
-
-`pubSufTest()` of generate-pubsuffix.js is in the public domain.
-
- // Any copyright is dedicated to the Public Domain.
- // http://creativecommons.org/publicdomain/zero/1.0/
-
-===
-
-`public-suffix.txt` was obtained from
-<https://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1>
-via <http://publicsuffix.org>.
-
-That file contains the usual Mozilla triple-license, for which this project uses it
-under the terms of the MPL 1.1:
-
- // ***** BEGIN LICENSE BLOCK *****
- // Version: MPL 1.1/GPL 2.0/LGPL 2.1
- //
- // The contents of this file are subject to the Mozilla Public License Version
- // 1.1 (the "License"); you may not use this file except in compliance with
- // the License. You may obtain a copy of the License at
- // http://www.mozilla.org/MPL/
- //
- // Software distributed under the License is distributed on an "AS IS" basis,
- // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- // for the specific language governing rights and limitations under the
- // License.
- //
- // The Original Code is the Public Suffix List.
- //
- // The Initial Developer of the Original Code is
- // Jo Hermans <jo...@gmail.com>.
- // Portions created by the Initial Developer are Copyright (C) 2007
- // the Initial Developer. All Rights Reserved.
- //
- // Contributor(s):
- // Ruben Arakelyan <ru...@rubenarakelyan.com>
- // Gervase Markham <ge...@gerv.net>
- // Pamela Greene <pa...@gmail.com>
- // David Triendl <da...@triendl.name>
- // Jothan Frakes <jo...@gmail.com>
- // The kind representatives of many TLD registries
- //
- // Alternatively, the contents of this file may be used under the terms of
- // either the GNU General Public License Version 2 or later (the "GPL"), or
- // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- // in which case the provisions of the GPL or the LGPL are applicable instead
- // of those above. If you wish to allow use of your version of this file only
- // under the terms of either the GPL or the LGPL, and not to allow others to
- // use your version of this file under the terms of the MPL, indicate your
- // decision by deleting the provisions above and replace them with the notice
- // and other provisions required by the GPL or the LGPL. If you do not delete
- // the provisions above, a recipient may use your version of this file under
- // the terms of any one of the MPL, the GPL or the LGPL.
- //
- // ***** END LICENSE BLOCK *****
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/README.md b/node_modules/request/node_modules/tough-cookie/README.md
deleted file mode 100644
index 60e1fb3..0000000
--- a/node_modules/request/node_modules/tough-cookie/README.md
+++ /dev/null
@@ -1,423 +0,0 @@
-[RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js
-
-[](https://travis-ci.org/SalesforceEng/tough-cookie)
-
-[](https://npmjs.org/package/tough-cookie)
-
-
-# Synopsis
-
-``` javascript
-var tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'
-var Cookie = tough.Cookie;
-var cookie = Cookie.parse(header);
-cookie.value = 'somethingdifferent';
-header = cookie.toString();
-
-var cookiejar = new tough.CookieJar();
-cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);
-// ...
-cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {
- res.headers['cookie'] = cookies.join('; ');
-});
-```
-
-# Installation
-
-It's _so_ easy!
-
-`npm install tough-cookie`
-
-Requires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default.
-
-Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.
-
-# API
-
-tough
-=====
-
-Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound".
-
-**Note**: prior to 1.0.x, several of these functions took a `strict` parameter. This has since been removed from the API as it was no longer necessary.
-
-parseDate(string)
------------------
-
-Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`.
-
-formatDate(date)
-----------------
-
-Format a Date into a RFC1123 string (the RFC6265-recommended format).
-
-canonicalDomain(str)
---------------------
-
-Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).
-
-domainMatch(str,domStr[,canonicalize=true])
--------------------------------------------
-
-Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match".
-
-The `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.
-
-defaultPath(path)
------------------
-
-Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC.
-
-The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.
-
-pathMatch(reqPath,cookiePath)
------------------------------
-
-Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean.
-
-This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.
-
-parse(header)
-----------------------------
-
-alias for `Cookie.parse(header)`
-
-fromJSON(string)
-----------------
-
-alias for `Cookie.fromJSON(string)`
-
-getPublicSuffix(hostname)
--------------------------
-
-Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.
-
-For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.
-
-For further information, see http://publicsuffix.org/. This module derives its list from that site.
-
-cookieCompare(a,b)
-------------------
-
-For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.
-
-``` javascript
-var cookies = [ /* unsorted array of Cookie objects */ ];
-cookies = cookies.sort(cookieCompare);
-```
-
-permuteDomain(domain)
----------------------
-
-Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.
-
-
-permutePath(path)
------------------
-
-Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.
-
-Cookie
-======
-
-Cookie.parse(header)
------------------------------------
-
-Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed.
-
-Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:
-
-``` javascript
-if (res.headers['set-cookie'] instanceof Array)
- cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); });
-else
- cookies = [Cookie.parse(res.headers['set-cookie'])];
-```
-
-Cookie.fromJSON(string)
------------------------
-
-Convert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.
-
-Properties
-==========
-
- * _key_ - string - the name or key of the cookie (default "")
- * _value_ - string - the value of the cookie (default "")
- * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `"Infinity"`). See `setExpires()`
- * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `"Infinity"` and `"-Infinity"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`
- * _domain_ - string - the `Domain=` attribute of the cookie
- * _path_ - string - the `Path=` of the cookie
- * _secure_ - boolean - the `Secure` cookie flag
- * _httpOnly_ - boolean - the `HttpOnly` cookie flag
- * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)
-
-After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:
-
- * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)
- * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.
- * _created_ - `Date` - when this cookie was added to the jar
- * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.
-
-Construction([{options}])
-------------
-
-Receives an options object that can contain any Cookie properties, uses the default for unspecified properties.
-
-.toString()
------------
-
-encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.
-
-.cookieString()
----------------
-
-encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').
-
-.setExpires(String)
--------------------
-
-sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set.
-
-.setMaxAge(number)
--------------------
-
-sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly.
-
-.expiryTime([now=Date.now()])
------------------------------
-
-.expiryDate([now=Date.now()])
------------------------------
-
-expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.
-
-Max-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.
-
-If Expires (`.expires`) is set, that's returned.
-
-Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).
-
-.TTL([now=Date.now()])
----------
-
-compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.
-
-The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.
-
-.canonicalizedDoman()
----------------------
-
-.cdomain()
-----------
-
-return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.
-
-.validate()
------------
-
-Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.
-
-validates cookie attributes for semantic correctness. Useful for "lint" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:
-
-``` javascript
-if (cookie.validate() === true) {
- // it's tasty
-} else {
- // yuck!
-}
-```
-
-CookieJar
-=========
-
-Construction([store = new MemoryCookieStore()][, rejectPublicSuffixes])
-------------
-
-Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.
-
-
-Attributes
-----------
-
- * _rejectPublicSuffixes_ - boolean - reject cookies with domains like "com" and "co.uk" (default: `true`)
-
-Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.
-
-.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))
--------------------------------------------------------------------
-
-Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.
-
-The `options` object can be omitted and can have the following properties:
-
- * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.
- * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
- * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
- * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.
-
-As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).
-
-.setCookieSync(cookieOrString, currentUrl, [{options}])
--------------------------------------------------------
-
-Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-.storeCookie(cookie, [{options},] cb(err,cookie))
--------------------------------------------------
-
-__REMOVED__ removed in lieu of the CookieStore API below
-
-.getCookies(currentUrl, [{options},] cb(err,cookies))
------------------------------------------------------
-
-Retrieve the list of cookies that can be sent in a Cookie header for the current url.
-
-If an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.
-
-The `options` object can be omitted and can have the following properties:
-
- * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.
- * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
- * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
- * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).
- * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).
-
-The `.lastAccessed` property of the returned cookies will have been updated.
-
-.getCookiesSync(currentUrl, [{options}])
-----------------------------------------
-
-Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-.getCookieString(...)
----------------------
-
-Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.
-
-.getCookieStringSync(...)
--------------------------
-
-Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-.getSetCookieStrings(...)
--------------------------
-
-Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.
-
-.getSetCookieStringsSync(...)
------------------------------
-
-Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-
-Store
-=====
-
-Base class for CookieJar stores.
-
-# CookieStore API
-
-The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.
-
-Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.
-
-All `domain` parameters will have been normalized before calling.
-
-The Cookie store must have all of the following methods.
-
-store.findCookie(domain, path, key, cb(err,cookie))
----------------------------------------------------
-
-Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.
-
-Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).
-
-store.findCookies(domain, path, cb(err,cookies))
-------------------------------------------------
-
-Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.
-
-If no cookies are found, the callback MUST be passed an empty array.
-
-The resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.
-
-As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).
-
-store.putCookie(cookie, cb(err))
---------------------------------
-
-Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.
-
-The `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.
-
-Pass an error if the cookie cannot be stored.
-
-store.updateCookie(oldCookie, newCookie, cb(err))
--------------------------------------------------
-
-Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.
-
-The `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).
-
-Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.
-
-The `newCookie` and `oldCookie` objects MUST NOT be modified.
-
-Pass an error if the newCookie cannot be stored.
-
-store.removeCookie(domain, path, key, cb(err))
-----------------------------------------------
-
-Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).
-
-The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.
-
-store.removeCookies(domain, path, cb(err))
-------------------------------------------
-
-Removes matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed.
-
-Pass an error ONLY if removing any existing cookies failed.
-
-# TODO
-
- * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()`
- * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891
- * better tests for `validate()`?
-
-# Copyright and License
-
-(tl;dr: BSD-3-Clause with some MPL/1.1)
-
-```text
- Copyright (c) 2015, Salesforce.com, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. Neither the name of Salesforce.com nor the names of its contributors may
- be used to endorse or promote products derived from this software without
- specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-```
-
-Portions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details.
[44/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js
deleted file mode 100644
index 7e9fc70..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var fs = require('fs')
- , lstat = fs.lstatSync;
-
-exports.readlinkSync = function (p) {
- if (lstat(p).isSymbolicLink()) {
- return fs.readlinkSync(p);
- } else {
- return p;
- }
-};
-
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json
deleted file mode 100644
index 5b8486a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "name": "graceful-readlink",
- "version": "1.0.1",
- "description": "graceful fs.readlink",
- "main": "index.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/zhiyelee/graceful-readlink.git"
- },
- "homepage": "https://github.com/zhiyelee/graceful-readlink",
- "bugs": {
- "url": "https://github.com/zhiyelee/graceful-readlink/issues"
- },
- "keywords": [
- "fs.readlink",
- "readlink"
- ],
- "author": {
- "name": "zhiyelee"
- },
- "license": "MIT",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "gitHead": "f6655275bebef706fb63fd01b5f062a7052419a5",
- "_id": "graceful-readlink@1.0.1",
- "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725",
- "_from": "graceful-readlink@>=1.0.0",
- "_npmVersion": "2.1.17",
- "_nodeVersion": "0.11.14",
- "_npmUser": {
- "name": "zhiyelee",
- "email": "zhiyelee@gmail.com"
- },
- "maintainers": [
- {
- "name": "zhiyelee",
- "email": "zhiyelee@gmail.com"
- }
- ],
- "dist": {
- "shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725",
- "tarball": "http://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/package.json b/node_modules/request/node_modules/har-validator/node_modules/commander/package.json
deleted file mode 100644
index 29f9034..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/package.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "name": "commander",
- "version": "2.8.1",
- "description": "the complete solution for node.js command-line programs",
- "keywords": [
- "command",
- "option",
- "parser"
- ],
- "author": {
- "name": "TJ Holowaychuk",
- "email": "tj@vision-media.ca"
- },
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/tj/commander.js.git"
- },
- "devDependencies": {
- "should": ">= 0.0.1",
- "sinon": ">= 1.14.1"
- },
- "scripts": {
- "test": "make test"
- },
- "main": "index",
- "engines": {
- "node": ">= 0.6.x"
- },
- "files": [
- "index.js"
- ],
- "dependencies": {
- "graceful-readlink": ">= 1.0.0"
- },
- "gitHead": "c6c84726050b19c0373de27cd359f3baddff579f",
- "bugs": {
- "url": "https://github.com/tj/commander.js/issues"
- },
- "homepage": "https://github.com/tj/commander.js",
- "_id": "commander@2.8.1",
- "_shasum": "06be367febfda0c330aa1e2a072d3dc9762425d4",
- "_from": "commander@>=2.8.1 <3.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
- "_npmUser": {
- "name": "zhiyelee",
- "email": "zhiyelee@gmail.com"
- },
- "maintainers": [
- {
- "name": "tjholowaychuk",
- "email": "tj@vision-media.ca"
- },
- {
- "name": "somekittens",
- "email": "rkoutnik@gmail.com"
- },
- {
- "name": "zhiyelee",
- "email": "zhiyelee@gmail.com"
- },
- {
- "name": "thethomaseffect",
- "email": "thethomaseffect@gmail.com"
- }
- ],
- "dist": {
- "shasum": "06be367febfda0c330aa1e2a072d3dc9762425d4",
- "tarball": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore
deleted file mode 100644
index dbb0721..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-cosmicrealms.com
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml
deleted file mode 100644
index 6e5919d..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE
deleted file mode 100644
index 757562e..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
deleted file mode 100644
index 47350d8..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
+++ /dev/null
@@ -1,173 +0,0 @@
-# is-my-json-valid
-
-A [JSONSchema](http://json-schema.org/) validator that uses code generation
-to be extremely fast
-
-```
-npm install is-my-json-valid
-```
-
-It passes the entire JSONSchema v4 test suite except for `remoteRefs` and `maxLength`/`minLength` when using unicode surrogate pairs.
-
-[](http://travis-ci.org/mafintosh/is-my-json-valid)
-
-## Usage
-
-Simply pass a schema to compile it
-
-``` js
-var validator = require('is-my-json-valid')
-
-var validate = validator({
- required: true,
- type: 'object',
- properties: {
- hello: {
- required: true,
- type: 'string'
- }
- }
-})
-
-console.log('should be valid', validate({hello: 'world'}))
-console.log('should not be valid', validate({}))
-
-// get the last list of errors by checking validate.errors
-// the following will print [{field: 'data.hello', message: 'is required'}]
-console.log(validate.errors)
-```
-
-You can also pass the schema as a string
-
-``` js
-var validate = validate('{"type": ... }')
-```
-
-Optionally you can use the require submodule to load a schema from `__dirname`
-
-``` js
-var validator = require('is-my-json-valid/require')
-var validate = validator('my-schema.json')
-```
-
-## Custom formats
-
-is-my-json-valid supports the formats specified in JSON schema v4 (such as date-time).
-If you want to add your own custom formats pass them as the formats options to the validator
-
-``` js
-var validate = validator({
- type: 'string',
- required: true,
- format: 'only-a'
-}, {
- formats: {
- 'only-a': /^a+$/
- }
-})
-
-console.log(validate('aa')) // true
-console.log(validate('ab')) // false
-```
-
-## External schemas
-
-You can pass in external schemas that you reference using the `$ref` attribute as the `schemas` option
-
-``` js
-var ext = {
- required: true,
- type: 'string'
-}
-
-var schema = {
- $ref: '#ext' // references another schema called ext
-}
-
-// pass the external schemas as an option
-var validate = validate(schema, {schemas: {ext: ext}})
-
-validate('hello') // returns true
-validate(42) // return false
-```
-
-## Filtering away additional properties
-
-is-my-json-valid supports filtering away properties not in the schema
-
-``` js
-var filter = validator.filter({
- required: true,
- type: 'object',
- properties: {
- hello: {type: 'string', required: true}
- },
- additionalProperties: false
-})
-
-var doc = {hello: 'world', notInSchema: true}
-console.log(filter(doc)) // {hello: 'world'}
-```
-
-## Verbose mode outputs the value on errors
-
-is-my-json-valid outputs the value causing an error when verbose is set to true
-
-``` js
-var validate = validator({
- required: true,
- type: 'object',
- properties: {
- hello: {
- required: true,
- type: 'string'
- }
- }
-}, {
- verbose: true
-})
-
-validate({hello: 100});
-console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100}
-```
-
-## Greedy mode tries to validate as much as possible
-
-By default is-my-json-valid bails on first validation error but when greedy is
-set to true it tries to validate as much as possible:
-
-``` js
-var validate = validator({
- type: 'object',
- properties: {
- x: {
- type: 'number'
- }
- },
- required: ['x', 'y']
-}, {
- greedy: true
-});
-
-validate({x: 'string'});
-console.log(validate.errors) // [{field: 'data.y', message: 'is required'},
- // {field: 'data.x', message: 'is the wrong type'}]
-```
-
-## Performance
-
-is-my-json-valid uses code generation to turn your JSON schema into basic javascript code that is easily optimizeable by v8.
-
-At the time of writing, is-my-json-valid is the __fastest validator__ when running
-
-* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)
-* [cosmicreals.com benchmark](http://cosmicrealms.com/blog/2014/08/29/benchmark-of-node-dot-js-json-validation-modules-part-3/)
-* [jsck benchmark](https://github.com/pandastrike/jsck/issues/72#issuecomment-70992684)
-* [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)
-* [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)
-
-If you know any other relevant benchmarks open a PR and I'll add them.
-
-## License
-
-MIT
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
deleted file mode 100644
index f70f4df..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var validator = require('./')
-
-var validate = validator({
- type: 'object',
- properties: {
- hello: {
- required: true,
- type: 'string'
- }
- }
-})
-
-console.log('should be valid', validate({hello: 'world'}))
-console.log('should not be valid', validate({}))
-
-// get the last error message by checking validate.error
-// the following will print "data.hello is required"
-console.log('the errors were:', validate.errors)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js
deleted file mode 100644
index 3038dae..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js
+++ /dev/null
@@ -1,14 +0,0 @@
-exports['date-time'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(\.\d+)?([zZ]|[+-]\d{2}:\d{2})$/
-exports['date'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/
-exports['time'] = /^\d{2}:\d{2}:\d{2}$/
-exports['email'] = /^\S+@\S+$/
-exports['ip-address'] = exports['ipv4'] = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
-exports['ipv6'] = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1
,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/
-exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/
-exports['color'] = /(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/
-exports['hostname'] = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$/
-exports['alpha'] = /^[a-zA-Z]+$/
-exports['alphanumeric'] = /^[a-zA-Z0-9]+$/
-exports['style'] = /\s*(.+?):\s*([^;]+);?/g
-exports['phone'] = /^\+(?:[0-9] ?){6,14}[0-9]$/
-exports['utc-millisec'] = /^[0-9]+(\.?[0-9]+)?$/
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
deleted file mode 100644
index 6fef4ed..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
+++ /dev/null
@@ -1,569 +0,0 @@
-var genobj = require('generate-object-property')
-var genfun = require('generate-function')
-var jsonpointer = require('jsonpointer')
-var xtend = require('xtend')
-var formats = require('./formats')
-
-var get = function(obj, additionalSchemas, ptr) {
- if (/^https?:\/\//.test(ptr)) return null
-
- var visit = function(sub) {
- if (sub && sub.id === ptr) return sub
- if (typeof sub !== 'object' || !sub) return null
- return Object.keys(sub).reduce(function(res, k) {
- return res || visit(sub[k])
- }, null)
- }
-
- var res = visit(obj)
- if (res) return res
-
- ptr = ptr.replace(/^#/, '')
- ptr = ptr.replace(/\/$/, '')
-
- try {
- return jsonpointer.get(obj, decodeURI(ptr))
- } catch (err) {
- var end = ptr.indexOf('#')
- var other
- // external reference
- if (end !== 0) {
- // fragment doesn't exist.
- if (end === -1) {
- other = additionalSchemas[ptr]
- } else {
- var ext = ptr.slice(0, end)
- other = additionalSchemas[ext]
- var fragment = ptr.slice(end).replace(/^#/, '')
- try {
- return jsonpointer.get(other, fragment)
- } catch (err) {}
- }
- } else {
- other = additionalSchemas[ptr]
- }
- return other || null
- }
-}
-
-var formatName = function(field) {
- field = JSON.stringify(field)
- var pattern = /\[([^\[\]"]+)\]/
- while (pattern.test(field)) field = field.replace(pattern, '."+$1+"')
- return field
-}
-
-var types = {}
-
-types.any = function() {
- return 'true'
-}
-
-types.null = function(name) {
- return name+' === null'
-}
-
-types.boolean = function(name) {
- return 'typeof '+name+' === "boolean"'
-}
-
-types.array = function(name) {
- return 'Array.isArray('+name+')'
-}
-
-types.object = function(name) {
- return 'typeof '+name+' === "object" && '+name+' && !Array.isArray('+name+')'
-}
-
-types.number = function(name) {
- return 'typeof '+name+' === "number"'
-}
-
-types.integer = function(name) {
- return 'typeof '+name+' === "number" && (Math.floor('+name+') === '+name+' || '+name+' > 9007199254740992 || '+name+' < -9007199254740992)'
-}
-
-types.string = function(name) {
- return 'typeof '+name+' === "string"'
-}
-
-var unique = function(array) {
- var list = []
- for (var i = 0; i < array.length; i++) {
- list.push(typeof array[i] === 'object' ? JSON.stringify(array[i]) : array[i])
- }
- for (var i = 1; i < list.length; i++) {
- if (list.indexOf(list[i]) !== i) return false
- }
- return true
-}
-
-var toType = function(node) {
- return node.type
-}
-
-var compile = function(schema, cache, root, reporter, opts) {
- var fmts = opts ? xtend(formats, opts.formats) : formats
- var scope = {unique:unique, formats:fmts}
- var verbose = opts ? !!opts.verbose : false;
- var greedy = opts && opts.greedy !== undefined ?
- opts.greedy : false;
-
- var syms = {}
- var gensym = function(name) {
- return name+(syms[name] = (syms[name] || 0)+1)
- }
-
- var reversePatterns = {}
- var patterns = function(p) {
- if (reversePatterns[p]) return reversePatterns[p]
- var n = gensym('pattern')
- scope[n] = new RegExp(p)
- reversePatterns[p] = n
- return n
- }
-
- var vars = ['i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z']
- var genloop = function() {
- var v = vars.shift()
- vars.push(v+v[0])
- return v
- }
-
- var visit = function(name, node, reporter, filter) {
- var properties = node.properties
- var type = node.type
- var tuple = false
-
- if (Array.isArray(node.items)) { // tuple type
- properties = {}
- node.items.forEach(function(item, i) {
- properties[i] = item
- })
- type = 'array'
- tuple = true
- }
-
- var indent = 0
- var error = function(msg, prop, value) {
- validate('errors++')
- if (reporter === true) {
- validate('if (validate.errors === null) validate.errors = []')
- if (verbose) {
- validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name)
- } else {
- validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg))
- }
- }
- }
-
- if (node.required === true) {
- indent++
- validate('if (%s === undefined) {', name)
- error('is required')
- validate('} else {')
- } else {
- indent++
- validate('if (%s !== undefined) {', name)
- }
-
- var valid = [].concat(type)
- .map(function(t) {
- return types[t || 'any'](name)
- })
- .join(' || ') || 'true'
-
- if (valid !== 'true') {
- indent++
- validate('if (!(%s)) {', valid)
- error('is the wrong type')
- validate('} else {')
- }
-
- if (tuple) {
- if (node.additionalItems === false) {
- validate('if (%s.length > %d) {', name, node.items.length)
- error('has additional items')
- validate('}')
- } else if (node.additionalItems) {
- var i = genloop()
- validate('for (var %s = %d; %s < %s.length; %s++) {', i, node.items.length, i, name, i)
- visit(name+'['+i+']', node.additionalItems, reporter, filter)
- validate('}')
- }
- }
-
- if (node.format && fmts[node.format]) {
- if (type !== 'string' && formats[node.format]) validate('if (%s) {', types.string(name))
- var n = gensym('format')
- scope[n] = fmts[node.format]
-
- if (typeof scope[n] === 'function') validate('if (!%s(%s)) {', n, name)
- else validate('if (!%s.test(%s)) {', n, name)
- error('must be '+node.format+' format')
- validate('}')
- if (type !== 'string' && formats[node.format]) validate('}')
- }
-
- if (Array.isArray(node.required)) {
- var isUndefined = function(req) {
- return genobj(name, req) + ' === undefined'
- }
-
- var checkRequired = function (req) {
- var prop = genobj(name, req);
- validate('if (%s === undefined) {', prop)
- error('is required', prop)
- validate('missing++')
- validate('}')
- }
- validate('if ((%s)) {', type !== 'object' ? types.object(name) : 'true')
- validate('var missing = 0')
- node.required.map(checkRequired)
- validate('}');
- if (!greedy) {
- validate('if (missing === 0) {')
- indent++
- }
- }
-
- if (node.uniqueItems) {
- if (type !== 'array') validate('if (%s) {', types.array(name))
- validate('if (!(unique(%s))) {', name)
- error('must be unique')
- validate('}')
- if (type !== 'array') validate('}')
- }
-
- if (node.enum) {
- var complex = node.enum.some(function(e) {
- return typeof e === 'object'
- })
-
- var compare = complex ?
- function(e) {
- return 'JSON.stringify('+name+')'+' !== JSON.stringify('+JSON.stringify(e)+')'
- } :
- function(e) {
- return name+' !== '+JSON.stringify(e)
- }
-
- validate('if (%s) {', node.enum.map(compare).join(' && ') || 'false')
- error('must be an enum value')
- validate('}')
- }
-
- if (node.dependencies) {
- if (type !== 'object') validate('if (%s) {', types.object(name))
-
- Object.keys(node.dependencies).forEach(function(key) {
- var deps = node.dependencies[key]
- if (typeof deps === 'string') deps = [deps]
-
- var exists = function(k) {
- return genobj(name, k) + ' !== undefined'
- }
-
- if (Array.isArray(deps)) {
- validate('if (%s !== undefined && !(%s)) {', genobj(name, key), deps.map(exists).join(' && ') || 'true')
- error('dependencies not set')
- validate('}')
- }
- if (typeof deps === 'object') {
- validate('if (%s !== undefined) {', genobj(name, key))
- visit(name, deps, reporter, filter)
- validate('}')
- }
- })
-
- if (type !== 'object') validate('}')
- }
-
- if (node.additionalProperties || node.additionalProperties === false) {
- if (type !== 'object') validate('if (%s) {', types.object(name))
-
- var i = genloop()
- var keys = gensym('keys')
-
- var toCompare = function(p) {
- return keys+'['+i+'] !== '+JSON.stringify(p)
- }
-
- var toTest = function(p) {
- return '!'+patterns(p)+'.test('+keys+'['+i+'])'
- }
-
- var additionalProp = Object.keys(properties || {}).map(toCompare)
- .concat(Object.keys(node.patternProperties || {}).map(toTest))
- .join(' && ') || 'true'
-
- validate('var %s = Object.keys(%s)', keys, name)
- ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)
- ('if (%s) {', additionalProp)
-
- if (node.additionalProperties === false) {
- if (filter) validate('delete %s', name+'['+keys+'['+i+']]')
- error('has additional properties', null, JSON.stringify(name+'.') + ' + ' + keys + '['+i+']')
- } else {
- visit(name+'['+keys+'['+i+']]', node.additionalProperties, reporter, filter)
- }
-
- validate
- ('}')
- ('}')
-
- if (type !== 'object') validate('}')
- }
-
- if (node.$ref) {
- var sub = get(root, opts && opts.schemas || {}, node.$ref)
- if (sub) {
- var fn = cache[node.$ref]
- if (!fn) {
- cache[node.$ref] = function proxy(data) {
- return fn(data)
- }
- fn = compile(sub, cache, root, false, opts)
- }
- var n = gensym('ref')
- scope[n] = fn
- validate('if (!(%s(%s))) {', n, name)
- error('referenced schema does not match')
- validate('}')
- }
- }
-
- if (node.not) {
- var prev = gensym('prev')
- validate('var %s = errors', prev)
- visit(name, node.not, false, filter)
- validate('if (%s === errors) {', prev)
- error('negative schema matches')
- validate('} else {')
- ('errors = %s', prev)
- ('}')
- }
-
- if (node.items && !tuple) {
- if (type !== 'array') validate('if (%s) {', types.array(name))
-
- var i = genloop()
- validate('for (var %s = 0; %s < %s.length; %s++) {', i, i, name, i)
- visit(name+'['+i+']', node.items, reporter, filter)
- validate('}')
-
- if (type !== 'array') validate('}')
- }
-
- if (node.patternProperties) {
- if (type !== 'object') validate('if (%s) {', types.object(name))
- var keys = gensym('keys')
- var i = genloop()
- validate
- ('var %s = Object.keys(%s)', keys, name)
- ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)
-
- Object.keys(node.patternProperties).forEach(function(key) {
- var p = patterns(key)
- validate('if (%s.test(%s)) {', p, keys+'['+i+']')
- visit(name+'['+keys+'['+i+']]', node.patternProperties[key], reporter, filter)
- validate('}')
- })
-
- validate('}')
- if (type !== 'object') validate('}')
- }
-
- if (node.pattern) {
- var p = patterns(node.pattern)
- if (type !== 'string') validate('if (%s) {', types.string(name))
- validate('if (!(%s.test(%s))) {', p, name)
- error('pattern mismatch')
- validate('}')
- if (type !== 'string') validate('}')
- }
-
- if (node.allOf) {
- node.allOf.forEach(function(sch) {
- visit(name, sch, reporter, filter)
- })
- }
-
- if (node.anyOf && node.anyOf.length) {
- var prev = gensym('prev')
-
- node.anyOf.forEach(function(sch, i) {
- if (i === 0) {
- validate('var %s = errors', prev)
- } else {
- validate('if (errors !== %s) {', prev)
- ('errors = %s', prev)
- }
- visit(name, sch, false, false)
- })
- node.anyOf.forEach(function(sch, i) {
- if (i) validate('}')
- })
- validate('if (%s !== errors) {', prev)
- error('no schemas match')
- validate('}')
- }
-
- if (node.oneOf && node.oneOf.length) {
- var prev = gensym('prev')
- var passes = gensym('passes')
-
- validate
- ('var %s = errors', prev)
- ('var %s = 0', passes)
-
- node.oneOf.forEach(function(sch, i) {
- visit(name, sch, false, false)
- validate('if (%s === errors) {', prev)
- ('%s++', passes)
- ('} else {')
- ('errors = %s', prev)
- ('}')
- })
-
- validate('if (%s !== 1) {', passes)
- error('no (or more than one) schemas match')
- validate('}')
- }
-
- if (node.multipleOf !== undefined) {
- if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name))
-
- var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1
- if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf)
- else validate('if (%s % %d) {', name, node.multipleOf)
-
- error('has a remainder')
- validate('}')
-
- if (type !== 'number' && type !== 'integer') validate('}')
- }
-
- if (node.maxProperties !== undefined) {
- if (type !== 'object') validate('if (%s) {', types.object(name))
-
- validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties)
- error('has more properties than allowed')
- validate('}')
-
- if (type !== 'object') validate('}')
- }
-
- if (node.minProperties !== undefined) {
- if (type !== 'object') validate('if (%s) {', types.object(name))
-
- validate('if (Object.keys(%s).length < %d) {', name, node.minProperties)
- error('has less properties than allowed')
- validate('}')
-
- if (type !== 'object') validate('}')
- }
-
- if (node.maxItems !== undefined) {
- if (type !== 'array') validate('if (%s) {', types.array(name))
-
- validate('if (%s.length > %d) {', name, node.maxItems)
- error('has more items than allowed')
- validate('}')
-
- if (type !== 'array') validate('}')
- }
-
- if (node.minItems !== undefined) {
- if (type !== 'array') validate('if (%s) {', types.array(name))
-
- validate('if (%s.length < %d) {', name, node.minItems)
- error('has less items than allowed')
- validate('}')
-
- if (type !== 'array') validate('}')
- }
-
- if (node.maxLength !== undefined) {
- if (type !== 'string') validate('if (%s) {', types.string(name))
-
- validate('if (%s.length > %d) {', name, node.maxLength)
- error('has longer length than allowed')
- validate('}')
-
- if (type !== 'string') validate('}')
- }
-
- if (node.minLength !== undefined) {
- if (type !== 'string') validate('if (%s) {', types.string(name))
-
- validate('if (%s.length < %d) {', name, node.minLength)
- error('has less length than allowed')
- validate('}')
-
- if (type !== 'string') validate('}')
- }
-
- if (node.minimum !== undefined) {
- validate('if (%s %s %d) {', name, node.exclusiveMinimum ? '<=' : '<', node.minimum)
- error('is less than minimum')
- validate('}')
- }
-
- if (node.maximum !== undefined) {
- validate('if (%s %s %d) {', name, node.exclusiveMaximum ? '>=' : '>', node.maximum)
- error('is more than maximum')
- validate('}')
- }
-
- if (properties) {
- Object.keys(properties).forEach(function(p) {
- visit(genobj(name, p), properties[p], reporter, filter)
- })
- }
-
- while (indent--) validate('}')
- }
-
- var validate = genfun
- ('function validate(data) {')
- ('validate.errors = null')
- ('var errors = 0')
-
- visit('data', schema, reporter, opts && opts.filter)
-
- validate
- ('return errors === 0')
- ('}')
-
- validate = validate.toFunction(scope)
- validate.errors = null
-
- validate.__defineGetter__('error', function() {
- if (!validate.errors) return ''
- return validate.errors
- .map(function(err) {
- return err.field+' '+err.message
- })
- .join('\n')
- })
-
- validate.toJSON = function() {
- return schema
- }
-
- return validate
-}
-
-module.exports = function(schema, opts) {
- if (typeof schema === 'string') schema = JSON.parse(schema)
- return compile(schema, {}, schema, true, opts)
-}
-
-module.exports.filter = function(schema, opts) {
- var validate = module.exports(schema, xtend(opts, {filter: true}))
- return function(sch) {
- validate(sch)
- return sch
- }
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml
deleted file mode 100644
index 6e5919d..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md
deleted file mode 100644
index 693bff8..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-# generate-function
-
-Module that helps you write generated functions in Node
-
-```
-npm install generate-function
-```
-
-[](http://travis-ci.org/mafintosh/generate-function)
-
-## Disclamer
-
-Writing code that generates code is hard.
-You should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc).
-
-## Usage
-
-``` js
-var genfun = require('generate-function')
-
-var addNumber = function(val) {
- var fn = genfun()
- ('function add(n) {')
- ('return n + %d', val) // supports format strings to insert values
- ('}')
-
- return fn.toFunction() // will compile the function
-}
-
-var add2 = addNumber(2)
-
-console.log('1+2=', add2(1))
-console.log(add2.toString()) // prints the generated function
-```
-
-If you need to close over variables in your generated function pass them to `toFunction(scope)`
-
-``` js
-var multiply = function(a, b) {
- return a * b
-}
-
-var addAndMultiplyNumber = function(val) {
- var fn = genfun()
- ('function(n) {')
- ('if (typeof n !== "number") {') // ending a line with { will indent the source
- ('throw new Error("argument should be a number")')
- ('}')
- ('var result = multiply(%d, n+%d)', val, val)
- ('return result')
- ('}')
-
- // use fn.toString() if you want to see the generated source
-
- return fn.toFunction({
- multiply: multiply
- })
-}
-
-var addAndMultiply2 = addAndMultiplyNumber(2)
-
-console.log('(3 + 2) * 2 =', addAndMultiply2(3))
-```
-
-## Related
-
-See [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that
-can be used to reference an object property
-
-## License
-
-MIT
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js
deleted file mode 100644
index 8d1fee1..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var genfun = require('./')
-
-var multiply = function(a, b) {
- return a * b
-}
-
-var addAndMultiplyNumber = function(val) {
- var fn = genfun()
- ('function(n) {')
- ('if (typeof n !== "number") {') // ending a line with { will indent the source
- ('throw new Error("argument should be a number")')
- ('}')
- ('var result = multiply(%d, n+%d)', val, val)
- ('return result')
- ('}')
-
- // use fn.toString() if you want to see the generated source
-
- return fn.toFunction({
- multiply: multiply
- })
-}
-
-var addAndMultiply2 = addAndMultiplyNumber(2)
-
-console.log(addAndMultiply2.toString())
-console.log('(3 + 2) * 2 =', addAndMultiply2(3))
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js
deleted file mode 100644
index 37e064b..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var util = require('util')
-
-var INDENT_START = /[\{\[]/
-var INDENT_END = /[\}\]]/
-
-module.exports = function() {
- var lines = []
- var indent = 0
-
- var push = function(str) {
- var spaces = ''
- while (spaces.length < indent*2) spaces += ' '
- lines.push(spaces+str)
- }
-
- var line = function(fmt) {
- if (!fmt) return line
-
- if (INDENT_END.test(fmt.trim()[0]) && INDENT_START.test(fmt[fmt.length-1])) {
- indent--
- push(util.format.apply(util, arguments))
- indent++
- return line
- }
- if (INDENT_START.test(fmt[fmt.length-1])) {
- push(util.format.apply(util, arguments))
- indent++
- return line
- }
- if (INDENT_END.test(fmt.trim()[0])) {
- indent--
- push(util.format.apply(util, arguments))
- return line
- }
-
- push(util.format.apply(util, arguments))
- return line
- }
-
- line.toString = function() {
- return lines.join('\n')
- }
-
- line.toFunction = function(scope) {
- var src = 'return ('+line.toString()+')'
-
- var keys = Object.keys(scope || {}).map(function(key) {
- return key
- })
-
- var vals = keys.map(function(key) {
- return scope[key]
- })
-
- return Function.apply(null, keys.concat(src)).apply(null, vals)
- }
-
- if (arguments.length) line.apply(null, arguments)
-
- return line
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json
deleted file mode 100644
index a66214b..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "name": "generate-function",
- "version": "2.0.0",
- "description": "Module that helps you write generated functions in Node",
- "main": "index.js",
- "scripts": {
- "test": "tape test.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/mafintosh/generate-function"
- },
- "keywords": [
- "generate",
- "code",
- "generation",
- "function",
- "performance"
- ],
- "author": {
- "name": "Mathias Buus"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/mafintosh/generate-function/issues"
- },
- "homepage": "https://github.com/mafintosh/generate-function",
- "devDependencies": {
- "tape": "^2.13.4"
- },
- "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149",
- "_id": "generate-function@2.0.0",
- "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74",
- "_from": "generate-function@>=2.0.0 <3.0.0",
- "_npmVersion": "1.4.23",
- "_npmUser": {
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
- },
- "maintainers": [
- {
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
- }
- ],
- "dist": {
- "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74",
- "tarball": "http://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js
deleted file mode 100644
index 2768893..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var tape = require('tape')
-var genfun = require('./')
-
-tape('generate add function', function(t) {
- var fn = genfun()
- ('function add(n) {')
- ('return n + %d', 42)
- ('}')
-
- t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented')
- t.same(fn.toFunction()(10), 52, 'function works')
- t.end()
-})
-
-tape('generate function + closed variables', function(t) {
- var fn = genfun()
- ('function add(n) {')
- ('return n + %d + number', 42)
- ('}')
-
- var notGood = fn.toFunction()
- var good = fn.toFunction({number:10})
-
- try {
- notGood(10)
- t.ok(false, 'function should not work')
- } catch (err) {
- t.same(err.message, 'number is not defined', 'throws reference error')
- }
-
- t.same(good(11), 63, 'function with closed var works')
- t.end()
-})
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore
deleted file mode 100644
index 3c3629e..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml
deleted file mode 100644
index 6e5919d..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE
deleted file mode 100644
index 757562e..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Mathias Buus
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md
deleted file mode 100644
index 0ee0461..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# generate-object-property
-
-Generate safe JS code that can used to reference a object property
-
- npm install generate-object-property
-
-[](http://travis-ci.org/mafintosh/generate-object-property)
-
-## Usage
-
-``` js
-var gen = require('generate-object-property');
-console.log(gen('a','b')); // prints a.b
-console.log(gen('a', 'foo-bar')); // prints a["foo-bar"]
-```
-
-## License
-
-MIT
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
deleted file mode 100644
index 5dc9f77..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var isProperty = require('is-property')
-
-var gen = function(obj, prop) {
- return isProperty(prop) ? obj+'.'+prop : obj+'['+JSON.stringify(prop)+']'
-}
-
-gen.valid = isProperty
-gen.property = function (prop) {
- return isProperty(prop) ? prop : JSON.stringify(prop)
-}
-
-module.exports = gen
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore
deleted file mode 100644
index 8ecfa25..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore
+++ /dev/null
@@ -1,17 +0,0 @@
-lib-cov
-*.seed
-*.log
-*.csv
-*.dat
-*.out
-*.pid
-*.gz
-
-pids
-logs
-results
-
-npm-debug.log
-node_modules/*
-*.DS_Store
-test/*
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE
deleted file mode 100644
index 8ce206a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-
-The MIT License (MIT)
-
-Copyright (c) 2013 Mikola Lysenko
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md
deleted file mode 100644
index ef1d00b..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-is-property
-===========
-Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "])
-
-Example
--------
-
-```javascript
-var isProperty = require("is-property")
-
-console.log(isProperty("foo")) //Prints true
-console.log(isProperty("0")) //Prints false
-```
-
-Install
--------
-
- npm install is-property
-
-### `require("is-property")(str)`
-Checks if str is a property
-
-* `str` is a string which we will test if it is a property or not
-
-**Returns** true or false depending if str is a property
-
-## Credits
-(c) 2013 Mikola Lysenko. MIT License
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js
deleted file mode 100644
index db58b47..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict"
-function isProperty(str) {
- return /^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\
u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12
d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d
\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\u
fb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0
a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u10
6e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2
102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaa
e0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a
71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\
u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)
-}
-module.exports = isProperty
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
deleted file mode 100644
index 9f23619..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "name": "is-property",
- "version": "1.0.2",
- "description": "Tests if a JSON property can be accessed using . syntax",
- "main": "is-property.js",
- "directories": {
- "test": "test"
- },
- "dependencies": {},
- "devDependencies": {
- "tape": "~1.0.4"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/mikolalysenko/is-property.git"
- },
- "keywords": [
- "is",
- "property",
- "json",
- "dot",
- "bracket",
- ".",
- "[]"
- ],
- "author": {
- "name": "Mikola Lysenko"
- },
- "license": "MIT",
- "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50",
- "bugs": {
- "url": "https://github.com/mikolalysenko/is-property/issues"
- },
- "homepage": "https://github.com/mikolalysenko/is-property",
- "_id": "is-property@1.0.2",
- "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84",
- "_from": "is-property@>=1.0.0 <2.0.0",
- "_npmVersion": "2.1.4",
- "_nodeVersion": "0.10.26",
- "_npmUser": {
- "name": "mikolalysenko",
- "email": "mikolalysenko@gmail.com"
- },
- "maintainers": [
- {
- "name": "mikolalysenko",
- "email": "mikolalysenko@gmail.com"
- }
- ],
- "dist": {
- "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84",
- "tarball": "http://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
- },
- "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
deleted file mode 100644
index 699a9bc..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "generate-object-property",
- "version": "1.2.0",
- "description": "Generate safe JS code that can used to reference a object property",
- "repository": {
- "type": "git",
- "url": "https://github.com/mafintosh/generate-object-property"
- },
- "devDependencies": {
- "tape": "^2.13.0"
- },
- "scripts": {
- "test": "tape test.js"
- },
- "dependencies": {
- "is-property": "^1.0.0"
- },
- "bugs": {
- "url": "https://github.com/mafintosh/generate-object-property/issues"
- },
- "homepage": "https://github.com/mafintosh/generate-object-property",
- "main": "index.js",
- "author": {
- "name": "Mathias Buus",
- "url": "@mafintosh"
- },
- "license": "MIT",
- "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c",
- "_id": "generate-object-property@1.2.0",
- "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
- "_from": "generate-object-property@>=1.1.0 <2.0.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
- },
- "maintainers": [
- {
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
- }
- ],
- "dist": {
- "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
- "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js
deleted file mode 100644
index 6c299c6..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var tape = require('tape')
-var gen = require('./')
-
-tape('valid', function(t) {
- t.same(gen('a', 'b'), 'a.b')
- t.end()
-})
-
-tape('invalid', function(t) {
- t.same(gen('a', '-b'), 'a["-b"]')
- t.end()
-})
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
deleted file mode 100644
index a057a7c..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: "node_js"
-node_js:
- - 0.4
- - 0.5
- - 0.6
- - 0.8
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md
deleted file mode 100644
index bcfdb1a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# JSON Pointer for nodejs
-
-This is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).
-
-## Usage
-
- var jsonpointer = require("jsonpointer");
- var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};
- var one = jsonpointer.get(obj, "/foo");
- var two = jsonpointer.get(obj, "/bar/baz");
- var three = jsonpointer.get(obj, "/qux/0");
- var four = jsonpointer.get(obj, "/qux/1");
- var five = jsonpointer.get(obj, "/qux/2");
-
- jsonpointer.set(obj, "/foo", 6); // obj.foo = 6;
-
-## Testing
-
- $ node test.js
- All tests pass.
- $
-
-[](undefined)
-
-## Author
-
-(c) 2011 Jan Lehnardt <ja...@apache.org>
-
-## License
-
-MIT License.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
deleted file mode 100644
index 3f53026..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
+++ /dev/null
@@ -1,79 +0,0 @@
-var console = require("console");
-
-var untilde = function(str) {
- return str.replace(/~./g, function(m) {
- switch (m) {
- case "~0":
- return "~";
- case "~1":
- return "/";
- }
- throw("Invalid tilde escape: " + m);
- });
-}
-
-var traverse = function(obj, pointer, value) {
- // assert(isArray(pointer))
- var part = untilde(pointer.shift());
- if(typeof obj[part] === "undefined") {
- throw("Value for pointer '" + pointer + "' not found.");
- return;
- }
- if(pointer.length !== 0) { // keep traversin!
- return traverse(obj[part], pointer, value);
- }
- // we're done
- if(typeof value === "undefined") {
- // just reading
- return obj[part];
- }
- // set new value, return old value
- var old_value = obj[part];
- if(value === null) {
- delete obj[part];
- } else {
- obj[part] = value;
- }
- return old_value;
-}
-
-var validate_input = function(obj, pointer) {
- if(typeof obj !== "object") {
- throw("Invalid input object.");
- }
-
- if(pointer === "") {
- return [];
- }
-
- if(!pointer) {
- throw("Invalid JSON pointer.");
- }
-
- pointer = pointer.split("/");
- var first = pointer.shift();
- if (first !== "") {
- throw("Invalid JSON pointer.");
- }
-
- return pointer;
-}
-
-var get = function(obj, pointer) {
- pointer = validate_input(obj, pointer);
- if (pointer.length === 0) {
- return obj;
- }
- return traverse(obj, pointer);
-}
-
-var set = function(obj, pointer, value) {
- pointer = validate_input(obj, pointer);
- if (pointer.length === 0) {
- throw("Invalid JSON pointer for set.")
- }
- return traverse(obj, pointer, value);
-}
-
-exports.get = get
-exports.set = set
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
deleted file mode 100644
index 25113c1..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "name": "jsonpointer",
- "description": "Simple JSON Addressing.",
- "tags": [
- "util",
- "simple",
- "util",
- "utility"
- ],
- "version": "1.1.0",
- "author": {
- "name": "Jan Lehnardt",
- "email": "jan@apache.org"
- },
- "contributors": [
- {
- "name": "Joe Hildebrand",
- "email": "joe-github@cursive.net"
- },
- {
- "name": "Filip Noetzel"
- }
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/janl/node-jsonpointer.git"
- },
- "bugs": {
- "url": "http://github.com/janl/node-jsonpointer/issues"
- },
- "engines": [
- "node >= 0.4.9"
- ],
- "main": "./jsonpointer",
- "scripts": {
- "test": "node test.js"
- },
- "readme": "# JSON Pointer for nodejs\n\nThis is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).\n\n## Usage\n\n var jsonpointer = require(\"jsonpointer\");\n var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};\n var one = jsonpointer.get(obj, \"/foo\");\n var two = jsonpointer.get(obj, \"/bar/baz\");\n var three = jsonpointer.get(obj, \"/qux/0\");\n var four = jsonpointer.get(obj, \"/qux/1\");\n var five = jsonpointer.get(obj, \"/qux/2\");\n\n jsonpointer.set(obj, \"/foo\", 6); // obj.foo = 6;\n\n## Testing\n\n $ node test.js\n All tests pass.\n $\n\n[](undefined)\n\n## Author\n\n(c) 2011 Jan Lehnardt <ja...@apache.org>\n\n## License\n\nMIT License.",
- "readmeFilename": "README.md",
- "_id": "jsonpointer@1.1.0",
- "dist": {
- "shasum": "c3c72efaed3b97154163dc01dd349e1cfe0f80fc",
- "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz"
- },
- "_npmVersion": "1.1.69",
- "_npmUser": {
- "name": "jan",
- "email": "jan@apache.org"
- },
- "maintainers": [
- {
- "name": "jan",
- "email": "jan@apache.org"
- }
- ],
- "directories": {},
- "_shasum": "c3c72efaed3b97154163dc01dd349e1cfe0f80fc",
- "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz",
- "_from": "jsonpointer@>=1.1.0 <2.0.0",
- "homepage": "https://github.com/janl/node-jsonpointer"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
deleted file mode 100644
index cdb8ec5..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
+++ /dev/null
@@ -1,100 +0,0 @@
-var assert = require("assert");
-var console = require("console");
-var jsonpointer = require("./jsonpointer");
-
-var obj = {
- a: 1,
- b: {
- c: 2
- },
- d: {
- e: [{a:3}, {b:4}, {c:5}]
- }
-};
-
-assert.equal(jsonpointer.get(obj, "/a"), 1);
-assert.equal(jsonpointer.get(obj, "/b/c"), 2);
-assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 3);
-assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 4);
-assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 5);
-
-// set returns old value
-assert.equal(jsonpointer.set(obj, "/a", 2), 1);
-assert.equal(jsonpointer.set(obj, "/b/c", 3), 2);
-assert.equal(jsonpointer.set(obj, "/d/e/0/a", 4), 3);
-assert.equal(jsonpointer.set(obj, "/d/e/1/b", 5), 4);
-assert.equal(jsonpointer.set(obj, "/d/e/2/c", 6), 5);
-
-assert.equal(jsonpointer.get(obj, "/a"), 2);
-assert.equal(jsonpointer.get(obj, "/b/c"), 3);
-assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 4);
-assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 5);
-assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 6);
-
-assert.equal(jsonpointer.get(obj, ""), obj);
-assert.throws(function() {
- assert.equal(jsonpointer.get(obj, "a"), 3);
-});
-
-var complexKeys = {
- "a/b": {
- c: 1
- },
- d: {
- "e/f": 2
- },
- "~1": 3,
- "01": 4
-}
-
-assert.equal(jsonpointer.get(complexKeys, "/a~1b/c"), 1);
-assert.equal(jsonpointer.get(complexKeys, "/d/e~1f"), 2);
-assert.equal(jsonpointer.get(complexKeys, "/~01"), 3);
-assert.equal(jsonpointer.get(complexKeys, "/01"), 4);
-assert.throws(function() {
- assert.equal(jsonpointer.get(complexKeys, "/a/b/c"), 1);
-});
-assert.throws(function() {
- assert.equal(jsonpointer.get(complexKeys, "/~1"), 3);
-});
-
-// draft-ietf-appsawg-json-pointer-08 has special array rules
-var ary = [ "zero", "one", "two" ];
-
-assert.throws(function() {
- assert.equal(jsonpointer.get(ary, "/01"), "one");
-});
-//assert.equal(jsonpointer.set(ary, "/-", "three"), null);
-//assert.equal(ary[3], "three");
-
-// Examples from the draft:
-var example = {
- "foo": ["bar", "baz"],
- "": 0,
- "a/b": 1,
- "c%d": 2,
- "e^f": 3,
- "g|h": 4,
- "i\\j": 5,
- "k\"l": 6,
- " ": 7,
- "m~n": 8
-};
-
-assert.equal(jsonpointer.get(example, ""), example);
-var ans = jsonpointer.get(example, "/foo");
-assert.equal(ans.length, 2);
-assert.equal(ans[0], "bar");
-assert.equal(ans[1], "baz");
-assert.equal(jsonpointer.get(example, "/foo/0"), "bar");
-assert.equal(jsonpointer.get(example, "/"), 0);
-assert.equal(jsonpointer.get(example, "/a~1b"), 1);
-assert.equal(jsonpointer.get(example, "/c%d"), 2);
-assert.equal(jsonpointer.get(example, "/e^f"), 3);
-assert.equal(jsonpointer.get(example, "/g|h"), 4);
-assert.equal(jsonpointer.get(example, "/i\\j"), 5);
-assert.equal(jsonpointer.get(example, "/k\"l"), 6);
-assert.equal(jsonpointer.get(example, "/ "), 7);
-assert.equal(jsonpointer.get(example, "/m~0n"), 8);
-
-console.log("All tests pass.");
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
deleted file mode 100644
index 904f8ab..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "name": "is-my-json-valid",
- "version": "2.12.0",
- "description": "A JSONSchema validator that uses code generation to be extremely fast",
- "main": "index.js",
- "dependencies": {
- "generate-function": "^2.0.0",
- "generate-object-property": "^1.1.0",
- "jsonpointer": "^1.1.0",
- "xtend": "^4.0.0"
- },
- "devDependencies": {
- "tape": "^2.13.4"
- },
- "scripts": {
- "test": "tape test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/mafintosh/is-my-json-valid"
- },
- "keywords": [
- "json",
- "schema",
- "orderly",
- "jsonschema"
- ],
- "author": {
- "name": "Mathias Buus"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/mafintosh/is-my-json-valid/issues"
- },
- "homepage": "https://github.com/mafintosh/is-my-json-valid",
- "gitHead": "fc2d995ecb1bdb0f367ddf114dfd069265043c6c",
- "_id": "is-my-json-valid@2.12.0",
- "_shasum": "8fa6c408b26be95b45a23e8f8c4b464a53874d2b",
- "_from": "is-my-json-valid@>=2.10.1 <3.0.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
- },
- "maintainers": [
- {
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
- },
- {
- "name": "watson",
- "email": "w@tson.dk"
- },
- {
- "name": "freeall",
- "email": "freeall@gmail.com"
- }
- ],
- "dist": {
- "shasum": "8fa6c408b26be95b45a23e8f8c4b464a53874d2b",
- "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js
deleted file mode 100644
index 0bfb8a2..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var fs = require('fs')
-var path = require('path')
-var compile = require('./')
-
-delete require.cache[require.resolve(__filename)]
-
-module.exports = function(file, opts) {
- file = path.join(path.dirname(module.parent.filename), file)
- if (!fs.existsSync(file) && fs.existsSync(file+'.schema')) file += '.schema'
- if (!fs.existsSync(file) && fs.existsSync(file+'.json')) file += '.json'
- return compile(fs.readFileSync(file, 'utf-8'), opts)
-}
[14/59] [abbrv] couchdb-nmo git commit: website: add video
Posted by ro...@apache.org.
website: add video
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/2870177e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/2870177e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/2870177e
Branch: refs/heads/master
Commit: 2870177e0fedbe9bfce04293c283efde4cfc9e5a
Parents: d9b401f
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun May 24 21:00:59 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sun May 24 21:02:16 2015 +0200
----------------------------------------------------------------------
doc/website/index.md | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/2870177e/doc/website/index.md
----------------------------------------------------------------------
diff --git a/doc/website/index.md b/doc/website/index.md
index 3cab8de..11e57da 100644
--- a/doc/website/index.md
+++ b/doc/website/index.md
@@ -1,10 +1,8 @@
## how to use nmo?
-Take a look at our video
+Take a look at the video:
-<iframe>
-
-</iframe>
+<iframe width="560" height="315" src="//www.youtube.com/embed/V_nChYFPixc" frameborder="0" allowfullscreen></iframe>
### Content from the video
[22/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json b/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json
deleted file mode 100644
index 783f660..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json
+++ /dev/null
@@ -1,1959 +0,0 @@
-[
- {
- "test": "0001",
- "received": [
- "foo=bar"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0002",
- "received": [
- "foo=bar; Expires=Fri, 07 Aug 2019 08:04:19 GMT"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0003",
- "received": [
- "foo=bar; Expires=Fri, 07 Aug 2007 08:04:19 GMT",
- "foo2=bar2; Expires=Fri, 07 Aug 2017 08:04:19 GMT"
- ],
- "sent": [
- { "name": "foo2", "value": "bar2" }
- ]
- },
- {
- "test": "0004",
- "received": [
- "foo"
- ],
- "sent": []
- },
- {
- "test": "0005",
- "received": [
- "foo=bar; max-age=10000;"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0006",
- "received": [
- "foo=bar; max-age=0;"
- ],
- "sent": []
- },
- {
- "test": "0007",
- "received": [
- "foo=bar; version=1;"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0008",
- "received": [
- "foo=bar; version=1000;"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0009",
- "received": [
- "foo=bar; customvalue=1000;"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0010",
- "received": [
- "foo=bar; secure;"
- ],
- "sent": []
- },
- {
- "test": "0011",
- "received": [
- "foo=bar; customvalue=\"1000 or more\";"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0012",
- "received": [
- "foo=bar; customvalue=\"no trailing semicolon\""
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "0013",
- "received": [
- "foo=bar",
- "foo=qux"
- ],
- "sent": [
- { "name": "foo", "value": "qux" }
- ]
- },
- {
- "test": "0014",
- "received": [
- "foo1=bar",
- "foo2=qux"
- ],
- "sent": [
- { "name": "foo1", "value": "bar" },
- { "name": "foo2", "value": "qux" }
- ]
- },
- {
- "test": "0015",
- "received": [
- "a=b",
- "z=y"
- ],
- "sent": [
- { "name": "a", "value": "b" },
- { "name": "z", "value": "y" }
- ]
- },
- {
- "test": "0016",
- "received": [
- "z=y",
- "a=b"
- ],
- "sent": [
- { "name": "z", "value": "y" },
- { "name": "a", "value": "b" }
- ]
- },
- {
- "test": "0017",
- "received": [
- "z=y, a=b"
- ],
- "sent": [
- { "name": "z", "value": "y, a=b" }
- ]
- },
- {
- "test": "0018",
- "received": [
- "z=y; foo=bar, a=b"
- ],
- "sent": [
- { "name": "z", "value": "y" }
- ]
- },
- {
- "test": "0019",
- "received": [
- "foo=b;max-age=3600, c=d;path=/"
- ],
- "sent": [
- { "name": "foo", "value": "b" }
- ]
- },
- {
- "test": "0020",
- "received": [
- "a=b",
- "=",
- "c=d"
- ],
- "sent": [
- { "name": "a", "value": "b" },
- { "name": "c", "value": "d" }
- ]
- },
- {
- "test": "0021",
- "received": [
- "a=b",
- "=x",
- "c=d"
- ],
- "sent": [
- { "name": "a", "value": "b" },
- { "name": "c", "value": "d" }
- ]
- },
- {
- "test": "0022",
- "received": [
- "a=b",
- "x=",
- "c=d"
- ],
- "sent": [
- { "name": "a", "value": "b" },
- { "name": "x", "value": "" },
- { "name": "c", "value": "d" }
- ]
- },
- {
- "test": "0023",
- "received": [
- "foo",
- ""
- ],
- "sent": []
- },
- {
- "test": "0024",
- "received": [
- "foo",
- "="
- ],
- "sent": []
- },
- {
- "test": "0025",
- "received": [
- "foo",
- "; bar"
- ],
- "sent": []
- },
- {
- "test": "0026",
- "received": [
- "foo",
- " "
- ],
- "sent": []
- },
- {
- "test": "0027",
- "received": [
- "foo",
- "bar"
- ],
- "sent": []
- },
- {
- "test": "0028",
- "received": [
- "foo",
- "\t"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0001",
- "received": [
- "foo=bar; Secure"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0002",
- "received": [
- "foo=bar; seCURe"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0003",
- "received": [
- "foo=bar; \"Secure\""
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "ATTRIBUTE0004",
- "received": [
- "foo=bar; Secure="
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0005",
- "received": [
- "foo=bar; Secure=aaaa"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0006",
- "received": [
- "foo=bar; Secure qux"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "ATTRIBUTE0007",
- "received": [
- "foo=bar; Secure =aaaaa"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0008",
- "received": [
- "foo=bar; Secure= aaaaa"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0009",
- "received": [
- "foo=bar; Secure; qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0010",
- "received": [
- "foo=bar; Secure;qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0011",
- "received": [
- "foo=bar; Secure ; qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0012",
- "received": [
- "foo=bar; Secure"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0013",
- "received": [
- "foo=bar; Secure ;"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0014",
- "received": [
- "foo=bar; Path"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "ATTRIBUTE0015",
- "received": [
- "foo=bar; Path="
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "ATTRIBUTE0016",
- "received": [
- "foo=bar; Path=/"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "ATTRIBUTE0017",
- "received": [
- "foo=bar; Path=/qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0018",
- "received": [
- "foo=bar; Path =/qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0019",
- "received": [
- "foo=bar; Path= /qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0020",
- "received": [
- "foo=bar; Path=/qux ; taz"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0021",
- "received": [
- "foo=bar; Path=/qux; Path=/"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "ATTRIBUTE0022",
- "received": [
- "foo=bar; Path=/; Path=/qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0023",
- "received": [
- "foo=bar; Path=/qux; Path=/cookie-parser-result"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "ATTRIBUTE0024",
- "received": [
- "foo=bar; Path=/cookie-parser-result; Path=/qux"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0025",
- "received": [
- "foo=bar; qux; Secure"
- ],
- "sent": []
- },
- {
- "test": "ATTRIBUTE0026",
- "received": [
- "foo=bar; qux=\"aaa;bbb\"; Secure"
- ],
- "sent": []
- },
- {
- "test": "CHARSET0001",
- "received": [
- "foo=\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c"
- ],
- "sent": [
- { "name": "foo", "value": "\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c" }
- ]
- },
- {
- "test": "CHARSET0002",
- "received": [
- "\u6625\u8282\u56de=\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c"
- ],
- "sent": [
- { "name": "\u6625\u8282\u56de", "value": "\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c" }
- ]
- },
- {
- "test": "CHARSET0003",
- "received": [
- "\u6625\u8282\u56de=\u5bb6\u8def\u00b7\u6625\u8fd0; \u5b8c\u5168\u624b\u518c"
- ],
- "sent": [
- { "name": "\u6625\u8282\u56de", "value": "\u5bb6\u8def\u00b7\u6625\u8fd0" }
- ]
- },
- {
- "test": "CHARSET0004",
- "received": [
- "foo=\"\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c\""
- ],
- "sent": [
- { "name": "foo", "value": "\"\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c\"" }
- ]
- },
- {
- "test": "CHROMIUM0001",
- "received": [
- "a=b"
- ],
- "sent": [
- { "name": "a", "value": "b" }
- ]
- },
- {
- "test": "CHROMIUM0002",
- "received": [
- "aBc=\"zzz \" ;"
- ],
- "sent": [
- { "name": "aBc", "value": "\"zzz \"" }
- ]
- },
- {
- "test": "CHROMIUM0003",
- "received": [
- "aBc=\"zzz \" ;"
- ],
- "sent": [
- { "name": "aBc", "value": "\"zzz \"" }
- ]
- },
- {
- "test": "CHROMIUM0004",
- "received": [
- "aBc=\"zz;pp\" ; ;"
- ],
- "sent": [
- { "name": "aBc", "value": "\"zz" }
- ]
- },
- {
- "test": "CHROMIUM0005",
- "received": [
- "aBc=\"zz ;"
- ],
- "sent": [
- { "name": "aBc", "value": "\"zz" }
- ]
- },
- {
- "test": "CHROMIUM0006",
- "received": [
- "aBc=\"zzz \" \"ppp\" ;"
- ],
- "sent": [
- { "name": "aBc", "value": "\"zzz \" \"ppp\"" }
- ]
- },
- {
- "test": "CHROMIUM0007",
- "received": [
- "aBc=\"zzz \" \"ppp\" ;"
- ],
- "sent": [
- { "name": "aBc", "value": "\"zzz \" \"ppp\"" }
- ]
- },
- {
- "test": "CHROMIUM0008",
- "received": [
- "aBc=A\"B ;"
- ],
- "sent": [
- { "name": "aBc", "value": "A\"B" }
- ]
- },
- {
- "test": "CHROMIUM0009",
- "received": [
- "BLAHHH; path=/;"
- ],
- "sent": []
- },
- {
- "test": "CHROMIUM0010",
- "received": [
- "\"BLA\\\"HHH\"; path=/;"
- ],
- "sent": []
- },
- {
- "test": "CHROMIUM0011",
- "received": [
- "a=\"B"
- ],
- "sent": [
- { "name": "a", "value": "\"B" }
- ]
- },
- {
- "test": "CHROMIUM0012",
- "received": [
- "=ABC"
- ],
- "sent": []
- },
- {
- "test": "CHROMIUM0013",
- "received": [
- "ABC=; path = /"
- ],
- "sent": [
- { "name": "ABC", "value": "" }
- ]
- },
- {
- "test": "CHROMIUM0014",
- "received": [
- " A = BC ;foo;;; bar"
- ],
- "sent": [
- { "name": "A", "value": "BC" }
- ]
- },
- {
- "test": "CHROMIUM0015",
- "received": [
- " A=== BC ;foo;;; bar"
- ],
- "sent": [
- { "name": "A", "value": "== BC" }
- ]
- },
- {
- "test": "CHROMIUM0016",
- "received": [
- "foo=\"zohNumRKgI0oxyhSsV3Z7D\" ; expires=Sun, 18-Apr-2027 21:06:29 GMT ; path=/ ; "
- ],
- "sent": [
- { "name": "foo", "value": "\"zohNumRKgI0oxyhSsV3Z7D\"" }
- ]
- },
- {
- "test": "CHROMIUM0017",
- "received": [
- "foo=zohNumRKgI0oxyhSsV3Z7D ; expires=Sun, 18-Apr-2027 21:06:29 GMT ; path=/ ; "
- ],
- "sent": [
- { "name": "foo", "value": "zohNumRKgI0oxyhSsV3Z7D" }
- ]
- },
- {
- "test": "CHROMIUM0018",
- "received": [
- " "
- ],
- "sent": []
- },
- {
- "test": "CHROMIUM0019",
- "received": [
- "a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- ],
- "sent": [
- { "name": "a", "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }
- ]
- },
- {
- "test": "CHROMIUM0021",
- "received": [
- ""
- ],
- "sent": []
- },
- {
- "test": "COMMA0001",
- "received": [
- "foo=bar, baz=qux"
- ],
- "sent": [
- { "name": "foo", "value": "bar, baz=qux" }
- ]
- },
- {
- "test": "COMMA0002",
- "received": [
- "foo=\"bar, baz=qux\""
- ],
- "sent": [
- { "name": "foo", "value": "\"bar, baz=qux\"" }
- ]
- },
- {
- "test": "COMMA0003",
- "received": [
- "foo=bar; b,az=qux"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "COMMA0004",
- "received": [
- "foo=bar; baz=q,ux"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "COMMA0005",
- "received": [
- "foo=bar; Max-Age=50,399"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "COMMA0006",
- "received": [
- "foo=bar; Expires=Fri, 07 Aug 2019 08:04:19 GMT"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "COMMA0007",
- "received": [
- "foo=bar; Expires=Fri 07 Aug 2019 08:04:19 GMT, baz=qux"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DISABLED_CHROMIUM0020",
- "received": [
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- ],
- "sent": []
- },
- {
- "test": "DISABLED_CHROMIUM0022",
- "received": [
- "AAA=BB\u0000ZYX"
- ],
- "sent": [
- { "name": "AAA", "value": "BB" }
- ]
- },
- {
- "test": "DISABLED_CHROMIUM0023",
- "received": [
- "AAA=BB\rZYX"
- ],
- "sent": [
- { "name": "AAA", "value": "BB" }
- ]
- },
- {
- "test": "DISABLED_PATH0029",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/bar"
- ],
- "sent-to": "/cookie-parser-result/f%6Fo/bar?disabled-path0029",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0001",
- "received": [
- "foo=bar; domain=home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0001",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0002",
- "received": [
- "foo=bar; domain=home.example.org"
- ],
- "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0002",
- "sent": []
- },
- {
- "test": "DOMAIN0003",
- "received": [
- "foo=bar; domain=.home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0003",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0004",
- "received": [
- "foo=bar; domain=home.example.org"
- ],
- "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0004",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0005",
- "received": [
- "foo=bar; domain=.home.example.org"
- ],
- "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0005",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0006",
- "received": [
- "foo=bar; domain=.home.example.org"
- ],
- "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0006",
- "sent": []
- },
- {
- "test": "DOMAIN0007",
- "received": [
- "foo=bar; domain=sibling.example.org"
- ],
- "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0007",
- "sent": []
- },
- {
- "test": "DOMAIN0008",
- "received": [
- "foo=bar; domain=.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0008",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0009",
- "received": [
- "foo=bar; domain=example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0009",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0010",
- "received": [
- "foo=bar; domain=..home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0010",
- "sent": []
- },
- {
- "test": "DOMAIN0011",
- "received": [
- "foo=bar; domain=home..example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0011",
- "sent": []
- },
- {
- "test": "DOMAIN0012",
- "received": [
- "foo=bar; domain= .home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0012",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0013",
- "received": [
- "foo=bar; domain= . home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0013",
- "sent": []
- },
- {
- "test": "DOMAIN0014",
- "received": [
- "foo=bar; domain=home.example.org."
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0014",
- "sent": []
- },
- {
- "test": "DOMAIN0015",
- "received": [
- "foo=bar; domain=home.example.org.."
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0015",
- "sent": []
- },
- {
- "test": "DOMAIN0016",
- "received": [
- "foo=bar; domain=home.example.org ."
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0016",
- "sent": []
- },
- {
- "test": "DOMAIN0017",
- "received": [
- "foo=bar; domain=.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0017",
- "sent": []
- },
- {
- "test": "DOMAIN0018",
- "received": [
- "foo=bar; domain=.org."
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0018",
- "sent": []
- },
- {
- "test": "DOMAIN0019",
- "received": [
- "foo=bar; domain=home.example.org",
- "foo2=bar2; domain=.home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0019",
- "sent": [
- { "name": "foo", "value": "bar" },
- { "name": "foo2", "value": "bar2" }
- ]
- },
- {
- "test": "DOMAIN0020",
- "received": [
- "foo2=bar2; domain=.home.example.org",
- "foo=bar; domain=home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0020",
- "sent": [
- { "name": "foo2", "value": "bar2" },
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0021",
- "received": [
- "foo=bar; domain=\"home.example.org\""
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0021",
- "sent": []
- },
- {
- "test": "DOMAIN0022",
- "received": [
- "foo=bar; domain=home.example.org",
- "foo2=bar2; domain=.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0022",
- "sent": [
- { "name": "foo", "value": "bar" },
- { "name": "foo2", "value": "bar2" }
- ]
- },
- {
- "test": "DOMAIN0023",
- "received": [
- "foo2=bar2; domain=.example.org",
- "foo=bar; domain=home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0023",
- "sent": [
- { "name": "foo2", "value": "bar2" },
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0024",
- "received": [
- "foo=bar; domain=.example.org; domain=home.example.org"
- ],
- "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0024",
- "sent": []
- },
- {
- "test": "DOMAIN0025",
- "received": [
- "foo=bar; domain=home.example.org; domain=.example.org"
- ],
- "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0025",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0026",
- "received": [
- "foo=bar; domain=home.eXaMpLe.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0026",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0027",
- "received": [
- "foo=bar; domain=home.example.org:8888"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0027",
- "sent": []
- },
- {
- "test": "DOMAIN0028",
- "received": [
- "foo=bar; domain=subdomain.home.example.org"
- ],
- "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0028",
- "sent": []
- },
- {
- "test": "DOMAIN0029",
- "received": [
- "foo=bar"
- ],
- "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0029",
- "sent": []
- },
- {
- "test": "DOMAIN0031",
- "received": [
- "foo=bar; domain=home.example.org; domain=.example.org"
- ],
- "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0031",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0033",
- "received": [
- "foo=bar; domain=home.example.org"
- ],
- "sent-to": "http://hoMe.eXaMplE.org:8888/cookie-parser-result?domain0033",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0034",
- "received": [
- "foo=bar; domain=home.example.org; domain=home.example.com"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0034",
- "sent": []
- },
- {
- "test": "DOMAIN0035",
- "received": [
- "foo=bar; domain=home.example.com; domain=home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0035",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0036",
- "received": [
- "foo=bar; domain=home.example.org; domain=home.example.com; domain=home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0036",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0037",
- "received": [
- "foo=bar; domain=home.example.com; domain=home.example.org; domain=home.example.com"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0037",
- "sent": []
- },
- {
- "test": "DOMAIN0038",
- "received": [
- "foo=bar; domain=home.example.org; domain=home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0038",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0039",
- "received": [
- "foo=bar; domain=home.example.org; domain=example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0039",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0040",
- "received": [
- "foo=bar; domain=example.org; domain=home.example.org"
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0040",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "DOMAIN0041",
- "received": [
- "foo=bar; domain=.sibling.example.org"
- ],
- "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0041",
- "sent": []
- },
- {
- "test": "DOMAIN0042",
- "received": [
- "foo=bar; domain=.sibling.home.example.org"
- ],
- "sent-to": "http://sibling.home.example.org:8888/cookie-parser-result?domain0042",
- "sent": []
- },
- {
- "test": "MOZILLA0001",
- "received": [
- "foo=bar; max-age=-1"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0002",
- "received": [
- "foo=bar; max-age=0"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0003",
- "received": [
- "foo=bar; expires=Thu, 10 Apr 1980 16:33:12 GMT"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0004",
- "received": [
- "foo=bar; max-age=60"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "MOZILLA0005",
- "received": [
- "foo=bar; max-age=-20"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0006",
- "received": [
- "foo=bar; max-age=60"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "MOZILLA0007",
- "received": [
- "foo=bar; expires=Thu, 10 Apr 1980 16:33:12 GMT"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0008",
- "received": [
- "foo=bar; max-age=60",
- "foo1=bar; max-age=60"
- ],
- "sent": [
- { "name": "foo", "value": "bar" },
- { "name": "foo1", "value": "bar" }
- ]
- },
- {
- "test": "MOZILLA0009",
- "received": [
- "foo=bar; max-age=60",
- "foo1=bar; max-age=60",
- "foo=differentvalue; max-age=0"
- ],
- "sent": [
- { "name": "foo1", "value": "bar" }
- ]
- },
- {
- "test": "MOZILLA0010",
- "received": [
- "foo=bar; max-age=60",
- "foo1=bar; max-age=60",
- "foo=differentvalue; max-age=0",
- "foo2=evendifferentvalue; max-age=0"
- ],
- "sent": [
- { "name": "foo1", "value": "bar" }
- ]
- },
- {
- "test": "MOZILLA0011",
- "received": [
- "test=parser; domain=.parser.test; ;; ;=; ,,, ===,abc,=; abracadabra! max-age=20;=;;"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0012",
- "received": [
- "test=\"fubar! = foo;bar\\\";\" parser; max-age=6",
- "five; max-age=2.63,"
- ],
- "sent": [
- { "name": "test", "value": "\"fubar! = foo" }
- ]
- },
- {
- "test": "MOZILLA0013",
- "received": [
- "test=kill; max-age=0",
- "five; max-age=0"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0014",
- "received": [
- "six"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0015",
- "received": [
- "six",
- "seven"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0016",
- "received": [
- "six",
- "seven",
- " =eight"
- ],
- "sent": []
- },
- {
- "test": "MOZILLA0017",
- "received": [
- "six",
- "seven",
- " =eight",
- "test=six"
- ],
- "sent": [
- { "name": "test", "value": "six" }
- ]
- },
- {
- "test": "NAME0001",
- "received": [
- "a=bar"
- ],
- "sent": [
- { "name": "a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0002",
- "received": [
- "1=bar"
- ],
- "sent": [
- { "name": "1", "value": "bar" }
- ]
- },
- {
- "test": "NAME0003",
- "received": [
- "$=bar"
- ],
- "sent": [
- { "name": "$", "value": "bar" }
- ]
- },
- {
- "test": "NAME0004",
- "received": [
- "!a=bar"
- ],
- "sent": [
- { "name": "!a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0005",
- "received": [
- "@a=bar"
- ],
- "sent": [
- { "name": "@a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0006",
- "received": [
- "#a=bar"
- ],
- "sent": [
- { "name": "#a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0007",
- "received": [
- "$a=bar"
- ],
- "sent": [
- { "name": "$a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0008",
- "received": [
- "%a=bar"
- ],
- "sent": [
- { "name": "%a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0009",
- "received": [
- "^a=bar"
- ],
- "sent": [
- { "name": "^a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0010",
- "received": [
- "&a=bar"
- ],
- "sent": [
- { "name": "&a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0011",
- "received": [
- "*a=bar"
- ],
- "sent": [
- { "name": "*a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0012",
- "received": [
- "(a=bar"
- ],
- "sent": [
- { "name": "(a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0013",
- "received": [
- ")a=bar"
- ],
- "sent": [
- { "name": ")a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0014",
- "received": [
- "-a=bar"
- ],
- "sent": [
- { "name": "-a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0015",
- "received": [
- "_a=bar"
- ],
- "sent": [
- { "name": "_a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0016",
- "received": [
- "+=bar"
- ],
- "sent": [
- { "name": "+", "value": "bar" }
- ]
- },
- {
- "test": "NAME0017",
- "received": [
- "=a=bar"
- ],
- "sent": []
- },
- {
- "test": "NAME0018",
- "received": [
- "a =bar"
- ],
- "sent": [
- { "name": "a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0019",
- "received": [
- "\"a=bar"
- ],
- "sent": [
- { "name": "\"a", "value": "bar" }
- ]
- },
- {
- "test": "NAME0020",
- "received": [
- "\"a=b\"=bar"
- ],
- "sent": [
- { "name": "\"a", "value": "b\"=bar" }
- ]
- },
- {
- "test": "NAME0021",
- "received": [
- "\"a=b\"=bar",
- "\"a=qux"
- ],
- "sent": [
- { "name": "\"a", "value": "qux" }
- ]
- },
- {
- "test": "NAME0022",
- "received": [
- " foo=bar"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "NAME0023",
- "received": [
- "foo;bar=baz"
- ],
- "sent": []
- },
- {
- "test": "NAME0024",
- "received": [
- "$Version=1; foo=bar"
- ],
- "sent": [
- { "name": "$Version", "value": "1" }
- ]
- },
- {
- "test": "NAME0025",
- "received": [
- "===a=bar"
- ],
- "sent": []
- },
- {
- "test": "NAME0026",
- "received": [
- "foo=bar "
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "NAME0027",
- "received": [
- "foo=bar ;"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "NAME0028",
- "received": [
- "=a"
- ],
- "sent": []
- },
- {
- "test": "NAME0029",
- "received": [
- "="
- ],
- "sent": []
- },
- {
- "test": "NAME0030",
- "received": [
- "foo bar=baz"
- ],
- "sent": [
- { "name": "foo bar", "value": "baz" }
- ]
- },
- {
- "test": "NAME0031",
- "received": [
- "\"foo;bar\"=baz"
- ],
- "sent": []
- },
- {
- "test": "NAME0032",
- "received": [
- "\"foo\\\"bar;baz\"=qux"
- ],
- "sent": []
- },
- {
- "test": "NAME0033",
- "received": [
- "=foo=bar",
- "aaa"
- ],
- "sent": []
- },
- {
- "test": "OPTIONAL_DOMAIN0030",
- "received": [
- "foo=bar; domain="
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?optional-domain0030",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "OPTIONAL_DOMAIN0041",
- "received": [
- "foo=bar; domain=example.org; domain="
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?optional-domain0041",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "OPTIONAL_DOMAIN0042",
- "received": [
- "foo=bar; domain=foo.example.org; domain="
- ],
- "sent-to": "http://home.example.org:8888/cookie-parser-result?optional-domain0042",
- "sent": []
- },
- {
- "test": "OPTIONAL_DOMAIN0043",
- "received": [
- "foo=bar; domain=foo.example.org; domain="
- ],
- "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?optional-domain0043",
- "sent": []
- },
- {
- "test": "ORDERING0001",
- "received": [
- "key=val0;",
- "key=val1; path=/cookie-parser-result",
- "key=val2; path=/",
- "key=val3; path=/bar",
- "key=val4; domain=.example.org",
- "key=val5; domain=.example.org; path=/cookie-parser-result/foo"
- ],
- "sent-to": "/cookie-parser-result/foo/baz?ordering0001",
- "sent": [
- { "name": "key", "value": "val5" },
- { "name": "key", "value": "val1" },
- { "name": "key", "value": "val2" },
- { "name": "key", "value": "val4" }
- ]
- },
- {
- "test": "PATH0001",
- "received": [
- "a=b; path=/",
- "x=y; path=/cookie-parser-result"
- ],
- "sent": [
- { "name": "x", "value": "y" },
- { "name": "a", "value": "b" }
- ]
- },
- {
- "test": "PATH0002",
- "received": [
- "a=b; path=/cookie-parser-result",
- "x=y; path=/"
- ],
- "sent": [
- { "name": "a", "value": "b" },
- { "name": "x", "value": "y" }
- ]
- },
- {
- "test": "PATH0003",
- "received": [
- "x=y; path=/",
- "a=b; path=/cookie-parser-result"
- ],
- "sent": [
- { "name": "a", "value": "b" },
- { "name": "x", "value": "y" }
- ]
- },
- {
- "test": "PATH0004",
- "received": [
- "x=y; path=/cookie-parser-result",
- "a=b; path=/"
- ],
- "sent": [
- { "name": "x", "value": "y" },
- { "name": "a", "value": "b" }
- ]
- },
- {
- "test": "PATH0005",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo"
- ],
- "sent": []
- },
- {
- "test": "PATH0006",
- "received": [
- "foo=bar",
- "foo=qux; path=/cookie-parser-result/foo"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0007",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo"
- ],
- "sent-to": "/cookie-parser-result/foo?path0007",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0008",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo"
- ],
- "sent-to": "/cookie-parser-result/bar?path0008",
- "sent": []
- },
- {
- "test": "PATH0009",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux"
- ],
- "sent-to": "/cookie-parser-result/foo?path0009",
- "sent": []
- },
- {
- "test": "PATH0010",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux"
- ],
- "sent-to": "/cookie-parser-result/foo/qux?path0010",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0011",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux"
- ],
- "sent-to": "/cookie-parser-result/bar/qux?path0011",
- "sent": []
- },
- {
- "test": "PATH0012",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux"
- ],
- "sent-to": "/cookie-parser-result/foo/baz?path0012",
- "sent": []
- },
- {
- "test": "PATH0013",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux/"
- ],
- "sent-to": "/cookie-parser-result/foo/baz?path0013",
- "sent": []
- },
- {
- "test": "PATH0014",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux/"
- ],
- "sent-to": "/cookie-parser-result/foo/qux?path0014",
- "sent": []
- },
- {
- "test": "PATH0015",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux/"
- ],
- "sent-to": "/cookie-parser-result/foo/qux/?path0015",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0016",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/"
- ],
- "sent-to": "/cookie-parser-result/foo/qux?path0016",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0017",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/"
- ],
- "sent-to": "/cookie-parser-result/foo//qux?path0017",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0018",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/"
- ],
- "sent-to": "/cookie-parser-result/fooqux?path0018",
- "sent": []
- },
- {
- "test": "PATH0019",
- "received": [
- "foo=bar; path"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0020",
- "received": [
- "foo=bar; path="
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0021",
- "received": [
- "foo=bar; path=/"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0022",
- "received": [
- "foo=bar; path= /"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0023",
- "received": [
- "foo=bar; Path=/cookie-PARSER-result"
- ],
- "sent": []
- },
- {
- "test": "PATH0024",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux?"
- ],
- "sent-to": "/cookie-parser-result/foo/qux?path0024",
- "sent": []
- },
- {
- "test": "PATH0025",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux#"
- ],
- "sent-to": "/cookie-parser-result/foo/qux?path0025",
- "sent": []
- },
- {
- "test": "PATH0026",
- "received": [
- "foo=bar; path=/cookie-parser-result/foo/qux;"
- ],
- "sent-to": "/cookie-parser-result/foo/qux?path0026",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0027",
- "received": [
- "foo=bar; path=\"/cookie-parser-result/foo/qux;\""
- ],
- "sent-to": "/cookie-parser-result/foo/qux?path0027",
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0028",
- "received": [
- "foo=bar; path=/cookie-parser-result/f%6Fo/bar"
- ],
- "sent-to": "/cookie-parser-result/foo/bar?path0028",
- "sent": []
- },
- {
- "test": "PATH0029",
- "received": [
- "a=b; \tpath\t=\t/cookie-parser-result\t",
- "x=y; \tpath\t=\t/book\t"
- ],
- "sent": [
- { "name": "a", "value": "b" }
- ]
- },
- {
- "test": "PATH0030",
- "received": [
- "foo=bar; path=/dog; path="
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "PATH0031",
- "received": [
- "foo=bar; path=; path=/dog"
- ],
- "sent": []
- },
- {
- "test": "PATH0032",
- "received": [
- "foo=bar; path=/cookie-parser-result",
- "foo=qux; path=/cookie-parser-result/"
- ],
- "sent-to": "/cookie-parser-result/dog?path0032",
- "sent": [
- { "name": "foo", "value": "qux" },
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "VALUE0001",
- "received": [
- "foo= bar"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- },
- {
- "test": "VALUE0002",
- "received": [
- "foo=\"bar\""
- ],
- "sent": [
- { "name": "foo", "value": "\"bar\"" }
- ]
- },
- {
- "test": "VALUE0003",
- "received": [
- "foo=\" bar \""
- ],
- "sent": [
- { "name": "foo", "value": "\" bar \"" }
- ]
- },
- {
- "test": "VALUE0004",
- "received": [
- "foo=\"bar;baz\""
- ],
- "sent": [
- { "name": "foo", "value": "\"bar" }
- ]
- },
- {
- "test": "VALUE0005",
- "received": [
- "foo=\"bar=baz\""
- ],
- "sent": [
- { "name": "foo", "value": "\"bar=baz\"" }
- ]
- },
- {
- "test": "VALUE0006",
- "received": [
- "\tfoo\t=\tbar\t \t;\tttt"
- ],
- "sent": [
- { "name": "foo", "value": "bar" }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/ietf_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/ietf_test.js b/node_modules/request/node_modules/tough-cookie/test/ietf_test.js
deleted file mode 100644
index fac2e3e..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/ietf_test.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var fs = require('fs');
-var path = require('path');
-var url = require('url');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-var CookieJar = tough.CookieJar;
-
-function readJson(filePath) {
- filePath = path.join(__dirname, filePath);
- return JSON.parse(fs.readFileSync(filePath).toString());
-}
-
-function setGetCookieVows() {
- var theVows = {};
- var data = readJson('./ietf_data/parser.json');
-
- data.forEach(function (testCase) {
- theVows[testCase.test] = function () {
- var jar = new CookieJar();
- var expected = testCase['sent']
- var sentFrom = 'http://home.example.org/cookie-parser?' + testCase.test;
- var sentTo = testCase['sent-to'] ?
- url.resolve('http://home.example.org', testCase['sent-to']) :
- 'http://home.example.org/cookie-parser-result?' + testCase.test;
-
- testCase['received'].forEach(function (cookieStr) {
- jar.setCookieSync(cookieStr, sentFrom, {ignoreError: true});
- });
-
- var actual = jar.getCookiesSync(sentTo);
- actual = actual.sort(tough.cookieCompare);
-
- assert.strictEqual(actual.length, expected.length);
-
- actual.forEach(function (actualCookie, idx) {
- var expectedCookie = expected[idx];
- assert.strictEqual(actualCookie.key, expectedCookie.name);
- assert.strictEqual(actualCookie.value, expectedCookie.value);
- });
- };
- });
-
- return {'Set/get cookie tests': theVows};
-}
-
-function dateVows() {
- var theVows = {};
-
- [
- './ietf_data/dates/bsd-examples.json',
- './ietf_data/dates/examples.json'
- ].forEach(function (filePath) {
- var data = readJson(filePath);
- var fileName = path.basename(filePath);
-
- data.forEach(function (testCase) {
- theVows[fileName + ' : ' + testCase.test] = function () {
- var actual = tough.parseDate(testCase.test);
- actual = actual ? actual.toUTCString() : null;
- assert.strictEqual(actual, testCase.expected);
- };
- });
- });
-
- return {'Date': theVows};
-}
-
-vows
- .describe('IETF http state tests')
- .addBatch(setGetCookieVows())
- .addBatch(dateVows())
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/lifetime_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/lifetime_test.js b/node_modules/request/node_modules/tough-cookie/test/lifetime_test.js
deleted file mode 100644
index e66a22b..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/lifetime_test.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-
-vows
- .describe('Lifetime')
- .addBatch({
- "TTL with max-age": function () {
- var c = new Cookie();
- c.maxAge = 123;
- assert.equal(c.TTL(), 123000);
- assert.equal(c.expiryTime(new Date(9000000)), 9123000);
- },
- "TTL with zero max-age": function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- c.maxAge = 0; // should be treated as "earliest representable"
- assert.equal(c.TTL(), 0);
- assert.equal(c.expiryTime(new Date(9000000)), -Infinity);
- assert.ok(!c.validate()); // not valid, really: non-zero-digit *DIGIT
- },
- "TTL with negative max-age": function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- c.maxAge = -1; // should be treated as "earliest representable"
- assert.equal(c.TTL(), 0);
- assert.equal(c.expiryTime(new Date(9000000)), -Infinity);
- assert.ok(!c.validate()); // not valid, really: non-zero-digit *DIGIT
- },
- "TTL with max-age and expires": function () {
- var c = new Cookie();
- c.maxAge = 123;
- c.expires = new Date(Date.now() + 9000);
- assert.equal(c.TTL(), 123000);
- assert.ok(c.isPersistent());
- },
- "TTL with expires": function () {
- var c = new Cookie();
- var now = Date.now();
- c.expires = new Date(now + 9000);
- assert.equal(c.TTL(now), 9000);
- assert.equal(c.expiryTime(), c.expires.getTime());
- },
- "TTL with old expires": function () {
- var c = new Cookie();
- c.setExpires('17 Oct 2010 00:00:00 GMT');
- assert.ok(c.TTL() < 0);
- assert.ok(c.isPersistent());
- },
- "default TTL": {
- topic: function () {
- return new Cookie();
- },
- "is Infinite-future": function (c) {
- assert.equal(c.TTL(), Infinity)
- },
- "is a 'session' cookie": function (c) {
- assert.ok(!c.isPersistent())
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/parsing_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/parsing_test.js b/node_modules/request/node_modules/tough-cookie/test/parsing_test.js
deleted file mode 100644
index cb37c63..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/parsing_test.js
+++ /dev/null
@@ -1,294 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-
-vows
- .describe('Parsing')
- .addBatch({
- "simple": {
- topic: function() {
- return Cookie.parse('a=bcd') || null;
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'a') },
- "value": function(c) { assert.equal(c.value, 'bcd') },
- "no path": function(c) { assert.equal(c.path, null) },
- "no domain": function(c) { assert.equal(c.domain, null) },
- "no extensions": function(c) { assert.ok(!c.extensions) }
- },
- "with expiry": {
- topic: function() {
- return Cookie.parse('a=bcd; Expires=Tue, 18 Oct 2011 07:05:03 GMT') || null;
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'a') },
- "value": function(c) { assert.equal(c.value, 'bcd') },
- "has expires": function(c) {
- assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be');
- assert.equal(c.expires.getTime(), 1318921503000);
- }
- },
- "with expiry and path": {
- topic: function() {
- return Cookie.parse('abc="xyzzy!"; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Path=/aBc') || null;
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'abc') },
- "value": function(c) { assert.equal(c.value, '"xyzzy!"') },
- "has expires": function(c) {
- assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be');
- assert.equal(c.expires.getTime(), 1318921503000);
- },
- "has path": function(c) { assert.equal(c.path, '/aBc'); },
- "no httponly or secure": function(c) {
- assert.ok(!c.httpOnly);
- assert.ok(!c.secure);
- }
- },
- "with everything": {
- topic: function() {
- return Cookie.parse('abc="xyzzy!"; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Path=/aBc; Domain=example.com; Secure; HTTPOnly; Max-Age=1234; Foo=Bar; Baz') || null;
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'abc') },
- "value": function(c) { assert.equal(c.value, '"xyzzy!"') },
- "has expires": function(c) {
- assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be');
- assert.equal(c.expires.getTime(), 1318921503000);
- },
- "has path": function(c) { assert.equal(c.path, '/aBc'); },
- "has domain": function(c) { assert.equal(c.domain, 'example.com'); },
- "has httponly": function(c) { assert.equal(c.httpOnly, true); },
- "has secure": function(c) { assert.equal(c.secure, true); },
- "has max-age": function(c) { assert.equal(c.maxAge, 1234); },
- "has extensions": function(c) {
- assert.ok(c.extensions);
- assert.equal(c.extensions[0], 'Foo=Bar');
- assert.equal(c.extensions[1], 'Baz');
- }
- },
- "invalid expires": function() {
- var c = Cookie.parse("a=b; Expires=xyzzy");
- assert.ok(c);
- assert.equal(c.expires, Infinity);
- },
- "zero max-age": function() {
- var c = Cookie.parse("a=b; Max-Age=0");
- assert.ok(c);
- assert.equal(c.maxAge, 0);
- },
- "negative max-age": function() {
- var c = Cookie.parse("a=b; Max-Age=-1");
- assert.ok(c);
- assert.equal(c.maxAge, -1);
- },
- "empty domain": function() {
- var c = Cookie.parse("a=b; domain=");
- assert.ok(c);
- assert.equal(c.domain, null);
- },
- "dot domain": function() {
- var c = Cookie.parse("a=b; domain=.");
- assert.ok(c);
- assert.equal(c.domain, null);
- },
- "uppercase domain": function() {
- var c = Cookie.parse("a=b; domain=EXAMPLE.COM");
- assert.ok(c);
- assert.equal(c.domain, 'example.com');
- },
- "trailing dot in domain": {
- topic: function() {
- return Cookie.parse("a=b; Domain=example.com.", true) || null;
- },
- "has the domain": function(c) { assert.equal(c.domain,"example.com.") },
- "but doesn't validate": function(c) { assert.equal(c.validate(),false) }
- },
- "empty path": function() {
- var c = Cookie.parse("a=b; path=");
- assert.ok(c);
- assert.equal(c.path, null);
- },
- "no-slash path": function() {
- var c = Cookie.parse("a=b; path=xyzzy");
- assert.ok(c);
- assert.equal(c.path, null);
- },
- "trailing semi-colons after path": {
- topic: function () {
- return [
- "a=b; path=/;",
- "c=d;;;;"
- ];
- },
- "strips semi-colons": function (t) {
- var c1 = Cookie.parse(t[0]);
- var c2 = Cookie.parse(t[1]);
- assert.ok(c1);
- assert.ok(c2);
- assert.equal(c1.path, '/');
- }
- },
- "secure-with-value": function() {
- var c = Cookie.parse("a=b; Secure=xyzzy");
- assert.ok(c);
- assert.equal(c.secure, true);
- },
- "httponly-with-value": function() {
- var c = Cookie.parse("a=b; HttpOnly=xyzzy");
- assert.ok(c);
- assert.equal(c.httpOnly, true);
- },
- "garbage": {
- topic: function() {
- return Cookie.parse("\x08", true) || null;
- },
- "doesn't parse": function(c) { assert.equal(c,null) }
- },
- "public suffix domain": {
- topic: function() {
- return Cookie.parse("a=b; domain=kyoto.jp", true) || null;
- },
- "parses fine": function(c) {
- assert.ok(c);
- assert.equal(c.domain, 'kyoto.jp');
- },
- "but fails validation": function(c) {
- assert.ok(c);
- assert.ok(!c.validate());
- }
- },
- "public suffix foonet.net": {
- "top level": {
- topic: function() {
- return Cookie.parse("a=b; domain=foonet.net") || null;
- },
- "parses and is valid": function(c) {
- assert.ok(c);
- assert.equal(c.domain, 'foonet.net');
- assert.ok(c.validate());
- }
- },
- "www": {
- topic: function() {
- return Cookie.parse("a=b; domain=www.foonet.net") || null;
- },
- "parses and is valid": function(c) {
- assert.ok(c);
- assert.equal(c.domain, 'www.foonet.net');
- assert.ok(c.validate());
- }
- },
- "with a dot": {
- topic: function() {
- return Cookie.parse("a=b; domain=.foonet.net") || null;
- },
- "parses and is valid": function(c) {
- assert.ok(c);
- assert.equal(c.domain, 'foonet.net');
- assert.ok(c.validate());
- }
- }
- },
- "Ironically, Google 'GAPS' cookie has very little whitespace": {
- topic: function() {
- return Cookie.parse("GAPS=1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-;Path=/;Expires=Thu, 17-Apr-2014 02:12:29 GMT;Secure;HttpOnly");
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'GAPS') },
- "value": function(c) { assert.equal(c.value, '1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-') },
- "path": function(c) {
- assert.notEqual(c.path, '/;Expires'); // BUG
- assert.equal(c.path, '/');
- },
- "expires": function(c) {
- assert.notEqual(c.expires, Infinity);
- assert.equal(c.expires.getTime(), 1397700749000);
- },
- "secure": function(c) { assert.ok(c.secure) },
- "httponly": function(c) { assert.ok(c.httpOnly) }
- },
- "lots of equal signs": {
- topic: function() {
- return Cookie.parse("queryPref=b=c&d=e; Path=/f=g; Expires=Thu, 17 Apr 2014 02:12:29 GMT; HttpOnly");
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'queryPref') },
- "value": function(c) { assert.equal(c.value, 'b=c&d=e') },
- "path": function(c) {
- assert.equal(c.path, '/f=g');
- },
- "expires": function(c) {
- assert.notEqual(c.expires, Infinity);
- assert.equal(c.expires.getTime(), 1397700749000);
- },
- "httponly": function(c) { assert.ok(c.httpOnly) }
- },
- "spaces in value": {
- topic: function() {
- return Cookie.parse('a=one two three',false) || null;
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'a') },
- "value": function(c) { assert.equal(c.value, 'one two three') },
- "no path": function(c) { assert.equal(c.path, null) },
- "no domain": function(c) { assert.equal(c.domain, null) },
- "no extensions": function(c) { assert.ok(!c.extensions) }
- },
- "quoted spaces in value": {
- topic: function() {
- return Cookie.parse('a="one two three"',false) || null;
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'a') },
- "value": function(c) { assert.equal(c.value, '"one two three"') },
- "no path": function(c) { assert.equal(c.path, null) },
- "no domain": function(c) { assert.equal(c.domain, null) },
- "no extensions": function(c) { assert.ok(!c.extensions) }
- },
- "non-ASCII in value": {
- topic: function() {
- return Cookie.parse('farbe=weiß',false) || null;
- },
- "parsed": function(c) { assert.ok(c) },
- "key": function(c) { assert.equal(c.key, 'farbe') },
- "value": function(c) { assert.equal(c.value, 'weiß') },
- "no path": function(c) { assert.equal(c.path, null) },
- "no domain": function(c) { assert.equal(c.domain, null) },
- "no extensions": function(c) { assert.ok(!c.extensions) }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/regression_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/regression_test.js b/node_modules/request/node_modules/tough-cookie/test/regression_test.js
deleted file mode 100644
index 4edb609..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/regression_test.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var async = require('async');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-var CookieJar = tough.CookieJar;
-
-var atNow = Date.now();
-
-function at(offset) {
- return {now: new Date(atNow + offset)};
-}
-
-vows
- .describe('Regression tests')
- .addBatch({
- "Issue 1": {
- topic: function () {
- var cj = new CookieJar();
- cj.setCookie('hello=world; path=/some/path/', 'http://domain/some/path/file', function (err, cookie) {
- this.callback(err, {cj: cj, cookie: cookie});
- }.bind(this));
- },
- "stored a cookie": function (t) {
- assert.ok(t.cookie);
- },
- "getting it back": {
- topic: function (t) {
- t.cj.getCookies('http://domain/some/path/file', function (err, cookies) {
- this.callback(err, {cj: t.cj, cookies: cookies || []});
- }.bind(this));
- },
- "got one cookie": function (t) {
- assert.lengthOf(t.cookies, 1);
- },
- "it's the right one": function (t) {
- var c = t.cookies[0];
- assert.equal(c.key, 'hello');
- assert.equal(c.value, 'world');
- }
- }
- }
- })
- .addBatch({
- "trailing semi-colon set into cj": {
- topic: function () {
- var cb = this.callback;
- var cj = new CookieJar();
- var ex = 'http://www.example.com';
- var tasks = [];
- tasks.push(function (next) {
- cj.setCookie('broken_path=testme; path=/;', ex, at(-1), next);
- });
- tasks.push(function (next) {
- cj.setCookie('b=2; Path=/;;;;', ex, at(-1), next);
- });
- async.parallel(tasks, function (err, cookies) {
- cb(null, {
- cj: cj,
- cookies: cookies
- });
- });
- },
- "check number of cookies": function (t) {
- assert.lengthOf(t.cookies, 2, "didn't set");
- },
- "check *broken_path* was set properly": function (t) {
- assert.equal(t.cookies[0].key, "broken_path");
- assert.equal(t.cookies[0].value, "testme");
- assert.equal(t.cookies[0].path, "/");
- },
- "check *b* was set properly": function (t) {
- assert.equal(t.cookies[1].key, "b");
- assert.equal(t.cookies[1].value, "2");
- assert.equal(t.cookies[1].path, "/");
- },
- "retrieve the cookie": {
- topic: function (t) {
- var cb = this.callback;
- t.cj.getCookies('http://www.example.com', {}, function (err, cookies) {
- t.cookies = cookies;
- cb(err, t);
- });
- },
- "get the cookie": function (t) {
- assert.lengthOf(t.cookies, 2);
- assert.equal(t.cookies[0].key, 'broken_path');
- assert.equal(t.cookies[0].value, 'testme');
- assert.equal(t.cookies[1].key, "b");
- assert.equal(t.cookies[1].value, "2");
- assert.equal(t.cookies[1].path, "/");
- }
- }
- }
- })
- .addBatch({
- "tough-cookie throws exception on malformed URI (GH-32)": {
- topic: function () {
- var url = "http://www.example.com/?test=100%";
- var cj = new CookieJar();
-
- cj.setCookieSync("Test=Test", url);
-
- return cj.getCookieStringSync(url);
- },
- "cookies are set": function (cookieStr) {
- assert.strictEqual(cookieStr, "Test=Test");
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/tough-cookie-deps.tsv
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/tough-cookie-deps.tsv b/node_modules/request/node_modules/tough-cookie/tough-cookie-deps.tsv
deleted file mode 100644
index 6796773..0000000
--- a/node_modules/request/node_modules/tough-cookie/tough-cookie-deps.tsv
+++ /dev/null
@@ -1,6 +0,0 @@
-async (0.1.18) MIT (http://github.com/caolan/async/raw/master/LICENSE) node_modules/async/package.json
-diff (1.0.8) BSD (http://github.com/kpdecker/jsdiff/blob/master/LICENSE) node_modules/vows/node_modules/diff/package.json
-eyes (0.1.8) MIT License (https://spdx.org/licenses/MIT) node_modules/vows/node_modules/eyes/package.json
-punycode (1.0.0) MIT (http://mths.be/mit) node_modules/punycode/package.json
-tough-cookie (0.12.1) MIT License (https://spdx.org/licenses/MIT) package.json
-vows (0.7.0) MIT License (https://spdx.org/licenses/MIT) node_modules/vows/LICENSE
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tunnel-agent/.jshintrc
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tunnel-agent/.jshintrc b/node_modules/request/node_modules/tunnel-agent/.jshintrc
deleted file mode 100644
index 4c1c8d4..0000000
--- a/node_modules/request/node_modules/tunnel-agent/.jshintrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "node": true,
- "asi": true,
- "laxcomma": true
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tunnel-agent/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tunnel-agent/LICENSE b/node_modules/request/node_modules/tunnel-agent/LICENSE
deleted file mode 100644
index a4a9aee..0000000
--- a/node_modules/request/node_modules/tunnel-agent/LICENSE
+++ /dev/null
@@ -1,55 +0,0 @@
-Apache License
-
-Version 2.0, January 2004
-
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modi
fications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
[59/59] [abbrv] couchdb-nmo git commit: describe why we check in
production modules
Posted by ro...@apache.org.
describe why we check in production modules
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/35982a55
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/35982a55
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/35982a55
Branch: refs/heads/master
Commit: 35982a557a61ef04bb2ff66302dfe29be2e78fea
Parents: 1f09715
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Jul 12 14:00:00 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sun Jul 12 14:00:00 2015 +0200
----------------------------------------------------------------------
README.md | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/35982a55/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 1ab308e..1f5cff5 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,14 @@ npm install -g nmo
It is written in ES6 and is using promises and generators for control
flow. We are aiming for 100% test coverage.
+Production dependencies are checked in for multiple reasons:
+
+ - blazing fast installs for our users as they are defined as
+ `bundledDependencies` in the `package.json` file and npm just
+ downloads one tarball
+ - if a package gets deleted on the registry, `nmo` still works for
+ new installs
+ - every contributor has the same version of a module
## Help
[27/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js b/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js
deleted file mode 100644
index ba054f4..0000000
--- a/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js
+++ /dev/null
@@ -1,293 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-'use strict';
-var fs = require('fs');
-var assert = require('assert');
-var punycode = require('punycode');
-
-fs.readFile('./public-suffix.txt', 'utf8', function(err,string) {
- if (err) {
- throw err;
- }
- var lines = string.split("\n");
- process.nextTick(function() {
- processList(lines);
- });
-});
-
-var index = {};
-
-var COMMENT = new RegExp('//.+');
-function processList(lines) {
- while (lines.length) {
- var line = lines.shift();
- line = line.replace(COMMENT,'').trim();
- if (!line) {
- continue;
- }
- addToIndex(index,line);
- }
-
- pubSufTest();
-
- var w = fs.createWriteStream('./lib/pubsuffix.js',{
- flags: 'w',
- encoding: 'utf8',
- mode: parseInt('644',8)
- });
- w.on('end', process.exit);
- w.write("/****************************************************\n");
- w.write(" * AUTOMATICALLY GENERATED by generate-pubsuffix.js *\n");
- w.write(" * DO NOT EDIT! *\n");
- w.write(" ****************************************************/\n\n");
-
- w.write('"use strict";\n\n');
- w.write("var punycode = require('punycode');\n\n");
-
- w.write("module.exports.getPublicSuffix = ");
- w.write(getPublicSuffix.toString());
- w.write(";\n\n");
-
- w.write("// The following generated structure is used under the MPL version 1.1\n");
- w.write("// See public-suffix.txt for more information\n\n");
- w.write("var index = module.exports.index = Object.freeze(\n");
- w.write(JSON.stringify(index));
- w.write(");\n\n");
- w.write("// END of automatically generated file\n");
-
- w.end();
-}
-
-function addToIndex(index,line) {
- var prefix = '';
- if (line.replace(/^(!|\*\.)/)) {
- prefix = RegExp.$1;
- line = line.slice(prefix.length);
- }
- line = prefix + punycode.toASCII(line);
-
- if (line.substr(0,1) == '!') {
- index[line.substr(1)] = false;
- } else {
- index[line] = true;
- }
-}
-
-// include the licence in the function since it gets written to pubsuffix.js
-function getPublicSuffix(domain) {
- /*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
- if (!domain) {
- return null;
- }
- if (domain.match(/^\./)) {
- return null;
- }
- var asciiDomain = punycode.toASCII(domain);
- var converted = false;
- if (asciiDomain !== domain) {
- domain = asciiDomain;
- converted = true;
- }
- if (index[domain]) {
- return null;
- }
-
- domain = domain.toLowerCase();
- var parts = domain.split('.').reverse();
-
- var suffix = '';
- var suffixLen = 0;
- for (var i=0; i<parts.length; i++) {
- var part = parts[i];
- var starstr = '*'+suffix;
- var partstr = part+suffix;
-
- if (index[starstr]) { // star rule matches
- suffixLen = i+1;
- if (index[partstr] === false) { // exception rule matches (NB: false, not undefined)
- suffixLen--;
- }
- } else if (index[partstr]) { // exact match, not exception
- suffixLen = i+1;
- }
-
- suffix = '.'+partstr;
- }
-
- if (index['*'+suffix]) { // *.domain exists (e.g. *.kyoto.jp for domain='kyoto.jp');
- return null;
- }
-
- suffixLen = suffixLen || 1;
- if (parts.length > suffixLen) {
- var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.');
- return converted ? punycode.toUnicode(publicSuffix) : publicSuffix;
- }
-
- return null;
-}
-
-function checkPublicSuffix(give,get) {
- var got = getPublicSuffix(give);
- assert.equal(got, get, give+' should be '+(get==null?'NULL':get)+' but got '+got);
-}
-
-// pubSufTest() was converted to JavaScript from http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1
-function pubSufTest() {
- // For this function-scope and this function-scope ONLY:
- // Any copyright is dedicated to the Public Domain.
- // http://creativecommons.org/publicdomain/zero/1.0/
-
- // NULL input.
- checkPublicSuffix(null, null);
- // Mixed case.
- checkPublicSuffix('COM', null);
- checkPublicSuffix('example.COM', 'example.com');
- checkPublicSuffix('WwW.example.COM', 'example.com');
- // Leading dot.
- checkPublicSuffix('.com', null);
- checkPublicSuffix('.example', null);
- checkPublicSuffix('.example.com', null);
- checkPublicSuffix('.example.example', null);
- // Unlisted TLD.
- checkPublicSuffix('example', null);
- checkPublicSuffix('example.example', 'example.example');
- checkPublicSuffix('b.example.example', 'example.example');
- checkPublicSuffix('a.b.example.example', 'example.example');
- // Listed, but non-Internet, TLD.
- //checkPublicSuffix('local', null);
- //checkPublicSuffix('example.local', null);
- //checkPublicSuffix('b.example.local', null);
- //checkPublicSuffix('a.b.example.local', null);
- // TLD with only 1 rule.
- checkPublicSuffix('biz', null);
- checkPublicSuffix('domain.biz', 'domain.biz');
- checkPublicSuffix('b.domain.biz', 'domain.biz');
- checkPublicSuffix('a.b.domain.biz', 'domain.biz');
- // TLD with some 2-level rules.
- checkPublicSuffix('com', null);
- checkPublicSuffix('example.com', 'example.com');
- checkPublicSuffix('b.example.com', 'example.com');
- checkPublicSuffix('a.b.example.com', 'example.com');
- checkPublicSuffix('uk.com', null);
- checkPublicSuffix('example.uk.com', 'example.uk.com');
- checkPublicSuffix('b.example.uk.com', 'example.uk.com');
- checkPublicSuffix('a.b.example.uk.com', 'example.uk.com');
- checkPublicSuffix('test.ac', 'test.ac');
- // TLD with only 1 (wildcard) rule.
- checkPublicSuffix('cy', null);
- checkPublicSuffix('c.cy', null);
- checkPublicSuffix('b.c.cy', 'b.c.cy');
- checkPublicSuffix('a.b.c.cy', 'b.c.cy');
- // More complex TLD.
- checkPublicSuffix('jp', null);
- checkPublicSuffix('test.jp', 'test.jp');
- checkPublicSuffix('www.test.jp', 'test.jp');
- checkPublicSuffix('ac.jp', null);
- checkPublicSuffix('test.ac.jp', 'test.ac.jp');
- checkPublicSuffix('www.test.ac.jp', 'test.ac.jp');
- checkPublicSuffix('kyoto.jp', null);
- checkPublicSuffix('test.kyoto.jp', 'test.kyoto.jp');
- checkPublicSuffix('ide.kyoto.jp', null);
- checkPublicSuffix('b.ide.kyoto.jp', 'b.ide.kyoto.jp');
- checkPublicSuffix('a.b.ide.kyoto.jp', 'b.ide.kyoto.jp');
- checkPublicSuffix('c.kobe.jp', null);
- checkPublicSuffix('b.c.kobe.jp', 'b.c.kobe.jp');
- checkPublicSuffix('a.b.c.kobe.jp', 'b.c.kobe.jp');
- checkPublicSuffix('city.kobe.jp', 'city.kobe.jp');
- checkPublicSuffix('www.city.kobe.jp', 'city.kobe.jp');
- // TLD with a wildcard rule and exceptions.
- checkPublicSuffix('ck', null);
- checkPublicSuffix('test.ck', null);
- checkPublicSuffix('b.test.ck', 'b.test.ck');
- checkPublicSuffix('a.b.test.ck', 'b.test.ck');
- checkPublicSuffix('www.ck', 'www.ck');
- checkPublicSuffix('www.www.ck', 'www.ck');
- // US K12.
- checkPublicSuffix('us', null);
- checkPublicSuffix('test.us', 'test.us');
- checkPublicSuffix('www.test.us', 'test.us');
- checkPublicSuffix('ak.us', null);
- checkPublicSuffix('test.ak.us', 'test.ak.us');
- checkPublicSuffix('www.test.ak.us', 'test.ak.us');
- checkPublicSuffix('k12.ak.us', null);
- checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us');
- checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us');
- // IDN labels.
- checkPublicSuffix('食狮.com.cn', '食狮.com.cn');
- checkPublicSuffix('食狮.公司.cn', '食狮.公司.cn');
- checkPublicSuffix('www.食狮.公司.cn', '食狮.公司.cn');
- checkPublicSuffix('shishi.公司.cn', 'shishi.公司.cn');
- checkPublicSuffix('公司.cn', null);
- checkPublicSuffix('食狮.中国', '食狮.中国');
- checkPublicSuffix('www.食狮.中国', '食狮.中国');
- checkPublicSuffix('shishi.中国', 'shishi.中国');
- checkPublicSuffix('中国', null);
- // Same as above, but punycoded.
- checkPublicSuffix('xn--85x722f.com.cn', 'xn--85x722f.com.cn');
- checkPublicSuffix('xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn');
- checkPublicSuffix('www.xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn');
- checkPublicSuffix('shishi.xn--55qx5d.cn', 'shishi.xn--55qx5d.cn');
- checkPublicSuffix('xn--55qx5d.cn', null);
- checkPublicSuffix('xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s');
- checkPublicSuffix('www.xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s');
- checkPublicSuffix('shishi.xn--fiqs8s', 'shishi.xn--fiqs8s');
- checkPublicSuffix('xn--fiqs8s', null);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/lib/cookie.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/node_modules/request/node_modules/tough-cookie/lib/cookie.js
deleted file mode 100644
index 9ca9531..0000000
--- a/node_modules/request/node_modules/tough-cookie/lib/cookie.js
+++ /dev/null
@@ -1,1137 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-'use strict';
-var net = require('net');
-var urlParse = require('url').parse;
-var pubsuffix = require('./pubsuffix');
-var Store = require('./store').Store;
-
-var punycode;
-try {
- punycode = require('punycode');
-} catch(e) {
- console.warn("cookie: can't load punycode; won't use punycode for domain normalization");
-}
-
-var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
-
-// From RFC6265 S4.1.1
-// note that it excludes \x3B ";"
-var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/;
-var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'$');
-
-// Double quotes are part of the value (see: S4.1.1).
-// '\r', '\n' and '\0' should be treated as a terminator in the "relaxed" mode
-// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60)
-// '=' and ';' are attribute/values separators
-// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64)
-var COOKIE_PAIR = /^([^=;]+)\s*=\s*(("?)[^\n\r\0]*\3)/;
-
-// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
-// Note ';' is \x3B
-var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
-
-// Used for checking whether or not there is a trailing semi-colon
-var TRAILING_SEMICOLON = /;+$/;
-
-var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/;
-var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/;
-var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i;
-
-var MONTH_TO_NUM = {
- jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
- jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
-};
-var NUM_TO_MONTH = [
- 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
-];
-var NUM_TO_DAY = [
- 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
-];
-
-var YEAR = /^(\d{2}|\d{4})$/; // 2 to 4 digits
-
-var MAX_TIME = 2147483647000; // 31-bit max
-var MIN_TIME = 0; // 31-bit min
-
-var cookiesCreated = 0; // Number of cookies created in runtime
-
-
-// RFC6265 S5.1.1 date parser:
-function parseDate(str) {
- if (!str) {
- return;
- }
-
- /* RFC6265 S5.1.1:
- * 2. Process each date-token sequentially in the order the date-tokens
- * appear in the cookie-date
- */
- var tokens = str.split(DATE_DELIM);
- if (!tokens) {
- return;
- }
-
- var hour = null;
- var minutes = null;
- var seconds = null;
- var day = null;
- var month = null;
- var year = null;
-
- for (var i=0; i<tokens.length; i++) {
- var token = tokens[i].trim();
- if (!token.length) {
- continue;
- }
-
- var result;
-
- /* 2.1. If the found-time flag is not set and the token matches the time
- * production, set the found-time flag and set the hour- value,
- * minute-value, and second-value to the numbers denoted by the digits in
- * the date-token, respectively. Skip the remaining sub-steps and continue
- * to the next date-token.
- */
- if (seconds === null) {
- result = TIME.exec(token);
- if (result) {
- hour = parseInt(result[1], 10);
- minutes = parseInt(result[2], 10);
- seconds = parseInt(result[3], 10);
- /* RFC6265 S5.1.1.5:
- * [fail if]
- * * the hour-value is greater than 23,
- * * the minute-value is greater than 59, or
- * * the second-value is greater than 59.
- */
- if(hour > 23 || minutes > 59 || seconds > 59) {
- return;
- }
-
- continue;
- }
- }
-
- /* 2.2. If the found-day-of-month flag is not set and the date-token matches
- * the day-of-month production, set the found-day-of- month flag and set
- * the day-of-month-value to the number denoted by the date-token. Skip
- * the remaining sub-steps and continue to the next date-token.
- */
- if (day === null) {
- result = DAY_OF_MONTH.exec(token);
- if (result) {
- day = parseInt(result, 10);
- /* RFC6265 S5.1.1.5:
- * [fail if] the day-of-month-value is less than 1 or greater than 31
- */
- if(day < 1 || day > 31) {
- return;
- }
- continue;
- }
- }
-
- /* 2.3. If the found-month flag is not set and the date-token matches the
- * month production, set the found-month flag and set the month-value to
- * the month denoted by the date-token. Skip the remaining sub-steps and
- * continue to the next date-token.
- */
- if (month === null) {
- result = MONTH.exec(token);
- if (result) {
- month = MONTH_TO_NUM[result[1].toLowerCase()];
- continue;
- }
- }
-
- /* 2.4. If the found-year flag is not set and the date-token matches the year
- * production, set the found-year flag and set the year-value to the number
- * denoted by the date-token. Skip the remaining sub-steps and continue to
- * the next date-token.
- */
- if (year === null) {
- result = YEAR.exec(token);
- if (result) {
- year = parseInt(result[0], 10);
- /* From S5.1.1:
- * 3. If the year-value is greater than or equal to 70 and less
- * than or equal to 99, increment the year-value by 1900.
- * 4. If the year-value is greater than or equal to 0 and less
- * than or equal to 69, increment the year-value by 2000.
- */
- if (70 <= year && year <= 99) {
- year += 1900;
- } else if (0 <= year && year <= 69) {
- year += 2000;
- }
-
- if (year < 1601) {
- return; // 5. ... the year-value is less than 1601
- }
- }
- }
- }
-
- if (seconds === null || day === null || month === null || year === null) {
- return; // 5. ... at least one of the found-day-of-month, found-month, found-
- // year, or found-time flags is not set,
- }
-
- return new Date(Date.UTC(year, month, day, hour, minutes, seconds));
-}
-
-function formatDate(date) {
- var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;
- var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;
- var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;
- var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;
- return NUM_TO_DAY[date.getUTCDay()] + ', ' +
- d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+
- h+':'+m+':'+s+' GMT';
-}
-
-// S5.1.2 Canonicalized Host Names
-function canonicalDomain(str) {
- if (str == null) {
- return null;
- }
- str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading .
-
- // convert to IDN if any non-ASCII characters
- if (punycode && /[^\u0001-\u007f]/.test(str)) {
- str = punycode.toASCII(str);
- }
-
- return str.toLowerCase();
-}
-
-// S5.1.3 Domain Matching
-function domainMatch(str, domStr, canonicalize) {
- if (str == null || domStr == null) {
- return null;
- }
- if (canonicalize !== false) {
- str = canonicalDomain(str);
- domStr = canonicalDomain(domStr);
- }
-
- /*
- * "The domain string and the string are identical. (Note that both the
- * domain string and the string will have been canonicalized to lower case at
- * this point)"
- */
- if (str == domStr) {
- return true;
- }
-
- /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
-
- /* "* The string is a host name (i.e., not an IP address)." */
- if (net.isIP(str)) {
- return false;
- }
-
- /* "* The domain string is a suffix of the string" */
- var idx = str.indexOf(domStr);
- if (idx <= 0) {
- return false; // it's a non-match (-1) or prefix (0)
- }
-
- // e.g "a.b.c".indexOf("b.c") === 2
- // 5 === 3+2
- if (str.length !== domStr.length + idx) { // it's not a suffix
- return false;
- }
-
- /* "* The last character of the string that is not included in the domain
- * string is a %x2E (".") character." */
- if (str.substr(idx-1,1) !== '.') {
- return false;
- }
-
- return true;
-}
-
-
-// RFC6265 S5.1.4 Paths and Path-Match
-
-/*
- * "The user agent MUST use an algorithm equivalent to the following algorithm
- * to compute the default-path of a cookie:"
- *
- * Assumption: the path (and not query part or absolute uri) is passed in.
- */
-function defaultPath(path) {
- // "2. If the uri-path is empty or if the first character of the uri-path is not
- // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
- if (!path || path.substr(0,1) !== "/") {
- return "/";
- }
-
- // "3. If the uri-path contains no more than one %x2F ("/") character, output
- // %x2F ("/") and skip the remaining step."
- if (path === "/") {
- return path;
- }
-
- var rightSlash = path.lastIndexOf("/");
- if (rightSlash === 0) {
- return "/";
- }
-
- // "4. Output the characters of the uri-path from the first character up to,
- // but not including, the right-most %x2F ("/")."
- return path.slice(0, rightSlash);
-}
-
-/*
- * "A request-path path-matches a given cookie-path if at least one of the
- * following conditions holds:"
- */
-function pathMatch(reqPath,cookiePath) {
- // "o The cookie-path and the request-path are identical."
- if (cookiePath === reqPath) {
- return true;
- }
-
- var idx = reqPath.indexOf(cookiePath);
- if (idx === 0) {
- // "o The cookie-path is a prefix of the request-path, and the last
- // character of the cookie-path is %x2F ("/")."
- if (cookiePath.substr(-1) === "/") {
- return true;
- }
-
- // " o The cookie-path is a prefix of the request-path, and the first
- // character of the request-path that is not included in the cookie- path
- // is a %x2F ("/") character."
- if (reqPath.substr(cookiePath.length,1) === "/") {
- return true;
- }
- }
-
- return false;
-}
-
-function parse(str) {
- str = str.trim();
-
- // S4.1.1 Trailing semi-colons are not part of the specification.
- var semiColonCheck = TRAILING_SEMICOLON.exec(str);
- if (semiColonCheck) {
- str = str.slice(0, semiColonCheck.index);
- }
-
- // We use a regex to parse the "name-value-pair" part of S5.2
- var firstSemi = str.indexOf(';'); // S5.2 step 1
- var result = COOKIE_PAIR.exec(firstSemi === -1 ? str : str.substr(0,firstSemi));
-
- // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")"
- // constraints as well as trimming any whitespace.
- if (!result) {
- return;
- }
-
- var c = new Cookie();
- c.key = result[1].trim();
- c.value = result[2].trim();
-
- if (firstSemi === -1) {
- return c;
- }
-
- // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
- // (including the %x3B (";") in question)." plus later on in the same section
- // "discard the first ";" and trim".
- var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim();
-
- // "If the unparsed-attributes string is empty, skip the rest of these
- // steps."
- if (unparsed.length === 0) {
- return c;
- }
-
- /*
- * S5.2 says that when looping over the items "[p]rocess the attribute-name
- * and attribute-value according to the requirements in the following
- * subsections" for every item. Plus, for many of the individual attributes
- * in S5.3 it says to use the "attribute-value of the last attribute in the
- * cookie-attribute-list". Therefore, in this implementation, we overwrite
- * the previous value.
- */
- var cookie_avs = unparsed.split(/\s*;\s*/);
- while (cookie_avs.length) {
- var av = cookie_avs.shift();
- var av_sep = av.indexOf('=');
- var av_key, av_value;
-
- if (av_sep === -1) {
- av_key = av;
- av_value = null;
- } else {
- av_key = av.substr(0,av_sep);
- av_value = av.substr(av_sep+1);
- }
-
- av_key = av_key.trim().toLowerCase();
-
- if (av_value) {
- av_value = av_value.trim();
- }
-
- switch(av_key) {
- case 'expires': // S5.2.1
- if (av_value) {
- var exp = parseDate(av_value);
- // "If the attribute-value failed to parse as a cookie date, ignore the
- // cookie-av."
- if (exp) {
- // over and underflow not realistically a concern: V8's getTime() seems to
- // store something larger than a 32-bit time_t (even with 32-bit node)
- c.expires = exp;
- }
- }
- break;
-
- case 'max-age': // S5.2.2
- if (av_value) {
- // "If the first character of the attribute-value is not a DIGIT or a "-"
- // character ...[or]... If the remainder of attribute-value contains a
- // non-DIGIT character, ignore the cookie-av."
- if (/^-?[0-9]+$/.test(av_value)) {
- var delta = parseInt(av_value, 10);
- // "If delta-seconds is less than or equal to zero (0), let expiry-time
- // be the earliest representable date and time."
- c.setMaxAge(delta);
- }
- }
- break;
-
- case 'domain': // S5.2.3
- // "If the attribute-value is empty, the behavior is undefined. However,
- // the user agent SHOULD ignore the cookie-av entirely."
- if (av_value) {
- // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
- // (".") character."
- var domain = av_value.trim().replace(/^\./, '');
- if (domain) {
- // "Convert the cookie-domain to lower case."
- c.domain = domain.toLowerCase();
- }
- }
- break;
-
- case 'path': // S5.2.4
- /*
- * "If the attribute-value is empty or if the first character of the
- * attribute-value is not %x2F ("/"):
- * Let cookie-path be the default-path.
- * Otherwise:
- * Let cookie-path be the attribute-value."
- *
- * We'll represent the default-path as null since it depends on the
- * context of the parsing.
- */
- c.path = av_value && av_value[0] === "/" ? av_value : null;
- break;
-
- case 'secure': // S5.2.5
- /*
- * "If the attribute-name case-insensitively matches the string "Secure",
- * the user agent MUST append an attribute to the cookie-attribute-list
- * with an attribute-name of Secure and an empty attribute-value."
- */
- c.secure = true;
- break;
-
- case 'httponly': // S5.2.6 -- effectively the same as 'secure'
- c.httpOnly = true;
- break;
-
- default:
- c.extensions = c.extensions || [];
- c.extensions.push(av);
- break;
- }
- }
-
- // ensure a default date for sorting:
- c.creation = new Date();
- //NOTE: add runtime index for the cookieCompare() to resolve the situation when Date's precision is not enough .
- //Store initial UTC time as well, so we will be able to determine if we need to fallback to the Date object.
- c._creationRuntimeIdx = ++cookiesCreated;
- c._initialCreationTime = c.creation.getTime();
- return c;
-}
-
-function fromJSON(str) {
- if (!str) {
- return null;
- }
-
- var obj;
- try {
- obj = JSON.parse(str);
- } catch (e) {
- return null;
- }
-
- var c = new Cookie();
- for (var i=0; i<numCookieProperties; i++) {
- var prop = cookieProperties[i];
- if (obj[prop] == null) {
- continue;
- }
- if (prop === 'expires' ||
- prop === 'creation' ||
- prop === 'lastAccessed')
- {
- c[prop] = obj[prop] == "Infinity" ? "Infinity" : new Date(obj[prop]);
- } else {
- c[prop] = obj[prop];
- }
- }
-
-
- // ensure a default date for sorting:
- c.creation = c.creation || new Date();
-
- return c;
-}
-
-/* Section 5.4 part 2:
- * "* Cookies with longer paths are listed before cookies with
- * shorter paths.
- *
- * * Among cookies that have equal-length path fields, cookies with
- * earlier creation-times are listed before cookies with later
- * creation-times."
- */
-
-function cookieCompare(a,b) {
- // descending for length: b CMP a
- var deltaLen = (b.path ? b.path.length : 0) - (a.path ? a.path.length : 0);
- if (deltaLen !== 0) {
- return deltaLen;
- }
-
- var aTime = a.creation ? a.creation.getTime() : MAX_TIME;
- var bTime = b.creation ? b.creation.getTime() : MAX_TIME;
-
- // NOTE: if creation dates are equal and they were not modified from the outside,
- // then use _creationRuntimeIdx for the comparison.
- if(aTime === bTime && aTime === a._initialCreationTime && bTime === b._initialCreationTime) {
- return a._creationRuntimeIdx - b._creationRuntimeIdx;
- }
-
- // ascending for time: a CMP b
- return aTime - bTime;
-}
-
-// Gives the permutation of all possible domainMatch()es of a given domain. The
-// array is in shortest-to-longest order. Handy for indexing.
-function permuteDomain(domain) {
- var pubSuf = pubsuffix.getPublicSuffix(domain);
- if (!pubSuf) {
- return null;
- }
- if (pubSuf == domain) {
- return [domain];
- }
-
- var prefix = domain.slice(0,-(pubSuf.length+1)); // ".example.com"
- var parts = prefix.split('.').reverse();
- var cur = pubSuf;
- var permutations = [cur];
- while (parts.length) {
- cur = parts.shift()+'.'+cur;
- permutations.push(cur);
- }
- return permutations;
-}
-
-// Gives the permutation of all possible pathMatch()es of a given path. The
-// array is in longest-to-shortest order. Handy for indexing.
-function permutePath(path) {
- if (path === '/') {
- return ['/'];
- }
- if (path.lastIndexOf('/') === path.length-1) {
- path = path.substr(0,path.length-1);
- }
- var permutations = [path];
- while (path.length > 1) {
- var lindex = path.lastIndexOf('/');
- if (lindex === 0) {
- break;
- }
- path = path.substr(0,lindex);
- permutations.push(path);
- }
- permutations.push('/');
- return permutations;
-}
-
-function getCookieContext(url) {
- if(url instanceof Object)
- return url;
-
- // NOTE: decodeURI will throw on malformed URIs (see GH-32).
- // Therefore, we will just skip decoding for such URIs.
- try {
- url = decodeURI(url);
- }
- catch(err) {
- // Silently swallow error
- }
-
- return urlParse(url);
-}
-
-function Cookie (opts) {
- if (typeof opts !== "object") {
- return;
- }
- Object.keys(opts).forEach(function (key) {
- if (Cookie.prototype.hasOwnProperty(key)) {
- this[key] = opts[key] || Cookie.prototype[key];
- }
- }.bind(this));
-}
-
-Cookie.parse = parse;
-Cookie.fromJSON = fromJSON;
-
-Cookie.prototype.key = "";
-Cookie.prototype.value = "";
-
-// the order in which the RFC has them:
-Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity
-Cookie.prototype.maxAge = null; // takes precedence over expires for TTL
-Cookie.prototype.domain = null;
-Cookie.prototype.path = null;
-Cookie.prototype.secure = false;
-Cookie.prototype.httpOnly = false;
-Cookie.prototype.extensions = null;
-
-// set by the CookieJar:
-Cookie.prototype.hostOnly = null; // boolean when set
-Cookie.prototype.pathIsDefault = null; // boolean when set
-Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
-Cookie.prototype._initialCreationTime = null; // Used to determine if cookie.creation was modified
-Cookie.prototype._creationRuntimeIdx = null; // Runtime index of the created cookie, used in cookieCompare()
-Cookie.prototype.lastAccessed = null; // Date when set
-
-var cookieProperties = Object.freeze(Object.keys(Cookie.prototype).map(function(p) {
- if (p instanceof Function) {
- return;
- }
- return p;
-}));
-var numCookieProperties = cookieProperties.length;
-
-Cookie.prototype.inspect = function inspect() {
- var now = Date.now();
- return 'Cookie="'+this.toString() +
- '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +
- '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +
- '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +
- '"';
-};
-
-Cookie.prototype.validate = function validate() {
- if (!COOKIE_OCTETS.test(this.value)) {
- return false;
- }
- if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires,true)) {
- return false;
- }
- if (this.maxAge != null && this.maxAge <= 0) {
- return false; // "Max-Age=" non-zero-digit *DIGIT
- }
- if (this.path != null && !PATH_VALUE.test(this.path)) {
- return false;
- }
-
- var cdomain = this.cdomain();
- if (cdomain) {
- if (cdomain.match(/\.$/)) {
- return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this
- }
- var suffix = pubsuffix.getPublicSuffix(cdomain);
- if (suffix == null) { // it's a public suffix
- return false;
- }
- }
- return true;
-};
-
-Cookie.prototype.setExpires = function setExpires(exp) {
- if (exp instanceof Date) {
- this.expires = exp;
- } else {
- this.expires = parseDate(exp) || "Infinity";
- }
-};
-
-Cookie.prototype.setMaxAge = function setMaxAge(age) {
- if (age === Infinity || age === -Infinity) {
- this.maxAge = age.toString(); // so JSON.stringify() works
- } else {
- this.maxAge = age;
- }
-};
-
-// gives Cookie header format
-Cookie.prototype.cookieString = function cookieString() {
- var val = this.value;
- if (val == null) {
- val = '';
- }
- return this.key+'='+val;
-};
-
-// gives Set-Cookie header format
-Cookie.prototype.toString = function toString() {
- var str = this.cookieString();
-
- if (this.expires != Infinity) {
- if (this.expires instanceof Date) {
- str += '; Expires='+formatDate(this.expires);
- } else {
- str += '; Expires='+this.expires;
- }
- }
-
- if (this.maxAge != null && this.maxAge != Infinity) {
- str += '; Max-Age='+this.maxAge;
- }
-
- if (this.domain && !this.hostOnly) {
- str += '; Domain='+this.domain;
- }
- if (this.path) {
- str += '; Path='+this.path;
- }
-
- if (this.secure) {
- str += '; Secure';
- }
- if (this.httpOnly) {
- str += '; HttpOnly';
- }
- if (this.extensions) {
- this.extensions.forEach(function(ext) {
- str += '; '+ext;
- });
- }
-
- return str;
-};
-
-// TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
-// elsewhere)
-// S5.3 says to give the "latest representable date" for which we use Infinity
-// For "expired" we use 0
-Cookie.prototype.TTL = function TTL(now) {
- /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires
- * attribute, the Max-Age attribute has precedence and controls the
- * expiration date of the cookie.
- * (Concurs with S5.3 step 3)
- */
- if (this.maxAge != null) {
- return this.maxAge<=0 ? 0 : this.maxAge*1000;
- }
-
- var expires = this.expires;
- if (expires != Infinity) {
- if (!(expires instanceof Date)) {
- expires = parseDate(expires) || Infinity;
- }
-
- if (expires == Infinity) {
- return Infinity;
- }
-
- return expires.getTime() - (now || Date.now());
- }
-
- return Infinity;
-};
-
-// expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
-// elsewhere)
-Cookie.prototype.expiryTime = function expiryTime(now) {
- if (this.maxAge != null) {
- var relativeTo = this.creation || now || new Date();
- var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;
- return relativeTo.getTime() + age;
- }
-
- if (this.expires == Infinity) {
- return Infinity;
- }
- return this.expires.getTime();
-};
-
-// expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
-// elsewhere), except it returns a Date
-Cookie.prototype.expiryDate = function expiryDate(now) {
- var millisec = this.expiryTime(now);
- if (millisec == Infinity) {
- return new Date(MAX_TIME);
- } else if (millisec == -Infinity) {
- return new Date(MIN_TIME);
- } else {
- return new Date(millisec);
- }
-};
-
-// This replaces the "persistent-flag" parts of S5.3 step 3
-Cookie.prototype.isPersistent = function isPersistent() {
- return (this.maxAge != null || this.expires != Infinity);
-};
-
-// Mostly S5.1.2 and S5.2.3:
-Cookie.prototype.cdomain =
-Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
- if (this.domain == null) {
- return null;
- }
- return canonicalDomain(this.domain);
-};
-
-
-var memstore;
-function CookieJar(store, rejectPublicSuffixes) {
- if (rejectPublicSuffixes != null) {
- this.rejectPublicSuffixes = rejectPublicSuffixes;
- }
-
- if (!store) {
- memstore = memstore || require('./memstore');
- store = new memstore.MemoryCookieStore();
- }
- this.store = store;
-}
-CookieJar.prototype.store = null;
-CookieJar.prototype.rejectPublicSuffixes = true;
-var CAN_BE_SYNC = [];
-
-CAN_BE_SYNC.push('setCookie');
-CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
- var err;
- var context = getCookieContext(url);
- if (options instanceof Function) {
- cb = options;
- options = {};
- }
-
- var host = canonicalDomain(context.hostname);
-
- // S5.3 step 1
- if (!(cookie instanceof Cookie)) {
- cookie = Cookie.parse(cookie);
- }
- if (!cookie) {
- err = new Error("Cookie failed to parse");
- return cb(options.ignoreError ? null : err);
- }
-
- // S5.3 step 2
- var now = options.now || new Date(); // will assign later to save effort in the face of errors
-
- // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
-
- // S5.3 step 4: NOOP; domain is null by default
-
- // S5.3 step 5: public suffixes
- if (this.rejectPublicSuffixes && cookie.domain) {
- var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
- if (suffix == null) { // e.g. "com"
- err = new Error("Cookie has domain set to a public suffix");
- return cb(options.ignoreError ? null : err);
- }
- }
-
- // S5.3 step 6:
- if (cookie.domain) {
- if (!domainMatch(host, cookie.cdomain(), false)) {
- err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host);
- return cb(options.ignoreError ? null : err);
- }
-
- if (cookie.hostOnly == null) { // don't reset if already set
- cookie.hostOnly = false;
- }
-
- } else {
- cookie.hostOnly = true;
- cookie.domain = host;
- }
-
- //S5.2.4 If the attribute-value is empty or if the first character of the
- //attribute-value is not %x2F ("/"):
- //Let cookie-path be the default-path.
- if (!cookie.path || cookie.path[0] !== '/') {
- cookie.path = defaultPath(context.pathname);
- cookie.pathIsDefault = true;
- }
-
- // S5.3 step 8: NOOP; secure attribute
- // S5.3 step 9: NOOP; httpOnly attribute
-
- // S5.3 step 10
- if (options.http === false && cookie.httpOnly) {
- err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
- return cb(options.ignoreError ? null : err);
- }
-
- var store = this.store;
-
- if (!store.updateCookie) {
- store.updateCookie = function(oldCookie, newCookie, cb) {
- this.putCookie(newCookie, cb);
- };
- }
-
- function withCookie(err, oldCookie) {
- if (err) {
- return cb(err);
- }
-
- var next = function(err) {
- if (err) {
- return cb(err);
- } else {
- cb(null, cookie);
- }
- };
-
- if (oldCookie) {
- // S5.3 step 11 - "If the cookie store contains a cookie with the same name,
- // domain, and path as the newly created cookie:"
- if (options.http === false && oldCookie.httpOnly) { // step 11.2
- err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
- return cb(options.ignoreError ? null : err);
- }
- cookie.creation = oldCookie.creation; // step 11.3
- cookie.lastAccessed = now;
- // Step 11.4 (delete cookie) is implied by just setting the new one:
- store.updateCookie(oldCookie, cookie, next); // step 12
-
- } else {
- cookie.creation = cookie.lastAccessed = now;
- store.putCookie(cookie, next); // step 12
- }
- }
-
- store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
-};
-
-// RFC6365 S5.4
-CAN_BE_SYNC.push('getCookies');
-CookieJar.prototype.getCookies = function(url, options, cb) {
- var context = getCookieContext(url);
- if (options instanceof Function) {
- cb = options;
- options = {};
- }
-
- var host = canonicalDomain(context.hostname);
- var path = context.pathname || '/';
-
- var secure = options.secure;
- if (secure == null && context.protocol &&
- (context.protocol == 'https:' || context.protocol == 'wss:'))
- {
- secure = true;
- }
-
- var http = options.http;
- if (http == null) {
- http = true;
- }
-
- var now = options.now || Date.now();
- var expireCheck = options.expire !== false;
- var allPaths = !!options.allPaths;
- var store = this.store;
-
- function matchingCookie(c) {
- // "Either:
- // The cookie's host-only-flag is true and the canonicalized
- // request-host is identical to the cookie's domain.
- // Or:
- // The cookie's host-only-flag is false and the canonicalized
- // request-host domain-matches the cookie's domain."
- if (c.hostOnly) {
- if (c.domain != host) {
- return false;
- }
- } else {
- if (!domainMatch(host, c.domain, false)) {
- return false;
- }
- }
-
- // "The request-uri's path path-matches the cookie's path."
- if (!allPaths && !pathMatch(path, c.path)) {
- return false;
- }
-
- // "If the cookie's secure-only-flag is true, then the request-uri's
- // scheme must denote a "secure" protocol"
- if (c.secure && !secure) {
- return false;
- }
-
- // "If the cookie's http-only-flag is true, then exclude the cookie if the
- // cookie-string is being generated for a "non-HTTP" API"
- if (c.httpOnly && !http) {
- return false;
- }
-
- // deferred from S5.3
- // non-RFC: allow retention of expired cookies by choice
- if (expireCheck && c.expiryTime() <= now) {
- store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored
- return false;
- }
-
- return true;
- }
-
- store.findCookies(host, allPaths ? null : path, function(err,cookies) {
- if (err) {
- return cb(err);
- }
-
- cookies = cookies.filter(matchingCookie);
-
- // sorting of S5.4 part 2
- if (options.sort !== false) {
- cookies = cookies.sort(cookieCompare);
- }
-
- // S5.4 part 3
- var now = new Date();
- cookies.forEach(function(c) {
- c.lastAccessed = now;
- });
- // TODO persist lastAccessed
-
- cb(null,cookies);
- });
-};
-
-CAN_BE_SYNC.push('getCookieString');
-CookieJar.prototype.getCookieString = function(/*..., cb*/) {
- var args = Array.prototype.slice.call(arguments,0);
- var cb = args.pop();
- var next = function(err,cookies) {
- if (err) {
- cb(err);
- } else {
- cb(null, cookies
- .sort(cookieCompare)
- .map(function(c){
- return c.cookieString();
- })
- .join('; '));
- }
- };
- args.push(next);
- this.getCookies.apply(this,args);
-};
-
-CAN_BE_SYNC.push('getSetCookieStrings');
-CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
- var args = Array.prototype.slice.call(arguments,0);
- var cb = args.pop();
- var next = function(err,cookies) {
- if (err) {
- cb(err);
- } else {
- cb(null, cookies.map(function(c){
- return c.toString();
- }));
- }
- };
- args.push(next);
- this.getCookies.apply(this,args);
-};
-
-// Use a closure to provide a true imperative API for synchronous stores.
-function syncWrap(method) {
- return function() {
- if (!this.store.synchronous) {
- throw new Error('CookieJar store is not synchronous; use async API instead.');
- }
-
- var args = Array.prototype.slice.call(arguments);
- var syncErr, syncResult;
- args.push(function syncCb(err, result) {
- syncErr = err;
- syncResult = result;
- });
- this[method].apply(this, args);
-
- if (syncErr) {
- throw syncErr;
- }
- return syncResult;
- };
-}
-
-// wrap all declared CAN_BE_SYNC methods in the sync wrapper
-CAN_BE_SYNC.forEach(function(method) {
- CookieJar.prototype[method+'Sync'] = syncWrap(method);
-});
-
-module.exports = {
- CookieJar: CookieJar,
- Cookie: Cookie,
- Store: Store,
- parseDate: parseDate,
- formatDate: formatDate,
- parse: parse,
- fromJSON: fromJSON,
- domainMatch: domainMatch,
- defaultPath: defaultPath,
- pathMatch: pathMatch,
- getPublicSuffix: pubsuffix.getPublicSuffix,
- cookieCompare: cookieCompare,
- permuteDomain: permuteDomain,
- permutePath: permutePath,
- canonicalDomain: canonicalDomain
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/lib/memstore.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/memstore.js b/node_modules/request/node_modules/tough-cookie/lib/memstore.js
deleted file mode 100644
index ce3ee66..0000000
--- a/node_modules/request/node_modules/tough-cookie/lib/memstore.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-'use strict';
-var tough = require('./cookie');
-var Store = require('./store').Store;
-var permuteDomain = tough.permuteDomain;
-var pathMatch = tough.pathMatch;
-var util = require('util');
-
-function MemoryCookieStore() {
- Store.call(this);
- this.idx = {};
-}
-util.inherits(MemoryCookieStore, Store);
-exports.MemoryCookieStore = MemoryCookieStore;
-MemoryCookieStore.prototype.idx = null;
-MemoryCookieStore.prototype.synchronous = true;
-
-// force a default depth:
-MemoryCookieStore.prototype.inspect = function() {
- return "{ idx: "+util.inspect(this.idx, false, 2)+' }';
-};
-
-MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {
- if (!this.idx[domain]) {
- return cb(null,undefined);
- }
- if (!this.idx[domain][path]) {
- return cb(null,undefined);
- }
- return cb(null,this.idx[domain][path][key]||null);
-};
-
-MemoryCookieStore.prototype.findCookies = function(domain, path, cb) {
- var results = [];
- if (!domain) {
- return cb(null,[]);
- }
-
- var pathMatcher;
- if (!path) {
- // null means "all paths"
- pathMatcher = function matchAll(domainIndex) {
- for (var curPath in domainIndex) {
- var pathIndex = domainIndex[curPath];
- for (var key in pathIndex) {
- results.push(pathIndex[key]);
- }
- }
- };
-
- } else {
- pathMatcher = function matchRFC(domainIndex) {
- //NOTE: we should use path-match algorithm from S5.1.4 here
- //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)
- Object.keys(domainIndex).forEach(function (cookiePath) {
- if (pathMatch(path, cookiePath)) {
- var pathIndex = domainIndex[cookiePath];
-
- for (var key in pathIndex) {
- results.push(pathIndex[key]);
- }
- }
- });
- };
- }
-
- var domains = permuteDomain(domain) || [domain];
- var idx = this.idx;
- domains.forEach(function(curDomain) {
- var domainIndex = idx[curDomain];
- if (!domainIndex) {
- return;
- }
- pathMatcher(domainIndex);
- });
-
- cb(null,results);
-};
-
-MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
- if (!this.idx[cookie.domain]) {
- this.idx[cookie.domain] = {};
- }
- if (!this.idx[cookie.domain][cookie.path]) {
- this.idx[cookie.domain][cookie.path] = {};
- }
- this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
- cb(null);
-};
-
-MemoryCookieStore.prototype.updateCookie = function updateCookie(oldCookie, newCookie, cb) {
- // updateCookie() may avoid updating cookies that are identical. For example,
- // lastAccessed may not be important to some stores and an equality
- // comparison could exclude that field.
- this.putCookie(newCookie,cb);
-};
-
-MemoryCookieStore.prototype.removeCookie = function removeCookie(domain, path, key, cb) {
- if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {
- delete this.idx[domain][path][key];
- }
- cb(null);
-};
-
-MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path, cb) {
- if (this.idx[domain]) {
- if (path) {
- delete this.idx[domain][path];
- } else {
- delete this.idx[domain];
- }
- }
- return cb(null);
-};
[18/59] [abbrv] couchdb-nmo git commit: add readme link
Posted by ro...@apache.org.
add readme link
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/0ce5e477
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/0ce5e477
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/0ce5e477
Branch: refs/heads/master
Commit: 0ce5e4774023f6153ae596c73b2d3eb5e049dda2
Parents: b5bf6e9
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Wed Jun 3 02:05:11 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Wed Jun 3 02:05:11 2015 +0200
----------------------------------------------------------------------
README.md | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/0ce5e477/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 183e03c..1ab308e 100644
--- a/README.md
+++ b/README.md
@@ -12,3 +12,8 @@ npm install -g nmo
It is written in ES6 and is using promises and generators for control
flow. We are aiming for 100% test coverage.
+
+
+## Help
+
+[http://robertkowalski.github.io/nmo/](http://robertkowalski.github.io/nmo/)
[21/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tunnel-agent/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tunnel-agent/README.md b/node_modules/request/node_modules/tunnel-agent/README.md
deleted file mode 100644
index bb533d5..0000000
--- a/node_modules/request/node_modules/tunnel-agent/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-tunnel-agent
-============
-
-HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tunnel-agent/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tunnel-agent/index.js b/node_modules/request/node_modules/tunnel-agent/index.js
deleted file mode 100644
index 13c0427..0000000
--- a/node_modules/request/node_modules/tunnel-agent/index.js
+++ /dev/null
@@ -1,236 +0,0 @@
-'use strict'
-
-var net = require('net')
- , tls = require('tls')
- , http = require('http')
- , https = require('https')
- , events = require('events')
- , assert = require('assert')
- , util = require('util')
- ;
-
-exports.httpOverHttp = httpOverHttp
-exports.httpsOverHttp = httpsOverHttp
-exports.httpOverHttps = httpOverHttps
-exports.httpsOverHttps = httpsOverHttps
-
-
-function httpOverHttp(options) {
- var agent = new TunnelingAgent(options)
- agent.request = http.request
- return agent
-}
-
-function httpsOverHttp(options) {
- var agent = new TunnelingAgent(options)
- agent.request = http.request
- agent.createSocket = createSecureSocket
- return agent
-}
-
-function httpOverHttps(options) {
- var agent = new TunnelingAgent(options)
- agent.request = https.request
- return agent
-}
-
-function httpsOverHttps(options) {
- var agent = new TunnelingAgent(options)
- agent.request = https.request
- agent.createSocket = createSecureSocket
- return agent
-}
-
-
-function TunnelingAgent(options) {
- var self = this
- self.options = options || {}
- self.proxyOptions = self.options.proxy || {}
- self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets
- self.requests = []
- self.sockets = []
-
- self.on('free', function onFree(socket, host, port) {
- for (var i = 0, len = self.requests.length; i < len; ++i) {
- var pending = self.requests[i]
- if (pending.host === host && pending.port === port) {
- // Detect the request to connect same origin server,
- // reuse the connection.
- self.requests.splice(i, 1)
- pending.request.onSocket(socket)
- return
- }
- }
- socket.destroy()
- self.removeSocket(socket)
- })
-}
-util.inherits(TunnelingAgent, events.EventEmitter)
-
-TunnelingAgent.prototype.addRequest = function addRequest(req, options) {
- var self = this
-
- // Legacy API: addRequest(req, host, port, path)
- if (typeof options === 'string') {
- options = {
- host: options,
- port: arguments[2],
- path: arguments[3]
- };
- }
-
- if (self.sockets.length >= this.maxSockets) {
- // We are over limit so we'll add it to the queue.
- self.requests.push({host: host, port: port, request: req})
- return
- }
-
- // If we are under maxSockets create a new one.
- self.createSocket({host: options.host, port: options.port, request: req}, function(socket) {
- socket.on('free', onFree)
- socket.on('close', onCloseOrRemove)
- socket.on('agentRemove', onCloseOrRemove)
- req.onSocket(socket)
-
- function onFree() {
- self.emit('free', socket, options.host, options.port)
- }
-
- function onCloseOrRemove(err) {
- self.removeSocket()
- socket.removeListener('free', onFree)
- socket.removeListener('close', onCloseOrRemove)
- socket.removeListener('agentRemove', onCloseOrRemove)
- }
- })
-}
-
-TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
- var self = this
- var placeholder = {}
- self.sockets.push(placeholder)
-
- var connectOptions = mergeOptions({}, self.proxyOptions,
- { method: 'CONNECT'
- , path: options.host + ':' + options.port
- , agent: false
- }
- )
- if (connectOptions.proxyAuth) {
- connectOptions.headers = connectOptions.headers || {}
- connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
- new Buffer(connectOptions.proxyAuth).toString('base64')
- }
-
- debug('making CONNECT request')
- var connectReq = self.request(connectOptions)
- connectReq.useChunkedEncodingByDefault = false // for v0.6
- connectReq.once('response', onResponse) // for v0.6
- connectReq.once('upgrade', onUpgrade) // for v0.6
- connectReq.once('connect', onConnect) // for v0.7 or later
- connectReq.once('error', onError)
- connectReq.end()
-
- function onResponse(res) {
- // Very hacky. This is necessary to avoid http-parser leaks.
- res.upgrade = true
- }
-
- function onUpgrade(res, socket, head) {
- // Hacky.
- process.nextTick(function() {
- onConnect(res, socket, head)
- })
- }
-
- function onConnect(res, socket, head) {
- connectReq.removeAllListeners()
- socket.removeAllListeners()
-
- if (res.statusCode === 200) {
- assert.equal(head.length, 0)
- debug('tunneling connection has established')
- self.sockets[self.sockets.indexOf(placeholder)] = socket
- cb(socket)
- } else {
- debug('tunneling socket could not be established, statusCode=%d', res.statusCode)
- var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)
- error.code = 'ECONNRESET'
- options.request.emit('error', error)
- self.removeSocket(placeholder)
- }
- }
-
- function onError(cause) {
- connectReq.removeAllListeners()
-
- debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack)
- var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)
- error.code = 'ECONNRESET'
- options.request.emit('error', error)
- self.removeSocket(placeholder)
- }
-}
-
-TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
- var pos = this.sockets.indexOf(socket)
- if (pos === -1) return
-
- this.sockets.splice(pos, 1)
-
- var pending = this.requests.shift()
- if (pending) {
- // If we have pending requests and a socket gets closed a new one
- // needs to be created to take over in the pool for the one that closed.
- this.createSocket(pending, function(socket) {
- pending.request.onSocket(socket)
- })
- }
-}
-
-function createSecureSocket(options, cb) {
- var self = this
- TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
- // 0 is dummy port for v0.6
- var secureSocket = tls.connect(0, mergeOptions({}, self.options,
- { servername: options.host
- , socket: socket
- }
- ))
- cb(secureSocket)
- })
-}
-
-
-function mergeOptions(target) {
- for (var i = 1, len = arguments.length; i < len; ++i) {
- var overrides = arguments[i]
- if (typeof overrides === 'object') {
- var keys = Object.keys(overrides)
- for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
- var k = keys[j]
- if (overrides[k] !== undefined) {
- target[k] = overrides[k]
- }
- }
- }
- }
- return target
-}
-
-
-var debug
-if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
- debug = function() {
- var args = Array.prototype.slice.call(arguments)
- if (typeof args[0] === 'string') {
- args[0] = 'TUNNEL: ' + args[0]
- } else {
- args.unshift('TUNNEL:')
- }
- console.error.apply(console, args)
- }
-} else {
- debug = function() {}
-}
-exports.debug = debug // for test
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tunnel-agent/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/request/node_modules/tunnel-agent/package.json
deleted file mode 100644
index 5b1ebba..0000000
--- a/node_modules/request/node_modules/tunnel-agent/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "author": {
- "name": "Mikeal Rogers",
- "email": "mikeal.rogers@gmail.com",
- "url": "http://www.futurealoof.com"
- },
- "name": "tunnel-agent",
- "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.",
- "version": "0.4.0",
- "repository": {
- "url": "https://github.com/mikeal/tunnel-agent"
- },
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {},
- "optionalDependencies": {},
- "engines": {
- "node": "*"
- },
- "bugs": {
- "url": "https://github.com/mikeal/tunnel-agent/issues"
- },
- "homepage": "https://github.com/mikeal/tunnel-agent",
- "_id": "tunnel-agent@0.4.0",
- "dist": {
- "shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550",
- "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
- },
- "_from": "tunnel-agent@>=0.4.0 <0.5.0",
- "_npmVersion": "1.3.21",
- "_npmUser": {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- },
- "maintainers": [
- {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- }
- ],
- "directories": {},
- "_shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550",
- "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz",
- "readme": "ERROR: No README data found!",
- "scripts": {}
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/package.json b/node_modules/request/package.json
deleted file mode 100644
index d34e2fc..0000000
--- a/node_modules/request/package.json
+++ /dev/null
@@ -1,106 +0,0 @@
-{
- "name": "request",
- "description": "Simplified HTTP request client.",
- "tags": [
- "http",
- "simple",
- "util",
- "utility"
- ],
- "version": "2.55.0",
- "author": {
- "name": "Mikeal Rogers",
- "email": "mikeal.rogers@gmail.com"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/request/request.git"
- },
- "bugs": {
- "url": "http://github.com/request/request/issues"
- },
- "license": "Apache-2.0",
- "engines": {
- "node": ">=0.8.0"
- },
- "main": "index.js",
- "dependencies": {
- "bl": "~0.9.0",
- "caseless": "~0.9.0",
- "forever-agent": "~0.6.0",
- "form-data": "~0.2.0",
- "json-stringify-safe": "~5.0.0",
- "mime-types": "~2.0.1",
- "node-uuid": "~1.4.0",
- "qs": "~2.4.0",
- "tunnel-agent": "~0.4.0",
- "tough-cookie": ">=0.12.0",
- "http-signature": "~0.10.0",
- "oauth-sign": "~0.6.0",
- "hawk": "~2.3.0",
- "aws-sign2": "~0.5.0",
- "stringstream": "~0.0.4",
- "combined-stream": "~0.0.5",
- "isstream": "~0.1.1",
- "har-validator": "^1.4.0"
- },
- "scripts": {
- "test": "npm run lint && node node_modules/.bin/taper tests/test-*.js && npm run test-browser",
- "test-browser": "node tests/browser/start.js",
- "lint": "node node_modules/.bin/eslint lib/ *.js tests/ && echo Lint passed."
- },
- "devDependencies": {
- "browserify": "~5.9.1",
- "browserify-istanbul": "~0.1.3",
- "coveralls": "~2.11.2",
- "eslint": "0.17.1",
- "function-bind": "~1.0.0",
- "istanbul": "~0.3.2",
- "karma": "~0.12.21",
- "karma-browserify": "~3.0.1",
- "karma-cli": "0.0.4",
- "karma-coverage": "0.2.6",
- "karma-phantomjs-launcher": "~0.1.4",
- "karma-tap": "~1.0.1",
- "rimraf": "~2.2.8",
- "server-destroy": "~1.0.0",
- "tape": "~3.0.0",
- "taper": "~0.4.0",
- "bluebird": "~2.9.21"
- },
- "gitHead": "b6000376387db12d0c2d7ed9ee87b0ba123e36dc",
- "homepage": "https://github.com/request/request",
- "_id": "request@2.55.0",
- "_shasum": "d75c1cdf679d76bb100f9bffe1fe551b5c24e93d",
- "_from": "request@>=2.55.0 <2.56.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
- },
- "maintainers": [
- {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- },
- {
- "name": "nylen",
- "email": "jnylen@gmail.com"
- },
- {
- "name": "fredkschott",
- "email": "fkschott@gmail.com"
- },
- {
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
- }
- ],
- "dist": {
- "shasum": "d75c1cdf679d76bb100f9bffe1fe551b5c24e93d",
- "tarball": "http://registry.npmjs.org/request/-/request-2.55.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/request/-/request-2.55.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/release.sh
----------------------------------------------------------------------
diff --git a/node_modules/request/release.sh b/node_modules/request/release.sh
deleted file mode 100755
index 7678bf8..0000000
--- a/node_modules/request/release.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-if [ -z "`which github-changes`" ]; then
- # specify version because github-changes "is under heavy development. Things
- # may break between releases" until 0.1.0
- echo "First, do: [sudo] npm install -g github-changes@0.0.14"
- exit 1
-fi
-
-if [ -d .git/refs/remotes/upstream ]; then
- remote=upstream
-else
- remote=origin
-fi
-
-# Increment v2.x.y -> v2.x+1.0
-npm version minor || exit 1
-
-# Generate changelog from pull requests
-github-changes -o request -r request \
- --auth --verbose \
- --file CHANGELOG.md \
- --only-pulls --use-commit-body \
- --date-format '(YYYY/MM/DD)' \
- || exit 1
-
-# Since the tag for the new version hasn't been pushed yet, any changes in it
-# will be marked as "upcoming"
-version="$(grep '"version"' package.json | cut -d'"' -f4)"
-sed -i -e "s/^### upcoming/### v$version/" CHANGELOG.md
-
-# This may fail if no changelog updates
-# TODO: would this ever actually happen? handle it better?
-git add CHANGELOG.md; git commit -m 'Update changelog'
-
-# Publish the new version to npm
-npm publish || exit 1
-
-# Increment v2.x.0 -> v2.x.1
-# For rationale, see:
-# https://github.com/request/oauth-sign/issues/10#issuecomment-58917018
-npm version patch || exit 1
-
-# Push back to the main repo
-git push $remote master --tags || exit 1
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/request.js
----------------------------------------------------------------------
diff --git a/node_modules/request/request.js b/node_modules/request/request.js
deleted file mode 100644
index 5f8f268..0000000
--- a/node_modules/request/request.js
+++ /dev/null
@@ -1,1569 +0,0 @@
-'use strict'
-
-var http = require('http')
- , https = require('https')
- , url = require('url')
- , util = require('util')
- , stream = require('stream')
- , qs = require('qs')
- , querystring = require('querystring')
- , zlib = require('zlib')
- , helpers = require('./lib/helpers')
- , bl = require('bl')
- , hawk = require('hawk')
- , aws = require('aws-sign2')
- , httpSignature = require('http-signature')
- , mime = require('mime-types')
- , tunnel = require('tunnel-agent')
- , stringstream = require('stringstream')
- , caseless = require('caseless')
- , ForeverAgent = require('forever-agent')
- , FormData = require('form-data')
- , cookies = require('./lib/cookies')
- , copy = require('./lib/copy')
- , getProxyFromURI = require('./lib/getProxyFromURI')
- , Har = require('./lib/har').Har
- , Auth = require('./lib/auth').Auth
- , OAuth = require('./lib/oauth').OAuth
- , Multipart = require('./lib/multipart').Multipart
- , Redirect = require('./lib/redirect').Redirect
-
-var safeStringify = helpers.safeStringify
- , isReadStream = helpers.isReadStream
- , toBase64 = helpers.toBase64
- , defer = helpers.defer
- , globalCookieJar = cookies.jar()
-
-
-var globalPool = {}
-
-var defaultProxyHeaderWhiteList = [
- 'accept',
- 'accept-charset',
- 'accept-encoding',
- 'accept-language',
- 'accept-ranges',
- 'cache-control',
- 'content-encoding',
- 'content-language',
- 'content-length',
- 'content-location',
- 'content-md5',
- 'content-range',
- 'content-type',
- 'connection',
- 'date',
- 'expect',
- 'max-forwards',
- 'pragma',
- 'referer',
- 'te',
- 'transfer-encoding',
- 'user-agent',
- 'via'
-]
-
-var defaultProxyHeaderExclusiveList = [
- 'proxy-authorization'
-]
-
-function filterForNonReserved(reserved, options) {
- // Filter out properties that are not reserved.
- // Reserved values are passed in at call site.
-
- var object = {}
- for (var i in options) {
- var notReserved = (reserved.indexOf(i) === -1)
- if (notReserved) {
- object[i] = options[i]
- }
- }
- return object
-}
-
-function filterOutReservedFunctions(reserved, options) {
- // Filter out properties that are functions and are reserved.
- // Reserved values are passed in at call site.
-
- var object = {}
- for (var i in options) {
- var isReserved = !(reserved.indexOf(i) === -1)
- var isFunction = (typeof options[i] === 'function')
- if (!(isReserved && isFunction)) {
- object[i] = options[i]
- }
- }
- return object
-
-}
-
-function constructProxyHost(uriObject) {
- var port = uriObject.portA
- , protocol = uriObject.protocol
- , proxyHost = uriObject.hostname + ':'
-
- if (port) {
- proxyHost += port
- } else if (protocol === 'https:') {
- proxyHost += '443'
- } else {
- proxyHost += '80'
- }
-
- return proxyHost
-}
-
-function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) {
- var whiteList = proxyHeaderWhiteList
- .reduce(function (set, header) {
- set[header.toLowerCase()] = true
- return set
- }, {})
-
- return Object.keys(headers)
- .filter(function (header) {
- return whiteList[header.toLowerCase()]
- })
- .reduce(function (set, header) {
- set[header] = headers[header]
- return set
- }, {})
-}
-
-function getTunnelOption(self, options) {
- // Tunnel HTTPS by default, or if a previous request in the redirect chain
- // was tunneled. Allow the user to override this setting.
-
- // If self.tunnel is already set (because this is a redirect), use the
- // existing value.
- if (typeof self.tunnel !== 'undefined') {
- return self.tunnel
- }
-
- // If options.tunnel is set (the user specified a value), use it.
- if (typeof options.tunnel !== 'undefined') {
- return options.tunnel
- }
-
- // If the destination is HTTPS, tunnel.
- if (self.uri.protocol === 'https:') {
- return true
- }
-
- // Otherwise, leave tunnel unset, because if a later request in the redirect
- // chain is HTTPS then that request (and any subsequent ones) should be
- // tunneled.
- return undefined
-}
-
-function constructTunnelOptions(request) {
- var proxy = request.proxy
-
- var tunnelOptions = {
- proxy : {
- host : proxy.hostname,
- port : +proxy.port,
- proxyAuth : proxy.auth,
- headers : request.proxyHeaders
- },
- headers : request.headers,
- ca : request.ca,
- cert : request.cert,
- key : request.key,
- passphrase : request.passphrase,
- pfx : request.pfx,
- ciphers : request.ciphers,
- rejectUnauthorized : request.rejectUnauthorized,
- secureOptions : request.secureOptions,
- secureProtocol : request.secureProtocol
- }
-
- return tunnelOptions
-}
-
-function constructTunnelFnName(uri, proxy) {
- var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
- var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
- return [uriProtocol, proxyProtocol].join('Over')
-}
-
-function getTunnelFn(request) {
- var uri = request.uri
- var proxy = request.proxy
- var tunnelFnName = constructTunnelFnName(uri, proxy)
- return tunnel[tunnelFnName]
-}
-
-// Function for properly handling a connection error
-function connectionErrorHandler(error) {
- var socket = this
- if (socket.res) {
- if (socket.res.request) {
- socket.res.request.emit('error', error)
- } else {
- socket.res.emit('error', error)
- }
- } else {
- socket._httpMessage.emit('error', error)
- }
-}
-
-// Return a simpler request object to allow serialization
-function requestToJSON() {
- var self = this
- return {
- uri: self.uri,
- method: self.method,
- headers: self.headers
- }
-}
-
-// Return a simpler response object to allow serialization
-function responseToJSON() {
- var self = this
- return {
- statusCode: self.statusCode,
- body: self.body,
- headers: self.headers,
- request: requestToJSON.call(self.request)
- }
-}
-
-// encode rfc3986 characters
-function rfc3986 (str) {
- return str.replace(/[!'()*]/g, function(c) {
- return '%' + c.charCodeAt(0).toString(16).toUpperCase()
- })
-}
-
-function Request (options) {
- // if given the method property in options, set property explicitMethod to true
-
- // extend the Request instance with any non-reserved properties
- // remove any reserved functions from the options object
- // set Request instance to be readable and writable
- // call init
-
- var self = this
-
- // start with HAR, then override with additional options
- if (options.har) {
- self._har = new Har(self)
- options = self._har.options(options)
- }
-
- stream.Stream.call(self)
- var reserved = Object.keys(Request.prototype)
- var nonReserved = filterForNonReserved(reserved, options)
-
- stream.Stream.call(self)
- util._extend(self, nonReserved)
- options = filterOutReservedFunctions(reserved, options)
-
- self.readable = true
- self.writable = true
- if (options.method) {
- self.explicitMethod = true
- }
- self._auth = new Auth(self)
- self._oauth = new OAuth(self)
- self._multipart = new Multipart(self)
- self._redirect = new Redirect(self)
- self.init(options)
-}
-
-util.inherits(Request, stream.Stream)
-
-// Debugging
-Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG)
-function debug() {
- if (Request.debug) {
- console.error('REQUEST %s', util.format.apply(util, arguments))
- }
-}
-
-Request.prototype.setupTunnel = function () {
- var self = this
-
- if (typeof self.proxy === 'string') {
- self.proxy = url.parse(self.proxy)
- }
-
- if (!self.proxy || !self.tunnel) {
- return false
- }
-
- // Setup Proxy Header Exclusive List and White List
- self.proxyHeaderExclusiveList = self.proxyHeaderExclusiveList || []
- self.proxyHeaderWhiteList = self.proxyHeaderWhiteList || defaultProxyHeaderWhiteList
- var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
- var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
-
- // Setup Proxy Headers and Proxy Headers Host
- // Only send the Proxy White Listed Header names
- self.proxyHeaders = constructProxyHeaderWhiteList(self.headers, proxyHeaderWhiteList)
- self.proxyHeaders.host = constructProxyHost(self.uri)
- proxyHeaderExclusiveList.forEach(self.removeHeader, self)
-
- // Set Agent from Tunnel Data
- var tunnelFn = getTunnelFn(self)
- var tunnelOptions = constructTunnelOptions(self)
- self.agent = tunnelFn(tunnelOptions)
-
- return true
-}
-
-Request.prototype.init = function (options) {
- // init() contains all the code to setup the request object.
- // the actual outgoing request is not started until start() is called
- // this function is called from both the constructor and on redirect.
- var self = this
- if (!options) {
- options = {}
- }
- self.headers = self.headers ? copy(self.headers) : {}
-
- // Delete headers with value undefined since they break
- // ClientRequest.OutgoingMessage.setHeader in node 0.12
- for (var headerName in self.headers) {
- if (typeof self.headers[headerName] === 'undefined') {
- delete self.headers[headerName]
- }
- }
-
- caseless.httpify(self, self.headers)
-
- if (!self.method) {
- self.method = options.method || 'GET'
- }
- if (!self.localAddress) {
- self.localAddress = options.localAddress
- }
-
- if (!self.qsLib) {
- self.qsLib = (options.useQuerystring ? querystring : qs)
- }
- if (!self.qsParseOptions) {
- self.qsParseOptions = options.qsParseOptions
- }
- if (!self.qsStringifyOptions) {
- self.qsStringifyOptions = options.qsStringifyOptions
- }
-
- debug(options)
- if (!self.pool && self.pool !== false) {
- self.pool = globalPool
- }
- self.dests = self.dests || []
- self.__isRequestRequest = true
-
- // Protect against double callback
- if (!self._callback && self.callback) {
- self._callback = self.callback
- self.callback = function () {
- if (self._callbackCalled) {
- return // Print a warning maybe?
- }
- self._callbackCalled = true
- self._callback.apply(self, arguments)
- }
- self.on('error', self.callback.bind())
- self.on('complete', self.callback.bind(self, null))
- }
-
- // People use this property instead all the time, so support it
- if (!self.uri && self.url) {
- self.uri = self.url
- delete self.url
- }
-
- // If there's a baseUrl, then use it as the base URL (i.e. uri must be
- // specified as a relative path and is appended to baseUrl).
- if (self.baseUrl) {
- if (typeof self.baseUrl !== 'string') {
- return self.emit('error', new Error('options.baseUrl must be a string'))
- }
-
- if (typeof self.uri !== 'string') {
- return self.emit('error', new Error('options.uri must be a string when using options.baseUrl'))
- }
-
- if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) {
- return self.emit('error', new Error('options.uri must be a path when using options.baseUrl'))
- }
-
- // Handle all cases to make sure that there's only one slash between
- // baseUrl and uri.
- var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1
- var uriStartsWithSlash = self.uri.indexOf('/') === 0
-
- if (baseUrlEndsWithSlash && uriStartsWithSlash) {
- self.uri = self.baseUrl + self.uri.slice(1)
- } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {
- self.uri = self.baseUrl + self.uri
- } else if (self.uri === '') {
- self.uri = self.baseUrl
- } else {
- self.uri = self.baseUrl + '/' + self.uri
- }
- delete self.baseUrl
- }
-
- // A URI is needed by this point, throw if we haven't been able to get one
- if (!self.uri) {
- return self.emit('error', new Error('options.uri is a required argument'))
- }
-
- // If a string URI/URL was given, parse it into a URL object
- if(typeof self.uri === 'string') {
- self.uri = url.parse(self.uri)
- }
-
- // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme
- if (self.uri.protocol === 'unix:') {
- return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`'))
- }
-
- // Support Unix Sockets
- if(self.uri.host === 'unix') {
- // Get the socket & request paths from the URL
- var unixParts = self.uri.path.split(':')
- , host = unixParts[0]
- , path = unixParts[1]
- // Apply unix properties to request
- self.socketPath = host
- self.uri.pathname = path
- self.uri.path = path
- self.uri.host = host
- self.uri.hostname = host
- self.uri.isUnix = true
- }
-
- if (self.strictSSL === false) {
- self.rejectUnauthorized = false
- }
-
- if(!self.hasOwnProperty('proxy')) {
- self.proxy = getProxyFromURI(self.uri)
- }
-
- self.tunnel = getTunnelOption(self, options)
- if (self.proxy) {
- self.setupTunnel()
- }
-
- if (!self.uri.pathname) {self.uri.pathname = '/'}
-
- if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {
- // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar
- // Detect and reject it as soon as possible
- var faultyUri = url.format(self.uri)
- var message = 'Invalid URI "' + faultyUri + '"'
- if (Object.keys(options).length === 0) {
- // No option ? This can be the sign of a redirect
- // As this is a case where the user cannot do anything (they didn't call request directly with this URL)
- // they should be warned that it can be caused by a redirection (can save some hair)
- message += '. This can be caused by a crappy redirection.'
- }
- // This error was fatal
- return self.emit('error', new Error(message))
- }
-
- self._redirect.onRequest()
-
- self.setHost = false
- if (!self.hasHeader('host')) {
- var hostHeaderName = self.originalHostHeaderName || 'host'
- self.setHeader(hostHeaderName, self.uri.hostname)
- if (self.uri.port) {
- if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') &&
- !(self.uri.port === 443 && self.uri.protocol === 'https:') ) {
- self.setHeader(hostHeaderName, self.getHeader('host') + (':' + self.uri.port) )
- }
- }
- self.setHost = true
- }
-
- self.jar(self._jar || options.jar)
-
- if (!self.uri.port) {
- if (self.uri.protocol === 'http:') {self.uri.port = 80}
- else if (self.uri.protocol === 'https:') {self.uri.port = 443}
- }
-
- if (self.proxy && !self.tunnel) {
- self.port = self.proxy.port
- self.host = self.proxy.hostname
- } else {
- self.port = self.uri.port
- self.host = self.uri.hostname
- }
-
- if (options.form) {
- self.form(options.form)
- }
-
- if (options.formData) {
- var formData = options.formData
- var requestForm = self.form()
- var appendFormValue = function (key, value) {
- if (value.hasOwnProperty('value') && value.hasOwnProperty('options')) {
- requestForm.append(key, value.value, value.options)
- } else {
- requestForm.append(key, value)
- }
- }
- for (var formKey in formData) {
- if (formData.hasOwnProperty(formKey)) {
- var formValue = formData[formKey]
- if (formValue instanceof Array) {
- for (var j = 0; j < formValue.length; j++) {
- appendFormValue(formKey, formValue[j])
- }
- } else {
- appendFormValue(formKey, formValue)
- }
- }
- }
- }
-
- if (options.qs) {
- self.qs(options.qs)
- }
-
- if (self.uri.path) {
- self.path = self.uri.path
- } else {
- self.path = self.uri.pathname + (self.uri.search || '')
- }
-
- if (self.path.length === 0) {
- self.path = '/'
- }
-
- // Auth must happen last in case signing is dependent on other headers
- if (options.oauth) {
- self.oauth(options.oauth)
- }
-
- if (options.aws) {
- self.aws(options.aws)
- }
-
- if (options.hawk) {
- self.hawk(options.hawk)
- }
-
- if (options.httpSignature) {
- self.httpSignature(options.httpSignature)
- }
-
- if (options.auth) {
- if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) {
- options.auth.user = options.auth.username
- }
- if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) {
- options.auth.pass = options.auth.password
- }
-
- self.auth(
- options.auth.user,
- options.auth.pass,
- options.auth.sendImmediately,
- options.auth.bearer
- )
- }
-
- if (self.gzip && !self.hasHeader('accept-encoding')) {
- self.setHeader('accept-encoding', 'gzip')
- }
-
- if (self.uri.auth && !self.hasHeader('authorization')) {
- var uriAuthPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) })
- self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)
- }
-
- if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {
- var proxyAuthPieces = self.proxy.auth.split(':').map(function(item){
- return querystring.unescape(item)
- })
- var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))
- self.setHeader('proxy-authorization', authHeader)
- }
-
- if (self.proxy && !self.tunnel) {
- self.path = (self.uri.protocol + '//' + self.uri.host + self.path)
- }
-
- if (options.json) {
- self.json(options.json)
- }
- if (options.multipart) {
- self.multipart(options.multipart)
- }
-
- if (options.time) {
- self.timing = true
- self.elapsedTime = self.elapsedTime || 0
- }
-
- if (self.body) {
- var length = 0
- if (!Buffer.isBuffer(self.body)) {
- if (Array.isArray(self.body)) {
- for (var i = 0; i < self.body.length; i++) {
- length += self.body[i].length
- }
- } else {
- self.body = new Buffer(self.body)
- length = self.body.length
- }
- } else {
- length = self.body.length
- }
- if (length) {
- if (!self.hasHeader('content-length')) {
- self.setHeader('content-length', length)
- }
- } else {
- throw new Error('Argument error, options.body.')
- }
- }
-
- var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol
- , defaultModules = {'http:':http, 'https:':https}
- , httpModules = self.httpModules || {}
-
- self.httpModule = httpModules[protocol] || defaultModules[protocol]
-
- if (!self.httpModule) {
- return self.emit('error', new Error('Invalid protocol: ' + protocol))
- }
-
- if (options.ca) {
- self.ca = options.ca
- }
-
- if (!self.agent) {
- if (options.agentOptions) {
- self.agentOptions = options.agentOptions
- }
-
- if (options.agentClass) {
- self.agentClass = options.agentClass
- } else if (options.forever) {
- self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL
- } else {
- self.agentClass = self.httpModule.Agent
- }
- }
-
- if (self.pool === false) {
- self.agent = false
- } else {
- self.agent = self.agent || self.getNewAgent()
- }
-
- self.on('pipe', function (src) {
- if (self.ntick && self._started) {
- throw new Error('You cannot pipe to this stream after the outbound request has started.')
- }
- self.src = src
- if (isReadStream(src)) {
- if (!self.hasHeader('content-type')) {
- self.setHeader('content-type', mime.lookup(src.path))
- }
- } else {
- if (src.headers) {
- for (var i in src.headers) {
- if (!self.hasHeader(i)) {
- self.setHeader(i, src.headers[i])
- }
- }
- }
- if (self._json && !self.hasHeader('content-type')) {
- self.setHeader('content-type', 'application/json')
- }
- if (src.method && !self.explicitMethod) {
- self.method = src.method
- }
- }
-
- // self.on('pipe', function () {
- // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')
- // })
- })
-
- defer(function () {
- if (self._aborted) {
- return
- }
-
- var end = function () {
- if (self._form) {
- if (!self._auth.hasAuth) {
- self._form.pipe(self)
- }
- else if (self._auth.hasAuth && self._auth.sentAuth) {
- self._form.pipe(self)
- }
- }
- if (self._multipart && self._multipart.chunked) {
- self._multipart.body.pipe(self)
- }
- if (self.body) {
- if (Array.isArray(self.body)) {
- self.body.forEach(function (part) {
- self.write(part)
- })
- } else {
- self.write(self.body)
- }
- self.end()
- } else if (self.requestBodyStream) {
- console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
- self.requestBodyStream.pipe(self)
- } else if (!self.src) {
- if (self._auth.hasAuth && !self._auth.sentAuth) {
- self.end()
- return
- }
- if (self.method !== 'GET' && typeof self.method !== 'undefined') {
- self.setHeader('content-length', 0)
- }
- self.end()
- }
- }
-
- if (self._form && !self.hasHeader('content-length')) {
- // Before ending the request, we had to compute the length of the whole form, asyncly
- self.setHeader(self._form.getHeaders())
- self._form.getLength(function (err, length) {
- if (!err) {
- self.setHeader('content-length', length)
- }
- end()
- })
- } else {
- end()
- }
-
- self.ntick = true
- })
-
-}
-
-// Must call this when following a redirect from https to http or vice versa
-// Attempts to keep everything as identical as possible, but update the
-// httpModule, Tunneling agent, and/or Forever Agent in use.
-Request.prototype._updateProtocol = function () {
- var self = this
- var protocol = self.uri.protocol
-
- if (protocol === 'https:' || self.tunnel) {
- // previously was doing http, now doing https
- // if it's https, then we might need to tunnel now.
- if (self.proxy) {
- if (self.setupTunnel()) {
- return
- }
- }
-
- self.httpModule = https
- switch (self.agentClass) {
- case ForeverAgent:
- self.agentClass = ForeverAgent.SSL
- break
- case http.Agent:
- self.agentClass = https.Agent
- break
- default:
- // nothing we can do. Just hope for the best.
- return
- }
-
- // if there's an agent, we need to get a new one.
- if (self.agent) {
- self.agent = self.getNewAgent()
- }
-
- } else {
- // previously was doing https, now doing http
- self.httpModule = http
- switch (self.agentClass) {
- case ForeverAgent.SSL:
- self.agentClass = ForeverAgent
- break
- case https.Agent:
- self.agentClass = http.Agent
- break
- default:
- // nothing we can do. just hope for the best
- return
- }
-
- // if there's an agent, then get a new one.
- if (self.agent) {
- self.agent = null
- self.agent = self.getNewAgent()
- }
- }
-}
-
-Request.prototype.getNewAgent = function () {
- var self = this
- var Agent = self.agentClass
- var options = {}
- if (self.agentOptions) {
- for (var i in self.agentOptions) {
- options[i] = self.agentOptions[i]
- }
- }
- if (self.ca) {
- options.ca = self.ca
- }
- if (self.ciphers) {
- options.ciphers = self.ciphers
- }
- if (self.secureProtocol) {
- options.secureProtocol = self.secureProtocol
- }
- if (self.secureOptions) {
- options.secureOptions = self.secureOptions
- }
- if (typeof self.rejectUnauthorized !== 'undefined') {
- options.rejectUnauthorized = self.rejectUnauthorized
- }
-
- if (self.cert && self.key) {
- options.key = self.key
- options.cert = self.cert
- }
-
- if (self.pfx) {
- options.pfx = self.pfx
- }
-
- if (self.passphrase) {
- options.passphrase = self.passphrase
- }
-
- var poolKey = ''
-
- // different types of agents are in different pools
- if (Agent !== self.httpModule.Agent) {
- poolKey += Agent.name
- }
-
- // ca option is only relevant if proxy or destination are https
- var proxy = self.proxy
- if (typeof proxy === 'string') {
- proxy = url.parse(proxy)
- }
- var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'
-
- if (isHttps) {
- if (options.ca) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.ca
- }
-
- if (typeof options.rejectUnauthorized !== 'undefined') {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.rejectUnauthorized
- }
-
- if (options.cert) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.cert.toString('ascii') + options.key.toString('ascii')
- }
-
- if (options.pfx) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.pfx.toString('ascii')
- }
-
- if (options.ciphers) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.ciphers
- }
-
- if (options.secureProtocol) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.secureProtocol
- }
-
- if (options.secureOptions) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.secureOptions
- }
- }
-
- if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) {
- // not doing anything special. Use the globalAgent
- return self.httpModule.globalAgent
- }
-
- // we're using a stored agent. Make sure it's protocol-specific
- poolKey = self.uri.protocol + poolKey
-
- // generate a new agent for this setting if none yet exists
- if (!self.pool[poolKey]) {
- self.pool[poolKey] = new Agent(options)
- // properly set maxSockets on new agents
- if (self.pool.maxSockets) {
- self.pool[poolKey].maxSockets = self.pool.maxSockets
- }
- }
-
- return self.pool[poolKey]
-}
-
-Request.prototype.start = function () {
- // start() is called once we are ready to send the outgoing HTTP request.
- // this is usually called on the first write(), end() or on nextTick()
- var self = this
-
- if (self._aborted) {
- return
- }
-
- self._started = true
- self.method = self.method || 'GET'
- self.href = self.uri.href
-
- if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {
- self.setHeader('content-length', self.src.stat.size)
- }
- if (self._aws) {
- self.aws(self._aws, true)
- }
-
- // We have a method named auth, which is completely different from the http.request
- // auth option. If we don't remove it, we're gonna have a bad time.
- var reqOptions = copy(self)
- delete reqOptions.auth
-
- debug('make request', self.uri.href)
-
- self.req = self.httpModule.request(reqOptions)
-
- if (self.timing) {
- self.startTime = new Date().getTime()
- }
-
- if (self.timeout && !self.timeoutTimer) {
- var timeout = self.timeout < 0 ? 0 : self.timeout
- self.timeoutTimer = setTimeout(function () {
- self.abort()
- var e = new Error('ETIMEDOUT')
- e.code = 'ETIMEDOUT'
- self.emit('error', e)
- }, timeout)
-
- // Set additional timeout on socket - in case if remote
- // server freeze after sending headers
- if (self.req.setTimeout) { // only works on node 0.6+
- self.req.setTimeout(timeout, function () {
- if (self.req) {
- self.req.abort()
- var e = new Error('ESOCKETTIMEDOUT')
- e.code = 'ESOCKETTIMEDOUT'
- self.emit('error', e)
- }
- })
- }
- }
-
- self.req.on('response', self.onRequestResponse.bind(self))
- self.req.on('error', self.onRequestError.bind(self))
- self.req.on('drain', function() {
- self.emit('drain')
- })
- self.req.on('socket', function(socket) {
- self.emit('socket', socket)
- })
-
- self.on('end', function() {
- if ( self.req.connection ) {
- self.req.connection.removeListener('error', connectionErrorHandler)
- }
- })
- self.emit('request', self.req)
-}
-
-Request.prototype.onRequestError = function (error) {
- var self = this
- if (self._aborted) {
- return
- }
- if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET'
- && self.agent.addRequestNoreuse) {
- self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }
- self.start()
- self.req.end()
- return
- }
- if (self.timeout && self.timeoutTimer) {
- clearTimeout(self.timeoutTimer)
- self.timeoutTimer = null
- }
- self.emit('error', error)
-}
-
-Request.prototype.onRequestResponse = function (response) {
- var self = this
- debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)
- response.on('end', function() {
- if (self.timing) {
- self.elapsedTime += (new Date().getTime() - self.startTime)
- debug('elapsed time', self.elapsedTime)
- response.elapsedTime = self.elapsedTime
- }
- debug('response end', self.uri.href, response.statusCode, response.headers)
- })
-
- // The check on response.connection is a workaround for browserify.
- if (response.connection && response.connection.listeners('error').indexOf(connectionErrorHandler) === -1) {
- response.connection.setMaxListeners(0)
- response.connection.once('error', connectionErrorHandler)
- }
- if (self._aborted) {
- debug('aborted', self.uri.href)
- response.resume()
- return
- }
- if (self._paused) {
- response.pause()
- } else if (response.resume) {
- // response.resume should be defined, but check anyway before calling. Workaround for browserify.
- response.resume()
- }
-
- self.response = response
- response.request = self
- response.toJSON = responseToJSON
-
- // XXX This is different on 0.10, because SSL is strict by default
- if (self.httpModule === https &&
- self.strictSSL && (!response.hasOwnProperty('client') ||
- !response.client.authorized)) {
- debug('strict ssl error', self.uri.href)
- var sslErr = response.hasOwnProperty('client') ? response.client.authorizationError : self.uri.href + ' does not support SSL'
- self.emit('error', new Error('SSL Error: ' + sslErr))
- return
- }
-
- // Save the original host before any redirect (if it changes, we need to
- // remove any authorization headers). Also remember the case of the header
- // name because lots of broken servers expect Host instead of host and we
- // want the caller to be able to specify this.
- self.originalHost = self.getHeader('host')
- if (!self.originalHostHeaderName) {
- self.originalHostHeaderName = self.hasHeader('host')
- }
- if (self.setHost) {
- self.removeHeader('host')
- }
- if (self.timeout && self.timeoutTimer) {
- clearTimeout(self.timeoutTimer)
- self.timeoutTimer = null
- }
-
- var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar
- var addCookie = function (cookie) {
- //set the cookie if it's domain in the href's domain.
- try {
- targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})
- } catch (e) {
- self.emit('error', e)
- }
- }
-
- response.caseless = caseless(response.headers)
-
- if (response.caseless.has('set-cookie') && (!self._disableCookies)) {
- var headerName = response.caseless.has('set-cookie')
- if (Array.isArray(response.headers[headerName])) {
- response.headers[headerName].forEach(addCookie)
- } else {
- addCookie(response.headers[headerName])
- }
- }
-
- if (self._redirect.onResponse(response)) {
- return // Ignore the rest of the response
- } else {
- // Be a good stream and emit end when the response is finished.
- // Hack to emit end on close because of a core bug that never fires end
- response.on('close', function () {
- if (!self._ended) {
- self.response.emit('end')
- }
- })
-
- response.on('end', function () {
- self._ended = true
- })
-
- var dataStream
- if (self.gzip) {
- var contentEncoding = response.headers['content-encoding'] || 'identity'
- contentEncoding = contentEncoding.trim().toLowerCase()
-
- if (contentEncoding === 'gzip') {
- dataStream = zlib.createGunzip()
- response.pipe(dataStream)
- } else {
- // Since previous versions didn't check for Content-Encoding header,
- // ignore any invalid values to preserve backwards-compatibility
- if (contentEncoding !== 'identity') {
- debug('ignoring unrecognized Content-Encoding ' + contentEncoding)
- }
- dataStream = response
- }
- } else {
- dataStream = response
- }
-
- if (self.encoding) {
- if (self.dests.length !== 0) {
- console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')
- } else if (dataStream.setEncoding) {
- dataStream.setEncoding(self.encoding)
- } else {
- // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with
- // zlib streams.
- // If/When support for 0.9.4 is dropped, this should be unnecessary.
- dataStream = dataStream.pipe(stringstream(self.encoding))
- }
- }
-
- self.emit('response', response)
-
- self.dests.forEach(function (dest) {
- self.pipeDest(dest)
- })
-
- dataStream.on('data', function (chunk) {
- self._destdata = true
- self.emit('data', chunk)
- })
- dataStream.on('end', function (chunk) {
- self.emit('end', chunk)
- })
- dataStream.on('error', function (error) {
- self.emit('error', error)
- })
- dataStream.on('close', function () {self.emit('close')})
-
- if (self.callback) {
- var buffer = bl()
- , strings = []
-
- self.on('data', function (chunk) {
- if (Buffer.isBuffer(chunk)) {
- buffer.append(chunk)
- } else {
- strings.push(chunk)
- }
- })
- self.on('end', function () {
- debug('end event', self.uri.href)
- if (self._aborted) {
- debug('aborted', self.uri.href)
- return
- }
-
- if (buffer.length) {
- debug('has body', self.uri.href, buffer.length)
- if (self.encoding === null) {
- // response.body = buffer
- // can't move to this until https://github.com/rvagg/bl/issues/13
- response.body = buffer.slice()
- } else {
- response.body = buffer.toString(self.encoding)
- }
- } else if (strings.length) {
- // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
- // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
- if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
- strings[0] = strings[0].substring(1)
- }
- response.body = strings.join('')
- }
-
- if (self._json) {
- try {
- response.body = JSON.parse(response.body, self._jsonReviver)
- } catch (e) {}
- }
- debug('emitting complete', self.uri.href)
- if(typeof response.body === 'undefined' && !self._json) {
- response.body = self.encoding === null ? new Buffer(0) : ''
- }
- self.emit('complete', response, response.body)
- })
- }
- //if no callback
- else{
- self.on('end', function () {
- if (self._aborted) {
- debug('aborted', self.uri.href)
- return
- }
- self.emit('complete', response)
- })
- }
- }
- debug('finish init function', self.uri.href)
-}
-
-Request.prototype.abort = function () {
- var self = this
- self._aborted = true
-
- if (self.req) {
- self.req.abort()
- }
- else if (self.response) {
- self.response.abort()
- }
-
- self.emit('abort')
-}
-
-Request.prototype.pipeDest = function (dest) {
- var self = this
- var response = self.response
- // Called after the response is received
- if (dest.headers && !dest.headersSent) {
- if (response.caseless.has('content-type')) {
- var ctname = response.caseless.has('content-type')
- if (dest.setHeader) {
- dest.setHeader(ctname, response.headers[ctname])
- }
- else {
- dest.headers[ctname] = response.headers[ctname]
- }
- }
-
- if (response.caseless.has('content-length')) {
- var clname = response.caseless.has('content-length')
- if (dest.setHeader) {
- dest.setHeader(clname, response.headers[clname])
- } else {
- dest.headers[clname] = response.headers[clname]
- }
- }
- }
- if (dest.setHeader && !dest.headersSent) {
- for (var i in response.headers) {
- // If the response content is being decoded, the Content-Encoding header
- // of the response doesn't represent the piped content, so don't pass it.
- if (!self.gzip || i !== 'content-encoding') {
- dest.setHeader(i, response.headers[i])
- }
- }
- dest.statusCode = response.statusCode
- }
- if (self.pipefilter) {
- self.pipefilter(response, dest)
- }
-}
-
-Request.prototype.qs = function (q, clobber) {
- var self = this
- var base
- if (!clobber && self.uri.query) {
- base = self.qsLib.parse(self.uri.query, self.qsParseOptions)
- } else {
- base = {}
- }
-
- for (var i in q) {
- base[i] = q[i]
- }
-
- if (self.qsLib.stringify(base, self.qsStringifyOptions) === ''){
- return self
- }
-
- var qs = self.qsLib.stringify(base, self.qsStringifyOptions)
-
- self.uri = url.parse(self.uri.href.split('?')[0] + '?' + rfc3986(qs))
- self.url = self.uri
- self.path = self.uri.path
-
- return self
-}
-Request.prototype.form = function (form) {
- var self = this
- if (form) {
- self.setHeader('content-type', 'application/x-www-form-urlencoded')
- self.body = (typeof form === 'string')
- ? form.toString('utf8')
- : self.qsLib.stringify(form, self.qsStringifyOptions).toString('utf8')
- self.body = rfc3986(self.body)
- return self
- }
- // create form-data object
- self._form = new FormData()
- self._form.on('error', function(err) {
- err.message = 'form-data: ' + err.message
- self.emit('error', err)
- self.abort()
- })
- return self._form
-}
-Request.prototype.multipart = function (multipart) {
- var self = this
-
- self._multipart.onRequest(multipart)
-
- if (!self._multipart.chunked) {
- self.body = self._multipart.body
- }
-
- return self
-}
-Request.prototype.json = function (val) {
- var self = this
-
- if (!self.hasHeader('accept')) {
- self.setHeader('accept', 'application/json')
- }
-
- self._json = true
- if (typeof val === 'boolean') {
- if (self.body !== undefined) {
- if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
- self.body = safeStringify(self.body)
- } else {
- self.body = rfc3986(self.body)
- }
- if (!self.hasHeader('content-type')) {
- self.setHeader('content-type', 'application/json')
- }
- }
- } else {
- self.body = safeStringify(val)
- if (!self.hasHeader('content-type')) {
- self.setHeader('content-type', 'application/json')
- }
- }
-
- if (typeof self.jsonReviver === 'function') {
- self._jsonReviver = self.jsonReviver
- }
-
- return self
-}
-Request.prototype.getHeader = function (name, headers) {
- var self = this
- var result, re, match
- if (!headers) {
- headers = self.headers
- }
- Object.keys(headers).forEach(function (key) {
- if (key.length !== name.length) {
- return
- }
- re = new RegExp(name, 'i')
- match = key.match(re)
- if (match) {
- result = headers[key]
- }
- })
- return result
-}
-
-Request.prototype.auth = function (user, pass, sendImmediately, bearer) {
- var self = this
-
- self._auth.onRequest(user, pass, sendImmediately, bearer)
-
- return self
-}
-Request.prototype.aws = function (opts, now) {
- var self = this
-
- if (!now) {
- self._aws = opts
- return self
- }
- var date = new Date()
- self.setHeader('date', date.toUTCString())
- var auth =
- { key: opts.key
- , secret: opts.secret
- , verb: self.method.toUpperCase()
- , date: date
- , contentType: self.getHeader('content-type') || ''
- , md5: self.getHeader('content-md5') || ''
- , amazonHeaders: aws.canonicalizeHeaders(self.headers)
- }
- var path = self.uri.path
- if (opts.bucket && path) {
- auth.resource = '/' + opts.bucket + path
- } else if (opts.bucket && !path) {
- auth.resource = '/' + opts.bucket
- } else if (!opts.bucket && path) {
- auth.resource = path
- } else if (!opts.bucket && !path) {
- auth.resource = '/'
- }
- auth.resource = aws.canonicalizeResource(auth.resource)
- self.setHeader('authorization', aws.authorization(auth))
-
- return self
-}
-Request.prototype.httpSignature = function (opts) {
- var self = this
- httpSignature.signRequest({
- getHeader: function(header) {
- return self.getHeader(header, self.headers)
- },
- setHeader: function(header, value) {
- self.setHeader(header, value)
- },
- method: self.method,
- path: self.path
- }, opts)
- debug('httpSignature authorization', self.getHeader('authorization'))
-
- return self
-}
-Request.prototype.hawk = function (opts) {
- var self = this
- self.setHeader('Authorization', hawk.client.header(self.uri, self.method, opts).field)
-}
-Request.prototype.oauth = function (_oauth) {
- var self = this
-
- self._oauth.onRequest(_oauth)
-
- return self
-}
-
-Request.prototype.jar = function (jar) {
- var self = this
- var cookies
-
- if (self._redirect.redirectsFollowed === 0) {
- self.originalCookieHeader = self.getHeader('cookie')
- }
-
- if (!jar) {
- // disable cookies
- cookies = false
- self._disableCookies = true
- } else {
- var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar
- var urihref = self.uri.href
- //fetch cookie in the Specified host
- if (targetCookieJar) {
- cookies = targetCookieJar.getCookieString(urihref)
- }
- }
-
- //if need cookie and cookie is not empty
- if (cookies && cookies.length) {
- if (self.originalCookieHeader) {
- // Don't overwrite existing Cookie header
- self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies)
- } else {
- self.setHeader('cookie', cookies)
- }
- }
- self._jar = jar
- return self
-}
-
-
-// Stream API
-Request.prototype.pipe = function (dest, opts) {
- var self = this
-
- if (self.response) {
- if (self._destdata) {
- throw new Error('You cannot pipe after data has been emitted from the response.')
- } else if (self._ended) {
- throw new Error('You cannot pipe after the response has been ended.')
- } else {
- stream.Stream.prototype.pipe.call(self, dest, opts)
- self.pipeDest(dest)
- return dest
- }
- } else {
- self.dests.push(dest)
- stream.Stream.prototype.pipe.call(self, dest, opts)
- return dest
- }
-}
-Request.prototype.write = function () {
- var self = this
- if (!self._started) {
- self.start()
- }
- return self.req.write.apply(self.req, arguments)
-}
-Request.prototype.end = function (chunk) {
- var self = this
- if (chunk) {
- self.write(chunk)
- }
- if (!self._started) {
- self.start()
- }
- self.req.end()
-}
-Request.prototype.pause = function () {
- var self = this
- if (!self.response) {
- self._paused = true
- } else {
- self.response.pause.apply(self.response, arguments)
- }
-}
-Request.prototype.resume = function () {
- var self = this
- if (!self.response) {
- self._paused = false
- } else {
- self.response.resume.apply(self.response, arguments)
- }
-}
-Request.prototype.destroy = function () {
- var self = this
- if (!self._ended) {
- self.end()
- } else if (self.response) {
- self.response.destroy()
- }
-}
-
-Request.defaultProxyHeaderWhiteList =
- defaultProxyHeaderWhiteList.slice()
-
-Request.defaultProxyHeaderExclusiveList =
- defaultProxyHeaderExclusiveList.slice()
-
-// Exports
-
-Request.prototype.toJSON = requestToJSON
-module.exports = Request
[54/59] [abbrv] couchdb-nmo git commit: add wreck@5.6.0
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/test/index.js b/node_modules/wreck/node_modules/hoek/test/index.js
new file mode 100755
index 0000000..3261ae8
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/test/index.js
@@ -0,0 +1,2425 @@
+// Load modules
+
+var Fs = require('fs');
+var Path = require('path');
+var Code = require('code');
+var Hoek = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+var nestedObj = {
+ v: [7, 8, 9],
+ w: /^something$/igm,
+ x: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date(),
+ d: /hi/igm,
+ e: /hello/
+ },
+ y: 'y',
+ z: new Date(1378775452757)
+};
+
+var dupsArray = [nestedObj, { z: 'z' }, nestedObj];
+var reducedDupsArray = [nestedObj, { z: 'z' }];
+
+describe('clone()', function () {
+
+ it('clones a nested object', function (done) {
+
+ var a = nestedObj;
+ var b = Hoek.clone(a);
+
+ expect(a).to.deep.equal(b);
+ expect(a.z.getTime()).to.equal(b.z.getTime());
+ done();
+ });
+
+ it('clones a null object', function (done) {
+
+ var b = Hoek.clone(null);
+
+ expect(b).to.equal(null);
+ done();
+ });
+
+ it('should not convert undefined properties to null', function (done) {
+
+ var obj = { something: undefined };
+ var b = Hoek.clone(obj);
+
+ expect(typeof b.something).to.equal('undefined');
+ done();
+ });
+
+ it('should not throw on circular reference', function (done) {
+
+ var a = {};
+ a.x = a;
+
+ var test = function () {
+
+ var b = Hoek.clone(a);
+ };
+
+ expect(test).to.not.throw();
+ done();
+ });
+
+ it('clones circular reference', function (done) {
+
+ var x = {
+ 'z': new Date()
+ };
+ x.y = x;
+
+ var b = Hoek.clone(x);
+ expect(Object.keys(b.y)).to.deep.equal(Object.keys(x));
+ expect(b.z).to.not.equal(x.z);
+ expect(b.y).to.not.equal(x.y);
+ expect(b.y.z).to.not.equal(x.y.z);
+ expect(b.y).to.equal(b);
+ expect(b.y.y.y.y).to.equal(b);
+ done();
+ });
+
+ it('clones an object with a null prototype', function (done) {
+
+ var obj = Object.create(null);
+ var b = Hoek.clone(obj);
+
+ expect(b).to.deep.equal(obj);
+ done();
+ });
+
+ it('clones deeply nested object', function (done) {
+
+ var a = {
+ x: {
+ y: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date(),
+ d: /hi/igm,
+ e: /hello/
+ }
+ }
+ };
+
+ var b = Hoek.clone(a);
+
+ expect(a).to.deep.equal(b);
+ expect(a.x.y.c.getTime()).to.equal(b.x.y.c.getTime());
+ done();
+ });
+
+ it('clones arrays', function (done) {
+
+ var a = [1, 2, 3];
+
+ var b = Hoek.clone(a);
+
+ expect(a).to.deep.equal(b);
+ done();
+ });
+
+ it('performs actual copy for shallow keys (no pass by reference)', function (done) {
+
+ var x = Hoek.clone(nestedObj);
+ var y = Hoek.clone(nestedObj);
+
+ // Date
+ expect(x.z).to.not.equal(nestedObj.z);
+ expect(x.z).to.not.equal(y.z);
+
+ // Regex
+ expect(x.w).to.not.equal(nestedObj.w);
+ expect(x.w).to.not.equal(y.w);
+
+ // Array
+ expect(x.v).to.not.equal(nestedObj.v);
+ expect(x.v).to.not.equal(y.v);
+
+ // Immutable(s)
+ x.y = 5;
+ expect(x.y).to.not.equal(nestedObj.y);
+ expect(x.y).to.not.equal(y.y);
+
+ done();
+ });
+
+ it('performs actual copy for deep keys (no pass by reference)', function (done) {
+
+ var x = Hoek.clone(nestedObj);
+ var y = Hoek.clone(nestedObj);
+
+ expect(x.x.c).to.not.equal(nestedObj.x.c);
+ expect(x.x.c).to.not.equal(y.x.c);
+
+ expect(x.x.c.getTime()).to.equal(nestedObj.x.c.getTime());
+ expect(x.x.c.getTime()).to.equal(y.x.c.getTime());
+ done();
+ });
+
+ it('copies functions with properties', function (done) {
+
+ var a = {
+ x: function () {
+
+ return 1;
+ },
+ y: {}
+ };
+ a.x.z = 'string in function';
+ a.x.v = function () {
+
+ return 2;
+ };
+ a.y.u = a.x;
+
+ var b = Hoek.clone(a);
+ expect(b.x()).to.equal(1);
+ expect(b.x.v()).to.equal(2);
+ expect(b.y.u).to.equal(b.x);
+ expect(b.x.z).to.equal('string in function');
+ done();
+ });
+
+ it('should copy a buffer', function (done) {
+
+ var tls = {
+ key: new Buffer([1, 2, 3, 4, 5]),
+ cert: new Buffer([1, 2, 3, 4, 5, 6, 10])
+ };
+
+ var copiedTls = Hoek.clone(tls);
+ expect(Buffer.isBuffer(copiedTls.key)).to.equal(true);
+ expect(JSON.stringify(copiedTls.key)).to.equal(JSON.stringify(tls.key));
+ expect(Buffer.isBuffer(copiedTls.cert)).to.equal(true);
+ expect(JSON.stringify(copiedTls.cert)).to.equal(JSON.stringify(tls.cert));
+ done();
+ });
+
+ it('clones an object with a prototype', function (done) {
+
+ var Obj = function () {
+
+ this.a = 5;
+ };
+
+ Obj.prototype.b = function () {
+
+ return 'c';
+ };
+
+ var a = new Obj();
+ var b = Hoek.clone(a);
+
+ expect(b.a).to.equal(5);
+ expect(b.b()).to.equal('c');
+ expect(a).to.deep.equal(b);
+ done();
+ });
+
+ it('reuses cloned Date object', function (done) {
+
+ var obj = {
+ a: new Date()
+ };
+
+ obj.b = obj.a;
+
+ var copy = Hoek.clone(obj);
+ expect(copy.a).to.equal(copy.b);
+ done();
+ });
+
+ it('shallow copies an object with a prototype and isImmutable flag', function (done) {
+
+ var Obj = function () {
+
+ this.value = 5;
+ };
+
+ Obj.prototype.b = function () {
+
+ return 'c';
+ };
+
+ Obj.prototype.isImmutable = true;
+
+ var obj = {
+ a: new Obj()
+ };
+
+ var copy = Hoek.clone(obj);
+
+ expect(obj.a.value).to.equal(5);
+ expect(copy.a.value).to.equal(5);
+ expect(copy.a.b()).to.equal('c');
+ expect(obj.a).to.equal(copy.a);
+ done();
+ });
+
+ it('clones an object with property getter without executing it', function (done) {
+
+ var obj = {};
+ var value = 1;
+ var execCount = 0;
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ ++execCount;
+ return value;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(execCount).to.equal(0);
+ expect(copy.test).to.equal(1);
+ expect(execCount).to.equal(1);
+ done();
+ });
+
+ it('clones an object with property getter and setter', function (done) {
+
+ var obj = {
+ _test: 0
+ };
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ return this._test;
+ },
+ set: function (value) {
+
+ this._test = value - 1;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(copy.test).to.equal(0);
+ copy.test = 5;
+ expect(copy.test).to.equal(4);
+ done();
+ });
+
+ it('clones an object with only property setter', function (done) {
+
+ var obj = {
+ _test: 0
+ };
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ set: function (value) {
+
+ this._test = value - 1;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(copy._test).to.equal(0);
+ copy.test = 5;
+ expect(copy._test).to.equal(4);
+ done();
+ });
+
+ it('clones an object with non-enumerable properties', function (done) {
+
+ var obj = {
+ _test: 0
+ };
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: false,
+ configurable: true,
+ set: function (value) {
+
+ this._test = value - 1;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(copy._test).to.equal(0);
+ copy.test = 5;
+ expect(copy._test).to.equal(4);
+ done();
+ });
+});
+
+describe('merge()', function () {
+
+ it('deep copies source items', function (done) {
+
+ var target = {
+ b: 3,
+ d: []
+ };
+
+ var source = {
+ c: {
+ d: 1
+ },
+ d: [{ e: 1 }]
+ };
+
+ Hoek.merge(target, source);
+ expect(target.c).to.not.equal(source.c);
+ expect(target.c).to.deep.equal(source.c);
+ expect(target.d).to.not.equal(source.d);
+ expect(target.d[0]).to.not.equal(source.d[0]);
+ expect(target.d).to.deep.equal(source.d);
+ done();
+ });
+
+ it('merges array over an object', function (done) {
+
+ var a = {
+ x: ['n', 'm']
+ };
+
+ var b = {
+ x: {
+ n: '1',
+ m: '2'
+ }
+ };
+
+ Hoek.merge(b, a);
+ expect(a.x[0]).to.equal('n');
+ expect(a.x.n).to.not.exist();
+ done();
+ });
+
+ it('merges object over an array', function (done) {
+
+ var a = {
+ x: ['n', 'm']
+ };
+
+ var b = {
+ x: {
+ n: '1',
+ m: '2'
+ }
+ };
+
+ Hoek.merge(a, b);
+ expect(a.x.n).to.equal('1');
+ expect(a.x[0]).to.not.exist();
+ done();
+ });
+
+ it('does not throw if source is null', function (done) {
+
+ var a = {};
+ var b = null;
+ var c = null;
+
+ expect(function () {
+
+ c = Hoek.merge(a, b);
+ }).to.not.throw();
+
+ expect(c).to.equal(a);
+ done();
+ });
+
+ it('does not throw if source is undefined', function (done) {
+
+ var a = {};
+ var b;
+ var c = null;
+
+ expect(function () {
+
+ c = Hoek.merge(a, b);
+ }).to.not.throw();
+
+ expect(c).to.equal(a);
+ done();
+ });
+
+ it('throws if source is not an object', function (done) {
+
+ expect(function () {
+
+ var a = {};
+ var b = 0;
+
+ Hoek.merge(a, b);
+ }).to.throw('Invalid source value: must be null, undefined, or an object');
+ done();
+ });
+
+ it('throws if target is not an object', function (done) {
+
+ expect(function () {
+
+ var a = 0;
+ var b = {};
+
+ Hoek.merge(a, b);
+ }).to.throw('Invalid target value: must be an object');
+ done();
+ });
+
+ it('throws if target is not an array and source is', function (done) {
+
+ expect(function () {
+
+ var a = {};
+ var b = [1, 2];
+
+ Hoek.merge(a, b);
+ }).to.throw('Cannot merge array onto an object');
+ done();
+ });
+
+ it('returns the same object when merging arrays', function (done) {
+
+ var a = [];
+ var b = [1, 2];
+
+ expect(Hoek.merge(a, b)).to.equal(a);
+ done();
+ });
+
+ it('combines an empty object with a non-empty object', function (done) {
+
+ var a = {};
+ var b = nestedObj;
+
+ var c = Hoek.merge(a, b);
+ expect(a).to.deep.equal(b);
+ expect(c).to.deep.equal(b);
+ done();
+ });
+
+ it('overrides values in target', function (done) {
+
+ var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
+ var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
+
+ var c = Hoek.merge(a, b);
+ expect(c.x).to.equal(null);
+ expect(c.y).to.equal(2);
+ expect(c.z).to.equal(4);
+ expect(c.v).to.equal(0);
+ expect(c.m).to.equal('123');
+ expect(c.t).to.deep.equal({ u: 6 });
+ done();
+ });
+
+ it('overrides values in target (flip)', function (done) {
+
+ var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
+ var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
+
+ var d = Hoek.merge(b, a);
+ expect(d.x).to.equal(1);
+ expect(d.y).to.equal(2);
+ expect(d.z).to.equal(3);
+ expect(d.v).to.equal(5);
+ expect(d.m).to.equal('abc');
+ expect(d.t).to.deep.equal('test');
+ done();
+ });
+
+ it('retains Date properties', function (done) {
+
+ var a = { x: new Date(1378776452757) };
+
+ var b = Hoek.merge({}, a);
+ expect(a.x.getTime()).to.equal(b.x.getTime());
+ done();
+ });
+
+ it('retains Date properties when merging keys', function (done) {
+
+ var a = { x: new Date(1378776452757) };
+
+ var b = Hoek.merge({ x: {} }, a);
+ expect(a.x.getTime()).to.equal(b.x.getTime());
+ done();
+ });
+
+ it('overrides Buffer', function (done) {
+
+ var a = { x: new Buffer('abc') };
+
+ var b = Hoek.merge({ x: {} }, a);
+ expect(a.x.toString()).to.equal('abc');
+ done();
+ });
+});
+
+describe('applyToDefaults()', function () {
+
+ var defaults = {
+ a: 1,
+ b: 2,
+ c: {
+ d: 3,
+ e: [5, 6]
+ },
+ f: 6,
+ g: 'test'
+ };
+
+ it('throws when target is null', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaults(null, {});
+ }).to.throw('Invalid defaults value: must be an object');
+ done();
+ });
+
+ it('returns null if options is false', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, false);
+ expect(result).to.equal(null);
+ done();
+ });
+
+ it('returns null if options is null', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, null);
+ expect(result).to.equal(null);
+ done();
+ });
+
+ it('returns null if options is undefined', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, undefined);
+ expect(result).to.equal(null);
+ done();
+ });
+
+ it('returns a copy of defaults if options is true', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, true);
+ expect(result).to.deep.equal(defaults);
+ done();
+ });
+
+ it('applies object to defaults', function (done) {
+
+ var obj = {
+ a: null,
+ c: {
+ e: [4]
+ },
+ f: 0,
+ g: {
+ h: 5
+ }
+ };
+
+ var result = Hoek.applyToDefaults(defaults, obj);
+ expect(result.c.e).to.deep.equal([4]);
+ expect(result.a).to.equal(1);
+ expect(result.b).to.equal(2);
+ expect(result.f).to.equal(0);
+ expect(result.g).to.deep.equal({ h: 5 });
+ done();
+ });
+
+ it('applies object to defaults with null', function (done) {
+
+ var obj = {
+ a: null,
+ c: {
+ e: [4]
+ },
+ f: 0,
+ g: {
+ h: 5
+ }
+ };
+
+ var result = Hoek.applyToDefaults(defaults, obj, true);
+ expect(result.c.e).to.deep.equal([4]);
+ expect(result.a).to.equal(null);
+ expect(result.b).to.equal(2);
+ expect(result.f).to.equal(0);
+ expect(result.g).to.deep.equal({ h: 5 });
+ done();
+ });
+});
+
+describe('cloneWithShallow()', function () {
+
+ it('deep clones except for listed keys', function (done) {
+
+ var source = {
+ a: {
+ b: 5
+ },
+ c: {
+ d: 6
+ }
+ };
+
+ var copy = Hoek.cloneWithShallow(source, ['c']);
+ expect(copy).to.deep.equal(source);
+ expect(copy).to.not.equal(source);
+ expect(copy.a).to.not.equal(source.a);
+ expect(copy.b).to.equal(source.b);
+ done();
+ });
+
+ it('returns immutable value', function (done) {
+
+ expect(Hoek.cloneWithShallow(5)).to.equal(5);
+ done();
+ });
+
+ it('returns null value', function (done) {
+
+ expect(Hoek.cloneWithShallow(null)).to.equal(null);
+ done();
+ });
+
+ it('returns undefined value', function (done) {
+
+ expect(Hoek.cloneWithShallow(undefined)).to.equal(undefined);
+ done();
+ });
+
+ it('deep clones except for listed keys (including missing keys)', function (done) {
+
+ var source = {
+ a: {
+ b: 5
+ },
+ c: {
+ d: 6
+ }
+ };
+
+ var copy = Hoek.cloneWithShallow(source, ['c', 'v']);
+ expect(copy).to.deep.equal(source);
+ expect(copy).to.not.equal(source);
+ expect(copy.a).to.not.equal(source.a);
+ expect(copy.b).to.equal(source.b);
+ done();
+ });
+});
+
+describe('applyToDefaultsWithShallow()', function () {
+
+ it('shallow copies the listed keys from options without merging', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5,
+ e: 3
+ },
+ c: {
+ d: 7,
+ g: 1
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ d: 6,
+ f: 7
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['a']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { d: 6, g: 1, f: 7 } });
+ expect(merged.a).to.equal(options.a);
+ expect(merged.a).to.not.equal(defaults.a);
+ expect(merged.c).to.not.equal(options.c);
+ expect(merged.c).to.not.equal(defaults.c);
+ done();
+ });
+
+ it('shallow copies the nested keys (override)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ },
+ c: {
+ d: 7,
+ g: 1
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ d: 6,
+ g: {
+ h: 8
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { d: 6, g: { h: 8 } } });
+ expect(merged.c.g).to.equal(options.c.g);
+ done();
+ });
+
+ it('shallow copies the nested keys (missing)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ h: 8
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
+ expect(merged.c.g).to.equal(options.c.g);
+ done();
+ });
+
+ it('shallow copies the nested keys (override)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ },
+ c: {
+ g: {
+ d: 7
+ }
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ h: 8
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
+ expect(merged.c.g).to.equal(options.c.g);
+ done();
+ });
+
+ it('shallow copies the nested keys (deeper)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ r: {
+ h: 8
+ }
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g.r']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
+ expect(merged.c.g.r).to.equal(options.c.g.r);
+ done();
+ });
+
+ it('shallow copies the nested keys (not present)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ r: {
+ h: 8
+ }
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['x.y']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
+ done();
+ });
+
+ it('shallow copies the listed keys in the defaults', function (done) {
+
+ var defaults = {
+ a: {
+ b: 1
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, {}, ['a']);
+ expect(merged.a).to.equal(defaults.a);
+ done();
+ });
+
+ it('shallow copies the listed keys in the defaults (true)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 1
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, true, ['a']);
+ expect(merged.a).to.equal(defaults.a);
+ done();
+ });
+
+ it('returns null on false', function (done) {
+
+ var defaults = {
+ a: {
+ b: 1
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, false, ['a']);
+ expect(merged).to.equal(null);
+ done();
+ });
+
+ it('throws on missing defaults', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow(null, {}, ['a']);
+ }).to.throw('Invalid defaults value: must be an object');
+ done();
+ });
+
+ it('throws on invalid defaults', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow('abc', {}, ['a']);
+ }).to.throw('Invalid defaults value: must be an object');
+ done();
+ });
+
+ it('throws on invalid options', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow({}, 'abc', ['a']);
+ }).to.throw('Invalid options value: must be true, falsy or an object');
+ done();
+ });
+
+ it('throws on missing keys', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow({}, true);
+ }).to.throw('Invalid keys');
+ done();
+ });
+
+ it('throws on invalid keys', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow({}, true, 'a');
+ }).to.throw('Invalid keys');
+ done();
+ });
+});
+
+describe('deepEqual()', function () {
+
+ it('compares simple values', function (done) {
+
+ expect(Hoek.deepEqual('x', 'x')).to.be.true();
+ expect(Hoek.deepEqual('x', 'y')).to.be.false();
+ expect(Hoek.deepEqual('x1', 'x')).to.be.false();
+ expect(Hoek.deepEqual(-0, +0)).to.be.false();
+ expect(Hoek.deepEqual(-0, -0)).to.be.true();
+ expect(Hoek.deepEqual(+0, +0)).to.be.true();
+ expect(Hoek.deepEqual(+0, -0)).to.be.false();
+ expect(Hoek.deepEqual(1, 1)).to.be.true();
+ expect(Hoek.deepEqual(0, 0)).to.be.true();
+ expect(Hoek.deepEqual(-1, 1)).to.be.false();
+ expect(Hoek.deepEqual(NaN, 0)).to.be.false();
+ expect(Hoek.deepEqual(NaN, NaN)).to.be.true();
+ done();
+ });
+
+ it('compares different types', function (done) {
+
+ expect(Hoek.deepEqual([], 5)).to.be.false();
+ expect(Hoek.deepEqual(5, [])).to.be.false();
+ expect(Hoek.deepEqual({}, null)).to.be.false();
+ expect(Hoek.deepEqual(null, {})).to.be.false();
+ expect(Hoek.deepEqual('abc', {})).to.be.false();
+ expect(Hoek.deepEqual({}, 'abc')).to.be.false();
+ done();
+ });
+
+ it('compares empty structures', function (done) {
+
+ expect(Hoek.deepEqual([], [])).to.be.true();
+ expect(Hoek.deepEqual({}, {})).to.be.true();
+ expect(Hoek.deepEqual([], {})).to.be.false();
+ done();
+ });
+
+ it('compares empty arguments object', function (done) {
+
+ var compare = function () {
+
+ expect(Hoek.deepEqual([], arguments)).to.be.false();
+ };
+
+ compare();
+ done();
+ });
+
+ it('compares empty arguments objects', function (done) {
+
+ var compare = function () {
+
+ var arg1 = arguments;
+
+ var inner = function () {
+
+ expect(Hoek.deepEqual(arg1, arguments)).to.be.false(); // callee is not the same
+ };
+
+ inner();
+ };
+
+ compare();
+ done();
+ });
+
+ it('compares dates', function (done) {
+
+ expect(Hoek.deepEqual(new Date(2015, 1, 1), new Date(2015, 1, 1))).to.be.true();
+ expect(Hoek.deepEqual(new Date(100), new Date(101))).to.be.false();
+ expect(Hoek.deepEqual(new Date(), {})).to.be.false();
+ done();
+ });
+
+ it('compares regular expressions', function (done) {
+
+ expect(Hoek.deepEqual(/\s/, new RegExp('\\\s'))).to.be.true();
+ expect(Hoek.deepEqual(/\s/g, /\s/g)).to.be.true();
+ expect(Hoek.deepEqual(/a/, {})).to.be.false();
+ expect(Hoek.deepEqual(/\s/g, /\s/i)).to.be.false();
+ expect(Hoek.deepEqual(/a/g, /b/g)).to.be.false();
+ done();
+ });
+
+ it('compares arrays', function (done) {
+
+ expect(Hoek.deepEqual([[1]], [[1]])).to.be.true();
+ expect(Hoek.deepEqual([1, 2, 3], [1, 2, 3])).to.be.true();
+ expect(Hoek.deepEqual([1, 2, 3], [1, 3, 2])).to.be.false();
+ expect(Hoek.deepEqual([1, 2, 3], [1, 2])).to.be.false();
+ expect(Hoek.deepEqual([1], [1])).to.be.true();
+ done();
+ });
+
+ it('compares buffers', function (done) {
+
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2, 3]))).to.be.true();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 3, 2]))).to.be.false();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2]))).to.be.false();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), {})).to.be.false();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), [1, 2, 3])).to.be.false();
+ done();
+ });
+
+ it('compares objects', function (done) {
+
+ expect(Hoek.deepEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 })).to.be.true();
+ expect(Hoek.deepEqual({ foo: 'bar' }, { foo: 'baz' })).to.be.false();
+ expect(Hoek.deepEqual({ foo: { bar: 'foo' } }, { foo: { bar: 'baz' } })).to.be.false();
+ done();
+ });
+
+ it('handles circular dependency', function (done) {
+
+ var a = {};
+ a.x = a;
+
+ var b = Hoek.clone(a);
+ expect(Hoek.deepEqual(a, b)).to.be.true();
+ done();
+ });
+
+ it('compares an object with property getter without executing it', function (done) {
+
+ var obj = {};
+ var value = 1;
+ var execCount = 0;
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ ++execCount;
+ return value;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(Hoek.deepEqual(obj, copy)).to.be.true();
+ expect(execCount).to.equal(0);
+ expect(copy.test).to.equal(1);
+ expect(execCount).to.equal(1);
+ done();
+ });
+
+ it('compares objects with property getters', function (done) {
+
+ var obj = {};
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ return 1;
+ }
+ });
+
+ var ref = {};
+ Object.defineProperty(ref, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ return 2;
+ }
+ });
+
+ expect(Hoek.deepEqual(obj, ref)).to.be.false();
+ done();
+ });
+
+ it('compares object prototypes', function (done) {
+
+ var Obj = function () {
+
+ this.a = 5;
+ };
+
+ Obj.prototype.b = function () {
+
+ return this.a;
+ };
+
+ var Ref = function () {
+
+ this.a = 5;
+ };
+
+ Ref.prototype.b = function () {
+
+ return this.a;
+ };
+
+ expect(Hoek.deepEqual(new Obj(), new Ref())).to.be.false();
+ expect(Hoek.deepEqual(new Obj(), new Obj())).to.be.true();
+ expect(Hoek.deepEqual(new Ref(), new Ref())).to.be.true();
+ done();
+ });
+
+ it('compares plain objects', function (done) {
+
+ var a = Object.create(null);
+ var b = Object.create(null);
+
+ a.b = 'c';
+ b.b = 'c';
+
+ expect(Hoek.deepEqual(a, b)).to.be.true();
+ expect(Hoek.deepEqual(a, { b: 'c' })).to.be.false();
+ done();
+ });
+
+ it('compares an object with an empty object', function (done) {
+
+ var a = { a: 1, b: 2 };
+
+ expect(Hoek.deepEqual({}, a)).to.be.false();
+ expect(Hoek.deepEqual(a, {})).to.be.false();
+ done();
+ });
+
+ it('compares an object ignoring the prototype', function (done) {
+
+ var a = Object.create(null);
+ var b = {};
+
+ expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
+ done();
+ });
+
+ it('compares an object ignoring the prototype recursively', function (done) {
+
+ var a = [Object.create(null)];
+ var b = [{}];
+
+ expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
+ done();
+ });
+});
+
+describe('unique()', function () {
+
+ it('ensures uniqueness within array of objects based on subkey', function (done) {
+
+ var a = Hoek.unique(dupsArray, 'x');
+ expect(a).to.deep.equal(reducedDupsArray);
+ done();
+ });
+
+ it('removes duplicated without key', function (done) {
+
+ expect(Hoek.unique([1, 2, 3, 4, 2, 1, 5])).to.deep.equal([1, 2, 3, 4, 5]);
+ done();
+ });
+});
+
+describe('mapToObject()', function () {
+
+ it('returns null on null array', function (done) {
+
+ var a = Hoek.mapToObject(null);
+ expect(a).to.equal(null);
+ done();
+ });
+
+ it('converts basic array to existential object', function (done) {
+
+ var keys = [1, 2, 3, 4];
+ var a = Hoek.mapToObject(keys);
+ for (var i in keys) {
+ expect(a[keys[i]]).to.equal(true);
+ }
+ done();
+ });
+
+ it('converts array of objects to existential object', function (done) {
+
+ var keys = [{ x: 1 }, { x: 2 }, { x: 3 }, { y: 4 }];
+ var subkey = 'x';
+ var a = Hoek.mapToObject(keys, subkey);
+ expect(a).to.deep.equal({ 1: true, 2: true, 3: true });
+ done();
+ });
+});
+
+describe('intersect()', function () {
+
+ it('returns the common objects of two arrays', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [5, 4, 5, 6, 7];
+ var common = Hoek.intersect(array1, array2);
+ expect(common.length).to.equal(2);
+ done();
+ });
+
+ it('returns just the first common object of two arrays', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [5, 4, 5, 6, 7];
+ var common = Hoek.intersect(array1, array2, true);
+ expect(common).to.equal(5);
+ done();
+ });
+
+ it('returns null when no common and returning just the first common object of two arrays', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [6, 7];
+ var common = Hoek.intersect(array1, array2, true);
+ expect(common).to.equal(null);
+ done();
+ });
+
+ it('returns an empty array if either input is null', function (done) {
+
+ expect(Hoek.intersect([1], null).length).to.equal(0);
+ expect(Hoek.intersect(null, [1]).length).to.equal(0);
+ done();
+ });
+
+ it('returns the common objects of object and array', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [5, 4, 5, 6, 7];
+ var common = Hoek.intersect(Hoek.mapToObject(array1), array2);
+ expect(common.length).to.equal(2);
+ done();
+ });
+});
+
+describe('contain()', function () {
+
+ it('tests strings', function (done) {
+
+ expect(Hoek.contain('abc', 'ab')).to.be.true();
+ expect(Hoek.contain('abc', 'abc', { only: true })).to.be.true();
+ expect(Hoek.contain('aaa', 'a', { only: true })).to.be.true();
+ expect(Hoek.contain('abc', 'b', { once: true })).to.be.true();
+ expect(Hoek.contain('abc', ['a', 'c'])).to.be.true();
+ expect(Hoek.contain('abc', ['a', 'd'], { part: true })).to.be.true();
+
+ expect(Hoek.contain('abc', 'ac')).to.be.false();
+ expect(Hoek.contain('abcd', 'abc', { only: true })).to.be.false();
+ expect(Hoek.contain('aab', 'a', { only: true })).to.be.false();
+ expect(Hoek.contain('abb', 'b', { once: true })).to.be.false();
+ expect(Hoek.contain('abc', ['a', 'd'])).to.be.false();
+ expect(Hoek.contain('abc', ['ab', 'bc'])).to.be.false(); // Overlapping values not supported
+ done();
+ });
+
+ it('tests arrays', function (done) {
+
+ expect(Hoek.contain([1, 2, 3], 1)).to.be.true();
+ expect(Hoek.contain([{ a: 1 }], { a: 1 }, { deep: true })).to.be.true();
+ expect(Hoek.contain([1, 2, 3], [1, 2])).to.be.true();
+ expect(Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true })).to.be.true();
+ expect(Hoek.contain([1, 1, 2], [1, 2], { only: true })).to.be.true();
+ expect(Hoek.contain([1, 2], [1, 2], { once: true })).to.be.true();
+ expect(Hoek.contain([1, 2, 3], [1, 4], { part: true })).to.be.true();
+ expect(Hoek.contain([[1], [2]], [[1]], { deep: true })).to.be.true();
+
+ expect(Hoek.contain([1, 2, 3], 4)).to.be.false();
+ expect(Hoek.contain([{ a: 1 }], { a: 2 }, { deep: true })).to.be.false();
+ expect(Hoek.contain([{ a: 1 }], { a: 1 })).to.be.false();
+ expect(Hoek.contain([1, 2, 3], [4, 5])).to.be.false();
+ expect(Hoek.contain([[3], [2]], [[1]])).to.be.false();
+ expect(Hoek.contain([[1], [2]], [[1]])).to.be.false();
+ expect(Hoek.contain([{ a: 1 }], [{ a: 2 }], { deep: true })).to.be.false();
+ expect(Hoek.contain([1, 3, 2], [1, 2], { only: true })).to.be.false();
+ expect(Hoek.contain([1, 2, 2], [1, 2], { once: true })).to.be.false();
+ expect(Hoek.contain([0, 2, 3], [1, 4], { part: true })).to.be.false();
+ done();
+ });
+
+ it('tests objects', function (done) {
+
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'a')).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'c'])).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'b', 'c'], { only: true })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1 })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, c: 3 })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }, { only: true })).to.be.true();
+ expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: false })).to.be.false();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: false })).to.be.true();
+
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'd')).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'd'])).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3, d: 4 }, ['a', 'b', 'c'], { only: true })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 2 })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 2, b: 2 }, { part: true })).to.be.false(); // part does not ignore bad value
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 3 })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 }, { only: true })).to.be.false();
+ expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: false })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: false })).to.be.false();
+
+ // Getter check
+ var Foo = function (bar) {
+
+ this.bar = bar;
+ };
+
+ Object.defineProperty(Foo.prototype, 'baz', {
+ enumerable: true,
+ get: function () {
+
+ return this.bar;
+ }
+ });
+
+ expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: false })).to.be.false();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: true })).to.be.true();
+
+ done();
+ });
+});
+
+describe('flatten()', function () {
+
+ it('returns a flat array', function (done) {
+
+ var result = Hoek.flatten([1, 2, [3, 4, [5, 6], [7], 8], [9], [10, [11, 12]], 13]);
+ expect(result.length).to.equal(13);
+ expect(result).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
+ done();
+ });
+});
+
+describe('reach()', function () {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1,
+ e: 2
+ },
+ f: 'hello'
+ },
+ g: {
+ h: 3
+ }
+ },
+ i: function () { },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ obj.i.x = 5;
+
+ it('returns first value of array', function (done) {
+
+ expect(Hoek.reach(obj, 'k.0')).to.equal(4);
+ done();
+ });
+
+ it('returns last value of array using negative index', function (done) {
+
+ expect(Hoek.reach(obj, 'k.-2')).to.equal(9);
+ done();
+ });
+
+ it('returns a valid member', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.c.d')).to.equal(1);
+ done();
+ });
+
+ it('returns a valid member with separator override', function (done) {
+
+ expect(Hoek.reach(obj, 'a/b/c/d', '/')).to.equal(1);
+ done();
+ });
+
+ it('returns undefined on null object', function (done) {
+
+ expect(Hoek.reach(null, 'a.b.c.d')).to.equal(undefined);
+ done();
+ });
+
+ it('returns undefined on missing object member', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.c.d.x')).to.equal(undefined);
+ done();
+ });
+
+ it('returns undefined on missing function member', function (done) {
+
+ expect(Hoek.reach(obj, 'i.y', { functions: true })).to.equal(undefined);
+ done();
+ });
+
+ it('throws on missing member in strict mode', function (done) {
+
+ expect(function () {
+
+ Hoek.reach(obj, 'a.b.c.o.x', { strict: true });
+ }).to.throw('Missing segment o in reach path a.b.c.o.x');
+
+ done();
+ });
+
+ it('returns undefined on invalid member', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.c.d-.x')).to.equal(undefined);
+ done();
+ });
+
+ it('returns function member', function (done) {
+
+ expect(typeof Hoek.reach(obj, 'i')).to.equal('function');
+ done();
+ });
+
+ it('returns function property', function (done) {
+
+ expect(Hoek.reach(obj, 'i.x')).to.equal(5);
+ done();
+ });
+
+ it('returns null', function (done) {
+
+ expect(Hoek.reach(obj, 'j')).to.equal(null);
+ done();
+ });
+
+ it('throws on function property when functions not allowed', function (done) {
+
+ expect(function () {
+
+ Hoek.reach(obj, 'i.x', { functions: false });
+ }).to.throw('Invalid segment x in reach path i.x');
+
+ done();
+ });
+
+ it('will return a default value if property is not found', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.q', { default: 'defaultValue' })).to.equal('defaultValue');
+ done();
+ });
+
+ it('will return a default value if path is not found', function (done) {
+
+ expect(Hoek.reach(obj, 'q', { default: 'defaultValue' })).to.equal('defaultValue');
+ done();
+ });
+
+ it('allows a falsey value to be used as the default value', function (done) {
+
+ expect(Hoek.reach(obj, 'q', { default: '' })).to.equal('');
+ done();
+ });
+});
+
+describe('reachTemplate()', function () {
+
+ it('applies object to template', function (done) {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1
+ }
+ }
+ },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ var template = '{k.0}:{k.-2}:{a.b.c.d}:{x.y}:{j}';
+
+ expect(Hoek.reachTemplate(obj, template)).to.equal('4:9:1::');
+ done();
+ });
+
+ it('applies object to template (options)', function (done) {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1
+ }
+ }
+ },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ var template = '{k/0}:{k/-2}:{a/b/c/d}:{x/y}:{j}';
+
+ expect(Hoek.reachTemplate(obj, template, '/')).to.equal('4:9:1::');
+ done();
+ });
+});
+
+describe('callStack()', function () {
+
+ it('returns the full call stack', function (done) {
+
+ var stack = Hoek.callStack();
+ expect(stack[0][0]).to.contain('index.js');
+ expect(stack[0][2]).to.equal(26);
+ done();
+ });
+});
+
+describe('displayStack ()', function () {
+
+ it('returns the full call stack for display', function (done) {
+
+ var stack = Hoek.displayStack();
+ expect(stack[0]).to.contain(Path.normalize('/test/index.js') + ':');
+ done();
+ });
+
+ it('includes constructor functions correctly', function (done) {
+
+ var Something = function (next) {
+
+ next();
+ };
+
+ var something = new Something(function () {
+
+ var stack = Hoek.displayStack();
+ expect(stack[1]).to.contain('new Something');
+ done();
+ });
+ });
+});
+
+describe('abort()', function () {
+
+ it('exits process when not in test mode', function (done) {
+
+ var env = process.env.NODE_ENV;
+ var write = process.stdout.write;
+ var exit = process.exit;
+
+ process.env.NODE_ENV = 'nottatest';
+ process.stdout.write = function () { };
+ process.exit = function (state) {
+
+ process.exit = exit;
+ process.env.NODE_ENV = env;
+ process.stdout.write = write;
+
+ expect(state).to.equal(1);
+ done();
+ };
+
+ Hoek.abort('Boom');
+ });
+
+ it('throws when not in test mode and abortThrow is true', function (done) {
+
+ var env = process.env.NODE_ENV;
+ process.env.NODE_ENV = 'nottatest';
+ Hoek.abortThrow = true;
+
+ var fn = function () {
+
+ Hoek.abort('my error message');
+ };
+
+ expect(fn).to.throw('my error message');
+ Hoek.abortThrow = false;
+ process.env.NODE_ENV = env;
+
+ done();
+ });
+
+ it('respects hideStack argument', function (done) {
+
+ var env = process.env.NODE_ENV;
+ var write = process.stdout.write;
+ var exit = process.exit;
+ var output = '';
+
+ process.exit = function () { };
+ process.env.NODE_ENV = '';
+ process.stdout.write = function (message) {
+
+ output = message;
+ };
+
+ Hoek.abort('my error message', true);
+
+ process.env.NODE_ENV = env;
+ process.stdout.write = write;
+ process.exit = exit;
+
+ expect(output).to.equal('ABORT: my error message\n\t\n');
+
+ done();
+ });
+
+ it('throws in test mode', function (done) {
+
+ var env = process.env.NODE_ENV;
+ process.env.NODE_ENV = 'test';
+
+ expect(function () {
+
+ Hoek.abort('my error message', true);
+ }).to.throw('my error message');
+
+ process.env.NODE_ENV = env;
+ done();
+ });
+
+ it('throws in test mode with default message', function (done) {
+
+ var env = process.env.NODE_ENV;
+ process.env.NODE_ENV = 'test';
+
+ expect(function () {
+
+ Hoek.abort('', true);
+ }).to.throw('Unknown error');
+
+ process.env.NODE_ENV = env;
+ done();
+ });
+
+ it('defaults to showing stack', function (done) {
+
+ var env = process.env.NODE_ENV;
+ var write = process.stdout.write;
+ var exit = process.exit;
+ var output = '';
+
+ process.exit = function () { };
+ process.env.NODE_ENV = '';
+ process.stdout.write = function (message) {
+
+ output = message;
+ };
+
+ Hoek.abort('my error message');
+
+ process.env.NODE_ENV = env;
+ process.stdout.write = write;
+ process.exit = exit;
+
+ expect(output).to.contain('index.js');
+
+ done();
+ });
+});
+
+describe('assert()', function () {
+
+ it('throws an Error when using assert in a test', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'my error message');
+ };
+
+ expect(fn).to.throw('my error message');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with no message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false);
+ };
+
+ expect(fn).to.throw('Unknown error');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with multipart message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', 'my message');
+ };
+
+ expect(fn).to.throw('This is my message');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with multipart message (empty)', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', '', 'my message');
+ };
+
+ expect(fn).to.throw('This is my message');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with object message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', { spinal: 'tap' });
+ };
+
+ expect(fn).to.throw('This is {"spinal":"tap"}');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with multipart string and error messages', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', new Error('spinal'), new Error('tap'));
+ };
+
+ expect(fn).to.throw('This is spinal tap');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with error object message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, new Error('This is spinal tap'));
+ };
+
+ expect(fn).to.throw('This is spinal tap');
+ done();
+ });
+
+ it('throws the same Error that is passed to it if there is only one error passed', function (done) {
+
+ var error = new Error('ruh roh');
+ var error2 = new Error('ruh roh');
+
+ var fn = function () {
+
+ Hoek.assert(false, error);
+ };
+
+ try {
+ fn();
+ } catch (err) {
+ expect(error).to.equal(error); // should be the same reference
+ expect(error).to.not.equal(error2); // error with the same message should not match
+ }
+
+ done();
+ });
+});
+
+describe('Timer', function () {
+
+ it('returns time elapsed', function (done) {
+
+ var timer = new Hoek.Timer();
+ setTimeout(function () {
+
+ expect(timer.elapsed()).to.be.above(9);
+ done();
+ }, 12);
+ });
+});
+
+describe('Bench', function () {
+
+ it('returns time elapsed', function (done) {
+
+ var timer = new Hoek.Bench();
+ setTimeout(function () {
+
+ expect(timer.elapsed()).to.be.above(9);
+ done();
+ }, 12);
+ });
+});
+
+describe('escapeRegex()', function () {
+
+ it('escapes all special regular expression characters', function (done) {
+
+ var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,');
+ expect(a).to.equal('4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s\\,');
+ done();
+ });
+});
+
+describe('Base64Url', function () {
+
+ var base64str = 'AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w';
+ var str = unescape('%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF');
+
+ describe('base64urlEncode()', function () {
+
+ it('should base64 URL-safe a string', function (done) {
+
+ expect(Hoek.base64urlEncode(str)).to.equal(base64str);
+ done();
+ });
+
+ it('encodes a buffer', function (done) {
+
+ expect(Hoek.base64urlEncode(new Buffer(str, 'binary'))).to.equal(base64str);
+ done();
+ });
+
+ it('should base64 URL-safe a hex string', function (done) {
+
+ var buffer = new Buffer(str, 'binary');
+ expect(Hoek.base64urlEncode(buffer.toString('hex'), 'hex')).to.equal(base64str);
+ done();
+ });
+
+ it('works on larger input strings', function (done) {
+
+ var input = Fs.readFileSync(Path.join(__dirname, 'index.js')).toString();
+ var encoded = Hoek.base64urlEncode(input);
+
+ expect(encoded).to.not.contain('+');
+ expect(encoded).to.not.contain('/');
+
+ var decoded = Hoek.base64urlDecode(encoded);
+
+ expect(decoded).to.equal(input);
+ done();
+ });
+ });
+
+ describe('base64urlDecode()', function () {
+
+ it('should un-base64 URL-safe a string', function (done) {
+
+ expect(Hoek.base64urlDecode(base64str)).to.equal(str);
+ done();
+ });
+
+ it('should un-base64 URL-safe a string into hex', function (done) {
+
+ expect(Hoek.base64urlDecode(base64str, 'hex')).to.equal(new Buffer(str, 'binary').toString('hex'));
+ done();
+ });
+
+ it('should un-base64 URL-safe a string and return a buffer', function (done) {
+
+ var buf = Hoek.base64urlDecode(base64str, 'buffer');
+ expect(buf instanceof Buffer).to.equal(true);
+ expect(buf.toString('binary')).to.equal(str);
+ done();
+ });
+
+ it('returns error on undefined input', function (done) {
+
+ expect(Hoek.base64urlDecode().message).to.exist();
+ done();
+ });
+
+ it('returns error on invalid input', function (done) {
+
+ expect(Hoek.base64urlDecode('*').message).to.exist();
+ done();
+ });
+ });
+});
+
+describe('escapeHeaderAttribute()', function () {
+
+ it('should not alter ascii values', function (done) {
+
+ var a = Hoek.escapeHeaderAttribute('My Value');
+ expect(a).to.equal('My Value');
+ done();
+ });
+
+ it('escapes all special HTTP header attribute characters', function (done) {
+
+ var a = Hoek.escapeHeaderAttribute('I said go!!!#"' + String.fromCharCode(92));
+ expect(a).to.equal('I said go!!!#\\"\\\\');
+ done();
+ });
+
+ it('throws on large unicode characters', function (done) {
+
+ var fn = function () {
+
+ Hoek.escapeHeaderAttribute('this is a test' + String.fromCharCode(500) + String.fromCharCode(300));
+ };
+
+ expect(fn).to.throw(Error);
+ done();
+ });
+
+ it('throws on CRLF to prevent response splitting', function (done) {
+
+ var fn = function () {
+
+ Hoek.escapeHeaderAttribute('this is a test\r\n');
+ };
+
+ expect(fn).to.throw(Error);
+ done();
+ });
+});
+
+describe('escapeHtml()', function () {
+
+ it('escapes all special HTML characters', function (done) {
+
+ var a = Hoek.escapeHtml('&<>"\'`');
+ expect(a).to.equal('&<>"'`');
+ done();
+ });
+
+ it('returns empty string on falsy input', function (done) {
+
+ var a = Hoek.escapeHtml('');
+ expect(a).to.equal('');
+ done();
+ });
+
+ it('returns unchanged string on no reserved input', function (done) {
+
+ var a = Hoek.escapeHtml('abc');
+ expect(a).to.equal('abc');
+ done();
+ });
+});
+
+describe('nextTick()', function () {
+
+ it('calls the provided callback on nextTick', function (done) {
+
+ var a = 0;
+
+ var inc = function (step, next) {
+
+ a += step;
+ next();
+ };
+
+ var ticked = Hoek.nextTick(inc);
+
+ ticked(5, function () {
+
+ expect(a).to.equal(6);
+ done();
+ });
+
+ expect(a).to.equal(0);
+ inc(1, function () {
+
+ expect(a).to.equal(1);
+ });
+ });
+});
+
+describe('once()', function () {
+
+ it('allows function to only execute once', function (done) {
+
+ var gen = 0;
+ var add = function (x) {
+
+ gen += x;
+ };
+
+ add(5);
+ expect(gen).to.equal(5);
+ add = Hoek.once(add);
+ add(5);
+ expect(gen).to.equal(10);
+ add(5);
+ expect(gen).to.equal(10);
+ done();
+ });
+
+ it('double once wraps one time', function (done) {
+
+ var method = function () { };
+ method = Hoek.once(method);
+ method.x = 1;
+ method = Hoek.once(method);
+ expect(method.x).to.equal(1);
+ done();
+ });
+});
+
+describe('isAbsoltePath()', function () {
+
+ it('identifies if path is absolute on Unix without node support', { parallel: false }, function (done) {
+
+ var orig = Path.isAbsolute;
+ Path.isAbsolute = undefined;
+
+ expect(Hoek.isAbsolutePath('')).to.equal(false);
+ expect(Hoek.isAbsolutePath('a')).to.equal(false);
+ expect(Hoek.isAbsolutePath('./a')).to.equal(false);
+ expect(Hoek.isAbsolutePath('/a')).to.equal(true);
+ expect(Hoek.isAbsolutePath('/')).to.equal(true);
+
+ Path.isAbsolute = orig;
+
+ done();
+ });
+
+ it('identifies if path is absolute with fake node support', { parallel: false }, function (done) {
+
+ var orig = Path.isAbsolute;
+ Path.isAbsolute = function (path) {
+
+ return path[0] === '/';
+ };
+
+ expect(Hoek.isAbsolutePath('', 'linux')).to.equal(false);
+ expect(Hoek.isAbsolutePath('a', 'linux')).to.equal(false);
+ expect(Hoek.isAbsolutePath('./a', 'linux')).to.equal(false);
+ expect(Hoek.isAbsolutePath('/a', 'linux')).to.equal(true);
+ expect(Hoek.isAbsolutePath('/', 'linux')).to.equal(true);
+
+ Path.isAbsolute = orig;
+
+ done();
+ });
+
+ it('identifies if path is absolute on Windows without node support', { parallel: false }, function (done) {
+
+ var orig = Path.isAbsolute;
+ Path.isAbsolute = undefined;
+
+ expect(Hoek.isAbsolutePath('//server/file', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('//server/file', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('\\\\server\\file', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('C:/Users/', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('C:\\Users\\', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('C:cwd/another', 'win32')).to.equal(false);
+ expect(Hoek.isAbsolutePath('C:cwd\\another', 'win32')).to.equal(false);
+ expect(Hoek.isAbsolutePath('directory/directory', 'win32')).to.equal(false);
+ expect(Hoek.isAbsolutePath('directory\\directory', 'win32')).to.equal(false);
+
+ Path.isAbsolute = orig;
+
+ done();
+ });
+});
+
+describe('isInteger()', function () {
+
+ it('validates integers', function (done) {
+
+ expect(Hoek.isInteger(0)).to.equal(true);
+ expect(Hoek.isInteger(1)).to.equal(true);
+ expect(Hoek.isInteger(1394035612500)).to.equal(true);
+ expect(Hoek.isInteger('0')).to.equal(false);
+ expect(Hoek.isInteger(1.0)).to.equal(true);
+ expect(Hoek.isInteger(1.1)).to.equal(false);
+ done();
+ });
+});
+
+describe('ignore()', function () {
+
+ it('exists', function (done) {
+
+ expect(Hoek.ignore).to.exist();
+ expect(typeof Hoek.ignore).to.equal('function');
+ done();
+ });
+});
+
+describe('inherits()', function () {
+
+ it('exists', function (done) {
+
+ expect(Hoek.inherits).to.exist();
+ expect(typeof Hoek.inherits).to.equal('function');
+ done();
+ });
+});
+
+describe('format()', function () {
+
+ it('exists', function (done) {
+
+ expect(Hoek.format).to.exist();
+ expect(typeof Hoek.format).to.equal('function');
+ done();
+ });
+
+ it('is a reference to Util.format', function (done) {
+
+ expect(Hoek.format('hello %s', 'world')).to.equal('hello world');
+ done();
+ });
+});
+
+describe('transform()', function () {
+
+ var source = {
+ address: {
+ one: '123 main street',
+ two: 'PO Box 1234'
+ },
+ zip: {
+ code: 3321232,
+ province: null
+ },
+ title: 'Warehouse',
+ state: 'CA'
+ };
+
+ it('transforms an object based on the input object', function (done) {
+
+ var result = Hoek.transform(source, {
+ 'person.address.lineOne': 'address.one',
+ 'person.address.lineTwo': 'address.two',
+ 'title': 'title',
+ 'person.address.region': 'state',
+ 'person.address.zip': 'zip.code',
+ 'person.address.location': 'zip.province'
+ });
+
+ expect(result).to.deep.equal({
+ person: {
+ address: {
+ lineOne: '123 main street',
+ lineTwo: 'PO Box 1234',
+ region: 'CA',
+ zip: 3321232,
+ location: null
+ }
+ },
+ title: 'Warehouse'
+ });
+
+ done();
+ });
+
+ it('uses the reach options passed into it', function (done) {
+
+ var schema = {
+ 'person.address.lineOne': 'address-one',
+ 'person.address.lineTwo': 'address-two',
+ 'title': 'title',
+ 'person.address.region': 'state',
+ 'person.prefix': 'person-title',
+ 'person.zip': 'zip-code'
+ };
+ var options = {
+ separator: '-',
+ default: 'unknown'
+ };
+ var result = Hoek.transform(source, schema, options);
+
+ expect(result).to.deep.equal({
+ person: {
+ address: {
+ lineOne: '123 main street',
+ lineTwo: 'PO Box 1234',
+ region: 'CA'
+ },
+ prefix: 'unknown',
+ zip: 3321232
+ },
+ title: 'Warehouse'
+ });
+
+ done();
+ });
+
+ it('works to create shallow objects', function (done) {
+
+ var result = Hoek.transform(source, {
+ lineOne: 'address.one',
+ lineTwo: 'address.two',
+ title: 'title',
+ region: 'state',
+ province: 'zip.province'
+ });
+
+ expect(result).to.deep.equal({
+ lineOne: '123 main street',
+ lineTwo: 'PO Box 1234',
+ title: 'Warehouse',
+ region: 'CA',
+ province: null
+ });
+
+ done();
+ });
+
+ it('only allows strings in the map', function (done) {
+
+ expect(function () {
+
+ var result = Hoek.transform(source, {
+ lineOne: {}
+ });
+ }).to.throw('All mappings must be "." delineated strings');
+
+ done();
+ });
+
+ it('throws an error on invalid arguments', function (done) {
+
+ expect(function () {
+
+ var result = Hoek.transform(NaN, {});
+ }).to.throw('Invalid source object: must be null, undefined, or an object');
+
+ done();
+ });
+
+ it('is safe to pass null', function (done) {
+
+ var result = Hoek.transform(null, {});
+ expect(result).to.deep.equal({});
+
+ done();
+ });
+
+ it('is safe to pass undefined', function (done) {
+
+ var result = Hoek.transform(undefined, {});
+ expect(result).to.deep.equal({});
+
+ done();
+ });
+});
+
+describe('uniqueFilename()', function () {
+
+ it('generates a random file path', function (done) {
+
+ var result = Hoek.uniqueFilename('./test/modules');
+
+ expect(result).to.exist();
+ expect(result).to.be.a.string();
+ expect(result).to.contain('test/modules');
+ done();
+ });
+
+ it('is random enough to use in fast loops', function (done) {
+
+ var results = [];
+
+ for (var i = 0; i < 10; ++i) {
+ results[i] = Hoek.uniqueFilename('./test/modules');
+ }
+
+ var filter = results.filter(function (item, index, array) {
+
+ return array.indexOf(item) === index;
+ });
+
+ expect(filter.length).to.equal(10);
+ expect(results.length).to.equal(10);
+ done();
+
+ });
+
+ it('combines the random elements with a supplied character', function (done) {
+
+ var result = Hoek.uniqueFilename('./test', 'txt');
+
+ expect(result).to.contain('test/');
+ expect(result).to.contain('.txt');
+
+ done();
+ });
+
+ it('accepts extensions with a "." in it', function (done) {
+
+ var result = Hoek.uniqueFilename('./test', '.mp3');
+
+ expect(result).to.contain('test/');
+ expect(result).to.contain('.mp3');
+
+ done();
+ });
+});
+
+describe('stringify()', function (done) {
+
+ it('converts object to string', function (done) {
+
+ var obj = { a: 1 };
+ expect(Hoek.stringify(obj)).to.equal('{"a":1}');
+ done();
+ });
+
+ it('returns error in result string', function (done) {
+
+ var obj = { a: 1 };
+ obj.b = obj;
+ expect(Hoek.stringify(obj)).to.equal('[Cannot display object: Converting circular structure to JSON]');
+ done();
+ });
+});
+
+describe('shallow()', function (done) {
+
+ it('shallow copies an object', function (done) {
+
+ var obj = {
+ a: 5,
+ b: {
+ c: 6
+ }
+ };
+
+ var shallow = Hoek.shallow(obj);
+ expect(shallow).to.not.equal(obj);
+ expect(shallow).to.deep.equal(obj);
+ expect(shallow.b).to.equal(obj.b);
+ done();
+ });
+});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/test/modules/ignore.txt
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/test/modules/ignore.txt b/node_modules/wreck/node_modules/hoek/test/modules/ignore.txt
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/test/modules/test1.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/test/modules/test1.js b/node_modules/wreck/node_modules/hoek/test/modules/test1.js
new file mode 100755
index 0000000..fa4e06a
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/test/modules/test1.js
@@ -0,0 +1 @@
+exports.x = 1;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/test/modules/test2.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/test/modules/test2.js b/node_modules/wreck/node_modules/hoek/test/modules/test2.js
new file mode 100755
index 0000000..88e9166
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/test/modules/test2.js
@@ -0,0 +1 @@
+exports.y = 2;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/node_modules/hoek/test/modules/test3.js
----------------------------------------------------------------------
diff --git a/node_modules/wreck/node_modules/hoek/test/modules/test3.js b/node_modules/wreck/node_modules/hoek/test/modules/test3.js
new file mode 100755
index 0000000..670e724
--- /dev/null
+++ b/node_modules/wreck/node_modules/hoek/test/modules/test3.js
@@ -0,0 +1 @@
+exports.z = 3;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bd300fa9/node_modules/wreck/package.json
----------------------------------------------------------------------
diff --git a/node_modules/wreck/package.json b/node_modules/wreck/package.json
new file mode 100644
index 0000000..72e00b0
--- /dev/null
+++ b/node_modules/wreck/package.json
@@ -0,0 +1,61 @@
+{
+ "name": "wreck",
+ "description": "HTTP Client Utilities",
+ "version": "5.6.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hapijs/wreck.git"
+ },
+ "main": "lib/index",
+ "keywords": [
+ "utilities",
+ "http",
+ "client"
+ ],
+ "engines": {
+ "node": ">=0.10.30"
+ },
+ "dependencies": {
+ "hoek": "2.x.x",
+ "boom": "2.x.x"
+ },
+ "devDependencies": {
+ "lab": "5.x.x",
+ "code": "1.x.x"
+ },
+ "scripts": {
+ "test": "lab -t 100 -L -a code",
+ "test-cov-html": "lab -r html -o coverage.html -a code"
+ },
+ "license": "BSD-3-Clause",
+ "gitHead": "95536ed6aaf0eac90becb8240a173331ee3482a5",
+ "bugs": {
+ "url": "https://github.com/hapijs/wreck/issues"
+ },
+ "homepage": "https://github.com/hapijs/wreck#readme",
+ "_id": "wreck@5.6.0",
+ "_shasum": "059c079a33a59c96e05f3d534a51fd2268bd5149",
+ "_from": "wreck@*",
+ "_npmVersion": "2.9.1",
+ "_nodeVersion": "0.10.37",
+ "_npmUser": {
+ "name": "wyatt",
+ "email": "wpreul@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ {
+ "name": "wyatt",
+ "email": "wpreul@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "059c079a33a59c96e05f3d534a51fd2268bd5149",
+ "tarball": "http://registry.npmjs.org/wreck/-/wreck-5.6.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/wreck/-/wreck-5.6.0.tgz"
+}
[23/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/api_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/api_test.js b/node_modules/request/node_modules/tough-cookie/test/api_test.js
deleted file mode 100644
index b21326c..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/api_test.js
+++ /dev/null
@@ -1,372 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var async = require('async');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-var CookieJar = tough.CookieJar;
-
-
-var atNow = Date.now();
-
-function at(offset) {
- return {now: new Date(atNow + offset)};
-}
-
-vows
- .describe('API')
- .addBatch({
- "All defined": function () {
- assert.ok(Cookie);
- assert.ok(CookieJar);
- }
- })
- .addBatch({
- "Constructor": {
- topic: function () {
- return new Cookie({
- key: 'test',
- value: 'b',
- maxAge: 60
- });
- },
- 'check for key property': function (c) {
- assert.ok(c);
- assert.equal(c.key, 'test');
- },
- 'check for value property': function (c) {
- assert.equal(c.value, 'b');
- },
- 'check for maxAge': function (c) {
- assert.equal(c.maxAge, 60);
- },
- 'check for default values for unspecified properties': function (c) {
- assert.equal(c.expires, "Infinity");
- assert.equal(c.secure, false);
- assert.equal(c.httpOnly, false);
- }
- }
- })
- .addBatch({
- "expiry option": {
- topic: function () {
- var cb = this.callback;
- var cj = new CookieJar();
- cj.setCookie('near=expiry; Domain=example.com; Path=/; Max-Age=1', 'http://www.example.com', at(-1), function (err, cookie) {
-
- cb(err, {cj: cj, cookie: cookie});
- });
- },
- "set the cookie": function (t) {
- assert.ok(t.cookie, "didn't set?!");
- assert.equal(t.cookie.key, 'near');
- },
- "then, retrieving": {
- topic: function (t) {
- var cb = this.callback;
- setTimeout(function () {
- t.cj.getCookies('http://www.example.com', {http: true, expire: false}, function (err, cookies) {
- t.cookies = cookies;
- cb(err, t);
- });
- }, 2000);
- },
- "got the cookie": function (t) {
- assert.lengthOf(t.cookies, 1);
- assert.equal(t.cookies[0].key, 'near');
- }
- }
- }
- })
- .addBatch({
- "allPaths option": {
- topic: function () {
- var cj = new CookieJar();
- var tasks = [];
- tasks.push(cj.setCookie.bind(cj, 'nopath_dom=qq; Path=/; Domain=example.com', 'http://example.com', {}));
- tasks.push(cj.setCookie.bind(cj, 'path_dom=qq; Path=/foo; Domain=example.com', 'http://example.com', {}));
- tasks.push(cj.setCookie.bind(cj, 'nopath_host=qq; Path=/', 'http://www.example.com', {}));
- tasks.push(cj.setCookie.bind(cj, 'path_host=qq; Path=/foo', 'http://www.example.com', {}));
- tasks.push(cj.setCookie.bind(cj, 'other=qq; Path=/', 'http://other.example.com/', {}));
- tasks.push(cj.setCookie.bind(cj, 'other2=qq; Path=/foo', 'http://other.example.com/foo', {}));
- var cb = this.callback;
- async.parallel(tasks, function (err, results) {
- cb(err, {cj: cj, cookies: results});
- });
- },
- "all set": function (t) {
- assert.equal(t.cookies.length, 6);
- assert.ok(t.cookies.every(function (c) {
- return !!c
- }));
- },
- "getting without allPaths": {
- topic: function (t) {
- var cb = this.callback;
- var cj = t.cj;
- cj.getCookies('http://www.example.com/', {}, function (err, cookies) {
- cb(err, {cj: cj, cookies: cookies});
- });
- },
- "found just two cookies": function (t) {
- assert.equal(t.cookies.length, 2);
- },
- "all are path=/": function (t) {
- assert.ok(t.cookies.every(function (c) {
- return c.path === '/'
- }));
- },
- "no 'other' cookies": function (t) {
- assert.ok(!t.cookies.some(function (c) {
- return (/^other/).test(c.name)
- }));
- }
- },
- "getting without allPaths for /foo": {
- topic: function (t) {
- var cb = this.callback;
- var cj = t.cj;
- cj.getCookies('http://www.example.com/foo', {}, function (err, cookies) {
- cb(err, {cj: cj, cookies: cookies});
- });
- },
- "found four cookies": function (t) {
- assert.equal(t.cookies.length, 4);
- },
- "no 'other' cookies": function (t) {
- assert.ok(!t.cookies.some(function (c) {
- return (/^other/).test(c.name)
- }));
- }
- },
- "getting with allPaths:true": {
- topic: function (t) {
- var cb = this.callback;
- var cj = t.cj;
- cj.getCookies('http://www.example.com/', {allPaths: true}, function (err, cookies) {
- cb(err, {cj: cj, cookies: cookies});
- });
- },
- "found four cookies": function (t) {
- assert.equal(t.cookies.length, 4);
- },
- "no 'other' cookies": function (t) {
- assert.ok(!t.cookies.some(function (c) {
- return (/^other/).test(c.name)
- }));
- }
- }
- }
- })
- .addBatch({
- "Remove cookies": {
- topic: function () {
- var jar = new CookieJar();
- var cookie = Cookie.parse("a=b; Domain=example.com; Path=/");
- var cookie2 = Cookie.parse("a=b; Domain=foo.com; Path=/");
- var cookie3 = Cookie.parse("foo=bar; Domain=foo.com; Path=/");
- jar.setCookie(cookie, 'http://example.com/index.html', function () {
- });
- jar.setCookie(cookie2, 'http://foo.com/index.html', function () {
- });
- jar.setCookie(cookie3, 'http://foo.com/index.html', function () {
- });
- return jar;
- },
- "all from matching domain": function (jar) {
- jar.store.removeCookies('example.com', null, function (err) {
- assert(err == null);
-
- jar.store.findCookies('example.com', null, function (err, cookies) {
- assert(err == null);
- assert(cookies != null);
- assert(cookies.length === 0, 'cookie was not removed');
- });
-
- jar.store.findCookies('foo.com', null, function (err, cookies) {
- assert(err == null);
- assert(cookies != null);
- assert(cookies.length === 2, 'cookies should not have been removed');
- });
- });
- },
- "from cookie store matching domain and key": function (jar) {
- jar.store.removeCookie('foo.com', '/', 'foo', function (err) {
- assert(err == null);
-
- jar.store.findCookies('foo.com', null, function (err, cookies) {
- assert(err == null);
- assert(cookies != null);
- assert(cookies.length === 1, 'cookie was not removed correctly');
- assert(cookies[0].key === 'a', 'wrong cookie was removed');
- });
- });
- }
- }
- })
- .addBatch({
- "Synchronous CookieJar": {
- "setCookieSync": {
- topic: function () {
- var jar = new CookieJar();
- var cookie = Cookie.parse("a=b; Domain=example.com; Path=/");
- cookie = jar.setCookieSync(cookie, 'http://example.com/index.html');
- return cookie;
- },
- "returns a copy of the cookie": function (cookie) {
- assert.instanceOf(cookie, Cookie);
- }
- },
- "getCookiesSync": {
- topic: function () {
- var jar = new CookieJar();
- var url = 'http://example.com/index.html';
- jar.setCookieSync("a=b; Domain=example.com; Path=/", url);
- jar.setCookieSync("c=d; Domain=example.com; Path=/", url);
- return jar.getCookiesSync(url);
- },
- "returns the cookie array": function (err, cookies) {
- assert.ok(!err);
- assert.ok(Array.isArray(cookies));
- assert.lengthOf(cookies, 2);
- cookies.forEach(function (cookie) {
- assert.instanceOf(cookie, Cookie);
- });
- }
- },
-
- "getCookieStringSync": {
- topic: function () {
- var jar = new CookieJar();
- var url = 'http://example.com/index.html';
- jar.setCookieSync("a=b; Domain=example.com; Path=/", url);
- jar.setCookieSync("c=d; Domain=example.com; Path=/", url);
- return jar.getCookieStringSync(url);
- },
- "returns the cookie header string": function (err, str) {
- assert.ok(!err);
- assert.typeOf(str, 'string');
- }
- },
-
- "getSetCookieStringsSync": {
- topic: function () {
- var jar = new CookieJar();
- var url = 'http://example.com/index.html';
- jar.setCookieSync("a=b; Domain=example.com; Path=/", url);
- jar.setCookieSync("c=d; Domain=example.com; Path=/", url);
- return jar.getSetCookieStringsSync(url);
- },
- "returns the cookie header string": function (err, headers) {
- assert.ok(!err);
- assert.ok(Array.isArray(headers));
- assert.lengthOf(headers, 2);
- headers.forEach(function (header) {
- assert.typeOf(header, 'string');
- });
- }
- }
- }
- })
- .addBatch({
- "Synchronous API on async CookieJar": {
- topic: function () {
- return new tough.Store();
- },
- "setCookieSync": {
- topic: function (store) {
- var jar = new CookieJar(store);
- try {
- jar.setCookieSync("a=b", 'http://example.com/index.html');
- return false;
- } catch (e) {
- return e;
- }
- },
- "fails": function (err) {
- assert.instanceOf(err, Error);
- assert.equal(err.message,
- 'CookieJar store is not synchronous; use async API instead.');
- }
- },
- "getCookiesSync": {
- topic: function (store) {
- var jar = new CookieJar(store);
- try {
- jar.getCookiesSync('http://example.com/index.html');
- return false;
- } catch (e) {
- return e;
- }
- },
- "fails": function (err) {
- assert.instanceOf(err, Error);
- assert.equal(err.message,
- 'CookieJar store is not synchronous; use async API instead.');
- }
- },
- "getCookieStringSync": {
- topic: function (store) {
- var jar = new CookieJar(store);
- try {
- jar.getCookieStringSync('http://example.com/index.html');
- return false;
- } catch (e) {
- return e;
- }
- },
- "fails": function (err) {
- assert.instanceOf(err, Error);
- assert.equal(err.message,
- 'CookieJar store is not synchronous; use async API instead.');
- }
- },
- "getSetCookieStringsSync": {
- topic: function (store) {
- var jar = new CookieJar(store);
- try {
- jar.getSetCookieStringsSync('http://example.com/index.html');
- return false;
- } catch (e) {
- return e;
- }
- },
- "fails": function (err) {
- assert.instanceOf(err, Error);
- assert.equal(err.message,
- 'CookieJar store is not synchronous; use async API instead.');
- }
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js b/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js
deleted file mode 100644
index 689407b..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js
+++ /dev/null
@@ -1,468 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var async = require('async');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-var CookieJar = tough.CookieJar;
-
-var atNow = Date.now();
-
-function at(offset) {
- return {now: new Date(atNow + offset)};
-}
-
-vows
- .describe('CookieJar')
- .addBatch({
- "Setting a basic cookie": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=example.com; Path=/");
- assert.strictEqual(c.hostOnly, null);
- assert.instanceOf(c.creation, Date);
- assert.strictEqual(c.lastAccessed, null);
- c.creation = new Date(Date.now() - 10000);
- cj.setCookie(c, 'http://example.com/index.html', this.callback);
- },
- "works": function (c) {
- assert.instanceOf(c, Cookie)
- }, // C is for Cookie, good enough for me
- "gets timestamped": function (c) {
- assert.ok(c.creation);
- assert.ok(Date.now() - c.creation.getTime() < 5000); // recently stamped
- assert.ok(c.lastAccessed);
- assert.equal(c.creation, c.lastAccessed);
- assert.equal(c.TTL(), Infinity);
- assert.ok(!c.isPersistent());
- }
- },
- "Setting a no-path cookie": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=example.com");
- assert.strictEqual(c.hostOnly, null);
- assert.instanceOf(c.creation, Date);
- assert.strictEqual(c.lastAccessed, null);
- c.creation = new Date(Date.now() - 10000);
- cj.setCookie(c, 'http://example.com/index.html', this.callback);
- },
- "domain": function (c) {
- assert.equal(c.domain, 'example.com')
- },
- "path is /": function (c) {
- assert.equal(c.path, '/')
- },
- "path was derived": function (c) {
- assert.strictEqual(c.pathIsDefault, true)
- }
- },
- "Setting a cookie already marked as host-only": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=example.com");
- assert.strictEqual(c.hostOnly, null);
- assert.instanceOf(c.creation, Date);
- assert.strictEqual(c.lastAccessed, null);
- c.creation = new Date(Date.now() - 10000);
- c.hostOnly = true;
- cj.setCookie(c, 'http://example.com/index.html', this.callback);
- },
- "domain": function (c) {
- assert.equal(c.domain, 'example.com')
- },
- "still hostOnly": function (c) {
- assert.strictEqual(c.hostOnly, true)
- }
- },
- "Setting a session cookie": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b");
- assert.strictEqual(c.path, null);
- cj.setCookie(c, 'http://www.example.com/dir/index.html', this.callback);
- },
- "works": function (c) {
- assert.instanceOf(c, Cookie)
- },
- "gets the domain": function (c) {
- assert.equal(c.domain, 'www.example.com')
- },
- "gets the default path": function (c) {
- assert.equal(c.path, '/dir')
- },
- "is 'hostOnly'": function (c) {
- assert.ok(c.hostOnly)
- }
- },
- "Setting wrong domain cookie": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=fooxample.com; Path=/");
- cj.setCookie(c, 'http://example.com/index.html', this.callback);
- },
- "fails": function (err, c) {
- assert.ok(err.message.match(/domain/i));
- assert.ok(!c);
- }
- },
- "Setting sub-domain cookie": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=www.example.com; Path=/");
- cj.setCookie(c, 'http://example.com/index.html', this.callback);
- },
- "fails": function (err, c) {
- assert.ok(err.message.match(/domain/i));
- assert.ok(!c);
- }
- },
- "Setting super-domain cookie": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=example.com; Path=/");
- cj.setCookie(c, 'http://www.app.example.com/index.html', this.callback);
- },
- "success": function (err, c) {
- assert.ok(!err);
- assert.equal(c.domain, 'example.com');
- }
- },
- "Setting a sub-path cookie on a super-domain": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=example.com; Path=/subpath");
- assert.strictEqual(c.hostOnly, null);
- assert.instanceOf(c.creation, Date);
- assert.strictEqual(c.lastAccessed, null);
- c.creation = new Date(Date.now() - 10000);
- cj.setCookie(c, 'http://www.example.com/index.html', this.callback);
- },
- "domain is super-domain": function (c) {
- assert.equal(c.domain, 'example.com')
- },
- "path is /subpath": function (c) {
- assert.equal(c.path, '/subpath')
- },
- "path was NOT derived": function (c) {
- assert.strictEqual(c.pathIsDefault, null)
- }
- },
- "Setting HttpOnly cookie over non-HTTP API": {
- topic: function () {
- var cj = new CookieJar();
- var c = Cookie.parse("a=b; Domain=example.com; Path=/; HttpOnly");
- cj.setCookie(c, 'http://example.com/index.html', {http: false}, this.callback);
- },
- "fails": function (err, c) {
- assert.match(err.message, /HttpOnly/i);
- assert.ok(!c);
- }
- }
- })
- .addBatch({
- "Store eight cookies": {
- topic: function () {
- var cj = new CookieJar();
- var ex = 'http://example.com/index.html';
- var tasks = [];
- tasks.push(function (next) {
- cj.setCookie('a=1; Domain=example.com; Path=/', ex, at(0), next);
- });
- tasks.push(function (next) {
- cj.setCookie('b=2; Domain=example.com; Path=/; HttpOnly', ex, at(1000), next);
- });
- tasks.push(function (next) {
- cj.setCookie('c=3; Domain=example.com; Path=/; Secure', ex, at(2000), next);
- });
- tasks.push(function (next) { // path
- cj.setCookie('d=4; Domain=example.com; Path=/foo', ex, at(3000), next);
- });
- tasks.push(function (next) { // host only
- cj.setCookie('e=5', ex, at(4000), next);
- });
- tasks.push(function (next) { // other domain
- cj.setCookie('f=6; Domain=nodejs.org; Path=/', 'http://nodejs.org', at(5000), next);
- });
- tasks.push(function (next) { // expired
- cj.setCookie('g=7; Domain=example.com; Path=/; Expires=Tue, 18 Oct 2011 00:00:00 GMT', ex, at(6000), next);
- });
- tasks.push(function (next) { // expired via Max-Age
- cj.setCookie('h=8; Domain=example.com; Path=/; Max-Age=1', ex, next);
- });
- var cb = this.callback;
- async.parallel(tasks, function (err, results) {
- setTimeout(function () {
- cb(err, cj, results);
- }, 2000); // so that 'h=8' expires
- });
- },
- "setup ok": function (err, cj, results) {
- assert.ok(!err);
- assert.ok(cj);
- assert.ok(results);
- },
- "then retrieving for http://nodejs.org": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('http://nodejs.org', this.callback);
- },
- "get a nodejs cookie": function (cookies) {
- assert.lengthOf(cookies, 1);
- var cookie = cookies[0];
- assert.equal(cookie.domain, 'nodejs.org');
- }
- },
- "then retrieving for https://example.com": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('https://example.com', {secure: true}, this.callback);
- },
- "get a secure example cookie with others": function (cookies) {
- var names = cookies.map(function (c) {
- return c.key
- });
- assert.deepEqual(names, ['a', 'b', 'c', 'e']);
- }
- },
- "then retrieving for https://example.com (missing options)": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('https://example.com', this.callback);
- },
- "get a secure example cookie with others": function (cookies) {
- var names = cookies.map(function (c) {
- return c.key
- });
- assert.deepEqual(names, ['a', 'b', 'c', 'e']);
- }
- },
- "then retrieving for http://example.com": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('http://example.com', this.callback);
- },
- "get a bunch of cookies": function (cookies) {
- var names = cookies.map(function (c) {
- return c.key
- });
- assert.deepEqual(names, ['a', 'b', 'e']);
- }
- },
- "then retrieving for http://EXAMPlE.com": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('http://EXAMPlE.com', this.callback);
- },
- "get a bunch of cookies": function (cookies) {
- var names = cookies.map(function (c) {
- return c.key
- });
- assert.deepEqual(names, ['a', 'b', 'e']);
- }
- },
- "then retrieving for http://example.com, non-HTTP": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('http://example.com', {http: false}, this.callback);
- },
- "get a bunch of cookies": function (cookies) {
- var names = cookies.map(function (c) {
- return c.key
- });
- assert.deepEqual(names, ['a', 'e']);
- }
- },
- "then retrieving for http://example.com/foo/bar": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('http://example.com/foo/bar', this.callback);
- },
- "get a bunch of cookies": function (cookies) {
- var names = cookies.map(function (c) {
- return c.key
- });
- assert.deepEqual(names, ['d', 'a', 'b', 'e']);
- }
- },
- "then retrieving for http://example.com as a string": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookieString('http://example.com', this.callback);
- },
- "get a single string": function (cookieHeader) {
- assert.equal(cookieHeader, "a=1; b=2; e=5");
- }
- },
- "then retrieving for http://example.com as a set-cookie header": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getSetCookieStrings('http://example.com', this.callback);
- },
- "get a single string": function (cookieHeaders) {
- assert.lengthOf(cookieHeaders, 3);
- assert.equal(cookieHeaders[0], "a=1; Domain=example.com; Path=/");
- assert.equal(cookieHeaders[1], "b=2; Domain=example.com; Path=/; HttpOnly");
- assert.equal(cookieHeaders[2], "e=5; Path=/");
- }
- },
- "then retrieving for http://www.example.com/": {
- topic: function (cj, oldResults) {
- assert.ok(oldResults);
- cj.getCookies('http://www.example.com/foo/bar', this.callback);
- },
- "get a bunch of cookies": function (cookies) {
- var names = cookies.map(function (c) {
- return c.key
- });
- assert.deepEqual(names, ['d', 'a', 'b']); // note lack of 'e'
- }
- }
- }
- })
- .addBatch({
- "Repeated names": {
- topic: function () {
- var cb = this.callback;
- var cj = new CookieJar();
- var ex = 'http://www.example.com/';
- var sc = cj.setCookie;
- var tasks = [];
- var now = Date.now();
- tasks.push(sc.bind(cj, 'aaaa=xxxx', ex, at(0)));
- tasks.push(sc.bind(cj, 'aaaa=1111; Domain=www.example.com', ex, at(1000)));
- tasks.push(sc.bind(cj, 'aaaa=2222; Domain=example.com', ex, at(2000)));
- tasks.push(sc.bind(cj, 'aaaa=3333; Domain=www.example.com; Path=/pathA', ex, at(3000)));
- async.series(tasks, function (err, results) {
- results = results.filter(function (e) {
- return e !== undefined
- });
- cb(err, {cj: cj, cookies: results, now: now});
- });
- },
- "all got set": function (err, t) {
- assert.lengthOf(t.cookies, 4);
- },
- "then getting 'em back": {
- topic: function (t) {
- var cj = t.cj;
- cj.getCookies('http://www.example.com/pathA', this.callback);
- },
- "there's just three": function (err, cookies) {
- var vals = cookies.map(function (c) {
- return c.value
- });
- // may break with sorting; sorting should put 3333 first due to longest path:
- assert.deepEqual(vals, ['3333', '1111', '2222']);
- }
- }
- }
- })
- .addBatch({
- "CookieJar setCookie errors": {
- "public-suffix domain": {
- topic: function () {
- var cj = new CookieJar();
- cj.setCookie('i=9; Domain=kyoto.jp; Path=/', 'kyoto.jp', this.callback);
- },
- "errors": function (err, cookie) {
- assert.ok(err);
- assert.ok(!cookie);
- assert.match(err.message, /public suffix/i);
- }
- },
- "wrong domain": {
- topic: function () {
- var cj = new CookieJar();
- cj.setCookie('j=10; Domain=google.com; Path=/', 'http://google.ca', this.callback);
- },
- "errors": function (err, cookie) {
- assert.ok(err);
- assert.ok(!cookie);
- assert.match(err.message, /not in this host's domain/i);
- }
- },
- "old cookie is HttpOnly": {
- topic: function () {
- var cb = this.callback;
- var next = function (err, c) {
- c = null;
- return cb(err, cj);
- };
- var cj = new CookieJar();
- cj.setCookie('k=11; Domain=example.ca; Path=/; HttpOnly', 'http://example.ca', {http: true}, next);
- },
- "initial cookie is set": function (err, cj) {
- assert.ok(!err);
- assert.ok(cj);
- },
- "but when trying to overwrite": {
- topic: function (cj) {
- var cb = this.callback;
- var next = function (err, c) {
- c = null;
- cb(null, err);
- };
- cj.setCookie('k=12; Domain=example.ca; Path=/', 'http://example.ca', {http: false}, next);
- },
- "it's an error": function (err) {
- assert.ok(err);
- },
- "then, checking the original": {
- topic: function (ignored, cj) {
- assert.ok(cj instanceof CookieJar);
- cj.getCookies('http://example.ca', {http: true}, this.callback);
- },
- "cookie has original value": function (err, cookies) {
- assert.equal(err, null);
- assert.lengthOf(cookies, 1);
- assert.equal(cookies[0].value, 11);
- }
- }
- }
- },
- "similar to public suffix": {
- topic: function () {
- var cj = new CookieJar();
- var url = 'http://www.foonet.net';
- assert.isTrue(cj.rejectPublicSuffixes);
- cj.setCookie('l=13; Domain=foonet.net; Path=/', url, this.callback);
- },
- "doesn't error": function (err, cookie) {
- assert.ok(!err);
- assert.ok(cookie);
- }
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js b/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js
deleted file mode 100644
index 8cc9842..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-
-function toKeyArray(cookies) {
- return cookies.map(function (c) {
- return c.key
- });
-}
-
-vows
- .describe('Cookie sorting')
- .addBatch({
- "Cookie Sorting": {
- topic: function () {
- var cookies = [];
- cookies.push(Cookie.parse("a=0; Domain=example.com"));
- cookies.push(Cookie.parse("b=1; Domain=www.example.com"));
- cookies.push(Cookie.parse("c=2; Domain=example.com; Path=/pathA"));
- cookies.push(Cookie.parse("d=3; Domain=www.example.com; Path=/pathA"));
- cookies.push(Cookie.parse("e=4; Domain=example.com; Path=/pathA/pathB"));
- cookies.push(Cookie.parse("f=5; Domain=www.example.com; Path=/pathA/pathB"));
-
- // weak shuffle:
- cookies = cookies.sort(function () {
- return Math.random() - 0.5
- });
-
- cookies = cookies.sort(tough.cookieCompare);
- return cookies;
- },
- "got": function (cookies) {
- assert.lengthOf(cookies, 6);
- assert.deepEqual(toKeyArray(cookies), ['e', 'f', 'c', 'd', 'a', 'b']);
- }
- }
- })
- .addBatch({
- "Changing creation date affects sorting": {
- topic: function () {
- var cookies = [];
- var now = Date.now();
- cookies.push(Cookie.parse("a=0;"));
- cookies.push(Cookie.parse("b=1;"));
- cookies.push(Cookie.parse("c=2;"));
-
- cookies.forEach(function (cookie, idx) {
- cookie.creation = new Date(now - 100 * idx);
- });
-
- return cookies.sort(tough.cookieCompare);
- },
- "got": function (cookies) {
- assert.deepEqual(toKeyArray(cookies), ['c', 'b', 'a']);
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js b/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js
deleted file mode 100644
index cc3f1fc..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-
-vows
- .describe('Cookie.toJSON()')
- .addBatch({
- "JSON": {
- "serialization": {
- topic: function() {
- var c = Cookie.parse('alpha=beta; Domain=example.com; Path=/foo; Expires=Tue, 19 Jan 2038 03:14:07 GMT; HttpOnly');
- return JSON.stringify(c);
- },
- "gives a string": function(str) {
- assert.equal(typeof str, "string");
- },
- "date is in ISO format": function(str) {
- assert.match(str, /"expires":"2038-01-19T03:14:07\.000Z"/, 'expires is in ISO format');
- }
- },
- "deserialization": {
- topic: function() {
- var json = '{"key":"alpha","value":"beta","domain":"example.com","path":"/foo","expires":"2038-01-19T03:14:07.000Z","httpOnly":true,"lastAccessed":2000000000123}';
- return Cookie.fromJSON(json);
- },
- "works": function(c) {
- assert.ok(c);
- },
- "key": function(c) { assert.equal(c.key, "alpha") },
- "value": function(c) { assert.equal(c.value, "beta") },
- "domain": function(c) { assert.equal(c.domain, "example.com") },
- "path": function(c) { assert.equal(c.path, "/foo") },
- "httpOnly": function(c) { assert.strictEqual(c.httpOnly, true) },
- "secure": function(c) { assert.strictEqual(c.secure, false) },
- "hostOnly": function(c) { assert.strictEqual(c.hostOnly, null) },
- "expires is a date object": function(c) {
- assert.equal(c.expires.getTime(), 2147483647000);
- },
- "lastAccessed is a date object": function(c) {
- assert.equal(c.lastAccessed.getTime(), 2000000000123);
- },
- "creation defaulted": function(c) {
- assert.ok(c.creation.getTime());
- }
- },
- "null deserialization": {
- topic: function() {
- return Cookie.fromJSON(null);
- },
- "is null": function(cookie) {
- assert.equal(cookie,null);
- }
- }
- },
- "expiry deserialization": {
- "Infinity": {
- topic: Cookie.fromJSON.bind(null, '{"expires":"Infinity"}'),
- "is infinite": function(c) {
- assert.strictEqual(c.expires, "Infinity");
- assert.equal(c.expires, Infinity);
- }
- }
- },
- "maxAge serialization": {
- topic: function() {
- return function(toSet) {
- var c = new Cookie();
- c.key = 'foo'; c.value = 'bar';
- c.setMaxAge(toSet);
- return JSON.stringify(c);
- };
- },
- "zero": {
- topic: function(f) { return f(0) },
- "looks good": function(str) {
- assert.match(str, /"maxAge":0/);
- }
- },
- "Infinity": {
- topic: function(f) { return f(Infinity) },
- "looks good": function(str) {
- assert.match(str, /"maxAge":"Infinity"/);
- }
- },
- "-Infinity": {
- topic: function(f) { return f(-Infinity) },
- "looks good": function(str) {
- assert.match(str, /"maxAge":"-Infinity"/);
- }
- },
- "null": {
- topic: function(f) { return f(null) },
- "looks good": function(str) {
- assert.match(str, /"maxAge":null/);
- }
- }
- },
- "maxAge deserialization": {
- "number": {
- topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":123}'),
- "is the number": function(c) {
- assert.strictEqual(c.maxAge, 123);
- }
- },
- "null": {
- topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":null}'),
- "is null": function(c) {
- assert.strictEqual(c.maxAge, null);
- }
- },
- "less than zero": {
- topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":-123}'),
- "is -123": function(c) {
- assert.strictEqual(c.maxAge, -123);
- }
- },
- "Infinity": {
- topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"Infinity"}'),
- "is inf-as-string": function(c) {
- assert.strictEqual(c.maxAge, "Infinity");
- }
- },
- "-Infinity": {
- topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"-Infinity"}'),
- "is inf-as-string": function(c) {
- assert.strictEqual(c.maxAge, "-Infinity");
- }
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js b/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js
deleted file mode 100644
index b7ad10d..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-
-vows
- .describe('Cookie.toString()')
- .addBatch({
- "a simple cookie": {
- topic: function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- return c;
- },
- "validates": function (c) {
- assert.ok(c.validate());
- },
- "to string": function (c) {
- assert.equal(c.toString(), 'a=b');
- }
- },
- "a cookie with spaces in the value": {
- topic: function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'beta gamma';
- return c;
- },
- "doesn't validate": function (c) {
- assert.ok(!c.validate());
- },
- "'garbage in, garbage out'": function (c) {
- assert.equal(c.toString(), 'a=beta gamma');
- }
- },
- "with an empty value and HttpOnly": {
- topic: function () {
- var c = new Cookie();
- c.key = 'a';
- c.httpOnly = true;
- return c;
- },
- "to string": function (c) {
- assert.equal(c.toString(), 'a=; HttpOnly');
- }
- },
- "with an expiry": {
- topic: function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- c.setExpires("Oct 18 2011 07:05:03 GMT");
- return c;
- },
- "validates": function (c) {
- assert.ok(c.validate());
- },
- "to string": function (c) {
- assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT');
- },
- "to short string": function (c) {
- assert.equal(c.cookieString(), 'a=b');
- }
- },
- "with a max-age": {
- topic: function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- c.setExpires("Oct 18 2011 07:05:03 GMT");
- c.maxAge = 12345;
- return c;
- },
- "validates": function (c) {
- assert.ok(c.validate()); // mabe this one *shouldn't*?
- },
- "to string": function (c) {
- assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345');
- }
- },
- "with a bunch of things": function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- c.setExpires("Oct 18 2011 07:05:03 GMT");
- c.maxAge = 12345;
- c.domain = 'example.com';
- c.path = '/foo';
- c.secure = true;
- c.httpOnly = true;
- c.extensions = ['MyExtension'];
- assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345; Domain=example.com; Path=/foo; Secure; HttpOnly; MyExtension');
- },
- "a host-only cookie": {
- topic: function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- c.hostOnly = true;
- c.domain = 'shouldnt-stringify.example.com';
- c.path = '/should-stringify';
- return c;
- },
- "validates": function (c) {
- assert.ok(c.validate());
- },
- "to string": function (c) {
- assert.equal(c.toString(), 'a=b; Path=/should-stringify');
- }
- },
- "minutes are '10'": {
- topic: function () {
- var c = new Cookie();
- c.key = 'a';
- c.value = 'b';
- c.expires = new Date(1284113410000);
- return c;
- },
- "validates": function (c) {
- assert.ok(c.validate());
- },
- "to string": function (c) {
- var str = c.toString();
- assert.notEqual(str, 'a=b; Expires=Fri, 010 Sep 2010 010:010:010 GMT');
- assert.equal(str, 'a=b; Expires=Fri, 10 Sep 2010 10:10:10 GMT');
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/date_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/date_test.js b/node_modules/request/node_modules/tough-cookie/test/date_test.js
deleted file mode 100644
index afd989c..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/date_test.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var tough = require('../lib/cookie');
-
-function dateVows(table) {
- var theVows = {};
- Object.keys(table).forEach(function (date) {
- var expect = table[date];
- theVows[date] = function () {
- var got = tough.parseDate(date) ? 'valid' : 'invalid';
- assert.equal(got, expect ? 'valid' : 'invalid');
- };
- });
- return {"date parsing": theVows};
-}
-
-vows
- .describe('Date')
- .addBatch(dateVows({
- "Wed, 09 Jun 2021 10:18:14 GMT": true,
- "Wed, 09 Jun 2021 22:18:14 GMT": true,
- "Tue, 18 Oct 2011 07:42:42.123 GMT": true,
- "18 Oct 2011 07:42:42 GMT": true,
- "8 Oct 2011 7:42:42 GMT": true,
- "8 Oct 2011 7:2:42 GMT": true,
- "Oct 18 2011 07:42:42 GMT": true,
- "Tue Oct 18 2011 07:05:03 GMT+0000 (GMT)": true,
- "09 Jun 2021 10:18:14 GMT": true,
- "99 Jix 3038 48:86:72 ZMT": false,
- '01 Jan 1970 00:00:00 GMT': true,
- '01 Jan 1600 00:00:00 GMT': false, // before 1601
- '01 Jan 1601 00:00:00 GMT': true,
- '10 Feb 81 13:00:00 GMT': true, // implicit year
- 'Thu, 17-Apr-2014 02:12:29 GMT': true, // dashes
- 'Thu, 17-Apr-2014 02:12:29 UTC': true // dashes and UTC
- }))
- .addBatch({
- "strict date parse of Thu, 01 Jan 1970 00:00:010 GMT": {
- topic: function () {
- return tough.parseDate('Thu, 01 Jan 1970 00:00:010 GMT', true) ? true : false;
- },
- "invalid": function (date) {
- assert.equal(date, false);
- }
- }
- })
- .export(module);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js b/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js
deleted file mode 100644
index 36b85b9..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-'use strict';
-var vows = require('vows');
-var assert = require('assert');
-var tough = require('../lib/cookie');
-var Cookie = tough.Cookie;
-
-function matchVows(func, table) {
- var theVows = {};
- table.forEach(function (item) {
- var str = item[0];
- var dom = item[1];
- var expect = item[2];
- var label = str + (expect ? " matches " : " doesn't match ") + dom;
- theVows[label] = function () {
- assert.equal(func(str, dom), expect);
- };
- });
- return theVows;
-}
-
-function defaultPathVows(table) {
- var theVows = {};
- table.forEach(function (item) {
- var str = item[0];
- var expect = item[1];
- var label = str + " gives " + expect;
- theVows[label] = function () {
- assert.equal(tough.defaultPath(str), expect);
- };
- });
- return theVows;
-}
-
-vows
- .describe('Domain and Path')
- .addBatch({
- "domain normalization": {
- "simple": function () {
- var c = new Cookie();
- c.domain = "EXAMPLE.com";
- assert.equal(c.canonicalizedDomain(), "example.com");
- },
- "extra dots": function () {
- var c = new Cookie();
- c.domain = ".EXAMPLE.com";
- assert.equal(c.cdomain(), "example.com");
- },
- "weird trailing dot": function () {
- var c = new Cookie();
- c.domain = "EXAMPLE.ca.";
- assert.equal(c.canonicalizedDomain(), "example.ca.");
- },
- "weird internal dots": function () {
- var c = new Cookie();
- c.domain = "EXAMPLE...ca.";
- assert.equal(c.canonicalizedDomain(), "example...ca.");
- },
- "IDN": function () {
- var c = new Cookie();
- c.domain = "δοκιμή.δοκιμή"; // "test.test" in greek
- assert.equal(c.canonicalizedDomain(), "xn--jxalpdlp.xn--jxalpdlp");
- }
- }
- })
- .addBatch({
- "Domain Match": matchVows(tough.domainMatch, [
- // str, dom, expect
- ["example.com", "example.com", true],
- ["eXaMpLe.cOm", "ExAmPlE.CoM", true],
- ["no.ca", "yes.ca", false],
- ["wwwexample.com", "example.com", false],
- ["www.example.com", "example.com", true],
- ["example.com", "www.example.com", false],
- ["www.subdom.example.com", "example.com", true],
- ["www.subdom.example.com", "subdom.example.com", true],
- ["example.com", "example.com.", false], // RFC6265 S4.1.2.3
- ["192.168.0.1", "168.0.1", false], // S5.1.3 "The string is a host name"
- [null, "example.com", null],
- ["example.com", null, null],
- [null, null, null],
- [undefined, undefined, null],
- ])
- })
-
- .addBatch({
- "default-path": defaultPathVows([
- [null, "/"],
- ["/", "/"],
- ["/file", "/"],
- ["/dir/file", "/dir"],
- ["noslash", "/"],
- ])
- })
- .addBatch({
- "Path-Match": matchVows(tough.pathMatch, [
- // request, cookie, match
- ["/", "/", true],
- ["/dir", "/", true],
- ["/", "/dir", false],
- ["/dir/", "/dir/", true],
- ["/dir/file", "/dir/", true],
- ["/dir/file", "/dir", true],
- ["/directory", "/dir", false],
- ])
- })
- .addBatch({
- "permuteDomain": {
- "base case": {
- topic: tough.permuteDomain.bind(null, 'example.com'),
- "got the domain": function (list) {
- assert.deepEqual(list, ['example.com']);
- }
- },
- "two levels": {
- topic: tough.permuteDomain.bind(null, 'foo.bar.example.com'),
- "got three things": function (list) {
- assert.deepEqual(list, ['example.com', 'bar.example.com', 'foo.bar.example.com']);
- }
- },
- "local domain": {
- topic: tough.permuteDomain.bind(null, 'foo.bar.example.localduhmain'),
- "got three things": function (list) {
- assert.deepEqual(list, ['example.localduhmain', 'bar.example.localduhmain', 'foo.bar.example.localduhmain']);
- }
- }
- },
- "permutePath": {
- "base case": {
- topic: tough.permutePath.bind(null, '/'),
- "just slash": function (list) {
- assert.deepEqual(list, ['/']);
- }
- },
- "single case": {
- topic: tough.permutePath.bind(null, '/foo'),
- "two things": function (list) {
- assert.deepEqual(list, ['/foo', '/']);
- },
- "path matching": function (list) {
- list.forEach(function (e) {
- assert.ok(tough.pathMatch('/foo', e));
- });
- }
- },
- "double case": {
- topic: tough.permutePath.bind(null, '/foo/bar'),
- "four things": function (list) {
- assert.deepEqual(list, ['/foo/bar', '/foo', '/']);
- },
- "path matching": function (list) {
- list.forEach(function (e) {
- assert.ok(tough.pathMatch('/foo/bar', e));
- });
- }
- },
- "trailing slash": {
- topic: tough.permutePath.bind(null, '/foo/bar/'),
- "three things": function (list) {
- assert.deepEqual(list, ['/foo/bar', '/foo', '/']);
- },
- "path matching": function (list) {
- list.forEach(function (e) {
- assert.ok(tough.pathMatch('/foo/bar/', e));
- });
- }
- }
- }
- })
- .export(module);
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json b/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json
deleted file mode 100644
index bc43160..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json
+++ /dev/null
@@ -1,168 +0,0 @@
-[
- {
- "test": "Sat, 15-Apr-17 21:01:22 GMT",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Thu, 19-Apr-2007 16:00:00 GMT",
- "expected": "Thu, 19 Apr 2007 16:00:00 GMT"
- }, {
- "test": "Wed, 25 Apr 2007 21:02:13 GMT",
- "expected": "Wed, 25 Apr 2007 21:02:13 GMT"
- }, {
- "test": "Thu, 19/Apr\\2007 16:00:00 GMT",
- "expected": "Thu, 19 Apr 2007 16:00:00 GMT"
- }, {
- "test": "Fri, 1 Jan 2010 01:01:50 GMT",
- "expected": "Fri, 01 Jan 2010 01:01:50 GMT"
- }, {
- "test": "Wednesday, 1-Jan-2003 00:00:00 GMT",
- "expected": "Wed, 01 Jan 2003 00:00:00 GMT"
- }, {
- "test": ", 1-Jan-2003 00:00:00 GMT",
- "expected": "Wed, 01 Jan 2003 00:00:00 GMT"
- }, {
- "test": " 1-Jan-2003 00:00:00 GMT",
- "expected": "Wed, 01 Jan 2003 00:00:00 GMT"
- }, {
- "test": "1-Jan-2003 00:00:00 GMT",
- "expected": "Wed, 01 Jan 2003 00:00:00 GMT"
- }, {
- "test": "Wed,18-Apr-07 22:50:12 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "WillyWonka , 18-Apr-07 22:50:12 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "WillyWonka , 18-Apr-07 22:50:12",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "WillyWonka , 18-apr-07 22:50:12",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Mon, 18-Apr-1977 22:50:13 GMT",
- "expected": "Mon, 18 Apr 1977 22:50:13 GMT"
- }, {
- "test": "Mon, 18-Apr-77 22:50:13 GMT",
- "expected": "Mon, 18 Apr 1977 22:50:13 GMT"
- }, {
- "test": "\"Sat, 15-Apr-17\\\"21:01:22\\\"GMT\"",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Partyday, 18- April-07 22:50:12",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Partyday, 18 - Apri-07 22:50:12",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Wednes, 1-Januar-2003 00:00:00 GMT",
- "expected": "Wed, 01 Jan 2003 00:00:00 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 GMT-2",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 GMT BLAH",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 GMT-0400",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 DST",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 -0400",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 (hello there)",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 11:22:33",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 ::00 21:01:22",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 boink:z 21:01:22",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Sat, 15-Apr-17 91:22:33 21:01:22",
- "expected": null
- }, {
- "test": "Thu Apr 18 22:50:12 2007 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "22:50:12 Thu Apr 18 2007 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Thu 22:50:12 Apr 18 2007 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Thu Apr 22:50:12 18 2007 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Thu Apr 18 22:50:12 2007 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Thu Apr 18 2007 22:50:12 GMT",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Thu Apr 18 2007 GMT 22:50:12",
- "expected": "Wed, 18 Apr 2007 22:50:12 GMT"
- }, {
- "test": "Sat, 15-Apr-17 21:01:22 GMT",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "15-Sat, Apr-17 21:01:22 GMT",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "15-Sat, Apr 21:01:22 GMT 17",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "15-Sat, Apr 21:01:22 GMT 2017",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "15 Apr 21:01:22 2017",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "15 17 Apr 21:01:22",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Apr 15 17 21:01:22",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "Apr 15 21:01:22 17",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "2017 April 15 21:01:22",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "15 April 2017 21:01:22",
- "expected": "Sat, 15 Apr 2017 21:01:22 GMT"
- }, {
- "test": "98 April 17 21:01:22",
- "expected": null
- }, {
- "test": "Thu, 012-Aug-2008 20:49:07 GMT",
- "expected": null
- }, {
- "test": "Thu, 12-Aug-31841 20:49:07 GMT",
- "expected": null
- }, {
- "test": "Thu, 12-Aug-9999999999 20:49:07 GMT",
- "expected": null
- }, {
- "test": "Thu, 999999999999-Aug-2007 20:49:07 GMT",
- "expected": null
- }, {
- "test": "Thu, 12-Aug-2007 20:61:99999999999 GMT",
- "expected": null
- }, {
- "test": "IAintNoDateFool",
- "expected": null
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json b/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json
deleted file mode 100644
index 61e674d..0000000
--- a/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json
+++ /dev/null
@@ -1,48 +0,0 @@
-[
- {
- "test": "Mon, 10-Dec-2007 17:02:24 GMT",
- "expected": "Mon, 10 Dec 2007 17:02:24 GMT"
- }, {
- "test": "Wed, 09 Dec 2009 16:27:23 GMT",
- "expected": "Wed, 09 Dec 2009 16:27:23 GMT"
- }, {
- "test": "Thursday, 01-Jan-1970 00:00:00 GMT",
- "expected": "Thu, 01 Jan 1970 00:00:00 GMT"
- }, {
- "test": "Mon Dec 10 16:32:30 2007 GMT",
- "expected": "Mon, 10 Dec 2007 16:32:30 GMT"
- }, {
- "test": "Wednesday, 01-Jan-10 00:00:00 GMT",
- "expected": "Fri, 01 Jan 2010 00:00:00 GMT"
- }, {
- "test": "Mon, 10-Dec-07 20:35:03 GMT",
- "expected": "Mon, 10 Dec 2007 20:35:03 GMT"
- }, {
- "test": "Wed, 1 Jan 2020 00:00:00 GMT",
- "expected": "Wed, 01 Jan 2020 00:00:00 GMT"
- }, {
- "test": "Saturday, 8-Dec-2012 21:24:09 GMT",
- "expected": "Sat, 08 Dec 2012 21:24:09 GMT"
- }, {
- "test": "Thu, 31 Dec 23:55:55 2037 GMT",
- "expected": "Thu, 31 Dec 2037 23:55:55 GMT"
- }, {
- "test": "Sun, 9 Dec 2012 13:42:05 GMT",
- "expected": "Sun, 09 Dec 2012 13:42:05 GMT"
- }, {
- "test": "Wed Dec 12 2007 08:44:07 GMT-0500 (EST)",
- "expected": "Wed, 12 Dec 2007 08:44:07 GMT"
- }, {
- "test": "Mon, 01-Jan-2011 00: 00:00 GMT",
- "expected": null
- }, {
- "test": "Sun, 1-Jan-1995 00:00:00 GMT",
- "expected": "Sun, 01 Jan 1995 00:00:00 GMT"
- }, {
- "test": "Wednesday, 01-Jan-10 0:0:00 GMT",
- "expected": "Fri, 01 Jan 2010 00:00:00 GMT"
- }, {
- "test": "Thu, 10 Dec 2009 13:57:2 GMT",
- "expected": "Thu, 10 Dec 2009 13:57:02 GMT"
- }
-]
[09/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000..db8539c
--- /dev/null
+++ b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,477 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, cb), and it'll handle all
+// the drain event emission and buffering.
+
+module.exports = Writable;
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Stream = require('stream');
+
+util.inherits(Writable, Stream);
+
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+}
+
+function WritableState(options, stream) {
+ var Duplex = require('./_stream_duplex');
+
+ options = options || {};
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var defaultHwm = options.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex)
+ this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function(er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.buffer = [];
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+}
+
+function Writable(options) {
+ var Duplex = require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, though they're not
+ // instanceof Writable, they're instanceof Readable.
+ if (!(this instanceof Writable) && !(this instanceof Duplex))
+ return new Writable(options);
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function() {
+ this.emit('error', new Error('Cannot pipe. Not readable.'));
+};
+
+
+function writeAfterEnd(stream, state, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ process.nextTick(function() {
+ cb(er);
+ });
+}
+
+// If we get something that is not a buffer, string, null, or undefined,
+// and we're not in objectMode, then that's an error.
+// Otherwise stream chunks are all considered to be of length=1, and the
+// watermarks determine how many objects to keep in the buffer, rather than
+// how many bytes or characters.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+ if (!util.isBuffer(chunk) &&
+ !util.isString(chunk) &&
+ !util.isNullOrUndefined(chunk) &&
+ !state.objectMode) {
+ var er = new TypeError('Invalid non-string/buffer chunk');
+ stream.emit('error', er);
+ process.nextTick(function() {
+ cb(er);
+ });
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function(chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+
+ if (util.isFunction(encoding)) {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (util.isBuffer(chunk))
+ encoding = 'buffer';
+ else if (!encoding)
+ encoding = state.defaultEncoding;
+
+ if (!util.isFunction(cb))
+ cb = function() {};
+
+ if (state.ended)
+ writeAfterEnd(this, state, cb);
+ else if (validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
+ }
+
+ return ret;
+};
+
+Writable.prototype.cork = function() {
+ var state = this._writableState;
+
+ state.corked++;
+};
+
+Writable.prototype.uncork = function() {
+ var state = this._writableState;
+
+ if (state.corked) {
+ state.corked--;
+
+ if (!state.writing &&
+ !state.corked &&
+ !state.finished &&
+ !state.bufferProcessing &&
+ state.buffer.length)
+ clearBuffer(this, state);
+ }
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode &&
+ state.decodeStrings !== false &&
+ util.isString(chunk)) {
+ chunk = new Buffer(chunk, encoding);
+ }
+ return chunk;
+}
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+ chunk = decodeChunk(state, chunk, encoding);
+ if (util.isBuffer(chunk))
+ encoding = 'buffer';
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret)
+ state.needDrain = true;
+
+ if (state.writing || state.corked)
+ state.buffer.push(new WriteReq(chunk, encoding, cb));
+ else
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+
+ return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (writev)
+ stream._writev(chunk, state.onwrite);
+ else
+ stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ if (sync)
+ process.nextTick(function() {
+ state.pendingcb--;
+ cb(er);
+ });
+ else {
+ state.pendingcb--;
+ cb(er);
+ }
+
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er)
+ onwriteError(stream, state, sync, er, cb);
+ else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(stream, state);
+
+ if (!finished &&
+ !state.corked &&
+ !state.bufferProcessing &&
+ state.buffer.length) {
+ clearBuffer(stream, state);
+ }
+
+ if (sync) {
+ process.nextTick(function() {
+ afterWrite(stream, state, finished, cb);
+ });
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished)
+ onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+
+ if (stream._writev && state.buffer.length > 1) {
+ // Fast case, write everything using _writev()
+ var cbs = [];
+ for (var c = 0; c < state.buffer.length; c++)
+ cbs.push(state.buffer[c].callback);
+
+ // count the one we are adding, as well.
+ // TODO(isaacs) clean this up
+ state.pendingcb++;
+ doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
+ for (var i = 0; i < cbs.length; i++) {
+ state.pendingcb--;
+ cbs[i](err);
+ }
+ });
+
+ // Clear buffer
+ state.buffer = [];
+ } else {
+ // Slow case, write chunks one-by-one
+ for (var c = 0; c < state.buffer.length; c++) {
+ var entry = state.buffer[c];
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ c++;
+ break;
+ }
+ }
+
+ if (c < state.buffer.length)
+ state.buffer = state.buffer.slice(c);
+ else
+ state.buffer.length = 0;
+ }
+
+ state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function(chunk, encoding, cb) {
+ cb(new Error('not implemented'));
+
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function(chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (util.isFunction(chunk)) {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (util.isFunction(encoding)) {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (!util.isNullOrUndefined(chunk))
+ this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished)
+ endWritable(this, state, cb);
+};
+
+
+function needFinish(stream, state) {
+ return (state.ending &&
+ state.length === 0 &&
+ !state.finished &&
+ !state.writing);
+}
+
+function prefinish(stream, state) {
+ if (!state.prefinished) {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(stream, state);
+ if (need) {
+ if (state.pendingcb === 0) {
+ prefinish(stream, state);
+ state.finished = true;
+ stream.emit('finish');
+ } else
+ prefinish(stream, state);
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished)
+ process.nextTick(cb);
+ else
+ stream.once('finish', cb);
+ }
+ state.ended = true;
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
new file mode 100644
index 0000000..9074e8e
--- /dev/null
+++ b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
@@ -0,0 +1,107 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// NOTE: These type checking functions intentionally don't use `instanceof`
+// because it is fragile and can be easily faked with `Object.create()`.
+function isArray(ar) {
+ return Array.isArray(ar);
+}
+exports.isArray = isArray;
+
+function isBoolean(arg) {
+ return typeof arg === 'boolean';
+}
+exports.isBoolean = isBoolean;
+
+function isNull(arg) {
+ return arg === null;
+}
+exports.isNull = isNull;
+
+function isNullOrUndefined(arg) {
+ return arg == null;
+}
+exports.isNullOrUndefined = isNullOrUndefined;
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+exports.isNumber = isNumber;
+
+function isString(arg) {
+ return typeof arg === 'string';
+}
+exports.isString = isString;
+
+function isSymbol(arg) {
+ return typeof arg === 'symbol';
+}
+exports.isSymbol = isSymbol;
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+exports.isUndefined = isUndefined;
+
+function isRegExp(re) {
+ return isObject(re) && objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+ return isObject(d) && objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+ return isObject(e) &&
+ (objectToString(e) === '[object Error]' || e instanceof Error);
+}
+exports.isError = isError;
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+exports.isFunction = isFunction;
+
+function isPrimitive(arg) {
+ return arg === null ||
+ typeof arg === 'boolean' ||
+ typeof arg === 'number' ||
+ typeof arg === 'string' ||
+ typeof arg === 'symbol' || // ES6 symbol
+ typeof arg === 'undefined';
+}
+exports.isPrimitive = isPrimitive;
+
+function isBuffer(arg) {
+ return Buffer.isBuffer(arg);
+}
+exports.isBuffer = isBuffer;
+
+function objectToString(o) {
+ return Object.prototype.toString.call(o);
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/package.json
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/package.json b/node_modules/npmlog/package.json
index 260ce66..345feac 100644
--- a/node_modules/npmlog/package.json
+++ b/node_modules/npmlog/package.json
@@ -6,7 +6,7 @@
},
"name": "npmlog",
"description": "logger for npm",
- "version": "1.2.0",
+ "version": "1.2.1",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/npmlog.git"
@@ -23,20 +23,24 @@
"devDependencies": {
"tap": ""
},
- "license": "BSD",
- "gitHead": "1fe2892a8b9dacb775d4fb365315865f421f4ca9",
+ "license": "ISC",
+ "gitHead": "4e1a73a567036064ded425a7d48c863d53550b4f",
"bugs": {
"url": "https://github.com/isaacs/npmlog/issues"
},
- "homepage": "https://github.com/isaacs/npmlog",
- "_id": "npmlog@1.2.0",
- "_shasum": "b512f18ae8696a0192ada78ba00c06dbbd91bafb",
+ "homepage": "https://github.com/isaacs/npmlog#readme",
+ "_id": "npmlog@1.2.1",
+ "_shasum": "28e7be619609b53f7ad1dd300a10d64d716268b6",
"_from": "npmlog@>=1.2.0 <1.3.0",
- "_npmVersion": "2.6.0",
- "_nodeVersion": "1.1.0",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
+ "name": "isaacs",
+ "email": "isaacs@npmjs.com"
+ },
+ "dist": {
+ "shasum": "28e7be619609b53f7ad1dd300a10d64d716268b6",
+ "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz"
},
"maintainers": [
{
@@ -48,11 +52,6 @@
"email": "me@re-becca.org"
}
],
- "dist": {
- "shasum": "b512f18ae8696a0192ada78ba00c06dbbd91bafb",
- "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-1.2.0.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/osenv/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/osenv/LICENSE b/node_modules/osenv/LICENSE
index 0c44ae7..19129e3 100644
--- a/node_modules/osenv/LICENSE
+++ b/node_modules/osenv/LICENSE
@@ -1,27 +1,15 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
+The ISC License
-The BSD License
+Copyright (c) Isaac Z. Schlueter and Contributors
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/osenv/package.json
----------------------------------------------------------------------
diff --git a/node_modules/osenv/package.json b/node_modules/osenv/package.json
index f9465b8..0e6a299 100644
--- a/node_modules/osenv/package.json
+++ b/node_modules/osenv/package.json
@@ -1,6 +1,6 @@
{
"name": "osenv",
- "version": "0.1.0",
+ "version": "0.1.1",
"main": "osenv.js",
"directories": {
"test": "test"
@@ -14,7 +14,7 @@
},
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/osenv"
+ "url": "git+https://github.com/npm/osenv.git"
},
"keywords": [
"environment",
@@ -30,19 +30,25 @@
"email": "i@izs.me",
"url": "http://blog.izs.me/"
},
- "license": "BSD",
+ "license": "ISC",
"description": "Look up environment settings specific to different operating systems",
+ "gitHead": "769ada6737026254372e3013b702c450a9b781e9",
"bugs": {
- "url": "https://github.com/isaacs/osenv/issues"
+ "url": "https://github.com/npm/osenv/issues"
},
- "homepage": "https://github.com/isaacs/osenv",
- "_id": "osenv@0.1.0",
- "_shasum": "61668121eec584955030b9f470b1d2309504bfcb",
+ "homepage": "https://github.com/npm/osenv#readme",
+ "_id": "osenv@0.1.1",
+ "_shasum": "ddc7c4bb86c64a3022e95f030ee028e9a5996c07",
"_from": "osenv@>=0.1.0 <0.2.0",
- "_npmVersion": "1.4.9",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
- "name": "robertkowalski",
- "email": "rok@kowalski.gd"
+ "name": "isaacs",
+ "email": "isaacs@npmjs.com"
+ },
+ "dist": {
+ "shasum": "ddc7c4bb86c64a3022e95f030ee028e9a5996c07",
+ "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.1.tgz"
},
"maintainers": [
{
@@ -52,12 +58,15 @@
{
"name": "robertkowalski",
"email": "rok@kowalski.gd"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
}
],
- "dist": {
- "shasum": "61668121eec584955030b9f470b1d2309504bfcb",
- "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.0.tgz"
- },
- "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.1.tgz"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/auth.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/auth.js b/node_modules/request/lib/auth.js
new file mode 100644
index 0000000..13c3ac8
--- /dev/null
+++ b/node_modules/request/lib/auth.js
@@ -0,0 +1,153 @@
+'use strict'
+
+var caseless = require('caseless')
+ , uuid = require('node-uuid')
+ , helpers = require('./helpers')
+
+var md5 = helpers.md5
+ , toBase64 = helpers.toBase64
+
+
+function Auth (request) {
+ // define all public properties here
+ this.request = request
+ this.hasAuth = false
+ this.sentAuth = false
+ this.bearerToken = null
+ this.user = null
+ this.pass = null
+}
+
+Auth.prototype.basic = function (user, pass, sendImmediately) {
+ var self = this
+ if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
+ throw new Error('auth() received invalid user or password')
+ }
+ self.user = user
+ self.pass = pass
+ self.hasAuth = true
+ var header = user + ':' + (pass || '')
+ if (sendImmediately || typeof sendImmediately === 'undefined') {
+ var authHeader = 'Basic ' + toBase64(header)
+ self.sentAuth = true
+ return authHeader
+ }
+}
+
+Auth.prototype.bearer = function (bearer, sendImmediately) {
+ var self = this
+ self.bearerToken = bearer
+ self.hasAuth = true
+ if (sendImmediately || typeof sendImmediately === 'undefined') {
+ if (typeof bearer === 'function') {
+ bearer = bearer()
+ }
+ var authHeader = 'Bearer ' + (bearer || '')
+ self.sentAuth = true
+ return authHeader
+ }
+}
+
+Auth.prototype.digest = function (method, path, authHeader) {
+ // TODO: More complete implementation of RFC 2617.
+ // - check challenge.algorithm
+ // - support algorithm="MD5-sess"
+ // - handle challenge.domain
+ // - support qop="auth-int" only
+ // - handle Authentication-Info (not necessarily?)
+ // - check challenge.stale (not necessarily?)
+ // - increase nc (not necessarily?)
+ // For reference:
+ // http://tools.ietf.org/html/rfc2617#section-3
+ // https://github.com/bagder/curl/blob/master/lib/http_digest.c
+
+ var self = this
+
+ var challenge = {}
+ var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
+ for (;;) {
+ var match = re.exec(authHeader)
+ if (!match) {
+ break
+ }
+ challenge[match[1]] = match[2] || match[3]
+ }
+
+ var ha1 = md5(self.user + ':' + challenge.realm + ':' + self.pass)
+ var ha2 = md5(method + ':' + path)
+ var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
+ var nc = qop && '00000001'
+ var cnonce = qop && uuid().replace(/-/g, '')
+ var digestResponse = qop
+ ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
+ : md5(ha1 + ':' + challenge.nonce + ':' + ha2)
+ var authValues = {
+ username: self.user,
+ realm: challenge.realm,
+ nonce: challenge.nonce,
+ uri: path,
+ qop: qop,
+ response: digestResponse,
+ nc: nc,
+ cnonce: cnonce,
+ algorithm: challenge.algorithm,
+ opaque: challenge.opaque
+ }
+
+ authHeader = []
+ for (var k in authValues) {
+ if (authValues[k]) {
+ if (k === 'qop' || k === 'nc' || k === 'algorithm') {
+ authHeader.push(k + '=' + authValues[k])
+ } else {
+ authHeader.push(k + '="' + authValues[k] + '"')
+ }
+ }
+ }
+ authHeader = 'Digest ' + authHeader.join(', ')
+ self.sentAuth = true
+ return authHeader
+}
+
+Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
+ var self = this
+ , request = self.request
+
+ var authHeader
+ if (bearer === undefined && user === undefined) {
+ throw new Error('no auth mechanism defined')
+ } else if (bearer !== undefined) {
+ authHeader = self.bearer(bearer, sendImmediately)
+ } else {
+ authHeader = self.basic(user, pass, sendImmediately)
+ }
+ if (authHeader) {
+ request.setHeader('authorization', authHeader)
+ }
+}
+
+Auth.prototype.onResponse = function (response) {
+ var self = this
+ , request = self.request
+
+ if (!self.hasAuth || self.sentAuth) { return null }
+
+ var c = caseless(response.headers)
+
+ var authHeader = c.get('www-authenticate')
+ var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()
+ // debug('reauth', authVerb)
+
+ switch (authVerb) {
+ case 'basic':
+ return self.basic(self.user, self.pass, true)
+
+ case 'bearer':
+ return self.bearer(self.bearerToken, true)
+
+ case 'digest':
+ return self.digest(request.method, request.path, authHeader)
+ }
+}
+
+exports.Auth = Auth
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/cookies.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/cookies.js b/node_modules/request/lib/cookies.js
new file mode 100644
index 0000000..adde7c6
--- /dev/null
+++ b/node_modules/request/lib/cookies.js
@@ -0,0 +1,39 @@
+'use strict'
+
+var tough = require('tough-cookie')
+
+var Cookie = tough.Cookie
+ , CookieJar = tough.CookieJar
+
+
+exports.parse = function(str) {
+ if (str && str.uri) {
+ str = str.uri
+ }
+ if (typeof str !== 'string') {
+ throw new Error('The cookie function only accepts STRING as param')
+ }
+ return Cookie.parse(str)
+}
+
+// Adapt the sometimes-Async api of tough.CookieJar to our requirements
+function RequestJar(store) {
+ var self = this
+ self._jar = new CookieJar(store)
+}
+RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) {
+ var self = this
+ return self._jar.setCookieSync(cookieOrStr, uri, options || {})
+}
+RequestJar.prototype.getCookieString = function(uri) {
+ var self = this
+ return self._jar.getCookieStringSync(uri)
+}
+RequestJar.prototype.getCookies = function(uri) {
+ var self = this
+ return self._jar.getCookiesSync(uri)
+}
+
+exports.jar = function(store) {
+ return new RequestJar(store)
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/copy.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/copy.js b/node_modules/request/lib/copy.js
new file mode 100644
index 0000000..ad162a5
--- /dev/null
+++ b/node_modules/request/lib/copy.js
@@ -0,0 +1,10 @@
+'use strict'
+
+module.exports =
+function copy (obj) {
+ var o = {}
+ Object.keys(obj).forEach(function (i) {
+ o[i] = obj[i]
+ })
+ return o
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/getProxyFromURI.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/getProxyFromURI.js b/node_modules/request/lib/getProxyFromURI.js
new file mode 100644
index 0000000..c2013a6
--- /dev/null
+++ b/node_modules/request/lib/getProxyFromURI.js
@@ -0,0 +1,79 @@
+'use strict'
+
+function formatHostname(hostname) {
+ // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
+ return hostname.replace(/^\.*/, '.').toLowerCase()
+}
+
+function parseNoProxyZone(zone) {
+ zone = zone.trim().toLowerCase()
+
+ var zoneParts = zone.split(':', 2)
+ , zoneHost = formatHostname(zoneParts[0])
+ , zonePort = zoneParts[1]
+ , hasPort = zone.indexOf(':') > -1
+
+ return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
+}
+
+function uriInNoProxy(uri, noProxy) {
+ var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
+ , hostname = formatHostname(uri.hostname)
+ , noProxyList = noProxy.split(',')
+
+ // iterate through the noProxyList until it finds a match.
+ return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) {
+ var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
+ , hostnameMatched = (
+ isMatchedAt > -1 &&
+ (isMatchedAt === hostname.length - noProxyZone.hostname.length)
+ )
+
+ if (noProxyZone.hasPort) {
+ return (port === noProxyZone.port) && hostnameMatched
+ }
+
+ return hostnameMatched
+ })
+}
+
+function getProxyFromURI(uri) {
+ // Decide the proper request proxy to use based on the request URI object and the
+ // environmental variables (NO_PROXY, HTTP_PROXY, etc.)
+ // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)
+
+ var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
+
+ // if the noProxy is a wildcard then return null
+
+ if (noProxy === '*') {
+ return null
+ }
+
+ // if the noProxy is not empty and the uri is found return null
+
+ if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
+ return null
+ }
+
+ // Check for HTTP or HTTPS Proxy in environment Else default to null
+
+ if (uri.protocol === 'http:') {
+ return process.env.HTTP_PROXY ||
+ process.env.http_proxy || null
+ }
+
+ if (uri.protocol === 'https:') {
+ return process.env.HTTPS_PROXY ||
+ process.env.https_proxy ||
+ process.env.HTTP_PROXY ||
+ process.env.http_proxy || null
+ }
+
+ // if none of that works, return null
+ // (What uri protocol are you using then?)
+
+ return null
+}
+
+module.exports = getProxyFromURI
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/har.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/har.js b/node_modules/request/lib/har.js
new file mode 100644
index 0000000..83453a3
--- /dev/null
+++ b/node_modules/request/lib/har.js
@@ -0,0 +1,205 @@
+'use strict'
+
+var fs = require('fs')
+var qs = require('querystring')
+var validate = require('har-validator')
+var util = require('util')
+
+function Har (request) {
+ this.request = request
+}
+
+Har.prototype.reducer = function (obj, pair) {
+ // new property ?
+ if (obj[pair.name] === undefined) {
+ obj[pair.name] = pair.value
+ return obj
+ }
+
+ // existing? convert to array
+ var arr = [
+ obj[pair.name],
+ pair.value
+ ]
+
+ obj[pair.name] = arr
+
+ return obj
+}
+
+Har.prototype.prep = function (data) {
+ // construct utility properties
+ data.queryObj = {}
+ data.headersObj = {}
+ data.postData.jsonObj = false
+ data.postData.paramsObj = false
+
+ // construct query objects
+ if (data.queryString && data.queryString.length) {
+ data.queryObj = data.queryString.reduce(this.reducer, {})
+ }
+
+ // construct headers objects
+ if (data.headers && data.headers.length) {
+ // loweCase header keys
+ data.headersObj = data.headers.reduceRight(function (headers, header) {
+ headers[header.name] = header.value
+ return headers
+ }, {})
+ }
+
+ // construct Cookie header
+ if (data.cookies && data.cookies.length) {
+ var cookies = data.cookies.map(function (cookie) {
+ return cookie.name + '=' + cookie.value
+ })
+
+ if (cookies.length) {
+ data.headersObj.cookie = cookies.join('; ')
+ }
+ }
+
+ // prep body
+ switch (data.postData.mimeType) {
+ case 'multipart/mixed':
+ case 'multipart/related':
+ case 'multipart/form-data':
+ case 'multipart/alternative':
+ // reset values
+ data.postData.mimeType = 'multipart/form-data'
+ break
+
+ case 'application/x-www-form-urlencoded':
+ if (!data.postData.params) {
+ data.postData.text = ''
+ } else {
+ data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
+
+ // always overwrite
+ data.postData.text = qs.stringify(data.postData.paramsObj)
+ }
+ break
+
+ case 'text/json':
+ case 'text/x-json':
+ case 'application/json':
+ case 'application/x-json':
+ data.postData.mimeType = 'application/json'
+
+ if (data.postData.text) {
+ try {
+ data.postData.jsonObj = JSON.parse(data.postData.text)
+ } catch (e) {
+ this.request.debug(e)
+
+ // force back to text/plain
+ data.postData.mimeType = 'text/plain'
+ }
+ }
+ break
+ }
+
+ return data
+}
+
+Har.prototype.options = function (options) {
+ // skip if no har property defined
+ if (!options.har) {
+ return options
+ }
+
+ var har = util._extend({}, options.har)
+
+ // only process the first entry
+ if (har.log && har.log.entries) {
+ har = har.log.entries[0]
+ }
+
+ // add optional properties to make validation successful
+ har.url = har.url || options.url || options.uri || options.baseUrl || '/'
+ har.httpVersion = har.httpVersion || 'HTTP/1.1'
+ har.queryString = har.queryString || []
+ har.headers = har.headers || []
+ har.cookies = har.cookies || []
+ har.postData = har.postData || {}
+ har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
+
+ har.bodySize = 0
+ har.headersSize = 0
+ har.postData.size = 0
+
+ if (!validate.request(har)) {
+ return options
+ }
+
+ // clean up and get some utility properties
+ var req = this.prep(har)
+
+ // construct new options
+ if (req.url) {
+ options.url = req.url
+ }
+
+ if (req.method) {
+ options.method = req.method
+ }
+
+ if (Object.keys(req.queryObj).length) {
+ options.qs = req.queryObj
+ }
+
+ if (Object.keys(req.headersObj).length) {
+ options.headers = req.headersObj
+ }
+
+ switch (req.postData.mimeType) {
+ case 'application/x-www-form-urlencoded':
+ options.form = req.postData.paramsObj
+ break
+
+ case 'application/json':
+ if (req.postData.jsonObj) {
+ options.body = req.postData.jsonObj
+ options.json = true
+ }
+ break
+
+ case 'multipart/form-data':
+ options.formData = {}
+
+ req.postData.params.forEach(function (param) {
+ var attachment = {}
+
+ if (!param.fileName && !param.fileName && !param.contentType) {
+ options.formData[param.name] = param.value
+ return
+ }
+
+ // attempt to read from disk!
+ if (param.fileName && !param.value) {
+ attachment.value = fs.createReadStream(param.fileName)
+ } else if (param.value) {
+ attachment.value = param.value
+ }
+
+ if (param.fileName) {
+ attachment.options = {
+ filename: param.fileName,
+ contentType: param.contentType ? param.contentType : null
+ }
+ }
+
+ options.formData[param.name] = attachment
+ })
+ break
+
+ default:
+ if (req.postData.text) {
+ options.body = req.postData.text
+ }
+ }
+
+ return options
+}
+
+exports.Har = Har
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/helpers.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/helpers.js b/node_modules/request/lib/helpers.js
new file mode 100644
index 0000000..8530d40
--- /dev/null
+++ b/node_modules/request/lib/helpers.js
@@ -0,0 +1,55 @@
+'use strict'
+
+var jsonSafeStringify = require('json-stringify-safe')
+ , crypto = require('crypto')
+
+function deferMethod() {
+ if(typeof setImmediate === 'undefined') {
+ return process.nextTick
+ }
+
+ return setImmediate
+}
+
+function isFunction(value) {
+ return typeof value === 'function'
+}
+
+function paramsHaveRequestBody(params) {
+ return (
+ params.body ||
+ params.requestBodyStream ||
+ (params.json && typeof params.json !== 'boolean') ||
+ params.multipart
+ )
+}
+
+function safeStringify (obj) {
+ var ret
+ try {
+ ret = JSON.stringify(obj)
+ } catch (e) {
+ ret = jsonSafeStringify(obj)
+ }
+ return ret
+}
+
+function md5 (str) {
+ return crypto.createHash('md5').update(str).digest('hex')
+}
+
+function isReadStream (rs) {
+ return rs.readable && rs.path && rs.mode
+}
+
+function toBase64 (str) {
+ return (new Buffer(str || '', 'utf8')).toString('base64')
+}
+
+exports.isFunction = isFunction
+exports.paramsHaveRequestBody = paramsHaveRequestBody
+exports.safeStringify = safeStringify
+exports.md5 = md5
+exports.isReadStream = isReadStream
+exports.toBase64 = toBase64
+exports.defer = deferMethod()
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/multipart.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/multipart.js b/node_modules/request/lib/multipart.js
new file mode 100644
index 0000000..905a54b
--- /dev/null
+++ b/node_modules/request/lib/multipart.js
@@ -0,0 +1,109 @@
+'use strict'
+
+var uuid = require('node-uuid')
+ , CombinedStream = require('combined-stream')
+ , isstream = require('isstream')
+
+
+function Multipart (request) {
+ this.request = request
+ this.boundary = uuid()
+ this.chunked = false
+ this.body = null
+}
+
+Multipart.prototype.isChunked = function (options) {
+ var self = this
+ , chunked = false
+ , parts = options.data || options
+
+ if (!parts.forEach) {
+ throw new Error('Argument error, options.multipart.')
+ }
+
+ if (options.chunked !== undefined) {
+ chunked = options.chunked
+ }
+
+ if (self.request.getHeader('transfer-encoding') === 'chunked') {
+ chunked = true
+ }
+
+ if (!chunked) {
+ parts.forEach(function (part) {
+ if(typeof part.body === 'undefined') {
+ throw new Error('Body attribute missing in multipart.')
+ }
+ if (isstream(part.body)) {
+ chunked = true
+ }
+ })
+ }
+
+ return chunked
+}
+
+Multipart.prototype.setHeaders = function (chunked) {
+ var self = this
+
+ if (chunked && !self.request.hasHeader('transfer-encoding')) {
+ self.request.setHeader('transfer-encoding', 'chunked')
+ }
+
+ var header = self.request.getHeader('content-type')
+
+ if (!header || header.indexOf('multipart') === -1) {
+ self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
+ } else {
+ if (header.indexOf('boundary') !== -1) {
+ self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
+ } else {
+ self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
+ }
+ }
+}
+
+Multipart.prototype.build = function (parts, chunked) {
+ var self = this
+ var body = chunked ? new CombinedStream() : []
+
+ function add (part) {
+ return chunked ? body.append(part) : body.push(new Buffer(part))
+ }
+
+ if (self.request.preambleCRLF) {
+ add('\r\n')
+ }
+
+ parts.forEach(function (part) {
+ var preamble = '--' + self.boundary + '\r\n'
+ Object.keys(part).forEach(function (key) {
+ if (key === 'body') { return }
+ preamble += key + ': ' + part[key] + '\r\n'
+ })
+ preamble += '\r\n'
+ add(preamble)
+ add(part.body)
+ add('\r\n')
+ })
+ add('--' + self.boundary + '--')
+
+ if (self.request.postambleCRLF) {
+ add('\r\n')
+ }
+
+ return body
+}
+
+Multipart.prototype.onRequest = function (options) {
+ var self = this
+
+ var chunked = self.isChunked(options)
+ , parts = options.data || options
+
+ self.setHeaders(chunked)
+ self.chunked = chunked
+ self.body = self.build(parts, chunked)
+}
+
+exports.Multipart = Multipart
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/oauth.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/oauth.js b/node_modules/request/lib/oauth.js
new file mode 100644
index 0000000..fc1cac6
--- /dev/null
+++ b/node_modules/request/lib/oauth.js
@@ -0,0 +1,125 @@
+'use strict'
+
+var qs = require('qs')
+ , caseless = require('caseless')
+ , uuid = require('node-uuid')
+ , oauth = require('oauth-sign')
+
+
+function OAuth (request) {
+ this.request = request
+}
+
+OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {
+ var oa = {}
+ for (var i in _oauth) {
+ oa['oauth_' + i] = _oauth[i]
+ }
+ if (!oa.oauth_version) {
+ oa.oauth_version = '1.0'
+ }
+ if (!oa.oauth_timestamp) {
+ oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString()
+ }
+ if (!oa.oauth_nonce) {
+ oa.oauth_nonce = uuid().replace(/-/g, '')
+ }
+ if (!oa.oauth_signature_method) {
+ oa.oauth_signature_method = 'HMAC-SHA1'
+ }
+
+ var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
+ delete oa.oauth_consumer_secret
+ delete oa.oauth_private_key
+
+ var token_secret = oa.oauth_token_secret
+ delete oa.oauth_token_secret
+
+ var realm = oa.oauth_realm
+ delete oa.oauth_realm
+ delete oa.oauth_transport_method
+
+ var baseurl = uri.protocol + '//' + uri.host + uri.pathname
+ var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
+
+ oa.oauth_signature = oauth.sign(
+ oa.oauth_signature_method,
+ method,
+ baseurl,
+ params,
+ consumer_secret_or_private_key,
+ token_secret)
+
+ if (realm) {
+ oa.realm = realm
+ }
+
+ return oa
+}
+
+OAuth.prototype.concatParams = function (oa, sep, wrap) {
+ wrap = wrap || ''
+
+ var params = Object.keys(oa).filter(function (i) {
+ return i !== 'realm' && i !== 'oauth_signature'
+ }).sort()
+
+ if (oa.realm) {
+ params.splice(0, 1, 'realm')
+ }
+ params.push('oauth_signature')
+
+ return params.map(function (i) {
+ return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
+ }).join(sep)
+}
+
+OAuth.prototype.onRequest = function (_oauth) {
+ var self = this
+ , request = self.request
+
+ var uri = request.uri || {}
+ , method = request.method || ''
+ , headers = caseless(request.headers)
+ , body = request.body || ''
+ , qsLib = request.qsLib || qs
+
+ var form
+ , query
+ , contentType = headers.get('content-type') || ''
+ , formContentType = 'application/x-www-form-urlencoded'
+ , transport = _oauth.transport_method || 'header'
+
+ if (contentType.slice(0, formContentType.length) === formContentType) {
+ contentType = formContentType
+ form = body
+ }
+ if (uri.query) {
+ query = uri.query
+ }
+ if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
+ throw new Error('oauth: transport_method of \'body\' requires \'POST\' ' +
+ 'and content-type \'' + formContentType + '\'')
+ }
+
+ var oa = this.buildParams(_oauth, uri, method, query, form, qsLib)
+
+ switch (transport) {
+ case 'header':
+ request.setHeader('Authorization', 'OAuth ' + this.concatParams(oa, ',', '"'))
+ break
+
+ case 'query':
+ request.path = (query ? '&' : '?') + this.concatParams(oa, '&')
+ break
+
+ case 'body':
+ request.body = (form ? form + '&' : '') + this.concatParams(oa, '&')
+ break
+
+ default:
+ throw new Error('oauth: transport_method invalid')
+ }
+}
+
+exports.OAuth = OAuth
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/lib/redirect.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/redirect.js b/node_modules/request/lib/redirect.js
new file mode 100644
index 0000000..7dd6c25
--- /dev/null
+++ b/node_modules/request/lib/redirect.js
@@ -0,0 +1,154 @@
+'use strict'
+
+var url = require('url')
+var isUrl = /^https?:/
+
+function Redirect (request) {
+ this.request = request
+ this.followRedirect = true
+ this.followRedirects = true
+ this.followAllRedirects = false
+ this.allowRedirect = function () {return true}
+ this.maxRedirects = 10
+ this.redirects = []
+ this.redirectsFollowed = 0
+ this.removeRefererHeader = false
+}
+
+Redirect.prototype.onRequest = function () {
+ var self = this
+ , request = self.request
+
+ if (request.maxRedirects !== undefined) {
+ self.maxRedirects = request.maxRedirects
+ }
+ if (typeof request.followRedirect === 'function') {
+ self.allowRedirect = request.followRedirect
+ }
+ if (request.followRedirect !== undefined) {
+ self.followRedirects = !!request.followRedirect
+ }
+ if (request.followAllRedirects !== undefined) {
+ self.followAllRedirects = request.followAllRedirects
+ }
+ if (self.followRedirects || self.followAllRedirects) {
+ self.redirects = self.redirects || []
+ }
+ if (request.removeRefererHeader !== undefined) {
+ self.removeRefererHeader = request.removeRefererHeader
+ }
+}
+
+Redirect.prototype.redirectTo = function (response) {
+ var self = this
+ , request = self.request
+
+ var redirectTo = null
+ if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
+ var location = response.caseless.get('location')
+ // debug('redirect', location)
+
+ if (self.followAllRedirects) {
+ redirectTo = location
+ } else if (self.followRedirects) {
+ switch (request.method) {
+ case 'PATCH':
+ case 'PUT':
+ case 'POST':
+ case 'DELETE':
+ // Do not follow redirects
+ break
+ default:
+ redirectTo = location
+ break
+ }
+ }
+ } else if (response.statusCode === 401) {
+ var authHeader = request._auth.onResponse(response)
+ if (authHeader) {
+ request.setHeader('authorization', authHeader)
+ redirectTo = request.uri
+ }
+ }
+ return redirectTo
+}
+
+Redirect.prototype.onResponse = function (response) {
+ var self = this
+ , request = self.request
+
+ var redirectTo = self.redirectTo(response)
+ if (!redirectTo || !self.allowRedirect.call(request, response)) {
+ return false
+ }
+
+
+ // debug('redirect to', redirectTo)
+
+ // ignore any potential response body. it cannot possibly be useful
+ // to us at this point.
+ if (request._paused) {
+ response.resume()
+ }
+
+ if (self.redirectsFollowed >= self.maxRedirects) {
+ request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))
+ return false
+ }
+ self.redirectsFollowed += 1
+
+ if (!isUrl.test(redirectTo)) {
+ redirectTo = url.resolve(request.uri.href, redirectTo)
+ }
+
+ var uriPrev = request.uri
+ request.uri = url.parse(redirectTo)
+
+ // handle the case where we change protocol from https to http or vice versa
+ if (request.uri.protocol !== uriPrev.protocol) {
+ request._updateProtocol()
+ }
+
+ self.redirects.push(
+ { statusCode : response.statusCode
+ , redirectUri: redirectTo
+ }
+ )
+ if (self.followAllRedirects && response.statusCode !== 401 && response.statusCode !== 307) {
+ request.method = 'GET'
+ }
+ // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
+ delete request.src
+ delete request.req
+ delete request.agent
+ delete request._started
+ if (response.statusCode !== 401 && response.statusCode !== 307) {
+ // Remove parameters from the previous response, unless this is the second request
+ // for a server that requires digest authentication.
+ delete request.body
+ delete request._form
+ if (request.headers) {
+ request.removeHeader('host')
+ request.removeHeader('content-type')
+ request.removeHeader('content-length')
+ if (request.uri.hostname !== request.originalHost.split(':')[0]) {
+ // Remove authorization if changing hostnames (but not if just
+ // changing ports or protocols). This matches the behavior of curl:
+ // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
+ request.removeHeader('authorization')
+ }
+ }
+ }
+
+ if (!self.removeRefererHeader) {
+ request.setHeader('referer', request.uri.href)
+ }
+
+ request.emit('redirect')
+
+ request.init()
+
+ return true
+}
+
+exports.Redirect = Redirect
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000..b513d61
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,89 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ return keys;
+}
+/*</replacement>*/
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+forEach(objectKeys(Writable.prototype), function(method) {
+ if (!Duplex.prototype[method])
+ Duplex.prototype[method] = Writable.prototype[method];
+});
+
+function Duplex(options) {
+ if (!(this instanceof Duplex))
+ return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false)
+ this.readable = false;
+
+ if (options && options.writable === false)
+ this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false)
+ this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended)
+ return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ process.nextTick(this.end.bind(this));
+}
+
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000..895ca50
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,46 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough))
+ return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function(chunk, encoding, cb) {
+ cb(null, chunk);
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000..6307220
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,982 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module.exports = Readable;
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+var EE = require('events').EventEmitter;
+
+/*<replacement>*/
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
+ return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+var Stream = require('stream');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+function ReadableState(options, stream) {
+ options = options || {};
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.buffer = [];
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = false;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // In streams that never have any data, and do push(null) right away,
+ // the consumer can miss the 'end' event if they do some I/O before
+ // consuming the stream. So, we don't emit('end') until some reading
+ // happens.
+ this.calledRead = false;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, becuase any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // when piping, we only care about 'readable' events that happen
+ // after read()ing all the bytes and not getting any pushback.
+ this.ranOut = false;
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+
+function Readable(options) {
+ if (!(this instanceof Readable))
+ return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ Stream.call(this);
+}
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function(chunk, encoding) {
+ var state = this._readableState;
+
+ if (typeof chunk === 'string' && !state.objectMode) {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = new Buffer(chunk, encoding);
+ encoding = '';
+ }
+ }
+
+ return readableAddChunk(this, state, chunk, encoding, false);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function(chunk) {
+ var state = this._readableState;
+ return readableAddChunk(this, state, chunk, '', true);
+};
+
+function readableAddChunk(stream, state, chunk, encoding, addToFront) {
+ var er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (chunk === null || chunk === undefined) {
+ state.reading = false;
+ if (!state.ended)
+ onEofChunk(stream, state);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (state.ended && !addToFront) {
+ var e = new Error('stream.push() after EOF');
+ stream.emit('error', e);
+ } else if (state.endEmitted && addToFront) {
+ var e = new Error('stream.unshift() after end event');
+ stream.emit('error', e);
+ } else {
+ if (state.decoder && !addToFront && !encoding)
+ chunk = state.decoder.write(chunk);
+
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront) {
+ state.buffer.unshift(chunk);
+ } else {
+ state.reading = false;
+ state.buffer.push(chunk);
+ }
+
+ if (state.needReadable)
+ emitReadable(stream);
+
+ maybeReadMore(stream, state);
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ }
+
+ return needMoreData(state);
+}
+
+
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended &&
+ (state.needReadable ||
+ state.length < state.highWaterMark ||
+ state.length === 0);
+}
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function(enc) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+ this._readableState.encoding = enc;
+};
+
+// Don't raise the hwm > 128MB
+var MAX_HWM = 0x800000;
+function roundUpToNextPowerOf2(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2
+ n--;
+ for (var p = 1; p < 32; p <<= 1) n |= n >> p;
+ n++;
+ }
+ return n;
+}
+
+function howMuchToRead(n, state) {
+ if (state.length === 0 && state.ended)
+ return 0;
+
+ if (state.objectMode)
+ return n === 0 ? 0 : 1;
+
+ if (n === null || isNaN(n)) {
+ // only flow one buffer at a time
+ if (state.flowing && state.buffer.length)
+ return state.buffer[0].length;
+ else
+ return state.length;
+ }
+
+ if (n <= 0)
+ return 0;
+
+ // If we're asking for more than the target buffer level,
+ // then raise the water mark. Bump up to the next highest
+ // power of 2, to prevent increasing it excessively in tiny
+ // amounts.
+ if (n > state.highWaterMark)
+ state.highWaterMark = roundUpToNextPowerOf2(n);
+
+ // don't have that much. return null, unless we've ended.
+ if (n > state.length) {
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ } else
+ return state.length;
+ }
+
+ return n;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function(n) {
+ var state = this._readableState;
+ state.calledRead = true;
+ var nOrig = n;
+ var ret;
+
+ if (typeof n !== 'number' || n > 0)
+ state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 &&
+ state.needReadable &&
+ (state.length >= state.highWaterMark || state.ended)) {
+ emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ ret = null;
+
+ // In cases where the decoder did not receive enough data
+ // to produce a full chunk, then immediately received an
+ // EOF, state.buffer will contain [<Buffer >, <Buffer 00 ...>].
+ // howMuchToRead will see this and coerce the amount to
+ // read to zero (because it's looking at the length of the
+ // first <Buffer > in state.buffer), and we'll end up here.
+ //
+ // This can only happen via state.decoder -- no other venue
+ // exists for pushing a zero-length chunk into state.buffer
+ // and triggering this behavior. In this case, we return our
+ // remaining data and end the stream, if appropriate.
+ if (state.length > 0 && state.decoder) {
+ ret = fromList(n, state);
+ state.length -= ret.length;
+ }
+
+ if (state.length === 0)
+ endReadable(this);
+
+ return ret;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length - n <= state.highWaterMark)
+ doRead = true;
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading)
+ doRead = false;
+
+ if (doRead) {
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0)
+ state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ }
+
+ // If _read called its callback synchronously, then `reading`
+ // will be false, and we need to re-evaluate how much data we
+ // can return to the user.
+ if (doRead && !state.reading)
+ n = howMuchToRead(nOrig, state);
+
+ if (n > 0)
+ ret = fromList(n, state);
+ else
+ ret = null;
+
+ if (ret === null) {
+ state.needReadable = true;
+ n = 0;
+ }
+
+ state.length -= n;
+
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (state.length === 0 && !state.ended)
+ state.needReadable = true;
+
+ // If we happened to read() exactly the remaining amount in the
+ // buffer, and the EOF has been seen at this point, then make sure
+ // that we emit 'end' on the very next tick.
+ if (state.ended && !state.endEmitted && state.length === 0)
+ endReadable(this);
+
+ return ret;
+};
+
+function chunkInvalid(state, chunk) {
+ var er = null;
+ if (!Buffer.isBuffer(chunk) &&
+ 'string' !== typeof chunk &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+
+function onEofChunk(stream, state) {
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // if we've ended and we have some data left, then emit
+ // 'readable' now to make sure it gets picked up.
+ if (state.length > 0)
+ emitReadable(stream);
+ else
+ endReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (state.emittedReadable)
+ return;
+
+ state.emittedReadable = true;
+ if (state.sync)
+ process.nextTick(function() {
+ emitReadable_(stream);
+ });
+ else
+ emitReadable_(stream);
+}
+
+function emitReadable_(stream) {
+ stream.emit('readable');
+}
+
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ process.nextTick(function() {
+ maybeReadMore_(stream, state);
+ });
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended &&
+ state.length < state.highWaterMark) {
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;
+ else
+ len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function(n) {
+ this.emit('error', new Error('not implemented'));
+};
+
+Readable.prototype.pipe = function(dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
+ dest !== process.stdout &&
+ dest !== process.stderr;
+
+ var endFn = doEnd ? onend : cleanup;
+ if (state.endEmitted)
+ process.nextTick(endFn);
+ else
+ src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable) {
+ if (readable !== src) return;
+ cleanup();
+ }
+
+ function onend() {
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ function cleanup() {
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', cleanup);
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (!dest._writableState || dest._writableState.needDrain)
+ ondrain();
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EE.listenerCount(dest, 'error') === 0)
+ dest.emit('error', er);
+ }
+ // This is a brutally ugly hack to make sure that our error handler
+ // is attached before any userland ones. NEVER DO THIS.
+ if (!dest._events || !dest._events.error)
+ dest.on('error', onerror);
+ else if (isArray(dest._events.error))
+ dest._events.error.unshift(onerror);
+ else
+ dest._events.error = [onerror, dest._events.error];
+
+
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ // the handler that waits for readable events after all
+ // the data gets sucked out in flow.
+ // This would be easier to follow with a .once() handler
+ // in flow(), but that is too slow.
+ this.on('readable', pipeOnReadable);
+
+ state.flowing = true;
+ process.nextTick(function() {
+ flow(src);
+ });
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function() {
+ var dest = this;
+ var state = src._readableState;
+ state.awaitDrain--;
+ if (state.awaitDrain === 0)
+ flow(src);
+ };
+}
+
+function flow(src) {
+ var state = src._readableState;
+ var chunk;
+ state.awaitDrain = 0;
+
+ function write(dest, i, list) {
+ var written = dest.write(chunk);
+ if (false === written) {
+ state.awaitDrain++;
+ }
+ }
+
+ while (state.pipesCount && null !== (chunk = src.read())) {
+
+ if (state.pipesCount === 1)
+ write(state.pipes, 0, null);
+ else
+ forEach(state.pipes, write);
+
+ src.emit('data', chunk);
+
+ // if anyone needs a drain, then we have to wait for that.
+ if (state.awaitDrain > 0)
+ return;
+ }
+
+ // if every destination was unpiped, either before entering this
+ // function, or in the while loop, then stop flowing.
+ //
+ // NB: This is a pretty rare edge case.
+ if (state.pipesCount === 0) {
+ state.flowing = false;
+
+ // if there were data event listeners added, then switch to old mode.
+ if (EE.listenerCount(src, 'data') > 0)
+ emitDataEvents(src);
+ return;
+ }
+
+ // at this point, no one needed a drain, so we just ran out of data
+ // on the next readable event, start it over again.
+ state.ranOut = true;
+}
+
+function pipeOnReadable() {
+ if (this._readableState.ranOut) {
+ this._readableState.ranOut = false;
+ flow(this);
+ }
+}
+
+
+Readable.prototype.unpipe = function(dest) {
+ var state = this._readableState;
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0)
+ return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes)
+ return this;
+
+ if (!dest)
+ dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ this.removeListener('readable', pipeOnReadable);
+ state.flowing = false;
+ if (dest)
+ dest.emit('unpipe', this);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ this.removeListener('readable', pipeOnReadable);
+ state.flowing = false;
+
+ for (var i = 0; i < len; i++)
+ dests[i].emit('unpipe', this);
+ return this;
+ }
+
+ // try to find the right one.
+ var i = indexOf(state.pipes, dest);
+ if (i === -1)
+ return this;
+
+ state.pipes.splice(i, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1)
+ state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function(ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ if (ev === 'data' && !this._readableState.flowing)
+ emitDataEvents(this);
+
+ if (ev === 'readable' && this.readable) {
+ var state = this._readableState;
+ if (!state.readableListening) {
+ state.readableListening = true;
+ state.emittedReadable = false;
+ state.needReadable = true;
+ if (!state.reading) {
+ this.read(0);
+ } else if (state.length) {
+ emitReadable(this, state);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function() {
+ emitDataEvents(this);
+ this.read(0);
+ this.emit('resume');
+};
+
+Readable.prototype.pause = function() {
+ emitDataEvents(this, true);
+ this.emit('pause');
+};
+
+function emitDataEvents(stream, startPaused) {
+ var state = stream._readableState;
+
+ if (state.flowing) {
+ // https://github.com/isaacs/readable-stream/issues/16
+ throw new Error('Cannot switch to old mode now.');
+ }
+
+ var paused = startPaused || false;
+ var readable = false;
+
+ // convert to an old-style stream.
+ stream.readable = true;
+ stream.pipe = Stream.prototype.pipe;
+ stream.on = stream.addListener = Stream.prototype.on;
+
+ stream.on('readable', function() {
+ readable = true;
+
+ var c;
+ while (!paused && (null !== (c = stream.read())))
+ stream.emit('data', c);
+
+ if (c === null) {
+ readable = false;
+ stream._readableState.needReadable = true;
+ }
+ });
+
+ stream.pause = function() {
+ paused = true;
+ this.emit('pause');
+ };
+
+ stream.resume = function() {
+ paused = false;
+ if (readable)
+ process.nextTick(function() {
+ stream.emit('readable');
+ });
+ else
+ this.read(0);
+ this.emit('resume');
+ };
+
+ // now make it start, just in case it hadn't already.
+ stream.emit('readable');
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function(stream) {
+ var state = this._readableState;
+ var paused = false;
+
+ var self = this;
+ stream.on('end', function() {
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length)
+ self.push(chunk);
+ }
+
+ self.push(null);
+ });
+
+ stream.on('data', function(chunk) {
+ if (state.decoder)
+ chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ //if (state.objectMode && util.isNullOrUndefined(chunk))
+ if (state.objectMode && (chunk === null || chunk === undefined))
+ return;
+ else if (!state.objectMode && (!chunk || !chunk.length))
+ return;
+
+ var ret = self.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (typeof stream[i] === 'function' &&
+ typeof this[i] === 'undefined') {
+ this[i] = function(method) { return function() {
+ return stream[method].apply(stream, arguments);
+ }}(i);
+ }
+ }
+
+ // proxy certain important events.
+ var events = ['error', 'close', 'destroy', 'pause', 'resume'];
+ forEach(events, function(ev) {
+ stream.on(ev, self.emit.bind(self, ev));
+ });
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ self._read = function(n) {
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+
+ return self;
+};
+
+
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+function fromList(n, state) {
+ var list = state.buffer;
+ var length = state.length;
+ var stringMode = !!state.decoder;
+ var objectMode = !!state.objectMode;
+ var ret;
+
+ // nothing in the list, definitely empty.
+ if (list.length === 0)
+ return null;
+
+ if (length === 0)
+ ret = null;
+ else if (objectMode)
+ ret = list.shift();
+ else if (!n || n >= length) {
+ // read it all, truncate the array.
+ if (stringMode)
+ ret = list.join('');
+ else
+ ret = Buffer.concat(list, length);
+ list.length = 0;
+ } else {
+ // read just some of it.
+ if (n < list[0].length) {
+ // just take a part of the first list item.
+ // slice is the same for buffers and strings.
+ var buf = list[0];
+ ret = buf.slice(0, n);
+ list[0] = buf.slice(n);
+ } else if (n === list[0].length) {
+ // first list is a perfect match
+ ret = list.shift();
+ } else {
+ // complex case.
+ // we have enough to cover it, but it spans past the first buffer.
+ if (stringMode)
+ ret = '';
+ else
+ ret = new Buffer(n);
+
+ var c = 0;
+ for (var i = 0, l = list.length; i < l && c < n; i++) {
+ var buf = list[0];
+ var cpy = Math.min(n - c, buf.length);
+
+ if (stringMode)
+ ret += buf.slice(0, cpy);
+ else
+ buf.copy(ret, c, 0, cpy);
+
+ if (cpy < buf.length)
+ list[0] = buf.slice(cpy);
+ else
+ list.shift();
+
+ c += cpy;
+ }
+ }
+ }
+
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0)
+ throw new Error('endReadable called on non-empty stream');
+
+ if (!state.endEmitted && state.calledRead) {
+ state.ended = true;
+ process.nextTick(function() {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+ });
+ }
+}
+
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
+
+function indexOf (xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+}
[10/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
fix broken deps
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/a67e6ba7
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/a67e6ba7
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/a67e6ba7
Branch: refs/heads/master
Commit: a67e6ba7849dd8367acf0ff5d0ad655ba12c500b
Parents: b5d3262
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri May 22 22:27:48 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Fri May 22 23:13:35 2015 +0200
----------------------------------------------------------------------
.../node_modules/proto-list/LICENSE | 32 +-
.../node_modules/proto-list/package.json | 33 +-
node_modules/nopt/LICENSE | 32 +-
node_modules/nopt/lib/nopt.js | 414 +++++
node_modules/nopt/node_modules/abbrev/LICENSE | 32 +-
.../nopt/node_modules/abbrev/package.json | 32 +-
node_modules/nopt/package.json | 33 +-
node_modules/npmlog/LICENSE | 36 +-
node_modules/npmlog/log.js | 4 +-
.../npmlog/node_modules/ansi/lib/ansi.js | 405 +++++
.../npmlog/node_modules/ansi/lib/newlines.js | 71 +
.../readable-stream/lib/_stream_duplex.js | 89 +
.../readable-stream/lib/_stream_passthrough.js | 46 +
.../readable-stream/lib/_stream_readable.js | 951 +++++++++++
.../readable-stream/lib/_stream_transform.js | 209 +++
.../readable-stream/lib/_stream_writable.js | 477 ++++++
.../node_modules/core-util-is/lib/util.js | 107 ++
node_modules/npmlog/package.json | 31 +-
node_modules/osenv/LICENSE | 36 +-
node_modules/osenv/package.json | 41 +-
node_modules/request/lib/auth.js | 153 ++
node_modules/request/lib/cookies.js | 39 +
node_modules/request/lib/copy.js | 10 +
node_modules/request/lib/getProxyFromURI.js | 79 +
node_modules/request/lib/har.js | 205 +++
node_modules/request/lib/helpers.js | 55 +
node_modules/request/lib/multipart.js | 109 ++
node_modules/request/lib/oauth.js | 125 ++
node_modules/request/lib/redirect.js | 154 ++
.../readable-stream/lib/_stream_duplex.js | 89 +
.../readable-stream/lib/_stream_passthrough.js | 46 +
.../readable-stream/lib/_stream_readable.js | 982 +++++++++++
.../readable-stream/lib/_stream_transform.js | 210 +++
.../readable-stream/lib/_stream_writable.js | 386 +++++
.../node_modules/core-util-is/lib/util.js | 107 ++
.../combined-stream/lib/combined_stream.js | 188 ++
.../delayed-stream/lib/delayed_stream.js | 99 ++
.../node_modules/form-data/lib/form_data.js | 351 ++++
.../form-data/node_modules/async/.travis.yml | 2 +
.../form-data/node_modules/async/README.md | 65 +-
.../form-data/node_modules/async/bower.json | 38 +
.../form-data/node_modules/async/component.json | 21 +-
.../form-data/node_modules/async/lib/async.js | 1123 ++++++++++++
.../form-data/node_modules/async/package.json | 66 +-
.../async/support/sync-package-managers.js | 53 +
.../generate-object-property/index.js | 6 +-
.../generate-object-property/package.json | 18 +-
.../request/node_modules/hawk/lib/browser.js | 641 +++++++
.../request/node_modules/hawk/lib/client.js | 369 ++++
.../request/node_modules/hawk/lib/crypto.js | 126 ++
.../request/node_modules/hawk/lib/index.js | 15 +
.../request/node_modules/hawk/lib/server.js | 534 ++++++
.../request/node_modules/hawk/lib/utils.js | 164 ++
.../hawk/node_modules/boom/README.md | 7 +
.../hawk/node_modules/boom/lib/index.js | 293 ++++
.../hawk/node_modules/boom/package.json | 23 +-
.../hawk/node_modules/cryptiles/lib/index.js | 68 +
.../hawk/node_modules/hoek/README.md | 18 +
.../hawk/node_modules/hoek/lib/escape.js | 132 ++
.../hawk/node_modules/hoek/lib/index.js | 977 +++++++++++
.../hawk/node_modules/hoek/package.json | 25 +-
.../hawk/node_modules/hoek/test/index.js | 1606 ++++++++++--------
.../hawk/node_modules/sntp/lib/index.js | 412 +++++
.../node_modules/http-signature/lib/index.js | 26 +
.../node_modules/http-signature/lib/parser.js | 304 ++++
.../node_modules/http-signature/lib/signer.js | 178 ++
.../node_modules/http-signature/lib/util.js | 304 ++++
.../node_modules/http-signature/lib/verify.js | 42 +
.../node_modules/asn1/lib/ber/errors.js | 13 +
.../node_modules/asn1/lib/ber/index.js | 27 +
.../node_modules/asn1/lib/ber/reader.js | 267 +++
.../node_modules/asn1/lib/ber/types.js | 36 +
.../node_modules/asn1/lib/ber/writer.js | 317 ++++
.../node_modules/asn1/lib/index.js | 20 +
.../ctype/man/man3ctype/ctio.3ctype | 241 +++
.../node_modules/json-stringify-safe/.npmignore | 1 +
.../json-stringify-safe/CHANGELOG.md | 14 +
.../node_modules/json-stringify-safe/LICENSE | 36 +-
.../node_modules/json-stringify-safe/Makefile | 35 +
.../node_modules/json-stringify-safe/README.md | 3 +
.../json-stringify-safe/package.json | 64 +-
.../json-stringify-safe/stringify.js | 54 +-
.../node_modules/json-stringify-safe/test.js | 128 --
.../json-stringify-safe/test/mocha.opts | 2 +
.../json-stringify-safe/test/stringify_test.js | 246 +++
.../request/node_modules/mime-types/HISTORY.md | 6 +
.../mime-types/node_modules/mime-db/HISTORY.md | 7 +
.../mime-types/node_modules/mime-db/db.json | 14 +-
.../node_modules/mime-db/package.json | 28 +-
.../node_modules/mime-types/package.json | 16 +-
.../request/node_modules/qs/lib/index.js | 15 +
.../request/node_modules/qs/lib/parse.js | 157 ++
.../request/node_modules/qs/lib/stringify.js | 97 ++
.../request/node_modules/qs/lib/utils.js | 132 ++
.../node_modules/tough-cookie/lib/cookie.js | 1137 +++++++++++++
.../node_modules/tough-cookie/lib/memstore.js | 143 ++
.../node_modules/tough-cookie/lib/pubsuffix.js | 98 ++
.../node_modules/tough-cookie/lib/store.js | 67 +
98 files changed, 16303 insertions(+), 1272 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/config-chain/node_modules/proto-list/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/config-chain/node_modules/proto-list/LICENSE b/node_modules/config-chain/node_modules/proto-list/LICENSE
index 05a4010..19129e3 100644
--- a/node_modules/config-chain/node_modules/proto-list/LICENSE
+++ b/node_modules/config-chain/node_modules/proto-list/LICENSE
@@ -1,23 +1,15 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
+The ISC License
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
+Copyright (c) Isaac Z. Schlueter and Contributors
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/config-chain/node_modules/proto-list/package.json
----------------------------------------------------------------------
diff --git a/node_modules/config-chain/node_modules/proto-list/package.json b/node_modules/config-chain/node_modules/proto-list/package.json
index f5b39aa..458621a 100644
--- a/node_modules/config-chain/node_modules/proto-list/package.json
+++ b/node_modules/config-chain/node_modules/proto-list/package.json
@@ -1,6 +1,6 @@
{
"name": "proto-list",
- "version": "1.2.3",
+ "version": "1.2.4",
"description": "A utility for managing a prototype chain",
"main": "./proto-list.js",
"author": {
@@ -13,27 +13,29 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/isaacs/proto-list"
- },
- "license": {
- "type": "MIT",
- "url": "https://github.com/isaacs/proto-list/blob/master/LICENSE"
+ "url": "git+https://github.com/isaacs/proto-list.git"
},
+ "license": "ISC",
"devDependencies": {
"tap": "0"
},
- "gitHead": "44d76897176861d176a53ed3f3fc5e05cdee7643",
+ "gitHead": "9e4af12d4dddee2fd531f0fe0c21c9cfacb78ac0",
"bugs": {
"url": "https://github.com/isaacs/proto-list/issues"
},
- "homepage": "https://github.com/isaacs/proto-list",
- "_id": "proto-list@1.2.3",
- "_shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9",
+ "homepage": "https://github.com/isaacs/proto-list#readme",
+ "_id": "proto-list@1.2.4",
+ "_shasum": "212d5bfe1318306a420f6402b8e26ff39647a849",
"_from": "proto-list@>=1.2.1 <1.3.0",
- "_npmVersion": "1.4.14",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
"name": "isaacs",
- "email": "i@izs.me"
+ "email": "isaacs@npmjs.com"
+ },
+ "dist": {
+ "shasum": "212d5bfe1318306a420f6402b8e26ff39647a849",
+ "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz"
},
"maintainers": [
{
@@ -41,11 +43,6 @@
"email": "i@izs.me"
}
],
- "dist": {
- "shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9",
- "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/nopt/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/nopt/LICENSE b/node_modules/nopt/LICENSE
index 05a4010..19129e3 100644
--- a/node_modules/nopt/LICENSE
+++ b/node_modules/nopt/LICENSE
@@ -1,23 +1,15 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
+The ISC License
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
+Copyright (c) Isaac Z. Schlueter and Contributors
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/nopt/lib/nopt.js
----------------------------------------------------------------------
diff --git a/node_modules/nopt/lib/nopt.js b/node_modules/nopt/lib/nopt.js
new file mode 100644
index 0000000..5309a00
--- /dev/null
+++ b/node_modules/nopt/lib/nopt.js
@@ -0,0 +1,414 @@
+// info about each config option.
+
+var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
+ ? function () { console.error.apply(console, arguments) }
+ : function () {}
+
+var url = require("url")
+ , path = require("path")
+ , Stream = require("stream").Stream
+ , abbrev = require("abbrev")
+
+module.exports = exports = nopt
+exports.clean = clean
+
+exports.typeDefs =
+ { String : { type: String, validate: validateString }
+ , Boolean : { type: Boolean, validate: validateBoolean }
+ , url : { type: url, validate: validateUrl }
+ , Number : { type: Number, validate: validateNumber }
+ , path : { type: path, validate: validatePath }
+ , Stream : { type: Stream, validate: validateStream }
+ , Date : { type: Date, validate: validateDate }
+ }
+
+function nopt (types, shorthands, args, slice) {
+ args = args || process.argv
+ types = types || {}
+ shorthands = shorthands || {}
+ if (typeof slice !== "number") slice = 2
+
+ debug(types, shorthands, args, slice)
+
+ args = args.slice(slice)
+ var data = {}
+ , key
+ , remain = []
+ , cooked = args
+ , original = args.slice(0)
+
+ parse(args, data, remain, types, shorthands)
+ // now data is full
+ clean(data, types, exports.typeDefs)
+ data.argv = {remain:remain,cooked:cooked,original:original}
+ Object.defineProperty(data.argv, 'toString', { value: function () {
+ return this.original.map(JSON.stringify).join(" ")
+ }, enumerable: false })
+ return data
+}
+
+function clean (data, types, typeDefs) {
+ typeDefs = typeDefs || exports.typeDefs
+ var remove = {}
+ , typeDefault = [false, true, null, String, Array]
+
+ Object.keys(data).forEach(function (k) {
+ if (k === "argv") return
+ var val = data[k]
+ , isArray = Array.isArray(val)
+ , type = types[k]
+ if (!isArray) val = [val]
+ if (!type) type = typeDefault
+ if (type === Array) type = typeDefault.concat(Array)
+ if (!Array.isArray(type)) type = [type]
+
+ debug("val=%j", val)
+ debug("types=", type)
+ val = val.map(function (val) {
+ // if it's an unknown value, then parse false/true/null/numbers/dates
+ if (typeof val === "string") {
+ debug("string %j", val)
+ val = val.trim()
+ if ((val === "null" && ~type.indexOf(null))
+ || (val === "true" &&
+ (~type.indexOf(true) || ~type.indexOf(Boolean)))
+ || (val === "false" &&
+ (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
+ val = JSON.parse(val)
+ debug("jsonable %j", val)
+ } else if (~type.indexOf(Number) && !isNaN(val)) {
+ debug("convert to number", val)
+ val = +val
+ } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
+ debug("convert to date", val)
+ val = new Date(val)
+ }
+ }
+
+ if (!types.hasOwnProperty(k)) {
+ return val
+ }
+
+ // allow `--no-blah` to set 'blah' to null if null is allowed
+ if (val === false && ~type.indexOf(null) &&
+ !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
+ val = null
+ }
+
+ var d = {}
+ d[k] = val
+ debug("prevalidated val", d, val, types[k])
+ if (!validate(d, k, val, types[k], typeDefs)) {
+ if (exports.invalidHandler) {
+ exports.invalidHandler(k, val, types[k], data)
+ } else if (exports.invalidHandler !== false) {
+ debug("invalid: "+k+"="+val, types[k])
+ }
+ return remove
+ }
+ debug("validated val", d, val, types[k])
+ return d[k]
+ }).filter(function (val) { return val !== remove })
+
+ if (!val.length) delete data[k]
+ else if (isArray) {
+ debug(isArray, data[k], val)
+ data[k] = val
+ } else data[k] = val[0]
+
+ debug("k=%s val=%j", k, val, data[k])
+ })
+}
+
+function validateString (data, k, val) {
+ data[k] = String(val)
+}
+
+function validatePath (data, k, val) {
+ if (val === true) return false
+ if (val === null) return true
+
+ val = String(val)
+ var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//
+ if (val.match(homePattern) && process.env.HOME) {
+ val = path.resolve(process.env.HOME, val.substr(2))
+ }
+ data[k] = path.resolve(String(val))
+ return true
+}
+
+function validateNumber (data, k, val) {
+ debug("validate Number %j %j %j", k, val, isNaN(val))
+ if (isNaN(val)) return false
+ data[k] = +val
+}
+
+function validateDate (data, k, val) {
+ debug("validate Date %j %j %j", k, val, Date.parse(val))
+ var s = Date.parse(val)
+ if (isNaN(s)) return false
+ data[k] = new Date(val)
+}
+
+function validateBoolean (data, k, val) {
+ if (val instanceof Boolean) val = val.valueOf()
+ else if (typeof val === "string") {
+ if (!isNaN(val)) val = !!(+val)
+ else if (val === "null" || val === "false") val = false
+ else val = true
+ } else val = !!val
+ data[k] = val
+}
+
+function validateUrl (data, k, val) {
+ val = url.parse(String(val))
+ if (!val.host) return false
+ data[k] = val.href
+}
+
+function validateStream (data, k, val) {
+ if (!(val instanceof Stream)) return false
+ data[k] = val
+}
+
+function validate (data, k, val, type, typeDefs) {
+ // arrays are lists of types.
+ if (Array.isArray(type)) {
+ for (var i = 0, l = type.length; i < l; i ++) {
+ if (type[i] === Array) continue
+ if (validate(data, k, val, type[i], typeDefs)) return true
+ }
+ delete data[k]
+ return false
+ }
+
+ // an array of anything?
+ if (type === Array) return true
+
+ // NaN is poisonous. Means that something is not allowed.
+ if (type !== type) {
+ debug("Poison NaN", k, val, type)
+ delete data[k]
+ return false
+ }
+
+ // explicit list of values
+ if (val === type) {
+ debug("Explicitly allowed %j", val)
+ // if (isArray) (data[k] = data[k] || []).push(val)
+ // else data[k] = val
+ data[k] = val
+ return true
+ }
+
+ // now go through the list of typeDefs, validate against each one.
+ var ok = false
+ , types = Object.keys(typeDefs)
+ for (var i = 0, l = types.length; i < l; i ++) {
+ debug("test type %j %j %j", k, val, types[i])
+ var t = typeDefs[types[i]]
+ if (t && type === t.type) {
+ var d = {}
+ ok = false !== t.validate(d, k, val)
+ val = d[k]
+ if (ok) {
+ // if (isArray) (data[k] = data[k] || []).push(val)
+ // else data[k] = val
+ data[k] = val
+ break
+ }
+ }
+ }
+ debug("OK? %j (%j %j %j)", ok, k, val, types[i])
+
+ if (!ok) delete data[k]
+ return ok
+}
+
+function parse (args, data, remain, types, shorthands) {
+ debug("parse", args, data, remain)
+
+ var key = null
+ , abbrevs = abbrev(Object.keys(types))
+ , shortAbbr = abbrev(Object.keys(shorthands))
+
+ for (var i = 0; i < args.length; i ++) {
+ var arg = args[i]
+ debug("arg", arg)
+
+ if (arg.match(/^-{2,}$/)) {
+ // done with keys.
+ // the rest are args.
+ remain.push.apply(remain, args.slice(i + 1))
+ args[i] = "--"
+ break
+ }
+ var hadEq = false
+ if (arg.charAt(0) === "-" && arg.length > 1) {
+ if (arg.indexOf("=") !== -1) {
+ hadEq = true
+ var v = arg.split("=")
+ arg = v.shift()
+ v = v.join("=")
+ args.splice.apply(args, [i, 1].concat([arg, v]))
+ }
+
+ // see if it's a shorthand
+ // if so, splice and back up to re-parse it.
+ var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
+ debug("arg=%j shRes=%j", arg, shRes)
+ if (shRes) {
+ debug(arg, shRes)
+ args.splice.apply(args, [i, 1].concat(shRes))
+ if (arg !== shRes[0]) {
+ i --
+ continue
+ }
+ }
+ arg = arg.replace(/^-+/, "")
+ var no = null
+ while (arg.toLowerCase().indexOf("no-") === 0) {
+ no = !no
+ arg = arg.substr(3)
+ }
+
+ if (abbrevs[arg]) arg = abbrevs[arg]
+
+ var isArray = types[arg] === Array ||
+ Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1
+
+ // allow unknown things to be arrays if specified multiple times.
+ if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
+ if (!Array.isArray(data[arg]))
+ data[arg] = [data[arg]]
+ isArray = true
+ }
+
+ var val
+ , la = args[i + 1]
+
+ var isBool = typeof no === 'boolean' ||
+ types[arg] === Boolean ||
+ Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 ||
+ (typeof types[arg] === 'undefined' && !hadEq) ||
+ (la === "false" &&
+ (types[arg] === null ||
+ Array.isArray(types[arg]) && ~types[arg].indexOf(null)))
+
+ if (isBool) {
+ // just set and move along
+ val = !no
+ // however, also support --bool true or --bool false
+ if (la === "true" || la === "false") {
+ val = JSON.parse(la)
+ la = null
+ if (no) val = !val
+ i ++
+ }
+
+ // also support "foo":[Boolean, "bar"] and "--foo bar"
+ if (Array.isArray(types[arg]) && la) {
+ if (~types[arg].indexOf(la)) {
+ // an explicit type
+ val = la
+ i ++
+ } else if ( la === "null" && ~types[arg].indexOf(null) ) {
+ // null allowed
+ val = null
+ i ++
+ } else if ( !la.match(/^-{2,}[^-]/) &&
+ !isNaN(la) &&
+ ~types[arg].indexOf(Number) ) {
+ // number
+ val = +la
+ i ++
+ } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) {
+ // string
+ val = la
+ i ++
+ }
+ }
+
+ if (isArray) (data[arg] = data[arg] || []).push(val)
+ else data[arg] = val
+
+ continue
+ }
+
+ if (types[arg] === String && la === undefined)
+ la = ""
+
+ if (la && la.match(/^-{2,}$/)) {
+ la = undefined
+ i --
+ }
+
+ val = la === undefined ? true : la
+ if (isArray) (data[arg] = data[arg] || []).push(val)
+ else data[arg] = val
+
+ i ++
+ continue
+ }
+ remain.push(arg)
+ }
+}
+
+function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
+ // handle single-char shorthands glommed together, like
+ // npm ls -glp, but only if there is one dash, and only if
+ // all of the chars are single-char shorthands, and it's
+ // not a match to some other abbrev.
+ arg = arg.replace(/^-+/, '')
+
+ // if it's an exact known option, then don't go any further
+ if (abbrevs[arg] === arg)
+ return null
+
+ // if it's an exact known shortopt, same deal
+ if (shorthands[arg]) {
+ // make it an array, if it's a list of words
+ if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+ shorthands[arg] = shorthands[arg].split(/\s+/)
+
+ return shorthands[arg]
+ }
+
+ // first check to see if this arg is a set of single-char shorthands
+ var singles = shorthands.___singles
+ if (!singles) {
+ singles = Object.keys(shorthands).filter(function (s) {
+ return s.length === 1
+ }).reduce(function (l,r) {
+ l[r] = true
+ return l
+ }, {})
+ shorthands.___singles = singles
+ debug('shorthand singles', singles)
+ }
+
+ var chrs = arg.split("").filter(function (c) {
+ return singles[c]
+ })
+
+ if (chrs.join("") === arg) return chrs.map(function (c) {
+ return shorthands[c]
+ }).reduce(function (l, r) {
+ return l.concat(r)
+ }, [])
+
+
+ // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
+ if (abbrevs[arg] && !shorthands[arg])
+ return null
+
+ // if it's an abbr for a shorthand, then use that
+ if (shortAbbr[arg])
+ arg = shortAbbr[arg]
+
+ // make it an array, if it's a list of words
+ if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+ shorthands[arg] = shorthands[arg].split(/\s+/)
+
+ return shorthands[arg]
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/nopt/node_modules/abbrev/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/nopt/node_modules/abbrev/LICENSE b/node_modules/nopt/node_modules/abbrev/LICENSE
index 05a4010..19129e3 100644
--- a/node_modules/nopt/node_modules/abbrev/LICENSE
+++ b/node_modules/nopt/node_modules/abbrev/LICENSE
@@ -1,23 +1,15 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
+The ISC License
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
+Copyright (c) Isaac Z. Schlueter and Contributors
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/nopt/node_modules/abbrev/package.json
----------------------------------------------------------------------
diff --git a/node_modules/nopt/node_modules/abbrev/package.json b/node_modules/nopt/node_modules/abbrev/package.json
index a4127b6..705363a 100644
--- a/node_modules/nopt/node_modules/abbrev/package.json
+++ b/node_modules/nopt/node_modules/abbrev/package.json
@@ -1,6 +1,6 @@
{
"name": "abbrev",
- "version": "1.0.5",
+ "version": "1.0.6",
"description": "Like ruby's abbrev module, but in js",
"author": {
"name": "Isaac Z. Schlueter",
@@ -12,23 +12,26 @@
},
"repository": {
"type": "git",
- "url": "http://github.com/isaacs/abbrev-js"
- },
- "license": {
- "type": "MIT",
- "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE"
+ "url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
},
+ "license": "ISC",
+ "gitHead": "648a6735d9c5a7a04885e3ada49eed4db36181c2",
"bugs": {
"url": "https://github.com/isaacs/abbrev-js/issues"
},
- "homepage": "https://github.com/isaacs/abbrev-js",
- "_id": "abbrev@1.0.5",
- "_shasum": "5d8257bd9ebe435e698b2fa431afde4fe7b10b03",
+ "homepage": "https://github.com/isaacs/abbrev-js#readme",
+ "_id": "abbrev@1.0.6",
+ "_shasum": "b6d632b859b3fa2d6f7e4b195472461b9e32dc30",
"_from": "abbrev@>=1.0.0 <2.0.0",
- "_npmVersion": "1.4.7",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
"name": "isaacs",
- "email": "i@izs.me"
+ "email": "isaacs@npmjs.com"
+ },
+ "dist": {
+ "shasum": "b6d632b859b3fa2d6f7e4b195472461b9e32dc30",
+ "tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.6.tgz"
},
"maintainers": [
{
@@ -36,11 +39,6 @@
"email": "i@izs.me"
}
],
- "dist": {
- "shasum": "5d8257bd9ebe435e698b2fa431afde4fe7b10b03",
- "tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.6.tgz"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/nopt/package.json
----------------------------------------------------------------------
diff --git a/node_modules/nopt/package.json b/node_modules/nopt/package.json
index 16d6f33..54bf23c 100644
--- a/node_modules/nopt/package.json
+++ b/node_modules/nopt/package.json
@@ -1,6 +1,6 @@
{
"name": "nopt",
- "version": "3.0.1",
+ "version": "3.0.2",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": {
"name": "Isaac Z. Schlueter",
@@ -13,33 +13,35 @@
},
"repository": {
"type": "git",
- "url": "http://github.com/isaacs/nopt"
+ "url": "git+ssh://git@github.com/isaacs/nopt.git"
},
"bin": {
"nopt": "./bin/nopt.js"
},
- "license": {
- "type": "MIT",
- "url": "https://github.com/isaacs/nopt/raw/master/LICENSE"
- },
+ "license": "ISC",
"dependencies": {
"abbrev": "1"
},
"devDependencies": {
"tap": "~0.4.8"
},
- "gitHead": "4296f7aba7847c198fea2da594f9e1bec02817ec",
+ "gitHead": "a0ff8dcbb29ae9da68769c9f782bd4d70746b02d",
"bugs": {
"url": "https://github.com/isaacs/nopt/issues"
},
- "homepage": "https://github.com/isaacs/nopt",
- "_id": "nopt@3.0.1",
- "_shasum": "bce5c42446a3291f47622a370abbf158fbbacbfd",
+ "homepage": "https://github.com/isaacs/nopt#readme",
+ "_id": "nopt@3.0.2",
+ "_shasum": "a82a87f9d8c3df140fe78fb29657a7a774403b5e",
"_from": "nopt@>=3.0.1 <3.1.0",
- "_npmVersion": "1.4.18",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
"name": "isaacs",
- "email": "i@izs.me"
+ "email": "isaacs@npmjs.com"
+ },
+ "dist": {
+ "shasum": "a82a87f9d8c3df140fe78fb29657a7a774403b5e",
+ "tarball": "http://registry.npmjs.org/nopt/-/nopt-3.0.2.tgz"
},
"maintainers": [
{
@@ -47,11 +49,6 @@
"email": "i@izs.me"
}
],
- "dist": {
- "shasum": "bce5c42446a3291f47622a370abbf158fbbacbfd",
- "tarball": "http://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.2.tgz"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/LICENSE b/node_modules/npmlog/LICENSE
index 0c44ae7..19129e3 100644
--- a/node_modules/npmlog/LICENSE
+++ b/node_modules/npmlog/LICENSE
@@ -1,27 +1,15 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
+The ISC License
-The BSD License
+Copyright (c) Isaac Z. Schlueter and Contributors
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/log.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/log.js b/node_modules/npmlog/log.js
index 067f6ff..8bf6422 100644
--- a/node_modules/npmlog/log.js
+++ b/node_modules/npmlog/log.js
@@ -32,12 +32,12 @@ log.progressEnabled = false
var gaugeTheme = undefined
log.enableUnicode = function () {
- gaugeTheme = gauge.unicode
+ gaugeTheme = Gauge.unicode
log.gauge.setTheme(gaugeTheme)
}
log.disableUnicode = function () {
- gaugeTheme = gauge.ascii
+ gaugeTheme = Gauge.ascii
log.gauge.setTheme(gaugeTheme)
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/ansi/lib/ansi.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/ansi/lib/ansi.js b/node_modules/npmlog/node_modules/ansi/lib/ansi.js
new file mode 100644
index 0000000..52fc8ec
--- /dev/null
+++ b/node_modules/npmlog/node_modules/ansi/lib/ansi.js
@@ -0,0 +1,405 @@
+
+/**
+ * References:
+ *
+ * - http://en.wikipedia.org/wiki/ANSI_escape_code
+ * - http://www.termsys.demon.co.uk/vtansi.htm
+ *
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var emitNewlineEvents = require('./newlines')
+ , prefix = '\x1b[' // For all escape codes
+ , suffix = 'm' // Only for color codes
+
+/**
+ * The ANSI escape sequences.
+ */
+
+var codes = {
+ up: 'A'
+ , down: 'B'
+ , forward: 'C'
+ , back: 'D'
+ , nextLine: 'E'
+ , previousLine: 'F'
+ , horizontalAbsolute: 'G'
+ , eraseData: 'J'
+ , eraseLine: 'K'
+ , scrollUp: 'S'
+ , scrollDown: 'T'
+ , savePosition: 's'
+ , restorePosition: 'u'
+ , queryPosition: '6n'
+ , hide: '?25l'
+ , show: '?25h'
+}
+
+/**
+ * Rendering ANSI codes.
+ */
+
+var styles = {
+ bold: 1
+ , italic: 3
+ , underline: 4
+ , inverse: 7
+}
+
+/**
+ * The negating ANSI code for the rendering modes.
+ */
+
+var reset = {
+ bold: 22
+ , italic: 23
+ , underline: 24
+ , inverse: 27
+}
+
+/**
+ * The standard, styleable ANSI colors.
+ */
+
+var colors = {
+ white: 37
+ , black: 30
+ , blue: 34
+ , cyan: 36
+ , green: 32
+ , magenta: 35
+ , red: 31
+ , yellow: 33
+ , grey: 90
+ , brightBlack: 90
+ , brightRed: 91
+ , brightGreen: 92
+ , brightYellow: 93
+ , brightBlue: 94
+ , brightMagenta: 95
+ , brightCyan: 96
+ , brightWhite: 97
+}
+
+
+/**
+ * Creates a Cursor instance based off the given `writable stream` instance.
+ */
+
+function ansi (stream, options) {
+ if (stream._ansicursor) {
+ return stream._ansicursor
+ } else {
+ return stream._ansicursor = new Cursor(stream, options)
+ }
+}
+module.exports = exports = ansi
+
+/**
+ * The `Cursor` class.
+ */
+
+function Cursor (stream, options) {
+ if (!(this instanceof Cursor)) {
+ return new Cursor(stream, options)
+ }
+ if (typeof stream != 'object' || typeof stream.write != 'function') {
+ throw new Error('a valid Stream instance must be passed in')
+ }
+
+ // the stream to use
+ this.stream = stream
+
+ // when 'enabled' is false then all the functions are no-ops except for write()
+ this.enabled = options && options.enabled
+ if (typeof this.enabled === 'undefined') {
+ this.enabled = stream.isTTY
+ }
+ this.enabled = !!this.enabled
+
+ // then `buffering` is true, then `write()` calls are buffered in
+ // memory until `flush()` is invoked
+ this.buffering = !!(options && options.buffering)
+ this._buffer = []
+
+ // controls the foreground and background colors
+ this.fg = this.foreground = new Colorer(this, 0)
+ this.bg = this.background = new Colorer(this, 10)
+
+ // defaults
+ this.Bold = false
+ this.Italic = false
+ this.Underline = false
+ this.Inverse = false
+
+ // keep track of the number of "newlines" that get encountered
+ this.newlines = 0
+ emitNewlineEvents(stream)
+ stream.on('newline', function () {
+ this.newlines++
+ }.bind(this))
+}
+exports.Cursor = Cursor
+
+/**
+ * Helper function that calls `write()` on the underlying Stream.
+ * Returns `this` instead of the write() return value to keep
+ * the chaining going.
+ */
+
+Cursor.prototype.write = function (data) {
+ if (this.buffering) {
+ this._buffer.push(arguments)
+ } else {
+ this.stream.write.apply(this.stream, arguments)
+ }
+ return this
+}
+
+/**
+ * Buffer `write()` calls into memory.
+ *
+ * @api public
+ */
+
+Cursor.prototype.buffer = function () {
+ this.buffering = true
+ return this
+}
+
+/**
+ * Write out the in-memory buffer.
+ *
+ * @api public
+ */
+
+Cursor.prototype.flush = function () {
+ this.buffering = false
+ var str = this._buffer.map(function (args) {
+ if (args.length != 1) throw new Error('unexpected args length! ' + args.length);
+ return args[0];
+ }).join('');
+ this._buffer.splice(0); // empty
+ this.write(str);
+ return this
+}
+
+
+/**
+ * The `Colorer` class manages both the background and foreground colors.
+ */
+
+function Colorer (cursor, base) {
+ this.current = null
+ this.cursor = cursor
+ this.base = base
+}
+exports.Colorer = Colorer
+
+/**
+ * Write an ANSI color code, ensuring that the same code doesn't get rewritten.
+ */
+
+Colorer.prototype._setColorCode = function setColorCode (code) {
+ var c = String(code)
+ if (this.current === c) return
+ this.cursor.enabled && this.cursor.write(prefix + c + suffix)
+ this.current = c
+ return this
+}
+
+
+/**
+ * Set up the positional ANSI codes.
+ */
+
+Object.keys(codes).forEach(function (name) {
+ var code = String(codes[name])
+ Cursor.prototype[name] = function () {
+ var c = code
+ if (arguments.length > 0) {
+ c = toArray(arguments).map(Math.round).join(';') + code
+ }
+ this.enabled && this.write(prefix + c)
+ return this
+ }
+})
+
+/**
+ * Set up the functions for the rendering ANSI codes.
+ */
+
+Object.keys(styles).forEach(function (style) {
+ var name = style[0].toUpperCase() + style.substring(1)
+ , c = styles[style]
+ , r = reset[style]
+
+ Cursor.prototype[style] = function () {
+ if (this[name]) return
+ this.enabled && this.write(prefix + c + suffix)
+ this[name] = true
+ return this
+ }
+
+ Cursor.prototype['reset' + name] = function () {
+ if (!this[name]) return
+ this.enabled && this.write(prefix + r + suffix)
+ this[name] = false
+ return this
+ }
+})
+
+/**
+ * Setup the functions for the standard colors.
+ */
+
+Object.keys(colors).forEach(function (color) {
+ var code = colors[color]
+
+ Colorer.prototype[color] = function () {
+ this._setColorCode(this.base + code)
+ return this.cursor
+ }
+
+ Cursor.prototype[color] = function () {
+ return this.foreground[color]()
+ }
+})
+
+/**
+ * Makes a beep sound!
+ */
+
+Cursor.prototype.beep = function () {
+ this.enabled && this.write('\x07')
+ return this
+}
+
+/**
+ * Moves cursor to specific position
+ */
+
+Cursor.prototype.goto = function (x, y) {
+ x = x | 0
+ y = y | 0
+ this.enabled && this.write(prefix + y + ';' + x + 'H')
+ return this
+}
+
+/**
+ * Resets the color.
+ */
+
+Colorer.prototype.reset = function () {
+ this._setColorCode(this.base + 39)
+ return this.cursor
+}
+
+/**
+ * Resets all ANSI formatting on the stream.
+ */
+
+Cursor.prototype.reset = function () {
+ this.enabled && this.write(prefix + '0' + suffix)
+ this.Bold = false
+ this.Italic = false
+ this.Underline = false
+ this.Inverse = false
+ this.foreground.current = null
+ this.background.current = null
+ return this
+}
+
+/**
+ * Sets the foreground color with the given RGB values.
+ * The closest match out of the 216 colors is picked.
+ */
+
+Colorer.prototype.rgb = function (r, g, b) {
+ var base = this.base + 38
+ , code = rgb(r, g, b)
+ this._setColorCode(base + ';5;' + code)
+ return this.cursor
+}
+
+/**
+ * Same as `cursor.fg.rgb(r, g, b)`.
+ */
+
+Cursor.prototype.rgb = function (r, g, b) {
+ return this.foreground.rgb(r, g, b)
+}
+
+/**
+ * Accepts CSS color codes for use with ANSI escape codes.
+ * For example: `#FF000` would be bright red.
+ */
+
+Colorer.prototype.hex = function (color) {
+ return this.rgb.apply(this, hex(color))
+}
+
+/**
+ * Same as `cursor.fg.hex(color)`.
+ */
+
+Cursor.prototype.hex = function (color) {
+ return this.foreground.hex(color)
+}
+
+
+// UTIL FUNCTIONS //
+
+/**
+ * Translates a 255 RGB value to a 0-5 ANSI RGV value,
+ * then returns the single ANSI color code to use.
+ */
+
+function rgb (r, g, b) {
+ var red = r / 255 * 5
+ , green = g / 255 * 5
+ , blue = b / 255 * 5
+ return rgb5(red, green, blue)
+}
+
+/**
+ * Turns rgb 0-5 values into a single ANSI color code to use.
+ */
+
+function rgb5 (r, g, b) {
+ var red = Math.round(r)
+ , green = Math.round(g)
+ , blue = Math.round(b)
+ return 16 + (red*36) + (green*6) + blue
+}
+
+/**
+ * Accepts a hex CSS color code string (# is optional) and
+ * translates it into an Array of 3 RGB 0-255 values, which
+ * can then be used with rgb().
+ */
+
+function hex (color) {
+ var c = color[0] === '#' ? color.substring(1) : color
+ , r = c.substring(0, 2)
+ , g = c.substring(2, 4)
+ , b = c.substring(4, 6)
+ return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)]
+}
+
+/**
+ * Turns an array-like object into a real array.
+ */
+
+function toArray (a) {
+ var i = 0
+ , l = a.length
+ , rtn = []
+ for (; i<l; i++) {
+ rtn.push(a[i])
+ }
+ return rtn
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/ansi/lib/newlines.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/ansi/lib/newlines.js b/node_modules/npmlog/node_modules/ansi/lib/newlines.js
new file mode 100644
index 0000000..4e37a0a
--- /dev/null
+++ b/node_modules/npmlog/node_modules/ansi/lib/newlines.js
@@ -0,0 +1,71 @@
+
+/**
+ * Accepts any node Stream instance and hijacks its "write()" function,
+ * so that it can count any newlines that get written to the output.
+ *
+ * When a '\n' byte is encountered, then a "newline" event will be emitted
+ * on the stream, with no arguments. It is up to the listeners to determine
+ * any necessary deltas required for their use-case.
+ *
+ * Ex:
+ *
+ * var cursor = ansi(process.stdout)
+ * , ln = 0
+ * process.stdout.on('newline', function () {
+ * ln++
+ * })
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var assert = require('assert')
+var NEWLINE = '\n'.charCodeAt(0)
+
+function emitNewlineEvents (stream) {
+ if (stream._emittingNewlines) {
+ // already emitting newline events
+ return
+ }
+
+ var write = stream.write
+
+ stream.write = function (data) {
+ // first write the data
+ var rtn = write.apply(stream, arguments)
+
+ if (stream.listeners('newline').length > 0) {
+ var len = data.length
+ , i = 0
+ // now try to calculate any deltas
+ if (typeof data == 'string') {
+ for (; i<len; i++) {
+ processByte(stream, data.charCodeAt(i))
+ }
+ } else {
+ // buffer
+ for (; i<len; i++) {
+ processByte(stream, data[i])
+ }
+ }
+ }
+
+ return rtn
+ }
+
+ stream._emittingNewlines = true
+}
+module.exports = emitNewlineEvents
+
+
+/**
+ * Processes an individual byte being written to a stream
+ */
+
+function processByte (stream, b) {
+ assert.equal(typeof b, 'number')
+ if (b === NEWLINE) {
+ stream.emit('newline')
+ }
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000..b513d61
--- /dev/null
+++ b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,89 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ return keys;
+}
+/*</replacement>*/
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+forEach(objectKeys(Writable.prototype), function(method) {
+ if (!Duplex.prototype[method])
+ Duplex.prototype[method] = Writable.prototype[method];
+});
+
+function Duplex(options) {
+ if (!(this instanceof Duplex))
+ return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false)
+ this.readable = false;
+
+ if (options && options.writable === false)
+ this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false)
+ this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended)
+ return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ process.nextTick(this.end.bind(this));
+}
+
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000..895ca50
--- /dev/null
+++ b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,46 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough))
+ return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function(chunk, encoding, cb) {
+ cb(null, chunk);
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000..19ab358
--- /dev/null
+++ b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,951 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module.exports = Readable;
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+var EE = require('events').EventEmitter;
+
+/*<replacement>*/
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
+ return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+var Stream = require('stream');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var StringDecoder;
+
+
+/*<replacement>*/
+var debug = require('util');
+if (debug && debug.debuglog) {
+ debug = debug.debuglog('stream');
+} else {
+ debug = function () {};
+}
+/*</replacement>*/
+
+
+util.inherits(Readable, Stream);
+
+function ReadableState(options, stream) {
+ var Duplex = require('./_stream_duplex');
+
+ options = options || {};
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ var defaultHwm = options.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.buffer = [];
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = null;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex)
+ this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // when piping, we only care about 'readable' events that happen
+ // after read()ing all the bytes and not getting any pushback.
+ this.ranOut = false;
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+
+function Readable(options) {
+ var Duplex = require('./_stream_duplex');
+
+ if (!(this instanceof Readable))
+ return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ Stream.call(this);
+}
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function(chunk, encoding) {
+ var state = this._readableState;
+
+ if (util.isString(chunk) && !state.objectMode) {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = new Buffer(chunk, encoding);
+ encoding = '';
+ }
+ }
+
+ return readableAddChunk(this, state, chunk, encoding, false);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function(chunk) {
+ var state = this._readableState;
+ return readableAddChunk(this, state, chunk, '', true);
+};
+
+function readableAddChunk(stream, state, chunk, encoding, addToFront) {
+ var er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (util.isNullOrUndefined(chunk)) {
+ state.reading = false;
+ if (!state.ended)
+ onEofChunk(stream, state);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (state.ended && !addToFront) {
+ var e = new Error('stream.push() after EOF');
+ stream.emit('error', e);
+ } else if (state.endEmitted && addToFront) {
+ var e = new Error('stream.unshift() after end event');
+ stream.emit('error', e);
+ } else {
+ if (state.decoder && !addToFront && !encoding)
+ chunk = state.decoder.write(chunk);
+
+ if (!addToFront)
+ state.reading = false;
+
+ // if we want the data now, just emit it.
+ if (state.flowing && state.length === 0 && !state.sync) {
+ stream.emit('data', chunk);
+ stream.read(0);
+ } else {
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront)
+ state.buffer.unshift(chunk);
+ else
+ state.buffer.push(chunk);
+
+ if (state.needReadable)
+ emitReadable(stream);
+ }
+
+ maybeReadMore(stream, state);
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ }
+
+ return needMoreData(state);
+}
+
+
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended &&
+ (state.needReadable ||
+ state.length < state.highWaterMark ||
+ state.length === 0);
+}
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function(enc) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+ this._readableState.encoding = enc;
+ return this;
+};
+
+// Don't raise the hwm > 128MB
+var MAX_HWM = 0x800000;
+function roundUpToNextPowerOf2(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2
+ n--;
+ for (var p = 1; p < 32; p <<= 1) n |= n >> p;
+ n++;
+ }
+ return n;
+}
+
+function howMuchToRead(n, state) {
+ if (state.length === 0 && state.ended)
+ return 0;
+
+ if (state.objectMode)
+ return n === 0 ? 0 : 1;
+
+ if (isNaN(n) || util.isNull(n)) {
+ // only flow one buffer at a time
+ if (state.flowing && state.buffer.length)
+ return state.buffer[0].length;
+ else
+ return state.length;
+ }
+
+ if (n <= 0)
+ return 0;
+
+ // If we're asking for more than the target buffer level,
+ // then raise the water mark. Bump up to the next highest
+ // power of 2, to prevent increasing it excessively in tiny
+ // amounts.
+ if (n > state.highWaterMark)
+ state.highWaterMark = roundUpToNextPowerOf2(n);
+
+ // don't have that much. return null, unless we've ended.
+ if (n > state.length) {
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ } else
+ return state.length;
+ }
+
+ return n;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function(n) {
+ debug('read', n);
+ var state = this._readableState;
+ var nOrig = n;
+
+ if (!util.isNumber(n) || n > 0)
+ state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 &&
+ state.needReadable &&
+ (state.length >= state.highWaterMark || state.ended)) {
+ debug('read: emitReadable', state.length, state.ended);
+ if (state.length === 0 && state.ended)
+ endReadable(this);
+ else
+ emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0)
+ endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+ debug('need readable', doRead);
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
+ doRead = true;
+ debug('length less than watermark', doRead);
+ }
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading) {
+ doRead = false;
+ debug('reading or ended', doRead);
+ }
+
+ if (doRead) {
+ debug('do read');
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0)
+ state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ }
+
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (doRead && !state.reading)
+ n = howMuchToRead(nOrig, state);
+
+ var ret;
+ if (n > 0)
+ ret = fromList(n, state);
+ else
+ ret = null;
+
+ if (util.isNull(ret)) {
+ state.needReadable = true;
+ n = 0;
+ }
+
+ state.length -= n;
+
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (state.length === 0 && !state.ended)
+ state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended && state.length === 0)
+ endReadable(this);
+
+ if (!util.isNull(ret))
+ this.emit('data', ret);
+
+ return ret;
+};
+
+function chunkInvalid(state, chunk) {
+ var er = null;
+ if (!util.isBuffer(chunk) &&
+ !util.isString(chunk) &&
+ !util.isNullOrUndefined(chunk) &&
+ !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+
+function onEofChunk(stream, state) {
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // emit 'readable' now to make sure it gets picked up.
+ emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ debug('emitReadable', state.flowing);
+ state.emittedReadable = true;
+ if (state.sync)
+ process.nextTick(function() {
+ emitReadable_(stream);
+ });
+ else
+ emitReadable_(stream);
+ }
+}
+
+function emitReadable_(stream) {
+ debug('emit readable');
+ stream.emit('readable');
+ flow(stream);
+}
+
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ process.nextTick(function() {
+ maybeReadMore_(stream, state);
+ });
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended &&
+ state.length < state.highWaterMark) {
+ debug('maybeReadMore read 0');
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;
+ else
+ len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function(n) {
+ this.emit('error', new Error('not implemented'));
+};
+
+Readable.prototype.pipe = function(dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
+ dest !== process.stdout &&
+ dest !== process.stderr;
+
+ var endFn = doEnd ? onend : cleanup;
+ if (state.endEmitted)
+ process.nextTick(endFn);
+ else
+ src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable) {
+ debug('onunpipe');
+ if (readable === src) {
+ cleanup();
+ }
+ }
+
+ function onend() {
+ debug('onend');
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ function cleanup() {
+ debug('cleanup');
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', cleanup);
+ src.removeListener('data', ondata);
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (state.awaitDrain &&
+ (!dest._writableState || dest._writableState.needDrain))
+ ondrain();
+ }
+
+ src.on('data', ondata);
+ function ondata(chunk) {
+ debug('ondata');
+ var ret = dest.write(chunk);
+ if (false === ret) {
+ debug('false write response, pause',
+ src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
+ src.pause();
+ }
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ debug('onerror', er);
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EE.listenerCount(dest, 'error') === 0)
+ dest.emit('error', er);
+ }
+ // This is a brutally ugly hack to make sure that our error handler
+ // is attached before any userland ones. NEVER DO THIS.
+ if (!dest._events || !dest._events.error)
+ dest.on('error', onerror);
+ else if (isArray(dest._events.error))
+ dest._events.error.unshift(onerror);
+ else
+ dest._events.error = [onerror, dest._events.error];
+
+
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ debug('onfinish');
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ debug('unpipe');
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ debug('pipe resume');
+ src.resume();
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function() {
+ var state = src._readableState;
+ debug('pipeOnDrain', state.awaitDrain);
+ if (state.awaitDrain)
+ state.awaitDrain--;
+ if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {
+ state.flowing = true;
+ flow(src);
+ }
+ };
+}
+
+
+Readable.prototype.unpipe = function(dest) {
+ var state = this._readableState;
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0)
+ return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes)
+ return this;
+
+ if (!dest)
+ dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ if (dest)
+ dest.emit('unpipe', this);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+
+ for (var i = 0; i < len; i++)
+ dests[i].emit('unpipe', this);
+ return this;
+ }
+
+ // try to find the right one.
+ var i = indexOf(state.pipes, dest);
+ if (i === -1)
+ return this;
+
+ state.pipes.splice(i, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1)
+ state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function(ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ // If listening to data, and it has not explicitly been paused,
+ // then call resume to start the flow of data on the next tick.
+ if (ev === 'data' && false !== this._readableState.flowing) {
+ this.resume();
+ }
+
+ if (ev === 'readable' && this.readable) {
+ var state = this._readableState;
+ if (!state.readableListening) {
+ state.readableListening = true;
+ state.emittedReadable = false;
+ state.needReadable = true;
+ if (!state.reading) {
+ var self = this;
+ process.nextTick(function() {
+ debug('readable nexttick read 0');
+ self.read(0);
+ });
+ } else if (state.length) {
+ emitReadable(this, state);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function() {
+ var state = this._readableState;
+ if (!state.flowing) {
+ debug('resume');
+ state.flowing = true;
+ if (!state.reading) {
+ debug('resume read 0');
+ this.read(0);
+ }
+ resume(this, state);
+ }
+ return this;
+};
+
+function resume(stream, state) {
+ if (!state.resumeScheduled) {
+ state.resumeScheduled = true;
+ process.nextTick(function() {
+ resume_(stream, state);
+ });
+ }
+}
+
+function resume_(stream, state) {
+ state.resumeScheduled = false;
+ stream.emit('resume');
+ flow(stream);
+ if (state.flowing && !state.reading)
+ stream.read(0);
+}
+
+Readable.prototype.pause = function() {
+ debug('call pause flowing=%j', this._readableState.flowing);
+ if (false !== this._readableState.flowing) {
+ debug('pause');
+ this._readableState.flowing = false;
+ this.emit('pause');
+ }
+ return this;
+};
+
+function flow(stream) {
+ var state = stream._readableState;
+ debug('flow', state.flowing);
+ if (state.flowing) {
+ do {
+ var chunk = stream.read();
+ } while (null !== chunk && state.flowing);
+ }
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function(stream) {
+ var state = this._readableState;
+ var paused = false;
+
+ var self = this;
+ stream.on('end', function() {
+ debug('wrapped end');
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length)
+ self.push(chunk);
+ }
+
+ self.push(null);
+ });
+
+ stream.on('data', function(chunk) {
+ debug('wrapped data');
+ if (state.decoder)
+ chunk = state.decoder.write(chunk);
+ if (!chunk || !state.objectMode && !chunk.length)
+ return;
+
+ var ret = self.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
+ this[i] = function(method) { return function() {
+ return stream[method].apply(stream, arguments);
+ }}(i);
+ }
+ }
+
+ // proxy certain important events.
+ var events = ['error', 'close', 'destroy', 'pause', 'resume'];
+ forEach(events, function(ev) {
+ stream.on(ev, self.emit.bind(self, ev));
+ });
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ self._read = function(n) {
+ debug('wrapped _read', n);
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+
+ return self;
+};
+
+
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+function fromList(n, state) {
+ var list = state.buffer;
+ var length = state.length;
+ var stringMode = !!state.decoder;
+ var objectMode = !!state.objectMode;
+ var ret;
+
+ // nothing in the list, definitely empty.
+ if (list.length === 0)
+ return null;
+
+ if (length === 0)
+ ret = null;
+ else if (objectMode)
+ ret = list.shift();
+ else if (!n || n >= length) {
+ // read it all, truncate the array.
+ if (stringMode)
+ ret = list.join('');
+ else
+ ret = Buffer.concat(list, length);
+ list.length = 0;
+ } else {
+ // read just some of it.
+ if (n < list[0].length) {
+ // just take a part of the first list item.
+ // slice is the same for buffers and strings.
+ var buf = list[0];
+ ret = buf.slice(0, n);
+ list[0] = buf.slice(n);
+ } else if (n === list[0].length) {
+ // first list is a perfect match
+ ret = list.shift();
+ } else {
+ // complex case.
+ // we have enough to cover it, but it spans past the first buffer.
+ if (stringMode)
+ ret = '';
+ else
+ ret = new Buffer(n);
+
+ var c = 0;
+ for (var i = 0, l = list.length; i < l && c < n; i++) {
+ var buf = list[0];
+ var cpy = Math.min(n - c, buf.length);
+
+ if (stringMode)
+ ret += buf.slice(0, cpy);
+ else
+ buf.copy(ret, c, 0, cpy);
+
+ if (cpy < buf.length)
+ list[0] = buf.slice(cpy);
+ else
+ list.shift();
+
+ c += cpy;
+ }
+ }
+ }
+
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0)
+ throw new Error('endReadable called on non-empty stream');
+
+ if (!state.endEmitted) {
+ state.ended = true;
+ process.nextTick(function() {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+ });
+ }
+}
+
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
+
+function indexOf (xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js
----------------------------------------------------------------------
diff --git a/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000..905c5e4
--- /dev/null
+++ b/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,209 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(Transform, Duplex);
+
+
+function TransformState(options, stream) {
+ this.afterTransform = function(er, data) {
+ return afterTransform(stream, er, data);
+ };
+
+ this.needTransform = false;
+ this.transforming = false;
+ this.writecb = null;
+ this.writechunk = null;
+}
+
+function afterTransform(stream, er, data) {
+ var ts = stream._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb)
+ return stream.emit('error', new Error('no writecb in Transform class'));
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (!util.isNullOrUndefined(data))
+ stream.push(data);
+
+ if (cb)
+ cb(er);
+
+ var rs = stream._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ stream._read(rs.highWaterMark);
+ }
+}
+
+
+function Transform(options) {
+ if (!(this instanceof Transform))
+ return new Transform(options);
+
+ Duplex.call(this, options);
+
+ this._transformState = new TransformState(options, this);
+
+ // when the writable side finishes, then flush out anything remaining.
+ var stream = this;
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ this.once('prefinish', function() {
+ if (util.isFunction(this._flush))
+ this._flush(function(er) {
+ done(stream, er);
+ });
+ else
+ done(stream);
+ });
+}
+
+Transform.prototype.push = function(chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function(chunk, encoding, cb) {
+ throw new Error('not implemented');
+};
+
+Transform.prototype._write = function(chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform ||
+ rs.needReadable ||
+ rs.length < rs.highWaterMark)
+ this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function(n) {
+ var ts = this._transformState;
+
+ if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+
+function done(stream, er) {
+ if (er)
+ return stream.emit('error', er);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ var ws = stream._writableState;
+ var ts = stream._transformState;
+
+ if (ws.length)
+ throw new Error('calling transform done when ws.length != 0');
+
+ if (ts.transforming)
+ throw new Error('calling transform done when still transforming');
+
+ return stream.push(null);
+}
[02/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js b/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
new file mode 100644
index 0000000..f07aa2b
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
@@ -0,0 +1,98 @@
+/****************************************************
+ * AUTOMATICALLY GENERATED by generate-pubsuffix.js *
+ * DO NOT EDIT! *
+ ****************************************************/
+
+"use strict";
+
+var punycode = require('punycode');
+
+module.exports.getPublicSuffix = function getPublicSuffix(domain) {
+ /*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+ if (!domain) {
+ return null;
+ }
+ if (domain.match(/^\./)) {
+ return null;
+ }
+ var asciiDomain = punycode.toASCII(domain);
+ var converted = false;
+ if (asciiDomain !== domain) {
+ domain = asciiDomain;
+ converted = true;
+ }
+ if (index[domain]) {
+ return null;
+ }
+
+ domain = domain.toLowerCase();
+ var parts = domain.split('.').reverse();
+
+ var suffix = '';
+ var suffixLen = 0;
+ for (var i=0; i<parts.length; i++) {
+ var part = parts[i];
+ var starstr = '*'+suffix;
+ var partstr = part+suffix;
+
+ if (index[starstr]) { // star rule matches
+ suffixLen = i+1;
+ if (index[partstr] === false) { // exception rule matches (NB: false, not undefined)
+ suffixLen--;
+ }
+ } else if (index[partstr]) { // exact match, not exception
+ suffixLen = i+1;
+ }
+
+ suffix = '.'+partstr;
+ }
+
+ if (index['*'+suffix]) { // *.domain exists (e.g. *.kyoto.jp for domain='kyoto.jp');
+ return null;
+ }
+
+ suffixLen = suffixLen || 1;
+ if (parts.length > suffixLen) {
+ var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.');
+ return converted ? punycode.toUnicode(publicSuffix) : publicSuffix;
+ }
+
+ return null;
+};
+
+// The following generated structure is used under the MPL version 1.1
+// See public-suffix.txt for more information
+
+var index = module.exports.index = Object.freeze(
+{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"edu
cator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software
.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,
"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":
true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,
"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"ne
t.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn"
:true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov
.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"*.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci
.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":tru
e,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":t
rue,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.
id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"*.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it
":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige
.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria
-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"ca
tanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":tru
e,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pesca
ra.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"tran
i-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehim
e.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn-
-efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city
.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takah
ama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gon
ohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":t
rue,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true
,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp
":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"sho
nai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kit
akata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"
hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma
.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiro
shima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.
hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkai
do.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokk
aido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.
jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka
.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.i
baraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.
jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagaw
a.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagaw
a.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.j
p":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.ku
mamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mi
e.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":
true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":t
rue,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"
nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasa
ki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.
nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.ni
igata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,
"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":t
rue,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,
"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.
jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama
.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"hi
gashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shi
mane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shi
zuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"koma
tsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koga
nei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"y
azu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama
.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":t
rue,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikaw
amisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.
km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":t
rue,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,
"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":t
rue,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimo
re.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"ca
rrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"
contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum"
:true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelv
inck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"ir
aq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"ma
d.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":tru
e,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprin
gs.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabar
bara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum
":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.
museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museu
m.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"s
ch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"
xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":
true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no
":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0
<TRUNCATED>
[04/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
new file mode 100755
index 0000000..e91718b
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
@@ -0,0 +1,412 @@
+// Load modules
+
+var Dgram = require('dgram');
+var Dns = require('dns');
+var Hoek = require('hoek');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.time = function (options, callback) {
+
+ if (arguments.length !== 2) {
+ callback = arguments[0];
+ options = {};
+ }
+
+ var settings = Hoek.clone(options);
+ settings.host = settings.host || 'pool.ntp.org';
+ settings.port = settings.port || 123;
+ settings.resolveReference = settings.resolveReference || false;
+
+ // Declare variables used by callback
+
+ var timeoutId = 0;
+ var sent = 0;
+
+ // Ensure callback is only called once
+
+ var finish = function (err, result) {
+
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ timeoutId = 0;
+ }
+
+ socket.removeAllListeners();
+ socket.once('error', internals.ignore);
+ socket.close();
+ return callback(err, result);
+ };
+
+ finish = Hoek.once(finish);
+
+ // Create UDP socket
+
+ var socket = Dgram.createSocket('udp4');
+
+ socket.once('error', function (err) {
+
+ return finish(err);
+ });
+
+ // Listen to incoming messages
+
+ socket.on('message', function (buffer, rinfo) {
+
+ var received = Date.now();
+
+ var message = new internals.NtpMessage(buffer);
+ if (!message.isValid) {
+ return finish(new Error('Invalid server response'), message);
+ }
+
+ if (message.originateTimestamp !== sent) {
+ return finish(new Error('Wrong originate timestamp'), message);
+ }
+
+ // Timestamp Name ID When Generated
+ // ------------------------------------------------------------
+ // Originate Timestamp T1 time request sent by client
+ // Receive Timestamp T2 time request received by server
+ // Transmit Timestamp T3 time reply sent by server
+ // Destination Timestamp T4 time reply received by client
+ //
+ // The roundtrip delay d and system clock offset t are defined as:
+ //
+ // d = (T4 - T1) - (T3 - T2) t = ((T2 - T1) + (T3 - T4)) / 2
+
+ var T1 = message.originateTimestamp;
+ var T2 = message.receiveTimestamp;
+ var T3 = message.transmitTimestamp;
+ var T4 = received;
+
+ message.d = (T4 - T1) - (T3 - T2);
+ message.t = ((T2 - T1) + (T3 - T4)) / 2;
+ message.receivedLocally = received;
+
+ if (!settings.resolveReference ||
+ message.stratum !== 'secondary') {
+
+ return finish(null, message);
+ }
+
+ // Resolve reference IP address
+
+ Dns.reverse(message.referenceId, function (err, domains) {
+
+ if (/* $lab:coverage:off$ */ !err /* $lab:coverage:on$ */) {
+ message.referenceHost = domains[0];
+ }
+
+ return finish(null, message);
+ });
+ });
+
+ // Set timeout
+
+ if (settings.timeout) {
+ timeoutId = setTimeout(function () {
+
+ timeoutId = 0;
+ return finish(new Error('Timeout'));
+ }, settings.timeout);
+ }
+
+ // Construct NTP message
+
+ var message = new Buffer(48);
+ for (var i = 0; i < 48; i++) { // Zero message
+ message[i] = 0;
+ }
+
+ message[0] = (0 << 6) + (4 << 3) + (3 << 0) // Set version number to 4 and Mode to 3 (client)
+ sent = Date.now();
+ internals.fromMsecs(sent, message, 40); // Set transmit timestamp (returns as originate)
+
+ // Send NTP request
+
+ socket.send(message, 0, message.length, settings.port, settings.host, function (err, bytes) {
+
+ if (err ||
+ bytes !== 48) {
+
+ return finish(err || new Error('Could not send entire message'));
+ }
+ });
+};
+
+
+internals.NtpMessage = function (buffer) {
+
+ this.isValid = false;
+
+ // Validate
+
+ if (buffer.length !== 48) {
+ return;
+ }
+
+ // Leap indicator
+
+ var li = (buffer[0] >> 6);
+ switch (li) {
+ case 0: this.leapIndicator = 'no-warning'; break;
+ case 1: this.leapIndicator = 'last-minute-61'; break;
+ case 2: this.leapIndicator = 'last-minute-59'; break;
+ case 3: this.leapIndicator = 'alarm'; break;
+ }
+
+ // Version
+
+ var vn = ((buffer[0] & 0x38) >> 3);
+ this.version = vn;
+
+ // Mode
+
+ var mode = (buffer[0] & 0x7);
+ switch (mode) {
+ case 1: this.mode = 'symmetric-active'; break;
+ case 2: this.mode = 'symmetric-passive'; break;
+ case 3: this.mode = 'client'; break;
+ case 4: this.mode = 'server'; break;
+ case 5: this.mode = 'broadcast'; break;
+ case 0:
+ case 6:
+ case 7: this.mode = 'reserved'; break;
+ }
+
+ // Stratum
+
+ var stratum = buffer[1];
+ if (stratum === 0) {
+ this.stratum = 'death';
+ }
+ else if (stratum === 1) {
+ this.stratum = 'primary';
+ }
+ else if (stratum <= 15) {
+ this.stratum = 'secondary';
+ }
+ else {
+ this.stratum = 'reserved';
+ }
+
+ // Poll interval (msec)
+
+ this.pollInterval = Math.round(Math.pow(2, buffer[2])) * 1000;
+
+ // Precision (msecs)
+
+ this.precision = Math.pow(2, buffer[3]) * 1000;
+
+ // Root delay (msecs)
+
+ var rootDelay = 256 * (256 * (256 * buffer[4] + buffer[5]) + buffer[6]) + buffer[7];
+ this.rootDelay = 1000 * (rootDelay / 0x10000);
+
+ // Root dispersion (msecs)
+
+ this.rootDispersion = ((buffer[8] << 8) + buffer[9] + ((buffer[10] << 8) + buffer[11]) / Math.pow(2, 16)) * 1000;
+
+ // Reference identifier
+
+ this.referenceId = '';
+ switch (this.stratum) {
+ case 'death':
+ case 'primary':
+ this.referenceId = String.fromCharCode(buffer[12]) + String.fromCharCode(buffer[13]) + String.fromCharCode(buffer[14]) + String.fromCharCode(buffer[15]);
+ break;
+ case 'secondary':
+ this.referenceId = '' + buffer[12] + '.' + buffer[13] + '.' + buffer[14] + '.' + buffer[15];
+ break;
+ }
+
+ // Reference timestamp
+
+ this.referenceTimestamp = internals.toMsecs(buffer, 16);
+
+ // Originate timestamp
+
+ this.originateTimestamp = internals.toMsecs(buffer, 24);
+
+ // Receive timestamp
+
+ this.receiveTimestamp = internals.toMsecs(buffer, 32);
+
+ // Transmit timestamp
+
+ this.transmitTimestamp = internals.toMsecs(buffer, 40);
+
+ // Validate
+
+ if (this.version === 4 &&
+ this.stratum !== 'reserved' &&
+ this.mode === 'server' &&
+ this.originateTimestamp &&
+ this.receiveTimestamp &&
+ this.transmitTimestamp) {
+
+ this.isValid = true;
+ }
+
+ return this;
+};
+
+
+internals.toMsecs = function (buffer, offset) {
+
+ var seconds = 0;
+ var fraction = 0;
+
+ for (var i = 0; i < 4; ++i) {
+ seconds = (seconds * 256) + buffer[offset + i];
+ }
+
+ for (i = 4; i < 8; ++i) {
+ fraction = (fraction * 256) + buffer[offset + i];
+ }
+
+ return ((seconds - 2208988800 + (fraction / Math.pow(2, 32))) * 1000);
+};
+
+
+internals.fromMsecs = function (ts, buffer, offset) {
+
+ var seconds = Math.floor(ts / 1000) + 2208988800;
+ var fraction = Math.round((ts % 1000) / 1000 * Math.pow(2, 32));
+
+ buffer[offset + 0] = (seconds & 0xFF000000) >> 24;
+ buffer[offset + 1] = (seconds & 0x00FF0000) >> 16;
+ buffer[offset + 2] = (seconds & 0x0000FF00) >> 8;
+ buffer[offset + 3] = (seconds & 0x000000FF);
+
+ buffer[offset + 4] = (fraction & 0xFF000000) >> 24;
+ buffer[offset + 5] = (fraction & 0x00FF0000) >> 16;
+ buffer[offset + 6] = (fraction & 0x0000FF00) >> 8;
+ buffer[offset + 7] = (fraction & 0x000000FF);
+};
+
+
+// Offset singleton
+
+internals.last = {
+ offset: 0,
+ expires: 0,
+ host: '',
+ port: 0
+};
+
+
+exports.offset = function (options, callback) {
+
+ if (arguments.length !== 2) {
+ callback = arguments[0];
+ options = {};
+ }
+
+ var now = Date.now();
+ var clockSyncRefresh = options.clockSyncRefresh || 24 * 60 * 60 * 1000; // Daily
+
+ if (internals.last.offset &&
+ internals.last.host === options.host &&
+ internals.last.port === options.port &&
+ now < internals.last.expires) {
+
+ process.nextTick(function () {
+
+ callback(null, internals.last.offset);
+ });
+
+ return;
+ }
+
+ exports.time(options, function (err, time) {
+
+ if (err) {
+ return callback(err, 0);
+ }
+
+ internals.last = {
+ offset: Math.round(time.t),
+ expires: now + clockSyncRefresh,
+ host: options.host,
+ port: options.port
+ };
+
+ return callback(null, internals.last.offset);
+ });
+};
+
+
+// Now singleton
+
+internals.now = {
+ intervalId: 0
+};
+
+
+exports.start = function (options, callback) {
+
+ if (arguments.length !== 2) {
+ callback = arguments[0];
+ options = {};
+ }
+
+ if (internals.now.intervalId) {
+ process.nextTick(function () {
+
+ callback();
+ });
+
+ return;
+ }
+
+ exports.offset(options, function (err, offset) {
+
+ internals.now.intervalId = setInterval(function () {
+
+ exports.offset(options, function () { });
+ }, options.clockSyncRefresh || 24 * 60 * 60 * 1000); // Daily
+
+ return callback();
+ });
+};
+
+
+exports.stop = function () {
+
+ if (!internals.now.intervalId) {
+ return;
+ }
+
+ clearInterval(internals.now.intervalId);
+ internals.now.intervalId = 0;
+};
+
+
+exports.isLive = function () {
+
+ return !!internals.now.intervalId;
+};
+
+
+exports.now = function () {
+
+ var now = Date.now();
+ if (!exports.isLive() ||
+ now >= internals.last.expires) {
+
+ return now;
+ }
+
+ return now + internals.last.offset;
+};
+
+
+internals.ignore = function () {
+
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/index.js b/node_modules/request/node_modules/http-signature/lib/index.js
new file mode 100644
index 0000000..217a5dd
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/index.js
@@ -0,0 +1,26 @@
+// Copyright 2011 Joyent, Inc. All rights reserved.
+
+var parser = require('./parser');
+var signer = require('./signer');
+var verify = require('./verify');
+var util = require('./util');
+
+
+
+///--- API
+
+module.exports = {
+
+ parse: parser.parseRequest,
+ parseRequest: parser.parseRequest,
+
+ sign: signer.signRequest,
+ signRequest: signer.signRequest,
+
+ sshKeyToPEM: util.sshKeyToPEM,
+ sshKeyFingerprint: util.fingerprint,
+ pemToRsaSSHKey: util.pemToRsaSSHKey,
+
+ verify: verify.verifySignature,
+ verifySignature: verify.verifySignature
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/lib/parser.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/parser.js b/node_modules/request/node_modules/http-signature/lib/parser.js
new file mode 100644
index 0000000..fd9ac10
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/parser.js
@@ -0,0 +1,304 @@
+// Copyright 2012 Joyent, Inc. All rights reserved.
+
+var assert = require('assert-plus');
+var util = require('util');
+
+
+
+///--- Globals
+
+var Algorithms = {
+ 'rsa-sha1': true,
+ 'rsa-sha256': true,
+ 'rsa-sha512': true,
+ 'dsa-sha1': true,
+ 'hmac-sha1': true,
+ 'hmac-sha256': true,
+ 'hmac-sha512': true
+};
+
+var State = {
+ New: 0,
+ Params: 1
+};
+
+var ParamsState = {
+ Name: 0,
+ Quote: 1,
+ Value: 2,
+ Comma: 3
+};
+
+
+
+///--- Specific Errors
+
+function HttpSignatureError(message, caller) {
+ if (Error.captureStackTrace)
+ Error.captureStackTrace(this, caller || HttpSignatureError);
+
+ this.message = message;
+ this.name = caller.name;
+}
+util.inherits(HttpSignatureError, Error);
+
+function ExpiredRequestError(message) {
+ HttpSignatureError.call(this, message, ExpiredRequestError);
+}
+util.inherits(ExpiredRequestError, HttpSignatureError);
+
+
+function InvalidHeaderError(message) {
+ HttpSignatureError.call(this, message, InvalidHeaderError);
+}
+util.inherits(InvalidHeaderError, HttpSignatureError);
+
+
+function InvalidParamsError(message) {
+ HttpSignatureError.call(this, message, InvalidParamsError);
+}
+util.inherits(InvalidParamsError, HttpSignatureError);
+
+
+function MissingHeaderError(message) {
+ HttpSignatureError.call(this, message, MissingHeaderError);
+}
+util.inherits(MissingHeaderError, HttpSignatureError);
+
+
+
+///--- Exported API
+
+module.exports = {
+
+ /**
+ * Parses the 'Authorization' header out of an http.ServerRequest object.
+ *
+ * Note that this API will fully validate the Authorization header, and throw
+ * on any error. It will not however check the signature, or the keyId format
+ * as those are specific to your environment. You can use the options object
+ * to pass in extra constraints.
+ *
+ * As a response object you can expect this:
+ *
+ * {
+ * "scheme": "Signature",
+ * "params": {
+ * "keyId": "foo",
+ * "algorithm": "rsa-sha256",
+ * "headers": [
+ * "date" or "x-date",
+ * "content-md5"
+ * ],
+ * "signature": "base64"
+ * },
+ * "signingString": "ready to be passed to crypto.verify()"
+ * }
+ *
+ * @param {Object} request an http.ServerRequest.
+ * @param {Object} options an optional options object with:
+ * - clockSkew: allowed clock skew in seconds (default 300).
+ * - headers: required header names (def: date or x-date)
+ * - algorithms: algorithms to support (default: all).
+ * @return {Object} parsed out object (see above).
+ * @throws {TypeError} on invalid input.
+ * @throws {InvalidHeaderError} on an invalid Authorization header error.
+ * @throws {InvalidParamsError} if the params in the scheme are invalid.
+ * @throws {MissingHeaderError} if the params indicate a header not present,
+ * either in the request headers from the params,
+ * or not in the params from a required header
+ * in options.
+ * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
+ */
+ parseRequest: function parseRequest(request, options) {
+ assert.object(request, 'request');
+ assert.object(request.headers, 'request.headers');
+ if (options === undefined) {
+ options = {};
+ }
+ if (options.headers === undefined) {
+ options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
+ }
+ assert.object(options, 'options');
+ assert.arrayOfString(options.headers, 'options.headers');
+ assert.optionalNumber(options.clockSkew, 'options.clockSkew');
+
+ if (!request.headers.authorization)
+ throw new MissingHeaderError('no authorization header present in ' +
+ 'the request');
+
+ options.clockSkew = options.clockSkew || 300;
+
+
+ var i = 0;
+ var state = State.New;
+ var substate = ParamsState.Name;
+ var tmpName = '';
+ var tmpValue = '';
+
+ var parsed = {
+ scheme: '',
+ params: {},
+ signingString: '',
+
+ get algorithm() {
+ return this.params.algorithm.toUpperCase();
+ },
+
+ get keyId() {
+ return this.params.keyId;
+ }
+
+ };
+
+ var authz = request.headers.authorization;
+ for (i = 0; i < authz.length; i++) {
+ var c = authz.charAt(i);
+
+ switch (Number(state)) {
+
+ case State.New:
+ if (c !== ' ') parsed.scheme += c;
+ else state = State.Params;
+ break;
+
+ case State.Params:
+ switch (Number(substate)) {
+
+ case ParamsState.Name:
+ var code = c.charCodeAt(0);
+ // restricted name of A-Z / a-z
+ if ((code >= 0x41 && code <= 0x5a) || // A-Z
+ (code >= 0x61 && code <= 0x7a)) { // a-z
+ tmpName += c;
+ } else if (c === '=') {
+ if (tmpName.length === 0)
+ throw new InvalidHeaderError('bad param format');
+ substate = ParamsState.Quote;
+ } else {
+ throw new InvalidHeaderError('bad param format');
+ }
+ break;
+
+ case ParamsState.Quote:
+ if (c === '"') {
+ tmpValue = '';
+ substate = ParamsState.Value;
+ } else {
+ throw new InvalidHeaderError('bad param format');
+ }
+ break;
+
+ case ParamsState.Value:
+ if (c === '"') {
+ parsed.params[tmpName] = tmpValue;
+ substate = ParamsState.Comma;
+ } else {
+ tmpValue += c;
+ }
+ break;
+
+ case ParamsState.Comma:
+ if (c === ',') {
+ tmpName = '';
+ substate = ParamsState.Name;
+ } else {
+ throw new InvalidHeaderError('bad param format');
+ }
+ break;
+
+ default:
+ throw new Error('Invalid substate');
+ }
+ break;
+
+ default:
+ throw new Error('Invalid substate');
+ }
+
+ }
+
+ if (!parsed.params.headers || parsed.params.headers === '') {
+ if (request.headers['x-date']) {
+ parsed.params.headers = ['x-date'];
+ } else {
+ parsed.params.headers = ['date'];
+ }
+ } else {
+ parsed.params.headers = parsed.params.headers.split(' ');
+ }
+
+ // Minimally validate the parsed object
+ if (!parsed.scheme || parsed.scheme !== 'Signature')
+ throw new InvalidHeaderError('scheme was not "Signature"');
+
+ if (!parsed.params.keyId)
+ throw new InvalidHeaderError('keyId was not specified');
+
+ if (!parsed.params.algorithm)
+ throw new InvalidHeaderError('algorithm was not specified');
+
+ if (!parsed.params.signature)
+ throw new InvalidHeaderError('signature was not specified');
+
+ // Check the algorithm against the official list
+ parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
+ if (!Algorithms[parsed.params.algorithm])
+ throw new InvalidParamsError(parsed.params.algorithm +
+ ' is not supported');
+
+ // Build the signingString
+ for (i = 0; i < parsed.params.headers.length; i++) {
+ var h = parsed.params.headers[i].toLowerCase();
+ parsed.params.headers[i] = h;
+
+ if (h !== 'request-line') {
+ var value = request.headers[h];
+ if (!value)
+ throw new MissingHeaderError(h + ' was not in the request');
+ parsed.signingString += h + ': ' + value;
+ } else {
+ parsed.signingString +=
+ request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;
+ }
+
+ if ((i + 1) < parsed.params.headers.length)
+ parsed.signingString += '\n';
+ }
+
+ // Check against the constraints
+ var date;
+ if (request.headers.date || request.headers['x-date']) {
+ if (request.headers['x-date']) {
+ date = new Date(request.headers['x-date']);
+ } else {
+ date = new Date(request.headers.date);
+ }
+ var now = new Date();
+ var skew = Math.abs(now.getTime() - date.getTime());
+
+ if (skew > options.clockSkew * 1000) {
+ throw new ExpiredRequestError('clock skew of ' +
+ (skew / 1000) +
+ 's was greater than ' +
+ options.clockSkew + 's');
+ }
+ }
+
+ options.headers.forEach(function (hdr) {
+ // Remember that we already checked any headers in the params
+ // were in the request, so if this passes we're good.
+ if (parsed.params.headers.indexOf(hdr) < 0)
+ throw new MissingHeaderError(hdr + ' was not a signed header');
+ });
+
+ if (options.algorithms) {
+ if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
+ throw new InvalidParamsError(parsed.params.algorithm +
+ ' is not a supported algorithm');
+ }
+
+ return parsed;
+ }
+
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/lib/signer.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/signer.js b/node_modules/request/node_modules/http-signature/lib/signer.js
new file mode 100644
index 0000000..3507f4d
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/signer.js
@@ -0,0 +1,178 @@
+// Copyright 2012 Joyent, Inc. All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+var http = require('http');
+
+var sprintf = require('util').format;
+
+
+
+///--- Globals
+
+var Algorithms = {
+ 'rsa-sha1': true,
+ 'rsa-sha256': true,
+ 'rsa-sha512': true,
+ 'dsa-sha1': true,
+ 'hmac-sha1': true,
+ 'hmac-sha256': true,
+ 'hmac-sha512': true
+};
+
+var Authorization =
+ 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
+
+
+
+///--- Specific Errors
+
+function MissingHeaderError(message) {
+ this.name = 'MissingHeaderError';
+ this.message = message;
+ this.stack = (new Error()).stack;
+}
+MissingHeaderError.prototype = new Error();
+
+
+function InvalidAlgorithmError(message) {
+ this.name = 'InvalidAlgorithmError';
+ this.message = message;
+ this.stack = (new Error()).stack;
+}
+InvalidAlgorithmError.prototype = new Error();
+
+
+
+///--- Internal Functions
+
+function _pad(val) {
+ if (parseInt(val, 10) < 10) {
+ val = '0' + val;
+ }
+ return val;
+}
+
+
+function _rfc1123() {
+ var date = new Date();
+
+ var months = ['Jan',
+ 'Feb',
+ 'Mar',
+ 'Apr',
+ 'May',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Oct',
+ 'Nov',
+ 'Dec'];
+ var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+ return days[date.getUTCDay()] + ', ' +
+ _pad(date.getUTCDate()) + ' ' +
+ months[date.getUTCMonth()] + ' ' +
+ date.getUTCFullYear() + ' ' +
+ _pad(date.getUTCHours()) + ':' +
+ _pad(date.getUTCMinutes()) + ':' +
+ _pad(date.getUTCSeconds()) +
+ ' GMT';
+}
+
+
+
+///--- Exported API
+
+module.exports = {
+
+ /**
+ * Adds an 'Authorization' header to an http.ClientRequest object.
+ *
+ * Note that this API will add a Date header if it's not already set. Any
+ * other headers in the options.headers array MUST be present, or this
+ * will throw.
+ *
+ * You shouldn't need to check the return type; it's just there if you want
+ * to be pedantic.
+ *
+ * @param {Object} request an instance of http.ClientRequest.
+ * @param {Object} options signing parameters object:
+ * - {String} keyId required.
+ * - {String} key required (either a PEM or HMAC key).
+ * - {Array} headers optional; defaults to ['date'].
+ * - {String} algorithm optional; defaults to 'rsa-sha256'.
+ * - {String} httpVersion optional; defaults to '1.1'.
+ * @return {Boolean} true if Authorization (and optionally Date) were added.
+ * @throws {TypeError} on bad parameter types (input).
+ * @throws {InvalidAlgorithmError} if algorithm was bad.
+ * @throws {MissingHeaderError} if a header to be signed was specified but
+ * was not present.
+ */
+ signRequest: function signRequest(request, options) {
+ assert.object(request, 'request');
+ assert.object(options, 'options');
+ assert.optionalString(options.algorithm, 'options.algorithm');
+ assert.string(options.keyId, 'options.keyId');
+ assert.optionalArrayOfString(options.headers, 'options.headers');
+ assert.optionalString(options.httpVersion, 'options.httpVersion');
+
+ if (!request.getHeader('Date'))
+ request.setHeader('Date', _rfc1123());
+ if (!options.headers)
+ options.headers = ['date'];
+ if (!options.algorithm)
+ options.algorithm = 'rsa-sha256';
+ if (!options.httpVersion)
+ options.httpVersion = '1.1';
+
+ options.algorithm = options.algorithm.toLowerCase();
+
+ if (!Algorithms[options.algorithm])
+ throw new InvalidAlgorithmError(options.algorithm + ' is not supported');
+
+ var i;
+ var stringToSign = '';
+ for (i = 0; i < options.headers.length; i++) {
+ if (typeof (options.headers[i]) !== 'string')
+ throw new TypeError('options.headers must be an array of Strings');
+
+ var h = options.headers[i].toLowerCase();
+
+ if (h !== 'request-line') {
+ var value = request.getHeader(h);
+ if (!value) {
+ throw new MissingHeaderError(h + ' was not in the request');
+ }
+ stringToSign += h + ': ' + value;
+ } else {
+ stringToSign +=
+ request.method + ' ' + request.path + ' HTTP/' + options.httpVersion;
+ }
+
+ if ((i + 1) < options.headers.length)
+ stringToSign += '\n';
+ }
+
+ var alg = options.algorithm.match(/(hmac|rsa)-(\w+)/);
+ var signature;
+ if (alg[1] === 'hmac') {
+ var hmac = crypto.createHmac(alg[2].toUpperCase(), options.key);
+ hmac.update(stringToSign);
+ signature = hmac.digest('base64');
+ } else {
+ var signer = crypto.createSign(options.algorithm.toUpperCase());
+ signer.update(stringToSign);
+ signature = signer.sign(options.key, 'base64');
+ }
+
+ request.setHeader('Authorization', sprintf(Authorization,
+ options.keyId,
+ options.algorithm,
+ options.headers.join(' '),
+ signature));
+
+ return true;
+ }
+
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/lib/util.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/util.js b/node_modules/request/node_modules/http-signature/lib/util.js
new file mode 100644
index 0000000..e7d915e
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/util.js
@@ -0,0 +1,304 @@
+// Copyright 2012 Joyent, Inc. All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+
+var asn1 = require('asn1');
+var ctype = require('ctype');
+
+
+
+///--- Helpers
+
+function readNext(buffer, offset) {
+ var len = ctype.ruint32(buffer, 'big', offset);
+ offset += 4;
+
+ var newOffset = offset + len;
+
+ return {
+ data: buffer.slice(offset, newOffset),
+ offset: newOffset
+ };
+}
+
+
+function writeInt(writer, buffer) {
+ writer.writeByte(0x02); // ASN1.Integer
+ writer.writeLength(buffer.length);
+
+ for (var i = 0; i < buffer.length; i++)
+ writer.writeByte(buffer[i]);
+
+ return writer;
+}
+
+
+function rsaToPEM(key) {
+ var buffer;
+ var der;
+ var exponent;
+ var i;
+ var modulus;
+ var newKey = '';
+ var offset = 0;
+ var type;
+ var tmp;
+
+ try {
+ buffer = new Buffer(key.split(' ')[1], 'base64');
+
+ tmp = readNext(buffer, offset);
+ type = tmp.data.toString();
+ offset = tmp.offset;
+
+ if (type !== 'ssh-rsa')
+ throw new Error('Invalid ssh key type: ' + type);
+
+ tmp = readNext(buffer, offset);
+ exponent = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ modulus = tmp.data;
+ } catch (e) {
+ throw new Error('Invalid ssh key: ' + key);
+ }
+
+ // DER is a subset of BER
+ der = new asn1.BerWriter();
+
+ der.startSequence();
+
+ der.startSequence();
+ der.writeOID('1.2.840.113549.1.1.1');
+ der.writeNull();
+ der.endSequence();
+
+ der.startSequence(0x03); // bit string
+ der.writeByte(0x00);
+
+ // Actual key
+ der.startSequence();
+ writeInt(der, modulus);
+ writeInt(der, exponent);
+ der.endSequence();
+
+ // bit string
+ der.endSequence();
+
+ der.endSequence();
+
+ tmp = der.buffer.toString('base64');
+ for (i = 0; i < tmp.length; i++) {
+ if ((i % 64) === 0)
+ newKey += '\n';
+ newKey += tmp.charAt(i);
+ }
+
+ if (!/\\n$/.test(newKey))
+ newKey += '\n';
+
+ return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
+}
+
+
+function dsaToPEM(key) {
+ var buffer;
+ var offset = 0;
+ var tmp;
+ var der;
+ var newKey = '';
+
+ var type;
+ var p;
+ var q;
+ var g;
+ var y;
+
+ try {
+ buffer = new Buffer(key.split(' ')[1], 'base64');
+
+ tmp = readNext(buffer, offset);
+ type = tmp.data.toString();
+ offset = tmp.offset;
+
+ /* JSSTYLED */
+ if (!/^ssh-ds[as].*/.test(type))
+ throw new Error('Invalid ssh key type: ' + type);
+
+ tmp = readNext(buffer, offset);
+ p = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ q = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ g = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ y = tmp.data;
+ } catch (e) {
+ console.log(e.stack);
+ throw new Error('Invalid ssh key: ' + key);
+ }
+
+ // DER is a subset of BER
+ der = new asn1.BerWriter();
+
+ der.startSequence();
+
+ der.startSequence();
+ der.writeOID('1.2.840.10040.4.1');
+
+ der.startSequence();
+ writeInt(der, p);
+ writeInt(der, q);
+ writeInt(der, g);
+ der.endSequence();
+
+ der.endSequence();
+
+ der.startSequence(0x03); // bit string
+ der.writeByte(0x00);
+ writeInt(der, y);
+ der.endSequence();
+
+ der.endSequence();
+
+ tmp = der.buffer.toString('base64');
+ for (var i = 0; i < tmp.length; i++) {
+ if ((i % 64) === 0)
+ newKey += '\n';
+ newKey += tmp.charAt(i);
+ }
+
+ if (!/\\n$/.test(newKey))
+ newKey += '\n';
+
+ return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
+}
+
+
+///--- API
+
+module.exports = {
+
+ /**
+ * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
+ *
+ * The intent of this module is to interoperate with OpenSSL only,
+ * specifically the node crypto module's `verify` method.
+ *
+ * @param {String} key an OpenSSH public key.
+ * @return {String} PEM encoded form of the RSA public key.
+ * @throws {TypeError} on bad input.
+ * @throws {Error} on invalid ssh key formatted data.
+ */
+ sshKeyToPEM: function sshKeyToPEM(key) {
+ assert.string(key, 'ssh_key');
+
+ /* JSSTYLED */
+ if (/^ssh-rsa.*/.test(key))
+ return rsaToPEM(key);
+
+ /* JSSTYLED */
+ if (/^ssh-ds[as].*/.test(key))
+ return dsaToPEM(key);
+
+ throw new Error('Only RSA and DSA public keys are allowed');
+ },
+
+
+ /**
+ * Generates an OpenSSH fingerprint from an ssh public key.
+ *
+ * @param {String} key an OpenSSH public key.
+ * @return {String} key fingerprint.
+ * @throws {TypeError} on bad input.
+ * @throws {Error} if what you passed doesn't look like an ssh public key.
+ */
+ fingerprint: function fingerprint(key) {
+ assert.string(key, 'ssh_key');
+
+ var pieces = key.split(' ');
+ if (!pieces || !pieces.length || pieces.length < 2)
+ throw new Error('invalid ssh key');
+
+ var data = new Buffer(pieces[1], 'base64');
+
+ var hash = crypto.createHash('md5');
+ hash.update(data);
+ var digest = hash.digest('hex');
+
+ var fp = '';
+ for (var i = 0; i < digest.length; i++) {
+ if (i && i % 2 === 0)
+ fp += ':';
+
+ fp += digest[i];
+ }
+
+ return fp;
+ },
+
+ /**
+ * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
+ *
+ * The reverse of the above function.
+ */
+ pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
+ assert.equal('string', typeof pem, 'typeof pem');
+
+ // chop off the BEGIN PUBLIC KEY and END PUBLIC KEY portion
+ var cleaned = pem.split('\n').slice(1, -2).join('');
+
+ var buf = new Buffer(cleaned, 'base64');
+
+ var der = new asn1.BerReader(buf);
+
+ der.readSequence();
+ der.readSequence();
+
+ var oid = der.readOID();
+ assert.equal(oid, '1.2.840.113549.1.1.1', 'pem not in RSA format');
+
+ // Null -- XXX this probably isn't good practice
+ der.readByte();
+ der.readByte();
+
+ // bit string sequence
+ der.readSequence(0x03);
+ der.readByte();
+ der.readSequence();
+
+ // modulus
+ assert.equal(der.peek(), asn1.Ber.Integer, 'modulus not an integer');
+ der._offset = der.readLength(der.offset + 1);
+ var modulus = der._buf.slice(der.offset, der.offset + der.length);
+ der._offset += der.length;
+
+ // exponent
+ assert.equal(der.peek(), asn1.Ber.Integer, 'exponent not an integer');
+ der._offset = der.readLength(der.offset + 1);
+ var exponent = der._buf.slice(der.offset, der.offset + der.length);
+ der._offset += der.length;
+
+ // now, make the key
+ var type = new Buffer('ssh-rsa');
+ var buffer = new Buffer(4 + type.length + 4 + modulus.length + 4 + exponent.length);
+ var i = 0;
+ buffer.writeUInt32BE(type.length, i); i += 4;
+ type.copy(buffer, i); i += type.length;
+ buffer.writeUInt32BE(exponent.length, i); i += 4;
+ exponent.copy(buffer, i); i += exponent.length;
+ buffer.writeUInt32BE(modulus.length, i); i += 4;
+ modulus.copy(buffer, i); i += modulus.length;
+
+ var s = type.toString() + ' ' + buffer.toString('base64') + ' ' + (comment || '');
+ return s;
+ }
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/lib/verify.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/lib/verify.js b/node_modules/request/node_modules/http-signature/lib/verify.js
new file mode 100644
index 0000000..5bf9589
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/verify.js
@@ -0,0 +1,42 @@
+// Copyright 2011 Joyent, Inc. All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+
+
+
+///--- Exported API
+
+module.exports = {
+
+ /**
+ * Simply wraps up the node crypto operations for you, and returns
+ * true or false. You are expected to pass in an object that was
+ * returned from `parse()`.
+ *
+ * @param {Object} parsedSignature the object you got from `parse`.
+ * @param {String} key either an RSA private key PEM or HMAC secret.
+ * @return {Boolean} true if valid, false otherwise.
+ * @throws {TypeError} if you pass in bad arguments.
+ */
+ verifySignature: function verifySignature(parsedSignature, key) {
+ assert.object(parsedSignature, 'parsedSignature');
+ assert.string(key, 'key');
+
+ var alg = parsedSignature.algorithm.match(/(HMAC|RSA|DSA)-(\w+)/);
+ if (!alg || alg.length !== 3)
+ throw new TypeError('parsedSignature: unsupported algorithm ' +
+ parsedSignature.algorithm);
+
+ if (alg[1] === 'HMAC') {
+ var hmac = crypto.createHmac(alg[2].toUpperCase(), key);
+ hmac.update(parsedSignature.signingString);
+ return (hmac.digest('base64') === parsedSignature.params.signature);
+ } else {
+ var verify = crypto.createVerify(alg[0]);
+ verify.update(parsedSignature.signingString);
+ return verify.verify(key, parsedSignature.params.signature, 'base64');
+ }
+ }
+
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
new file mode 100644
index 0000000..ff21d4f
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
@@ -0,0 +1,13 @@
+// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
+
+
+module.exports = {
+
+ newInvalidAsn1Error: function(msg) {
+ var e = new Error();
+ e.name = 'InvalidAsn1Error';
+ e.message = msg || '';
+ return e;
+ }
+
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
new file mode 100644
index 0000000..4fb90ae
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
@@ -0,0 +1,27 @@
+// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
+
+var errors = require('./errors');
+var types = require('./types');
+
+var Reader = require('./reader');
+var Writer = require('./writer');
+
+
+///--- Exports
+
+module.exports = {
+
+ Reader: Reader,
+
+ Writer: Writer
+
+};
+
+for (var t in types) {
+ if (types.hasOwnProperty(t))
+ module.exports[t] = types[t];
+}
+for (var e in errors) {
+ if (errors.hasOwnProperty(e))
+ module.exports[e] = errors[e];
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
new file mode 100644
index 0000000..bd3357a
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
@@ -0,0 +1,267 @@
+// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
+
+var assert = require('assert');
+
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+///--- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+
+
+///--- API
+
+function Reader(data) {
+ if (!data || !Buffer.isBuffer(data))
+ throw new TypeError('data must be a node Buffer');
+
+ this._buf = data;
+ this._size = data.length;
+
+ // These hold the "current" state
+ this._len = 0;
+ this._offset = 0;
+
+ var self = this;
+ this.__defineGetter__('length', function() { return self._len; });
+ this.__defineGetter__('offset', function() { return self._offset; });
+ this.__defineGetter__('remain', function() {
+ return self._size - self._offset;
+ });
+ this.__defineGetter__('buffer', function() {
+ return self._buf.slice(self._offset);
+ });
+}
+
+
+/**
+ * Reads a single byte and advances offset; you can pass in `true` to make this
+ * a "peek" operation (i.e., get the byte, but don't advance the offset).
+ *
+ * @param {Boolean} peek true means don't move offset.
+ * @return {Number} the next byte, null if not enough data.
+ */
+Reader.prototype.readByte = function(peek) {
+ if (this._size - this._offset < 1)
+ return null;
+
+ var b = this._buf[this._offset] & 0xff;
+
+ if (!peek)
+ this._offset += 1;
+
+ return b;
+};
+
+
+Reader.prototype.peek = function() {
+ return this.readByte(true);
+};
+
+
+/**
+ * Reads a (potentially) variable length off the BER buffer. This call is
+ * not really meant to be called directly, as callers have to manipulate
+ * the internal buffer afterwards.
+ *
+ * As a result of this call, you can call `Reader.length`, until the
+ * next thing called that does a readLength.
+ *
+ * @return {Number} the amount of offset to advance the buffer.
+ * @throws {InvalidAsn1Error} on bad ASN.1
+ */
+Reader.prototype.readLength = function(offset) {
+ if (offset === undefined)
+ offset = this._offset;
+
+ if (offset >= this._size)
+ return null;
+
+ var lenB = this._buf[offset++] & 0xff;
+ if (lenB === null)
+ return null;
+
+ if ((lenB & 0x80) == 0x80) {
+ lenB &= 0x7f;
+
+ if (lenB == 0)
+ throw newInvalidAsn1Error('Indefinite length not supported');
+
+ if (lenB > 4)
+ throw newInvalidAsn1Error('encoding too long');
+
+ if (this._size - offset < lenB)
+ return null;
+
+ this._len = 0;
+ for (var i = 0; i < lenB; i++)
+ this._len = (this._len << 8) + (this._buf[offset++] & 0xff);
+
+ } else {
+ // Wasn't a variable length
+ this._len = lenB;
+ }
+
+ return offset;
+};
+
+
+/**
+ * Parses the next sequence in this BER buffer.
+ *
+ * To get the length of the sequence, call `Reader.length`.
+ *
+ * @return {Number} the sequence's tag.
+ */
+Reader.prototype.readSequence = function(tag) {
+ var seq = this.peek();
+ if (seq === null)
+ return null;
+ if (tag !== undefined && tag !== seq)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + seq.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ this._offset = o;
+ return seq;
+};
+
+
+Reader.prototype.readInt = function() {
+ return this._readTag(ASN1.Integer);
+};
+
+
+Reader.prototype.readBoolean = function() {
+ return (this._readTag(ASN1.Boolean) === 0 ? false : true);
+};
+
+
+Reader.prototype.readEnumeration = function() {
+ return this._readTag(ASN1.Enumeration);
+};
+
+
+Reader.prototype.readString = function(tag, retbuf) {
+ if (!tag)
+ tag = ASN1.OctetString;
+
+ var b = this.peek();
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+
+ if (o === null)
+ return null;
+
+ if (this.length > this._size - o)
+ return null;
+
+ this._offset = o;
+
+ if (this.length === 0)
+ return '';
+
+ var str = this._buf.slice(this._offset, this._offset + this.length);
+ this._offset += this.length;
+
+ return retbuf ? str : str.toString('utf8');
+};
+
+Reader.prototype.readOID = function(tag) {
+ if (!tag)
+ tag = ASN1.OID;
+
+ var b = this.peek();
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ if (this.length > this._size - o)
+ return null;
+
+ this._offset = o;
+
+ var values = [];
+ var value = 0;
+
+ for (var i = 0; i < this.length; i++) {
+ var byte = this._buf[this._offset++] & 0xff;
+
+ value <<= 7;
+ value += byte & 0x7f;
+ if ((byte & 0x80) == 0) {
+ values.push(value);
+ value = 0;
+ }
+ }
+
+ value = values.shift();
+ values.unshift(value % 40);
+ values.unshift((value / 40) >> 0);
+
+ return values.join('.');
+};
+
+
+Reader.prototype._readTag = function(tag) {
+ assert.ok(tag !== undefined);
+
+ var b = this.peek();
+
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ if (this.length > 4)
+ throw newInvalidAsn1Error('Integer too long: ' + this.length);
+
+ if (this.length > this._size - o)
+ return null;
+ this._offset = o;
+
+ var fb = this._buf[this._offset++];
+ var value = 0;
+
+ value = fb & 0x7F;
+ for (var i = 1; i < this.length; i++) {
+ value <<= 8;
+ value |= (this._buf[this._offset++] & 0xff);
+ }
+
+ if ((fb & 0x80) == 0x80)
+ value = -value;
+
+ return value;
+};
+
+
+
+///--- Exported API
+
+module.exports = Reader;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
new file mode 100644
index 0000000..8aea000
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
@@ -0,0 +1,36 @@
+// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
+
+
+module.exports = {
+ EOC: 0,
+ Boolean: 1,
+ Integer: 2,
+ BitString: 3,
+ OctetString: 4,
+ Null: 5,
+ OID: 6,
+ ObjectDescriptor: 7,
+ External: 8,
+ Real: 9, // float
+ Enumeration: 10,
+ PDV: 11,
+ Utf8String: 12,
+ RelativeOID: 13,
+ Sequence: 16,
+ Set: 17,
+ NumericString: 18,
+ PrintableString: 19,
+ T61String: 20,
+ VideotexString: 21,
+ IA5String: 22,
+ UTCTime: 23,
+ GeneralizedTime: 24,
+ GraphicString: 25,
+ VisibleString: 26,
+ GeneralString: 28,
+ UniversalString: 29,
+ CharacterString: 30,
+ BMPString: 31,
+ Constructor: 32,
+ Context: 128
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
new file mode 100644
index 0000000..7b445cc
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
@@ -0,0 +1,317 @@
+// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
+
+var assert = require('assert');
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+///--- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+var DEFAULT_OPTS = {
+ size: 1024,
+ growthFactor: 8
+};
+
+
+///--- Helpers
+
+function merge(from, to) {
+ assert.ok(from);
+ assert.equal(typeof(from), 'object');
+ assert.ok(to);
+ assert.equal(typeof(to), 'object');
+
+ var keys = Object.getOwnPropertyNames(from);
+ keys.forEach(function(key) {
+ if (to[key])
+ return;
+
+ var value = Object.getOwnPropertyDescriptor(from, key);
+ Object.defineProperty(to, key, value);
+ });
+
+ return to;
+}
+
+
+
+///--- API
+
+function Writer(options) {
+ options = merge(DEFAULT_OPTS, options || {});
+
+ this._buf = new Buffer(options.size || 1024);
+ this._size = this._buf.length;
+ this._offset = 0;
+ this._options = options;
+
+ // A list of offsets in the buffer where we need to insert
+ // sequence tag/len pairs.
+ this._seq = [];
+
+ var self = this;
+ this.__defineGetter__('buffer', function() {
+ if (self._seq.length)
+ throw new InvalidAsn1Error(self._seq.length + ' unended sequence(s)');
+
+ return self._buf.slice(0, self._offset);
+ });
+}
+
+
+Writer.prototype.writeByte = function(b) {
+ if (typeof(b) !== 'number')
+ throw new TypeError('argument must be a Number');
+
+ this._ensure(1);
+ this._buf[this._offset++] = b;
+};
+
+
+Writer.prototype.writeInt = function(i, tag) {
+ if (typeof(i) !== 'number')
+ throw new TypeError('argument must be a Number');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Integer;
+
+ var sz = 4;
+
+ while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000)) &&
+ (sz > 1)) {
+ sz--;
+ i <<= 8;
+ }
+
+ if (sz > 4)
+ throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff');
+
+ this._ensure(2 + sz);
+ this._buf[this._offset++] = tag;
+ this._buf[this._offset++] = sz;
+
+ while (sz-- > 0) {
+ this._buf[this._offset++] = ((i & 0xff000000) >> 24);
+ i <<= 8;
+ }
+
+};
+
+
+Writer.prototype.writeNull = function() {
+ this.writeByte(ASN1.Null);
+ this.writeByte(0x00);
+};
+
+
+Writer.prototype.writeEnumeration = function(i, tag) {
+ if (typeof(i) !== 'number')
+ throw new TypeError('argument must be a Number');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Enumeration;
+
+ return this.writeInt(i, tag);
+};
+
+
+Writer.prototype.writeBoolean = function(b, tag) {
+ if (typeof(b) !== 'boolean')
+ throw new TypeError('argument must be a Boolean');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Boolean;
+
+ this._ensure(3);
+ this._buf[this._offset++] = tag;
+ this._buf[this._offset++] = 0x01;
+ this._buf[this._offset++] = b ? 0xff : 0x00;
+};
+
+
+Writer.prototype.writeString = function(s, tag) {
+ if (typeof(s) !== 'string')
+ throw new TypeError('argument must be a string (was: ' + typeof(s) + ')');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.OctetString;
+
+ var len = Buffer.byteLength(s);
+ this.writeByte(tag);
+ this.writeLength(len);
+ if (len) {
+ this._ensure(len);
+ this._buf.write(s, this._offset);
+ this._offset += len;
+ }
+};
+
+
+Writer.prototype.writeBuffer = function(buf, tag) {
+ if (typeof(tag) !== 'number')
+ throw new TypeError('tag must be a number');
+ if (!Buffer.isBuffer(buf))
+ throw new TypeError('argument must be a buffer');
+
+ this.writeByte(tag);
+ this.writeLength(buf.length);
+ this._ensure(buf.length);
+ buf.copy(this._buf, this._offset, 0, buf.length);
+ this._offset += buf.length;
+};
+
+
+Writer.prototype.writeStringArray = function(strings) {
+ if ((!strings instanceof Array))
+ throw new TypeError('argument must be an Array[String]');
+
+ var self = this;
+ strings.forEach(function(s) {
+ self.writeString(s);
+ });
+};
+
+// This is really to solve DER cases, but whatever for now
+Writer.prototype.writeOID = function(s, tag) {
+ if (typeof(s) !== 'string')
+ throw new TypeError('argument must be a string');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.OID;
+
+ if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
+ throw new Error('argument is not a valid OID string');
+
+ function encodeOctet(bytes, octet) {
+ if (octet < 128) {
+ bytes.push(octet);
+ } else if (octet < 16384) {
+ bytes.push((octet >>> 7) | 0x80);
+ bytes.push(octet & 0x7F);
+ } else if (octet < 2097152) {
+ bytes.push((octet >>> 14) | 0x80);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ } else if (octet < 268435456) {
+ bytes.push((octet >>> 21) | 0x80);
+ bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ } else {
+ bytes.push(((octet >>> 28) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 21) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ }
+ }
+
+ var tmp = s.split('.');
+ var bytes = [];
+ bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
+ tmp.slice(2).forEach(function(b) {
+ encodeOctet(bytes, parseInt(b, 10));
+ });
+
+ var self = this;
+ this._ensure(2 + bytes.length);
+ this.writeByte(tag);
+ this.writeLength(bytes.length);
+ bytes.forEach(function(b) {
+ self.writeByte(b);
+ });
+};
+
+
+Writer.prototype.writeLength = function(len) {
+ if (typeof(len) !== 'number')
+ throw new TypeError('argument must be a Number');
+
+ this._ensure(4);
+
+ if (len <= 0x7f) {
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xff) {
+ this._buf[this._offset++] = 0x81;
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xffff) {
+ this._buf[this._offset++] = 0x82;
+ this._buf[this._offset++] = len >> 8;
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xffffff) {
+ this._shift(start, len, 1);
+ this._buf[this._offset++] = 0x83;
+ this._buf[this._offset++] = len >> 16;
+ this._buf[this._offset++] = len >> 8;
+ this._buf[this._offset++] = len;
+ } else {
+ throw new InvalidAsn1ERror('Length too long (> 4 bytes)');
+ }
+};
+
+Writer.prototype.startSequence = function(tag) {
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Sequence | ASN1.Constructor;
+
+ this.writeByte(tag);
+ this._seq.push(this._offset);
+ this._ensure(3);
+ this._offset += 3;
+};
+
+
+Writer.prototype.endSequence = function() {
+ var seq = this._seq.pop();
+ var start = seq + 3;
+ var len = this._offset - start;
+
+ if (len <= 0x7f) {
+ this._shift(start, len, -2);
+ this._buf[seq] = len;
+ } else if (len <= 0xff) {
+ this._shift(start, len, -1);
+ this._buf[seq] = 0x81;
+ this._buf[seq + 1] = len;
+ } else if (len <= 0xffff) {
+ this._buf[seq] = 0x82;
+ this._buf[seq + 1] = len >> 8;
+ this._buf[seq + 2] = len;
+ } else if (len <= 0xffffff) {
+ this._shift(start, len, 1);
+ this._buf[seq] = 0x83;
+ this._buf[seq + 1] = len >> 16;
+ this._buf[seq + 2] = len >> 8;
+ this._buf[seq + 3] = len;
+ } else {
+ throw new InvalidAsn1Error('Sequence too long');
+ }
+};
+
+
+Writer.prototype._shift = function(start, len, shift) {
+ assert.ok(start !== undefined);
+ assert.ok(len !== undefined);
+ assert.ok(shift);
+
+ this._buf.copy(this._buf, start + shift, start, start + len);
+ this._offset += shift;
+};
+
+Writer.prototype._ensure = function(len) {
+ assert.ok(len);
+
+ if (this._size - this._offset < len) {
+ var sz = this._size * this._options.growthFactor;
+ if (sz - this._offset < len)
+ sz += len;
+
+ var buf = new Buffer(sz);
+
+ this._buf.copy(buf, 0, 0, this._offset);
+ this._buf = buf;
+ this._size = sz;
+ }
+};
+
+
+
+///--- Exported API
+
+module.exports = Writer;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
new file mode 100644
index 0000000..d1766e7
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
@@ -0,0 +1,20 @@
+// Copyright 2011 Mark Cavage <mc...@gmail.com> All rights reserved.
+
+// If you have no idea what ASN.1 or BER is, see this:
+// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
+
+var Ber = require('./ber/index');
+
+
+
+///--- Exported API
+
+module.exports = {
+
+ Ber: Ber,
+
+ BerReader: Ber.Reader,
+
+ BerWriter: Ber.Writer
+
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype b/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
new file mode 100644
index 0000000..3f94986
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
@@ -0,0 +1,241 @@
+'\" te
+.\" Copyright (c) 2011, Robert Mustacchi. All Rights Reserved.
+.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining a copy
+.\" of this software and associated documentation files (the "Software"), to
+.\" deal in the Software without restriction, including without limitation the
+.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+.\" sell copies of the Software, and to permit persons to whom the Software is
+.\" furnished to do so, subject to the following conditions:
+.\"
+.\" The above copyright notice and this permission notice shall be included in
+.\" all copies or substantial portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+.\" IN THE SOFTWARE.
+.TH CTIO 3CTYPE "December 12, 2011"
+.SH NAME
+ctio, ruint8, ruint16, ruint32, ruint64, wuint8, wuint16, wuint32, wuint64,
+rsint8, rsint16, rsint32, rsint64, wsint8, wsint16, wsint32, wsint64, rfloat,
+rdouble, wfloat, wdouble \- integer and float operations
+.SH SYNOPSIS
+.LP
+.nf
+var mod_ctype = require('ctype');
+
+\fBNumber\fR \fBmod_ctype.ruint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.ruint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.ruint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber[2]\fR \fBmod_ctype.ruint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber[2]\fR \fBmod_ctype.rsint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rfloat\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rdouble\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wfloat\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wdouble\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The argument \fIbuf\fR refers to a valid buffer (from calling new Buffer()). The
+argument \fIendian\fR is either the string 'big' or 'little' and controls
+whether the data in the buffer is interpreted as big or little endian. The argument
+\fIoffset\fR indicates the starting index into the buffer to read or write. All
+functions ensure that starting at \fIoffset\fR does not overflow the end of the
+buffer. The argument \fIvalue\fR is a Number that is the valid type for the
+specific function. All functions that take \fIvalue\fR as an argument, verify
+that the passed value is valid.
+
+.SS "\fBruint8()\fR, \fBruint16()\fR, \fBruint32()\fR"
+.sp
+.LP
+The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions read an 8,
+16, and 32-bit unsigned value from \fIbuf\fR and return it. The value read is
+influenced by the values of \fIoffset\fR and \fRendian\fI.
+
+
+.SS "\fBrsint8()\fR, \fBrsint16()\fR, \fBrsint32()\fR"
+.sp
+.LP
+The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions work just as
+\fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR, except they return signed
+integers.
+
+.SS "\fBruint64()\fR, \fBrsint64()\fR"
+.sp
+.LP
+The \fBruint64()\fR and \fBrsint64()\fR functions read unsigned and signed 64
+bit integers respectively from \fBbuf\fR. Due to the limitations of ECMAScript's
+\fBNumber\fR type, they cannot be stored as one value without a loss of
+precision. Instead of returning the values as a single \fBNumber\fR, the
+functions return an array of two numbers. The first entry always contains the
+upper 32-bits and the second value contains the lower 32-bits. The lossy
+transformation into a number would be \fIres[0]*Math.pow(2,32)+res[1]\fR.
+Note that, unless an entry is zero, both array entries are guaranteed to have
+the same sign.
+
+.SS "\fBwuint8()\fR, \fBwuint16()\fR, \fBwuint32()\fR"
+.sp
+.LP
+The functions \fBwuint8()\fR, \fBwuint16()\fR, and \fBwuint32()\fR modify the
+contents of \fBbuf\fR by writing an 8, 16, and 32-bit unsigned integer
+respectively to \fBbuf\fR. It is illegal to pass a number that is not an integer
+within the domain of the integer size, for example, for \fBwuint8()\fR the valid
+range is \fB[0, 255]\fR. The value will be written in either big or little
+endian format based upon the value of \fBendian\fR.
+
+
+.SS "\fBwsint8()\fR, \fBwsint16()\fR, \fBwsint32()\fR"
+.sp
+.LP
+The functions \fBwsint8()\fR, \fBwsint16()\fR, and \fBwsint32()\fR function
+identically to the functions \fBwuint8()\fR, \fBwuint16()\fR, and
+\fBwuint32()\fR except that they the valid domain for \fBvalue\fR is that of a
+signed number instead of an unsigned number. For example the \fBwsint8()\fR has
+a domain of \fB[-128, 127]\fR.
+
+.SS "\fBwuint64()\fR, \fBwsint64()\fR"
+.sp
+.LP
+The functions \fBwuint64()\fR and \fBswint64()\fR write out 64-bit unsigned and
+signed integers to \fBbuf\fR. The \fBvalue\fR argument must be in the same
+format as described in \fBruint64()\fR and \fBrsint64()\fR.
+
+.SS "\fBrfloat()\fR, \fBrdouble()\fR"
+.sp
+.LP
+The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other read
+functions, except that they read a single precision and double precision
+IEEE-754 floating point value instead.
+
+.SS "\fBwfloat()\fR, \fBwdouble()\fR"
+.sp
+.LP
+The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other write
+functions, except that the domain for a float is that of a single precision 4
+byte value. The domain for a double is any \fBNumber\fR in ECMAScript, which is
+defined to be represented by a double.
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Interface Stability Committed
+_
+MT-Level See below.
+_
+Standard Not standardized.
+.TE
+
+.sp
+.LP
+
+All functions are MT-safe in so far as there aren't shared memory MT concerns in
+most node programs. If one where to concoct such an environment, these functions
+wouldn't be MT-safe.
+
+.SH SEE ALSO
+.sp
+.LP
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/.npmignore b/node_modules/request/node_modules/json-stringify-safe/.npmignore
new file mode 100644
index 0000000..17d6b36
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/.npmignore
@@ -0,0 +1 @@
+/*.tgz
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md b/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
new file mode 100644
index 0000000..42bcb60
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
@@ -0,0 +1,14 @@
+## Unreleased
+- Fixes stringify to only take ancestors into account when checking
+ circularity.
+ It previously assumed every visited object was circular which led to [false
+ positives][issue9].
+ Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago.
+- Fixes calling the `replacer` function in the proper context (`thisArg`).
+- Fixes calling the `cycleReplacer` function in the proper context (`thisArg`).
+- Speeds serializing by a factor of
+ Big-O(h-my-god-it-linearly-searched-every-object) it had ever seen. Searching
+ only the ancestors for a circular references speeds up things considerably.
+
+[must]: https://github.com/moll/js-must
+[issue9]: https://github.com/isaacs/json-stringify-safe/issues/9
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/LICENSE b/node_modules/request/node_modules/json-stringify-safe/LICENSE
index 0c44ae7..19129e3 100644
--- a/node_modules/request/node_modules/json-stringify-safe/LICENSE
+++ b/node_modules/request/node_modules/json-stringify-safe/LICENSE
@@ -1,27 +1,15 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
+The ISC License
-The BSD License
+Copyright (c) Isaac Z. Schlueter and Contributors
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/Makefile b/node_modules/request/node_modules/json-stringify-safe/Makefile
new file mode 100644
index 0000000..36088c7
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/Makefile
@@ -0,0 +1,35 @@
+NODE_OPTS =
+TEST_OPTS =
+
+love:
+ @echo "Feel like makin' love."
+
+test:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS)
+
+spec:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS)
+
+autotest:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS)
+
+autospec:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS)
+
+pack:
+ @file=$$(npm pack); echo "$$file"; tar tf "$$file"
+
+publish:
+ npm publish
+
+tag:
+ git tag "v$$(node -e 'console.log(require("./package").version)')"
+
+clean:
+ rm -f *.tgz
+ npm prune --production
+
+.PHONY: love
+.PHONY: test spec autotest autospec
+.PHONY: pack publish tag
+.PHONY: clean
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/README.md b/node_modules/request/node_modules/json-stringify-safe/README.md
index 5d764f3..a11f302 100644
--- a/node_modules/request/node_modules/json-stringify-safe/README.md
+++ b/node_modules/request/node_modules/json-stringify-safe/README.md
@@ -47,3 +47,6 @@ stringify.getSerialize(serializer, decycler)
Returns a serializer that can be used elsewhere. This is the actual
function that's passed to JSON.stringify.
+
+**Note** that the function returned from `getSerialize` is stateful for now, so
+do **not** use it more than once.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/package.json b/node_modules/request/node_modules/json-stringify-safe/package.json
index 90549cb..e3cbf9a 100644
--- a/node_modules/request/node_modules/json-stringify-safe/package.json
+++ b/node_modules/request/node_modules/json-stringify-safe/package.json
@@ -1,50 +1,68 @@
{
"name": "json-stringify-safe",
- "version": "5.0.0",
- "description": "Like JSON.stringify, but doesn't blow up on circular refs",
- "main": "stringify.js",
- "scripts": {
- "test": "node test.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/json-stringify-safe"
- },
+ "version": "5.0.1",
+ "description": "Like JSON.stringify, but doesn't blow up on circular refs.",
"keywords": [
"json",
"stringify",
"circular",
"safe"
],
+ "homepage": "https://github.com/isaacs/json-stringify-safe",
+ "bugs": {
+ "url": "https://github.com/isaacs/json-stringify-safe/issues"
+ },
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"url": "http://blog.izs.me"
},
- "license": "BSD",
- "bugs": {
- "url": "https://github.com/isaacs/json-stringify-safe/issues"
+ "contributors": [
+ {
+ "name": "Andri Möll",
+ "email": "andri@dot.ee",
+ "url": "http://themoll.com"
+ }
+ ],
+ "license": "ISC",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/json-stringify-safe.git"
},
- "_id": "json-stringify-safe@5.0.0",
- "dist": {
- "shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e",
- "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
+ "main": "stringify.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "devDependencies": {
+ "mocha": ">= 2.1.0 < 3",
+ "must": ">= 0.12 < 0.13",
+ "sinon": ">= 1.12.2 < 2"
},
+ "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5",
+ "_id": "json-stringify-safe@5.0.1",
+ "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
"_from": "json-stringify-safe@>=5.0.0 <5.1.0",
- "_npmVersion": "1.3.6",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
"name": "isaacs",
- "email": "i@izs.me"
+ "email": "isaacs@npmjs.com"
+ },
+ "dist": {
+ "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
+ "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
+ },
+ {
+ "name": "moll",
+ "email": "andri@dot.ee"
}
],
"directories": {},
- "_shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e",
- "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz",
- "readme": "ERROR: No README data found!",
- "homepage": "https://github.com/isaacs/json-stringify-safe"
+ "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "readme": "ERROR: No README data found!"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/stringify.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/stringify.js b/node_modules/request/node_modules/json-stringify-safe/stringify.js
index 853ef9b..124a452 100644
--- a/node_modules/request/node_modules/json-stringify-safe/stringify.js
+++ b/node_modules/request/node_modules/json-stringify-safe/stringify.js
@@ -1,39 +1,27 @@
-module.exports = stringify;
+exports = module.exports = stringify
+exports.getSerialize = serializer
-function getSerialize (fn, decycle) {
- var seen = [], keys = [];
- decycle = decycle || function(key, value) {
- return '[Circular ' + getPath(value, seen, keys) + ']'
- };
- return function(key, value) {
- var ret = value;
- if (typeof value === 'object' && value) {
- if (seen.indexOf(value) !== -1)
- ret = decycle(key, value);
- else {
- seen.push(value);
- keys.push(key);
- }
- }
- if (fn) ret = fn(key, ret);
- return ret;
- }
+function stringify(obj, replacer, spaces, cycleReplacer) {
+ return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
}
-function getPath (value, seen, keys) {
- var index = seen.indexOf(value);
- var path = [ keys[index] ];
- for (index--; index >= 0; index--) {
- if (seen[index][ path[0] ] === value) {
- value = seen[index];
- path.unshift(keys[index]);
- }
+function serializer(replacer, cycleReplacer) {
+ var stack = [], keys = []
+
+ if (cycleReplacer == null) cycleReplacer = function(key, value) {
+ if (stack[0] === value) return "[Circular ~]"
+ return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
}
- return '~' + path.join('.');
-}
-function stringify(obj, fn, spaces, decycle) {
- return JSON.stringify(obj, getSerialize(fn, decycle), spaces);
-}
+ return function(key, value) {
+ if (stack.length > 0) {
+ var thisPos = stack.indexOf(this)
+ ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
+ ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
+ if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
+ }
+ else stack.push(value)
-stringify.getSerialize = getSerialize;
+ return replacer == null ? value : replacer.call(this, key, value)
+ }
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/test.js b/node_modules/request/node_modules/json-stringify-safe/test.js
deleted file mode 100644
index 991e919..0000000
--- a/node_modules/request/node_modules/json-stringify-safe/test.js
+++ /dev/null
@@ -1,128 +0,0 @@
-var stringify = require('./stringify.js');
-
-var circularObj = { a: 'b' };
-circularObj.circularRef = circularObj;
-circularObj.list = [ circularObj, circularObj ];
-
-//////////
-// default
-var testObj = {
- "a": "b",
- "circularRef": "[Circular ~]",
- "list": [
- "[Circular ~]",
- "[Circular ~]"
- ]
-};
-
-var assert = require('assert');
-assert.equal(JSON.stringify(testObj, null, 2),
- stringify(circularObj, null, 2));
-
-assert.equal(JSON.stringify(testObj, null, 2),
- JSON.stringify(circularObj, stringify.getSerialize(), 2));
-
-
-////////
-// prune
-testObj = {
- "a": "b",
- "list": [
- null,
- null
- ]
-};
-
-function prune(k, v) {}
-
-assert.equal(JSON.stringify(testObj, null, 2),
- stringify(circularObj, null, 2, prune));
-
-///////////
-// re-cycle
-// (throws)
-function recycle(k, v) {
- return v;
-}
-
-assert.throws(function() {
- stringify(circularObj, null, 2, recycle);
-});
-
-////////
-// fancy
-testObj = {
- "a": "b",
- "circularRef": "circularRef{a:string,circularRef:Object,list:Array}",
- "list": [
- "0{a:string,circularRef:Object,list:Array}",
- "1{a:string,circularRef:Object,list:Array}"
- ]
-};
-
-function signer(key, value) {
- var ret = key + '{';
- var f = false;
- for (var i in value) {
- if (f)
- ret += ',';
- f = true;
- ret += i + ':';
- var v = value[i];
- switch (typeof v) {
- case 'object':
- if (!v)
- ret += 'null';
- else if (Array.isArray(v))
- ret += 'Array'
- else
- ret += v.constructor && v.constructor.name || 'Object';
- break;
- default:
- ret += typeof v;
- break;
- }
- }
- ret += '}';
- return ret;
-}
-
-assert.equal(JSON.stringify(testObj, null, 2),
- stringify(circularObj, null, 2, signer));
-
-
-///////
-//multi
-var a = { x: 1 };
-a.a = a;
-var b = { x: 2 };
-b.a = a;
-
-var c = { a: a, b: b };
-var d = { list: [ a, b, c ] };
-d.d = d;
-
-var multi = {
- "list": [
- {
- "x": 1,
- "a": "[Circular ~.list.0]"
- },
- {
- "x": 2,
- "a": "[Circular ~.list.0]"
- },
- {
- "a": "[Circular ~.list.0]",
- "b": "[Circular ~.list.1]"
- }
- ],
- "d": "[Circular ~]"
-};
-
-assert.equal(JSON.stringify(multi, null, 2),
- stringify(d, null, 2));
-
-////////
-// pass!
-console.log('ok');
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts b/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
new file mode 100644
index 0000000..2544e58
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
@@ -0,0 +1,2 @@
+--recursive
+--require must
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js b/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
new file mode 100644
index 0000000..5b32583
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
@@ -0,0 +1,246 @@
+var Sinon = require("sinon")
+var stringify = require("..")
+function jsonify(obj) { return JSON.stringify(obj, null, 2) }
+
+describe("Stringify", function() {
+ it("must stringify circular objects", function() {
+ var obj = {name: "Alice"}
+ obj.self = obj
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
+ })
+
+ it("must stringify circular objects with intermediaries", function() {
+ var obj = {name: "Alice"}
+ obj.identity = {self: obj}
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify({name: "Alice", identity: {self: "[Circular ~]"}}))
+ })
+
+ it("must stringify circular objects deeper", function() {
+ var obj = {name: "Alice", child: {name: "Bob"}}
+ obj.child.self = obj.child
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice",
+ child: {name: "Bob", self: "[Circular ~.child]"}
+ }))
+ })
+
+ it("must stringify circular objects deeper with intermediaries", function() {
+ var obj = {name: "Alice", child: {name: "Bob"}}
+ obj.child.identity = {self: obj.child}
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice",
+ child: {name: "Bob", identity: {self: "[Circular ~.child]"}}
+ }))
+ })
+
+ it("must stringify circular objects in an array", function() {
+ var obj = {name: "Alice"}
+ obj.self = [obj, obj]
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice", self: ["[Circular ~]", "[Circular ~]"]
+ }))
+ })
+
+ it("must stringify circular objects deeper in an array", function() {
+ var obj = {name: "Alice", children: [{name: "Bob"}, {name: "Eve"}]}
+ obj.children[0].self = obj.children[0]
+ obj.children[1].self = obj.children[1]
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice",
+ children: [
+ {name: "Bob", self: "[Circular ~.children.0]"},
+ {name: "Eve", self: "[Circular ~.children.1]"}
+ ]
+ }))
+ })
+
+ it("must stringify circular arrays", function() {
+ var obj = []
+ obj.push(obj)
+ obj.push(obj)
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify(["[Circular ~]", "[Circular ~]"]))
+ })
+
+ it("must stringify circular arrays with intermediaries", function() {
+ var obj = []
+ obj.push({name: "Alice", self: obj})
+ obj.push({name: "Bob", self: obj})
+
+ stringify(obj, null, 2).must.eql(jsonify([
+ {name: "Alice", self: "[Circular ~]"},
+ {name: "Bob", self: "[Circular ~]"}
+ ]))
+ })
+
+ it("must stringify repeated objects in objects", function() {
+ var obj = {}
+ var alice = {name: "Alice"}
+ obj.alice1 = alice
+ obj.alice2 = alice
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ alice1: {name: "Alice"},
+ alice2: {name: "Alice"}
+ }))
+ })
+
+ it("must stringify repeated objects in arrays", function() {
+ var alice = {name: "Alice"}
+ var obj = [alice, alice]
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify([{name: "Alice"}, {name: "Alice"}]))
+ })
+
+ it("must call given decycler and use its output", function() {
+ var obj = {}
+ obj.a = obj
+ obj.b = obj
+
+ var decycle = Sinon.spy(function() { return decycle.callCount })
+ var json = stringify(obj, null, 2, decycle)
+ json.must.eql(jsonify({a: 1, b: 2}, null, 2))
+
+ decycle.callCount.must.equal(2)
+ decycle.thisValues[0].must.equal(obj)
+ decycle.args[0][0].must.equal("a")
+ decycle.args[0][1].must.equal(obj)
+ decycle.thisValues[1].must.equal(obj)
+ decycle.args[1][0].must.equal("b")
+ decycle.args[1][1].must.equal(obj)
+ })
+
+ it("must call replacer and use its output", function() {
+ var obj = {name: "Alice", child: {name: "Bob"}}
+
+ var replacer = Sinon.spy(bangString)
+ var json = stringify(obj, replacer, 2)
+ json.must.eql(jsonify({name: "Alice!", child: {name: "Bob!"}}))
+
+ replacer.callCount.must.equal(4)
+ replacer.args[0][0].must.equal("")
+ replacer.args[0][1].must.equal(obj)
+ replacer.thisValues[1].must.equal(obj)
+ replacer.args[1][0].must.equal("name")
+ replacer.args[1][1].must.equal("Alice")
+ replacer.thisValues[2].must.equal(obj)
+ replacer.args[2][0].must.equal("child")
+ replacer.args[2][1].must.equal(obj.child)
+ replacer.thisValues[3].must.equal(obj.child)
+ replacer.args[3][0].must.equal("name")
+ replacer.args[3][1].must.equal("Bob")
+ })
+
+ it("must call replacer after describing circular references", function() {
+ var obj = {name: "Alice"}
+ obj.self = obj
+
+ var replacer = Sinon.spy(bangString)
+ var json = stringify(obj, replacer, 2)
+ json.must.eql(jsonify({name: "Alice!", self: "[Circular ~]!"}))
+
+ replacer.callCount.must.equal(3)
+ replacer.args[0][0].must.equal("")
+ replacer.args[0][1].must.equal(obj)
+ replacer.thisValues[1].must.equal(obj)
+ replacer.args[1][0].must.equal("name")
+ replacer.args[1][1].must.equal("Alice")
+ replacer.thisValues[2].must.equal(obj)
+ replacer.args[2][0].must.equal("self")
+ replacer.args[2][1].must.equal("[Circular ~]")
+ })
+
+ it("must call given decycler and use its output for nested objects",
+ function() {
+ var obj = {}
+ obj.a = obj
+ obj.b = {self: obj}
+
+ var decycle = Sinon.spy(function() { return decycle.callCount })
+ var json = stringify(obj, null, 2, decycle)
+ json.must.eql(jsonify({a: 1, b: {self: 2}}))
+
+ decycle.callCount.must.equal(2)
+ decycle.args[0][0].must.equal("a")
+ decycle.args[0][1].must.equal(obj)
+ decycle.args[1][0].must.equal("self")
+ decycle.args[1][1].must.equal(obj)
+ })
+
+ it("must use decycler's output when it returned null", function() {
+ var obj = {a: "b"}
+ obj.self = obj
+ obj.selves = [obj, obj]
+
+ function decycle() { return null }
+ stringify(obj, null, 2, decycle).must.eql(jsonify({
+ a: "b",
+ self: null,
+ selves: [null, null]
+ }))
+ })
+
+ it("must use decycler's output when it returned undefined", function() {
+ var obj = {a: "b"}
+ obj.self = obj
+ obj.selves = [obj, obj]
+
+ function decycle() {}
+ stringify(obj, null, 2, decycle).must.eql(jsonify({
+ a: "b",
+ selves: [null, null]
+ }))
+ })
+
+ it("must throw given a decycler that returns a cycle", function() {
+ var obj = {}
+ obj.self = obj
+ var err
+ function identity(key, value) { return value }
+ try { stringify(obj, null, 2, identity) } catch (ex) { err = ex }
+ err.must.be.an.instanceof(TypeError)
+ })
+
+ describe(".getSerialize", function() {
+ it("must stringify circular objects", function() {
+ var obj = {a: "b"}
+ obj.circularRef = obj
+ obj.list = [obj, obj]
+
+ var json = JSON.stringify(obj, stringify.getSerialize(), 2)
+ json.must.eql(jsonify({
+ "a": "b",
+ "circularRef": "[Circular ~]",
+ "list": ["[Circular ~]", "[Circular ~]"]
+ }))
+ })
+
+ // This is the behavior as of Mar 3, 2015.
+ // The serializer function keeps state inside the returned function and
+ // so far I'm not sure how to not do that. JSON.stringify's replacer is not
+ // called _after_ serialization.
+ xit("must return a function that could be called twice", function() {
+ var obj = {name: "Alice"}
+ obj.self = obj
+
+ var json
+ var serializer = stringify.getSerialize()
+
+ json = JSON.stringify(obj, serializer, 2)
+ json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
+
+ json = JSON.stringify(obj, serializer, 2)
+ json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
+ })
+ })
+})
+
+function bangString(key, value) {
+ return typeof value == "string" ? value + "!" : value
+}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/mime-types/HISTORY.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/mime-types/HISTORY.md b/node_modules/request/node_modules/mime-types/HISTORY.md
index e8ab1a3..3f4ebe9 100644
--- a/node_modules/request/node_modules/mime-types/HISTORY.md
+++ b/node_modules/request/node_modules/mime-types/HISTORY.md
@@ -1,3 +1,9 @@
+2.0.12 / 2015-05-19
+===================
+
+ * deps: mime-db@~1.10.0
+ - Add new mime types
+
2.0.11 / 2015-05-05
===================
[45/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/index.js
deleted file mode 100644
index 0f1aeb3..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict';
-
-module.exports = function (cb) {
- var stdin = process.stdin;
- var ret = '';
-
- if (stdin.isTTY) {
- setImmediate(cb, '');
- return;
- }
-
- stdin.setEncoding('utf8');
-
- stdin.on('readable', function () {
- var chunk;
-
- while (chunk = stdin.read()) {
- ret += chunk;
- }
- });
-
- stdin.on('end', function () {
- cb(ret);
- });
-};
-
-module.exports.buffer = function (cb) {
- var stdin = process.stdin;
- var ret = [];
- var len = 0;
-
- if (stdin.isTTY) {
- setImmediate(cb, new Buffer(''));
- return;
- }
-
- stdin.on('readable', function () {
- var chunk;
-
- while (chunk = stdin.read()) {
- ret.push(chunk);
- len += chunk.length;
- }
- });
-
- stdin.on('end', function () {
- cb(Buffer.concat(ret, len));
- });
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/package.json
deleted file mode 100644
index e0e5c64..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/package.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "name": "get-stdin",
- "version": "4.0.1",
- "description": "Easier stdin",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/get-stdin"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "node test.js && node test-buffer.js && echo unicorns | node test-real.js"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "std",
- "stdin",
- "stdio",
- "concat",
- "buffer",
- "stream",
- "process",
- "stream"
- ],
- "devDependencies": {
- "ava": "0.0.4",
- "buffer-equal": "0.0.1"
- },
- "gitHead": "65c744975229b25d6cc5c7546f49b6ad9099553f",
- "bugs": {
- "url": "https://github.com/sindresorhus/get-stdin/issues"
- },
- "homepage": "https://github.com/sindresorhus/get-stdin",
- "_id": "get-stdin@4.0.1",
- "_shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe",
- "_from": "get-stdin@>=4.0.1 <5.0.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- }
- ],
- "dist": {
- "shasum": "b968c6b0a04384324902e8bf1a5df32579a450fe",
- "tarball": "http://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/readme.md
deleted file mode 100644
index bc1d32a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/get-stdin/readme.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# get-stdin [](https://travis-ci.org/sindresorhus/get-stdin)
-
-> Easier stdin
-
-
-## Install
-
-```sh
-$ npm install --save get-stdin
-```
-
-
-## Usage
-
-```js
-// example.js
-var stdin = require('get-stdin');
-
-stdin(function (data) {
- console.log(data);
- //=> unicorns
-});
-```
-
-```sh
-$ echo unicorns | node example.js
-unicorns
-```
-
-
-## API
-
-### stdin(callback)
-
-Get `stdin` as a string.
-
-### stdin.buffer(callback)
-
-Get `stdin` as a buffer.
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
deleted file mode 100644
index 43582f8..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
+++ /dev/null
@@ -1,92 +0,0 @@
-{
- "name": "has-ansi",
- "version": "1.0.3",
- "description": "Check if a string has ANSI escape codes",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/has-ansi"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "bin": {
- "has-ansi": "cli.js"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js",
- "cli.js"
- ],
- "keywords": [
- "cli",
- "bin",
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "string",
- "tty",
- "escape",
- "shell",
- "xterm",
- "command-line",
- "text",
- "regex",
- "regexp",
- "re",
- "match",
- "test",
- "find",
- "pattern",
- "has"
- ],
- "dependencies": {
- "ansi-regex": "^1.1.0",
- "get-stdin": "^4.0.1"
- },
- "devDependencies": {
- "mocha": "*"
- },
- "gitHead": "416428ed16f8e9718aec54cea083173af6019917",
- "bugs": {
- "url": "https://github.com/sindresorhus/has-ansi/issues"
- },
- "homepage": "https://github.com/sindresorhus/has-ansi",
- "_id": "has-ansi@1.0.3",
- "_shasum": "c0b5b1615d9e382b0ff67169d967b425e48ca538",
- "_from": "has-ansi@>=1.0.3 <2.0.0",
- "_npmVersion": "2.1.16",
- "_nodeVersion": "0.10.35",
- "_npmUser": {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- },
- "dist": {
- "shasum": "c0b5b1615d9e382b0ff67169d967b425e48ca538",
- "tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md
deleted file mode 100644
index 0fa149a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# has-ansi [](https://travis-ci.org/sindresorhus/has-ansi)
-
-> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
-
-
-## Install
-
-```sh
-$ npm install --save has-ansi
-```
-
-
-## Usage
-
-```js
-var hasAnsi = require('has-ansi');
-
-hasAnsi('\u001b[4mcake\u001b[0m');
-//=> true
-
-hasAnsi('cake');
-//=> false
-```
-
-
-## CLI
-
-```sh
-$ npm install --global has-ansi
-```
-
-```
-$ has-ansi --help
-
- Usage
- has-ansi <string>
- echo <string> | has-ansi
-
- Exits with code 0 if input has ANSI escape codes and 1 if not
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/cli.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/cli.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/cli.js
deleted file mode 100755
index b83f63b..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/cli.js
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-var fs = require('fs');
-var pkg = require('./package.json');
-var stripAnsi = require('./');
-var argv = process.argv.slice(2);
-var input = argv[0];
-
-function help() {
- console.log([
- '',
- ' ' + pkg.description,
- '',
- ' Usage',
- ' strip-ansi <input-file> > <output-file>',
- ' cat <input-file> | strip-ansi > <output-file>',
- '',
- ' Example',
- ' strip-ansi unicorn.txt > unicorn-stripped.txt'
- ].join('\n'));
-}
-
-function init(data) {
- process.stdout.write(stripAnsi(data));
-}
-
-if (argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-if (!input && process.stdin.isTTY) {
- help();
- return;
-}
-
-if (input) {
- init(fs.readFileSync(input, 'utf8'));
-} else {
- process.stdin.setEncoding('utf8');
- process.stdin.on('data', init);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js
deleted file mode 100644
index 099480f..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-var ansiRegex = require('ansi-regex')();
-
-module.exports = function (str) {
- return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js
deleted file mode 100644
index 2fcdd1e..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-module.exports = function () {
- return /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g;
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <si...@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json
deleted file mode 100644
index 8d70330..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json
+++ /dev/null
@@ -1,86 +0,0 @@
-{
- "name": "ansi-regex",
- "version": "1.1.1",
- "description": "Regular expression for matching ANSI escape codes",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/ansi-regex"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha test/test.js",
- "view-supported": "node test/viewCodes.js"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "command-line",
- "text",
- "regex",
- "regexp",
- "re",
- "match",
- "test",
- "find",
- "pattern"
- ],
- "devDependencies": {
- "mocha": "*"
- },
- "gitHead": "47fb974630af70998157b30fad6eb5e5bd7c7cd6",
- "bugs": {
- "url": "https://github.com/sindresorhus/ansi-regex/issues"
- },
- "homepage": "https://github.com/sindresorhus/ansi-regex",
- "_id": "ansi-regex@1.1.1",
- "_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
- "_from": "ansi-regex@>=1.0.0 <2.0.0",
- "_npmVersion": "2.1.16",
- "_nodeVersion": "0.10.35",
- "_npmUser": {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- },
- "dist": {
- "shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
- "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md
deleted file mode 100644
index ae876e7..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# ansi-regex [](https://travis-ci.org/sindresorhus/ansi-regex)
-
-> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
-
-
-## Install
-
-```sh
-$ npm install --save ansi-regex
-```
-
-
-## Usage
-
-```js
-var ansiRegex = require('ansi-regex');
-
-ansiRegex().test('\u001b[4mcake\u001b[0m');
-//=> true
-
-ansiRegex().test('cake');
-//=> false
-
-'\u001b[4mcake\u001b[0m'.match(ansiRegex());
-//=> ['\u001b[4m', '\u001b[0m']
-```
-
-*It's a function so you can create multiple instances. Regexes with the global flag will have the `.lastIndex` property changed for each call to methods on the instance. Therefore reusing the instance with multiple calls will not work as expected for `.test()`.*
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json
deleted file mode 100644
index 44c71ff..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
- "name": "strip-ansi",
- "version": "2.0.1",
- "description": "Strip ANSI escape codes",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/strip-ansi"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "bin": {
- "strip-ansi": "cli.js"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js",
- "cli.js"
- ],
- "keywords": [
- "strip",
- "trim",
- "remove",
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "dependencies": {
- "ansi-regex": "^1.0.0"
- },
- "devDependencies": {
- "mocha": "*"
- },
- "gitHead": "1eff0936c01f89efa312d9d51deed137259871a1",
- "bugs": {
- "url": "https://github.com/sindresorhus/strip-ansi/issues"
- },
- "homepage": "https://github.com/sindresorhus/strip-ansi",
- "_id": "strip-ansi@2.0.1",
- "_shasum": "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e",
- "_from": "strip-ansi@>=2.0.1 <3.0.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "dist": {
- "shasum": "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e",
- "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md
deleted file mode 100644
index 53ec264..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# strip-ansi [](https://travis-ci.org/sindresorhus/strip-ansi)
-
-> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
-
-
-## Install
-
-```sh
-$ npm install --save strip-ansi
-```
-
-
-## Usage
-
-```js
-var stripAnsi = require('strip-ansi');
-
-stripAnsi('\u001b[4mcake\u001b[0m');
-//=> 'cake'
-```
-
-
-## CLI
-
-```sh
-$ npm install --global strip-ansi
-```
-
-```sh
-$ strip-ansi --help
-
- Usage
- strip-ansi <input-file> > <output-file>
- cat <input-file> | strip-ansi > <output-file>
-
- Example
- strip-ansi unicorn.txt > unicorn-stripped.txt
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/cli.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/cli.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/cli.js
deleted file mode 100755
index e746987..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/cli.js
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-var pkg = require('./package.json');
-var supportsColor = require('./');
-var argv = process.argv.slice(2);
-
-function help() {
- console.log([
- '',
- ' ' + pkg.description,
- '',
- ' Usage',
- ' supports-color',
- '',
- ' Exits with code 0 if color is supported and 1 if not'
- ].join('\n'));
-}
-
-if (argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-process.exit(supportsColor ? 0 : 1);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js
deleted file mode 100644
index a171964..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-'use strict';
-var argv = process.argv;
-
-module.exports = (function () {
- if ('FORCE_COLOR' in process.env) {
- return true;
- }
-
- if (argv.indexOf('--no-color') !== -1 ||
- argv.indexOf('--no-colors') !== -1 ||
- argv.indexOf('--color=false') !== -1) {
- return false;
- }
-
- if (argv.indexOf('--color') !== -1 ||
- argv.indexOf('--colors') !== -1 ||
- argv.indexOf('--color=true') !== -1 ||
- argv.indexOf('--color=always') !== -1) {
- return true;
- }
-
- if (process.stdout && !process.stdout.isTTY) {
- return false;
- }
-
- if (process.platform === 'win32') {
- return true;
- }
-
- if ('COLORTERM' in process.env) {
- return true;
- }
-
- if (process.env.TERM === 'dumb') {
- return false;
- }
-
- if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
- return true;
- }
-
- return false;
-})();
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <si...@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
deleted file mode 100644
index 0a52c0d..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "name": "supports-color",
- "version": "1.3.1",
- "description": "Detect whether a terminal supports color",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/supports-color"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "bin": {
- "supports-color": "cli.js"
- },
- "engines": {
- "node": ">=0.8.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js",
- "cli.js"
- ],
- "keywords": [
- "cli",
- "bin",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "ansi",
- "styles",
- "tty",
- "rgb",
- "256",
- "shell",
- "xterm",
- "command-line",
- "support",
- "supports",
- "capability",
- "detect"
- ],
- "devDependencies": {
- "mocha": "*",
- "require-uncached": "^1.0.2"
- },
- "gitHead": "09f1b4c336cee7269b4c8b3a8880054a23fcb35e",
- "bugs": {
- "url": "https://github.com/sindresorhus/supports-color/issues"
- },
- "homepage": "https://github.com/sindresorhus/supports-color",
- "_id": "supports-color@1.3.1",
- "_shasum": "15758df09d8ff3b4acc307539fabe27095e1042d",
- "_from": "supports-color@>=1.3.0 <2.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
- "_npmUser": {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- "dist": {
- "shasum": "15758df09d8ff3b4acc307539fabe27095e1042d",
- "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md
deleted file mode 100644
index fe6016f..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# supports-color [](https://travis-ci.org/sindresorhus/supports-color)
-
-> Detect whether a terminal supports color
-
-
-## Install
-
-```
-$ npm install --save supports-color
-```
-
-
-## Usage
-
-```js
-var supportsColor = require('supports-color');
-
-if (supportsColor) {
- console.log('Terminal supports color');
-}
-```
-
-It obeys the `--color` and `--no-color` CLI flags.
-
-For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
-
-
-## CLI
-
-```
-$ npm install --global supports-color
-```
-
-```
-$ supports-color --help
-
- Usage
- supports-color
-
- Exits with code 0 if color is supported and 1 if not
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
deleted file mode 100644
index 93055c0..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "name": "chalk",
- "version": "1.0.0",
- "description": "Terminal string styling done right. Much color.",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/chalk"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha",
- "bench": "matcha benchmark.js"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "ansi",
- "styles",
- "tty",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "dependencies": {
- "ansi-styles": "^2.0.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^1.0.3",
- "strip-ansi": "^2.0.1",
- "supports-color": "^1.3.0"
- },
- "devDependencies": {
- "matcha": "^0.6.0",
- "mocha": "*"
- },
- "gitHead": "8864d3563313ed15574a38dd5c9d5966080c46ce",
- "bugs": {
- "url": "https://github.com/sindresorhus/chalk/issues"
- },
- "homepage": "https://github.com/sindresorhus/chalk",
- "_id": "chalk@1.0.0",
- "_shasum": "b3cf4ed0ff5397c99c75b8f679db2f52831f96dc",
- "_from": "chalk@>=1.0.0 <2.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
- "_npmUser": {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- "dist": {
- "shasum": "b3cf4ed0ff5397c99c75b8f679db2f52831f96dc",
- "tarball": "http://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md
deleted file mode 100644
index 43c7064..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md
+++ /dev/null
@@ -1,197 +0,0 @@
-<h1 align="center">
- <br>
- <img width="360" src="https://cdn.rawgit.com/sindresorhus/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
- <br>
- <br>
-</h1>
-
-> Terminal string styling done right
-
-[](https://travis-ci.org/sindresorhus/chalk) [](https://www.youtube.com/watch?v=Sm368W0OsHo)
-
-[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.
-
-**Chalk is a clean and focused alternative.**
-
-
-
-
-## Why
-
-- Highly performant
-- Doesn't extend `String.prototype`
-- Expressive API
-- Ability to nest styles
-- Clean and focused
-- Auto-detects color support
-- Actively maintained
-- [Used by ~3000 modules](https://www.npmjs.com/browse/depended/chalk)
-
-
-## Install
-
-```
-$ npm install --save chalk
-```
-
-
-## Usage
-
-Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
-
-```js
-var chalk = require('chalk');
-
-// style a string
-chalk.blue('Hello world!');
-
-// combine styled and normal strings
-chalk.blue('Hello') + 'World' + chalk.red('!');
-
-// compose multiple styles using the chainable API
-chalk.blue.bgRed.bold('Hello world!');
-
-// pass in multiple arguments
-chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');
-
-// nest styles
-chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
-
-// nest styles of the same type even (color, underline, background)
-chalk.green(
- 'I am a green line ' +
- chalk.blue.underline.bold('with a blue substring') +
- ' that becomes green again!'
-);
-```
-
-Easily define your own themes.
-
-```js
-var chalk = require('chalk');
-var error = chalk.bold.red;
-console.log(error('Error!'));
-```
-
-Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).
-
-```js
-var name = 'Sindre';
-console.log(chalk.green('Hello %s'), name);
-//=> Hello Sindre
-```
-
-
-## API
-
-### chalk.`<style>[.<style>...](string, [string...])`
-
-Example: `chalk.red.bold.underline('Hello', 'world');`
-
-Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.
-
-Multiple arguments will be separated by space.
-
-### chalk.enabled
-
-Color support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.
-
-If you need to change this in a reusable module create a new instance:
-
-```js
-var ctx = new chalk.constructor({enabled: false});
-```
-
-### chalk.supportsColor
-
-Detect whether the terminal [supports color](https://github.com/sindresorhus/supports-color). Used internally and handled for you, but exposed for convenience.
-
-Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
-
-### chalk.styles
-
-Exposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles).
-
-Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.
-
-```js
-var chalk = require('chalk');
-
-console.log(chalk.styles.red);
-//=> {open: '\u001b[31m', close: '\u001b[39m'}
-
-console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);
-```
-
-### chalk.hasColor(string)
-
-Check whether a string [has color](https://github.com/sindresorhus/has-ansi).
-
-### chalk.stripColor(string)
-
-[Strip color](https://github.com/sindresorhus/strip-ansi) from a string.
-
-Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.
-
-Example:
-
-```js
-var chalk = require('chalk');
-var styledString = getText();
-
-if (!chalk.supportsColor) {
- styledString = chalk.stripColor(styledString);
-}
-```
-
-
-## Styles
-
-### Modifiers
-
-- `reset`
-- `bold`
-- `dim`
-- `italic` *(not widely supported)*
-- `underline`
-- `inverse`
-- `hidden`
-- `strikethrough` *(not widely supported)*
-
-### Colors
-
-- `black`
-- `red`
-- `green`
-- `yellow`
-- `blue` *(on Windows the bright version is used as normal blue is illegible)*
-- `magenta`
-- `cyan`
-- `white`
-- `gray`
-
-### Background colors
-
-- `bgBlack`
-- `bgRed`
-- `bgGreen`
-- `bgYellow`
-- `bgBlue`
-- `bgMagenta`
-- `bgCyan`
-- `bgWhite`
-
-
-## 256-colors
-
-Chalk does not support support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.
-
-
-## Windows
-
-If you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/History.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/History.md b/node_modules/request/node_modules/har-validator/node_modules/commander/History.md
deleted file mode 100644
index 7b8b2c4..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/History.md
+++ /dev/null
@@ -1,256 +0,0 @@
-
-2.8.1 / 2015-04-22
-==================
-
- * Back out `support multiline description` Close #396 #397
-
-
-
-2.8.0 / 2015-04-07
-==================
-
- * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee
- * Fix bug in Git-style sub-commands #372 @zhiyelee
- * Allow commands to be hidden from help #383 @tonylukasavage
- * When git-style sub-commands are in use, yet none are called, display help #382 @claylo
- * Add ability to specify arguments syntax for top-level command #258 @rrthomas
- * Support multiline descriptions #208 @zxqfox
-
-2.7.1 / 2015-03-11
-==================
-
- * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
-
-2.7.0 / 2015-03-09
-==================
-
- * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
- * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage
- * Add support for camelCase on `opts()`. Close #353 @nkzawa
- * Add node.js 0.12 and io.js to travis.yml
- * Allow RegEx options. #337 @palanik
- * Fixes exit code when sub-command failing. Close #260 #332 @pirelenito
- * git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee
-
-2.6.0 / 2014-12-30
-==================
-
- * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee
- * Add application description to the help msg. Close #112 @dalssoft
-
-2.5.1 / 2014-12-15
-==================
-
- * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee
-
-2.5.0 / 2014-10-24
-==================
-
- * add support for variadic arguments. Closes #277 @whitlockjc
-
-2.4.0 / 2014-10-17
-==================
-
- * fixed a bug on executing the coercion function of subcommands option. Closes #270
- * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage
- * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage
- * fixed a bug on subcommand name. Closes #248 @jonathandelgado
- * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr
-
-2.3.0 / 2014-07-16
-==================
-
- * add command alias'. Closes PR #210
- * fix: Typos. Closes #99
- * fix: Unused fs module. Closes #217
-
-2.2.0 / 2014-03-29
-==================
-
- * add passing of previous option value
- * fix: support subcommands on windows. Closes #142
- * Now the defaultValue passed as the second argument of the coercion function.
-
-2.1.0 / 2013-11-21
-==================
-
- * add: allow cflag style option params, unit test, fixes #174
-
-2.0.0 / 2013-07-18
-==================
-
- * remove input methods (.prompt, .confirm, etc)
-
-1.3.2 / 2013-07-18
-==================
-
- * add support for sub-commands to co-exist with the original command
-
-1.3.1 / 2013-07-18
-==================
-
- * add quick .runningCommand hack so you can opt-out of other logic when running a sub command
-
-1.3.0 / 2013-07-09
-==================
-
- * add EACCES error handling
- * fix sub-command --help
-
-1.2.0 / 2013-06-13
-==================
-
- * allow "-" hyphen as an option argument
- * support for RegExp coercion
-
-1.1.1 / 2012-11-20
-==================
-
- * add more sub-command padding
- * fix .usage() when args are present. Closes #106
-
-1.1.0 / 2012-11-16
-==================
-
- * add git-style executable subcommand support. Closes #94
-
-1.0.5 / 2012-10-09
-==================
-
- * fix `--name` clobbering. Closes #92
- * fix examples/help. Closes #89
-
-1.0.4 / 2012-09-03
-==================
-
- * add `outputHelp()` method.
-
-1.0.3 / 2012-08-30
-==================
-
- * remove invalid .version() defaulting
-
-1.0.2 / 2012-08-24
-==================
-
- * add `--foo=bar` support [arv]
- * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
-
-1.0.1 / 2012-08-03
-==================
-
- * fix issue #56
- * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
-
-1.0.0 / 2012-07-05
-==================
-
- * add support for optional option descriptions
- * add defaulting of `.version()` to package.json's version
-
-0.6.1 / 2012-06-01
-==================
-
- * Added: append (yes or no) on confirmation
- * Added: allow node.js v0.7.x
-
-0.6.0 / 2012-04-10
-==================
-
- * Added `.prompt(obj, callback)` support. Closes #49
- * Added default support to .choose(). Closes #41
- * Fixed the choice example
-
-0.5.1 / 2011-12-20
-==================
-
- * Fixed `password()` for recent nodes. Closes #36
-
-0.5.0 / 2011-12-04
-==================
-
- * Added sub-command option support [itay]
-
-0.4.3 / 2011-12-04
-==================
-
- * Fixed custom help ordering. Closes #32
-
-0.4.2 / 2011-11-24
-==================
-
- * Added travis support
- * Fixed: line-buffered input automatically trimmed. Closes #31
-
-0.4.1 / 2011-11-18
-==================
-
- * Removed listening for "close" on --help
-
-0.4.0 / 2011-11-15
-==================
-
- * Added support for `--`. Closes #24
-
-0.3.3 / 2011-11-14
-==================
-
- * Fixed: wait for close event when writing help info [Jerry Hamlet]
-
-0.3.2 / 2011-11-01
-==================
-
- * Fixed long flag definitions with values [felixge]
-
-0.3.1 / 2011-10-31
-==================
-
- * Changed `--version` short flag to `-V` from `-v`
- * Changed `.version()` so it's configurable [felixge]
-
-0.3.0 / 2011-10-31
-==================
-
- * Added support for long flags only. Closes #18
-
-0.2.1 / 2011-10-24
-==================
-
- * "node": ">= 0.4.x < 0.7.0". Closes #20
-
-0.2.0 / 2011-09-26
-==================
-
- * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
-
-0.1.0 / 2011-08-24
-==================
-
- * Added support for custom `--help` output
-
-0.0.5 / 2011-08-18
-==================
-
- * Changed: when the user enters nothing prompt for password again
- * Fixed issue with passwords beginning with numbers [NuckChorris]
-
-0.0.4 / 2011-08-15
-==================
-
- * Fixed `Commander#args`
-
-0.0.3 / 2011-08-15
-==================
-
- * Added default option value support
-
-0.0.2 / 2011-08-15
-==================
-
- * Added mask support to `Command#password(str[, mask], fn)`
- * Added `Command#password(str, fn)`
-
-0.0.1 / 2010-01-03
-==================
-
- * Initial release
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE
deleted file mode 100644
index 10f997a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2011 TJ Holowaychuk <tj...@vision-media.ca>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md b/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md
deleted file mode 100644
index af58e22..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md
+++ /dev/null
@@ -1,342 +0,0 @@
-# Commander.js
-
-
-[](http://travis-ci.org/tj/commander.js)
-[](https://www.npmjs.org/package/commander)
-[](https://www.npmjs.org/package/commander)
-[](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
- The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).
- [API documentation](http://tj.github.com/commander.js/)
-
-
-## Installation
-
- $ npm install commander
-
-## Option parsing
-
- Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
-
-```js
-#!/usr/bin/env node
-
-/**
- * Module dependencies.
- */
-
-var program = require('commander');
-
-program
- .version('0.0.1')
- .option('-p, --peppers', 'Add peppers')
- .option('-P, --pineapple', 'Add pineapple')
- .option('-b, --bbq-sauce', 'Add bbq sauce')
- .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
- .parse(process.argv);
-
-console.log('you ordered a pizza with:');
-if (program.peppers) console.log(' - peppers');
-if (program.pineapple) console.log(' - pineapple');
-if (program.bbqSauce) console.log(' - bbq');
-console.log(' - %s cheese', program.cheese);
-```
-
- Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
-
-
-## Coercion
-
-```js
-function range(val) {
- return val.split('..').map(Number);
-}
-
-function list(val) {
- return val.split(',');
-}
-
-function collect(val, memo) {
- memo.push(val);
- return memo;
-}
-
-function increaseVerbosity(v, total) {
- return total + 1;
-}
-
-program
- .version('0.0.1')
- .usage('[options] <file ...>')
- .option('-i, --integer <n>', 'An integer argument', parseInt)
- .option('-f, --float <n>', 'A float argument', parseFloat)
- .option('-r, --range <a>..<b>', 'A range', range)
- .option('-l, --list <items>', 'A list', list)
- .option('-o, --optional [value]', 'An optional value')
- .option('-c, --collect [value]', 'A repeatable value', collect, [])
- .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)
- .parse(process.argv);
-
-console.log(' int: %j', program.integer);
-console.log(' float: %j', program.float);
-console.log(' optional: %j', program.optional);
-program.range = program.range || [];
-console.log(' range: %j..%j', program.range[0], program.range[1]);
-console.log(' list: %j', program.list);
-console.log(' collect: %j', program.collect);
-console.log(' verbosity: %j', program.verbose);
-console.log(' args: %j', program.args);
-```
-
-## Regular Expression
-```js
-program
- .version('0.0.1')
- .option('-s --size <size>', 'Pizza size', /^(large|medium|small)$/i, 'medium')
- .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
- .parse(process.argv);
-
-console.log(' size: %j', program.size);
-console.log(' drink: %j', program.drink);
-```
-
-## Variadic arguments
-
- The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to
- append `...` to the argument name. Here is an example:
-
-```js
-#!/usr/bin/env node
-
-/**
- * Module dependencies.
- */
-
-var program = require('commander');
-
-program
- .version('0.0.1')
- .command('rmdir <dir> [otherDirs...]')
- .action(function (dir, otherDirs) {
- console.log('rmdir %s', dir);
- if (otherDirs) {
- otherDirs.forEach(function (oDir) {
- console.log('rmdir %s', oDir);
- });
- }
- });
-
-program.parse(process.argv);
-```
-
- An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed
- to your action as demonstrated above.
-
-## Specify the argument syntax
-
-```js
-#!/usr/bin/env node
-
-var program = require('../');
-
-program
- .version('0.0.1')
- .arguments('<cmd> [env]')
- .action(function (cmd, env) {
- cmdValue = cmd;
- envValue = env;
- });
-
-program.parse(process.argv);
-
-if (typeof cmdValue === 'undefined') {
- console.error('no command given!');
- process.exit(1);
-}
-console.log('command:', cmdValue);
-console.log('environment:', envValue || "no environment given");
-```
-
-## Git-style sub-commands
-
-```js
-// file: ./examples/pm
-var program = require('..');
-
-program
- .version('0.0.1')
- .command('install [name]', 'install one or more packages')
- .command('search [query]', 'search with optional query')
- .command('list', 'list packages installed')
- .parse(process.argv);
-```
-
-When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
-The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.
-
-If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
-
-### `--harmony`
-
-You can enable `--harmony` option in two ways:
-* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern.
-* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.
-
-## Automated --help
-
- The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
-
-```
- $ ./examples/pizza --help
-
- Usage: pizza [options]
-
- An application for pizzas ordering
-
- Options:
-
- -h, --help output usage information
- -V, --version output the version number
- -p, --peppers Add peppers
- -P, --pineapple Add pineapple
- -b, --bbq Add bbq sauce
- -c, --cheese <type> Add the specified type of cheese [marble]
- -C, --no-cheese You do not want any cheese
-
-```
-
-## Custom help
-
- You can display arbitrary `-h, --help` information
- by listening for "--help". Commander will automatically
- exit once you are done so that the remainder of your program
- does not execute causing undesired behaviours, for example
- in the following executable "stuff" will not output when
- `--help` is used.
-
-```js
-#!/usr/bin/env node
-
-/**
- * Module dependencies.
- */
-
-var program = require('commander');
-
-program
- .version('0.0.1')
- .option('-f, --foo', 'enable some foo')
- .option('-b, --bar', 'enable some bar')
- .option('-B, --baz', 'enable some baz');
-
-// must be before .parse() since
-// node's emit() is immediate
-
-program.on('--help', function(){
- console.log(' Examples:');
- console.log('');
- console.log(' $ custom-help --help');
- console.log(' $ custom-help -h');
- console.log('');
-});
-
-program.parse(process.argv);
-
-console.log('stuff');
-```
-
-Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
-
-```
-
-Usage: custom-help [options]
-
-Options:
-
- -h, --help output usage information
- -V, --version output the version number
- -f, --foo enable some foo
- -b, --bar enable some bar
- -B, --baz enable some baz
-
-Examples:
-
- $ custom-help --help
- $ custom-help -h
-
-```
-
-## .outputHelp()
-
-Output help information without exiting.
-
-If you want to display help by default (e.g. if no command was provided), you can use something like:
-
-```js
-var program = require('commander');
-
-program
- .version('0.0.1')
- .command('getstream [url]', 'get stream URL')
- .parse(process.argv);
-
- if (!process.argv.slice(2).length) {
- program.outputHelp();
- }
-```
-
-## .help()
-
- Output help information and exit immediately.
-
-## Examples
-
-```js
-var program = require('commander');
-
-program
- .version('0.0.1')
- .option('-C, --chdir <path>', 'change the working directory')
- .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
- .option('-T, --no-tests', 'ignore test hook')
-
-program
- .command('setup [env]')
- .description('run setup commands for all envs')
- .option("-s, --setup_mode [mode]", "Which setup mode to use")
- .action(function(env, options){
- var mode = options.setup_mode || "normal";
- env = env || 'all';
- console.log('setup for %s env(s) with %s mode', env, mode);
- });
-
-program
- .command('exec <cmd>')
- .alias('ex')
- .description('execute the given remote cmd')
- .option("-e, --exec_mode <mode>", "Which exec mode to use")
- .action(function(cmd, options){
- console.log('exec "%s" using %s mode', cmd, options.exec_mode);
- }).on('--help', function() {
- console.log(' Examples:');
- console.log();
- console.log(' $ deploy exec sequential');
- console.log(' $ deploy exec async');
- console.log();
- });
-
-program
- .command('*')
- .action(function(env){
- console.log('deploying "%s"', env);
- });
-
-program.parse(process.argv);
-```
-
-More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
-
-## License
-
-MIT
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/index.js b/node_modules/request/node_modules/har-validator/node_modules/commander/index.js
deleted file mode 100644
index 8776965..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/index.js
+++ /dev/null
@@ -1,1103 +0,0 @@
-
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('events').EventEmitter;
-var spawn = require('child_process').spawn;
-var readlink = require('graceful-readlink').readlinkSync;
-var path = require('path');
-var dirname = path.dirname;
-var basename = path.basename;
-var fs = require('fs');
-
-/**
- * Expose the root command.
- */
-
-exports = module.exports = new Command();
-
-/**
- * Expose `Command`.
- */
-
-exports.Command = Command;
-
-/**
- * Expose `Option`.
- */
-
-exports.Option = Option;
-
-/**
- * Initialize a new `Option` with the given `flags` and `description`.
- *
- * @param {String} flags
- * @param {String} description
- * @api public
- */
-
-function Option(flags, description) {
- this.flags = flags;
- this.required = ~flags.indexOf('<');
- this.optional = ~flags.indexOf('[');
- this.bool = !~flags.indexOf('-no-');
- flags = flags.split(/[ ,|]+/);
- if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
- this.long = flags.shift();
- this.description = description || '';
-}
-
-/**
- * Return option name.
- *
- * @return {String}
- * @api private
- */
-
-Option.prototype.name = function() {
- return this.long
- .replace('--', '')
- .replace('no-', '');
-};
-
-/**
- * Check if `arg` matches the short or long flag.
- *
- * @param {String} arg
- * @return {Boolean}
- * @api private
- */
-
-Option.prototype.is = function(arg) {
- return arg == this.short || arg == this.long;
-};
-
-/**
- * Initialize a new `Command`.
- *
- * @param {String} name
- * @api public
- */
-
-function Command(name) {
- this.commands = [];
- this.options = [];
- this._execs = [];
- this._allowUnknownOption = false;
- this._args = [];
- this._name = name;
-}
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-
-Command.prototype.__proto__ = EventEmitter.prototype;
-
-/**
- * Add command `name`.
- *
- * The `.action()` callback is invoked when the
- * command `name` is specified via __ARGV__,
- * and the remaining arguments are applied to the
- * function for access.
- *
- * When the `name` is "*" an un-matched command
- * will be passed as the first arg, followed by
- * the rest of __ARGV__ remaining.
- *
- * Examples:
- *
- * program
- * .version('0.0.1')
- * .option('-C, --chdir <path>', 'change the working directory')
- * .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
- * .option('-T, --no-tests', 'ignore test hook')
- *
- * program
- * .command('setup')
- * .description('run remote setup commands')
- * .action(function() {
- * console.log('setup');
- * });
- *
- * program
- * .command('exec <cmd>')
- * .description('run the given remote command')
- * .action(function(cmd) {
- * console.log('exec "%s"', cmd);
- * });
- *
- * program
- * .command('teardown <dir> [otherDirs...]')
- * .description('run teardown commands')
- * .action(function(dir, otherDirs) {
- * console.log('dir "%s"', dir);
- * if (otherDirs) {
- * otherDirs.forEach(function (oDir) {
- * console.log('dir "%s"', oDir);
- * });
- * }
- * });
- *
- * program
- * .command('*')
- * .description('deploy the given env')
- * .action(function(env) {
- * console.log('deploying "%s"', env);
- * });
- *
- * program.parse(process.argv);
- *
- * @param {String} name
- * @param {String} [desc] for git-style sub-commands
- * @return {Command} the new command
- * @api public
- */
-
-Command.prototype.command = function(name, desc, opts) {
- opts = opts || {};
- var args = name.split(/ +/);
- var cmd = new Command(args.shift());
-
- if (desc) {
- cmd.description(desc);
- this.executables = true;
- this._execs[cmd._name] = true;
- }
-
- cmd._noHelp = !!opts.noHelp;
- this.commands.push(cmd);
- cmd.parseExpectedArgs(args);
- cmd.parent = this;
-
- if (desc) return this;
- return cmd;
-};
-
-/**
- * Define argument syntax for the top-level command.
- *
- * @api public
- */
-
-Command.prototype.arguments = function (desc) {
- return this.parseExpectedArgs(desc.split(/ +/));
-}
-
-/**
- * Add an implicit `help [cmd]` subcommand
- * which invokes `--help` for the given command.
- *
- * @api private
- */
-
-Command.prototype.addImplicitHelpCommand = function() {
- this.command('help [cmd]', 'display help for [cmd]');
-};
-
-/**
- * Parse expected `args`.
- *
- * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
- *
- * @param {Array} args
- * @return {Command} for chaining
- * @api public
- */
-
-Command.prototype.parseExpectedArgs = function(args) {
- if (!args.length) return;
- var self = this;
- args.forEach(function(arg) {
- var argDetails = {
- required: false,
- name: '',
- variadic: false
- };
-
- switch (arg[0]) {
- case '<':
- argDetails.required = true;
- argDetails.name = arg.slice(1, -1);
- break;
- case '[':
- argDetails.name = arg.slice(1, -1);
- break;
- }
-
- if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
- argDetails.variadic = true;
- argDetails.name = argDetails.name.slice(0, -3);
- }
- if (argDetails.name) {
- self._args.push(argDetails);
- }
- });
- return this;
-};
-
-/**
- * Register callback `fn` for the command.
- *
- * Examples:
- *
- * program
- * .command('help')
- * .description('display verbose help')
- * .action(function() {
- * // output help here
- * });
- *
- * @param {Function} fn
- * @return {Command} for chaining
- * @api public
- */
-
-Command.prototype.action = function(fn) {
- var self = this;
- var listener = function(args, unknown) {
- // Parse any so-far unknown options
- args = args || [];
- unknown = unknown || [];
-
- var parsed = self.parseOptions(unknown);
-
- // Output help if necessary
- outputHelpIfNecessary(self, parsed.unknown);
-
- // If there are still any unknown options, then we simply
- // die, unless someone asked for help, in which case we give it
- // to them, and then we die.
- if (parsed.unknown.length > 0) {
- self.unknownOption(parsed.unknown[0]);
- }
-
- // Leftover arguments need to be pushed back. Fixes issue #56
- if (parsed.args.length) args = parsed.args.concat(args);
-
- self._args.forEach(function(arg, i) {
- if (arg.required && null == args[i]) {
- self.missingArgument(arg.name);
- } else if (arg.variadic) {
- if (i !== self._args.length - 1) {
- self.variadicArgNotLast(arg.name);
- }
-
- args[i] = args.splice(i);
- }
- });
-
- // Always append ourselves to the end of the arguments,
- // to make sure we match the number of arguments the user
- // expects
- if (self._args.length) {
- args[self._args.length] = self;
- } else {
- args.push(self);
- }
-
- fn.apply(self, args);
- };
- var parent = this.parent || this;
- var name = parent === this ? '*' : this._name;
- parent.on(name, listener);
- if (this._alias) parent.on(this._alias, listener);
- return this;
-};
-
-/**
- * Define option with `flags`, `description` and optional
- * coercion `fn`.
- *
- * The `flags` string should contain both the short and long flags,
- * separated by comma, a pipe or space. The following are all valid
- * all will output this way when `--help` is used.
- *
- * "-p, --pepper"
- * "-p|--pepper"
- * "-p --pepper"
- *
- * Examples:
- *
- * // simple boolean defaulting to false
- * program.option('-p, --pepper', 'add pepper');
- *
- * --pepper
- * program.pepper
- * // => Boolean
- *
- * // simple boolean defaulting to true
- * program.option('-C, --no-cheese', 'remove cheese');
- *
- * program.cheese
- * // => true
- *
- * --no-cheese
- * program.cheese
- * // => false
- *
- * // required argument
- * program.option('-C, --chdir <path>', 'change the working directory');
- *
- * --chdir /tmp
- * program.chdir
- * // => "/tmp"
- *
- * // optional argument
- * program.option('-c, --cheese [type]', 'add cheese [marble]');
- *
- * @param {String} flags
- * @param {String} description
- * @param {Function|Mixed} fn or default
- * @param {Mixed} defaultValue
- * @return {Command} for chaining
- * @api public
- */
-
-Command.prototype.option = function(flags, description, fn, defaultValue) {
- var self = this
- , option = new Option(flags, description)
- , oname = option.name()
- , name = camelcase(oname);
-
- // default as 3rd arg
- if (typeof fn != 'function') {
- if (fn instanceof RegExp) {
- var regex = fn;
- fn = function(val, def) {
- var m = regex.exec(val);
- return m ? m[0] : def;
- }
- }
- else {
- defaultValue = fn;
- fn = null;
- }
- }
-
- // preassign default value only for --no-*, [optional], or <required>
- if (false == option.bool || option.optional || option.required) {
- // when --no-* we make sure default is true
- if (false == option.bool) defaultValue = true;
- // preassign only if we have a default
- if (undefined !== defaultValue) self[name] = defaultValue;
- }
-
- // register the option
- this.options.push(option);
-
- // when it's passed assign the value
- // and conditionally invoke the callback
- this.on(oname, function(val) {
- // coercion
- if (null !== val && fn) val = fn(val, undefined === self[name]
- ? defaultValue
- : self[name]);
-
- // unassigned or bool
- if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
- // if no value, bool true, and we have a default, then use it!
- if (null == val) {
- self[name] = option.bool
- ? defaultValue || true
- : false;
- } else {
- self[name] = val;
- }
- } else if (null !== val) {
- // reassign
- self[name] = val;
- }
- });
-
- return this;
-};
-
-/**
- * Allow unknown options on the command line.
- *
- * @param {Boolean} arg if `true` or omitted, no error will be thrown
- * for unknown options.
- * @api public
- */
-Command.prototype.allowUnknownOption = function(arg) {
- this._allowUnknownOption = arguments.length === 0 || arg;
- return this;
-};
-
-/**
- * Parse `argv`, settings options and invoking commands when defined.
- *
- * @param {Array} argv
- * @return {Command} for chaining
- * @api public
- */
-
-Command.prototype.parse = function(argv) {
- // implicit help
- if (this.executables) this.addImplicitHelpCommand();
-
- // store raw args
- this.rawArgs = argv;
-
- // guess name
- this._name = this._name || basename(argv[1], '.js');
-
- // github-style sub-commands with no sub-command
- if (this.executables && argv.length < 3) {
- // this user needs help
- argv.push('--help');
- }
-
- // process argv
- var parsed = this.parseOptions(this.normalize(argv.slice(2)));
- var args = this.args = parsed.args;
-
- var result = this.parseArgs(this.args, parsed.unknown);
-
- // executable sub-commands
- var name = result.args[0];
- if (this._execs[name] && typeof this._execs[name] != "function") {
- return this.executeSubCommand(argv, args, parsed.unknown);
- }
-
- return result;
-};
-
-/**
- * Execute a sub-command executable.
- *
- * @param {Array} argv
- * @param {Array} args
- * @param {Array} unknown
- * @api private
- */
-
-Command.prototype.executeSubCommand = function(argv, args, unknown) {
- args = args.concat(unknown);
-
- if (!args.length) this.help();
- if ('help' == args[0] && 1 == args.length) this.help();
-
- // <cmd> --help
- if ('help' == args[0]) {
- args[0] = args[1];
- args[1] = '--help';
- }
-
- // executable
- var f = argv[1];
- // name of the subcommand, link `pm-install`
- var bin = basename(f, '.js') + '-' + args[0];
-
-
- // In case of globally installed, get the base dir where executable
- // subcommand file should be located at
- var baseDir
- , link = readlink(f);
-
- // when symbolink is relative path
- if (link !== f && link.charAt(0) !== '/') {
- link = path.join(dirname(f), link)
- }
- baseDir = dirname(link);
-
- // prefer local `./<bin>` to bin in the $PATH
- var localBin = path.join(baseDir, bin);
-
- // whether bin file is a js script with explicit `.js` extension
- var isExplicitJS = false;
- if (exists(localBin + '.js')) {
- bin = localBin + '.js';
- isExplicitJS = true;
- } else if (exists(localBin)) {
- bin = localBin;
- }
-
- args = args.slice(1);
-
- var proc;
- if (process.platform !== 'win32') {
- if (isExplicitJS) {
- args.unshift(localBin);
- // add executable arguments to spawn
- args = (process.execArgv || []).concat(args);
-
- proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] });
- } else {
- proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
- }
- } else {
- args.unshift(localBin);
- proc = spawn(process.execPath, args, { stdio: 'inherit'});
- }
-
- proc.on('close', process.exit.bind(process));
- proc.on('error', function(err) {
- if (err.code == "ENOENT") {
- console.error('\n %s(1) does not exist, try --help\n', bin);
- } else if (err.code == "EACCES") {
- console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
- }
- process.exit(1);
- });
-
- this.runningCommand = proc;
-};
-
-/**
- * Normalize `args`, splitting joined short flags. For example
- * the arg "-abc" is equivalent to "-a -b -c".
- * This also normalizes equal sign and splits "--abc=def" into "--abc def".
- *
- * @param {Array} args
- * @return {Array}
- * @api private
- */
-
-Command.prototype.normalize = function(args) {
- var ret = []
- , arg
- , lastOpt
- , index;
-
- for (var i = 0, len = args.length; i < len; ++i) {
- arg = args[i];
- if (i > 0) {
- lastOpt = this.optionFor(args[i-1]);
- }
-
- if (arg === '--') {
- // Honor option terminator
- ret = ret.concat(args.slice(i));
- break;
- } else if (lastOpt && lastOpt.required) {
- ret.push(arg);
- } else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
- arg.slice(1).split('').forEach(function(c) {
- ret.push('-' + c);
- });
- } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
- ret.push(arg.slice(0, index), arg.slice(index + 1));
- } else {
- ret.push(arg);
- }
- }
-
- return ret;
-};
-
-/**
- * Parse command `args`.
- *
- * When listener(s) are available those
- * callbacks are invoked, otherwise the "*"
- * event is emitted and those actions are invoked.
- *
- * @param {Array} args
- * @return {Command} for chaining
- * @api private
- */
-
-Command.prototype.parseArgs = function(args, unknown) {
- var name;
-
- if (args.length) {
- name = args[0];
- if (this.listeners(name).length) {
- this.emit(args.shift(), args, unknown);
- } else {
- this.emit('*', args);
- }
- } else {
- outputHelpIfNecessary(this, unknown);
-
- // If there were no args and we have unknown options,
- // then they are extraneous and we need to error.
- if (unknown.length > 0) {
- this.unknownOption(unknown[0]);
- }
- }
-
- return this;
-};
-
-/**
- * Return an option matching `arg` if any.
- *
- * @param {String} arg
- * @return {Option}
- * @api private
- */
-
-Command.prototype.optionFor = function(arg) {
- for (var i = 0, len = this.options.length; i < len; ++i) {
- if (this.options[i].is(arg)) {
- return this.options[i];
- }
- }
-};
-
-/**
- * Parse options from `argv` returning `argv`
- * void of these options.
- *
- * @param {Array} argv
- * @return {Array}
- * @api public
- */
-
-Command.prototype.parseOptions = function(argv) {
- var args = []
- , len = argv.length
- , literal
- , option
- , arg;
-
- var unknownOptions = [];
-
- // parse options
- for (var i = 0; i < len; ++i) {
- arg = argv[i];
-
- // literal args after --
- if ('--' == arg) {
- literal = true;
- continue;
- }
-
- if (literal) {
- args.push(arg);
- continue;
- }
-
- // find matching Option
- option = this.optionFor(arg);
-
- // option is defined
- if (option) {
- // requires arg
- if (option.required) {
- arg = argv[++i];
- if (null == arg) return this.optionMissingArgument(option);
- this.emit(option.name(), arg);
- // optional arg
- } else if (option.optional) {
- arg = argv[i+1];
- if (null == arg || ('-' == arg[0] && '-' != arg)) {
- arg = null;
- } else {
- ++i;
- }
- this.emit(option.name(), arg);
- // bool
- } else {
- this.emit(option.name());
- }
- continue;
- }
-
- // looks like an option
- if (arg.length > 1 && '-' == arg[0]) {
- unknownOptions.push(arg);
-
- // If the next argument looks like it might be
- // an argument for this option, we pass it on.
- // If it isn't, then it'll simply be ignored
- if (argv[i+1] && '-' != argv[i+1][0]) {
- unknownOptions.push(argv[++i]);
- }
- continue;
- }
-
- // arg
- args.push(arg);
- }
-
- return { args: args, unknown: unknownOptions };
-};
-
-/**
- * Return an object containing options as key-value pairs
- *
- * @return {Object}
- * @api public
- */
-Command.prototype.opts = function() {
- var result = {}
- , len = this.options.length;
-
- for (var i = 0 ; i < len; i++) {
- var key = camelcase(this.options[i].name());
- result[key] = key === 'version' ? this._version : this[key];
- }
- return result;
-};
-
-/**
- * Argument `name` is missing.
- *
- * @param {String} name
- * @api private
- */
-
-Command.prototype.missingArgument = function(name) {
- console.error();
- console.error(" error: missing required argument `%s'", name);
- console.error();
- process.exit(1);
-};
-
-/**
- * `Option` is missing an argument, but received `flag` or nothing.
- *
- * @param {String} option
- * @param {String} flag
- * @api private
- */
-
-Command.prototype.optionMissingArgument = function(option, flag) {
- console.error();
- if (flag) {
- console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
- } else {
- console.error(" error: option `%s' argument missing", option.flags);
- }
- console.error();
- process.exit(1);
-};
-
-/**
- * Unknown option `flag`.
- *
- * @param {String} flag
- * @api private
- */
-
-Command.prototype.unknownOption = function(flag) {
- if (this._allowUnknownOption) return;
- console.error();
- console.error(" error: unknown option `%s'", flag);
- console.error();
- process.exit(1);
-};
-
-/**
- * Variadic argument with `name` is not the last argument as required.
- *
- * @param {String} name
- * @api private
- */
-
-Command.prototype.variadicArgNotLast = function(name) {
- console.error();
- console.error(" error: variadic arguments must be last `%s'", name);
- console.error();
- process.exit(1);
-};
-
-/**
- * Set the program version to `str`.
- *
- * This method auto-registers the "-V, --version" flag
- * which will print the version number when passed.
- *
- * @param {String} str
- * @param {String} flags
- * @return {Command} for chaining
- * @api public
- */
-
-Command.prototype.version = function(str, flags) {
- if (0 == arguments.length) return this._version;
- this._version = str;
- flags = flags || '-V, --version';
- this.option(flags, 'output the version number');
- this.on('version', function() {
- process.stdout.write(str + '\n');
- process.exit(0);
- });
- return this;
-};
-
-/**
- * Set the description to `str`.
- *
- * @param {String} str
- * @return {String|Command}
- * @api public
- */
-
-Command.prototype.description = function(str) {
- if (0 == arguments.length) return this._description;
- this._description = str;
- return this;
-};
-
-/**
- * Set an alias for the command
- *
- * @param {String} alias
- * @return {String|Command}
- * @api public
- */
-
-Command.prototype.alias = function(alias) {
- if (0 == arguments.length) return this._alias;
- this._alias = alias;
- return this;
-};
-
-/**
- * Set / get the command usage `str`.
- *
- * @param {String} str
- * @return {String|Command}
- * @api public
- */
-
-Command.prototype.usage = function(str) {
- var args = this._args.map(function(arg) {
- return humanReadableArgName(arg);
- });
-
- var usage = '[options]'
- + (this.commands.length ? ' [command]' : '')
- + (this._args.length ? ' ' + args.join(' ') : '');
-
- if (0 == arguments.length) return this._usage || usage;
- this._usage = str;
-
- return this;
-};
-
-/**
- * Get the name of the command
- *
- * @param {String} name
- * @return {String|Command}
- * @api public
- */
-
-Command.prototype.name = function() {
- return this._name;
-};
-
-/**
- * Return the largest option length.
- *
- * @return {Number}
- * @api private
- */
-
-Command.prototype.largestOptionLength = function() {
- return this.options.reduce(function(max, option) {
- return Math.max(max, option.flags.length);
- }, 0);
-};
-
-/**
- * Return help for options.
- *
- * @return {String}
- * @api private
- */
-
-Command.prototype.optionHelp = function() {
- var width = this.largestOptionLength();
-
- // Prepend the help information
- return [pad('-h, --help', width) + ' ' + 'output usage information']
- .concat(this.options.map(function(option) {
- return pad(option.flags, width) + ' ' + option.description;
- }))
- .join('\n');
-};
-
-/**
- * Return command help documentation.
- *
- * @return {String}
- * @api private
- */
-
-Command.prototype.commandHelp = function() {
- if (!this.commands.length) return '';
-
- var commands = this.commands.filter(function(cmd) {
- return !cmd._noHelp;
- }).map(function(cmd) {
- var args = cmd._args.map(function(arg) {
- return humanReadableArgName(arg);
- }).join(' ');
-
- return [
- cmd._name
- + (cmd._alias
- ? '|' + cmd._alias
- : '')
- + (cmd.options.length
- ? ' [options]'
- : '')
- + ' ' + args
- , cmd.description()
- ];
- });
-
- var width = commands.reduce(function(max, command) {
- return Math.max(max, command[0].length);
- }, 0);
-
- return [
- ''
- , ' Commands:'
- , ''
- , commands.map(function(cmd) {
- return pad(cmd[0], width) + ' ' + cmd[1];
- }).join('\n').replace(/^/gm, ' ')
- , ''
- ].join('\n');
-};
-
-/**
- * Return program help documentation.
- *
- * @return {String}
- * @api private
- */
-
-Command.prototype.helpInformation = function() {
- var desc = [];
- if (this._description) {
- desc = [
- ' ' + this._description
- , ''
- ];
- }
-
- var cmdName = this._name;
- if (this._alias) {
- cmdName = cmdName + '|' + this._alias;
- }
- var usage = [
- ''
- ,' Usage: ' + cmdName + ' ' + this.usage()
- , ''
- ];
-
- var cmds = [];
- var commandHelp = this.commandHelp();
- if (commandHelp) cmds = [commandHelp];
-
- var options = [
- ' Options:'
- , ''
- , '' + this.optionHelp().replace(/^/gm, ' ')
- , ''
- , ''
- ];
-
- return usage
- .concat(cmds)
- .concat(desc)
- .concat(options)
- .join('\n');
-};
-
-/**
- * Output help information for this command
- *
- * @api public
- */
-
-Command.prototype.outputHelp = function() {
- process.stdout.write(this.helpInformation());
- this.emit('--help');
-};
-
-/**
- * Output help information and exit.
- *
- * @api public
- */
-
-Command.prototype.help = function() {
- this.outputHelp();
- process.exit();
-};
-
-/**
- * Camel-case the given `flag`
- *
- * @param {String} flag
- * @return {String}
- * @api private
- */
-
-function camelcase(flag) {
- return flag.split('-').reduce(function(str, word) {
- return str + word[0].toUpperCase() + word.slice(1);
- });
-}
-
-/**
- * Pad `str` to `width`.
- *
- * @param {String} str
- * @param {Number} width
- * @return {String}
- * @api private
- */
-
-function pad(str, width) {
- var len = Math.max(0, width - str.length);
- return str + Array(len + 1).join(' ');
-}
-
-/**
- * Output help information if necessary
- *
- * @param {Command} command to output help for
- * @param {Array} array of options to search for -h or --help
- * @api private
- */
-
-function outputHelpIfNecessary(cmd, options) {
- options = options || [];
- for (var i = 0; i < options.length; i++) {
- if (options[i] == '--help' || options[i] == '-h') {
- cmd.outputHelp();
- process.exit(0);
- }
- }
-}
-
-/**
- * Takes an argument an returns its human readable equivalent for help usage.
- *
- * @param {Object} arg
- * @return {String}
- * @api private
- */
-
-function humanReadableArgName(arg) {
- var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
-
- return arg.required
- ? '<' + nameOutput + '>'
- : '[' + nameOutput + ']'
-}
-
-// for versions before node v0.8 when there weren't `fs.existsSync`
-function exists(file) {
- try {
- if (fs.statSync(file).isFile()) {
- return true;
- }
- } catch (e) {
- return false;
- }
-}
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore
deleted file mode 100644
index 3ac7d16..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.idea/
-.DS_Store
-node_modules/
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml
deleted file mode 100644
index baf9be7..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
- - "0.12"
- - "io.js"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE
deleted file mode 100644
index d1f842f..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Zhiye Li
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md
deleted file mode 100644
index fc63b50..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# graceful-readlink
-[](https://www.npmjs.org/package/graceful-readlink)
-[](https://www.npmjs.org/package/graceful-readlink)
-
-
-## Usage
-
-```js
-var readlinkSync = require('graceful-readlink').readlinkSync;
-console.log(readlinkSync(f));
-// output
-// the file pointed to when `f` is a symbolic link
-// the `f` itself when `f` is not a symbolic link
-```
-## Licence
-
-MIT License
[05/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
index 6fa13db..3261ae8 100755
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
@@ -20,70 +20,70 @@ var it = lab.test;
var expect = Code.expect;
-var nestedObj = {
+var nestedObj = {
v: [7, 8, 9],
w: /^something$/igm,
- x: {
+ x: {
a: [1, 2, 3],
b: 123456,
c: new Date(),
d: /hi/igm,
- e: /hello/
+ e: /hello/
},
y: 'y',
- z: new Date(1378775452757)
+ z: new Date(1378775452757)
};
var dupsArray = [nestedObj, { z: 'z' }, nestedObj];
var reducedDupsArray = [nestedObj, { z: 'z' }];
-describe('clone()', function () {
+describe('clone()', function () {
- it('clones a nested object', function (done) {
+ it('clones a nested object', function (done) {
var a = nestedObj;
var b = Hoek.clone(a);
expect(a).to.deep.equal(b);
expect(a.z.getTime()).to.equal(b.z.getTime());
- done();
+ done();
});
- it('clones a null object', function (done) {
+ it('clones a null object', function (done) {
var b = Hoek.clone(null);
expect(b).to.equal(null);
- done();
+ done();
});
- it('should not convert undefined properties to null', function (done) {
+ it('should not convert undefined properties to null', function (done) {
var obj = { something: undefined };
var b = Hoek.clone(obj);
expect(typeof b.something).to.equal('undefined');
- done();
+ done();
});
- it('should not throw on circular reference', function (done) {
+ it('should not throw on circular reference', function (done) {
var a = {};
a.x = a;
- var test = function () {
+ var test = function () {
- var b = Hoek.clone(a);
+ var b = Hoek.clone(a);
};
expect(test).to.not.throw();
- done();
+ done();
});
- it('clones circular reference', function (done) {
+ it('clones circular reference', function (done) {
- var x = {
- 'z': new Date()
+ var x = {
+ 'z': new Date()
};
x.y = x;
@@ -94,50 +94,50 @@ describe('clone()', function () {
expect(b.y.z).to.not.equal(x.y.z);
expect(b.y).to.equal(b);
expect(b.y.y.y.y).to.equal(b);
- done();
+ done();
});
- it('clones an object with a null prototype', function (done) {
+ it('clones an object with a null prototype', function (done) {
var obj = Object.create(null);
var b = Hoek.clone(obj);
expect(b).to.deep.equal(obj);
- done();
+ done();
});
- it('clones deeply nested object', function (done) {
+ it('clones deeply nested object', function (done) {
- var a = {
- x: {
- y: {
+ var a = {
+ x: {
+ y: {
a: [1, 2, 3],
b: 123456,
c: new Date(),
d: /hi/igm,
- e: /hello/
- }
- }
+ e: /hello/
+ }
+ }
};
var b = Hoek.clone(a);
expect(a).to.deep.equal(b);
expect(a.x.y.c.getTime()).to.equal(b.x.y.c.getTime());
- done();
+ done();
});
- it('clones arrays', function (done) {
+ it('clones arrays', function (done) {
var a = [1, 2, 3];
var b = Hoek.clone(a);
expect(a).to.deep.equal(b);
- done();
+ done();
});
- it('performs actual copy for shallow keys (no pass by reference)', function (done) {
+ it('performs actual copy for shallow keys (no pass by reference)', function (done) {
var x = Hoek.clone(nestedObj);
var y = Hoek.clone(nestedObj);
@@ -159,10 +159,10 @@ describe('clone()', function () {
expect(x.y).to.not.equal(nestedObj.y);
expect(x.y).to.not.equal(y.y);
- done();
+ done();
});
- it('performs actual copy for deep keys (no pass by reference)', function (done) {
+ it('performs actual copy for deep keys (no pass by reference)', function (done) {
var x = Hoek.clone(nestedObj);
var y = Hoek.clone(nestedObj);
@@ -172,17 +172,23 @@ describe('clone()', function () {
expect(x.x.c.getTime()).to.equal(nestedObj.x.c.getTime());
expect(x.x.c.getTime()).to.equal(y.x.c.getTime());
- done();
+ done();
});
- it('copies functions with properties', function (done) {
+ it('copies functions with properties', function (done) {
- var a = {
- x: function () { return 1; },
- y: {}
+ var a = {
+ x: function () {
+
+ return 1;
+ },
+ y: {}
};
a.x.z = 'string in function';
- a.x.v = function () { return 2; };
+ a.x.v = function () {
+
+ return 2;
+ };
a.y.u = a.x;
var b = Hoek.clone(a);
@@ -190,13 +196,14 @@ describe('clone()', function () {
expect(b.x.v()).to.equal(2);
expect(b.y.u).to.equal(b.x);
expect(b.x.z).to.equal('string in function');
- done();
+ done();
});
it('should copy a buffer', function (done) {
+
var tls = {
key: new Buffer([1, 2, 3, 4, 5]),
- cert: new Buffer([1, 2, 3, 4, 5, 6, 10])
+ cert: new Buffer([1, 2, 3, 4, 5, 6, 10])
};
var copiedTls = Hoek.clone(tls);
@@ -204,17 +211,20 @@ describe('clone()', function () {
expect(JSON.stringify(copiedTls.key)).to.equal(JSON.stringify(tls.key));
expect(Buffer.isBuffer(copiedTls.cert)).to.equal(true);
expect(JSON.stringify(copiedTls.cert)).to.equal(JSON.stringify(tls.cert));
- done();
+ done();
});
- it('clones an object with a prototype', function (done) {
+ it('clones an object with a prototype', function (done) {
- var Obj = function () {
+ var Obj = function () {
- this.a = 5;
+ this.a = 5;
};
- Obj.prototype.b = function () { return 'c'; };
+ Obj.prototype.b = function () {
+
+ return 'c';
+ };
var a = new Obj();
var b = Hoek.clone(a);
@@ -222,34 +232,38 @@ describe('clone()', function () {
expect(b.a).to.equal(5);
expect(b.b()).to.equal('c');
expect(a).to.deep.equal(b);
- done();
+ done();
});
- it('reuses cloned Date object', function (done) {
+ it('reuses cloned Date object', function (done) {
- var obj = {
- a: new Date()
+ var obj = {
+ a: new Date()
};
obj.b = obj.a;
var copy = Hoek.clone(obj);
expect(copy.a).to.equal(copy.b);
- done();
+ done();
});
- it('shallow copies an object with a prototype and isImmutable flag', function (done) {
+ it('shallow copies an object with a prototype and isImmutable flag', function (done) {
+
+ var Obj = function () {
- var Obj = function () {
+ this.value = 5;
+ };
- this.value = 5;
+ Obj.prototype.b = function () {
+
+ return 'c';
};
- Obj.prototype.b = function () { return 'c'; };
Obj.prototype.isImmutable = true;
- var obj = {
- a: new Obj()
+ var obj = {
+ a: new Obj()
};
var copy = Hoek.clone(obj);
@@ -258,117 +272,117 @@ describe('clone()', function () {
expect(copy.a.value).to.equal(5);
expect(copy.a.b()).to.equal('c');
expect(obj.a).to.equal(copy.a);
- done();
+ done();
});
- it('clones an object with property getter without executing it', function (done) {
+ it('clones an object with property getter without executing it', function (done) {
var obj = {};
var value = 1;
var execCount = 0;
- Object.defineProperty(obj, 'test', {
+ Object.defineProperty(obj, 'test', {
enumerable: true,
configurable: true,
- get: function () {
+ get: function () {
++execCount;
- return value;
- }
+ return value;
+ }
});
var copy = Hoek.clone(obj);
expect(execCount).to.equal(0);
expect(copy.test).to.equal(1);
expect(execCount).to.equal(1);
- done();
+ done();
});
- it('clones an object with property getter and setter', function (done) {
+ it('clones an object with property getter and setter', function (done) {
- var obj = {
- _test: 0
+ var obj = {
+ _test: 0
};
- Object.defineProperty(obj, 'test', {
+ Object.defineProperty(obj, 'test', {
enumerable: true,
configurable: true,
- get: function () {
+ get: function () {
- return this._test;
+ return this._test;
},
- set: function (value) {
+ set: function (value) {
- this._test = value - 1;
- }
+ this._test = value - 1;
+ }
});
var copy = Hoek.clone(obj);
expect(copy.test).to.equal(0);
copy.test = 5;
expect(copy.test).to.equal(4);
- done();
+ done();
});
- it('clones an object with only property setter', function (done) {
+ it('clones an object with only property setter', function (done) {
- var obj = {
- _test: 0
+ var obj = {
+ _test: 0
};
- Object.defineProperty(obj, 'test', {
+ Object.defineProperty(obj, 'test', {
enumerable: true,
configurable: true,
- set: function (value) {
+ set: function (value) {
- this._test = value - 1;
- }
+ this._test = value - 1;
+ }
});
var copy = Hoek.clone(obj);
expect(copy._test).to.equal(0);
copy.test = 5;
expect(copy._test).to.equal(4);
- done();
+ done();
});
- it('clones an object with non-enumerable properties', function (done) {
+ it('clones an object with non-enumerable properties', function (done) {
- var obj = {
- _test: 0
+ var obj = {
+ _test: 0
};
- Object.defineProperty(obj, 'test', {
+ Object.defineProperty(obj, 'test', {
enumerable: false,
configurable: true,
- set: function (value) {
+ set: function (value) {
- this._test = value - 1;
- }
+ this._test = value - 1;
+ }
});
var copy = Hoek.clone(obj);
expect(copy._test).to.equal(0);
copy.test = 5;
expect(copy._test).to.equal(4);
- done();
- });
+ done();
+ });
});
-describe('merge()', function () {
+describe('merge()', function () {
- it('deep copies source items', function (done) {
+ it('deep copies source items', function (done) {
- var target = {
+ var target = {
b: 3,
- d: []
+ d: []
};
- var source = {
- c: {
- d: 1
+ var source = {
+ c: {
+ d: 1
},
- d: [{ e: 1 }]
+ d: [{ e: 1 }]
};
Hoek.merge(target, source);
@@ -377,123 +391,123 @@ describe('merge()', function () {
expect(target.d).to.not.equal(source.d);
expect(target.d[0]).to.not.equal(source.d[0]);
expect(target.d).to.deep.equal(source.d);
- done();
+ done();
});
- it('merges array over an object', function (done) {
+ it('merges array over an object', function (done) {
- var a = {
- x: ['n', 'm']
+ var a = {
+ x: ['n', 'm']
};
- var b = {
- x: {
+ var b = {
+ x: {
n: '1',
- m: '2'
- }
+ m: '2'
+ }
};
Hoek.merge(b, a);
expect(a.x[0]).to.equal('n');
expect(a.x.n).to.not.exist();
- done();
+ done();
});
- it('merges object over an array', function (done) {
+ it('merges object over an array', function (done) {
- var a = {
- x: ['n', 'm']
+ var a = {
+ x: ['n', 'm']
};
- var b = {
- x: {
+ var b = {
+ x: {
n: '1',
- m: '2'
- }
+ m: '2'
+ }
};
Hoek.merge(a, b);
expect(a.x.n).to.equal('1');
expect(a.x[0]).to.not.exist();
- done();
+ done();
});
- it('does not throw if source is null', function (done) {
+ it('does not throw if source is null', function (done) {
var a = {};
var b = null;
var c = null;
- expect(function () {
+ expect(function () {
- c = Hoek.merge(a, b);
+ c = Hoek.merge(a, b);
}).to.not.throw();
expect(c).to.equal(a);
- done();
+ done();
});
- it('does not throw if source is undefined', function (done) {
+ it('does not throw if source is undefined', function (done) {
var a = {};
var b;
var c = null;
- expect(function () {
+ expect(function () {
- c = Hoek.merge(a, b);
+ c = Hoek.merge(a, b);
}).to.not.throw();
expect(c).to.equal(a);
- done();
+ done();
});
- it('throws if source is not an object', function (done) {
+ it('throws if source is not an object', function (done) {
- expect(function () {
+ expect(function () {
var a = {};
var b = 0;
- Hoek.merge(a, b);
+ Hoek.merge(a, b);
}).to.throw('Invalid source value: must be null, undefined, or an object');
- done();
+ done();
});
- it('throws if target is not an object', function (done) {
+ it('throws if target is not an object', function (done) {
- expect(function () {
+ expect(function () {
var a = 0;
var b = {};
- Hoek.merge(a, b);
+ Hoek.merge(a, b);
}).to.throw('Invalid target value: must be an object');
- done();
+ done();
});
- it('throws if target is not an array and source is', function (done) {
+ it('throws if target is not an array and source is', function (done) {
- expect(function () {
+ expect(function () {
var a = {};
var b = [1, 2];
- Hoek.merge(a, b);
+ Hoek.merge(a, b);
}).to.throw('Cannot merge array onto an object');
- done();
+ done();
});
- it('returns the same object when merging arrays', function (done) {
+ it('returns the same object when merging arrays', function (done) {
var a = [];
var b = [1, 2];
expect(Hoek.merge(a, b)).to.equal(a);
- done();
+ done();
});
- it('combines an empty object with a non-empty object', function (done) {
+ it('combines an empty object with a non-empty object', function (done) {
var a = {};
var b = nestedObj;
@@ -501,10 +515,10 @@ describe('merge()', function () {
var c = Hoek.merge(a, b);
expect(a).to.deep.equal(b);
expect(c).to.deep.equal(b);
- done();
+ done();
});
- it('overrides values in target', function (done) {
+ it('overrides values in target', function (done) {
var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
@@ -516,10 +530,10 @@ describe('merge()', function () {
expect(c.v).to.equal(0);
expect(c.m).to.equal('123');
expect(c.t).to.deep.equal({ u: 6 });
- done();
+ done();
});
- it('overrides values in target (flip)', function (done) {
+ it('overrides values in target (flip)', function (done) {
var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
@@ -531,98 +545,98 @@ describe('merge()', function () {
expect(d.v).to.equal(5);
expect(d.m).to.equal('abc');
expect(d.t).to.deep.equal('test');
- done();
+ done();
});
- it('retains Date properties', function (done) {
+ it('retains Date properties', function (done) {
var a = { x: new Date(1378776452757) };
var b = Hoek.merge({}, a);
expect(a.x.getTime()).to.equal(b.x.getTime());
- done();
+ done();
});
- it('retains Date properties when merging keys', function (done) {
+ it('retains Date properties when merging keys', function (done) {
var a = { x: new Date(1378776452757) };
var b = Hoek.merge({ x: {} }, a);
expect(a.x.getTime()).to.equal(b.x.getTime());
- done();
+ done();
});
- it('overrides Buffer', function (done) {
+ it('overrides Buffer', function (done) {
var a = { x: new Buffer('abc') };
var b = Hoek.merge({ x: {} }, a);
expect(a.x.toString()).to.equal('abc');
- done();
- });
+ done();
+ });
});
-describe('applyToDefaults()', function () {
+describe('applyToDefaults()', function () {
- var defaults = {
+ var defaults = {
a: 1,
b: 2,
- c: {
+ c: {
d: 3,
- e: [5, 6]
+ e: [5, 6]
},
f: 6,
- g: 'test'
+ g: 'test'
};
- it('throws when target is null', function (done) {
+ it('throws when target is null', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.applyToDefaults(null, {});
+ Hoek.applyToDefaults(null, {});
}).to.throw('Invalid defaults value: must be an object');
- done();
+ done();
});
- it('returns null if options is false', function (done) {
+ it('returns null if options is false', function (done) {
var result = Hoek.applyToDefaults(defaults, false);
expect(result).to.equal(null);
- done();
+ done();
});
- it('returns null if options is null', function (done) {
+ it('returns null if options is null', function (done) {
var result = Hoek.applyToDefaults(defaults, null);
expect(result).to.equal(null);
- done();
+ done();
});
- it('returns null if options is undefined', function (done) {
+ it('returns null if options is undefined', function (done) {
var result = Hoek.applyToDefaults(defaults, undefined);
expect(result).to.equal(null);
- done();
+ done();
});
- it('returns a copy of defaults if options is true', function (done) {
+ it('returns a copy of defaults if options is true', function (done) {
var result = Hoek.applyToDefaults(defaults, true);
expect(result).to.deep.equal(defaults);
- done();
+ done();
});
- it('applies object to defaults', function (done) {
+ it('applies object to defaults', function (done) {
- var obj = {
+ var obj = {
a: null,
- c: {
- e: [4]
+ c: {
+ e: [4]
},
f: 0,
- g: {
- h: 5
- }
+ g: {
+ h: 5
+ }
};
var result = Hoek.applyToDefaults(defaults, obj);
@@ -631,20 +645,20 @@ describe('applyToDefaults()', function () {
expect(result.b).to.equal(2);
expect(result.f).to.equal(0);
expect(result.g).to.deep.equal({ h: 5 });
- done();
+ done();
});
- it('applies object to defaults with null', function (done) {
+ it('applies object to defaults with null', function (done) {
- var obj = {
+ var obj = {
a: null,
- c: {
- e: [4]
+ c: {
+ e: [4]
},
f: 0,
- g: {
- h: 5
- }
+ g: {
+ h: 5
+ }
};
var result = Hoek.applyToDefaults(defaults, obj, true);
@@ -653,21 +667,21 @@ describe('applyToDefaults()', function () {
expect(result.b).to.equal(2);
expect(result.f).to.equal(0);
expect(result.g).to.deep.equal({ h: 5 });
- done();
- });
+ done();
+ });
});
-describe('cloneWithShallow()', function () {
+describe('cloneWithShallow()', function () {
- it('deep clones except for listed keys', function (done) {
+ it('deep clones except for listed keys', function (done) {
- var source = {
- a: {
- b: 5
+ var source = {
+ a: {
+ b: 5
},
- c: {
- d: 6
- }
+ c: {
+ d: 6
+ }
};
var copy = Hoek.cloneWithShallow(source, ['c']);
@@ -675,36 +689,36 @@ describe('cloneWithShallow()', function () {
expect(copy).to.not.equal(source);
expect(copy.a).to.not.equal(source.a);
expect(copy.b).to.equal(source.b);
- done();
+ done();
});
- it('returns immutable value', function (done) {
+ it('returns immutable value', function (done) {
expect(Hoek.cloneWithShallow(5)).to.equal(5);
- done();
+ done();
});
- it('returns null value', function (done) {
+ it('returns null value', function (done) {
expect(Hoek.cloneWithShallow(null)).to.equal(null);
- done();
+ done();
});
- it('returns undefined value', function (done) {
+ it('returns undefined value', function (done) {
expect(Hoek.cloneWithShallow(undefined)).to.equal(undefined);
- done();
+ done();
});
- it('deep clones except for listed keys (including missing keys)', function (done) {
+ it('deep clones except for listed keys (including missing keys)', function (done) {
- var source = {
- a: {
- b: 5
+ var source = {
+ a: {
+ b: 5
},
- c: {
- d: 6
- }
+ c: {
+ d: 6
+ }
};
var copy = Hoek.cloneWithShallow(source, ['c', 'v']);
@@ -712,33 +726,33 @@ describe('cloneWithShallow()', function () {
expect(copy).to.not.equal(source);
expect(copy.a).to.not.equal(source.a);
expect(copy.b).to.equal(source.b);
- done();
- });
+ done();
+ });
});
-describe('applyToDefaultsWithShallow()', function () {
+describe('applyToDefaultsWithShallow()', function () {
- it('shallow copies the listed keys from options without merging', function (done) {
+ it('shallow copies the listed keys from options without merging', function (done) {
- var defaults = {
- a: {
+ var defaults = {
+ a: {
b: 5,
- e: 3
+ e: 3
},
- c: {
+ c: {
d: 7,
- g: 1
- }
+ g: 1
+ }
};
- var options = {
- a: {
- b: 4
+ var options = {
+ a: {
+ b: 4
},
- c: {
+ c: {
d: 6,
- f: 7
- }
+ f: 7
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['a']);
@@ -747,235 +761,235 @@ describe('applyToDefaultsWithShallow()', function () {
expect(merged.a).to.not.equal(defaults.a);
expect(merged.c).to.not.equal(options.c);
expect(merged.c).to.not.equal(defaults.c);
- done();
+ done();
});
- it('shallow copies the nested keys (override)', function (done) {
+ it('shallow copies the nested keys (override)', function (done) {
- var defaults = {
- a: {
- b: 5
+ var defaults = {
+ a: {
+ b: 5
},
- c: {
+ c: {
d: 7,
- g: 1
- }
+ g: 1
+ }
};
- var options = {
- a: {
- b: 4
+ var options = {
+ a: {
+ b: 4
},
- c: {
+ c: {
d: 6,
- g: {
- h: 8
- }
- }
+ g: {
+ h: 8
+ }
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
expect(merged).to.deep.equal({ a: { b: 4 }, c: { d: 6, g: { h: 8 } } });
expect(merged.c.g).to.equal(options.c.g);
- done();
+ done();
});
- it('shallow copies the nested keys (missing)', function (done) {
+ it('shallow copies the nested keys (missing)', function (done) {
- var defaults = {
- a: {
- b: 5
- }
+ var defaults = {
+ a: {
+ b: 5
+ }
};
- var options = {
- a: {
- b: 4
+ var options = {
+ a: {
+ b: 4
},
- c: {
- g: {
- h: 8
- }
- }
+ c: {
+ g: {
+ h: 8
+ }
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
expect(merged.c.g).to.equal(options.c.g);
- done();
+ done();
});
- it('shallow copies the nested keys (override)', function (done) {
+ it('shallow copies the nested keys (override)', function (done) {
- var defaults = {
- a: {
- b: 5
+ var defaults = {
+ a: {
+ b: 5
},
- c: {
- g: {
- d: 7
- }
- }
+ c: {
+ g: {
+ d: 7
+ }
+ }
};
- var options = {
- a: {
- b: 4
+ var options = {
+ a: {
+ b: 4
},
- c: {
- g: {
- h: 8
- }
- }
+ c: {
+ g: {
+ h: 8
+ }
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
expect(merged.c.g).to.equal(options.c.g);
- done();
+ done();
});
- it('shallow copies the nested keys (deeper)', function (done) {
+ it('shallow copies the nested keys (deeper)', function (done) {
- var defaults = {
- a: {
- b: 5
- }
+ var defaults = {
+ a: {
+ b: 5
+ }
};
- var options = {
- a: {
- b: 4
+ var options = {
+ a: {
+ b: 4
},
- c: {
- g: {
- r: {
- h: 8
- }
- }
- }
+ c: {
+ g: {
+ r: {
+ h: 8
+ }
+ }
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g.r']);
expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
expect(merged.c.g.r).to.equal(options.c.g.r);
- done();
+ done();
});
- it('shallow copies the nested keys (not present)', function (done) {
+ it('shallow copies the nested keys (not present)', function (done) {
- var defaults = {
- a: {
- b: 5
- }
+ var defaults = {
+ a: {
+ b: 5
+ }
};
- var options = {
- a: {
- b: 4
+ var options = {
+ a: {
+ b: 4
},
- c: {
- g: {
- r: {
- h: 8
- }
- }
- }
+ c: {
+ g: {
+ r: {
+ h: 8
+ }
+ }
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['x.y']);
expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
- done();
+ done();
});
- it('shallow copies the listed keys in the defaults', function (done) {
+ it('shallow copies the listed keys in the defaults', function (done) {
- var defaults = {
- a: {
- b: 1
- }
+ var defaults = {
+ a: {
+ b: 1
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, {}, ['a']);
expect(merged.a).to.equal(defaults.a);
- done();
+ done();
});
- it('shallow copies the listed keys in the defaults (true)', function (done) {
+ it('shallow copies the listed keys in the defaults (true)', function (done) {
- var defaults = {
- a: {
- b: 1
- }
+ var defaults = {
+ a: {
+ b: 1
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, true, ['a']);
expect(merged.a).to.equal(defaults.a);
- done();
+ done();
});
- it('returns null on false', function (done) {
+ it('returns null on false', function (done) {
- var defaults = {
- a: {
- b: 1
- }
+ var defaults = {
+ a: {
+ b: 1
+ }
};
var merged = Hoek.applyToDefaultsWithShallow(defaults, false, ['a']);
expect(merged).to.equal(null);
- done();
+ done();
});
- it('throws on missing defaults', function (done) {
+ it('throws on missing defaults', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.applyToDefaultsWithShallow(null, {}, ['a']);
+ Hoek.applyToDefaultsWithShallow(null, {}, ['a']);
}).to.throw('Invalid defaults value: must be an object');
- done();
+ done();
});
- it('throws on invalid defaults', function (done) {
+ it('throws on invalid defaults', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.applyToDefaultsWithShallow('abc', {}, ['a']);
+ Hoek.applyToDefaultsWithShallow('abc', {}, ['a']);
}).to.throw('Invalid defaults value: must be an object');
- done();
+ done();
});
- it('throws on invalid options', function (done) {
+ it('throws on invalid options', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.applyToDefaultsWithShallow({}, 'abc', ['a']);
+ Hoek.applyToDefaultsWithShallow({}, 'abc', ['a']);
}).to.throw('Invalid options value: must be true, falsy or an object');
- done();
+ done();
});
- it('throws on missing keys', function (done) {
+ it('throws on missing keys', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.applyToDefaultsWithShallow({}, true);
+ Hoek.applyToDefaultsWithShallow({}, true);
}).to.throw('Invalid keys');
- done();
+ done();
});
- it('throws on invalid keys', function (done) {
+ it('throws on invalid keys', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.applyToDefaultsWithShallow({}, true, 'a');
+ Hoek.applyToDefaultsWithShallow({}, true, 'a');
}).to.throw('Invalid keys');
- done();
- });
+ done();
+ });
});
-describe('deepEqual()', function () {
+describe('deepEqual()', function () {
- it('compares simple values', function (done) {
+ it('compares simple values', function (done) {
expect(Hoek.deepEqual('x', 'x')).to.be.true();
expect(Hoek.deepEqual('x', 'y')).to.be.false();
@@ -989,10 +1003,10 @@ describe('deepEqual()', function () {
expect(Hoek.deepEqual(-1, 1)).to.be.false();
expect(Hoek.deepEqual(NaN, 0)).to.be.false();
expect(Hoek.deepEqual(NaN, NaN)).to.be.true();
- done();
+ done();
});
- it('compares different types', function (done) {
+ it('compares different types', function (done) {
expect(Hoek.deepEqual([], 5)).to.be.false();
expect(Hoek.deepEqual(5, [])).to.be.false();
@@ -1000,116 +1014,116 @@ describe('deepEqual()', function () {
expect(Hoek.deepEqual(null, {})).to.be.false();
expect(Hoek.deepEqual('abc', {})).to.be.false();
expect(Hoek.deepEqual({}, 'abc')).to.be.false();
- done();
+ done();
});
- it('compares empty structures', function (done) {
+ it('compares empty structures', function (done) {
expect(Hoek.deepEqual([], [])).to.be.true();
expect(Hoek.deepEqual({}, {})).to.be.true();
expect(Hoek.deepEqual([], {})).to.be.false();
- done();
+ done();
});
- it('compares empty arguments object', function (done) {
+ it('compares empty arguments object', function (done) {
- var compare = function () {
+ var compare = function () {
- expect(Hoek.deepEqual([], arguments)).to.be.false();
+ expect(Hoek.deepEqual([], arguments)).to.be.false();
};
compare();
- done();
+ done();
});
- it('compares empty arguments objects', function (done) {
+ it('compares empty arguments objects', function (done) {
- var compare = function () {
+ var compare = function () {
var arg1 = arguments;
- var inner = function () {
+ var inner = function () {
expect(Hoek.deepEqual(arg1, arguments)).to.be.false(); // callee is not the same
};
- inner();
+ inner();
};
compare();
- done();
+ done();
});
- it('compares dates', function (done) {
+ it('compares dates', function (done) {
expect(Hoek.deepEqual(new Date(2015, 1, 1), new Date(2015, 1, 1))).to.be.true();
expect(Hoek.deepEqual(new Date(100), new Date(101))).to.be.false();
expect(Hoek.deepEqual(new Date(), {})).to.be.false();
- done();
+ done();
});
- it('compares regular expressions', function (done) {
+ it('compares regular expressions', function (done) {
expect(Hoek.deepEqual(/\s/, new RegExp('\\\s'))).to.be.true();
expect(Hoek.deepEqual(/\s/g, /\s/g)).to.be.true();
expect(Hoek.deepEqual(/a/, {})).to.be.false();
expect(Hoek.deepEqual(/\s/g, /\s/i)).to.be.false();
expect(Hoek.deepEqual(/a/g, /b/g)).to.be.false();
- done();
+ done();
});
- it('compares arrays', function (done) {
+ it('compares arrays', function (done) {
expect(Hoek.deepEqual([[1]], [[1]])).to.be.true();
expect(Hoek.deepEqual([1, 2, 3], [1, 2, 3])).to.be.true();
expect(Hoek.deepEqual([1, 2, 3], [1, 3, 2])).to.be.false();
expect(Hoek.deepEqual([1, 2, 3], [1, 2])).to.be.false();
expect(Hoek.deepEqual([1], [1])).to.be.true();
- done();
+ done();
});
- it('compares buffers', function (done) {
+ it('compares buffers', function (done) {
expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2, 3]))).to.be.true();
expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 3, 2]))).to.be.false();
expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2]))).to.be.false();
expect(Hoek.deepEqual(new Buffer([1, 2, 3]), {})).to.be.false();
expect(Hoek.deepEqual(new Buffer([1, 2, 3]), [1, 2, 3])).to.be.false();
- done();
+ done();
});
- it('compares objects', function (done) {
+ it('compares objects', function (done) {
expect(Hoek.deepEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 })).to.be.true();
expect(Hoek.deepEqual({ foo: 'bar' }, { foo: 'baz' })).to.be.false();
expect(Hoek.deepEqual({ foo: { bar: 'foo' } }, { foo: { bar: 'baz' } })).to.be.false();
- done();
+ done();
});
- it('handles circular dependency', function (done) {
+ it('handles circular dependency', function (done) {
var a = {};
a.x = a;
var b = Hoek.clone(a);
expect(Hoek.deepEqual(a, b)).to.be.true();
- done();
+ done();
});
- it('compares an object with property getter without executing it', function (done) {
+ it('compares an object with property getter without executing it', function (done) {
var obj = {};
var value = 1;
var execCount = 0;
- Object.defineProperty(obj, 'test', {
+ Object.defineProperty(obj, 'test', {
enumerable: true,
configurable: true,
- get: function () {
+ get: function () {
++execCount;
- return value;
- }
+ return value;
+ }
});
var copy = Hoek.clone(obj);
@@ -1117,52 +1131,64 @@ describe('deepEqual()', function () {
expect(execCount).to.equal(0);
expect(copy.test).to.equal(1);
expect(execCount).to.equal(1);
- done();
+ done();
});
- it('compares objects with property getters', function (done) {
+ it('compares objects with property getters', function (done) {
var obj = {};
- Object.defineProperty(obj, 'test', {
+ Object.defineProperty(obj, 'test', {
enumerable: true,
configurable: true,
- get: function () { return 1; }
+ get: function () {
+
+ return 1;
+ }
});
var ref = {};
- Object.defineProperty(ref, 'test', {
+ Object.defineProperty(ref, 'test', {
enumerable: true,
configurable: true,
- get: function () { return 2; }
+ get: function () {
+
+ return 2;
+ }
});
expect(Hoek.deepEqual(obj, ref)).to.be.false();
- done();
+ done();
});
- it('compares object prototypes', function (done) {
+ it('compares object prototypes', function (done) {
- var Obj = function () {
+ var Obj = function () {
- this.a = 5;
+ this.a = 5;
};
- Obj.prototype.b = function () { return this.a; };
+ Obj.prototype.b = function () {
+
+ return this.a;
+ };
- var Ref = function () {
+ var Ref = function () {
- this.a = 5;
+ this.a = 5;
};
- Ref.prototype.b = function () { return this.a; };
+ Ref.prototype.b = function () {
+
+ return this.a;
+ };
expect(Hoek.deepEqual(new Obj(), new Ref())).to.be.false();
expect(Hoek.deepEqual(new Obj(), new Obj())).to.be.true();
expect(Hoek.deepEqual(new Ref(), new Ref())).to.be.true();
- done();
+ done();
});
- it('compares plain objects', function (done) {
+ it('compares plain objects', function (done) {
var a = Object.create(null);
var b = Object.create(null);
@@ -1172,122 +1198,131 @@ describe('deepEqual()', function () {
expect(Hoek.deepEqual(a, b)).to.be.true();
expect(Hoek.deepEqual(a, { b: 'c' })).to.be.false();
- done();
+ done();
});
- it('compares an object with an empty object', function (done) {
+ it('compares an object with an empty object', function (done) {
var a = { a: 1, b: 2 };
expect(Hoek.deepEqual({}, a)).to.be.false();
expect(Hoek.deepEqual(a, {})).to.be.false();
- done();
+ done();
});
- it('compares an object ignoring the prototype', function (done) {
+ it('compares an object ignoring the prototype', function (done) {
var a = Object.create(null);
var b = {};
- expect(Hoek.deepEqual(a, b, { prototype: false})).to.be.true();
- done();
+ expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
+ done();
});
+
+ it('compares an object ignoring the prototype recursively', function (done) {
+
+ var a = [Object.create(null)];
+ var b = [{}];
+
+ expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
+ done();
+ });
});
-describe('unique()', function () {
+describe('unique()', function () {
- it('ensures uniqueness within array of objects based on subkey', function (done) {
+ it('ensures uniqueness within array of objects based on subkey', function (done) {
var a = Hoek.unique(dupsArray, 'x');
expect(a).to.deep.equal(reducedDupsArray);
- done();
+ done();
});
- it('removes duplicated without key', function (done) {
+ it('removes duplicated without key', function (done) {
expect(Hoek.unique([1, 2, 3, 4, 2, 1, 5])).to.deep.equal([1, 2, 3, 4, 5]);
- done();
- });
+ done();
+ });
});
-describe('mapToObject()', function () {
+describe('mapToObject()', function () {
- it('returns null on null array', function (done) {
+ it('returns null on null array', function (done) {
var a = Hoek.mapToObject(null);
expect(a).to.equal(null);
- done();
+ done();
});
- it('converts basic array to existential object', function (done) {
+ it('converts basic array to existential object', function (done) {
var keys = [1, 2, 3, 4];
var a = Hoek.mapToObject(keys);
- for (var i in keys) {
- expect(a[keys[i]]).to.equal(true);
+ for (var i in keys) {
+ expect(a[keys[i]]).to.equal(true);
}
- done();
+ done();
});
- it('converts array of objects to existential object', function (done) {
+ it('converts array of objects to existential object', function (done) {
var keys = [{ x: 1 }, { x: 2 }, { x: 3 }, { y: 4 }];
var subkey = 'x';
var a = Hoek.mapToObject(keys, subkey);
expect(a).to.deep.equal({ 1: true, 2: true, 3: true });
- done();
- });
+ done();
+ });
});
-describe('intersect()', function () {
+describe('intersect()', function () {
- it('returns the common objects of two arrays', function (done) {
+ it('returns the common objects of two arrays', function (done) {
var array1 = [1, 2, 3, 4, 4, 5, 5];
var array2 = [5, 4, 5, 6, 7];
var common = Hoek.intersect(array1, array2);
expect(common.length).to.equal(2);
- done();
+ done();
});
- it('returns just the first common object of two arrays', function (done) {
+ it('returns just the first common object of two arrays', function (done) {
var array1 = [1, 2, 3, 4, 4, 5, 5];
var array2 = [5, 4, 5, 6, 7];
var common = Hoek.intersect(array1, array2, true);
expect(common).to.equal(5);
- done();
+ done();
});
- it('returns null when no common and returning just the first common object of two arrays', function (done) {
+ it('returns null when no common and returning just the first common object of two arrays', function (done) {
var array1 = [1, 2, 3, 4, 4, 5, 5];
var array2 = [6, 7];
var common = Hoek.intersect(array1, array2, true);
expect(common).to.equal(null);
- done();
+ done();
});
- it('returns an empty array if either input is null', function (done) {
+ it('returns an empty array if either input is null', function (done) {
expect(Hoek.intersect([1], null).length).to.equal(0);
expect(Hoek.intersect(null, [1]).length).to.equal(0);
- done();
+ done();
});
- it('returns the common objects of object and array', function (done) {
+ it('returns the common objects of object and array', function (done) {
var array1 = [1, 2, 3, 4, 4, 5, 5];
var array2 = [5, 4, 5, 6, 7];
var common = Hoek.intersect(Hoek.mapToObject(array1), array2);
expect(common.length).to.equal(2);
- done();
- });
+ done();
+ });
});
-describe('contain()', function () {
+describe('contain()', function () {
- it('tests strings', function (done) {
+ it('tests strings', function (done) {
expect(Hoek.contain('abc', 'ab')).to.be.true();
expect(Hoek.contain('abc', 'abc', { only: true })).to.be.true();
@@ -1302,10 +1337,10 @@ describe('contain()', function () {
expect(Hoek.contain('abb', 'b', { once: true })).to.be.false();
expect(Hoek.contain('abc', ['a', 'd'])).to.be.false();
expect(Hoek.contain('abc', ['ab', 'bc'])).to.be.false(); // Overlapping values not supported
- done();
+ done();
});
- it('tests arrays', function (done) {
+ it('tests arrays', function (done) {
expect(Hoek.contain([1, 2, 3], 1)).to.be.true();
expect(Hoek.contain([{ a: 1 }], { a: 1 }, { deep: true })).to.be.true();
@@ -1326,10 +1361,10 @@ describe('contain()', function () {
expect(Hoek.contain([1, 3, 2], [1, 2], { only: true })).to.be.false();
expect(Hoek.contain([1, 2, 2], [1, 2], { once: true })).to.be.false();
expect(Hoek.contain([0, 2, 3], [1, 4], { part: true })).to.be.false();
- done();
+ done();
});
- it('tests objects', function (done) {
+ it('tests objects', function (done) {
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'a')).to.be.true();
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'c'])).to.be.true();
@@ -1339,6 +1374,11 @@ describe('contain()', function () {
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true })).to.be.true();
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }, { only: true })).to.be.true();
expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: false })).to.be.false();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: false })).to.be.true();
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'd')).to.be.false();
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'd'])).to.be.false();
@@ -1349,187 +1389,258 @@ describe('contain()', function () {
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 })).to.be.false();
expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 }, { only: true })).to.be.false();
expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] })).to.be.false();
- done();
- });
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: false })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: false })).to.be.false();
+
+ // Getter check
+ var Foo = function (bar) {
+
+ this.bar = bar;
+ };
+
+ Object.defineProperty(Foo.prototype, 'baz', {
+ enumerable: true,
+ get: function () {
+
+ return this.bar;
+ }
+ });
+
+ expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: false })).to.be.false();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: true })).to.be.true();
+
+ done();
+ });
});
-describe('flatten()', function () {
+describe('flatten()', function () {
- it('returns a flat array', function (done) {
+ it('returns a flat array', function (done) {
var result = Hoek.flatten([1, 2, [3, 4, [5, 6], [7], 8], [9], [10, [11, 12]], 13]);
expect(result.length).to.equal(13);
expect(result).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
- done();
- });
+ done();
+ });
});
-describe('reach()', function () {
+describe('reach()', function () {
- var obj = {
- a: {
- b: {
- c: {
+ var obj = {
+ a: {
+ b: {
+ c: {
d: 1,
- e: 2
+ e: 2
},
- f: 'hello'
+ f: 'hello'
},
- g: {
- h: 3
- }
+ g: {
+ h: 3
+ }
},
i: function () { },
j: null,
- k: [4, 8, 9, 1]
+ k: [4, 8, 9, 1]
};
obj.i.x = 5;
- it('returns first value of array', function (done) {
+ it('returns first value of array', function (done) {
expect(Hoek.reach(obj, 'k.0')).to.equal(4);
- done();
+ done();
});
- it('returns last value of array using negative index', function (done) {
+ it('returns last value of array using negative index', function (done) {
expect(Hoek.reach(obj, 'k.-2')).to.equal(9);
- done();
+ done();
});
- it('returns a valid member', function (done) {
+ it('returns a valid member', function (done) {
expect(Hoek.reach(obj, 'a.b.c.d')).to.equal(1);
- done();
+ done();
});
- it('returns a valid member with separator override', function (done) {
+ it('returns a valid member with separator override', function (done) {
expect(Hoek.reach(obj, 'a/b/c/d', '/')).to.equal(1);
- done();
+ done();
});
- it('returns undefined on null object', function (done) {
+ it('returns undefined on null object', function (done) {
expect(Hoek.reach(null, 'a.b.c.d')).to.equal(undefined);
- done();
+ done();
});
- it('returns undefined on missing object member', function (done) {
+ it('returns undefined on missing object member', function (done) {
expect(Hoek.reach(obj, 'a.b.c.d.x')).to.equal(undefined);
- done();
+ done();
});
- it('returns undefined on missing function member', function (done) {
+ it('returns undefined on missing function member', function (done) {
expect(Hoek.reach(obj, 'i.y', { functions: true })).to.equal(undefined);
- done();
+ done();
});
- it('throws on missing member in strict mode', function (done) {
+ it('throws on missing member in strict mode', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.reach(obj, 'a.b.c.o.x', { strict: true });
+ Hoek.reach(obj, 'a.b.c.o.x', { strict: true });
}).to.throw('Missing segment o in reach path a.b.c.o.x');
- done();
+ done();
});
- it('returns undefined on invalid member', function (done) {
+ it('returns undefined on invalid member', function (done) {
expect(Hoek.reach(obj, 'a.b.c.d-.x')).to.equal(undefined);
- done();
+ done();
});
- it('returns function member', function (done) {
+ it('returns function member', function (done) {
expect(typeof Hoek.reach(obj, 'i')).to.equal('function');
- done();
+ done();
});
- it('returns function property', function (done) {
+ it('returns function property', function (done) {
expect(Hoek.reach(obj, 'i.x')).to.equal(5);
- done();
+ done();
});
- it('returns null', function (done) {
+ it('returns null', function (done) {
expect(Hoek.reach(obj, 'j')).to.equal(null);
- done();
+ done();
});
- it('throws on function property when functions not allowed', function (done) {
+ it('throws on function property when functions not allowed', function (done) {
- expect(function () {
+ expect(function () {
- Hoek.reach(obj, 'i.x', { functions: false });
+ Hoek.reach(obj, 'i.x', { functions: false });
}).to.throw('Invalid segment x in reach path i.x');
- done();
+ done();
});
- it('will return a default value if property is not found', function (done) {
+ it('will return a default value if property is not found', function (done) {
expect(Hoek.reach(obj, 'a.b.q', { default: 'defaultValue' })).to.equal('defaultValue');
- done();
+ done();
});
- it('will return a default value if path is not found', function (done) {
+ it('will return a default value if path is not found', function (done) {
expect(Hoek.reach(obj, 'q', { default: 'defaultValue' })).to.equal('defaultValue');
- done();
+ done();
});
- it('allows a falsey value to be used as the default value', function (done) {
+ it('allows a falsey value to be used as the default value', function (done) {
expect(Hoek.reach(obj, 'q', { default: '' })).to.equal('');
- done();
- });
+ done();
+ });
+});
+
+describe('reachTemplate()', function () {
+
+ it('applies object to template', function (done) {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1
+ }
+ }
+ },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ var template = '{k.0}:{k.-2}:{a.b.c.d}:{x.y}:{j}';
+
+ expect(Hoek.reachTemplate(obj, template)).to.equal('4:9:1::');
+ done();
+ });
+
+ it('applies object to template (options)', function (done) {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1
+ }
+ }
+ },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ var template = '{k/0}:{k/-2}:{a/b/c/d}:{x/y}:{j}';
+
+ expect(Hoek.reachTemplate(obj, template, '/')).to.equal('4:9:1::');
+ done();
+ });
});
-describe('callStack()', function () {
+describe('callStack()', function () {
- it('returns the full call stack', function (done) {
+ it('returns the full call stack', function (done) {
var stack = Hoek.callStack();
expect(stack[0][0]).to.contain('index.js');
expect(stack[0][2]).to.equal(26);
- done();
- });
+ done();
+ });
});
-describe('displayStack ()', function () {
+describe('displayStack ()', function () {
- it('returns the full call stack for display', function (done) {
+ it('returns the full call stack for display', function (done) {
var stack = Hoek.displayStack();
expect(stack[0]).to.contain(Path.normalize('/test/index.js') + ':');
- done();
+ done();
});
- it('includes constructor functions correctly', function (done) {
+ it('includes constructor functions correctly', function (done) {
- var Something = function (next) {
+ var Something = function (next) {
- next();
+ next();
};
- var something = new Something(function () {
+ var something = new Something(function () {
var stack = Hoek.displayStack();
expect(stack[1]).to.contain('new Something');
- done();
- });
- });
+ done();
+ });
+ });
});
-describe('abort()', function () {
+describe('abort()', function () {
- it('exits process when not in test mode', function (done) {
+ it('exits process when not in test mode', function (done) {
var env = process.env.NODE_ENV;
var write = process.stdout.write;
@@ -1537,38 +1648,38 @@ describe('abort()', function () {
process.env.NODE_ENV = 'nottatest';
process.stdout.write = function () { };
- process.exit = function (state) {
+ process.exit = function (state) {
process.exit = exit;
process.env.NODE_ENV = env;
process.stdout.write = write;
expect(state).to.equal(1);
- done();
+ done();
};
- Hoek.abort('Boom');
+ Hoek.abort('Boom');
});
- it('throws when not in test mode and abortThrow is true', function (done) {
+ it('throws when not in test mode and abortThrow is true', function (done) {
var env = process.env.NODE_ENV;
process.env.NODE_ENV = 'nottatest';
Hoek.abortThrow = true;
- var fn = function () {
+ var fn = function () {
- Hoek.abort('my error message');
+ Hoek.abort('my error message');
};
expect(fn).to.throw('my error message');
Hoek.abortThrow = false;
process.env.NODE_ENV = env;
- done();
+ done();
});
- it('respects hideStack argument', function (done) {
+ it('respects hideStack argument', function (done) {
var env = process.env.NODE_ENV;
var write = process.stdout.write;
@@ -1577,9 +1688,9 @@ describe('abort()', function () {
process.exit = function () { };
process.env.NODE_ENV = '';
- process.stdout.write = function (message) {
+ process.stdout.write = function (message) {
- output = message;
+ output = message;
};
Hoek.abort('my error message', true);
@@ -1590,38 +1701,38 @@ describe('abort()', function () {
expect(output).to.equal('ABORT: my error message\n\t\n');
- done();
+ done();
});
- it('throws in test mode', function (done) {
+ it('throws in test mode', function (done) {
var env = process.env.NODE_ENV;
process.env.NODE_ENV = 'test';
- expect(function () {
+ expect(function () {
- Hoek.abort('my error message', true);
+ Hoek.abort('my error message', true);
}).to.throw('my error message');
process.env.NODE_ENV = env;
- done();
+ done();
});
- it('throws in test mode with default message', function (done) {
+ it('throws in test mode with default message', function (done) {
var env = process.env.NODE_ENV;
process.env.NODE_ENV = 'test';
- expect(function () {
+ expect(function () {
- Hoek.abort('', true);
+ Hoek.abort('', true);
}).to.throw('Unknown error');
process.env.NODE_ENV = env;
- done();
+ done();
});
- it('defaults to showing stack', function (done) {
+ it('defaults to showing stack', function (done) {
var env = process.env.NODE_ENV;
var write = process.stdout.write;
@@ -1630,9 +1741,9 @@ describe('abort()', function () {
process.exit = function () { };
process.env.NODE_ENV = '';
- process.stdout.write = function (message) {
+ process.stdout.write = function (message) {
- output = message;
+ output = message;
};
Hoek.abort('my error message');
@@ -1643,172 +1754,173 @@ describe('abort()', function () {
expect(output).to.contain('index.js');
- done();
- });
+ done();
+ });
});
-describe('assert()', function () {
+describe('assert()', function () {
- it('throws an Error when using assert in a test', function (done) {
+ it('throws an Error when using assert in a test', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false, 'my error message');
+ Hoek.assert(false, 'my error message');
};
expect(fn).to.throw('my error message');
- done();
+ done();
});
- it('throws an Error when using assert in a test with no message', function (done) {
+ it('throws an Error when using assert in a test with no message', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false);
+ Hoek.assert(false);
};
expect(fn).to.throw('Unknown error');
- done();
+ done();
});
- it('throws an Error when using assert in a test with multipart message', function (done) {
+ it('throws an Error when using assert in a test with multipart message', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false, 'This', 'is', 'my message');
+ Hoek.assert(false, 'This', 'is', 'my message');
};
expect(fn).to.throw('This is my message');
- done();
+ done();
});
- it('throws an Error when using assert in a test with multipart message (empty)', function (done) {
+ it('throws an Error when using assert in a test with multipart message (empty)', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false, 'This', 'is', '', 'my message');
+ Hoek.assert(false, 'This', 'is', '', 'my message');
};
expect(fn).to.throw('This is my message');
- done();
+ done();
});
- it('throws an Error when using assert in a test with object message', function (done) {
+ it('throws an Error when using assert in a test with object message', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false, 'This', 'is', { spinal: 'tap' });
+ Hoek.assert(false, 'This', 'is', { spinal: 'tap' });
};
expect(fn).to.throw('This is {"spinal":"tap"}');
- done();
+ done();
});
- it('throws an Error when using assert in a test with multipart string and error messages', function (done) {
+ it('throws an Error when using assert in a test with multipart string and error messages', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false, 'This', 'is', new Error('spinal'), new Error('tap'));
+ Hoek.assert(false, 'This', 'is', new Error('spinal'), new Error('tap'));
};
expect(fn).to.throw('This is spinal tap');
- done();
+ done();
});
- it('throws an Error when using assert in a test with error object message', function (done) {
+ it('throws an Error when using assert in a test with error object message', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false, new Error('This is spinal tap'));
+ Hoek.assert(false, new Error('This is spinal tap'));
};
expect(fn).to.throw('This is spinal tap');
- done();
+ done();
});
- it('throws the same Error that is passed to it if there is only one error passed', function (done) {
+ it('throws the same Error that is passed to it if there is only one error passed', function (done) {
+
var error = new Error('ruh roh');
var error2 = new Error('ruh roh');
- var fn = function () {
+ var fn = function () {
- Hoek.assert(false, error);
+ Hoek.assert(false, error);
};
- try {
- fn();
- } catch (err) {
+ try {
+ fn();
+ } catch (err) {
expect(error).to.equal(error); // should be the same reference
expect(error).to.not.equal(error2); // error with the same message should not match
}
- done();
- });
+ done();
+ });
});
-describe('Timer', function () {
+describe('Timer', function () {
- it('returns time elapsed', function (done) {
+ it('returns time elapsed', function (done) {
var timer = new Hoek.Timer();
- setTimeout(function () {
+ setTimeout(function () {
expect(timer.elapsed()).to.be.above(9);
- done();
- }, 12);
- });
+ done();
+ }, 12);
+ });
});
-describe('Bench', function () {
+describe('Bench', function () {
- it('returns time elapsed', function (done) {
+ it('returns time elapsed', function (done) {
var timer = new Hoek.Bench();
- setTimeout(function () {
+ setTimeout(function () {
expect(timer.elapsed()).to.be.above(9);
- done();
- }, 12);
- });
+ done();
+ }, 12);
+ });
});
-describe('escapeRegex()', function () {
+describe('escapeRegex()', function () {
- it('escapes all special regular expression characters', function (done) {
+ it('escapes all special regular expression characters', function (done) {
var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,');
expect(a).to.equal('4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s\\,');
- done();
- });
+ done();
+ });
});
-describe('Base64Url', function () {
+describe('Base64Url', function () {
var base64str = 'AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w';
var str = unescape('%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF');
- describe('base64urlEncode()', function () {
+ describe('base64urlEncode()', function () {
- it('should base64 URL-safe a string', function (done) {
+ it('should base64 URL-safe a string', function (done) {
expect(Hoek.base64urlEncode(str)).to.equal(base64str);
- done();
+ done();
});
- it('encodes a buffer', function (done) {
+ it('encodes a buffer', function (done) {
expect(Hoek.base64urlEncode(new Buffer(str, 'binary'))).to.equal(base64str);
- done();
+ done();
});
- it('should base64 URL-safe a hex string', function (done) {
+ it('should base64 URL-safe a hex string', function (done) {
var buffer = new Buffer(str, 'binary');
expect(Hoek.base64urlEncode(buffer.toString('hex'), 'hex')).to.equal(base64str);
- done();
+ done();
});
- it('works on larger input strings', function (done) {
+ it('works on larger input strings', function (done) {
var input = Fs.readFileSync(Path.join(__dirname, 'index.js')).toString();
var encoded = Hoek.base64urlEncode(input);
@@ -1819,145 +1931,145 @@ describe('Base64Url', function () {
var decoded = Hoek.base64urlDecode(encoded);
expect(decoded).to.equal(input);
- done();
- });
+ done();
+ });
});
- describe('base64urlDecode()', function () {
+ describe('base64urlDecode()', function () {
- it('should un-base64 URL-safe a string', function (done) {
+ it('should un-base64 URL-safe a string', function (done) {
expect(Hoek.base64urlDecode(base64str)).to.equal(str);
- done();
+ done();
});
- it('should un-base64 URL-safe a string into hex', function (done) {
+ it('should un-base64 URL-safe a string into hex', function (done) {
expect(Hoek.base64urlDecode(base64str, 'hex')).to.equal(new Buffer(str, 'binary').toString('hex'));
- done();
+ done();
});
- it('should un-base64 URL-safe a string and return a buffer', function (done) {
+ it('should un-base64 URL-safe a string and return a buffer', function (done) {
var buf = Hoek.base64urlDecode(base64str, 'buffer');
expect(buf instanceof Buffer).to.equal(true);
expect(buf.toString('binary')).to.equal(str);
- done();
+ done();
});
- it('returns error on undefined input', function (done) {
+ it('returns error on undefined input', function (done) {
expect(Hoek.base64urlDecode().message).to.exist();
- done();
+ done();
});
- it('returns error on invalid input', function (done) {
+ it('returns error on invalid input', function (done) {
expect(Hoek.base64urlDecode('*').message).to.exist();
- done();
- });
- });
+ done();
+ });
+ });
});
-describe('escapeHeaderAttribute()', function () {
+describe('escapeHeaderAttribute()', function () {
- it('should not alter ascii values', function (done) {
+ it('should not alter ascii values', function (done) {
var a = Hoek.escapeHeaderAttribute('My Value');
expect(a).to.equal('My Value');
- done();
+ done();
});
- it('escapes all special HTTP header attribute characters', function (done) {
+ it('escapes all special HTTP header attribute characters', function (done) {
var a = Hoek.escapeHeaderAttribute('I said go!!!#"' + String.fromCharCode(92));
expect(a).to.equal('I said go!!!#\\"\\\\');
- done();
+ done();
});
- it('throws on large unicode characters', function (done) {
+ it('throws on large unicode characters', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.escapeHeaderAttribute('this is a test' + String.fromCharCode(500) + String.fromCharCode(300));
+ Hoek.escapeHeaderAttribute('this is a test' + String.fromCharCode(500) + String.fromCharCode(300));
};
expect(fn).to.throw(Error);
- done();
+ done();
});
- it('throws on CRLF to prevent response splitting', function (done) {
+ it('throws on CRLF to prevent response splitting', function (done) {
- var fn = function () {
+ var fn = function () {
- Hoek.escapeHeaderAttribute('this is a test\r\n');
+ Hoek.escapeHeaderAttribute('this is a test\r\n');
};
expect(fn).to.throw(Error);
- done();
- });
+ done();
+ });
});
-describe('escapeHtml()', function () {
+describe('escapeHtml()', function () {
- it('escapes all special HTML characters', function (done) {
+ it('escapes all special HTML characters', function (done) {
var a = Hoek.escapeHtml('&<>"\'`');
expect(a).to.equal('&<>"'`');
- done();
+ done();
});
- it('returns empty string on falsy input', function (done) {
+ it('returns empty string on falsy input', function (done) {
var a = Hoek.escapeHtml('');
expect(a).to.equal('');
- done();
+ done();
});
- it('returns unchanged string on no reserved input', function (done) {
+ it('returns unchanged string on no reserved input', function (done) {
var a = Hoek.escapeHtml('abc');
expect(a).to.equal('abc');
- done();
- });
+ done();
+ });
});
-describe('nextTick()', function () {
+describe('nextTick()', function () {
- it('calls the provided callback on nextTick', function (done) {
+ it('calls the provided callback on nextTick', function (done) {
var a = 0;
- var inc = function (step, next) {
+ var inc = function (step, next) {
a += step;
- next();
+ next();
};
var ticked = Hoek.nextTick(inc);
- ticked(5, function () {
+ ticked(5, function () {
expect(a).to.equal(6);
- done();
+ done();
});
expect(a).to.equal(0);
- inc(1, function () {
+ inc(1, function () {
- expect(a).to.equal(1);
- });
- });
+ expect(a).to.equal(1);
+ });
+ });
});
-describe('once()', function () {
+describe('once()', function () {
- it('allows function to only execute once', function (done) {
+ it('allows function to only execute once', function (done) {
var gen = 0;
- var add = function (x) {
+ var add = function (x) {
- gen += x;
+ gen += x;
};
add(5);
@@ -1967,23 +2079,23 @@ describe('once()', function () {
expect(gen).to.equal(10);
add(5);
expect(gen).to.equal(10);
- done();
+ done();
});
- it('double once wraps one time', function (done) {
+ it('double once wraps one time', function (done) {
var method = function () { };
method = Hoek.once(method);
method.x = 1;
method = Hoek.once(method);
expect(method.x).to.equal(1);
- done();
- });
+ done();
+ });
});
-describe('isAbsoltePath()', function () {
+describe('isAbsoltePath()', function () {
- it('identifies if path is absolute on Unix without node support', { parallel: false }, function (done) {
+ it('identifies if path is absolute on Unix without node support', { parallel: false }, function (done) {
var orig = Path.isAbsolute;
Path.isAbsolute = undefined;
@@ -1996,13 +2108,16 @@ describe('isAbsoltePath()', function () {
Path.isAbsolute = orig;
- done();
+ done();
});
- it('identifies if path is absolute with fake node support', { parallel: false }, function (done) {
+ it('identifies if path is absolute with fake node support', { parallel: false }, function (done) {
var orig = Path.isAbsolute;
- Path.isAbsolute = function (path) { return path[0] === '/'; };
+ Path.isAbsolute = function (path) {
+
+ return path[0] === '/';
+ };
expect(Hoek.isAbsolutePath('', 'linux')).to.equal(false);
expect(Hoek.isAbsolutePath('a', 'linux')).to.equal(false);
@@ -2012,10 +2127,10 @@ describe('isAbsoltePath()', function () {
Path.isAbsolute = orig;
- done();
+ done();
});
- it('identifies if path is absolute on Windows without node support', { parallel: false }, function (done) {
+ it('identifies if path is absolute on Windows without node support', { parallel: false }, function (done) {
var orig = Path.isAbsolute;
Path.isAbsolute = undefined;
@@ -2032,13 +2147,13 @@ describe('isAbsoltePath()', function () {
Path.isAbsolute = orig;
- done();
- });
+ done();
+ });
});
-describe('isInteger()', function () {
+describe('isInteger()', function () {
- it('validates integers', function (done) {
+ it('validates integers', function (done) {
expect(Hoek.isInteger(0)).to.equal(true);
expect(Hoek.isInteger(1)).to.equal(true);
@@ -2046,264 +2161,265 @@ describe('isInteger()', function () {
expect(Hoek.isInteger('0')).to.equal(false);
expect(Hoek.isInteger(1.0)).to.equal(true);
expect(Hoek.isInteger(1.1)).to.equal(false);
- done();
- });
+ done();
+ });
});
-describe('ignore()', function () {
+describe('ignore()', function () {
- it('exists', function (done) {
+ it('exists', function (done) {
expect(Hoek.ignore).to.exist();
expect(typeof Hoek.ignore).to.equal('function');
- done();
- });
+ done();
+ });
});
-describe('inherits()', function () {
+describe('inherits()', function () {
- it('exists', function (done) {
+ it('exists', function (done) {
expect(Hoek.inherits).to.exist();
expect(typeof Hoek.inherits).to.equal('function');
- done();
- });
+ done();
+ });
});
-describe('format()', function () {
+describe('format()', function () {
- it('exists', function (done) {
+ it('exists', function (done) {
expect(Hoek.format).to.exist();
expect(typeof Hoek.format).to.equal('function');
- done();
+ done();
});
- it('is a reference to Util.format', function (done) {
+ it('is a reference to Util.format', function (done) {
expect(Hoek.format('hello %s', 'world')).to.equal('hello world');
- done();
- });
+ done();
+ });
});
-describe('transform()', function () {
+describe('transform()', function () {
- var source = {
- address: {
+ var source = {
+ address: {
one: '123 main street',
- two: 'PO Box 1234'
+ two: 'PO Box 1234'
},
- zip: {
+ zip: {
code: 3321232,
- province: null
+ province: null
},
title: 'Warehouse',
- state: 'CA'
+ state: 'CA'
};
- it('transforms an object based on the input object', function (done) {
+ it('transforms an object based on the input object', function (done) {
- var result = Hoek.transform(source, {
+ var result = Hoek.transform(source, {
'person.address.lineOne': 'address.one',
'person.address.lineTwo': 'address.two',
'title': 'title',
'person.address.region': 'state',
'person.address.zip': 'zip.code',
- 'person.address.location': 'zip.province'
+ 'person.address.location': 'zip.province'
});
- expect(result).to.deep.equal({
- person: {
- address: {
+ expect(result).to.deep.equal({
+ person: {
+ address: {
lineOne: '123 main street',
lineTwo: 'PO Box 1234',
region: 'CA',
zip: 3321232,
- location: null
- }
+ location: null
+ }
},
- title: 'Warehouse'
+ title: 'Warehouse'
});
- done();
+ done();
});
- it('uses the reach options passed into it', function (done) {
+ it('uses the reach options passed into it', function (done) {
- var schema = {
+ var schema = {
'person.address.lineOne': 'address-one',
'person.address.lineTwo': 'address-two',
'title': 'title',
'person.address.region': 'state',
'person.prefix': 'person-title',
- 'person.zip': 'zip-code'
+ 'person.zip': 'zip-code'
};
- var options = {
+ var options = {
separator: '-',
- default: 'unknown'
+ default: 'unknown'
};
var result = Hoek.transform(source, schema, options);
- expect(result).to.deep.equal({
- person: {
- address: {
+ expect(result).to.deep.equal({
+ person: {
+ address: {
lineOne: '123 main street',
lineTwo: 'PO Box 1234',
- region: 'CA'
+ region: 'CA'
},
prefix: 'unknown',
- zip: 3321232
+ zip: 3321232
},
- title: 'Warehouse'
+ title: 'Warehouse'
});
- done();
+ done();
});
- it('works to create shallow objects', function (done) {
+ it('works to create shallow objects', function (done) {
- var result = Hoek.transform(source, {
+ var result = Hoek.transform(source, {
lineOne: 'address.one',
lineTwo: 'address.two',
title: 'title',
region: 'state',
- province: 'zip.province'
+ province: 'zip.province'
});
- expect(result).to.deep.equal({
+ expect(result).to.deep.equal({
lineOne: '123 main street',
lineTwo: 'PO Box 1234',
title: 'Warehouse',
region: 'CA',
- province: null
+ province: null
});
- done();
+ done();
});
- it('only allows strings in the map', function (done) {
+ it('only allows strings in the map', function (done) {
expect(function () {
+
var result = Hoek.transform(source, {
lineOne: {}
});
}).to.throw('All mappings must be "." delineated strings');
- done();
+ done();
});
- it('throws an error on invalid arguments', function (done) {
+ it('throws an error on invalid arguments', function (done) {
- expect(function () {
+ expect(function () {
- var result = Hoek.transform(NaN, {});
+ var result = Hoek.transform(NaN, {});
}).to.throw('Invalid source object: must be null, undefined, or an object');
- done();
+ done();
});
- it('is safe to pass null', function (done) {
+ it('is safe to pass null', function (done) {
var result = Hoek.transform(null, {});
expect(result).to.deep.equal({});
- done();
+ done();
});
- it('is safe to pass undefined', function (done) {
+ it('is safe to pass undefined', function (done) {
var result = Hoek.transform(undefined, {});
expect(result).to.deep.equal({});
- done();
- });
+ done();
+ });
});
-describe('uniqueFilename()', function () {
+describe('uniqueFilename()', function () {
- it('generates a random file path', function (done) {
+ it('generates a random file path', function (done) {
var result = Hoek.uniqueFilename('./test/modules');
expect(result).to.exist();
expect(result).to.be.a.string();
expect(result).to.contain('test/modules');
- done();
+ done();
});
- it('is random enough to use in fast loops', function (done) {
+ it('is random enough to use in fast loops', function (done) {
var results = [];
- for (var i = 0; i < 10; ++i) {
- results[i] = Hoek.uniqueFilename('./test/modules');
+ for (var i = 0; i < 10; ++i) {
+ results[i] = Hoek.uniqueFilename('./test/modules');
}
- var filter = results.filter(function (item, index, array) {
+ var filter = results.filter(function (item, index, array) {
- return array.indexOf(item) === index;
+ return array.indexOf(item) === index;
});
expect(filter.length).to.equal(10);
expect(results.length).to.equal(10);
- done();
+ done();
});
- it('combines the random elements with a supplied character', function (done) {
+ it('combines the random elements with a supplied character', function (done) {
var result = Hoek.uniqueFilename('./test', 'txt');
expect(result).to.contain('test/');
expect(result).to.contain('.txt');
- done();
+ done();
});
- it('accepts extensions with a "." in it', function (done) {
+ it('accepts extensions with a "." in it', function (done) {
var result = Hoek.uniqueFilename('./test', '.mp3');
expect(result).to.contain('test/');
expect(result).to.contain('.mp3');
- done();
- });
+ done();
+ });
});
-describe('stringify()', function (done) {
+describe('stringify()', function (done) {
- it('converts object to string', function (done) {
+ it('converts object to string', function (done) {
var obj = { a: 1 };
expect(Hoek.stringify(obj)).to.equal('{"a":1}');
- done();
+ done();
});
- it('returns error in result string', function (done) {
+ it('returns error in result string', function (done) {
var obj = { a: 1 };
obj.b = obj;
expect(Hoek.stringify(obj)).to.equal('[Cannot display object: Converting circular structure to JSON]');
- done();
- });
+ done();
+ });
});
-describe('shallow()', function (done) {
+describe('shallow()', function (done) {
- it('shallow copies an object', function (done) {
+ it('shallow copies an object', function (done) {
<TRUNCATED>
[37/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
deleted file mode 100755
index e91718b..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
+++ /dev/null
@@ -1,412 +0,0 @@
-// Load modules
-
-var Dgram = require('dgram');
-var Dns = require('dns');
-var Hoek = require('hoek');
-
-
-// Declare internals
-
-var internals = {};
-
-
-exports.time = function (options, callback) {
-
- if (arguments.length !== 2) {
- callback = arguments[0];
- options = {};
- }
-
- var settings = Hoek.clone(options);
- settings.host = settings.host || 'pool.ntp.org';
- settings.port = settings.port || 123;
- settings.resolveReference = settings.resolveReference || false;
-
- // Declare variables used by callback
-
- var timeoutId = 0;
- var sent = 0;
-
- // Ensure callback is only called once
-
- var finish = function (err, result) {
-
- if (timeoutId) {
- clearTimeout(timeoutId);
- timeoutId = 0;
- }
-
- socket.removeAllListeners();
- socket.once('error', internals.ignore);
- socket.close();
- return callback(err, result);
- };
-
- finish = Hoek.once(finish);
-
- // Create UDP socket
-
- var socket = Dgram.createSocket('udp4');
-
- socket.once('error', function (err) {
-
- return finish(err);
- });
-
- // Listen to incoming messages
-
- socket.on('message', function (buffer, rinfo) {
-
- var received = Date.now();
-
- var message = new internals.NtpMessage(buffer);
- if (!message.isValid) {
- return finish(new Error('Invalid server response'), message);
- }
-
- if (message.originateTimestamp !== sent) {
- return finish(new Error('Wrong originate timestamp'), message);
- }
-
- // Timestamp Name ID When Generated
- // ------------------------------------------------------------
- // Originate Timestamp T1 time request sent by client
- // Receive Timestamp T2 time request received by server
- // Transmit Timestamp T3 time reply sent by server
- // Destination Timestamp T4 time reply received by client
- //
- // The roundtrip delay d and system clock offset t are defined as:
- //
- // d = (T4 - T1) - (T3 - T2) t = ((T2 - T1) + (T3 - T4)) / 2
-
- var T1 = message.originateTimestamp;
- var T2 = message.receiveTimestamp;
- var T3 = message.transmitTimestamp;
- var T4 = received;
-
- message.d = (T4 - T1) - (T3 - T2);
- message.t = ((T2 - T1) + (T3 - T4)) / 2;
- message.receivedLocally = received;
-
- if (!settings.resolveReference ||
- message.stratum !== 'secondary') {
-
- return finish(null, message);
- }
-
- // Resolve reference IP address
-
- Dns.reverse(message.referenceId, function (err, domains) {
-
- if (/* $lab:coverage:off$ */ !err /* $lab:coverage:on$ */) {
- message.referenceHost = domains[0];
- }
-
- return finish(null, message);
- });
- });
-
- // Set timeout
-
- if (settings.timeout) {
- timeoutId = setTimeout(function () {
-
- timeoutId = 0;
- return finish(new Error('Timeout'));
- }, settings.timeout);
- }
-
- // Construct NTP message
-
- var message = new Buffer(48);
- for (var i = 0; i < 48; i++) { // Zero message
- message[i] = 0;
- }
-
- message[0] = (0 << 6) + (4 << 3) + (3 << 0) // Set version number to 4 and Mode to 3 (client)
- sent = Date.now();
- internals.fromMsecs(sent, message, 40); // Set transmit timestamp (returns as originate)
-
- // Send NTP request
-
- socket.send(message, 0, message.length, settings.port, settings.host, function (err, bytes) {
-
- if (err ||
- bytes !== 48) {
-
- return finish(err || new Error('Could not send entire message'));
- }
- });
-};
-
-
-internals.NtpMessage = function (buffer) {
-
- this.isValid = false;
-
- // Validate
-
- if (buffer.length !== 48) {
- return;
- }
-
- // Leap indicator
-
- var li = (buffer[0] >> 6);
- switch (li) {
- case 0: this.leapIndicator = 'no-warning'; break;
- case 1: this.leapIndicator = 'last-minute-61'; break;
- case 2: this.leapIndicator = 'last-minute-59'; break;
- case 3: this.leapIndicator = 'alarm'; break;
- }
-
- // Version
-
- var vn = ((buffer[0] & 0x38) >> 3);
- this.version = vn;
-
- // Mode
-
- var mode = (buffer[0] & 0x7);
- switch (mode) {
- case 1: this.mode = 'symmetric-active'; break;
- case 2: this.mode = 'symmetric-passive'; break;
- case 3: this.mode = 'client'; break;
- case 4: this.mode = 'server'; break;
- case 5: this.mode = 'broadcast'; break;
- case 0:
- case 6:
- case 7: this.mode = 'reserved'; break;
- }
-
- // Stratum
-
- var stratum = buffer[1];
- if (stratum === 0) {
- this.stratum = 'death';
- }
- else if (stratum === 1) {
- this.stratum = 'primary';
- }
- else if (stratum <= 15) {
- this.stratum = 'secondary';
- }
- else {
- this.stratum = 'reserved';
- }
-
- // Poll interval (msec)
-
- this.pollInterval = Math.round(Math.pow(2, buffer[2])) * 1000;
-
- // Precision (msecs)
-
- this.precision = Math.pow(2, buffer[3]) * 1000;
-
- // Root delay (msecs)
-
- var rootDelay = 256 * (256 * (256 * buffer[4] + buffer[5]) + buffer[6]) + buffer[7];
- this.rootDelay = 1000 * (rootDelay / 0x10000);
-
- // Root dispersion (msecs)
-
- this.rootDispersion = ((buffer[8] << 8) + buffer[9] + ((buffer[10] << 8) + buffer[11]) / Math.pow(2, 16)) * 1000;
-
- // Reference identifier
-
- this.referenceId = '';
- switch (this.stratum) {
- case 'death':
- case 'primary':
- this.referenceId = String.fromCharCode(buffer[12]) + String.fromCharCode(buffer[13]) + String.fromCharCode(buffer[14]) + String.fromCharCode(buffer[15]);
- break;
- case 'secondary':
- this.referenceId = '' + buffer[12] + '.' + buffer[13] + '.' + buffer[14] + '.' + buffer[15];
- break;
- }
-
- // Reference timestamp
-
- this.referenceTimestamp = internals.toMsecs(buffer, 16);
-
- // Originate timestamp
-
- this.originateTimestamp = internals.toMsecs(buffer, 24);
-
- // Receive timestamp
-
- this.receiveTimestamp = internals.toMsecs(buffer, 32);
-
- // Transmit timestamp
-
- this.transmitTimestamp = internals.toMsecs(buffer, 40);
-
- // Validate
-
- if (this.version === 4 &&
- this.stratum !== 'reserved' &&
- this.mode === 'server' &&
- this.originateTimestamp &&
- this.receiveTimestamp &&
- this.transmitTimestamp) {
-
- this.isValid = true;
- }
-
- return this;
-};
-
-
-internals.toMsecs = function (buffer, offset) {
-
- var seconds = 0;
- var fraction = 0;
-
- for (var i = 0; i < 4; ++i) {
- seconds = (seconds * 256) + buffer[offset + i];
- }
-
- for (i = 4; i < 8; ++i) {
- fraction = (fraction * 256) + buffer[offset + i];
- }
-
- return ((seconds - 2208988800 + (fraction / Math.pow(2, 32))) * 1000);
-};
-
-
-internals.fromMsecs = function (ts, buffer, offset) {
-
- var seconds = Math.floor(ts / 1000) + 2208988800;
- var fraction = Math.round((ts % 1000) / 1000 * Math.pow(2, 32));
-
- buffer[offset + 0] = (seconds & 0xFF000000) >> 24;
- buffer[offset + 1] = (seconds & 0x00FF0000) >> 16;
- buffer[offset + 2] = (seconds & 0x0000FF00) >> 8;
- buffer[offset + 3] = (seconds & 0x000000FF);
-
- buffer[offset + 4] = (fraction & 0xFF000000) >> 24;
- buffer[offset + 5] = (fraction & 0x00FF0000) >> 16;
- buffer[offset + 6] = (fraction & 0x0000FF00) >> 8;
- buffer[offset + 7] = (fraction & 0x000000FF);
-};
-
-
-// Offset singleton
-
-internals.last = {
- offset: 0,
- expires: 0,
- host: '',
- port: 0
-};
-
-
-exports.offset = function (options, callback) {
-
- if (arguments.length !== 2) {
- callback = arguments[0];
- options = {};
- }
-
- var now = Date.now();
- var clockSyncRefresh = options.clockSyncRefresh || 24 * 60 * 60 * 1000; // Daily
-
- if (internals.last.offset &&
- internals.last.host === options.host &&
- internals.last.port === options.port &&
- now < internals.last.expires) {
-
- process.nextTick(function () {
-
- callback(null, internals.last.offset);
- });
-
- return;
- }
-
- exports.time(options, function (err, time) {
-
- if (err) {
- return callback(err, 0);
- }
-
- internals.last = {
- offset: Math.round(time.t),
- expires: now + clockSyncRefresh,
- host: options.host,
- port: options.port
- };
-
- return callback(null, internals.last.offset);
- });
-};
-
-
-// Now singleton
-
-internals.now = {
- intervalId: 0
-};
-
-
-exports.start = function (options, callback) {
-
- if (arguments.length !== 2) {
- callback = arguments[0];
- options = {};
- }
-
- if (internals.now.intervalId) {
- process.nextTick(function () {
-
- callback();
- });
-
- return;
- }
-
- exports.offset(options, function (err, offset) {
-
- internals.now.intervalId = setInterval(function () {
-
- exports.offset(options, function () { });
- }, options.clockSyncRefresh || 24 * 60 * 60 * 1000); // Daily
-
- return callback();
- });
-};
-
-
-exports.stop = function () {
-
- if (!internals.now.intervalId) {
- return;
- }
-
- clearInterval(internals.now.intervalId);
- internals.now.intervalId = 0;
-};
-
-
-exports.isLive = function () {
-
- return !!internals.now.intervalId;
-};
-
-
-exports.now = function () {
-
- var now = Date.now();
- if (!exports.isLive() ||
- now >= internals.last.expires) {
-
- return now;
- }
-
- return now + internals.last.offset;
-};
-
-
-internals.ignore = function () {
-
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/package.json b/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
deleted file mode 100755
index 45356c8..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "name": "sntp",
- "description": "SNTP Client",
- "version": "1.0.9",
- "author": {
- "name": "Eran Hammer",
- "email": "eran@hammer.io",
- "url": "http://hueniverse.com"
- },
- "contributors": [],
- "repository": {
- "type": "git",
- "url": "git://github.com/hueniverse/sntp"
- },
- "main": "index",
- "keywords": [
- "sntp",
- "ntp",
- "time"
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "dependencies": {
- "hoek": "2.x.x"
- },
- "devDependencies": {
- "lab": "4.x.x"
- },
- "scripts": {
- "test": "make test-cov"
- },
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/hueniverse/sntp/raw/master/LICENSE"
- }
- ],
- "gitHead": "ee2e35284f684609990681734d39010cd356d7da",
- "bugs": {
- "url": "https://github.com/hueniverse/sntp/issues"
- },
- "homepage": "https://github.com/hueniverse/sntp",
- "_id": "sntp@1.0.9",
- "_shasum": "6541184cc90aeea6c6e7b35e2659082443c66198",
- "_from": "sntp@>=1.0.0 <2.0.0",
- "_npmVersion": "1.4.23",
- "_npmUser": {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- },
- "maintainers": [
- {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- }
- ],
- "dist": {
- "shasum": "6541184cc90aeea6c6e7b35e2659082443c66198",
- "tarball": "http://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js b/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js
deleted file mode 100755
index f1d1cda..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js
+++ /dev/null
@@ -1,435 +0,0 @@
-// Load modules
-
-var Dns = require('dns');
-var Dgram = require('dgram');
-var Lab = require('lab');
-var Sntp = require('../lib');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var before = lab.before;
-var after = lab.after;
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Lab.expect;
-
-
-describe('SNTP', function () {
-
- describe('#time', function () {
-
- it('returns consistent result over multiple tries', function (done) {
-
- Sntp.time(function (err, time) {
-
- expect(err).to.not.exist;
- expect(time).to.exist;
- var t1 = time.t;
-
- Sntp.time(function (err, time) {
-
- expect(err).to.not.exist;
- expect(time).to.exist;
- var t2 = time.t;
- expect(Math.abs(t1 - t2)).is.below(200);
- done();
- });
- });
- });
-
- it('resolves reference IP', function (done) {
-
- Sntp.time({ host: 'ntp.exnet.com', resolveReference: true }, function (err, time) {
-
- expect(err).to.not.exist;
- expect(time).to.exist;
- expect(time.referenceHost).to.exist;
- done();
- });
- });
-
- it('times out on no response', function (done) {
-
- Sntp.time({ port: 124, timeout: 100 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time).to.not.exist;
- expect(err.message).to.equal('Timeout');
- done();
- });
- });
-
- it('errors on error event', { parallel: false }, function (done) {
-
- var orig = Dgram.createSocket;
- Dgram.createSocket = function (type) {
-
- Dgram.createSocket = orig;
- var socket = Dgram.createSocket(type);
- setImmediate(function () { socket.emit('error', new Error('Fake')) });
- return socket;
- };
-
- Sntp.time(function (err, time) {
-
- expect(err).to.exist;
- expect(time).to.not.exist;
- expect(err.message).to.equal('Fake');
- done();
- });
- });
-
- it('errors on incorrect sent size', { parallel: false }, function (done) {
-
- var orig = Dgram.Socket.prototype.send;
- Dgram.Socket.prototype.send = function (buf, offset, length, port, address, callback) {
-
- Dgram.Socket.prototype.send = orig;
- return callback(null, 40);
- };
-
- Sntp.time(function (err, time) {
-
- expect(err).to.exist;
- expect(time).to.not.exist;
- expect(err.message).to.equal('Could not send entire message');
- done();
- });
- });
-
- it('times out on invalid host', function (done) {
-
- Sntp.time({ host: 'error', timeout: 10000 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time).to.not.exist;
- expect(err.message).to.contain('getaddrinfo');
- done();
- });
- });
-
- it('fails on bad response buffer size', function (done) {
-
- var server = Dgram.createSocket('udp4');
- server.on('message', function (message, remote) {
- var message = new Buffer(10);
- server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
-
- server.close();
- });
- });
-
- server.bind(49123);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(err.message).to.equal('Invalid server response');
- done();
- });
- });
-
- var messup = function (bytes) {
-
- var server = Dgram.createSocket('udp4');
- server.on('message', function (message, remote) {
-
- var message = new Buffer([
- 0x24, 0x01, 0x00, 0xe3,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x41, 0x43, 0x54, 0x53,
- 0xd4, 0xa8, 0x2d, 0xc7,
- 0x1c, 0x5d, 0x49, 0x1b,
- 0xd4, 0xa8, 0x2d, 0xe6,
- 0x67, 0xef, 0x9d, 0xb2,
- 0xd4, 0xa8, 0x2d, 0xe6,
- 0x71, 0xed, 0xb5, 0xfb,
- 0xd4, 0xa8, 0x2d, 0xe6,
- 0x71, 0xee, 0x6c, 0xc5
- ]);
-
- for (var i = 0, il = bytes.length; i < il; ++i) {
- message[bytes[i][0]] = bytes[i][1];
- }
-
- server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
-
- server.close();
- });
- });
-
- server.bind(49123);
- };
-
- it('fails on bad version', function (done) {
-
- messup([[0, (0 << 6) + (3 << 3) + (4 << 0)]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time.version).to.equal(3);
- expect(err.message).to.equal('Invalid server response');
- done();
- });
- });
-
- it('fails on bad originateTimestamp', function (done) {
-
- messup([[24, 0x83], [25, 0xaa], [26, 0x7e], [27, 0x80], [28, 0], [29, 0], [30, 0], [31, 0]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(err.message).to.equal('Invalid server response');
- done();
- });
- });
-
- it('fails on bad receiveTimestamp', function (done) {
-
- messup([[32, 0x83], [33, 0xaa], [34, 0x7e], [35, 0x80], [36, 0], [37, 0], [38, 0], [39, 0]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(err.message).to.equal('Invalid server response');
- done();
- });
- });
-
- it('fails on bad originate timestamp and alarm li', function (done) {
-
- messup([[0, (3 << 6) + (4 << 3) + (4 << 0)]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(err.message).to.equal('Wrong originate timestamp');
- expect(time.leapIndicator).to.equal('alarm');
- done();
- });
- });
-
- it('returns time with death stratum and last61 li', function (done) {
-
- messup([[0, (1 << 6) + (4 << 3) + (4 << 0)], [1, 0]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(time.stratum).to.equal('death');
- expect(time.leapIndicator).to.equal('last-minute-61');
- done();
- });
- });
-
- it('returns time with reserved stratum and last59 li', function (done) {
-
- messup([[0, (2 << 6) + (4 << 3) + (4 << 0)], [1, 0x1f]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(time.stratum).to.equal('reserved');
- expect(time.leapIndicator).to.equal('last-minute-59');
- done();
- });
- });
-
- it('fails on bad mode (symmetric-active)', function (done) {
-
- messup([[0, (0 << 6) + (4 << 3) + (1 << 0)]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time.mode).to.equal('symmetric-active');
- done();
- });
- });
-
- it('fails on bad mode (symmetric-passive)', function (done) {
-
- messup([[0, (0 << 6) + (4 << 3) + (2 << 0)]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time.mode).to.equal('symmetric-passive');
- done();
- });
- });
-
- it('fails on bad mode (client)', function (done) {
-
- messup([[0, (0 << 6) + (4 << 3) + (3 << 0)]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time.mode).to.equal('client');
- done();
- });
- });
-
- it('fails on bad mode (broadcast)', function (done) {
-
- messup([[0, (0 << 6) + (4 << 3) + (5 << 0)]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time.mode).to.equal('broadcast');
- done();
- });
- });
-
- it('fails on bad mode (reserved)', function (done) {
-
- messup([[0, (0 << 6) + (4 << 3) + (6 << 0)]]);
-
- Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
-
- expect(err).to.exist;
- expect(time.mode).to.equal('reserved');
- done();
- });
- });
- });
-
- describe('#offset', function () {
-
- it('gets the current offset', function (done) {
-
- Sntp.offset(function (err, offset) {
-
- expect(err).to.not.exist;
- expect(offset).to.not.equal(0);
- done();
- });
- });
-
- it('gets the current offset from cache', function (done) {
-
- Sntp.offset(function (err, offset) {
-
- expect(err).to.not.exist;
- expect(offset).to.not.equal(0);
- var offset1 = offset;
- Sntp.offset({}, function (err, offset) {
-
- expect(err).to.not.exist;
- expect(offset).to.equal(offset1);
- done();
- });
- });
- });
-
- it('gets the new offset on different server', function (done) {
-
- Sntp.offset(function (err, offset) {
-
- expect(err).to.not.exist;
- expect(offset).to.not.equal(0);
- var offset1 = offset;
- Sntp.offset({ host: 'nist1-sj.ustiming.org' }, function (err, offset) {
-
- expect(err).to.not.exist;
- expect(offset).to.not.equal(offset1);
- done();
- });
- });
- });
-
- it('gets the new offset on different server', function (done) {
-
- Sntp.offset(function (err, offset) {
-
- expect(err).to.not.exist;
- expect(offset).to.not.equal(0);
- var offset1 = offset;
- Sntp.offset({ port: 123 }, function (err, offset) {
-
- expect(err).to.not.exist;
- expect(offset).to.not.equal(offset1);
- done();
- });
- });
- });
-
- it('fails getting the current offset on invalid server', function (done) {
-
- Sntp.offset({ host: 'error' }, function (err, offset) {
-
- expect(err).to.exist;
- expect(offset).to.equal(0);
- done();
- });
- });
- });
-
- describe('#now', function () {
-
- it('starts auto-sync, gets now, then stops', function (done) {
-
- Sntp.stop();
-
- var before = Sntp.now();
- expect(before).to.equal(Date.now());
-
- Sntp.start(function () {
-
- var now = Sntp.now();
- expect(now).to.not.equal(Date.now());
- Sntp.stop();
-
- done();
- });
- });
-
- it('starts twice', function (done) {
-
- Sntp.start(function () {
-
- Sntp.start(function () {
-
- var now = Sntp.now();
- expect(now).to.not.equal(Date.now());
- Sntp.stop();
-
- done();
- });
- });
- });
-
- it('starts auto-sync, gets now, waits, gets again after timeout', function (done) {
-
- Sntp.stop();
-
- var before = Sntp.now();
- expect(before).to.equal(Date.now());
-
- Sntp.start({ clockSyncRefresh: 100 }, function () {
-
- var now = Sntp.now();
- expect(now).to.not.equal(Date.now());
- expect(now).to.equal(Sntp.now());
-
- setTimeout(function () {
-
- expect(Sntp.now()).to.not.equal(now);
- Sntp.stop();
- done();
- }, 110);
- });
- });
- });
-});
-
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/package.json b/node_modules/request/node_modules/hawk/package.json
deleted file mode 100755
index 4fe0064..0000000
--- a/node_modules/request/node_modules/hawk/package.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "name": "hawk",
- "description": "HTTP Hawk Authentication Scheme",
- "version": "2.3.1",
- "author": {
- "name": "Eran Hammer",
- "email": "eran@hammer.io",
- "url": "http://hueniverse.com"
- },
- "contributors": [],
- "repository": {
- "type": "git",
- "url": "git://github.com/hueniverse/hawk"
- },
- "main": "index",
- "keywords": [
- "http",
- "authentication",
- "scheme",
- "hawk"
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "browser": "./lib/browser.js",
- "dependencies": {
- "hoek": "2.x.x",
- "boom": "2.x.x",
- "cryptiles": "2.x.x",
- "sntp": "1.x.x"
- },
- "devDependencies": {
- "code": "1.x.x",
- "lab": "5.x.x"
- },
- "scripts": {
- "test": "make test-cov"
- },
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/hueniverse/hawk/raw/master/LICENSE"
- }
- ],
- "gitHead": "492632da51ecedd5f59ce96f081860ad24ce6532",
- "bugs": {
- "url": "https://github.com/hueniverse/hawk/issues"
- },
- "homepage": "https://github.com/hueniverse/hawk",
- "_id": "hawk@2.3.1",
- "_shasum": "1e731ce39447fa1d0f6d707f7bceebec0fd1ec1f",
- "_from": "hawk@>=2.3.0 <2.4.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- },
- "maintainers": [
- {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- }
- ],
- "dist": {
- "shasum": "1e731ce39447fa1d0f6d707f7bceebec0fd1ec1f",
- "tarball": "http://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/hawk/-/hawk-2.3.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/test/browser.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/test/browser.js b/node_modules/request/node_modules/hawk/test/browser.js
deleted file mode 100755
index a452413..0000000
--- a/node_modules/request/node_modules/hawk/test/browser.js
+++ /dev/null
@@ -1,1453 +0,0 @@
-// Load modules
-
-var Url = require('url');
-var Code = require('code');
-var Hawk = require('../lib');
-var Hoek = require('hoek');
-var Lab = require('lab');
-var Browser = require('../lib/browser');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('Browser', function () {
-
- var credentialsFunc = function (id, callback) {
-
- var credentials = {
- id: id,
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: (id === '1' ? 'sha1' : 'sha256'),
- user: 'steve'
- };
-
- return callback(null, credentials);
- };
-
- it('should generate a bewit then successfully authenticate it', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?a=1&b=2',
- host: 'example.com',
- port: 80
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- var bewit = Browser.client.bewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100, ext: 'some-app-data' });
- req.url += '&bewit=' + bewit;
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(attributes.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('should generate a bewit then successfully authenticate it (no ext)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?a=1&b=2',
- host: 'example.com',
- port: 80
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- var bewit = Browser.client.bewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100 });
- req.url += '&bewit=' + bewit;
-
- Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
- });
-
- describe('#bewit', function () {
-
- it('returns a valid bewit value', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdca3NjeHdOUjJ0SnBQMVQxekRMTlBiQjVVaUtJVTl0T1NKWFRVZEc3WDloOD1ceGFuZHlhbmR6');
- done();
- });
-
- it('returns a valid bewit value (explicit HTTP port)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('http://example.com:8080/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcaFpiSjNQMmNLRW80a3kwQzhqa1pBa1J5Q1p1ZWc0V1NOYnhWN3ZxM3hIVT1ceGFuZHlhbmR6');
- done();
- });
-
- it('returns a valid bewit value (explicit HTTPS port)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('https://example.com:8043/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcL2t4UjhwK0xSaTdvQTRnUXc3cWlxa3BiVHRKYkR4OEtRMC9HRUwvVytTUT1ceGFuZHlhbmR6');
- done();
- });
-
- it('returns a valid bewit value (null ext)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: null });
- expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcSUdZbUxnSXFMckNlOEN4dktQczRKbFdJQStValdKSm91d2dBUmlWaENBZz1c');
- done();
- });
-
- it('errors on invalid options', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', 4);
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on missing uri', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid uri', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit(5, { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid credentials (id)', function (done) {
-
- var credentials = {
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on missing credentials', function (done) {
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { ttlSec: 3000, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid credentials (key)', function (done) {
-
- var credentials = {
- id: '123456',
- algorithm: 'sha256'
- };
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on invalid algorithm', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'hmac-sha-0'
- };
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, ext: 'xandyandz' });
- expect(bewit).to.equal('');
- done();
- });
-
- it('errors on missing options', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'hmac-sha-0'
- };
-
- var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow');
- expect(bewit).to.equal('');
- done();
- });
- });
-
- it('generates a header then successfully parse it (configuration)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
- expect(req.authorization).to.exist();
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (node request)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (browserify)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- },
- getHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (time offset)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', localtimeOffsetMsec: 100000 }).field;
- expect(req.authorization).to.exist();
-
- Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 100000 }, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (no server header options)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (no server header)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
- done();
- });
- });
- });
-
- it('generates a header with stale ts and successfully authenticate on second call', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- Browser.utils.setNtpOffset(60 * 60 * 1000);
- var header = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' });
- req.authorization = header.field;
- expect(req.authorization).to.exist();
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Stale timestamp');
-
- var res = {
- headers: {
- 'www-authenticate': err.output.headers['WWW-Authenticate']
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- expect(Browser.utils.getNtpOffset()).to.equal(60 * 60 * 1000);
- expect(Browser.client.authenticate(res, credentials, header.artifacts)).to.equal(true);
- expect(Browser.utils.getNtpOffset()).to.equal(0);
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
- expect(req.authorization).to.exist();
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
- });
-
- it('generates a header with stale ts and successfully authenticate on second call (manual localStorage)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- var localStorage = new Browser.internals.LocalStorage();
-
- Browser.utils.setStorage(localStorage)
-
- Browser.utils.setNtpOffset(60 * 60 * 1000);
- var header = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' });
- req.authorization = header.field;
- expect(req.authorization).to.exist();
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.message).to.equal('Stale timestamp');
-
- var res = {
- headers: {
- 'www-authenticate': err.output.headers['WWW-Authenticate']
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- expect(parseInt(localStorage.getItem('hawk_ntp_offset'))).to.equal(60 * 60 * 1000);
- expect(Browser.utils.getNtpOffset()).to.equal(60 * 60 * 1000);
- expect(Browser.client.authenticate(res, credentials, header.artifacts)).to.equal(true);
- expect(Browser.utils.getNtpOffset()).to.equal(0);
- expect(parseInt(localStorage.getItem('hawk_ntp_offset'))).to.equal(0);
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
- expect(req.authorization).to.exist();
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
- });
-
- it('generates a header then fails to parse it (missing server header hash)', function (done) {
-
- var req = {
- method: 'POST',
- url: '/resource/4?filter=a',
- headers: {
- host: 'example.com:8080',
- 'content-type': 'text/plain;x=y'
- }
- };
-
- var payload = 'some not so random text';
-
- credentialsFunc('123456', function (err, credentials) {
-
- var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
- req.headers.authorization = reqHeader.field;
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
-
- var res = {
- headers: {
- 'content-type': 'text/plain'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
- expect(res.headers['server-authorization']).to.exist();
-
- expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(false);
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (with hash)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it then validate payload', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(Hawk.server.authenticatePayload('hola!', credentials, artifacts)).to.be.true();
- expect(Hawk.server.authenticatePayload('hello!', credentials, artifacts)).to.be.false();
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (app)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(artifacts.app).to.equal('asd23ased');
- done();
- });
- });
- });
-
- it('generates a header then successfully parse it (app, dlg)', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased', dlg: '23434szr3q4d' }).field;
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- expect(artifacts.ext).to.equal('some-app-data');
- expect(artifacts.app).to.equal('asd23ased');
- expect(artifacts.dlg).to.equal('23434szr3q4d');
- done();
- });
- });
- });
-
- it('generates a header then fail authentication due to bad hash', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
- Hawk.server.authenticate(req, credentialsFunc, { payload: 'byebye!' }, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(err.output.payload.message).to.equal('Bad payload hash');
- done();
- });
- });
- });
-
- it('generates a header for one resource then fail to authenticate another', function (done) {
-
- var req = {
- method: 'GET',
- url: '/resource/4?filter=a',
- host: 'example.com',
- port: 8080
- };
-
- credentialsFunc('123456', function (err, credentials) {
-
- req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
- req.url = '/something/else';
-
- Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
-
- expect(err).to.exist();
- expect(credentials).to.exist();
- done();
- });
- });
- });
-
- describe('client', function () {
-
- describe('#header', function () {
-
- it('returns a valid authorization header (sha1)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var header = Browser.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
- done();
- });
-
- it('returns a valid authorization header (sha256)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
- done();
- });
-
- it('returns a valid authorization header (empty payload)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha1'
- };
-
- var header = Browser.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: '' }).field;
- expect(header).to.equal('Hawk id=\"123456\", ts=\"1353809207\", nonce=\"Ygvqdz\", hash=\"404ghL7K+hfyhByKKejFBRGgTjU=\", ext=\"Bazinga!\", mac=\"Bh1sj1DOfFRWOdi3ww52nLCJdBE=\"');
- done();
- });
-
- it('returns a valid authorization header (no ext)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
- done();
- });
-
- it('returns a valid authorization header (null ext)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain', ext: null }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
- done();
- });
-
- it('returns a valid authorization header (uri object)', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var uri = Browser.utils.parseUri('https://example.net/somewhere/over/the/rainbow');
- var header = Browser.client.header(uri, 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
- done();
- });
-
- it('errors on missing options', function (done) {
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST');
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on empty uri', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on invalid uri', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header(4, 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on missing method', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', '', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on invalid method', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 5, { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid argument type');
- done();
- });
-
- it('errors on missing credentials', function (done) {
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid credentials object');
- done();
- });
-
- it('errors on invalid credentials (id)', function (done) {
-
- var credentials = {
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid credentials object');
- done();
- });
-
- it('errors on invalid credentials (key)', function (done) {
-
- var credentials = {
- id: '123456',
- algorithm: 'sha256'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Invalid credentials object');
- done();
- });
-
- it('errors on invalid algorithm', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'hmac-sha-0'
- };
-
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 });
- expect(header.field).to.equal('');
- expect(header.err).to.equal('Unknown algorithm');
- done();
- });
-
- it('uses a pre-calculated payload hash', function (done) {
-
- var credentials = {
- id: '123456',
- key: '2983d45yun89q',
- algorithm: 'sha256'
- };
-
- var options = { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' };
- options.hash = Browser.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
- var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', options).field;
- expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
- done();
- });
- });
-
- describe('#authenticate', function () {
-
- it('skips tsm validation when missing ts', function (done) {
-
- var res = {
- headers: {
- 'www-authenticate': 'Hawk error="Stale timestamp"'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var artifacts = {
- ts: 1402135580,
- nonce: 'iBRB6t',
- method: 'GET',
- resource: '/resource/4?filter=a',
- host: 'example.com',
- port: '8080',
- ext: 'some-app-data'
- };
-
- expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
- done();
- });
-
- it('returns false on invalid header', function (done) {
-
- var res = {
- headers: {
- 'server-authorization': 'Hawk mac="abc", bad="xyz"'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- expect(Browser.client.authenticate(res, {})).to.equal(false);
- done();
- });
-
- it('returns false on invalid mac', function (done) {
-
- var res = {
- headers: {
- 'content-type': 'text/plain',
- 'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1362336900',
- nonce: 'eb5S_L',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- app: undefined,
- dlg: undefined,
- mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
- id: '123456'
- };
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(false);
- done();
- });
-
- it('returns true on ignoring hash', function (done) {
-
- var res = {
- headers: {
- 'content-type': 'text/plain',
- 'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- var artifacts = {
- method: 'POST',
- host: 'example.com',
- port: '8080',
- resource: '/resource/4?filter=a',
- ts: '1362336900',
- nonce: 'eb5S_L',
- hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
- ext: 'some-app-data',
- app: undefined,
- dlg: undefined,
- mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
- id: '123456'
- };
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
- done();
- });
-
- it('errors on invalid WWW-Authenticate header format', function (done) {
-
- var res = {
- headers: {
- 'www-authenticate': 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- expect(Browser.client.authenticate(res, {})).to.equal(false);
- done();
- });
-
- it('errors on invalid WWW-Authenticate header format', function (done) {
-
- var credentials = {
- id: '123456',
- key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
- algorithm: 'sha256',
- user: 'steve'
- };
-
- var res = {
- headers: {
- 'www-authenticate': 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"'
- },
- getResponseHeader: function (header) {
-
- return res.headers[header.toLowerCase()];
- }
- };
-
- expect(Browser.client.authenticate(res, credentials)).to.equal(false);
- done();
- });
- });
-
- describe('#message', function () {
-
- it('generates an authorization then successfully parse it', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: credentials });
- expect(auth).to.exist();
-
- Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
-
- expect(err).to.not.exist();
- expect(credentials.user).to.equal('steve');
- done();
- });
- });
- });
-
- it('generates an authorization using custom nonce/timestamp', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: credentials, nonce: 'abc123', timestamp: 1398536270957 });
- expect(auth).to.exist();
- expect(auth.nonce).to.equal('abc123');
- expect(auth.ts).to.equal(1398536270957);
- done();
- });
- });
-
- it('errors on missing host', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message(null, 8080, 'some message', { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on invalid host', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message(5, 8080, 'some message', { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on missing port', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message('example.com', 0, 'some message', { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on invalid port', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message('example.com', 'a', 'some message', { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on missing message', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message('example.com', 8080, undefined, { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on null message', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message('example.com', 8080, null, { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on invalid message', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var auth = Browser.client.message('example.com', 8080, 5, { credentials: credentials });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on missing credentials', function (done) {
-
- var auth = Browser.client.message('example.com', 8080, 'some message', {});
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on missing options', function (done) {
-
- var auth = Browser.client.message('example.com', 8080, 'some message');
- expect(auth).to.not.exist();
- done();
- });
-
- it('errors on invalid credentials (id)', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var creds = Hoek.clone(credentials);
- delete creds.id;
- var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: creds });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on invalid credentials (key)', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var creds = Hoek.clone(credentials);
- delete creds.key;
- var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: creds });
- expect(auth).to.not.exist();
- done();
- });
- });
-
- it('errors on invalid algorithm', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var creds = Hoek.clone(credentials);
- creds.algorithm = 'blah';
- var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: creds });
- expect(auth).to.not.exist();
- done();
- });
- });
- });
-
- describe('#authenticateTimestamp', function (done) {
-
- it('validates a timestamp', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var tsm = Hawk.crypto.timestampMessage(credentials);
- expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(true);
- done();
- });
- });
-
- it('validates a timestamp without updating local time', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var offset = Browser.utils.getNtpOffset();
- var tsm = Hawk.crypto.timestampMessage(credentials, 10000);
- expect(Browser.client.authenticateTimestamp(tsm, credentials, false)).to.equal(true);
- expect(offset).to.equal(Browser.utils.getNtpOffset());
- done();
- });
- });
-
- it('detects a bad timestamp', function (done) {
-
- credentialsFunc('123456', function (err, credentials) {
-
- var tsm = Hawk.crypto.timestampMessage(credentials);
- tsm.ts = 4;
- expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(false);
- done();
- });
- });
- });
- });
-
- describe('internals', function () {
-
- describe('LocalStorage', function () {
-
- it('goes through the full lifecycle', function (done) {
-
- var storage = new Browser.internals.LocalStorage();
- expect(storage.length).to.equal(0);
- expect(storage.getItem('a')).to.equal(null);
- storage.setItem('a', 5);
- expect(storage.length).to.equal(1);
- expect(storage.key()).to.equal('a');
- expect(storage.key(0)).to.equal('a');
- expect(storage.getItem('a')).to.equal('5');
- storage.setItem('b', 'test');
- expect(storage.key()).to.equal('a');
- expect(storage.key(0)).to.equal('a');
- expect(storage.key(1)).to.equal('b');
- expect(storage.length).to.equal(2);
- expect(storage.getItem('b')).to.equal('test');
- storage.removeItem('a');
- expect(storage.length).to.equal(1);
- expect(storage.getItem('a')).to.equal(null);
- expect(storage.getItem('b')).to.equal('test');
- storage.clear();
- expect(storage.length).to.equal(0);
- expect(storage.getItem('a')).to.equal(null);
- expect(storage.getItem('b')).to.equal(null);
- done();
- });
- });
- });
-
- describe('utils', function () {
-
- describe('#setStorage', function () {
-
- it('sets storage for the first time', function (done) {
-
- Browser.utils.storage = new Browser.internals.LocalStorage(); // Reset state
-
- expect(Browser.utils.storage.getItem('hawk_ntp_offset')).to.not.exist();
- Browser.utils.storage.setItem('test', '1');
- Browser.utils.setStorage(new Browser.internals.LocalStorage());
- expect(Browser.utils.storage.getItem('test')).to.not.exist();
- Browser.utils.storage.setItem('test', '2');
- expect(Browser.utils.storage.getItem('test')).to.equal('2');
- done();
- });
- });
-
- describe('#setNtpOffset', function (done) {
-
- it('catches localStorage errors', function (done) {
-
- var orig = Browser.utils.storage.setItem;
- var error = console.error;
- var count = 0;
- console.error = function () { if (count++ === 2) { console.error = error; } };
- Browser.utils.storage.setItem = function () {
-
- Browser.utils.storage.setItem = orig;
- throw new Error()
- };
-
- expect(function () {
- Browser.utils.setNtpOffset(100);
- }).not.to.throw();
-
- done();
- });
- });
-
- describe('#parseAuthorizationHeader', function (done) {
-
- it('returns null on missing header', function (done) {
-
- expect(Browser.utils.parseAuthorizationHeader()).to.equal(null);
- done();
- });
-
- it('returns null on bad header syntax (structure)', function (done) {
-
- expect(Browser.utils.parseAuthorizationHeader('Hawk')).to.equal(null);
- done();
- });
-
- it('returns null on bad header syntax (parts)', function (done) {
-
- expect(Browser.utils.parseAuthorizationHeader(' ')).to.equal(null);
- done();
- });
-
- it('returns null on bad scheme name', function (done) {
-
- expect(Browser.utils.parseAuthorizationHeader('Basic asdasd')).to.equal(null);
- done();
- });
-
- it('returns null on bad attribute value', function (done) {
-
- expect(Browser.utils.parseAuthorizationHeader('Hawk test="\t"', ['test'])).to.equal(null);
- done();
- });
-
- it('returns null on duplicated attribute', function (done) {
-
- expect(Browser.utils.parseAuthorizationHeader('Hawk test="a", test="b"', ['test'])).to.equal(null);
- done();
- });
- });
-
- describe('#parseUri', function () {
-
- it('returns empty port when unknown scheme', function (done) {
-
- var uri = Browser.utils.parseUri('ftp://domain');
- expect(uri.port).to.equal('');
- done();
- });
-
- it('returns default port when missing', function (done) {
-
- var uri = Browser.utils.parseUri('http://');
- expect(uri.port).to.equal('80');
- done();
- });
- });
-
- var str = "https://www.google.ca/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=url";
- var base64str = "aHR0cHM6Ly93d3cuZ29vZ2xlLmNhL3dlYmhwP3NvdXJjZWlkPWNocm9tZS1pbnN0YW50Jmlvbj0xJmVzcHY9MiZpZT1VVEYtOCNxPXVybA";
-
- describe('#base64urlEncode', function () {
-
- it('should base64 URL-safe decode a string', function (done) {
-
- expect(Browser.utils.base64urlEncode(str)).to.equal(base64str);
- done();
- });
-
- });
-
- });
-});
[17/59] [abbrv] couchdb-nmo git commit: website: fix commands
Posted by ro...@apache.org.
website: fix commands
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/b5bf6e93
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/b5bf6e93
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/b5bf6e93
Branch: refs/heads/master
Commit: b5bf6e93ee10ed556c2b37d24b439381b7c09f8c
Parents: bbeeaae
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun May 31 23:51:38 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sun May 31 23:51:38 2015 +0200
----------------------------------------------------------------------
doc/website/index.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/b5bf6e93/doc/website/index.md
----------------------------------------------------------------------
diff --git a/doc/website/index.md b/doc/website/index.md
index 91207ec..5942193 100644
--- a/doc/website/index.md
+++ b/doc/website/index.md
@@ -23,10 +23,10 @@ nmo cluster add node2 http://foo:bar@localhost:25984 anemone
nmo cluster add node3 http://foo:bar@localhost:35984 anemone
# check config
-nmo cluster
+nmo cluster get
# we support json!
-nmo cluster --json
+nmo cluster get --json
nmo isonline http://foo:bar@localhost:15984 --json
# join cluster
[07/59] [abbrv] couchdb-nmo git commit: fix broken deps
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/node_modules/async/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/package.json b/node_modules/request/node_modules/form-data/node_modules/async/package.json
index e8f9ed8..98c2e0b 100644
--- a/node_modules/request/node_modules/form-data/node_modules/async/package.json
+++ b/node_modules/request/node_modules/form-data/node_modules/async/package.json
@@ -1,28 +1,30 @@
{
"name": "async",
"description": "Higher-order functions and common patterns for asynchronous code",
- "main": "./lib/async",
+ "main": "lib/async.js",
"author": {
"name": "Caolan McMahon"
},
- "version": "0.9.0",
+ "version": "0.9.2",
+ "keywords": [
+ "async",
+ "callback",
+ "utility",
+ "module"
+ ],
"repository": {
"type": "git",
- "url": "https://github.com/caolan/async.git"
+ "url": "git+https://github.com/caolan/async.git"
},
"bugs": {
"url": "https://github.com/caolan/async/issues"
},
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/caolan/async/raw/master/LICENSE"
- }
- ],
+ "license": "MIT",
"devDependencies": {
"nodeunit": ">0.0.0",
"uglify-js": "1.2.x",
- "nodelint": ">0.0.0"
+ "nodelint": ">0.0.0",
+ "lodash": ">=2.4.1"
},
"jam": {
"main": "lib/async.js",
@@ -30,31 +32,53 @@
"lib/async.js",
"README.md",
"LICENSE"
+ ],
+ "categories": [
+ "Utilities"
]
},
"scripts": {
"test": "nodeunit test/test-async.js"
},
- "homepage": "https://github.com/caolan/async",
- "_id": "async@0.9.0",
- "dist": {
- "shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
- "tarball": "http://registry.npmjs.org/async/-/async-0.9.0.tgz"
+ "spm": {
+ "main": "lib/async.js"
},
+ "volo": {
+ "main": "lib/async.js",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ]
+ },
+ "gitHead": "de3a16091d5125384eff4a54deb3998b13c3814c",
+ "homepage": "https://github.com/caolan/async#readme",
+ "_id": "async@0.9.2",
+ "_shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d",
"_from": "async@>=0.9.0 <0.10.0",
- "_npmVersion": "1.4.3",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
- "name": "caolan",
- "email": "caolan.mcmahon@gmail.com"
+ "name": "beaugunderson",
+ "email": "beau@beaugunderson.com"
},
"maintainers": [
{
"name": "caolan",
- "email": "caolan@caolanmcmahon.com"
+ "email": "caolan.mcmahon@gmail.com"
+ },
+ {
+ "name": "beaugunderson",
+ "email": "beau@beaugunderson.com"
}
],
+ "dist": {
+ "shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d",
+ "tarball": "http://registry.npmjs.org/async/-/async-0.9.2.tgz"
+ },
"directories": {},
- "_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
- "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
+ "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
"readme": "ERROR: No README data found!"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js b/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
new file mode 100755
index 0000000..30cb7c2
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
@@ -0,0 +1,53 @@
+#!/usr/bin/env node
+
+// This should probably be its own module but complaints about bower/etc.
+// support keep coming up and I'd rather just enable the workflow here for now
+// and figure out where this should live later. -- @beaugunderson
+
+var fs = require('fs');
+var _ = require('lodash');
+
+var packageJson = require('../package.json');
+
+var IGNORES = ['**/.*', 'node_modules', 'bower_components', 'test', 'tests'];
+var INCLUDES = ['lib/async.js', 'README.md', 'LICENSE'];
+var REPOSITORY_NAME = 'caolan/async';
+
+packageJson.jam = {
+ main: packageJson.main,
+ include: INCLUDES,
+ categories: ['Utilities']
+};
+
+packageJson.spm = {
+ main: packageJson.main
+};
+
+packageJson.volo = {
+ main: packageJson.main,
+ ignore: IGNORES
+};
+
+var bowerSpecific = {
+ moduleType: ['amd', 'globals', 'node'],
+ ignore: IGNORES,
+ authors: [packageJson.author]
+};
+
+var bowerInclude = ['name', 'description', 'version', 'main', 'keywords',
+ 'license', 'homepage', 'repository', 'devDependencies'];
+
+var componentSpecific = {
+ repository: REPOSITORY_NAME,
+ scripts: [packageJson.main]
+};
+
+var componentInclude = ['name', 'description', 'version', 'keywords',
+ 'license'];
+
+var bowerJson = _.merge({}, _.pick(packageJson, bowerInclude), bowerSpecific);
+var componentJson = _.merge({}, _.pick(packageJson, componentInclude), componentSpecific);
+
+fs.writeFileSync('./bower.json', JSON.stringify(bowerJson, null, 2));
+fs.writeFileSync('./component.json', JSON.stringify(componentJson, null, 2));
+fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
index 8337c18..5dc9f77 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
@@ -5,4 +5,8 @@ var gen = function(obj, prop) {
}
gen.valid = isProperty
-module.exports = gen
\ No newline at end of file
+gen.property = function (prop) {
+ return isProperty(prop) ? prop : JSON.stringify(prop)
+}
+
+module.exports = gen
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
index 03f694b..699a9bc 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
@@ -1,6 +1,6 @@
{
"name": "generate-object-property",
- "version": "1.1.1",
+ "version": "1.2.0",
"description": "Generate safe JS code that can used to reference a object property",
"repository": {
"type": "git",
@@ -25,12 +25,12 @@
"url": "@mafintosh"
},
"license": "MIT",
- "gitHead": "366cb415f6b73904b809e554f685ef1eefe308d8",
- "_id": "generate-object-property@1.1.1",
- "_shasum": "8fda6b4cb69b34a189a6cebee7c4c268af47cc93",
+ "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c",
+ "_id": "generate-object-property@1.2.0",
+ "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
"_from": "generate-object-property@>=1.1.0 <2.0.0",
- "_npmVersion": "2.7.1",
- "_nodeVersion": "1.6.2",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
@@ -42,10 +42,10 @@
}
],
"dist": {
- "shasum": "8fda6b4cb69b34a189a6cebee7c4c268af47cc93",
- "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.1.1.tgz"
+ "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
+ "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.1.1.tgz",
+ "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
"readme": "ERROR: No README data found!"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/lib/browser.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/browser.js b/node_modules/request/node_modules/hawk/lib/browser.js
new file mode 100755
index 0000000..3307fa2
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/browser.js
@@ -0,0 +1,641 @@
+/*
+ HTTP Hawk Authentication Scheme
+ Copyright (c) 2012-2014, Eran Hammer <er...@hammer.io>
+ BSD Licensed
+*/
+
+
+// Declare namespace
+
+var hawk = {
+ internals: {}
+};
+
+
+hawk.client = {
+
+ // Generate an Authorization header for a given request
+
+ /*
+ uri: 'http://example.com/resource?a=b' or object generated by hawk.utils.parseUri()
+ method: HTTP verb (e.g. 'GET', 'POST')
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ timestamp: Date.now() / 1000, // A pre-calculated timestamp in seconds
+ nonce: '2334f34f', // A pre-generated nonce
+ localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
+ payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
+ contentType: 'application/json', // Payload content-type (ignored if hash provided)
+ hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash
+ app: '24s23423f34dx', // Oz application id
+ dlg: '234sz34tww3sd' // Oz delegated-by application id
+ }
+ */
+
+ header: function (uri, method, options) {
+
+ var result = {
+ field: '',
+ artifacts: {}
+ };
+
+ // Validate inputs
+
+ if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
+ !method || typeof method !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ result.err = 'Invalid argument type';
+ return result;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || hawk.utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ result.err = 'Invalid credentials object';
+ return result;
+ }
+
+ if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
+ return result;
+ }
+
+ // Parse URI
+
+ if (typeof uri === 'string') {
+ uri = hawk.utils.parseUri(uri);
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || hawk.utils.randomString(6),
+ method: method,
+ resource: uri.relative,
+ host: uri.hostname,
+ port: uri.port,
+ hash: options.hash,
+ ext: options.ext,
+ app: options.app,
+ dlg: options.dlg
+ };
+
+ result.artifacts = artifacts;
+
+ // Calculate payload hash
+
+ if (!artifacts.hash &&
+ (options.payload || options.payload === '')) {
+
+ artifacts.hash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ }
+
+ var mac = hawk.crypto.calculateMac('header', credentials, artifacts);
+
+ // Construct header
+
+ var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed
+ var header = 'Hawk id="' + credentials.id +
+ '", ts="' + artifacts.ts +
+ '", nonce="' + artifacts.nonce +
+ (artifacts.hash ? '", hash="' + artifacts.hash : '') +
+ (hasExt ? '", ext="' + hawk.utils.escapeHeaderAttribute(artifacts.ext) : '') +
+ '", mac="' + mac + '"';
+
+ if (artifacts.app) {
+ header += ', app="' + artifacts.app +
+ (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
+ }
+
+ result.field = header;
+
+ return result;
+ },
+
+ // Generate a bewit value for a given URI
+
+ /*
+ uri: 'http://example.com/resource?a=b'
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+ ttlSec: 60 * 60, // TTL in seconds
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ localtimeOffsetMsec: 400 // Time offset to sync with server time
+ };
+ */
+
+ bewit: function (uri, options) {
+
+ // Validate inputs
+
+ if (!uri ||
+ (typeof uri !== 'string') ||
+ !options ||
+ typeof options !== 'object' ||
+ !options.ttlSec) {
+
+ return '';
+ }
+
+ options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value
+
+ // Application time
+
+ var now = hawk.utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ return '';
+ }
+
+ if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return '';
+ }
+
+ // Parse URI
+
+ uri = hawk.utils.parseUri(uri);
+
+ // Calculate signature
+
+ var exp = now + options.ttlSec;
+ var mac = hawk.crypto.calculateMac('bewit', credentials, {
+ ts: exp,
+ nonce: '',
+ method: 'GET',
+ resource: uri.relative, // Maintain trailing '?' and query params
+ host: uri.hostname,
+ port: uri.port,
+ ext: options.ext
+ });
+
+ // Construct bewit: id\exp\mac\ext
+
+ var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
+ return hawk.utils.base64urlEncode(bewit);
+ },
+
+ // Validate server response
+
+ /*
+ request: object created via 'new XMLHttpRequest()' after response received
+ artifacts: object received from header().artifacts
+ options: {
+ payload: optional payload received
+ required: specifies if a Server-Authorization header is required. Defaults to 'false'
+ }
+ */
+
+ authenticate: function (request, credentials, artifacts, options) {
+
+ options = options || {};
+
+ var getHeader = function (name) {
+
+ return request.getResponseHeader ? request.getResponseHeader(name) : request.getHeader(name);
+ };
+
+ var wwwAuthenticate = getHeader('www-authenticate');
+ if (wwwAuthenticate) {
+
+ // Parse HTTP WWW-Authenticate header
+
+ var attributes = hawk.utils.parseAuthorizationHeader(wwwAuthenticate, ['ts', 'tsm', 'error']);
+ if (!attributes) {
+ return false;
+ }
+
+ if (attributes.ts) {
+ var tsm = hawk.crypto.calculateTsMac(attributes.ts, credentials);
+ if (tsm !== attributes.tsm) {
+ return false;
+ }
+
+ hawk.utils.setNtpOffset(attributes.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
+ }
+ }
+
+ // Parse HTTP Server-Authorization header
+
+ var serverAuthorization = getHeader('server-authorization');
+ if (!serverAuthorization &&
+ !options.required) {
+
+ return true;
+ }
+
+ var attributes = hawk.utils.parseAuthorizationHeader(serverAuthorization, ['mac', 'ext', 'hash']);
+ if (!attributes) {
+ return false;
+ }
+
+ var modArtifacts = {
+ ts: artifacts.ts,
+ nonce: artifacts.nonce,
+ method: artifacts.method,
+ resource: artifacts.resource,
+ host: artifacts.host,
+ port: artifacts.port,
+ hash: attributes.hash,
+ ext: attributes.ext,
+ app: artifacts.app,
+ dlg: artifacts.dlg
+ };
+
+ var mac = hawk.crypto.calculateMac('response', credentials, modArtifacts);
+ if (mac !== attributes.mac) {
+ return false;
+ }
+
+ if (!options.payload &&
+ options.payload !== '') {
+
+ return true;
+ }
+
+ if (!attributes.hash) {
+ return false;
+ }
+
+ var calculatedHash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, getHeader('content-type'));
+ return (calculatedHash === attributes.hash);
+ },
+
+ message: function (host, port, message, options) {
+
+ // Validate inputs
+
+ if (!host || typeof host !== 'string' ||
+ !port || typeof port !== 'number' ||
+ message === null || message === undefined || typeof message !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ return null;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || hawk.utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ // Invalid credential object
+ return null;
+ }
+
+ if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return null;
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || hawk.utils.randomString(6),
+ host: host,
+ port: port,
+ hash: hawk.crypto.calculatePayloadHash(message, credentials.algorithm)
+ };
+
+ // Construct authorization
+
+ var result = {
+ id: credentials.id,
+ ts: artifacts.ts,
+ nonce: artifacts.nonce,
+ hash: artifacts.hash,
+ mac: hawk.crypto.calculateMac('message', credentials, artifacts)
+ };
+
+ return result;
+ },
+
+ authenticateTimestamp: function (message, credentials, updateClock) { // updateClock defaults to true
+
+ var tsm = hawk.crypto.calculateTsMac(message.ts, credentials);
+ if (tsm !== message.tsm) {
+ return false;
+ }
+
+ if (updateClock !== false) {
+ hawk.utils.setNtpOffset(message.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
+ }
+
+ return true;
+ }
+};
+
+
+hawk.crypto = {
+
+ headerVersion: '1',
+
+ algorithms: ['sha1', 'sha256'],
+
+ calculateMac: function (type, credentials, options) {
+
+ var normalized = hawk.crypto.generateNormalizedString(type, options);
+
+ var hmac = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()](normalized, credentials.key);
+ return hmac.toString(CryptoJS.enc.Base64);
+ },
+
+ generateNormalizedString: function (type, options) {
+
+ var normalized = 'hawk.' + hawk.crypto.headerVersion + '.' + type + '\n' +
+ options.ts + '\n' +
+ options.nonce + '\n' +
+ (options.method || '').toUpperCase() + '\n' +
+ (options.resource || '') + '\n' +
+ options.host.toLowerCase() + '\n' +
+ options.port + '\n' +
+ (options.hash || '') + '\n';
+
+ if (options.ext) {
+ normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
+ }
+
+ normalized += '\n';
+
+ if (options.app) {
+ normalized += options.app + '\n' +
+ (options.dlg || '') + '\n';
+ }
+
+ return normalized;
+ },
+
+ calculatePayloadHash: function (payload, algorithm, contentType) {
+
+ var hash = CryptoJS.algo[algorithm.toUpperCase()].create();
+ hash.update('hawk.' + hawk.crypto.headerVersion + '.payload\n');
+ hash.update(hawk.utils.parseContentType(contentType) + '\n');
+ hash.update(payload);
+ hash.update('\n');
+ return hash.finalize().toString(CryptoJS.enc.Base64);
+ },
+
+ calculateTsMac: function (ts, credentials) {
+
+ var hash = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()]('hawk.' + hawk.crypto.headerVersion + '.ts\n' + ts + '\n', credentials.key);
+ return hash.toString(CryptoJS.enc.Base64);
+ }
+};
+
+
+// localStorage compatible interface
+
+hawk.internals.LocalStorage = function () {
+
+ this._cache = {};
+ this.length = 0;
+
+ this.getItem = function (key) {
+
+ return this._cache.hasOwnProperty(key) ? String(this._cache[key]) : null;
+ };
+
+ this.setItem = function (key, value) {
+
+ this._cache[key] = String(value);
+ this.length = Object.keys(this._cache).length;
+ };
+
+ this.removeItem = function (key) {
+
+ delete this._cache[key];
+ this.length = Object.keys(this._cache).length;
+ };
+
+ this.clear = function () {
+
+ this._cache = {};
+ this.length = 0;
+ };
+
+ this.key = function (i) {
+
+ return Object.keys(this._cache)[i || 0];
+ };
+};
+
+
+hawk.utils = {
+
+ storage: new hawk.internals.LocalStorage(),
+
+ setStorage: function (storage) {
+
+ var ntpOffset = hawk.utils.storage.getItem('hawk_ntp_offset');
+ hawk.utils.storage = storage;
+ if (ntpOffset) {
+ hawk.utils.setNtpOffset(ntpOffset);
+ }
+ },
+
+ setNtpOffset: function (offset) {
+
+ try {
+ hawk.utils.storage.setItem('hawk_ntp_offset', offset);
+ }
+ catch (err) {
+ console.error('[hawk] could not write to storage.');
+ console.error(err);
+ }
+ },
+
+ getNtpOffset: function () {
+
+ var offset = hawk.utils.storage.getItem('hawk_ntp_offset');
+ if (!offset) {
+ return 0;
+ }
+
+ return parseInt(offset, 10);
+ },
+
+ now: function (localtimeOffsetMsec) {
+
+ return Math.floor(((new Date()).getTime() + (localtimeOffsetMsec || 0)) / 1000) + hawk.utils.getNtpOffset();
+ },
+
+ escapeHeaderAttribute: function (attribute) {
+
+ return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"');
+ },
+
+ parseContentType: function (header) {
+
+ if (!header) {
+ return '';
+ }
+
+ return header.split(';')[0].replace(/^\s+|\s+$/g, '').toLowerCase();
+ },
+
+ parseAuthorizationHeader: function (header, keys) {
+
+ if (!header) {
+ return null;
+ }
+
+ var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/); // Header: scheme[ something]
+ if (!headerParts) {
+ return null;
+ }
+
+ var scheme = headerParts[1];
+ if (scheme.toLowerCase() !== 'hawk') {
+ return null;
+ }
+
+ var attributesString = headerParts[2];
+ if (!attributesString) {
+ return null;
+ }
+
+ var attributes = {};
+ var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
+
+ // Check valid attribute names
+
+ if (keys.indexOf($1) === -1) {
+ return;
+ }
+
+ // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+
+ if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
+ return;
+ }
+
+ // Check for duplicates
+
+ if (attributes.hasOwnProperty($1)) {
+ return;
+ }
+
+ attributes[$1] = $2;
+ return '';
+ });
+
+ if (verify !== '') {
+ return null;
+ }
+
+ return attributes;
+ },
+
+ randomString: function (size) {
+
+ var randomSource = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+ var len = randomSource.length;
+
+ var result = [];
+ for (var i = 0; i < size; ++i) {
+ result[i] = randomSource[Math.floor(Math.random() * len)];
+ }
+
+ return result.join('');
+ },
+
+ parseUri: function (input) {
+
+ // Based on: parseURI 1.2.2
+ // http://blog.stevenlevithan.com/archives/parseuri
+ // (c) Steven Levithan <stevenlevithan.com>
+ // MIT License
+
+ var keys = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'hostname', 'port', 'resource', 'relative', 'pathname', 'directory', 'file', 'query', 'fragment'];
+
+ var uriRegex = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?)(?:#(.*))?)/;
+ var uriByNumber = input.match(uriRegex);
+ var uri = {};
+
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ uri[keys[i]] = uriByNumber[i] || '';
+ }
+
+ if (uri.port === '') {
+ uri.port = (uri.protocol.toLowerCase() === 'http' ? '80' : (uri.protocol.toLowerCase() === 'https' ? '443' : ''));
+ }
+
+ return uri;
+ },
+
+ base64urlEncode: function (value) {
+
+ var wordArray = CryptoJS.enc.Utf8.parse(value);
+ var encoded = CryptoJS.enc.Base64.stringify(wordArray);
+ return encoded.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+ }
+};
+
+
+// $lab:coverage:off$
+
+// Based on: Crypto-JS v3.1.2
+// Copyright (c) 2009-2013, Jeff Mott. All rights reserved.
+// http://code.google.com/p/crypto-js/
+// http://code.google.com/p/crypto-js/wiki/License
+
+var CryptoJS = CryptoJS || function (h, r) { var k = {}, l = k.lib = {}, n = function () { }, f = l.Base = { extend: function (a) { n.prototype = this; var b = new n; a && b.mixIn(a); b.hasOwnProperty("init") || (b.init = function () { b.$super.init.apply(this, arguments) }); b.init.prototype = b; b.$super = this; return b }, create: function () { var a = this.extend(); a.init.apply(a, arguments); return a }, init: function () { }, mixIn: function (a) { for (var b in a) a.hasOwnProperty(b) && (this[b] = a[b]); a.hasOwnProperty("toString") && (this.toString = a.toString) }, clone: function () { return this.init.prototype.extend(this) } }, j = l.WordArray = f.extend({ init: function (a, b) { a = this.words = a || []; this.sigBytes = b != r ? b : 4 * a.length }, toString: function (a) { return (a || s).stringify(this) }, concat: function (a) { var b = this.words, d = a.words, c = this.sigBytes; a = a.sigBytes; this.clamp(); if (c % 4) for (var e = 0; e < a; e++) b[c + e >>> 2] |= (d[e
>>> 2] >>> 24 - 8 * (e % 4) & 255) << 24 - 8 * ((c + e) % 4); else if (65535 < d.length) for (e = 0; e < a; e += 4) b[c + e >>> 2] = d[e >>> 2]; else b.push.apply(b, d); this.sigBytes += a; return this }, clamp: function () { var a = this.words, b = this.sigBytes; a[b >>> 2] &= 4294967295 << 32 - 8 * (b % 4); a.length = h.ceil(b / 4) }, clone: function () { var a = f.clone.call(this); a.words = this.words.slice(0); return a }, random: function (a) { for (var b = [], d = 0; d < a; d += 4) b.push(4294967296 * h.random() | 0); return new j.init(b, a) } }), m = k.enc = {}, s = m.Hex = { stringify: function (a) { var b = a.words; a = a.sigBytes; for (var d = [], c = 0; c < a; c++) { var e = b[c >>> 2] >>> 24 - 8 * (c % 4) & 255; d.push((e >>> 4).toString(16)); d.push((e & 15).toString(16)) } return d.join("") }, parse: function (a) { for (var b = a.length, d = [], c = 0; c < b; c += 2) d[c >>> 3] |= parseInt(a.substr(c, 2), 16) << 24 - 4 * (c % 8); return new j.init(d, b / 2) } }, p = m.
Latin1 = { stringify: function (a) { var b = a.words; a = a.sigBytes; for (var d = [], c = 0; c < a; c++) d.push(String.fromCharCode(b[c >>> 2] >>> 24 - 8 * (c % 4) & 255)); return d.join("") }, parse: function (a) { for (var b = a.length, d = [], c = 0; c < b; c++) d[c >>> 2] |= (a.charCodeAt(c) & 255) << 24 - 8 * (c % 4); return new j.init(d, b) } }, t = m.Utf8 = { stringify: function (a) { try { return decodeURIComponent(escape(p.stringify(a))) } catch (b) { throw Error("Malformed UTF-8 data"); } }, parse: function (a) { return p.parse(unescape(encodeURIComponent(a))) } }, q = l.BufferedBlockAlgorithm = f.extend({ reset: function () { this._data = new j.init; this._nDataBytes = 0 }, _append: function (a) { "string" == typeof a && (a = t.parse(a)); this._data.concat(a); this._nDataBytes += a.sigBytes }, _process: function (a) { var b = this._data, d = b.words, c = b.sigBytes, e = this.blockSize, f = c / (4 * e), f = a ? h.ceil(f) : h.max((f | 0) - this._minBufferSize, 0); a = f *
e; c = h.min(4 * a, c); if (a) { for (var g = 0; g < a; g += e) this._doProcessBlock(d, g); g = d.splice(0, a); b.sigBytes -= c } return new j.init(g, c) }, clone: function () { var a = f.clone.call(this); a._data = this._data.clone(); return a }, _minBufferSize: 0 }); l.Hasher = q.extend({ cfg: f.extend(), init: function (a) { this.cfg = this.cfg.extend(a); this.reset() }, reset: function () { q.reset.call(this); this._doReset() }, update: function (a) { this._append(a); this._process(); return this }, finalize: function (a) { a && this._append(a); return this._doFinalize() }, blockSize: 16, _createHelper: function (a) { return function (b, d) { return (new a.init(d)).finalize(b) } }, _createHmacHelper: function (a) { return function (b, d) { return (new u.HMAC.init(a, d)).finalize(b) } } }); var u = k.algo = {}; return k }(Math);
+(function () { var k = CryptoJS, b = k.lib, m = b.WordArray, l = b.Hasher, d = [], b = k.algo.SHA1 = l.extend({ _doReset: function () { this._hash = new m.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) }, _doProcessBlock: function (n, p) { for (var a = this._hash.words, e = a[0], f = a[1], h = a[2], j = a[3], b = a[4], c = 0; 80 > c; c++) { if (16 > c) d[c] = n[p + c] | 0; else { var g = d[c - 3] ^ d[c - 8] ^ d[c - 14] ^ d[c - 16]; d[c] = g << 1 | g >>> 31 } g = (e << 5 | e >>> 27) + b + d[c]; g = 20 > c ? g + ((f & h | ~f & j) + 1518500249) : 40 > c ? g + ((f ^ h ^ j) + 1859775393) : 60 > c ? g + ((f & h | f & j | h & j) - 1894007588) : g + ((f ^ h ^ j) - 899497514); b = j; j = h; h = f << 30 | f >>> 2; f = e; e = g } a[0] = a[0] + e | 0; a[1] = a[1] + f | 0; a[2] = a[2] + h | 0; a[3] = a[3] + j | 0; a[4] = a[4] + b | 0 }, _doFinalize: function () { var b = this._data, d = b.words, a = 8 * this._nDataBytes, e = 8 * b.sigBytes; d[e >>> 5] |= 128 << 24 - e % 32; d[
(e + 64 >>> 9 << 4) + 14] = Math.floor(a / 4294967296); d[(e + 64 >>> 9 << 4) + 15] = a; b.sigBytes = 4 * d.length; this._process(); return this._hash }, clone: function () { var b = l.clone.call(this); b._hash = this._hash.clone(); return b } }); k.SHA1 = l._createHelper(b); k.HmacSHA1 = l._createHmacHelper(b) })();
+(function (k) { for (var g = CryptoJS, h = g.lib, v = h.WordArray, j = h.Hasher, h = g.algo, s = [], t = [], u = function (q) { return 4294967296 * (q - (q | 0)) | 0 }, l = 2, b = 0; 64 > b;) { var d; a: { d = l; for (var w = k.sqrt(d), r = 2; r <= w; r++) if (!(d % r)) { d = !1; break a } d = !0 } d && (8 > b && (s[b] = u(k.pow(l, 0.5))), t[b] = u(k.pow(l, 1 / 3)), b++); l++ } var n = [], h = h.SHA256 = j.extend({ _doReset: function () { this._hash = new v.init(s.slice(0)) }, _doProcessBlock: function (q, h) { for (var a = this._hash.words, c = a[0], d = a[1], b = a[2], k = a[3], f = a[4], g = a[5], j = a[6], l = a[7], e = 0; 64 > e; e++) { if (16 > e) n[e] = q[h + e] | 0; else { var m = n[e - 15], p = n[e - 2]; n[e] = ((m << 25 | m >>> 7) ^ (m << 14 | m >>> 18) ^ m >>> 3) + n[e - 7] + ((p << 15 | p >>> 17) ^ (p << 13 | p >>> 19) ^ p >>> 10) + n[e - 16] } m = l + ((f << 26 | f >>> 6) ^ (f << 21 | f >>> 11) ^ (f << 7 | f >>> 25)) + (f & g ^ ~f & j) + t[e] + n[e]; p = ((c << 30 | c >
>> 2) ^ (c << 19 | c >>> 13) ^ (c << 10 | c >>> 22)) + (c & d ^ c & b ^ d & b); l = j; j = g; g = f; f = k + m | 0; k = b; b = d; d = c; c = m + p | 0 } a[0] = a[0] + c | 0; a[1] = a[1] + d | 0; a[2] = a[2] + b | 0; a[3] = a[3] + k | 0; a[4] = a[4] + f | 0; a[5] = a[5] + g | 0; a[6] = a[6] + j | 0; a[7] = a[7] + l | 0 }, _doFinalize: function () { var d = this._data, b = d.words, a = 8 * this._nDataBytes, c = 8 * d.sigBytes; b[c >>> 5] |= 128 << 24 - c % 32; b[(c + 64 >>> 9 << 4) + 14] = k.floor(a / 4294967296); b[(c + 64 >>> 9 << 4) + 15] = a; d.sigBytes = 4 * b.length; this._process(); return this._hash }, clone: function () { var b = j.clone.call(this); b._hash = this._hash.clone(); return b } }); g.SHA256 = j._createHelper(h); g.HmacSHA256 = j._createHmacHelper(h) })(Math);
+(function () { var c = CryptoJS, k = c.enc.Utf8; c.algo.HMAC = c.lib.Base.extend({ init: function (a, b) { a = this._hasher = new a.init; "string" == typeof b && (b = k.parse(b)); var c = a.blockSize, e = 4 * c; b.sigBytes > e && (b = a.finalize(b)); b.clamp(); for (var f = this._oKey = b.clone(), g = this._iKey = b.clone(), h = f.words, j = g.words, d = 0; d < c; d++) h[d] ^= 1549556828, j[d] ^= 909522486; f.sigBytes = g.sigBytes = e; this.reset() }, reset: function () { var a = this._hasher; a.reset(); a.update(this._iKey) }, update: function (a) { this._hasher.update(a); return this }, finalize: function (a) { var b = this._hasher; a = b.finalize(a); b.reset(); return b.finalize(this._oKey.clone().concat(a)) } }) })();
+(function () { var h = CryptoJS, j = h.lib.WordArray; h.enc.Base64 = { stringify: function (b) { var e = b.words, f = b.sigBytes, c = this._map; b.clamp(); b = []; for (var a = 0; a < f; a += 3) for (var d = (e[a >>> 2] >>> 24 - 8 * (a % 4) & 255) << 16 | (e[a + 1 >>> 2] >>> 24 - 8 * ((a + 1) % 4) & 255) << 8 | e[a + 2 >>> 2] >>> 24 - 8 * ((a + 2) % 4) & 255, g = 0; 4 > g && a + 0.75 * g < f; g++) b.push(c.charAt(d >>> 6 * (3 - g) & 63)); if (e = c.charAt(64)) for (; b.length % 4;) b.push(e); return b.join("") }, parse: function (b) { var e = b.length, f = this._map, c = f.charAt(64); c && (c = b.indexOf(c), -1 != c && (e = c)); for (var c = [], a = 0, d = 0; d < e; d++) if (d % 4) { var g = f.indexOf(b.charAt(d - 1)) << 2 * (d % 4), h = f.indexOf(b.charAt(d)) >>> 6 - 2 * (d % 4); c[a >>> 2] |= (g | h) << 24 - 8 * (a % 4); a++ } return j.create(c, a) }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" } })();
+
+hawk.crypto.internals = CryptoJS;
+
+
+// Export if used as a module
+
+if (typeof module !== 'undefined' && module.exports) {
+ module.exports = hawk;
+}
+
+// $lab:coverage:on$
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/lib/client.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/client.js b/node_modules/request/node_modules/hawk/lib/client.js
new file mode 100755
index 0000000..7fdd484
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/client.js
@@ -0,0 +1,369 @@
+// Load modules
+
+var Url = require('url');
+var Hoek = require('hoek');
+var Cryptiles = require('cryptiles');
+var Crypto = require('./crypto');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Generate an Authorization header for a given request
+
+/*
+ uri: 'http://example.com/resource?a=b' or object from Url.parse()
+ method: HTTP verb (e.g. 'GET', 'POST')
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ timestamp: Date.now(), // A pre-calculated timestamp
+ nonce: '2334f34f', // A pre-generated nonce
+ localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
+ payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
+ contentType: 'application/json', // Payload content-type (ignored if hash provided)
+ hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash
+ app: '24s23423f34dx', // Oz application id
+ dlg: '234sz34tww3sd' // Oz delegated-by application id
+ }
+*/
+
+exports.header = function (uri, method, options) {
+
+ var result = {
+ field: '',
+ artifacts: {}
+ };
+
+ // Validate inputs
+
+ if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
+ !method || typeof method !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ result.err = 'Invalid argument type';
+ return result;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || Utils.nowSecs(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ result.err = 'Invalid credential object';
+ return result;
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
+ return result;
+ }
+
+ // Parse URI
+
+ if (typeof uri === 'string') {
+ uri = Url.parse(uri);
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || Cryptiles.randomString(6),
+ method: method,
+ resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
+ host: uri.hostname,
+ port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
+ hash: options.hash,
+ ext: options.ext,
+ app: options.app,
+ dlg: options.dlg
+ };
+
+ result.artifacts = artifacts;
+
+ // Calculate payload hash
+
+ if (!artifacts.hash &&
+ (options.payload || options.payload === '')) {
+
+ artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ }
+
+ var mac = Crypto.calculateMac('header', credentials, artifacts);
+
+ // Construct header
+
+ var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed
+ var header = 'Hawk id="' + credentials.id +
+ '", ts="' + artifacts.ts +
+ '", nonce="' + artifacts.nonce +
+ (artifacts.hash ? '", hash="' + artifacts.hash : '') +
+ (hasExt ? '", ext="' + Hoek.escapeHeaderAttribute(artifacts.ext) : '') +
+ '", mac="' + mac + '"';
+
+ if (artifacts.app) {
+ header += ', app="' + artifacts.app +
+ (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
+ }
+
+ result.field = header;
+
+ return result;
+};
+
+
+// Validate server response
+
+/*
+ res: node's response object
+ artifacts: object received from header().artifacts
+ options: {
+ payload: optional payload received
+ required: specifies if a Server-Authorization header is required. Defaults to 'false'
+ }
+*/
+
+exports.authenticate = function (res, credentials, artifacts, options) {
+
+ artifacts = Hoek.clone(artifacts);
+ options = options || {};
+
+ if (res.headers['www-authenticate']) {
+
+ // Parse HTTP WWW-Authenticate header
+
+ var attributes = Utils.parseAuthorizationHeader(res.headers['www-authenticate'], ['ts', 'tsm', 'error']);
+ if (attributes instanceof Error) {
+ return false;
+ }
+
+ // Validate server timestamp (not used to update clock since it is done via the SNPT client)
+
+ if (attributes.ts) {
+ var tsm = Crypto.calculateTsMac(attributes.ts, credentials);
+ if (tsm !== attributes.tsm) {
+ return false;
+ }
+ }
+ }
+
+ // Parse HTTP Server-Authorization header
+
+ if (!res.headers['server-authorization'] &&
+ !options.required) {
+
+ return true;
+ }
+
+ var attributes = Utils.parseAuthorizationHeader(res.headers['server-authorization'], ['mac', 'ext', 'hash']);
+ if (attributes instanceof Error) {
+ return false;
+ }
+
+ artifacts.ext = attributes.ext;
+ artifacts.hash = attributes.hash;
+
+ var mac = Crypto.calculateMac('response', credentials, artifacts);
+ if (mac !== attributes.mac) {
+ return false;
+ }
+
+ if (!options.payload &&
+ options.payload !== '') {
+
+ return true;
+ }
+
+ if (!attributes.hash) {
+ return false;
+ }
+
+ var calculatedHash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, res.headers['content-type']);
+ return (calculatedHash === attributes.hash);
+};
+
+
+// Generate a bewit value for a given URI
+
+/*
+ uri: 'http://example.com/resource?a=b' or object from Url.parse()
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+ ttlSec: 60 * 60, // TTL in seconds
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ localtimeOffsetMsec: 400 // Time offset to sync with server time
+ };
+*/
+
+exports.getBewit = function (uri, options) {
+
+ // Validate inputs
+
+ if (!uri ||
+ (typeof uri !== 'string' && typeof uri !== 'object') ||
+ !options ||
+ typeof options !== 'object' ||
+ !options.ttlSec) {
+
+ return '';
+ }
+
+ options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ return '';
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return '';
+ }
+
+ // Parse URI
+
+ if (typeof uri === 'string') {
+ uri = Url.parse(uri);
+ }
+
+ // Calculate signature
+
+ var exp = Math.floor(now / 1000) + options.ttlSec;
+ var mac = Crypto.calculateMac('bewit', credentials, {
+ ts: exp,
+ nonce: '',
+ method: 'GET',
+ resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
+ host: uri.hostname,
+ port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
+ ext: options.ext
+ });
+
+ // Construct bewit: id\exp\mac\ext
+
+ var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
+ return Hoek.base64urlEncode(bewit);
+};
+
+
+// Generate an authorization string for a message
+
+/*
+ host: 'example.com',
+ port: 8000,
+ message: '{"some":"payload"}', // UTF-8 encoded string for body hash generation
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+
+ // Optional
+
+ timestamp: Date.now(), // A pre-calculated timestamp
+ nonce: '2334f34f', // A pre-generated nonce
+ localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
+ }
+*/
+
+exports.message = function (host, port, message, options) {
+
+ // Validate inputs
+
+ if (!host || typeof host !== 'string' ||
+ !port || typeof port !== 'number' ||
+ message === null || message === undefined || typeof message !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ return null;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || Utils.nowSecs(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ // Invalid credential object
+ return null;
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return null;
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || Cryptiles.randomString(6),
+ host: host,
+ port: port,
+ hash: Crypto.calculatePayloadHash(message, credentials.algorithm)
+ };
+
+ // Construct authorization
+
+ var result = {
+ id: credentials.id,
+ ts: artifacts.ts,
+ nonce: artifacts.nonce,
+ hash: artifacts.hash,
+ mac: Crypto.calculateMac('message', credentials, artifacts)
+ };
+
+ return result;
+};
+
+
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/lib/crypto.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/crypto.js b/node_modules/request/node_modules/hawk/lib/crypto.js
new file mode 100755
index 0000000..d3c8244
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/crypto.js
@@ -0,0 +1,126 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Url = require('url');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// MAC normalization format version
+
+exports.headerVersion = '1'; // Prevent comparison of mac values generated with different normalized string formats
+
+
+// Supported HMAC algorithms
+
+exports.algorithms = ['sha1', 'sha256'];
+
+
+// Calculate the request MAC
+
+/*
+ type: 'header', // 'header', 'bewit', 'response'
+ credentials: {
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+ options: {
+ method: 'GET',
+ resource: '/resource?a=1&b=2',
+ host: 'example.com',
+ port: 8080,
+ ts: 1357718381034,
+ nonce: 'd3d345f',
+ hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
+ ext: 'app-specific-data',
+ app: 'hf48hd83qwkj', // Application id (Oz)
+ dlg: 'd8djwekds9cj' // Delegated by application id (Oz), requires options.app
+ }
+*/
+
+exports.calculateMac = function (type, credentials, options) {
+
+ var normalized = exports.generateNormalizedString(type, options);
+
+ var hmac = Crypto.createHmac(credentials.algorithm, credentials.key).update(normalized);
+ var digest = hmac.digest('base64');
+ return digest;
+};
+
+
+exports.generateNormalizedString = function (type, options) {
+
+ var resource = options.resource || '';
+ if (resource &&
+ resource[0] !== '/') {
+
+ var url = Url.parse(resource, false);
+ resource = url.path; // Includes query
+ }
+
+ var normalized = 'hawk.' + exports.headerVersion + '.' + type + '\n' +
+ options.ts + '\n' +
+ options.nonce + '\n' +
+ (options.method || '').toUpperCase() + '\n' +
+ resource + '\n' +
+ options.host.toLowerCase() + '\n' +
+ options.port + '\n' +
+ (options.hash || '') + '\n';
+
+ if (options.ext) {
+ normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
+ }
+
+ normalized += '\n';
+
+ if (options.app) {
+ normalized += options.app + '\n' +
+ (options.dlg || '') + '\n';
+ }
+
+ return normalized;
+};
+
+
+exports.calculatePayloadHash = function (payload, algorithm, contentType) {
+
+ var hash = exports.initializePayloadHash(algorithm, contentType);
+ hash.update(payload || '');
+ return exports.finalizePayloadHash(hash);
+};
+
+
+exports.initializePayloadHash = function (algorithm, contentType) {
+
+ var hash = Crypto.createHash(algorithm);
+ hash.update('hawk.' + exports.headerVersion + '.payload\n');
+ hash.update(Utils.parseContentType(contentType) + '\n');
+ return hash;
+};
+
+
+exports.finalizePayloadHash = function (hash) {
+
+ hash.update('\n');
+ return hash.digest('base64');
+};
+
+
+exports.calculateTsMac = function (ts, credentials) {
+
+ var hmac = Crypto.createHmac(credentials.algorithm, credentials.key);
+ hmac.update('hawk.' + exports.headerVersion + '.ts\n' + ts + '\n');
+ return hmac.digest('base64');
+};
+
+
+exports.timestampMessage = function (credentials, localtimeOffsetMsec) {
+
+ var now = Utils.nowSecs(localtimeOffsetMsec);
+ var tsm = exports.calculateTsMac(now, credentials);
+ return { ts: now, tsm: tsm };
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/index.js b/node_modules/request/node_modules/hawk/lib/index.js
new file mode 100755
index 0000000..a883882
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/index.js
@@ -0,0 +1,15 @@
+// Export sub-modules
+
+exports.error = exports.Error = require('boom');
+exports.sntp = require('sntp');
+
+exports.server = require('./server');
+exports.client = require('./client');
+exports.crypto = require('./crypto');
+exports.utils = require('./utils');
+
+exports.uri = {
+ authenticate: exports.server.authenticateBewit,
+ getBewit: exports.client.getBewit
+};
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/lib/server.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/server.js b/node_modules/request/node_modules/hawk/lib/server.js
new file mode 100755
index 0000000..a803930
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/server.js
@@ -0,0 +1,534 @@
+// Load modules
+
+var Boom = require('boom');
+var Hoek = require('hoek');
+var Cryptiles = require('cryptiles');
+var Crypto = require('./crypto');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Hawk authentication
+
+/*
+ req: node's HTTP request object or an object as follows:
+
+ var request = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
+ };
+
+ credentialsFunc: required function to lookup the set of Hawk credentials based on the provided credentials id.
+ The credentials include the MAC key, MAC algorithm, and other attributes (such as username)
+ needed by the application. This function is the equivalent of verifying the username and
+ password in Basic authentication.
+
+ var credentialsFunc = function (id, callback) {
+
+ // Lookup credentials in database
+ db.lookup(id, function (err, item) {
+
+ if (err || !item) {
+ return callback(err);
+ }
+
+ var credentials = {
+ // Required
+ key: item.key,
+ algorithm: item.algorithm,
+ // Application specific
+ user: item.user
+ };
+
+ return callback(null, credentials);
+ });
+ };
+
+ options: {
+
+ hostHeaderName: optional header field name, used to override the default 'Host' header when used
+ behind a cache of a proxy. Apache2 changes the value of the 'Host' header while preserving
+ the original (which is what the module must verify) in the 'x-forwarded-host' header field.
+ Only used when passed a node Http.ServerRequest object.
+
+ nonceFunc: optional nonce validation function. The function signature is function(nonce, ts, callback)
+ where 'callback' must be called using the signature function(err).
+
+ timestampSkewSec: optional number of seconds of permitted clock skew for incoming timestamps. Defaults to 60 seconds.
+ Provides a +/- skew which means actual allowed window is double the number of seconds.
+
+ localtimeOffsetMsec: optional local clock time offset express in a number of milliseconds (positive or negative).
+ Defaults to 0.
+
+ payload: optional payload for validation. The client calculates the hash value and includes it via the 'hash'
+ header attribute. The server always ensures the value provided has been included in the request
+ MAC. When this option is provided, it validates the hash value itself. Validation is done by calculating
+ a hash value over the entire payload (assuming it has already be normalized to the same format and
+ encoding used by the client to calculate the hash on request). If the payload is not available at the time
+ of authentication, the authenticatePayload() method can be used by passing it the credentials and
+ attributes.hash returned in the authenticate callback.
+
+ host: optional host name override. Only used when passed a node request object.
+ port: optional port override. Only used when passed a node request object.
+ }
+
+ callback: function (err, credentials, artifacts) { }
+ */
+
+exports.authenticate = function (req, credentialsFunc, options, callback) {
+
+ callback = Hoek.nextTick(callback);
+
+ // Default options
+
+ options.nonceFunc = options.nonceFunc || function (nonce, ts, nonceCallback) { return nonceCallback(); }; // No validation
+ options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing
+
+ // Convert node Http request object to a request configuration object
+
+ var request = Utils.parseRequest(req, options);
+ if (request instanceof Error) {
+ return callback(Boom.badRequest(request.message));
+ }
+
+ // Parse HTTP Authorization header
+
+ var attributes = Utils.parseAuthorizationHeader(request.authorization);
+ if (attributes instanceof Error) {
+ return callback(attributes);
+ }
+
+ // Construct artifacts container
+
+ var artifacts = {
+ method: request.method,
+ host: request.host,
+ port: request.port,
+ resource: request.url,
+ ts: attributes.ts,
+ nonce: attributes.nonce,
+ hash: attributes.hash,
+ ext: attributes.ext,
+ app: attributes.app,
+ dlg: attributes.dlg,
+ mac: attributes.mac,
+ id: attributes.id
+ };
+
+ // Verify required header attributes
+
+ if (!attributes.id ||
+ !attributes.ts ||
+ !attributes.nonce ||
+ !attributes.mac) {
+
+ return callback(Boom.badRequest('Missing attributes'), null, artifacts);
+ }
+
+ // Fetch Hawk credentials
+
+ credentialsFunc(attributes.id, function (err, credentials) {
+
+ if (err) {
+ return callback(err, credentials || null, artifacts);
+ }
+
+ if (!credentials) {
+ return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, artifacts);
+ }
+
+ if (!credentials.key ||
+ !credentials.algorithm) {
+
+ return callback(Boom.internal('Invalid credentials'), credentials, artifacts);
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return callback(Boom.internal('Unknown algorithm'), credentials, artifacts);
+ }
+
+ // Calculate MAC
+
+ var mac = Crypto.calculateMac('header', credentials, artifacts);
+ if (!Cryptiles.fixedTimeComparison(mac, attributes.mac)) {
+ return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, artifacts);
+ }
+
+ // Check payload hash
+
+ if (options.payload ||
+ options.payload === '') {
+
+ if (!attributes.hash) {
+ return callback(Boom.unauthorized('Missing required payload hash', 'Hawk'), credentials, artifacts);
+ }
+
+ var hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, request.contentType);
+ if (!Cryptiles.fixedTimeComparison(hash, attributes.hash)) {
+ return callback(Boom.unauthorized('Bad payload hash', 'Hawk'), credentials, artifacts);
+ }
+ }
+
+ // Check nonce
+
+ options.nonceFunc(attributes.nonce, attributes.ts, function (err) {
+
+ if (err) {
+ return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials, artifacts);
+ }
+
+ // Check timestamp staleness
+
+ if (Math.abs((attributes.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
+ var tsm = Crypto.timestampMessage(credentials, options.localtimeOffsetMsec);
+ return callback(Boom.unauthorized('Stale timestamp', 'Hawk', tsm), credentials, artifacts);
+ }
+
+ // Successful authentication
+
+ return callback(null, credentials, artifacts);
+ });
+ });
+};
+
+
+// Authenticate payload hash - used when payload cannot be provided during authenticate()
+
+/*
+ payload: raw request payload
+ credentials: from authenticate callback
+ artifacts: from authenticate callback
+ contentType: req.headers['content-type']
+*/
+
+exports.authenticatePayload = function (payload, credentials, artifacts, contentType) {
+
+ var calculatedHash = Crypto.calculatePayloadHash(payload, credentials.algorithm, contentType);
+ return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash);
+};
+
+
+// Authenticate payload hash - used when payload cannot be provided during authenticate()
+
+/*
+ calculatedHash: the payload hash calculated using Crypto.calculatePayloadHash()
+ artifacts: from authenticate callback
+*/
+
+exports.authenticatePayloadHash = function (calculatedHash, artifacts) {
+
+ return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash);
+};
+
+
+// Generate a Server-Authorization header for a given response
+
+/*
+ credentials: {}, // Object received from authenticate()
+ artifacts: {} // Object received from authenticate(); 'mac', 'hash', and 'ext' - ignored
+ options: {
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
+ contentType: 'application/json', // Payload content-type (ignored if hash provided)
+ hash: 'U4MKKSmiVxk37JCCrAVIjV=' // Pre-calculated payload hash
+ }
+*/
+
+exports.header = function (credentials, artifacts, options) {
+
+ // Prepare inputs
+
+ options = options || {};
+
+ if (!artifacts ||
+ typeof artifacts !== 'object' ||
+ typeof options !== 'object') {
+
+ return '';
+ }
+
+ artifacts = Hoek.clone(artifacts);
+ delete artifacts.mac;
+ artifacts.hash = options.hash;
+ artifacts.ext = options.ext;
+
+ // Validate credentials
+
+ if (!credentials ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ // Invalid credential object
+ return '';
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return '';
+ }
+
+ // Calculate payload hash
+
+ if (!artifacts.hash &&
+ (options.payload || options.payload === '')) {
+
+ artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ }
+
+ var mac = Crypto.calculateMac('response', credentials, artifacts);
+
+ // Construct header
+
+ var header = 'Hawk mac="' + mac + '"' +
+ (artifacts.hash ? ', hash="' + artifacts.hash + '"' : '');
+
+ if (artifacts.ext !== null &&
+ artifacts.ext !== undefined &&
+ artifacts.ext !== '') { // Other falsey values allowed
+
+ header += ', ext="' + Hoek.escapeHeaderAttribute(artifacts.ext) + '"';
+ }
+
+ return header;
+};
+
+
+/*
+ * Arguments and options are the same as authenticate() with the exception that the only supported options are:
+ * 'hostHeaderName', 'localtimeOffsetMsec', 'host', 'port'
+ */
+
+exports.authenticateBewit = function (req, credentialsFunc, options, callback) {
+
+ callback = Hoek.nextTick(callback);
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec);
+
+ // Convert node Http request object to a request configuration object
+
+ var request = Utils.parseRequest(req, options);
+ if (request instanceof Error) {
+ return callback(Boom.badRequest(request.message));
+ }
+
+ // Extract bewit
+
+ // 1 2 3 4
+ var resource = request.url.match(/^(\/.*)([\?&])bewit\=([^&$]*)(?:&(.+))?$/);
+ if (!resource) {
+ return callback(Boom.unauthorized(null, 'Hawk'));
+ }
+
+ // Bewit not empty
+
+ if (!resource[3]) {
+ return callback(Boom.unauthorized('Empty bewit', 'Hawk'));
+ }
+
+ // Verify method is GET
+
+ if (request.method !== 'GET' &&
+ request.method !== 'HEAD') {
+
+ return callback(Boom.unauthorized('Invalid method', 'Hawk'));
+ }
+
+ // No other authentication
+
+ if (request.authorization) {
+ return callback(Boom.badRequest('Multiple authentications'));
+ }
+
+ // Parse bewit
+
+ var bewitString = Hoek.base64urlDecode(resource[3]);
+ if (bewitString instanceof Error) {
+ return callback(Boom.badRequest('Invalid bewit encoding'));
+ }
+
+ // Bewit format: id\exp\mac\ext ('\' is used because it is a reserved header attribute character)
+
+ var bewitParts = bewitString.split('\\');
+ if (bewitParts.length !== 4) {
+ return callback(Boom.badRequest('Invalid bewit structure'));
+ }
+
+ var bewit = {
+ id: bewitParts[0],
+ exp: parseInt(bewitParts[1], 10),
+ mac: bewitParts[2],
+ ext: bewitParts[3] || ''
+ };
+
+ if (!bewit.id ||
+ !bewit.exp ||
+ !bewit.mac) {
+
+ return callback(Boom.badRequest('Missing bewit attributes'));
+ }
+
+ // Construct URL without bewit
+
+ var url = resource[1];
+ if (resource[4]) {
+ url += resource[2] + resource[4];
+ }
+
+ // Check expiration
+
+ if (bewit.exp * 1000 <= now) {
+ return callback(Boom.unauthorized('Access expired', 'Hawk'), null, bewit);
+ }
+
+ // Fetch Hawk credentials
+
+ credentialsFunc(bewit.id, function (err, credentials) {
+
+ if (err) {
+ return callback(err, credentials || null, bewit.ext);
+ }
+
+ if (!credentials) {
+ return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, bewit);
+ }
+
+ if (!credentials.key ||
+ !credentials.algorithm) {
+
+ return callback(Boom.internal('Invalid credentials'), credentials, bewit);
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return callback(Boom.internal('Unknown algorithm'), credentials, bewit);
+ }
+
+ // Calculate MAC
+
+ var mac = Crypto.calculateMac('bewit', credentials, {
+ ts: bewit.exp,
+ nonce: '',
+ method: 'GET',
+ resource: url,
+ host: request.host,
+ port: request.port,
+ ext: bewit.ext
+ });
+
+ if (!Cryptiles.fixedTimeComparison(mac, bewit.mac)) {
+ return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, bewit);
+ }
+
+ // Successful authentication
+
+ return callback(null, credentials, bewit);
+ });
+};
+
+
+/*
+ * options are the same as authenticate() with the exception that the only supported options are:
+ * 'nonceFunc', 'timestampSkewSec', 'localtimeOffsetMsec'
+ */
+
+exports.authenticateMessage = function (host, port, message, authorization, credentialsFunc, options, callback) {
+
+ callback = Hoek.nextTick(callback);
+
+ // Default options
+
+ options.nonceFunc = options.nonceFunc || function (nonce, ts, nonceCallback) { return nonceCallback(); }; // No validation
+ options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing
+
+ // Validate authorization
+
+ if (!authorization.id ||
+ !authorization.ts ||
+ !authorization.nonce ||
+ !authorization.hash ||
+ !authorization.mac) {
+
+ return callback(Boom.badRequest('Invalid authorization'))
+ }
+
+ // Fetch Hawk credentials
+
+ credentialsFunc(authorization.id, function (err, credentials) {
+
+ if (err) {
+ return callback(err, credentials || null);
+ }
+
+ if (!credentials) {
+ return callback(Boom.unauthorized('Unknown credentials', 'Hawk'));
+ }
+
+ if (!credentials.key ||
+ !credentials.algorithm) {
+
+ return callback(Boom.internal('Invalid credentials'), credentials);
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return callback(Boom.internal('Unknown algorithm'), credentials);
+ }
+
+ // Construct artifacts container
+
+ var artifacts = {
+ ts: authorization.ts,
+ nonce: authorization.nonce,
+ host: host,
+ port: port,
+ hash: authorization.hash
+ };
+
+ // Calculate MAC
+
+ var mac = Crypto.calculateMac('message', credentials, artifacts);
+ if (!Cryptiles.fixedTimeComparison(mac, authorization.mac)) {
+ return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials);
+ }
+
+ // Check payload hash
+
+ var hash = Crypto.calculatePayloadHash(message, credentials.algorithm);
+ if (!Cryptiles.fixedTimeComparison(hash, authorization.hash)) {
+ return callback(Boom.unauthorized('Bad message hash', 'Hawk'), credentials);
+ }
+
+ // Check nonce
+
+ options.nonceFunc(authorization.nonce, authorization.ts, function (err) {
+
+ if (err) {
+ return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials);
+ }
+
+ // Check timestamp staleness
+
+ if (Math.abs((authorization.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
+ return callback(Boom.unauthorized('Stale timestamp'), credentials);
+ }
+
+ // Successful authentication
+
+ return callback(null, credentials);
+ });
+ });
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/lib/utils.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/lib/utils.js b/node_modules/request/node_modules/hawk/lib/utils.js
new file mode 100755
index 0000000..de74606
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/utils.js
@@ -0,0 +1,164 @@
+// Load modules
+
+var Sntp = require('sntp');
+var Boom = require('boom');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.version = function () {
+
+ return require('../package.json').version;
+};
+
+
+// Extract host and port from request
+
+// $1 $2
+internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+))?(?:(?:\r\n)?\s)*$/; // (IPv4, hostname)|(IPv6)
+
+
+exports.parseHost = function (req, hostHeaderName) {
+
+ hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host');
+ var hostHeader = req.headers[hostHeaderName];
+ if (!hostHeader) {
+ return null;
+ }
+
+ var hostParts = hostHeader.match(internals.hostHeaderRegex);
+ if (!hostParts) {
+ return null;
+ }
+
+ return {
+ name: hostParts[1],
+ port: (hostParts[2] ? hostParts[2] : (req.connection && req.connection.encrypted ? 443 : 80))
+ };
+};
+
+
+// Parse Content-Type header content
+
+exports.parseContentType = function (header) {
+
+ if (!header) {
+ return '';
+ }
+
+ return header.split(';')[0].trim().toLowerCase();
+};
+
+
+// Convert node's to request configuration object
+
+exports.parseRequest = function (req, options) {
+
+ if (!req.headers) {
+ return req;
+ }
+
+ // Obtain host and port information
+
+ if (!options.host || !options.port) {
+ var host = exports.parseHost(req, options.hostHeaderName);
+ if (!host) {
+ return new Error('Invalid Host header');
+ }
+ }
+
+ var request = {
+ method: req.method,
+ url: req.url,
+ host: options.host || host.name,
+ port: options.port || host.port,
+ authorization: req.headers.authorization,
+ contentType: req.headers['content-type'] || ''
+ };
+
+ return request;
+};
+
+
+exports.now = function (localtimeOffsetMsec) {
+
+ return Sntp.now() + (localtimeOffsetMsec || 0);
+};
+
+
+exports.nowSecs = function (localtimeOffsetMsec) {
+
+ return Math.floor(exports.now(localtimeOffsetMsec) / 1000);
+};
+
+
+// Parse Hawk HTTP Authorization header
+
+exports.parseAuthorizationHeader = function (header, keys) {
+
+ keys = keys || ['id', 'ts', 'nonce', 'hash', 'ext', 'mac', 'app', 'dlg'];
+
+ if (!header) {
+ return Boom.unauthorized(null, 'Hawk');
+ }
+
+ var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/); // Header: scheme[ something]
+ if (!headerParts) {
+ return Boom.badRequest('Invalid header syntax');
+ }
+
+ var scheme = headerParts[1];
+ if (scheme.toLowerCase() !== 'hawk') {
+ return Boom.unauthorized(null, 'Hawk');
+ }
+
+ var attributesString = headerParts[2];
+ if (!attributesString) {
+ return Boom.badRequest('Invalid header syntax');
+ }
+
+ var attributes = {};
+ var errorMessage = '';
+ var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
+
+ // Check valid attribute names
+
+ if (keys.indexOf($1) === -1) {
+ errorMessage = 'Unknown attribute: ' + $1;
+ return;
+ }
+
+ // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+
+ if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
+ errorMessage = 'Bad attribute value: ' + $1;
+ return;
+ }
+
+ // Check for duplicates
+
+ if (attributes.hasOwnProperty($1)) {
+ errorMessage = 'Duplicate attribute: ' + $1;
+ return;
+ }
+
+ attributes[$1] = $2;
+ return '';
+ });
+
+ if (verify !== '') {
+ return Boom.badRequest(errorMessage || 'Bad header format');
+ }
+
+ return attributes;
+};
+
+
+exports.unauthorized = function (message) {
+
+ return Boom.unauthorized(message, 'Hawk');
+};
+
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/boom/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/README.md b/node_modules/request/node_modules/hawk/node_modules/boom/README.md
index c28507d..43f1562 100755
--- a/node_modules/request/node_modules/hawk/node_modules/boom/README.md
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/README.md
@@ -3,6 +3,7 @@
HTTP-friendly error objects
[](http://travis-ci.org/hapijs/boom)
+[](https://www.npmjs.com/package/boom)
Lead Maintainer: [Adam Bretz](https://github.com/arb)
@@ -574,3 +575,9 @@ Generates the following response payload:
"message": "An internal server error occurred"
}
```
+
+## F.A.Q.
+
+###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives?
+
+There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
new file mode 100755
index 0000000..256bf32
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
@@ -0,0 +1,293 @@
+// Load modules
+
+var Http = require('http');
+var Hoek = require('hoek');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.wrap = function (error, statusCode, message) {
+
+ Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object');
+ return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message));
+};
+
+
+exports.create = function (statusCode, message, data) {
+
+ var error = new Error(message ? message : undefined); // Avoids settings null message
+ error.data = data || null;
+ internals.initialize(error, statusCode);
+ return error;
+};
+
+
+internals.initialize = function (error, statusCode, message) {
+
+ var numberCode = parseInt(statusCode, 10);
+ Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode);
+
+ error.isBoom = true;
+ error.isServer = numberCode >= 500;
+
+ if (!error.hasOwnProperty('data')) {
+ error.data = null;
+ }
+
+ error.output = {
+ statusCode: numberCode,
+ payload: {},
+ headers: {}
+ };
+
+ error.reformat = internals.reformat;
+ error.reformat();
+
+ if (!message &&
+ !error.message) {
+
+ message = error.output.payload.error;
+ }
+
+ if (message) {
+ error.message = (message + (error.message ? ': ' + error.message : ''));
+ }
+
+ return error;
+};
+
+
+internals.reformat = function () {
+
+ this.output.payload.statusCode = this.output.statusCode;
+ this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown';
+
+ if (this.output.statusCode === 500) {
+ this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user
+ }
+ else if (this.message) {
+ this.output.payload.message = this.message;
+ }
+};
+
+
+// 4xx Client Errors
+
+exports.badRequest = function (message, data) {
+
+ return exports.create(400, message, data);
+};
+
+
+exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[])
+
+ var err = exports.create(401, message);
+
+ if (!scheme) {
+ return err;
+ }
+
+ var wwwAuthenticate = '';
+ var i = 0;
+ var il = 0;
+
+ if (typeof scheme === 'string') {
+
+ // function (message, scheme, attributes)
+
+ wwwAuthenticate = scheme;
+ if (attributes) {
+ var names = Object.keys(attributes);
+ for (i = 0, il = names.length; i < il; ++i) {
+ if (i) {
+ wwwAuthenticate += ',';
+ }
+
+ var value = attributes[names[i]];
+ if (value === null ||
+ value === undefined) { // Value can be zero
+
+ value = '';
+ }
+ wwwAuthenticate += ' ' + names[i] + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
+ }
+ }
+
+ if (message) {
+ if (attributes) {
+ wwwAuthenticate += ',';
+ }
+ wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"';
+ }
+ else {
+ err.isMissing = true;
+ }
+ }
+ else {
+
+ // function (message, wwwAuthenticate[])
+
+ var wwwArray = scheme;
+ for (i = 0, il = wwwArray.length; i < il; ++i) {
+ if (i) {
+ wwwAuthenticate += ', ';
+ }
+
+ wwwAuthenticate += wwwArray[i];
+ }
+ }
+
+ err.output.headers['WWW-Authenticate'] = wwwAuthenticate;
+
+ return err;
+};
+
+
+exports.forbidden = function (message, data) {
+
+ return exports.create(403, message, data);
+};
+
+
+exports.notFound = function (message, data) {
+
+ return exports.create(404, message, data);
+};
+
+
+exports.methodNotAllowed = function (message, data) {
+
+ return exports.create(405, message, data);
+};
+
+
+exports.notAcceptable = function (message, data) {
+
+ return exports.create(406, message, data);
+};
+
+
+exports.proxyAuthRequired = function (message, data) {
+
+ return exports.create(407, message, data);
+};
+
+
+exports.clientTimeout = function (message, data) {
+
+ return exports.create(408, message, data);
+};
+
+
+exports.conflict = function (message, data) {
+
+ return exports.create(409, message, data);
+};
+
+
+exports.resourceGone = function (message, data) {
+
+ return exports.create(410, message, data);
+};
+
+
+exports.lengthRequired = function (message, data) {
+
+ return exports.create(411, message, data);
+};
+
+
+exports.preconditionFailed = function (message, data) {
+
+ return exports.create(412, message, data);
+};
+
+
+exports.entityTooLarge = function (message, data) {
+
+ return exports.create(413, message, data);
+};
+
+
+exports.uriTooLong = function (message, data) {
+
+ return exports.create(414, message, data);
+};
+
+
+exports.unsupportedMediaType = function (message, data) {
+
+ return exports.create(415, message, data);
+};
+
+
+exports.rangeNotSatisfiable = function (message, data) {
+
+ return exports.create(416, message, data);
+};
+
+
+exports.expectationFailed = function (message, data) {
+
+ return exports.create(417, message, data);
+};
+
+exports.badData = function (message, data) {
+
+ return exports.create(422, message, data);
+};
+
+
+exports.tooManyRequests = function (message, data) {
+
+ return exports.create(429, message, data);
+};
+
+
+// 5xx Server Errors
+
+exports.internal = function (message, data, statusCode) {
+
+ var error = (data instanceof Error ? exports.wrap(data, statusCode, message) : exports.create(statusCode || 500, message));
+
+ if (data instanceof Error === false) {
+ error.data = data;
+ }
+
+ return error;
+};
+
+
+exports.notImplemented = function (message, data) {
+
+ return exports.internal(message, data, 501);
+};
+
+
+exports.badGateway = function (message, data) {
+
+ return exports.internal(message, data, 502);
+};
+
+
+exports.serverTimeout = function (message, data) {
+
+ return exports.internal(message, data, 503);
+};
+
+
+exports.gatewayTimeout = function (message, data) {
+
+ return exports.internal(message, data, 504);
+};
+
+
+exports.badImplementation = function (message, data) {
+
+ var err = exports.internal(message, data, 500);
+ err.isDeveloperError = true;
+ return err;
+};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/boom/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/node_modules/request/node_modules/hawk/node_modules/boom/package.json
index 72fd0ed..ba76f4d 100644
--- a/node_modules/request/node_modules/hawk/node_modules/boom/package.json
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/package.json
@@ -1,7 +1,7 @@
{
"name": "boom",
"description": "HTTP-friendly error objects",
- "version": "2.7.1",
+ "version": "2.7.2",
"repository": {
"type": "git",
"url": "git://github.com/hapijs/boom"
@@ -25,22 +25,17 @@
"test": "lab -a code -t 100",
"test-cov-html": "lab -a code -r html -o coverage.html"
},
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/hapijs/boom/raw/master/LICENSE"
- }
- ],
- "gitHead": "7ff4ee336ccae7d706065a6ee941a1db2d434ab9",
+ "license": "BSD-3-Clause",
+ "gitHead": "29be188e9ecfce3a2e090b8714dec2b6e0791724",
"bugs": {
"url": "https://github.com/hapijs/boom/issues"
},
"homepage": "https://github.com/hapijs/boom",
- "_id": "boom@2.7.1",
- "_shasum": "fb165c348d337977c61d4363c21e9e1abf526705",
+ "_id": "boom@2.7.2",
+ "_shasum": "dad628d897f7fd2e32cc82197f13307971cf8354",
"_from": "boom@>=2.0.0 <3.0.0",
"_npmVersion": "2.7.0",
- "_nodeVersion": "0.10.36",
+ "_nodeVersion": "0.10.38",
"_npmUser": {
"name": "arb",
"email": "arbretz@gmail.com"
@@ -60,10 +55,10 @@
}
],
"dist": {
- "shasum": "fb165c348d337977c61d4363c21e9e1abf526705",
- "tarball": "http://registry.npmjs.org/boom/-/boom-2.7.1.tgz"
+ "shasum": "dad628d897f7fd2e32cc82197f13307971cf8354",
+ "tarball": "http://registry.npmjs.org/boom/-/boom-2.7.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/boom/-/boom-2.7.1.tgz",
+ "_resolved": "https://registry.npmjs.org/boom/-/boom-2.7.2.tgz",
"readme": "ERROR: No README data found!"
}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/a67e6ba7/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
new file mode 100755
index 0000000..f385870
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
@@ -0,0 +1,68 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Boom = require('boom');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Generate a cryptographically strong pseudo-random data
+
+exports.randomString = function (size) {
+
+ var buffer = exports.randomBits((size + 1) * 6);
+ if (buffer instanceof Error) {
+ return buffer;
+ }
+
+ var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+ return string.slice(0, size);
+};
+
+
+exports.randomBits = function (bits) {
+
+ if (!bits ||
+ bits < 0) {
+
+ return Boom.internal('Invalid random bits count');
+ }
+
+ var bytes = Math.ceil(bits / 8);
+ try {
+ return Crypto.randomBytes(bytes);
+ }
+ catch (err) {
+ return Boom.internal('Failed generating random bits: ' + err.message);
+ }
+};
+
+
+// Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match)
+
+exports.fixedTimeComparison = function (a, b) {
+
+ if (typeof a !== 'string' ||
+ typeof b !== 'string') {
+
+ return false;
+ }
+
+ var mismatch = (a.length === b.length ? 0 : 1);
+ if (mismatch) {
+ b = a;
+ }
+
+ for (var i = 0, il = a.length; i < il; ++i) {
+ var ac = a.charCodeAt(i);
+ var bc = b.charCodeAt(i);
+ mismatch |= (ac ^ bc);
+ }
+
+ return (mismatch === 0);
+};
+
+
[43/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js
deleted file mode 100644
index 4e0a34b..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js
+++ /dev/null
@@ -1,84 +0,0 @@
-exports.valid = {
- fullName : "John Doe",
- age : 47,
- state : "Massachusetts",
- city : "Boston",
- zip : 16417,
- married : false,
- dozen : 12,
- dozenOrBakersDozen : 13,
- favoriteEvenNumber : 14,
- topThreeFavoriteColors : [ "red", "blue", "green" ],
- favoriteSingleDigitWholeNumbers : [ 7 ],
- favoriteFiveLetterWord : "coder",
- emailAddresses :
- [
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org",
- "01234567890@numbers-in-local.net",
- "&'*+-./=?^_{}~@other-valid-characters-in-local.net",
- "mixed-1234-in-{+^}-local@sld.net",
- "a@single-character-in-local.org",
- "\"quoted\"@sld.com",
- "\"\\e\\s\\c\\a\\p\\e\\d\"@sld.com",
- "\"quoted-at-sign@sld.org\"@sld.com",
- "\"escaped\\\"quote\"@sld.com",
- "\"back\\slash\"@sld.com",
- "one-character-third-level@a.example.com",
- "single-character-in-sld@x.org",
- "local@dash-in-sld.com",
- "letters-in-sld@123.com",
- "one-letter-sld@x.org",
- "uncommon-tld@sld.museum",
- "uncommon-tld@sld.travel",
- "uncommon-tld@sld.mobi",
- "country-code-tld@sld.uk",
- "country-code-tld@sld.rw",
- "local@sld.newTLD",
- "the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org",
- "the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com",
- "local@sub.domains.com"
- ],
- ipAddresses : [ "127.0.0.1", "24.48.64.2", "192.168.1.1", "209.68.44.3", "2.2.2.2" ]
-}
-
-exports.invalid = {
- fullName : null,
- age : -1,
- state : 47,
- city : false,
- zip : [null],
- married : "yes",
- dozen : 50,
- dozenOrBakersDozen : "over 9000",
- favoriteEvenNumber : 15,
- topThreeFavoriteColors : [ "red", 5 ],
- favoriteSingleDigitWholeNumbers : [ 78, 2, 999 ],
- favoriteFiveLetterWord : "codernaut",
- emailAddresses : [],
- ipAddresses : [ "999.0.099.1", "294.48.64.2346", false, "2221409.64214128.42414.235233", "124124.12412412" ]
-}
-
-exports.schema = { // from cosmic thingy
- name : "test",
- type : "object",
- additionalProperties : false,
- required : ["fullName", "age", "zip", "married", "dozen", "dozenOrBakersDozen", "favoriteEvenNumber", "topThreeFavoriteColors", "favoriteSingleDigitWholeNumbers", "favoriteFiveLetterWord", "emailAddresses", "ipAddresses"],
- properties :
- {
- fullName : { type : "string" },
- age : { type : "integer", minimum : 0 },
- optionalItem : { type : "string" },
- state : { type : "string" },
- city : { type : "string" },
- zip : { type : "integer", minimum : 0, maximum : 99999 },
- married : { type : "boolean" },
- dozen : { type : "integer", minimum : 12, maximum : 12 },
- dozenOrBakersDozen : { type : "integer", minimum : 12, maximum : 13 },
- favoriteEvenNumber : { type : "integer", multipleOf : 2 },
- topThreeFavoriteColors : { type : "array", minItems : 3, maxItems : 3, uniqueItems : true, items : { type : "string" }},
- favoriteSingleDigitWholeNumbers : { type : "array", minItems : 1, maxItems : 10, uniqueItems : true, items : { type : "integer", minimum : 0, maximum : 9 }},
- favoriteFiveLetterWord : { type : "string", minLength : 5, maxLength : 5 },
- emailAddresses : { type : "array", minItems : 1, uniqueItems : true, items : { type : "string", format : "email" }},
- ipAddresses : { type : "array", uniqueItems : true, items : { type : "string", format : "ipv4" }},
- }
- }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json
deleted file mode 100644
index 521745c..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json
+++ /dev/null
@@ -1,82 +0,0 @@
-[
- {
- "description": "additionalItems as schema",
- "schema": {
- "items": [{}],
- "additionalItems": {"type": "integer"}
- },
- "tests": [
- {
- "description": "additional items match schema",
- "data": [ null, 2, 3, 4 ],
- "valid": true
- },
- {
- "description": "additional items do not match schema",
- "data": [ null, 2, 3, "foo" ],
- "valid": false
- }
- ]
- },
- {
- "description": "items is schema, no additionalItems",
- "schema": {
- "items": {},
- "additionalItems": false
- },
- "tests": [
- {
- "description": "all items match schema",
- "data": [ 1, 2, 3, 4, 5 ],
- "valid": true
- }
- ]
- },
- {
- "description": "array of items with no additionalItems",
- "schema": {
- "items": [{}, {}, {}],
- "additionalItems": false
- },
- "tests": [
- {
- "description": "no additional items present",
- "data": [ 1, 2, 3 ],
- "valid": true
- },
- {
- "description": "additional items are not permitted",
- "data": [ 1, 2, 3, 4 ],
- "valid": false
- }
- ]
- },
- {
- "description": "additionalItems as false without items",
- "schema": {"additionalItems": false},
- "tests": [
- {
- "description":
- "items defaults to empty schema so everything is valid",
- "data": [ 1, 2, 3, 4, 5 ],
- "valid": true
- },
- {
- "description": "ignores non-arrays",
- "data": {"foo" : "bar"},
- "valid": true
- }
- ]
- },
- {
- "description": "additionalItems are allowed by default",
- "schema": {"items": [{"type": "integer"}]},
- "tests": [
- {
- "description": "only the first item is validated",
- "data": [1, "foo", false],
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json
deleted file mode 100644
index 40831f9..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json
+++ /dev/null
@@ -1,88 +0,0 @@
-[
- {
- "description":
- "additionalProperties being false does not allow other properties",
- "schema": {
- "properties": {"foo": {}, "bar": {}},
- "patternProperties": { "^v": {} },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "no additional properties is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "an additional property is invalid",
- "data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": [1, 2, 3],
- "valid": true
- },
- {
- "description": "patternProperties are not additional properties",
- "data": {"foo":1, "vroom": 2},
- "valid": true
- }
- ]
- },
- {
- "description":
- "additionalProperties allows a schema which should validate",
- "schema": {
- "properties": {"foo": {}, "bar": {}},
- "additionalProperties": {"type": "boolean"}
- },
- "tests": [
- {
- "description": "no additional properties is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "an additional valid property is valid",
- "data": {"foo" : 1, "bar" : 2, "quux" : true},
- "valid": true
- },
- {
- "description": "an additional invalid property is invalid",
- "data": {"foo" : 1, "bar" : 2, "quux" : 12},
- "valid": false
- }
- ]
- },
- {
- "description":
- "additionalProperties can exist by itself",
- "schema": {
- "additionalProperties": {"type": "boolean"}
- },
- "tests": [
- {
- "description": "an additional valid property is valid",
- "data": {"foo" : true},
- "valid": true
- },
- {
- "description": "an additional invalid property is invalid",
- "data": {"foo" : 1},
- "valid": false
- }
- ]
- },
- {
- "description": "additionalProperties are allowed by default",
- "schema": {"properties": {"foo": {}, "bar": {}}},
- "tests": [
- {
- "description": "additional properties are allowed",
- "data": {"foo": 1, "bar": 2, "quux": true},
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json
deleted file mode 100644
index bbb5f89..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json
+++ /dev/null
@@ -1,112 +0,0 @@
-[
- {
- "description": "allOf",
- "schema": {
- "allOf": [
- {
- "properties": {
- "bar": {"type": "integer"}
- },
- "required": ["bar"]
- },
- {
- "properties": {
- "foo": {"type": "string"}
- },
- "required": ["foo"]
- }
- ]
- },
- "tests": [
- {
- "description": "allOf",
- "data": {"foo": "baz", "bar": 2},
- "valid": true
- },
- {
- "description": "mismatch second",
- "data": {"foo": "baz"},
- "valid": false
- },
- {
- "description": "mismatch first",
- "data": {"bar": 2},
- "valid": false
- },
- {
- "description": "wrong type",
- "data": {"foo": "baz", "bar": "quux"},
- "valid": false
- }
- ]
- },
- {
- "description": "allOf with base schema",
- "schema": {
- "properties": {"bar": {"type": "integer"}},
- "required": ["bar"],
- "allOf" : [
- {
- "properties": {
- "foo": {"type": "string"}
- },
- "required": ["foo"]
- },
- {
- "properties": {
- "baz": {"type": "null"}
- },
- "required": ["baz"]
- }
- ]
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": "quux", "bar": 2, "baz": null},
- "valid": true
- },
- {
- "description": "mismatch base schema",
- "data": {"foo": "quux", "baz": null},
- "valid": false
- },
- {
- "description": "mismatch first allOf",
- "data": {"bar": 2, "baz": null},
- "valid": false
- },
- {
- "description": "mismatch second allOf",
- "data": {"foo": "quux", "bar": 2},
- "valid": false
- },
- {
- "description": "mismatch both",
- "data": {"bar": 2},
- "valid": false
- }
- ]
- },
- {
- "description": "allOf simple types",
- "schema": {
- "allOf": [
- {"maximum": 30},
- {"minimum": 20}
- ]
- },
- "tests": [
- {
- "description": "valid",
- "data": 25,
- "valid": true
- },
- {
- "description": "mismatch one",
- "data": 35,
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json
deleted file mode 100644
index a58714a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json
+++ /dev/null
@@ -1,68 +0,0 @@
-[
- {
- "description": "anyOf",
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "minimum": 2
- }
- ]
- },
- "tests": [
- {
- "description": "first anyOf valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "second anyOf valid",
- "data": 2.5,
- "valid": true
- },
- {
- "description": "both anyOf valid",
- "data": 3,
- "valid": true
- },
- {
- "description": "neither anyOf valid",
- "data": 1.5,
- "valid": false
- }
- ]
- },
- {
- "description": "anyOf with base schema",
- "schema": {
- "type": "string",
- "anyOf" : [
- {
- "maxLength": 2
- },
- {
- "minLength": 4
- }
- ]
- },
- "tests": [
- {
- "description": "mismatch base schema",
- "data": 3,
- "valid": false
- },
- {
- "description": "one anyOf valid",
- "data": "foobar",
- "valid": true
- },
- {
- "description": "both anyOf invalid",
- "data": "foo",
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json
deleted file mode 100644
index ccc7c17..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json
+++ /dev/null
@@ -1,107 +0,0 @@
-[
- {
- "description": "integer",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "a bignum is an integer",
- "data": 12345678910111213141516171819202122232425262728293031,
- "valid": true
- }
- ]
- },
- {
- "description": "number",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "a bignum is a number",
- "data": 98249283749234923498293171823948729348710298301928331,
- "valid": true
- }
- ]
- },
- {
- "description": "integer",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "a negative bignum is an integer",
- "data": -12345678910111213141516171819202122232425262728293031,
- "valid": true
- }
- ]
- },
- {
- "description": "number",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "a negative bignum is a number",
- "data": -98249283749234923498293171823948729348710298301928331,
- "valid": true
- }
- ]
- },
- {
- "description": "string",
- "schema": {"type": "string"},
- "tests": [
- {
- "description": "a bignum is not a string",
- "data": 98249283749234923498293171823948729348710298301928331,
- "valid": false
- }
- ]
- },
- {
- "description": "integer comparison",
- "schema": {"maximum": 18446744073709551615},
- "tests": [
- {
- "description": "comparison works for high numbers",
- "data": 18446744073709551600,
- "valid": true
- }
- ]
- },
- {
- "description": "float comparison with high precision",
- "schema": {
- "maximum": 972783798187987123879878123.18878137,
- "exclusiveMaximum": true
- },
- "tests": [
- {
- "description": "comparison works for high numbers",
- "data": 972783798187987123879878123.188781371,
- "valid": false
- }
- ]
- },
- {
- "description": "integer comparison",
- "schema": {"minimum": -18446744073709551615},
- "tests": [
- {
- "description": "comparison works for very negative numbers",
- "data": -18446744073709551600,
- "valid": true
- }
- ]
- },
- {
- "description": "float comparison with high precision on negative numbers",
- "schema": {
- "minimum": -972783798187987123879878123.18878137,
- "exclusiveMinimum": true
- },
- "tests": [
- {
- "description": "comparison works for very negative numbers",
- "data": -972783798187987123879878123.188781371,
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json
deleted file mode 100644
index 1762977..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json
+++ /dev/null
@@ -1,49 +0,0 @@
-[
- {
- "description": "invalid type for default",
- "schema": {
- "properties": {
- "foo": {
- "type": "integer",
- "default": []
- }
- }
- },
- "tests": [
- {
- "description": "valid when property is specified",
- "data": {"foo": 13},
- "valid": true
- },
- {
- "description": "still valid when the invalid default is used",
- "data": {},
- "valid": true
- }
- ]
- },
- {
- "description": "invalid string value for default",
- "schema": {
- "properties": {
- "bar": {
- "type": "string",
- "minLength": 4,
- "default": "bad"
- }
- }
- },
- "tests": [
- {
- "description": "valid when property is specified",
- "data": {"bar": "good"},
- "valid": true
- },
- {
- "description": "still valid when the invalid default is used",
- "data": {},
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json
deleted file mode 100644
index cf935a3..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json
+++ /dev/null
@@ -1,32 +0,0 @@
-[
- {
- "description": "valid definition",
- "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
- "tests": [
- {
- "description": "valid definition schema",
- "data": {
- "definitions": {
- "foo": {"type": "integer"}
- }
- },
- "valid": true
- }
- ]
- },
- {
- "description": "invalid definition",
- "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
- "tests": [
- {
- "description": "invalid definition schema",
- "data": {
- "definitions": {
- "foo": {"type": 1}
- }
- },
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json
deleted file mode 100644
index 7b9b16a..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json
+++ /dev/null
@@ -1,113 +0,0 @@
-[
- {
- "description": "dependencies",
- "schema": {
- "dependencies": {"bar": ["foo"]}
- },
- "tests": [
- {
- "description": "neither",
- "data": {},
- "valid": true
- },
- {
- "description": "nondependant",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "with dependency",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "missing dependency",
- "data": {"bar": 2},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": "foo",
- "valid": true
- }
- ]
- },
- {
- "description": "multiple dependencies",
- "schema": {
- "dependencies": {"quux": ["foo", "bar"]}
- },
- "tests": [
- {
- "description": "neither",
- "data": {},
- "valid": true
- },
- {
- "description": "nondependants",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "with dependencies",
- "data": {"foo": 1, "bar": 2, "quux": 3},
- "valid": true
- },
- {
- "description": "missing dependency",
- "data": {"foo": 1, "quux": 2},
- "valid": false
- },
- {
- "description": "missing other dependency",
- "data": {"bar": 1, "quux": 2},
- "valid": false
- },
- {
- "description": "missing both dependencies",
- "data": {"quux": 1},
- "valid": false
- }
- ]
- },
- {
- "description": "multiple dependencies subschema",
- "schema": {
- "dependencies": {
- "bar": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"type": "integer"}
- }
- }
- }
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "no dependency",
- "data": {"foo": "quux"},
- "valid": true
- },
- {
- "description": "wrong type",
- "data": {"foo": "quux", "bar": 2},
- "valid": false
- },
- {
- "description": "wrong type other",
- "data": {"foo": 2, "bar": "quux"},
- "valid": false
- },
- {
- "description": "wrong type both",
- "data": {"foo": "quux", "bar": "quux"},
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json
deleted file mode 100644
index f124436..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json
+++ /dev/null
@@ -1,72 +0,0 @@
-[
- {
- "description": "simple enum validation",
- "schema": {"enum": [1, 2, 3]},
- "tests": [
- {
- "description": "one of the enum is valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "something else is invalid",
- "data": 4,
- "valid": false
- }
- ]
- },
- {
- "description": "heterogeneous enum validation",
- "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
- "tests": [
- {
- "description": "one of the enum is valid",
- "data": [],
- "valid": true
- },
- {
- "description": "something else is invalid",
- "data": null,
- "valid": false
- },
- {
- "description": "objects are deep compared",
- "data": {"foo": false},
- "valid": false
- }
- ]
- },
- {
- "description": "enums in properties",
- "schema": {
- "type":"object",
- "properties": {
- "foo": {"enum":["foo"]},
- "bar": {"enum":["bar"]}
- },
- "required": ["bar"]
- },
- "tests": [
- {
- "description": "both properties are valid",
- "data": {"foo":"foo", "bar":"bar"},
- "valid": true
- },
- {
- "description": "missing optional property is valid",
- "data": {"bar":"bar"},
- "valid": true
- },
- {
- "description": "missing required property is invalid",
- "data": {"foo":"foo"},
- "valid": false
- },
- {
- "description": "missing all properties is invalid",
- "data": {},
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json
deleted file mode 100644
index 53c5d25..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json
+++ /dev/null
@@ -1,143 +0,0 @@
-[
- {
- "description": "validation of date-time strings",
- "schema": {"format": "date-time"},
- "tests": [
- {
- "description": "a valid date-time string",
- "data": "1963-06-19T08:30:06.283185Z",
- "valid": true
- },
- {
- "description": "an invalid date-time string",
- "data": "06/19/1963 08:30:06 PST",
- "valid": false
- },
- {
- "description": "only RFC3339 not all of ISO 8601 are valid",
- "data": "2013-350T01:01:01",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of URIs",
- "schema": {"format": "uri"},
- "tests": [
- {
- "description": "a valid URI",
- "data": "http://foo.bar/?baz=qux#quux",
- "valid": true
- },
- {
- "description": "an invalid URI",
- "data": "\\\\WINDOWS\\fileshare",
- "valid": false
- },
- {
- "description": "an invalid URI though valid URI reference",
- "data": "abc",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of e-mail addresses",
- "schema": {"format": "email"},
- "tests": [
- {
- "description": "a valid e-mail address",
- "data": "joe.bloggs@example.com",
- "valid": true
- },
- {
- "description": "an invalid e-mail address",
- "data": "2962",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of IP addresses",
- "schema": {"format": "ipv4"},
- "tests": [
- {
- "description": "a valid IP address",
- "data": "192.168.0.1",
- "valid": true
- },
- {
- "description": "an IP address with too many components",
- "data": "127.0.0.0.1",
- "valid": false
- },
- {
- "description": "an IP address with out-of-range values",
- "data": "256.256.256.256",
- "valid": false
- },
- {
- "description": "an IP address without 4 components",
- "data": "127.0",
- "valid": false
- },
- {
- "description": "an IP address as an integer",
- "data": "0x7f000001",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of IPv6 addresses",
- "schema": {"format": "ipv6"},
- "tests": [
- {
- "description": "a valid IPv6 address",
- "data": "::1",
- "valid": true
- },
- {
- "description": "an IPv6 address with out-of-range values",
- "data": "12345::",
- "valid": false
- },
- {
- "description": "an IPv6 address with too many components",
- "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
- "valid": false
- },
- {
- "description": "an IPv6 address containing illegal characters",
- "data": "::laptop",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of host names",
- "schema": {"format": "hostname"},
- "tests": [
- {
- "description": "a valid host name",
- "data": "www.example.com",
- "valid": true
- },
- {
- "description": "a host name starting with an illegal character",
- "data": "-a-host-name-that-starts-with--",
- "valid": false
- },
- {
- "description": "a host name containing illegal characters",
- "data": "not_a_valid_host_name",
- "valid": false
- },
- {
- "description": "a host name with a component too long",
- "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json
deleted file mode 100644
index f5e18a1..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json
+++ /dev/null
@@ -1,46 +0,0 @@
-[
- {
- "description": "a schema given for items",
- "schema": {
- "items": {"type": "integer"}
- },
- "tests": [
- {
- "description": "valid items",
- "data": [ 1, 2, 3 ],
- "valid": true
- },
- {
- "description": "wrong type of items",
- "data": [1, "x"],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": {"foo" : "bar"},
- "valid": true
- }
- ]
- },
- {
- "description": "an array of schemas for items",
- "schema": {
- "items": [
- {"type": "integer"},
- {"type": "string"}
- ]
- },
- "tests": [
- {
- "description": "correct types",
- "data": [ 1, "foo" ],
- "valid": true
- },
- {
- "description": "wrong types",
- "data": [ "foo", 1 ],
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json
deleted file mode 100644
index 3b53a6b..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "maxItems validation",
- "schema": {"maxItems": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": [1],
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": [1, 2, 3],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": "foobar",
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json
deleted file mode 100644
index 48eb129..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "maxLength validation",
- "schema": {"maxLength": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": "f",
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": "fo",
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": "foo",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": 100,
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json
deleted file mode 100644
index d282446..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "maxProperties validation",
- "schema": {"maxProperties": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": {"foo": 1, "bar": 2, "baz": 3},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": "foobar",
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json
deleted file mode 100644
index 86c7b89..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json
+++ /dev/null
@@ -1,42 +0,0 @@
-[
- {
- "description": "maximum validation",
- "schema": {"maximum": 3.0},
- "tests": [
- {
- "description": "below the maximum is valid",
- "data": 2.6,
- "valid": true
- },
- {
- "description": "above the maximum is invalid",
- "data": 3.5,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "x",
- "valid": true
- }
- ]
- },
- {
- "description": "exclusiveMaximum validation",
- "schema": {
- "maximum": 3.0,
- "exclusiveMaximum": true
- },
- "tests": [
- {
- "description": "below the maximum is still valid",
- "data": 2.2,
- "valid": true
- },
- {
- "description": "boundary point is invalid",
- "data": 3.0,
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json
deleted file mode 100644
index ed51188..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "minItems validation",
- "schema": {"minItems": 1},
- "tests": [
- {
- "description": "longer is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": [1],
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": [],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": "",
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json
deleted file mode 100644
index e9c14b1..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "minLength validation",
- "schema": {"minLength": 2},
- "tests": [
- {
- "description": "longer is valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": "fo",
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": "f",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": 1,
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json
deleted file mode 100644
index a72c7d2..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "minProperties validation",
- "schema": {"minProperties": 1},
- "tests": [
- {
- "description": "longer is valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": {},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": "",
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json
deleted file mode 100644
index d5bf000..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json
+++ /dev/null
@@ -1,42 +0,0 @@
-[
- {
- "description": "minimum validation",
- "schema": {"minimum": 1.1},
- "tests": [
- {
- "description": "above the minimum is valid",
- "data": 2.6,
- "valid": true
- },
- {
- "description": "below the minimum is invalid",
- "data": 0.6,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "x",
- "valid": true
- }
- ]
- },
- {
- "description": "exclusiveMinimum validation",
- "schema": {
- "minimum": 1.1,
- "exclusiveMinimum": true
- },
- "tests": [
- {
- "description": "above the minimum is still valid",
- "data": 1.2,
- "valid": true
- },
- {
- "description": "boundary point is invalid",
- "data": 1.1,
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
deleted file mode 100644
index ca3b761..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
+++ /dev/null
@@ -1,60 +0,0 @@
-[
- {
- "description": "by int",
- "schema": {"multipleOf": 2},
- "tests": [
- {
- "description": "int by int",
- "data": 10,
- "valid": true
- },
- {
- "description": "int by int fail",
- "data": 7,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "foo",
- "valid": true
- }
- ]
- },
- {
- "description": "by number",
- "schema": {"multipleOf": 1.5},
- "tests": [
- {
- "description": "zero is multiple of anything",
- "data": 0,
- "valid": true
- },
- {
- "description": "4.5 is multiple of 1.5",
- "data": 4.5,
- "valid": true
- },
- {
- "description": "35 is not multiple of 1.5",
- "data": 35,
- "valid": false
- }
- ]
- },
- {
- "description": "by small number",
- "schema": {"multipleOf": 0.0001},
- "tests": [
- {
- "description": "0.0075 is multiple of 0.0001",
- "data": 0.0075,
- "valid": true
- },
- {
- "description": "0.00751 is not multiple of 0.0001",
- "data": 0.00751,
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json
deleted file mode 100644
index cbb7f46..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json
+++ /dev/null
@@ -1,96 +0,0 @@
-[
- {
- "description": "not",
- "schema": {
- "not": {"type": "integer"}
- },
- "tests": [
- {
- "description": "allowed",
- "data": "foo",
- "valid": true
- },
- {
- "description": "disallowed",
- "data": 1,
- "valid": false
- }
- ]
- },
- {
- "description": "not multiple types",
- "schema": {
- "not": {"type": ["integer", "boolean"]}
- },
- "tests": [
- {
- "description": "valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "mismatch",
- "data": 1,
- "valid": false
- },
- {
- "description": "other mismatch",
- "data": true,
- "valid": false
- }
- ]
- },
- {
- "description": "not more complex schema",
- "schema": {
- "not": {
- "type": "object",
- "properties": {
- "foo": {
- "type": "string"
- }
- }
- }
- },
- "tests": [
- {
- "description": "match",
- "data": 1,
- "valid": true
- },
- {
- "description": "other match",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"foo": "bar"},
- "valid": false
- }
- ]
- },
- {
- "description": "forbidden property",
- "schema": {
- "properties": {
- "foo": {
- "not": {}
- }
- }
- },
- "tests": [
- {
- "description": "property present",
- "data": {"foo": 1, "bar": 2},
- "valid": false
- },
- {
- "description": "property absent",
- "data": {"bar": 1, "baz": 2},
- "valid": true
- }
- ]
- }
-
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json
deleted file mode 100644
index d7fce9f..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json
+++ /dev/null
@@ -1,18 +0,0 @@
-[
- {
- "description": "validation of null and format",
- "schema": {"type": ["null", "string"], "format": "date-time"},
- "tests": [
- {
- "description": "a valid date-time string",
- "data": "1963-06-19T08:30:06.283185Z",
- "valid": true
- },
- {
- "description": "allow null",
- "data": null,
- "valid": true
- }
- ]
- }
-]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json
deleted file mode 100644
index 1eaa4e4..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json
+++ /dev/null
@@ -1,68 +0,0 @@
-[
- {
- "description": "oneOf",
- "schema": {
- "oneOf": [
- {
- "type": "integer"
- },
- {
- "minimum": 2
- }
- ]
- },
- "tests": [
- {
- "description": "first oneOf valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "second oneOf valid",
- "data": 2.5,
- "valid": true
- },
- {
- "description": "both oneOf valid",
- "data": 3,
- "valid": false
- },
- {
- "description": "neither oneOf valid",
- "data": 1.5,
- "valid": false
- }
- ]
- },
- {
- "description": "oneOf with base schema",
- "schema": {
- "type": "string",
- "oneOf" : [
- {
- "minLength": 2
- },
- {
- "maxLength": 4
- }
- ]
- },
- "tests": [
- {
- "description": "mismatch base schema",
- "data": 3,
- "valid": false
- },
- {
- "description": "one oneOf valid",
- "data": "foobar",
- "valid": true
- },
- {
- "description": "both oneOf valid",
- "data": "foo",
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json
deleted file mode 100644
index befc4b5..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json
+++ /dev/null
@@ -1,23 +0,0 @@
-[
- {
- "description": "pattern validation",
- "schema": {"pattern": "^a*$"},
- "tests": [
- {
- "description": "a matching pattern is valid",
- "data": "aaa",
- "valid": true
- },
- {
- "description": "a non-matching pattern is invalid",
- "data": "abc",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": true,
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json
deleted file mode 100644
index 18586e5..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json
+++ /dev/null
@@ -1,110 +0,0 @@
-[
- {
- "description":
- "patternProperties validates properties matching a regex",
- "schema": {
- "patternProperties": {
- "f.*o": {"type": "integer"}
- }
- },
- "tests": [
- {
- "description": "a single valid match is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "multiple valid matches is valid",
- "data": {"foo": 1, "foooooo" : 2},
- "valid": true
- },
- {
- "description": "a single invalid match is invalid",
- "data": {"foo": "bar", "fooooo": 2},
- "valid": false
- },
- {
- "description": "multiple invalid matches is invalid",
- "data": {"foo": "bar", "foooooo" : "baz"},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": 12,
- "valid": true
- }
- ]
- },
- {
- "description": "multiple simultaneous patternProperties are validated",
- "schema": {
- "patternProperties": {
- "a*": {"type": "integer"},
- "aaa*": {"maximum": 20}
- }
- },
- "tests": [
- {
- "description": "a single valid match is valid",
- "data": {"a": 21},
- "valid": true
- },
- {
- "description": "a simultaneous match is valid",
- "data": {"aaaa": 18},
- "valid": true
- },
- {
- "description": "multiple matches is valid",
- "data": {"a": 21, "aaaa": 18},
- "valid": true
- },
- {
- "description": "an invalid due to one is invalid",
- "data": {"a": "bar"},
- "valid": false
- },
- {
- "description": "an invalid due to the other is invalid",
- "data": {"aaaa": 31},
- "valid": false
- },
- {
- "description": "an invalid due to both is invalid",
- "data": {"aaa": "foo", "aaaa": 31},
- "valid": false
- }
- ]
- },
- {
- "description": "regexes are not anchored by default and are case sensitive",
- "schema": {
- "patternProperties": {
- "[0-9]{2,}": { "type": "boolean" },
- "X_": { "type": "string" }
- }
- },
- "tests": [
- {
- "description": "non recognized members are ignored",
- "data": { "answer 1": "42" },
- "valid": true
- },
- {
- "description": "recognized members are accounted for",
- "data": { "a31b": null },
- "valid": false
- },
- {
- "description": "regexes are case sensitive",
- "data": { "a_x_3": 3 },
- "valid": true
- },
- {
- "description": "regexes are case sensitive, 2",
- "data": { "a_X_3": 3 },
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json
deleted file mode 100644
index cd1644d..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json
+++ /dev/null
@@ -1,92 +0,0 @@
-[
- {
- "description": "object properties validation",
- "schema": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"type": "string"}
- }
- },
- "tests": [
- {
- "description": "both properties present and valid is valid",
- "data": {"foo": 1, "bar": "baz"},
- "valid": true
- },
- {
- "description": "one property invalid is invalid",
- "data": {"foo": 1, "bar": {}},
- "valid": false
- },
- {
- "description": "both properties invalid is invalid",
- "data": {"foo": [], "bar": {}},
- "valid": false
- },
- {
- "description": "doesn't invalidate other properties",
- "data": {"quux": []},
- "valid": true
- },
- {
- "description": "ignores non-objects",
- "data": [],
- "valid": true
- }
- ]
- },
- {
- "description":
- "properties, patternProperties, additionalProperties interaction",
- "schema": {
- "properties": {
- "foo": {"type": "array", "maxItems": 3},
- "bar": {"type": "array"}
- },
- "patternProperties": {"f.o": {"minItems": 2}},
- "additionalProperties": {"type": "integer"}
- },
- "tests": [
- {
- "description": "property validates property",
- "data": {"foo": [1, 2]},
- "valid": true
- },
- {
- "description": "property invalidates property",
- "data": {"foo": [1, 2, 3, 4]},
- "valid": false
- },
- {
- "description": "patternProperty invalidates property",
- "data": {"foo": []},
- "valid": false
- },
- {
- "description": "patternProperty validates nonproperty",
- "data": {"fxo": [1, 2]},
- "valid": true
- },
- {
- "description": "patternProperty invalidates nonproperty",
- "data": {"fxo": []},
- "valid": false
- },
- {
- "description": "additionalProperty ignores property",
- "data": {"bar": []},
- "valid": true
- },
- {
- "description": "additionalProperty validates others",
- "data": {"quux": 3},
- "valid": true
- },
- {
- "description": "additionalProperty invalidates others",
- "data": {"quux": "foo"},
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json
deleted file mode 100644
index d8214bc..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json
+++ /dev/null
@@ -1,128 +0,0 @@
-[
- {
- "description": "root pointer ref",
- "schema": {
- "properties": {
- "foo": {"$ref": "#"}
- },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "match",
- "data": {"foo": false},
- "valid": true
- },
- {
- "description": "recursive match",
- "data": {"foo": {"foo": false}},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"bar": false},
- "valid": false
- },
- {
- "description": "recursive mismatch",
- "data": {"foo": {"bar": false}},
- "valid": false
- }
- ]
- },
- {
- "description": "relative pointer ref to object",
- "schema": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"$ref": "#/properties/foo"}
- }
- },
- "tests": [
- {
- "description": "match",
- "data": {"bar": 3},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"bar": true},
- "valid": false
- }
- ]
- },
- {
- "description": "relative pointer ref to array",
- "schema": {
- "items": [
- {"type": "integer"},
- {"$ref": "#/items/0"}
- ]
- },
- "tests": [
- {
- "description": "match array",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "mismatch array",
- "data": [1, "foo"],
- "valid": false
- }
- ]
- },
- {
- "description": "escaped pointer ref",
- "schema": {
- "tilda~field": {"type": "integer"},
- "slash/field": {"type": "integer"},
- "percent%field": {"type": "integer"},
- "properties": {
- "tilda": {"$ref": "#/tilda~0field"},
- "slash": {"$ref": "#/slash~1field"},
- "percent": {"$ref": "#/percent%25field"}
- }
- },
- "tests": [
- {
- "description": "slash",
- "data": {"slash": "aoeu"},
- "valid": false
- },
- {
- "description": "tilda",
- "data": {"tilda": "aoeu"},
- "valid": false
- },
- {
- "description": "percent",
- "data": {"percent": "aoeu"},
- "valid": false
- }
- ]
- },
- {
- "description": "nested refs",
- "schema": {
- "definitions": {
- "a": {"type": "integer"},
- "b": {"$ref": "#/definitions/a"},
- "c": {"$ref": "#/definitions/b"}
- },
- "$ref": "#/definitions/c"
- },
- "tests": [
- {
- "description": "nested ref valid",
- "data": 5,
- "valid": true
- },
- {
- "description": "nested ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json
deleted file mode 100644
index 4ca8047..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json
+++ /dev/null
@@ -1,74 +0,0 @@
-[
- {
- "description": "remote ref",
- "schema": {"$ref": "http://localhost:1234/integer.json"},
- "tests": [
- {
- "description": "remote ref valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "remote ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "fragment within remote ref",
- "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
- "tests": [
- {
- "description": "remote fragment valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "remote fragment invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "ref within remote ref",
- "schema": {
- "$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
- },
- "tests": [
- {
- "description": "ref within ref valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "ref within ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "change resolution scope",
- "schema": {
- "id": "http://localhost:1234/",
- "items": {
- "id": "folder/",
- "items": {"$ref": "folderInteger.json"}
- }
- },
- "tests": [
- {
- "description": "changed scope ref valid",
- "data": [[1]],
- "valid": true
- },
- {
- "description": "changed scope ref invalid",
- "data": [["a"]],
- "valid": false
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json
deleted file mode 100644
index 612f73f..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json
+++ /dev/null
@@ -1,39 +0,0 @@
-[
- {
- "description": "required validation",
- "schema": {
- "properties": {
- "foo": {},
- "bar": {}
- },
- "required": ["foo"]
- },
- "tests": [
- {
- "description": "present required property is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "non-present required property is invalid",
- "data": {"bar": 1},
- "valid": false
- }
- ]
- },
- {
- "description": "required default validation",
- "schema": {
- "properties": {
- "foo": {}
- }
- },
- "tests": [
- {
- "description": "not required by default",
- "data": {},
- "valid": true
- }
- ]
- }
-]
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json
deleted file mode 100644
index 257f051..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json
+++ /dev/null
@@ -1,330 +0,0 @@
-[
- {
- "description": "integer type matches integers",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "an integer is an integer",
- "data": 1,
- "valid": true
- },
- {
- "description": "a float is not an integer",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an integer",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not an integer",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not an integer",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not an integer",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an integer",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "number type matches numbers",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "an integer is a number",
- "data": 1,
- "valid": true
- },
- {
- "description": "a float is a number",
- "data": 1.1,
- "valid": true
- },
- {
- "description": "a string is not a number",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not a number",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a number",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not a number",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not a number",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "string type matches strings",
- "schema": {"type": "string"},
- "tests": [
- {
- "description": "1 is not a string",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not a string",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is a string",
- "data": "foo",
- "valid": true
- },
- {
- "description": "an object is not a string",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a string",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not a string",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not a string",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "object type matches objects",
- "schema": {"type": "object"},
- "tests": [
- {
- "description": "an integer is not an object",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not an object",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an object",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is an object",
- "data": {},
- "valid": true
- },
- {
- "description": "an array is not an object",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not an object",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an object",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "array type matches arrays",
- "schema": {"type": "array"},
- "tests": [
- {
- "description": "an integer is not an array",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not an array",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an array",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not an array",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not an array",
- "data": [],
- "valid": true
- },
- {
- "description": "a boolean is not an array",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an array",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "boolean type matches booleans",
- "schema": {"type": "boolean"},
- "tests": [
- {
- "description": "an integer is not a boolean",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not a boolean",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not a boolean",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not a boolean",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a boolean",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not a boolean",
- "data": true,
- "valid": true
- },
- {
- "description": "null is not a boolean",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "null type matches only the null object",
- "schema": {"type": "null"},
- "tests": [
- {
- "description": "an integer is not null",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not null",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not null",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not null",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not null",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not null",
- "data": true,
- "valid": false
- },
- {
- "description": "null is null",
- "data": null,
- "valid": true
- }
- ]
- },
- {
- "description": "multiple types can be specified in an array",
- "schema": {"type": ["integer", "string"]},
- "tests": [
- {
- "description": "an integer is valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "a string is valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "a float is invalid",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "an object is invalid",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is invalid",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is invalid",
- "data": true,
- "valid": false
- },
- {
- "description": "null is invalid",
- "data": null,
- "valid": false
- }
- ]
- }
-]
[16/59] [abbrv] couchdb-nmo git commit: docs,
website: install instructions
Posted by ro...@apache.org.
docs, website: install instructions
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/bbeeaae4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/bbeeaae4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/bbeeaae4
Branch: refs/heads/master
Commit: bbeeaae4272f9f80bc0e37a962a3d4a5332bbceb
Parents: 6f5bdfd
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat May 30 04:14:11 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat May 30 04:14:11 2015 +0200
----------------------------------------------------------------------
README.md | 6 ++++++
doc/website/index.md | 9 ++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bbeeaae4/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 1e5f08b..183e03c 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,12 @@
`nmo` is a cli tool to manage CouchDB clusters and nodes.
+## Installation
+
+```
+npm install -g nmo
+```
+
## Contributing
It is written in ES6 and is using promises and generators for control
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/bbeeaae4/doc/website/index.md
----------------------------------------------------------------------
diff --git a/doc/website/index.md b/doc/website/index.md
index 11e57da..91207ec 100644
--- a/doc/website/index.md
+++ b/doc/website/index.md
@@ -1,4 +1,11 @@
-## how to use nmo?
+## Install nmo
+
+```
+# you need to have node installed
+npm install -g nmo
+```
+
+## How to use nmo?
Take a look at the video:
[46/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
deleted file mode 100644
index 394c41c..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
+++ /dev/null
@@ -1,1123 +0,0 @@
-/*!
- * async
- * https://github.com/caolan/async
- *
- * Copyright 2010-2014 Caolan McMahon
- * Released under the MIT license
- */
-/*jshint onevar: false, indent:4 */
-/*global setImmediate: false, setTimeout: false, console: false */
-(function () {
-
- var async = {};
-
- // global on the server, window in the browser
- var root, previous_async;
-
- root = this;
- if (root != null) {
- previous_async = root.async;
- }
-
- async.noConflict = function () {
- root.async = previous_async;
- return async;
- };
-
- function only_once(fn) {
- var called = false;
- return function() {
- if (called) throw new Error("Callback was already called.");
- called = true;
- fn.apply(root, arguments);
- }
- }
-
- //// cross-browser compatiblity functions ////
-
- var _toString = Object.prototype.toString;
-
- var _isArray = Array.isArray || function (obj) {
- return _toString.call(obj) === '[object Array]';
- };
-
- var _each = function (arr, iterator) {
- for (var i = 0; i < arr.length; i += 1) {
- iterator(arr[i], i, arr);
- }
- };
-
- var _map = function (arr, iterator) {
- if (arr.map) {
- return arr.map(iterator);
- }
- var results = [];
- _each(arr, function (x, i, a) {
- results.push(iterator(x, i, a));
- });
- return results;
- };
-
- var _reduce = function (arr, iterator, memo) {
- if (arr.reduce) {
- return arr.reduce(iterator, memo);
- }
- _each(arr, function (x, i, a) {
- memo = iterator(memo, x, i, a);
- });
- return memo;
- };
-
- var _keys = function (obj) {
- if (Object.keys) {
- return Object.keys(obj);
- }
- var keys = [];
- for (var k in obj) {
- if (obj.hasOwnProperty(k)) {
- keys.push(k);
- }
- }
- return keys;
- };
-
- //// exported async module functions ////
-
- //// nextTick implementation with browser-compatible fallback ////
- if (typeof process === 'undefined' || !(process.nextTick)) {
- if (typeof setImmediate === 'function') {
- async.nextTick = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- async.setImmediate = async.nextTick;
- }
- else {
- async.nextTick = function (fn) {
- setTimeout(fn, 0);
- };
- async.setImmediate = async.nextTick;
- }
- }
- else {
- async.nextTick = process.nextTick;
- if (typeof setImmediate !== 'undefined') {
- async.setImmediate = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- }
- else {
- async.setImmediate = async.nextTick;
- }
- }
-
- async.each = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- _each(arr, function (x) {
- iterator(x, only_once(done) );
- });
- function done(err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback();
- }
- }
- }
- };
- async.forEach = async.each;
-
- async.eachSeries = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- var iterate = function () {
- iterator(arr[completed], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback();
- }
- else {
- iterate();
- }
- }
- });
- };
- iterate();
- };
- async.forEachSeries = async.eachSeries;
-
- async.eachLimit = function (arr, limit, iterator, callback) {
- var fn = _eachLimit(limit);
- fn.apply(null, [arr, iterator, callback]);
- };
- async.forEachLimit = async.eachLimit;
-
- var _eachLimit = function (limit) {
-
- return function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length || limit <= 0) {
- return callback();
- }
- var completed = 0;
- var started = 0;
- var running = 0;
-
- (function replenish () {
- if (completed >= arr.length) {
- return callback();
- }
-
- while (running < limit && started < arr.length) {
- started += 1;
- running += 1;
- iterator(arr[started - 1], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- running -= 1;
- if (completed >= arr.length) {
- callback();
- }
- else {
- replenish();
- }
- }
- });
- }
- })();
- };
- };
-
-
- var doParallel = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.each].concat(args));
- };
- };
- var doParallelLimit = function(limit, fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [_eachLimit(limit)].concat(args));
- };
- };
- var doSeries = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.eachSeries].concat(args));
- };
- };
-
-
- var _asyncMap = function (eachfn, arr, iterator, callback) {
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- if (!callback) {
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err) {
- callback(err);
- });
- });
- } else {
- var results = [];
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err, v) {
- results[x.index] = v;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
- async.map = doParallel(_asyncMap);
- async.mapSeries = doSeries(_asyncMap);
- async.mapLimit = function (arr, limit, iterator, callback) {
- return _mapLimit(limit)(arr, iterator, callback);
- };
-
- var _mapLimit = function(limit) {
- return doParallelLimit(limit, _asyncMap);
- };
-
- // reduce only has a series version, as doing reduce in parallel won't
- // work in many situations.
- async.reduce = function (arr, memo, iterator, callback) {
- async.eachSeries(arr, function (x, callback) {
- iterator(memo, x, function (err, v) {
- memo = v;
- callback(err);
- });
- }, function (err) {
- callback(err, memo);
- });
- };
- // inject alias
- async.inject = async.reduce;
- // foldl alias
- async.foldl = async.reduce;
-
- async.reduceRight = function (arr, memo, iterator, callback) {
- var reversed = _map(arr, function (x) {
- return x;
- }).reverse();
- async.reduce(reversed, memo, iterator, callback);
- };
- // foldr alias
- async.foldr = async.reduceRight;
-
- var _filter = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.filter = doParallel(_filter);
- async.filterSeries = doSeries(_filter);
- // select alias
- async.select = async.filter;
- async.selectSeries = async.filterSeries;
-
- var _reject = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (!v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.reject = doParallel(_reject);
- async.rejectSeries = doSeries(_reject);
-
- var _detect = function (eachfn, arr, iterator, main_callback) {
- eachfn(arr, function (x, callback) {
- iterator(x, function (result) {
- if (result) {
- main_callback(x);
- main_callback = function () {};
- }
- else {
- callback();
- }
- });
- }, function (err) {
- main_callback();
- });
- };
- async.detect = doParallel(_detect);
- async.detectSeries = doSeries(_detect);
-
- async.some = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (v) {
- main_callback(true);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(false);
- });
- };
- // any alias
- async.any = async.some;
-
- async.every = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (!v) {
- main_callback(false);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(true);
- });
- };
- // all alias
- async.all = async.every;
-
- async.sortBy = function (arr, iterator, callback) {
- async.map(arr, function (x, callback) {
- iterator(x, function (err, criteria) {
- if (err) {
- callback(err);
- }
- else {
- callback(null, {value: x, criteria: criteria});
- }
- });
- }, function (err, results) {
- if (err) {
- return callback(err);
- }
- else {
- var fn = function (left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- };
- callback(null, _map(results.sort(fn), function (x) {
- return x.value;
- }));
- }
- });
- };
-
- async.auto = function (tasks, callback) {
- callback = callback || function () {};
- var keys = _keys(tasks);
- var remainingTasks = keys.length
- if (!remainingTasks) {
- return callback();
- }
-
- var results = {};
-
- var listeners = [];
- var addListener = function (fn) {
- listeners.unshift(fn);
- };
- var removeListener = function (fn) {
- for (var i = 0; i < listeners.length; i += 1) {
- if (listeners[i] === fn) {
- listeners.splice(i, 1);
- return;
- }
- }
- };
- var taskComplete = function () {
- remainingTasks--
- _each(listeners.slice(0), function (fn) {
- fn();
- });
- };
-
- addListener(function () {
- if (!remainingTasks) {
- var theCallback = callback;
- // prevent final callback from calling itself if it errors
- callback = function () {};
-
- theCallback(null, results);
- }
- });
-
- _each(keys, function (k) {
- var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
- var taskCallback = function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- if (err) {
- var safeResults = {};
- _each(_keys(results), function(rkey) {
- safeResults[rkey] = results[rkey];
- });
- safeResults[k] = args;
- callback(err, safeResults);
- // stop subsequent errors hitting callback multiple times
- callback = function () {};
- }
- else {
- results[k] = args;
- async.setImmediate(taskComplete);
- }
- };
- var requires = task.slice(0, Math.abs(task.length - 1)) || [];
- var ready = function () {
- return _reduce(requires, function (a, x) {
- return (a && results.hasOwnProperty(x));
- }, true) && !results.hasOwnProperty(k);
- };
- if (ready()) {
- task[task.length - 1](taskCallback, results);
- }
- else {
- var listener = function () {
- if (ready()) {
- removeListener(listener);
- task[task.length - 1](taskCallback, results);
- }
- };
- addListener(listener);
- }
- });
- };
-
- async.retry = function(times, task, callback) {
- var DEFAULT_TIMES = 5;
- var attempts = [];
- // Use defaults if times not passed
- if (typeof times === 'function') {
- callback = task;
- task = times;
- times = DEFAULT_TIMES;
- }
- // Make sure times is a number
- times = parseInt(times, 10) || DEFAULT_TIMES;
- var wrappedTask = function(wrappedCallback, wrappedResults) {
- var retryAttempt = function(task, finalAttempt) {
- return function(seriesCallback) {
- task(function(err, result){
- seriesCallback(!err || finalAttempt, {err: err, result: result});
- }, wrappedResults);
- };
- };
- while (times) {
- attempts.push(retryAttempt(task, !(times-=1)));
- }
- async.series(attempts, function(done, data){
- data = data[data.length - 1];
- (wrappedCallback || callback)(data.err, data.result);
- });
- }
- // If a callback is passed, run this as a controll flow
- return callback ? wrappedTask() : wrappedTask
- };
-
- async.waterfall = function (tasks, callback) {
- callback = callback || function () {};
- if (!_isArray(tasks)) {
- var err = new Error('First argument to waterfall must be an array of functions');
- return callback(err);
- }
- if (!tasks.length) {
- return callback();
- }
- var wrapIterator = function (iterator) {
- return function (err) {
- if (err) {
- callback.apply(null, arguments);
- callback = function () {};
- }
- else {
- var args = Array.prototype.slice.call(arguments, 1);
- var next = iterator.next();
- if (next) {
- args.push(wrapIterator(next));
- }
- else {
- args.push(callback);
- }
- async.setImmediate(function () {
- iterator.apply(null, args);
- });
- }
- };
- };
- wrapIterator(async.iterator(tasks))();
- };
-
- var _parallel = function(eachfn, tasks, callback) {
- callback = callback || function () {};
- if (_isArray(tasks)) {
- eachfn.map(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- eachfn.each(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.parallel = function (tasks, callback) {
- _parallel({ map: async.map, each: async.each }, tasks, callback);
- };
-
- async.parallelLimit = function(tasks, limit, callback) {
- _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
- };
-
- async.series = function (tasks, callback) {
- callback = callback || function () {};
- if (_isArray(tasks)) {
- async.mapSeries(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- async.eachSeries(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.iterator = function (tasks) {
- var makeCallback = function (index) {
- var fn = function () {
- if (tasks.length) {
- tasks[index].apply(null, arguments);
- }
- return fn.next();
- };
- fn.next = function () {
- return (index < tasks.length - 1) ? makeCallback(index + 1): null;
- };
- return fn;
- };
- return makeCallback(0);
- };
-
- async.apply = function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- return function () {
- return fn.apply(
- null, args.concat(Array.prototype.slice.call(arguments))
- );
- };
- };
-
- var _concat = function (eachfn, arr, fn, callback) {
- var r = [];
- eachfn(arr, function (x, cb) {
- fn(x, function (err, y) {
- r = r.concat(y || []);
- cb(err);
- });
- }, function (err) {
- callback(err, r);
- });
- };
- async.concat = doParallel(_concat);
- async.concatSeries = doSeries(_concat);
-
- async.whilst = function (test, iterator, callback) {
- if (test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.whilst(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doWhilst = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- var args = Array.prototype.slice.call(arguments, 1);
- if (test.apply(null, args)) {
- async.doWhilst(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.until = function (test, iterator, callback) {
- if (!test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.until(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doUntil = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- var args = Array.prototype.slice.call(arguments, 1);
- if (!test.apply(null, args)) {
- async.doUntil(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.queue = function (worker, concurrency) {
- if (concurrency === undefined) {
- concurrency = 1;
- }
- function _insert(q, data, pos, callback) {
- if (!q.started){
- q.started = true;
- }
- if (!_isArray(data)) {
- data = [data];
- }
- if(data.length == 0) {
- // call drain immediately if there are no tasks
- return async.setImmediate(function() {
- if (q.drain) {
- q.drain();
- }
- });
- }
- _each(data, function(task) {
- var item = {
- data: task,
- callback: typeof callback === 'function' ? callback : null
- };
-
- if (pos) {
- q.tasks.unshift(item);
- } else {
- q.tasks.push(item);
- }
-
- if (q.saturated && q.tasks.length === q.concurrency) {
- q.saturated();
- }
- async.setImmediate(q.process);
- });
- }
-
- var workers = 0;
- var q = {
- tasks: [],
- concurrency: concurrency,
- saturated: null,
- empty: null,
- drain: null,
- started: false,
- paused: false,
- push: function (data, callback) {
- _insert(q, data, false, callback);
- },
- kill: function () {
- q.drain = null;
- q.tasks = [];
- },
- unshift: function (data, callback) {
- _insert(q, data, true, callback);
- },
- process: function () {
- if (!q.paused && workers < q.concurrency && q.tasks.length) {
- var task = q.tasks.shift();
- if (q.empty && q.tasks.length === 0) {
- q.empty();
- }
- workers += 1;
- var next = function () {
- workers -= 1;
- if (task.callback) {
- task.callback.apply(task, arguments);
- }
- if (q.drain && q.tasks.length + workers === 0) {
- q.drain();
- }
- q.process();
- };
- var cb = only_once(next);
- worker(task.data, cb);
- }
- },
- length: function () {
- return q.tasks.length;
- },
- running: function () {
- return workers;
- },
- idle: function() {
- return q.tasks.length + workers === 0;
- },
- pause: function () {
- if (q.paused === true) { return; }
- q.paused = true;
- },
- resume: function () {
- if (q.paused === false) { return; }
- q.paused = false;
- // Need to call q.process once per concurrent
- // worker to preserve full concurrency after pause
- for (var w = 1; w <= q.concurrency; w++) {
- async.setImmediate(q.process);
- }
- }
- };
- return q;
- };
-
- async.priorityQueue = function (worker, concurrency) {
-
- function _compareTasks(a, b){
- return a.priority - b.priority;
- };
-
- function _binarySearch(sequence, item, compare) {
- var beg = -1,
- end = sequence.length - 1;
- while (beg < end) {
- var mid = beg + ((end - beg + 1) >>> 1);
- if (compare(item, sequence[mid]) >= 0) {
- beg = mid;
- } else {
- end = mid - 1;
- }
- }
- return beg;
- }
-
- function _insert(q, data, priority, callback) {
- if (!q.started){
- q.started = true;
- }
- if (!_isArray(data)) {
- data = [data];
- }
- if(data.length == 0) {
- // call drain immediately if there are no tasks
- return async.setImmediate(function() {
- if (q.drain) {
- q.drain();
- }
- });
- }
- _each(data, function(task) {
- var item = {
- data: task,
- priority: priority,
- callback: typeof callback === 'function' ? callback : null
- };
-
- q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
-
- if (q.saturated && q.tasks.length === q.concurrency) {
- q.saturated();
- }
- async.setImmediate(q.process);
- });
- }
-
- // Start with a normal queue
- var q = async.queue(worker, concurrency);
-
- // Override push to accept second parameter representing priority
- q.push = function (data, priority, callback) {
- _insert(q, data, priority, callback);
- };
-
- // Remove unshift function
- delete q.unshift;
-
- return q;
- };
-
- async.cargo = function (worker, payload) {
- var working = false,
- tasks = [];
-
- var cargo = {
- tasks: tasks,
- payload: payload,
- saturated: null,
- empty: null,
- drain: null,
- drained: true,
- push: function (data, callback) {
- if (!_isArray(data)) {
- data = [data];
- }
- _each(data, function(task) {
- tasks.push({
- data: task,
- callback: typeof callback === 'function' ? callback : null
- });
- cargo.drained = false;
- if (cargo.saturated && tasks.length === payload) {
- cargo.saturated();
- }
- });
- async.setImmediate(cargo.process);
- },
- process: function process() {
- if (working) return;
- if (tasks.length === 0) {
- if(cargo.drain && !cargo.drained) cargo.drain();
- cargo.drained = true;
- return;
- }
-
- var ts = typeof payload === 'number'
- ? tasks.splice(0, payload)
- : tasks.splice(0, tasks.length);
-
- var ds = _map(ts, function (task) {
- return task.data;
- });
-
- if(cargo.empty) cargo.empty();
- working = true;
- worker(ds, function () {
- working = false;
-
- var args = arguments;
- _each(ts, function (data) {
- if (data.callback) {
- data.callback.apply(null, args);
- }
- });
-
- process();
- });
- },
- length: function () {
- return tasks.length;
- },
- running: function () {
- return working;
- }
- };
- return cargo;
- };
-
- var _console_fn = function (name) {
- return function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- fn.apply(null, args.concat([function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (typeof console !== 'undefined') {
- if (err) {
- if (console.error) {
- console.error(err);
- }
- }
- else if (console[name]) {
- _each(args, function (x) {
- console[name](x);
- });
- }
- }
- }]));
- };
- };
- async.log = _console_fn('log');
- async.dir = _console_fn('dir');
- /*async.info = _console_fn('info');
- async.warn = _console_fn('warn');
- async.error = _console_fn('error');*/
-
- async.memoize = function (fn, hasher) {
- var memo = {};
- var queues = {};
- hasher = hasher || function (x) {
- return x;
- };
- var memoized = function () {
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- var key = hasher.apply(null, args);
- if (key in memo) {
- async.nextTick(function () {
- callback.apply(null, memo[key]);
- });
- }
- else if (key in queues) {
- queues[key].push(callback);
- }
- else {
- queues[key] = [callback];
- fn.apply(null, args.concat([function () {
- memo[key] = arguments;
- var q = queues[key];
- delete queues[key];
- for (var i = 0, l = q.length; i < l; i++) {
- q[i].apply(null, arguments);
- }
- }]));
- }
- };
- memoized.memo = memo;
- memoized.unmemoized = fn;
- return memoized;
- };
-
- async.unmemoize = function (fn) {
- return function () {
- return (fn.unmemoized || fn).apply(null, arguments);
- };
- };
-
- async.times = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.map(counter, iterator, callback);
- };
-
- async.timesSeries = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.mapSeries(counter, iterator, callback);
- };
-
- async.seq = function (/* functions... */) {
- var fns = arguments;
- return function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- async.reduce(fns, args, function (newargs, fn, cb) {
- fn.apply(that, newargs.concat([function () {
- var err = arguments[0];
- var nextargs = Array.prototype.slice.call(arguments, 1);
- cb(err, nextargs);
- }]))
- },
- function (err, results) {
- callback.apply(that, [err].concat(results));
- });
- };
- };
-
- async.compose = function (/* functions... */) {
- return async.seq.apply(null, Array.prototype.reverse.call(arguments));
- };
-
- var _applyEach = function (eachfn, fns /*args...*/) {
- var go = function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- return eachfn(fns, function (fn, cb) {
- fn.apply(that, args.concat([cb]));
- },
- callback);
- };
- if (arguments.length > 2) {
- var args = Array.prototype.slice.call(arguments, 2);
- return go.apply(this, args);
- }
- else {
- return go;
- }
- };
- async.applyEach = doParallel(_applyEach);
- async.applyEachSeries = doSeries(_applyEach);
-
- async.forever = function (fn, callback) {
- function next(err) {
- if (err) {
- if (callback) {
- return callback(err);
- }
- throw err;
- }
- fn(next);
- }
- next();
- };
-
- // Node.js
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = async;
- }
- // AMD / RequireJS
- else if (typeof define !== 'undefined' && define.amd) {
- define([], function () {
- return async;
- });
- }
- // included directly via <script> tag
- else {
- root.async = async;
- }
-
-}());
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/package.json b/node_modules/request/node_modules/form-data/node_modules/async/package.json
deleted file mode 100644
index 98c2e0b..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/package.json
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- "name": "async",
- "description": "Higher-order functions and common patterns for asynchronous code",
- "main": "lib/async.js",
- "author": {
- "name": "Caolan McMahon"
- },
- "version": "0.9.2",
- "keywords": [
- "async",
- "callback",
- "utility",
- "module"
- ],
- "repository": {
- "type": "git",
- "url": "git+https://github.com/caolan/async.git"
- },
- "bugs": {
- "url": "https://github.com/caolan/async/issues"
- },
- "license": "MIT",
- "devDependencies": {
- "nodeunit": ">0.0.0",
- "uglify-js": "1.2.x",
- "nodelint": ">0.0.0",
- "lodash": ">=2.4.1"
- },
- "jam": {
- "main": "lib/async.js",
- "include": [
- "lib/async.js",
- "README.md",
- "LICENSE"
- ],
- "categories": [
- "Utilities"
- ]
- },
- "scripts": {
- "test": "nodeunit test/test-async.js"
- },
- "spm": {
- "main": "lib/async.js"
- },
- "volo": {
- "main": "lib/async.js",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "tests"
- ]
- },
- "gitHead": "de3a16091d5125384eff4a54deb3998b13c3814c",
- "homepage": "https://github.com/caolan/async#readme",
- "_id": "async@0.9.2",
- "_shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d",
- "_from": "async@>=0.9.0 <0.10.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "beaugunderson",
- "email": "beau@beaugunderson.com"
- },
- "maintainers": [
- {
- "name": "caolan",
- "email": "caolan.mcmahon@gmail.com"
- },
- {
- "name": "beaugunderson",
- "email": "beau@beaugunderson.com"
- }
- ],
- "dist": {
- "shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d",
- "tarball": "http://registry.npmjs.org/async/-/async-0.9.2.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js b/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
deleted file mode 100755
index 30cb7c2..0000000
--- a/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env node
-
-// This should probably be its own module but complaints about bower/etc.
-// support keep coming up and I'd rather just enable the workflow here for now
-// and figure out where this should live later. -- @beaugunderson
-
-var fs = require('fs');
-var _ = require('lodash');
-
-var packageJson = require('../package.json');
-
-var IGNORES = ['**/.*', 'node_modules', 'bower_components', 'test', 'tests'];
-var INCLUDES = ['lib/async.js', 'README.md', 'LICENSE'];
-var REPOSITORY_NAME = 'caolan/async';
-
-packageJson.jam = {
- main: packageJson.main,
- include: INCLUDES,
- categories: ['Utilities']
-};
-
-packageJson.spm = {
- main: packageJson.main
-};
-
-packageJson.volo = {
- main: packageJson.main,
- ignore: IGNORES
-};
-
-var bowerSpecific = {
- moduleType: ['amd', 'globals', 'node'],
- ignore: IGNORES,
- authors: [packageJson.author]
-};
-
-var bowerInclude = ['name', 'description', 'version', 'main', 'keywords',
- 'license', 'homepage', 'repository', 'devDependencies'];
-
-var componentSpecific = {
- repository: REPOSITORY_NAME,
- scripts: [packageJson.main]
-};
-
-var componentInclude = ['name', 'description', 'version', 'keywords',
- 'license'];
-
-var bowerJson = _.merge({}, _.pick(packageJson, bowerInclude), bowerSpecific);
-var componentJson = _.merge({}, _.pick(packageJson, componentInclude), componentSpecific);
-
-fs.writeFileSync('./bower.json', JSON.stringify(bowerJson, null, 2));
-fs.writeFileSync('./component.json', JSON.stringify(componentJson, null, 2));
-fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/form-data/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/form-data/package.json b/node_modules/request/node_modules/form-data/package.json
deleted file mode 100644
index 7f1adae..0000000
--- a/node_modules/request/node_modules/form-data/package.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "author": {
- "name": "Felix Geisendörfer",
- "email": "felix@debuggable.com",
- "url": "http://debuggable.com/"
- },
- "name": "form-data",
- "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
- "version": "0.2.0",
- "repository": {
- "type": "git",
- "url": "git://github.com/felixge/node-form-data.git"
- },
- "main": "./lib/form_data",
- "scripts": {
- "test": "node test/run.js"
- },
- "engines": {
- "node": ">= 0.8"
- },
- "dependencies": {
- "async": "~0.9.0",
- "combined-stream": "~0.0.4",
- "mime-types": "~2.0.3"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "https://raw.github.com/felixge/node-form-data/master/License"
- }
- ],
- "devDependencies": {
- "fake": "~0.2.2",
- "far": "~0.0.7",
- "formidable": "~1.0.14",
- "request": "~2.36.0"
- },
- "gitHead": "dfc1a2aef40b97807e2ffe477da06cb2c37e259f",
- "bugs": {
- "url": "https://github.com/felixge/node-form-data/issues"
- },
- "homepage": "https://github.com/felixge/node-form-data",
- "_id": "form-data@0.2.0",
- "_shasum": "26f8bc26da6440e299cbdcfb69035c4f77a6e466",
- "_from": "form-data@>=0.2.0 <0.3.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
- },
- "maintainers": [
- {
- "name": "felixge",
- "email": "felix@debuggable.com"
- },
- {
- "name": "idralyuk",
- "email": "igor@buran.us"
- },
- {
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
- },
- {
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
- },
- {
- "name": "celer",
- "email": "dtyree77@gmail.com"
- }
- ],
- "dist": {
- "shasum": "26f8bc26da6440e299cbdcfb69035c4f77a6e466",
- "tarball": "http://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/LICENSE b/node_modules/request/node_modules/har-validator/LICENSE
deleted file mode 100644
index d527871..0000000
--- a/node_modules/request/node_modules/har-validator/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Ahmad Nassri (https://www.ahmadnassri.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/README.md b/node_modules/request/node_modules/har-validator/README.md
deleted file mode 100644
index 3680513..0000000
--- a/node_modules/request/node_modules/har-validator/README.md
+++ /dev/null
@@ -1,362 +0,0 @@
-# HAR Validator [![version][npm-version]][npm-url] [![License][npm-license]][license-url]
-
-Extremely fast HTTP Archive ([HAR](http://www.softwareishard.com/blog/har-12-spec/)) validator using JSON Schema.
-
-[![Build Status][travis-image]][travis-url]
-[![Downloads][npm-downloads]][npm-url]
-[![Code Climate][codeclimate-quality]][codeclimate-url]
-[![Coverage Status][codeclimate-coverage]][codeclimate-url]
-[![Dependencies][david-image]][david-url]
-
-## Install
-
-```shell
-# to use in cli
-npm install --global har-validator
-
-# to use as a module
-npm install --save har-validator
-```
-
-## Usage
-
-```
-
- Usage: har-validator [options] <files ...>
-
- Options:
-
- -h, --help output usage information
- -V, --version output the version number
- -s, --schema [name] validate schema name (log, request, response, etc ...)
-
-```
-
-###### Example
-
-```shell
-har-validator har.json
-
-har-validator --schema request request.json
-```
-
-## API
-
-### Validate(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var HAR = require('./har.json');
-var validate = require('har-validator');
-
-validate(HAR, function (e, valid) {
- if (e) console.log(e.errors)
-
- if (valid) console.log('horray!');
-});
-```
-
-### Validate.log(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.log(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.cache(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.cache(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.cacheEntry(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.cacheEntry(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.content(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.content(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.cookie(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.cookie(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.creator(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.creator(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.entry(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.entry(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.log(data [, callback])
-
-alias of [`Validate(data [, callback])`](#validate-data-callback-)
-
-### Validate.page(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.page(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.pageTimings(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.pageTimings(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.postData(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.postData(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.record(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.record(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.request(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.request(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.response(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.cacheEntry(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-### Validate.timings(data [, callback])
-
-Returns `true` or `false`.
-
-- **data**: `Object` *(Required)*
- a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object
-
-- **callback**: `Function`
- gets two arguments (err, valid)
-
-```js
-var validate = require('har-validator');
-
-validate.timings(data, function (e, valid) {
- if (e) console.log(e.errors)
-});
-```
-
-## Support
-
-Donations are welcome to help support the continuous development of this project.
-
-[![Gratipay][gratipay-image]][gratipay-url]
-[![PayPal][paypal-image]][paypal-url]
-[![Flattr][flattr-image]][flattr-url]
-[![Bitcoin][bitcoin-image]][bitcoin-url]
-
-## License
-
-[MIT](LICENSE) © [Ahmad Nassri](https://www.ahmadnassri.com)
-
-[license-url]: https://github.com/ahmadnassri/har-validator/blob/master/LICENSE
-
-[travis-url]: https://travis-ci.org/ahmadnassri/har-validator
-[travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square
-
-[npm-url]: https://www.npmjs.com/package/har-validator
-[npm-license]: https://img.shields.io/npm/l/har-validator.svg?style=flat-square
-[npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square
-[npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square
-
-[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-validator
-[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-validator.svg?style=flat-square
-[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-validator.svg?style=flat-square
-
-[david-url]: https://david-dm.org/ahmadnassri/har-validator
-[david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square
-
-[gratipay-url]: https://www.gratipay.com/ahmadnassri/
-[gratipay-image]: https://img.shields.io/gratipay/ahmadnassri.svg?style=flat-square
-
-[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UJ2B2BTK9VLRS&on0=project&os0=har-validator
-[paypal-image]: http://img.shields.io/badge/paypal-donate-green.svg?style=flat-square
-
-[flattr-url]: https://flattr.com/submit/auto?user_id=ahmadnassri&url=https://github.com/ahmadnassri/har-validator&title=har-validator&language=&tags=github&category=software
-[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square
-
-[bitcoin-image]: http://img.shields.io/badge/bitcoin-1Nb46sZRVG3or7pNaDjthcGJpWhvoPpCxy-green.svg?style=flat-square
-[bitcoin-url]: https://www.coinbase.com/checkouts/ae383ae6bb931a2fa5ad11cec115191e?name=har-validator
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/bin/har-validator
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/bin/har-validator b/node_modules/request/node_modules/har-validator/bin/har-validator
deleted file mode 100755
index ab1db25..0000000
--- a/node_modules/request/node_modules/har-validator/bin/har-validator
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env node
-
-'use strict'
-
-var Promise = require('bluebird')
-
-var chalk = require('chalk')
-var cmd = require('commander')
-var fs = Promise.promisifyAll(require('fs'))
-var path = require('path')
-var pkg = require('../package.json')
-var validate = Promise.promisifyAll(require('..'))
-
-cmd
- .version(pkg.version)
- .usage('[options] <files ...>')
- .option('-s, --schema [name]', 'validate schema name (log, request, response, etc ...)')
- .parse(process.argv)
-
-if (!cmd.args.length) {
- cmd.help()
-}
-
-if (!cmd.schema) {
- cmd.schema = 'har'
-}
-
-cmd.args.map(function (fileName) {
- var file = chalk.yellow.italic(path.basename(fileName))
-
- fs.readFileAsync(fileName)
- .then(JSON.parse)
- .then(validate[cmd.schema + 'Async'])
- .then(function () {
- console.log('%s [%s] is valid', chalk.green('✓'), file)
- })
- .catch(SyntaxError, function (e) {
- console.error('%s [%s] failed to read JSON: %s', chalk.red('✖'), file, chalk.red(e.message))
- })
- .catch(function (e) {
- e.errors.map(function (err) {
- console.error('%s [%s] failed validation: (%s: %s) %s', chalk.red('✖'), file, chalk.cyan.italic(err.field), chalk.magenta.italic(err.value), chalk.red(err.message))
- })
- })
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js
deleted file mode 100644
index 4138a64..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js
+++ /dev/null
@@ -1,100 +0,0 @@
-'use strict';
-var escapeStringRegexp = require('escape-string-regexp');
-var ansiStyles = require('ansi-styles');
-var stripAnsi = require('strip-ansi');
-var hasAnsi = require('has-ansi');
-var supportsColor = require('supports-color');
-var defineProps = Object.defineProperties;
-
-function Chalk(options) {
- // detect mode if not set manually
- this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
-}
-
-// use bright blue on Windows as the normal blue color is illegible
-if (process.platform === 'win32') {
- ansiStyles.blue.open = '\u001b[94m';
-}
-
-function build(_styles) {
- var builder = function builder() {
- return applyStyle.apply(builder, arguments);
- };
- builder._styles = _styles;
- builder.enabled = this.enabled;
- // __proto__ is used because we must return a function, but there is
- // no way to create a function with a different prototype.
- builder.__proto__ = proto;
- return builder;
-}
-
-var styles = (function () {
- var ret = {};
-
- Object.keys(ansiStyles).forEach(function (key) {
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
-
- ret[key] = {
- get: function () {
- return build.call(this, this._styles.concat(key));
- }
- };
- });
-
- return ret;
-})();
-
-var proto = defineProps(function chalk() {}, styles);
-
-function applyStyle() {
- // support varags, but simply cast to string in case there's only one arg
- var args = arguments;
- var argsLen = args.length;
- var str = argsLen !== 0 && String(arguments[0]);
- if (argsLen > 1) {
- // don't slice `arguments`, it prevents v8 optimizations
- for (var a = 1; a < argsLen; a++) {
- str += ' ' + args[a];
- }
- }
-
- if (!this.enabled || !str) {
- return str;
- }
-
- /*jshint validthis: true */
- var nestedStyles = this._styles;
-
- var i = nestedStyles.length;
- while (i--) {
- var code = ansiStyles[nestedStyles[i]];
- // Replace any instances already present with a re-opening code
- // otherwise only the part of the string until said closing code
- // will be colored, and the rest will simply be 'plain'.
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
- }
-
- return str;
-}
-
-function init() {
- var ret = {};
-
- Object.keys(styles).forEach(function (name) {
- ret[name] = {
- get: function () {
- return build.call(this, [name]);
- }
- };
- });
-
- return ret;
-}
-
-defineProps(Chalk.prototype, init());
-
-module.exports = new Chalk();
-module.exports.styles = ansiStyles;
-module.exports.hasColor = hasAnsi;
-module.exports.stripColor = stripAnsi;
-module.exports.supportsColor = supportsColor;
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/license
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <si...@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/has-ansi
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/has-ansi b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/has-ansi
deleted file mode 120000
index c1e7413..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/has-ansi
+++ /dev/null
@@ -1 +0,0 @@
-../has-ansi/cli.js
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/strip-ansi
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/strip-ansi b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/strip-ansi
deleted file mode 120000
index b65c9f8..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/strip-ansi
+++ /dev/null
@@ -1 +0,0 @@
-../strip-ansi/cli.js
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/supports-color
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/supports-color b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/supports-color
deleted file mode 120000
index af0f05e..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/.bin/supports-color
+++ /dev/null
@@ -1 +0,0 @@
-../supports-color/cli.js
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js
deleted file mode 100644
index caf9e11..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-var styles = module.exports = {
- modifiers: {
- reset: [0, 0],
- bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- colors: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39]
- },
- bgColors: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49]
- }
-};
-
-// fix humans
-styles.colors.grey = styles.colors.gray;
-
-Object.keys(styles).forEach(function (groupName) {
- var group = styles[groupName];
-
- Object.keys(group).forEach(function (styleName) {
- var style = group[styleName];
-
- styles[styleName] = group[styleName] = {
- open: '\u001b[' + style[0] + 'm',
- close: '\u001b[' + style[1] + 'm'
- };
- });
-
- Object.defineProperty(styles, groupName, {
- value: group,
- enumerable: false
- });
-});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <si...@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
deleted file mode 100644
index e670f25..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "name": "ansi-styles",
- "version": "2.0.1",
- "description": "ANSI escape codes for styling strings in the terminal",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/ansi-styles"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "devDependencies": {
- "mocha": "*"
- },
- "gitHead": "da6541334e1681cb803f891fab8abf4313cc4bc1",
- "bugs": {
- "url": "https://github.com/sindresorhus/ansi-styles/issues"
- },
- "homepage": "https://github.com/sindresorhus/ansi-styles",
- "_id": "ansi-styles@2.0.1",
- "_shasum": "b033f57f93e2d28adeb8bc11138fa13da0fd20a3",
- "_from": "ansi-styles@>=2.0.1 <3.0.0",
- "_npmVersion": "2.1.16",
- "_nodeVersion": "0.10.35",
- "_npmUser": {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- },
- "dist": {
- "shasum": "b033f57f93e2d28adeb8bc11138fa13da0fd20a3",
- "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md
deleted file mode 100644
index 89ec6a7..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md
+++ /dev/null
@@ -1,86 +0,0 @@
-# ansi-styles [](https://travis-ci.org/sindresorhus/ansi-styles)
-
-> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
-
-You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings.
-
-
-
-
-## Install
-
-```sh
-$ npm install --save ansi-styles
-```
-
-
-## Usage
-
-```js
-var ansi = require('ansi-styles');
-
-console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
-```
-
-
-## API
-
-Each style has an `open` and `close` property.
-
-
-## Styles
-
-### Modifiers
-
-- `reset`
-- `bold`
-- `dim`
-- `italic` *(not widely supported)*
-- `underline`
-- `inverse`
-- `hidden`
-- `strikethrough` *(not widely supported)*
-
-### Colors
-
-- `black`
-- `red`
-- `green`
-- `yellow`
-- `blue`
-- `magenta`
-- `cyan`
-- `white`
-- `gray`
-
-### Background colors
-
-- `bgBlack`
-- `bgRed`
-- `bgGreen`
-- `bgYellow`
-- `bgBlue`
-- `bgMagenta`
-- `bgCyan`
-- `bgWhite`
-
-
-## Advanced usage
-
-By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
-
-- `ansi.modifiers`
-- `ansi.colors`
-- `ansi.bgColors`
-
-
-###### Example
-
-```js
-console.log(ansi.colors.green.open);
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
deleted file mode 100644
index ac6572c..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
-
-module.exports = function (str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- return str.replace(matchOperatorsRe, '\\$&');
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <si...@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
deleted file mode 100644
index 749f5de..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "name": "escape-string-regexp",
- "version": "1.0.3",
- "description": "Escape RegExp special characters",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/escape-string-regexp"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "scripts": {
- "test": "mocha"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "regex",
- "regexp",
- "re",
- "regular",
- "expression",
- "escape",
- "string",
- "str",
- "special",
- "characters"
- ],
- "devDependencies": {
- "mocha": "*"
- },
- "gitHead": "1e446e6b4449b5f1f8868cd31bf8fd25ee37fb4b",
- "bugs": {
- "url": "https://github.com/sindresorhus/escape-string-regexp/issues"
- },
- "homepage": "https://github.com/sindresorhus/escape-string-regexp",
- "_id": "escape-string-regexp@1.0.3",
- "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
- "_from": "escape-string-regexp@>=1.0.2 <2.0.0",
- "_npmVersion": "2.1.16",
- "_nodeVersion": "0.10.35",
- "_npmUser": {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- },
- "dist": {
- "shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
- "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
deleted file mode 100644
index 808a963..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# escape-string-regexp [](https://travis-ci.org/sindresorhus/escape-string-regexp)
-
-> Escape RegExp special characters
-
-
-## Install
-
-```sh
-$ npm install --save escape-string-regexp
-```
-
-
-## Usage
-
-```js
-var escapeStringRegexp = require('escape-string-regexp');
-
-var escapedString = escapeStringRegexp('how much $ for a unicorn?');
-//=> how much \$ for a unicorn\?
-
-new RegExp(escapedString);
-```
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/cli.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/cli.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/cli.js
deleted file mode 100755
index 0386a82..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/cli.js
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-var stdin = require('get-stdin');
-var pkg = require('./package.json');
-var hasAnsi = require('./');
-var argv = process.argv.slice(2);
-var input = argv[0];
-
-function help() {
- console.log([
- '',
- ' ' + pkg.description,
- '',
- ' Usage',
- ' has-ansi <string>',
- ' echo <string> | has-ansi',
- '',
- ' Exits with code 0 if input has ANSI escape codes and 1 if not'
- ].join('\n'));
-}
-
-function init(data) {
- process.exit(hasAnsi(data) ? 0 : 1);
-}
-
-if (argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-if (process.stdin.isTTY) {
- if (!input) {
- help();
- return;
- }
-
- init(input);
-} else {
- stdin(init);
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js
deleted file mode 100644
index 98fae06..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-var ansiRegex = require('ansi-regex');
-var re = new RegExp(ansiRegex().source); // remove the `g` flag
-module.exports = re.test.bind(re);
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <si...@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js
deleted file mode 100644
index 2fcdd1e..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-module.exports = function () {
- return /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g;
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license
deleted file mode 100644
index 654d0bf..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <si...@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json
deleted file mode 100644
index 8d70330..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json
+++ /dev/null
@@ -1,86 +0,0 @@
-{
- "name": "ansi-regex",
- "version": "1.1.1",
- "description": "Regular expression for matching ANSI escape codes",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/sindresorhus/ansi-regex"
- },
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
- },
- "maintainers": [
- {
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
- },
- {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- }
- ],
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "mocha test/test.js",
- "view-supported": "node test/viewCodes.js"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "command-line",
- "text",
- "regex",
- "regexp",
- "re",
- "match",
- "test",
- "find",
- "pattern"
- ],
- "devDependencies": {
- "mocha": "*"
- },
- "gitHead": "47fb974630af70998157b30fad6eb5e5bd7c7cd6",
- "bugs": {
- "url": "https://github.com/sindresorhus/ansi-regex/issues"
- },
- "homepage": "https://github.com/sindresorhus/ansi-regex",
- "_id": "ansi-regex@1.1.1",
- "_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
- "_from": "ansi-regex@>=1.0.0 <2.0.0",
- "_npmVersion": "2.1.16",
- "_nodeVersion": "0.10.35",
- "_npmUser": {
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
- },
- "dist": {
- "shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
- "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md
deleted file mode 100644
index ae876e7..0000000
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# ansi-regex [](https://travis-ci.org/sindresorhus/ansi-regex)
-
-> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
-
-
-## Install
-
-```sh
-$ npm install --save ansi-regex
-```
-
-
-## Usage
-
-```js
-var ansiRegex = require('ansi-regex');
-
-ansiRegex().test('\u001b[4mcake\u001b[0m');
-//=> true
-
-ansiRegex().test('cake');
-//=> false
-
-'\u001b[4mcake\u001b[0m'.match(ansiRegex());
-//=> ['\u001b[4m', '\u001b[0m']
-```
-
-*It's a function so you can create multiple instances. Regexes with the global flag will have the `.lastIndex` property changed for each call to methods on the instance. Therefore reusing the instance with multiple calls will not work as expected for `.test()`.*
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
[39/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
deleted file mode 100755
index 5f6f90c..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
+++ /dev/null
@@ -1,977 +0,0 @@
-// Load modules
-
-var Crypto = require('crypto');
-var Path = require('path');
-var Util = require('util');
-var Escape = require('./escape');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Clone object or array
-
-exports.clone = function (obj, seen) {
-
- if (typeof obj !== 'object' ||
- obj === null) {
-
- return obj;
- }
-
- seen = seen || { orig: [], copy: [] };
-
- var lookup = seen.orig.indexOf(obj);
- if (lookup !== -1) {
- return seen.copy[lookup];
- }
-
- var newObj;
- var cloneDeep = false;
-
- if (!Array.isArray(obj)) {
- if (Buffer.isBuffer(obj)) {
- newObj = new Buffer(obj);
- }
- else if (obj instanceof Date) {
- newObj = new Date(obj.getTime());
- }
- else if (obj instanceof RegExp) {
- newObj = new RegExp(obj);
- }
- else {
- var proto = Object.getPrototypeOf(obj);
- if (proto &&
- proto.isImmutable) {
-
- newObj = obj;
- }
- else {
- newObj = Object.create(proto);
- cloneDeep = true;
- }
- }
- }
- else {
- newObj = [];
- cloneDeep = true;
- }
-
- seen.orig.push(obj);
- seen.copy.push(newObj);
-
- if (cloneDeep) {
- var keys = Object.getOwnPropertyNames(obj);
- for (var i = 0, il = keys.length; i < il; ++i) {
- var key = keys[i];
- var descriptor = Object.getOwnPropertyDescriptor(obj, key);
- if (descriptor.get ||
- descriptor.set) {
-
- Object.defineProperty(newObj, key, descriptor);
- }
- else {
- newObj[key] = exports.clone(obj[key], seen);
- }
- }
- }
-
- return newObj;
-};
-
-
-// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied
-/*eslint-disable */
-exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) {
-/*eslint-enable */
- exports.assert(target && typeof target === 'object', 'Invalid target value: must be an object');
- exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
-
- if (!source) {
- return target;
- }
-
- if (Array.isArray(source)) {
- exports.assert(Array.isArray(target), 'Cannot merge array onto an object');
- if (isMergeArrays === false) { // isMergeArrays defaults to true
- target.length = 0; // Must not change target assignment
- }
-
- for (var i = 0, il = source.length; i < il; ++i) {
- target.push(exports.clone(source[i]));
- }
-
- return target;
- }
-
- var keys = Object.keys(source);
- for (var k = 0, kl = keys.length; k < kl; ++k) {
- var key = keys[k];
- var value = source[key];
- if (value &&
- typeof value === 'object') {
-
- if (!target[key] ||
- typeof target[key] !== 'object' ||
- (Array.isArray(target[key]) ^ Array.isArray(value)) ||
- value instanceof Date ||
- Buffer.isBuffer(value) ||
- value instanceof RegExp) {
-
- target[key] = exports.clone(value);
- }
- else {
- exports.merge(target[key], value, isNullOverride, isMergeArrays);
- }
- }
- else {
- if (value !== null &&
- value !== undefined) { // Explicit to preserve empty strings
-
- target[key] = value;
- }
- else if (isNullOverride !== false) { // Defaults to true
- target[key] = value;
- }
- }
- }
-
- return target;
-};
-
-
-// Apply options to a copy of the defaults
-
-exports.applyToDefaults = function (defaults, options, isNullOverride) {
-
- exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
- exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
-
- if (!options) { // If no options, return null
- return null;
- }
-
- var copy = exports.clone(defaults);
-
- if (options === true) { // If options is set to true, use defaults
- return copy;
- }
-
- return exports.merge(copy, options, isNullOverride === true, false);
-};
-
-
-// Clone an object except for the listed keys which are shallow copied
-
-exports.cloneWithShallow = function (source, keys) {
-
- if (!source ||
- typeof source !== 'object') {
-
- return source;
- }
-
- var storage = internals.store(source, keys); // Move shallow copy items to storage
- var copy = exports.clone(source); // Deep copy the rest
- internals.restore(copy, source, storage); // Shallow copy the stored items and restore
- return copy;
-};
-
-
-internals.store = function (source, keys) {
-
- var storage = {};
- for (var i = 0, il = keys.length; i < il; ++i) {
- var key = keys[i];
- var value = exports.reach(source, key);
- if (value !== undefined) {
- storage[key] = value;
- internals.reachSet(source, key, undefined);
- }
- }
-
- return storage;
-};
-
-
-internals.restore = function (copy, source, storage) {
-
- var keys = Object.keys(storage);
- for (var i = 0, il = keys.length; i < il; ++i) {
- var key = keys[i];
- internals.reachSet(copy, key, storage[key]);
- internals.reachSet(source, key, storage[key]);
- }
-};
-
-
-internals.reachSet = function (obj, key, value) {
-
- var path = key.split('.');
- var ref = obj;
- for (var i = 0, il = path.length; i < il; ++i) {
- var segment = path[i];
- if (i + 1 === il) {
- ref[segment] = value;
- }
-
- ref = ref[segment];
- }
-};
-
-
-// Apply options to defaults except for the listed keys which are shallow copied from option without merging
-
-exports.applyToDefaultsWithShallow = function (defaults, options, keys) {
-
- exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
- exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
- exports.assert(keys && Array.isArray(keys), 'Invalid keys');
-
- if (!options) { // If no options, return null
- return null;
- }
-
- var copy = exports.cloneWithShallow(defaults, keys);
-
- if (options === true) { // If options is set to true, use defaults
- return copy;
- }
-
- var storage = internals.store(options, keys); // Move shallow copy items to storage
- exports.merge(copy, options, false, false); // Deep copy the rest
- internals.restore(copy, options, storage); // Shallow copy the stored items and restore
- return copy;
-};
-
-
-// Deep object or array comparison
-
-exports.deepEqual = function (obj, ref, options, seen) {
-
- options = options || { prototype: true };
-
- var type = typeof obj;
-
- if (type !== typeof ref) {
- return false;
- }
-
- if (type !== 'object' ||
- obj === null ||
- ref === null) {
-
- if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql
- return obj !== 0 || 1 / obj === 1 / ref; // -0 / +0
- }
-
- return obj !== obj && ref !== ref; // NaN
- }
-
- seen = seen || [];
- if (seen.indexOf(obj) !== -1) {
- return true; // If previous comparison failed, it would have stopped execution
- }
-
- seen.push(obj);
-
- if (Array.isArray(obj)) {
- if (!Array.isArray(ref)) {
- return false;
- }
-
- if (!options.part && obj.length !== ref.length) {
- return false;
- }
-
- for (var i = 0, il = obj.length; i < il; ++i) {
- if (options.part) {
- var found = false;
- for (var r = 0, rl = ref.length; r < rl; ++r) {
- if (exports.deepEqual(obj[i], ref[r], options, seen)) {
- found = true;
- break;
- }
- }
-
- return found;
- }
-
- if (!exports.deepEqual(obj[i], ref[i], options, seen)) {
- return false;
- }
- }
-
- return true;
- }
-
- if (Buffer.isBuffer(obj)) {
- if (!Buffer.isBuffer(ref)) {
- return false;
- }
-
- if (obj.length !== ref.length) {
- return false;
- }
-
- for (var j = 0, jl = obj.length; j < jl; ++j) {
- if (obj[j] !== ref[j]) {
- return false;
- }
- }
-
- return true;
- }
-
- if (obj instanceof Date) {
- return (ref instanceof Date && obj.getTime() === ref.getTime());
- }
-
- if (obj instanceof RegExp) {
- return (ref instanceof RegExp && obj.toString() === ref.toString());
- }
-
- if (options.prototype) {
- if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) {
- return false;
- }
- }
-
- var keys = Object.getOwnPropertyNames(obj);
-
- if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) {
- return false;
- }
-
- for (var k = 0, kl = keys.length; k < kl; ++k) {
- var key = keys[k];
- var descriptor = Object.getOwnPropertyDescriptor(obj, key);
- if (descriptor.get) {
- if (!exports.deepEqual(descriptor, Object.getOwnPropertyDescriptor(ref, key), options, seen)) {
- return false;
- }
- }
- else if (!exports.deepEqual(obj[key], ref[key], options, seen)) {
- return false;
- }
- }
-
- return true;
-};
-
-
-// Remove duplicate items from array
-
-exports.unique = function (array, key) {
-
- var index = {};
- var result = [];
-
- for (var i = 0, il = array.length; i < il; ++i) {
- var id = (key ? array[i][key] : array[i]);
- if (index[id] !== true) {
-
- result.push(array[i]);
- index[id] = true;
- }
- }
-
- return result;
-};
-
-
-// Convert array into object
-
-exports.mapToObject = function (array, key) {
-
- if (!array) {
- return null;
- }
-
- var obj = {};
- for (var i = 0, il = array.length; i < il; ++i) {
- if (key) {
- if (array[i][key]) {
- obj[array[i][key]] = true;
- }
- }
- else {
- obj[array[i]] = true;
- }
- }
-
- return obj;
-};
-
-
-// Find the common unique items in two arrays
-
-exports.intersect = function (array1, array2, justFirst) {
-
- if (!array1 || !array2) {
- return [];
- }
-
- var common = [];
- var hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1);
- var found = {};
- for (var i = 0, il = array2.length; i < il; ++i) {
- if (hash[array2[i]] && !found[array2[i]]) {
- if (justFirst) {
- return array2[i];
- }
-
- common.push(array2[i]);
- found[array2[i]] = true;
- }
- }
-
- return (justFirst ? null : common);
-};
-
-
-// Test if the reference contains the values
-
-exports.contain = function (ref, values, options) {
-
- /*
- string -> string(s)
- array -> item(s)
- object -> key(s)
- object -> object (key:value)
- */
-
- var valuePairs = null;
- if (typeof ref === 'object' &&
- typeof values === 'object' &&
- !Array.isArray(ref) &&
- !Array.isArray(values)) {
-
- valuePairs = values;
- values = Object.keys(values);
- }
- else {
- values = [].concat(values);
- }
-
- options = options || {}; // deep, once, only, part
-
- exports.assert(arguments.length >= 2, 'Insufficient arguments');
- exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object');
- exports.assert(values.length, 'Values array cannot be empty');
-
- var compare, compareFlags;
- if (options.deep) {
- compare = exports.deepEqual;
-
- var hasOnly = options.hasOwnProperty('only'), hasPart = options.hasOwnProperty('part');
-
- compareFlags = {
- prototype: hasOnly ? options.only : hasPart ? !options.part : false,
- part: hasOnly ? !options.only : hasPart ? options.part : true
- };
- }
- else {
- compare = function (a, b) {
-
- return a === b;
- };
- }
-
- var misses = false;
- var matches = new Array(values.length);
- for (var i = 0, il = matches.length; i < il; ++i) {
- matches[i] = 0;
- }
-
- if (typeof ref === 'string') {
- var pattern = '(';
- for (i = 0, il = values.length; i < il; ++i) {
- var value = values[i];
- exports.assert(typeof value === 'string', 'Cannot compare string reference to non-string value');
- pattern += (i ? '|' : '') + exports.escapeRegex(value);
- }
-
- var regex = new RegExp(pattern + ')', 'g');
- var leftovers = ref.replace(regex, function ($0, $1) {
-
- var index = values.indexOf($1);
- ++matches[index];
- return ''; // Remove from string
- });
-
- misses = !!leftovers;
- }
- else if (Array.isArray(ref)) {
- for (i = 0, il = ref.length; i < il; ++i) {
- for (var j = 0, jl = values.length, matched = false; j < jl && matched === false; ++j) {
- matched = compare(values[j], ref[i], compareFlags) && j;
- }
-
- if (matched !== false) {
- ++matches[matched];
- }
- else {
- misses = true;
- }
- }
- }
- else {
- var keys = Object.keys(ref);
- for (i = 0, il = keys.length; i < il; ++i) {
- var key = keys[i];
- var pos = values.indexOf(key);
- if (pos !== -1) {
- if (valuePairs &&
- !compare(valuePairs[key], ref[key], compareFlags)) {
-
- return false;
- }
-
- ++matches[pos];
- }
- else {
- misses = true;
- }
- }
- }
-
- var result = false;
- for (i = 0, il = matches.length; i < il; ++i) {
- result = result || !!matches[i];
- if ((options.once && matches[i] > 1) ||
- (!options.part && !matches[i])) {
-
- return false;
- }
- }
-
- if (options.only &&
- misses) {
-
- return false;
- }
-
- return result;
-};
-
-
-// Flatten array
-
-exports.flatten = function (array, target) {
-
- var result = target || [];
-
- for (var i = 0, il = array.length; i < il; ++i) {
- if (Array.isArray(array[i])) {
- exports.flatten(array[i], result);
- }
- else {
- result.push(array[i]);
- }
- }
-
- return result;
-};
-
-
-// Convert an object key chain string ('a.b.c') to reference (object[a][b][c])
-
-exports.reach = function (obj, chain, options) {
-
- options = options || {};
- if (typeof options === 'string') {
- options = { separator: options };
- }
-
- var path = chain.split(options.separator || '.');
- var ref = obj;
- for (var i = 0, il = path.length; i < il; ++i) {
- var key = path[i];
- if (key[0] === '-' && Array.isArray(ref)) {
- key = key.slice(1, key.length);
- key = ref.length - key;
- }
-
- if (!ref ||
- !ref.hasOwnProperty(key) ||
- (typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties
-
- exports.assert(!options.strict || i + 1 === il, 'Missing segment', key, 'in reach path ', chain);
- exports.assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain);
- ref = options.default;
- break;
- }
-
- ref = ref[key];
- }
-
- return ref;
-};
-
-
-exports.reachTemplate = function (obj, template, options) {
-
- return template.replace(/{([^}]+)}/g, function ($0, chain) {
-
- var value = exports.reach(obj, chain, options);
- return (value === undefined || value === null ? '' : value);
- });
-};
-
-
-exports.formatStack = function (stack) {
-
- var trace = [];
- for (var i = 0, il = stack.length; i < il; ++i) {
- var item = stack[i];
- trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]);
- }
-
- return trace;
-};
-
-
-exports.formatTrace = function (trace) {
-
- var display = [];
-
- for (var i = 0, il = trace.length; i < il; ++i) {
- var row = trace[i];
- display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')');
- }
-
- return display;
-};
-
-
-exports.callStack = function (slice) {
-
- // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
-
- var v8 = Error.prepareStackTrace;
- Error.prepareStackTrace = function (err, stack) {
-
- return stack;
- };
-
- var capture = {};
- Error.captureStackTrace(capture, arguments.callee); /*eslint no-caller:0 */
- var stack = capture.stack;
-
- Error.prepareStackTrace = v8;
-
- var trace = exports.formatStack(stack);
-
- if (slice) {
- return trace.slice(slice);
- }
-
- return trace;
-};
-
-
-exports.displayStack = function (slice) {
-
- var trace = exports.callStack(slice === undefined ? 1 : slice + 1);
-
- return exports.formatTrace(trace);
-};
-
-
-exports.abortThrow = false;
-
-
-exports.abort = function (message, hideStack) {
-
- if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) {
- throw new Error(message || 'Unknown error');
- }
-
- var stack = '';
- if (!hideStack) {
- stack = exports.displayStack(1).join('\n\t');
- }
- console.log('ABORT: ' + message + '\n\t' + stack);
- process.exit(1);
-};
-
-
-exports.assert = function (condition /*, msg1, msg2, msg3 */) {
-
- if (condition) {
- return;
- }
-
- if (arguments.length === 2 && arguments[1] instanceof Error) {
- throw arguments[1];
- }
-
- var msgs = [];
- for (var i = 1, il = arguments.length; i < il; ++i) {
- if (arguments[i] !== '') {
- msgs.push(arguments[i]); // Avoids Array.slice arguments leak, allowing for V8 optimizations
- }
- }
-
- msgs = msgs.map(function (msg) {
-
- return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : exports.stringify(msg);
- });
- throw new Error(msgs.join(' ') || 'Unknown error');
-};
-
-
-exports.Timer = function () {
-
- this.ts = 0;
- this.reset();
-};
-
-
-exports.Timer.prototype.reset = function () {
-
- this.ts = Date.now();
-};
-
-
-exports.Timer.prototype.elapsed = function () {
-
- return Date.now() - this.ts;
-};
-
-
-exports.Bench = function () {
-
- this.ts = 0;
- this.reset();
-};
-
-
-exports.Bench.prototype.reset = function () {
-
- this.ts = exports.Bench.now();
-};
-
-
-exports.Bench.prototype.elapsed = function () {
-
- return exports.Bench.now() - this.ts;
-};
-
-
-exports.Bench.now = function () {
-
- var ts = process.hrtime();
- return (ts[0] * 1e3) + (ts[1] / 1e6);
-};
-
-
-// Escape string for Regex construction
-
-exports.escapeRegex = function (string) {
-
- // Escape ^$.*+-?=!:|\/()[]{},
- return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
-};
-
-
-// Base64url (RFC 4648) encode
-
-exports.base64urlEncode = function (value, encoding) {
-
- var buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary'));
- return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
-};
-
-
-// Base64url (RFC 4648) decode
-
-exports.base64urlDecode = function (value, encoding) {
-
- if (value &&
- !/^[\w\-]*$/.test(value)) {
-
- return new Error('Invalid character');
- }
-
- try {
- var buf = new Buffer(value, 'base64');
- return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary'));
- }
- catch (err) {
- return err;
- }
-};
-
-
-// Escape attribute value for use in HTTP header
-
-exports.escapeHeaderAttribute = function (attribute) {
-
- // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
-
- exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')');
-
- return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash
-};
-
-
-exports.escapeHtml = function (string) {
-
- return Escape.escapeHtml(string);
-};
-
-
-exports.escapeJavaScript = function (string) {
-
- return Escape.escapeJavaScript(string);
-};
-
-
-exports.nextTick = function (callback) {
-
- return function () {
-
- var args = arguments;
- process.nextTick(function () {
-
- callback.apply(null, args);
- });
- };
-};
-
-
-exports.once = function (method) {
-
- if (method._hoekOnce) {
- return method;
- }
-
- var once = false;
- var wrapped = function () {
-
- if (!once) {
- once = true;
- method.apply(null, arguments);
- }
- };
-
- wrapped._hoekOnce = true;
-
- return wrapped;
-};
-
-
-exports.isAbsolutePath = function (path, platform) {
-
- if (!path) {
- return false;
- }
-
- if (Path.isAbsolute) { // node >= 0.11
- return Path.isAbsolute(path);
- }
-
- platform = platform || process.platform;
-
- // Unix
-
- if (platform !== 'win32') {
- return path[0] === '/';
- }
-
- // Windows
-
- return !!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path); // C:\ or \\something\something
-};
-
-
-exports.isInteger = function (value) {
-
- return (typeof value === 'number' &&
- parseFloat(value) === parseInt(value, 10) &&
- !isNaN(value));
-};
-
-
-exports.ignore = function () { };
-
-
-exports.inherits = Util.inherits;
-
-
-exports.format = Util.format;
-
-
-exports.transform = function (source, transform, options) {
-
- exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source object: must be null, undefined, or an object');
-
- var result = {};
- var keys = Object.keys(transform);
-
- for (var k = 0, kl = keys.length; k < kl; ++k) {
- var key = keys[k];
- var path = key.split('.');
- var sourcePath = transform[key];
-
- exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings');
-
- var segment;
- var res = result;
-
- while (path.length > 1) {
- segment = path.shift();
- if (!res[segment]) {
- res[segment] = {};
- }
- res = res[segment];
- }
- segment = path.shift();
- res[segment] = exports.reach(source, sourcePath, options);
- }
-
- return result;
-};
-
-
-exports.uniqueFilename = function (path, extension) {
-
- if (extension) {
- extension = extension[0] !== '.' ? '.' + extension : extension;
- }
- else {
- extension = '';
- }
-
- path = Path.resolve(path);
- var name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension;
- return Path.join(path, name);
-};
-
-
-exports.stringify = function () {
-
- try {
- return JSON.stringify.apply(null, arguments);
- }
- catch (err) {
- return '[Cannot display object: ' + err.message + ']';
- }
-};
-
-
-exports.shallow = function (source) {
-
- var target = {};
- var keys = Object.keys(source);
- for (var i = 0, il = keys.length; i < il; ++i) {
- var key = keys[i];
- target[key] = source[key];
- }
-
- return target;
-};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
deleted file mode 100644
index 716fe27..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "name": "hoek",
- "description": "General purpose node utilities",
- "version": "2.14.0",
- "repository": {
- "type": "git",
- "url": "git://github.com/hapijs/hoek.git"
- },
- "main": "index",
- "keywords": [
- "utilities"
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "dependencies": {},
- "devDependencies": {
- "code": "1.x.x",
- "lab": "5.x.x"
- },
- "scripts": {
- "test": "make test-cov"
- },
- "license": "BSD-3-Clause",
- "gitHead": "e80875a516f4b0eaa757ac4814c4510eebdcf589",
- "bugs": {
- "url": "https://github.com/hapijs/hoek/issues"
- },
- "homepage": "https://github.com/hapijs/hoek#readme",
- "_id": "hoek@2.14.0",
- "_shasum": "81211691f52a5a835ae49edbf1e89c9003476aa4",
- "_from": "hoek@>=2.0.0 <3.0.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "0.12.2",
- "_npmUser": {
- "name": "nlf",
- "email": "quitlahok@gmail.com"
- },
- "dist": {
- "shasum": "81211691f52a5a835ae49edbf1e89c9003476aa4",
- "tarball": "http://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz"
- },
- "maintainers": [
- {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
- },
- {
- "name": "wyatt",
- "email": "wpreul@gmail.com"
- },
- {
- "name": "nlf",
- "email": "quitlahok@gmail.com"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz",
- "readme": "ERROR: No README data found!"
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js
deleted file mode 100755
index a5d048f..0000000
--- a/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js
+++ /dev/null
@@ -1,88 +0,0 @@
-// Load modules
-
-var Code = require('code');
-var Hoek = require('../lib');
-var Lab = require('lab');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var describe = lab.experiment;
-var it = lab.test;
-var expect = Code.expect;
-
-
-describe('escapeJavaScript()', function () {
-
- it('encodes / characters', function (done) {
-
- var encoded = Hoek.escapeJavaScript('<script>alert(1)</script>');
- expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e');
- done();
- });
-
- it('encodes \' characters', function (done) {
-
- var encoded = Hoek.escapeJavaScript('something(\'param\')');
- expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29');
- done();
- });
-
- it('encodes large unicode characters with the correct padding', function (done) {
-
- var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000));
- expect(encoded).to.equal('\\u0500\\u1000');
- done();
- });
-
- it('doesn\'t throw an exception when passed null', function (done) {
-
- var encoded = Hoek.escapeJavaScript(null);
- expect(encoded).to.equal('');
- done();
- });
-});
-
-describe('escapeHtml()', function () {
-
- it('encodes / characters', function (done) {
-
- var encoded = Hoek.escapeHtml('<script>alert(1)</script>');
- expect(encoded).to.equal('<script>alert(1)</script>');
- done();
- });
-
- it('encodes < and > as named characters', function (done) {
-
- var encoded = Hoek.escapeHtml('<script><>');
- expect(encoded).to.equal('<script><>');
- done();
- });
-
- it('encodes large unicode characters', function (done) {
-
- var encoded = Hoek.escapeHtml(String.fromCharCode(500) + String.fromCharCode(1000));
- expect(encoded).to.equal('ǴϨ');
- done();
- });
-
- it('doesn\'t throw an exception when passed null', function (done) {
-
- var encoded = Hoek.escapeHtml(null);
- expect(encoded).to.equal('');
- done();
- });
-
- it('encodes {} characters', function (done) {
-
- var encoded = Hoek.escapeHtml('{}');
- expect(encoded).to.equal('{}');
- done();
- });
-});
[51/59] [abbrv] couchdb-nmo git commit: remove request module
Posted by ro...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/README.md b/node_modules/request/README.md
deleted file mode 100644
index 2abc9e1..0000000
--- a/node_modules/request/README.md
+++ /dev/null
@@ -1,1031 +0,0 @@
-
-# Request - Simplified HTTP client
-
-[](https://nodei.co/npm/request/)
-
-[](https://travis-ci.org/request/request)
-[](https://coveralls.io/r/request/request)
-[](https://gitter.im/request/request?utm_source=badge)
-
-
-## Super simple to use
-
-Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.
-
-```js
-var request = require('request');
-request('http://www.google.com', function (error, response, body) {
- if (!error && response.statusCode == 200) {
- console.log(body) // Show the HTML for the Google homepage.
- }
-})
-```
-
-
-## Table of contents
-
-- [Streaming](#streaming)
-- [Forms](#forms)
-- [HTTP Authentication](#http-authentication)
-- [Custom HTTP Headers](#custom-http-headers)
-- [OAuth Signing](#oauth-signing)
-- [Proxies](#proxies)
-- [Unix Domain Sockets](#unix-domain-sockets)
-- [TLS/SSL Protocol](#tlsssl-protocol)
-- [Support for HAR 1.2](#support-for-har-12)
-- [**All Available Options**](#requestoptions-callback)
-
-Request also offers [convenience methods](#convenience-methods) like
-`request.defaults` and `request.post`, and there are
-lots of [usage examples](#examples) and several
-[debugging techniques](#debugging).
-
-
----
-
-
-## Streaming
-
-You can stream any response to a file stream.
-
-```js
-request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))
-```
-
-You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one).
-
-```js
-fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))
-```
-
-Request can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers.
-
-```js
-request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))
-```
-
-Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage).
-
-```js
-request
- .get('http://google.com/img.png')
- .on('response', function(response) {
- console.log(response.statusCode) // 200
- console.log(response.headers['content-type']) // 'image/png'
- })
- .pipe(request.put('http://mysite.com/img.png'))
-```
-
-To easily handle errors when streaming requests, listen to the `error` event before piping:
-
-```js
-request
- .get('http://mysite.com/doodle.png')
- .on('error', function(err) {
- console.log(err)
- })
- .pipe(fs.createWriteStream('doodle.png'))
-```
-
-Now let’s get fancy.
-
-```js
-http.createServer(function (req, resp) {
- if (req.url === '/doodle.png') {
- if (req.method === 'PUT') {
- req.pipe(request.put('http://mysite.com/doodle.png'))
- } else if (req.method === 'GET' || req.method === 'HEAD') {
- request.get('http://mysite.com/doodle.png').pipe(resp)
- }
- }
-})
-```
-
-You can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do:
-
-```js
-http.createServer(function (req, resp) {
- if (req.url === '/doodle.png') {
- var x = request('http://mysite.com/doodle.png')
- req.pipe(x)
- x.pipe(resp)
- }
-})
-```
-
-And since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :)
-
-```js
-req.pipe(request('http://mysite.com/doodle.png')).pipe(resp)
-```
-
-Also, none of this new functionality conflicts with requests previous features, it just expands them.
-
-```js
-var r = request.defaults({'proxy':'http://localproxy.com'})
-
-http.createServer(function (req, resp) {
- if (req.url === '/doodle.png') {
- r.get('http://google.com/doodle.png').pipe(resp)
- }
-})
-```
-
-You can still use intermediate proxies, the requests will still follow HTTP forwards, etc.
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## Forms
-
-`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.
-
-
-#### application/x-www-form-urlencoded (URL-Encoded Forms)
-
-URL-encoded forms are simple.
-
-```js
-request.post('http://service.com/upload', {form:{key:'value'}})
-// or
-request.post('http://service.com/upload').form({key:'value'})
-// or
-request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })
-```
-
-
-#### multipart/form-data (Multipart Form Uploads)
-
-For `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.
-
-
-```js
-var formData = {
- // Pass a simple key-value pair
- my_field: 'my_value',
- // Pass data via Buffers
- my_buffer: new Buffer([1, 2, 3]),
- // Pass data via Streams
- my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
- // Pass multiple values /w an Array
- attachments: [
- fs.createReadStream(__dirname + '/attachment1.jpg'),
- fs.createReadStream(__dirname + '/attachment2.jpg')
- ],
- // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}
- // Use case: for some types of streams, you'll need to provide "file"-related information manually.
- // See the `form-data` README for more information about options: https://github.com/felixge/node-form-data
- custom_file: {
- value: fs.createReadStream('/dev/urandom'),
- options: {
- filename: 'topsecret.jpg',
- contentType: 'image/jpg'
- }
- }
-};
-request.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) {
- if (err) {
- return console.error('upload failed:', err);
- }
- console.log('Upload successful! Server responded with:', body);
-});
-```
-
-For advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)
-
-```js
-// NOTE: Advanced use-case, for normal use see 'formData' usage above
-var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) { // ...
-
-var form = r.form();
-form.append('my_field', 'my_value');
-form.append('my_buffer', new Buffer([1, 2, 3]));
-form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});
-```
-See the [form-data README](https://github.com/felixge/node-form-data) for more information & examples.
-
-
-#### multipart/related
-
-Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options.
-
-```js
- request({
- method: 'PUT',
- preambleCRLF: true,
- postambleCRLF: true,
- uri: 'http://service.com/upload',
- multipart: [
- {
- 'content-type': 'application/json'
- body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
- },
- { body: 'I am an attachment' },
- { body: fs.createReadStream('image.png') }
- ],
- // alternatively pass an object containing additional options
- multipart: {
- chunked: false,
- data: [
- {
- 'content-type': 'application/json',
- body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
- },
- { body: 'I am an attachment' }
- ]
- }
- },
- function (error, response, body) {
- if (error) {
- return console.error('upload failed:', error);
- }
- console.log('Upload successful! Server responded with:', body);
- })
-```
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## HTTP Authentication
-
-```js
-request.get('http://some.server.com/').auth('username', 'password', false);
-// or
-request.get('http://some.server.com/', {
- 'auth': {
- 'user': 'username',
- 'pass': 'password',
- 'sendImmediately': false
- }
-});
-// or
-request.get('http://some.server.com/').auth(null, null, true, 'bearerToken');
-// or
-request.get('http://some.server.com/', {
- 'auth': {
- 'bearer': 'bearerToken'
- }
-});
-```
-
-If passed as an option, `auth` should be a hash containing values:
-
-- `user` || `username`
-- `pass` || `password`
-- `sendImmediately` (optional)
-- `bearer` (optional)
-
-The method form takes parameters
-`auth(username, password, sendImmediately, bearer)`.
-
-`sendImmediately` defaults to `true`, which causes a basic or bearer
-authentication header to be sent. If `sendImmediately` is `false`, then
-`request` will retry with a proper authentication header after receiving a
-`401` response from the server (which must contain a `WWW-Authenticate` header
-indicating the required authentication method).
-
-Note that you can also specify basic authentication using the URL itself, as
-detailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the
-`user:password` before the host with an `@` sign:
-
-```js
-var username = 'username',
- password = 'password',
- url = 'http://' + username + ':' + password + '@some.server.com';
-
-request({url: url}, function (error, response, body) {
- // Do more stuff with 'body' here
-});
-```
-
-Digest authentication is supported, but it only works with `sendImmediately`
-set to `false`; otherwise `request` will send basic authentication on the
-initial request, which will probably cause the request to fail.
-
-Bearer authentication is supported, and is activated when the `bearer` value is
-available. The value may be either a `String` or a `Function` returning a
-`String`. Using a function to supply the bearer token is particularly useful if
-used in conjuction with `defaults` to allow a single function to supply the
-last known token at the time of sending a request, or to compute one on the fly.
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## Custom HTTP Headers
-
-HTTP Headers, such as `User-Agent`, can be set in the `options` object.
-In the example below, we call the github API to find out the number
-of stars and forks for the request repository. This requires a
-custom `User-Agent` header as well as https.
-
-```js
-var request = require('request');
-
-var options = {
- url: 'https://api.github.com/repos/request/request',
- headers: {
- 'User-Agent': 'request'
- }
-};
-
-function callback(error, response, body) {
- if (!error && response.statusCode == 200) {
- var info = JSON.parse(body);
- console.log(info.stargazers_count + " Stars");
- console.log(info.forks_count + " Forks");
- }
-}
-
-request(options, callback);
-```
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## OAuth Signing
-
-[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The
-default signing algorithm is
-[HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2):
-
-```js
-// OAuth1.0 - 3-legged server side flow (Twitter example)
-// step 1
-var qs = require('querystring')
- , oauth =
- { callback: 'http://mysite.com/callback/'
- , consumer_key: CONSUMER_KEY
- , consumer_secret: CONSUMER_SECRET
- }
- , url = 'https://api.twitter.com/oauth/request_token'
- ;
-request.post({url:url, oauth:oauth}, function (e, r, body) {
- // Ideally, you would take the body in the response
- // and construct a URL that a user clicks on (like a sign in button).
- // The verifier is only available in the response after a user has
- // verified with twitter that they are authorizing your app.
-
- // step 2
- var req_data = qs.parse(body)
- var uri = 'https://api.twitter.com/oauth/authenticate'
- + '?' + qs.stringify({oauth_token: req_data.oauth_token})
- // redirect the user to the authorize uri
-
- // step 3
- // after the user is redirected back to your server
- var auth_data = qs.parse(body)
- , oauth =
- { consumer_key: CONSUMER_KEY
- , consumer_secret: CONSUMER_SECRET
- , token: auth_data.oauth_token
- , token_secret: req_data.oauth_token_secret
- , verifier: auth_data.oauth_verifier
- }
- , url = 'https://api.twitter.com/oauth/access_token'
- ;
- request.post({url:url, oauth:oauth}, function (e, r, body) {
- // ready to make signed requests on behalf of the user
- var perm_data = qs.parse(body)
- , oauth =
- { consumer_key: CONSUMER_KEY
- , consumer_secret: CONSUMER_SECRET
- , token: perm_data.oauth_token
- , token_secret: perm_data.oauth_token_secret
- }
- , url = 'https://api.twitter.com/1.1/users/show.json'
- , qs =
- { screen_name: perm_data.screen_name
- , user_id: perm_data.user_id
- }
- ;
- request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {
- console.log(user)
- })
- })
-})
-```
-
-For [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make
-the following changes to the OAuth options object:
-* Pass `signature_method : 'RSA-SHA1'`
-* Instead of `consumer_secret`, specify a `private_key` string in
- [PEM format](http://how2ssl.com/articles/working_with_pem_files/)
-
-For [PLAINTEXT signing](http://oauth.net/core/1.0/#anchor22), make
-the following changes to the OAuth options object:
-* Pass `signature_method : 'PLAINTEXT'`
-
-To send OAuth parameters via query params or in a post body as described in The
-[Consumer Request Parameters](http://oauth.net/core/1.0/#consumer_req_param)
-section of the oauth1 spec:
-* Pass `transport_method : 'query'` or `transport_method : 'body'` in the OAuth
- options object.
-* `transport_method` defaults to `'header'`
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## Proxies
-
-If you specify a `proxy` option, then the request (and any subsequent
-redirects) will be sent via a connection to the proxy server.
-
-If your endpoint is an `https` url, and you are using a proxy, then
-request will send a `CONNECT` request to the proxy server *first*, and
-then use the supplied connection to connect to the endpoint.
-
-That is, first it will make a request like:
-
-```
-HTTP/1.1 CONNECT endpoint-server.com:80
-Host: proxy-server.com
-User-Agent: whatever user agent you specify
-```
-
-and then the proxy server make a TCP connection to `endpoint-server`
-on port `80`, and return a response that looks like:
-
-```
-HTTP/1.1 200 OK
-```
-
-At this point, the connection is left open, and the client is
-communicating directly with the `endpoint-server.com` machine.
-
-See [the wikipedia page on HTTP Tunneling](http://en.wikipedia.org/wiki/HTTP_tunnel)
-for more information.
-
-By default, when proxying `http` traffic, request will simply make a
-standard proxied `http` request. This is done by making the `url`
-section of the initial line of the request a fully qualified url to
-the endpoint.
-
-For example, it will make a single request that looks like:
-
-```
-HTTP/1.1 GET http://endpoint-server.com/some-url
-Host: proxy-server.com
-Other-Headers: all go here
-
-request body or whatever
-```
-
-Because a pure "http over http" tunnel offers no additional security
-or other features, it is generally simpler to go with a
-straightforward HTTP proxy in this case. However, if you would like
-to force a tunneling proxy, you may set the `tunnel` option to `true`.
-
-You can also make a standard proxied `http` request by explicitly setting
-`tunnel : false`, but **note that this will allow the proxy to see the traffic
-to/from the destination server**.
-
-If you are using a tunneling proxy, you may set the
-`proxyHeaderWhiteList` to share certain headers with the proxy.
-
-You can also set the `proxyHeaderExclusiveList` to share certain
-headers only with the proxy and not with destination host.
-
-By default, this set is:
-
-```
-accept
-accept-charset
-accept-encoding
-accept-language
-accept-ranges
-cache-control
-content-encoding
-content-language
-content-length
-content-location
-content-md5
-content-range
-content-type
-connection
-date
-expect
-max-forwards
-pragma
-proxy-authorization
-referer
-te
-transfer-encoding
-user-agent
-via
-```
-
-Note that, when using a tunneling proxy, the `proxy-authorization`
-header and any headers from custom `proxyHeaderExclusiveList` are
-*never* sent to the endpoint server, but only to the proxy server.
-
-
-### Controlling proxy behaviour using environment variables
-
-The following environment variables are respected by `request`:
-
- * `HTTP_PROXY` / `http_proxy`
- * `HTTPS_PROXY` / `https_proxy`
- * `NO_PROXY` / `no_proxy`
-
-When `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.
-
-`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables.
-
-Here's some examples of valid `no_proxy` values:
-
- * `google.com` - don't proxy HTTP/HTTPS requests to Google.
- * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google.
- * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo!
- * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether.
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## UNIX Domain Sockets
-
-`request` supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:
-
-```js
-/* Pattern */ 'http://unix:SOCKET:PATH'
-/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path')
-```
-
-Note: The `SOCKET` path is assumed to be absolute to the root of the host file system.
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## TLS/SSL Protocol
-
-TLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be
-set in the `agentOptions` property of the `options` object.
-In the example below, we call an API requires client side SSL certificate
-(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol:
-
-```js
-var fs = require('fs')
- , path = require('path')
- , certFile = path.resolve(__dirname, 'ssl/client.crt')
- , keyFile = path.resolve(__dirname, 'ssl/client.key')
- , request = require('request');
-
-var options = {
- url: 'https://api.some-server.com/',
- agentOptions: {
- cert: fs.readFileSync(certFile),
- key: fs.readFileSync(keyFile),
- // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format:
- // pfx: fs.readFileSync(pfxFilePath),
- passphrase: 'password',
- securityOptions: 'SSL_OP_NO_SSLv3'
- }
-};
-
-request.get(options);
-```
-
-It is able to force using SSLv3 only by specifying `secureProtocol`:
-
-```js
-request.get({
- url: 'https://api.some-server.com/',
- agentOptions: {
- secureProtocol: 'SSLv3_method'
- }
-});
-```
-
-It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs).
-This can be useful, for example, when using self-signed certificates.
-To allow a different certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`:
-
-```js
-request.get({
- url: 'https://api.some-server.com/',
- agentOptions: {
- ca: fs.readFileSync('ca.cert.pem')
- }
-});
-```
-
-[back to top](#table-of-contents)
-
-
----
-
-## Support for HAR 1.2
-
-The `options.har` property will override the values: `url`, `method`, `qs`, `headers`, `form`, `formData`, `body`, `json`, as well as construct multipart data and read files from disk when `request.postData.params[].fileName` is present without a matching `value`.
-
-a validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching.
-
-```js
- var request = require('request')
- request({
- // will be ignored
- method: 'GET'
- uri: 'http://www.google.com',
-
- // HTTP Archive Request Object
- har: {
- url: 'http://www.mockbin.com/har'
- method: 'POST',
- headers: [
- {
- name: 'content-type',
- value: 'application/x-www-form-urlencoded'
- }
- ],
- postData: {
- mimeType: 'application/x-www-form-urlencoded',
- params: [
- {
- name: 'foo',
- value: 'bar'
- },
- {
- name: 'hello',
- value: 'world'
- }
- ]
- }
- }
- })
-
- // a POST request will be sent to http://www.mockbin.com
- // with body an application/x-www-form-urlencoded body:
- // foo=bar&hello=world
-```
-
-[back to top](#table-of-contents)
-
-
----
-
-## request(options, callback)
-
-The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.
-
-- `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`
-- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.
-- `method` - http method (default: `"GET"`)
-- `headers` - http headers (default: `{}`)
-
----
-
-- `qs` - object containing querystring values to be appended to the `uri`
-- `qsParseOptions` - object containing options to pass to the [qs.parse](https://github.com/hapijs/qs#parsing-objects) method or [querystring.parse](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options) method
-- `qsStringifyOptions` - object containing options to pass to the [qs.stringify](https://github.com/hapijs/qs#stringifying) method or to the [querystring.stringify](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) method. For example, to change the way arrays are converted to query strings pass the `arrayFormat` option with one of `indices|brackets|repeat`
-- `useQuerystring` - If true, use `querystring` to stringify and parse
- querystrings, otherwise use `qs` (default: `false`). Set this option to
- `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the
- default `foo[0]=bar&foo[1]=baz`.
-
----
-
-- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object.
-- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above.
-- `formData` - Data to pass for a `multipart/form-data` request. See
- [Forms](#forms) section above.
-- `multipart` - array of objects which contain their own headers and `body`
- attributes. Sends a `multipart/related` request. See [Forms](#forms) section
- above.
- - Alternatively you can pass in an object `{chunked: false, data: []}` where
- `chunked` is used to specify whether the request is sent in
- [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)
- In non-chunked requests, data items with body streams are not allowed.
-- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.
-- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.
-- `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.
-- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.
-
----
-
-- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above.
-- `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.
-- `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).
-- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services)
-- `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.
-
----
-
-- `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.
-- `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)
-- `maxRedirects` - the maximum number of redirects to follow (default: `10`)
-
----
-
-- `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default).
-- `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.
-- `jar` - If `true` and `tough-cookie` is installed, remember cookies for future use (or define your custom cookie jar; see examples section)
-
----
-
-- `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as [your options allow for it](request.js#L747)). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool.
- - A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`).
- - Note that if you are sending multiple requests in a loop and creating
- multiple new `pool` objects, `maxSockets` will not work as intended. To
- work around this, either use [`request.defaults`](#requestdefaultsoptions)
- with your pool options or create the pool object with the `maxSockets`
- property outside of the loop.
-- `timeout` - Integer containing the number of milliseconds to wait for a
- request to respond before aborting the request. Note that if the underlying
- TCP connection cannot be established, the OS-wide TCP connection timeout will
- overrule the `timeout` option ([the default in Linux is around 20 seconds](http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout)).
-- `localAddress` - Local interface to bind for network connections.
-- `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`)
-- `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option.
-- `agentOptions` - Object containing user agent options. See documentation above. **Note:** [see tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback).
-- `tunnel` - controls the behavior of
- [HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling)
- as follows:
- - `undefined` (default) - `true` if the destination is `https` or a previous
- request in the redirect chain used a tunneling proxy, `false` otherwise
- - `true` - always tunnel to the destination by making a `CONNECT` request to
- the proxy
- - `false` - request the destination as a `GET` request.
-- `proxyHeaderWhiteList` - A whitelist of headers to send to a
- tunneling proxy.
-- `proxyHeaderExclusiveList` - A whitelist of headers to send
- exclusively to a tunneling proxy and not to destination.
-- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`).
-
----
-
-- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's `elapsedTime` property.
-
----
-
-- `har` - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)*
-
-The callback argument gets 3 arguments:
-
-1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object)
-2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object
-3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied)
-
-[back to top](#table-of-contents)
-
-
----
-
-## Convenience methods
-
-There are also shorthand methods for different HTTP METHODs and some other conveniences.
-
-
-### request.defaults(options)
-
-This method **returns a wrapper** around the normal request API that defaults
-to whatever options you pass to it.
-
-**Note:** `request.defaults()` **does not** modify the global request API;
-instead, it **returns a wrapper** that has your default settings applied to it.
-
-**Note:** You can call `.defaults()` on the wrapper that is returned from
-`request.defaults` to add/override defaults that were previously defaulted.
-
-For example:
-```js
-//requests using baseRequest() will set the 'x-token' header
-var baseRequest = request.defaults({
- headers: {x-token: 'my-token'}
-})
-
-//requests using specialRequest() will include the 'x-token' header set in
-//baseRequest and will also include the 'special' header
-var specialRequest = baseRequest.defaults({
- headers: {special: 'special value'}
-})
-```
-
-### request.put
-
-Same as `request()`, but defaults to `method: "PUT"`.
-
-```js
-request.put(url)
-```
-
-### request.patch
-
-Same as `request()`, but defaults to `method: "PATCH"`.
-
-```js
-request.patch(url)
-```
-
-### request.post
-
-Same as `request()`, but defaults to `method: "POST"`.
-
-```js
-request.post(url)
-```
-
-### request.head
-
-Same as `request()`, but defaults to `method: "HEAD"`.
-
-```js
-request.head(url)
-```
-
-### request.del
-
-Same as `request()`, but defaults to `method: "DELETE"`.
-
-```js
-request.del(url)
-```
-
-### request.get
-
-Same as `request()` (for uniformity).
-
-```js
-request.get(url)
-```
-### request.cookie
-
-Function that creates a new cookie.
-
-```js
-request.cookie('key1=value1')
-```
-### request.jar()
-
-Function that creates a new cookie jar.
-
-```js
-request.jar()
-```
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## Debugging
-
-There are at least three ways to debug the operation of `request`:
-
-1. Launch the node process like `NODE_DEBUG=request node script.js`
- (`lib,request,otherlib` works too).
-
-2. Set `require('request').debug = true` at any time (this does the same thing
- as #1).
-
-3. Use the [request-debug module](https://github.com/nylen/request-debug) to
- view request and response headers and bodies.
-
-[back to top](#table-of-contents)
-
-
----
-
-
-## Examples:
-
-```js
- var request = require('request')
- , rand = Math.floor(Math.random()*100000000).toString()
- ;
- request(
- { method: 'PUT'
- , uri: 'http://mikeal.iriscouch.com/testjs/' + rand
- , multipart:
- [ { 'content-type': 'application/json'
- , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
- }
- , { body: 'I am an attachment' }
- ]
- }
- , function (error, response, body) {
- if(response.statusCode == 201){
- console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)
- } else {
- console.log('error: '+ response.statusCode)
- console.log(body)
- }
- }
- )
-```
-
-For backwards-compatibility, response compression is not supported by default.
-To accept gzip-compressed responses, set the `gzip` option to `true`. Note
-that the body data passed through `request` is automatically decompressed
-while the response object is unmodified and will contain compressed data if
-the server sent a compressed response.
-
-```js
- var request = require('request')
- request(
- { method: 'GET'
- , uri: 'http://www.google.com'
- , gzip: true
- }
- , function (error, response, body) {
- // body is the decompressed response body
- console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))
- console.log('the decoded data is: ' + body)
- }
- ).on('data', function(data) {
- // decompressed data as it is received
- console.log('decoded chunk: ' + data)
- })
- .on('response', function(response) {
- // unmodified http.IncomingMessage object
- response.on('data', function(data) {
- // compressed data as it is received
- console.log('received ' + data.length + ' bytes of compressed data')
- })
- })
-```
-
-Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`) and install `tough-cookie`.
-
-```js
-var request = request.defaults({jar: true})
-request('http://www.google.com', function () {
- request('http://images.google.com')
-})
-```
-
-To use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`)
-
-```js
-var j = request.jar()
-var request = request.defaults({jar:j})
-request('http://www.google.com', function () {
- request('http://images.google.com')
-})
-```
-
-OR
-
-```js
-var j = request.jar();
-var cookie = request.cookie('key1=value1');
-var url = 'http://www.google.com';
-j.setCookie(cookie, url);
-request({url: url, jar: j}, function () {
- request('http://images.google.com')
-})
-```
-
-To use a custom cookie store (such as a
-[`FileCookieStore`](https://github.com/mitsuru/tough-cookie-filestore)
-which supports saving to and restoring from JSON files), pass it as a parameter
-to `request.jar()`:
-
-```js
-var FileCookieStore = require('tough-cookie-filestore');
-// NOTE - currently the 'cookies.json' file must already exist!
-var j = request.jar(new FileCookieStore('cookies.json'));
-request = request.defaults({ jar : j })
-request('http://www.google.com', function() {
- request('http://images.google.com')
-})
-```
-
-The cookie store must be a
-[`tough-cookie`](https://github.com/goinstant/tough-cookie)
-store and it must support synchronous operations; see the
-[`CookieStore` API docs](https://github.com/goinstant/tough-cookie/#cookiestore-api)
-for details.
-
-To inspect your cookie jar after a request:
-
-```js
-var j = request.jar()
-request({url: 'http://www.google.com', jar: j}, function () {
- var cookie_string = j.getCookieString(uri); // "key1=value1; key2=value2; ..."
- var cookies = j.getCookies(uri);
- // [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...]
-})
-```
-
-[back to top](#table-of-contents)
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/disabled.appveyor.yml
----------------------------------------------------------------------
diff --git a/node_modules/request/disabled.appveyor.yml b/node_modules/request/disabled.appveyor.yml
deleted file mode 100644
index 238f3d6..0000000
--- a/node_modules/request/disabled.appveyor.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-# http://www.appveyor.com/docs/appveyor-yml
-
-# Fix line endings in Windows. (runs before repo cloning)
-init:
- - git config --global core.autocrlf input
-
-# Test against these versions of Node.js.
-environment:
- matrix:
- - nodejs_version: "0.10"
- - nodejs_version: "0.8"
- - nodejs_version: "0.11"
-
-# Allow failing jobs for bleeding-edge Node.js versions.
-matrix:
- allow_failures:
- - nodejs_version: "0.11"
-
-# Install scripts. (runs after repo cloning)
-install:
- # Get the latest stable version of Node 0.STABLE.latest
- - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version)
- # Typical npm stuff.
- - npm install
-
-# Post-install test scripts.
-test_script:
- # Output useful info for debugging.
- - ps: "npm test # PowerShell" # Pass comment to PS for easier debugging
- - cmd: npm test
-
-# Don't actually build.
-build: off
-
-# Set build version format here instead of in the admin panel.
-version: "{build}"
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/examples/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/examples/README.md b/node_modules/request/examples/README.md
deleted file mode 100644
index 526d71b..0000000
--- a/node_modules/request/examples/README.md
+++ /dev/null
@@ -1,115 +0,0 @@
-
-# Authentication
-
-## OAuth
-
-### OAuth1.0 Refresh Token
-
-- http://oauth.googlecode.com/svn/spec/ext/session/1.0/drafts/1/spec.html#anchor4
-- https://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html
-
-```js
-request.post('https://api.login.yahoo.com/oauth/v2/get_token', {
- oauth: {
- consumer_key: '...',
- consumer_secret: '...',
- token: '...',
- token_secret: '...',
- session_handle: '...'
- }
-}, function (err, res, body) {
- var result = require('querystring').parse(body)
- // assert.equal(typeof result, 'object')
-})
-```
-
-### OAuth2 Refresh Token
-
-- https://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-6
-
-```js
-request.post('https://accounts.google.com/o/oauth2/token', {
- form: {
- grant_type: 'refresh_token',
- client_id: '...',
- client_secret: '...',
- refresh_token: '...'
- },
- json: true
-}, function (err, res, body) {
- // assert.equal(typeof body, 'object')
-})
-```
-
-# Multipart
-
-## multipart/form-data
-
-### Flickr Image Upload
-
-- https://www.flickr.com/services/api/upload.api.html
-
-```js
-request.post('https://up.flickr.com/services/upload', {
- oauth: {
- consumer_key: '...',
- consumer_secret: '...',
- token: '...',
- token_secret: '...'
- },
- // all meta data should be included here for proper signing
- qs: {
- title: 'My cat is awesome',
- description: 'Sent on ' + new Date(),
- is_public: 1
- },
- // again the same meta data + the actual photo
- formData: {
- title: 'My cat is awesome',
- description: 'Sent on ' + new Date(),
- is_public: 1,
- photo:fs.createReadStream('cat.png')
- },
- json: true
-}, function (err, res, body) {
- // assert.equal(typeof body, 'object')
-})
-```
-
-# Streams
-
-## `POST` data
-
-Use Request as a Writable stream to easily `POST` Readable streams (like files, other HTTP requests, or otherwise).
-
-TL;DR: Pipe a Readable Stream onto Request via:
-
-```
-READABLE.pipe(request.post(URL));
-```
-
-A more detailed example:
-
-```js
-var fs = require('fs')
- , path = require('path')
- , http = require('http')
- , request = require('request')
- , TMP_FILE_PATH = path.join(path.sep, 'tmp', 'foo')
-;
-
-// write a temporary file:
-fs.writeFileSync(TMP_FILE_PATH, 'foo bar baz quk\n');
-
-http.createServer(function(req, res) {
- console.log('the server is receiving data!\n');
- req
- .on('end', res.end.bind(res))
- .pipe(process.stdout)
- ;
-}).listen(3000).unref();
-
-fs.createReadStream(TMP_FILE_PATH)
- .pipe(request.post('http://127.0.0.1:3000'))
-;
-```
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/index.js
----------------------------------------------------------------------
diff --git a/node_modules/request/index.js b/node_modules/request/index.js
deleted file mode 100755
index 3474840..0000000
--- a/node_modules/request/index.js
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright 2010-2012 Mikeal Rogers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-'use strict'
-
-var extend = require('util')._extend
- , cookies = require('./lib/cookies')
- , helpers = require('./lib/helpers')
-
-var isFunction = helpers.isFunction
- , paramsHaveRequestBody = helpers.paramsHaveRequestBody
-
-
-// organize params for patch, post, put, head, del
-function initParams(uri, options, callback) {
- if (typeof options === 'function') {
- callback = options
- }
-
- var params = {}
- if (typeof options === 'object') {
- params = extend({}, options)
- params = extend(params, {uri: uri})
- } else if (typeof uri === 'string') {
- params = extend({}, {uri: uri})
- } else {
- params = extend({}, uri)
- }
-
- params.callback = callback
- return params
-}
-
-function request (uri, options, callback) {
- if (typeof uri === 'undefined') {
- throw new Error('undefined is not a valid uri or options object.')
- }
-
- var params = initParams(uri, options, callback)
-
- if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
- throw new Error('HTTP HEAD requests MUST NOT include a request body.')
- }
-
- return new request.Request(params)
-}
-
-var verbs = ['get', 'head', 'post', 'put', 'patch', 'del']
-
-verbs.forEach(function(verb) {
- var method = verb === 'del' ? 'DELETE' : verb.toUpperCase()
- request[verb] = function (uri, options, callback) {
- var params = initParams(uri, options, callback)
- params.method = method
- return request(params, params.callback)
- }
-})
-
-request.jar = function (store) {
- return cookies.jar(store)
-}
-
-request.cookie = function (str) {
- return cookies.parse(str)
-}
-
-function wrapRequestMethod (method, options, requester) {
-
- return function (uri, opts, callback) {
- var params = initParams(uri, opts, callback)
-
- var headerlessOptions = extend({}, options)
- delete headerlessOptions.headers
- params = extend(headerlessOptions, params)
-
- if (options.headers) {
- var headers = extend({}, options.headers)
- params.headers = extend(headers, params.headers)
- }
-
- if (typeof method === 'string') {
- params.method = (method === 'del' ? 'DELETE' : method.toUpperCase())
- method = request[method]
- }
-
- if (isFunction(requester)) {
- method = requester
- }
-
- return method(params, params.callback)
- }
-}
-
-request.defaults = function (options, requester) {
- var self = this
-
- if (typeof options === 'function') {
- requester = options
- options = {}
- }
-
- var defaults = wrapRequestMethod(self, options, requester)
-
- var verbs = ['get', 'head', 'post', 'put', 'patch', 'del']
- verbs.forEach(function(verb) {
- defaults[verb] = wrapRequestMethod(verb, options, requester)
- })
-
- defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
- defaults.jar = self.jar
- defaults.defaults = self.defaults
- return defaults
-}
-
-request.forever = function (agentOptions, optionsArg) {
- var options = {}
- if (optionsArg) {
- options = extend({}, optionsArg)
- }
- if (agentOptions) {
- options.agentOptions = agentOptions
- }
-
- options.forever = true
- return request.defaults(options)
-}
-
-// Exports
-
-module.exports = request
-request.Request = require('./request')
-request.initParams = initParams
-
-// Backwards compatibility for request.debug
-Object.defineProperty(request, 'debug', {
- enumerable : true,
- get : function() {
- return request.Request.debug
- },
- set : function(debug) {
- request.Request.debug = debug
- }
-})
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/auth.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/auth.js b/node_modules/request/lib/auth.js
deleted file mode 100644
index 13c3ac8..0000000
--- a/node_modules/request/lib/auth.js
+++ /dev/null
@@ -1,153 +0,0 @@
-'use strict'
-
-var caseless = require('caseless')
- , uuid = require('node-uuid')
- , helpers = require('./helpers')
-
-var md5 = helpers.md5
- , toBase64 = helpers.toBase64
-
-
-function Auth (request) {
- // define all public properties here
- this.request = request
- this.hasAuth = false
- this.sentAuth = false
- this.bearerToken = null
- this.user = null
- this.pass = null
-}
-
-Auth.prototype.basic = function (user, pass, sendImmediately) {
- var self = this
- if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
- throw new Error('auth() received invalid user or password')
- }
- self.user = user
- self.pass = pass
- self.hasAuth = true
- var header = user + ':' + (pass || '')
- if (sendImmediately || typeof sendImmediately === 'undefined') {
- var authHeader = 'Basic ' + toBase64(header)
- self.sentAuth = true
- return authHeader
- }
-}
-
-Auth.prototype.bearer = function (bearer, sendImmediately) {
- var self = this
- self.bearerToken = bearer
- self.hasAuth = true
- if (sendImmediately || typeof sendImmediately === 'undefined') {
- if (typeof bearer === 'function') {
- bearer = bearer()
- }
- var authHeader = 'Bearer ' + (bearer || '')
- self.sentAuth = true
- return authHeader
- }
-}
-
-Auth.prototype.digest = function (method, path, authHeader) {
- // TODO: More complete implementation of RFC 2617.
- // - check challenge.algorithm
- // - support algorithm="MD5-sess"
- // - handle challenge.domain
- // - support qop="auth-int" only
- // - handle Authentication-Info (not necessarily?)
- // - check challenge.stale (not necessarily?)
- // - increase nc (not necessarily?)
- // For reference:
- // http://tools.ietf.org/html/rfc2617#section-3
- // https://github.com/bagder/curl/blob/master/lib/http_digest.c
-
- var self = this
-
- var challenge = {}
- var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
- for (;;) {
- var match = re.exec(authHeader)
- if (!match) {
- break
- }
- challenge[match[1]] = match[2] || match[3]
- }
-
- var ha1 = md5(self.user + ':' + challenge.realm + ':' + self.pass)
- var ha2 = md5(method + ':' + path)
- var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
- var nc = qop && '00000001'
- var cnonce = qop && uuid().replace(/-/g, '')
- var digestResponse = qop
- ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
- : md5(ha1 + ':' + challenge.nonce + ':' + ha2)
- var authValues = {
- username: self.user,
- realm: challenge.realm,
- nonce: challenge.nonce,
- uri: path,
- qop: qop,
- response: digestResponse,
- nc: nc,
- cnonce: cnonce,
- algorithm: challenge.algorithm,
- opaque: challenge.opaque
- }
-
- authHeader = []
- for (var k in authValues) {
- if (authValues[k]) {
- if (k === 'qop' || k === 'nc' || k === 'algorithm') {
- authHeader.push(k + '=' + authValues[k])
- } else {
- authHeader.push(k + '="' + authValues[k] + '"')
- }
- }
- }
- authHeader = 'Digest ' + authHeader.join(', ')
- self.sentAuth = true
- return authHeader
-}
-
-Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
- var self = this
- , request = self.request
-
- var authHeader
- if (bearer === undefined && user === undefined) {
- throw new Error('no auth mechanism defined')
- } else if (bearer !== undefined) {
- authHeader = self.bearer(bearer, sendImmediately)
- } else {
- authHeader = self.basic(user, pass, sendImmediately)
- }
- if (authHeader) {
- request.setHeader('authorization', authHeader)
- }
-}
-
-Auth.prototype.onResponse = function (response) {
- var self = this
- , request = self.request
-
- if (!self.hasAuth || self.sentAuth) { return null }
-
- var c = caseless(response.headers)
-
- var authHeader = c.get('www-authenticate')
- var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()
- // debug('reauth', authVerb)
-
- switch (authVerb) {
- case 'basic':
- return self.basic(self.user, self.pass, true)
-
- case 'bearer':
- return self.bearer(self.bearerToken, true)
-
- case 'digest':
- return self.digest(request.method, request.path, authHeader)
- }
-}
-
-exports.Auth = Auth
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/cookies.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/cookies.js b/node_modules/request/lib/cookies.js
deleted file mode 100644
index adde7c6..0000000
--- a/node_modules/request/lib/cookies.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict'
-
-var tough = require('tough-cookie')
-
-var Cookie = tough.Cookie
- , CookieJar = tough.CookieJar
-
-
-exports.parse = function(str) {
- if (str && str.uri) {
- str = str.uri
- }
- if (typeof str !== 'string') {
- throw new Error('The cookie function only accepts STRING as param')
- }
- return Cookie.parse(str)
-}
-
-// Adapt the sometimes-Async api of tough.CookieJar to our requirements
-function RequestJar(store) {
- var self = this
- self._jar = new CookieJar(store)
-}
-RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) {
- var self = this
- return self._jar.setCookieSync(cookieOrStr, uri, options || {})
-}
-RequestJar.prototype.getCookieString = function(uri) {
- var self = this
- return self._jar.getCookieStringSync(uri)
-}
-RequestJar.prototype.getCookies = function(uri) {
- var self = this
- return self._jar.getCookiesSync(uri)
-}
-
-exports.jar = function(store) {
- return new RequestJar(store)
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/copy.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/copy.js b/node_modules/request/lib/copy.js
deleted file mode 100644
index ad162a5..0000000
--- a/node_modules/request/lib/copy.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict'
-
-module.exports =
-function copy (obj) {
- var o = {}
- Object.keys(obj).forEach(function (i) {
- o[i] = obj[i]
- })
- return o
-}
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/getProxyFromURI.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/getProxyFromURI.js b/node_modules/request/lib/getProxyFromURI.js
deleted file mode 100644
index c2013a6..0000000
--- a/node_modules/request/lib/getProxyFromURI.js
+++ /dev/null
@@ -1,79 +0,0 @@
-'use strict'
-
-function formatHostname(hostname) {
- // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
- return hostname.replace(/^\.*/, '.').toLowerCase()
-}
-
-function parseNoProxyZone(zone) {
- zone = zone.trim().toLowerCase()
-
- var zoneParts = zone.split(':', 2)
- , zoneHost = formatHostname(zoneParts[0])
- , zonePort = zoneParts[1]
- , hasPort = zone.indexOf(':') > -1
-
- return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
-}
-
-function uriInNoProxy(uri, noProxy) {
- var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
- , hostname = formatHostname(uri.hostname)
- , noProxyList = noProxy.split(',')
-
- // iterate through the noProxyList until it finds a match.
- return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) {
- var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
- , hostnameMatched = (
- isMatchedAt > -1 &&
- (isMatchedAt === hostname.length - noProxyZone.hostname.length)
- )
-
- if (noProxyZone.hasPort) {
- return (port === noProxyZone.port) && hostnameMatched
- }
-
- return hostnameMatched
- })
-}
-
-function getProxyFromURI(uri) {
- // Decide the proper request proxy to use based on the request URI object and the
- // environmental variables (NO_PROXY, HTTP_PROXY, etc.)
- // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)
-
- var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
-
- // if the noProxy is a wildcard then return null
-
- if (noProxy === '*') {
- return null
- }
-
- // if the noProxy is not empty and the uri is found return null
-
- if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
- return null
- }
-
- // Check for HTTP or HTTPS Proxy in environment Else default to null
-
- if (uri.protocol === 'http:') {
- return process.env.HTTP_PROXY ||
- process.env.http_proxy || null
- }
-
- if (uri.protocol === 'https:') {
- return process.env.HTTPS_PROXY ||
- process.env.https_proxy ||
- process.env.HTTP_PROXY ||
- process.env.http_proxy || null
- }
-
- // if none of that works, return null
- // (What uri protocol are you using then?)
-
- return null
-}
-
-module.exports = getProxyFromURI
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/har.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/har.js b/node_modules/request/lib/har.js
deleted file mode 100644
index 83453a3..0000000
--- a/node_modules/request/lib/har.js
+++ /dev/null
@@ -1,205 +0,0 @@
-'use strict'
-
-var fs = require('fs')
-var qs = require('querystring')
-var validate = require('har-validator')
-var util = require('util')
-
-function Har (request) {
- this.request = request
-}
-
-Har.prototype.reducer = function (obj, pair) {
- // new property ?
- if (obj[pair.name] === undefined) {
- obj[pair.name] = pair.value
- return obj
- }
-
- // existing? convert to array
- var arr = [
- obj[pair.name],
- pair.value
- ]
-
- obj[pair.name] = arr
-
- return obj
-}
-
-Har.prototype.prep = function (data) {
- // construct utility properties
- data.queryObj = {}
- data.headersObj = {}
- data.postData.jsonObj = false
- data.postData.paramsObj = false
-
- // construct query objects
- if (data.queryString && data.queryString.length) {
- data.queryObj = data.queryString.reduce(this.reducer, {})
- }
-
- // construct headers objects
- if (data.headers && data.headers.length) {
- // loweCase header keys
- data.headersObj = data.headers.reduceRight(function (headers, header) {
- headers[header.name] = header.value
- return headers
- }, {})
- }
-
- // construct Cookie header
- if (data.cookies && data.cookies.length) {
- var cookies = data.cookies.map(function (cookie) {
- return cookie.name + '=' + cookie.value
- })
-
- if (cookies.length) {
- data.headersObj.cookie = cookies.join('; ')
- }
- }
-
- // prep body
- switch (data.postData.mimeType) {
- case 'multipart/mixed':
- case 'multipart/related':
- case 'multipart/form-data':
- case 'multipart/alternative':
- // reset values
- data.postData.mimeType = 'multipart/form-data'
- break
-
- case 'application/x-www-form-urlencoded':
- if (!data.postData.params) {
- data.postData.text = ''
- } else {
- data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
-
- // always overwrite
- data.postData.text = qs.stringify(data.postData.paramsObj)
- }
- break
-
- case 'text/json':
- case 'text/x-json':
- case 'application/json':
- case 'application/x-json':
- data.postData.mimeType = 'application/json'
-
- if (data.postData.text) {
- try {
- data.postData.jsonObj = JSON.parse(data.postData.text)
- } catch (e) {
- this.request.debug(e)
-
- // force back to text/plain
- data.postData.mimeType = 'text/plain'
- }
- }
- break
- }
-
- return data
-}
-
-Har.prototype.options = function (options) {
- // skip if no har property defined
- if (!options.har) {
- return options
- }
-
- var har = util._extend({}, options.har)
-
- // only process the first entry
- if (har.log && har.log.entries) {
- har = har.log.entries[0]
- }
-
- // add optional properties to make validation successful
- har.url = har.url || options.url || options.uri || options.baseUrl || '/'
- har.httpVersion = har.httpVersion || 'HTTP/1.1'
- har.queryString = har.queryString || []
- har.headers = har.headers || []
- har.cookies = har.cookies || []
- har.postData = har.postData || {}
- har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
-
- har.bodySize = 0
- har.headersSize = 0
- har.postData.size = 0
-
- if (!validate.request(har)) {
- return options
- }
-
- // clean up and get some utility properties
- var req = this.prep(har)
-
- // construct new options
- if (req.url) {
- options.url = req.url
- }
-
- if (req.method) {
- options.method = req.method
- }
-
- if (Object.keys(req.queryObj).length) {
- options.qs = req.queryObj
- }
-
- if (Object.keys(req.headersObj).length) {
- options.headers = req.headersObj
- }
-
- switch (req.postData.mimeType) {
- case 'application/x-www-form-urlencoded':
- options.form = req.postData.paramsObj
- break
-
- case 'application/json':
- if (req.postData.jsonObj) {
- options.body = req.postData.jsonObj
- options.json = true
- }
- break
-
- case 'multipart/form-data':
- options.formData = {}
-
- req.postData.params.forEach(function (param) {
- var attachment = {}
-
- if (!param.fileName && !param.fileName && !param.contentType) {
- options.formData[param.name] = param.value
- return
- }
-
- // attempt to read from disk!
- if (param.fileName && !param.value) {
- attachment.value = fs.createReadStream(param.fileName)
- } else if (param.value) {
- attachment.value = param.value
- }
-
- if (param.fileName) {
- attachment.options = {
- filename: param.fileName,
- contentType: param.contentType ? param.contentType : null
- }
- }
-
- options.formData[param.name] = attachment
- })
- break
-
- default:
- if (req.postData.text) {
- options.body = req.postData.text
- }
- }
-
- return options
-}
-
-exports.Har = Har
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/helpers.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/helpers.js b/node_modules/request/lib/helpers.js
deleted file mode 100644
index 8530d40..0000000
--- a/node_modules/request/lib/helpers.js
+++ /dev/null
@@ -1,55 +0,0 @@
-'use strict'
-
-var jsonSafeStringify = require('json-stringify-safe')
- , crypto = require('crypto')
-
-function deferMethod() {
- if(typeof setImmediate === 'undefined') {
- return process.nextTick
- }
-
- return setImmediate
-}
-
-function isFunction(value) {
- return typeof value === 'function'
-}
-
-function paramsHaveRequestBody(params) {
- return (
- params.body ||
- params.requestBodyStream ||
- (params.json && typeof params.json !== 'boolean') ||
- params.multipart
- )
-}
-
-function safeStringify (obj) {
- var ret
- try {
- ret = JSON.stringify(obj)
- } catch (e) {
- ret = jsonSafeStringify(obj)
- }
- return ret
-}
-
-function md5 (str) {
- return crypto.createHash('md5').update(str).digest('hex')
-}
-
-function isReadStream (rs) {
- return rs.readable && rs.path && rs.mode
-}
-
-function toBase64 (str) {
- return (new Buffer(str || '', 'utf8')).toString('base64')
-}
-
-exports.isFunction = isFunction
-exports.paramsHaveRequestBody = paramsHaveRequestBody
-exports.safeStringify = safeStringify
-exports.md5 = md5
-exports.isReadStream = isReadStream
-exports.toBase64 = toBase64
-exports.defer = deferMethod()
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/multipart.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/multipart.js b/node_modules/request/lib/multipart.js
deleted file mode 100644
index 905a54b..0000000
--- a/node_modules/request/lib/multipart.js
+++ /dev/null
@@ -1,109 +0,0 @@
-'use strict'
-
-var uuid = require('node-uuid')
- , CombinedStream = require('combined-stream')
- , isstream = require('isstream')
-
-
-function Multipart (request) {
- this.request = request
- this.boundary = uuid()
- this.chunked = false
- this.body = null
-}
-
-Multipart.prototype.isChunked = function (options) {
- var self = this
- , chunked = false
- , parts = options.data || options
-
- if (!parts.forEach) {
- throw new Error('Argument error, options.multipart.')
- }
-
- if (options.chunked !== undefined) {
- chunked = options.chunked
- }
-
- if (self.request.getHeader('transfer-encoding') === 'chunked') {
- chunked = true
- }
-
- if (!chunked) {
- parts.forEach(function (part) {
- if(typeof part.body === 'undefined') {
- throw new Error('Body attribute missing in multipart.')
- }
- if (isstream(part.body)) {
- chunked = true
- }
- })
- }
-
- return chunked
-}
-
-Multipart.prototype.setHeaders = function (chunked) {
- var self = this
-
- if (chunked && !self.request.hasHeader('transfer-encoding')) {
- self.request.setHeader('transfer-encoding', 'chunked')
- }
-
- var header = self.request.getHeader('content-type')
-
- if (!header || header.indexOf('multipart') === -1) {
- self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
- } else {
- if (header.indexOf('boundary') !== -1) {
- self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
- } else {
- self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
- }
- }
-}
-
-Multipart.prototype.build = function (parts, chunked) {
- var self = this
- var body = chunked ? new CombinedStream() : []
-
- function add (part) {
- return chunked ? body.append(part) : body.push(new Buffer(part))
- }
-
- if (self.request.preambleCRLF) {
- add('\r\n')
- }
-
- parts.forEach(function (part) {
- var preamble = '--' + self.boundary + '\r\n'
- Object.keys(part).forEach(function (key) {
- if (key === 'body') { return }
- preamble += key + ': ' + part[key] + '\r\n'
- })
- preamble += '\r\n'
- add(preamble)
- add(part.body)
- add('\r\n')
- })
- add('--' + self.boundary + '--')
-
- if (self.request.postambleCRLF) {
- add('\r\n')
- }
-
- return body
-}
-
-Multipart.prototype.onRequest = function (options) {
- var self = this
-
- var chunked = self.isChunked(options)
- , parts = options.data || options
-
- self.setHeaders(chunked)
- self.chunked = chunked
- self.body = self.build(parts, chunked)
-}
-
-exports.Multipart = Multipart
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/oauth.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/oauth.js b/node_modules/request/lib/oauth.js
deleted file mode 100644
index fc1cac6..0000000
--- a/node_modules/request/lib/oauth.js
+++ /dev/null
@@ -1,125 +0,0 @@
-'use strict'
-
-var qs = require('qs')
- , caseless = require('caseless')
- , uuid = require('node-uuid')
- , oauth = require('oauth-sign')
-
-
-function OAuth (request) {
- this.request = request
-}
-
-OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {
- var oa = {}
- for (var i in _oauth) {
- oa['oauth_' + i] = _oauth[i]
- }
- if (!oa.oauth_version) {
- oa.oauth_version = '1.0'
- }
- if (!oa.oauth_timestamp) {
- oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString()
- }
- if (!oa.oauth_nonce) {
- oa.oauth_nonce = uuid().replace(/-/g, '')
- }
- if (!oa.oauth_signature_method) {
- oa.oauth_signature_method = 'HMAC-SHA1'
- }
-
- var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
- delete oa.oauth_consumer_secret
- delete oa.oauth_private_key
-
- var token_secret = oa.oauth_token_secret
- delete oa.oauth_token_secret
-
- var realm = oa.oauth_realm
- delete oa.oauth_realm
- delete oa.oauth_transport_method
-
- var baseurl = uri.protocol + '//' + uri.host + uri.pathname
- var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
-
- oa.oauth_signature = oauth.sign(
- oa.oauth_signature_method,
- method,
- baseurl,
- params,
- consumer_secret_or_private_key,
- token_secret)
-
- if (realm) {
- oa.realm = realm
- }
-
- return oa
-}
-
-OAuth.prototype.concatParams = function (oa, sep, wrap) {
- wrap = wrap || ''
-
- var params = Object.keys(oa).filter(function (i) {
- return i !== 'realm' && i !== 'oauth_signature'
- }).sort()
-
- if (oa.realm) {
- params.splice(0, 1, 'realm')
- }
- params.push('oauth_signature')
-
- return params.map(function (i) {
- return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
- }).join(sep)
-}
-
-OAuth.prototype.onRequest = function (_oauth) {
- var self = this
- , request = self.request
-
- var uri = request.uri || {}
- , method = request.method || ''
- , headers = caseless(request.headers)
- , body = request.body || ''
- , qsLib = request.qsLib || qs
-
- var form
- , query
- , contentType = headers.get('content-type') || ''
- , formContentType = 'application/x-www-form-urlencoded'
- , transport = _oauth.transport_method || 'header'
-
- if (contentType.slice(0, formContentType.length) === formContentType) {
- contentType = formContentType
- form = body
- }
- if (uri.query) {
- query = uri.query
- }
- if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
- throw new Error('oauth: transport_method of \'body\' requires \'POST\' ' +
- 'and content-type \'' + formContentType + '\'')
- }
-
- var oa = this.buildParams(_oauth, uri, method, query, form, qsLib)
-
- switch (transport) {
- case 'header':
- request.setHeader('Authorization', 'OAuth ' + this.concatParams(oa, ',', '"'))
- break
-
- case 'query':
- request.path = (query ? '&' : '?') + this.concatParams(oa, '&')
- break
-
- case 'body':
- request.body = (form ? form + '&' : '') + this.concatParams(oa, '&')
- break
-
- default:
- throw new Error('oauth: transport_method invalid')
- }
-}
-
-exports.OAuth = OAuth
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/lib/redirect.js
----------------------------------------------------------------------
diff --git a/node_modules/request/lib/redirect.js b/node_modules/request/lib/redirect.js
deleted file mode 100644
index 7dd6c25..0000000
--- a/node_modules/request/lib/redirect.js
+++ /dev/null
@@ -1,154 +0,0 @@
-'use strict'
-
-var url = require('url')
-var isUrl = /^https?:/
-
-function Redirect (request) {
- this.request = request
- this.followRedirect = true
- this.followRedirects = true
- this.followAllRedirects = false
- this.allowRedirect = function () {return true}
- this.maxRedirects = 10
- this.redirects = []
- this.redirectsFollowed = 0
- this.removeRefererHeader = false
-}
-
-Redirect.prototype.onRequest = function () {
- var self = this
- , request = self.request
-
- if (request.maxRedirects !== undefined) {
- self.maxRedirects = request.maxRedirects
- }
- if (typeof request.followRedirect === 'function') {
- self.allowRedirect = request.followRedirect
- }
- if (request.followRedirect !== undefined) {
- self.followRedirects = !!request.followRedirect
- }
- if (request.followAllRedirects !== undefined) {
- self.followAllRedirects = request.followAllRedirects
- }
- if (self.followRedirects || self.followAllRedirects) {
- self.redirects = self.redirects || []
- }
- if (request.removeRefererHeader !== undefined) {
- self.removeRefererHeader = request.removeRefererHeader
- }
-}
-
-Redirect.prototype.redirectTo = function (response) {
- var self = this
- , request = self.request
-
- var redirectTo = null
- if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
- var location = response.caseless.get('location')
- // debug('redirect', location)
-
- if (self.followAllRedirects) {
- redirectTo = location
- } else if (self.followRedirects) {
- switch (request.method) {
- case 'PATCH':
- case 'PUT':
- case 'POST':
- case 'DELETE':
- // Do not follow redirects
- break
- default:
- redirectTo = location
- break
- }
- }
- } else if (response.statusCode === 401) {
- var authHeader = request._auth.onResponse(response)
- if (authHeader) {
- request.setHeader('authorization', authHeader)
- redirectTo = request.uri
- }
- }
- return redirectTo
-}
-
-Redirect.prototype.onResponse = function (response) {
- var self = this
- , request = self.request
-
- var redirectTo = self.redirectTo(response)
- if (!redirectTo || !self.allowRedirect.call(request, response)) {
- return false
- }
-
-
- // debug('redirect to', redirectTo)
-
- // ignore any potential response body. it cannot possibly be useful
- // to us at this point.
- if (request._paused) {
- response.resume()
- }
-
- if (self.redirectsFollowed >= self.maxRedirects) {
- request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))
- return false
- }
- self.redirectsFollowed += 1
-
- if (!isUrl.test(redirectTo)) {
- redirectTo = url.resolve(request.uri.href, redirectTo)
- }
-
- var uriPrev = request.uri
- request.uri = url.parse(redirectTo)
-
- // handle the case where we change protocol from https to http or vice versa
- if (request.uri.protocol !== uriPrev.protocol) {
- request._updateProtocol()
- }
-
- self.redirects.push(
- { statusCode : response.statusCode
- , redirectUri: redirectTo
- }
- )
- if (self.followAllRedirects && response.statusCode !== 401 && response.statusCode !== 307) {
- request.method = 'GET'
- }
- // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
- delete request.src
- delete request.req
- delete request.agent
- delete request._started
- if (response.statusCode !== 401 && response.statusCode !== 307) {
- // Remove parameters from the previous response, unless this is the second request
- // for a server that requires digest authentication.
- delete request.body
- delete request._form
- if (request.headers) {
- request.removeHeader('host')
- request.removeHeader('content-type')
- request.removeHeader('content-length')
- if (request.uri.hostname !== request.originalHost.split(':')[0]) {
- // Remove authorization if changing hostnames (but not if just
- // changing ports or protocols). This matches the behavior of curl:
- // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
- request.removeHeader('authorization')
- }
- }
- }
-
- if (!self.removeRefererHeader) {
- request.setHeader('referer', request.uri.href)
- }
-
- request.emit('redirect')
-
- request.init()
-
- return true
-}
-
-exports.Redirect = Redirect
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/.bin/har-validator
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/.bin/har-validator b/node_modules/request/node_modules/.bin/har-validator
deleted file mode 120000
index c6ec163..0000000
--- a/node_modules/request/node_modules/.bin/har-validator
+++ /dev/null
@@ -1 +0,0 @@
-../har-validator/bin/har-validator
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/.bin/uuid
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/.bin/uuid b/node_modules/request/node_modules/.bin/uuid
deleted file mode 120000
index 80eb14a..0000000
--- a/node_modules/request/node_modules/.bin/uuid
+++ /dev/null
@@ -1 +0,0 @@
-../node-uuid/bin/uuid
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/aws-sign2/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/aws-sign2/LICENSE b/node_modules/request/node_modules/aws-sign2/LICENSE
deleted file mode 100644
index a4a9aee..0000000
--- a/node_modules/request/node_modules/aws-sign2/LICENSE
+++ /dev/null
@@ -1,55 +0,0 @@
-Apache License
-
-Version 2.0, January 2004
-
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
-You must cause any modified files to carry prominent notices stating that You changed the files; and
-
-You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
-If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modi
fications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/7ee4acde/node_modules/request/node_modules/aws-sign2/README.md
----------------------------------------------------------------------
diff --git a/node_modules/request/node_modules/aws-sign2/README.md b/node_modules/request/node_modules/aws-sign2/README.md
deleted file mode 100644
index 763564e..0000000
--- a/node_modules/request/node_modules/aws-sign2/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-aws-sign
-========
-
-AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.