diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f3a0c3..d2e7c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## [v2.3.0](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.3.0) (2018-05-22) +- Add origin to create card transaction [\#17](https://github.com/uphold/uphold-sdk-javascript/pull/17) ([pgom](https://github.com/pgom)) + ## [v2.2.1](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.2.1) (2018-05-16) - bump request version [\#16](https://github.com/uphold/uphold-sdk-javascript/pull/16) ([evq](https://github.com/evq)) diff --git a/dist/browser/uphold-sdk-javascript.js b/dist/browser/uphold-sdk-javascript.js index be8f8d8..a4760bd 100644 --- a/dist/browser/uphold-sdk-javascript.js +++ b/dist/browser/uphold-sdk-javascript.js @@ -1 +1 @@ -module.exports=function(l){function n(e){if(u[e])return u[e].exports;var t=u[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var u={};return n.m=l,n.c=u,n.i=function(l){return l},n.d=function(l,u,e){n.o(l,u)||Object.defineProperty(l,u,{configurable:!1,enumerable:!0,get:e})},n.n=function(l){var u=l&&l.__esModule?function(){return l.default}:function(){return l};return n.d(u,"a",u),u},n.o=function(l,n){return Object.prototype.hasOwnProperty.call(l,n)},n.p="",n(n.s=10)}([function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.BaseError=void 0;var o=u(51),i=function(l){return l&&l.__esModule?l:{default:l}}(o);n.BaseError=function(l){function n(){return e(this,n),t(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return r(n,l),n}(i.default)},function(l,n,u){(function(l,u){function e(l,n){return l.set(n[0],n[1]),l}function t(l,n){return l.add(n),l}function r(l,n,u){switch(u.length){case 0:return l.call(n);case 1:return l.call(n,u[0]);case 2:return l.call(n,u[0],u[1]);case 3:return l.call(n,u[0],u[1],u[2])}return l.apply(n,u)}function o(l,n){for(var u=-1,e=l?l.length:0;++u-1}function P(l,n){var u=this.__data__,e=z(u,l);return e<0?u.push([l,n]):u[e][1]=n,this}function A(l){var n=-1,u=l?l.length:0;for(this.clear();++n-1&&l%1==0&&l-1&&l%1==0&&l<=Dl}function Sl(l){var n=typeof l;return!!l&&("object"==n||"function"==n)}function Rl(l){return!!l&&"object"==typeof l}function Ml(l){if(!Rl(l)||Un.call(l)!=Wl||f(l))return!1;var n=Dn(l);if(null===n)return!0;var u=In.call(n,"constructor")&&n.constructor;return"function"==typeof u&&u instanceof u&&Mn.call(u)==Bn}function Il(l){return sl(l,Ul(l))}function Bl(l){return Al(l)?N(l):Q(l)}function Ul(l){return Al(l)?N(l,!0):X(l)}function ql(){return[]}function Ll(){return!1}var Nl=200,Fl="__lodash_hash_undefined__",Dl=9007199254740991,zl="[object Arguments]",Hl="[object Boolean]",Kl="[object Date]",Jl="[object Function]",Vl="[object GeneratorFunction]",Gl="[object Map]",$l="[object Number]",Wl="[object Object]",Ql="[object RegExp]",Xl="[object Set]",Yl="[object String]",Zl="[object Symbol]",ln="[object WeakMap]",nn="[object ArrayBuffer]",un="[object DataView]",en="[object Float32Array]",tn="[object Float64Array]",rn="[object Int8Array]",on="[object Int16Array]",an="[object Int32Array]",cn="[object Uint8Array]",sn="[object Uint8ClampedArray]",fn="[object Uint16Array]",dn="[object Uint32Array]",pn=/[\\^$.*+?()[\]{}|]/g,hn=/\w*$/,yn=/^\[object .+?Constructor\]$/,bn=/^(?:0|[1-9]\d*)$/,vn={};vn[en]=vn[tn]=vn[rn]=vn[on]=vn[an]=vn[cn]=vn[sn]=vn[fn]=vn[dn]=!0,vn[zl]=vn["[object Array]"]=vn[nn]=vn[Hl]=vn[un]=vn[Kl]=vn["[object Error]"]=vn[Jl]=vn[Gl]=vn[$l]=vn[Wl]=vn[Ql]=vn[Xl]=vn[Yl]=vn[ln]=!1;var gn={};gn[zl]=gn["[object Array]"]=gn[nn]=gn[un]=gn[Hl]=gn[Kl]=gn[en]=gn[tn]=gn[rn]=gn[on]=gn[an]=gn[Gl]=gn[$l]=gn[Wl]=gn[Ql]=gn[Xl]=gn[Yl]=gn[Zl]=gn[cn]=gn[sn]=gn[fn]=gn[dn]=!0,gn["[object Error]"]=gn[Jl]=gn[ln]=!1;var _n="object"==typeof l&&l&&l.Object===Object&&l,mn="object"==typeof self&&self&&self.Object===Object&&self,wn=_n||mn||Function("return this")(),On="object"==typeof n&&n&&!n.nodeType&&n,jn=On&&"object"==typeof u&&u&&!u.nodeType&&u,kn=jn&&jn.exports===On,En=kn&&_n.process,Pn=function(){try{return En&&En.binding("util")}catch(l){}}(),An=Pn&&Pn.isTypedArray,xn=Array.prototype,Cn=Function.prototype,Tn=Object.prototype,Sn=wn["__core-js_shared__"],Rn=function(){var l=/[^.]+$/.exec(Sn&&Sn.keys&&Sn.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Mn=Cn.toString,In=Tn.hasOwnProperty,Bn=Mn.call(Object),Un=Tn.toString,qn=RegExp("^"+Mn.call(In).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ln=kn?wn.Buffer:void 0,Nn=wn.Symbol,Fn=wn.Uint8Array,Dn=p(Object.getPrototypeOf,Object),zn=Object.create,Hn=Tn.propertyIsEnumerable,Kn=xn.splice,Jn=Object.getOwnPropertySymbols,Vn=Ln?Ln.isBuffer:void 0,Gn=p(Object.keys,Object),$n=Math.max,Wn=hl(wn,"DataView"),Qn=hl(wn,"Map"),Xn=hl(wn,"Promise"),Yn=hl(wn,"Set"),Zn=hl(wn,"WeakMap"),lu=hl(Object,"create"),nu=kl(Wn),uu=kl(Qn),eu=kl(Xn),tu=kl(Yn),ru=kl(Zn),ou=Nn?Nn.prototype:void 0,iu=ou?ou.valueOf:void 0;y.prototype.clear=b,y.prototype.delete=v,y.prototype.get=g,y.prototype.has=_,y.prototype.set=m,w.prototype.clear=O,w.prototype.delete=j,w.prototype.get=k,w.prototype.has=E,w.prototype.set=P,A.prototype.clear=x,A.prototype.delete=C,A.prototype.get=T,A.prototype.has=S,A.prototype.set=R,M.prototype.clear=I,M.prototype.delete=B,M.prototype.get=U,M.prototype.has=q,M.prototype.set=L;var au=Jn?p(Jn,Object):ql,cu=G;(Wn&&cu(new Wn(new ArrayBuffer(1)))!=un||Qn&&cu(new Qn)!=Gl||Xn&&"[object Promise]"!=cu(Xn.resolve())||Yn&&cu(new Yn)!=Xl||Zn&&cu(new Zn)!=ln)&&(cu=function(l){var n=Un.call(l),u=n==Wl?l.constructor:void 0,e=u?kl(u):void 0;if(e)switch(e){case nu:return un;case uu:return Gl;case eu:return"[object Promise]";case tu:return Xl;case ru:return ln}return n});var su=Array.isArray,fu=Vn||Ll,du=An?function(l){return function(n){return l(n)}}(An):W,pu=function(l){return ll(function(n,u){var e=-1,t=u.length,r=t>1?u[t-1]:void 0,o=t>2?u[2]:void 0;for(r=l.length>3&&"function"==typeof r?(t--,r):void 0,o&&_l(u[0],u[1],o)&&(r=t<3?void 0:r,t=1),n=Object(n);++e=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122?u+=n.charAt(e):r<128?u+=t[r]:r<2048?u+=t[192|r>>6]+t[128|63&r]:r<55296||r>=57344?u+=t[224|r>>12]+t[128|r>>6&63]+t[128|63&r]:(e+=1,r=65536+((1023&r)<<10|1023&n.charCodeAt(e)),u+=t[240|r>>18]+t[128|r>>12&63]+t[128|r>>6&63]+t[128|63&r])}return u},n.compact=function(l,u){if("object"!=typeof l||null===l)return l;var e=u||[],t=e.indexOf(l);if(-1!==t)return e[t];if(e.push(l),Array.isArray(l)){for(var r=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:"_token";e(this,l),this.cache={},this.storageName=n}return t(l,[{key:"getItem",value:function(l){if(this.cache[l])return Promise.resolve(this.cache[l]);var n=this._getCookie();return n[l]?(this.cache[l]=n[l],Promise.resolve(n[l])):Promise.reject()}},{key:"removeItem",value:function(l){var n=this._getCookie();return n[l]?(delete this.cache[l],delete n[l],this._setCookie(n),Promise.resolve()):Promise.resolve()}},{key:"setItem",value:function(l,n){var u=this._getCookie();return delete this.cache[l],u[l]=n,this._setCookie(u),Promise.resolve()}},{key:"_getCookie",value:function(){var l=new RegExp("(?:^|; )"+encodeURIComponent(this.storageName)+"=([^;]*)").exec(document.cookie);return l?JSON.parse(decodeURIComponent(l[1])):{}}},{key:"_setCookie",value:function(l){document.cookie=this.storageName+"="+encodeURIComponent(JSON.stringify(l))+";path=/"}}]),l}();n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:"get",u=arguments[2],e=this,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=o({},r,{body:u,cache:"no-cache",credentials:"omit",headers:new Headers(o({},this.defaultHeaders,t)),method:n.toUpperCase(),mode:"cors"});return fetch(l,i).then(function(l){return l.ok?l.text().then(e._parseText).then(function(n){return e._formatResponse(l,n)}):Promise.reject(l)}).catch(function(l){return l.json?l.text().then(e._parseText).then(function(n){return Promise.reject((0,a.createError)(e._formatResponse(l,n),l))}):Promise.reject((0,a.createError)(e._formatResponse({error:l,status:-1}),l))})}},{key:"_formatResponse",value:function(l){return{body:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,headers:this._parseHeaders(l.headers),status:l.status,url:l.url}}},{key:"_parseHeaders",value:function(l){var n={};return l?(l.forEach(function(l,u){n[u]=l}),n):n}},{key:"_parseText",value:function(l){if(!l||(0,s.default)(l))return{};try{return JSON.parse(l)}catch(n){return l}}}]),n}(a.Client);n.default=f},function(l,n,u){"use strict";function e(l,n){return this.api("/me/accounts/"+l,n)}function t(l){return this.api("/me/accounts",l)}Object.defineProperty(n,"__esModule",{value:!0}),n.getAccount=e,n.getAccounts=t},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/addresses",(0,o.default)({body:{network:n},method:"post"},u))}function t(l,n){return this.api("/me/cards/"+l+"/addresses",n)}Object.defineProperty(n,"__esModule",{value:!0}),n.createCardAddress=e,n.getCardAddresses=t;var r=u(1),o=function(l){return l&&l.__esModule?l:{default:l}}(r)},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/cancel",a({method:"post"},u))}function t(l,n,u,e,t){var r=u.message,o=u.securityCode;return t=(0,s.default)({body:{message:r,securityCode:o},method:"post"},t),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions/"+n+"/commit",t)}function r(l,n,u,e,t){var r=n.amount,o=n.currency,i=n.destination,c=n.message,f=n.securityCode;return t=(0,s.default)({body:{denomination:{amount:r,currency:o},destination:i,message:c,securityCode:f},method:"post"},t),u&&(t.queryParams=a({commit:!0},t.queryParams)),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions",t)}function o(l,n,u,e){return this.paginate("/me/cards/"+l+"/transactions",n,u,e)}function i(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/resend",a({method:"post"},u))}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InternalServerError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InvalidScopeError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&"invalid_scope"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.NotFoundError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.OTPRequiredError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.headers;return!(!n||!n["otp-token"])&&"REQUIRED"===n["otp-token"].toUpperCase()}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.RateLimitError=void 0;var o=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),i(n,[{key:"getRateLimitData",value:function(){return{limit:this.limit,remaining:this.remaining,reset:this.reset}}}]),n}(a.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnauthorizedError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&("invalid_request"===n.error||"invalid_grant"===n.error)||401===u&&"invalid_token"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnavailableError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status<=0}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnknownError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body;return n&&"validation_failed"===n.code}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},e=u.authenticate,o=void 0===e||e,i=u.headers,a=void 0===i?{}:i,c=u.method,s=void 0===c?"get":c,d=u.queryParams,p=u.raw,h=u.version,y=void 0===h?this.options.version:h,b=u.body,v=(0,f.buildUrl)(l,this.options.baseUrl,y,d),g=void 0;return b&&("object"===(void 0===b?"undefined":t(b))&&(b=JSON.stringify(b)),a["content-type"]="application/json"),g=o&&!a.authorization?this.getToken().then(function(l){return n.client.request(v,s,b,r({},(0,f.buildBearerAuthorizationHeader)(l.access_token),a),u)}):this.client.request(v,s,b,a,u),g.then(function(l){return p?l:l.body}).catch(this._refreshToken(v,s,b,a,u))}},{key:"authorize",value:function(l){var n=this.oauthClient.buildAccessTokenRequestByAuthorizationCodeGrant(l);return this.tokenRequestPromise=this._authenticationRequest(n),this.tokenRequestPromise}},{key:"getToken",value:function(){var l=this;return this.storage.getItem(this.options.accessTokenKey).then(function(n){return n?l.storage.getItem(l.options.refreshTokenKey).then(function(l){return{access_token:n,refresh_token:l}}).catch(function(){return{access_token:n}}):(l.tokenRequestPromise=null,Promise.reject())}).catch(function(){return l.tokenRequestPromise?l.tokenRequestPromise:Promise.reject(new c.AuthorizationRequiredError)})}},{key:"logout",value:function(){var l=this;return this._revokeToken().catch(function(l){if(!(l instanceof c.UnauthorizedError))return Promise.reject(l)}).then(function(){return l.removeToken()})}},{key:"paginate",value:function(l){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.itemsPerPage,e=arguments[3];return new s.Paginator(this,l,u,e).getPage(n)}},{key:"removeToken",value:function(){return Promise.all([this.storage.removeItem(this.options.accessTokenKey),this.storage.removeItem(this.options.refreshTokenKey)])}},{key:"setToken",value:function(l){var n=this;return this.storage.setItem(this.options.accessTokenKey,l.access_token).then(function(){if(l.refresh_token)return n.storage.setItem(n.options.refreshTokenKey,l.refresh_token)}).then(function(){return l})}},{key:"_authenticationRequest",value:function(l){var n=this,u=l.body,e=l.headers,t=l.url;return this.client.request(t,"post",u,e).then(function(l){var u=l.body;return n.setToken(u)})}},{key:"_refreshToken",value:function(l,n,u,e,t){var o=this;return function(i){return i&&i.body&&"invalid_token"===i.body.error?(o.refreshRequestPromise||(o.refreshRequestPromise=o._requestRefreshToken(i)),o.refreshRequestPromise.then(function(i){return o.client.request(l,n,u,r({},(0,f.buildBearerAuthorizationHeader)(i.access_token),e),t).then(function(l){return l.body})})):Promise.reject(i)}}},{key:"_requestRefreshToken",value:function(l){var n=this;return this.storage.getItem(this.options.refreshTokenKey).catch(function(){return Promise.reject(l)}).then(function(l){var u=n.oauthClient.buildRefreshTokenRequest(l);return n._authenticationRequest(u).then(function(l){return n.refreshRequestPromise=null,l})})}},{key:"_revokeToken",value:function(){var l=this;return this.getToken().then(function(n){var u=l.oauthClient.buildRevokeTokenRequest(n.access_token),e=u.body,t=u.headers,r=u.url;return l.client.request(r,"post",e,t)})}}]),l}();n.default=d;for(var p in a)d.prototype[p]=a[p]},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=u(47),r=function l(){e(this,l),this.defaultHeaders={"user-agent":t.name+"/"+t.version}};n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:1,u=arguments[1];return this.sdk.api(this.uri,(0,c.default)({headers:{range:"items="+(n-1)*this.itemsPerPage+"-"+(n*this.itemsPerPage-1)}},this.options,u,{raw:!0})).then(function(n){var u=n.body,e=n.headers,t=i.default.parse(e["content-range"]),r=t.first,o=t.length;return l.currentPage=o?r/l.itemsPerPage+1:null,l.headers=e,l.items=u,l.itemsCount=o,l.pagesCount=Math.ceil(o/l.itemsPerPage),l})}},{key:"getPreviousPage",value:function(l){return this.hasPreviousPage()?this.getPage(this.currentPage-1,l):Promise.resolve()}},{key:"hasNextPage",value:function(){return!!this.currentPage&&this.currentPage1}}]),l}();n.default=s},function(l,n,u){"use strict";function e(l,n){for(var u=o.default,e=Array.isArray(u),r=0,u=e?u:u[Symbol.iterator]();;){var i;if(e){if(r>=u.length)break;i=u[r++]}else{if(r=u.next(),r.done)break;i=r.value}var a=i;if(a.hasError&&a.hasError(l))return new a(t({},l,{response:n}))}}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===l[n-2]?2:"="===l[n-1]?1:0}function t(l){return 3*l.length/4-e(l)}function r(l){var n,u,t,r,o,i,a=l.length;o=e(l),i=new f(3*a/4-o),t=o>0?a-4:a;var c=0;for(n=0,u=0;n>16&255,i[c++]=r>>8&255,i[c++]=255&r;return 2===o?(r=s[l.charCodeAt(n)]<<2|s[l.charCodeAt(n+1)]>>4,i[c++]=255&r):1===o&&(r=s[l.charCodeAt(n)]<<10|s[l.charCodeAt(n+1)]<<4|s[l.charCodeAt(n+2)]>>2,i[c++]=r>>8&255,i[c++]=255&r),i}function o(l){return c[l>>18&63]+c[l>>12&63]+c[l>>6&63]+c[63&l]}function i(l,n,u){for(var e,t=[],r=n;ra?a:o+16383));return 1===e?(n=l[u-1],t+=c[n>>2],t+=c[n<<4&63],t+="=="):2===e&&(n=(l[u-2]<<8)+l[u-1],t+=c[n>>10],t+=c[n>>4&63],t+=c[n<<2&63],t+="="),r.push(t),r.join("")}n.byteLength=t,n.toByteArray=r,n.fromByteArray=a;for(var c=[],s=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,h=d.length;p|(]*>|]*>|]+>)+/i,r=new RegExp(e.map(function(l){return"<"+l+"\\b[^>]*>"}).join("|"),"i");l.exports=function(l){return!!t.test(l)||r.test(l)}},function(l,n){l.exports=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]},function(l,n,u){l.exports=u(45)},function(l,n){l.exports={name:"@uphold/uphold-sdk-javascript",version:"2.2.1",description:"Uphold SDK for JavasScript",keywords:["api","javascript","sdk","uphold"],license:"MIT",author:"Uphold Inc.",main:"dist/node/index.js",repository:"git@github.com:uphold/uphold-sdk-javascript.git",scripts:{build:"rm -rf dist && yarn build:node && yarn build:browser","build:browser":"yarn && webpack --progress","build:node":"babel src/node -d dist/node && babel src/core -d dist/core",changelog:"github-changelog-generator --owner uphold --repo uphold-sdk-javascript --future-release=v$npm_package_version > CHANGELOG.md",cover:"yarn test -- --coverage",docs:"yarn docs:build && yarn docs:prepare && yarn docs:publish","docs:build":"gitbook install && cd docs && ../node_modules/.bin/gitbook build && cp -R images/* _book/gitbook/images","docs:prepare":"cd docs/_book && git init && git checkout -b gh-pages && git add . && git commit -m 'Update documentation'","docs:publish":"cd docs/_book && git push git@github.com:uphold/uphold-sdk-javascript gh-pages --force && cd .. && rm -rf _book",lint:"eslint --cache src test",release:"npm version $1 -m 'Release %s'",tdd:"yarn test -- --watch",test:"jest --config jest.json",version:"yarn build && yarn changelog && git add -f dist CHANGELOG.md"},browser:"dist/browser/uphold-sdk-javascript.js",dependencies:{"base64-js":"1.2.0","content-range":"1.1.0","lodash.merge":"4.6.0",qs:"6.4.0",request:"2.86.0","request-promise":"4.2.0","standard-error":"1.1.0","text-encoding":"0.6.4"},devDependencies:{"@uphold/github-changelog-generator":"0.4.1","babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-loader":"7.0.0","babel-plugin-istanbul":"4.1.3","babel-plugin-transform-object-rest-spread":"6.23.0","babel-polyfill":"6.23.0","babel-preset-es2015":"6.24.1","babel-preset-es2015-node":"4.0.2",eslint:"3.19.0","eslint-config-seegno":"9.0.0","eslint-plugin-babel":"4.1.1","fetch-mock":"5.10.0","gitbook-cli":"2.3.0","html-tags":"1.1.1","is-html":"1.1.0","isomorphic-fetch":"2.2.1",jest:"19.0.2","json-loader":"0.5.4",nock:"9.0.13","pre-commit":"1.2.2",webpack:"2.5.0"},engines:{node:">=4"},"pre-commit":["lint"]}},function(l,n,u){"use strict";var e=u(50),t=u(49),r=u(7);l.exports={formats:r,parse:t,stringify:e}},function(l,n,u){"use strict";var e=u(8),t=Object.prototype.hasOwnProperty,r={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:e.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(l,n){for(var u={},e=l.split(n.delimiter,n.parameterLimit===1/0?void 0:n.parameterLimit),r=0;r=0&&u.parseArrays&&o<=u.arrayLimit?(e=[],e[o]=i(l,n,u)):e[r]=i(l,n,u)}return e},a=function(l,n,u){if(l){var e=u.allowDots?l.replace(/\.([^.[]+)/g,"[$1]"):l,r=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,a=r.exec(e),c=a?e.slice(0,a.index):e,s=[];if(c){if(!u.plainObjects&&t.call(Object.prototype,c)&&!u.allowPrototypes)return;s.push(c)}for(var f=0;null!==(a=o.exec(e))&&f57343)t.push(r);else if(56320<=r&&r<=57343)t.push(65533);else if(55296<=r&&r<=56319)if(e===u-1)t.push(65533);else{var o=n.charCodeAt(e+1);if(56320<=o&&o<=57343){var i=1023&r,a=1023&o;t.push(65536+(i<<10)+a),e+=1}else t.push(65533)}e+=1}return t}function i(l){for(var n="",u=0;u>10),56320+(1023&e)))}return n}function a(l){return 0<=l&&l<=127}function c(l){this.tokens=[].slice.call(l),this.tokens.reverse()}function s(l,n){if(l)throw TypeError("Decoder error");return n||65533}function f(l){throw TypeError("The code point "+l+" could not be encoded.")}function d(){}function p(){}function h(l){return l=String(l).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Q,l)?Q[l]:null}function y(l,n){return n?n[l]||null:null}function b(l,n){var u=n.indexOf(l);return-1===u?null:u}function v(l){if(!("encoding-indexes"in n))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return n["encoding-indexes"][l]}function g(l){if(l>39419&&l<189e3||l>1237575)return null;if(7457===l)return 59335;var n,u=0,e=0,t=v("gb18030-ranges");for(n=0;n>6*u)+t];u>0;){var o=n>>6*(u-1);r.push(128|63&o),u-=1}return r}}function P(l,n){var u=n.fatal;this.handler=function(n,e){if(e===G)return $;if(a(e))return e;var t=l[e-128];return null===t?s(u):t}}function A(l,n){n.fatal;this.handler=function(n,u){if(u===G)return $;if(V(u))return u;var e=b(u,l);return null===e&&f(u),e+128}}function x(l){var n=l.fatal,u=0,t=0,r=0;this.handler=function(l,o){if(o===G&&0===u&&0===t&&0===r)return $;o!==G||0===u&&0===t&&0===r||(u=0,t=0,r=0,s(n));var i;if(0!==r){i=null,e(o,48,57)&&(i=g(10*(126*(10*(u-129)+t-48)+r-129)+o-48));var c=[t,r,o];return u=0,t=0,r=0,null===i?(l.prepend(c),s(n)):i}if(0!==t)return e(o,129,254)?(r=o,null):(l.prepend([t,o]),u=0,t=0,s(n));if(0!==u){if(e(o,48,57))return t=o,null;var f=u,d=null;u=0;var p=o<127?64:65;return(e(o,64,126)||e(o,128,254))&&(d=190*(f-129)+(o-p)),i=null===d?null:y(d,v("gb18030")),null===i&&a(o)&&l.prepend(o),null===i?s(n):i}return a(o)?o:128===o?8364:e(o,129,254)?(u=o,null):s(n)}}function C(l,n){l.fatal;this.handler=function(l,u){if(u===G)return $;if(V(u))return u;if(58853===u)return f(u);if(n&&8364===u)return 128;var e=b(u,v("gb18030"));if(null!==e){var t=J(e/190)+129,r=e%190;return[t,r+(r<63?64:65)]}if(n)return f(u);e=_(u);var o=J(e/10/126/10);e-=10*o*126*10;var i=J(e/10/126);e-=10*i*126;var a=J(e/10);return[o+129,i+48,a+129,e-10*a+48]}}function T(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:98;switch((e(t,64,126)||e(t,161,254))&&(o=157*(r-129)+(t-i)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=null===o?null:y(o,v("big5"));return null===c&&a(t)&&l.prepend(t),null===c?s(n):c}return a(t)?t:e(t,129,254)?(u=t,null):s(n)}}function S(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;var u=w(n);if(null===u)return f(n);var e=J(u/157)+129;if(e<161)return f(n);var t=u%157;return[e,t+(t<63?64:98)]}}function R(l){var n=l.fatal,u=!1,t=0;this.handler=function(l,r){if(r===G&&0!==t)return t=0,s(n);if(r===G&&0===t)return $;if(142===t&&e(r,161,223))return t=0,65216+r;if(143===t&&e(r,161,254))return u=!0,t=r,null;if(0!==t){var o=t;t=0;var i=null;return e(o,161,254)&&e(r,161,254)&&(i=y(94*(o-161)+(r-161),v(u?"jis0212":"jis0208"))),u=!1,e(r,161,254)||l.prepend(r),null===i?s(n):i}return a(r)?r:142===r||143===r||e(r,161,254)?(t=r,null):s(n)}}function M(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return[142,n-65377+161];8722===n&&(n=65293);var u=b(n,v("jis0208"));return null===u?f(n):[J(u/94)+161,u%94+161]}}function I(l){var n=l.fatal,u={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},t=u.ASCII,r=u.ASCII,o=0,i=!1;this.handler=function(l,a){switch(t){default:case u.ASCII:return 27===a?(t=u.EscapeStart,null):e(a,0,127)&&14!==a&&15!==a&&27!==a?(i=!1,a):a===G?$:(i=!1,s(n));case u.Roman:return 27===a?(t=u.EscapeStart,null):92===a?(i=!1,165):126===a?(i=!1,8254):e(a,0,127)&&14!==a&&15!==a&&27!==a&&92!==a&&126!==a?(i=!1,a):a===G?$:(i=!1,s(n));case u.Katakana:return 27===a?(t=u.EscapeStart,null):e(a,33,95)?(i=!1,65344+a):a===G?$:(i=!1,s(n));case u.LeadByte:return 27===a?(t=u.EscapeStart,null):e(a,33,126)?(i=!1,o=a,t=u.TrailByte,null):a===G?$:(i=!1,s(n));case u.TrailByte:if(27===a)return t=u.EscapeStart,s(n);if(e(a,33,126)){t=u.LeadByte;var c=94*(o-33)+a-33,f=y(c,v("jis0208"));return null===f?s(n):f}return a===G?(t=u.LeadByte,l.prepend(a),s(n)):(t=u.LeadByte,s(n));case u.EscapeStart:return 36===a||40===a?(o=a,t=u.Escape,null):(l.prepend(a),i=!1,t=r,s(n));case u.Escape:var d=o;o=0;var p=null;if(40===d&&66===a&&(p=u.ASCII),40===d&&74===a&&(p=u.Roman),40===d&&73===a&&(p=u.Katakana),36!==d||64!==a&&66!==a||(p=u.LeadByte),null!==p){t=t=p;var h=i;return i=!0,h?s(n):null}return l.prepend([d,a]),i=!1,t=r,s(n)}}}function B(l){var n=(l.fatal,{ASCII:0,Roman:1,jis0208:2}),u=n.ASCII;this.handler=function(l,e){if(e===G&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if(e===G&&u===n.ASCII)return $;if(!(u!==n.ASCII&&u!==n.Roman||14!==e&&15!==e&&27!==e))return f(65533);if(u===n.ASCII&&V(e))return e;if(u===n.Roman&&(V(e)&&92!==e&&126!==e||165==e||8254==e)){if(V(e))return e;if(165===e)return 92;if(8254===e)return 126}if(V(e)&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if((165===e||8254===e)&&u!==n.Roman)return l.prepend(e),u=n.Roman,[27,40,74];8722===e&&(e=65293);var t=b(e,v("jis0208"));return null===t?f(e):u!==n.jis0208?(l.prepend(e),u=n.jis0208,[27,36,66]):[J(t/94)+33,t%94+33]}}function U(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:65,c=r<160?129:193;if((e(t,64,126)||e(t,128,252))&&(o=188*(r-c)+t-i),e(o,8836,10715))return 48508+o;var f=null===o?null:y(o,v("jis0208"));return null===f&&a(t)&&l.prepend(t),null===f?s(n):f}return a(t)||128===t?t:e(t,161,223)?65216+t:e(t,129,159)||e(t,224,252)?(u=t,null):s(n)}}function q(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n)||128===n)return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return n-65377+161;8722===n&&(n=65293);var u=m(n);if(null===u)return f(n);var t=J(u/188),r=t<31?129:193,o=u%188;return[t+r,o+(o<63?64:65)]}}function L(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0,e(t,65,254)&&(o=190*(r-129)+(t-65));var i=null===o?null:y(o,v("euc-kr"));return null===o&&a(t)&&l.prepend(t),null===i?s(n):i}return a(t)?t:e(t,129,254)?(u=t,null):s(n)}}function N(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;var u=b(n,v("euc-kr"));return null===u?f(n):[J(u/190)+129,u%190+65]}}function F(l,n){var u=l>>8,e=255&l;return n?[u,e]:[e,u]}function D(l,n){var u=n.fatal,t=null,r=null;this.handler=function(n,o){if(o===G&&(null!==t||null!==r))return s(u);if(o===G&&null===t&&null===r)return $;if(null===t)return t=o,null;var i;if(i=l?(t<<8)+o:(o<<8)+t,t=null,null!==r){var a=r;return r=null,e(i,56320,57343)?65536+1024*(a-55296)+(i-56320):(n.prepend(F(i,l)),s(u))}return e(i,55296,56319)?(r=i,null):e(i,56320,57343)?s(u):i}}function z(l,n){n.fatal;this.handler=function(n,u){if(u===G)return $;if(e(u,0,65535))return F(u,l);var t=F(55296+(u-65536>>10),l),r=F(56320+(u-65536&1023),l);return t.concat(r)}}function H(l){l.fatal;this.handler=function(l,n){return n===G?$:a(n)?n:63360+n-128}}function K(l){l.fatal;this.handler=function(l,n){return n===G?$:V(n)?n:e(n,63360,63487)?n-63360+128:f(n)}}void 0!==l&&l.exports&&!n["encoding-indexes"]&&(n["encoding-indexes"]=u(53)["encoding-indexes"]);var J=Math.floor,V=a,G=-1;c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():G},prepend:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.push(n.pop());else this.tokens.push(l)},push:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.unshift(n.shift());else this.tokens.unshift(l)}};var $=-1;d.prototype={handler:function(l,n){}},p.prototype={handler:function(l,n){}};var W=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Q={};W.forEach(function(l){l.encodings.forEach(function(l){l.labels.forEach(function(n){Q[n]=l})})});var X,Y,Z={},ll={},nl="utf-8";Object.defineProperty&&(Object.defineProperty(O.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(O.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(O.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),O.prototype.decode=function(l,n){function u(l){return!t(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(l.length>0&&65279===l[0]?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),i(l)}var e;e="object"==typeof l&&l instanceof ArrayBuffer?new Uint8Array(l):"object"==typeof l&&"buffer"in l&&l.buffer instanceof ArrayBuffer?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(0),n=r(n),this._do_not_flush||(this._decoder=ll[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(n.stream);for(var o,a=new c(e),s=[];;){var f=a.read();if(f===G)break;if((o=this._decoder.handler(a,f))===$)break;null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}if(!this._do_not_flush){do{if((o=this._decoder.handler(a,a.read()))===$)break;null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!a.endOfStream());this._decoder=null}return u.call(this,s)},Object.defineProperty&&Object.defineProperty(j.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),j.prototype.encode=function(l,n){l=void 0===l?"":String(l),n=r(n),this._do_not_flush||(this._encoder=Z[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(n.stream);for(var u,e=new c(o(l)),t=[];;){var i=e.read();if(i===G)break;if((u=this._encoder.handler(e,i))===$)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}if(!this._do_not_flush){for(;;){if((u=this._encoder.handler(e,e.read()))===$)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}this._encoder=null}return new Uint8Array(t)},Z["UTF-8"]=function(l){return new E(l)},ll["UTF-8"]=function(l){return new k(l)},function(){"encoding-indexes"in n&&W.forEach(function(l){"Legacy single-byte encodings"===l.heading&&l.encodings.forEach(function(l){var n=l.name,u=v(n.toLowerCase());ll[n]=function(l){return new P(u,l)},Z[n]=function(l){return new A(u,l)}})})}(),ll.GBK=function(l){return new x(l)},Z.GBK=function(l){return new C(l,!0)},Z.gb18030=function(l){return new C(l)},ll.gb18030=function(l){return new x(l)},Z.Big5=function(l){return new S(l)},ll.Big5=function(l){return new T(l)},Z["EUC-JP"]=function(l){return new M(l)},ll["EUC-JP"]=function(l){return new R(l)},Z["ISO-2022-JP"]=function(l){return new B(l)},ll["ISO-2022-JP"]=function(l){return new I(l)},Z.Shift_JIS=function(l){return new q(l)},ll.Shift_JIS=function(l){return new U(l)},Z["EUC-KR"]=function(l){return new N(l)},ll["EUC-KR"]=function(l){return new L(l)},Z["UTF-16BE"]=function(l){return new z(!0,l)},ll["UTF-16BE"]=function(l){return new D(!0,l)},Z["UTF-16LE"]=function(l){return new z(!1,l)},ll["UTF-16LE"]=function(l){return new D(!1,l)},Z["x-user-defined"]=function(l){return new K(l)},ll["x-user-defined"]=function(l){return new H(l)},n.TextEncoder||(n.TextEncoder=j),n.TextDecoder||(n.TextDecoder=O),void 0!==l&&l.exports&&(l.exports={TextEncoder:n.TextEncoder,TextDecoder:n.TextDecoder,EncodingIndexes:n["encoding-indexes"]})}(this||{})},function(l,n){var u;u=function(){return this}();try{u=u||Function("return this")()||(0,eval)("this")}catch(l){"object"==typeof window&&(u=window)}l.exports=u},function(l,n){l.exports=function(l){return l.webpackPolyfill||(l.deprecate=function(){},l.paths=[],l.children||(l.children=[]),Object.defineProperty(l,"loaded",{enumerable:!0,get:function(){return l.l}}),Object.defineProperty(l,"id",{enumerable:!0,get:function(){return l.i}}),l.webpackPolyfill=1),l}}]); \ No newline at end of file +module.exports=function(l){function n(e){if(u[e])return u[e].exports;var t=u[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var u={};return n.m=l,n.c=u,n.i=function(l){return l},n.d=function(l,u,e){n.o(l,u)||Object.defineProperty(l,u,{configurable:!1,enumerable:!0,get:e})},n.n=function(l){var u=l&&l.__esModule?function(){return l.default}:function(){return l};return n.d(u,"a",u),u},n.o=function(l,n){return Object.prototype.hasOwnProperty.call(l,n)},n.p="",n(n.s=10)}([function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.BaseError=void 0;var o=u(51),i=function(l){return l&&l.__esModule?l:{default:l}}(o);n.BaseError=function(l){function n(){return e(this,n),t(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return r(n,l),n}(i.default)},function(l,n,u){(function(l,u){function e(l,n){return l.set(n[0],n[1]),l}function t(l,n){return l.add(n),l}function r(l,n,u){switch(u.length){case 0:return l.call(n);case 1:return l.call(n,u[0]);case 2:return l.call(n,u[0],u[1]);case 3:return l.call(n,u[0],u[1],u[2])}return l.apply(n,u)}function o(l,n){for(var u=-1,e=l?l.length:0;++u-1}function P(l,n){var u=this.__data__,e=z(u,l);return e<0?u.push([l,n]):u[e][1]=n,this}function A(l){var n=-1,u=l?l.length:0;for(this.clear();++n-1&&l%1==0&&l-1&&l%1==0&&l<=Dl}function Sl(l){var n=typeof l;return!!l&&("object"==n||"function"==n)}function Rl(l){return!!l&&"object"==typeof l}function Ml(l){if(!Rl(l)||Un.call(l)!=Wl||f(l))return!1;var n=Dn(l);if(null===n)return!0;var u=In.call(n,"constructor")&&n.constructor;return"function"==typeof u&&u instanceof u&&Mn.call(u)==Bn}function Il(l){return sl(l,Ul(l))}function Bl(l){return Al(l)?N(l):Q(l)}function Ul(l){return Al(l)?N(l,!0):X(l)}function ql(){return[]}function Ll(){return!1}var Nl=200,Fl="__lodash_hash_undefined__",Dl=9007199254740991,zl="[object Arguments]",Hl="[object Boolean]",Kl="[object Date]",Jl="[object Function]",Vl="[object GeneratorFunction]",Gl="[object Map]",$l="[object Number]",Wl="[object Object]",Ql="[object RegExp]",Xl="[object Set]",Yl="[object String]",Zl="[object Symbol]",ln="[object WeakMap]",nn="[object ArrayBuffer]",un="[object DataView]",en="[object Float32Array]",tn="[object Float64Array]",rn="[object Int8Array]",on="[object Int16Array]",an="[object Int32Array]",cn="[object Uint8Array]",sn="[object Uint8ClampedArray]",fn="[object Uint16Array]",dn="[object Uint32Array]",pn=/[\\^$.*+?()[\]{}|]/g,hn=/\w*$/,yn=/^\[object .+?Constructor\]$/,bn=/^(?:0|[1-9]\d*)$/,vn={};vn[en]=vn[tn]=vn[rn]=vn[on]=vn[an]=vn[cn]=vn[sn]=vn[fn]=vn[dn]=!0,vn[zl]=vn["[object Array]"]=vn[nn]=vn[Hl]=vn[un]=vn[Kl]=vn["[object Error]"]=vn[Jl]=vn[Gl]=vn[$l]=vn[Wl]=vn[Ql]=vn[Xl]=vn[Yl]=vn[ln]=!1;var gn={};gn[zl]=gn["[object Array]"]=gn[nn]=gn[un]=gn[Hl]=gn[Kl]=gn[en]=gn[tn]=gn[rn]=gn[on]=gn[an]=gn[Gl]=gn[$l]=gn[Wl]=gn[Ql]=gn[Xl]=gn[Yl]=gn[Zl]=gn[cn]=gn[sn]=gn[fn]=gn[dn]=!0,gn["[object Error]"]=gn[Jl]=gn[ln]=!1;var _n="object"==typeof l&&l&&l.Object===Object&&l,mn="object"==typeof self&&self&&self.Object===Object&&self,wn=_n||mn||Function("return this")(),On="object"==typeof n&&n&&!n.nodeType&&n,jn=On&&"object"==typeof u&&u&&!u.nodeType&&u,kn=jn&&jn.exports===On,En=kn&&_n.process,Pn=function(){try{return En&&En.binding("util")}catch(l){}}(),An=Pn&&Pn.isTypedArray,xn=Array.prototype,Cn=Function.prototype,Tn=Object.prototype,Sn=wn["__core-js_shared__"],Rn=function(){var l=/[^.]+$/.exec(Sn&&Sn.keys&&Sn.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Mn=Cn.toString,In=Tn.hasOwnProperty,Bn=Mn.call(Object),Un=Tn.toString,qn=RegExp("^"+Mn.call(In).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ln=kn?wn.Buffer:void 0,Nn=wn.Symbol,Fn=wn.Uint8Array,Dn=p(Object.getPrototypeOf,Object),zn=Object.create,Hn=Tn.propertyIsEnumerable,Kn=xn.splice,Jn=Object.getOwnPropertySymbols,Vn=Ln?Ln.isBuffer:void 0,Gn=p(Object.keys,Object),$n=Math.max,Wn=hl(wn,"DataView"),Qn=hl(wn,"Map"),Xn=hl(wn,"Promise"),Yn=hl(wn,"Set"),Zn=hl(wn,"WeakMap"),lu=hl(Object,"create"),nu=kl(Wn),uu=kl(Qn),eu=kl(Xn),tu=kl(Yn),ru=kl(Zn),ou=Nn?Nn.prototype:void 0,iu=ou?ou.valueOf:void 0;y.prototype.clear=b,y.prototype.delete=v,y.prototype.get=g,y.prototype.has=_,y.prototype.set=m,w.prototype.clear=O,w.prototype.delete=j,w.prototype.get=k,w.prototype.has=E,w.prototype.set=P,A.prototype.clear=x,A.prototype.delete=C,A.prototype.get=T,A.prototype.has=S,A.prototype.set=R,M.prototype.clear=I,M.prototype.delete=B,M.prototype.get=U,M.prototype.has=q,M.prototype.set=L;var au=Jn?p(Jn,Object):ql,cu=G;(Wn&&cu(new Wn(new ArrayBuffer(1)))!=un||Qn&&cu(new Qn)!=Gl||Xn&&"[object Promise]"!=cu(Xn.resolve())||Yn&&cu(new Yn)!=Xl||Zn&&cu(new Zn)!=ln)&&(cu=function(l){var n=Un.call(l),u=n==Wl?l.constructor:void 0,e=u?kl(u):void 0;if(e)switch(e){case nu:return un;case uu:return Gl;case eu:return"[object Promise]";case tu:return Xl;case ru:return ln}return n});var su=Array.isArray,fu=Vn||Ll,du=An?function(l){return function(n){return l(n)}}(An):W,pu=function(l){return ll(function(n,u){var e=-1,t=u.length,r=t>1?u[t-1]:void 0,o=t>2?u[2]:void 0;for(r=l.length>3&&"function"==typeof r?(t--,r):void 0,o&&_l(u[0],u[1],o)&&(r=t<3?void 0:r,t=1),n=Object(n);++e=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122?u+=n.charAt(e):r<128?u+=t[r]:r<2048?u+=t[192|r>>6]+t[128|63&r]:r<55296||r>=57344?u+=t[224|r>>12]+t[128|r>>6&63]+t[128|63&r]:(e+=1,r=65536+((1023&r)<<10|1023&n.charCodeAt(e)),u+=t[240|r>>18]+t[128|r>>12&63]+t[128|r>>6&63]+t[128|63&r])}return u},n.compact=function(l,u){if("object"!=typeof l||null===l)return l;var e=u||[],t=e.indexOf(l);if(-1!==t)return e[t];if(e.push(l),Array.isArray(l)){for(var r=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:"_token";e(this,l),this.cache={},this.storageName=n}return t(l,[{key:"getItem",value:function(l){if(this.cache[l])return Promise.resolve(this.cache[l]);var n=this._getCookie();return n[l]?(this.cache[l]=n[l],Promise.resolve(n[l])):Promise.reject()}},{key:"removeItem",value:function(l){var n=this._getCookie();return n[l]?(delete this.cache[l],delete n[l],this._setCookie(n),Promise.resolve()):Promise.resolve()}},{key:"setItem",value:function(l,n){var u=this._getCookie();return delete this.cache[l],u[l]=n,this._setCookie(u),Promise.resolve()}},{key:"_getCookie",value:function(){var l=new RegExp("(?:^|; )"+encodeURIComponent(this.storageName)+"=([^;]*)").exec(document.cookie);return l?JSON.parse(decodeURIComponent(l[1])):{}}},{key:"_setCookie",value:function(l){document.cookie=this.storageName+"="+encodeURIComponent(JSON.stringify(l))+";path=/"}}]),l}();n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:"get",u=arguments[2],e=this,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=o({},r,{body:u,cache:"no-cache",credentials:"omit",headers:new Headers(o({},this.defaultHeaders,t)),method:n.toUpperCase(),mode:"cors"});return fetch(l,i).then(function(l){return l.ok?l.text().then(e._parseText).then(function(n){return e._formatResponse(l,n)}):Promise.reject(l)}).catch(function(l){return l.json?l.text().then(e._parseText).then(function(n){return Promise.reject((0,a.createError)(e._formatResponse(l,n),l))}):Promise.reject((0,a.createError)(e._formatResponse({error:l,status:-1}),l))})}},{key:"_formatResponse",value:function(l){return{body:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,headers:this._parseHeaders(l.headers),status:l.status,url:l.url}}},{key:"_parseHeaders",value:function(l){var n={};return l?(l.forEach(function(l,u){n[u]=l}),n):n}},{key:"_parseText",value:function(l){if(!l||(0,s.default)(l))return{};try{return JSON.parse(l)}catch(n){return l}}}]),n}(a.Client);n.default=f},function(l,n,u){"use strict";function e(l,n){return this.api("/me/accounts/"+l,n)}function t(l){return this.api("/me/accounts",l)}Object.defineProperty(n,"__esModule",{value:!0}),n.getAccount=e,n.getAccounts=t},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/addresses",(0,o.default)({body:{network:n},method:"post"},u))}function t(l,n){return this.api("/me/cards/"+l+"/addresses",n)}Object.defineProperty(n,"__esModule",{value:!0}),n.createCardAddress=e,n.getCardAddresses=t;var r=u(1),o=function(l){return l&&l.__esModule?l:{default:l}}(r)},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/cancel",a({method:"post"},u))}function t(l,n,u,e,t){var r=u.message,o=u.securityCode;return t=(0,s.default)({body:{message:r,securityCode:o},method:"post"},t),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions/"+n+"/commit",t)}function r(l,n,u,e,t){var r=n.amount,o=n.currency,i=n.destination,c=n.origin,f=n.message,d=n.securityCode;return t=(0,s.default)({body:{denomination:{amount:r,currency:o},destination:i,message:f,origin:c,securityCode:d},method:"post"},t),u&&(t.queryParams=a({commit:!0},t.queryParams)),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions",t)}function o(l,n,u,e){return this.paginate("/me/cards/"+l+"/transactions",n,u,e)}function i(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/resend",a({method:"post"},u))}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InternalServerError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InvalidScopeError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&"invalid_scope"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.NotFoundError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.OTPRequiredError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.headers;return!(!n||!n["otp-token"])&&"REQUIRED"===n["otp-token"].toUpperCase()}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.RateLimitError=void 0;var o=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),i(n,[{key:"getRateLimitData",value:function(){return{limit:this.limit,remaining:this.remaining,reset:this.reset}}}]),n}(a.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnauthorizedError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&("invalid_request"===n.error||"invalid_grant"===n.error)||401===u&&"invalid_token"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnavailableError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status<=0}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnknownError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body;return n&&"validation_failed"===n.code}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},e=u.authenticate,o=void 0===e||e,i=u.headers,a=void 0===i?{}:i,c=u.method,s=void 0===c?"get":c,d=u.queryParams,p=u.raw,h=u.version,y=void 0===h?this.options.version:h,b=u.body,v=(0,f.buildUrl)(l,this.options.baseUrl,y,d),g=void 0;return b&&("object"===(void 0===b?"undefined":t(b))&&(b=JSON.stringify(b)),a["content-type"]="application/json"),g=o&&!a.authorization?this.getToken().then(function(l){return n.client.request(v,s,b,r({},(0,f.buildBearerAuthorizationHeader)(l.access_token),a),u)}):this.client.request(v,s,b,a,u),g.then(function(l){return p?l:l.body}).catch(this._refreshToken(v,s,b,a,u))}},{key:"authorize",value:function(l){var n=this.oauthClient.buildAccessTokenRequestByAuthorizationCodeGrant(l);return this.tokenRequestPromise=this._authenticationRequest(n),this.tokenRequestPromise}},{key:"getToken",value:function(){var l=this;return this.storage.getItem(this.options.accessTokenKey).then(function(n){return n?l.storage.getItem(l.options.refreshTokenKey).then(function(l){return{access_token:n,refresh_token:l}}).catch(function(){return{access_token:n}}):(l.tokenRequestPromise=null,Promise.reject())}).catch(function(){return l.tokenRequestPromise?l.tokenRequestPromise:Promise.reject(new c.AuthorizationRequiredError)})}},{key:"logout",value:function(){var l=this;return this._revokeToken().catch(function(l){if(!(l instanceof c.UnauthorizedError))return Promise.reject(l)}).then(function(){return l.removeToken()})}},{key:"paginate",value:function(l){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.itemsPerPage,e=arguments[3];return new s.Paginator(this,l,u,e).getPage(n)}},{key:"removeToken",value:function(){return Promise.all([this.storage.removeItem(this.options.accessTokenKey),this.storage.removeItem(this.options.refreshTokenKey)])}},{key:"setToken",value:function(l){var n=this;return this.storage.setItem(this.options.accessTokenKey,l.access_token).then(function(){if(l.refresh_token)return n.storage.setItem(n.options.refreshTokenKey,l.refresh_token)}).then(function(){return l})}},{key:"_authenticationRequest",value:function(l){var n=this,u=l.body,e=l.headers,t=l.url;return this.client.request(t,"post",u,e).then(function(l){var u=l.body;return n.setToken(u)})}},{key:"_refreshToken",value:function(l,n,u,e,t){var o=this;return function(i){return i&&i.body&&"invalid_token"===i.body.error?(o.refreshRequestPromise||(o.refreshRequestPromise=o._requestRefreshToken(i)),o.refreshRequestPromise.then(function(i){return o.client.request(l,n,u,r({},(0,f.buildBearerAuthorizationHeader)(i.access_token),e),t).then(function(l){return l.body})})):Promise.reject(i)}}},{key:"_requestRefreshToken",value:function(l){var n=this;return this.storage.getItem(this.options.refreshTokenKey).catch(function(){return Promise.reject(l)}).then(function(l){var u=n.oauthClient.buildRefreshTokenRequest(l);return n._authenticationRequest(u).then(function(l){return n.refreshRequestPromise=null,l})})}},{key:"_revokeToken",value:function(){var l=this;return this.getToken().then(function(n){var u=l.oauthClient.buildRevokeTokenRequest(n.access_token),e=u.body,t=u.headers,r=u.url;return l.client.request(r,"post",e,t)})}}]),l}();n.default=d;for(var p in a)d.prototype[p]=a[p]},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=u(47),r=function l(){e(this,l),this.defaultHeaders={"user-agent":t.name+"/"+t.version}};n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:1,u=arguments[1];return this.sdk.api(this.uri,(0,c.default)({headers:{range:"items="+(n-1)*this.itemsPerPage+"-"+(n*this.itemsPerPage-1)}},this.options,u,{raw:!0})).then(function(n){var u=n.body,e=n.headers,t=i.default.parse(e["content-range"]),r=t.first,o=t.length;return l.currentPage=o?r/l.itemsPerPage+1:null,l.headers=e,l.items=u,l.itemsCount=o,l.pagesCount=Math.ceil(o/l.itemsPerPage),l})}},{key:"getPreviousPage",value:function(l){return this.hasPreviousPage()?this.getPage(this.currentPage-1,l):Promise.resolve()}},{key:"hasNextPage",value:function(){return!!this.currentPage&&this.currentPage1}}]),l}();n.default=s},function(l,n,u){"use strict";function e(l,n){for(var u=o.default,e=Array.isArray(u),r=0,u=e?u:u[Symbol.iterator]();;){var i;if(e){if(r>=u.length)break;i=u[r++]}else{if(r=u.next(),r.done)break;i=r.value}var a=i;if(a.hasError&&a.hasError(l))return new a(t({},l,{response:n}))}}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===l[n-2]?2:"="===l[n-1]?1:0}function t(l){return 3*l.length/4-e(l)}function r(l){var n,u,t,r,o,i,a=l.length;o=e(l),i=new f(3*a/4-o),t=o>0?a-4:a;var c=0;for(n=0,u=0;n>16&255,i[c++]=r>>8&255,i[c++]=255&r;return 2===o?(r=s[l.charCodeAt(n)]<<2|s[l.charCodeAt(n+1)]>>4,i[c++]=255&r):1===o&&(r=s[l.charCodeAt(n)]<<10|s[l.charCodeAt(n+1)]<<4|s[l.charCodeAt(n+2)]>>2,i[c++]=r>>8&255,i[c++]=255&r),i}function o(l){return c[l>>18&63]+c[l>>12&63]+c[l>>6&63]+c[63&l]}function i(l,n,u){for(var e,t=[],r=n;ra?a:o+16383));return 1===e?(n=l[u-1],t+=c[n>>2],t+=c[n<<4&63],t+="=="):2===e&&(n=(l[u-2]<<8)+l[u-1],t+=c[n>>10],t+=c[n>>4&63],t+=c[n<<2&63],t+="="),r.push(t),r.join("")}n.byteLength=t,n.toByteArray=r,n.fromByteArray=a;for(var c=[],s=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,h=d.length;p|(]*>|]*>|]+>)+/i,r=new RegExp(e.map(function(l){return"<"+l+"\\b[^>]*>"}).join("|"),"i");l.exports=function(l){return!!t.test(l)||r.test(l)}},function(l,n){l.exports=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]},function(l,n,u){l.exports=u(45)},function(l,n){l.exports={name:"@uphold/uphold-sdk-javascript",version:"2.3.0",description:"Uphold SDK for JavasScript",keywords:["api","javascript","sdk","uphold"],license:"MIT",author:"Uphold Inc.",main:"dist/node/index.js",repository:"git@github.com:uphold/uphold-sdk-javascript.git",scripts:{build:"rm -rf dist && yarn build:node && yarn build:browser","build:browser":"yarn && webpack --progress","build:node":"babel src/node -d dist/node && babel src/core -d dist/core",changelog:"github-changelog-generator --owner uphold --repo uphold-sdk-javascript --future-release=v$npm_package_version > CHANGELOG.md",cover:"yarn test -- --coverage",docs:"yarn docs:build && yarn docs:prepare && yarn docs:publish","docs:build":"gitbook install && cd docs && ../node_modules/.bin/gitbook build && cp -R images/* _book/gitbook/images","docs:prepare":"cd docs/_book && git init && git checkout -b gh-pages && git add . && git commit -m 'Update documentation'","docs:publish":"cd docs/_book && git push git@github.com:uphold/uphold-sdk-javascript gh-pages --force && cd .. && rm -rf _book",lint:"eslint --cache src test",release:"npm version $1 -m 'Release %s'",tdd:"yarn test -- --watch",test:"jest --config jest.json",version:"yarn build && yarn changelog && git add -f dist CHANGELOG.md"},browser:"dist/browser/uphold-sdk-javascript.js",dependencies:{"base64-js":"1.2.0","content-range":"1.1.0","lodash.merge":"4.6.0",qs:"6.4.0",request:"2.86.0","request-promise":"4.2.0","standard-error":"1.1.0","text-encoding":"0.6.4"},devDependencies:{"@uphold/github-changelog-generator":"0.4.1","babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-loader":"7.0.0","babel-plugin-istanbul":"4.1.3","babel-plugin-transform-object-rest-spread":"6.23.0","babel-polyfill":"6.23.0","babel-preset-es2015":"6.24.1","babel-preset-es2015-node":"4.0.2",eslint:"3.19.0","eslint-config-seegno":"9.0.0","eslint-plugin-babel":"4.1.1","fetch-mock":"5.10.0","gitbook-cli":"2.3.0","html-tags":"1.1.1","is-html":"1.1.0","isomorphic-fetch":"2.2.1",jest:"19.0.2","json-loader":"0.5.4",nock:"9.0.13","pre-commit":"1.2.2",webpack:"2.5.0"},engines:{node:">=4"},"pre-commit":["lint"]}},function(l,n,u){"use strict";var e=u(50),t=u(49),r=u(7);l.exports={formats:r,parse:t,stringify:e}},function(l,n,u){"use strict";var e=u(8),t=Object.prototype.hasOwnProperty,r={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:e.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(l,n){for(var u={},e=l.split(n.delimiter,n.parameterLimit===1/0?void 0:n.parameterLimit),r=0;r=0&&u.parseArrays&&o<=u.arrayLimit?(e=[],e[o]=i(l,n,u)):e[r]=i(l,n,u)}return e},a=function(l,n,u){if(l){var e=u.allowDots?l.replace(/\.([^.[]+)/g,"[$1]"):l,r=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,a=r.exec(e),c=a?e.slice(0,a.index):e,s=[];if(c){if(!u.plainObjects&&t.call(Object.prototype,c)&&!u.allowPrototypes)return;s.push(c)}for(var f=0;null!==(a=o.exec(e))&&f57343)t.push(r);else if(56320<=r&&r<=57343)t.push(65533);else if(55296<=r&&r<=56319)if(e===u-1)t.push(65533);else{var o=n.charCodeAt(e+1);if(56320<=o&&o<=57343){var i=1023&r,a=1023&o;t.push(65536+(i<<10)+a),e+=1}else t.push(65533)}e+=1}return t}function i(l){for(var n="",u=0;u>10),56320+(1023&e)))}return n}function a(l){return 0<=l&&l<=127}function c(l){this.tokens=[].slice.call(l),this.tokens.reverse()}function s(l,n){if(l)throw TypeError("Decoder error");return n||65533}function f(l){throw TypeError("The code point "+l+" could not be encoded.")}function d(){}function p(){}function h(l){return l=String(l).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Q,l)?Q[l]:null}function y(l,n){return n?n[l]||null:null}function b(l,n){var u=n.indexOf(l);return-1===u?null:u}function v(l){if(!("encoding-indexes"in n))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return n["encoding-indexes"][l]}function g(l){if(l>39419&&l<189e3||l>1237575)return null;if(7457===l)return 59335;var n,u=0,e=0,t=v("gb18030-ranges");for(n=0;n>6*u)+t];u>0;){var o=n>>6*(u-1);r.push(128|63&o),u-=1}return r}}function P(l,n){var u=n.fatal;this.handler=function(n,e){if(e===G)return $;if(a(e))return e;var t=l[e-128];return null===t?s(u):t}}function A(l,n){n.fatal;this.handler=function(n,u){if(u===G)return $;if(V(u))return u;var e=b(u,l);return null===e&&f(u),e+128}}function x(l){var n=l.fatal,u=0,t=0,r=0;this.handler=function(l,o){if(o===G&&0===u&&0===t&&0===r)return $;o!==G||0===u&&0===t&&0===r||(u=0,t=0,r=0,s(n));var i;if(0!==r){i=null,e(o,48,57)&&(i=g(10*(126*(10*(u-129)+t-48)+r-129)+o-48));var c=[t,r,o];return u=0,t=0,r=0,null===i?(l.prepend(c),s(n)):i}if(0!==t)return e(o,129,254)?(r=o,null):(l.prepend([t,o]),u=0,t=0,s(n));if(0!==u){if(e(o,48,57))return t=o,null;var f=u,d=null;u=0;var p=o<127?64:65;return(e(o,64,126)||e(o,128,254))&&(d=190*(f-129)+(o-p)),i=null===d?null:y(d,v("gb18030")),null===i&&a(o)&&l.prepend(o),null===i?s(n):i}return a(o)?o:128===o?8364:e(o,129,254)?(u=o,null):s(n)}}function C(l,n){l.fatal;this.handler=function(l,u){if(u===G)return $;if(V(u))return u;if(58853===u)return f(u);if(n&&8364===u)return 128;var e=b(u,v("gb18030"));if(null!==e){var t=J(e/190)+129,r=e%190;return[t,r+(r<63?64:65)]}if(n)return f(u);e=_(u);var o=J(e/10/126/10);e-=10*o*126*10;var i=J(e/10/126);e-=10*i*126;var a=J(e/10);return[o+129,i+48,a+129,e-10*a+48]}}function T(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:98;switch((e(t,64,126)||e(t,161,254))&&(o=157*(r-129)+(t-i)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=null===o?null:y(o,v("big5"));return null===c&&a(t)&&l.prepend(t),null===c?s(n):c}return a(t)?t:e(t,129,254)?(u=t,null):s(n)}}function S(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;var u=w(n);if(null===u)return f(n);var e=J(u/157)+129;if(e<161)return f(n);var t=u%157;return[e,t+(t<63?64:98)]}}function R(l){var n=l.fatal,u=!1,t=0;this.handler=function(l,r){if(r===G&&0!==t)return t=0,s(n);if(r===G&&0===t)return $;if(142===t&&e(r,161,223))return t=0,65216+r;if(143===t&&e(r,161,254))return u=!0,t=r,null;if(0!==t){var o=t;t=0;var i=null;return e(o,161,254)&&e(r,161,254)&&(i=y(94*(o-161)+(r-161),v(u?"jis0212":"jis0208"))),u=!1,e(r,161,254)||l.prepend(r),null===i?s(n):i}return a(r)?r:142===r||143===r||e(r,161,254)?(t=r,null):s(n)}}function M(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return[142,n-65377+161];8722===n&&(n=65293);var u=b(n,v("jis0208"));return null===u?f(n):[J(u/94)+161,u%94+161]}}function I(l){var n=l.fatal,u={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},t=u.ASCII,r=u.ASCII,o=0,i=!1;this.handler=function(l,a){switch(t){default:case u.ASCII:return 27===a?(t=u.EscapeStart,null):e(a,0,127)&&14!==a&&15!==a&&27!==a?(i=!1,a):a===G?$:(i=!1,s(n));case u.Roman:return 27===a?(t=u.EscapeStart,null):92===a?(i=!1,165):126===a?(i=!1,8254):e(a,0,127)&&14!==a&&15!==a&&27!==a&&92!==a&&126!==a?(i=!1,a):a===G?$:(i=!1,s(n));case u.Katakana:return 27===a?(t=u.EscapeStart,null):e(a,33,95)?(i=!1,65344+a):a===G?$:(i=!1,s(n));case u.LeadByte:return 27===a?(t=u.EscapeStart,null):e(a,33,126)?(i=!1,o=a,t=u.TrailByte,null):a===G?$:(i=!1,s(n));case u.TrailByte:if(27===a)return t=u.EscapeStart,s(n);if(e(a,33,126)){t=u.LeadByte;var c=94*(o-33)+a-33,f=y(c,v("jis0208"));return null===f?s(n):f}return a===G?(t=u.LeadByte,l.prepend(a),s(n)):(t=u.LeadByte,s(n));case u.EscapeStart:return 36===a||40===a?(o=a,t=u.Escape,null):(l.prepend(a),i=!1,t=r,s(n));case u.Escape:var d=o;o=0;var p=null;if(40===d&&66===a&&(p=u.ASCII),40===d&&74===a&&(p=u.Roman),40===d&&73===a&&(p=u.Katakana),36!==d||64!==a&&66!==a||(p=u.LeadByte),null!==p){t=t=p;var h=i;return i=!0,h?s(n):null}return l.prepend([d,a]),i=!1,t=r,s(n)}}}function B(l){var n=(l.fatal,{ASCII:0,Roman:1,jis0208:2}),u=n.ASCII;this.handler=function(l,e){if(e===G&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if(e===G&&u===n.ASCII)return $;if(!(u!==n.ASCII&&u!==n.Roman||14!==e&&15!==e&&27!==e))return f(65533);if(u===n.ASCII&&V(e))return e;if(u===n.Roman&&(V(e)&&92!==e&&126!==e||165==e||8254==e)){if(V(e))return e;if(165===e)return 92;if(8254===e)return 126}if(V(e)&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if((165===e||8254===e)&&u!==n.Roman)return l.prepend(e),u=n.Roman,[27,40,74];8722===e&&(e=65293);var t=b(e,v("jis0208"));return null===t?f(e):u!==n.jis0208?(l.prepend(e),u=n.jis0208,[27,36,66]):[J(t/94)+33,t%94+33]}}function U(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:65,c=r<160?129:193;if((e(t,64,126)||e(t,128,252))&&(o=188*(r-c)+t-i),e(o,8836,10715))return 48508+o;var f=null===o?null:y(o,v("jis0208"));return null===f&&a(t)&&l.prepend(t),null===f?s(n):f}return a(t)||128===t?t:e(t,161,223)?65216+t:e(t,129,159)||e(t,224,252)?(u=t,null):s(n)}}function q(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n)||128===n)return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return n-65377+161;8722===n&&(n=65293);var u=m(n);if(null===u)return f(n);var t=J(u/188),r=t<31?129:193,o=u%188;return[t+r,o+(o<63?64:65)]}}function L(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0,e(t,65,254)&&(o=190*(r-129)+(t-65));var i=null===o?null:y(o,v("euc-kr"));return null===o&&a(t)&&l.prepend(t),null===i?s(n):i}return a(t)?t:e(t,129,254)?(u=t,null):s(n)}}function N(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;var u=b(n,v("euc-kr"));return null===u?f(n):[J(u/190)+129,u%190+65]}}function F(l,n){var u=l>>8,e=255&l;return n?[u,e]:[e,u]}function D(l,n){var u=n.fatal,t=null,r=null;this.handler=function(n,o){if(o===G&&(null!==t||null!==r))return s(u);if(o===G&&null===t&&null===r)return $;if(null===t)return t=o,null;var i;if(i=l?(t<<8)+o:(o<<8)+t,t=null,null!==r){var a=r;return r=null,e(i,56320,57343)?65536+1024*(a-55296)+(i-56320):(n.prepend(F(i,l)),s(u))}return e(i,55296,56319)?(r=i,null):e(i,56320,57343)?s(u):i}}function z(l,n){n.fatal;this.handler=function(n,u){if(u===G)return $;if(e(u,0,65535))return F(u,l);var t=F(55296+(u-65536>>10),l),r=F(56320+(u-65536&1023),l);return t.concat(r)}}function H(l){l.fatal;this.handler=function(l,n){return n===G?$:a(n)?n:63360+n-128}}function K(l){l.fatal;this.handler=function(l,n){return n===G?$:V(n)?n:e(n,63360,63487)?n-63360+128:f(n)}}void 0!==l&&l.exports&&!n["encoding-indexes"]&&(n["encoding-indexes"]=u(53)["encoding-indexes"]);var J=Math.floor,V=a,G=-1;c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():G},prepend:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.push(n.pop());else this.tokens.push(l)},push:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.unshift(n.shift());else this.tokens.unshift(l)}};var $=-1;d.prototype={handler:function(l,n){}},p.prototype={handler:function(l,n){}};var W=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Q={};W.forEach(function(l){l.encodings.forEach(function(l){l.labels.forEach(function(n){Q[n]=l})})});var X,Y,Z={},ll={},nl="utf-8";Object.defineProperty&&(Object.defineProperty(O.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(O.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(O.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),O.prototype.decode=function(l,n){function u(l){return!t(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(l.length>0&&65279===l[0]?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),i(l)}var e;e="object"==typeof l&&l instanceof ArrayBuffer?new Uint8Array(l):"object"==typeof l&&"buffer"in l&&l.buffer instanceof ArrayBuffer?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(0),n=r(n),this._do_not_flush||(this._decoder=ll[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(n.stream);for(var o,a=new c(e),s=[];;){var f=a.read();if(f===G)break;if((o=this._decoder.handler(a,f))===$)break;null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}if(!this._do_not_flush){do{if((o=this._decoder.handler(a,a.read()))===$)break;null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!a.endOfStream());this._decoder=null}return u.call(this,s)},Object.defineProperty&&Object.defineProperty(j.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),j.prototype.encode=function(l,n){l=void 0===l?"":String(l),n=r(n),this._do_not_flush||(this._encoder=Z[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(n.stream);for(var u,e=new c(o(l)),t=[];;){var i=e.read();if(i===G)break;if((u=this._encoder.handler(e,i))===$)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}if(!this._do_not_flush){for(;;){if((u=this._encoder.handler(e,e.read()))===$)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}this._encoder=null}return new Uint8Array(t)},Z["UTF-8"]=function(l){return new E(l)},ll["UTF-8"]=function(l){return new k(l)},function(){"encoding-indexes"in n&&W.forEach(function(l){"Legacy single-byte encodings"===l.heading&&l.encodings.forEach(function(l){var n=l.name,u=v(n.toLowerCase());ll[n]=function(l){return new P(u,l)},Z[n]=function(l){return new A(u,l)}})})}(),ll.GBK=function(l){return new x(l)},Z.GBK=function(l){return new C(l,!0)},Z.gb18030=function(l){return new C(l)},ll.gb18030=function(l){return new x(l)},Z.Big5=function(l){return new S(l)},ll.Big5=function(l){return new T(l)},Z["EUC-JP"]=function(l){return new M(l)},ll["EUC-JP"]=function(l){return new R(l)},Z["ISO-2022-JP"]=function(l){return new B(l)},ll["ISO-2022-JP"]=function(l){return new I(l)},Z.Shift_JIS=function(l){return new q(l)},ll.Shift_JIS=function(l){return new U(l)},Z["EUC-KR"]=function(l){return new N(l)},ll["EUC-KR"]=function(l){return new L(l)},Z["UTF-16BE"]=function(l){return new z(!0,l)},ll["UTF-16BE"]=function(l){return new D(!0,l)},Z["UTF-16LE"]=function(l){return new z(!1,l)},ll["UTF-16LE"]=function(l){return new D(!1,l)},Z["x-user-defined"]=function(l){return new K(l)},ll["x-user-defined"]=function(l){return new H(l)},n.TextEncoder||(n.TextEncoder=j),n.TextDecoder||(n.TextDecoder=O),void 0!==l&&l.exports&&(l.exports={TextEncoder:n.TextEncoder,TextDecoder:n.TextDecoder,EncodingIndexes:n["encoding-indexes"]})}(this||{})},function(l,n){var u;u=function(){return this}();try{u=u||Function("return this")()||(0,eval)("this")}catch(l){"object"==typeof window&&(u=window)}l.exports=u},function(l,n){l.exports=function(l){return l.webpackPolyfill||(l.deprecate=function(){},l.paths=[],l.children||(l.children=[]),Object.defineProperty(l,"loaded",{enumerable:!0,get:function(){return l.l}}),Object.defineProperty(l,"id",{enumerable:!0,get:function(){return l.i}}),l.webpackPolyfill=1),l}}]); \ No newline at end of file diff --git a/dist/core/actions/card-transaction.js b/dist/core/actions/card-transaction.js index 855ec27..2ec7d28 100644 --- a/dist/core/actions/card-transaction.js +++ b/dist/core/actions/card-transaction.js @@ -51,6 +51,7 @@ function createCardTransaction(cardId, _ref2, commit, otp, options) { let amount = _ref2.amount, currency = _ref2.currency, destination = _ref2.destination, + origin = _ref2.origin, message = _ref2.message, securityCode = _ref2.securityCode; @@ -62,6 +63,7 @@ function createCardTransaction(cardId, _ref2, commit, otp, options) { }, destination: destination, message: message, + origin: origin, securityCode: securityCode }, method: 'post' diff --git a/package.json b/package.json index ea781ff..8d4d0f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uphold/uphold-sdk-javascript", - "version": "2.2.1", + "version": "2.3.0", "description": "Uphold SDK for JavasScript", "keywords": [ "api",