=l){var y=t?null:s(e);if(y)return c(y);h=!1,f=u,v=new o}else v=t?[]:d;e:for(;++n=t?t-1:r}Object.defineProperty(t,"__esModule",{value:!0}),t.FileStore=void 0;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},f=function(){function e(e,t){for(var r=0;r=500&&f.statusCode<600)){r.next=28;break}if(p=function(){m.Log.debug("File upload error.",f.statusCode);var r=Math.pow(2,v.count)+s(1e3,1);if(r>=v.maxBackoff)throw f.error;return m.Log.debug("File upload will try again in "+r+" seconds."),{v:new y.Promise(function(i){setTimeout(function(){v.count=v.count+1,i(d.uploadToGCS(e,t,n,o,v))},r)})}}(),"object"!==("undefined"==typeof p?"undefined":l(p))){r.next=28;break}return r.abrupt("return",p.v);case 28:throw f.error;case 29:return r.abrupt("return",f);case 30:case"end":return r.stop()}},r,this)}));return e}()},{key:"create",value:function(e,t,r){return this.upload(e,t,r)}},{key:"update",value:function(e,t,r){return this.upload(e,t,r)}},{key:"remove",value:function(){throw new d.KinveyError("Please use removeById() to remove files one by one.")}},{key:"pathname",get:function(){return"/"+R+"/"+this.client.appKey}}]),t}(v.NetworkStore)}).call(t,r(11))},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,i){try{var a=t[o](i),u=a.value}catch(s){return void r(s)}return a.done?void e(u):Promise.resolve(u).then(function(e){return n("next",e)},function(e){return n("throw",e)})}return n("next")})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.UserStore=void 0;var s=function(){function e(e,t){for(var r=0;r-1?u[s?t[c]:c]:void 0}}var o=r(15),i=r(77),a=r(72);e.exports=n},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return function(){var t=e.apply(this,arguments);return new s.Promise(function(e,r){function n(o,i){try{var a=t[o](i),u=a.value}catch(c){return void r(c)}return a.done?void e(u):s.Promise.resolve(u).then(function(e){return n("next",e)},function(e){return n("throw",e)})}return n("next")})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedDB=void 0;var a=function(){function e(e,t){for(var r=0;r0){var r=o.queue;o.queue=[],(0,p["default"])(r,function(e){e.call(o)})}};return t};return o.openTransaction(t,r,a(n),a(i),!0)},v.onblocked=function(){i(new u.KinveyError("The "+o.name+" IndexedDB database version can't be upgraded because the database is already open."))},v.onerror=function(e){i(new u.KinveyError("Unable to open the "+o.name+" IndexedDB database."+(" "+e.target.error.message+".")))},v}},{key:"find",value:function(){function e(e){return t.apply(this,arguments)}var t=o(l["default"].mark(function r(e){var t=this;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new s.Promise(function(r,n){t.openTransaction(e,!1,function(){var i=o(l["default"].mark(function a(o){var i,u,s;return l["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=o.objectStore(e),u=i.openCursor(),s=[],u.onsuccess=function(e){var t=e.target.result;return t?(s.push(t.value),t["continue"]()):r(s)},u.onerror=function(e){n(e)};case 5:case"end":return t.stop()}},a,t)}));return function(e){return i.apply(this,arguments)}}(),n)}));case 1:case"end":return r.stop()}},r,this)}));return e}()},{key:"findById",value:function(){function e(e,r){return t.apply(this,arguments)}var t=o(l["default"].mark(function r(e,t){var n=this;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new s.Promise(function(r,i){n.openTransaction(e,!1,function(){var a=o(l["default"].mark(function s(o){var a,c;return l["default"].wrap(function(s){for(;;)switch(s.prev=s.next){case 0:a=o.objectStore(e),c=a.get(t),c.onsuccess=function(o){var a=o.target.result;a?r(a):i(new u.NotFoundError("An entity with _id = "+t+" was not found in the "+e+(" collection on the "+n.name+" IndexedDB database.")))},c.onerror=function(){i(new u.NotFoundError("An entity with _id = "+t+" was not found in the "+e+(" collection on the "+n.name+" IndexedDB database.")))};case 4:case"end":return s.stop()}},s,n)}));return function(e){return a.apply(this,arguments)}}(),i)}));case 1:case"end":return r.stop()}},r,this)}));return e}()},{key:"save",value:function(){function e(e,r){return t.apply(this,arguments)}var t=o(l["default"].mark(function r(e,t){var n,i=this;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n=!1,(0,y["default"])(t)||(n=!0,t=[t]),0!==t.length){r.next=4;break}return r.abrupt("return",null);case 4:return r.abrupt("return",new s.Promise(function(r,a){i.openTransaction(e,!0,function(){var s=o(l["default"].mark(function c(o){var s;return l["default"].wrap(function(c){for(;;)switch(c.prev=c.next){case 0:s=o.objectStore(e),(0,p["default"])(t,function(e){s.put(e)}),o.oncomplete=function(){r(n?t[0]:t)},o.onerror=function(t){a(new u.KinveyError("An error occurred while saving the entities to the "+e+(" collection on the "+i.name+" IndexedDB database. "+t.target.error.message+".")))};case 4:case"end":return c.stop()}},c,i)}));return function(e){return s.apply(this,arguments)}}(),a)}));case 5:case"end":return r.stop()}},r,this)}));return e}()},{key:"removeById",value:function(){function e(e,r){return t.apply(this,arguments)}var t=o(l["default"].mark(function r(e,t){var n=this;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new s.Promise(function(r,i){n.openTransaction(e,!0,function(){var a=o(l["default"].mark(function s(o){var a,c;return l["default"].wrap(function(s){for(;;)switch(s.prev=s.next){case 0:a=o.objectStore(e),c=a.get(t),a["delete"](t),o.oncomplete=function(){var o=c.result;o?r(o):i(new u.NotFoundError("An entity with id = "+t+" was not found in the "+e+(" collection on the "+n.name+" IndexedDB database.")))},o.onerror=function(){i(new u.NotFoundError("An entity with id = "+t+" was not found in the "+e+(" collection on the "+n.name+" IndexedDB database.")))};case 5:case"end":return s.stop()}},s,n)}));return function(e){return a.apply(this,arguments)}}(),i)}));case 1:case"end":return r.stop()}},r,this)}));return e}()},{key:"clear",value:function(){function t(){return r.apply(this,arguments)}var r=o(l["default"].mark(function n(){var t=this;return l["default"].wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new s.Promise(function(r,n){var o=e.indexedDB||e.webkitIndexedDB||e.mozIndexedDB||e.msIndexedDB,i=o.deleteDatabase(t.name);i.onsuccess=function(){g={},r()},i.onerror=function(e){n(new u.KinveyError("An error occurred while clearing the "+t.name+" IndexedDB database."+(" "+e.target.error.message+".")))}}));case 1:case"end":return r.stop()}},n,this)}));return t}()}],[{key:"isSupported",value:function(){var t=e.indexedDB||e.webkitIndexedDB||e.mozIndexedDB||e.msIndexedDB;return!!t}}]),t}()}).call(t,function(){return this}())},function(e,t,r){(function(e,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e){return function(){var t=e.apply(this,arguments);return new c.Promise(function(e,r){function n(o,i){try{var a=t[o](i),u=a.value}catch(s){return void r(s)}return a.done?void e(u):c.Promise.resolve(u).then(function(e){return n("next",e)},function(e){return n("throw",e)})}return n("next")})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.WebSQL=void 0;var u=function(){function e(e,t){for(var r=0;r=n.maxQueuedPromises?void o(new Error("Queue limit reached")):(n.queue.push({promiseGenerator:e,resolve:t,reject:o,notify:i||r}),void n._dequeue())})},e.prototype.getPendingLength=function(){return this.pendingPromises},e.prototype.getQueueLength=function(){return this.queue.length},e.prototype._dequeue=function(){var e=this;if(this.pendingPromises>=this.maxPendingPromises)return!1;var t=this.queue.shift();if(!t)return!1;try{this.pendingPromises++,n(t.promiseGenerator()).then(function(r){e.pendingPromises--,t.resolve(r),e._dequeue()},function(r){e.pendingPromises--,t.reject(r),e._dequeue()},function(e){t.notify(e)})}catch(r){e.pendingPromises--,t.reject(r),e._dequeue()}return!0},e})},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.XHRMiddleware=void 0;var u=function(){function e(e,t){for(var r=0;r"],main:"./dist/export.js",repository:{type:"git",url:"git@github.com:Kinvey/html5-sdk"},scripts:{build:"gulp build",bundle:"gulp bundle",clean:"gulp clean",lint:"gulp lint",test:"npm run test:unit","test:unit":"mocha --compilers js:babel-core/register -r babel-polyfill -s 100 --recursive test/unit/setup test/unit","test:unit:watch":"mocha -w --compilers js:babel-core/register -r babel-polyfill -s 100 --recursive test/unit/setup test/unit","test:jenkins":"npm run test:unit:jenkins","test:unit:jenkins":"istanbul cover _mocha -- --reporter tap --compilers js:babel-core/register -r babel-polyfill -s 100 --recursive test/unit/setup test/unit > test.tap && istanbul report clover","e2e:server":"webdriver-manager update && webdriver-manager start","e2e:app":"npm run bundle && node ./test/e2e/app","e2e:test":"protractor ./test/e2e/test/protractor.conf.js"},dependencies:{"es6-promise":"^3.2.1","kinvey-javascript-rack":"^1.0.0","kinvey-javascript-sdk-core":"^3.0.0",lodash:"^4.8.2","parse-headers":"^2.0.1","promise-queue":"^2.2.3","regenerator-runtime":"^0.9.5"},peerDependencies:{"kinvey-javascript-rack":"^1.0.0","kinvey-javascript-sdk-core":"^3.0.0"},devDependencies:{"babel-core":"^6.9.0","babel-eslint":"^6.0.0","babel-polyfill":"^6.9.0","babel-preset-es2015":"^6.9.0","babel-preset-stage-2":"^6.0.15","babel-register":"^6.9.0",del:"^2.0.2",eslint:"^2.12.0","eslint-config-airbnb":"^9.0.1","eslint-plugin-import":"^1.8.0","eslint-plugin-jsx-a11y":"^1.2.2","eslint-plugin-react":"^5.1.1",expect:"^1.20.2",express:"^4.14.0",gulp:"^3.9.0","gulp-babel":"^6.1.2","gulp-banner":"^0.1.3","gulp-buffer":"0.0.2","gulp-bump":"^2.1.0","gulp-env":"^0.4.0","gulp-eslint":"^2.0.0","gulp-git":"^1.7.0","gulp-plumber":"^1.0.1","gulp-prompt":"^0.2.0","gulp-rename":"^1.2.2","gulp-s3-upload":"^1.6.0","gulp-sourcemaps":"^1.6.0","gulp-tag-version":"^1.3.0","gulp-uglify":"^1.5.1","gulp-util":"^3.0.6",istanbul:"^0.4.3","json-loader":"^0.5.4",mocha:"^2.5.3",nock:"^8.0.0",protractor:"^4.0.3","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.1.0",webpack:"^1.13.0","webpack-stream":"^3.1.0",yargs:"^4.7.1"},engines:{node:">=4.0"},keywords:["Kinvey","JavaScript","HTML5"]}},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(o,i){try{var a=t[o](i),u=a.value}catch(s){return void r(s)}return a.done?void e(u):Promise.resolve(u).then(function(e){return n("next",e)},function(e){return n("throw",e)})}return n("next")})}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Popup=void 0;var s=function(){function e(e,t){for(var r=0;r0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),o||(o=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var o=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,o,a,u;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(u=a;u-- >0;)if(r[u]===t||r[u].listener&&r[u].listener===t){o=u;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}}])});