Comparing version 2.1.1 to 2.1.2
@@ -1,1 +0,1 @@ | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var _partial=_interopDefault(require("ramda/src/partial")),_curry=_interopDefault(require("ramda/src/curry")),_pipeP=_interopDefault(require("ramda/src/pipeP")),_keys=_interopDefault(require("ramda/src/keys")),_forEach=_interopDefault(require("ramda/src/forEach")),_dissoc=_interopDefault(require("ramda/src/dissoc")),_merge=_interopDefault(require("ramda/src/merge")),_prop=_interopDefault(require("ramda/src/prop")),_always=_interopDefault(require("ramda/src/always")),_ifElse=_interopDefault(require("ramda/src/ifElse")),_contains=_interopDefault(require("ramda/src/contains")),_gte=_interopDefault(require("ramda/src/gte")),_curryN=_interopDefault(require("ramda/src/curryN")),_T=_interopDefault(require("ramda/src/T")),_is=_interopDefault(require("ramda/src/is")),_identity=_interopDefault(require("ramda/src/identity")),_isNil=_interopDefault(require("ramda/src/isNil")),_cond=_interopDefault(require("ramda/src/cond")),axios=_interopDefault(require("axios")),__assign=function(){return(__assign=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},__awaiter=function(e,r,t,n){return new(t||(t=Promise))(function(a,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function o(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?a(e.value):new t(function(r){r(e.value)}).then(s,o)}u((n=n.apply(e,r||[])).next())})},__generator=function(e,r){var t,n,a,i,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(i){return function(o){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){s.label=i[1];break}if(6===i[0]&&s.label<a[1]){s.label=a[1],a=i;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(i);break}a[2]&&s.ops.pop(),s.trys.pop();continue}i=r.call(e,s)}catch(e){i=[6,e],n=0}finally{t=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,o])}}},_this=void 0,toNumber=_cond([[_isNil,_identity],[_is(Number),_identity],[_T,function(e){return Number(e)}]]),isWithin=_curryN(3,function(e,r,t){var n=_is(Number);return n(e)&&n(r)&&n(t)&&_gte(t,e)&&_gte(r,t)}),containsText=_curryN(2,function(e,r){return _contains(r,e)}),isPromise=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},DEFAULT_HEADERS={Accept:"application/json","Content-Type":"application/json"},DEFAULT_CONFIG={timeout:0},NONE=null,CLIENT_ERROR="CLIENT_ERROR",SERVER_ERROR="SERVER_ERROR",TIMEOUT_ERROR="TIMEOUT_ERROR",CONNECTION_ERROR="CONNECTION_ERROR",NETWORK_ERROR="NETWORK_ERROR",UNKNOWN_ERROR="UNKNOWN_ERROR",CANCEL_ERROR="CANCEL_ERROR",TIMEOUT_ERROR_CODES=["ECONNABORTED"],NODEJS_CONNECTION_ERROR_CODES=["ENOTFOUND","ECONNREFUSED","ECONNRESET"],in200s=isWithin(200,299),in400s=isWithin(400,499),in500s=isWithin(500,599),statusNil=_ifElse(_isNil,_always(void 0),_prop("status")),getProblemFromError=function(e){return"Network Error"===e.message?NETWORK_ERROR:axios.isCancel(e)?CANCEL_ERROR:_cond([[_isNil,function(){return getProblemFromStatus(statusNil(e.response))}],[containsText(TIMEOUT_ERROR_CODES),_always(TIMEOUT_ERROR)],[containsText(NODEJS_CONNECTION_ERROR_CODES),_always(CONNECTION_ERROR)],[_T,_always(UNKNOWN_ERROR)]])(e.code)},getProblemFromStatus=function(e){return _cond([[_isNil,_always(UNKNOWN_ERROR)],[in200s,_always(NONE)],[in400s,_always(CLIENT_ERROR)],[in500s,_always(SERVER_ERROR)],[_T,_always(UNKNOWN_ERROR)]])(e)},create=function(e){var r,t=_merge(DEFAULT_HEADERS,e.headers||{});if(e.axiosInstance)r=e.axiosInstance;else{var n=_merge(DEFAULT_CONFIG,_dissoc("headers",e));r=axios.create(n)}var a=[],i=[],s=[],o=[],u=[],R=function(e,n){return t[e]=n,r},c=function(e,r,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),l(_merge({url:r,params:t,method:e},n))},_=function(e,r,t,n){return void 0===t&&(t=null),void 0===n&&(n={}),l(_merge({url:r,method:e,data:t},n))},l=function(e){return __awaiter(_this,void 0,void 0,function(){var n,a,o;return __generator(this,function(u){switch(u.label){case 0:if(e.headers=__assign({},t,e.headers),i.length>0&&_forEach(function(r){return r(e)},i),!(s.length>0))return[3,6];n=0,u.label=1;case 1:return n<s.length?(a=s[n](e),isPromise(a)?[4,a]:[3,3]):[3,6];case 2:return u.sent(),[3,5];case 3:return[4,a(e)];case 4:u.sent(),u.label=5;case 5:return n++,[3,1];case 6:return o=_pipeP(O(toNumber(new Date)),E),[2,r.request(e).then(o).catch(o)]}})})},E=function(e){return a.forEach(function(r){try{r(e)}catch(e){}}),e},O=_curry(function(e,r){return __awaiter(_this,void 0,void 0,function(){var t,n,a,i,s,R,c,_,l,E,O,f,N,p,d,T;return __generator(this,function(m){switch(m.label){case 0:if(t=toNumber(new Date),n=t-e,a=r instanceof Error||axios.isCancel(r),i=r,s=r,R=a?s.response:i,c=R&&R.status||null,_=a?getProblemFromError(r):getProblemFromStatus(c),l=a?s:null,E=in200s(c),O=r.config||null,f=R&&R.headers||null,N=R&&R.data||null,p={duration:n,problem:_,originalError:l,ok:E,status:c,headers:f,config:O,data:N},o.length>0&&_forEach(function(e){return e(p)},o),!(u.length>0))return[3,6];d=0,m.label=1;case 1:return d<u.length?(T=u[d](p),isPromise(T)?[4,T]:[3,3]):[3,6];case 2:return m.sent(),[3,5];case 3:return[4,T(p)];case 4:m.sent(),m.label=5;case 5:return d++,[3,1];case 6:return[2,p]}})})});return{axiosInstance:r,monitors:a,addMonitor:function(e){a.push(e)},requestTransforms:i,asyncRequestTransforms:s,responseTransforms:o,asyncResponseTransforms:u,addRequestTransform:function(e){return i.push(e)},addAsyncRequestTransform:function(e){return s.push(e)},addResponseTransform:function(e){return o.push(e)},addAsyncResponseTransform:function(e){return u.push(e)},setHeader:R,setHeaders:function(e){return _forEach(function(r){return R(r,e[r])},_keys(e)),r},deleteHeader:function(e){return delete t[e],r},headers:t,setBaseURL:function(e){return r.defaults.baseURL=e,r},getBaseURL:function(){return r.defaults.baseURL},any:l,get:_partial(c,["get"]),delete:_partial(c,["delete"]),head:_partial(c,["head"]),post:_partial(_,["post"]),put:_partial(_,["put"]),patch:_partial(_,["patch"]),link:_partial(c,["link"]),unlink:_partial(c,["unlink"])}},isCancel=axios.isCancel,CancelToken=axios.CancelToken,apisauce={DEFAULT_HEADERS:DEFAULT_HEADERS,NONE:NONE,CLIENT_ERROR:CLIENT_ERROR,SERVER_ERROR:SERVER_ERROR,TIMEOUT_ERROR:TIMEOUT_ERROR,CONNECTION_ERROR:CONNECTION_ERROR,NETWORK_ERROR:NETWORK_ERROR,UNKNOWN_ERROR:UNKNOWN_ERROR,create:create,isCancel:isCancel,CancelToken:CancelToken};exports.DEFAULT_HEADERS=DEFAULT_HEADERS,exports.NONE=NONE,exports.CLIENT_ERROR=CLIENT_ERROR,exports.SERVER_ERROR=SERVER_ERROR,exports.TIMEOUT_ERROR=TIMEOUT_ERROR,exports.CONNECTION_ERROR=CONNECTION_ERROR,exports.NETWORK_ERROR=NETWORK_ERROR,exports.UNKNOWN_ERROR=UNKNOWN_ERROR,exports.CANCEL_ERROR=CANCEL_ERROR,exports.getProblemFromError=getProblemFromError,exports.getProblemFromStatus=getProblemFromStatus,exports.create=create,exports.isCancel=isCancel,exports.CancelToken=CancelToken,exports.default=apisauce; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var _partial=_interopDefault(require("ramda/src/partial")),_curry=_interopDefault(require("ramda/src/curry")),_pipeP=_interopDefault(require("ramda/src/pipeP")),_keys=_interopDefault(require("ramda/src/keys")),_forEach=_interopDefault(require("ramda/src/forEach")),_dissoc=_interopDefault(require("ramda/src/dissoc")),_merge=_interopDefault(require("ramda/src/merge")),_prop=_interopDefault(require("ramda/src/prop")),_always=_interopDefault(require("ramda/src/always")),_ifElse=_interopDefault(require("ramda/src/ifElse")),_contains=_interopDefault(require("ramda/src/contains")),_gte=_interopDefault(require("ramda/src/gte")),_curryN=_interopDefault(require("ramda/src/curryN")),_T=_interopDefault(require("ramda/src/T")),_is=_interopDefault(require("ramda/src/is")),_identity=_interopDefault(require("ramda/src/identity")),_isNil=_interopDefault(require("ramda/src/isNil")),_cond=_interopDefault(require("ramda/src/cond")),axios=_interopDefault(require("axios")),__assign=function(){return(__assign=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},__awaiter=function(e,r,t,n){return new(t||(t=Promise))(function(a,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function o(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?a(e.value):new t(function(r){r(e.value)}).then(s,o)}u((n=n.apply(e,r||[])).next())})},__generator=function(e,r){var t,n,a,i,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(i){return function(o){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){s.label=i[1];break}if(6===i[0]&&s.label<a[1]){s.label=a[1],a=i;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(i);break}a[2]&&s.ops.pop(),s.trys.pop();continue}i=r.call(e,s)}catch(e){i=[6,e],n=0}finally{t=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,o])}}},_this=void 0,toNumber=_cond([[_isNil,_identity],[_is(Number),_identity],[_T,function(e){return Number(e)}]]),isWithin=_curryN(3,function(e,r,t){var n=_is(Number);return n(e)&&n(r)&&n(t)&&_gte(t,e)&&_gte(r,t)}),containsText=_curryN(2,function(e,r){return _contains(r,e)}),isPromise=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},DEFAULT_HEADERS={Accept:"application/json","Content-Type":"application/json"},DEFAULT_CONFIG={timeout:0},NONE=null,CLIENT_ERROR="CLIENT_ERROR",SERVER_ERROR="SERVER_ERROR",TIMEOUT_ERROR="TIMEOUT_ERROR",CONNECTION_ERROR="CONNECTION_ERROR",NETWORK_ERROR="NETWORK_ERROR",UNKNOWN_ERROR="UNKNOWN_ERROR",CANCEL_ERROR="CANCEL_ERROR",TIMEOUT_ERROR_CODES=["ECONNABORTED"],NODEJS_CONNECTION_ERROR_CODES=["ENOTFOUND","ECONNREFUSED","ECONNRESET"],in200s=isWithin(200,299),in400s=isWithin(400,499),in500s=isWithin(500,599),statusNil=_ifElse(_isNil,_always(void 0),_prop("status")),getProblemFromError=function(e){return"Network Error"===e.message?NETWORK_ERROR:axios.isCancel(e)?CANCEL_ERROR:_cond([[_isNil,function(){return getProblemFromStatus(statusNil(e.response))}],[containsText(TIMEOUT_ERROR_CODES),_always(TIMEOUT_ERROR)],[containsText(NODEJS_CONNECTION_ERROR_CODES),_always(CONNECTION_ERROR)],[_T,_always(UNKNOWN_ERROR)]])(e.code)},getProblemFromStatus=function(e){return _cond([[_isNil,_always(UNKNOWN_ERROR)],[in200s,_always(NONE)],[in400s,_always(CLIENT_ERROR)],[in500s,_always(SERVER_ERROR)],[_T,_always(UNKNOWN_ERROR)]])(e)},create=function(e){var r,t=_merge(DEFAULT_HEADERS,e.headers||{});if(e.axiosInstance)r=e.axiosInstance;else{var n=_merge(DEFAULT_CONFIG,_dissoc("headers",e));r=axios.create(n)}var a=[],i=[],s=[],o=[],u=[],R=function(e,n){return t[e]=n,r},c=function(e,r,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),l(_merge({url:r,params:t,method:e},n))},_=function(e,r,t,n){return void 0===n&&(n={}),l(_merge({url:r,method:e,data:t},n))},l=function(e){return __awaiter(_this,void 0,void 0,function(){var n,a,o;return __generator(this,function(u){switch(u.label){case 0:if(e.headers=__assign({},t,e.headers),i.length>0&&_forEach(function(r){return r(e)},i),!(s.length>0))return[3,6];n=0,u.label=1;case 1:return n<s.length?(a=s[n](e),isPromise(a)?[4,a]:[3,3]):[3,6];case 2:return u.sent(),[3,5];case 3:return[4,a(e)];case 4:u.sent(),u.label=5;case 5:return n++,[3,1];case 6:return o=_pipeP(O(toNumber(new Date)),E),[2,r.request(e).then(o).catch(o)]}})})},E=function(e){return a.forEach(function(r){try{r(e)}catch(e){}}),e},O=_curry(function(e,r){return __awaiter(_this,void 0,void 0,function(){var t,n,a,i,s,R,c,_,l,E,O,f,N,p,d,T;return __generator(this,function(m){switch(m.label){case 0:if(t=toNumber(new Date),n=t-e,a=r instanceof Error||axios.isCancel(r),i=r,s=r,R=a?s.response:i,c=R&&R.status||null,_=a?getProblemFromError(r):getProblemFromStatus(c),l=a?s:null,E=in200s(c),O=r.config||null,f=R&&R.headers||null,N=R&&R.data||null,p={duration:n,problem:_,originalError:l,ok:E,status:c,headers:f,config:O,data:N},o.length>0&&_forEach(function(e){return e(p)},o),!(u.length>0))return[3,6];d=0,m.label=1;case 1:return d<u.length?(T=u[d](p),isPromise(T)?[4,T]:[3,3]):[3,6];case 2:return m.sent(),[3,5];case 3:return[4,T(p)];case 4:m.sent(),m.label=5;case 5:return d++,[3,1];case 6:return[2,p]}})})});return{axiosInstance:r,monitors:a,addMonitor:function(e){a.push(e)},requestTransforms:i,asyncRequestTransforms:s,responseTransforms:o,asyncResponseTransforms:u,addRequestTransform:function(e){return i.push(e)},addAsyncRequestTransform:function(e){return s.push(e)},addResponseTransform:function(e){return o.push(e)},addAsyncResponseTransform:function(e){return u.push(e)},setHeader:R,setHeaders:function(e){return _forEach(function(r){return R(r,e[r])},_keys(e)),r},deleteHeader:function(e){return delete t[e],r},headers:t,setBaseURL:function(e){return r.defaults.baseURL=e,r},getBaseURL:function(){return r.defaults.baseURL},any:l,get:_partial(c,["get"]),delete:_partial(c,["delete"]),head:_partial(c,["head"]),post:_partial(_,["post"]),put:_partial(_,["put"]),patch:_partial(_,["patch"]),link:_partial(c,["link"]),unlink:_partial(c,["unlink"])}},isCancel=axios.isCancel,CancelToken=axios.CancelToken,apisauce={DEFAULT_HEADERS:DEFAULT_HEADERS,NONE:NONE,CLIENT_ERROR:CLIENT_ERROR,SERVER_ERROR:SERVER_ERROR,TIMEOUT_ERROR:TIMEOUT_ERROR,CONNECTION_ERROR:CONNECTION_ERROR,NETWORK_ERROR:NETWORK_ERROR,UNKNOWN_ERROR:UNKNOWN_ERROR,create:create,isCancel:isCancel,CancelToken:CancelToken};exports.DEFAULT_HEADERS=DEFAULT_HEADERS,exports.NONE=NONE,exports.CLIENT_ERROR=CLIENT_ERROR,exports.SERVER_ERROR=SERVER_ERROR,exports.TIMEOUT_ERROR=TIMEOUT_ERROR,exports.CONNECTION_ERROR=CONNECTION_ERROR,exports.NETWORK_ERROR=NETWORK_ERROR,exports.UNKNOWN_ERROR=UNKNOWN_ERROR,exports.CANCEL_ERROR=CANCEL_ERROR,exports.getProblemFromError=getProblemFromError,exports.getProblemFromStatus=getProblemFromStatus,exports.create=create,exports.isCancel=isCancel,exports.CancelToken=CancelToken,exports.default=apisauce; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],t):t(e.apisauce={},e.axios)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(e,t){var r;e=e||[],t=t||[];var n=e.length,u=t.length,o=[];for(r=0;r<n;)o[o.length]=e[r],r+=1;for(r=0;r<u;)o[o.length]=t[r],r+=1;return o},n=Object.freeze({default:r,__moduleExports:r});var u=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,u){return t.apply(this,arguments)};case 5:return function(e,r,n,u,o){return t.apply(this,arguments)};case 6:return function(e,r,n,u,o,a){return t.apply(this,arguments)};case 7:return function(e,r,n,u,o,a,c){return t.apply(this,arguments)};case 8:return function(e,r,n,u,o,a,c,f){return t.apply(this,arguments)};case 9:return function(e,r,n,u,o,a,c,f,i){return t.apply(this,arguments)};case 10:return function(e,r,n,u,o,a,c,f,i,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}},o=Object.freeze({default:u,__moduleExports:u});var a=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},c=Object.freeze({default:a,__moduleExports:a}),f=c&&a||c;var i=function(e){return function t(r){return 0===arguments.length||f(r)?t:e.apply(this,arguments)}},l=Object.freeze({default:i,__moduleExports:i}),s=l&&i||l;var p=function(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return f(r)?t:s(function(t){return e(r,t)});default:return f(r)&&f(n)?t:f(r)?s(function(t){return e(t,n)}):f(n)?s(function(t){return e(r,t)}):e(r,n)}}},d=Object.freeze({default:p,__moduleExports:p}),h=o&&u||o,y=d&&p||d;var O=function(e){return y(function(t,r){return h(Math.max(0,t.length-r.length),function(){return t.apply(this,e(r,arguments))})})},E=Object.freeze({default:O,__moduleExports:O}),R=(E&&O||E)(n&&r||n);var _=function e(t,r,n){return function(){for(var u=[],o=0,a=t,c=0;c<r.length||o<arguments.length;){var i;c<r.length&&(!f(r[c])||o>=arguments.length)?i=r[c]:(i=arguments[o],o+=1),u[c]=i,f(i)||(a-=1),c+=1}return a<=0?n.apply(this,u):h(a,e(t,u,n))}},b=Object.freeze({default:_,__moduleExports:_}),g=b&&_||b,m=y(function(e,t){return 1===e?s(t):h(e,g(e,[],t))}),v=Object.freeze({default:m,__moduleExports:m}),j=v&&m||v,x=s(function(e){return j(e.length,e)});var N=function(e,t){return function(){var r=this;return e.apply(r,arguments).then(function(e){return t.call(r,e)})}},z=Object.freeze({default:N,__moduleExports:N});var T=function(e){return function t(r,n,u){switch(arguments.length){case 0:return t;case 1:return f(r)?t:y(function(t,n){return e(r,t,n)});case 2:return f(r)&&f(n)?t:f(r)?y(function(t,r){return e(t,n,r)}):f(n)?y(function(t,n){return e(r,t,n)}):s(function(t){return e(r,n,t)});default:return f(r)&&f(n)&&f(u)?t:f(r)&&f(n)?y(function(t,r){return e(t,r,u)}):f(r)&&f(u)?y(function(t,r){return e(t,n,r)}):f(n)&&f(u)?y(function(t,n){return e(r,t,n)}):f(r)?s(function(t){return e(t,n,u)}):f(n)?s(function(t){return e(r,t,u)}):f(u)?s(function(t){return e(r,n,t)}):e(r,n,u)}}},w=Object.freeze({default:T,__moduleExports:T}),C=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},A=Object.freeze({default:C,__moduleExports:C});var S=function(e){return"[object String]"===Object.prototype.toString.call(e)},U=Object.freeze({default:S,__moduleExports:S}),I=A&&C||A,k=U&&S||U,q=s(function(e){return!!I(e)||!!e&&("object"==typeof e&&(!k(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))}),L=Object.freeze({default:q,__moduleExports:q}),P=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var W=function(e){return new P(e)},K=Object.freeze({default:W,__moduleExports:W}),D=y(function(e,t){return h(e.length,function(){return e.apply(t,arguments)})}),F=Object.freeze({default:D,__moduleExports:D}),M=L&&q||L,B=K&&W||K,H=F&&D||F;function V(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function G(e,t,r,n){return e["@@transducer/result"](r[n](H(e["@@transducer/step"],e),t))}var X="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";var J=function(e,t,r){if("function"==typeof e&&(e=B(e)),M(r))return function(e,t,r){for(var n=0,u=r.length;n<u;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}(e,t,r);if("function"==typeof r["fantasy-land/reduce"])return G(e,t,r,"fantasy-land/reduce");if(null!=r[X])return V(e,t,r[X]());if("function"==typeof r.next)return V(e,t,r);if("function"==typeof r.reduce)return G(e,t,r,"reduce");throw new TypeError("reduce: list must be array or iterable")},Q=Object.freeze({default:J,__moduleExports:J}),Y=w&&T||w,Z=Q&&J||Q,$=Y(Z),ee=Object.freeze({default:$,__moduleExports:$});var te=function(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return I(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}},re=Object.freeze({default:te,__moduleExports:te}),ne=re&&te||re,ue=Y(ne("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)})),oe=Object.freeze({default:ue,__moduleExports:ue}),ae=s(ne("tail",(oe&&ue||oe)(1,1/0))),ce=Object.freeze({default:ae,__moduleExports:ae}),fe=z&&N||z,ie=ee&&$||ee,le=ce&&ae||ce;var se=function(){if(0===arguments.length)throw new Error("pipeP requires at least one argument");return h(arguments[0].length,ie(fe,arguments[0],le(arguments)))};var pe=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},de=Object.freeze({default:pe,__moduleExports:pe}),he=de&&pe||de,ye=Object.prototype.toString,Oe=function(){return"[object Arguments]"===ye.call(arguments)?function(e){return"[object Arguments]"===ye.call(e)}:function(e){return he("callee",e)}},Ee=Object.freeze({default:Oe,__moduleExports:Oe}),Re=Ee&&Oe||Ee,_e=!{toString:null}.propertyIsEnumerable("toString"),be=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ge=function(){return arguments.propertyIsEnumerable("length")}(),me=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},ve="function"!=typeof Object.keys||ge?function(e){if(Object(e)!==e)return[];var t,r,n=[],u=ge&&Re(e);for(t in e)!he(t,e)||u&&"length"===t||(n[n.length]=t);if(_e)for(r=be.length-1;r>=0;)he(t=be[r],e)&&!me(n,t)&&(n[n.length]=t),r-=1;return n}:function(e){return Object(e)!==e?[]:Object.keys(e)},je=s(ve),xe=y(ne("forEach",function(e,t){for(var r=t.length,n=0;n<r;)e(t[n]),n+=1;return t})),Ne=y(function(e,t){var r={};for(var n in t)r[n]=t[n];return delete r[e],r});var ze=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,n=arguments.length;r<n;){var u=arguments[r];if(null!=u)for(var o in u)he(o,u)&&(t[o]=u[o]);r+=1}return t},Te=Object.freeze({default:ze,__moduleExports:ze}),we=Te&&ze||Te,Ce="function"==typeof Object.assign?Object.assign:we,Ae=Object.freeze({default:Ce,__moduleExports:Ce}),Se=Ae&&Ce||Ae,Ue=y(function(e,t){return Se({},e,t)}),Ie=y(function(e,t){for(var r=t,n=0;n<e.length;){if(null==r)return;r=r[e[n]],n+=1}return r}),ke=Object.freeze({default:Ie,__moduleExports:Ie}),qe=ke&&Ie||ke,Le=y(function(e,t){return qe([e],t)}),Pe=s(function(e){return function(){return e}}),We=Y(function(e,t,r){return j(Math.max(e.length,t.length,r.length),function(){return e.apply(this,arguments)?t.apply(this,arguments):r.apply(this,arguments)})});var Ke=function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r},De=Object.freeze({default:Ke,__moduleExports:Ke});var Fe=function(e,t,r){for(var n=0,u=r.length;n<u;){if(e(t,r[n]))return!0;n+=1}return!1},Me=Object.freeze({default:Fe,__moduleExports:Fe});var Be=function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]},He=Object.freeze({default:Be,__moduleExports:Be}),Ve=y(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),Ge=Object.freeze({default:Ve,__moduleExports:Ve}),Xe=s(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),Je=Object.freeze({default:Xe,__moduleExports:Xe}),Qe=De&&Ke||De,Ye=Me&&Fe||Me,Ze=He&&Be||He,$e=Ge&&Ve||Ge,et=Je&&Xe||Je;function tt(e,t,r,n){var u=Qe(e),o=Qe(t);function a(e,t){return rt(e,t,r.slice(),n.slice())}return!Ye(function(e,t){return!Ye(a,t,e)},o,u)}function rt(e,t,r,n){if($e(e,t))return!0;var u=et(e);if(u!==et(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===Ze(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!$e(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!$e(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var o=r.length-1;o>=0;){if(r[o]===e)return n[o]===t;o-=1}switch(u){case"Map":return e.size===t.size&&tt(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&tt(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=je(e);if(a.length!==je(t).length)return!1;var c=r.concat([e]),f=n.concat([t]);for(o=a.length-1;o>=0;){var i=a[o];if(!he(i,t)||!rt(t[i],e[i],c,f))return!1;o-=1}return!0}var nt=rt,ut=Object.freeze({default:nt,__moduleExports:nt}),ot=ut&&nt||ut,at=y(function(e,t){return ot(e,t,[],[])}),ct=Object.freeze({default:at,__moduleExports:at}),ft=ct&&at||ct;var it=function(e,t,r){var n,u;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r<e.length;){if(0===(u=e[r])&&1/u===n)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(u=e[r])&&u!=u)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(ft(e[r],t))return r;r+=1}return-1},lt=Object.freeze({default:it,__moduleExports:it}),st=lt&&it||lt;var pt=function(e,t){return st(t,e,0)>=0},dt=Object.freeze({default:pt,__moduleExports:pt}),ht=y(dt&&pt||dt),yt=y(function(e,t){return e>=t}),Ot=Pe(!0),Et=y(function(e,t){return null!=t&&t.constructor===e||t instanceof e});var Rt=function(e){return e},_t=Object.freeze({default:Rt,__moduleExports:Rt}),bt=s(_t&&Rt||_t),gt=s(function(e){return null==e});var mt=function(e){return"function"==typeof e["@@transducer/step"]},vt=Object.freeze({default:mt,__moduleExports:mt}),jt=vt&&mt||vt;var xt=function(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),u=n.pop();if(!I(u)){for(var o=0;o<e.length;){if("function"==typeof u[e[o]])return u[e[o]].apply(u,n);o+=1}if(jt(u))return t.apply(null,n)(u)}return r.apply(this,arguments)}},Nt=Object.freeze({default:xt,__moduleExports:xt});var zt=function(e,t){for(var r=0,n=t.length,u=Array(n);r<n;)u[r]=e(t[r]),r+=1;return u},Tt=Object.freeze({default:zt,__moduleExports:zt}),wt={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}},Ct=wt.init,At=wt.result,St=Object.freeze({default:wt,__moduleExports:wt,init:Ct,result:At}),Ut=St&&wt||St,It=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Ut.init,e.prototype["@@transducer/result"]=Ut.result,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}(),kt=y(function(e,t){return new It(e,t)}),qt=Object.freeze({default:kt,__moduleExports:kt}),Lt=Tt&&zt||Tt,Pt=y((Nt&&xt||Nt)(["fantasy-land/map","map"],qt&&kt||qt,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return j(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Z(function(r,n){return r[n]=e(t[n]),r},{},je(t));default:return Lt(e,t)}})),Wt=Object.freeze({default:Pt,__moduleExports:Pt}),Kt=y(function(e,t){return t>e?t:e}),Dt=Object.freeze({default:Kt,__moduleExports:Kt}),Ft=Wt&&Pt||Wt,Mt=Dt&&Kt||Dt,Bt=s(function(e){var t=ie(Mt,0,Ft(function(e){return e[0].length},e));return h(t,function(){for(var t=0;t<e.length;){if(e[t][0].apply(this,arguments))return e[t][1].apply(this,arguments);t+=1}})}),Ht=function(){return(Ht=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)},Vt=function(e,t,r,n){return new(r||(r=Promise))(function(u,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function c(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){e.done?u(e.value):new r(function(t){t(e.value)}).then(a,c)}f((n=n.apply(e,t||[])).next())})},Gt=function(e,t){var r,n,u,o,a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(u=2&o[0]?n.return:o[0]?n.throw||((u=n.return)&&u.call(n),0):n.next)&&!(u=u.call(n,o[1])).done)return u;switch(n=0,u&&(o=[2&o[0],u.value]),o[0]){case 0:case 1:u=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(u=(u=a.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]<u[3])){a.label=o[1];break}if(6===o[0]&&a.label<u[1]){a.label=u[1],u=o;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(o);break}u[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=u=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Xt=Bt([[gt,bt],[Et(Number),bt],[Ot,function(e){return Number(e)}]]),Jt=m(3,function(e,t,r){var n=Et(Number);return n(e)&&n(t)&&n(r)&&yt(r,e)&&yt(t,r)}),Qt=m(2,function(e,t){return ht(t,e)}),Yt=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},Zt={Accept:"application/json","Content-Type":"application/json"},$t={timeout:0},er=["ECONNABORTED"],tr=["ENOTFOUND","ECONNREFUSED","ECONNRESET"],rr=Jt(200,299),nr=Jt(400,499),ur=Jt(500,599),or=We(gt,Pe(void 0),Le("status")),ar=function(e){return"Network Error"===e.message?"NETWORK_ERROR":t.isCancel(e)?"CANCEL_ERROR":Bt([[gt,function(){return cr(or(e.response))}],[Qt(er),Pe("TIMEOUT_ERROR")],[Qt(tr),Pe("CONNECTION_ERROR")],[Ot,Pe("UNKNOWN_ERROR")]])(e.code)},cr=function(e){return Bt([[gt,Pe("UNKNOWN_ERROR")],[rr,Pe(null)],[nr,Pe("CLIENT_ERROR")],[ur,Pe("SERVER_ERROR")],[Ot,Pe("UNKNOWN_ERROR")]])(e)},fr=function(e){var r,n=Ue(Zt,e.headers||{});if(e.axiosInstance)r=e.axiosInstance;else{var u=Ue($t,Ne("headers",e));r=t.create(u)}var o=[],a=[],c=[],f=[],i=[],l=function(e,t){return n[e]=t,r},s=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),d(Ue({url:t,params:r,method:e},n))},p=function(e,t,r,n){return void 0===r&&(r=null),void 0===n&&(n={}),d(Ue({url:t,method:e,data:r},n))},d=function(e){return Vt(void 0,void 0,void 0,function(){var t,u,o;return Gt(this,function(f){switch(f.label){case 0:if(e.headers=Ht({},n,e.headers),a.length>0&&xe(function(t){return t(e)},a),!(c.length>0))return[3,6];t=0,f.label=1;case 1:return t<c.length?(u=c[t](e),Yt(u)?[4,u]:[3,3]):[3,6];case 2:return f.sent(),[3,5];case 3:return[4,u(e)];case 4:f.sent(),f.label=5;case 5:return t++,[3,1];case 6:return o=se(y(Xt(new Date)),h),[2,r.request(e).then(o).catch(o)]}})})},h=function(e){return o.forEach(function(t){try{t(e)}catch(e){}}),e},y=x(function(e,r){return Vt(void 0,void 0,void 0,function(){var n,u,o,a,c,l,s,p,d,h,y,O,E,R,_,b;return Gt(this,function(g){switch(g.label){case 0:if(n=Xt(new Date),u=n-e,o=r instanceof Error||t.isCancel(r),a=r,c=r,l=o?c.response:a,s=l&&l.status||null,p=o?ar(r):cr(s),d=o?c:null,h=rr(s),y=r.config||null,O=l&&l.headers||null,E=l&&l.data||null,R={duration:u,problem:p,originalError:d,ok:h,status:s,headers:O,config:y,data:E},f.length>0&&xe(function(e){return e(R)},f),!(i.length>0))return[3,6];_=0,g.label=1;case 1:return _<i.length?(b=i[_](R),Yt(b)?[4,b]:[3,3]):[3,6];case 2:return g.sent(),[3,5];case 3:return[4,b(R)];case 4:g.sent(),g.label=5;case 5:return _++,[3,1];case 6:return[2,R]}})})});return{axiosInstance:r,monitors:o,addMonitor:function(e){o.push(e)},requestTransforms:a,asyncRequestTransforms:c,responseTransforms:f,asyncResponseTransforms:i,addRequestTransform:function(e){return a.push(e)},addAsyncRequestTransform:function(e){return c.push(e)},addResponseTransform:function(e){return f.push(e)},addAsyncResponseTransform:function(e){return i.push(e)},setHeader:l,setHeaders:function(e){return xe(function(t){return l(t,e[t])},je(e)),r},deleteHeader:function(e){return delete n[e],r},headers:n,setBaseURL:function(e){return r.defaults.baseURL=e,r},getBaseURL:function(){return r.defaults.baseURL},any:d,get:R(s,["get"]),delete:R(s,["delete"]),head:R(s,["head"]),post:R(p,["post"]),put:R(p,["put"]),patch:R(p,["patch"]),link:R(s,["link"]),unlink:R(s,["unlink"])}},ir=t.isCancel,lr=t.CancelToken,sr={DEFAULT_HEADERS:Zt,NONE:null,CLIENT_ERROR:"CLIENT_ERROR",SERVER_ERROR:"SERVER_ERROR",TIMEOUT_ERROR:"TIMEOUT_ERROR",CONNECTION_ERROR:"CONNECTION_ERROR",NETWORK_ERROR:"NETWORK_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR",create:fr,isCancel:ir,CancelToken:lr};e.DEFAULT_HEADERS=Zt,e.NONE=null,e.CLIENT_ERROR="CLIENT_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT_ERROR="TIMEOUT_ERROR",e.CONNECTION_ERROR="CONNECTION_ERROR",e.NETWORK_ERROR="NETWORK_ERROR",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.CANCEL_ERROR="CANCEL_ERROR",e.getProblemFromError=ar,e.getProblemFromStatus=cr,e.create=fr,e.isCancel=ir,e.CancelToken=lr,e.default=sr,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],t):t(e.apisauce={},e.axios)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(e,t){var r;e=e||[],t=t||[];var n=e.length,u=t.length,o=[];for(r=0;r<n;)o[o.length]=e[r],r+=1;for(r=0;r<u;)o[o.length]=t[r],r+=1;return o},n=Object.freeze({default:r,__moduleExports:r});var u=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,u){return t.apply(this,arguments)};case 5:return function(e,r,n,u,o){return t.apply(this,arguments)};case 6:return function(e,r,n,u,o,a){return t.apply(this,arguments)};case 7:return function(e,r,n,u,o,a,c){return t.apply(this,arguments)};case 8:return function(e,r,n,u,o,a,c,f){return t.apply(this,arguments)};case 9:return function(e,r,n,u,o,a,c,f,i){return t.apply(this,arguments)};case 10:return function(e,r,n,u,o,a,c,f,i,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}},o=Object.freeze({default:u,__moduleExports:u});var a=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},c=Object.freeze({default:a,__moduleExports:a}),f=c&&a||c;var i=function(e){return function t(r){return 0===arguments.length||f(r)?t:e.apply(this,arguments)}},l=Object.freeze({default:i,__moduleExports:i}),s=l&&i||l;var p=function(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return f(r)?t:s(function(t){return e(r,t)});default:return f(r)&&f(n)?t:f(r)?s(function(t){return e(t,n)}):f(n)?s(function(t){return e(r,t)}):e(r,n)}}},d=Object.freeze({default:p,__moduleExports:p}),h=o&&u||o,y=d&&p||d;var O=function(e){return y(function(t,r){return h(Math.max(0,t.length-r.length),function(){return t.apply(this,e(r,arguments))})})},E=Object.freeze({default:O,__moduleExports:O}),R=(E&&O||E)(n&&r||n);var _=function e(t,r,n){return function(){for(var u=[],o=0,a=t,c=0;c<r.length||o<arguments.length;){var i;c<r.length&&(!f(r[c])||o>=arguments.length)?i=r[c]:(i=arguments[o],o+=1),u[c]=i,f(i)||(a-=1),c+=1}return a<=0?n.apply(this,u):h(a,e(t,u,n))}},b=Object.freeze({default:_,__moduleExports:_}),g=b&&_||b,m=y(function(e,t){return 1===e?s(t):h(e,g(e,[],t))}),v=Object.freeze({default:m,__moduleExports:m}),j=v&&m||v,x=s(function(e){return j(e.length,e)});var N=function(e,t){return function(){var r=this;return e.apply(r,arguments).then(function(e){return t.call(r,e)})}},z=Object.freeze({default:N,__moduleExports:N});var T=function(e){return function t(r,n,u){switch(arguments.length){case 0:return t;case 1:return f(r)?t:y(function(t,n){return e(r,t,n)});case 2:return f(r)&&f(n)?t:f(r)?y(function(t,r){return e(t,n,r)}):f(n)?y(function(t,n){return e(r,t,n)}):s(function(t){return e(r,n,t)});default:return f(r)&&f(n)&&f(u)?t:f(r)&&f(n)?y(function(t,r){return e(t,r,u)}):f(r)&&f(u)?y(function(t,r){return e(t,n,r)}):f(n)&&f(u)?y(function(t,n){return e(r,t,n)}):f(r)?s(function(t){return e(t,n,u)}):f(n)?s(function(t){return e(r,t,u)}):f(u)?s(function(t){return e(r,n,t)}):e(r,n,u)}}},w=Object.freeze({default:T,__moduleExports:T}),C=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},A=Object.freeze({default:C,__moduleExports:C});var S=function(e){return"[object String]"===Object.prototype.toString.call(e)},U=Object.freeze({default:S,__moduleExports:S}),I=A&&C||A,k=U&&S||U,q=s(function(e){return!!I(e)||!!e&&("object"==typeof e&&(!k(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))}),L=Object.freeze({default:q,__moduleExports:q}),P=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var W=function(e){return new P(e)},K=Object.freeze({default:W,__moduleExports:W}),D=y(function(e,t){return h(e.length,function(){return e.apply(t,arguments)})}),F=Object.freeze({default:D,__moduleExports:D}),M=L&&q||L,B=K&&W||K,H=F&&D||F;function V(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function G(e,t,r,n){return e["@@transducer/result"](r[n](H(e["@@transducer/step"],e),t))}var X="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";var J=function(e,t,r){if("function"==typeof e&&(e=B(e)),M(r))return function(e,t,r){for(var n=0,u=r.length;n<u;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}(e,t,r);if("function"==typeof r["fantasy-land/reduce"])return G(e,t,r,"fantasy-land/reduce");if(null!=r[X])return V(e,t,r[X]());if("function"==typeof r.next)return V(e,t,r);if("function"==typeof r.reduce)return G(e,t,r,"reduce");throw new TypeError("reduce: list must be array or iterable")},Q=Object.freeze({default:J,__moduleExports:J}),Y=w&&T||w,Z=Q&&J||Q,$=Y(Z),ee=Object.freeze({default:$,__moduleExports:$});var te=function(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return I(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}},re=Object.freeze({default:te,__moduleExports:te}),ne=re&&te||re,ue=Y(ne("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)})),oe=Object.freeze({default:ue,__moduleExports:ue}),ae=s(ne("tail",(oe&&ue||oe)(1,1/0))),ce=Object.freeze({default:ae,__moduleExports:ae}),fe=z&&N||z,ie=ee&&$||ee,le=ce&&ae||ce;var se=function(){if(0===arguments.length)throw new Error("pipeP requires at least one argument");return h(arguments[0].length,ie(fe,arguments[0],le(arguments)))};var pe=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},de=Object.freeze({default:pe,__moduleExports:pe}),he=de&&pe||de,ye=Object.prototype.toString,Oe=function(){return"[object Arguments]"===ye.call(arguments)?function(e){return"[object Arguments]"===ye.call(e)}:function(e){return he("callee",e)}},Ee=Object.freeze({default:Oe,__moduleExports:Oe}),Re=Ee&&Oe||Ee,_e=!{toString:null}.propertyIsEnumerable("toString"),be=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ge=function(){return arguments.propertyIsEnumerable("length")}(),me=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},ve="function"!=typeof Object.keys||ge?function(e){if(Object(e)!==e)return[];var t,r,n=[],u=ge&&Re(e);for(t in e)!he(t,e)||u&&"length"===t||(n[n.length]=t);if(_e)for(r=be.length-1;r>=0;)he(t=be[r],e)&&!me(n,t)&&(n[n.length]=t),r-=1;return n}:function(e){return Object(e)!==e?[]:Object.keys(e)},je=s(ve),xe=y(ne("forEach",function(e,t){for(var r=t.length,n=0;n<r;)e(t[n]),n+=1;return t})),Ne=y(function(e,t){var r={};for(var n in t)r[n]=t[n];return delete r[e],r});var ze=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,n=arguments.length;r<n;){var u=arguments[r];if(null!=u)for(var o in u)he(o,u)&&(t[o]=u[o]);r+=1}return t},Te=Object.freeze({default:ze,__moduleExports:ze}),we=Te&&ze||Te,Ce="function"==typeof Object.assign?Object.assign:we,Ae=Object.freeze({default:Ce,__moduleExports:Ce}),Se=Ae&&Ce||Ae,Ue=y(function(e,t){return Se({},e,t)}),Ie=y(function(e,t){for(var r=t,n=0;n<e.length;){if(null==r)return;r=r[e[n]],n+=1}return r}),ke=Object.freeze({default:Ie,__moduleExports:Ie}),qe=ke&&Ie||ke,Le=y(function(e,t){return qe([e],t)}),Pe=s(function(e){return function(){return e}}),We=Y(function(e,t,r){return j(Math.max(e.length,t.length,r.length),function(){return e.apply(this,arguments)?t.apply(this,arguments):r.apply(this,arguments)})});var Ke=function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r},De=Object.freeze({default:Ke,__moduleExports:Ke});var Fe=function(e,t,r){for(var n=0,u=r.length;n<u;){if(e(t,r[n]))return!0;n+=1}return!1},Me=Object.freeze({default:Fe,__moduleExports:Fe});var Be=function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]},He=Object.freeze({default:Be,__moduleExports:Be}),Ve=y(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),Ge=Object.freeze({default:Ve,__moduleExports:Ve}),Xe=s(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),Je=Object.freeze({default:Xe,__moduleExports:Xe}),Qe=De&&Ke||De,Ye=Me&&Fe||Me,Ze=He&&Be||He,$e=Ge&&Ve||Ge,et=Je&&Xe||Je;function tt(e,t,r,n){var u=Qe(e),o=Qe(t);function a(e,t){return rt(e,t,r.slice(),n.slice())}return!Ye(function(e,t){return!Ye(a,t,e)},o,u)}function rt(e,t,r,n){if($e(e,t))return!0;var u=et(e);if(u!==et(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===Ze(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!$e(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!$e(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var o=r.length-1;o>=0;){if(r[o]===e)return n[o]===t;o-=1}switch(u){case"Map":return e.size===t.size&&tt(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&tt(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=je(e);if(a.length!==je(t).length)return!1;var c=r.concat([e]),f=n.concat([t]);for(o=a.length-1;o>=0;){var i=a[o];if(!he(i,t)||!rt(t[i],e[i],c,f))return!1;o-=1}return!0}var nt=rt,ut=Object.freeze({default:nt,__moduleExports:nt}),ot=ut&&nt||ut,at=y(function(e,t){return ot(e,t,[],[])}),ct=Object.freeze({default:at,__moduleExports:at}),ft=ct&&at||ct;var it=function(e,t,r){var n,u;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r<e.length;){if(0===(u=e[r])&&1/u===n)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(u=e[r])&&u!=u)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(ft(e[r],t))return r;r+=1}return-1},lt=Object.freeze({default:it,__moduleExports:it}),st=lt&&it||lt;var pt=function(e,t){return st(t,e,0)>=0},dt=Object.freeze({default:pt,__moduleExports:pt}),ht=y(dt&&pt||dt),yt=y(function(e,t){return e>=t}),Ot=Pe(!0),Et=y(function(e,t){return null!=t&&t.constructor===e||t instanceof e});var Rt=function(e){return e},_t=Object.freeze({default:Rt,__moduleExports:Rt}),bt=s(_t&&Rt||_t),gt=s(function(e){return null==e});var mt=function(e){return"function"==typeof e["@@transducer/step"]},vt=Object.freeze({default:mt,__moduleExports:mt}),jt=vt&&mt||vt;var xt=function(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),u=n.pop();if(!I(u)){for(var o=0;o<e.length;){if("function"==typeof u[e[o]])return u[e[o]].apply(u,n);o+=1}if(jt(u))return t.apply(null,n)(u)}return r.apply(this,arguments)}},Nt=Object.freeze({default:xt,__moduleExports:xt});var zt=function(e,t){for(var r=0,n=t.length,u=Array(n);r<n;)u[r]=e(t[r]),r+=1;return u},Tt=Object.freeze({default:zt,__moduleExports:zt}),wt={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}},Ct=wt.init,At=wt.result,St=Object.freeze({default:wt,__moduleExports:wt,init:Ct,result:At}),Ut=St&&wt||St,It=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=Ut.init,e.prototype["@@transducer/result"]=Ut.result,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}(),kt=y(function(e,t){return new It(e,t)}),qt=Object.freeze({default:kt,__moduleExports:kt}),Lt=Tt&&zt||Tt,Pt=y((Nt&&xt||Nt)(["fantasy-land/map","map"],qt&&kt||qt,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return j(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Z(function(r,n){return r[n]=e(t[n]),r},{},je(t));default:return Lt(e,t)}})),Wt=Object.freeze({default:Pt,__moduleExports:Pt}),Kt=y(function(e,t){return t>e?t:e}),Dt=Object.freeze({default:Kt,__moduleExports:Kt}),Ft=Wt&&Pt||Wt,Mt=Dt&&Kt||Dt,Bt=s(function(e){var t=ie(Mt,0,Ft(function(e){return e[0].length},e));return h(t,function(){for(var t=0;t<e.length;){if(e[t][0].apply(this,arguments))return e[t][1].apply(this,arguments);t+=1}})}),Ht=function(){return(Ht=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)},Vt=function(e,t,r,n){return new(r||(r=Promise))(function(u,o){function a(e){try{f(n.next(e))}catch(e){o(e)}}function c(e){try{f(n.throw(e))}catch(e){o(e)}}function f(e){e.done?u(e.value):new r(function(t){t(e.value)}).then(a,c)}f((n=n.apply(e,t||[])).next())})},Gt=function(e,t){var r,n,u,o,a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(u=2&o[0]?n.return:o[0]?n.throw||((u=n.return)&&u.call(n),0):n.next)&&!(u=u.call(n,o[1])).done)return u;switch(n=0,u&&(o=[2&o[0],u.value]),o[0]){case 0:case 1:u=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(u=(u=a.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]<u[3])){a.label=o[1];break}if(6===o[0]&&a.label<u[1]){a.label=u[1],u=o;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(o);break}u[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=u=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Xt=Bt([[gt,bt],[Et(Number),bt],[Ot,function(e){return Number(e)}]]),Jt=m(3,function(e,t,r){var n=Et(Number);return n(e)&&n(t)&&n(r)&&yt(r,e)&&yt(t,r)}),Qt=m(2,function(e,t){return ht(t,e)}),Yt=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},Zt={Accept:"application/json","Content-Type":"application/json"},$t={timeout:0},er=["ECONNABORTED"],tr=["ENOTFOUND","ECONNREFUSED","ECONNRESET"],rr=Jt(200,299),nr=Jt(400,499),ur=Jt(500,599),or=We(gt,Pe(void 0),Le("status")),ar=function(e){return"Network Error"===e.message?"NETWORK_ERROR":t.isCancel(e)?"CANCEL_ERROR":Bt([[gt,function(){return cr(or(e.response))}],[Qt(er),Pe("TIMEOUT_ERROR")],[Qt(tr),Pe("CONNECTION_ERROR")],[Ot,Pe("UNKNOWN_ERROR")]])(e.code)},cr=function(e){return Bt([[gt,Pe("UNKNOWN_ERROR")],[rr,Pe(null)],[nr,Pe("CLIENT_ERROR")],[ur,Pe("SERVER_ERROR")],[Ot,Pe("UNKNOWN_ERROR")]])(e)},fr=function(e){var r,n=Ue(Zt,e.headers||{});if(e.axiosInstance)r=e.axiosInstance;else{var u=Ue($t,Ne("headers",e));r=t.create(u)}var o=[],a=[],c=[],f=[],i=[],l=function(e,t){return n[e]=t,r},s=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),d(Ue({url:t,params:r,method:e},n))},p=function(e,t,r,n){return void 0===n&&(n={}),d(Ue({url:t,method:e,data:r},n))},d=function(e){return Vt(void 0,void 0,void 0,function(){var t,u,o;return Gt(this,function(f){switch(f.label){case 0:if(e.headers=Ht({},n,e.headers),a.length>0&&xe(function(t){return t(e)},a),!(c.length>0))return[3,6];t=0,f.label=1;case 1:return t<c.length?(u=c[t](e),Yt(u)?[4,u]:[3,3]):[3,6];case 2:return f.sent(),[3,5];case 3:return[4,u(e)];case 4:f.sent(),f.label=5;case 5:return t++,[3,1];case 6:return o=se(y(Xt(new Date)),h),[2,r.request(e).then(o).catch(o)]}})})},h=function(e){return o.forEach(function(t){try{t(e)}catch(e){}}),e},y=x(function(e,r){return Vt(void 0,void 0,void 0,function(){var n,u,o,a,c,l,s,p,d,h,y,O,E,R,_,b;return Gt(this,function(g){switch(g.label){case 0:if(n=Xt(new Date),u=n-e,o=r instanceof Error||t.isCancel(r),a=r,c=r,l=o?c.response:a,s=l&&l.status||null,p=o?ar(r):cr(s),d=o?c:null,h=rr(s),y=r.config||null,O=l&&l.headers||null,E=l&&l.data||null,R={duration:u,problem:p,originalError:d,ok:h,status:s,headers:O,config:y,data:E},f.length>0&&xe(function(e){return e(R)},f),!(i.length>0))return[3,6];_=0,g.label=1;case 1:return _<i.length?(b=i[_](R),Yt(b)?[4,b]:[3,3]):[3,6];case 2:return g.sent(),[3,5];case 3:return[4,b(R)];case 4:g.sent(),g.label=5;case 5:return _++,[3,1];case 6:return[2,R]}})})});return{axiosInstance:r,monitors:o,addMonitor:function(e){o.push(e)},requestTransforms:a,asyncRequestTransforms:c,responseTransforms:f,asyncResponseTransforms:i,addRequestTransform:function(e){return a.push(e)},addAsyncRequestTransform:function(e){return c.push(e)},addResponseTransform:function(e){return f.push(e)},addAsyncResponseTransform:function(e){return i.push(e)},setHeader:l,setHeaders:function(e){return xe(function(t){return l(t,e[t])},je(e)),r},deleteHeader:function(e){return delete n[e],r},headers:n,setBaseURL:function(e){return r.defaults.baseURL=e,r},getBaseURL:function(){return r.defaults.baseURL},any:d,get:R(s,["get"]),delete:R(s,["delete"]),head:R(s,["head"]),post:R(p,["post"]),put:R(p,["put"]),patch:R(p,["patch"]),link:R(s,["link"]),unlink:R(s,["unlink"])}},ir=t.isCancel,lr=t.CancelToken,sr={DEFAULT_HEADERS:Zt,NONE:null,CLIENT_ERROR:"CLIENT_ERROR",SERVER_ERROR:"SERVER_ERROR",TIMEOUT_ERROR:"TIMEOUT_ERROR",CONNECTION_ERROR:"CONNECTION_ERROR",NETWORK_ERROR:"NETWORK_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR",create:fr,isCancel:ir,CancelToken:lr};e.DEFAULT_HEADERS=Zt,e.NONE=null,e.CLIENT_ERROR="CLIENT_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT_ERROR="TIMEOUT_ERROR",e.CONNECTION_ERROR="CONNECTION_ERROR",e.NETWORK_ERROR="NETWORK_ERROR",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.CANCEL_ERROR="CANCEL_ERROR",e.getProblemFromError=ar,e.getProblemFromStatus=cr,e.create=fr,e.isCancel=ir,e.CancelToken=lr,e.default=sr,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"author": "Steve Kellock <steve@kellock.ca>", | ||
@@ -10,3 +10,3 @@ "ava": { | ||
"dependencies": { | ||
"axios": "^0.21.1", | ||
"axios": "^0.21.4", | ||
"ramda": "^0.25.0" | ||
@@ -13,0 +13,0 @@ }, |
@@ -335,2 +335,15 @@ # Apisauce | ||
# Cancel Request | ||
```js | ||
import {CancelToken} from 'apisauce' | ||
const source = CancelToken.source() | ||
const api = create({ baseURL: 'github.com' }) | ||
api.get('/users', {}, { cancelToken: source.token }) | ||
// To cancel request | ||
source.cancel() | ||
``` | ||
# Problem Codes | ||
@@ -337,0 +350,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46023
372
1
Updatedaxios@^0.21.4