couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [31/51] [abbrv] [partial] couchdb-nmo git commit: Remove node_modules from repo
Date Mon, 30 Nov 2015 09:37:13 GMT
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/asap.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/asap.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/asap.js
deleted file mode 100644
index 4f7dcee..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/asap.js
+++ /dev/null
@@ -1,111 +0,0 @@
-var len = 0;
-var toString = {}.toString;
-var vertxNext;
-export default function asap(callback, arg) {
-  queue[len] = callback;
-  queue[len + 1] = arg;
-  len += 2;
-  if (len === 2) {
-    // If len is 2, that means that we need to schedule an async flush.
-    // If additional callbacks are queued before the queue is flushed, they
-    // will be processed by this flush that we are scheduling.
-    scheduleFlush();
-  }
-}
-
-var browserWindow = (typeof window !== 'undefined') ? window : undefined;
-var browserGlobal = browserWindow || {};
-var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
-var isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
-
-// test for web worker but not in IE10
-var isWorker = typeof Uint8ClampedArray !== 'undefined' &&
-  typeof importScripts !== 'undefined' &&
-  typeof MessageChannel !== 'undefined';
-
-// node
-function useNextTick() {
-  var nextTick = process.nextTick;
-  // node version 0.10.x displays a deprecation warning when nextTick is used recursively
-  // setImmediate should be used instead instead
-  var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
-  if (Array.isArray(version) && version[1] === '0' && version[2] === '10') {
-    nextTick = setImmediate;
-  }
-  return function() {
-    nextTick(flush);
-  };
-}
-
-// vertx
-function useVertxTimer() {
-  return function() {
-    vertxNext(flush);
-  };
-}
-
-function useMutationObserver() {
-  var iterations = 0;
-  var observer = new BrowserMutationObserver(flush);
-  var node = document.createTextNode('');
-  observer.observe(node, { characterData: true });
-
-  return function() {
-    node.data = (iterations = ++iterations % 2);
-  };
-}
-
-// web worker
-function useMessageChannel() {
-  var channel = new MessageChannel();
-  channel.port1.onmessage = flush;
-  return function () {
-    channel.port2.postMessage(0);
-  };
-}
-
-function useSetTimeout() {
-  return function() {
-    setTimeout(flush, 1);
-  };
-}
-
-var queue = new Array(1000);
-function flush() {
-  for (var i = 0; i < len; i+=2) {
-    var callback = queue[i];
-    var arg = queue[i+1];
-
-    callback(arg);
-
-    queue[i] = undefined;
-    queue[i+1] = undefined;
-  }
-
-  len = 0;
-}
-
-function attemptVertex() {
-  try {
-    var r = require;
-    var vertx = r('vertx');
-    vertxNext = vertx.runOnLoop || vertx.runOnContext;
-    return useVertxTimer();
-  } catch(e) {
-    return useSetTimeout();
-  }
-}
-
-var scheduleFlush;
-// Decide what async method to use to triggering processing of queued callbacks:
-if (isNode) {
-  scheduleFlush = useNextTick();
-} else if (BrowserMutationObserver) {
-  scheduleFlush = useMutationObserver();
-} else if (isWorker) {
-  scheduleFlush = useMessageChannel();
-} else if (browserWindow === undefined && typeof require === 'function') {
-  scheduleFlush = attemptVertex();
-} else {
-  scheduleFlush = useSetTimeout();
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/enumerator.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/enumerator.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/enumerator.js
deleted file mode 100644
index 03fdf8c..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/enumerator.js
+++ /dev/null
@@ -1,113 +0,0 @@
-import {
-  isArray,
-  isMaybeThenable
-} from './utils';
-
-import {
-  noop,
-  reject,
-  fulfill,
-  subscribe,
-  FULFILLED,
-  REJECTED,
-  PENDING
-} from './-internal';
-
-function Enumerator(Constructor, input) {
-  var enumerator = this;
-
-  enumerator._instanceConstructor = Constructor;
-  enumerator.promise = new Constructor(noop);
-
-  if (enumerator._validateInput(input)) {
-    enumerator._input     = input;
-    enumerator.length     = input.length;
-    enumerator._remaining = input.length;
-
-    enumerator._init();
-
-    if (enumerator.length === 0) {
-      fulfill(enumerator.promise, enumerator._result);
-    } else {
-      enumerator.length = enumerator.length || 0;
-      enumerator._enumerate();
-      if (enumerator._remaining === 0) {
-        fulfill(enumerator.promise, enumerator._result);
-      }
-    }
-  } else {
-    reject(enumerator.promise, enumerator._validationError());
-  }
-}
-
-Enumerator.prototype._validateInput = function(input) {
-  return isArray(input);
-};
-
-Enumerator.prototype._validationError = function() {
-  return new Error('Array Methods must be provided an Array');
-};
-
-Enumerator.prototype._init = function() {
-  this._result = new Array(this.length);
-};
-
-export default Enumerator;
-
-Enumerator.prototype._enumerate = function() {
-  var enumerator = this;
-
-  var length  = enumerator.length;
-  var promise = enumerator.promise;
-  var input   = enumerator._input;
-
-  for (var i = 0; promise._state === PENDING && i < length; i++) {
-    enumerator._eachEntry(input[i], i);
-  }
-};
-
-Enumerator.prototype._eachEntry = function(entry, i) {
-  var enumerator = this;
-  var c = enumerator._instanceConstructor;
-
-  if (isMaybeThenable(entry)) {
-    if (entry.constructor === c && entry._state !== PENDING) {
-      entry._onerror = null;
-      enumerator._settledAt(entry._state, i, entry._result);
-    } else {
-      enumerator._willSettleAt(c.resolve(entry), i);
-    }
-  } else {
-    enumerator._remaining--;
-    enumerator._result[i] = entry;
-  }
-};
-
-Enumerator.prototype._settledAt = function(state, i, value) {
-  var enumerator = this;
-  var promise = enumerator.promise;
-
-  if (promise._state === PENDING) {
-    enumerator._remaining--;
-
-    if (state === REJECTED) {
-      reject(promise, value);
-    } else {
-      enumerator._result[i] = value;
-    }
-  }
-
-  if (enumerator._remaining === 0) {
-    fulfill(promise, enumerator._result);
-  }
-};
-
-Enumerator.prototype._willSettleAt = function(promise, i) {
-  var enumerator = this;
-
-  subscribe(promise, undefined, function(value) {
-    enumerator._settledAt(FULFILLED, i, value);
-  }, function(reason) {
-    enumerator._settledAt(REJECTED, i, reason);
-  });
-};

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/polyfill.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/polyfill.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/polyfill.js
deleted file mode 100644
index 6696dfc..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/polyfill.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*global self*/
-import Promise from './promise';
-
-export default function polyfill() {
-  var local;
-
-  if (typeof global !== 'undefined') {
-      local = global;
-  } else if (typeof self !== 'undefined') {
-      local = self;
-  } else {
-      try {
-          local = Function('return this')();
-      } catch (e) {
-          throw new Error('polyfill failed because global object is unavailable in this environment');
-      }
-  }
-
-  var P = local.Promise;
-
-  if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {
-    return;
-  }
-
-  local.Promise = Promise;
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise.js
deleted file mode 100644
index 78fe2ca..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise.js
+++ /dev/null
@@ -1,408 +0,0 @@
-import {
-  isFunction
-} from './utils';
-
-import {
-  noop,
-  subscribe,
-  initializePromise,
-  invokeCallback,
-  FULFILLED,
-  REJECTED
-} from './-internal';
-
-import asap from './asap';
-
-import all from './promise/all';
-import race from './promise/race';
-import Resolve from './promise/resolve';
-import Reject from './promise/reject';
-
-var counter = 0;
-
-function needsResolver() {
-  throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
-}
-
-function needsNew() {
-  throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
-}
-
-export default Promise;
-/**
-  Promise objects represent the eventual result of an asynchronous operation. The
-  primary way of interacting with a promise is through its `then` method, which
-  registers callbacks to receive either a promise’s eventual value or the reason
-  why the promise cannot be fulfilled.
-
-  Terminology
-  -----------
-
-  - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
-  - `thenable` is an object or function that defines a `then` method.
-  - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
-  - `exception` is a value that is thrown using the throw statement.
-  - `reason` is a value that indicates why a promise was rejected.
-  - `settled` the final resting state of a promise, fulfilled or rejected.
-
-  A promise can be in one of three states: pending, fulfilled, or rejected.
-
-  Promises that are fulfilled have a fulfillment value and are in the fulfilled
-  state.  Promises that are rejected have a rejection reason and are in the
-  rejected state.  A fulfillment value is never a thenable.
-
-  Promises can also be said to *resolve* a value.  If this value is also a
-  promise, then the original promise's settled state will match the value's
-  settled state.  So a promise that *resolves* a promise that rejects will
-  itself reject, and a promise that *resolves* a promise that fulfills will
-  itself fulfill.
-
-
-  Basic Usage:
-  ------------
-
-  ```js
-  var promise = new Promise(function(resolve, reject) {
-    // on success
-    resolve(value);
-
-    // on failure
-    reject(reason);
-  });
-
-  promise.then(function(value) {
-    // on fulfillment
-  }, function(reason) {
-    // on rejection
-  });
-  ```
-
-  Advanced Usage:
-  ---------------
-
-  Promises shine when abstracting away asynchronous interactions such as
-  `XMLHttpRequest`s.
-
-  ```js
-  function getJSON(url) {
-    return new Promise(function(resolve, reject){
-      var xhr = new XMLHttpRequest();
-
-      xhr.open('GET', url);
-      xhr.onreadystatechange = handler;
-      xhr.responseType = 'json';
-      xhr.setRequestHeader('Accept', 'application/json');
-      xhr.send();
-
-      function handler() {
-        if (this.readyState === this.DONE) {
-          if (this.status === 200) {
-            resolve(this.response);
-          } else {
-            reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
-          }
-        }
-      };
-    });
-  }
-
-  getJSON('/posts.json').then(function(json) {
-    // on fulfillment
-  }, function(reason) {
-    // on rejection
-  });
-  ```
-
-  Unlike callbacks, promises are great composable primitives.
-
-  ```js
-  Promise.all([
-    getJSON('/posts'),
-    getJSON('/comments')
-  ]).then(function(values){
-    values[0] // => postsJSON
-    values[1] // => commentsJSON
-
-    return values;
-  });
-  ```
-
-  @class Promise
-  @param {function} resolver
-  Useful for tooling.
-  @constructor
-*/
-function Promise(resolver) {
-  this._id = counter++;
-  this._state = undefined;
-  this._result = undefined;
-  this._subscribers = [];
-
-  if (noop !== resolver) {
-    if (!isFunction(resolver)) {
-      needsResolver();
-    }
-
-    if (!(this instanceof Promise)) {
-      needsNew();
-    }
-
-    initializePromise(this, resolver);
-  }
-}
-
-Promise.all = all;
-Promise.race = race;
-Promise.resolve = Resolve;
-Promise.reject = Reject;
-
-Promise.prototype = {
-  constructor: Promise,
-
-/**
-  The primary way of interacting with a promise is through its `then` method,
-  which registers callbacks to receive either a promise's eventual value or the
-  reason why the promise cannot be fulfilled.
-
-  ```js
-  findUser().then(function(user){
-    // user is available
-  }, function(reason){
-    // user is unavailable, and you are given the reason why
-  });
-  ```
-
-  Chaining
-  --------
-
-  The return value of `then` is itself a promise.  This second, 'downstream'
-  promise is resolved with the return value of the first promise's fulfillment
-  or rejection handler, or rejected if the handler throws an exception.
-
-  ```js
-  findUser().then(function (user) {
-    return user.name;
-  }, function (reason) {
-    return 'default name';
-  }).then(function (userName) {
-    // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
-    // will be `'default name'`
-  });
-
-  findUser().then(function (user) {
-    throw new Error('Found user, but still unhappy');
-  }, function (reason) {
-    throw new Error('`findUser` rejected and we're unhappy');
-  }).then(function (value) {
-    // never reached
-  }, function (reason) {
-    // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
-    // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
-  });
-  ```
-  If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
-
-  ```js
-  findUser().then(function (user) {
-    throw new PedagogicalException('Upstream error');
-  }).then(function (value) {
-    // never reached
-  }).then(function (value) {
-    // never reached
-  }, function (reason) {
-    // The `PedgagocialException` is propagated all the way down to here
-  });
-  ```
-
-  Assimilation
-  ------------
-
-  Sometimes the value you want to propagate to a downstream promise can only be
-  retrieved asynchronously. This can be achieved by returning a promise in the
-  fulfillment or rejection handler. The downstream promise will then be pending
-  until the returned promise is settled. This is called *assimilation*.
-
-  ```js
-  findUser().then(function (user) {
-    return findCommentsByAuthor(user);
-  }).then(function (comments) {
-    // The user's comments are now available
-  });
-  ```
-
-  If the assimliated promise rejects, then the downstream promise will also reject.
-
-  ```js
-  findUser().then(function (user) {
-    return findCommentsByAuthor(user);
-  }).then(function (comments) {
-    // If `findCommentsByAuthor` fulfills, we'll have the value here
-  }, function (reason) {
-    // If `findCommentsByAuthor` rejects, we'll have the reason here
-  });
-  ```
-
-  Simple Example
-  --------------
-
-  Synchronous Example
-
-  ```javascript
-  var result;
-
-  try {
-    result = findResult();
-    // success
-  } catch(reason) {
-    // failure
-  }
-  ```
-
-  Errback Example
-
-  ```js
-  findResult(function(result, err){
-    if (err) {
-      // failure
-    } else {
-      // success
-    }
-  });
-  ```
-
-  Promise Example;
-
-  ```javascript
-  findResult().then(function(result){
-    // success
-  }, function(reason){
-    // failure
-  });
-  ```
-
-  Advanced Example
-  --------------
-
-  Synchronous Example
-
-  ```javascript
-  var author, books;
-
-  try {
-    author = findAuthor();
-    books  = findBooksByAuthor(author);
-    // success
-  } catch(reason) {
-    // failure
-  }
-  ```
-
-  Errback Example
-
-  ```js
-
-  function foundBooks(books) {
-
-  }
-
-  function failure(reason) {
-
-  }
-
-  findAuthor(function(author, err){
-    if (err) {
-      failure(err);
-      // failure
-    } else {
-      try {
-        findBoooksByAuthor(author, function(books, err) {
-          if (err) {
-            failure(err);
-          } else {
-            try {
-              foundBooks(books);
-            } catch(reason) {
-              failure(reason);
-            }
-          }
-        });
-      } catch(error) {
-        failure(err);
-      }
-      // success
-    }
-  });
-  ```
-
-  Promise Example;
-
-  ```javascript
-  findAuthor().
-    then(findBooksByAuthor).
-    then(function(books){
-      // found books
-  }).catch(function(reason){
-    // something went wrong
-  });
-  ```
-
-  @method then
-  @param {Function} onFulfilled
-  @param {Function} onRejected
-  Useful for tooling.
-  @return {Promise}
-*/
-  then: function(onFulfillment, onRejection) {
-    var parent = this;
-    var state = parent._state;
-
-    if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) {
-      return this;
-    }
-
-    var child = new this.constructor(noop);
-    var result = parent._result;
-
-    if (state) {
-      var callback = arguments[state - 1];
-      asap(function(){
-        invokeCallback(state, child, callback, result);
-      });
-    } else {
-      subscribe(parent, child, onFulfillment, onRejection);
-    }
-
-    return child;
-  },
-
-/**
-  `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
-  as the catch block of a try/catch statement.
-
-  ```js
-  function findAuthor(){
-    throw new Error('couldn't find that author');
-  }
-
-  // synchronous
-  try {
-    findAuthor();
-  } catch(reason) {
-    // something went wrong
-  }
-
-  // async with promises
-  findAuthor().catch(function(reason){
-    // something went wrong
-  });
-  ```
-
-  @method catch
-  @param {Function} onRejection
-  Useful for tooling.
-  @return {Promise}
-*/
-  'catch': function(onRejection) {
-    return this.then(null, onRejection);
-  }
-};

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/all.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/all.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/all.js
deleted file mode 100644
index 03033f0..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/all.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import Enumerator from '../enumerator';
-
-/**
-  `Promise.all` accepts an array of promises, and returns a new promise which
-  is fulfilled with an array of fulfillment values for the passed promises, or
-  rejected with the reason of the first passed promise to be rejected. It casts all
-  elements of the passed iterable to promises as it runs this algorithm.
-
-  Example:
-
-  ```javascript
-  var promise1 = resolve(1);
-  var promise2 = resolve(2);
-  var promise3 = resolve(3);
-  var promises = [ promise1, promise2, promise3 ];
-
-  Promise.all(promises).then(function(array){
-    // The array here would be [ 1, 2, 3 ];
-  });
-  ```
-
-  If any of the `promises` given to `all` are rejected, the first promise
-  that is rejected will be given as an argument to the returned promises's
-  rejection handler. For example:
-
-  Example:
-
-  ```javascript
-  var promise1 = resolve(1);
-  var promise2 = reject(new Error("2"));
-  var promise3 = reject(new Error("3"));
-  var promises = [ promise1, promise2, promise3 ];
-
-  Promise.all(promises).then(function(array){
-    // Code here never runs because there are rejected promises!
-  }, function(error) {
-    // error.message === "2"
-  });
-  ```
-
-  @method all
-  @static
-  @param {Array} entries array of promises
-  @param {String} label optional string for labeling the promise.
-  Useful for tooling.
-  @return {Promise} promise that is fulfilled when all `promises` have been
-  fulfilled, or rejected if any of them become rejected.
-  @static
-*/
-export default function all(entries) {
-  return new Enumerator(this, entries).promise;
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/race.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/race.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/race.js
deleted file mode 100644
index 0d7ff13..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/race.js
+++ /dev/null
@@ -1,104 +0,0 @@
-import {
-  isArray
-} from "../utils";
-
-import {
-  noop,
-  resolve,
-  reject,
-  subscribe,
-  PENDING
-} from '../-internal';
-
-/**
-  `Promise.race` returns a new promise which is settled in the same way as the
-  first passed promise to settle.
-
-  Example:
-
-  ```javascript
-  var promise1 = new Promise(function(resolve, reject){
-    setTimeout(function(){
-      resolve('promise 1');
-    }, 200);
-  });
-
-  var promise2 = new Promise(function(resolve, reject){
-    setTimeout(function(){
-      resolve('promise 2');
-    }, 100);
-  });
-
-  Promise.race([promise1, promise2]).then(function(result){
-    // result === 'promise 2' because it was resolved before promise1
-    // was resolved.
-  });
-  ```
-
-  `Promise.race` is deterministic in that only the state of the first
-  settled promise matters. For example, even if other promises given to the
-  `promises` array argument are resolved, but the first settled promise has
-  become rejected before the other promises became fulfilled, the returned
-  promise will become rejected:
-
-  ```javascript
-  var promise1 = new Promise(function(resolve, reject){
-    setTimeout(function(){
-      resolve('promise 1');
-    }, 200);
-  });
-
-  var promise2 = new Promise(function(resolve, reject){
-    setTimeout(function(){
-      reject(new Error('promise 2'));
-    }, 100);
-  });
-
-  Promise.race([promise1, promise2]).then(function(result){
-    // Code here never runs
-  }, function(reason){
-    // reason.message === 'promise 2' because promise 2 became rejected before
-    // promise 1 became fulfilled
-  });
-  ```
-
-  An example real-world use case is implementing timeouts:
-
-  ```javascript
-  Promise.race([ajax('foo.json'), timeout(5000)])
-  ```
-
-  @method race
-  @static
-  @param {Array} promises array of promises to observe
-  Useful for tooling.
-  @return {Promise} a promise which settles in the same way as the first passed
-  promise to settle.
-*/
-export default function race(entries) {
-  /*jshint validthis:true */
-  var Constructor = this;
-
-  var promise = new Constructor(noop);
-
-  if (!isArray(entries)) {
-    reject(promise, new TypeError('You must pass an array to race.'));
-    return promise;
-  }
-
-  var length = entries.length;
-
-  function onFulfillment(value) {
-    resolve(promise, value);
-  }
-
-  function onRejection(reason) {
-    reject(promise, reason);
-  }
-
-  for (var i = 0; promise._state === PENDING && i < length; i++) {
-    subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
-  }
-
-  return promise;
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/reject.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/reject.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/reject.js
deleted file mode 100644
index 63b86cb..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/reject.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import {
-  noop,
-  reject as _reject
-} from '../-internal';
-
-/**
-  `Promise.reject` returns a promise rejected with the passed `reason`.
-  It is shorthand for the following:
-
-  ```javascript
-  var promise = new Promise(function(resolve, reject){
-    reject(new Error('WHOOPS'));
-  });
-
-  promise.then(function(value){
-    // Code here doesn't run because the promise is rejected!
-  }, function(reason){
-    // reason.message === 'WHOOPS'
-  });
-  ```
-
-  Instead of writing the above, your code now simply becomes the following:
-
-  ```javascript
-  var promise = Promise.reject(new Error('WHOOPS'));
-
-  promise.then(function(value){
-    // Code here doesn't run because the promise is rejected!
-  }, function(reason){
-    // reason.message === 'WHOOPS'
-  });
-  ```
-
-  @method reject
-  @static
-  @param {Any} reason value that the returned promise will be rejected with.
-  Useful for tooling.
-  @return {Promise} a promise rejected with the given `reason`.
-*/
-export default function reject(reason) {
-  /*jshint validthis:true */
-  var Constructor = this;
-  var promise = new Constructor(noop);
-  _reject(promise, reason);
-  return promise;
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/resolve.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/resolve.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/resolve.js
deleted file mode 100644
index 201a545..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/promise/resolve.js
+++ /dev/null
@@ -1,48 +0,0 @@
-import {
-  noop,
-  resolve as _resolve
-} from '../-internal';
-
-/**
-  `Promise.resolve` returns a promise that will become resolved with the
-  passed `value`. It is shorthand for the following:
-
-  ```javascript
-  var promise = new Promise(function(resolve, reject){
-    resolve(1);
-  });
-
-  promise.then(function(value){
-    // value === 1
-  });
-  ```
-
-  Instead of writing the above, your code now simply becomes the following:
-
-  ```javascript
-  var promise = Promise.resolve(1);
-
-  promise.then(function(value){
-    // value === 1
-  });
-  ```
-
-  @method resolve
-  @static
-  @param {Any} value value that the returned promise will be resolved with
-  Useful for tooling.
-  @return {Promise} a promise that will become fulfilled with the given
-  `value`
-*/
-export default function resolve(object) {
-  /*jshint validthis:true */
-  var Constructor = this;
-
-  if (object && typeof object === 'object' && object.constructor === Constructor) {
-    return object;
-  }
-
-  var promise = new Constructor(noop);
-  _resolve(promise, object);
-  return promise;
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/utils.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/utils.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/utils.js
deleted file mode 100644
index 31ec6f9..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/lib/es6-promise/utils.js
+++ /dev/null
@@ -1,22 +0,0 @@
-export function objectOrFunction(x) {
-  return typeof x === 'function' || (typeof x === 'object' && x !== null);
-}
-
-export function isFunction(x) {
-  return typeof x === 'function';
-}
-
-export function isMaybeThenable(x) {
-  return typeof x === 'object' && x !== null;
-}
-
-var _isArray;
-if (!Array.isArray) {
-  _isArray = function (x) {
-    return Object.prototype.toString.call(x) === '[object Array]';
-  };
-} else {
-  _isArray = Array.isArray;
-}
-
-export var isArray = _isArray;

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/package.json
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/package.json b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/package.json
deleted file mode 100644
index 339d673..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/es6-promise/package.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
-  "name": "es6-promise",
-  "namespace": "es6-promise",
-  "version": "2.1.1",
-  "description": "A lightweight library that provides tools for organizing asynchronous code",
-  "main": "dist/es6-promise.js",
-  "directories": {
-    "lib": "lib"
-  },
-  "files": [
-    "dist",
-    "lib"
-  ],
-  "devDependencies": {
-    "bower": "^1.3.9",
-    "brfs": "0.0.8",
-    "broccoli-es3-safe-recast": "0.0.8",
-    "broccoli-es6-module-transpiler": "^0.5.0",
-    "broccoli-jshint": "^0.5.1",
-    "broccoli-merge-trees": "^0.1.4",
-    "broccoli-replace": "^0.2.0",
-    "broccoli-stew": "0.0.6",
-    "broccoli-uglify-js": "^0.1.3",
-    "broccoli-watchify": "^0.2.0",
-    "ember-cli": "^0.2.2",
-    "ember-publisher": "0.0.7",
-    "git-repo-version": "0.0.2",
-    "json3": "^3.3.2",
-    "minimatch": "^2.0.1",
-    "mocha": "^1.20.1",
-    "promises-aplus-tests-phantom": "^2.1.0-revise",
-    "release-it": "0.0.10"
-  },
-  "scripts": {
-    "build": "ember build",
-    "start": "ember s",
-    "test": "ember test",
-    "test:server": "ember test --server",
-    "test:node": "ember build && mocha ./dist/test/browserify",
-    "lint": "jshint lib",
-    "prepublish": "ember build --environment production",
-    "dry-run-release": "ember build --environment production && release-it --dry-run --non-interactive"
-  },
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/jakearchibald/ES6-Promises.git"
-  },
-  "bugs": {
-    "url": "https://github.com/jakearchibald/ES6-Promises/issues"
-  },
-  "browser": {
-    "vertx": false
-  },
-  "keywords": [
-    "promises",
-    "futures"
-  ],
-  "author": {
-    "name": "Yehuda Katz, Tom Dale, Stefan Penner and contributors",
-    "url": "Conversion to ES6 API by Jake Archibald"
-  },
-  "license": "MIT",
-  "spm": {
-    "main": "dist/es6-promise.js"
-  },
-  "gitHead": "02cf697c50856f0cd3785f425a2cf819af0e521c",
-  "homepage": "https://github.com/jakearchibald/ES6-Promises",
-  "_id": "es6-promise@2.1.1",
-  "_shasum": "03e8f3c7297928e5478d6ab1d0643251507bdedd",
-  "_from": "es6-promise@2.1.1",
-  "_npmVersion": "2.5.1",
-  "_nodeVersion": "0.12.1",
-  "_npmUser": {
-    "name": "jaffathecake",
-    "email": "jaffathecake@gmail.com"
-  },
-  "maintainers": [
-    {
-      "name": "jaffathecake",
-      "email": "jaffathecake@gmail.com"
-    }
-  ],
-  "dist": {
-    "shasum": "03e8f3c7297928e5478d6ab1d0643251507bdedd",
-    "tarball": "http://registry.npmjs.org/es6-promise/-/es6-promise-2.1.1.tgz"
-  },
-  "_resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-2.1.1.tgz",
-  "readme": "ERROR: No README data found!"
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/HISTORY.md
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/HISTORY.md b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/HISTORY.md
deleted file mode 100644
index a21da87..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/HISTORY.md
+++ /dev/null
@@ -1,246 +0,0 @@
-1.2.14 09-28-2015
------------------
-- NODE-547 only emit error if there are any listeners.
-- Fixed APM issue with issuing readConcern.
-
-1.2.13 09-18-2015
------------------
-- Added BSON serializer ignoreUndefined option for insert/update/remove/command/cursor.
-
-1.2.12 09-08-2015
------------------
-- NODE-541 Added initial support for readConcern.
-
-1.2.11 08-31-2015
------------------
-- NODE-535 If connectWithNoPrimary is true then primary-only connection is not allowed.
-- NODE-534 Passive secondaries are not allowed for secondaryOnlyConnectionAllowed.
-- Fixed filtering bug for logging (Issue 30, https://github.com/christkv/mongodb-core/issues/30).
-
-1.2.10 08-14-2015
------------------
-- Added missing Mongos.prototype.parserType function.
-
-1.2.9 08-05-2015
-----------------
-- NODE-525 Reset connectionTimeout after it's overwritten by tls.connect.
-- NODE-518 connectTimeoutMS is doubled in 2.0.39.
-
-1.2.8 07-24-2015
------------------
-- Minor fix to handle 2.4.x errors better by correctly return driver layer issues.
-
-1.2.7 07-16-2015
------------------
-- Refactoring to allow to tap into find/getmore/killcursor in cursors for APM monitoring in driver.
-
-1.2.6 07-14-2015
------------------
-- NODE-505 Query fails to find records that have a 'result' property with an array value.
-
-1.2.5 07-14-2015
------------------
-- NODE-492 correctly handle hanging replicaset monitoring connections when server is unavailable due to network partitions or firewalls dropping packets, configureable using the connectionTimeoutMS setting.
-
-1.2.4 07-07-2015
------------------
-- NODE-493 staggering the socket connections to avoid overwhelming the mongod process.
-
-1.2.3 06-26-2015
------------------
-- Minor bug fixes.
-
-1.2.2 06-22-2015
------------------
-- Fix issue with SCRAM authentication causing authentication to return true on failed authentication (Issue 26, https://github.com/cglass17).
-
-1.2.1 06-17-2015
------------------
-- Ensure serializeFunctions passed down correctly to wire protocol.
-
-1.2.0 06-17-2015
------------------
-- Switching to using the 0.4.x pure JS serializer, removing dependency on C++ parser.
-- Refactoring wire protocol messages to avoid expensive size calculations of documents in favor of writing out an array of buffers to the sockets.
-- NODE-486 fixed issue related to limit and skip when calling toArray in 2.0 driver.
-- NODE-483 throw error if capabilities of topology is queries before topology has performed connection setup.
-- NODE-487 fixed issue where killcursor command was not being sent correctly on limit and skip queries.
-
-1.1.33 05-31-2015
------------------
-- NODE-478 Work around authentication race condition in mongos authentication due to multi step authentication methods like SCRAM.
-
-1.1.32 05-20-2015
------------------
-- After reconnect, it updates the allowable reconnect retries to the option settings (Issue #23, https://github.com/owenallenaz)
-
-1.1.31 05-19-2015
------------------
-- Minor fixes for issues with re-authentication of mongos.
-
-1.1.30 05-18-2015
------------------
-- Correctly emit 'all' event when primary + all secondaries have connected.
-
-1.1.29 05-17-2015
------------------
-- NODE-464 Only use a single socket against arbiters and hidden servers.
-- Ensure we filter out hidden servers from any server queries.
-
-1.1.28 05-12-2015
------------------
-- Fixed buffer compare for electionId for < node 12.0.2
-
-1.1.27 05-12-2015
------------------
-- NODE-455 Update SDAM specification support to cover electionId and Mongos load balancing.
-
-1.1.26 05-06-2015
------------------
-- NODE-456 Allow mongodb-core to pipeline commands (ex findAndModify+GLE) along the same connection and handle the returned results.
-- Fixes to make mongodb-core work for node 0.8.x when using scram and setImmediate.
-
-1.1.25 04-24-2015
------------------
-- Handle lack of callback in crud operations when returning error on application closed.
-
-1.1.24 04-22-2015
------------------
-- Error out when topology has been destroyed either by connection retries being exhausted or destroy called on topology.
-
-1.1.23 04-15-2015
------------------
-- Standardizing mongoErrors and its API (Issue #14)
-- Creating a new connection is slow because of 100ms setTimeout() (Issue #17, https://github.com/vkarpov15)
-- remove mkdirp and rimraf dependencies (Issue #12)
-- Updated default value of param options.rejectUnauthorized to match documentation (Issue #16)
-- ISSUE: NODE-417 Resolution. Improving behavior of thrown errors (Issue #14, https://github.com/owenallenaz)
-- Fix cursor hanging when next() called on exhausted cursor (Issue #18, https://github.com/vkarpov15)
-
-1.1.22 04-10-2015
------------------
-- Minor refactorings in cursor code to make extending the cursor simpler.
-- NODE-417 Resolution. Improving behavior of thrown errors using Error.captureStackTrace.
-
-1.1.21 03-26-2015
------------------
-- Updated bson module to 0.3.0 that extracted the c++ parser into bson-ext and made it an optional dependency.
-
-1.1.20 03-24-2015
------------------
-- NODE-395 Socket Not Closing, db.close called before full set finished initalizing leading to server connections in progress not being closed properly.
-
-1.1.19 03-21-2015
------------------
-- Made kerberos module ~0.0 to allow for quicker releases due to io.js of kerberos module.
-
-1.1.18 03-17-2015
------------------
-- Added support for minHeartbeatFrequencyMS on server reconnect according to the SDAM specification.
-
-1.1.17 03-16-2015
------------------
-- NODE-377, fixed issue where tags would correctly be checked on secondary and nearest to filter out eligible server candidates.
-
-1.1.16 03-06-2015
------------------
-- rejectUnauthorized parameter is set to true for ssl certificates by default instead of false.
-
-1.1.15 03-04-2015
------------------
-- Removed check for type in replset pickserver function.
-
-1.1.14 02-26-2015
------------------
-- NODE-374 correctly adding passive secondaries to the list of eligable servers for reads
-
-1.1.13 02-24-2015
------------------
-- NODE-365 mongoDB native node.js driver infinite reconnect attempts (fixed issue around handling of retry attempts)
-
-1.1.12 02-16-2015
------------------
-- Fixed cursor transforms for buffered document reads from cursor.
-
-1.1.11 02-02-2015
------------------
-- Remove the required setName for replicaset connections, if not set it will pick the first setName returned.
-
-1.1.10 31-01-2015
------------------
-- Added tranforms.doc option to cursor to allow for pr. document transformations.
-
-1.1.9 21-01-2015
-----------------
-- Updated BSON dependency to 0.2.18 to fix issues with io.js and node.
-- Updated Kerberos dependency to 0.0.8 to fix issues with io.js and node.
-- Don't treat findOne() as a command cursor.
-- Refactored out state changes into methods to simplify read the next method.
-
-1.1.8 09-12-2015
-----------------
-- Stripped out Object.defineProperty for performance reasons
-- Applied more performance optimizations.
-- properties cursorBatchSize, cursorSkip, cursorLimit are not methods setCursorBatchSize/cursorBatchSize, setCursorSkip/cursorSkip, setCursorLimit/cursorLimit
-
-1.1.7 18-12-2014
-----------------
-- Use ns variable for getMore commands for command cursors to work properly with cursor version of listCollections and listIndexes.
-
-1.1.6 18-12-2014
-----------------
-- Server manager fixed to support 2.2.X servers for travis test matrix.
-
-1.1.5 17-12-2014
-----------------
-- Fall back to errmsg when creating MongoError for command errors
-
-1.1.4 17-12-2014
-----------------
-- Added transform method support for cursor (initially just for initial query results) to support listCollections/listIndexes in 2.8.
-- Fixed variable leak in scram.
-- Fixed server manager to deal better with killing processes.
-- Bumped bson to 0.2.16.
-
-1.1.3 01-12-2014
-----------------
-- Fixed error handling issue with nonce generation in mongocr.
-- Fixed issues with restarting servers when using ssl.
-- Using strict for all classes.
-- Cleaned up any escaping global variables.
-
-1.1.2 20-11-2014
-----------------
-- Correctly encoding UTF8 collection names on wire protocol messages.
-- Added emitClose parameter to topology destroy methods to allow users to specify that they wish the topology to emit the close event to any listeners.
-
-1.1.1 14-11-2014
-----------------
-- Refactored code to use prototype instead of privileged methods.
-- Fixed issue with auth where a runtime condition could leave replicaset members without proper authentication.
-- Several deopt optimizations for v8 to improve performance and reduce GC pauses.
-
-1.0.5 29-10-2014
-----------------
-- Fixed issue with wrong namespace being created for command cursors.
-
-1.0.4 24-10-2014
-----------------
-- switched from using shift for the cursor due to bad slowdown on big batchSizes as shift causes entire array to be copied on each call.
-
-1.0.3 21-10-2014
-----------------
-- fixed error issuing problem on cursor.next when iterating over a huge dataset with a very small batchSize.
-
-1.0.2 07-10-2014
-----------------
-- fullsetup is now defined as a primary and secondary being available allowing for all read preferences to be satisfied.
-- fixed issue with replset_state logging.
-
-1.0.1 07-10-2014
-----------------
-- Dependency issue solved
-
-1.0.0 07-10-2014
-----------------
-- Initial release of mongodb-core

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/LICENSE b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/LICENSE
deleted file mode 100644
index ad410e1..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/LICENSE
+++ /dev/null
@@ -1,201 +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:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) 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
-
-      (d) 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 modifications 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
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "{}"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright {yyyy} {name of copyright owner}
-
-   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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/Makefile
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/Makefile b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/Makefile
deleted file mode 100644
index 36e1202..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-NODE = node
-NPM = npm
-JSDOC = jsdoc
-name = all
- 
-generate_docs:
-	# cp -R ./HISTORY.md ./docs/content/meta/release-notes.md
-	hugo -s docs/reference -d ../../public
-	$(JSDOC) -c conf.json -t docs/jsdoc-template/ -d ./public/api
-	cp -R ./public/api/scripts ./public/.
-	cp -R ./public/api/styles ./public/.

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/README.md
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/README.md b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/README.md
deleted file mode 100644
index 1c9e4c8..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/README.md
+++ /dev/null
@@ -1,225 +0,0 @@
-# Description
-
-The MongoDB Core driver is the low level part of the 2.0 or higher MongoDB driver and is meant for library developers not end users. It does not contain any abstractions or helpers outside of the basic management of MongoDB topology connections, CRUD operations and authentication.
-
-## MongoDB Node.JS Core Driver
- 
-| what          | where                                          |
-|---------------|------------------------------------------------|
-| documentation | http://mongodb.github.io/node-mongodb-native/  |
-| apidoc        | http://mongodb.github.io/node-mongodb-native/  |
-| source        | https://github.com/christkv/mongodb-core       |
-| mongodb       | http://www.mongodb.org/                        |
-
-### Blogs of Engineers involved in the driver
-- Christian Kvalheim [@christkv](https://twitter.com/christkv) <http://christiankvalheim.com>
-
-### Bugs / Feature Requests
-
-Think you’ve found a bug? Want to see a new feature in node-mongodb-native? Please open a
-case in our issue management tool, JIRA:
-
-- Create an account and login <https://jira.mongodb.org>.
-- Navigate to the NODE project <https://jira.mongodb.org/browse/NODE>.
-- Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it.
-
-Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the
-Core Server (i.e. SERVER) project are **public**.
-
-### Questions and Bug Reports
-
- * mailing list: https://groups.google.com/forum/#!forum/node-mongodb-native
- * jira: http://jira.mongodb.org/
-
-### Change Log
-
-http://jira.mongodb.org/browse/NODE
-
-# QuickStart
-
-The quick start guide will show you how to set up a simple application using Core driver and MongoDB. It scope is only how to set up the driver and perform the simple crud operations. For more inn depth coverage we encourage reading the tutorials.
-
-## Create the package.json file
-
-Let's create a directory where our application will live. In our case we will put this under our projects directory.
-
-```
-mkdir myproject
-cd myproject
-```
-
-Create a **package.json** using your favorite text editor and fill it in.
-
-```json
-{
-  "name": "myproject",
-  "version": "1.0.0",
-  "description": "My first project",
-  "main": "index.js",
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/christkv/myfirstproject.git"
-  },
-  "dependencies": {
-    "mongodb-core": "~1.0"
-  },
-  "author": "Christian Kvalheim",
-  "license": "Apache 2.0",
-  "bugs": {
-    "url": "https://github.com/christkv/myfirstproject/issues"
-  },
-  "homepage": "https://github.com/christkv/myfirstproject"
-}
-```
-
-Save the file and return to the shell or command prompt and use **NPM** to install all the dependencies.
-
-```
-npm install
-```
-
-You should see **NPM** download a lot of files. Once it's done you'll find all the downloaded packages under the **node_modules** directory.
-
-Booting up a MongoDB Server
----------------------------
-Let's boot up a MongoDB server instance. Download the right MongoDB version from [MongoDB](http://www.mongodb.org), open a new shell or command line and ensure the **mongod** command is in the shell or command line path. Now let's create a database directory (in our case under **/data**).
-
-```
-mongod --dbpath=/data --port 27017
-```
-
-You should see the **mongod** process start up and print some status information.
-
-## Connecting to MongoDB
-
-Let's create a new **app.js** file that we will use to show the basic CRUD operations using the MongoDB driver.
-
-First let's add code to connect to the server. Notice that there is no concept of a database here and we use the topology directly to perform the connection.
-
-```js
-var Server = require('mongodb-core').Server
-  , assert = require('assert');
-
-// Set up server connection
-var server = new Server({
-    host: 'localhost'
-  , port: 27017
-  , reconnect: true
-  , reconnectInterval: 50
-});
-
-// Add event listeners
-server.on('connect', function(_server) {
-  console.log('connected');
-  test.done();
-});
-
-server.on('close', function() {
-  console.log('closed');
-});
-
-server.on('reconnect', function() {
-  console.log('reconnect');
-});
-
-// Start connection
-server.connect();
-```
-
-To connect to a replicaset we would use the `ReplSet` class and for a set of Mongos proxies we use the `Mongos` class. Each topology class offer the same CRUD operations and you operate on the topology directly. Let's look at an example exercising all the different available CRUD operations.
-
-```js
-var Server = require('mongodb-core').Server
-  , assert = require('assert');
-
-// Set up server connection
-var server = new Server({
-    host: 'localhost'
-  , port: 27017
-  , reconnect: true
-  , reconnectInterval: 50
-});
-
-// Add event listeners
-server.on('connect', function(_server) {
-  console.log('connected');
-
-  // Execute the ismaster command
-  _server.command('system.$cmd', {ismaster: true}, function(err, result) {
-
-    // Perform a document insert
-    _server.insert('myproject.inserts1', [{a:1}, {a:2}], {
-      writeConcern: {w:1}, ordered:true
-    }, function(err, results) {
-      assert.equal(null, err);
-      assert.equal(2, results.result.n);      
-
-      // Perform a document update
-      _server.update('myproject.inserts1', [{
-        q: {a: 1}, u: {'$set': {b:1}}
-      }], {
-        writeConcern: {w:1}, ordered:true
-      }, function(err, results) {
-        assert.equal(null, err);
-        assert.equal(1, results.result.n);
-
-        // Remove a document
-        _server.remove('myproject.inserts1', [{
-          q: {a: 1}, limit: 1
-        }], {
-          writeConcern: {w:1}, ordered:true
-        }, function(err, results) {
-          assert.equal(null, err);
-          assert.equal(1, results.result.n);
-
-          // Get a document
-          var cursor = _server.cursor('integration_tests.inserts_example4', {
-              find: 'integration_tests.example4'
-            , query: {a:1}
-          });
-
-          // Get the first document
-          cursor.next(function(err, doc) {
-            assert.equal(null, err);
-            assert.equal(2, doc.a);
-
-            // Execute the ismaster command
-            _server.command("system.$cmd"
-              , {ismaster: true}, function(err, result) {
-                assert.equal(null, err)
-                _server.destroy();              
-            });
-          });
-      });
-    });
-
-    test.done();
-  });
-});
-
-server.on('close', function() {
-  console.log('closed');
-});
-
-server.on('reconnect', function() {
-  console.log('reconnect');
-});
-
-// Start connection
-server.connect();
-```
-
-The core driver does not contain any helpers or abstractions only the core crud operations. These consist of the following commands.
-
-* `insert`, Insert takes an array of 1 or more documents to be inserted against the topology and allows you to specify a write concern and if you wish to execute the inserts in order or out of order.
-* `update`, Update takes an array of 1 or more update commands to be executed against the server topology and also allows you to specify a write concern and if you wish to execute the updates in order or out of order.
-* `remove`, Remove takes an array of 1 or more remove commands to be executed against the server topology and also allows you to specify a write concern and if you wish to execute the removes in order or out of order.
-* `cursor`, Returns you a cursor for either the 'virtual' `find` command, a command that returns a cursor id or a plain cursor id. Read the cursor tutorial for more inn depth coverage.
-* `command`, Executes a command against MongoDB and returns the result.
-* `auth`, Authenticates the current topology using a supported authentication scheme.
-
-The Core Driver is a building block for library builders and is not meant for usage by end users as it lacks a lot of features the end user might need such as automatic buffering of operations when a primary is changing in a replicaset or the db and collections abstraction.
-
-## Next steps
-
-The next step is to get more in depth information about how the different aspects of the core driver works and how to leverage them to extend the functionality of the cursors. Please view the tutorials for more detailed information.

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/TESTING.md
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/TESTING.md b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/TESTING.md
deleted file mode 100644
index fe03ea0..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/TESTING.md
+++ /dev/null
@@ -1,18 +0,0 @@
-Testing setup
-=============
-
-Single Server
--------------
-mongod --dbpath=./db
-
-Replicaset
-----------
-mongo --nodb
-var x = new ReplSetTest({"useHostName":"false", "nodes" : {node0 : {}, node1 : {}, node2 : {}}})
-x.startSet();
-var config = x.getReplSetConfig()
-x.initiate(config);
-
-Mongos
-------
-var s = new ShardingTest( "auth1", 1 , 0 , 2 , {rs: true, noChunkSize : true});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/conf.json
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/conf.json b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/conf.json
deleted file mode 100644
index c5eca92..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/conf.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
-  "plugins": ["plugins/markdown", "docs/lib/jsdoc/examples_plugin.js"],
-  "source": {
-    "include": [
-      "test/tests/functional/operation_example_tests.js",
-      "lib/topologies/mongos.js",
-      "lib/topologies/command_result.js",
-      "lib/topologies/read_preference.js",
-      "lib/topologies/replset.js",
-      "lib/topologies/server.js",
-      "lib/topologies/session.js",
-      "lib/topologies/replset_state.js",
-      "lib/connection/logger.js",
-      "lib/connection/connection.js",
-      "lib/cursor.js",
-      "lib/error.js",
-      "node_modules/bson/lib/bson/binary.js",
-      "node_modules/bson/lib/bson/code.js",
-      "node_modules/bson/lib/bson/db_ref.js",
-      "node_modules/bson/lib/bson/double.js",
-      "node_modules/bson/lib/bson/long.js",
-      "node_modules/bson/lib/bson/objectid.js",
-      "node_modules/bson/lib/bson/symbol.js",
-      "node_modules/bson/lib/bson/timestamp.js",
-      "node_modules/bson/lib/bson/max_key.js",
-      "node_modules/bson/lib/bson/min_key.js"
-    ]     
-  },
-  "templates": {
-    "cleverLinks": true,
-    "monospaceLinks": true,
-    "default": {
-      "outputSourceFiles" : true
-    },
-    "applicationName": "Node.js MongoDB Driver API",
-    "disqus": true,
-    "googleAnalytics": "UA-29229787-1",
-    "openGraph": {
-      "title": "",
-      "type": "website",
-      "image": "",
-      "site_name": "",
-      "url": ""
-    },
-    "meta": {
-      "title": "",
-      "description": "",
-      "keyword": ""
-    },
-    "linenums": true
-  },  
-  "markdown": {
-    "parser": "gfm",
-    "hardwrap": true,
-    "tags": ["examples"]
-  },
-  "examples": {
-    "indent": 4
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/index.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/index.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/index.js
deleted file mode 100644
index 8f10860..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/index.js
+++ /dev/null
@@ -1,18 +0,0 @@
-module.exports = {
-    MongoError: require('./lib/error')
-  , Server: require('./lib/topologies/server')
-  , ReplSet: require('./lib/topologies/replset')
-  , Mongos: require('./lib/topologies/mongos')
-  , Logger: require('./lib/connection/logger')
-  , Cursor: require('./lib/cursor')
-  , ReadPreference: require('./lib/topologies/read_preference')
-  , BSON: require('bson')
-  // Raw operations
-  , Query: require('./lib/connection/commands').Query
-  // Auth mechanisms
-  , MongoCR: require('./lib/auth/mongocr')
-  , X509: require('./lib/auth/x509')
-  , Plain: require('./lib/auth/plain')
-  , GSSAPI: require('./lib/auth/gssapi')
-  , ScramSHA1: require('./lib/auth/scram')
-}

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/gssapi.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/gssapi.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/gssapi.js
deleted file mode 100644
index c442b9b..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/gssapi.js
+++ /dev/null
@@ -1,244 +0,0 @@
-"use strict";
-
-var f = require('util').format
-  , crypto = require('crypto')
-  , MongoError = require('../error');
-
-var AuthSession = function(db, username, password, options) {
-  this.db = db;
-  this.username = username;
-  this.password = password;
-  this.options = options;
-}
-
-AuthSession.prototype.equal = function(session) {
-  return session.db == this.db 
-    && session.username == this.username
-    && session.password == this.password;
-}
-
-// Kerberos class
-var Kerberos = null;
-var MongoAuthProcess = null;
-
-// Try to grab the Kerberos class
-try {
-  Kerberos = require('kerberos').Kerberos
-  // Authentication process for Mongo
-  MongoAuthProcess = require('kerberos').processes.MongoAuthProcess
-} catch(err) {}
-
-/**
- * Creates a new GSSAPI authentication mechanism
- * @class
- * @return {GSSAPI} A cursor instance
- */
-var GSSAPI = function() {
-  this.authStore = [];
-}
-
-/**
- * Authenticate
- * @method
- * @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
- * @param {Pool} pool Connection pool for this topology
- * @param {string} db Name of the database
- * @param {string} username Username
- * @param {string} password Password
- * @param {authResultCallback} callback The callback to return the result from the authentication
- * @return {object}
- */
-GSSAPI.prototype.auth = function(server, pool, db, username, password, options, callback) {
-  var self = this;
-  // We don't have the Kerberos library
-  if(Kerberos == null) return callback(new Error("Kerberos library is not installed"));  
-  var gssapiServiceName = options['gssapiServiceName'] || 'mongodb';
-  // Get all the connections
-  var connections = pool.getAll();
-  // Total connections
-  var count = connections.length;
-  if(count == 0) return callback(null, null);
-
-  // Valid connections
-  var numberOfValidConnections = 0;
-  var credentialsValid = false;
-  var errorObject = null;
-
-  // For each connection we need to authenticate
-  while(connections.length > 0) {    
-    // Execute MongoCR
-    var execute = function(connection) {
-      // Start Auth process for a connection
-      GSSAPIInitialize(db, username, password, db, gssapiServiceName, server, connection, function(err, r) {
-        // Adjust count
-        count = count - 1;
-
-        // If we have an error
-        if(err) {
-          errorObject = err;
-        } else if(r.result['$err']) {
-          errorObject = r.result;
-        } else if(r.result['errmsg']) {
-          errorObject = r.result;
-        } else {
-          credentialsValid = true;
-          numberOfValidConnections = numberOfValidConnections + 1;
-        }
-
-        // We have authenticated all connections
-        if(count == 0 && numberOfValidConnections > 0) {
-          // Store the auth details
-          addAuthSession(self.authStore, new AuthSession(db, username, password, options));
-          // Return correct authentication
-          callback(null, true);
-        } else if(count == 0) {
-          if(errorObject == null) errorObject = new MongoError(f("failed to authenticate using mongocr"));
-          callback(errorObject, false);
-        }
-      });
-    }
-
-    // Get the connection
-    execute(connections.shift());
-  }
-}
-
-//
-// Initialize step
-var GSSAPIInitialize = function(db, username, password, authdb, gssapiServiceName, server, connection, callback) {
-  // Create authenticator
-  var mongo_auth_process = new MongoAuthProcess(connection.host, connection.port, gssapiServiceName);
-
-  // Perform initialization
-  mongo_auth_process.init(username, password, function(err, context) {
-    if(err) return callback(err, false);
-
-    // Perform the first step
-    mongo_auth_process.transition('', function(err, payload) {
-      if(err) return callback(err, false);
-
-      // Call the next db step
-      MongoDBGSSAPIFirstStep(mongo_auth_process, payload, db, username, password, authdb, server, connection, callback);
-    });
-  });
-}
-
-//
-// Perform first step against mongodb
-var MongoDBGSSAPIFirstStep = function(mongo_auth_process, payload, db, username, password, authdb, server, connection, callback) {
-  // Build the sasl start command
-  var command = {
-      saslStart: 1
-    , mechanism: 'GSSAPI'
-    , payload: payload
-    , autoAuthorize: 1
-  };
-
-  // Execute first sasl step
-  server.command("$external.$cmd"
-    , command
-    , { connection: connection }, function(err, r) {
-    if(err) return callback(err, false);    
-    var doc = r.result;
-    // Execute mongodb transition
-    mongo_auth_process.transition(r.result.payload, function(err, payload) {
-      if(err) return callback(err, false);
-
-      // MongoDB API Second Step
-      MongoDBGSSAPISecondStep(mongo_auth_process, payload, doc, db, username, password, authdb, server, connection, callback);
-    });
-  });
-}
-
-//
-// Perform first step against mongodb
-var MongoDBGSSAPISecondStep = function(mongo_auth_process, payload, doc, db, username, password, authdb, server, connection, callback) {
-  // Build Authentication command to send to MongoDB
-  var command = {
-      saslContinue: 1
-    , conversationId: doc.conversationId
-    , payload: payload
-  };
-
-  // Execute the command
-  server.command("$external.$cmd"
-    , command
-    , { connection: connection }, function(err, r) {
-    if(err) return callback(err, false);
-    var doc = r.result;
-    // Call next transition for kerberos
-    mongo_auth_process.transition(doc.payload, function(err, payload) {
-      if(err) return callback(err, false);
-
-      // Call the last and third step
-      MongoDBGSSAPIThirdStep(mongo_auth_process, payload, doc, db, username, password, authdb, server, connection, callback);
-    });    
-  });
-}
-
-var MongoDBGSSAPIThirdStep = function(mongo_auth_process, payload, doc, db, username, password, authdb, server, connection, callback) {
-  // Build final command
-  var command = {
-      saslContinue: 1
-    , conversationId: doc.conversationId
-    , payload: payload
-  };
-
-  // Execute the command
-  server.command("$external.$cmd"
-    , command
-    , { connection: connection }, function(err, r) {
-    if(err) return callback(err, false);
-    mongo_auth_process.transition(null, function(err, payload) {
-      if(err) return callback(err, null);
-      callback(null, r);
-    });
-  });
-}
-
-// Add to store only if it does not exist
-var addAuthSession = function(authStore, session) {
-  var found = false;
-
-  for(var i = 0; i < authStore.length; i++) {
-    if(authStore[i].equal(session)) {
-      found = true;
-      break;
-    }
-  }
-
-  if(!found) authStore.push(session);
-}
-
-/**
- * Re authenticate pool
- * @method
- * @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
- * @param {Pool} pool Connection pool for this topology
- * @param {authResultCallback} callback The callback to return the result from the authentication
- * @return {object}
- */
-GSSAPI.prototype.reauthenticate = function(server, pool, callback) {
-  var count = this.authStore.length;
-  if(count == 0) return callback(null, null);
-  // Iterate over all the auth details stored
-  for(var i = 0; i < this.authStore.length; i++) {
-    this.auth(server, pool, this.authStore[i].db, this.authStore[i].username, this.authStore[i].password, this.authStore[i].options, function(err, r) {
-      count = count - 1;
-      // Done re-authenticating
-      if(count == 0) {
-        callback(null, null);
-      }
-    });
-  }
-}
-
-/**
- * This is a result from a authentication strategy
- *
- * @callback authResultCallback
- * @param {error} error An error object. Set to null if no error present
- * @param {boolean} result The result of the authentication process
- */
-
-module.exports = GSSAPI;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/mongocr.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/mongocr.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/mongocr.js
deleted file mode 100644
index d0e9f59..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/mongocr.js
+++ /dev/null
@@ -1,160 +0,0 @@
-"use strict";
-
-var f = require('util').format
-  , crypto = require('crypto')
-  , MongoError = require('../error');
-
-var AuthSession = function(db, username, password) {
-  this.db = db;
-  this.username = username;
-  this.password = password;
-}
-
-AuthSession.prototype.equal = function(session) {
-  return session.db == this.db 
-    && session.username == this.username
-    && session.password == this.password;  
-}
-
-/**
- * Creates a new MongoCR authentication mechanism
- * @class
- * @return {MongoCR} A cursor instance
- */
-var MongoCR = function() {
-  this.authStore = [];
-}
-
-// Add to store only if it does not exist
-var addAuthSession = function(authStore, session) {
-  var found = false;
-
-  for(var i = 0; i < authStore.length; i++) {
-    if(authStore[i].equal(session)) {
-      found = true;
-      break;
-    }
-  }
-
-  if(!found) authStore.push(session);
-}
-
-/**
- * Authenticate
- * @method
- * @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
- * @param {Pool} pool Connection pool for this topology
- * @param {string} db Name of the database
- * @param {string} username Username
- * @param {string} password Password
- * @param {authResultCallback} callback The callback to return the result from the authentication
- * @return {object}
- */
-MongoCR.prototype.auth = function(server, pool, db, username, password, callback) {
-  var self = this;
-  // Get all the connections
-  var connections = pool.getAll();
-  // Total connections
-  var count = connections.length;
-  if(count == 0) return callback(null, null);
-
-  // Valid connections
-  var numberOfValidConnections = 0;
-  var credentialsValid = false;
-  var errorObject = null;
-
-  // For each connection we need to authenticate
-  while(connections.length > 0) {    
-    // Execute MongoCR
-    var executeMongoCR = function(connection) {
-      // Let's start the process
-      server.command(f("%s.$cmd", db)
-        , { getnonce: 1 }
-        , { connection: connection }, function(err, r) {
-          var nonce = null;
-          var key = null;
-          
-          // Adjust the number of connections left
-          // Get nonce
-          if(err == null) {
-            nonce = r.result.nonce;
-            // Use node md5 generator
-            var md5 = crypto.createHash('md5');
-            // Generate keys used for authentication
-            md5.update(username + ":mongo:" + password);
-            var hash_password = md5.digest('hex');
-            // Final key
-            md5 = crypto.createHash('md5');
-            md5.update(nonce + username + hash_password);
-            key = md5.digest('hex');
-          }
-
-          // Execute command
-          server.command(f("%s.$cmd", db)
-            , { authenticate: 1, user: username, nonce: nonce, key:key}
-            , { connection: connection }, function(err, r) {
-              count = count - 1;
-
-              // If we have an error
-              if(err) {
-                errorObject = err;
-              } else if(r.result['$err']) {
-                errorObject = r.result;
-              } else if(r.result['errmsg']) {
-                errorObject = r.result;
-              } else {
-                credentialsValid = true;
-                numberOfValidConnections = numberOfValidConnections + 1;
-              }
-
-              // We have authenticated all connections
-              if(count == 0 && numberOfValidConnections > 0) {
-                // Store the auth details
-                addAuthSession(self.authStore, new AuthSession(db, username, password));
-                // Return correct authentication
-                callback(null, true);
-              } else if(count == 0) {
-                if(errorObject == null) errorObject = new MongoError(f("failed to authenticate using mongocr"));
-                callback(errorObject, false);
-              }
-          });
-      });
-    }
-
-    // Get the connection
-    executeMongoCR(connections.shift());
-  }
-}
-
-/**
- * Re authenticate pool
- * @method
- * @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
- * @param {Pool} pool Connection pool for this topology
- * @param {authResultCallback} callback The callback to return the result from the authentication
- * @return {object}
- */
-MongoCR.prototype.reauthenticate = function(server, pool, callback) {
-  var count = this.authStore.length;
-  if(count == 0) return callback(null, null);
-  // Iterate over all the auth details stored
-  for(var i = 0; i < this.authStore.length; i++) {
-    this.auth(server, pool, this.authStore[i].db, this.authStore[i].username, this.authStore[i].password, function(err, r) {
-      count = count - 1;
-      // Done re-authenticating
-      if(count == 0) {
-        callback(null, null);
-      }
-    });
-  }
-}
-
-/**
- * This is a result from a authentication strategy
- *
- * @callback authResultCallback
- * @param {error} error An error object. Set to null if no error present
- * @param {boolean} result The result of the authentication process
- */
-
-module.exports = MongoCR;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/6436833c/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/plain.js
----------------------------------------------------------------------
diff --git a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/plain.js b/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/plain.js
deleted file mode 100644
index 31ce872..0000000
--- a/node_modules/couchbulkimporter/node_modules/mongodb/node_modules/mongodb-core/lib/auth/plain.js
+++ /dev/null
@@ -1,150 +0,0 @@
-"use strict";
-
-var f = require('util').format
-  , crypto = require('crypto')
-  , Binary = require('bson').Binary
-  , MongoError = require('../error');
-
-var AuthSession = function(db, username, password) {
-  this.db = db;
-  this.username = username;
-  this.password = password;
-}
-
-AuthSession.prototype.equal = function(session) {
-  return session.db == this.db 
-    && session.username == this.username
-    && session.password == this.password;
-}
-
-/**
- * Creates a new Plain authentication mechanism
- * @class
- * @return {Plain} A cursor instance
- */
-var Plain = function() {
-  this.authStore = [];
-}
-
-/**
- * Authenticate
- * @method
- * @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
- * @param {Pool} pool Connection pool for this topology
- * @param {string} db Name of the database
- * @param {string} username Username
- * @param {string} password Password
- * @param {authResultCallback} callback The callback to return the result from the authentication
- * @return {object}
- */
-Plain.prototype.auth = function(server, pool, db, username, password, callback) {
-  var self = this;
-  // Get all the connections
-  var connections = pool.getAll();
-  // Total connections
-  var count = connections.length;
-  if(count == 0) return callback(null, null);
-
-  // Valid connections
-  var numberOfValidConnections = 0;
-  var credentialsValid = false;
-  var errorObject = null;
-
-  // For each connection we need to authenticate
-  while(connections.length > 0) {    
-    // Execute MongoCR
-    var execute = function(connection) {
-      // Create payload
-      var payload = new Binary(f("\x00%s\x00%s", username, password));
-
-      // Let's start the sasl process
-      var command = {
-          saslStart: 1
-        , mechanism: 'PLAIN'
-        , payload: payload
-        , autoAuthorize: 1
-      };
-
-      // Let's start the process
-      server.command("$external.$cmd"
-        , command
-        , { connection: connection }, function(err, r) {
-        // Adjust count
-        count = count - 1;
-
-        // If we have an error
-        if(err) {
-          errorObject = err;
-        } else if(r.result['$err']) {
-          errorObject = r.result;
-        } else if(r.result['errmsg']) {
-          errorObject = r.result;
-        } else {
-          credentialsValid = true;
-          numberOfValidConnections = numberOfValidConnections + 1;
-        }
-
-        // We have authenticated all connections
-        if(count == 0 && numberOfValidConnections > 0) {
-          // Store the auth details
-          addAuthSession(self.authStore, new AuthSession(db, username, password));
-          // Return correct authentication
-          callback(null, true);
-        } else if(count == 0) {
-          if(errorObject == null) errorObject = new MongoError(f("failed to authenticate using mongocr"));
-          callback(errorObject, false);
-        }
-      });
-    }
-
-    // Get the connection
-    execute(connections.shift());
-  }
-}
-
-// Add to store only if it does not exist
-var addAuthSession = function(authStore, session) {
-  var found = false;
-
-  for(var i = 0; i < authStore.length; i++) {
-    if(authStore[i].equal(session)) {
-      found = true;
-      break;
-    }
-  }
-
-  if(!found) authStore.push(session);
-}
-
-/**
- * Re authenticate pool
- * @method
- * @param {{Server}|{ReplSet}|{Mongos}} server Topology the authentication method is being called on
- * @param {Pool} pool Connection pool for this topology
- * @param {authResultCallback} callback The callback to return the result from the authentication
- * @return {object}
- */
-Plain.prototype.reauthenticate = function(server, pool, callback) {
-  var count = this.authStore.length;
-  if(count == 0) return callback(null, null);
-  // Iterate over all the auth details stored
-  for(var i = 0; i < this.authStore.length; i++) {
-    this.auth(server, pool, this.authStore[i].db, this.authStore[i].username, this.authStore[i].password, function(err, r) {
-      count = count - 1;
-      // Done re-authenticating
-      if(count == 0) {
-        callback(null, null);
-      }
-    });
-  }
-}
-
-/**
- * This is a result from a authentication strategy
- *
- * @callback authResultCallback
- * @param {error} error An error object. Set to null if no error present
- * @param {boolean} result The result of the authentication process
- */
-
-module.exports = Plain;
\ No newline at end of file


Mime
View raw message